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