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