Elin Modding Docs Doc
Loading...
Searching...
No Matches
QuestTaskHunt.cs
1using System;
2using System.Collections.Generic;
3using System.Runtime.CompilerServices;
4using Newtonsoft.Json;
5
6// Token: 0x02000106 RID: 262
7public class QuestTaskHunt : QuestTask
8{
9 // Token: 0x170001B2 RID: 434
10 // (get) Token: 0x060006E0 RID: 1760 RVA: 0x00029A52 File Offset: 0x00027C52
11 public SourceRace.Row Race
12 {
13 get
14 {
15 return EClass.sources.races.map[this.idRace];
16 }
17 }
18
19 // Token: 0x170001B3 RID: 435
20 // (get) Token: 0x060006E1 RID: 1761 RVA: 0x00029A6E File Offset: 0x00027C6E
21 public override string RefDrama2
22 {
23 get
24 {
25 if (this.type != QuestTaskHunt.Type.Race)
26 {
27 return "";
28 }
29 return this.Race.GetName();
30 }
31 }
32
33 // Token: 0x170001B4 RID: 436
34 // (get) Token: 0x060006E2 RID: 1762 RVA: 0x00029A8A File Offset: 0x00027C8A
35 public override string RefDrama3
36 {
37 get
38 {
39 return this.numRequired.ToString() ?? "";
40 }
41 }
42
43 // Token: 0x060006E3 RID: 1763 RVA: 0x00029AA0 File Offset: 0x00027CA0
44 public override bool IsComplete()
45 {
46 return this.numHunted >= this.numRequired;
47 }
48
49 // Token: 0x060006E4 RID: 1764 RVA: 0x00029AB4 File Offset: 0x00027CB4
50 public static List<SourceChara.Row> ListTargets(string idRace)
51 {
52 List<SourceChara.Row> list = new List<SourceChara.Row>();
53 foreach (SourceChara.Row row in EClass.sources.charas.rows)
54 {
55 if (row.quality == 0 && row.race == idRace && row.chance > 0 && row.hostility != "Friend")
56 {
57 list.Add(row);
58 }
59 }
60 return list;
61 }
62
63 // Token: 0x060006E5 RID: 1765 RVA: 0x00029B48 File Offset: 0x00027D48
64 public override void OnInit()
65 {
66 if (this.setup == QuestTaskHunt.Setup.FighterGuild)
67 {
68 this.numRequired = 20;
69 this.idRace = "yeek";
70 this.type = QuestTaskHunt.Type.Race;
71 return;
72 }
73 if (this.type == QuestTaskHunt.Type.Race)
74 {
75 for (int i = 0; i < 100; i++)
76 {
77 SourceRace.Row row = EClass.sources.races.rows.RandomItem<SourceRace.Row>();
78 if (QuestTaskHunt.ListTargets(row.id).Count != 0)
79 {
80 this.idRace = row.id;
81 }
82 }
83 this.numRequired = 3 + this.owner.difficulty * 2 + EClass.rnd(5);
84 return;
85 }
86 this.numRequired = 10 + this.owner.difficulty * 3 + EClass.rnd(5);
87 }
88
89 // Token: 0x060006E6 RID: 1766 RVA: 0x00029BFC File Offset: 0x00027DFC
90 public override void OnKillChara(Chara c)
91 {
92 QuestTaskHunt.<>c__DisplayClass16_0 CS$<>8__locals1;
93 CS$<>8__locals1.<>4__this = this;
94 CS$<>8__locals1.c = c;
95 if (CS$<>8__locals1.c.IsPCFaction)
96 {
97 return;
98 }
99 if (this.type == QuestTaskHunt.Type.Race)
100 {
101 if (CS$<>8__locals1.c.race.id == this.idRace)
102 {
103 this.<OnKillChara>g__CountKill|16_0(ref CS$<>8__locals1);
104 return;
105 }
106 }
107 else if (CS$<>8__locals1.c.OriginalHostility <= Hostility.Enemy)
108 {
109 this.<OnKillChara>g__CountKill|16_0(ref CS$<>8__locals1);
110 }
111 }
112
113 // Token: 0x060006E7 RID: 1767 RVA: 0x00029C6C File Offset: 0x00027E6C
114 public override string GetTextProgress()
115 {
116 if (this.type == QuestTaskHunt.Type.Race)
117 {
118 return "progressHuntRace".lang(this.numHunted.ToString() ?? "", this.numRequired.ToString() ?? "", this.Race.GetName(), null, null);
119 }
120 return "progressHunt".lang(this.numHunted.ToString() ?? "", this.numRequired.ToString() ?? "", null, null, null);
121 }
122
123 // Token: 0x060006E8 RID: 1768 RVA: 0x00029CF8 File Offset: 0x00027EF8
124 public override void OnGetDetail(ref string detail, bool onJournal)
125 {
126 if (this.type == QuestTaskHunt.Type.Race)
127 {
128 if (!onJournal)
129 {
130 return;
131 }
132 List<SourceChara.Row> list = QuestTaskHunt.ListTargets(this.idRace);
133 int num = 0;
134 detail = string.Concat(new string[]
135 {
136 detail,
137 Environment.NewLine,
138 Environment.NewLine,
139 "target_huntRace".lang(),
140 Environment.NewLine
141 });
142 foreach (SourceChara.Row row in list)
143 {
144 detail = string.Concat(new string[]
145 {
146 detail,
147 row.GetName().ToTitleCase(true),
148 " (",
149 EClass.sources.races.map[this.idRace].GetName(),
150 ")"
151 });
152 num++;
153 if (num > 5)
154 {
155 break;
156 }
157 detail += Environment.NewLine;
158 }
159 }
160 }
161
162 // Token: 0x060006EA RID: 1770 RVA: 0x00029E08 File Offset: 0x00028008
163 [CompilerGenerated]
164 private void <OnKillChara>g__CountKill|16_0(ref QuestTaskHunt.<>c__DisplayClass16_0 A_1)
165 {
166 this.numHunted++;
167 if (this.numHunted > this.numRequired)
168 {
169 this.numHunted = this.numRequired;
170 return;
171 }
172 this.owner.bonusMoney += EClass.curve(3 + A_1.c.LV, 50, 10, 75) * ((this.type == QuestTaskHunt.Type.Race) ? 2 : 1);
173 }
174
175 // Token: 0x04000725 RID: 1829
176 [JsonProperty]
177 public int numHunted;
178
179 // Token: 0x04000726 RID: 1830
180 [JsonProperty]
181 public int numRequired;
182
183 // Token: 0x04000727 RID: 1831
184 [JsonProperty]
185 public string idRace;
186
187 // Token: 0x04000728 RID: 1832
188 [JsonProperty]
189 public QuestTaskHunt.Type type;
190
191 // Token: 0x04000729 RID: 1833
192 public QuestTaskHunt.Setup setup;
193
194 // Token: 0x02000821 RID: 2081
195 public enum Type
196 {
197 // Token: 0x04002300 RID: 8960
198 Default,
199 // Token: 0x04002301 RID: 8961
200 Race
201 }
202
203 // Token: 0x02000822 RID: 2082
204 public enum Setup
205 {
206 // Token: 0x04002303 RID: 8963
207 Random,
208 // Token: 0x04002304 RID: 8964
209 FighterGuild
210 }
211}
Definition Chara.cs:12