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