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