Elin Modding Docs Doc
Loading...
Searching...
No Matches
TraitDeedRelocate.cs
1using System;
2using System.Collections.Generic;
3
4// Token: 0x02000371 RID: 881
6{
7 // Token: 0x170007F8 RID: 2040
8 // (get) Token: 0x06001B1D RID: 6941 RVA: 0x000A72FD File Offset: 0x000A54FD
9 public override bool CanBeDestroyed
10 {
11 get
12 {
13 return false;
14 }
15 }
16
17 // Token: 0x06001B1E RID: 6942 RVA: 0x000A7300 File Offset: 0x000A5500
18 public override void OnRead(Chara c)
19 {
20 if (!EClass._zone.IsRegion)
21 {
22 Msg.Say("globalmap_item");
23 return;
24 }
25 EloMap.Cell cell = EClass.scene.elomap.GetCell(EClass.pc.pos);
26 if (cell == null || (cell.zone != null && (!(cell.zone is Zone_Field) || cell.zone.IsPCFaction)))
27 {
28 Msg.Say("cannot_use_here");
29 return;
30 }
31 List<FactionBranch> list = EClass.pc.faction.GetChildren();
32 EClass.ui.AddLayer<LayerList>().SetNoSound().SetList<FactionBranch>(list, (FactionBranch b) => b.owner.NameWithLevel, delegate(int a, string s)
33 {
34 Zone z = list[a].owner;
35 Dialog.YesNo("dialog_relocateLand", delegate
36 {
37 if (cell.zone != null)
38 {
39 cell.zone.Destroy();
40 }
41 EClass.game.Save(false, null, false);
42 EClass.Sound.Play("jingle_embark");
43 EClass.pc.PlaySound("build", 1f, true);
44 this.owner.ModNum(-1, true);
45 EClass.scene.elomap.SetZone(z.x, z.y, null, false);
46 Point point = EClass.pc.pos.ToRegionPos();
47 z.x = point.x;
48 z.y = point.z;
49 EClass.scene.elomap.SetZone(z.x, z.y, z, true);
50 Msg.Say("base_relocate", z.Name, null, null, null);
51 }, null, "yes", "no");
52 }, true).TryShowHint("h_relocate");
53 }
54}
Definition Chara.cs:12
Definition Msg.cs:7
Definition Point.cs:11
Definition Zone.cs:14