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