Elin Decompiled Documentation EA 23.130 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 && 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 || !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 int num4 = 0;
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.HasTag(CTAG.suicide) && !c.HasCondition<ConWet>())
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 == 0)
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 c.DamageHP(num4, e.id, power * num / 100, attackSource, chara ?? CC);
325 if (c.IsAliveInCurrentZone && CC.IsAliveInCurrentZone && id == EffectId.DrainMana && c.isChara && CC.isChara && c.Chara.mana.value > 0)
326 {
327 int num6 = num4 * num / 100;
328 Debug.Log(num4 + " v:" + num6 + " evalue:" + e.Value + " power:" + power + " elepMod:" + num);
329 if (num6 > c.Chara.mana.value)
330 {
331 num6 = c.Chara.mana.value;
332 }
333 c.Chara.mana.Mod(-num6);
334 CC.Chara.mana.Mod(num6);
335 }
336 if (id == EffectId.Explosive && CC.trait is TraitCookerMicrowave)
337 {
338 chara = EClass.pc;
339 }
340 if (chara != null && chara.IsAliveInCurrentZone)
341 {
342 chara.DoHostileAction(c);
343 }
344 num2++;
345 }
346 if ((id == EffectId.Explosive || id == EffectId.Suicide) && ((id != EffectId.Suicide && id != EffectId.Meteor) || !EClass._zone.IsPCFaction))
347 {
348 int num7 = id switch
349 {
350 EffectId.Suicide => CC.LV / 3 + 40,
351 EffectId.Meteor => 50 + power / 20,
352 _ => (actref.refThing != null) ? actref.refThing.material.hardness : (30 + power / 20),
353 };
354 bool flag5 = EClass._zone.HasLaw && !EClass._zone.IsPCFaction && (CC.IsPC || (id == EffectId.Explosive && actref.refThing == null)) && !(EClass._zone is Zone_Vernis);
355 if (p.HasObj && p.cell.matObj.hardness <= num7)
356 {
358 if (flag5)
359 {
361 }
362 }
363 if (!p.HasObj && p.HasBlock && p.matBlock.hardness <= num7)
364 {
366 if (flag5)
367 {
369 }
370 }
371 }
372 if (e.id == 910)
373 {
374 int num8 = 0;
375 if (id == EffectId.Meteor)
376 {
377 num8 = 2;
378 }
380 {
381 num8 = 0;
382 }
383 if (num8 > EClass.rnd(10))
384 {
385 p.ModFire(4 + EClass.rnd(10));
386 }
387 }
388 if (e.id == 911)
389 {
390 p.ModFire(-20, extinguish: true);
391 }
392 }
393 if (RapidCount == 0)
394 {
395 foreach (Card item3 in list)
396 {
397 if (item3.ExistsOnMap)
398 {
399 RapidCount += 2;
400 ProcAt(id, power, BlessedState.Normal, item3, null, item3.pos, isNeg: true, actref);
401 }
402 }
403 }
404 return num2 > 0;
405 }
406
407 public static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef = default(ActRef))
408 {
409 Chara CC = cc.Chara;
410 bool flag = state <= BlessedState.Cursed;
411 bool flag2 = isNeg || flag;
412 Element element = Element.Create(actRef.aliasEle.IsEmpty("eleFire"), power / 10);
414 {
415 angle += 5;
416 if (angle > 100)
417 {
418 angle = 30;
419 }
420 Debug.Log(angle);
421 }
422 switch (id)
423 {
424 case EffectId.Earthquake:
425 {
426 List<Point> list3 = EClass._map.ListPointsInCircle(CC.pos, 12f, mustBeWalkable: false);
427 if (list3.Count == 0)
428 {
429 list3.Add(CC.pos.Copy());
430 }
431 CC.Say("spell_earthquake", CC, element.Name.ToLower());
432 TryDelay(delegate
433 {
434 CC.PlaySound("spell_earthquake");
435 });
436 if (CC.IsInMutterDistance())
437 {
438 Shaker.ShakeCam("ball");
439 }
440 EClass.Wait(1f, CC);
441 DamageEle(CC, id, power, element, list3, actRef, "spell_earthquake");
442 break;
443 }
444 case EffectId.Meteor:
445 {
446 EffectMeteor.Create(cc.pos, 6, 10, delegate
447 {
448 });
449 List<Point> list4 = EClass._map.ListPointsInCircle(CC.pos, 10f);
450 if (list4.Count == 0)
451 {
452 list4.Add(CC.pos.Copy());
453 }
454 CC.Say("spell_ball", CC, element.Name.ToLower());
455 TryDelay(delegate
456 {
457 CC.PlaySound("spell_ball");
458 });
459 if (CC.IsInMutterDistance())
460 {
461 Shaker.ShakeCam("ball");
462 }
463 EClass.Wait(1f, CC);
464 DamageEle(CC, id, power, element, list4, actRef, "spell_ball");
465 return;
466 }
467 case EffectId.Hand:
468 case EffectId.DrainBlood:
469 case EffectId.DrainMana:
470 case EffectId.Sword:
471 {
472 List<Point> list5 = new List<Point>();
473 list5.Add(tp.Copy());
474 EClass.Wait(0.3f, CC);
475 TryDelay(delegate
476 {
477 CC.PlaySound("spell_hand");
478 });
479 Chara cC = CC;
480 EffectId id3 = id;
481 Element e = element;
482 ActRef actref = actRef;
483 object lang;
484 switch (id)
485 {
486 default:
487 lang = "spell_hand";
488 break;
489 case EffectId.Sword:
490 lang = "spell_sword";
491 break;
492 case EffectId.DrainBlood:
493 case EffectId.DrainMana:
494 lang = "";
495 break;
496 }
497 if (!DamageEle(cC, id3, power, e, list5, actref, (string)lang))
498 {
499 CC.Say("spell_hand_miss", CC, element.Name.ToLower());
500 }
501 return;
502 }
503 case EffectId.Arrow:
504 {
505 List<Point> list = new List<Point>();
506 list.Add(tp.Copy());
507 CC.Say("spell_arrow", CC, element.Name.ToLower());
508 EClass.Wait(0.5f, CC);
509 TryDelay(delegate
510 {
511 CC.PlaySound("spell_arrow");
512 });
513 DamageEle(CC, id, power, element, list, actRef, "spell_arrow");
514 return;
515 }
516 case EffectId.Summon:
517 {
518 CC.Say("summon_ally", CC);
519 if (EClass._zone.CountMinions(CC) >= CC.MaxSummon || CC.c_uidMaster != 0)
520 {
521 CC.Say("summon_ally_fail", CC);
522 return;
523 }
524 string id4 = actRef.n1;
525 int num3 = 1;
526 int num4 = -1;
527 int radius = 3;
528 bool flag3 = false;
529 int num5 = -1;
530 switch (actRef.n1)
531 {
532 case "shadow":
533 num3 = Mathf.Clamp(power / 100, 1, 5) + ((power >= 100) ? EClass.rnd(2) : 0);
534 break;
535 case "monster":
536 case "fire":
537 case "animal":
538 num3 = 1 + EClass.rnd(2);
539 break;
540 case "special_force":
541 id4 = "army_palmia";
542 num3 = 4 + EClass.rnd(2);
543 num5 = EClass._zone.DangerLv;
544 break;
545 case "tentacle":
546 num4 = 20 + EClass.rnd(10);
547 radius = 1;
548 break;
549 }
550 for (int j = 0; j < num3; j++)
551 {
552 if (EClass._zone.CountMinions(CC) >= CC.MaxSummon)
553 {
554 break;
555 }
556 Point point = tp.GetRandomPoint(radius)?.GetNearestPoint(allowBlock: false, allowChara: false);
557 if (point == null || !point.IsValid)
558 {
559 continue;
560 }
561 Chara chara2 = null;
562 if (num5 != -1)
563 {
565 {
566 lv = num5
567 });
568 }
569 chara2 = actRef.n1 switch
570 {
571 "yeek" => CharaGen.CreateFromFilter(SpawnListChara.Get("summon_yeek", (SourceChara.Row r) => r.race == "yeek"), power / 10),
572 "orc" => CharaGen.CreateFromFilter(SpawnListChara.Get("summon_orc", (SourceChara.Row r) => r.race == "orc"), power / 10),
573 "pawn" => CharaGen.CreateFromFilter("c_pawn", power / 10),
574 "monster" => CharaGen.CreateFromFilter("c_dungeon", power / 10),
575 "animal" => CharaGen.CreateFromFilter("c_animal", power / 15),
576 "fire" => CharaGen.CreateFromElement("Fire", power / 10),
577 "fish" => CharaGen.CreateFromFilter(SpawnListChara.Get("summon_fish", (SourceChara.Row r) => r.ContainsTag("water") || r.model.Chara.race.tag.Contains("water")), power / 10),
578 "octopus" => CharaGen.CreateFromFilter(SpawnListChara.Get("summon_octopus", (SourceChara.Row r) => r.race == "octopus"), power / 10),
579 _ => CharaGen.Create(id4, power / 10),
580 };
581 if (chara2 == null)
582 {
583 continue;
584 }
585 int num6 = -1;
586 num6 = ((!(actRef.n1 == "shadow")) ? (chara2.LV * (100 + power / 10) / 100 + power / 30) : (power / 10 + 1));
587 if (chara2.LV < num6)
588 {
589 chara2.SetLv(num6);
590 }
591 chara2.interest = 0;
592 if (chara2.HaveFur())
593 {
594 chara2.c_fur = -1;
595 }
596 string n = actRef.n1;
597 if (!(n == "shadow"))
598 {
599 if (n == "special_force")
600 {
601 chara2.homeZone = EClass._zone;
602 }
603 }
604 else
605 {
606 chara2.hp = chara2.MaxHP / 2;
607 }
608 EClass._zone.AddCard(chara2, point);
609 if (!(actRef.n1 == "monster") || actRef.refThing == null)
610 {
611 chara2.MakeMinion(CC);
612 }
613 if (num4 != -1)
614 {
615 chara2.SetSummon(num4);
616 }
617 flag3 = true;
618 }
619 if (!flag3)
620 {
621 CC.Say("summon_ally_fail", CC);
622 }
623 return;
624 }
625 case EffectId.Funnel:
626 {
627 if (EClass._zone.CountMinions(CC) >= CC.MaxSummon || CC.c_uidMaster != 0)
628 {
629 CC.Say("summon_ally_fail", CC);
630 return;
631 }
632 CC.Say("spell_funnel", CC, element.Name.ToLower());
633 CC.PlaySound("spell_funnel");
634 Chara chara = CharaGen.Create("bit");
635 chara.SetMainElement(element.source.alias, element.Value, elemental: true);
636 chara.SetSummon(20 + power / 20 + EClass.rnd(10));
637 chara.SetLv(power / 15);
638 chara.interest = 0;
639 EClass._zone.AddCard(chara, tp.GetNearestPoint(allowBlock: false, allowChara: false));
640 chara.PlayEffect("teleport");
641 chara.MakeMinion(CC);
642 return;
643 }
644 case EffectId.Breathe:
645 {
646 List<Point> list7 = EClass._map.ListPointsInArc(CC.pos, tp, 7, 35f);
647 if (list7.Count == 0)
648 {
649 list7.Add(CC.pos.Copy());
650 }
651 CC.Say("spell_breathe", CC, element.Name.ToLower());
652 EClass.Wait(0.8f, CC);
653 TryDelay(delegate
654 {
655 CC.PlaySound("spell_breathe");
656 });
658 {
659 Shaker.ShakeCam("breathe");
660 }
661 DamageEle(CC, id, power, element, list7, actRef, "spell_breathe");
662 return;
663 }
664 case EffectId.Scream:
665 CC.PlaySound("scream");
666 CC.PlayEffect("scream");
667 {
668 foreach (Point item in EClass._map.ListPointsInCircle(cc.pos, 6f, mustBeWalkable: false, los: false))
669 {
670 foreach (Chara chara3 in item.Charas)
671 {
672 if (chara3.ResistLv(957) <= 0)
673 {
674 chara3.AddCondition<ConParalyze>(power);
675 }
676 }
677 }
678 return;
679 }
680 case EffectId.Ball:
681 case EffectId.Explosive:
682 case EffectId.BallBubble:
683 case EffectId.Suicide:
684 {
685 float radius2 = ((id == EffectId.Suicide) ? 3.5f : ((float)((id == EffectId.BallBubble) ? 2 : 5)));
686 if (id == EffectId.Explosive && actRef.refThing != null)
687 {
688 radius2 = 2f;
689 }
690 if (id == EffectId.Suicide)
691 {
692 if (CC.MainElement != Element.Void)
693 {
694 element = CC.MainElement;
695 }
696 if (CC.HasTag(CTAG.kamikaze))
697 {
698 radius2 = 1.5f;
699 }
700 }
701 bool flag4 = id == EffectId.Explosive || id == EffectId.Suicide;
702 List<Point> list6 = EClass._map.ListPointsInCircle(cc.pos, radius2, !flag4, !flag4);
703 if (list6.Count == 0)
704 {
705 list6.Add(cc.pos.Copy());
706 }
707 cc.Say((id == EffectId.Suicide) ? "abSuicide" : "spell_ball", cc, element.Name.ToLower());
708 EClass.Wait(0.8f, cc);
709 TryDelay(delegate
710 {
711 cc.PlaySound("spell_ball");
712 });
714 {
715 Shaker.ShakeCam("ball");
716 }
717 DamageEle(actRef.origin ?? cc, id, power, element, list6, actRef, (id == EffectId.Suicide) ? "suicide" : "spell_ball");
718 if (id == EffectId.Suicide && CC.IsAliveInCurrentZone)
719 {
720 CC.Die();
721 }
722 return;
723 }
724 case EffectId.Bolt:
725 {
726 List<Point> list2 = EClass._map.ListPointsInLine(CC.pos, tp, 10);
727 if (list2.Count == 0)
728 {
729 list2.Add(CC.pos.Copy());
730 }
731 CC.Say("spell_bolt", CC, element.Name.ToLower());
732 EClass.Wait(0.8f, CC);
733 TryDelay(delegate
734 {
735 CC.PlaySound("spell_bolt");
736 });
738 {
739 Shaker.ShakeCam("bolt");
740 }
741 DamageEle(CC, id, power, element, list2, actRef, "spell_bolt");
742 return;
743 }
744 case EffectId.Bubble:
745 case EffectId.Web:
746 case EffectId.MistOfDarkness:
747 case EffectId.Puddle:
748 {
749 if (LangGame.Has("ab" + id))
750 {
751 CC.Say("ab" + id, CC);
752 }
753 tp.PlaySound("vomit");
754 int num = 2 + EClass.rnd(3);
755 int id2 = id switch
756 {
757 EffectId.MistOfDarkness => 6,
758 EffectId.Bubble => 5,
759 EffectId.Puddle => 4,
760 _ => 7,
761 };
762 EffectId idEffect = ((id == EffectId.Bubble) ? EffectId.BallBubble : EffectId.PuddleEffect);
763 Color matColor = EClass.Colors.elementColors.TryGetValue(element.source.alias);
764 if (id == EffectId.Bubble && CC.id == "cancer")
765 {
766 idEffect = EffectId.Nothing;
767 num = 1 + EClass.rnd(3);
768 }
769 for (int i = 0; i < num; i++)
770 {
771 Point randomPoint = tp.GetRandomPoint(2);
772 if (randomPoint != null && !randomPoint.HasBlock && (id != EffectId.Puddle || !randomPoint.cell.IsTopWaterAndNoSnow))
773 {
774 int num2 = 4 + EClass.rnd(5);
775 if (id == EffectId.Web)
776 {
777 num2 *= 3;
778 }
779 EClass._map.SetEffect(randomPoint.x, randomPoint.z, new CellEffect
780 {
781 id = id2,
782 amount = num2,
783 idEffect = idEffect,
784 idEle = element.id,
785 power = power,
786 isHostileAct = CC.IsPCParty,
787 color = BaseTileMap.GetColorInt(ref matColor, 100)
788 });
789 }
790 }
791 return;
792 }
793 }
794 List<Card> list8 = tp.ListCards().ToList();
795 list8.Reverse();
796 if (list8.Contains(CC))
797 {
798 list8.Remove(CC);
799 list8.Insert(0, CC);
800 }
801 bool flag5 = true;
802 foreach (Card item2 in list8)
803 {
804 if (tc == null || item2 == tc)
805 {
806 Proc(id, power, state, CC, item2, actRef);
807 if (flag2 && item2.isChara && item2 != CC)
808 {
809 CC.DoHostileAction(item2);
810 }
811 if (actRef.refThing == null || !(actRef.refThing.trait is TraitRod) || (uint)(id - 200) <= 4u)
812 {
813 return;
814 }
815 flag5 = false;
816 }
817 }
818 if (flag5)
819 {
820 CC.SayNothingHappans();
821 }
822 }
823
824 public static void Proc(EffectId id, Card cc, Card tc = null, int power = 100, ActRef actRef = default(ActRef))
825 {
826 Proc(id, power, BlessedState.Normal, cc, tc, actRef);
827 }
828
829 public static void Proc(EffectId id, int power, BlessedState state, Card cc, Card tc = null, ActRef actRef = default(ActRef))
830 {
831 if (tc == null)
832 {
833 tc = cc;
834 }
835 Chara TC = tc.Chara;
836 Chara CC = cc.Chara;
837 bool blessed = state >= BlessedState.Blessed;
838 bool flag = state <= BlessedState.Cursed;
839 int orgPower = power;
840 if (blessed || flag)
841 {
842 power *= 2;
843 }
844 switch (id)
845 {
846 case EffectId.Duplicate:
847 {
848 Point randomPoint = CC.pos.GetRandomPoint(2, requireLos: false, allowChara: false, allowBlocked: false, 200);
849 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)
850 {
851 CC.Say("split_fail", CC);
852 return;
853 }
854 Chara t2 = CC.Duplicate();
855 EClass._zone.AddCard(t2, randomPoint);
856 CC.Say("split", CC);
857 break;
858 }
859 case EffectId.Escape:
860 if (CC.IsPCFaction || (EClass._zone.Boss == CC && EClass.rnd(30) != 0))
861 {
862 return;
863 }
864 CC.Say("escape", CC);
865 CC.PlaySound("escape");
866 if (EClass._zone.Boss == CC)
867 {
868 CC.TryDropBossLoot();
869 }
870 CC.Destroy();
871 break;
872 case EffectId.Exterminate:
873 {
874 CC.PlaySound("clean_floor");
875 Msg.Say("exterminate");
876 List<Chara> list2 = EClass._map.charas.Where((Chara c) => c.isCopy && !c.IsPCFaction).ToList();
877 if (list2.Count == 0)
878 {
880 return;
881 }
882 foreach (Chara item in list2)
883 {
884 item.Say("split_fail", item);
885 item.PlayEffect("vanish");
886 item.Die();
887 }
888 break;
889 }
890 case EffectId.DropMine:
891 {
892 if (CC.pos.Installed != null || EClass._zone.IsPCFaction)
893 {
894 return;
895 }
896 Thing thing = ThingGen.Create("mine");
897 thing.c_idRefCard = "dog_mine";
898 Zone.ignoreSpawnAnime = true;
899 EClass._zone.AddCard(thing, CC.pos).Install();
900 break;
901 }
902 case EffectId.MagicMap:
903 if (!CC.IsPC)
904 {
906 break;
907 }
908 if (flag)
909 {
910 CC.Say("abMagicMap_curse", CC);
911 CC.PlaySound("curse3");
912 CC.PlayEffect("curse");
913 CC.AddCondition<ConConfuse>(200, force: true);
914 break;
915 }
916 CC.Say("abMagicMap", CC);
917 CC.PlayEffect("identify");
918 CC.PlaySound("identify");
919 if (blessed)
920 {
922 }
923 else
924 {
925 EClass._map.Reveal(CC.pos, power);
926 }
927 break;
928 case EffectId.AbsorbMana:
929 {
930 EClass.game.religions.Element.Talk("ability");
931 Dice dice = Dice.Create("ActManaAbsorb", power, CC, (actRef.refThing != null) ? null : actRef.act);
932 TC.mana.Mod(dice.Roll());
933 TC.PlaySound("heal");
934 TC.PlayEffect("heal");
935 if (TC.IsPC)
936 {
937 CC.Say("absorbMana", CC);
938 }
939 break;
940 }
941 case EffectId.ModPotential:
942 {
943 Element element = cc.elements.ListElements((Element e) => e.HasTag("primary")).RandomItem();
944 cc.elements.ModTempPotential(element.id, power / 10);
945 break;
946 }
947 case EffectId.ForgetItems:
948 {
949 TC.PlaySound("curse3");
950 TC.PlayEffect("curse");
951 TC.Say("forgetItems", TC);
952 int num2 = power / 50 + 1 + EClass.rnd(3);
953 List<Thing> source = TC.things.List((Thing t) => t.c_IDTState == 0);
954 for (int i = 0; i < num2; i++)
955 {
956 source.RandomItem().c_IDTState = 5;
957 }
958 break;
959 }
960 case EffectId.EnchantWeapon:
961 case EffectId.EnchantArmor:
962 case EffectId.EnchantWeaponGreat:
963 case EffectId.EnchantArmorGreat:
964 {
965 bool armor = id == EffectId.EnchantArmor || id == EffectId.EnchantArmorGreat;
966 bool flag4 = id == EffectId.EnchantWeaponGreat || id == EffectId.EnchantArmorGreat;
967 if (!tc.isThing)
968 {
969 LayerDragGrid.CreateEnchant(CC, armor, flag4, state);
970 return;
971 }
972 cc.PlaySound("identify");
973 cc.PlayEffect("identify");
974 if (flag)
975 {
976 cc.Say("enc_curse", tc);
977 tc.ModEncLv(-1);
978 break;
979 }
980 int num5 = (flag4 ? 4 : 2) + (blessed ? 1 : 0);
981 if (tc.encLV >= num5)
982 {
983 cc.Say("enc_resist", tc);
984 break;
985 }
986 cc.Say("enc", tc);
987 tc.ModEncLv(1);
988 break;
989 }
990 case EffectId.Identify:
991 case EffectId.GreaterIdentify:
992 {
993 bool flag5 = id == EffectId.GreaterIdentify;
994 if (flag)
995 {
996 Redirect(EffectId.ForgetItems, flag5 ? BlessedState.Cursed : BlessedState.Normal, default(ActRef));
997 break;
998 }
999 if (!tc.isThing)
1000 {
1001 int count = ((!blessed) ? 1 : (flag5 ? (2 + EClass.rnd(2)) : (3 + EClass.rnd(3))));
1002 LayerDragGrid.CreateIdentify(CC, flag5, state, 0, count);
1003 return;
1004 }
1005 cc.PlaySound("identify");
1006 cc.PlayEffect("identify");
1007 tc.Thing.Identify(cc.IsPCParty, (!flag5) ? IDTSource.Identify : IDTSource.SuperiorIdentify);
1008 break;
1009 }
1010 case EffectId.Uncurse:
1011 {
1012 if (!tc.isThing)
1013 {
1014 LayerDragGrid.CreateUncurse(CC, state);
1015 return;
1016 }
1017 Thing thing2 = tc.Thing;
1018 if (thing2.blessedState == BlessedState.Cursed)
1019 {
1020 thing2.SetBlessedState(BlessedState.Normal);
1021 }
1022 else if (thing2.blessedState == BlessedState.Doomed)
1023 {
1024 thing2.SetBlessedState(BlessedState.Normal);
1025 }
1026 thing2.GetRootCard()?.TryStack(thing2);
1027 LayerInventory.SetDirty(thing2);
1028 break;
1029 }
1030 case EffectId.Lighten:
1031 {
1032 if (!tc.isThing)
1033 {
1034 LayerDragGrid.CreateLighten(CC, state);
1035 return;
1036 }
1037 if (tc.Num > 1)
1038 {
1039 tc = tc.Split(1);
1040 }
1041 cc.PlaySound("offering");
1042 cc.PlayEffect("buff");
1043 int num = (tc.isWeightChanged ? tc.c_weight : tc.Thing.source.weight);
1044 tc.isWeightChanged = true;
1045 Element orCreateElement = tc.elements.GetOrCreateElement(64);
1046 Element orCreateElement2 = tc.elements.GetOrCreateElement(65);
1047 Element orCreateElement3 = tc.elements.GetOrCreateElement(67);
1048 Element orCreateElement4 = tc.elements.GetOrCreateElement(66);
1049 bool flag2 = tc.IsEquipmentOrRangedOrAmmo || tc.IsThrownWeapon;
1050 if (flag)
1051 {
1052 num = (int)(0.01f * (float)num * (float)power * 0.75f + 500f);
1053 if (num < 0 || num > 10000000)
1054 {
1055 num = 10000000;
1056 flag2 = false;
1057 }
1058 if (flag2)
1059 {
1060 if (tc.IsWeapon || tc.IsThrownWeapon || tc.IsAmmo)
1061 {
1062 tc.elements.ModBase(67, Mathf.Clamp(orCreateElement3.vBase * power / 1000, 1, 5));
1063 tc.elements.ModBase(66, -Mathf.Clamp(orCreateElement4.vBase * power / 1000, 1, 5));
1064 }
1065 else
1066 {
1067 tc.elements.ModBase(65, Mathf.Clamp(orCreateElement2.vBase * power / 1000, 1, 5));
1068 tc.elements.ModBase(64, -Mathf.Clamp(orCreateElement.vBase * power / 1000, 1, 5));
1069 }
1070 }
1071 cc.Say("lighten_curse", cc, tc);
1072 }
1073 else
1074 {
1075 num = num * (100 - power / 10) / 100;
1076 if (blessed)
1077 {
1078 power /= 4;
1079 }
1080 if (flag2)
1081 {
1082 if (tc.IsWeapon || tc.IsThrownWeapon || tc.IsAmmo)
1083 {
1084 tc.elements.ModBase(67, -Mathf.Clamp(orCreateElement3.vBase * power / 1000, 1, 5));
1085 tc.elements.ModBase(66, Mathf.Clamp(orCreateElement4.vBase * power / 1000, 1, 5));
1086 }
1087 else
1088 {
1089 tc.elements.ModBase(65, -Mathf.Clamp(orCreateElement2.vBase * power / 1000, 1, 5));
1090 tc.elements.ModBase(64, Mathf.Clamp(orCreateElement.vBase * power / 1000, 1, 5));
1091 }
1092 }
1093 cc.Say("lighten", cc, tc);
1094 }
1095 tc.c_weight = num;
1096 tc.SetDirtyWeight();
1097 if (tc.parent == null)
1098 {
1099 CC.Pick(tc.Thing, msg: false);
1100 }
1102 break;
1103 }
1104 case EffectId.Reconstruction:
1105 {
1106 if (!tc.isThing)
1107 {
1109 return;
1110 }
1111 if (tc.Num > 1)
1112 {
1113 tc = tc.Split(1);
1114 }
1115 cc.PlaySound("mutation");
1116 cc.PlayEffect("identify");
1117 cc.Say("reconstruct", cc, tc);
1118 EClass.game.cards.uidNext += EClass.rnd(30);
1119 Thing thing3 = ThingGen.Create(tc.id, -1, tc.LV * power / 100);
1120 thing3.SetBlessedState(state);
1121 tc.Destroy();
1122 CC.Pick(thing3, msg: false);
1123 if (!CC.IsPC)
1124 {
1125 CC.TryEquip(thing3);
1126 }
1127 break;
1128 }
1129 case EffectId.ChangeMaterialLesser:
1130 case EffectId.ChangeMaterial:
1131 case EffectId.ChangeMaterialGreater:
1132 {
1133 SourceMaterial.Row row = EClass.sources.materials.alias.TryGetValue(actRef.n1);
1134 if (!tc.isThing)
1135 {
1136 LayerDragGrid.CreateChangeMaterial(CC, actRef.refThing, row, id, state);
1137 return;
1138 }
1139 if (tc.Num > 1)
1140 {
1141 tc = tc.Split(1);
1142 }
1143 string name = tc.Name;
1144 if (row == null)
1145 {
1146 bool num3 = id == EffectId.ChangeMaterialGreater;
1147 bool flag3 = id == EffectId.ChangeMaterialLesser;
1148 string text2 = tc.Thing.source.tierGroup;
1149 Dictionary<string, SourceMaterial.TierList> tierMap = SourceMaterial.tierMap;
1150 int num4 = 1;
1151 if (flag)
1152 {
1153 num4 -= 2;
1154 }
1155 if (blessed)
1156 {
1157 num4++;
1158 }
1159 if (num3)
1160 {
1161 num4++;
1162 }
1163 if (flag3)
1164 {
1165 num4 -= 2;
1166 }
1167 num4 = Mathf.Clamp(num4 + EClass.rnd(2), 0, 4);
1168 if (EClass.rnd(10) == 0)
1169 {
1170 text2 = ((text2 == "metal") ? "leather" : "metal");
1171 }
1172 SourceMaterial.TierList tierList = (text2.IsEmpty() ? tierMap.RandomItem() : tierMap[text2]);
1173 for (int j = 0; j < 1000; j++)
1174 {
1175 row = tierList.tiers[num4].Select();
1176 if (row != tc.material)
1177 {
1178 break;
1179 }
1180 }
1181 }
1182 cc.PlaySound("offering");
1183 cc.PlayEffect("buff");
1184 if ((tc.id == "log" || tc.id == "branch") && tc.material.alias == "carbone")
1185 {
1186 foreach (Element item2 in tc.elements.dict.Values.ToList())
1187 {
1188 if (item2.IsTrait && item2.vBase != 0)
1189 {
1190 tc.elements.ModBase(item2.id, -item2.vBase);
1191 }
1192 }
1193 }
1194 tc.ChangeMaterial(row);
1195 if (tc.trait is TraitGene && tc.c_DNA != null)
1196 {
1197 DNA.Type type = DNA.GetType(tc.material.alias);
1198 tc.c_DNA.Generate(type);
1199 }
1200 cc.Say("materialChanged", name, row.GetName());
1201 if (CC != null)
1202 {
1203 if (tc.parent == null)
1204 {
1205 CC.Pick(tc.Thing, msg: false);
1206 }
1208 }
1209 break;
1210 }
1211 case EffectId.Return:
1212 case EffectId.Evac:
1213 if (!cc.IsPC)
1214 {
1215 Redirect(EffectId.Teleport, state, default(ActRef));
1216 return;
1217 }
1218 cc.PlaySound("return_cast");
1219 if (EClass.player.returnInfo == null)
1220 {
1221 if (id == EffectId.Evac)
1222 {
1223 EClass.player.returnInfo = new Player.ReturnInfo
1224 {
1225 turns = EClass.rnd(10) + 10,
1226 isEvac = true
1227 };
1228 }
1229 else
1230 {
1231 if (EClass.game.spatials.ListReturnLocations().Count == 0)
1232 {
1233 Msg.Say("returnNowhere");
1234 break;
1235 }
1236 EClass.player.returnInfo = new Player.ReturnInfo
1237 {
1238 turns = EClass.rnd(10) + 10,
1239 askDest = true
1240 };
1241 }
1242 Msg.Say("returnBegin");
1243 }
1244 else
1245 {
1246 EClass.player.returnInfo = null;
1247 Msg.Say("returnAbort");
1248 }
1249 break;
1250 case EffectId.Teleport:
1251 case EffectId.TeleportShort:
1252 case EffectId.Gate:
1253 if (!tc.HasHost)
1254 {
1255 if (!flag)
1256 {
1257 if (id == EffectId.TeleportShort)
1258 {
1259 tc.Teleport(GetTeleportPos(tc.pos));
1260 }
1261 else
1262 {
1263 tc.Teleport(GetTeleportPos(tc.pos, EClass._map.bounds.Width));
1264 }
1265 }
1266 if (id == EffectId.Gate && CC.IsPC)
1267 {
1268 foreach (Chara chara2 in EClass._map.charas)
1269 {
1270 if (!chara2.HasHost && chara2 != tc && (chara2.IsPCParty || chara2.IsPCPartyMinion))
1271 {
1272 chara2.Teleport(tc.pos.GetNearestPoint(allowBlock: false, allowChara: false) ?? tc.pos);
1273 }
1274 }
1275 }
1276 }
1277 if (flag)
1278 {
1279 Redirect(EffectId.Gravity, BlessedState.Normal, default(ActRef));
1280 }
1281 if (blessed)
1282 {
1283 Redirect(EffectId.Levitate, BlessedState.Normal, default(ActRef));
1284 }
1285 break;
1286 }
1287 if (TC == null)
1288 {
1289 return;
1290 }
1291 switch (id)
1292 {
1293 case EffectId.ThrowPotion:
1294 if (!CC.pos.Equals(TC.pos))
1295 {
1296 Thing t3 = ThingGen.Create(new string[6] { "330", "331", "334", "335", "336", "1142" }.RandomItem());
1297 ActThrow.Throw(CC, TC.pos, t3, ThrowMethod.Punish, 0.7f);
1298 }
1299 break;
1300 case EffectId.ShutterHex:
1301 {
1302 if (!CC.IsHostile(TC))
1303 {
1304 break;
1305 }
1306 int hex = 0;
1307 foreach (Condition condition4 in TC.conditions)
1308 {
1309 if (condition4.Type == ConditionType.Debuff)
1310 {
1311 hex++;
1312 }
1313 }
1314 if (hex == 0)
1315 {
1316 CC.SayNothingHappans();
1317 break;
1318 }
1319 TC.pos.PlayEffect("holyveil");
1320 TC.pos.PlaySound("holyveil");
1321 TC.pos.PlaySound("atk_eleSound");
1322 TC.conditions.ForeachReverse(delegate(Condition c)
1323 {
1324 if (c.Type == ConditionType.Debuff)
1325 {
1326 c.Kill();
1327 }
1328 });
1329 TC.Say("abShutterHex", TC);
1330 TC.pos.ForeachNeighbor(delegate(Point p)
1331 {
1332 foreach (Chara item3 in p.ListCharas())
1333 {
1334 if (!item3.IsHostile(CC))
1335 {
1336 break;
1337 }
1338 int dmg2 = Dice.Create("SpShutterHex", power * hex, CC, (actRef.refThing != null) ? null : actRef.act).Roll();
1339 item3.DamageHP(dmg2, 919, power, AttackSource.None, CC);
1340 }
1341 });
1342 break;
1343 }
1344 case EffectId.Draw:
1345 {
1346 Point point = CC.pos.GetRandomPoint(1)?.GetNearestPoint(allowBlock: false, allowChara: false);
1347 if (point == null || !CC.CanSeeLos(point) || (CC.IsPCFactionOrMinion && TC.IsPCFactionOrMinion && TC.isRestrained))
1348 {
1349 break;
1350 }
1351 CC.Say("abDraw", CC, TC);
1352 if (TC.HasCondition<ConGravity>())
1353 {
1354 CC.SayNothingHappans();
1355 break;
1356 }
1357 TC.MoveImmediate(point, !EClass.core.config.camera.smoothFollow);
1358 if (CC.id == "tentacle")
1359 {
1360 TC.AddCondition<ConEntangle>();
1361 }
1362 break;
1363 }
1364 case EffectId.Steal:
1365 {
1367 {
1368 break;
1369 }
1370 if (TC.Evalue(426) > 0)
1371 {
1372 TC.Say((actRef.n1 == "money") ? "abStealNegateMoney" : "abStealNegate", TC);
1373 break;
1374 }
1375 Thing thing6 = null;
1376 bool flag7 = actRef.n1 == "food";
1377 if (actRef.n1 == "money")
1378 {
1379 int currency = TC.GetCurrency();
1380 if (currency > 0)
1381 {
1382 currency = Mathf.Clamp(EClass.rnd(currency / 10), 1, 100 + EClass.rndHalf(CC.LV * 200));
1383 thing6 = ThingGen.Create("money").SetNum(currency);
1384 TC.ModCurrency(-currency);
1385 }
1386 }
1387 else
1388 {
1389 Func<Thing, bool> func = (Thing t) => true;
1390 if (flag7)
1391 {
1392 func = (Thing t) => t.IsFood;
1393 }
1394 List<Thing> list6 = TC.things.List(delegate(Thing t)
1395 {
1397 {
1398 return false;
1399 }
1400 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);
1401 }, onlyAccessible: true);
1402 if (list6.Count > 0)
1403 {
1404 thing6 = list6.RandomItem();
1405 if (thing6.Num > 1)
1406 {
1407 thing6 = thing6.Split(1);
1408 }
1409 }
1410 CC.AddCooldown(6640, 200);
1411 }
1412 if (thing6 == null)
1413 {
1414 CC.Say("abStealNothing", CC, TC);
1415 break;
1416 }
1417 thing6.SetInt(116, 1);
1418 TC.PlaySound(thing6.material.GetSoundDrop(thing6.sourceCard));
1419 CC.Pick(thing6, msg: false);
1420 CC.Say("abSteal", CC, TC, thing6.Name);
1421 if (actRef.n1 == "food")
1422 {
1423 if (CC.hunger.value != 0)
1424 {
1425 CC.InstantEat(thing6);
1426 }
1427 }
1428 else
1429 {
1430 CC.Say("abStealEscape", CC);
1431 CC.Teleport(GetTeleportPos(tc.pos, 30), silent: true);
1432 }
1433 break;
1434 }
1435 case EffectId.NeckHunt:
1436 CC.TryNeckHunt(TC, power);
1437 break;
1438 case EffectId.CurseEQ:
1439 {
1440 if (CC != null && CC != TC)
1441 {
1442 TC.Say("curse", CC, TC);
1443 }
1444 TC.PlaySound("curse3");
1445 TC.PlayEffect("curse");
1446 if (EClass.rnd(150 + TC.LUC * 5 + TC.Evalue(972) * 20) >= power + (flag ? 200 : 0) || TC.TryNullifyCurse())
1447 {
1448 break;
1449 }
1450 List<Thing> list3 = TC.things.List(delegate(Thing t)
1451 {
1452 if (!t.isEquipped || t.blessedState == BlessedState.Doomed || t.IsToolbelt)
1453 {
1454 return false;
1455 }
1456 return (t.blessedState < BlessedState.Blessed || EClass.rnd(10) == 0) ? true : false;
1457 });
1458 if (list3.Count == 0)
1459 {
1460 CC.SayNothingHappans();
1461 break;
1462 }
1463 Thing thing4 = list3.RandomItem();
1464 TC.Say("curse_hit", TC, thing4);
1465 thing4.SetBlessedState((thing4.blessedState == BlessedState.Cursed) ? BlessedState.Doomed : BlessedState.Cursed);
1466 LayerInventory.SetDirty(thing4);
1467 break;
1468 }
1469 case EffectId.UncurseEQ:
1470 case EffectId.UncurseEQGreater:
1471 {
1472 TC.Say("uncurseEQ" + (blessed ? "_bless" : (flag ? "_curse" : "")), TC);
1473 TC.PlaySound("uncurse");
1474 TC.PlayEffect("uncurse");
1475 if (flag)
1476 {
1477 Redirect(EffectId.CurseEQ, BlessedState.Normal, default(ActRef));
1478 break;
1479 }
1480 int success = 0;
1481 int fail = 0;
1482 List<Thing> list = new List<Thing>();
1483 TC.things.Foreach(delegate(Thing t)
1484 {
1485 int num10 = 0;
1486 if ((t.isEquipped || t.IsRangedWeapon || blessed) && t.blessedState < BlessedState.Normal)
1487 {
1488 if (t.blessedState == BlessedState.Cursed)
1489 {
1490 num10 = EClass.rnd(200);
1491 }
1492 if (t.blessedState == BlessedState.Doomed)
1493 {
1494 num10 = EClass.rnd(1000);
1495 }
1496 if (blessed)
1497 {
1498 num10 /= 2;
1499 }
1500 if (id == EffectId.UncurseEQGreater)
1501 {
1502 num10 /= 10;
1503 }
1504 if (power >= num10)
1505 {
1506 TC.Say("uncurseEQ_success", t);
1507 t.SetBlessedState(BlessedState.Normal);
1508 if (t.isEquipped && t.HasElement(656))
1509 {
1510 TC.body.Unequip(t);
1511 }
1513 success++;
1514 list.Add(t);
1515 }
1516 else
1517 {
1518 fail++;
1519 }
1520 }
1521 });
1522 foreach (Thing item4 in list)
1523 {
1524 item4.GetRootCard()?.TryStack(item4);
1525 }
1526 if (success == 0 && fail == 0)
1527 {
1528 TC.SayNothingHappans();
1529 }
1530 else if (fail > 0)
1531 {
1532 TC.Say("uncurseEQ_fail");
1533 }
1534 break;
1535 }
1536 case EffectId.Buff:
1537 {
1538 string text3 = actRef.n1;
1539 string text4 = "";
1540 if (flag)
1541 {
1542 text4 = EClass.sources.stats.alias[text3].curse;
1543 if (!text4.IsEmpty())
1544 {
1545 text3 = text4;
1546 }
1547 }
1548 Condition condition = Condition.Create(text3, power, delegate(Condition con)
1549 {
1550 if (!actRef.aliasEle.IsEmpty())
1551 {
1552 con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
1553 }
1554 });
1555 condition.isPerfume = TC.IsPC && actRef.isPerfume;
1556 Condition condition2 = TC.AddCondition(condition);
1557 if (condition2 != null && condition2.isPerfume)
1558 {
1559 condition2.value = 3;
1560 Msg.Say("perfume", TC);
1561 }
1562 if (!text4.IsEmpty())
1563 {
1564 CC.DoHostileAction(TC);
1565 }
1566 break;
1567 }
1568 case EffectId.KizuamiTrick:
1569 {
1570 EClass.game.religions.Trickery.Talk("ability");
1571 bool hex2 = CC.IsHostile(TC);
1572 List<SourceStat.Row> list4 = EClass.sources.stats.rows.Where((SourceStat.Row con) => con.tag.Contains("random") && con.group == (hex2 ? "Debuff" : "Buff")).ToList();
1573 int power2 = power;
1574 for (int k = 0; k < 4 + EClass.rnd(2); k++)
1575 {
1576 SourceStat.Row row2 = list4.RandomItem();
1577 list4.Remove(row2);
1578 Proc(hex2 ? EffectId.Debuff : EffectId.Buff, CC, TC, power2, new ActRef
1579 {
1580 n1 = row2.alias
1581 });
1582 }
1583 if (EClass.core.config.game.waitOnDebuff && !CC.IsPC)
1584 {
1585 EClass.Wait(0.3f, TC);
1586 }
1587 break;
1588 }
1589 case EffectId.Debuff:
1590 {
1591 CC.DoHostileAction(TC);
1592 bool isPowerful = TC.IsPowerful;
1593 string n = actRef.n1;
1594 if (n == "ConSuffocation")
1595 {
1596 power = power * 2 / 3;
1597 }
1598 int a2 = power;
1599 int num8 = TC.WIL * (isPowerful ? 20 : 5);
1600 ConHolyVeil condition3 = TC.GetCondition<ConHolyVeil>();
1601 if (condition3 != null)
1602 {
1603 num8 += condition3.power * 5;
1604 }
1605 if (EClass.rnd(a2) < num8 / EClass.sources.stats.alias[n].hexPower && EClass.rnd(10) != 0)
1606 {
1607 TC.Say("debuff_resist", TC);
1608 CC.DoHostileAction(TC);
1609 break;
1610 }
1611 TC.AddCondition(Condition.Create(n, power, delegate(Condition con)
1612 {
1613 con.givenByPcParty = CC.IsPCParty;
1614 if (!actRef.aliasEle.IsEmpty())
1615 {
1616 con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
1617 }
1618 }));
1619 if (n == "ConBane" && CC.HasElement(1416))
1620 {
1621 TC.AddCondition<ConExcommunication>(power);
1622 }
1623 CC.DoHostileAction(TC);
1624 if (EClass.core.config.game.waitOnDebuff && !CC.IsPC)
1625 {
1626 EClass.Wait(0.3f, TC);
1627 }
1628 break;
1629 }
1630 case EffectId.Mutation:
1631 TC.MutateRandom(1, 100, ether: false, state);
1633 {
1634 EClass.Wait(0.3f, TC);
1635 }
1636 break;
1637 case EffectId.CureMutation:
1638 TC.MutateRandom(-1, 100, ether: false, state);
1639 break;
1640 case EffectId.Ally:
1641 {
1642 Msg.Say("gainAlly");
1643 Chara chara = CharaGen.CreateFromFilter("chara", cc.LV);
1644 EClass._zone.AddCard(chara, cc.pos.GetNearestPoint(allowBlock: false, allowChara: false));
1645 if (cc.IsPCFactionOrMinion)
1646 {
1647 chara.MakeAlly(msg: false);
1648 }
1649 chara.PlaySound("identify");
1650 chara.PlayEffect("teleport");
1651 break;
1652 }
1653 case EffectId.Wish:
1654 if (!TC.IsPC)
1655 {
1656 break;
1657 }
1658 if (blessed || flag)
1659 {
1660 power /= 2;
1661 }
1662 Dialog.InputName("dialogWish", "q", delegate(bool cancel, string text)
1663 {
1664 if (!cancel)
1665 {
1666 Msg.Say("wish", TC, text);
1667 Wish(text, EClass.pc.NameTitled, power, state);
1668 }
1669 });
1670 break;
1671 case EffectId.Faith:
1672 {
1674 tc.PlayEffect("aura_heaven");
1675 tc.PlaySound("aura_heaven");
1676 tc.Say("faith", tc, faith.Name);
1677 if (flag)
1678 {
1679 tc.Say("faith_curse", tc, faith.Name);
1680 break;
1681 }
1682 if (blessed)
1683 {
1684 tc.Say("faith_bless", tc, faith.Name);
1685 }
1686 tc.ModExp(306, power * 10);
1687 tc.ModExp(85, power * 10);
1688 if (tc.elements.Base(85) >= tc.elements.Value(306))
1689 {
1690 tc.elements.SetBase(85, tc.elements.Value(306));
1691 }
1692 break;
1693 }
1694 case EffectId.TransGender:
1695 {
1696 tc.PlaySound("mutation");
1697 tc.PlayEffect("mutation");
1698 int gender = tc.bio.gender;
1699 int gender2 = gender switch
1700 {
1701 1 => 2,
1702 2 => 1,
1703 _ => (EClass.rnd(2) != 0) ? 1 : 2,
1704 };
1705 if (gender != 0 && EClass.rnd(10) == 0)
1706 {
1707 gender2 = 0;
1708 }
1709 tc.bio.SetGender(gender2);
1710 tc.Say("transGender", tc, Gender.Name(tc.bio.gender));
1711 tc.Talk("tail");
1712 if (blessed && tc.bio.age > 1)
1713 {
1714 tc.Say("ageDown", tc);
1715 tc.bio.age--;
1716 }
1717 else if (flag)
1718 {
1719 tc.Say("ageUp", tc);
1720 tc.bio.age++;
1721 }
1722 break;
1723 }
1724 case EffectId.BuffStats:
1725 case EffectId.DebuffStats:
1726 case EffectId.LulwyTrick:
1727 Debug.Log(power + "/" + id.ToString() + "/" + actRef.n1);
1728 if (id == EffectId.LulwyTrick)
1729 {
1730 EClass.game.religions.Wind.Talk("ability");
1731 }
1732 if (power < 0 || id == EffectId.DebuffStats)
1733 {
1734 power = Mathf.Abs(power);
1735 if (blessed)
1736 {
1737 power /= 4;
1738 }
1739 flag = true;
1740 }
1741 TC.AddCondition(Condition.Create(power, delegate(ConBuffStats con)
1742 {
1743 con.SetRefVal(Element.GetId(actRef.n1), (int)id);
1744 }));
1745 break;
1746 case EffectId.Revive:
1747 {
1748 List<KeyValuePair<int, Chara>> list7 = 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();
1749 if (TC.IsPCFaction || TC.IsPCFactionMinion)
1750 {
1751 if (TC.IsPC && list7.Count == 0)
1752 {
1753 list7 = 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();
1754 }
1755 if (list7.Count > 0)
1756 {
1757 list7.RandomItem().Value.Chara.GetRevived();
1758 break;
1759 }
1760 }
1761 TC.SayNothingHappans();
1762 break;
1763 }
1764 case EffectId.DamageBody:
1765 case EffectId.DamageMind:
1766 case EffectId.DamageBodyGreat:
1767 case EffectId.DamageMindGreat:
1768 case EffectId.Weaken:
1769 {
1770 bool flag8 = id == EffectId.DamageBody || id == EffectId.DamageBodyGreat;
1771 bool mind = id == EffectId.DamageMind || id == EffectId.DamageMindGreat;
1772 int num6 = ((id == EffectId.DamageBody || id == EffectId.DamageMind) ? 1 : (4 + EClass.rnd(4)));
1773 if (id == EffectId.Weaken)
1774 {
1775 flag8 = EClass.rnd(2) == 0;
1776 mind = !flag8;
1777 num6 = 1;
1778 }
1779 else
1780 {
1781 TC.PlayEffect("debuff");
1782 TC.PlaySound("debuff");
1783 }
1784 TC.Say(flag8 ? "damageBody" : "damageMind", TC);
1785 for (int l = 0; l < num6; l++)
1786 {
1787 TC.DamageTempElements(power, flag8, mind);
1788 }
1789 if (TC.IsPC)
1790 {
1791 Tutorial.Play("healer");
1792 }
1793 break;
1794 }
1795 case EffectId.EnhanceBody:
1796 case EffectId.EnhanceMind:
1797 case EffectId.EnhanceBodyGreat:
1798 case EffectId.EnhanceMindGreat:
1799 {
1800 bool flag9 = id == EffectId.EnhanceBody || id == EffectId.EnhanceBodyGreat;
1801 bool mind2 = id == EffectId.EnhanceMind || id == EffectId.EnhanceMindGreat;
1802 int num7 = ((id == EffectId.EnhanceBody || id == EffectId.EnhanceMind) ? 1 : (4 + EClass.rnd(4)));
1803 TC.Say(flag9 ? "enhanceBody" : "enhanceMind", TC);
1804 TC.PlayEffect("buff");
1805 TC.PlaySound("buff");
1806 for (int m = 0; m < num7; m++)
1807 {
1808 TC.EnhanceTempElements(power, flag9, mind2);
1809 }
1810 break;
1811 }
1812 case EffectId.RestoreBody:
1813 case EffectId.RestoreMind:
1814 {
1815 bool flag6 = id == EffectId.RestoreBody;
1816 if (flag)
1817 {
1818 Redirect(flag6 ? EffectId.DamageBodyGreat : EffectId.DamageMindGreat, BlessedState.Normal, default(ActRef));
1819 break;
1820 }
1821 TC.Say(flag6 ? "restoreBody" : "restoreMind", TC);
1822 TC.PlaySound("heal");
1823 TC.PlayEffect("heal");
1824 TC.CureHost(flag6 ? CureType.CureBody : CureType.CureMind, power, state);
1825 if (blessed)
1826 {
1827 Redirect(flag6 ? EffectId.EnhanceBodyGreat : EffectId.EnhanceMindGreat, BlessedState.Normal, default(ActRef));
1828 }
1829 break;
1830 }
1831 case EffectId.HealComplete:
1832 TC.HealHPHost(100000000, (actRef.refThing == null) ? HealSource.Magic : HealSource.Item);
1833 TC.CureHost(CureType.HealComplete, power, state);
1834 TC.Say("heal_heavy", TC);
1835 break;
1836 case EffectId.Heal:
1837 case EffectId.JureHeal:
1838 {
1839 if (id == EffectId.JureHeal)
1840 {
1841 EClass.game.religions.Healing.Talk("ability");
1842 }
1843 if (actRef.act != null)
1844 {
1845 Debug.Log(actRef.act.id);
1846 }
1847 int num9 = Dice.Create((actRef.act != null && EClass.sources.calc.map.ContainsKey(actRef.act.ID)) ? actRef.act.ID : "SpHealLight", power, CC, (actRef.refThing != null) ? null : actRef.act).Roll();
1848 if (actRef.refThing != null)
1849 {
1850 num9 = num9 * (100 + actRef.refThing.Evalue(7500)) / 100;
1851 }
1852 if (flag)
1853 {
1854 TC.DamageHP(num9 / 2, 919, power);
1855 break;
1856 }
1857 TC.HealHPHost(num9, (actRef.refThing == null) ? HealSource.Magic : HealSource.Item);
1858 TC.CureHost(CureType.Heal, power, state);
1859 TC.Say((power >= 300) ? "heal_heavy" : "heal_light", TC);
1860 break;
1861 }
1862 case EffectId.RemedyJure:
1863 TC.HealHP(1000000, HealSource.Magic);
1864 TC.CureHost(CureType.Jure, power, state);
1865 TC.Say("heal_jure", TC);
1866 break;
1867 case EffectId.Headpat:
1868 CC.Cuddle(TC, headpat: true);
1869 break;
1870 case EffectId.RemoveHex:
1871 case EffectId.RemoveHexAll:
1872 if (flag)
1873 {
1874 Redirect(EffectId.CurseEQ, BlessedState.Normal, default(ActRef));
1875 break;
1876 }
1877 foreach (Condition item5 in TC.conditions.Copy())
1878 {
1879 if (item5.Type == ConditionType.Debuff && !item5.IsKilled && EClass.rnd(power * 2) > EClass.rnd(item5.power))
1880 {
1881 CC.Say("removeHex", TC, item5.Name.ToLower());
1882 item5.Kill();
1883 if (id == EffectId.RemoveHex)
1884 {
1885 break;
1886 }
1887 }
1888 }
1889 TC.AddCondition<ConHolyVeil>(power / 2);
1890 break;
1891 case EffectId.CureCorruption:
1892 TC.PlaySound("heal");
1893 TC.PlayEffect("heal");
1894 if (flag)
1895 {
1896 TC.Say("cureCorruption_curse", TC);
1897 TC.mana.Mod(9999);
1898 TC.ModCorruption(power);
1899 }
1900 else
1901 {
1902 TC.Say("cureCorruption", TC);
1903 TC.ModCorruption(-power * (blessed ? 150 : 200) / 100);
1904 }
1905 break;
1906 case EffectId.Drink:
1907 case EffectId.DrinkRamune:
1908 case EffectId.DrinkMilk:
1909 if (id == EffectId.DrinkRamune)
1910 {
1911 TC.Say("drinkRamune", TC);
1912 }
1913 if (TC.IsPC)
1914 {
1915 TC.Say("drinkGood", TC);
1916 }
1917 if (id == EffectId.DrinkMilk)
1918 {
1919 if (TC.IsPC)
1920 {
1921 TC.Say("drinkMilk", TC);
1922 }
1923 if (blessed)
1924 {
1925 TC.ModHeight(EClass.rnd(5) + 3);
1926 }
1927 else if (flag)
1928 {
1929 TC.ModHeight((EClass.rnd(5) + 3) * -1);
1930 }
1931 }
1932 break;
1933 case EffectId.DrinkWater:
1934 if (flag)
1935 {
1936 if (TC.IsPC)
1937 {
1938 TC.Say("drinkWater_dirty", TC);
1939 }
1941 }
1942 else if (TC.IsPC)
1943 {
1944 TC.Say("drinkWater_clear", TC);
1945 }
1946 break;
1947 case EffectId.DrinkWaterDirty:
1948 if (TC.IsPC)
1949 {
1950 TC.Say("drinkWater_dirty", TC);
1951 }
1952 if (TC.IsPCFaction)
1953 {
1954 TC.Vomit();
1955 }
1956 break;
1957 case EffectId.SaltWater:
1958 if (TC.HasElement(1211))
1959 {
1960 TC.Say("drinkSaltWater_snail", TC);
1961 int dmg = ((TC.hp > 10) ? (TC.hp - EClass.rnd(10)) : 10000);
1962 TC.DamageHP(dmg, AttackSource.None, CC);
1963 }
1964 else if (TC.IsPC)
1965 {
1966 TC.Say("drinkSaltWater", TC);
1967 }
1968 break;
1969 case EffectId.Booze:
1970 TC.AddCondition<ConDrunk>(power);
1971 if (TC.HasElement(1215))
1972 {
1973 TC.Say("drunk_dwarf", TC);
1974 TC.AddCondition(Condition.Create(power + EClass.rnd(power), delegate(ConBuffStats con)
1975 {
1976 con.SetRefVal(Element.List_MainAttributes.RandomItem(), (int)id);
1977 }));
1978 }
1979 break;
1980 case EffectId.CatsEye:
1981 if (flag)
1982 {
1983 Redirect(EffectId.Blind, BlessedState.Normal, default(ActRef));
1984 }
1985 else
1986 {
1987 TC.AddCondition<ConNightVision>(power);
1988 }
1989 break;
1990 case EffectId.Hero:
1991 if (flag)
1992 {
1993 Redirect(EffectId.Fear, BlessedState.Normal, default(ActRef));
1994 }
1995 else
1996 {
1997 TC.AddCondition<ConHero>(power);
1998 }
1999 break;
2000 case EffectId.HolyVeil:
2001 if (flag)
2002 {
2003 Redirect(EffectId.Fear, BlessedState.Normal, default(ActRef));
2004 }
2005 else
2006 {
2007 TC.AddCondition<ConHolyVeil>(power);
2008 }
2009 break;
2010 case EffectId.Levitate:
2011 if (flag)
2012 {
2013 Redirect(EffectId.Gravity, BlessedState.Normal, default(ActRef));
2014 }
2015 else
2016 {
2017 TC.AddCondition<ConLevitate>(power);
2018 }
2019 break;
2020 case EffectId.Gravity:
2021 if (blessed)
2022 {
2023 power /= 4;
2024 }
2025 TC.AddCondition<ConGravity>(power);
2026 if (flag)
2027 {
2028 Redirect(EffectId.BuffStats, BlessedState.Cursed, new ActRef
2029 {
2030 aliasEle = "STR"
2031 });
2032 }
2033 break;
2034 case EffectId.Fear:
2035 if (blessed)
2036 {
2037 power /= 4;
2038 }
2039 TC.AddCondition<ConFear>(power);
2040 if (flag)
2041 {
2042 Redirect(EffectId.Confuse, BlessedState.Normal, default(ActRef));
2043 }
2044 break;
2045 case EffectId.Faint:
2046 if (blessed)
2047 {
2048 power /= 4;
2049 }
2050 TC.AddCondition<ConFaint>(power);
2051 if (flag)
2052 {
2053 Redirect(EffectId.Disease, BlessedState.Normal, default(ActRef));
2054 }
2055 break;
2056 case EffectId.Paralyze:
2057 if (blessed)
2058 {
2059 power /= 4;
2060 }
2061 TC.AddCondition<ConParalyze>(power);
2062 if (flag)
2063 {
2064 Redirect(EffectId.Blind, BlessedState.Normal, default(ActRef));
2065 }
2066 break;
2067 case EffectId.Poison:
2068 if (blessed)
2069 {
2070 power /= 4;
2071 }
2072 TC.AddCondition<ConPoison>(power);
2073 if (flag)
2074 {
2075 Redirect(EffectId.Paralyze, BlessedState.Normal, default(ActRef));
2076 }
2077 break;
2078 case EffectId.Sleep:
2079 if (blessed)
2080 {
2081 power /= 4;
2082 }
2083 TC.AddCondition<ConSleep>(power);
2084 if (flag)
2085 {
2086 Redirect(EffectId.Disease, BlessedState.Normal, default(ActRef));
2087 }
2088 break;
2089 case EffectId.Confuse:
2090 if (blessed)
2091 {
2092 power /= 4;
2093 }
2094 TC.AddCondition<ConConfuse>(power);
2095 if (flag)
2096 {
2097 Redirect(EffectId.Fear, BlessedState.Normal, default(ActRef));
2098 }
2099 break;
2100 case EffectId.Blind:
2101 if (blessed)
2102 {
2103 power /= 4;
2104 }
2105 TC.AddCondition<ConBlind>(power);
2106 if (flag)
2107 {
2108 Redirect(EffectId.Confuse, BlessedState.Normal, default(ActRef));
2109 }
2110 break;
2111 case EffectId.Disease:
2112 if (blessed)
2113 {
2114 power /= 4;
2115 }
2116 TC.AddCondition<ConDisease>(power);
2117 if (flag)
2118 {
2119 Redirect(EffectId.Poison, BlessedState.Normal, default(ActRef));
2120 }
2121 break;
2122 case EffectId.Acid:
2123 {
2124 if (blessed)
2125 {
2126 power /= 4;
2127 }
2128 List<Thing> list5 = TC.things.List((Thing t) => (t.Num <= 1 && t.IsEquipmentOrRanged && !t.IsToolbelt && !t.IsLightsource && t.isEquipped) ? true : false);
2129 if (list5.Count != 0)
2130 {
2131 Thing thing5 = list5.RandomItem();
2132 TC.Say("acid_hit", TC);
2133 if (thing5.isAcidproof)
2134 {
2135 TC.Say("acid_nullify", thing5);
2136 }
2137 else if (thing5.encLV > -5)
2138 {
2139 TC.Say("acid_rust", TC, thing5);
2140 thing5.ModEncLv(-1);
2141 LayerInventory.SetDirty(thing5);
2142 }
2143 if (TC.IsPCParty)
2144 {
2145 Tutorial.Reserve("rust");
2146 }
2147 }
2148 break;
2149 }
2150 case EffectId.PuddleEffect:
2151 TC.DamageHP(power / 5, actRef.idEle, power);
2152 break;
2153 case EffectId.Acidproof:
2154 if (blessed)
2155 {
2156 power /= 4;
2157 }
2158 if (TC.IsPC)
2159 {
2160 TC.Say("pc_pain");
2161 }
2162 TC.Say("drink_acid", TC);
2163 TC.DamageHP(power / 5, 923, power);
2164 break;
2165 case EffectId.LevelDown:
2166 Msg.Say("nothingHappens");
2167 break;
2168 case EffectId.Love:
2169 if (flag)
2170 {
2171 if (CC == TC)
2172 {
2173 TC.Say("love_curse_self", TC);
2174 }
2175 else
2176 {
2177 TC.Say("love_curse", CC, TC);
2178 TC.ModAffinity(CC, -power / 4, show: false);
2179 }
2180 TC.ShowEmo(Emo.angry);
2181 }
2182 else
2183 {
2184 LoveMiracle(TC, CC, power);
2185 }
2186 break;
2187 }
2188 void Redirect(EffectId _id, BlessedState _state, ActRef _ref1)
2189 {
2190 Proc(_id, orgPower, _state, cc, tc, _ref1);
2191 }
2192 }
2193
2194 public static void Poison(Chara tc, Chara c, int power)
2195 {
2196 tc.Say("eat_poison", tc);
2197 tc.Talk("scream");
2198 int num = (int)Mathf.Sqrt(power * 100);
2199 tc.DamageHP(num * 2 + EClass.rnd(num), 915, power);
2200 if (!tc.isDead && !tc.IsPC)
2201 {
2203 }
2204 }
2205
2206 public static void LoveMiracle(Chara tc, Chara c, int power)
2207 {
2208 if (c == tc)
2209 {
2210 tc.Say("love_ground", tc);
2211 }
2212 else
2213 {
2214 tc.Say("love_chara", c, tc);
2215 }
2216 tc.ModAffinity(EClass.pc, power / 4);
2218 {
2219 if (EClass.rnd(2) == 0)
2220 {
2221 tc.MakeMilk();
2222 }
2223 else
2224 {
2225 tc.MakeEgg();
2226 }
2227 }
2228 }
2229
2230 public static Point GetTeleportPos(Point org, int radius = 6)
2231 {
2232 Point point = new Point();
2233 for (int i = 0; i < 10000; i++)
2234 {
2235 point.Set(org);
2236 point.x += EClass.rnd(radius) - EClass.rnd(radius);
2237 point.z += EClass.rnd(radius) - EClass.rnd(radius);
2238 if (point.IsValid && point.IsInBounds && !point.cell.blocked && point.Distance(org) >= radius / 3 + 1 - i / 50 && !point.cell.HasZoneStairs())
2239 {
2240 return point;
2241 }
2242 }
2243 return org.GetRandomNeighbor().GetNearestPoint();
2244 }
2245
2246 public static bool Wish(string s, string name, int power, BlessedState state)
2247 {
2249 string netMsg = GameLang.Parse("wish".langGame(), thirdPerson: true, name, s);
2250 bool net = EClass.core.config.net.enable && EClass.core.config.net.sendEvent;
2251 List<WishItem> list = new List<WishItem>();
2252 int wishLv = 10 + power / 4;
2253 int wishValue = power * 200;
2254 if (state >= BlessedState.Blessed)
2255 {
2256 wishLv = wishLv * 150 / 100;
2257 }
2258 else if (state <= BlessedState.Cursed)
2259 {
2260 wishLv = wishLv * 150 / 100;
2261 wishValue = 1;
2262 }
2263 Debug.Log(power + "/" + wishValue);
2264 string _s = s.ToLower();
2265 foreach (CardRow r in EClass.sources.cards.rows)
2266 {
2267 if (r.HasTag(CTAG.godArtifact))
2268 {
2269 bool flag = false;
2270 foreach (Religion item in EClass.game.religions.list)
2271 {
2272 if (item.IsValidArtifact(r.id))
2273 {
2274 flag = true;
2275 }
2276 }
2277 if (!flag)
2278 {
2279 continue;
2280 }
2281 }
2282 else if (r.quality >= 4 || r.HasTag(CTAG.noWish))
2283 {
2284 switch (r.id)
2285 {
2286 case "medal":
2287 case "plat":
2288 case "money":
2289 case "money2":
2290 break;
2291 default:
2292 continue;
2293 }
2294 }
2295 if (r.isChara)
2296 {
2297 continue;
2298 }
2299 string text = r.GetName().ToLower();
2300 int score = Compare(_s, text);
2301 if (score == 0)
2302 {
2303 continue;
2304 }
2305 list.Add(new WishItem
2306 {
2307 score = score,
2308 n = text,
2309 action = delegate
2310 {
2311 Debug.Log(r.id);
2312 SourceCategory.Row category = EClass.sources.cards.map[r.id].Category;
2313 if (category.IsChildOf("weapon") || category.IsChildOf("armor") || category.IsChildOf("ranged"))
2314 {
2315 CardBlueprint.SetRarity(Rarity.Legendary);
2316 }
2317 Thing thing = ThingGen.Create(r.id, -1, wishLv);
2318 int num = 1;
2319 bool flag2 = thing.trait is TraitDeed || thing.rarity >= Rarity.Artifact || thing.source._origin == "artifact_summon";
2320 switch (thing.id)
2321 {
2322 case "rod_wish":
2323 thing.c_charges = 0;
2324 break;
2325 case "money":
2326 num = EClass.rndHalf(wishValue);
2327 break;
2328 case "plat":
2329 num = EClass.rndHalf(wishValue / 2000 + 4);
2330 break;
2331 case "money2":
2332 num = EClass.rndHalf(wishValue / 1000 + 4);
2333 break;
2334 case "medal":
2335 num = EClass.rndHalf(wishValue / 3000 + 4);
2336 break;
2337 default:
2338 if (!flag2 && thing.trait.CanStack)
2339 {
2340 int num2 = wishValue;
2341 int price = thing.GetPrice();
2342 for (int i = 0; i < 1000; i++)
2343 {
2344 int num3 = price + 500 + i * Mathf.Max(price, 200);
2345 if (num2 > num3)
2346 {
2347 num++;
2348 num2 -= num3;
2349 }
2350 }
2351 }
2352 break;
2353 }
2354 if (num < 1)
2355 {
2356 num = 1;
2357 }
2358 thing.SetNum(num);
2359 Debug.Log(_s + "/" + num + "/" + score);
2360 if (thing.HasTag(CTAG.godArtifact))
2361 {
2362 Religion.Reforge(thing.id);
2363 }
2364 else
2365 {
2366 EClass._zone.AddCard(thing, EClass.pc.pos);
2367 }
2368 netMsg = netMsg + Lang.space + GameLang.Parse("wishNet".langGame(), Msg.IsThirdPerson(thing), Msg.GetName(thing).ToTitleCase());
2369 if (net)
2370 {
2371 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
2372 }
2373 Msg.Say("dropReward");
2374 }
2375 });
2376 }
2377 if (list.Count == 0)
2378 {
2379 netMsg = netMsg + Lang.space + "wishFail".langGame();
2380 if (net)
2381 {
2382 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
2383 }
2384 Msg.Say("wishFail");
2385 return false;
2386 }
2387 list.Sort((WishItem a, WishItem b) => b.score - a.score);
2388 foreach (WishItem item2 in list)
2389 {
2390 Debug.Log(item2.score + "/" + s + "/" + item2.n);
2391 }
2392 list[0].action();
2393 return true;
2394 }
2395
2396 public static int Compare(string s, string t)
2397 {
2398 if (s.IsEmpty())
2399 {
2400 return 0;
2401 }
2402 int num = 0;
2403 if (t == s)
2404 {
2405 num += 100;
2406 }
2407 if (t.Contains(s))
2408 {
2409 num += 100;
2410 }
2411 return num;
2412 }
2413}
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
EffectId
Definition: EffectId.cs:2
Emo
Definition: Emo.cs:2
HealSource
Definition: HealSource.cs:2
IDTSource
Definition: IDTSource.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:2194
static void Proc(EffectId id, int power, BlessedState state, Card cc, Card tc=null, ActRef actRef=default(ActRef))
Definition: ActEffect.cs:829
static Point GetTeleportPos(Point org, int radius=6)
Definition: ActEffect.cs:2230
static int angle
Definition: ActEffect.cs:21
static int Compare(string s, string t)
Definition: ActEffect.cs:2396
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:824
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:2246
static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef=default(ActRef))
Definition: ActEffect.cs:407
static void LoveMiracle(Chara tc, Chara c, int power)
Definition: ActEffect.cs:2206
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:109
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:454
int gender
Definition: Biography.cs:29
static void Set(CardBlueprint _bp)
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
bool IsPCFactionOrMinion
Definition: Card.cs:2172
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:5334
virtual bool IsMultisize
Definition: Card.cs:2058
virtual bool isThing
Definition: Card.cs:1981
bool IsAmmo
Definition: Card.cs:2147
virtual Chara Chara
Definition: Card.cs:1970
Thing Split(int a)
Definition: Card.cs:3275
ElementContainerCard elements
Definition: Card.cs:37
string id
Definition: Card.cs:31
void DamageHP(int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:3810
bool HasElement(int ele, int req=1)
Definition: Card.cs:5395
bool IsThrownWeapon
Definition: Card.cs:2145
SourceMaterial.Row material
Definition: Card.cs:1951
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5585
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:2887
bool isCopy
Definition: Card.cs:850
virtual bool IsPCParty
Definition: Card.cs:2049
int c_uidMaster
Definition: Card.cs:1397
Biography bio
Definition: Card.cs:40
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6135
Card SetLv(int a)
Definition: Card.cs:2784
string Name
Definition: Card.cs:2037
bool IsRangedWeapon
Definition: Card.cs:2143
ICardParent parent
Definition: Card.cs:51
bool ExistsOnMap
Definition: Card.cs:1985
Thing SetNum(int a)
Definition: Card.cs:3286
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3642
bool isAcidproof
Definition: Card.cs:658
bool IsToolbelt
Definition: Card.cs:2069
bool HasTag(CTAG tag)
Definition: Card.cs:2495
Point pos
Definition: Card.cs:55
bool IsInMutterDistance(int d=10)
Definition: Card.cs:7069
void SetDirtyWeight()
Definition: Card.cs:2454
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:5619
bool IsEquipmentOrRanged
Definition: Card.cs:2118
void TryStack(Thing t)
Definition: Card.cs:6383
Trait trait
Definition: Card.cs:49
int encLV
Definition: Card.cs:310
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2027
void ModEncLv(int a)
Definition: Card.cs:3593
void SayNothingHappans()
Definition: Card.cs:6227
void Destroy()
Definition: Card.cs:4680
bool HaveFur()
Definition: Card.cs:7230
virtual bool IsPC
Definition: Card.cs:2043
virtual bool isChara
Definition: Card.cs:1983
virtual Thing Thing
Definition: Card.cs:1958
Card GetRootCard()
Definition: Card.cs:3217
int Evalue(int ele)
Definition: Card.cs:2471
int ResistLv(int res)
Definition: Card.cs:5390
bool IsLightsource
Definition: Card.cs:2071
virtual bool HasHost
Definition: Card.cs:2323
BlessedState blessedState
Definition: Card.cs:262
Card Install()
Definition: Card.cs:3492
Card parentCard
Definition: Card.cs:99
void ModExp(string alias, int a)
Definition: Card.cs:2548
DNA c_DNA
Definition: Card.cs:1805
int Num
Definition: Card.cs:154
bool IsWeapon
Definition: Card.cs:2106
int LV
Definition: Card.cs:370
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6232
bool IsTopWaterAndNoSnow
Definition: Cell.cs:712
SourceMaterial.Row matObj
Definition: Cell.cs:1036
bool HasZoneStairs(bool includeLocked=true)
Definition: Cell.cs:1713
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:551
Element MainElement
Definition: Chara.cs:707
CharaBody body
Definition: Chara.cs:94
bool IsLevitating
Definition: Chara.cs:587
bool TryNeckHunt(Chara TC, int power, bool harvest=false)
Definition: Chara.cs:8845
void InstantEat(Thing t=null, bool sound=true)
Definition: Chara.cs:6933
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:8513
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7268
override bool IsPC
Definition: Chara.cs:602
Chara host
Definition: Chara.cs:33
bool CanSeeLos(Card c, int dist=-1)
Definition: Chara.cs:1064
override bool IsPCParty
Definition: Chara.cs:605
int corruption
Definition: Chara.cs:367
bool HasCondition(string alias)
Definition: Chara.cs:8666
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None)
Definition: Chara.cs:4820
void SetMainElement(string id, int v=0, bool elemental=false)
Definition: Chara.cs:1818
Stats hunger
Definition: Chara.cs:956
override bool HasHost
Definition: Chara.cs:678
override bool IsPCFaction
Definition: Chara.cs:661
override bool IsPCPartyMinion
Definition: Chara.cs:629
int MaxSummon
Definition: Chara.cs:704
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2073
Chara Duplicate()
Definition: Chara.cs:1544
void MakeAlly(bool msg=true)
Definition: Chara.cs:2019
Stats mana
Definition: Chara.cs:968
void TryDropBossLoot()
Definition: Chara.cs:5117
string NameTitled
Definition: Chara.cs:506
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:7987
Religion faith
Definition: Chara.cs:429
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:5765
void RequestProtection(Chara attacker, Action< Chara > action)
Definition: Chara.cs:7725
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7058
void SetSummon(int duration)
Definition: Chara.cs:2102
bool IsHostile()
Definition: Chara.cs:5942
Thing MakeMilk(bool effect=true, int num=1, bool addToZone=true)
Definition: Chara.cs:7478
bool isDead
Definition: Chara.cs:379
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:3940
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true)
Definition: Chara.cs:7498
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:598
GraphicSetting graphic
Definition: CoreConfig.cs:596
CameraConfig camera
Definition: CoreConfig.cs:606
NetSetting net
Definition: CoreConfig.cs:600
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
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 int rnd(int a)
Definition: EClass.cs:58
static Core core
Definition: EClass.cs:6
static void Wait(float a, Card c)
Definition: EClass.cs:97
static Zone _zone
Definition: EClass.cs:20
static Map _map
Definition: EClass.cs:18
static SourceManager sources
Definition: EClass.cs:42
static int rndHalf(int a)
Definition: EClass.cs:82
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)
Element GetOrCreateElement(Element ele)
int id
Definition: ELEMENT.cs:246
int vBase
Definition: ELEMENT.cs:248
SourceElement.Row source
Definition: ELEMENT.cs:269
bool HasTag(string tag)
Definition: ELEMENT.cs:469
static int[] List_MainAttributes
Definition: ELEMENT.cs:236
static int GetId(string alias)
Definition: ELEMENT.cs:1113
int Value
Definition: ELEMENT.cs:288
virtual string Name
Definition: ELEMENT.cs:300
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1094
static Element Void
Definition: ELEMENT.cs:234
bool IsTrait
Definition: ELEMENT.cs:358
bool HasItemProtection
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
Definition: GameLang.cs:123
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 string space
Definition: Lang.cs:32
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:2546
void TryShatter(Point pos, int ele, int power)
Definition: Map.cs:1194
List< Point > ListPointsInArc(Point center, Point to, int radius, float angle)
Definition: Map.cs:2287
void Reveal(Point center, int power=100)
Definition: Map.cs:912
void MineObj(Point point, Task task=null, Chara c=null)
Definition: Map.cs:1827
void MineBlock(Point point, bool recoverBlock=false, Chara c=null, bool mineObj=true)
Definition: Map.cs:1655
List< Point > ListPointsInLine(Point center, Point to, int radius)
Definition: Map.cs:2304
void SetEffect(int x, int z, CellEffect effect=null)
Definition: Map.cs:1495
List< Point > ListPointsInCircle(Point center, float radius, bool mustBeWalkable=true, bool los=true)
Definition: Map.cs:2256
List< Chara > charas
Definition: Map.cs:81
void RevealAll(bool reveal=true)
Definition: Map.cs:899
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:313
void ModKarma(int a)
Definition: Player.cs:2306
ReturnInfo returnInfo
Definition: Player.cs:685
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:1027
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:909
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:1229
bool Equals(int _x, int _z)
Definition: Point.cs:936
List< Chara > ListCharas()
Definition: Point.cs:1147
bool IsValid
Definition: Point.cs:88
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:965
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:1278
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
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:1976
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:163
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
int CountMinions(Chara c)
Definition: Zone.cs:3440
FactionBranch branch
Definition: Zone.cs:34
virtual bool IsUserZone
Definition: Zone.cs:264
Chara Boss
Definition: Zone.cs:83
override int DangerLv
Definition: Zone.cs:107
bool IsPCFaction
Definition: Zone.cs:464
ZoneInstance instance
Definition: Zone.cs:52
Card AddCard(Card t, Point point)
Definition: Zone.cs:1893
Definition: ActRef.cs:2
Act act
Definition: ActRef.cs:3
Thing refThing
Definition: ActRef.cs:9