Elin Modding Docs Doc
Loading...
Searching...
No Matches
Expedition.cs
1using System;
2using Newtonsoft.Json;
3
4// Token: 0x0200008C RID: 140
5public class Expedition : EClass
6{
7 // Token: 0x170000BB RID: 187
8 // (get) Token: 0x060003D4 RID: 980 RVA: 0x0001B207 File Offset: 0x00019407
9 public Chara chara
10 {
11 get
12 {
13 return RefChara.Get(this.uidChara);
14 }
15 }
16
17 // Token: 0x170000BC RID: 188
18 // (get) Token: 0x060003D5 RID: 981 RVA: 0x0001B214 File Offset: 0x00019414
19 public int MinHour
20 {
21 get
22 {
23 return (int)((float)this.hours * 0.8f);
24 }
25 }
26
27 // Token: 0x170000BD RID: 189
28 // (get) Token: 0x060003D6 RID: 982 RVA: 0x0001B224 File Offset: 0x00019424
29 public int MaxHour
30 {
31 get
32 {
33 return (int)((float)this.hours * 1.2f);
34 }
35 }
36
37 // Token: 0x170000BE RID: 190
38 // (get) Token: 0x060003D7 RID: 983 RVA: 0x0001B234 File Offset: 0x00019434
39 public string strType
40 {
41 get
42 {
43 return ("ex" + this.type.ToString()).lang();
44 }
45 }
46
47 // Token: 0x060003D8 RID: 984 RVA: 0x0001B256 File Offset: 0x00019456
48 public void SetOwner(FactionBranch _branch)
49 {
50 this.branch = _branch;
51 }
52
53 // Token: 0x060003D9 RID: 985 RVA: 0x0001B260 File Offset: 0x00019460
54 public void OnCreate()
55 {
56 HomeResourceManager resources = this.branch.resources;
57 switch (this.type)
58 {
59 case ExpeditionType.Search:
60 this.hours = 24;
61 return;
62 case ExpeditionType.Training:
63 this.hours = 120;
64 return;
65 case ExpeditionType.Explore:
66 this.hours = 10;
67 return;
68 case ExpeditionType.Hunt:
69 this.hours = 10;
70 return;
71 default:
72 this.hours = 24;
73 return;
74 }
75 }
76
77 // Token: 0x060003DA RID: 986 RVA: 0x0001B2C4 File Offset: 0x000194C4
78 public void Start()
79 {
80 this.hours = Rand.Range(this.MinHour, this.MaxHour);
81 this.costs.Pay();
82 WidgetPopText.Say("expeditionStart".lang(this.chara.Name, this.strType, null, null, null), FontColor.Default, null);
83 EClass.Branch.Log("bExpeditionStart", this.chara, this.strType, null, null);
84 if (this.chara.IsInActiveZone)
85 {
86 Msg.Say("bExpeditionStart", this.chara, this.strType, null, null);
87 }
88 this.chara.MoveZone("somewhere");
89 }
90
91 // Token: 0x060003DB RID: 987 RVA: 0x0001B36C File Offset: 0x0001956C
92 public void OnAdvanceHour()
93 {
94 this.hours--;
95 if (this.hours <= 0)
96 {
97 this.End();
98 }
99 }
100
101 // Token: 0x060003DC RID: 988 RVA: 0x0001B38C File Offset: 0x0001958C
102 public void End()
103 {
104 this.branch.expeditions.dict.Remove(this.uidChara);
105 this.chara.MoveZone(this.chara.homeZone, ZoneTransition.EnterState.Auto);
106 WidgetPopText.Say("expeditionEnd".lang(this.chara.Name, this.strType, null, null, null), FontColor.Default, null);
107 this.branch.Log("bExpeditionEnd", this.chara, this.strType, null, null);
108 if (this.chara.IsInActiveZone)
109 {
110 Msg.Say("bExpeditionEnd", this.chara, this.strType, null, null);
111 }
112 ExpeditionType expeditionType = this.type;
113 if (expeditionType != ExpeditionType.Search)
114 {
115 if (expeditionType != ExpeditionType.Explore)
116 {
117 return;
118 }
119 this.chara.GetWorkSummary().progress = 100;
120 }
121 else
122 {
123 foreach (Zone zone in EClass.world.region.ListZonesInRadius(this.branch.owner, 10))
124 {
125 if (!zone.isKnown)
126 {
127 zone.isKnown = true;
128 WidgetPopText.Say("discoverZone".lang(zone.Name, null, null, null, null), FontColor.Great, null);
129 }
130 }
131 Zone zone2 = EClass.world.region.CreateRandomSite(this.chara.homeZone, 8, null, true);
132 if (zone2 != null)
133 {
134 zone2.isKnown = true;
135 WidgetPopText.Say("discoverZone".lang(zone2.Name, null, null, null, null), FontColor.Great, null);
136 return;
137 }
138 }
139 }
140
141 // Token: 0x060003DD RID: 989 RVA: 0x0001B520 File Offset: 0x00019720
142 public static Expedition Create(Chara c, ExpeditionType type)
143 {
144 Expedition expedition = new Expedition();
145 expedition.uidChara = c.uid;
146 expedition.type = type;
147 expedition.SetOwner(c.homeBranch);
148 expedition.OnCreate();
149 return expedition;
150 }
151
152 // Token: 0x040005B7 RID: 1463
153 [JsonProperty]
154 public int hours;
155
156 // Token: 0x040005B8 RID: 1464
157 [JsonProperty]
158 public int uidChara;
159
160 // Token: 0x040005B9 RID: 1465
161 [JsonProperty]
162 public ExpeditionType type;
163
164 // Token: 0x040005BA RID: 1466
165 public HomeResource.CostList costs = new HomeResource.CostList();
166
167 // Token: 0x040005BB RID: 1467
168 public FactionBranch branch;
169}
Definition Chara.cs:12
Definition Msg.cs:7
Definition Zone.cs:14