Elin Modding Docs Doc
Loading...
Searching...
No Matches
TraitTrap.cs
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4
5// Token: 0x0200031A RID: 794
7{
8 // Token: 0x17000758 RID: 1880
9 // (get) Token: 0x0600198D RID: 6541 RVA: 0x000A2BF3 File Offset: 0x000A0DF3
10 public override byte WeightMod
11 {
12 get
13 {
14 if (!this.owner.isHidden)
15 {
16 return 10;
17 }
18 return 0;
19 }
20 }
21
22 // Token: 0x17000759 RID: 1881
23 // (get) Token: 0x0600198E RID: 6542 RVA: 0x000A2C06 File Offset: 0x000A0E06
24 public virtual int DestroyChanceOnActivateTrap
25 {
26 get
27 {
28 return 50;
29 }
30 }
31
32 // Token: 0x1700075A RID: 1882
33 // (get) Token: 0x0600198F RID: 6543 RVA: 0x000A2C0A File Offset: 0x000A0E0A
34 public override bool CanBeHeld
35 {
36 get
37 {
38 return EClass._zone.IsPCFaction;
39 }
40 }
41
42 // Token: 0x1700075B RID: 1883
43 // (get) Token: 0x06001990 RID: 6544 RVA: 0x000A2C16 File Offset: 0x000A0E16
44 public override bool StartHidden
45 {
46 get
47 {
48 return true;
49 }
50 }
51
52 // Token: 0x1700075C RID: 1884
53 // (get) Token: 0x06001991 RID: 6545 RVA: 0x000A2C19 File Offset: 0x000A0E19
54 public override bool CanDisarmTrap
55 {
56 get
57 {
58 return !this.IsJammed;
59 }
60 }
61
62 // Token: 0x1700075D RID: 1885
63 // (get) Token: 0x06001992 RID: 6546 RVA: 0x000A2C24 File Offset: 0x000A0E24
64 public override bool IsNegativeEffect
65 {
66 get
67 {
68 return true;
69 }
70 }
71
72 // Token: 0x06001993 RID: 6547 RVA: 0x000A2C28 File Offset: 0x000A0E28
73 public override bool IgnoreWhenLevitating()
74 {
75 if (this.owner.sourceCard.vals.Length == 0)
76 {
77 return false;
78 }
79 string text = this.owner.sourceCard.vals[0];
80 uint num = <PrivateImplementationDetails>.ComputeStringHash(text);
81 if (num <= 1426490280U)
82 {
83 if (num != 163485141U)
84 {
85 if (num != 274826164U)
86 {
87 if (num != 1426490280U)
88 {
89 return false;
90 }
91 if (!(text == "acid"))
92 {
93 return false;
94 }
95 }
96 else if (!(text == "blind"))
97 {
98 return false;
99 }
100 }
101 else if (!(text == "paralysis"))
102 {
103 return false;
104 }
105 }
106 else if (num <= 2313861896U)
107 {
108 if (num != 2122968502U)
109 {
110 if (num != 2313861896U)
111 {
112 return false;
113 }
114 if (!(text == "sleep"))
115 {
116 return false;
117 }
118 }
119 else if (!(text == "mine"))
120 {
121 return false;
122 }
123 }
124 else if (num != 2574777438U)
125 {
126 if (num != 3649609552U)
127 {
128 return false;
129 }
130 if (!(text == "banana"))
131 {
132 return false;
133 }
134 }
135 else if (!(text == "spear"))
136 {
137 return false;
138 }
139 return true;
140 }
141
142 // Token: 0x06001994 RID: 6548 RVA: 0x000A2D20 File Offset: 0x000A0F20
143 public override void OnActivateTrap(Chara c)
144 {
145 if (this.owner.sourceCard.vals == null || this.owner.sourceCard.vals.Length == 0)
146 {
147 Debug.Log(this.owner.id);
148 return;
149 }
150 string text = this.owner.sourceCard.vals[0];
151 c.PlaySound("trap", 1f, true);
152 c.Say("trap", c, this.owner, null, null);
153 if (text == "mine")
154 {
155 Msg.Say("trap_mine", c, null, null, null);
156 }
157 else
158 {
159 c.Say("trap_" + text, c, null, null);
160 }
161 uint num = <PrivateImplementationDetails>.ComputeStringHash(text);
162 if (num <= 2313861896U)
163 {
164 if (num <= 274826164U)
165 {
166 if (num != 163485141U)
167 {
168 if (num != 274826164U)
169 {
170 goto IL_3C6;
171 }
172 if (!(text == "blind"))
173 {
174 goto IL_3C6;
175 }
176 ActEffect.Proc(EffectId.Blind, c, null, 100, default(ActRef));
177 goto IL_3C6;
178 }
179 else
180 {
181 if (!(text == "paralysis"))
182 {
183 goto IL_3C6;
184 }
185 ActEffect.Proc(EffectId.Paralyze, c, null, 100, default(ActRef));
186 goto IL_3C6;
187 }
188 }
189 else if (num != 1426490280U)
190 {
191 if (num != 2122968502U)
192 {
193 if (num != 2313861896U)
194 {
195 goto IL_3C6;
196 }
197 if (!(text == "sleep"))
198 {
199 goto IL_3C6;
200 }
201 ActEffect.Proc(EffectId.Sleep, c, null, 100, default(ActRef));
202 goto IL_3C6;
203 }
204 else
205 {
206 if (!(text == "mine"))
207 {
208 goto IL_3C6;
209 }
210 c.PlayEffect("explosion", true, 0f, default(Vector3));
211 c.PlaySound("explosion", 1f, true);
212 int num2 = (EClass.debug.enable ? 100000 : 100) + base.TrapLv * 2 + EClass.rnd(200);
213 if (this.IsLaidByDog)
214 {
215 num2 /= 2;
216 }
217 c.DamageHP(num2, AttackSource.Trap, null);
218 Shaker.ShakeCam("default", 1f);
219 goto IL_3C6;
220 }
221 }
222 else if (!(text == "acid"))
223 {
224 goto IL_3C6;
225 }
226 }
227 else if (num <= 2574777438U)
228 {
229 if (num != 2369798645U)
230 {
231 if (num != 2574777438U)
232 {
233 goto IL_3C6;
234 }
235 if (!(text == "spear"))
236 {
237 goto IL_3C6;
238 }
239 if (c.isLevitating)
240 {
241 c.Say("trap_spear_nullify", c, null, null);
242 goto IL_3C6;
243 }
244 c.DamageHP(base.TrapLv * 2 + 10, AttackSource.Trap, null);
245 goto IL_3C6;
246 }
247 else
248 {
249 if (!(text == "curse"))
250 {
251 goto IL_3C6;
252 }
253 ActEffect.Proc(EffectId.CurseEQ, c, null, 100, default(ActRef));
254 goto IL_3C6;
255 }
256 }
257 else if (num != 3289626814U)
258 {
259 if (num != 3649609552U)
260 {
261 if (num != 4268299041U)
262 {
263 goto IL_3C6;
264 }
265 if (!(text == "sister"))
266 {
267 goto IL_3C6;
268 }
269 using (List<Chara>.Enumerator enumerator = EClass._map.charas.GetEnumerator())
270 {
271 while (enumerator.MoveNext())
272 {
273 Chara chara = enumerator.Current;
274 chara.RemoveCondition<ConSuspend>();
275 }
276 goto IL_3C6;
277 }
278 }
279 else
280 {
281 if (!(text == "banana"))
282 {
283 goto IL_3C6;
284 }
285 c.Stumble(150);
286 goto IL_3C6;
287 }
288 }
289 else
290 {
291 if (!(text == "teleport"))
292 {
293 goto IL_3C6;
294 }
295 ActEffect.Proc(EffectId.Teleport, c, null, 100, default(ActRef));
296 goto IL_3C6;
297 }
298 c.PlayEffect("Element/eleAcid", true, 0f, default(Vector3));
299 ActEffect.Proc(EffectId.Acid, c, null, 100, default(ActRef));
300 IL_3C6:
301 if (this.DestroyChanceOnActivateTrap >= EClass.rnd(100))
302 {
303 this.owner.Destroy();
304 }
305 }
306
307 // Token: 0x06001995 RID: 6549 RVA: 0x000A3120 File Offset: 0x000A1320
308 public override void SetName(ref string s)
309 {
310 if (this.IsJammed)
311 {
312 s = "_jammed".lang(s, null, null, null, null);
313 }
314 }
315}
Definition Chara.cs:12
Definition Msg.cs:7