Elin Decompiled Documentation EA 23.211 Nightly Patch 1
Loading...
Searching...
No Matches
ActEffect.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using UnityEngine;
5
6public class ActEffect : EClass
7{
8 private class WishItem
9 {
10 public string n;
11
12 public int score;
13
14 public Action action;
15 }
16
17 public static int RapidCount;
18
19 public static float RapidDelay;
20
21 public static int angle = 20;
22
23 public static void TryDelay(Action a)
24 {
25 if (RapidCount == 0)
26 {
27 a();
28 return;
29 }
30 TweenUtil.Delay((float)RapidCount * RapidDelay, delegate
31 {
32 a();
33 });
34 }
35
36 public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Point> points, ActRef actref, string lang = null)
37 {
38 if (points.Count == 0)
39 {
41 return false;
42 }
44 {
45 Debug.Log(e.source.alias);
46 e = Element.Create(0, 1);
47 }
48 ElementRef elementRef = EClass.setting.elements[e.source.alias];
49 int num = actref.act?.ElementPowerMod ?? 50;
50 int num2 = 0;
51 Point point = CC.pos.Copy();
52 List<Card> list = new List<Card>();
53 bool flag = false;
54 if (id == EffectId.Explosive && actref.refThing != null)
55 {
56 power = power * actref.refThing.material.hardness / 10;
57 }
58 string text = id.ToString();
59 string text2 = (EClass.sources.calc.map.ContainsKey(text) ? text : (EClass.sources.calc.map.ContainsKey("Sp" + text) ? ("Sp" + text) : (text.ToLowerInvariant() + "_")));
60 foreach (Point p in points)
61 {
62 bool flag2 = true;
63 AttackSource attackSource = AttackSource.None;
64 switch (id)
65 {
66 case EffectId.Explosive:
67 text2 = "ball_";
68 flag = false;
69 break;
70 case EffectId.BallBubble:
71 text2 = "ball_";
72 break;
73 case EffectId.Earthquake:
74 text2 = "SpEarthquake";
75 flag2 = false;
76 flag = true;
77 break;
78 case EffectId.Meteor:
79 text2 = "SpMeteor";
80 break;
81 default:
82 if (CC.isChara && p.Equals(CC.pos) && points.Count >= 2)
83 {
84 continue;
85 }
86 break;
87 case EffectId.Suicide:
88 break;
89 }
90 Effect effect = null;
91 Effect effect2 = (flag2 ? Effect.Get("trail1") : null);
92 Point from = p;
93 switch (id)
94 {
95 case EffectId.Arrow:
96 case EffectId.MoonSpear:
97 case EffectId.MoonArrow:
98 {
99 effect = Effect.Get((id == EffectId.MoonSpear || id == EffectId.MoonArrow) ? "spell_moonspear" : "spell_arrow");
100 if (id == EffectId.Arrow)
101 {
102 effect.sr.color = elementRef.colorSprite;
103 }
104 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
105 Color startColor = (componentInChildren.endColor = elementRef.colorSprite);
106 componentInChildren.startColor = startColor;
107 from = CC.pos;
108 break;
109 }
110 case EffectId.Earthquake:
111 {
112 if (EClass.rnd(4) == 0 && p.IsSync)
113 {
114 effect = Effect.Get("smoke_earthquake");
115 }
116 float num3 = 0.06f * (float)CC.pos.Distance(p);
117 Point pos = p.Copy();
118 TweenUtil.Tween(num3, null, delegate
119 {
120 pos.Animate(AnimeID.Quake, animeBlock: true);
121 });
122 if (effect != null)
123 {
124 effect.SetStartDelay(num3);
125 }
126 break;
127 }
128 default:
129 {
130 effect = Effect.Get("Element/ball_" + ((e.id == 0) ? "Void" : e.source.alias.Remove(0, 3)));
131 if (effect == null)
132 {
133 effect = Effect.Get("Element/ball_Fire");
134 }
135 float startDelay = ((id == EffectId.Meteor) ? 0.1f : 0.04f) * (float)CC.pos.Distance(p);
136 effect.SetStartDelay(startDelay);
137 effect2.SetStartDelay(startDelay);
138 break;
139 }
140 }
141 if (effect2 != null)
142 {
143 effect2.SetParticleColor(elementRef.colorTrail, changeMaterial: true, "_TintColor").Play(from);
144 }
145 if (effect != null)
146 {
147 if (id == EffectId.Arrow || id == EffectId.MoonSpear || id == EffectId.MoonArrow)
148 {
149 TryDelay(delegate
150 {
151 effect.Play(CC.pos, 0f, p);
152 });
153 }
154 else
155 {
156 TryDelay(delegate
157 {
158 effect.Play(p).Flip(p.x > CC.pos.x);
159 });
160 }
161 }
162 bool flag3 = false;
163 if (CC.IsPCFactionOrMinion && (CC.HasElement(1651) || EClass.pc.Evalue(1651) >= 2))
164 {
165 bool flag4 = false;
166 foreach (Card item in p.ListCards())
167 {
168 if (item.isChara)
169 {
170 if (item.IsPCFactionOrMinion)
171 {
172 flag4 = true;
173 }
174 }
175 else if ((e.id != 910 && e.id != 911) || !item.IsFood || !item.category.IsChildOf("foodstuff"))
176 {
177 flag4 = true;
178 }
179 }
180 flag3 = flag4;
181 }
182 if (!flag3)
183 {
184 if (e.id == 910)
185 {
186 EClass._map.TryShatter(p, 910, power);
187 }
188 if (e.id == 911)
189 {
190 EClass._map.TryShatter(p, 911, power);
191 }
192 }
193 foreach (Card item2 in p.ListCards().ToList())
194 {
195 Card c = item2;
196 if ((!c.isChara && !c.trait.CanBeAttacked) || (c.IsMultisize && item2 == CC) || (c.isChara && (c.Chara.host == CC || c.Chara.parasite == CC || c.Chara.ride == CC)))
197 {
198 continue;
199 }
200 switch (id)
201 {
202 case EffectId.Arrow:
203 case EffectId.Hand:
204 case EffectId.Sword:
205 case EffectId.MoonSpear:
206 case EffectId.MoonArrow:
207 if (c.isChara && CC.isChara)
208 {
209 c.Chara.RequestProtection(CC.Chara, delegate(Chara a)
210 {
211 c = a;
212 });
213 }
214 if (id == EffectId.MoonSpear || (id == EffectId.MoonArrow && EClass.rnd(5) == 0))
215 {
216 attackSource = AttackSource.MoonSpear;
217 }
218 break;
219 }
220 switch (id)
221 {
222 case EffectId.Arrow:
223 attackSource = AttackSource.MagicArrow;
224 break;
225 case EffectId.Hand:
226 attackSource = AttackSource.MagicHand;
227 break;
228 case EffectId.Sword:
229 attackSource = AttackSource.MagicSword;
230 break;
231 }
232 long num4 = 0L;
233 bool isChara = CC.isChara;
234 if (id == EffectId.Suicide)
235 {
236 num4 = CC.MaxHP * 2;
237 num4 = num4 * 100 / (50 + point.Distance(p) * 75);
238 if ((c.HasCondition<ConBrightnessOfLife>() || c.HasTag(CTAG.suicide)) && !c.HasCondition<ConWet>() && !c.IsPowerful)
239 {
240 list.Add(c);
241 }
242 }
243 else
244 {
245 Dice dice = Dice.Create(text2, power, CC, (actref.refThing != null) ? null : actref.act);
246 if (dice == null)
247 {
248 Debug.Log(text2);
249 }
250 num4 = dice.Roll();
251 switch (id)
252 {
253 case EffectId.Earthquake:
254 if (c.HasCondition<ConGravity>())
255 {
256 num4 = dice.RollMax() * 2;
257 }
258 else if (c.isChara && c.Chara.IsLevitating)
259 {
260 num4 /= 2;
261 }
262 break;
263 case EffectId.Sword:
264 num4 = num4 * (int)Mathf.Min(70f + Mathf.Sqrt(CC.Evalue(101)) * 3f, 200f) / 100;
265 break;
266 }
267 if (id == EffectId.Ball || id == EffectId.BallBubble || id == EffectId.Explosive)
268 {
269 num4 = num4 * 100 / (90 + point.Distance(p) * 10);
270 }
271 }
272 if (id == EffectId.Sword)
273 {
274 c.PlaySound("ab_magicsword");
275 c.PlayEffect("hit_slash");
276 }
277 if ((actref.noFriendlyFire && !CC.Chara.IsHostile(c as Chara)) || (flag && c == CC))
278 {
279 continue;
280 }
281 if (isChara && points.Count > 1 && c != null && c.isChara && CC.isChara && CC.Chara.IsFriendOrAbove(c.Chara))
282 {
283 int num5 = CC.Evalue(302);
284 if (!CC.IsPC && CC.IsPCFactionOrMinion)
285 {
286 num5 += EClass.pc.Evalue(302);
287 }
288 if (CC.HasElement(1214))
289 {
290 num5 *= 2;
291 }
292 if (num5 > 0)
293 {
294 if (num5 * 10 > EClass.rnd(num4 + 1))
295 {
296 if (c == c.pos.FirstChara)
297 {
298 CC.ModExp(302, CC.IsPC ? 10 : 50);
299 }
300 continue;
301 }
302 num4 = EClass.rnd(num4 * 100 / (100 + num5 * 10 + 1));
303 if (c == c.pos.FirstChara)
304 {
305 CC.ModExp(302, CC.IsPC ? 20 : 100);
306 }
307 if (num4 == 0L)
308 {
309 continue;
310 }
311 }
312 if ((CC.HasElement(1214) || (!CC.IsPC && (CC.IsPCFaction || CC.IsPCFactionMinion) && EClass.pc.HasElement(1214))) && EClass.rnd(5) != 0)
313 {
314 continue;
315 }
316 }
317 if (!lang.IsEmpty())
318 {
319 if (lang == "spell_hand")
320 {
321 string[] list2 = Lang.GetList("attack" + (CC.isChara ? CC.Chara.race.meleeStyle.IsEmpty("Touch") : "Touch"));
322 string @ref = "_elehand".lang(e.source.GetAltname(2), list2[4]);
323 CC.Say(c.IsPCParty ? "cast_hand_ally" : "cast_hand", CC, c, @ref, c.IsPCParty ? list2[1] : list2[2]);
324 }
325 else
326 {
327 CC.Say(lang + "_hit", CC, c, e.Name.ToLower());
328 }
329 }
330 Chara chara = (CC.isChara ? CC.Chara : ((actref.refThing != null) ? EClass._map.FindChara(actref.refThing.c_uidRefCard) : null));
331 if (c.IsMultisize)
332 {
333 switch (id)
334 {
335 case EffectId.Ball:
336 case EffectId.Explosive:
337 case EffectId.BallBubble:
338 case EffectId.Meteor:
339 case EffectId.Earthquake:
340 case EffectId.Suicide:
341 num4 /= 2;
342 break;
343 }
344 }
345 if (RapidCount > 0)
346 {
347 num4 = num4 * 100 / (100 + RapidCount * 50);
348 }
349 num4 = num4 * Act.powerMod / 100;
350 if (num4 > 9999999)
351 {
352 num4 = 9999999L;
353 }
354 c.DamageHP((int)num4, e.id, power * num / 100, attackSource, chara ?? CC);
355 if (c.IsAliveInCurrentZone && CC.IsAliveInCurrentZone && id == EffectId.DrainMana && c.isChara && CC.isChara && c.Chara.mana.value > 0)
356 {
357 long num6 = num4 * num / 100;
358 Debug.Log(num4 + " v:" + num6 + " evalue:" + e.Value + " power:" + power + " elepMod:" + num);
359 if (num6 > c.Chara.mana.value)
360 {
361 num6 = c.Chara.mana.value;
362 }
363 c.Chara.mana.Mod((int)(-num6));
364 CC.Chara.mana.Mod((int)num6);
365 }
366 if (id == EffectId.Explosive && CC.trait is TraitCookerMicrowave)
367 {
368 chara = EClass.pc;
369 }
370 if (chara != null && chara.IsAliveInCurrentZone)
371 {
372 chara.DoHostileAction(c);
373 }
374 num2++;
375 }
376 if ((id == EffectId.Explosive || id == EffectId.Suicide) && ((id != EffectId.Suicide && id != EffectId.Meteor) || !EClass._zone.IsPCFaction))
377 {
378 int num7 = id switch
379 {
380 EffectId.Suicide => CC.LV / 3 + 40,
381 EffectId.Meteor => 50 + power / 20,
382 _ => (actref.refThing != null) ? actref.refThing.material.hardness : (30 + power / 20),
383 };
384 bool flag5 = EClass._zone.HasLaw && !EClass._zone.IsPCFaction && (CC.IsPC || (id == EffectId.Explosive && actref.refThing == null)) && !(EClass._zone is Zone_Vernis);
385 if (p.HasObj && p.cell.matObj.hardness <= num7)
386 {
388 if (flag5)
389 {
391 }
392 }
393 if (!p.HasObj && p.HasBlock && p.matBlock.hardness <= num7)
394 {
396 if (flag5)
397 {
399 }
400 }
401 }
402 if (e.id == 910)
403 {
404 int num8 = 0;
405 if (id == EffectId.Meteor)
406 {
407 num8 = 2;
408 }
410 {
411 num8 = 0;
412 }
413 if (num8 > EClass.rnd(10))
414 {
415 p.ModFire(4 + EClass.rnd(10));
416 }
417 }
418 if (e.id == 911)
419 {
420 p.ModFire(-20, extinguish: true);
421 }
422 }
423 if (RapidCount == 0)
424 {
425 foreach (Card item3 in list)
426 {
427 if (item3.ExistsOnMap)
428 {
429 RapidCount += 2;
430 ProcAt(id, power, BlessedState.Normal, item3, null, item3.pos, isNeg: true, actref);
431 }
432 }
433 }
434 return num2 > 0;
435 }
436
437 public static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef = default(ActRef))
438 {
439 Chara CC = cc.Chara;
440 bool flag = state <= BlessedState.Cursed;
441 bool flag2 = isNeg || flag;
442 Element element = Element.Create(actRef.aliasEle.IsEmpty("eleFire"), power / 10);
444 {
445 angle += 5;
446 if (angle > 100)
447 {
448 angle = 30;
449 }
450 Debug.Log(angle);
451 }
452 switch (id)
453 {
454 case EffectId.Earthquake:
455 {
456 List<Point> list3 = EClass._map.ListPointsInCircle(CC.pos, 12f, mustBeWalkable: false);
457 if (list3.Count == 0)
458 {
459 list3.Add(CC.pos.Copy());
460 }
461 CC.Say("spell_earthquake", CC, element.Name.ToLower());
462 TryDelay(delegate
463 {
464 CC.PlaySound("spell_earthquake");
465 });
466 if (CC.IsInMutterDistance())
467 {
468 Shaker.ShakeCam("ball");
469 }
470 EClass.Wait(1f, CC);
471 DamageEle(CC, id, power, element, list3, actRef, "spell_earthquake");
472 break;
473 }
474 case EffectId.Meteor:
475 {
476 EffectMeteor.Create(cc.pos, 6, 10, delegate
477 {
478 });
479 List<Point> list2 = EClass._map.ListPointsInCircle(CC.pos, 10f);
480 if (list2.Count == 0)
481 {
482 list2.Add(CC.pos.Copy());
483 }
484 CC.Say("spell_ball", CC, element.Name.ToLower());
485 TryDelay(delegate
486 {
487 CC.PlaySound("spell_ball");
488 });
489 if (CC.IsInMutterDistance())
490 {
491 Shaker.ShakeCam("ball");
492 }
493 EClass.Wait(1f, CC);
494 DamageEle(CC, id, power, element, list2, actRef, "spell_ball");
495 return;
496 }
497 case EffectId.Hand:
498 case EffectId.DrainBlood:
499 case EffectId.DrainMana:
500 case EffectId.Sword:
501 {
502 List<Point> list4 = new List<Point>();
503 list4.Add(tp.Copy());
504 EClass.Wait(0.3f, CC);
505 TryDelay(delegate
506 {
507 CC.PlaySound("spell_hand");
508 });
509 if (!DamageEle(CC, id, power, element, list4, actRef, (id == EffectId.DrainBlood || id == EffectId.DrainMana) ? "" : ((id == EffectId.Sword) ? "spell_sword" : "spell_hand")))
510 {
511 CC.Say("spell_hand_miss", CC, element.Name.ToLower());
512 }
513 return;
514 }
515 case EffectId.Arrow:
516 case EffectId.MoonSpear:
517 case EffectId.MoonArrow:
518 {
519 List<Point> list = new List<Point>();
520 list.Add(tp.Copy());
521 CC.Say((id == EffectId.MoonSpear) ? "spell_spear" : "spell_arrow", CC, element.Name.ToLower());
522 EClass.Wait(0.5f, CC);
523 TryDelay(delegate
524 {
525 CC.PlaySound((id == EffectId.MoonSpear) ? "spell_moonspear" : "spell_arrow");
526 });
527 DamageEle(CC, id, power, element, list, actRef, (id == EffectId.MoonSpear) ? "spell_spear" : "spell_arrow");
528 return;
529 }
530 case EffectId.Summon:
531 {
532 if (actRef.n1 == "special")
533 {
534 SE.Play("warhorn");
535 Msg.Say("warhorn");
536 }
537 CC.Say("summon_ally", CC);
538 if (EClass._zone.CountMinions(CC) >= CC.MaxSummon || CC.c_uidMaster != 0)
539 {
540 CC.Say("summon_ally_fail", CC);
541 return;
542 }
543 string id3 = actRef.n1;
544 int num3 = 1;
545 int num4 = -1;
546 int radius = 3;
547 bool flag3 = false;
548 bool flag4 = actRef.n1 == "special";
549 int num5 = -1;
550 string text = "";
551 switch (actRef.n1)
552 {
553 case "shadow":
554 case "tsunami":
555 num3 = Mathf.Clamp(power / 100, 1, 5) + ((power >= 100) ? EClass.rnd(2) : 0);
556 break;
557 case "monster":
558 case "fire":
559 case "animal":
560 num3 = 1 + EClass.rnd(2);
561 break;
562 case "special_force":
563 id3 = "army_palmia";
564 num3 = 4 + EClass.rnd(2);
565 num5 = EClass._zone.DangerLv;
566 break;
567 case "tentacle":
568 num4 = 20 + EClass.rnd(10);
569 radius = 1;
570 break;
571 case "special":
572 CC.SetInt(70, EClass.world.date.GetRaw() + 1440);
573 num3 = Mathf.Clamp(7 + CC.LV / 100, 4, 20);
574 num5 = CC.LV;
575 break;
576 }
577 num3 += CC.Evalue(1240);
578 for (int j = 0; j < num3; j++)
579 {
580 if (EClass._zone.CountMinions(CC) >= CC.MaxSummon)
581 {
582 break;
583 }
584 Point point = tp.GetRandomPoint(radius)?.GetNearestPoint(allowBlock: false, allowChara: false);
585 if (point == null || !point.IsValid)
586 {
587 continue;
588 }
589 Chara chara = null;
591 if (num5 != -1)
592 {
593 CardBlueprint.current.lv = num5;
594 }
595 if (!text.IsEmpty())
596 {
597 CardBlueprint.current.idEle = text;
598 }
599 switch (actRef.n1)
600 {
601 case "special":
602 if (j == 0 && !CC.HasMinion("imolonac") && !CC.HasMinion("ygolonac"))
603 {
604 chara = CharaGen.Create((EClass.rnd(20) == 0) ? "imolonac" : "ygolonac");
605 break;
606 }
608 chara = CharaGen.Create("hound", CC.LV);
609 if (text.IsEmpty())
610 {
611 text = chara.MainElement.source.alias;
612 }
613 break;
614 case "yeek":
615 chara = CharaGen.CreateFromFilter(SpawnListChara.Get("summon_yeek", (SourceChara.Row r) => r.race == "yeek"), power / 10);
616 break;
617 case "orc":
618 chara = CharaGen.CreateFromFilter(SpawnListChara.Get("summon_orc", (SourceChara.Row r) => r.race == "orc"), power / 10);
619 break;
620 case "pawn":
621 chara = CharaGen.CreateFromFilter("c_pawn", power / 10);
622 break;
623 case "monster":
624 chara = CharaGen.CreateFromFilter("c_dungeon", power / 10);
625 break;
626 case "animal":
627 chara = CharaGen.CreateFromFilter("c_animal", power / 15);
628 break;
629 case "fire":
630 chara = CharaGen.CreateFromElement("Fire", power / 10);
631 break;
632 case "fish":
633 chara = CharaGen.CreateFromFilter(SpawnListChara.Get("summon_fish", (SourceChara.Row r) => r.ContainsTag("water") || r.model.Chara.race.tag.Contains("water")), power / 10);
634 break;
635 case "octopus":
636 chara = CharaGen.CreateFromFilter(SpawnListChara.Get("summon_octopus", (SourceChara.Row r) => r.race == "octopus"), power / 10);
637 break;
638 default:
639 chara = CharaGen.Create(id3, power / 10);
640 break;
641 }
642 if (chara == null)
643 {
644 continue;
645 }
646 if (chara.rarity >= Rarity.Legendary && !flag4)
647 {
648 j--;
649 continue;
650 }
651 int num6 = -1;
652 string n = actRef.n1;
653 if (!(n == "shadow"))
654 {
655 if (!(n == "special"))
656 {
657 num6 = chara.LV * (100 + power / 10) / 100 + power / 30;
658 }
659 }
660 else
661 {
662 num6 = power / 10 + 1;
663 }
664 if (chara.LV < num6)
665 {
666 chara.SetLv(num6);
667 }
668 chara.interest = 0;
669 if (chara.HaveFur())
670 {
671 chara.c_fur = -1;
672 }
673 n = actRef.n1;
674 if (!(n == "shadow"))
675 {
676 if (n == "special_force")
677 {
678 chara.homeZone = EClass._zone;
679 }
680 }
681 else
682 {
683 chara.hp = chara.MaxHP / 2;
684 }
685 EClass._zone.AddCard(chara, point);
686 if (flag)
687 {
688 Chara chara2 = chara;
689 Hostility hostility2 = (chara.c_originalHostility = Hostility.Enemy);
690 chara2.hostility = hostility2;
691 }
692 else if (!(actRef.n1 == "monster") || actRef.refThing == null)
693 {
694 chara.MakeMinion(CC);
695 }
696 if (num4 != -1)
697 {
698 chara.SetSummon(num4);
699 }
700 flag3 = true;
701 }
702 if (!flag3)
703 {
704 CC.Say("summon_ally_fail", CC);
705 }
706 return;
707 }
708 case EffectId.Funnel:
709 {
710 if (EClass._zone.CountMinions(CC) >= CC.MaxSummon || CC.c_uidMaster != 0)
711 {
712 CC.Say("summon_ally_fail", CC);
713 return;
714 }
715 CC.Say("spell_funnel", CC, element.Name.ToLower());
716 CC.PlaySound("spell_funnel");
717 Chara chara3 = CharaGen.Create("bit");
718 chara3.SetMainElement(element.source.alias, element.Value, elemental: true);
719 chara3.SetSummon(20 + power / 20 + EClass.rnd(10));
720 chara3.SetLv(power / 15);
721 chara3.interest = 0;
722 EClass._zone.AddCard(chara3, tp.GetNearestPoint(allowBlock: false, allowChara: false));
723 chara3.PlayEffect("teleport");
724 chara3.MakeMinion(CC);
725 return;
726 }
727 case EffectId.Breathe:
728 {
729 List<Point> list5 = EClass._map.ListPointsInArc(CC.pos, tp, 7, 35f);
730 if (list5.Count == 0)
731 {
732 list5.Add(CC.pos.Copy());
733 }
734 CC.Say("spell_breathe", CC, element.Name.ToLower());
735 EClass.Wait(0.8f, CC);
736 TryDelay(delegate
737 {
738 CC.PlaySound("spell_breathe");
739 });
741 {
742 Shaker.ShakeCam("breathe");
743 }
744 DamageEle(CC, id, power, element, list5, actRef, "spell_breathe");
745 return;
746 }
747 case EffectId.Scream:
748 CC.PlaySound("scream");
749 CC.PlayEffect("scream");
750 {
751 foreach (Point item in EClass._map.ListPointsInCircle(cc.pos, 6f, mustBeWalkable: false, los: false))
752 {
753 foreach (Chara chara4 in item.Charas)
754 {
755 if (chara4.ResistLv(957) <= 0)
756 {
757 chara4.AddCondition<ConParalyze>(power);
758 }
759 }
760 }
761 return;
762 }
763 case EffectId.Ball:
764 case EffectId.Explosive:
765 case EffectId.BallBubble:
766 case EffectId.Suicide:
767 {
768 float radius2 = ((id == EffectId.Suicide) ? 3.5f : ((float)((id == EffectId.BallBubble) ? 2 : 5)));
769 if (id == EffectId.Explosive && actRef.refThing != null)
770 {
771 radius2 = 2 + actRef.refThing.Evalue(666);
772 }
773 if (id == EffectId.Suicide)
774 {
775 if (CC.MainElement != Element.Void)
776 {
777 element = CC.MainElement;
778 }
780 {
781 element = Element.Create(919, 10);
782 }
783 if (CC.HasTag(CTAG.kamikaze))
784 {
785 radius2 = 1.5f;
786 }
787 }
788 bool flag5 = id == EffectId.Explosive || id == EffectId.Suicide;
789 List<Point> list7 = EClass._map.ListPointsInCircle(cc.pos, radius2, !flag5, !flag5);
790 if (list7.Count == 0)
791 {
792 list7.Add(cc.pos.Copy());
793 }
794 cc.Say((id == EffectId.Suicide) ? "abSuicide" : "spell_ball", cc, element.Name.ToLower());
795 EClass.Wait(0.8f, cc);
796 TryDelay(delegate
797 {
798 cc.PlaySound("spell_ball");
799 });
801 {
802 Shaker.ShakeCam("ball");
803 }
804 DamageEle(actRef.origin ?? cc, id, power, element, list7, actRef, (id == EffectId.Suicide) ? "suicide" : "spell_ball");
805 if (id == EffectId.Suicide && CC.IsAliveInCurrentZone)
806 {
807 CC.Die();
808 }
809 return;
810 }
811 case EffectId.Bolt:
812 {
813 List<Point> list6 = EClass._map.ListPointsInLine(CC.pos, tp, 10);
814 if (list6.Count == 0)
815 {
816 list6.Add(CC.pos.Copy());
817 }
818 CC.Say("spell_bolt", CC, element.Name.ToLower());
819 EClass.Wait(0.8f, CC);
820 TryDelay(delegate
821 {
822 CC.PlaySound("spell_bolt");
823 });
825 {
826 Shaker.ShakeCam("bolt");
827 }
828 DamageEle(CC, id, power, element, list6, actRef, "spell_bolt");
829 return;
830 }
831 case EffectId.Bubble:
832 case EffectId.Web:
833 case EffectId.MistOfDarkness:
834 case EffectId.Puddle:
835 {
836 if (LangGame.Has("ab" + id))
837 {
838 CC.Say("ab" + id, CC);
839 }
840 tp.PlaySound("vomit");
841 int num = 2 + EClass.rnd(3);
842 int id2 = ((id == EffectId.Puddle) ? 4 : ((id == EffectId.Bubble) ? 5 : ((id == EffectId.MistOfDarkness) ? 6 : 7)));
843 EffectId idEffect = ((id == EffectId.Bubble) ? EffectId.BallBubble : EffectId.PuddleEffect);
844 Color matColor = EClass.Colors.elementColors.TryGetValue(element.source.alias);
845 if (id == EffectId.Bubble && CC.id == "cancer")
846 {
847 idEffect = EffectId.Nothing;
848 num = 1 + EClass.rnd(3);
849 }
850 for (int i = 0; i < num; i++)
851 {
852 Point randomPoint = tp.GetRandomPoint(2);
853 if (randomPoint != null && !randomPoint.HasBlock && (id != EffectId.Puddle || !randomPoint.cell.IsTopWaterAndNoSnow))
854 {
855 int num2 = 4 + EClass.rnd(5);
856 if (id == EffectId.Web)
857 {
858 num2 *= 3;
859 }
860 EClass._map.SetEffect(randomPoint.x, randomPoint.z, new CellEffect
861 {
862 id = id2,
863 amount = num2,
864 idEffect = idEffect,
865 idEle = element.id,
866 power = power,
867 isHostileAct = CC.IsPCParty,
868 color = BaseTileMap.GetColorInt(ref matColor, 100)
869 });
870 }
871 }
872 return;
873 }
874 }
875 List<Card> list8 = tp.ListCards().ToList();
876 list8.Reverse();
877 if (list8.Contains(CC))
878 {
879 list8.Remove(CC);
880 list8.Insert(0, CC);
881 }
882 bool flag6 = true;
883 foreach (Card item2 in list8)
884 {
885 if (tc == null || item2 == tc)
886 {
887 Proc(id, power, state, CC, item2, actRef);
888 if (flag2 && item2.isChara && item2 != CC)
889 {
890 CC.DoHostileAction(item2);
891 }
892 if (actRef.refThing == null || !(actRef.refThing.trait is TraitRod))
893 {
894 return;
895 }
896 EffectId effectId = id;
897 if ((uint)(effectId - 200) <= 4u)
898 {
899 return;
900 }
901 flag6 = false;
902 }
903 }
904 if (flag6)
905 {
906 CC.SayNothingHappans();
907 }
908 }
909
910 public static void Proc(EffectId id, Card cc, Card tc = null, int power = 100, ActRef actRef = default(ActRef))
911 {
912 Proc(id, power, BlessedState.Normal, cc, tc, actRef);
913 }
914
915 public static void Proc(EffectId id, int power, BlessedState state, Card cc, Card tc = null, ActRef actRef = default(ActRef))
916 {
917 if (tc == null)
918 {
919 tc = cc;
920 }
921 Chara TC = tc.Chara;
922 Chara CC = cc.Chara;
923 bool blessed = state >= BlessedState.Blessed;
924 bool flag = state <= BlessedState.Cursed;
925 int orgPower = power;
926 if (blessed || flag)
927 {
928 power *= 2;
929 }
930 switch (id)
931 {
932 case EffectId.Duplicate:
933 {
934 Point randomPoint = CC.pos.GetRandomPoint(2, requireLos: false, allowChara: false, allowBlocked: false, 200);
935 if (randomPoint == null || randomPoint.Equals(CC.pos) || !randomPoint.IsValid || !CC.CanDuplicate())
936 {
937 CC.Say("split_fail", CC);
938 return;
939 }
940 Chara t2 = CC.Duplicate();
941 EClass._zone.AddCard(t2, randomPoint);
942 CC.Say("split", CC);
943 break;
944 }
945 case EffectId.Escape:
946 if (CC.IsPCFaction || (EClass._zone.Boss == CC && EClass.rnd(30) != 0))
947 {
948 return;
949 }
950 CC.Say("escape", CC);
951 CC.PlaySound("escape");
952 if (EClass._zone.Boss == CC)
953 {
954 CC.TryDropBossLoot();
955 }
956 CC.Destroy();
957 break;
958 case EffectId.BurnMana:
959 CC.PlaySound("fire");
960 CC.PlayEffect("Element/eleFire");
961 CC.Say("burn_mana", CC);
962 CC.mana.Mod(-CC.mana.max / 3 - 1);
963 break;
964 case EffectId.Exterminate:
965 {
966 CC.PlaySound("clean_floor");
967 Msg.Say("exterminate");
968 List<Chara> list2 = EClass._map.charas.Where((Chara c) => c.isCopy && !c.IsPCFaction).ToList();
969 if (list2.Count == 0)
970 {
972 return;
973 }
974 foreach (Chara item in list2)
975 {
976 item.Say("split_fail", item);
977 item.PlayEffect("vanish");
978 item.Die();
979 }
980 break;
981 }
982 case EffectId.DropMine:
983 {
984 if (CC.pos.Installed != null || EClass._zone.IsPCFaction)
985 {
986 return;
987 }
988 Thing thing = ThingGen.Create("mine");
989 thing.c_idRefCard = "dog_mine";
990 Zone.ignoreSpawnAnime = true;
991 EClass._zone.AddCard(thing, CC.pos).Install();
992 break;
993 }
994 case EffectId.LittleSisterMigration:
995 {
997 {
999 return;
1000 }
1001 List<Chara> list3 = new List<Chara>();
1002 bool flag5 = false;
1003 foreach (Chara chara2 in EClass._map.charas)
1004 {
1005 if (!chara2.IsPCFactionOrMinion && chara2.id == "littleOne")
1006 {
1007 if (flag5)
1008 {
1009 flag5 = false;
1010 continue;
1011 }
1012 list3.Add(chara2);
1013 flag5 = true;
1014 }
1015 }
1016 if (list3.Count == 0)
1017 {
1019 return;
1020 }
1021 EClass.pc.PlaySound("chime_angel");
1022 foreach (Chara item2 in list3)
1023 {
1024 item2.PlayEffect("revive");
1025 item2.Destroy();
1026 }
1027 Msg.Say("little_migration", list3.Count.ToString() ?? "");
1028 EClass._zone.ModInfluence(list3.Count);
1029 EClass.player.stats.sistersDepart += list3.Count;
1030 break;
1031 }
1032 case EffectId.MagicMap:
1033 if (!CC.IsPC)
1034 {
1035 CC.SayNothingHappans();
1036 break;
1037 }
1038 if (flag)
1039 {
1040 CC.Say("abMagicMap_curse", CC);
1041 CC.PlaySound("curse3");
1042 CC.PlayEffect("curse");
1043 CC.AddCondition<ConConfuse>(200, force: true);
1044 break;
1045 }
1046 CC.Say("abMagicMap", CC);
1047 CC.PlayEffect("identify");
1048 CC.PlaySound("identify");
1049 if (blessed)
1050 {
1052 }
1053 else
1054 {
1055 EClass._map.Reveal(CC.pos, power);
1056 }
1057 break;
1058 case EffectId.AbsorbMana:
1059 {
1060 if (CC == TC)
1061 {
1062 EClass.game.religions.Element.Talk("ability");
1063 }
1064 Dice dice = Dice.Create("ActManaAbsorb", power, CC, (actRef.refThing != null) ? null : actRef.act);
1065 TC.mana.Mod(dice.Roll());
1066 TC.PlaySound("heal");
1067 TC.PlayEffect("heal");
1068 if (TC == CC)
1069 {
1070 CC.Say("absorbMana", CC);
1071 }
1072 break;
1073 }
1074 case EffectId.ModPotential:
1075 {
1076 Element element = cc.elements.ListElements((Element e) => e.HasTag("primary")).RandomItem();
1077 cc.elements.ModTempPotential(element.id, power / 10);
1078 break;
1079 }
1080 case EffectId.ForgetItems:
1081 {
1082 TC.PlaySound("curse3");
1083 TC.PlayEffect("curse");
1084 TC.Say("forgetItems", TC);
1085 int num5 = power / 50 + 1 + EClass.rnd(3);
1086 List<Thing> source = TC.things.List((Thing t) => t.c_IDTState == 0);
1087 for (int j = 0; j < num5; j++)
1088 {
1089 source.RandomItem().c_IDTState = 5;
1090 }
1091 break;
1092 }
1093 case EffectId.EnchantWeapon:
1094 case EffectId.EnchantArmor:
1095 case EffectId.EnchantWeaponGreat:
1096 case EffectId.EnchantArmorGreat:
1097 {
1098 bool armor = id == EffectId.EnchantArmor || id == EffectId.EnchantArmorGreat;
1099 bool flag4 = id == EffectId.EnchantWeaponGreat || id == EffectId.EnchantArmorGreat;
1100 if (!tc.isThing)
1101 {
1102 LayerDragGrid.CreateEnchant(CC, armor, flag4, state);
1103 return;
1104 }
1105 cc.PlaySound("identify");
1106 cc.PlayEffect("identify");
1107 if (flag)
1108 {
1109 cc.Say("enc_curse", tc);
1110 tc.ModEncLv(-1);
1111 break;
1112 }
1113 int num4 = (flag4 ? 4 : 2) + (blessed ? 1 : 0);
1114 if (tc.encLV >= num4)
1115 {
1116 cc.Say("enc_resist", tc);
1117 break;
1118 }
1119 cc.Say("enc", tc);
1120 tc.ModEncLv(1);
1121 break;
1122 }
1123 case EffectId.Identify:
1124 case EffectId.GreaterIdentify:
1125 {
1126 bool flag6 = id == EffectId.GreaterIdentify;
1127 if (flag)
1128 {
1129 Redirect(EffectId.ForgetItems, flag6 ? BlessedState.Cursed : BlessedState.Normal, default(ActRef));
1130 break;
1131 }
1132 if (!tc.isThing)
1133 {
1134 int count = ((!blessed) ? 1 : (flag6 ? (2 + EClass.rnd(2)) : (3 + EClass.rnd(3))));
1135 LayerDragGrid.CreateIdentify(CC, flag6, state, 0, count);
1136 return;
1137 }
1138 cc.PlaySound("identify");
1139 cc.PlayEffect("identify");
1140 tc.Thing.Identify(cc.IsPCParty, (!flag6) ? IDTSource.Identify : IDTSource.SuperiorIdentify);
1141 break;
1142 }
1143 case EffectId.Uncurse:
1144 {
1145 if (!tc.isThing)
1146 {
1147 LayerDragGrid.CreateUncurse(CC, state);
1148 return;
1149 }
1150 Thing thing2 = tc.Thing;
1151 if (thing2.blessedState == BlessedState.Cursed)
1152 {
1153 thing2.SetBlessedState(BlessedState.Normal);
1154 }
1155 else if (thing2.blessedState == BlessedState.Doomed)
1156 {
1157 thing2.SetBlessedState(BlessedState.Normal);
1158 }
1159 thing2.GetRootCard()?.TryStack(thing2);
1160 LayerInventory.SetDirty(thing2);
1161 break;
1162 }
1163 case EffectId.Lighten:
1164 {
1165 if (!tc.isThing)
1166 {
1167 LayerDragGrid.CreateLighten(CC, state);
1168 return;
1169 }
1170 if (tc.Num > 1)
1171 {
1172 tc = tc.Split(1);
1173 }
1174 cc.PlaySound("offering");
1175 cc.PlayEffect("buff");
1176 int num3 = (tc.isWeightChanged ? tc.c_weight : tc.Thing.source.weight);
1177 tc.isWeightChanged = true;
1178 Element orCreateElement = tc.elements.GetOrCreateElement(64);
1179 Element orCreateElement2 = tc.elements.GetOrCreateElement(65);
1180 Element orCreateElement3 = tc.elements.GetOrCreateElement(67);
1181 Element orCreateElement4 = tc.elements.GetOrCreateElement(66);
1182 bool flag3 = tc.IsEquipmentOrRangedOrAmmo || tc.IsThrownWeapon;
1183 if (flag)
1184 {
1185 num3 = (int)(0.01f * (float)num3 * (float)power * 0.75f + 500f);
1186 if (num3 < 0 || num3 > 10000000)
1187 {
1188 num3 = 10000000;
1189 flag3 = false;
1190 }
1191 if (flag3)
1192 {
1193 if (tc.IsWeapon || tc.IsThrownWeapon || tc.IsAmmo)
1194 {
1195 tc.elements.ModBase(67, Mathf.Clamp(orCreateElement3.vBase * power / 1000, 1, 5));
1196 tc.elements.ModBase(66, -Mathf.Clamp(orCreateElement4.vBase * power / 1000, 1, 5));
1197 }
1198 else
1199 {
1200 tc.elements.ModBase(65, Mathf.Clamp(orCreateElement2.vBase * power / 1000, 1, 5));
1201 tc.elements.ModBase(64, -Mathf.Clamp(orCreateElement.vBase * power / 1000, 1, 5));
1202 }
1203 }
1204 cc.Say("lighten_curse", cc, tc);
1205 }
1206 else
1207 {
1208 num3 = num3 * (100 - power / 10) / 100;
1209 if (blessed)
1210 {
1211 power /= 4;
1212 }
1213 if (flag3)
1214 {
1215 if (tc.IsWeapon || tc.IsThrownWeapon || tc.IsAmmo)
1216 {
1217 tc.elements.ModBase(67, -Mathf.Clamp(orCreateElement3.vBase * power / 1000, 1, 5));
1218 tc.elements.ModBase(66, Mathf.Clamp(orCreateElement4.vBase * power / 1000, 1, 5));
1219 }
1220 else
1221 {
1222 tc.elements.ModBase(65, -Mathf.Clamp(orCreateElement2.vBase * power / 1000, 1, 5));
1223 tc.elements.ModBase(64, Mathf.Clamp(orCreateElement.vBase * power / 1000, 1, 5));
1224 }
1225 }
1226 cc.Say("lighten", cc, tc);
1227 }
1228 tc.c_weight = num3;
1229 tc.SetDirtyWeight();
1230 if (tc.parent == null)
1231 {
1232 CC.Pick(tc.Thing, msg: false);
1233 }
1235 break;
1236 }
1237 case EffectId.Reconstruction:
1238 {
1239 if (!tc.isThing)
1240 {
1242 return;
1243 }
1244 if (tc.Num > 1)
1245 {
1246 tc = tc.Split(1);
1247 }
1248 cc.PlaySound("mutation");
1249 cc.PlayEffect("identify");
1250 cc.Say("reconstruct", cc, tc);
1251 EClass.game.cards.uidNext += EClass.rnd(30);
1252 int num6 = Mathf.Max(tc.genLv, tc.LV, EClass.player.stats.deepest);
1254 {
1255 blesstedState = state
1256 });
1257 Thing thing3 = ThingGen.Create(tc.id, -1, (int)((long)num6 * (long)power / 400));
1258 thing3.genLv = num6;
1259 tc.Destroy();
1260 CC.Pick(thing3, msg: false);
1261 if (!CC.IsPC)
1262 {
1263 CC.TryEquip(thing3);
1264 }
1265 break;
1266 }
1267 case EffectId.ChangeMaterialLesser:
1268 case EffectId.ChangeMaterial:
1269 case EffectId.ChangeMaterialGreater:
1270 {
1271 SourceMaterial.Row row = EClass.sources.materials.alias.TryGetValue(actRef.n1);
1272 if (!tc.isThing)
1273 {
1274 LayerDragGrid.CreateChangeMaterial(CC, actRef.refThing, row, id, state);
1275 return;
1276 }
1277 if (tc.Num > 1)
1278 {
1279 tc = tc.Split(1);
1280 }
1281 string name = tc.Name;
1282 if (row == null)
1283 {
1284 bool num = id == EffectId.ChangeMaterialGreater;
1285 bool flag2 = id == EffectId.ChangeMaterialLesser;
1286 string text2 = tc.Thing.source.tierGroup;
1287 Dictionary<string, SourceMaterial.TierList> tierMap = SourceMaterial.tierMap;
1288 int num2 = 1;
1289 if (flag)
1290 {
1291 num2 -= 2;
1292 }
1293 if (blessed)
1294 {
1295 num2++;
1296 }
1297 if (num)
1298 {
1299 num2++;
1300 }
1301 if (flag2)
1302 {
1303 num2 -= 2;
1304 }
1305 num2 = Mathf.Clamp(num2 + EClass.rnd(2), 0, 4);
1306 if (EClass.rnd(10) == 0)
1307 {
1308 text2 = ((text2 == "metal") ? "leather" : "metal");
1309 }
1310 SourceMaterial.TierList tierList = (text2.IsEmpty() ? tierMap.RandomItem() : tierMap[text2]);
1311 for (int i = 0; i < 1000; i++)
1312 {
1313 row = tierList.tiers[num2].Select();
1314 if (row != tc.material)
1315 {
1316 break;
1317 }
1318 }
1319 }
1320 cc.PlaySound("offering");
1321 cc.PlayEffect("buff");
1322 if ((tc.id == "log" || tc.id == "branch") && tc.material.alias == "carbone")
1323 {
1324 foreach (Element item3 in tc.elements.dict.Values.ToList())
1325 {
1326 if (item3.IsTrait && item3.vBase != 0)
1327 {
1328 tc.elements.ModBase(item3.id, -item3.vBase);
1329 }
1330 }
1331 }
1332 tc.ChangeMaterial(row);
1333 if (tc.trait is TraitGene && tc.c_DNA != null)
1334 {
1335 DNA.Type type = DNA.GetType(tc.material.alias);
1336 tc.c_DNA.Generate(type);
1337 }
1338 cc.Say("materialChanged", name, row.GetName());
1339 if (CC != null)
1340 {
1341 if (tc.parent == null)
1342 {
1343 CC.Pick(tc.Thing, msg: false);
1344 }
1346 }
1347 break;
1348 }
1349 case EffectId.ReturnVoid:
1350 {
1352 if (EClass.game.IsSurvival || root == null || root.visitCount == 0 || EClass.player.stats.deepestVoid < 1 || (!EClass.debug.enable && EClass.player.CountKeyItem("license_void") == 0))
1353 {
1355 return;
1356 }
1357 int max = Mathf.Min(EClass.player.stats.deepestVoid, -root.MinLv);
1358 int destLv = 1;
1359 Dialog.InputName("dialogVoidReturn".lang(max.ToString() ?? ""), max.ToString() ?? "", delegate(bool cancel, string text)
1360 {
1361 if (!cancel)
1362 {
1363 destLv = Mathf.Abs(text.ToInt());
1364 destLv = Mathf.Clamp(destLv, 1, max) * -1;
1365 Zone zone = ((root.lv == destLv) ? root : (root.children.Find((Spatial t) => t.lv == destLv) as Zone));
1366 Debug.Log(destLv + "/" + zone);
1367 if (zone == null)
1368 {
1369 zone = SpatialGen.Create(root.GetNewZoneID(destLv), root, register: true) as Zone;
1370 zone.lv = destLv;
1371 }
1372 Msg.Say("returnComplete");
1373 EClass.player.uidLastTravelZone = 0;
1375 EClass.player.lastZonePos = null;
1376 EClass.player.returnInfo = null;
1377 }
1378 });
1379 break;
1380 }
1381 case EffectId.Return:
1382 case EffectId.Evac:
1383 if (!cc.IsPC)
1384 {
1385 Redirect(EffectId.Teleport, state, default(ActRef));
1386 return;
1387 }
1388 cc.PlaySound("return_cast");
1389 if (EClass.player.returnInfo == null)
1390 {
1391 if (id == EffectId.Evac)
1392 {
1393 EClass.player.returnInfo = new Player.ReturnInfo
1394 {
1395 turns = EClass.rnd(10) + 10,
1396 isEvac = true
1397 };
1398 }
1399 else
1400 {
1401 if (EClass.game.spatials.ListReturnLocations().Count == 0)
1402 {
1403 Msg.Say("returnNowhere");
1404 break;
1405 }
1406 EClass.player.returnInfo = new Player.ReturnInfo
1407 {
1408 turns = EClass.rnd(10) + 10,
1409 askDest = true
1410 };
1411 }
1412 Msg.Say("returnBegin");
1413 }
1414 else
1415 {
1416 EClass.player.returnInfo = null;
1417 Msg.Say("returnAbort");
1418 }
1419 break;
1420 case EffectId.Teleport:
1421 case EffectId.TeleportShort:
1422 case EffectId.Gate:
1423 if (!tc.HasHost)
1424 {
1425 if (!flag)
1426 {
1427 if (id == EffectId.TeleportShort)
1428 {
1429 tc.Teleport(GetTeleportPos(tc.pos));
1430 }
1431 else
1432 {
1433 tc.Teleport(GetTeleportPos(tc.pos, EClass._map.bounds.Width));
1434 }
1435 }
1436 if (id == EffectId.Gate && CC.IsPC)
1437 {
1438 foreach (Chara chara3 in EClass._map.charas)
1439 {
1440 if (!chara3.HasHost && chara3 != tc && (chara3.IsPCParty || chara3.IsPCPartyMinion))
1441 {
1442 chara3.Teleport(tc.pos.GetNearestPoint(allowBlock: false, allowChara: false) ?? tc.pos);
1443 }
1444 }
1445 }
1446 }
1447 if (flag)
1448 {
1449 Redirect(EffectId.Gravity, BlessedState.Normal, default(ActRef));
1450 }
1451 if (blessed)
1452 {
1453 Redirect(EffectId.Levitate, BlessedState.Normal, default(ActRef));
1454 }
1455 break;
1456 }
1457 if (TC == null)
1458 {
1459 return;
1460 }
1461 switch (id)
1462 {
1463 case EffectId.ThrowPotion:
1464 if (!CC.pos.Equals(TC.pos))
1465 {
1466 Thing t3 = ThingGen.Create(new string[6] { "330", "331", "334", "335", "336", "1142" }.RandomItem());
1467 ActThrow.Throw(CC, TC.pos, t3, ThrowMethod.Punish, 0.7f);
1468 }
1469 break;
1470 case EffectId.ShutterHex:
1471 {
1472 if (!CC.IsHostile(TC))
1473 {
1474 break;
1475 }
1476 int num10 = 0;
1477 foreach (Condition condition4 in TC.conditions)
1478 {
1479 if (condition4.Type == ConditionType.Debuff)
1480 {
1481 num10++;
1482 }
1483 }
1484 if (num10 == 0)
1485 {
1486 CC.SayNothingHappans();
1487 break;
1488 }
1489 TC.pos.PlayEffect("holyveil");
1490 TC.pos.PlaySound("holyveil");
1491 TC.pos.PlaySound("atk_eleSound");
1492 TC.conditions.ForeachReverse(delegate(Condition c)
1493 {
1494 if (c.Type == ConditionType.Debuff && EClass.rnd(3) == 0)
1495 {
1496 c.Kill();
1497 }
1498 });
1499 TC.Say("abShutterHex", TC);
1500 Point center = CC.pos.Copy();
1501 List<Chara> list6 = TC.pos.ListCharasInRadius(TC, 4, (Chara c) => !c.IsFriendOrAbove(CC));
1502 for (int l = 0; l < num10; l++)
1503 {
1504 TweenUtil.Delay((float)l * 0.1f, delegate
1505 {
1506 center.PlaySound("shutterhex");
1507 });
1508 foreach (Chara item4 in list6)
1509 {
1510 if (item4.ExistsOnMap)
1511 {
1512 Effect effect = Effect.Get("spell_moonspear");
1513 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
1514 Color startColor = (componentInChildren.endColor = EClass.Colors.elementColors["eleHoly"]);
1515 componentInChildren.startColor = startColor;
1516 Point pos = item4.pos.Copy();
1517 TweenUtil.Delay((float)l * 0.1f, delegate
1518 {
1519 effect.Play(center, 0f, pos);
1520 });
1521 int num11 = Dice.Create("SpShutterHex", power, CC, (actRef.refThing != null) ? null : actRef.act).Roll();
1522 item4.DamageHP(num11, 919, power, AttackSource.None, CC, showEffect: false);
1523 }
1524 }
1525 }
1526 break;
1527 }
1528 case EffectId.Draw:
1529 {
1530 if (CC.Dist(TC) <= 1 || (CC.IsPCFactionOrMinion && TC.IsPCFactionOrMinion && TC.isRestrained))
1531 {
1532 break;
1533 }
1534 Point point = CC.GetFirstStep(TC.pos, PathManager.MoveType.Combat);
1535 if (!point.IsValid)
1536 {
1537 point = CC.pos.GetRandomPoint(1)?.GetNearestPoint(allowBlock: false, allowChara: false);
1538 }
1539 if (point == null || !CC.CanSeeLos(point))
1540 {
1541 break;
1542 }
1543 CC.Say("abDraw", CC, TC);
1544 if (TC.HasCondition<ConGravity>())
1545 {
1546 CC.SayNothingHappans();
1547 break;
1548 }
1549 TC.MoveImmediate(point, !EClass.core.config.camera.smoothFollow);
1550 if (CC.id == "tentacle")
1551 {
1552 TC.AddCondition<ConEntangle>();
1553 }
1554 break;
1555 }
1556 case EffectId.CatSniff:
1557 {
1558 Chara nearbyCatToSniff = CC.GetNearbyCatToSniff();
1559 if (nearbyCatToSniff != null)
1560 {
1561 CC.Sniff(nearbyCatToSniff);
1562 }
1563 break;
1564 }
1565 case EffectId.Steal:
1566 {
1568 {
1569 break;
1570 }
1571 if (TC.Evalue(426) > 0)
1572 {
1573 TC.Say((actRef.n1 == "money") ? "abStealNegateMoney" : "abStealNegate", TC);
1574 break;
1575 }
1576 Thing thing4 = null;
1577 bool flag8 = actRef.n1 == "food";
1578 if (actRef.n1 == "money")
1579 {
1580 int currency = TC.GetCurrency();
1581 if (currency > 0)
1582 {
1583 currency = Mathf.Clamp(EClass.rnd(currency / 10), 1, 100 + EClass.rndHalf(CC.LV * 200));
1584 thing4 = ThingGen.Create("money").SetNum(currency);
1585 TC.ModCurrency(-currency);
1586 }
1587 }
1588 else
1589 {
1590 Func<Thing, bool> func = (Thing t) => true;
1591 if (flag8)
1592 {
1593 func = (Thing t) => t.IsFood;
1594 }
1595 List<Thing> list5 = TC.things.List(delegate(Thing t)
1596 {
1598 {
1599 return false;
1600 }
1601 return 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);
1602 }, onlyAccessible: true);
1603 if (list5.Count > 0)
1604 {
1605 thing4 = list5.RandomItem();
1606 if (thing4.Num > 1)
1607 {
1608 thing4 = thing4.Split(1);
1609 }
1610 }
1611 CC.AddCooldown(6640, 200);
1612 }
1613 if (thing4 == null)
1614 {
1615 CC.Say("abStealNothing", CC, TC);
1616 break;
1617 }
1618 thing4.SetInt(116, 1);
1619 TC.PlaySound(thing4.material.GetSoundDrop(thing4.sourceCard));
1620 CC.Pick(thing4, msg: false);
1621 CC.Say("abSteal", CC, TC, thing4.Name);
1622 if (actRef.n1 == "food")
1623 {
1624 if (CC.hunger.value != 0)
1625 {
1626 CC.InstantEat(thing4);
1627 }
1628 }
1629 else
1630 {
1631 CC.Say("abStealEscape", CC);
1632 CC.Teleport(GetTeleportPos(tc.pos, 30), silent: true);
1633 }
1634 break;
1635 }
1636 case EffectId.NeckHunt:
1637 CC.TryNeckHunt(TC, power);
1638 break;
1639 case EffectId.CurseEQ:
1640 {
1641 if (CC != null && CC != TC)
1642 {
1643 TC.Say("curse", CC, TC);
1644 }
1645 TC.PlaySound("curse3");
1646 TC.PlayEffect("curse");
1647 if (EClass.rnd(150 + TC.LUC * 5 + TC.Evalue(972) * 20) >= power + (flag ? 200 : 0) || TC.TryNullifyCurse())
1648 {
1649 break;
1650 }
1651 List<Thing> list9 = TC.things.List(delegate(Thing t)
1652 {
1653 if (!t.isEquipped || t.blessedState == BlessedState.Doomed || t.IsToolbelt)
1654 {
1655 return false;
1656 }
1657 return (t.blessedState < BlessedState.Blessed || EClass.rnd(10) == 0) ? true : false;
1658 });
1659 if (list9.Count == 0)
1660 {
1661 CC.SayNothingHappans();
1662 break;
1663 }
1664 Thing thing6 = list9.RandomItem();
1665 TC.Say("curse_hit", TC, thing6);
1666 thing6.SetBlessedState((thing6.blessedState == BlessedState.Cursed) ? BlessedState.Doomed : BlessedState.Cursed);
1667 LayerInventory.SetDirty(thing6);
1668 break;
1669 }
1670 case EffectId.UncurseEQ:
1671 case EffectId.UncurseEQGreater:
1672 {
1673 TC.Say("uncurseEQ" + (blessed ? "_bless" : (flag ? "_curse" : "")), TC);
1674 TC.PlaySound("uncurse");
1675 TC.PlayEffect("uncurse");
1676 if (flag)
1677 {
1678 Redirect(EffectId.CurseEQ, BlessedState.Normal, default(ActRef));
1679 break;
1680 }
1681 int success = 0;
1682 int fail = 0;
1683 List<Thing> list = new List<Thing>();
1684 TC.things.Foreach(delegate(Thing t)
1685 {
1686 int num13 = 0;
1687 if ((t.isEquipped || t.IsRangedWeapon || blessed) && t.blessedState < BlessedState.Normal)
1688 {
1689 if (t.blessedState == BlessedState.Cursed)
1690 {
1691 num13 = EClass.rnd(200);
1692 }
1693 if (t.blessedState == BlessedState.Doomed)
1694 {
1695 num13 = EClass.rnd(1000);
1696 }
1697 if (blessed)
1698 {
1699 num13 /= 2;
1700 }
1701 if (id == EffectId.UncurseEQGreater)
1702 {
1703 num13 /= 10;
1704 }
1705 if (power >= num13)
1706 {
1707 TC.Say("uncurseEQ_success", t);
1708 t.SetBlessedState(BlessedState.Normal);
1709 if (t.isEquipped && t.HasElement(656))
1710 {
1711 TC.body.Unequip(t);
1712 }
1714 success++;
1715 list.Add(t);
1716 }
1717 else
1718 {
1719 fail++;
1720 }
1721 }
1722 });
1723 foreach (Thing item5 in list)
1724 {
1725 item5.GetRootCard()?.TryStack(item5);
1726 }
1727 if (success == 0 && fail == 0)
1728 {
1729 TC.SayNothingHappans();
1730 }
1731 else if (fail > 0)
1732 {
1733 TC.Say("uncurseEQ_fail");
1734 }
1735 break;
1736 }
1737 case EffectId.Buff:
1738 {
1739 string text3 = actRef.n1;
1740 string text4 = "";
1741 if (flag)
1742 {
1743 text4 = EClass.sources.stats.alias[text3].curse;
1744 if (!text4.IsEmpty())
1745 {
1746 text3 = text4;
1747 }
1748 }
1749 Condition condition2 = Condition.Create(text3, power, delegate(Condition con)
1750 {
1751 if (!actRef.aliasEle.IsEmpty())
1752 {
1753 con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
1754 }
1755 });
1756 condition2.isPerfume = TC.IsPC && actRef.isPerfume;
1757 Condition condition3 = TC.AddCondition(condition2);
1758 if (condition3 != null && condition3.isPerfume)
1759 {
1760 condition3.value = 3;
1761 Msg.Say("perfume", TC);
1762 }
1763 if (!text4.IsEmpty())
1764 {
1765 CC.DoHostileAction(TC);
1766 }
1767 break;
1768 }
1769 case EffectId.KizuamiTrick:
1770 {
1771 EClass.game.religions.Trickery.Talk("ability");
1772 bool hex = CC.IsHostile(TC);
1773 List<SourceStat.Row> list8 = EClass.sources.stats.rows.Where((SourceStat.Row con) => con.tag.Contains("random") && con.group == (hex ? "Debuff" : "Buff")).ToList();
1774 int power2 = power;
1775 for (int m = 0; m < 4 + EClass.rnd(2); m++)
1776 {
1777 SourceStat.Row row2 = list8.RandomItem();
1778 list8.Remove(row2);
1779 Proc(hex ? EffectId.DebuffKizuami : EffectId.Buff, CC, TC, power2, new ActRef
1780 {
1781 n1 = row2.alias
1782 });
1783 }
1785 {
1786 EClass.Wait(0.3f, TC);
1787 }
1788 break;
1789 }
1790 case EffectId.Debuff:
1791 case EffectId.DebuffKizuami:
1792 {
1793 CC.DoHostileAction(TC);
1794 bool isPowerful = TC.IsPowerful;
1795 string n = actRef.n1;
1796 if (n == "ConSuffocation")
1797 {
1798 power = power * 2 / 3;
1799 }
1800 int a2 = power;
1801 int num8 = TC.WIL * (isPowerful ? 20 : 5);
1802 ConHolyVeil condition = TC.GetCondition<ConHolyVeil>();
1803 if (condition != null)
1804 {
1805 num8 += condition.power * 5;
1806 }
1807 if (id != EffectId.DebuffKizuami && EClass.rnd(a2) < num8 / EClass.sources.stats.alias[n].hexPower && EClass.rnd(10) != 0)
1808 {
1809 TC.Say("debuff_resist", TC);
1810 CC.DoHostileAction(TC);
1811 break;
1812 }
1813 TC.AddCondition(Condition.Create(n, power, delegate(Condition con)
1814 {
1815 con.givenByPcParty = CC.IsPCParty;
1816 if (!actRef.aliasEle.IsEmpty())
1817 {
1818 con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
1819 }
1820 }));
1821 if (n == "ConBane" && CC.HasElement(1416))
1822 {
1823 TC.AddCondition<ConExcommunication>(power);
1824 }
1825 CC.DoHostileAction(TC);
1827 {
1828 EClass.Wait(0.3f, TC);
1829 }
1830 break;
1831 }
1832 case EffectId.Mutation:
1833 TC.MutateRandom(1, 100, ether: false, state);
1835 {
1836 EClass.Wait(0.3f, TC);
1837 }
1838 break;
1839 case EffectId.CureMutation:
1840 TC.MutateRandom(-1, 100, ether: false, state);
1841 break;
1842 case EffectId.Ally:
1843 {
1844 Msg.Say("gainAlly");
1845 Chara chara = CharaGen.CreateFromFilter("chara", cc.LV);
1846 EClass._zone.AddCard(chara, cc.pos.GetNearestPoint(allowBlock: false, allowChara: false));
1847 if (cc.IsPCFactionOrMinion)
1848 {
1849 chara.MakeAlly(msg: false);
1850 }
1851 chara.PlaySound("identify");
1852 chara.PlayEffect("teleport");
1853 break;
1854 }
1855 case EffectId.Wish:
1856 if (!TC.IsPC)
1857 {
1858 break;
1859 }
1860 if (blessed || flag)
1861 {
1862 power /= 2;
1863 }
1864 Dialog.InputName("dialogWish", "q", delegate(bool cancel, string text)
1865 {
1866 if (!cancel)
1867 {
1868 Msg.Say("wish", TC, text);
1869 Wish(text, EClass.pc.NameTitled, power, state);
1870 }
1871 });
1872 break;
1873 case EffectId.Faith:
1874 {
1876 tc.PlayEffect("aura_heaven");
1877 tc.PlaySound("aura_heaven");
1878 tc.Say("faith", tc, faith.Name);
1879 if (flag)
1880 {
1881 tc.Say("faith_curse", tc, faith.Name);
1882 break;
1883 }
1884 if (blessed)
1885 {
1886 tc.Say("faith_bless", tc, faith.Name);
1887 }
1888 tc.ModExp(306, power * 10);
1889 tc.ModExp(85, power * 10);
1890 if (tc.elements.Base(85) >= tc.elements.Value(306))
1891 {
1892 tc.elements.SetBase(85, tc.elements.Value(306));
1893 }
1894 break;
1895 }
1896 case EffectId.TransGender:
1897 {
1898 tc.PlaySound("mutation");
1899 tc.PlayEffect("mutation");
1900 int gender = tc.bio.gender;
1901 int gender2 = gender switch
1902 {
1903 1 => 2,
1904 2 => 1,
1905 _ => (EClass.rnd(2) != 0) ? 1 : 2,
1906 };
1907 if (gender != 0 && EClass.rnd(10) == 0)
1908 {
1909 gender2 = 0;
1910 }
1911 tc.bio.SetGender(gender2);
1912 tc.Say("transGender", tc, Gender.Name(tc.bio.gender));
1913 tc.Talk("tail");
1914 int age = tc.bio.GetAge(tc.Chara);
1915 if (blessed && age > 1)
1916 {
1917 tc.Say("ageDown", tc);
1918 tc.bio.SetAge(tc.Chara, age - 1);
1919 }
1920 else if (flag)
1921 {
1922 tc.Say("ageUp", tc);
1923 tc.bio.SetAge(tc.Chara, age + 1);
1924 }
1925 break;
1926 }
1927 case EffectId.Youth:
1928 {
1929 tc.PlaySound("mutation");
1930 tc.PlayEffect("mutation");
1931 int age3 = tc.bio.GetAge(tc.Chara);
1932 if (!flag && age3 <= 0)
1933 {
1934 tc.SayNothingHappans();
1935 break;
1936 }
1937 age3 = Mathf.Max(0, age3 * 100 / (flag ? 75 : (blessed ? 400 : 200))) + (flag ? 1 : 0);
1938 tc.Say(flag ? "ageUp" : "ageDown", tc);
1939 tc.bio.SetAge(tc.Chara, age3);
1940 break;
1941 }
1942 case EffectId.EternalYouth:
1943 {
1944 tc.PlaySound("mutation");
1945 tc.PlayEffect("mutation");
1946 if (tc.IsUnique)
1947 {
1948 tc.SayNothingHappans();
1949 break;
1950 }
1951 int age2 = tc.bio.GetAge(tc.Chara);
1952 if (flag)
1953 {
1954 if (tc.c_lockedAge != 0)
1955 {
1956 tc.Say("eternalYouth2", tc);
1957 tc.c_lockedAge = 0;
1958 tc.elements.Remove(1243);
1959 tc.bio.SetAge(tc.Chara, age2);
1960 }
1961 Redirect(EffectId.Youth, BlessedState.Cursed, default(ActRef));
1962 }
1963 else if (tc.c_lockedAge != 0)
1964 {
1965 tc.SayNothingHappans();
1966 }
1967 else
1968 {
1969 tc.PlaySound("dropRewardXmas");
1970 tc.Say("eternalYouth1", tc);
1971 tc.c_lockedAge = age2 + 1;
1972 tc.elements.SetBase(1243, 1);
1973 if (blessed)
1974 {
1975 Redirect(EffectId.Youth, BlessedState.Blessed, default(ActRef));
1976 }
1977 }
1978 break;
1979 }
1980 case EffectId.BuffStats:
1981 case EffectId.DebuffStats:
1982 case EffectId.LulwyTrick:
1983 Debug.Log(power + "/" + id.ToString() + "/" + actRef.n1);
1984 if (id == EffectId.LulwyTrick)
1985 {
1986 EClass.game.religions.Wind.Talk("ability");
1987 }
1988 if (power < 0 || id == EffectId.DebuffStats)
1989 {
1990 power = Mathf.Abs(power);
1991 if (blessed)
1992 {
1993 power /= 4;
1994 }
1995 flag = true;
1996 }
1997 TC.AddCondition(Condition.Create(power, delegate(ConBuffStats con)
1998 {
1999 con.SetRefVal(Element.GetId(actRef.n1), (int)id);
2000 }));
2001 break;
2002 case EffectId.Revive:
2003 {
2004 List<KeyValuePair<int, Chara>> list4 = EClass.game.cards.globalCharas.Where((KeyValuePair<int, Chara> a) => a.Value.isDead && a.Value.faction == EClass.pc.faction && !a.Value.isSummon && a.Value.c_wasInPcParty).ToList();
2005 if (TC.IsPCFaction || TC.IsPCFactionMinion)
2006 {
2007 if (TC.IsPC && list4.Count == 0)
2008 {
2009 list4 = EClass.game.cards.globalCharas.Where((KeyValuePair<int, Chara> a) => a.Value.CanRevive() && a.Value.isDead && a.Value.faction == EClass.pc.faction && !a.Value.isSummon).ToList();
2010 }
2011 if (list4.Count > 0)
2012 {
2013 list4.RandomItem().Value.Chara.GetRevived();
2014 break;
2015 }
2016 }
2017 TC.SayNothingHappans();
2018 break;
2019 }
2020 case EffectId.DamageBody:
2021 case EffectId.DamageMind:
2022 case EffectId.DamageBodyGreat:
2023 case EffectId.DamageMindGreat:
2024 case EffectId.Weaken:
2025 {
2026 bool flag9 = id == EffectId.DamageBody || id == EffectId.DamageBodyGreat;
2027 bool mind = id == EffectId.DamageMind || id == EffectId.DamageMindGreat;
2028 int num9 = ((id == EffectId.DamageBody || id == EffectId.DamageMind) ? 1 : (4 + EClass.rnd(4)));
2029 if (id == EffectId.Weaken)
2030 {
2031 flag9 = EClass.rnd(2) == 0;
2032 mind = !flag9;
2033 num9 = 1;
2034 }
2035 else
2036 {
2037 TC.PlayEffect("debuff");
2038 TC.PlaySound("debuff");
2039 }
2040 TC.Say(flag9 ? "damageBody" : "damageMind", TC);
2041 for (int k = 0; k < num9; k++)
2042 {
2043 TC.DamageTempElements(power, flag9, mind, id != EffectId.Weaken);
2044 }
2045 if (TC.IsPC)
2046 {
2047 Tutorial.Play("healer");
2048 }
2049 break;
2050 }
2051 case EffectId.EnhanceBody:
2052 case EffectId.EnhanceMind:
2053 case EffectId.EnhanceBodyGreat:
2054 case EffectId.EnhanceMindGreat:
2055 {
2056 bool flag10 = id == EffectId.EnhanceBody || id == EffectId.EnhanceBodyGreat;
2057 bool mind2 = id == EffectId.EnhanceMind || id == EffectId.EnhanceMindGreat;
2058 if (id != EffectId.EnhanceBody && id != EffectId.EnhanceMind)
2059 {
2060 EClass.rnd(4);
2061 }
2062 TC.Say(flag10 ? "enhanceBody" : "enhanceMind", TC);
2063 TC.PlayEffect("buff");
2064 TC.PlaySound("buff");
2065 TC.EnhanceTempElements(power, flag10, mind2, onlyRenew: true);
2066 break;
2067 }
2068 case EffectId.RestoreBody:
2069 case EffectId.RestoreMind:
2070 {
2071 bool flag7 = id == EffectId.RestoreBody;
2072 if (flag)
2073 {
2074 Redirect(flag7 ? EffectId.DamageBodyGreat : EffectId.DamageMindGreat, BlessedState.Normal, default(ActRef));
2075 break;
2076 }
2077 TC.Say(flag7 ? "restoreBody" : "restoreMind", TC);
2078 TC.PlaySound("heal");
2079 TC.PlayEffect("heal");
2080 TC.CureHost(flag7 ? CureType.CureBody : CureType.CureMind, power, state);
2081 if (blessed)
2082 {
2083 Redirect(flag7 ? EffectId.EnhanceBodyGreat : EffectId.EnhanceMindGreat, BlessedState.Normal, default(ActRef));
2084 }
2085 break;
2086 }
2087 case EffectId.HealComplete:
2088 TC.HealHPHost(100000000, (actRef.refThing == null) ? HealSource.Magic : HealSource.Item);
2089 TC.CureHost(CureType.HealComplete, power, state);
2090 TC.Say("heal_heavy", TC);
2091 break;
2092 case EffectId.Heal:
2093 case EffectId.JureHeal:
2094 {
2095 if (id == EffectId.JureHeal)
2096 {
2097 EClass.game.religions.Healing.Talk("ability");
2098 }
2099 if (actRef.act != null)
2100 {
2101 Debug.Log(actRef.act.id);
2102 }
2103 int num7 = Dice.Create((actRef.act != null && EClass.sources.calc.map.ContainsKey(actRef.act.ID)) ? actRef.act.ID : "SpHealLight", power, CC, (actRef.refThing != null) ? null : actRef.act).Roll();
2104 if (actRef.refThing != null)
2105 {
2106 num7 = num7 * (100 + actRef.refThing.Evalue(750) * 10) / 100;
2107 }
2108 if (flag)
2109 {
2110 TC.DamageHP(num7 / 2, 919, power);
2111 break;
2112 }
2113 TC.HealHPHost(num7, (actRef.refThing == null && id != EffectId.JureHeal) ? HealSource.Magic : HealSource.Item);
2114 TC.CureHost(CureType.Heal, power, state);
2115 TC.Say((power >= 300) ? "heal_heavy" : "heal_light", TC);
2116 break;
2117 }
2118 case EffectId.RemedyJure:
2119 TC.HealHP(1000000, HealSource.Magic);
2120 TC.CureHost(CureType.Jure, power, state);
2121 TC.Say("heal_jure", TC);
2122 break;
2123 case EffectId.Headpat:
2124 CC.Cuddle(TC, headpat: true);
2125 break;
2126 case EffectId.RemoveHex:
2127 case EffectId.RemoveHexAll:
2128 if (flag)
2129 {
2130 Redirect(EffectId.CurseEQ, BlessedState.Normal, default(ActRef));
2131 break;
2132 }
2133 foreach (Condition item6 in TC.conditions.Copy())
2134 {
2135 if (item6.Type == ConditionType.Debuff && !item6.IsKilled && EClass.rnd(power * 2) > EClass.rnd(item6.power))
2136 {
2137 CC.Say("removeHex", TC, item6.Name.ToLower());
2138 item6.Kill();
2139 if (id == EffectId.RemoveHex)
2140 {
2141 break;
2142 }
2143 }
2144 }
2145 TC.AddCondition<ConHolyVeil>(power / 2);
2146 break;
2147 case EffectId.CureCorruption:
2148 TC.PlaySound("heal");
2149 TC.PlayEffect("heal");
2150 if (flag)
2151 {
2152 TC.Say("cureCorruption_curse", TC);
2153 TC.mana.Mod(9999);
2154 TC.ModCorruption(power);
2155 }
2156 else
2157 {
2158 TC.Say("cureCorruption", TC);
2159 TC.ModCorruption(-power * (blessed ? 150 : 200) / 100);
2160 }
2161 break;
2162 case EffectId.Drink:
2163 case EffectId.DrinkRamune:
2164 case EffectId.DrinkMilk:
2165 if (id == EffectId.DrinkRamune)
2166 {
2167 TC.Say("drinkRamune", TC);
2168 }
2169 if (TC.IsPC)
2170 {
2171 TC.Say("drinkGood", TC);
2172 }
2173 if (id == EffectId.DrinkMilk)
2174 {
2175 if (TC.IsPC)
2176 {
2177 TC.Say("drinkMilk", TC);
2178 }
2179 if (blessed)
2180 {
2181 TC.ModHeight(EClass.rnd(5) + 3);
2182 }
2183 else if (flag)
2184 {
2185 TC.ModHeight((EClass.rnd(5) + 3) * -1);
2186 }
2187 }
2188 break;
2189 case EffectId.DrinkWater:
2190 if (flag)
2191 {
2192 if (TC.IsPC)
2193 {
2194 TC.Say("drinkWater_dirty", TC);
2195 }
2197 }
2198 else if (TC.IsPC)
2199 {
2200 TC.Say("drinkWater_clear", TC);
2201 }
2202 break;
2203 case EffectId.DrinkWaterDirty:
2204 if (TC.IsPC)
2205 {
2206 TC.Say("drinkWater_dirty", TC);
2207 }
2208 if (TC.IsPCFaction)
2209 {
2210 TC.Vomit();
2211 }
2212 break;
2213 case EffectId.SaltWater:
2214 if (TC.HasElement(1211))
2215 {
2216 TC.Say("drinkSaltWater_snail", TC);
2217 int num12 = ((TC.hp > 10) ? (TC.hp - EClass.rnd(10)) : 10000);
2218 TC.DamageHP(num12, AttackSource.None, CC);
2219 }
2220 else if (TC.IsPC)
2221 {
2222 TC.Say("drinkSaltWater", TC);
2223 }
2224 break;
2225 case EffectId.Booze:
2226 TC.AddCondition<ConDrunk>(power);
2227 if (TC.HasElement(1215))
2228 {
2229 TC.Say("drunk_dwarf", TC);
2230 TC.AddCondition(Condition.Create(power + EClass.rnd(power), delegate(ConBuffStats con)
2231 {
2232 con.SetRefVal(Element.List_MainAttributes.RandomItem(), (int)id);
2233 }));
2234 }
2235 break;
2236 case EffectId.CatsEye:
2237 if (flag)
2238 {
2239 Redirect(EffectId.Blind, BlessedState.Normal, default(ActRef));
2240 }
2241 else
2242 {
2243 TC.AddCondition<ConNightVision>(power);
2244 }
2245 break;
2246 case EffectId.Hero:
2247 if (flag)
2248 {
2249 Redirect(EffectId.Fear, BlessedState.Normal, default(ActRef));
2250 }
2251 else
2252 {
2253 TC.AddCondition<ConHero>(power);
2254 }
2255 break;
2256 case EffectId.HolyVeil:
2257 if (flag)
2258 {
2259 Redirect(EffectId.Fear, BlessedState.Normal, default(ActRef));
2260 }
2261 else
2262 {
2263 TC.AddCondition<ConHolyVeil>(power);
2264 }
2265 break;
2266 case EffectId.Levitate:
2267 if (flag)
2268 {
2269 Redirect(EffectId.Gravity, BlessedState.Normal, default(ActRef));
2270 }
2271 else
2272 {
2273 TC.AddCondition<ConLevitate>(power);
2274 }
2275 break;
2276 case EffectId.Gravity:
2277 if (blessed)
2278 {
2279 power /= 4;
2280 }
2281 TC.AddCondition<ConGravity>(power);
2282 if (flag)
2283 {
2284 Redirect(EffectId.BuffStats, BlessedState.Cursed, new ActRef
2285 {
2286 aliasEle = "STR"
2287 });
2288 }
2289 break;
2290 case EffectId.Fear:
2291 if (blessed)
2292 {
2293 power /= 4;
2294 }
2295 TC.AddCondition<ConFear>(power);
2296 if (flag)
2297 {
2298 Redirect(EffectId.Confuse, BlessedState.Normal, default(ActRef));
2299 }
2300 break;
2301 case EffectId.Faint:
2302 if (blessed)
2303 {
2304 power /= 4;
2305 }
2306 TC.AddCondition<ConFaint>(power);
2307 if (flag)
2308 {
2309 Redirect(EffectId.Disease, BlessedState.Normal, default(ActRef));
2310 }
2311 break;
2312 case EffectId.Paralyze:
2313 if (blessed)
2314 {
2315 power /= 4;
2316 }
2317 TC.AddCondition<ConParalyze>(power);
2318 if (flag)
2319 {
2320 Redirect(EffectId.Blind, BlessedState.Normal, default(ActRef));
2321 }
2322 break;
2323 case EffectId.Poison:
2324 if (blessed)
2325 {
2326 power /= 4;
2327 }
2328 TC.AddCondition<ConPoison>(power);
2329 if (flag)
2330 {
2331 Redirect(EffectId.Paralyze, BlessedState.Normal, default(ActRef));
2332 }
2333 break;
2334 case EffectId.Sleep:
2335 if (blessed)
2336 {
2337 power /= 4;
2338 }
2339 TC.AddCondition<ConSleep>(power);
2340 if (flag)
2341 {
2342 Redirect(EffectId.Disease, BlessedState.Normal, default(ActRef));
2343 }
2344 break;
2345 case EffectId.Confuse:
2346 if (blessed)
2347 {
2348 power /= 4;
2349 }
2350 TC.AddCondition<ConConfuse>(power);
2351 if (flag)
2352 {
2353 Redirect(EffectId.Fear, BlessedState.Normal, default(ActRef));
2354 }
2355 break;
2356 case EffectId.Blind:
2357 if (blessed)
2358 {
2359 power /= 4;
2360 }
2361 TC.AddCondition<ConBlind>(power);
2362 if (flag)
2363 {
2364 Redirect(EffectId.Confuse, BlessedState.Normal, default(ActRef));
2365 }
2366 break;
2367 case EffectId.Disease:
2368 if (blessed)
2369 {
2370 power /= 4;
2371 }
2372 TC.AddCondition<ConDisease>(power);
2373 if (flag)
2374 {
2375 Redirect(EffectId.Poison, BlessedState.Normal, default(ActRef));
2376 }
2377 break;
2378 case EffectId.Acid:
2379 {
2380 if (blessed)
2381 {
2382 power /= 4;
2383 }
2384 List<Thing> list7 = TC.things.List((Thing t) => (t.Num <= 1 && t.IsEquipmentOrRanged && !t.IsToolbelt && !t.IsLightsource && t.isEquipped) ? true : false);
2385 if (list7.Count != 0)
2386 {
2387 Thing thing5 = list7.RandomItem();
2388 TC.Say("acid_hit", TC);
2389 if (thing5.isAcidproof)
2390 {
2391 TC.Say("acid_nullify", thing5);
2392 }
2393 else if (thing5.encLV > -5)
2394 {
2395 TC.Say("acid_rust", TC, thing5);
2396 thing5.ModEncLv(-1);
2397 LayerInventory.SetDirty(thing5);
2398 }
2399 if (TC.IsPCParty)
2400 {
2401 Tutorial.Reserve("rust");
2402 }
2403 }
2404 break;
2405 }
2406 case EffectId.PuddleEffect:
2407 TC.DamageHP(power / 5, actRef.idEle, power);
2408 break;
2409 case EffectId.Acidproof:
2410 if (blessed)
2411 {
2412 power /= 4;
2413 }
2414 if (TC.IsPC)
2415 {
2416 TC.Say("pc_pain");
2417 }
2418 TC.Say("drink_acid", TC);
2419 TC.DamageHP(power / 5, 923, power);
2420 break;
2421 case EffectId.LevelDown:
2422 Msg.Say("nothingHappens");
2423 break;
2424 case EffectId.Love:
2425 case EffectId.LovePlus:
2426 if (flag)
2427 {
2428 if (CC == TC)
2429 {
2430 TC.Say("love_curse_self", TC);
2431 }
2432 else
2433 {
2434 TC.Say("love_curse", CC, TC);
2435 TC.ModAffinity(CC, -power / 4, show: false);
2436 }
2437 TC.ShowEmo(Emo.angry);
2438 }
2439 else
2440 {
2441 LoveMiracle(TC, CC, power, id, state);
2442 }
2443 break;
2444 case EffectId.HairGrowth:
2445 if (flag)
2446 {
2447 if (TC.HasElement(1532))
2448 {
2449 TC.SetMutation(1532);
2450 }
2451 else
2452 {
2453 TC.SetMutation(1533, 1);
2454 }
2455 TC.c_fur = 0;
2456 break;
2457 }
2458 if (blessed)
2459 {
2460 if (TC.HasElement(1533))
2461 {
2462 TC.SetMutation(1533);
2463 }
2464 else
2465 {
2466 TC.SetMutation(1532, 1);
2467 }
2468 }
2469 TC.PlayEffect("aura_heaven");
2470 TC.PlaySound("godbless");
2471 if (!TC.HaveFur())
2472 {
2473 TC.Say("grow_hair_fail", TC);
2474 break;
2475 }
2476 TC.Say("grow_hair", TC);
2477 TC.c_fur = 100;
2478 break;
2479 case EffectId.Gene:
2480 GeneMiracle(TC, CC, blessed ? DNA.Type.Superior : (flag ? DNA.Type.Brain : DNA.Type.Default));
2481 break;
2482 }
2483 void Redirect(EffectId _id, BlessedState _state, ActRef _ref1)
2484 {
2485 Proc(_id, orgPower, _state, cc, tc, _ref1);
2486 }
2487 }
2488
2489 public static void Poison(Chara tc, Chara c, int power)
2490 {
2491 tc.Say("eat_poison", tc);
2492 tc.Talk("scream");
2493 if (power > 100000000)
2494 {
2495 power = 100000000;
2496 }
2497 int num = (int)Mathf.Sqrt(power * 100);
2498 tc.DamageHP(num * 2 + EClass.rnd(num), 915, power);
2499 if (!tc.isDead && !tc.IsPC)
2500 {
2502 }
2503 }
2504
2505 public static void LoveMiracle(Chara tc, Chara c, int power, EffectId idEffect = EffectId.Love, BlessedState? state = null)
2506 {
2507 if (c == tc)
2508 {
2509 tc.Say("love_ground", tc);
2510 }
2511 else
2512 {
2513 tc.Say("love_chara", c, tc);
2514 }
2515 tc.ModAffinity(EClass.pc, power / 4);
2516 if ((idEffect != EffectId.Love || EClass.rnd(2) != 0) && (!EClass._zone.IsUserZone || tc.IsPCFaction || !EClass.game.principal.disableUsermapBenefit))
2517 {
2518 if (idEffect == EffectId.MoonSpear && EClass.rnd(EClass.debug.enable ? 2 : 20) == 0)
2519 {
2520 Thing thing = tc.MakeGene();
2521 tc.GiveBirth(thing, effect: true);
2522 tc.Say("item_drop", thing);
2523 }
2524 else if (idEffect != EffectId.LovePlus && EClass.rnd(2) == 0)
2525 {
2526 Thing c2 = tc.MakeMilk(effect: true, 1, addToZone: true, state);
2527 tc.Say("item_drop", c2);
2528 }
2529 else
2530 {
2531 Thing c3 = tc.MakeEgg(effect: true, 1, addToZone: true, (idEffect == EffectId.LovePlus) ? 3 : 20, state);
2532 tc.Say("item_drop", c3);
2533 }
2534 }
2535 }
2536
2537 public static void GeneMiracle(Chara tc, Chara c, DNA.Type type)
2538 {
2540 {
2542 return;
2543 }
2544 if (c == tc)
2545 {
2546 tc.Say("love_ground", tc);
2547 }
2548 else
2549 {
2550 tc.Say("love_chara", c, tc);
2551 }
2552 Thing t = tc.MakeGene(type);
2553 tc.GiveBirth(t, effect: true);
2554 }
2555
2556 public static Point GetTeleportPos(Point org, int radius = 6)
2557 {
2558 Point point = new Point();
2559 for (int i = 0; i < 10000; i++)
2560 {
2561 point.Set(org);
2562 point.x += EClass.rnd(radius) - EClass.rnd(radius);
2563 point.z += EClass.rnd(radius) - EClass.rnd(radius);
2564 if (point.IsValid && point.IsInBounds && !point.cell.blocked && point.Distance(org) >= radius / 3 + 1 - i / 50 && !point.cell.HasZoneStairs())
2565 {
2566 return point;
2567 }
2568 }
2569 return org.GetRandomNeighbor().GetNearestPoint();
2570 }
2571
2572 public static bool Wish(string s, string name, int power, BlessedState state)
2573 {
2575 string netMsg = GameLang.Parse("wish".langGame(), thirdPerson: true, name, s);
2576 bool net = EClass.core.config.net.enable && EClass.core.config.net.sendEvent;
2577 List<WishItem> list = new List<WishItem>();
2578 int wishLv = 10 + power / 4;
2579 int wishValue = 5000 + power * 50;
2580 if (state >= BlessedState.Blessed)
2581 {
2582 wishLv = wishLv * 150 / 100;
2583 }
2584 else if (state <= BlessedState.Cursed)
2585 {
2586 wishLv = wishLv * 150 / 100;
2587 wishValue = 1;
2588 }
2589 Debug.Log(power + "/" + wishValue);
2590 string _s = s.ToLower();
2591 foreach (CardRow r in EClass.sources.cards.rows)
2592 {
2593 if (r.HasTag(CTAG.godArtifact))
2594 {
2595 bool flag = false;
2596 foreach (Religion item in EClass.game.religions.list)
2597 {
2598 if (item.IsValidArtifact(r.id))
2599 {
2600 flag = true;
2601 }
2602 }
2603 if (!flag)
2604 {
2605 continue;
2606 }
2607 }
2608 else if (r.quality >= 4 || r.HasTag(CTAG.noWish))
2609 {
2610 switch (r.id)
2611 {
2612 case "medal":
2613 case "plat":
2614 case "money":
2615 case "money2":
2616 break;
2617 default:
2618 continue;
2619 }
2620 }
2621 if (r.isChara)
2622 {
2623 continue;
2624 }
2625 string text = r.GetName().ToLower();
2626 int score = Compare(_s, text);
2627 if (score == 0)
2628 {
2629 continue;
2630 }
2631 list.Add(new WishItem
2632 {
2633 score = score,
2634 n = text,
2635 action = delegate
2636 {
2637 Debug.Log(r.id);
2638 SourceCategory.Row category = EClass.sources.cards.map[r.id].Category;
2639 if (category.IsChildOf("weapon") || category.IsChildOf("armor") || category.IsChildOf("ranged"))
2640 {
2641 CardBlueprint.SetRarity(Rarity.Legendary);
2642 }
2643 Thing thing = ThingGen.Create(r.id, -1, wishLv);
2644 int num = 1;
2645 int price = thing.GetPrice(CurrencyType.Money, sell: false, PriceType.Tourism);
2646 bool flag2 = thing.trait is TraitDeed || thing.rarity >= Rarity.Artifact || thing.source._origin == "artifact_summon";
2647 switch (thing.id)
2648 {
2649 case "rod_wish":
2650 thing.c_charges = 0;
2651 break;
2652 case "money":
2653 num = EClass.rndHalf(wishValue * 3);
2654 break;
2655 case "plat":
2656 num = EClass.rndHalf(wishValue / 500 + 4);
2657 break;
2658 case "money2":
2659 num = EClass.rndHalf(wishValue / 500 + 4);
2660 break;
2661 case "medal":
2662 num = EClass.rndHalf(wishValue / 2000 + 4);
2663 break;
2664 default:
2665 if (!flag2 && thing.trait.CanStack)
2666 {
2667 int num2 = wishValue;
2668 num2 -= price;
2669 for (int i = 1; i < 1000; i++)
2670 {
2671 int num3 = price + i * 2 * (price + 500);
2672 if (num3 > 0 && num2 > num3)
2673 {
2674 num++;
2675 num2 -= num3;
2676 }
2677 }
2678 }
2679 break;
2680 }
2681 if (price > 2500 && num > 3)
2682 {
2683 num = 3 + (int)Mathf.Sqrt(num - 3);
2684 }
2685 if (price > 5000 && num > 2)
2686 {
2687 num = 2 + (int)Mathf.Sqrt(num - 2) / 2;
2688 }
2689 if (price > 10000 && num > 1)
2690 {
2691 num = 1 + Mathf.Min((int)Mathf.Sqrt(num - 1) / 3, 2);
2692 }
2693 if (num < 1)
2694 {
2695 num = 1;
2696 }
2697 thing.SetNum(num);
2698 Debug.Log(_s + "/" + num + "/" + score);
2699 if (thing.HasTag(CTAG.godArtifact))
2700 {
2701 Religion.Reforge(thing.id);
2702 }
2703 else
2704 {
2705 EClass._zone.AddCard(thing, EClass.pc.pos);
2706 }
2707 netMsg = netMsg + Lang.space + GameLang.Parse("wishNet".langGame(), Msg.IsThirdPerson(thing), Msg.GetName(thing).ToTitleCase());
2708 if (net)
2709 {
2710 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
2711 }
2712 Msg.Say("dropReward");
2713 }
2714 });
2715 }
2716 if (list.Count == 0)
2717 {
2718 netMsg = netMsg + Lang.space + "wishFail".langGame();
2719 if (net)
2720 {
2721 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
2722 }
2723 Msg.Say("wishFail");
2724 return false;
2725 }
2726 list.Sort((WishItem a, WishItem b) => b.score - a.score);
2727 foreach (WishItem item2 in list)
2728 {
2729 Debug.Log(item2.score + "/" + s + "/" + item2.n);
2730 }
2731 list[0].action();
2732 return true;
2733 }
2734
2735 public static int Compare(string s, string t)
2736 {
2737 if (s.IsEmpty())
2738 {
2739 return 0;
2740 }
2741 int num = 0;
2742 if (t == s)
2743 {
2744 num += 100;
2745 }
2746 if (t.Contains(s))
2747 {
2748 num += 100;
2749 }
2750 return num;
2751 }
2752}
AnimeID
Definition: AnimeID.cs:2
AttackSource
Definition: AttackSource.cs:2
BlessedState
Definition: BlessedState.cs:2
CTAG
Definition: CTAG.cs:2
@ currency
ChatCategory
Definition: ChatCategory.cs:2
ConditionType
Definition: ConditionType.cs:2
CureType
Definition: CureType.cs:2
CurrencyType
Definition: CurrencyType.cs:2
EffectId
Definition: EffectId.cs:2
Emo
Definition: Emo.cs:2
HealSource
Definition: HealSource.cs:2
Hostility
Definition: Hostility.cs:2
IDTSource
Definition: IDTSource.cs:2
PriceType
Definition: PriceType.cs:2
Rarity
Definition: Rarity.cs:2
ThrowMethod
Definition: ThrowMethod.cs:2
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
static void Poison(Chara tc, Chara c, int power)
Definition: ActEffect.cs:2489
static void LoveMiracle(Chara tc, Chara c, int power, EffectId idEffect=EffectId.Love, BlessedState? state=null)
Definition: ActEffect.cs:2505
static void Proc(EffectId id, int power, BlessedState state, Card cc, Card tc=null, ActRef actRef=default(ActRef))
Definition: ActEffect.cs:915
static void GeneMiracle(Chara tc, Chara c, DNA.Type type)
Definition: ActEffect.cs:2537
static Point GetTeleportPos(Point org, int radius=6)
Definition: ActEffect.cs:2556
static int angle
Definition: ActEffect.cs:21
static int Compare(string s, string t)
Definition: ActEffect.cs:2735
static float RapidDelay
Definition: ActEffect.cs:19
static int RapidCount
Definition: ActEffect.cs:17
static void TryDelay(Action a)
Definition: ActEffect.cs:23
static void Proc(EffectId id, Card cc, Card tc=null, int power=100, ActRef actRef=default(ActRef))
Definition: ActEffect.cs:910
static bool DamageEle(Card CC, EffectId id, int power, Element e, List< Point > points, ActRef actref, string lang=null)
Definition: ActEffect.cs:36
static bool Wish(string s, string name, int power, BlessedState state)
Definition: ActEffect.cs:2572
static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef=default(ActRef))
Definition: ActEffect.cs:437
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
Definition: ActThrow.cs:97
virtual int ElementPowerMod
Definition: ACT.cs:111
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
void SetElement(int id)
virtual string Name
void SetRefVal(int a, int b)
virtual ConditionType Type
Definition: BaseStats.cs:19
static int GetColorInt(ref Color matColor, int p)
void SetGender(int g)
Definition: Biography.cs:473
int GetAge(Chara c)
Definition: Biography.cs:276
void SetAge(Chara c, int a)
Definition: Biography.cs:297
int gender
Definition: Biography.cs:29
static void Set(CardBlueprint _bp)
static CardBlueprint current
GlobalCharaList globalCharas
Definition: CardManager.cs:46
virtual string GetName(int i)
Definition: CardRow.cs:95
int quality
Definition: CardRow.cs:19
bool isChara
Definition: CardRow.cs:55
string id
Definition: CardRow.cs:7
Definition: Card.cs:11
int c_lockedAge
Definition: Card.cs:1339
bool IsPCFactionOrMinion
Definition: Card.cs:2246
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:5706
virtual bool IsMultisize
Definition: Card.cs:2132
virtual bool isThing
Definition: Card.cs:2055
bool IsAmmo
Definition: Card.cs:2221
virtual Chara Chara
Definition: Card.cs:2044
Thing Split(int a)
Definition: Card.cs:3395
ElementContainerCard elements
Definition: Card.cs:39
string id
Definition: Card.cs:33
bool IsUnique
Definition: Card.cs:2065
bool HasElement(int ele, int req=1)
Definition: Card.cs:5767
bool IsThrownWeapon
Definition: Card.cs:2219
SourceMaterial.Row material
Definition: Card.cs:2025
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5981
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3007
bool isCopy
Definition: Card.cs:876
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:7085
virtual bool IsPCParty
Definition: Card.cs:2123
int c_uidMaster
Definition: Card.cs:1435
Biography bio
Definition: Card.cs:42
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6536
Card SetLv(int a)
Definition: Card.cs:2871
Rarity rarity
Definition: Card.cs:312
string Name
Definition: Card.cs:2111
bool IsRangedWeapon
Definition: Card.cs:2217
ICardParent parent
Definition: Card.cs:53
bool ExistsOnMap
Definition: Card.cs:2059
Thing SetNum(int a)
Definition: Card.cs:3406
Thing GiveBirth(Thing t, bool effect)
Definition: Card.cs:5644
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3806
bool isAcidproof
Definition: Card.cs:684
bool IsToolbelt
Definition: Card.cs:2143
bool HasTag(CTAG tag)
Definition: Card.cs:2569
Point pos
Definition: Card.cs:57
bool IsInMutterDistance(int d=10)
Definition: Card.cs:7516
void SetDirtyWeight()
Definition: Card.cs:2528
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6015
bool IsEquipmentOrRanged
Definition: Card.cs:2192
void TryStack(Thing t)
Definition: Card.cs:6792
Trait trait
Definition: Card.cs:51
bool IsPowerful
Definition: Card.cs:2068
int encLV
Definition: Card.cs:324
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2101
Thing MakeMilk(bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
Definition: Card.cs:5620
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:3974
void ModEncLv(int a)
Definition: Card.cs:3757
void SayNothingHappans()
Definition: Card.cs:6628
void Destroy()
Definition: Card.cs:4962
bool HaveFur()
Definition: Card.cs:7677
virtual bool IsPC
Definition: Card.cs:2117
virtual bool isChara
Definition: Card.cs:2057
virtual Thing Thing
Definition: Card.cs:2032
Card GetRootCard()
Definition: Card.cs:3337
int Evalue(int ele)
Definition: Card.cs:2545
int Dist(Card c)
Definition: Card.cs:7472
int ResistLv(int res)
Definition: Card.cs:5762
bool IsLightsource
Definition: Card.cs:2145
virtual bool HasHost
Definition: Card.cs:2397
BlessedState blessedState
Definition: Card.cs:276
Card Install()
Definition: Card.cs:3652
Card parentCard
Definition: Card.cs:101
void ModExp(string alias, int a)
Definition: Card.cs:2622
DNA c_DNA
Definition: Card.cs:1867
int genLv
Definition: Card.cs:192
int Num
Definition: Card.cs:156
bool IsWeapon
Definition: Card.cs:2180
int LV
Definition: Card.cs:384
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6633
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5604
bool IsTopWaterAndNoSnow
Definition: Cell.cs:712
SourceMaterial.Row matObj
Definition: Cell.cs:1036
bool HasZoneStairs(bool includeLocked=true)
Definition: Cell.cs:1717
void UnqeuipIfTooHeavy(Thing t)
Definition: CharaBody.cs:165
static Chara CreateFromElement(string idEle, int lv=-1, string idFilter="chara")
Definition: CharaGen.cs:32
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
Definition: CharaGen.cs:22
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Definition: Chara.cs:10
override bool IsAliveInCurrentZone
Definition: Chara.cs:559
Element MainElement
Definition: Chara.cs:715
CharaBody body
Definition: Chara.cs:94
bool IsLevitating
Definition: Chara.cs:595
bool TryNeckHunt(Chara TC, int power, bool harvest=false)
Definition: Chara.cs:9330
void Cuddle(Chara c, bool headpat=false)
Definition: Chara.cs:6104
void InstantEat(Thing t=null, bool sound=true)
Definition: Chara.cs:7377
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:8968
Faction faction
Definition: Chara.cs:425
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7711
override bool IsPC
Definition: Chara.cs:610
Chara host
Definition: Chara.cs:33
Point GetFirstStep(Point newPoint, PathManager.MoveType moveType=PathManager.MoveType.Default)
Definition: Chara.cs:2543
Chara GetNearbyCatToSniff()
Definition: Chara.cs:7844
bool CanSeeLos(Card c, int dist=-1)
Definition: Chara.cs:1244
override bool IsPCParty
Definition: Chara.cs:613
bool RequestProtection(Chara attacker, Action< Chara > action)
Definition: Chara.cs:8148
bool HasCondition(string alias)
Definition: Chara.cs:9125
void SetMainElement(string id, int v=0, bool elemental=false)
Definition: Chara.cs:2056
Stats hunger
Definition: Chara.cs:1136
bool HasMinion(string id)
Definition: Chara.cs:2322
override bool HasHost
Definition: Chara.cs:686
override bool IsPCFaction
Definition: Chara.cs:669
override bool IsPCPartyMinion
Definition: Chara.cs:637
int MaxSummon
Definition: Chara.cs:712
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2311
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
Definition: Chara.cs:5180
Chara Duplicate()
Definition: Chara.cs:1765
void MakeAlly(bool msg=true)
Definition: Chara.cs:2257
bool CanDuplicate()
Definition: Chara.cs:1752
Stats mana
Definition: Chara.cs:1148
void TryDropBossLoot()
Definition: Chara.cs:5482
string NameTitled
Definition: Chara.cs:514
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:8412
Thing MakeGene(DNA.Type? type=null)
Definition: Chara.cs:7923
Religion faith
Definition: Chara.cs:437
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6192
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7501
void SetSummon(int duration)
Definition: Chara.cs:2351
bool IsHostile()
Definition: Chara.cs:6369
bool isDead
Definition: Chara.cs:387
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:4229
void Sniff(Chara c)
Definition: Chara.cs:7856
void MoveZone(string alias)
Definition: Chara.cs:3290
UD_String_Color elementColors
Definition: ConWet.cs:2
virtual bool IsKilled
Definition: Condition.cs:7
void Kill(bool silent=false)
Definition: Condition.cs:91
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
Definition: Condition.cs:46
new GameConfig game
Definition: CoreConfig.cs:605
GraphicSetting graphic
Definition: CoreConfig.cs:603
CameraConfig camera
Definition: CoreConfig.cs:613
NetSetting net
Definition: CoreConfig.cs:607
bool enable
Definition: CoreDebug.cs:286
CoreConfig config
Definition: Core.cs:70
Definition: DNA.cs:8
Type
Definition: DNA.cs:10
static Type GetType(string idMat)
Definition: DNA.cs:498
void Generate(Type _type, Chara model=null)
Definition: DNA.cs:254
int GetRaw(int offsetHours=0)
Definition: Date.cs:322
Definition: Dialog.cs:7
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
Definition: Dialog.cs:528
Definition: Dice.cs:4
static int RollMax(int num, int sides, int bonus=0)
Definition: Dice.cs:46
static int Roll(int num, int sides, int bonus=0, Card card=null)
Definition: Dice.cs:15
static Dice Create(Element ele, Card c)
Definition: Dice.cs:96
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
static ColorProfile Colors
Definition: EClass.cs:38
static Core core
Definition: EClass.cs:6
static void Wait(float a, Card c)
Definition: EClass.cs:102
static Zone _zone
Definition: EClass.cs:20
static World world
Definition: EClass.cs:40
static Map _map
Definition: EClass.cs:18
static int rnd(long a)
Definition: EClass.cs:58
static SourceManager sources
Definition: EClass.cs:42
static int rndHalf(int a)
Definition: EClass.cs:87
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
static CoreDebug debug
Definition: EClass.cs:48
static GameSetting setting
Definition: EClass.cs:34
Definition: EInput.cs:8
static bool isShiftDown
Definition: EInput.cs:261
static void Create(Point center, int radius, int count, Action< int, Point > onComplete)
Definition: EffectMeteor.cs:33
Definition: Effect.cs:7
static Effect Get(Effect original)
Definition: Effect.cs:85
Effect SetStartDelay(float a)
Definition: Effect.cs:199
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:100
Effect SetParticleColor(Color c)
Definition: Effect.cs:289
List< Element > ListElements(Func< Element, bool > shoudList=null, Comparison< Element > comparison=null)
Dictionary< int, Element > dict
int Value(int ele)
Element ModTempPotential(int ele, int v, int threshMsg=0)
Element ModBase(int ele, int v)
Element SetBase(string alias, int v, int potential=0)
void Remove(int id)
Element GetOrCreateElement(Element ele)
int id
Definition: ELEMENT.cs:250
int vBase
Definition: ELEMENT.cs:252
SourceElement.Row source
Definition: ELEMENT.cs:273
bool HasTag(string tag)
Definition: ELEMENT.cs:473
static int[] List_MainAttributes
Definition: ELEMENT.cs:240
static int GetId(string alias)
Definition: ELEMENT.cs:1119
int Value
Definition: ELEMENT.cs:292
virtual string Name
Definition: ELEMENT.cs:304
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1100
static Element Void
Definition: ELEMENT.cs:238
bool IsTrait
Definition: ELEMENT.cs:362
bool HasItemProtection
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
Definition: GameLang.cs:125
bool disableUsermapBenefit
UD_String_ElementRef elements
Definition: GameSetting.cs:315
ReligionManager religions
Definition: Game.cs:158
GamePrincipal principal
Definition: Game.cs:221
SpatialManager spatials
Definition: Game.cs:152
CardManager cards
Definition: Game.cs:155
bool IsSurvival
Definition: Game.cs:272
Definition: Gender.cs:2
static string Name(int g)
Definition: Gender.cs:9
static bool Has(string id)
Definition: LangGame.cs:46
Definition: Lang.cs:6
static string langCode
Definition: Lang.cs:28
static string[] GetList(string id)
Definition: Lang.cs:114
static LayerDragGrid CreateEnchant(Chara cc, bool armor, bool superior=false, BlessedState state=BlessedState.Normal, int count=1)
static LayerDragGrid CreateChangeMaterial(Chara cc, Thing consume, SourceMaterial.Row mat, EffectId idEffect, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static LayerDragGrid CreateLighten(Chara cc, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static LayerDragGrid CreateUncurse(Chara cc, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static LayerDragGrid CreateReconstruction(Chara cc, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static LayerDragGrid CreateIdentify(Chara cc, bool superior=false, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static void SetDirty(Thing t)
int Width
Definition: MapBounds.cs:26
Chara FindChara(string id)
Definition: Map.cs:2568
void TryShatter(Point pos, int ele, int power)
Definition: Map.cs:1200
List< Point > ListPointsInArc(Point center, Point to, int radius, float angle)
Definition: Map.cs:2309
void Reveal(Point center, int power=100)
Definition: Map.cs:918
void MineObj(Point point, Task task=null, Chara c=null)
Definition: Map.cs:1840
void MineBlock(Point point, bool recoverBlock=false, Chara c=null, bool mineObj=true)
Definition: Map.cs:1668
List< Point > ListPointsInLine(Point center, Point to, int radius)
Definition: Map.cs:2326
void SetEffect(int x, int z, CellEffect effect=null)
Definition: Map.cs:1508
List< Point > ListPointsInCircle(Point center, float radius, bool mustBeWalkable=true, bool los=true)
Definition: Map.cs:2278
List< Chara > charas
Definition: Map.cs:81
void RevealAll(bool reveal=true)
Definition: Map.cs:905
MapBounds bounds
Definition: Map.cs:52
Definition: Msg.cs:5
static bool IsThirdPerson(Card c)
Definition: Msg.cs:291
static ThirstPersonInfo thirdPerson1
Definition: Msg.cs:6
static string SayNothingHappen()
Definition: Msg.cs:96
static string GetName(Card c)
Definition: Msg.cs:274
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
Definition: Net.cs:11
static async UniTask< bool > SendChat(string name, string msg, ChatCategory cat, string idLang)
Definition: Net.cs:318
int deepest
Definition: Player.cs:111
int deepestVoid
Definition: Player.cs:114
void ModKarma(int a)
Definition: Player.cs:2489
Stats stats
Definition: Player.cs:1013
int CountKeyItem(string alias)
Definition: Player.cs:2141
ReturnInfo returnInfo
Definition: Player.cs:863
Definition: Point.cs:9
Thing Installed
Definition: Point.cs:315
SourceMaterial.Row matBlock
Definition: Point.cs:55
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1035
Point Copy()
Definition: Point.cs:479
Point Set(int _x, int _z)
Definition: Point.cs:491
int x
Definition: Point.cs:36
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:607
void ModFire(int value, bool extinguish=false)
Definition: Point.cs:917
int z
Definition: Point.cs:39
bool IsSync
Definition: Point.cs:332
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1237
bool Equals(int _x, int _z)
Definition: Point.cs:944
bool IsValid
Definition: Point.cs:88
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:973
Chara FirstChara
Definition: Point.cs:276
bool HasBlock
Definition: Point.cs:141
bool IsInBounds
Definition: Point.cs:104
Cell cell
Definition: Point.cs:51
Point GetRandomNeighbor()
Definition: Point.cs:747
void Animate(AnimeID id, bool animeBlock=false)
Definition: Point.cs:1286
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
Definition: Point.cs:757
ReligionWind Wind
ReligionTrickery Trickery
ReligionElement Element
List< Religion > list
ReligionHealing Healing
static Thing Reforge(string id, Point pos=null, bool first=true)
Definition: Religion.cs:279
void Talk(string idTalk, Card c=null, Card agent=null)
Definition: Religion.cs:153
bool HasTag(CTAG _tag)
Definition: RenderRow.cs:125
Definition: Shaker.cs:5
static void ShakeCam(string id="default", float magnitude=1f)
Definition: Shaker.cs:25
List< CardRow > rows
Definition: SourceCard.cs:6
Dictionary< string, CardRow > map
Definition: SourceCard.cs:8
SourceMaterial materials
SourceStat stats
SourceCalc calc
SourceCard cards
SourceElement elements
static Dictionary< string, TierList > tierMap
static Spatial Create(string id, Spatial parent, bool register, int x=-99999, int y=-99999, int icon=0)
Definition: SpatialGen.cs:16
Zone Find(string id)
List< Zone > ListReturnLocations()
int lv
Definition: Spatial.cs:142
int visitCount
Definition: Spatial.cs:154
List< Spatial > children
Definition: Spatial.cs:37
static SpawnList Get(string id, Func< SourceChara.Row, bool > func)
virtual void Mod(int a)
Definition: Stats.cs:135
virtual int value
Definition: Stats.cs:56
virtual int max
Definition: Stats.cs:68
Definition: TC.cs:4
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8
SourceThing.Row source
Definition: Thing.cs:11
bool isEquipped
Definition: Thing.cs:17
override CardRow sourceCard
Definition: Thing.cs:47
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:2048
void Set(string n)
virtual SourceElement.Row source
Definition: TraitScroll.cs:5
static void BadEffect(Chara c)
Definition: TraitWell.cs:143
virtual bool CanBeAttacked
Definition: Trait.cs:164
static void Reserve(string idStep, Action onBeforePlay=null)
Definition: Tutorial.cs:55
static void Play(string idStep)
Definition: Tutorial.cs:7
bool ContainsKey(TKey key)
Definition: UDictionary.cs:151
bool TryGetValue(TKey key, out TValue value)
Definition: UDictionary.cs:178
GameDate date
Definition: World.cs:6
Definition: Zone.cs:12
virtual string GetNewZoneID(int level)
Definition: Zone.cs:542
int CountMinions(Chara c)
Definition: Zone.cs:3640
FactionBranch branch
Definition: Zone.cs:34
virtual bool IsUserZone
Definition: Zone.cs:266
Chara Boss
Definition: Zone.cs:83
void ModInfluence(int a)
Definition: Zone.cs:3521
override int DangerLv
Definition: Zone.cs:107
virtual int MinLv
Definition: Zone.cs:276
bool IsPCFaction
Definition: Zone.cs:468
ZoneInstance instance
Definition: Zone.cs:52
Card AddCard(Card t, Point point)
Definition: Zone.cs:1948
Definition: ActRef.cs:2
Act act
Definition: ActRef.cs:3
Thing refThing
Definition: ActRef.cs:9