Elin Modding Docs Doc
Loading...
Searching...
No Matches
ActEffect.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using UnityEngine;
5
6// Token: 0x020001B8 RID: 440
7public class ActEffect : EClass
8{
9 // Token: 0x06000C78 RID: 3192 RVA: 0x0005D23C File Offset: 0x0005B43C
10 public static void TryDelay(Action a)
11 {
12 if (ActEffect.RapidCount == 0)
13 {
14 a();
15 return;
16 }
17 TweenUtil.Delay((float)ActEffect.RapidCount * ActEffect.RapidDelay, delegate
18 {
19 a();
20 });
21 }
22
23 // Token: 0x06000C79 RID: 3193 RVA: 0x0005D288 File Offset: 0x0005B488
24 public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Point> points, ActRef actref, string lang = null)
25 {
26 if (points.Count == 0)
27 {
28 CC.SayNothingHappans();
29 return false;
30 }
31 if (!EClass.setting.elements.ContainsKey(e.source.alias))
32 {
33 Debug.Log(e.source.alias);
34 e = Element.Create(0, 1);
35 }
36 ElementRef elementRef = EClass.setting.elements[e.source.alias];
37 Act act = actref.act;
38 int num = (act != null) ? act.ElementPowerMod : 50;
39 int num2 = 0;
40 Point point = CC.pos.Copy();
41 List<Card> list = new List<Card>();
42 bool flag = false;
43 if (id == EffectId.Explosive)
44 {
45 power = power * actref.refThing.material.hardness / 10;
46 Debug.Log(power);
47 }
48 string text = id.ToString();
49 string text2 = EClass.sources.calc.map.ContainsKey(text) ? text : (text.ToLower() + "_");
50 using (List<Point>.Enumerator enumerator = points.GetEnumerator())
51 {
52 while (enumerator.MoveNext())
53 {
54 Point p = enumerator.Current;
55 bool flag2 = true;
56 if (id <= EffectId.Meteor)
57 {
58 if (id - EffectId.Explosive <= 1)
59 {
60 text2 = "ball_";
61 goto IL_1CB;
62 }
63 if (id == EffectId.Meteor)
64 {
65 text2 = "SpMeteor";
66 goto IL_1CB;
67 }
68 }
69 else
70 {
71 if (id == EffectId.Earthquake)
72 {
73 text2 = "SpEarthquake";
74 flag2 = false;
75 flag = true;
76 goto IL_1CB;
77 }
78 if (id == EffectId.Suicide)
79 {
80 goto IL_1CB;
81 }
82 }
83 if (CC.isChara && p.Equals(CC.pos) && points.Count >= 2)
84 {
85 continue;
86 }
87 IL_1CB:
88 Effect effect = null;
89 Effect effect2 = flag2 ? Effect.Get("trail1") : null;
90 Point from = p;
91 if (id != EffectId.Arrow)
92 {
93 if (id != EffectId.Earthquake)
94 {
95 effect = Effect.Get("Element/ball_" + ((e.id == 0) ? "Void" : e.source.alias.Remove(0, 3)));
96 if (effect == null)
97 {
98 effect = Effect.Get("Element/ball_Fire");
99 }
100 float startDelay = ((id == EffectId.Meteor) ? 0.1f : 0.04f) * (float)CC.pos.Distance(p);
101 effect.SetStartDelay(startDelay);
102 effect2.SetStartDelay(startDelay);
103 }
104 else
105 {
106 if (EClass.rnd(4) == 0 && p.IsSync)
107 {
108 effect = Effect.Get("smoke_earthquake");
109 }
110 float num3 = 0.06f * (float)CC.pos.Distance(p);
111 Point pos = p.Copy();
112 TweenUtil.Tween(num3, null, delegate()
113 {
114 pos.Animate(AnimeID.Quake, true);
115 });
116 if (effect != null)
117 {
118 effect.SetStartDelay(num3);
119 }
120 }
121 }
122 else
123 {
124 effect = Effect.Get("spell_arrow");
125 effect.sr.color = elementRef.colorSprite;
126 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
127 componentInChildren.startColor = (componentInChildren.endColor = elementRef.colorSprite);
128 from = CC.pos;
129 }
130 if (effect2 != null)
131 {
132 effect2.SetParticleColor(elementRef.colorTrail, true, "_TintColor").Play(from, 0f, null, null);
133 }
134 if (effect != null)
135 {
136 if (id == EffectId.Arrow)
137 {
138 ActEffect.TryDelay(delegate
139 {
140 effect.Play(CC.pos, 0f, p, null);
141 });
142 }
143 else
144 {
145 ActEffect.TryDelay(delegate
146 {
147 effect.Play(p, 0f, null, null).Flip(p.x > CC.pos.x, false);
148 });
149 }
150 }
151 bool flag3 = CC.HasElement(1651, 1) && CC.IsPCFactionOrMinion;
152 if (CC.IsPCFactionOrMinion && EClass.pc.Evalue(1651) >= 2)
153 {
154 flag3 = true;
155 }
156 if (!flag3)
157 {
158 if (e.id == 910)
159 {
160 EClass._map.TryShatter(p, 910, power);
161 }
162 if (e.id == 911)
163 {
164 EClass._map.TryShatter(p, 911, power);
165 }
166 }
167 foreach (Card card in p.ListCards(false).ToList<Card>())
168 {
169 Card c = card;
170 if ((c.isChara || c.trait.CanBeAttacked) && (!c.IsMultisize || card != CC) && (!c.isChara || (c.Chara.host != CC && c.Chara.parasite != CC && c.Chara.ride != CC)))
171 {
172 if (id - EffectId.Arrow <= 1 && c.isChara && CC.isChara)
173 {
174 c.Chara.RequestProtection(CC.Chara, delegate(Chara a)
175 {
176 c = a;
177 });
178 }
179 bool isChara = CC.isChara;
180 int num4;
181 if (id == EffectId.Suicide)
182 {
183 num4 = CC.MaxHP * 2;
184 num4 = num4 * 100 / (50 + point.Distance(p) * 75);
185 if (c.HasTag(CTAG.suicide) && !c.HasCondition<ConWet>())
186 {
187 list.Add(c);
188 }
189 }
190 else
191 {
192 Dice dice = Dice.Create(text2, power, CC, actref.act);
193 if (dice == null)
194 {
195 Debug.Log(text2);
196 }
197 num4 = dice.Roll();
198 if (id == EffectId.Earthquake)
199 {
200 if (c.HasCondition<ConGravity>())
201 {
202 num4 = dice.RollMax() * 2;
203 }
204 else if (c.isChara && c.Chara.isLevitating)
205 {
206 num4 /= 2;
207 }
208 }
209 if (id == EffectId.Ball || id == EffectId.BallBubble || id == EffectId.Explosive)
210 {
211 num4 = num4 * 100 / (90 + point.Distance(p) * 10);
212 }
213 }
214 if ((!actref.noFriendlyFire || CC.Chara.IsHostile(c as Chara)) && (!flag || c != CC))
215 {
216 if (isChara && points.Count > 1 && c != null && c.isChara && CC.isChara && CC.Chara.IsFriendOrAbove(c.Chara))
217 {
218 int num5 = CC.Evalue(302);
219 if (!CC.IsPC && CC.IsPCFactionOrMinion)
220 {
221 num5 += EClass.pc.Evalue(302);
222 }
223 if (num5 > 0)
224 {
225 if (num5 * 10 > EClass.rnd(num4 + 1))
226 {
227 CC.ModExp(302, CC.IsPC ? 10 : 50);
228 continue;
229 }
230 num4 = EClass.rnd(num4 * 100 / (100 + num5 * 10 + 1));
231 CC.ModExp(302, CC.IsPC ? 20 : 100);
232 if (num4 == 0)
233 {
234 continue;
235 }
236 }
237 if (CC.HasElement(1214, 1) || (!CC.IsPC && (CC.IsPCFaction || CC.IsPCFactionMinion) && EClass.pc.HasElement(1214, 1) && EClass.rnd(5) != 0))
238 {
239 continue;
240 }
241 }
242 if (!lang.IsEmpty())
243 {
244 if (lang == "spell_hand")
245 {
246 string[] list2 = Lang.GetList("attack" + (CC.isChara ? CC.Chara.race.meleeStyle.IsEmpty("Touch") : "Touch"));
247 string @ref = "_elehand".lang(e.source.GetAltname(2), list2[4], null, null, null);
248 CC.Say(c.IsPCParty ? "cast_hand_ally" : "cast_hand", CC, c, @ref, c.IsPCParty ? list2[1] : list2[2]);
249 }
250 else
251 {
252 CC.Say(lang + "_hit", CC, c, e.Name.ToLower(), null);
253 }
254 }
255 Chara chara = CC.isChara ? CC.Chara : EClass._map.FindChara(actref.refThing.c_uidRefCard);
256 c.DamageHP(num4, e.id, power * num / 100, AttackSource.None, chara ?? CC, true);
257 if (chara != null && chara.IsAliveInCurrentZone)
258 {
259 chara.DoHostileAction(c, false);
260 }
261 num2++;
262 }
263 }
264 }
265 if (id == EffectId.Explosive)
266 {
267 int hardness = actref.refThing.material.hardness;
268 bool flag4 = EClass._zone.HasLaw && !EClass._zone.IsPCFaction && CC.IsPC && !(EClass._zone is Zone_Vernis);
269 if (p.HasObj && p.cell.matObj.hardness <= hardness)
270 {
271 EClass._map.MineObj(p, null, null);
272 if (flag4)
273 {
274 EClass.player.ModKarma(-1);
275 }
276 }
277 if (!p.HasObj && p.HasBlock && p.matBlock.hardness <= hardness)
278 {
279 EClass._map.MineBlock(p, false, null);
280 if (flag4)
281 {
282 EClass.player.ModKarma(-1);
283 }
284 }
285 }
286 if (e.id == 911)
287 {
288 p.ModFire(-20);
289 }
290 }
291 }
292 if (ActEffect.RapidCount == 0)
293 {
294 foreach (Card card2 in list)
295 {
296 if (card2.ExistsOnMap)
297 {
298 ActEffect.RapidCount += 2;
299 ActEffect.ProcAt(id, power, BlessedState.Normal, card2, null, card2.pos, true, actref);
300 }
301 }
302 }
303 return num2 > 0;
304 }
305
306 // Token: 0x06000C7A RID: 3194 RVA: 0x0005DF90 File Offset: 0x0005C190
307 public static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef = default(ActRef))
308 {
309 Chara CC = cc.Chara;
310 bool flag = state <= BlessedState.Cursed;
311 bool flag2 = isNeg || flag;
312 Element element = Element.Create(actRef.aliasEle.IsEmpty("eleFire"), power / 10);
313 if (EClass.debug.enable && EInput.isShiftDown)
314 {
315 ActEffect.angle += 5;
316 if (ActEffect.angle > 100)
317 {
318 ActEffect.angle = 30;
319 }
320 Debug.Log(ActEffect.angle);
321 }
322 if (ActEffect.RapidCount > 0)
323 {
324 power = power * 100 / (100 + ActEffect.RapidCount * 50);
325 }
326 if (id <= EffectId.Earthquake)
327 {
328 switch (id)
329 {
330 case EffectId.Breathe:
331 {
332 List<Point> list = EClass._map.ListPointsInArc(CC.pos, tp, 7, 35f);
333 if (list.Count == 0)
334 {
335 list.Add(CC.pos.Copy());
336 }
337 CC.Say("spell_breathe", CC, element.Name.ToLower(), null);
338 EClass.Wait(0.8f, CC);
339 ActEffect.TryDelay(delegate
340 {
341 CC.PlaySound("spell_breathe", 1f, true);
342 });
343 if (CC.IsInMutterDistance(10) && !EClass.core.config.graphic.disableShake)
344 {
345 Shaker.ShakeCam("breathe", 1f);
346 }
347 ActEffect.DamageEle(CC, id, power, element, list, actRef, "spell_breathe");
348 return;
349 }
350 case EffectId.Ball:
351 case EffectId.Explosive:
352 case EffectId.BallBubble:
353 goto IL_9C1;
354 case EffectId.Bolt:
355 {
356 List<Point> list2 = EClass._map.ListPointsInLine(CC.pos, tp, 10);
357 if (list2.Count == 0)
358 {
359 list2.Add(CC.pos.Copy());
360 }
361 CC.Say("spell_bolt", CC, element.Name.ToLower(), null);
362 EClass.Wait(0.8f, CC);
363 ActEffect.TryDelay(delegate
364 {
365 CC.PlaySound("spell_bolt", 1f, true);
366 });
367 if (CC.IsInMutterDistance(10) && !EClass.core.config.graphic.disableShake)
368 {
369 Shaker.ShakeCam("bolt", 1f);
370 }
371 ActEffect.DamageEle(CC, id, power, element, list2, actRef, "spell_bolt");
372 return;
373 }
374 case EffectId.Arrow:
375 {
376 List<Point> list3 = new List<Point>();
377 list3.Add(tp.Copy());
378 CC.Say("spell_arrow", CC, element.Name.ToLower(), null);
379 EClass.Wait(0.5f, CC);
380 ActEffect.TryDelay(delegate
381 {
382 CC.PlaySound("spell_arrow", 1f, true);
383 });
384 ActEffect.DamageEle(CC, id, power, element, list3, actRef, "spell_arrow");
385 return;
386 }
387 case EffectId.Hand:
388 break;
389 case EffectId.Funnel:
390 {
391 if (EClass._zone.CountMinions(CC) > CC.MaxSummon || CC.c_uidMaster != 0)
392 {
393 CC.Say("summon_ally_fail", CC, null, null);
394 return;
395 }
396 CC.Say("spell_funnel", CC, element.Name.ToLower(), null);
397 CC.PlaySound("spell_funnel", 1f, true);
398 Chara chara = CharaGen.Create("bit", -1);
399 chara.SetMainElement(element.source.alias, element.Value, true);
400 chara.SetSummon(20 + power / 20 + EClass.rnd(10));
401 chara.SetLv(power / 15);
402 EClass._zone.AddCard(chara, tp.GetNearestPoint(false, false, true, false));
403 chara.PlayEffect("teleport", true, 0f, default(Vector3));
404 chara.MakeMinion(CC, MinionType.Default);
405 return;
406 }
407 case EffectId.TransGender:
408 case EffectId.ModPotential:
409 case EffectId.Buff:
410 case EffectId.Debuff:
411 case EffectId.Weaken:
412 case EffectId.NeckHunt:
413 goto IL_DE1;
414 case EffectId.Summon:
415 {
416 CC.Say("summon_ally", CC, null, null);
417 if (EClass._zone.CountMinions(CC) > CC.MaxSummon || CC.c_uidMaster != 0)
418 {
419 CC.Say("summon_ally_fail", CC, null, null);
420 return;
421 }
422 string id2 = actRef.n1;
423 int num = 1;
424 int num2 = -1;
425 int radius = 3;
426 bool flag3 = false;
427 int num3 = -1;
428 string n = actRef.n1;
429 if (!(n == "shadow"))
430 {
431 if (!(n == "monster") && !(n == "fire") && !(n == "animal"))
432 {
433 if (!(n == "special_force"))
434 {
435 if (n == "tentacle")
436 {
437 num2 = 20 + EClass.rnd(10);
438 radius = 1;
439 }
440 }
441 else
442 {
443 id2 = "army_palmia";
444 num = 4 + EClass.rnd(2);
445 num3 = EClass._zone.DangerLv;
446 }
447 }
448 else
449 {
450 num = 1 + EClass.rnd(2);
451 }
452 }
453 else
454 {
455 num = Mathf.Clamp(power / 100, 1, 5) + ((power < 100) ? 0 : EClass.rnd(2));
456 }
457 int num4 = 0;
458 while (num4 < num && EClass._zone.CountMinions(CC) <= CC.MaxSummon)
459 {
460 Point randomPoint = tp.GetRandomPoint(radius, true, true, false, 100);
461 Point point = (randomPoint != null) ? randomPoint.GetNearestPoint(false, false, true, false) : null;
462 if (point != null && point.IsValid)
463 {
464 if (num3 != -1)
465 {
467 {
468 lv = num3
469 });
470 }
471 n = actRef.n1;
472 Chara chara2;
473 if (!(n == "pawn"))
474 {
475 if (!(n == "monster"))
476 {
477 if (!(n == "animal"))
478 {
479 if (!(n == "fire"))
480 {
481 chara2 = CharaGen.Create(id2, power / 10);
482 }
483 else
484 {
485 chara2 = CharaGen.CreateFromElement("Fire", power / 10, "chara");
486 }
487 }
488 else
489 {
490 chara2 = CharaGen.CreateFromFilter("c_animal", power / 15, -1);
491 }
492 }
493 else
494 {
495 chara2 = CharaGen.CreateFromFilter("c_dungeon", power / 10, -1);
496 }
497 }
498 else
499 {
500 chara2 = CharaGen.CreateFromFilter("c_pawn", power / 10, -1);
501 }
502 if (chara2 != null)
503 {
504 int num5;
505 if (actRef.n1 == "shadow")
506 {
507 num5 = power / 10 + 1;
508 }
509 else
510 {
511 num5 = chara2.LV * (100 + power / 10) / 100 + power / 30;
512 }
513 if (chara2.LV < num5)
514 {
515 chara2.SetLv(num5);
516 }
517 n = actRef.n1;
518 if (!(n == "shadow"))
519 {
520 if (n == "special_force")
521 {
522 chara2.homeZone = EClass._zone;
523 }
524 }
525 else
526 {
527 chara2.hp = chara2.MaxHP / 2;
528 }
529 EClass._zone.AddCard(chara2, point);
530 if (!(actRef.n1 == "monster") || actRef.refThing == null)
531 {
532 chara2.MakeMinion(CC, MinionType.Default);
533 }
534 if (num2 != -1)
535 {
536 chara2.SetSummon(num2);
537 }
538 flag3 = true;
539 }
540 }
541 num4++;
542 }
543 if (!flag3)
544 {
545 CC.Say("summon_ally_fail", CC, null, null);
546 }
547 return;
548 }
549 case EffectId.Bubble:
550 case EffectId.Web:
551 case EffectId.MistOfDarkness:
552 case EffectId.Puddle:
553 {
554 if (LangGame.Has("ab" + id.ToString()))
555 {
556 CC.Say("ab" + id.ToString(), CC, null, null);
557 }
558 tp.PlaySound("vomit", true, 1f, true);
559 int num6 = 2 + EClass.rnd(3);
560 int id3 = (id == EffectId.Puddle) ? 4 : ((id == EffectId.Bubble) ? 5 : ((id == EffectId.MistOfDarkness) ? 6 : 7));
561 EffectId idEffect = (id == EffectId.Bubble) ? EffectId.BallBubble : EffectId.PuddleEffect;
562 Color color = EClass.Colors.elementColors.TryGetValue(element.source.alias, default(Color));
563 if (id == EffectId.Bubble && CC.id == "cancer")
564 {
565 idEffect = EffectId.Nothing;
566 num6 = 1 + EClass.rnd(3);
567 }
568 for (int i = 0; i < num6; i++)
569 {
570 Point randomPoint2 = tp.GetRandomPoint(2, true, true, false, 100);
571 if (randomPoint2 != null && !randomPoint2.HasBlock && (id != EffectId.Puddle || !randomPoint2.cell.IsTopWaterAndNoSnow))
572 {
573 int num7 = 4 + EClass.rnd(5);
574 if (id == EffectId.Web)
575 {
576 num7 *= 3;
577 }
578 EClass._map.SetEffect(randomPoint2.x, randomPoint2.z, new CellEffect
579 {
580 id = id3,
581 amount = num7,
582 idEffect = idEffect,
583 idEle = element.id,
584 power = power,
585 isHostileAct = CC.IsPCParty,
586 color = BaseTileMap.GetColorInt(ref color, 100)
587 });
588 }
589 }
590 return;
591 }
592 default:
593 {
594 if (id == EffectId.Meteor)
595 {
596 EffectMeteor.Create(cc.pos, 6, 10, delegate(int a, Point b)
597 {
598 });
599 List<Point> list4 = EClass._map.ListPointsInCircle(CC.pos, 10f, true, true);
600 if (list4.Count == 0)
601 {
602 list4.Add(CC.pos.Copy());
603 }
604 CC.Say("spell_ball", CC, element.Name.ToLower(), null);
605 ActEffect.TryDelay(delegate
606 {
607 CC.PlaySound("spell_ball", 1f, true);
608 });
609 if (CC.IsInMutterDistance(10))
610 {
611 Shaker.ShakeCam("ball", 1f);
612 }
613 EClass.Wait(1f, CC);
614 ActEffect.DamageEle(CC, id, power, element, list4, actRef, "spell_ball");
615 return;
616 }
617 if (id != EffectId.Earthquake)
618 {
619 goto IL_DE1;
620 }
621 List<Point> list5 = EClass._map.ListPointsInCircle(CC.pos, 12f, false, true);
622 if (list5.Count == 0)
623 {
624 list5.Add(CC.pos.Copy());
625 }
626 CC.Say("spell_earthquake", CC, element.Name.ToLower(), null);
627 ActEffect.TryDelay(delegate
628 {
629 CC.PlaySound("spell_earthquake", 1f, true);
630 });
631 if (CC.IsInMutterDistance(10))
632 {
633 Shaker.ShakeCam("ball", 1f);
634 }
635 EClass.Wait(1f, CC);
636 ActEffect.DamageEle(CC, id, power, element, list5, actRef, "spell_earthquake");
637 goto IL_DE1;
638 }
639 }
640 }
641 else
642 {
643 if (id == EffectId.Suicide)
644 {
645 goto IL_9C1;
646 }
647 if (id != EffectId.DrainBlood)
648 {
649 if (id != EffectId.Scream)
650 {
651 goto IL_DE1;
652 }
653 CC.PlaySound("scream", 1f, true);
654 CC.PlayEffect("scream", true, 0f, default(Vector3));
655 foreach (Point point2 in EClass._map.ListPointsInCircle(cc.pos, 6f, false, false))
656 {
657 foreach (Chara chara3 in point2.Charas)
658 {
659 if (chara3.ResistLv(957) <= 0)
660 {
661 chara3.AddCondition<ConParalyze>(power, false);
662 }
663 }
664 }
665 return;
666 }
667 }
668 List<Point> list6 = new List<Point>();
669 list6.Add(tp.Copy());
670 EClass.Wait(0.3f, CC);
671 ActEffect.TryDelay(delegate
672 {
673 CC.PlaySound("spell_hand", 1f, true);
674 });
675 if (!ActEffect.DamageEle(CC, id, power, element, list6, actRef, (id == EffectId.DrainBlood) ? "" : "spell_hand"))
676 {
677 CC.Say("spell_hand_miss", CC, element.Name.ToLower(), null);
678 }
679 return;
680 IL_9C1:
681 float radius2 = (id == EffectId.Suicide) ? 3.5f : ((float)((id == EffectId.BallBubble) ? 2 : ((id == EffectId.Explosive) ? 2 : 5)));
682 if (id == EffectId.Suicide)
683 {
684 if (CC.MainElement != Element.Void)
685 {
686 element = CC.MainElement;
687 }
688 if (CC.HasTag(CTAG.kamikaze))
689 {
690 radius2 = 1.5f;
691 }
692 }
693 List<Point> list7 = EClass._map.ListPointsInCircle(cc.pos, radius2, id != EffectId.Explosive, id != EffectId.Explosive);
694 if (list7.Count == 0)
695 {
696 list7.Add(cc.pos.Copy());
697 }
698 cc.Say((id == EffectId.Suicide) ? "abSuicide" : "spell_ball", cc, element.Name.ToLower(), null);
699 EClass.Wait(0.8f, cc);
700 ActEffect.TryDelay(delegate
701 {
702 cc.PlaySound("spell_ball", 1f, true);
703 });
704 if (cc.IsInMutterDistance(10) && !EClass.core.config.graphic.disableShake)
705 {
706 Shaker.ShakeCam("ball", 1f);
707 }
708 ActEffect.DamageEle(actRef.origin ?? cc, id, power, element, list7, actRef, (id == EffectId.Suicide) ? "suicide" : "spell_ball");
709 if (id == EffectId.Suicide && CC.IsAliveInCurrentZone)
710 {
711 CC.Die(null, null, AttackSource.None);
712 }
713 return;
714 IL_DE1:
715 List<Card> list8 = tp.ListCards(false);
716 list8.Reverse();
717 if (list8.Contains(CC))
718 {
719 list8.Insert(0, CC);
720 }
721 foreach (Card card in list8)
722 {
723 if (tc == null || card == tc)
724 {
725 ActEffect.Proc(id, power, state, CC, card, actRef);
726 if (flag2 && card.isChara && card != CC)
727 {
728 CC.DoHostileAction(card, false);
729 }
730 return;
731 }
732 }
733 CC.SayNothingHappans();
734 }
735
736 // Token: 0x06000C7B RID: 3195 RVA: 0x0005EE50 File Offset: 0x0005D050
737 public static void Proc(EffectId id, Card cc, Card tc = null, int power = 100, ActRef actRef = default(ActRef))
738 {
739 ActEffect.Proc(id, power, BlessedState.Normal, cc, tc, actRef);
740 }
741
742 // Token: 0x06000C7C RID: 3196 RVA: 0x0005EE60 File Offset: 0x0005D060
743 public static void Proc(EffectId id, int power, BlessedState state, Card cc, Card tc = null, ActRef actRef = default(ActRef))
744 {
745 ActEffect.<>c__DisplayClass7_0 CS$<>8__locals1 = new ActEffect.<>c__DisplayClass7_0();
746 CS$<>8__locals1.cc = cc;
747 CS$<>8__locals1.tc = tc;
748 CS$<>8__locals1.power = power;
749 CS$<>8__locals1.actRef = actRef;
750 CS$<>8__locals1.id = id;
751 if (CS$<>8__locals1.tc == null)
752 {
753 CS$<>8__locals1.tc = CS$<>8__locals1.cc;
754 }
755 CS$<>8__locals1.TC = CS$<>8__locals1.tc.Chara;
756 CS$<>8__locals1.CC = CS$<>8__locals1.cc.Chara;
757 CS$<>8__locals1.blessed = (state >= BlessedState.Blessed);
758 bool flag = state <= BlessedState.Cursed;
759 CS$<>8__locals1.orgPower = CS$<>8__locals1.power;
760 if (CS$<>8__locals1.blessed || flag)
761 {
762 CS$<>8__locals1.power *= 2;
763 }
764 EffectId id2 = CS$<>8__locals1.id;
765 if (id2 <= EffectId.ModPotential)
766 {
767 if (id2 <= EffectId.Uncurse)
768 {
769 switch (id2)
770 {
771 case EffectId.Identify:
772 case EffectId.GreaterIdentify:
773 {
774 bool flag2 = CS$<>8__locals1.id == EffectId.GreaterIdentify;
775 if (flag)
776 {
777 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.ForgetItems, flag2 ? BlessedState.Cursed : BlessedState.Normal, default(ActRef));
778 goto IL_1244;
779 }
780 if (!CS$<>8__locals1.tc.isThing)
781 {
782 int count = CS$<>8__locals1.blessed ? (flag2 ? (2 + EClass.rnd(2)) : (3 + EClass.rnd(3))) : 1;
783 LayerDragGrid.CreateIdentify(CS$<>8__locals1.CC, flag2, state, 0, count);
784 return;
785 }
786 CS$<>8__locals1.cc.PlaySound("identify", 1f, true);
787 CS$<>8__locals1.cc.PlayEffect("identify", true, 0f, default(Vector3));
788 CS$<>8__locals1.tc.Thing.Identify(CS$<>8__locals1.cc.IsPCParty, flag2 ? IDTSource.SuperiorIdentify : IDTSource.Identify);
789 goto IL_1244;
790 }
791 case EffectId.Teleport:
792 case EffectId.TeleportShort:
793 if (!flag)
794 {
795 if (CS$<>8__locals1.id == EffectId.TeleportShort)
796 {
797 CS$<>8__locals1.tc.Teleport(ActEffect.GetTeleportPos(CS$<>8__locals1.tc.pos, 6), false, false);
798 }
799 else
800 {
801 CS$<>8__locals1.tc.Teleport(ActEffect.GetTeleportPos(CS$<>8__locals1.tc.pos, EClass._map.bounds.Width), false, false);
802 }
803 }
804 if (flag)
805 {
806 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.Gravity, BlessedState.Normal, default(ActRef));
807 }
808 if (CS$<>8__locals1.blessed)
809 {
810 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.Levitate, BlessedState.Normal, default(ActRef));
811 goto IL_1244;
812 }
813 goto IL_1244;
814 case EffectId.CreateWall:
815 goto IL_1244;
816 case EffectId.Return:
817 case EffectId.Evac:
818 if (!CS$<>8__locals1.cc.IsPC)
819 {
820 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.Teleport, state, default(ActRef));
821 return;
822 }
823 if (EClass.player.returnInfo == null)
824 {
825 if (CS$<>8__locals1.id == EffectId.Evac)
826 {
827 EClass.player.returnInfo = new Player.ReturnInfo
828 {
829 turns = EClass.rnd(10) + 10,
830 isEvac = true
831 };
832 }
833 else
834 {
835 if (EClass.game.spatials.ListReturnLocations().Count == 0)
836 {
837 Msg.Say("returnNowhere");
838 goto IL_1244;
839 }
840 EClass.player.returnInfo = new Player.ReturnInfo
841 {
842 turns = EClass.rnd(10) + 10,
843 askDest = true
844 };
845 }
846 Msg.Say("returnBegin");
847 goto IL_1244;
848 }
849 EClass.player.returnInfo = null;
850 Msg.Say("returnAbort");
851 goto IL_1244;
852 case EffectId.ChangeMaterialLesser:
853 case EffectId.ChangeMaterial:
854 case EffectId.ChangeMaterialGreater:
855 {
856 SourceMaterial.Row row = EClass.sources.materials.alias.TryGetValue(CS$<>8__locals1.actRef.n1, null);
857 if (!CS$<>8__locals1.tc.isThing)
858 {
859 LayerDragGrid.CreateChangeMaterial(CS$<>8__locals1.CC, CS$<>8__locals1.actRef.refThing, row, CS$<>8__locals1.id, state, 0, 1);
860 return;
861 }
862 if (CS$<>8__locals1.tc.Num > 1)
863 {
864 CS$<>8__locals1.tc = CS$<>8__locals1.tc.Split(1);
865 }
866 string name = CS$<>8__locals1.tc.Name;
867 if (row == null)
868 {
869 bool flag3 = CS$<>8__locals1.id == EffectId.ChangeMaterialGreater;
870 bool flag4 = CS$<>8__locals1.id == EffectId.ChangeMaterialLesser;
871 string text4 = CS$<>8__locals1.tc.Thing.source.tierGroup;
872 Dictionary<string, SourceMaterial.TierList> tierMap = SourceMaterial.tierMap;
873 int num = 1;
874 if (flag)
875 {
876 num -= 2;
877 }
878 if (CS$<>8__locals1.blessed)
879 {
880 num++;
881 }
882 if (flag3)
883 {
884 num++;
885 }
886 if (flag4)
887 {
888 num -= 2;
889 }
890 num = Mathf.Clamp(num + EClass.rnd(2), 0, 4);
891 if (EClass.rnd(10) == 0)
892 {
893 text4 = ((text4 == "metal") ? "leather" : "metal");
894 }
895 SourceMaterial.TierList tierList = text4.IsEmpty() ? tierMap.RandomItem<string, SourceMaterial.TierList>() : tierMap[text4];
896 for (int i = 0; i < 1000; i++)
897 {
898 row = tierList.tiers[num].Select();
899 if (row != CS$<>8__locals1.tc.material)
900 {
901 break;
902 }
903 }
904 }
905 CS$<>8__locals1.cc.PlaySound("offering", 1f, true);
906 CS$<>8__locals1.cc.PlayEffect("buff", true, 0f, default(Vector3));
907 CS$<>8__locals1.tc.ChangeMaterial(row);
908 if (CS$<>8__locals1.tc.trait is TraitGene && CS$<>8__locals1.tc.c_DNA != null)
909 {
910 DNA.Type type = DNA.GetType(CS$<>8__locals1.tc.material.alias);
911 CS$<>8__locals1.tc.c_DNA.Generate(type, null);
912 }
913 CS$<>8__locals1.cc.Say("materialChanged", name, row.GetName());
914 if (CS$<>8__locals1.tc.parent == null)
915 {
916 CS$<>8__locals1.CC.Pick(CS$<>8__locals1.tc.Thing, false, true);
917 }
918 CS$<>8__locals1.CC.body.UnqeuipIfTooHeavy(CS$<>8__locals1.tc.Thing);
919 goto IL_1244;
920 }
921 default:
922 {
923 if (id2 != EffectId.Uncurse)
924 {
925 goto IL_1244;
926 }
927 if (!CS$<>8__locals1.tc.isThing)
928 {
929 LayerDragGrid.CreateUncurse(CS$<>8__locals1.CC, state, 0, 1);
930 return;
931 }
932 Thing thing = CS$<>8__locals1.tc.Thing;
933 if (thing.blessedState == BlessedState.Cursed)
934 {
935 thing.SetBlessedState(BlessedState.Normal);
936 }
937 else if (thing.blessedState == BlessedState.Doomed)
938 {
939 thing.SetBlessedState(BlessedState.Normal);
940 }
941 Card rootCard = thing.GetRootCard();
942 if (rootCard != null)
943 {
944 rootCard.TryStack(thing);
945 }
946 LayerInventory.SetDirty(thing);
947 goto IL_1244;
948 }
949 }
950 }
951 else
952 {
953 switch (id2)
954 {
955 case EffectId.EnchantWeapon:
956 case EffectId.EnchantArmor:
957 break;
958 case EffectId.Lighten:
959 {
960 if (!CS$<>8__locals1.tc.isThing)
961 {
962 LayerDragGrid.CreateLighten(CS$<>8__locals1.CC, state, 0, 1);
963 return;
964 }
965 if (CS$<>8__locals1.tc.Num > 1)
966 {
967 CS$<>8__locals1.tc = CS$<>8__locals1.tc.Split(1);
968 }
969 CS$<>8__locals1.cc.PlaySound("offering", 1f, true);
970 CS$<>8__locals1.cc.PlayEffect("buff", true, 0f, default(Vector3));
971 int num2 = CS$<>8__locals1.tc.isWeightChanged ? CS$<>8__locals1.tc.c_weight : CS$<>8__locals1.tc.Thing.source.weight;
972 CS$<>8__locals1.tc.isWeightChanged = true;
973 Element orCreateElement = CS$<>8__locals1.tc.elements.GetOrCreateElement(64);
974 Element orCreateElement2 = CS$<>8__locals1.tc.elements.GetOrCreateElement(65);
975 Element orCreateElement3 = CS$<>8__locals1.tc.elements.GetOrCreateElement(67);
976 Element orCreateElement4 = CS$<>8__locals1.tc.elements.GetOrCreateElement(66);
977 bool flag5 = CS$<>8__locals1.tc.IsEquipmentOrRanged || CS$<>8__locals1.tc.IsThrownWeapon || CS$<>8__locals1.tc.IsAmmo;
978 if (flag)
979 {
980 num2 = (int)(0.01f * (float)num2 * (float)CS$<>8__locals1.power * 0.75f + 500f);
981 if (num2 < 1)
982 {
983 num2 = 1;
984 }
985 if (flag5)
986 {
987 if (CS$<>8__locals1.tc.IsWeapon || CS$<>8__locals1.tc.IsThrownWeapon)
988 {
989 CS$<>8__locals1.tc.elements.ModBase(67, Mathf.Clamp(orCreateElement3.vBase * CS$<>8__locals1.power / 1000, 1, 5));
990 CS$<>8__locals1.tc.elements.ModBase(66, -Mathf.Clamp(orCreateElement4.vBase * CS$<>8__locals1.power / 1000, 1, 5));
991 }
992 else
993 {
994 CS$<>8__locals1.tc.elements.ModBase(65, Mathf.Clamp(orCreateElement2.vBase * CS$<>8__locals1.power / 1000, 1, 5));
995 CS$<>8__locals1.tc.elements.ModBase(64, -Mathf.Clamp(orCreateElement.vBase * CS$<>8__locals1.power / 1000, 1, 5));
996 }
997 }
998 CS$<>8__locals1.cc.Say("lighten_curse", CS$<>8__locals1.cc, CS$<>8__locals1.tc, null, null);
999 }
1000 else
1001 {
1002 num2 = num2 * (100 - CS$<>8__locals1.power / 10) / 100;
1003 if (CS$<>8__locals1.blessed)
1004 {
1005 CS$<>8__locals1.power /= 4;
1006 }
1007 if (flag5)
1008 {
1009 if (CS$<>8__locals1.tc.IsWeapon || CS$<>8__locals1.tc.IsThrownWeapon)
1010 {
1011 CS$<>8__locals1.tc.elements.ModBase(67, -Mathf.Clamp(orCreateElement3.vBase * CS$<>8__locals1.power / 1000, 1, 5));
1012 CS$<>8__locals1.tc.elements.ModBase(66, Mathf.Clamp(orCreateElement4.vBase * CS$<>8__locals1.power / 1000, 1, 5));
1013 }
1014 else
1015 {
1016 CS$<>8__locals1.tc.elements.ModBase(65, -Mathf.Clamp(orCreateElement2.vBase * CS$<>8__locals1.power / 1000, 1, 5));
1017 CS$<>8__locals1.tc.elements.ModBase(64, Mathf.Clamp(orCreateElement.vBase * CS$<>8__locals1.power / 1000, 1, 5));
1018 }
1019 }
1020 CS$<>8__locals1.cc.Say("lighten", CS$<>8__locals1.cc, CS$<>8__locals1.tc, null, null);
1021 }
1022 CS$<>8__locals1.tc.c_weight = num2;
1023 CS$<>8__locals1.tc.SetDirtyWeight();
1024 if (CS$<>8__locals1.tc.parent == null)
1025 {
1026 CS$<>8__locals1.CC.Pick(CS$<>8__locals1.tc.Thing, false, true);
1027 }
1028 CS$<>8__locals1.CC.body.UnqeuipIfTooHeavy(CS$<>8__locals1.tc.Thing);
1029 goto IL_1244;
1030 }
1031 case EffectId.Naming:
1032 case EffectId.Faith:
1033 goto IL_1244;
1034 case EffectId.ForgetItems:
1035 {
1036 CS$<>8__locals1.TC.PlaySound("curse3", 1f, true);
1037 CS$<>8__locals1.TC.PlayEffect("curse", true, 0f, default(Vector3));
1038 CS$<>8__locals1.TC.Say("forgetItems", CS$<>8__locals1.TC, null, null);
1039 int num3 = CS$<>8__locals1.power / 50 + 1 + EClass.rnd(3);
1040 List<Thing> source = CS$<>8__locals1.TC.things.List((Thing t) => t.c_IDTState == 0, false);
1041 for (int j = 0; j < num3; j++)
1042 {
1043 source.RandomItem<Thing>().c_IDTState = 5;
1044 }
1045 goto IL_1244;
1046 }
1047 default:
1048 {
1049 if (id2 != EffectId.ModPotential)
1050 {
1051 goto IL_1244;
1052 }
1053 Element element = CS$<>8__locals1.cc.elements.ListElements((Element e) => e.HasTag("primary"), null).RandomItem<Element>();
1054 CS$<>8__locals1.cc.elements.ModTempPotential(element.id, CS$<>8__locals1.power / 10, 0);
1055 goto IL_1244;
1056 }
1057 }
1058 }
1059 }
1060 else
1061 {
1062 if (id2 <= EffectId.Duplicate)
1063 {
1064 if (id2 == EffectId.AbsorbMana)
1065 {
1066 EClass.game.religions.Element.Talk("ability", null, null);
1067 Dice dice = Dice.Create("ActManaAbsorb", CS$<>8__locals1.power, CS$<>8__locals1.CC, CS$<>8__locals1.actRef.act);
1068 CS$<>8__locals1.CC.mana.Mod(dice.Roll());
1069 CS$<>8__locals1.TC.PlaySound("heal", 1f, true);
1070 CS$<>8__locals1.TC.PlayEffect("heal", true, 0f, default(Vector3));
1071 CS$<>8__locals1.CC.Say("absorbMana", CS$<>8__locals1.CC, null, null);
1072 goto IL_1244;
1073 }
1074 switch (id2)
1075 {
1076 case EffectId.Exterminate:
1077 {
1078 CS$<>8__locals1.CC.PlaySound("clean_floor", 1f, true);
1079 Msg.Say("exterminate");
1080 List<Chara> list7 = (from c in EClass._map.charas
1081 where c.isCopy && !c.IsPCFaction
1082 select c).ToList<Chara>();
1083 if (list7.Count == 0)
1084 {
1085 Msg.SayNothingHappen();
1086 return;
1087 }
1088 using (List<Chara>.Enumerator enumerator = list7.GetEnumerator())
1089 {
1090 while (enumerator.MoveNext())
1091 {
1092 Chara chara = enumerator.Current;
1093 chara.Say("split_fail", chara, null, null);
1094 chara.PlayEffect("vanish", true, 0f, default(Vector3));
1095 chara.Die(null, null, AttackSource.None);
1096 }
1097 goto IL_1244;
1098 }
1099 break;
1100 }
1101 case EffectId.Earthquake:
1102 case EffectId.Boost:
1103 case EffectId.RemoveHex:
1104 case EffectId.RemoveHexAll:
1105 goto IL_1244;
1106 case EffectId.MagicMap:
1107 if (!CS$<>8__locals1.CC.IsPC)
1108 {
1109 CS$<>8__locals1.CC.SayNothingHappans();
1110 goto IL_1244;
1111 }
1112 if (flag)
1113 {
1114 CS$<>8__locals1.CC.Say("abMagicMap_curse", CS$<>8__locals1.CC, null, null);
1115 CS$<>8__locals1.CC.PlaySound("curse3", 1f, true);
1116 CS$<>8__locals1.CC.PlayEffect("curse", true, 0f, default(Vector3));
1117 CS$<>8__locals1.CC.AddCondition<ConConfuse>(200, true);
1118 goto IL_1244;
1119 }
1120 CS$<>8__locals1.CC.Say("abMagicMap", CS$<>8__locals1.CC, null, null);
1121 CS$<>8__locals1.CC.PlayEffect("identify", true, 0f, default(Vector3));
1122 CS$<>8__locals1.CC.PlaySound("identify", 1f, true);
1123 if (CS$<>8__locals1.blessed)
1124 {
1125 EClass._map.RevealAll(true);
1126 goto IL_1244;
1127 }
1128 EClass._map.Reveal(CS$<>8__locals1.CC.pos, CS$<>8__locals1.power);
1129 goto IL_1244;
1130 case EffectId.Escape:
1131 if (CS$<>8__locals1.CC.IsPCFaction || (EClass._zone.Boss == CS$<>8__locals1.CC && EClass.rnd(20) != 0))
1132 {
1133 return;
1134 }
1135 CS$<>8__locals1.CC.Say("escape", CS$<>8__locals1.CC, null, null);
1136 CS$<>8__locals1.CC.PlaySound("escape", 1f, true);
1137 if (EClass._zone.Boss == CS$<>8__locals1.CC)
1138 {
1139 CS$<>8__locals1.CC.TryDropBossLoot();
1140 }
1141 CS$<>8__locals1.CC.Destroy();
1142 goto IL_1244;
1143 case EffectId.EnchantWeaponGreat:
1144 case EffectId.EnchantArmorGreat:
1145 goto IL_71A;
1146 case EffectId.Duplicate:
1147 {
1148 Point randomPoint = CS$<>8__locals1.CC.pos.GetRandomPoint(2, false, false, false, 200);
1149 if (randomPoint == null || randomPoint.Equals(CS$<>8__locals1.CC.pos) || !randomPoint.IsValid || EClass._zone.IsRegion || CS$<>8__locals1.CC.HasCondition<ConPoison>() || CS$<>8__locals1.CC.HasCondition<ConConfuse>() || CS$<>8__locals1.CC.HasCondition<ConDim>() || CS$<>8__locals1.CC.HasCondition<ConParalyze>() || CS$<>8__locals1.CC.HasCondition<ConSleep>() || CS$<>8__locals1.CC.HasCondition<ConBurning>() || CS$<>8__locals1.CC.HasCondition<ConFreeze>() || CS$<>8__locals1.CC.HasCondition<ConMiasma>())
1150 {
1151 CS$<>8__locals1.CC.Say("split_fail", CS$<>8__locals1.CC, null, null);
1152 return;
1153 }
1154 Chara t3 = CS$<>8__locals1.CC.Duplicate();
1155 EClass._zone.AddCard(t3, randomPoint);
1156 CS$<>8__locals1.CC.Say("split", CS$<>8__locals1.CC, null, null);
1157 goto IL_1244;
1158 }
1159 default:
1160 goto IL_1244;
1161 }
1162 }
1163 else if (id2 != EffectId.Reconstruction)
1164 {
1165 if (id2 != EffectId.DropMine)
1166 {
1167 goto IL_1244;
1168 }
1169 }
1170 else
1171 {
1172 if (!CS$<>8__locals1.tc.isThing)
1173 {
1174 LayerDragGrid.CreateReconstruction(CS$<>8__locals1.CC, state, 0, 1);
1175 return;
1176 }
1177 if (CS$<>8__locals1.tc.Num > 1)
1178 {
1179 CS$<>8__locals1.tc = CS$<>8__locals1.tc.Split(1);
1180 }
1181 CS$<>8__locals1.cc.PlaySound("mutation", 1f, true);
1182 CS$<>8__locals1.cc.PlayEffect("identify", true, 0f, default(Vector3));
1183 CS$<>8__locals1.cc.Say("reconstruct", CS$<>8__locals1.cc, CS$<>8__locals1.tc, null, null);
1184 Thing thing2 = ThingGen.Create(CS$<>8__locals1.tc.id, -1, CS$<>8__locals1.tc.LV * CS$<>8__locals1.power / 100);
1185 thing2.SetBlessedState(state);
1186 CS$<>8__locals1.tc.Destroy();
1187 CS$<>8__locals1.CC.Pick(thing2, false, true);
1188 if (!CS$<>8__locals1.CC.IsPC)
1189 {
1190 CS$<>8__locals1.CC.TryEquip(thing2, false);
1191 goto IL_1244;
1192 }
1193 goto IL_1244;
1194 }
1195 if (CS$<>8__locals1.CC.pos.Installed != null || EClass._zone.IsPCFaction)
1196 {
1197 return;
1198 }
1199 Thing thing3 = ThingGen.Create("mine", -1, -1);
1200 thing3.c_idRefCard = "dog_mine";
1201 Zone.ignoreSpawnAnime = true;
1202 EClass._zone.AddCard(thing3, CS$<>8__locals1.CC.pos).Install();
1203 goto IL_1244;
1204 }
1205 IL_71A:
1206 bool armor = CS$<>8__locals1.id == EffectId.EnchantArmor || CS$<>8__locals1.id == EffectId.EnchantArmorGreat;
1207 bool flag6 = CS$<>8__locals1.id == EffectId.EnchantWeaponGreat || CS$<>8__locals1.id == EffectId.EnchantArmorGreat;
1208 if (!CS$<>8__locals1.tc.isThing)
1209 {
1210 LayerDragGrid.CreateEnchant(CS$<>8__locals1.CC, armor, flag6, state, 1);
1211 return;
1212 }
1213 CS$<>8__locals1.cc.PlaySound("identify", 1f, true);
1214 CS$<>8__locals1.cc.PlayEffect("identify", true, 0f, default(Vector3));
1215 if (flag)
1216 {
1217 CS$<>8__locals1.cc.Say("enc_curse", CS$<>8__locals1.tc, null, null);
1218 CS$<>8__locals1.tc.ModEncLv(-1);
1219 }
1220 else
1221 {
1222 int num4 = (flag6 ? 4 : 2) + (CS$<>8__locals1.blessed ? 1 : 0);
1223 if (CS$<>8__locals1.tc.encLV >= num4)
1224 {
1225 CS$<>8__locals1.cc.Say("enc_resist", CS$<>8__locals1.tc, null, null);
1226 }
1227 else
1228 {
1229 CS$<>8__locals1.cc.Say("enc", CS$<>8__locals1.tc, null, null);
1230 CS$<>8__locals1.tc.ModEncLv(1);
1231 }
1232 }
1233 IL_1244:
1234 if (CS$<>8__locals1.TC == null)
1235 {
1236 return;
1237 }
1238 id2 = CS$<>8__locals1.id;
1239 switch (id2)
1240 {
1241 case EffectId.Booze:
1242 CS$<>8__locals1.TC.AddCondition<ConDrunk>(CS$<>8__locals1.power, false);
1243 if (CS$<>8__locals1.TC.HasElement(1215, 1))
1244 {
1245 CS$<>8__locals1.TC.Say("drunk_dwarf", CS$<>8__locals1.TC, null, null);
1246 CS$<>8__locals1.TC.AddCondition(Condition.Create<ConBuffStats>(CS$<>8__locals1.power + EClass.rnd(CS$<>8__locals1.power), delegate(ConBuffStats con)
1247 {
1248 con.SetRefVal(Element.List_MainAttributes.RandomItem<int>(), (int)CS$<>8__locals1.id);
1249 }), false);
1250 return;
1251 }
1252 break;
1253 case EffectId.Drink:
1254 case EffectId.DrinkRamune:
1255 case EffectId.DrinkMilk:
1256 if (CS$<>8__locals1.id == EffectId.DrinkRamune)
1257 {
1258 CS$<>8__locals1.TC.Say("drinkRamune", CS$<>8__locals1.TC, null, null);
1259 }
1260 if (CS$<>8__locals1.TC.IsPC)
1261 {
1262 CS$<>8__locals1.TC.Say("drinkGood", CS$<>8__locals1.TC, null, null);
1263 }
1264 if (CS$<>8__locals1.id == EffectId.DrinkMilk)
1265 {
1266 if (CS$<>8__locals1.TC.IsPC)
1267 {
1268 CS$<>8__locals1.TC.Say("drinkMilk", CS$<>8__locals1.TC, null, null);
1269 }
1270 if (CS$<>8__locals1.blessed)
1271 {
1272 CS$<>8__locals1.TC.ModHeight(EClass.rnd(5) + 3);
1273 return;
1274 }
1275 if (flag)
1276 {
1277 CS$<>8__locals1.TC.ModHeight((EClass.rnd(5) + 3) * -1);
1278 return;
1279 }
1280 }
1281 break;
1282 case EffectId.DrinkWater:
1283 if (flag)
1284 {
1285 if (CS$<>8__locals1.TC.IsPC)
1286 {
1287 CS$<>8__locals1.TC.Say("drinkWater_dirty", CS$<>8__locals1.TC, null, null);
1288 }
1289 TraitWell.BadEffect(CS$<>8__locals1.TC);
1290 return;
1291 }
1292 if (CS$<>8__locals1.TC.IsPC)
1293 {
1294 CS$<>8__locals1.TC.Say("drinkWater_clear", CS$<>8__locals1.TC, null, null);
1295 return;
1296 }
1297 break;
1298 case EffectId.DrinkWaterDirty:
1299 if (CS$<>8__locals1.TC.IsPC)
1300 {
1301 CS$<>8__locals1.TC.Say("drinkWater_dirty", CS$<>8__locals1.TC, null, null);
1302 }
1303 if (CS$<>8__locals1.TC.IsPCFaction)
1304 {
1305 CS$<>8__locals1.TC.Vomit();
1306 return;
1307 }
1308 break;
1309 case EffectId.SaltWater:
1310 if (CS$<>8__locals1.TC.HasElement(1211, 1))
1311 {
1312 CS$<>8__locals1.TC.Say("drinkSaltWater_snail", CS$<>8__locals1.TC, null, null);
1313 int dmg = (CS$<>8__locals1.TC.hp > 10) ? (CS$<>8__locals1.TC.hp - EClass.rnd(10)) : 10000;
1314 CS$<>8__locals1.TC.DamageHP(dmg, AttackSource.None, CS$<>8__locals1.CC);
1315 return;
1316 }
1317 if (CS$<>8__locals1.TC.IsPC)
1318 {
1319 CS$<>8__locals1.TC.Say("drinkSaltWater", CS$<>8__locals1.TC, null, null);
1320 return;
1321 }
1322 break;
1323 default:
1324 {
1325 switch (id2)
1326 {
1327 case EffectId.Heal:
1328 goto IL_2805;
1329 case EffectId.RestoreBody:
1330 case EffectId.RestoreMind:
1331 {
1332 bool flag7 = CS$<>8__locals1.id == EffectId.RestoreBody;
1333 if (flag)
1334 {
1335 CS$<>8__locals1.<Proc>g__Redirect|0(flag7 ? EffectId.DamageBodyGreat : EffectId.DamageMindGreat, BlessedState.Normal, default(ActRef));
1336 return;
1337 }
1338 CS$<>8__locals1.TC.Say(flag7 ? "restoreBody" : "restoreMind", CS$<>8__locals1.TC, null, null);
1339 CS$<>8__locals1.TC.PlaySound("heal", 1f, true);
1340 CS$<>8__locals1.TC.PlayEffect("heal", true, 0f, default(Vector3));
1341 CS$<>8__locals1.TC.CureHost(flag7 ? CureType.CureBody : CureType.CureMind, CS$<>8__locals1.power, state);
1342 if (CS$<>8__locals1.blessed)
1343 {
1344 CS$<>8__locals1.<Proc>g__Redirect|0(flag7 ? EffectId.EnhanceBodyGreat : EffectId.EnhanceMindGreat, BlessedState.Normal, default(ActRef));
1345 return;
1346 }
1347 return;
1348 }
1349 case EffectId.DamageBody:
1350 case EffectId.DamageMind:
1351 case EffectId.DamageBodyGreat:
1352 case EffectId.DamageMindGreat:
1353 break;
1354 case EffectId.EnhanceBody:
1355 case EffectId.EnhanceMind:
1356 case EffectId.EnhanceBodyGreat:
1357 case EffectId.EnhanceMindGreat:
1358 {
1359 bool flag8 = CS$<>8__locals1.id == EffectId.EnhanceBody || CS$<>8__locals1.id == EffectId.EnhanceBodyGreat;
1360 bool mind = CS$<>8__locals1.id == EffectId.EnhanceMind || CS$<>8__locals1.id == EffectId.EnhanceMindGreat;
1361 int num5 = (CS$<>8__locals1.id == EffectId.EnhanceBody || CS$<>8__locals1.id == EffectId.EnhanceMind) ? 1 : (4 + EClass.rnd(4));
1362 CS$<>8__locals1.TC.Say(flag8 ? "enhanceBody" : "enhanceMind", CS$<>8__locals1.TC, null, null);
1363 CS$<>8__locals1.TC.PlayEffect("buff", true, 0f, default(Vector3));
1364 CS$<>8__locals1.TC.PlaySound("buff", 1f, true);
1365 for (int k = 0; k < num5; k++)
1366 {
1367 CS$<>8__locals1.TC.EnhanceTempElements(CS$<>8__locals1.power, flag8, mind);
1368 }
1369 return;
1370 }
1371 case EffectId.Revive:
1372 {
1373 List<KeyValuePair<int, Chara>> list2 = (from a in EClass.game.cards.globalCharas
1374 where a.Value.isDead && a.Value.faction == EClass.pc.faction && !a.Value.isSummon && a.Value.GetInt(103, null) != 0
1375 select a).ToList<KeyValuePair<int, Chara>>();
1376 if (CS$<>8__locals1.TC.IsPCFaction || CS$<>8__locals1.TC.IsPCFactionMinion)
1377 {
1378 if (CS$<>8__locals1.TC.IsPC && list2.Count == 0)
1379 {
1380 list2 = (from a in EClass.game.cards.globalCharas
1381 where a.Value.isDead && a.Value.faction == EClass.pc.faction && !a.Value.isSummon
1382 select a).ToList<KeyValuePair<int, Chara>>();
1383 }
1384 if (list2.Count > 0)
1385 {
1386 list2.RandomItem<KeyValuePair<int, Chara>>().Value.Chara.GetRevived();
1387 return;
1388 }
1389 }
1390 CS$<>8__locals1.TC.SayNothingHappans();
1391 return;
1392 }
1393 default:
1394 switch (id2)
1395 {
1396 case EffectId.Sleep:
1397 if (CS$<>8__locals1.blessed)
1398 {
1399 CS$<>8__locals1.power /= 4;
1400 }
1401 CS$<>8__locals1.TC.AddCondition<ConSleep>(CS$<>8__locals1.power, false);
1402 if (flag)
1403 {
1404 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.Disease, BlessedState.Normal, default(ActRef));
1405 return;
1406 }
1407 return;
1408 case EffectId.Paralyze:
1409 if (CS$<>8__locals1.blessed)
1410 {
1411 CS$<>8__locals1.power /= 4;
1412 }
1413 CS$<>8__locals1.TC.AddCondition<ConParalyze>(CS$<>8__locals1.power, false);
1414 if (flag)
1415 {
1416 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.Blind, BlessedState.Normal, default(ActRef));
1417 return;
1418 }
1419 return;
1420 case EffectId.Blind:
1421 if (CS$<>8__locals1.blessed)
1422 {
1423 CS$<>8__locals1.power /= 4;
1424 }
1425 CS$<>8__locals1.TC.AddCondition<ConBlind>(CS$<>8__locals1.power, false);
1426 if (flag)
1427 {
1428 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.Confuse, BlessedState.Normal, default(ActRef));
1429 return;
1430 }
1431 return;
1432 case EffectId.Confuse:
1433 if (CS$<>8__locals1.blessed)
1434 {
1435 CS$<>8__locals1.power /= 4;
1436 }
1437 CS$<>8__locals1.TC.AddCondition<ConConfuse>(CS$<>8__locals1.power, false);
1438 if (flag)
1439 {
1440 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.Fear, BlessedState.Normal, default(ActRef));
1441 return;
1442 }
1443 return;
1444 case EffectId.Poison:
1445 if (CS$<>8__locals1.blessed)
1446 {
1447 CS$<>8__locals1.power /= 4;
1448 }
1449 CS$<>8__locals1.TC.AddCondition<ConPoison>(CS$<>8__locals1.power, false);
1450 if (flag)
1451 {
1452 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.Paralyze, BlessedState.Normal, default(ActRef));
1453 return;
1454 }
1455 return;
1456 case EffectId.Faint:
1457 if (CS$<>8__locals1.blessed)
1458 {
1459 CS$<>8__locals1.power /= 4;
1460 }
1461 CS$<>8__locals1.TC.AddCondition<ConFaint>(CS$<>8__locals1.power, false);
1462 if (flag)
1463 {
1464 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.Disease, BlessedState.Normal, default(ActRef));
1465 return;
1466 }
1467 return;
1468 case EffectId.Fear:
1469 if (CS$<>8__locals1.blessed)
1470 {
1471 CS$<>8__locals1.power /= 4;
1472 }
1473 CS$<>8__locals1.TC.AddCondition<ConFear>(CS$<>8__locals1.power, false);
1474 if (flag)
1475 {
1476 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.Confuse, BlessedState.Normal, default(ActRef));
1477 return;
1478 }
1479 return;
1480 case EffectId.Disease:
1481 if (CS$<>8__locals1.blessed)
1482 {
1483 CS$<>8__locals1.power /= 4;
1484 }
1485 CS$<>8__locals1.TC.AddCondition<ConDisease>(CS$<>8__locals1.power, false);
1486 if (flag)
1487 {
1488 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.Poison, BlessedState.Normal, default(ActRef));
1489 return;
1490 }
1491 return;
1492 case EffectId.Acid:
1493 {
1494 if (CS$<>8__locals1.blessed)
1495 {
1496 CS$<>8__locals1.power /= 4;
1497 }
1498 List<Thing> list3 = CS$<>8__locals1.TC.things.List((Thing t) => t.Num <= 1 && t.IsEquipmentOrRanged && !t.IsToolbelt && !t.IsLightsource && t.isEquipped, false);
1499 if (list3.Count == 0)
1500 {
1501 return;
1502 }
1503 Thing thing4 = list3.RandomItem<Thing>();
1504 CS$<>8__locals1.TC.Say("acid_hit", CS$<>8__locals1.TC, null, null);
1505 if (thing4.isAcidproof)
1506 {
1507 CS$<>8__locals1.TC.Say("acid_nullify", thing4, null, null);
1508 }
1509 else if (thing4.encLV > -5)
1510 {
1511 CS$<>8__locals1.TC.Say("acid_rust", CS$<>8__locals1.TC, thing4, null, null);
1512 thing4.ModEncLv(-1);
1513 LayerInventory.SetDirty(thing4);
1514 }
1515 if (CS$<>8__locals1.TC.IsPCParty)
1516 {
1517 Tutorial.Reserve("rust", null);
1518 return;
1519 }
1520 return;
1521 }
1522 case EffectId.HealComplete:
1523 Dice.Create("SpHealLight", CS$<>8__locals1.power, CS$<>8__locals1.CC, CS$<>8__locals1.actRef.act);
1524 CS$<>8__locals1.TC.HealHPHost(9999, HealSource.Magic);
1525 CS$<>8__locals1.TC.CureHost(CureType.HealComplete, CS$<>8__locals1.power, state);
1526 CS$<>8__locals1.TC.Say("heal_heavy", CS$<>8__locals1.TC, null, null);
1527 return;
1528 case EffectId.BuffStats:
1529 case EffectId.DebuffStats:
1530 case EffectId.LulwyTrick:
1531 Debug.Log(string.Concat(new string[]
1532 {
1533 CS$<>8__locals1.power.ToString(),
1534 "/",
1535 CS$<>8__locals1.id.ToString(),
1536 "/",
1537 CS$<>8__locals1.actRef.n1
1538 }));
1539 if (CS$<>8__locals1.id == EffectId.LulwyTrick)
1540 {
1541 EClass.game.religions.Wind.Talk("ability", null, null);
1542 }
1543 if (CS$<>8__locals1.power < 0 || CS$<>8__locals1.id == EffectId.DebuffStats)
1544 {
1545 CS$<>8__locals1.power = Mathf.Abs(CS$<>8__locals1.power);
1546 if (CS$<>8__locals1.blessed)
1547 {
1548 CS$<>8__locals1.power /= 4;
1549 }
1550 flag = true;
1551 }
1552 CS$<>8__locals1.TC.AddCondition(Condition.Create<ConBuffStats>(CS$<>8__locals1.power, delegate(ConBuffStats con)
1553 {
1554 con.SetRefVal(Element.GetId(CS$<>8__locals1.actRef.n1), (int)CS$<>8__locals1.id);
1555 }), false);
1556 return;
1557 case EffectId.Wish:
1558 if (CS$<>8__locals1.TC.IsPC)
1559 {
1560 Msg.Say("wishHappen");
1561 Dialog.InputName("dialogWish", "q", delegate(bool cancel, string text)
1562 {
1563 if (!cancel)
1564 {
1565 Msg.Say("wish", CS$<>8__locals1.TC, text, null, null);
1566 ActEffect.Wish(text, EClass.pc.NameTitled, CS$<>8__locals1.power);
1567 }
1568 }, Dialog.InputType.Default);
1569 return;
1570 }
1571 return;
1572 case EffectId.Ally:
1573 {
1574 Msg.Say("gainAlly");
1575 Chara chara2 = CharaGen.CreateFromFilter("chara", EClass.pc.LV, -1);
1576 EClass._zone.AddCard(chara2, CS$<>8__locals1.cc.pos.GetNearestPoint(false, false, true, false));
1577 chara2.MakeAlly(false);
1578 chara2.PlaySound("identify", 1f, true);
1579 chara2.PlayEffect("teleport", true, 0f, default(Vector3));
1580 return;
1581 }
1582 case EffectId.CatsEye:
1583 if (flag)
1584 {
1585 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.Blind, BlessedState.Normal, default(ActRef));
1586 return;
1587 }
1588 CS$<>8__locals1.TC.AddCondition<ConNightVision>(CS$<>8__locals1.power, false);
1589 return;
1590 case EffectId.LevelDown:
1591 Msg.Say("nothingHappens");
1592 return;
1593 case EffectId.Love:
1594 if (flag)
1595 {
1596 if (CS$<>8__locals1.CC == CS$<>8__locals1.TC)
1597 {
1598 CS$<>8__locals1.TC.Say("love_curse_self", CS$<>8__locals1.TC, null, null);
1599 }
1600 else
1601 {
1602 CS$<>8__locals1.TC.Say("love_curse", CS$<>8__locals1.CC, CS$<>8__locals1.TC, null, null);
1603 CS$<>8__locals1.TC.ModAffinity(CS$<>8__locals1.CC, -CS$<>8__locals1.power / 4, false);
1604 }
1605 CS$<>8__locals1.TC.ShowEmo(Emo.angry, 0f, true);
1606 return;
1607 }
1608 ActEffect.LoveMiracle(CS$<>8__locals1.TC, CS$<>8__locals1.CC, CS$<>8__locals1.power);
1609 return;
1610 case EffectId.Uncurse:
1611 case EffectId.EnchantWeapon:
1612 case EffectId.EnchantArmor:
1613 case EffectId.Lighten:
1614 case EffectId.Naming:
1615 case EffectId.ForgetItems:
1616 case EffectId.Breathe:
1617 case EffectId.Ball:
1618 case EffectId.Explosive:
1619 case EffectId.BallBubble:
1620 case EffectId.Bolt:
1621 case EffectId.Arrow:
1622 case EffectId.Hand:
1623 case EffectId.Funnel:
1624 case EffectId.Summon:
1625 case EffectId.ModPotential:
1626 case EffectId.Bubble:
1627 case EffectId.Web:
1628 case EffectId.MistOfDarkness:
1629 case EffectId.Puddle:
1630 case EffectId.AbsorbMana:
1631 case EffectId.Meteor:
1632 case EffectId.Exterminate:
1633 case EffectId.Earthquake:
1634 case EffectId.MagicMap:
1635 case EffectId.Escape:
1636 case EffectId.Boost:
1637 case EffectId.EnchantWeaponGreat:
1638 case EffectId.EnchantArmorGreat:
1639 case EffectId.Duplicate:
1640 case EffectId.Suicide:
1641 case EffectId.Reconstruction:
1642 case EffectId.DrainBlood:
1643 case EffectId.Scream:
1644 case EffectId.DropMine:
1645 return;
1646 case EffectId.UncurseEQ:
1647 case EffectId.UncurseEQGreater:
1648 {
1649 CS$<>8__locals1.TC.Say("uncurseEQ" + (CS$<>8__locals1.blessed ? "_bless" : (flag ? "_curse" : "")), CS$<>8__locals1.TC, null, null);
1650 CS$<>8__locals1.TC.PlaySound("uncurse", 1f, true);
1651 CS$<>8__locals1.TC.PlayEffect("uncurse", true, 0f, default(Vector3));
1652 if (flag)
1653 {
1654 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.CurseEQ, BlessedState.Normal, default(ActRef));
1655 return;
1656 }
1657 int success = 0;
1658 int fail = 0;
1659 List<Thing> list = new List<Thing>();
1660 CS$<>8__locals1.TC.things.Foreach(delegate(Thing t)
1661 {
1662 int num11 = 0;
1663 if (!t.isEquipped && !t.IsRangedWeapon && !CS$<>8__locals1.blessed)
1664 {
1665 return;
1666 }
1667 if (t.blessedState >= BlessedState.Normal)
1668 {
1669 return;
1670 }
1671 if (t.blessedState == BlessedState.Cursed)
1672 {
1673 num11 = EClass.rnd(200);
1674 }
1675 if (t.blessedState == BlessedState.Doomed)
1676 {
1677 num11 = EClass.rnd(1000);
1678 }
1679 if (CS$<>8__locals1.blessed)
1680 {
1681 num11 /= 2;
1682 }
1683 if (CS$<>8__locals1.id == EffectId.UncurseEQGreater)
1684 {
1685 num11 /= 10;
1686 }
1687 int num12;
1688 if (CS$<>8__locals1.power >= num11)
1689 {
1690 CS$<>8__locals1.TC.Say("uncurseEQ_success", t, null, null);
1691 t.SetBlessedState(BlessedState.Normal);
1692 if (t.isEquipped && t.HasElement(656, 1))
1693 {
1694 CS$<>8__locals1.TC.body.Unequip(t, true);
1695 }
1696 LayerInventory.SetDirty(t);
1697 num12 = success;
1698 success = num12 + 1;
1699 list.Add(t);
1700 return;
1701 }
1702 num12 = fail;
1703 fail = num12 + 1;
1704 }, true);
1705 foreach (Thing thing5 in list)
1706 {
1707 Card rootCard2 = thing5.GetRootCard();
1708 if (rootCard2 != null)
1709 {
1710 rootCard2.TryStack(thing5);
1711 }
1712 }
1713 if (success == 0 && fail == 0)
1714 {
1715 CS$<>8__locals1.TC.SayNothingHappans();
1716 return;
1717 }
1718 if (fail > 0)
1719 {
1720 CS$<>8__locals1.TC.Say("uncurseEQ_fail", null, null);
1721 return;
1722 }
1723 return;
1724 }
1725 case EffectId.CurseEQ:
1726 {
1727 if (CS$<>8__locals1.CC != null && CS$<>8__locals1.CC != CS$<>8__locals1.TC)
1728 {
1729 CS$<>8__locals1.TC.Say("curse", CS$<>8__locals1.CC, CS$<>8__locals1.TC, null, null);
1730 }
1731 CS$<>8__locals1.TC.PlaySound("curse3", 1f, true);
1732 CS$<>8__locals1.TC.PlayEffect("curse", true, 0f, default(Vector3));
1733 if (EClass.rnd(150 + CS$<>8__locals1.TC.LUC * 5 + CS$<>8__locals1.TC.Evalue(972) * 20) >= CS$<>8__locals1.power + (flag ? 200 : 0) || CS$<>8__locals1.TC.TryNullifyCurse())
1734 {
1735 return;
1736 }
1737 List<Thing> list4 = CS$<>8__locals1.TC.things.List((Thing t) => t.isEquipped && t.blessedState != BlessedState.Doomed && !t.IsToolbelt && (t.blessedState < BlessedState.Blessed || EClass.rnd(10) == 0), false);
1738 if (list4.Count == 0)
1739 {
1740 CS$<>8__locals1.CC.SayNothingHappans();
1741 return;
1742 }
1743 Thing thing6 = list4.RandomItem<Thing>();
1744 CS$<>8__locals1.TC.Say("curse_hit", CS$<>8__locals1.TC, thing6, null, null);
1745 thing6.SetBlessedState((thing6.blessedState == BlessedState.Cursed) ? BlessedState.Doomed : BlessedState.Cursed);
1746 LayerInventory.SetDirty(thing6);
1747 return;
1748 }
1749 case EffectId.HolyVeil:
1750 if (flag)
1751 {
1752 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.Fear, BlessedState.Normal, default(ActRef));
1753 return;
1754 }
1755 CS$<>8__locals1.TC.AddCondition<ConHolyVeil>(CS$<>8__locals1.power, false);
1756 return;
1757 case EffectId.Faith:
1758 {
1759 Religion faith = CS$<>8__locals1.tc.Chara.faith;
1760 if (faith.IsEyth)
1761 {
1762 CS$<>8__locals1.tc.SayNothingHappans();
1763 return;
1764 }
1765 CS$<>8__locals1.tc.PlayEffect("aura_heaven", true, 0f, default(Vector3));
1766 CS$<>8__locals1.tc.PlaySound("aura_heaven", 1f, true);
1767 CS$<>8__locals1.tc.Say("faith", CS$<>8__locals1.tc, faith.Name, null);
1768 if (flag)
1769 {
1770 CS$<>8__locals1.tc.Say("faith_curse", CS$<>8__locals1.tc, faith.Name, null);
1771 return;
1772 }
1773 if (CS$<>8__locals1.blessed)
1774 {
1775 CS$<>8__locals1.tc.Say("faith_bless", CS$<>8__locals1.tc, faith.Name, null);
1776 }
1777 CS$<>8__locals1.tc.ModExp(306, CS$<>8__locals1.power * 10);
1778 CS$<>8__locals1.tc.ModExp(85, CS$<>8__locals1.power * 10);
1779 if (CS$<>8__locals1.tc.elements.Base(85) >= CS$<>8__locals1.tc.elements.Value(306))
1780 {
1781 CS$<>8__locals1.tc.elements.SetBase(85, CS$<>8__locals1.tc.elements.Value(306), 0);
1782 return;
1783 }
1784 return;
1785 }
1786 case EffectId.Hero:
1787 if (flag)
1788 {
1789 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.Fear, BlessedState.Normal, default(ActRef));
1790 return;
1791 }
1792 CS$<>8__locals1.TC.AddCondition<ConHero>(CS$<>8__locals1.power, false);
1793 return;
1794 case EffectId.Acidproof:
1795 if (CS$<>8__locals1.blessed)
1796 {
1797 CS$<>8__locals1.power /= 4;
1798 }
1799 if (CS$<>8__locals1.TC.IsPC)
1800 {
1801 CS$<>8__locals1.TC.Say("pc_pain", null, null);
1802 }
1803 CS$<>8__locals1.TC.Say("drink_acid", CS$<>8__locals1.TC, null, null);
1804 CS$<>8__locals1.TC.DamageHP(CS$<>8__locals1.power / 5, 923, CS$<>8__locals1.power, AttackSource.None, null, true);
1805 return;
1806 case EffectId.Levitate:
1807 if (flag)
1808 {
1809 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.Gravity, BlessedState.Normal, default(ActRef));
1810 return;
1811 }
1812 CS$<>8__locals1.TC.AddCondition<ConLevitate>(CS$<>8__locals1.power, false);
1813 return;
1814 case EffectId.Gravity:
1815 if (CS$<>8__locals1.blessed)
1816 {
1817 CS$<>8__locals1.power /= 4;
1818 }
1819 CS$<>8__locals1.TC.AddCondition<ConGravity>(CS$<>8__locals1.power, false);
1820 if (flag)
1821 {
1822 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.BuffStats, BlessedState.Cursed, new ActRef
1823 {
1824 aliasEle = "STR"
1825 });
1826 return;
1827 }
1828 return;
1829 case EffectId.Mutation:
1830 CS$<>8__locals1.TC.MutateRandom(1, 100, false, state);
1831 if (EClass.core.config.game.waitOnDebuff)
1832 {
1833 EClass.Wait(0.3f, CS$<>8__locals1.TC);
1834 return;
1835 }
1836 return;
1837 case EffectId.CureMutation:
1838 CS$<>8__locals1.TC.MutateRandom(-1, 100, false, state);
1839 return;
1840 case EffectId.TransGender:
1841 {
1842 CS$<>8__locals1.tc.PlaySound("mutation", 1f, true);
1843 CS$<>8__locals1.tc.PlayEffect("mutation", true, 0f, default(Vector3));
1844 int gender = CS$<>8__locals1.tc.bio.gender;
1845 int gender2 = (gender == 2) ? 1 : ((gender == 1) ? 2 : ((EClass.rnd(2) == 0) ? 2 : 1));
1846 if (gender != 0 && EClass.rnd(10) == 0)
1847 {
1848 gender2 = 0;
1849 }
1850 CS$<>8__locals1.tc.bio.SetGender(gender2);
1851 CS$<>8__locals1.tc.Say("transGender", CS$<>8__locals1.tc, Gender.Name(CS$<>8__locals1.tc.bio.gender), null);
1852 CS$<>8__locals1.tc.Talk("tail", null, null, false);
1853 if (CS$<>8__locals1.blessed && CS$<>8__locals1.tc.bio.age > 1)
1854 {
1855 CS$<>8__locals1.tc.Say("ageDown", CS$<>8__locals1.tc, null, null);
1856 Biography bio = CS$<>8__locals1.tc.bio;
1857 int num6 = bio.age;
1858 bio.age = num6 - 1;
1859 return;
1860 }
1861 if (flag)
1862 {
1863 CS$<>8__locals1.tc.Say("ageUp", CS$<>8__locals1.tc, null, null);
1864 Biography bio2 = CS$<>8__locals1.tc.bio;
1865 int num6 = bio2.age;
1866 bio2.age = num6 + 1;
1867 return;
1868 }
1869 return;
1870 }
1871 case EffectId.Buff:
1872 {
1873 string text2 = CS$<>8__locals1.actRef.n1;
1874 string text3 = "";
1875 if (flag)
1876 {
1877 text3 = EClass.sources.stats.alias[text2].curse;
1878 if (!text3.IsEmpty())
1879 {
1880 text2 = text3;
1881 }
1882 }
1883 Condition condition = Condition.Create(text2, CS$<>8__locals1.power, delegate(Condition con)
1884 {
1885 if (!CS$<>8__locals1.actRef.aliasEle.IsEmpty())
1886 {
1887 con.SetElement(EClass.sources.elements.alias[CS$<>8__locals1.actRef.aliasEle].id);
1888 }
1889 });
1890 condition.isPerfume = (CS$<>8__locals1.TC.IsPC && CS$<>8__locals1.actRef.isPerfume);
1891 Condition condition2 = CS$<>8__locals1.TC.AddCondition(condition, false);
1892 if (condition2 != null && condition2.isPerfume)
1893 {
1894 condition2.value = 3;
1895 Msg.Say("perfume", CS$<>8__locals1.TC, null, null, null);
1896 }
1897 if (!text3.IsEmpty())
1898 {
1899 CS$<>8__locals1.CC.DoHostileAction(CS$<>8__locals1.TC, false);
1900 return;
1901 }
1902 return;
1903 }
1904 case EffectId.Debuff:
1905 {
1906 CS$<>8__locals1.CC.DoHostileAction(CS$<>8__locals1.TC, false);
1907 bool isPowerful = CS$<>8__locals1.TC.IsPowerful;
1908 string n = CS$<>8__locals1.actRef.n1;
1909 int power2 = CS$<>8__locals1.power;
1910 int num7 = CS$<>8__locals1.TC.WIL * (isPowerful ? 20 : 5);
1911 ConHolyVeil condition3 = CS$<>8__locals1.TC.GetCondition<ConHolyVeil>();
1912 if (condition3 != null)
1913 {
1914 num7 += condition3.power * 5;
1915 }
1916 if (EClass.rnd(power2) < num7 / EClass.sources.stats.alias[n].hexPower && EClass.rnd(10) != 0)
1917 {
1918 CS$<>8__locals1.TC.Say("debuff_resist", CS$<>8__locals1.TC, null, null);
1919 CS$<>8__locals1.CC.DoHostileAction(CS$<>8__locals1.TC, false);
1920 return;
1921 }
1922 CS$<>8__locals1.TC.AddCondition(Condition.Create(n, CS$<>8__locals1.power, delegate(Condition con)
1923 {
1924 con.givenByPcParty = CS$<>8__locals1.CC.IsPCParty;
1925 if (!CS$<>8__locals1.actRef.aliasEle.IsEmpty())
1926 {
1927 con.SetElement(EClass.sources.elements.alias[CS$<>8__locals1.actRef.aliasEle].id);
1928 }
1929 }), false);
1930 if (n == "ConBane" && CS$<>8__locals1.CC.HasElement(1416, 1))
1931 {
1932 CS$<>8__locals1.TC.AddCondition<ConExcommunication>(CS$<>8__locals1.power, false);
1933 }
1934 CS$<>8__locals1.CC.DoHostileAction(CS$<>8__locals1.TC, false);
1935 if (EClass.core.config.game.waitOnDebuff && !CS$<>8__locals1.CC.IsPC)
1936 {
1937 EClass.Wait(0.3f, CS$<>8__locals1.TC);
1938 return;
1939 }
1940 return;
1941 }
1942 case EffectId.Weaken:
1943 break;
1944 case EffectId.NeckHunt:
1945 CS$<>8__locals1.CC.TryNeckHunt(CS$<>8__locals1.TC, CS$<>8__locals1.power, false);
1946 return;
1947 case EffectId.PuddleEffect:
1948 CS$<>8__locals1.TC.DamageHP(CS$<>8__locals1.power / 5, CS$<>8__locals1.actRef.idEle, CS$<>8__locals1.power, AttackSource.None, null, true);
1949 return;
1950 case EffectId.RemedyJure:
1951 CS$<>8__locals1.TC.HealHP(1000000, HealSource.Magic);
1952 CS$<>8__locals1.TC.CureHost(CureType.Jure, CS$<>8__locals1.power, state);
1953 CS$<>8__locals1.TC.Say("heal_jure", CS$<>8__locals1.TC, null, null);
1954 return;
1955 case EffectId.JureHeal:
1956 goto IL_2805;
1957 case EffectId.KizuamiTrick:
1958 {
1959 EClass.game.religions.Trickery.Talk("ability", null, null);
1960 bool hex = CS$<>8__locals1.CC.IsHostile(CS$<>8__locals1.TC);
1961 List<SourceStat.Row> list5 = (from con in EClass.sources.stats.rows
1962 where con.tag.Contains("random") && con.@group == (hex ? "Debuff" : "Buff")
1963 select con).ToList<SourceStat.Row>();
1964 int power3 = CS$<>8__locals1.power;
1965 for (int l = 0; l < 4 + EClass.rnd(2); l++)
1966 {
1967 SourceStat.Row row2 = list5.RandomItem<SourceStat.Row>();
1968 list5.Remove(row2);
1969 ActEffect.Proc(hex ? EffectId.Debuff : EffectId.Buff, CS$<>8__locals1.CC, CS$<>8__locals1.TC, power3, new ActRef
1970 {
1971 n1 = row2.alias
1972 });
1973 }
1974 if (EClass.core.config.game.waitOnDebuff && !CS$<>8__locals1.CC.IsPC)
1975 {
1976 EClass.Wait(0.3f, CS$<>8__locals1.TC);
1977 return;
1978 }
1979 return;
1980 }
1981 case EffectId.CureCorruption:
1982 CS$<>8__locals1.TC.PlaySound("heal", 1f, true);
1983 CS$<>8__locals1.TC.PlayEffect("heal", true, 0f, default(Vector3));
1984 if (flag)
1985 {
1986 CS$<>8__locals1.TC.Say("cureCorruption_curse", CS$<>8__locals1.TC, null, null);
1987 CS$<>8__locals1.TC.mana.Mod(9999);
1988 CS$<>8__locals1.TC.ModCorruption(CS$<>8__locals1.power);
1989 return;
1990 }
1991 CS$<>8__locals1.TC.Say("cureCorruption", CS$<>8__locals1.TC, null, null);
1992 CS$<>8__locals1.TC.ModCorruption(-CS$<>8__locals1.power * 2);
1993 return;
1994 case EffectId.Headpat:
1995 CS$<>8__locals1.CC.Cuddle(CS$<>8__locals1.TC, true);
1996 return;
1997 case EffectId.RemoveHex:
1998 case EffectId.RemoveHexAll:
1999 if (flag)
2000 {
2001 CS$<>8__locals1.<Proc>g__Redirect|0(EffectId.CurseEQ, BlessedState.Normal, default(ActRef));
2002 return;
2003 }
2004 foreach (Condition condition4 in CS$<>8__locals1.TC.conditions.Copy<Condition>())
2005 {
2006 if (condition4.Type == ConditionType.Debuff && !condition4.IsKilled && EClass.rnd(CS$<>8__locals1.power * 2) > EClass.rnd(condition4.power))
2007 {
2008 CS$<>8__locals1.CC.Say("removeHex", CS$<>8__locals1.TC, condition4.Name.ToLower(), null);
2009 condition4.Kill(false);
2010 if (CS$<>8__locals1.id == EffectId.RemoveHex)
2011 {
2012 break;
2013 }
2014 }
2015 }
2016 CS$<>8__locals1.TC.AddCondition<ConHolyVeil>(CS$<>8__locals1.power / 2, false);
2017 return;
2018 case EffectId.ShutterHex:
2019 {
2020 if (!CS$<>8__locals1.CC.IsHostile(CS$<>8__locals1.TC))
2021 {
2022 return;
2023 }
2024 int hex = 0;
2025 using (List<Condition>.Enumerator enumerator4 = CS$<>8__locals1.TC.conditions.GetEnumerator())
2026 {
2027 while (enumerator4.MoveNext())
2028 {
2029 if (enumerator4.Current.Type == ConditionType.Debuff)
2030 {
2031 int num6 = hex;
2032 hex = num6 + 1;
2033 }
2034 }
2035 }
2036 if (hex == 0)
2037 {
2038 CS$<>8__locals1.CC.SayNothingHappans();
2039 return;
2040 }
2041 CS$<>8__locals1.TC.pos.PlayEffect("holyveil");
2042 CS$<>8__locals1.TC.pos.PlaySound("holyveil", true, 1f, true);
2043 CS$<>8__locals1.TC.pos.PlaySound("atk_eleSound", true, 1f, true);
2044 CS$<>8__locals1.TC.conditions.ForeachReverse(delegate(Condition c)
2045 {
2046 if (c.Type == ConditionType.Debuff)
2047 {
2048 c.Kill(false);
2049 }
2050 });
2051 CS$<>8__locals1.TC.Say("abShutterHex", CS$<>8__locals1.TC, null, null);
2052 CS$<>8__locals1.TC.pos.ForeachNeighbor(delegate(Point p)
2053 {
2054 foreach (Chara chara3 in p.ListCharas())
2055 {
2056 if (!chara3.IsHostile(CS$<>8__locals1.CC))
2057 {
2058 break;
2059 }
2060 int dmg2 = Dice.Create("SpShutterHex", CS$<>8__locals1.power * hex, CS$<>8__locals1.CC, CS$<>8__locals1.actRef.act).Roll();
2061 chara3.DamageHP(dmg2, 919, CS$<>8__locals1.power, AttackSource.None, CS$<>8__locals1.CC, true);
2062 }
2063 }, true);
2064 return;
2065 }
2066 case EffectId.Draw:
2067 {
2068 Point randomPoint2 = CS$<>8__locals1.CC.pos.GetRandomPoint(1, true, true, false, 100);
2069 Point point = (randomPoint2 != null) ? randomPoint2.GetNearestPoint(false, false, true, false) : null;
2070 if (point == null || !CS$<>8__locals1.CC.CanSeeLos(point, -1))
2071 {
2072 return;
2073 }
2074 CS$<>8__locals1.CC.Say("abDraw", CS$<>8__locals1.CC, CS$<>8__locals1.TC, null, null);
2075 if (CS$<>8__locals1.TC.HasCondition<ConGravity>())
2076 {
2077 CS$<>8__locals1.CC.SayNothingHappans();
2078 return;
2079 }
2080 CS$<>8__locals1.TC.MoveImmediate(point, !EClass.core.config.camera.smoothFollow, true);
2081 if (CS$<>8__locals1.CC.id == "tentacle")
2082 {
2083 CS$<>8__locals1.TC.AddCondition<ConEntangle>(100, false);
2084 return;
2085 }
2086 return;
2087 }
2088 case EffectId.Steal:
2089 {
2090 if (EClass._zone.instance is ZoneInstanceBout)
2091 {
2092 return;
2093 }
2094 if (CS$<>8__locals1.TC.Evalue(426) > 0)
2095 {
2096 CS$<>8__locals1.TC.Say((CS$<>8__locals1.actRef.n1 == "money") ? "abStealNegateMoney" : "abStealNegate", CS$<>8__locals1.TC, null, null);
2097 return;
2098 }
2099 Thing thing7 = null;
2100 bool flag9 = CS$<>8__locals1.actRef.n1 == "food";
2101 if (CS$<>8__locals1.actRef.n1 == "money")
2102 {
2103 int num8 = CS$<>8__locals1.TC.GetCurrency("money");
2104 if (num8 > 0)
2105 {
2106 num8 = Mathf.Clamp(EClass.rnd(num8 / 10), 1, EClass.rndHalf(CS$<>8__locals1.CC.LV * 200));
2107 thing7 = ThingGen.Create("money", -1, -1).SetNum(num8);
2108 CS$<>8__locals1.TC.ModCurrency(-num8, "money");
2109 }
2110 }
2111 else
2112 {
2113 Func<Thing, bool> func = (Thing t) => true;
2114 if (flag9)
2115 {
2116 func = ((Thing t) => t.IsFood);
2117 }
2118 List<Thing> list6 = CS$<>8__locals1.TC.things.List(delegate(Thing t)
2119 {
2120 Card parentCard = t.parentCard;
2121 return !(((parentCard != null) ? parentCard.trait : null) is TraitChestMerchant) && !(t.trait is TraitTool) && (t.trait.CanBeDestroyed && t.things.Count == 0 && t.invY != 1 && t.trait.CanBeStolen && !t.trait.CanOnlyCarry && !t.IsUnique && !t.isEquipped && t.blessedState == BlessedState.Normal) && func(t);
2122 }, true);
2123 if (list6.Count > 0)
2124 {
2125 thing7 = list6.RandomItem<Thing>();
2126 if (thing7.Num > 1)
2127 {
2128 thing7 = thing7.Split(1);
2129 }
2130 }
2131 }
2132 if (thing7 == null)
2133 {
2134 CS$<>8__locals1.CC.Say("abStealNothing", CS$<>8__locals1.CC, CS$<>8__locals1.TC, null, null);
2135 return;
2136 }
2137 thing7.SetInt(116, 1);
2138 CS$<>8__locals1.TC.PlaySound(thing7.material.GetSoundDrop(thing7.sourceCard), 1f, true);
2139 CS$<>8__locals1.CC.Pick(thing7, false, true);
2140 CS$<>8__locals1.CC.Say("abSteal", CS$<>8__locals1.CC, CS$<>8__locals1.TC, thing7.Name, null);
2141 if (!(CS$<>8__locals1.actRef.n1 == "food"))
2142 {
2143 CS$<>8__locals1.CC.Say("abStealEscape", CS$<>8__locals1.CC, null, null);
2144 CS$<>8__locals1.CC.Teleport(ActEffect.GetTeleportPos(CS$<>8__locals1.tc.pos, 30), true, false);
2145 return;
2146 }
2147 if (CS$<>8__locals1.CC.hunger.value != 0)
2148 {
2149 CS$<>8__locals1.CC.InstantEat(thing7, true);
2150 return;
2151 }
2152 return;
2153 }
2154 case EffectId.ThrowPotion:
2155 if (!CS$<>8__locals1.CC.pos.Equals(CS$<>8__locals1.TC.pos))
2156 {
2157 Thing t2 = ThingGen.Create(new string[]
2158 {
2159 "330",
2160 "331",
2161 "334",
2162 "335",
2163 "336",
2164 "1142"
2165 }.RandomItem<string>(), -1, -1);
2166 ActThrow.Throw(CS$<>8__locals1.CC, CS$<>8__locals1.TC.pos, t2, ThrowMethod.Punish, 0.7f);
2167 return;
2168 }
2169 return;
2170 default:
2171 return;
2172 }
2173 break;
2174 }
2175 bool flag10 = CS$<>8__locals1.id == EffectId.DamageBody || CS$<>8__locals1.id == EffectId.DamageBodyGreat;
2176 bool mind2 = CS$<>8__locals1.id == EffectId.DamageMind || CS$<>8__locals1.id == EffectId.DamageMindGreat;
2177 int num9 = (CS$<>8__locals1.id == EffectId.DamageBody || CS$<>8__locals1.id == EffectId.DamageMind) ? 1 : (4 + EClass.rnd(4));
2178 if (CS$<>8__locals1.id == EffectId.Weaken)
2179 {
2180 flag10 = (EClass.rnd(2) == 0);
2181 mind2 = !flag10;
2182 num9 = 1;
2183 }
2184 else
2185 {
2186 CS$<>8__locals1.TC.PlayEffect("debuff", true, 0f, default(Vector3));
2187 CS$<>8__locals1.TC.PlaySound("debuff", 1f, true);
2188 }
2189 CS$<>8__locals1.TC.Say(flag10 ? "damageBody" : "damageMind", CS$<>8__locals1.TC, null, null);
2190 for (int m = 0; m < num9; m++)
2191 {
2192 CS$<>8__locals1.TC.DamageTempElements(CS$<>8__locals1.power, flag10, mind2);
2193 }
2194 if (CS$<>8__locals1.TC.IsPC)
2195 {
2196 Tutorial.Play("healer");
2197 return;
2198 }
2199 break;
2200 IL_2805:
2201 if (CS$<>8__locals1.id == EffectId.JureHeal)
2202 {
2203 EClass.game.religions.Healing.Talk("ability", null, null);
2204 }
2205 int num10 = Dice.Create((CS$<>8__locals1.actRef.act != null && EClass.sources.calc.map.ContainsKey(CS$<>8__locals1.actRef.act.ID)) ? CS$<>8__locals1.actRef.act.ID : "SpHealLight", CS$<>8__locals1.power, CS$<>8__locals1.CC, CS$<>8__locals1.actRef.act).Roll();
2206 if (flag)
2207 {
2208 CS$<>8__locals1.TC.DamageHP(num10 / 2, 919, CS$<>8__locals1.power, AttackSource.None, null, true);
2209 return;
2210 }
2211 CS$<>8__locals1.TC.HealHPHost(num10, HealSource.Magic);
2212 CS$<>8__locals1.TC.CureHost(CureType.Heal, CS$<>8__locals1.power, state);
2213 CS$<>8__locals1.TC.Say((CS$<>8__locals1.power >= 300) ? "heal_heavy" : "heal_light", CS$<>8__locals1.TC, null, null);
2214 return;
2215 }
2216 }
2217 }
2218
2219 // Token: 0x06000C7D RID: 3197 RVA: 0x00062118 File Offset: 0x00060318
2220 public static void Poison(Chara tc, Chara c, int power)
2221 {
2222 tc.Say("eat_poison", tc, null, null);
2223 tc.Talk("scream", null, null, false);
2224 int num = (int)Mathf.Sqrt((float)(power * 100));
2225 tc.DamageHP(num * 2 + EClass.rnd(num), 915, power, AttackSource.None, null, true);
2226 if (!tc.isDead && !tc.IsPC)
2227 {
2228 EClass.player.ModKarma(-5);
2229 }
2230 }
2231
2232 // Token: 0x06000C7E RID: 3198 RVA: 0x00062184 File Offset: 0x00060384
2233 public static void LoveMiracle(Chara tc, Chara c, int power)
2234 {
2235 if (c == tc)
2236 {
2237 tc.Say("love_ground", tc, null, null);
2238 }
2239 else
2240 {
2241 tc.Say("love_chara", c, tc, null, null);
2242 }
2243 tc.ModAffinity(EClass.pc, power / 4, true);
2244 if (EClass.rnd(2) == 0)
2245 {
2246 return;
2247 }
2248 if (EClass.rnd(2) == 0)
2249 {
2250 tc.MakeMilk(true, 1, true);
2251 return;
2252 }
2253 tc.MakeEgg(true, 1, true);
2254 }
2255
2256 // Token: 0x06000C7F RID: 3199 RVA: 0x000621EC File Offset: 0x000603EC
2257 public static Point GetTeleportPos(Point org, int radius = 6)
2258 {
2259 Point point = new Point();
2260 for (int i = 0; i < 10000; i++)
2261 {
2262 point.Set(org);
2263 point.x += EClass.rnd(radius) - EClass.rnd(radius);
2264 point.z += EClass.rnd(radius) - EClass.rnd(radius);
2265 if (point.IsValid && point.IsInBounds && !point.cell.blocked && point.Distance(org) >= radius / 3 + 1 && !point.cell.HasZoneStairs(true))
2266 {
2267 return point;
2268 }
2269 }
2270 return org.GetRandomNeighbor().GetNearestPoint(false, true, true, false);
2271 }
2272
2273 // Token: 0x06000C80 RID: 3200 RVA: 0x00062298 File Offset: 0x00060498
2274 public static bool Wish(string s, string name, int power)
2275 {
2276 Msg.thirdPerson1.Set(EClass.pc, false);
2277 string netMsg = GameLang.Parse("wish".langGame(), true, name, s, null, null);
2278 bool net = EClass.core.config.net.enable && EClass.core.config.net.sendEvent;
2279 List<ActEffect.WishItem> list = new List<ActEffect.WishItem>();
2280 int wishLv = 10 + power / 4;
2281 int wishValue = power * 200;
2282 Debug.Log(power.ToString() + "/" + wishValue.ToString());
2283 string _s = s.ToLower();
2284 using (List<CardRow>.Enumerator enumerator = EClass.sources.cards.rows.GetEnumerator())
2285 {
2286 while (enumerator.MoveNext())
2287 {
2288 CardRow r = enumerator.Current;
2289 if (r.quality >= 4 || r.HasTag(CTAG.noWish))
2290 {
2291 string id = r.id;
2292 if (!(id == "medal") && !(id == "plat") && !(id == "money") && !(id == "money2"))
2293 {
2294 continue;
2295 }
2296 }
2297 if (!r.isChara)
2298 {
2299 string text = r.GetName(1).ToLower();
2300 int score = ActEffect.Compare(_s, text);
2301 if (score != 0)
2302 {
2303 list.Add(new ActEffect.WishItem
2304 {
2305 score = score,
2306 n = text,
2307 action = delegate()
2308 {
2309 Debug.Log(r.id);
2310 SourceCategory.Row category = EClass.sources.cards.map[r.id].Category;
2311 if (category.IsChildOf("weapon") || category.IsChildOf("armor") || category.IsChildOf("ranged"))
2312 {
2313 CardBlueprint.SetRarity(Rarity.Legendary);
2314 }
2315 Thing thing = ThingGen.Create(r.id, -1, wishLv);
2316 int num = 1;
2317 string id2 = thing.id;
2318 if (!(id2 == "rod_wish"))
2319 {
2320 if (!(id2 == "money"))
2321 {
2322 if (!(id2 == "plat"))
2323 {
2324 if (!(id2 == "money2"))
2325 {
2326 if (id2 == "medal")
2327 {
2328 num = EClass.rndHalf(wishValue / 3000 + 4);
2329 }
2330 }
2331 else
2332 {
2333 num = EClass.rndHalf(wishValue / 1000 + 4);
2334 }
2335 }
2336 else
2337 {
2338 num = EClass.rndHalf(wishValue / 2000 + 4);
2339 }
2340 }
2341 else
2342 {
2343 num = EClass.rndHalf(wishValue);
2344 }
2345 }
2346 else
2347 {
2348 thing.c_charges = 0;
2349 }
2350 if (num < 1)
2351 {
2352 num = 1;
2353 }
2354 if (num == 1 && thing.trait.CanStack)
2355 {
2356 int num2 = wishValue;
2357 for (int i = 0; i < 1000; i++)
2358 {
2359 int num3 = thing.GetPrice(CurrencyType.Money, false, PriceType.Default, null) + 500 + i * 200;
2360 if (num2 > num3)
2361 {
2362 num++;
2363 num2 -= num3;
2364 }
2365 }
2366 }
2367 if (thing.trait is TraitDeed)
2368 {
2369 num = 1;
2370 }
2371 thing.SetNum(num);
2372 Debug.Log(string.Concat(new string[]
2373 {
2374 _s,
2375 "/",
2376 num.ToString(),
2377 "/",
2378 score.ToString()
2379 }));
2380 EClass._zone.AddCard(thing, EClass.pc.pos);
2381 netMsg = netMsg + Lang.space + GameLang.Parse("wishNet".langGame(), Msg.IsThirdPerson(thing), Msg.GetName(thing).ToTitleCase(false), null, null, null);
2382 if (net)
2383 {
2384 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
2385 }
2386 Msg.Say("dropReward");
2387 }
2388 });
2389 }
2390 }
2391 }
2392 }
2393 if (list.Count == 0)
2394 {
2395 netMsg = netMsg + Lang.space + "wishFail".langGame();
2396 if (net)
2397 {
2398 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
2399 }
2400 Msg.Say("wishFail");
2401 return false;
2402 }
2403 list.Sort((ActEffect.WishItem a, ActEffect.WishItem b) => b.score - a.score);
2404 foreach (ActEffect.WishItem wishItem in list)
2405 {
2406 Debug.Log(string.Concat(new string[]
2407 {
2408 wishItem.score.ToString(),
2409 "/",
2410 s,
2411 "/",
2412 wishItem.n
2413 }));
2414 }
2415 list[0].action();
2416 return true;
2417 }
2418
2419 // Token: 0x06000C81 RID: 3201 RVA: 0x000625AC File Offset: 0x000607AC
2420 public static int Compare(string s, string t)
2421 {
2422 if (s.IsEmpty())
2423 {
2424 return 0;
2425 }
2426 int num = 0;
2427 if (t == s)
2428 {
2429 num += 100;
2430 }
2431 if (t.Contains(s))
2432 {
2433 num += 100;
2434 }
2435 return num;
2436 }
2437
2438 // Token: 0x04000CC4 RID: 3268
2439 public static int RapidCount;
2440
2441 // Token: 0x04000CC5 RID: 3269
2442 public static float RapidDelay;
2443
2444 // Token: 0x04000CC6 RID: 3270
2445 public static int angle = 20;
2446
2447 // Token: 0x0200089D RID: 2205
2448 private class WishItem
2449 {
2450 // Token: 0x040024C7 RID: 9415
2451 public string n;
2452
2453 // Token: 0x040024C8 RID: 9416
2454 public int score;
2455
2456 // Token: 0x040024C9 RID: 9417
2457 public Action action;
2458 }
2459}
Definition Act.2.cs:7
Definition Card.cs:13
Definition Chara.cs:12
Definition DNA.cs:9
Definition Dice.cs:7
Definition Msg.cs:7
Definition Net.cs:12
Definition Point.cs:11
Definition Thing.cs:10