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