Elin Decompiled Documentation EA 23.225 Nightly Patch 3
Loading...
Searching...
No Matches
ActEffect Class Reference
Inheritance diagram for ActEffect:
EClass

Classes

class  WishItem
 

Static Public Member Functions

static void TryDelay (Action a)
 
static bool DamageEle (Card CC, EffectId id, int power, Element e, List< Point > points, ActRef actref, string lang=null)
 
static void ProcAt (EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef=default(ActRef))
 
static void Proc (EffectId id, Card cc, Card tc=null, int power=100, ActRef actRef=default(ActRef))
 
static void Proc (EffectId id, int power, BlessedState state, Card cc, Card tc=null, ActRef actRef=default(ActRef))
 
static void Poison (Chara tc, Chara c, int power)
 
static void LoveMiracle (Chara tc, Chara c, int power, EffectId idEffect=EffectId.Love, BlessedState? state=null)
 
static void GeneMiracle (Chara tc, Chara c, DNA.Type type)
 
static Point GetTeleportPos (Point org, int radius=6)
 
static bool Wish (string s, string name, int power, BlessedState state)
 
static int Compare (string s, string t)
 
- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Static Public Attributes

static int RapidCount
 
static float RapidDelay
 
static int angle = 20
 
- Static Public Attributes inherited from EClass
static Core core
 

Additional Inherited Members

- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 6 of file ActEffect.cs.

Member Function Documentation

◆ Compare()

static int ActEffect.Compare ( string  s,
string  t 
)
inlinestatic

Definition at line 2815 of file ActEffect.cs.

2816 {
2817 if (s.IsEmpty())
2818 {
2819 return 0;
2820 }
2821 int num = 0;
2822 if (t == s)
2823 {
2824 num += 100;
2825 }
2826 if (t.Contains(s))
2827 {
2828 num += 100;
2829 }
2830 return num;
2831 }

◆ DamageEle()

static bool ActEffect.DamageEle ( Card  CC,
EffectId  id,
int  power,
Element  e,
List< Point points,
ActRef  actref,
string  lang = null 
)
inlinestatic

Definition at line 36 of file ActEffect.cs.

37 {
38 if (points.Count == 0)
39 {
41 return false;
42 }
44 {
45 Debug.Log(e.source.alias);
46 e = Element.Create(0, 1);
47 }
48 ElementRef elementRef = EClass.setting.elements[e.source.alias];
49 int num = actref.act?.ElementPowerMod ?? 50;
50 int num2 = 0;
51 Point point = CC.pos.Copy();
52 List<Card> list = new List<Card>();
53 bool flag = false;
54 if ((id == EffectId.Explosive || id == EffectId.Rocket) && actref.refThing != null)
55 {
56 power = power * actref.refThing.material.hardness / 10;
57 }
58 string text = id.ToString();
59 string text2 = (EClass.sources.calc.map.ContainsKey(text) ? text : (EClass.sources.calc.map.ContainsKey("Sp" + text) ? ("Sp" + text) : (text.ToLowerInvariant() + "_")));
60 foreach (Point p in points)
61 {
62 bool flag2 = true;
63 AttackSource attackSource = AttackSource.None;
64 switch (id)
65 {
66 case EffectId.Explosive:
67 case EffectId.Rocket:
68 text2 = "ball_";
69 flag = false;
70 break;
71 case EffectId.BallBubble:
72 text2 = "ball_";
73 break;
74 case EffectId.Earthquake:
75 text2 = "SpEarthquake";
76 flag2 = false;
77 flag = true;
78 break;
79 case EffectId.Meteor:
80 text2 = "SpMeteor";
81 break;
82 default:
83 if (CC.isChara && p.Equals(CC.pos) && points.Count >= 2)
84 {
85 continue;
86 }
87 break;
88 case EffectId.Suicide:
89 break;
90 }
91 Effect effect = null;
92 Effect effect2 = (flag2 ? Effect.Get("trail1") : null);
93 Point from = p;
94 switch (id)
95 {
96 case EffectId.Arrow:
97 case EffectId.MoonSpear:
98 case EffectId.MoonArrow:
99 {
100 effect = Effect.Get((id == EffectId.MoonSpear || id == EffectId.MoonArrow) ? "spell_moonspear" : "spell_arrow");
101 if (id == EffectId.Arrow)
102 {
103 effect.sr.color = elementRef.colorSprite;
104 }
105 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
106 Color startColor = (componentInChildren.endColor = elementRef.colorSprite);
107 componentInChildren.startColor = startColor;
108 from = CC.pos;
109 break;
110 }
111 case EffectId.Earthquake:
112 {
113 if (EClass.rnd(4) == 0 && p.IsSync)
114 {
115 effect = Effect.Get("smoke_earthquake");
116 }
117 float num3 = 0.06f * (float)CC.pos.Distance(p);
118 Point pos = p.Copy();
119 TweenUtil.Tween(num3, null, delegate
120 {
121 pos.Animate(AnimeID.Quake, animeBlock: true);
122 });
123 if (effect != null)
124 {
125 effect.SetStartDelay(num3);
126 }
127 break;
128 }
129 default:
130 {
131 effect = Effect.Get("Element/ball_" + ((e.id == 0) ? "Void" : e.source.alias.Remove(0, 3)));
132 if (effect == null)
133 {
134 effect = Effect.Get("Element/ball_Fire");
135 }
136 float startDelay = ((id == EffectId.Meteor) ? 0.1f : 0.04f) * (float)CC.pos.Distance(p);
137 effect.SetStartDelay(startDelay);
138 effect2.SetStartDelay(startDelay);
139 break;
140 }
141 }
142 if (effect2 != null)
143 {
144 effect2.SetParticleColor(elementRef.colorTrail, changeMaterial: true, "_TintColor").Play(from);
145 }
146 if (effect != null)
147 {
148 if (id == EffectId.Arrow || id == EffectId.MoonSpear || id == EffectId.MoonArrow)
149 {
150 TryDelay(delegate
151 {
152 effect.Play(CC.pos, 0f, p);
153 });
154 }
155 else
156 {
157 TryDelay(delegate
158 {
159 effect.Play(p).Flip(p.x > CC.pos.x);
160 });
161 }
162 }
163 bool flag3 = false;
164 if (CC.IsPCFactionOrMinion && (CC.HasElement(1651) || EClass.pc.Evalue(1651) >= 2))
165 {
166 bool flag4 = false;
167 foreach (Card item in p.ListCards())
168 {
169 if (item.isChara)
170 {
171 if (item.IsPCFactionOrMinion)
172 {
173 flag4 = true;
174 }
175 }
176 else if ((e.id != 910 && e.id != 911) || !item.IsFood || !item.category.IsChildOf("foodstuff"))
177 {
178 flag4 = true;
179 }
180 }
181 flag3 = flag4;
182 }
183 if (!flag3)
184 {
185 if (e.id == 910)
186 {
187 EClass._map.TryShatter(p, 910, power);
188 }
189 if (e.id == 911)
190 {
191 EClass._map.TryShatter(p, 911, power);
192 }
193 }
194 foreach (Card item2 in p.ListCards().ToList())
195 {
196 Card c = item2;
197 if ((!c.isChara && !c.trait.CanBeAttacked) || (c.IsMultisize && item2 == CC) || (c.isChara && (c.Chara.host == CC || c.Chara.parasite == CC || c.Chara.ride == CC)))
198 {
199 continue;
200 }
201 switch (id)
202 {
203 case EffectId.Arrow:
204 case EffectId.Hand:
205 case EffectId.Sword:
206 case EffectId.MoonSpear:
207 case EffectId.MoonArrow:
208 if (c.isChara && CC.isChara)
209 {
210 c.Chara.RequestProtection(CC.Chara, delegate(Chara a)
211 {
212 c = a;
213 });
214 }
215 if (id == EffectId.MoonSpear || (id == EffectId.MoonArrow && EClass.rnd(5) == 0))
216 {
217 attackSource = AttackSource.MoonSpear;
218 }
219 break;
220 }
221 switch (id)
222 {
223 case EffectId.Arrow:
224 attackSource = AttackSource.MagicArrow;
225 break;
226 case EffectId.Hand:
227 attackSource = AttackSource.MagicHand;
228 break;
229 case EffectId.Sword:
230 attackSource = AttackSource.MagicSword;
231 break;
232 }
233 long num4 = 0L;
234 bool isChara = CC.isChara;
235 if (id == EffectId.Suicide)
236 {
237 num4 = CC.MaxHP * 2;
238 num4 = num4 * 100 / (50 + point.Distance(p) * 75);
239 if ((c.HasCondition<ConBrightnessOfLife>() || c.HasTag(CTAG.suicide)) && !c.HasCondition<ConWet>() && !c.IsPowerful)
240 {
241 list.Add(c);
242 }
243 }
244 else
245 {
246 Dice dice = Dice.Create(text2, power, CC, (actref.refThing != null) ? null : actref.act);
247 if (dice == null)
248 {
249 Debug.Log(text2);
250 }
251 num4 = dice.Roll();
252 switch (id)
253 {
254 case EffectId.Earthquake:
255 if (c.HasCondition<ConGravity>())
256 {
257 num4 = dice.RollMax() * 2;
258 }
259 else if (c.isChara && c.Chara.IsLevitating)
260 {
261 num4 /= 2;
262 }
263 break;
264 case EffectId.Sword:
265 num4 = num4 * (int)Mathf.Min(70f + Mathf.Sqrt(CC.Evalue(101)) * 3f, 200f) / 100;
266 break;
267 }
268 if (id == EffectId.Ball || id == EffectId.BallBubble || id == EffectId.Explosive || id == EffectId.Rocket)
269 {
270 num4 = num4 * 100 / (90 + point.Distance(p) * 10);
271 }
272 }
273 if (id == EffectId.Sword)
274 {
275 c.PlaySound("ab_magicsword");
276 c.PlayEffect("hit_slash");
277 }
278 if ((actref.noFriendlyFire && !CC.Chara.IsHostile(c as Chara)) || (flag && c == CC))
279 {
280 continue;
281 }
282 if (isChara && points.Count > 1 && c != null && c.isChara && CC.isChara && CC.Chara.IsFriendOrAbove(c.Chara))
283 {
284 int num5 = CC.Evalue(302);
285 if (!CC.IsPC && CC.IsPCFactionOrMinion)
286 {
287 num5 += EClass.pc.Evalue(302);
288 }
289 if (CC.HasElement(1214))
290 {
291 num5 *= 2;
292 }
293 if (num5 > 0)
294 {
295 if (num5 * 10 > EClass.rnd(num4 + 1))
296 {
297 if (c == c.pos.FirstChara)
298 {
299 CC.ModExp(302, CC.IsPC ? 10 : 50);
300 }
301 continue;
302 }
303 num4 = EClass.rnd(num4 * 100 / (100 + num5 * 10 + 1));
304 if (c == c.pos.FirstChara)
305 {
306 CC.ModExp(302, CC.IsPC ? 20 : 100);
307 }
308 if (num4 == 0L)
309 {
310 continue;
311 }
312 }
313 if ((CC.HasElement(1214) || (!CC.IsPC && (CC.IsPCFaction || CC.IsPCFactionMinion) && EClass.pc.HasElement(1214))) && EClass.rnd(5) != 0)
314 {
315 continue;
316 }
317 }
318 if (!lang.IsEmpty())
319 {
320 if (lang == "spell_hand")
321 {
322 string[] list2 = Lang.GetList("attack" + (CC.isChara ? CC.Chara.race.meleeStyle.IsEmpty("Touch") : "Touch"));
323 string @ref = "_elehand".lang(e.source.GetAltname(2), list2[4]);
324 CC.Say(c.IsPCParty ? "cast_hand_ally" : "cast_hand", CC, c, @ref, c.IsPCParty ? list2[1] : list2[2]);
325 }
326 else
327 {
328 CC.Say(lang + "_hit", CC, c, e.Name.ToLower());
329 }
330 }
331 Chara chara = (CC.isChara ? CC.Chara : ((actref.refThing != null) ? EClass._map.FindChara(actref.refThing.c_uidRefCard) : null));
332 if (c.IsMultisize)
333 {
334 switch (id)
335 {
336 case EffectId.Ball:
337 case EffectId.Explosive:
338 case EffectId.BallBubble:
339 case EffectId.Meteor:
340 case EffectId.Earthquake:
341 case EffectId.Suicide:
342 case EffectId.Rocket:
343 case EffectId.Flare:
344 num4 /= 2;
345 break;
346 }
347 }
348 if (RapidCount > 0)
349 {
350 num4 = num4 * 100 / (100 + RapidCount * 50);
351 }
352 num4 = num4 * Act.powerMod / 100;
353 if (num4 > 99999999)
354 {
355 num4 = 99999999L;
356 }
357 c.DamageHP(num4, e.id, power * num / 100, attackSource, chara ?? CC);
358 if (c.IsAliveInCurrentZone && CC.IsAliveInCurrentZone && id == EffectId.DrainMana && c.isChara && CC.isChara && c.Chara.mana.value > 0)
359 {
360 long num6 = num4 * num / 100;
361 Debug.Log(num4 + " v:" + num6 + " evalue:" + e.Value + " power:" + power + " elepMod:" + num);
362 if (num6 > c.Chara.mana.value)
363 {
364 num6 = c.Chara.mana.value;
365 }
366 c.Chara.mana.Mod((int)(-num6));
367 CC.Chara.mana.Mod((int)num6);
368 }
369 if (id == EffectId.Explosive && CC.trait is TraitCookerMicrowave)
370 {
371 chara = EClass.pc;
372 }
373 if (chara != null && chara.IsAliveInCurrentZone)
374 {
375 chara.DoHostileAction(c);
376 }
377 num2++;
378 }
379 if ((id == EffectId.Explosive || id == EffectId.Suicide || id == EffectId.Rocket) && (!EClass._zone.IsPCFaction || !EClass.Branch.HasItemProtection))
380 {
381 int num7 = id switch
382 {
383 EffectId.Suicide => CC.LV / 3 + 40,
384 EffectId.Meteor => 50 + power / 20,
385 _ => (actref.refThing != null) ? actref.refThing.material.hardness : (30 + power / 20),
386 };
387 bool flag5 = EClass._zone.HasLaw && !EClass._zone.IsPCFaction && (CC.IsPC || (id == EffectId.Explosive && actref.refThing == null)) && !(EClass._zone is Zone_Vernis);
388 if (p.HasObj && p.cell.matObj.hardness <= num7)
389 {
391 if (flag5)
392 {
394 }
395 }
396 if (!p.HasObj && p.HasBlock && p.matBlock.hardness <= num7)
397 {
399 if (flag5)
400 {
402 }
403 }
404 }
405 if (e.id == 910)
406 {
407 int num8 = 0;
408 if (id == EffectId.Meteor)
409 {
410 num8 = 2;
411 }
413 {
414 num8 = 0;
415 }
416 if (num8 > EClass.rnd(10))
417 {
418 p.ModFire(4 + EClass.rnd(10));
419 }
420 }
421 if (e.id == 911)
422 {
423 p.ModFire(-20, extinguish: true);
424 }
425 }
426 if (RapidCount == 0)
427 {
428 foreach (Card item3 in list)
429 {
430 if (item3.ExistsOnMap)
431 {
432 RapidCount += 2;
433 ProcAt(id, power, BlessedState.Normal, item3, null, item3.pos, isNeg: true, actref);
434 }
435 }
436 }
437 return num2 > 0;
438 }
AnimeID
Definition: AnimeID.cs:2
AttackSource
Definition: AttackSource.cs:2
BlessedState
Definition: BlessedState.cs:2
CTAG
Definition: CTAG.cs:2
EffectId
Definition: EffectId.cs:2
static int RapidCount
Definition: ActEffect.cs:17
static void TryDelay(Action a)
Definition: ActEffect.cs:23
static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef=default(ActRef))
Definition: ActEffect.cs:440
virtual int ElementPowerMod
Definition: ACT.cs:111
Definition: Card.cs:11
bool IsPCFactionOrMinion
Definition: Card.cs:2260
virtual bool IsMultisize
Definition: Card.cs:2146
virtual Chara Chara
Definition: Card.cs:2058
bool HasElement(int ele, int req=1)
Definition: Card.cs:5816
SourceMaterial.Row material
Definition: Card.cs:2039
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6038
virtual bool IsPCParty
Definition: Card.cs:2137
int c_uidRefCard
Definition: Card.cs:1124
bool ExistsOnMap
Definition: Card.cs:2073
bool HasTag(CTAG tag)
Definition: Card.cs:2583
Point pos
Definition: Card.cs:59
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6072
Trait trait
Definition: Card.cs:53
bool IsPowerful
Definition: Card.cs:2082
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2115
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:3993
void SayNothingHappans()
Definition: Card.cs:6685
virtual bool IsPC
Definition: Card.cs:2131
virtual bool isChara
Definition: Card.cs:2071
int Evalue(int ele)
Definition: Card.cs:2559
virtual bool IsPCFactionMinion
Definition: Card.cs:2143
void ModExp(string alias, int a)
Definition: Card.cs:2636
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6690
SourceMaterial.Row matObj
Definition: Cell.cs:1036
Definition: Chara.cs:10
override bool IsAliveInCurrentZone
Definition: Chara.cs:559
bool IsLevitating
Definition: Chara.cs:595
Chara host
Definition: Chara.cs:33
bool RequestProtection(Chara attacker, Action< Chara > action)
Definition: Chara.cs:8198
bool IsFriendOrAbove()
Definition: Chara.cs:6501
Stats mana
Definition: Chara.cs:1152
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6232
bool IsHostile()
Definition: Chara.cs:6409
SourceRace.Row race
Definition: Chara.cs:462
Definition: ConWet.cs:2
Definition: Dice.cs:5
static int RollMax(int num, int sides, int bonus=0)
Definition: Dice.cs:70
static int Roll(int num, int sides, int bonus=0, Card card=null)
Definition: Dice.cs:48
static Dice Create(Element ele, Card c)
Definition: Dice.cs:120
Definition: EClass.cs:5
static Zone _zone
Definition: EClass.cs:20
static Map _map
Definition: EClass.cs:18
static int rnd(long a)
Definition: EClass.cs:58
static SourceManager sources
Definition: EClass.cs:42
static FactionBranch Branch
Definition: EClass.cs:22
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
static GameSetting setting
Definition: EClass.cs:34
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
Color colorSprite
Definition: ElementRef.cs:7
Color colorTrail
Definition: ElementRef.cs:9
int id
Definition: ELEMENT.cs:250
SourceElement.Row source
Definition: ELEMENT.cs:273
int Value
Definition: ELEMENT.cs:292
virtual string Name
Definition: ELEMENT.cs:304
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1100
bool HasItemProtection
UD_String_ElementRef elements
Definition: GameSetting.cs:315
Definition: Lang.cs:6
static string[] GetList(string id)
Definition: Lang.cs:114
Chara FindChara(string id)
Definition: Map.cs:2568
void TryShatter(Point pos, int ele, int power)
Definition: Map.cs:1200
void MineObj(Point point, Task task=null, Chara c=null)
Definition: Map.cs:1840
void MineBlock(Point point, bool recoverBlock=false, Chara c=null, bool mineObj=true)
Definition: Map.cs:1668
void ModKarma(int a)
Definition: Player.cs:2496
Definition: Point.cs:9
SourceMaterial.Row matBlock
Definition: Point.cs:55
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1039
Point Copy()
Definition: Point.cs:479
int x
Definition: Point.cs:36
void ModFire(int value, bool extinguish=false)
Definition: Point.cs:921
bool IsSync
Definition: Point.cs:332
bool Equals(int _x, int _z)
Definition: Point.cs:948
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:977
Chara FirstChara
Definition: Point.cs:276
bool HasBlock
Definition: Point.cs:141
Cell cell
Definition: Point.cs:51
void Animate(AnimeID id, bool animeBlock=false)
Definition: Point.cs:1290
SourceCalc calc
virtual void Mod(int a)
Definition: Stats.cs:135
virtual int value
Definition: Stats.cs:56
virtual bool CanBeAttacked
Definition: Trait.cs:164
bool ContainsKey(TKey key)
Definition: UDictionary.cs:151
FactionBranch branch
Definition: Zone.cs:34
bool IsPCFaction
Definition: Zone.cs:470
Act act
Definition: ActRef.cs:3
bool noFriendlyFire
Definition: ActRef.cs:15
Thing refThing
Definition: ActRef.cs:9

References EClass._map, EClass._zone, ActRef.act, Point.Animate(), EClass.Branch, Zone.branch, SourceManager.calc, Trait.CanBeAttacked, Point.cell, Card.Chara, Color, UDictionary< TKey, TValue >.ContainsKey(), Point.Copy(), Dice.Create(), Element.Create(), Card.DamageHP(), Debug, Chara.DoHostileAction(), Act.ElementPowerMod, GameSetting.elements, Point.Equals(), Card.Evalue(), Card.ExistsOnMap, Map.FindChara(), Point.FirstChara, Effect.Get(), Lang.GetList(), Point.HasBlock, Card.HasElement(), FactionBranch.HasItemProtection, Point.HasObj, Card.HasTag(), Chara.host, Card.IsAliveInCurrentZone, Chara.IsAliveInCurrentZone, Card.isChara, Chara.IsLevitating, Card.IsMultisize, Zone.IsPCFaction, Card.IsPCParty, Card.IsPowerful, Point.IsSync, item, Point.ListCards(), Chara.mana, Point.matBlock, Cell.matObj, Map.MineBlock(), Map.MineObj(), Stats.Mod(), Point.ModFire(), Player.ModKarma(), Card.Name, Chara.parasite, EClass.pc, Effect.Play(), Card.PlayEffect(), EClass.player, Card.PlaySound(), Card.pos, ProcAt(), RapidCount, ActRef.refThing, Chara.RequestProtection(), Chara.ride, EClass.rnd(), Dice.Roll(), Dice.RollMax(), Card.SayNothingHappans(), Effect.SetParticleColor(), Effect.SetStartDelay(), EClass.setting, Element.source, EClass.sources, Card.trait, TryDelay(), Map.TryShatter(), Stats.value, and Point.x.

Referenced by ProcAt().

◆ GeneMiracle()

static void ActEffect.GeneMiracle ( Chara  tc,
Chara  c,
DNA::Type  type 
)
inlinestatic

Definition at line 2617 of file ActEffect.cs.

2618 {
2620 {
2622 return;
2623 }
2624 if (c == tc)
2625 {
2626 tc.Say("love_ground", tc);
2627 }
2628 else
2629 {
2630 tc.Say("love_chara", c, tc);
2631 }
2632 Thing t = tc.MakeGene(type);
2633 tc.GiveBirth(t, effect: true);
2634 }
Thing GiveBirth(Thing t, bool effect)
Definition: Card.cs:5693
Thing MakeGene(DNA.Type? type=null)
Definition: Chara.cs:7973
Definition: Msg.cs:5
static string SayNothingHappen()
Definition: Msg.cs:96
Definition: Thing.cs:8
virtual bool IsUserZone
Definition: Zone.cs:268

References EClass._zone, Card.GiveBirth(), Card.IsPCFactionOrMinion, Zone.IsUserZone, Chara.MakeGene(), Card.Say(), and Msg.SayNothingHappen().

◆ GetTeleportPos()

static Point ActEffect.GetTeleportPos ( Point  org,
int  radius = 6 
)
inlinestatic

Definition at line 2636 of file ActEffect.cs.

2637 {
2638 Point point = new Point();
2639 for (int i = 0; i < 10000; i++)
2640 {
2641 point.Set(org);
2642 point.x += EClass.rnd(radius) - EClass.rnd(radius);
2643 point.z += EClass.rnd(radius) - EClass.rnd(radius);
2644 if (point.IsValid && point.IsInBounds && !point.cell.blocked && point.Distance(org) >= radius / 3 + 1 - i / 50 && !point.cell.HasZoneStairs())
2645 {
2646 return point;
2647 }
2648 }
2649 return org.GetRandomNeighbor().GetNearestPoint();
2650 }
bool HasZoneStairs(bool includeLocked=true)
Definition: Cell.cs:1717
Point Set(int _x, int _z)
Definition: Point.cs:491
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:607
bool IsValid
Definition: Point.cs:88
bool IsInBounds
Definition: Point.cs:104
Point GetRandomNeighbor()
Definition: Point.cs:747

References Algorithms.WeightCell.blocked, Point.cell, Point.Distance(), Point.GetNearestPoint(), Point.GetRandomNeighbor(), Cell.HasZoneStairs(), Point.IsInBounds, Point.IsValid, EClass.rnd(), and Point.Set().

Referenced by AI_PassTime.Run().

◆ LoveMiracle()

static void ActEffect.LoveMiracle ( Chara  tc,
Chara  c,
int  power,
EffectId  idEffect = EffectId::Love,
BlessedState state = null 
)
inlinestatic

Definition at line 2585 of file ActEffect.cs.

2586 {
2587 if (c == tc)
2588 {
2589 tc.Say("love_ground", tc);
2590 }
2591 else
2592 {
2593 tc.Say("love_chara", c, tc);
2594 }
2595 tc.ModAffinity(EClass.pc, power / 4);
2596 if ((idEffect != EffectId.Love || EClass.rnd(2) != 0) && (!EClass._zone.IsUserZone || tc.IsPCFaction || !EClass.game.principal.disableUsermapBenefit))
2597 {
2598 if (idEffect == EffectId.MoonSpear && EClass.rnd(EClass.debug.enable ? 2 : 20) == 0)
2599 {
2600 Thing thing = tc.MakeGene();
2601 tc.GiveBirth(thing, effect: true);
2602 tc.Say("item_drop", thing);
2603 }
2604 else if (idEffect != EffectId.LovePlus && EClass.rnd(2) == 0)
2605 {
2606 Thing c2 = tc.MakeMilk(effect: true, 1, addToZone: true, state);
2607 tc.Say("item_drop", c2);
2608 }
2609 else
2610 {
2611 Thing c3 = tc.MakeEgg(effect: true, 1, addToZone: true, (idEffect == EffectId.LovePlus) ? 3 : 20, state);
2612 tc.Say("item_drop", c3);
2613 }
2614 }
2615 }
Thing MakeMilk(bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
Definition: Card.cs:5662
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5639
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7755
override bool IsPCFaction
Definition: Chara.cs:669
bool enable
Definition: CoreDebug.cs:286
static Game game
Definition: EClass.cs:8
static CoreDebug debug
Definition: EClass.cs:48
bool disableUsermapBenefit
GamePrincipal principal
Definition: Game.cs:221

References EClass._zone, EClass.debug, GamePrincipal.disableUsermapBenefit, CoreDebug.enable, EClass.game, Card.GiveBirth(), Chara.IsPCFaction, Zone.IsUserZone, Card.MakeEgg(), Chara.MakeGene(), Card.MakeMilk(), Chara.ModAffinity(), EClass.pc, Game.principal, EClass.rnd(), and Card.Say().

Referenced by FoodEffect.Proc().

◆ Poison()

static void ActEffect.Poison ( Chara  tc,
Chara  c,
int  power 
)
inlinestatic

Definition at line 2569 of file ActEffect.cs.

2570 {
2571 tc.Say("eat_poison", tc);
2572 tc.Talk("scream");
2573 if (power > 100000000)
2574 {
2575 power = 100000000;
2576 }
2577 int num = (int)Mathf.Sqrt(power * 100);
2578 tc.DamageHP(num * 2 + EClass.rnd(num), 915, power);
2579 if (!tc.isDead && !tc.IsPC)
2580 {
2582 }
2583 }
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6593
override bool IsPC
Definition: Chara.cs:610
bool isDead
Definition: Chara.cs:387

References Card.DamageHP(), Chara.isDead, Chara.IsPC, Player.ModKarma(), EClass.player, EClass.rnd(), Card.Say(), and Card.Talk().

Referenced by FoodEffect.Proc().

◆ Proc() [1/2]

◆ Proc() [2/2]

static void ActEffect.Proc ( EffectId  id,
int  power,
BlessedState  state,
Card  cc,
Card  tc = null,
ActRef  actRef = default(ActRef) 
)
inlinestatic

Definition at line 940 of file ActEffect.cs.

941 {
942 if (tc == null)
943 {
944 tc = cc;
945 }
946 Chara TC = tc.Chara;
947 Chara CC = cc.Chara;
948 bool blessed = state >= BlessedState.Blessed;
949 bool flag = state <= BlessedState.Cursed;
950 int orgPower = power;
951 if (blessed || flag)
952 {
953 power *= 2;
954 }
955 switch (id)
956 {
957 case EffectId.Duplicate:
958 {
959 Point randomPoint = CC.pos.GetRandomPoint(2, requireLos: false, allowChara: false, allowBlocked: false, 200);
960 if (randomPoint == null || randomPoint.Equals(CC.pos) || !randomPoint.IsValid || !CC.CanDuplicate())
961 {
962 CC.Say("split_fail", CC);
963 return;
964 }
965 Chara t2 = CC.Duplicate();
966 EClass._zone.AddCard(t2, randomPoint);
967 CC.Say("split", CC);
968 break;
969 }
970 case EffectId.Escape:
971 if (CC.IsPCFaction || (EClass._zone.Boss == CC && EClass.rnd(30) != 0))
972 {
973 return;
974 }
975 CC.Say("escape", CC);
976 CC.PlaySound("escape");
977 if (EClass._zone.Boss == CC)
978 {
979 CC.TryDropBossLoot();
980 }
981 CC.Destroy();
982 break;
983 case EffectId.BurnMana:
984 CC.PlaySound("fire");
985 CC.PlayEffect("Element/eleFire");
986 CC.Say("burn_mana", CC);
987 CC.mana.Mod(-CC.mana.max / 3 - 1);
988 break;
989 case EffectId.Exterminate:
990 {
991 CC.PlaySound("clean_floor");
992 Msg.Say("exterminate");
993 List<Chara> list2 = EClass._map.charas.Where((Chara c) => c.isCopy && !c.IsPCFaction).ToList();
994 if (list2.Count == 0)
995 {
997 return;
998 }
999 foreach (Chara item in list2)
1000 {
1001 item.Say("split_fail", item);
1002 item.PlayEffect("vanish");
1003 item.Die();
1004 }
1005 break;
1006 }
1007 case EffectId.DropMine:
1008 {
1009 if (CC.pos.Installed != null || EClass._zone.IsPCFaction)
1010 {
1011 return;
1012 }
1013 Thing thing = ThingGen.Create("mine");
1014 thing.c_idRefCard = "dog_mine";
1015 Zone.ignoreSpawnAnime = true;
1016 EClass._zone.AddCard(thing, CC.pos).Install();
1017 break;
1018 }
1019 case EffectId.LittleSisterMigration:
1020 {
1022 {
1024 return;
1025 }
1026 List<Chara> list3 = new List<Chara>();
1027 bool flag5 = false;
1028 foreach (Chara chara2 in EClass._map.charas)
1029 {
1030 if (!chara2.IsPCFactionOrMinion && chara2.id == "littleOne")
1031 {
1032 if (flag5)
1033 {
1034 flag5 = false;
1035 continue;
1036 }
1037 list3.Add(chara2);
1038 flag5 = true;
1039 }
1040 }
1041 if (list3.Count == 0)
1042 {
1044 return;
1045 }
1046 EClass.pc.PlaySound("chime_angel");
1047 foreach (Chara item2 in list3)
1048 {
1049 item2.PlayEffect("revive");
1050 item2.Destroy();
1051 }
1052 Msg.Say("little_migration", list3.Count.ToString() ?? "");
1053 EClass._zone.ModInfluence(list3.Count);
1054 EClass.player.stats.sistersDepart += list3.Count;
1055 break;
1056 }
1057 case EffectId.MagicMap:
1058 if (!CC.IsPC)
1059 {
1060 CC.SayNothingHappans();
1061 break;
1062 }
1063 if (flag)
1064 {
1065 CC.Say("abMagicMap_curse", CC);
1066 CC.PlaySound("curse3");
1067 CC.PlayEffect("curse");
1068 CC.AddCondition<ConConfuse>(200, force: true);
1069 break;
1070 }
1071 CC.Say("abMagicMap", CC);
1072 CC.PlayEffect("identify");
1073 CC.PlaySound("identify");
1074 if (blessed)
1075 {
1077 }
1078 else
1079 {
1080 EClass._map.Reveal(CC.pos, power);
1081 }
1082 break;
1083 case EffectId.AbsorbMana:
1084 {
1085 if (CC == TC)
1086 {
1087 EClass.game.religions.Element.Talk("ability");
1088 }
1089 Dice dice = Dice.Create("ActManaAbsorb", power, CC, (actRef.refThing != null) ? null : actRef.act);
1090 TC.mana.Mod(dice.Roll());
1091 TC.PlaySound("heal");
1092 TC.PlayEffect("heal");
1093 if (TC == CC)
1094 {
1095 CC.Say("absorbMana", CC);
1096 }
1097 break;
1098 }
1099 case EffectId.ModPotential:
1100 {
1101 Element element = cc.elements.ListElements((Element e) => e.HasTag("primary")).RandomItem();
1102 cc.elements.ModTempPotential(element.id, power / 10);
1103 break;
1104 }
1105 case EffectId.ForgetItems:
1106 {
1107 TC.PlaySound("curse3");
1108 TC.PlayEffect("curse");
1109 TC.Say("forgetItems", TC);
1110 int num5 = power / 50 + 1 + EClass.rnd(3);
1111 List<Thing> source = TC.things.List((Thing t) => t.c_IDTState == 0);
1112 for (int j = 0; j < num5; j++)
1113 {
1114 source.RandomItem().c_IDTState = 5;
1115 }
1116 break;
1117 }
1118 case EffectId.EnchantWeapon:
1119 case EffectId.EnchantArmor:
1120 case EffectId.EnchantWeaponGreat:
1121 case EffectId.EnchantArmorGreat:
1122 {
1123 bool armor = id == EffectId.EnchantArmor || id == EffectId.EnchantArmorGreat;
1124 bool flag4 = id == EffectId.EnchantWeaponGreat || id == EffectId.EnchantArmorGreat;
1125 if (!tc.isThing)
1126 {
1127 LayerDragGrid.CreateEnchant(CC, armor, flag4, state);
1128 return;
1129 }
1130 cc.PlaySound("identify");
1131 cc.PlayEffect("identify");
1132 if (flag)
1133 {
1134 cc.Say("enc_curse", tc);
1135 tc.ModEncLv(-1);
1136 break;
1137 }
1138 int num4 = (flag4 ? 4 : 2) + (blessed ? 1 : 0);
1139 if (tc.encLV >= num4)
1140 {
1141 cc.Say("enc_resist", tc);
1142 break;
1143 }
1144 cc.Say("enc", tc);
1145 tc.ModEncLv(1);
1146 break;
1147 }
1148 case EffectId.Identify:
1149 case EffectId.GreaterIdentify:
1150 {
1151 bool flag6 = id == EffectId.GreaterIdentify;
1152 if (flag)
1153 {
1154 Redirect(EffectId.ForgetItems, flag6 ? BlessedState.Cursed : BlessedState.Normal, default(ActRef));
1155 break;
1156 }
1157 if (!tc.isThing)
1158 {
1159 int count = ((!blessed) ? 1 : (flag6 ? (2 + EClass.rnd(2)) : (3 + EClass.rnd(3))));
1160 LayerDragGrid.CreateIdentify(CC, flag6, state, 0, count);
1161 return;
1162 }
1163 cc.PlaySound("identify");
1164 cc.PlayEffect("identify");
1165 tc.Thing.Identify(cc.IsPCParty, (!flag6) ? IDTSource.Identify : IDTSource.SuperiorIdentify);
1166 break;
1167 }
1168 case EffectId.Uncurse:
1169 {
1170 if (!tc.isThing)
1171 {
1172 LayerDragGrid.CreateUncurse(CC, state);
1173 return;
1174 }
1175 Thing thing2 = tc.Thing;
1176 if (thing2.blessedState == BlessedState.Cursed)
1177 {
1178 thing2.SetBlessedState(BlessedState.Normal);
1179 }
1180 else if (thing2.blessedState == BlessedState.Doomed)
1181 {
1182 thing2.SetBlessedState(BlessedState.Normal);
1183 }
1184 thing2.GetRootCard()?.TryStack(thing2);
1185 LayerInventory.SetDirty(thing2);
1186 break;
1187 }
1188 case EffectId.Lighten:
1189 {
1190 if (!tc.isThing)
1191 {
1192 LayerDragGrid.CreateLighten(CC, state);
1193 return;
1194 }
1195 if (tc.Num > 1)
1196 {
1197 tc = tc.Split(1);
1198 }
1199 cc.PlaySound("offering");
1200 cc.PlayEffect("buff");
1201 int num3 = (tc.isWeightChanged ? tc.c_weight : tc.Thing.source.weight);
1202 tc.isWeightChanged = true;
1203 Element orCreateElement = tc.elements.GetOrCreateElement(64);
1204 Element orCreateElement2 = tc.elements.GetOrCreateElement(65);
1205 Element orCreateElement3 = tc.elements.GetOrCreateElement(67);
1206 Element orCreateElement4 = tc.elements.GetOrCreateElement(66);
1207 bool flag3 = tc.IsEquipmentOrRangedOrAmmo || tc.IsThrownWeapon;
1208 if (flag)
1209 {
1210 num3 = (int)(0.01f * (float)num3 * (float)power * 0.75f + 500f);
1211 if (num3 < 0 || num3 > 10000000)
1212 {
1213 num3 = 10000000;
1214 flag3 = false;
1215 }
1216 if (flag3)
1217 {
1218 if (tc.IsWeapon || tc.IsThrownWeapon || tc.IsAmmo)
1219 {
1220 tc.elements.ModBase(67, Mathf.Clamp(orCreateElement3.vBase * power / 1000, 1, 5));
1221 tc.elements.ModBase(66, -Mathf.Clamp(orCreateElement4.vBase * power / 1000, 1, 5));
1222 }
1223 else
1224 {
1225 tc.elements.ModBase(65, Mathf.Clamp(orCreateElement2.vBase * power / 1000, 1, 5));
1226 tc.elements.ModBase(64, -Mathf.Clamp(orCreateElement.vBase * power / 1000, 1, 5));
1227 }
1228 }
1229 cc.Say("lighten_curse", cc, tc);
1230 }
1231 else
1232 {
1233 num3 = num3 * (100 - power / 10) / 100;
1234 if (blessed)
1235 {
1236 power /= 4;
1237 }
1238 if (flag3)
1239 {
1240 if (tc.IsWeapon || tc.IsThrownWeapon || tc.IsAmmo)
1241 {
1242 tc.elements.ModBase(67, -Mathf.Clamp(orCreateElement3.vBase * power / 1000, 1, 5));
1243 tc.elements.ModBase(66, Mathf.Clamp(orCreateElement4.vBase * power / 1000, 1, 5));
1244 }
1245 else
1246 {
1247 tc.elements.ModBase(65, -Mathf.Clamp(orCreateElement2.vBase * power / 1000, 1, 5));
1248 tc.elements.ModBase(64, Mathf.Clamp(orCreateElement.vBase * power / 1000, 1, 5));
1249 }
1250 }
1251 cc.Say("lighten", cc, tc);
1252 }
1253 tc.c_weight = num3;
1254 tc.SetDirtyWeight();
1255 if (tc.parent == null)
1256 {
1257 CC.Pick(tc.Thing, msg: false);
1258 }
1260 break;
1261 }
1262 case EffectId.Reconstruction:
1263 {
1264 if (!tc.isThing)
1265 {
1267 return;
1268 }
1269 if (tc.Num > 1)
1270 {
1271 tc = tc.Split(1);
1272 }
1273 cc.PlaySound("mutation");
1274 cc.PlayEffect("identify");
1275 cc.Say("reconstruct", cc, tc);
1276 EClass.game.cards.uidNext += EClass.rnd(30);
1277 int num6 = Mathf.Max(tc.genLv, tc.LV, EClass.player.stats.deepest);
1279 {
1280 blesstedState = state
1281 });
1282 Thing thing3 = ThingGen.Create(tc.id, -1, (int)((long)num6 * (long)power / 400));
1283 thing3.genLv = num6;
1284 tc.Destroy();
1285 CC.Pick(thing3, msg: false);
1286 if (!CC.IsPC)
1287 {
1288 CC.TryEquip(thing3);
1289 }
1290 break;
1291 }
1292 case EffectId.ChangeMaterialLesser:
1293 case EffectId.ChangeMaterial:
1294 case EffectId.ChangeMaterialGreater:
1295 {
1296 SourceMaterial.Row row = EClass.sources.materials.alias.TryGetValue(actRef.n1);
1297 if (!tc.isThing)
1298 {
1299 LayerDragGrid.CreateChangeMaterial(CC, actRef.refThing, row, id, state);
1300 return;
1301 }
1302 if (tc.Num > 1)
1303 {
1304 tc = tc.Split(1);
1305 }
1306 string name = tc.Name;
1307 if (row == null)
1308 {
1309 bool num = id == EffectId.ChangeMaterialGreater;
1310 bool flag2 = id == EffectId.ChangeMaterialLesser;
1311 string text2 = tc.Thing.source.tierGroup;
1312 Dictionary<string, SourceMaterial.TierList> tierMap = SourceMaterial.tierMap;
1313 int num2 = 1;
1314 if (flag)
1315 {
1316 num2 -= 2;
1317 }
1318 if (blessed)
1319 {
1320 num2++;
1321 }
1322 if (num)
1323 {
1324 num2++;
1325 }
1326 if (flag2)
1327 {
1328 num2 -= 2;
1329 }
1330 num2 = Mathf.Clamp(num2 + EClass.rnd(2), 0, 4);
1331 if (EClass.rnd(10) == 0)
1332 {
1333 text2 = ((text2 == "metal") ? "leather" : "metal");
1334 }
1335 SourceMaterial.TierList tierList = (text2.IsEmpty() ? tierMap.RandomItem() : tierMap[text2]);
1336 for (int i = 0; i < 1000; i++)
1337 {
1338 row = tierList.tiers[num2].Select();
1339 if (row != tc.material)
1340 {
1341 break;
1342 }
1343 }
1344 }
1345 cc.PlaySound("offering");
1346 cc.PlayEffect("buff");
1347 if ((tc.id == "log" || tc.id == "branch") && tc.material.alias == "carbone")
1348 {
1349 foreach (Element item3 in tc.elements.dict.Values.ToList())
1350 {
1351 if (item3.IsTrait && item3.vBase != 0)
1352 {
1353 tc.elements.ModBase(item3.id, -item3.vBase);
1354 }
1355 }
1356 }
1357 tc.ChangeMaterial(row);
1358 if (tc.trait is TraitGene && tc.c_DNA != null)
1359 {
1360 DNA.Type type = DNA.GetType(tc.material.alias);
1361 tc.c_DNA.Generate(type);
1362 }
1363 cc.Say("materialChanged", name, row.GetName());
1364 if (CC != null)
1365 {
1366 if (tc.parent == null)
1367 {
1368 CC.Pick(tc.Thing, msg: false);
1369 }
1371 }
1372 break;
1373 }
1374 case EffectId.ReturnVoid:
1375 {
1377 if (EClass.game.IsSurvival || root == null || root.visitCount == 0 || EClass.player.stats.deepestVoid < 1 || (!EClass.debug.enable && EClass.player.CountKeyItem("license_void") == 0))
1378 {
1380 return;
1381 }
1382 int max = Mathf.Min(EClass.player.stats.deepestVoid, -root.MinLv);
1383 int destLv = 1;
1384 Dialog.InputName("dialogVoidReturn".lang(max.ToString() ?? ""), max.ToString() ?? "", delegate(bool cancel, string text)
1385 {
1386 if (!cancel)
1387 {
1388 destLv = Mathf.Abs(text.ToInt());
1389 destLv = Mathf.Clamp(destLv, 1, max) * -1;
1390 Zone zone = ((root.lv == destLv) ? root : (root.children.Find((Spatial t) => t.lv == destLv) as Zone));
1391 Debug.Log(destLv + "/" + zone);
1392 if (zone == null)
1393 {
1394 zone = SpatialGen.Create(root.GetNewZoneID(destLv), root, register: true) as Zone;
1395 zone.lv = destLv;
1396 }
1397 Msg.Say("returnComplete");
1398 EClass.player.uidLastTravelZone = 0;
1400 EClass.player.lastZonePos = null;
1401 EClass.player.returnInfo = null;
1402 }
1403 });
1404 break;
1405 }
1406 case EffectId.Return:
1407 case EffectId.Evac:
1408 if (!cc.IsPC)
1409 {
1410 Redirect(EffectId.Teleport, state, default(ActRef));
1411 return;
1412 }
1413 cc.PlaySound("return_cast");
1414 if (EClass.player.returnInfo == null)
1415 {
1416 if (id == EffectId.Evac)
1417 {
1418 EClass.player.returnInfo = new Player.ReturnInfo
1419 {
1420 turns = EClass.rnd(10) + 10,
1421 isEvac = true
1422 };
1423 }
1424 else
1425 {
1426 if (EClass.game.spatials.ListReturnLocations().Count == 0)
1427 {
1428 Msg.Say("returnNowhere");
1429 break;
1430 }
1431 EClass.player.returnInfo = new Player.ReturnInfo
1432 {
1433 turns = EClass.rnd(10) + 10,
1434 askDest = true
1435 };
1436 }
1437 Msg.Say("returnBegin");
1438 }
1439 else
1440 {
1441 EClass.player.returnInfo = null;
1442 Msg.Say("returnAbort");
1443 }
1444 break;
1445 case EffectId.Teleport:
1446 case EffectId.TeleportShort:
1447 case EffectId.Gate:
1448 if (!tc.HasHost)
1449 {
1450 if (!flag)
1451 {
1452 if (id == EffectId.TeleportShort)
1453 {
1454 tc.Teleport(GetTeleportPos(tc.pos));
1455 }
1456 else
1457 {
1459 }
1460 }
1461 if (id == EffectId.Gate && CC.IsPC)
1462 {
1463 foreach (Chara chara3 in EClass._map.charas)
1464 {
1465 if (!chara3.HasHost && chara3 != tc && (chara3.IsPCParty || chara3.IsPCPartyMinion))
1466 {
1467 chara3.Teleport(tc.pos.GetNearestPoint(allowBlock: false, allowChara: false) ?? tc.pos);
1468 }
1469 }
1470 }
1471 }
1472 if (flag)
1473 {
1474 Redirect(EffectId.Gravity, BlessedState.Normal, default(ActRef));
1475 }
1476 if (blessed)
1477 {
1478 Redirect(EffectId.Levitate, BlessedState.Normal, default(ActRef));
1479 }
1480 break;
1481 }
1482 if (TC == null)
1483 {
1484 return;
1485 }
1486 switch (id)
1487 {
1488 case EffectId.ThrowPotion:
1489 if (!CC.pos.Equals(TC.pos))
1490 {
1491 Thing t3 = ThingGen.Create(new string[6] { "330", "331", "334", "335", "336", "1142" }.RandomItem());
1492 ActThrow.Throw(CC, TC.pos, t3, ThrowMethod.Punish, 0.7f);
1493 }
1494 break;
1495 case EffectId.StripBlessing:
1496 {
1497 List<Condition> list10 = new List<Condition>();
1498 foreach (Condition condition4 in TC.conditions)
1499 {
1500 if (GetBlessingDifficulty(condition4) > 0 && EClass.rnd(GetBlessingDifficulty(condition4)) == 0)
1501 {
1502 list10.Add(condition4);
1503 }
1504 }
1505 if (list10.Count == 0)
1506 {
1507 CC.SayNothingHappans();
1508 break;
1509 }
1510 TC.pos.PlayEffect("holyveil");
1511 TC.pos.PlaySound("holyveil");
1512 TC.Say("unpolluted", TC);
1513 list10.Shuffle();
1514 {
1515 foreach (Condition item4 in list10)
1516 {
1517 item4.Kill();
1518 if (CC.IsHostile(TC))
1519 {
1520 break;
1521 }
1522 }
1523 break;
1524 }
1525 }
1526 case EffectId.ShutterHex:
1527 {
1528 if (!CC.IsHostile(TC))
1529 {
1530 break;
1531 }
1532 int num8 = 0;
1533 foreach (Condition condition5 in TC.conditions)
1534 {
1535 if (condition5.Type == ConditionType.Debuff)
1536 {
1537 num8++;
1538 }
1539 }
1540 if (num8 == 0)
1541 {
1542 CC.SayNothingHappans();
1543 break;
1544 }
1545 TC.pos.PlayEffect("holyveil");
1546 TC.pos.PlaySound("holyveil");
1547 TC.pos.PlaySound("atk_eleSound");
1548 TC.conditions.ForeachReverse(delegate(Condition c)
1549 {
1550 if (c.Type == ConditionType.Debuff && EClass.rnd(3) == 0)
1551 {
1552 c.Kill();
1553 }
1554 });
1555 TC.Say("abShutterHex", TC);
1556 Point center = CC.pos.Copy();
1557 List<Chara> list5 = TC.pos.ListCharasInRadius(TC, 4, (Chara c) => c == TC || c.IsHostile(CC));
1558 for (int l = 0; l < num8; l++)
1559 {
1560 TweenUtil.Delay((float)l * 0.1f, delegate
1561 {
1562 center.PlaySound("shutterhex");
1563 });
1564 foreach (Chara item5 in list5)
1565 {
1566 if (item5.ExistsOnMap)
1567 {
1568 Effect effect = Effect.Get("spell_moonspear");
1569 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
1570 Color startColor = (componentInChildren.endColor = EClass.Colors.elementColors["eleHoly"]);
1571 componentInChildren.startColor = startColor;
1572 Point pos = item5.pos.Copy();
1573 TweenUtil.Delay((float)l * 0.1f, delegate
1574 {
1575 effect.Play(center, 0f, pos);
1576 });
1577 int num9 = Dice.Create("SpShutterHex", power, CC, (actRef.refThing != null) ? null : actRef.act).Roll();
1578 item5.DamageHP(num9, 919, power, AttackSource.None, CC, showEffect: false);
1579 }
1580 }
1581 }
1582 break;
1583 }
1584 case EffectId.Draw:
1585 {
1586 if (CC.Dist(TC) <= 1 || (CC.IsPCFactionOrMinion && TC.IsPCFactionOrMinion && TC.isRestrained))
1587 {
1588 break;
1589 }
1590 Point point = CC.GetFirstStep(TC.pos, PathManager.MoveType.Combat);
1591 if (!point.IsValid)
1592 {
1593 point = CC.pos.GetRandomPoint(1)?.GetNearestPoint(allowBlock: false, allowChara: false);
1594 }
1595 if (point == null || !CC.CanSeeLos(point))
1596 {
1597 break;
1598 }
1599 CC.Say("abDraw", CC, TC);
1600 if (TC.HasCondition<ConGravity>())
1601 {
1602 CC.SayNothingHappans();
1603 break;
1604 }
1605 TC.MoveImmediate(point, !EClass.core.config.camera.smoothFollow);
1606 if (CC.id == "tentacle")
1607 {
1608 TC.AddCondition<ConEntangle>();
1609 }
1610 break;
1611 }
1612 case EffectId.CatSniff:
1613 {
1614 Chara nearbyCatToSniff = CC.GetNearbyCatToSniff();
1615 if (nearbyCatToSniff != null)
1616 {
1617 CC.Sniff(nearbyCatToSniff);
1618 }
1619 break;
1620 }
1621 case EffectId.Steal:
1622 {
1624 {
1625 break;
1626 }
1627 if (TC.Evalue(426) > 0)
1628 {
1629 TC.Say((actRef.n1 == "money") ? "abStealNegateMoney" : "abStealNegate", TC);
1630 break;
1631 }
1632 Thing thing4 = null;
1633 bool flag9 = actRef.n1 == "food";
1634 if (actRef.n1 == "money")
1635 {
1636 int currency = TC.GetCurrency();
1637 if (currency > 0)
1638 {
1639 currency = Mathf.Clamp(EClass.rnd(currency / 10), 1, 100 + EClass.rndHalf(CC.LV * 200));
1640 thing4 = ThingGen.Create("money").SetNum(currency);
1641 TC.ModCurrency(-currency);
1642 }
1643 }
1644 else
1645 {
1646 Func<Thing, bool> func = (Thing t) => true;
1647 if (flag9)
1648 {
1649 func = (Thing t) => t.IsFood;
1650 }
1651 List<Thing> list6 = TC.things.List(delegate(Thing t)
1652 {
1654 {
1655 return false;
1656 }
1657 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);
1658 }, onlyAccessible: true);
1659 if (list6.Count > 0)
1660 {
1661 thing4 = list6.RandomItem();
1662 if (thing4.Num > 1)
1663 {
1664 thing4 = thing4.Split(1);
1665 }
1666 }
1667 CC.AddCooldown(6640, 200);
1668 }
1669 if (thing4 == null)
1670 {
1671 CC.Say("abStealNothing", CC, TC);
1672 break;
1673 }
1674 thing4.SetInt(116, 1);
1675 TC.PlaySound(thing4.material.GetSoundDrop(thing4.sourceCard));
1676 CC.Pick(thing4, msg: false);
1677 CC.Say("abSteal", CC, TC, thing4.Name);
1678 if (actRef.n1 == "food")
1679 {
1680 if (CC.hunger.value != 0)
1681 {
1682 CC.InstantEat(thing4);
1683 }
1684 }
1685 else
1686 {
1687 CC.Say("abStealEscape", CC);
1688 CC.Teleport(GetTeleportPos(tc.pos, 30), silent: true);
1689 }
1690 break;
1691 }
1692 case EffectId.NeckHunt:
1693 CC.TryNeckHunt(TC, power);
1694 break;
1695 case EffectId.CurseEQ:
1696 {
1697 if (CC != null && CC != TC)
1698 {
1699 TC.Say("curse", CC, TC);
1700 }
1701 TC.PlaySound("curse3");
1702 TC.PlayEffect("curse");
1703 if (EClass.rnd(150 + TC.LUC * 5 + TC.Evalue(972) * 20) >= power + (flag ? 200 : 0) || TC.TryNullifyCurse())
1704 {
1705 break;
1706 }
1707 List<Thing> list9 = TC.things.List(delegate(Thing t)
1708 {
1709 if (!t.isEquipped || t.blessedState == BlessedState.Doomed || t.IsToolbelt)
1710 {
1711 return false;
1712 }
1713 return (t.blessedState < BlessedState.Blessed || EClass.rnd(10) == 0) ? true : false;
1714 });
1715 if (list9.Count == 0)
1716 {
1717 CC.SayNothingHappans();
1718 break;
1719 }
1720 Thing thing6 = list9.RandomItem();
1721 TC.Say("curse_hit", TC, thing6);
1722 thing6.SetBlessedState((thing6.blessedState == BlessedState.Cursed) ? BlessedState.Doomed : BlessedState.Cursed);
1723 LayerInventory.SetDirty(thing6);
1724 break;
1725 }
1726 case EffectId.UncurseEQ:
1727 case EffectId.UncurseEQGreater:
1728 {
1729 TC.Say("uncurseEQ" + (blessed ? "_bless" : (flag ? "_curse" : "")), TC);
1730 TC.PlaySound("uncurse");
1731 TC.PlayEffect("uncurse");
1732 if (flag)
1733 {
1734 Redirect(EffectId.CurseEQ, BlessedState.Normal, default(ActRef));
1735 break;
1736 }
1737 int success = 0;
1738 int fail = 0;
1739 List<Thing> list = new List<Thing>();
1740 TC.things.Foreach(delegate(Thing t)
1741 {
1742 int num13 = 0;
1743 if ((t.isEquipped || t.IsRangedWeapon || blessed) && t.blessedState < BlessedState.Normal)
1744 {
1745 if (t.blessedState == BlessedState.Cursed)
1746 {
1747 num13 = EClass.rnd(200);
1748 }
1749 if (t.blessedState == BlessedState.Doomed)
1750 {
1751 num13 = EClass.rnd(1000);
1752 }
1753 if (blessed)
1754 {
1755 num13 /= 2;
1756 }
1757 if (id == EffectId.UncurseEQGreater)
1758 {
1759 num13 /= 10;
1760 }
1761 if (power >= num13)
1762 {
1763 TC.Say("uncurseEQ_success", t);
1764 t.SetBlessedState(BlessedState.Normal);
1765 if (t.isEquipped && t.HasElement(656))
1766 {
1767 TC.body.Unequip(t);
1768 }
1770 success++;
1771 list.Add(t);
1772 }
1773 else
1774 {
1775 fail++;
1776 }
1777 }
1778 });
1779 foreach (Thing item6 in list)
1780 {
1781 item6.GetRootCard()?.TryStack(item6);
1782 }
1783 if (success == 0 && fail == 0)
1784 {
1785 TC.SayNothingHappans();
1786 }
1787 else if (fail > 0)
1788 {
1789 TC.Say("uncurseEQ_fail");
1790 }
1791 break;
1792 }
1793 case EffectId.Buff:
1794 {
1795 string text3 = actRef.n1;
1796 string text4 = "";
1797 if (flag)
1798 {
1799 text4 = EClass.sources.stats.alias[text3].curse;
1800 if (!text4.IsEmpty())
1801 {
1802 text3 = text4;
1803 }
1804 }
1805 Condition condition = Condition.Create(text3, power, delegate(Condition con)
1806 {
1807 if (!actRef.aliasEle.IsEmpty())
1808 {
1809 con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
1810 }
1811 });
1812 condition.isPerfume = TC.IsPC && actRef.isPerfume;
1813 Condition condition2 = TC.AddCondition(condition);
1814 if (condition2 != null && condition2.isPerfume)
1815 {
1816 condition2.value = 3;
1817 Msg.Say("perfume", TC);
1818 }
1819 if (!text4.IsEmpty())
1820 {
1821 CC.DoHostileAction(TC);
1822 }
1823 break;
1824 }
1825 case EffectId.KizuamiTrick:
1826 {
1827 EClass.game.religions.Trickery.Talk("ability");
1828 bool hex = CC.IsHostile(TC);
1829 List<SourceStat.Row> list7 = EClass.sources.stats.rows.Where((SourceStat.Row con) => con.tag.Contains("random") && con.group == (hex ? "Debuff" : "Buff")).ToList();
1830 int power2 = power;
1831 for (int m = 0; m < 4 + EClass.rnd(2); m++)
1832 {
1833 SourceStat.Row row2 = list7.RandomItem();
1834 list7.Remove(row2);
1835 Proc(hex ? EffectId.DebuffKizuami : EffectId.Buff, CC, TC, power2, new ActRef
1836 {
1837 n1 = row2.alias
1838 });
1839 }
1841 {
1842 EClass.Wait(0.3f, TC);
1843 }
1844 break;
1845 }
1846 case EffectId.Debuff:
1847 case EffectId.DebuffKizuami:
1848 {
1849 CC.DoHostileAction(TC);
1850 bool isPowerful = TC.IsPowerful;
1851 string n = actRef.n1;
1852 if (n == "ConSuffocation")
1853 {
1854 power = power * 2 / 3;
1855 }
1856 int a2 = power;
1857 int num10 = TC.WIL * (isPowerful ? 20 : 5);
1858 ConHolyVeil condition3 = TC.GetCondition<ConHolyVeil>();
1859 if (condition3 != null)
1860 {
1861 num10 += condition3.power * 5;
1862 }
1863 if (id != EffectId.DebuffKizuami && EClass.rnd(a2) < num10 / EClass.sources.stats.alias[n].hexPower && EClass.rnd(10) != 0)
1864 {
1865 TC.Say("debuff_resist", TC);
1866 CC.DoHostileAction(TC);
1867 break;
1868 }
1869 TC.AddCondition(Condition.Create(n, power, delegate(Condition con)
1870 {
1871 con.givenByPcParty = CC.IsPCParty;
1872 if (!actRef.aliasEle.IsEmpty())
1873 {
1874 con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
1875 }
1876 }));
1877 if (n == "ConBane" && CC.HasElement(1416))
1878 {
1879 TC.AddCondition<ConExcommunication>(power);
1880 }
1881 CC.DoHostileAction(TC);
1883 {
1884 EClass.Wait(0.3f, TC);
1885 }
1886 break;
1887 }
1888 case EffectId.Mutation:
1889 TC.MutateRandom(1, 100, ether: false, state);
1891 {
1892 EClass.Wait(0.3f, TC);
1893 }
1894 break;
1895 case EffectId.CureMutation:
1896 TC.MutateRandom(-1, 100, ether: false, state);
1897 break;
1898 case EffectId.Ally:
1899 {
1900 Msg.Say("gainAlly");
1901 Chara chara = CharaGen.CreateFromFilter("chara", cc.LV);
1902 EClass._zone.AddCard(chara, cc.pos.GetNearestPoint(allowBlock: false, allowChara: false));
1903 if (cc.IsPCFactionOrMinion)
1904 {
1905 chara.MakeAlly(msg: false);
1906 }
1907 chara.PlaySound("identify");
1908 chara.PlayEffect("teleport");
1909 break;
1910 }
1911 case EffectId.Wish:
1912 if (!TC.IsPC)
1913 {
1914 break;
1915 }
1916 if (blessed || flag)
1917 {
1918 power /= 2;
1919 }
1920 Dialog.InputName("dialogWish", "q", delegate(bool cancel, string text)
1921 {
1922 if (!cancel)
1923 {
1924 Msg.Say("wish", TC, text);
1925 Wish(text, EClass.pc.NameTitled, power, state);
1926 }
1927 });
1928 break;
1929 case EffectId.Faith:
1930 {
1932 tc.PlayEffect("aura_heaven");
1933 tc.PlaySound("aura_heaven");
1934 tc.Say("faith", tc, faith.Name);
1935 if (flag)
1936 {
1937 tc.Say("faith_curse", tc, faith.Name);
1938 break;
1939 }
1940 if (blessed)
1941 {
1942 tc.Say("faith_bless", tc, faith.Name);
1943 }
1944 tc.ModExp(306, power * 10);
1945 tc.ModExp(85, power * 10);
1946 if (tc.elements.Base(85) >= tc.elements.Value(306))
1947 {
1948 tc.elements.SetBase(85, tc.elements.Value(306));
1949 }
1950 break;
1951 }
1952 case EffectId.TransGender:
1953 {
1954 tc.PlaySound("mutation");
1955 tc.PlayEffect("mutation");
1956 int gender = tc.bio.gender;
1957 int gender2 = gender switch
1958 {
1959 1 => 2,
1960 2 => 1,
1961 _ => (EClass.rnd(2) != 0) ? 1 : 2,
1962 };
1963 if (gender != 0 && EClass.rnd(10) == 0)
1964 {
1965 gender2 = 0;
1966 }
1967 tc.bio.SetGender(gender2);
1968 tc.Say("transGender", tc, Gender.Name(tc.bio.gender));
1969 tc.Talk("tail");
1970 int age2 = tc.bio.GetAge(tc.Chara);
1971 if (blessed && age2 > 1)
1972 {
1973 tc.Say("ageDown", tc);
1974 tc.bio.SetAge(tc.Chara, age2 - 1);
1975 }
1976 else if (flag)
1977 {
1978 tc.Say("ageUp", tc);
1979 tc.bio.SetAge(tc.Chara, age2 + 1);
1980 }
1981 break;
1982 }
1983 case EffectId.Youth:
1984 {
1985 tc.PlaySound("mutation");
1986 tc.PlayEffect("mutation");
1987 int age = tc.bio.GetAge(tc.Chara);
1988 if (!flag && age <= 0)
1989 {
1990 tc.SayNothingHappans();
1991 break;
1992 }
1993 age = Mathf.Max(0, age * 100 / (flag ? 75 : (blessed ? 400 : 200))) + (flag ? 1 : 0);
1994 tc.Say(flag ? "ageUp" : "ageDown", tc);
1995 tc.bio.SetAge(tc.Chara, age);
1996 break;
1997 }
1998 case EffectId.EternalYouth:
1999 {
2000 tc.PlaySound("mutation");
2001 tc.PlayEffect("mutation");
2002 if (tc.IsUnique)
2003 {
2004 tc.SayNothingHappans();
2005 break;
2006 }
2007 int age3 = tc.bio.GetAge(tc.Chara);
2008 if (flag)
2009 {
2010 if (tc.c_lockedAge != 0)
2011 {
2012 tc.Say("eternalYouth2", tc);
2013 tc.c_lockedAge = 0;
2014 tc.elements.Remove(1243);
2015 tc.bio.SetAge(tc.Chara, age3);
2016 }
2017 Redirect(EffectId.Youth, BlessedState.Cursed, default(ActRef));
2018 }
2019 else if (tc.c_lockedAge != 0)
2020 {
2021 tc.SayNothingHappans();
2022 }
2023 else
2024 {
2025 tc.PlaySound("dropRewardXmas");
2026 tc.Say("eternalYouth1", tc);
2027 tc.c_lockedAge = age3 + 1;
2028 tc.elements.SetBase(1243, 1);
2029 if (blessed)
2030 {
2031 Redirect(EffectId.Youth, BlessedState.Blessed, default(ActRef));
2032 }
2033 }
2034 break;
2035 }
2036 case EffectId.BuffStats:
2037 case EffectId.DebuffStats:
2038 case EffectId.LulwyTrick:
2039 Debug.Log(power + "/" + id.ToString() + "/" + actRef.n1);
2040 if (id == EffectId.LulwyTrick)
2041 {
2042 EClass.game.religions.Wind.Talk("ability");
2043 }
2044 if (power < 0 || id == EffectId.DebuffStats)
2045 {
2046 power = Mathf.Abs(power);
2047 if (blessed)
2048 {
2049 power /= 4;
2050 }
2051 flag = true;
2052 }
2053 TC.AddCondition(Condition.Create(power, delegate(ConBuffStats con)
2054 {
2055 con.SetRefVal(Element.GetId(actRef.n1), (int)id);
2056 }));
2057 break;
2058 case EffectId.Revive:
2059 {
2060 List<KeyValuePair<int, Chara>> list4 = 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();
2061 if (TC.IsPCFaction || TC.IsPCFactionMinion)
2062 {
2063 if (TC.IsPC && list4.Count == 0)
2064 {
2065 list4 = 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();
2066 }
2067 if (list4.Count > 0)
2068 {
2069 list4.RandomItem().Value.Chara.GetRevived();
2070 break;
2071 }
2072 }
2073 TC.SayNothingHappans();
2074 break;
2075 }
2076 case EffectId.DamageBody:
2077 case EffectId.DamageMind:
2078 case EffectId.DamageBodyGreat:
2079 case EffectId.DamageMindGreat:
2080 case EffectId.Weaken:
2081 {
2082 bool flag7 = id == EffectId.DamageBody || id == EffectId.DamageBodyGreat;
2083 bool mind = id == EffectId.DamageMind || id == EffectId.DamageMindGreat;
2084 int num7 = ((id == EffectId.DamageBody || id == EffectId.DamageMind) ? 1 : (4 + EClass.rnd(4)));
2085 if (id == EffectId.Weaken)
2086 {
2087 flag7 = EClass.rnd(2) == 0;
2088 mind = !flag7;
2089 num7 = 1;
2090 }
2091 else
2092 {
2093 TC.PlayEffect("debuff");
2094 TC.PlaySound("debuff");
2095 }
2096 TC.Say(flag7 ? "damageBody" : "damageMind", TC);
2097 for (int k = 0; k < num7; k++)
2098 {
2099 TC.DamageTempElements(power, flag7, mind, id != EffectId.Weaken);
2100 }
2101 if (TC.IsPC)
2102 {
2103 Tutorial.Play("healer");
2104 }
2105 break;
2106 }
2107 case EffectId.EnhanceBody:
2108 case EffectId.EnhanceMind:
2109 case EffectId.EnhanceBodyGreat:
2110 case EffectId.EnhanceMindGreat:
2111 {
2112 bool flag10 = id == EffectId.EnhanceBody || id == EffectId.EnhanceBodyGreat;
2113 bool mind2 = id == EffectId.EnhanceMind || id == EffectId.EnhanceMindGreat;
2114 if (id != EffectId.EnhanceBody && id != EffectId.EnhanceMind)
2115 {
2116 EClass.rnd(4);
2117 }
2118 TC.Say(flag10 ? "enhanceBody" : "enhanceMind", TC);
2119 TC.PlayEffect("buff");
2120 TC.PlaySound("buff");
2121 TC.EnhanceTempElements(power, flag10, mind2, onlyRenew: true);
2122 break;
2123 }
2124 case EffectId.RestoreBody:
2125 case EffectId.RestoreMind:
2126 {
2127 bool flag8 = id == EffectId.RestoreBody;
2128 if (flag)
2129 {
2130 Redirect(flag8 ? EffectId.DamageBodyGreat : EffectId.DamageMindGreat, BlessedState.Normal, default(ActRef));
2131 break;
2132 }
2133 TC.Say(flag8 ? "restoreBody" : "restoreMind", TC);
2134 TC.PlaySound("heal");
2135 TC.PlayEffect("heal");
2136 TC.CureHost(flag8 ? CureType.CureBody : CureType.CureMind, power, state);
2137 if (blessed)
2138 {
2139 Redirect(flag8 ? EffectId.EnhanceBodyGreat : EffectId.EnhanceMindGreat, BlessedState.Normal, default(ActRef));
2140 }
2141 break;
2142 }
2143 case EffectId.HealComplete:
2144 TC.HealHPHost(100000000, (actRef.refThing == null) ? HealSource.Magic : HealSource.Item);
2145 TC.CureHost(CureType.HealComplete, power, state);
2146 TC.Say("heal_heavy", TC);
2147 break;
2148 case EffectId.Heal:
2149 case EffectId.JureHeal:
2150 {
2151 if (id == EffectId.JureHeal)
2152 {
2153 EClass.game.religions.Healing.Talk("ability");
2154 }
2155 if (actRef.act != null)
2156 {
2157 Debug.Log(actRef.act.id);
2158 }
2159 int num12 = 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();
2160 if (actRef.refThing != null)
2161 {
2162 num12 = num12 * (100 + actRef.refThing.Evalue(750) * 10) / 100;
2163 }
2164 if (flag)
2165 {
2166 TC.DamageHP(num12 / 2, 919, power);
2167 break;
2168 }
2169 TC.HealHPHost(num12, (actRef.refThing == null && id != EffectId.JureHeal) ? HealSource.Magic : HealSource.Item);
2170 TC.CureHost(CureType.Heal, power, state);
2171 TC.Say((power >= 300) ? "heal_heavy" : "heal_light", TC);
2172 break;
2173 }
2174 case EffectId.RemedyJure:
2175 TC.HealHP(1000000, HealSource.Magic);
2176 TC.CureHost(CureType.Jure, power, state);
2177 TC.Say("heal_jure", TC);
2178 break;
2179 case EffectId.Headpat:
2180 CC.Cuddle(TC, headpat: true);
2181 break;
2182 case EffectId.RemoveHex:
2183 case EffectId.RemoveHexAll:
2184 if (flag)
2185 {
2186 Redirect(EffectId.CurseEQ, BlessedState.Normal, default(ActRef));
2187 break;
2188 }
2189 foreach (Condition item7 in TC.conditions.Copy())
2190 {
2191 if (item7.Type == ConditionType.Debuff && !item7.IsKilled && EClass.rnd(power * (CC.IsPowerful ? 5 : 2)) > EClass.rnd(item7.power))
2192 {
2193 CC.Say("removeHex", TC, item7.Name.ToLower());
2194 item7.Kill();
2195 if (id == EffectId.RemoveHex)
2196 {
2197 break;
2198 }
2199 }
2200 }
2201 TC.AddCondition<ConHolyVeil>(power / 2);
2202 break;
2203 case EffectId.CureCorruption:
2204 TC.PlaySound("heal");
2205 TC.PlayEffect("heal");
2206 if (flag)
2207 {
2208 TC.Say("cureCorruption_curse", TC);
2209 TC.mana.Mod(9999);
2210 TC.ModCorruption(power);
2211 }
2212 else
2213 {
2214 TC.Say("cureCorruption", TC);
2215 TC.ModCorruption(-power * (blessed ? 150 : 200) / 100);
2216 }
2217 break;
2218 case EffectId.Drink:
2219 case EffectId.DrinkRamune:
2220 case EffectId.DrinkMilk:
2221 if (id == EffectId.DrinkRamune)
2222 {
2223 TC.Say("drinkRamune", TC);
2224 }
2225 if (TC.IsPC)
2226 {
2227 TC.Say("drinkGood", TC);
2228 }
2229 if (id == EffectId.DrinkMilk)
2230 {
2231 if (TC.IsPC)
2232 {
2233 TC.Say("drinkMilk", TC);
2234 }
2235 if (blessed)
2236 {
2237 TC.ModHeight(EClass.rnd(5) + 3);
2238 }
2239 else if (flag)
2240 {
2241 TC.ModHeight((EClass.rnd(5) + 3) * -1);
2242 }
2243 }
2244 break;
2245 case EffectId.DrinkWater:
2246 if (flag)
2247 {
2248 if (TC.IsPC)
2249 {
2250 TC.Say("drinkWater_dirty", TC);
2251 }
2253 }
2254 else if (TC.IsPC)
2255 {
2256 TC.Say("drinkWater_clear", TC);
2257 }
2258 break;
2259 case EffectId.DrinkWaterDirty:
2260 if (TC.IsPC)
2261 {
2262 TC.Say("drinkWater_dirty", TC);
2263 }
2264 if (TC.IsPCFaction)
2265 {
2266 TC.Vomit();
2267 }
2268 break;
2269 case EffectId.SaltWater:
2270 if (TC.HasElement(1211))
2271 {
2272 TC.Say("drinkSaltWater_snail", TC);
2273 int num11 = ((TC.hp > 10) ? (TC.hp - EClass.rnd(10)) : 10000);
2274 TC.DamageHP(num11, AttackSource.None, CC);
2275 }
2276 else if (TC.IsPC)
2277 {
2278 TC.Say("drinkSaltWater", TC);
2279 }
2280 break;
2281 case EffectId.Booze:
2282 TC.AddCondition<ConDrunk>(power);
2283 if (TC.HasElement(1215))
2284 {
2285 TC.Say("drunk_dwarf", TC);
2286 TC.AddCondition(Condition.Create(power + EClass.rnd(power), delegate(ConBuffStats con)
2287 {
2288 con.SetRefVal(Element.List_MainAttributes.RandomItem(), (int)id);
2289 }));
2290 }
2291 break;
2292 case EffectId.CatsEye:
2293 if (flag)
2294 {
2295 Redirect(EffectId.Blind, BlessedState.Normal, default(ActRef));
2296 }
2297 else
2298 {
2299 TC.AddCondition<ConNightVision>(power);
2300 }
2301 break;
2302 case EffectId.Hero:
2303 if (flag)
2304 {
2305 Redirect(EffectId.Fear, BlessedState.Normal, default(ActRef));
2306 }
2307 else
2308 {
2309 TC.AddCondition<ConHero>(power);
2310 }
2311 break;
2312 case EffectId.HolyVeil:
2313 if (flag)
2314 {
2315 Redirect(EffectId.Fear, BlessedState.Normal, default(ActRef));
2316 }
2317 else
2318 {
2319 TC.AddCondition<ConHolyVeil>(power);
2320 }
2321 break;
2322 case EffectId.Levitate:
2323 if (flag)
2324 {
2325 Redirect(EffectId.Gravity, BlessedState.Normal, default(ActRef));
2326 }
2327 else
2328 {
2329 TC.AddCondition<ConLevitate>(power);
2330 }
2331 break;
2332 case EffectId.Gravity:
2333 if (blessed)
2334 {
2335 power /= 4;
2336 }
2337 TC.AddCondition<ConGravity>(power);
2338 if (flag)
2339 {
2340 Redirect(EffectId.BuffStats, BlessedState.Cursed, new ActRef
2341 {
2342 aliasEle = "STR"
2343 });
2344 }
2345 break;
2346 case EffectId.Fear:
2347 if (blessed)
2348 {
2349 power /= 4;
2350 }
2351 TC.AddCondition<ConFear>(power);
2352 if (flag)
2353 {
2354 Redirect(EffectId.Confuse, BlessedState.Normal, default(ActRef));
2355 }
2356 break;
2357 case EffectId.Faint:
2358 if (blessed)
2359 {
2360 power /= 4;
2361 }
2362 TC.AddCondition<ConFaint>(power);
2363 if (flag)
2364 {
2365 Redirect(EffectId.Disease, BlessedState.Normal, default(ActRef));
2366 }
2367 break;
2368 case EffectId.Paralyze:
2369 if (blessed)
2370 {
2371 power /= 4;
2372 }
2373 TC.AddCondition<ConParalyze>(power);
2374 if (flag)
2375 {
2376 Redirect(EffectId.Blind, BlessedState.Normal, default(ActRef));
2377 }
2378 break;
2379 case EffectId.Poison:
2380 if (blessed)
2381 {
2382 power /= 4;
2383 }
2384 TC.AddCondition<ConPoison>(power);
2385 if (flag)
2386 {
2387 Redirect(EffectId.Paralyze, BlessedState.Normal, default(ActRef));
2388 }
2389 break;
2390 case EffectId.Sleep:
2391 if (blessed)
2392 {
2393 power /= 4;
2394 }
2395 TC.AddCondition<ConSleep>(power);
2396 if (flag)
2397 {
2398 Redirect(EffectId.Disease, BlessedState.Normal, default(ActRef));
2399 }
2400 break;
2401 case EffectId.Confuse:
2402 if (blessed)
2403 {
2404 power /= 4;
2405 }
2406 TC.AddCondition<ConConfuse>(power);
2407 if (flag)
2408 {
2409 Redirect(EffectId.Fear, BlessedState.Normal, default(ActRef));
2410 }
2411 break;
2412 case EffectId.Blind:
2413 if (blessed)
2414 {
2415 power /= 4;
2416 }
2417 TC.AddCondition<ConBlind>(power);
2418 if (flag)
2419 {
2420 Redirect(EffectId.Confuse, BlessedState.Normal, default(ActRef));
2421 }
2422 break;
2423 case EffectId.Disease:
2424 if (blessed)
2425 {
2426 power /= 4;
2427 }
2428 TC.AddCondition<ConDisease>(power);
2429 if (flag)
2430 {
2431 Redirect(EffectId.Poison, BlessedState.Normal, default(ActRef));
2432 }
2433 break;
2434 case EffectId.Acid:
2435 {
2436 if (blessed)
2437 {
2438 power /= 4;
2439 }
2440 List<Thing> list8 = TC.things.List((Thing t) => (t.Num <= 1 && t.IsEquipmentOrRanged && !t.IsToolbelt && !t.IsLightsource && t.isEquipped) ? true : false);
2441 if (list8.Count != 0)
2442 {
2443 Thing thing5 = list8.RandomItem();
2444 TC.Say("acid_hit", TC);
2445 if (thing5.isAcidproof)
2446 {
2447 TC.Say("acid_nullify", thing5);
2448 }
2449 else if (thing5.encLV > -5)
2450 {
2451 TC.Say("acid_rust", TC, thing5);
2452 thing5.ModEncLv(-1);
2453 LayerInventory.SetDirty(thing5);
2454 }
2455 if (TC.IsPCParty)
2456 {
2457 Tutorial.Reserve("rust");
2458 }
2459 }
2460 break;
2461 }
2462 case EffectId.PuddleEffect:
2463 TC.DamageHP(power / 5, actRef.idEle, power);
2464 break;
2465 case EffectId.Acidproof:
2466 if (blessed)
2467 {
2468 power /= 4;
2469 }
2470 if (TC.IsPC)
2471 {
2472 TC.Say("pc_pain");
2473 }
2474 TC.Say("drink_acid", TC);
2475 TC.DamageHP(power / 5, 923, power);
2476 break;
2477 case EffectId.LevelDown:
2478 Msg.Say("nothingHappens");
2479 break;
2480 case EffectId.Love:
2481 case EffectId.LovePlus:
2482 if (flag)
2483 {
2484 if (CC == TC)
2485 {
2486 TC.Say("love_curse_self", TC);
2487 }
2488 else
2489 {
2490 TC.Say("love_curse", CC, TC);
2491 TC.ModAffinity(CC, -power / 4, show: false);
2492 }
2493 TC.ShowEmo(Emo.angry);
2494 }
2495 else
2496 {
2497 LoveMiracle(TC, CC, power, id, state);
2498 }
2499 break;
2500 case EffectId.HairGrowth:
2501 if (flag)
2502 {
2503 if (TC.HasElement(1532))
2504 {
2505 TC.SetMutation(1532);
2506 }
2507 else
2508 {
2509 TC.SetMutation(1533, 1);
2510 }
2511 TC.c_fur = 0;
2512 break;
2513 }
2514 if (blessed)
2515 {
2516 if (TC.HasElement(1533))
2517 {
2518 TC.SetMutation(1533);
2519 }
2520 else
2521 {
2522 TC.SetMutation(1532, 1);
2523 }
2524 }
2525 TC.PlayEffect("aura_heaven");
2526 TC.PlaySound("godbless");
2527 if (!TC.HaveFur())
2528 {
2529 TC.Say("grow_hair_fail", TC);
2530 break;
2531 }
2532 TC.Say("grow_hair", TC);
2533 TC.c_fur = 100;
2534 break;
2535 case EffectId.Gene:
2536 GeneMiracle(TC, CC, blessed ? DNA.Type.Superior : (flag ? DNA.Type.Brain : DNA.Type.Default));
2537 break;
2538 }
2539 int GetBlessingDifficulty(Condition c)
2540 {
2541 if (c.Type != ConditionType.Buff)
2542 {
2543 return 0;
2544 }
2545 if (!CC.IsHostile(TC))
2546 {
2547 return 1;
2548 }
2549 if (c is ConBoost)
2550 {
2551 return 5;
2552 }
2553 if (c is ConRebirth)
2554 {
2555 return 10;
2556 }
2557 if (c is ConInvulnerable)
2558 {
2559 return 100;
2560 }
2561 return 2;
2562 }
2563 void Redirect(EffectId _id, BlessedState _state, ActRef _ref1)
2564 {
2565 Proc(_id, orgPower, _state, cc, tc, _ref1);
2566 }
2567 }
@ currency
ConditionType
Definition: ConditionType.cs:2
CureType
Definition: CureType.cs:2
Emo
Definition: Emo.cs:2
HealSource
Definition: HealSource.cs:2
IDTSource
Definition: IDTSource.cs:2
ThrowMethod
Definition: ThrowMethod.cs:2
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
static void LoveMiracle(Chara tc, Chara c, int power, EffectId idEffect=EffectId.Love, BlessedState? state=null)
Definition: ActEffect.cs:2585
static void GeneMiracle(Chara tc, Chara c, DNA.Type type)
Definition: ActEffect.cs:2617
static Point GetTeleportPos(Point org, int radius=6)
Definition: ActEffect.cs:2636
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
Definition: ActThrow.cs:97
virtual string ID
Definition: ACT.cs:99
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
void SetGender(int g)
Definition: Biography.cs:473
int GetAge(Chara c)
Definition: Biography.cs:276
void SetAge(Chara c, int a)
Definition: Biography.cs:297
int gender
Definition: Biography.cs:29
static void Set(CardBlueprint _bp=null)
GlobalCharaList globalCharas
Definition: CardManager.cs:46
int c_lockedAge
Definition: Card.cs:1353
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:5755
virtual bool isThing
Definition: Card.cs:2069
bool IsAmmo
Definition: Card.cs:2235
Thing Split(int a)
Definition: Card.cs:3414
ElementContainerCard elements
Definition: Card.cs:41
string id
Definition: Card.cs:35
bool IsUnique
Definition: Card.cs:2079
bool IsThrownWeapon
Definition: Card.cs:2233
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3022
bool isCopy
Definition: Card.cs:878
Biography bio
Definition: Card.cs:44
string Name
Definition: Card.cs:2125
bool IsRangedWeapon
Definition: Card.cs:2231
ICardParent parent
Definition: Card.cs:55
Thing SetNum(int a)
Definition: Card.cs:3425
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3825
bool isAcidproof
Definition: Card.cs:686
bool IsToolbelt
Definition: Card.cs:2157
void SetDirtyWeight()
Definition: Card.cs:2542
bool IsEquipmentOrRanged
Definition: Card.cs:2206
void TryStack(Thing t)
Definition: Card.cs:6849
int encLV
Definition: Card.cs:326
void ModEncLv(int a)
Definition: Card.cs:3776
void Destroy()
Definition: Card.cs:4996
virtual Thing Thing
Definition: Card.cs:2046
Card GetRootCard()
Definition: Card.cs:3356
int Dist(Card c)
Definition: Card.cs:7533
bool IsLightsource
Definition: Card.cs:2159
virtual bool HasHost
Definition: Card.cs:2411
BlessedState blessedState
Definition: Card.cs:278
Card Install()
Definition: Card.cs:3671
Card parentCard
Definition: Card.cs:103
DNA c_DNA
Definition: Card.cs:1881
int genLv
Definition: Card.cs:194
int Num
Definition: Card.cs:158
bool IsWeapon
Definition: Card.cs:2194
int LV
Definition: Card.cs:386
void UnqeuipIfTooHeavy(Thing t)
Definition: CharaBody.cs:165
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
Definition: CharaGen.cs:22
CharaBody body
Definition: Chara.cs:94
bool TryNeckHunt(Chara TC, int power, bool harvest=false)
Definition: Chara.cs:9393
void Cuddle(Chara c, bool headpat=false)
Definition: Chara.cs:6144
void InstantEat(Thing t=null, bool sound=true)
Definition: Chara.cs:7421
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9018
Faction faction
Definition: Chara.cs:425
Point GetFirstStep(Point newPoint, PathManager.MoveType moveType=PathManager.MoveType.Default)
Definition: Chara.cs:2549
Chara GetNearbyCatToSniff()
Definition: Chara.cs:7894
bool CanSeeLos(Card c, int dist=-1)
Definition: Chara.cs:1248
override bool IsPCParty
Definition: Chara.cs:613
Stats hunger
Definition: Chara.cs:1140
override bool HasHost
Definition: Chara.cs:686
override bool IsPCPartyMinion
Definition: Chara.cs:637
Chara Duplicate()
Definition: Chara.cs:1770
void MakeAlly(bool msg=true)
Definition: Chara.cs:2263
bool CanDuplicate()
Definition: Chara.cs:1753
void TryDropBossLoot()
Definition: Chara.cs:5512
string NameTitled
Definition: Chara.cs:514
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:8462
Religion faith
Definition: Chara.cs:437
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7545
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:4235
void Sniff(Chara c)
Definition: Chara.cs:7906
void MoveZone(string alias)
Definition: Chara.cs:3296
UD_String_Color elementColors
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:605
CameraConfig camera
Definition: CoreConfig.cs:613
CoreConfig config
Definition: Core.cs:70
Definition: DNA.cs:8
Type
Definition: DNA.cs:10
static Type GetType(string idMat)
Definition: DNA.cs:511
void Generate(Type _type, Chara model=null)
Definition: DNA.cs:267
Definition: Dialog.cs:7
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
Definition: Dialog.cs:528
static ColorProfile Colors
Definition: EClass.cs:38
static Core core
Definition: EClass.cs:6
static void Wait(float a, Card c)
Definition: EClass.cs:102
static int rndHalf(int a)
Definition: EClass.cs:87
List< Element > ListElements(Func< Element, bool > shoudList=null, Comparison< Element > comparison=null)
Dictionary< int, Element > dict
int Value(int ele)
Element ModTempPotential(int ele, int v, int threshMsg=0)
Element ModBase(int ele, int v)
Element SetBase(string alias, int v, int potential=0)
void Remove(int id)
Element GetOrCreateElement(Element ele)
int vBase
Definition: ELEMENT.cs:252
bool HasTag(string tag)
Definition: ELEMENT.cs:473
static int[] List_MainAttributes
Definition: ELEMENT.cs:240
static int GetId(string alias)
Definition: ELEMENT.cs:1119
bool IsTrait
Definition: ELEMENT.cs:362
ReligionManager religions
Definition: Game.cs:158
SpatialManager spatials
Definition: Game.cs:152
CardManager cards
Definition: Game.cs:155
bool IsSurvival
Definition: Game.cs:272
Definition: Gender.cs:2
static string Name(int g)
Definition: Gender.cs:9
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
void Reveal(Point center, int power=100)
Definition: Map.cs:918
List< Chara > charas
Definition: Map.cs:81
void RevealAll(bool reveal=true)
Definition: Map.cs:905
MapBounds bounds
Definition: Map.cs:52
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
int deepest
Definition: Player.cs:111
int deepestVoid
Definition: Player.cs:114
Stats stats
Definition: Player.cs:1013
int CountKeyItem(string alias)
Definition: Player.cs:2148
ReturnInfo returnInfo
Definition: Player.cs:863
Thing Installed
Definition: Point.cs:315
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1241
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
Definition: Point.cs:757
ReligionWind Wind
ReligionTrickery Trickery
ReligionElement Element
ReligionHealing Healing
void Talk(string idTalk, Card c=null, Card agent=null)
Definition: Religion.cs:153
SourceMaterial materials
SourceStat stats
SourceElement elements
static Dictionary< string, TierList > tierMap
static Spatial Create(string id, Spatial parent, bool register, int x=-99999, int y=-99999, int icon=0)
Definition: SpatialGen.cs:16
Zone Find(string id)
List< Zone > ListReturnLocations()
int lv
Definition: Spatial.cs:142
int visitCount
Definition: Spatial.cs:154
List< Spatial > children
Definition: Spatial.cs:37
virtual int max
Definition: Stats.cs:68
Definition: TC.cs:4
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
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:2052
static void BadEffect(Chara c)
Definition: TraitWell.cs:143
static void Reserve(string idStep, Action onBeforePlay=null)
Definition: Tutorial.cs:55
static void Play(string idStep)
Definition: Tutorial.cs:7
Definition: Zone.cs:12
virtual string GetNewZoneID(int level)
Definition: Zone.cs:544
Chara Boss
Definition: Zone.cs:83
void ModInfluence(int a)
Definition: Zone.cs:3572
virtual int MinLv
Definition: Zone.cs:278
ZoneInstance instance
Definition: Zone.cs:52
Card AddCard(Card t, Point point)
Definition: Zone.cs:1959
Definition: ActRef.cs:2
string n1
Definition: ActRef.cs:7
int idEle
Definition: ActRef.cs:19
bool isPerfume
Definition: ActRef.cs:13
string aliasEle
Definition: ActRef.cs:5

References EClass._map, EClass._zone, Zone.AddCard(), Chara.AddCondition(), Chara.AddCooldown(), armor, TraitWell.BadEffect(), ElementContainer.Base(), Card.bio, Card.blessedState, Chara.body, Zone.Boss, Map.bounds, Card.c_DNA, Card.c_lockedAge, SourceManager.calc, CoreConfig.camera, Chara.CanDuplicate(), Chara.CanSeeLos(), Game.cards, Card.ChangeMaterial(), Card.Chara, Map.charas, Spatial.children, Color, EClass.Colors, Core.config, Point.Copy(), EClass.core, Player.CountKeyItem(), Dice.Create(), Condition.Create(), ThingGen.Create(), SpatialGen.Create(), LayerDragGrid.CreateChangeMaterial(), LayerDragGrid.CreateEnchant(), CharaGen.CreateFromFilter(), LayerDragGrid.CreateIdentify(), LayerDragGrid.CreateLighten(), LayerDragGrid.CreateReconstruction(), LayerDragGrid.CreateUncurse(), Chara.Cuddle(), currency, Card.DamageHP(), EClass.debug, Debug, Player.Stats.deepest, Player.Stats.deepestVoid, Card.Destroy(), ElementContainer.dict, Card.Dist(), Chara.DoHostileAction(), Chara.Duplicate(), ReligionManager.Element, ColorProfile.elementColors, Card.elements, SourceManager.elements, CoreDebug.enable, Card.encLV, Point.Equals(), Card.ExistsOnMap, Chara.faction, Chara.faith, faith, SpatialManager.Find(), CoreConfig.game, EClass.game, Biography.gender, DNA.Generate(), Card.genLv, Effect.Get(), Biography.GetAge(), Chara.GetFirstStep(), Element.GetId(), Chara.GetNearbyCatToSniff(), Point.GetNearestPoint(), Zone.GetNewZoneID(), ElementContainer.GetOrCreateElement(), Point.GetRandomPoint(), Card.GetRootCard(), DNA.GetType(), CardManager.globalCharas, Card.HasElement(), Card.HasHost, Chara.HasHost, Element.HasTag(), ReligionManager.Healing, Chara.hunger, Card.id, Element.id, Thing.Identify(), if(), Dialog.InputName(), Card.Install(), Point.Installed, Zone.instance, Chara.InstantEat(), Card.isAcidproof, Card.IsAmmo, Card.isCopy, Card.IsEquipmentOrRanged, Thing.isEquipped, Chara.IsHostile(), Condition.IsKilled, Card.IsLightsource, Card.IsPC, Chara.IsPC, Chara.IsPCFaction, Zone.IsPCFaction, Card.IsPCFactionOrMinion, Card.IsPCParty, Chara.IsPCParty, Chara.IsPCPartyMinion, BaseCondition.isPerfume, Card.IsRangedWeapon, Game.IsSurvival, Card.isThing, Card.IsThrownWeapon, Card.IsToolbelt, Element.IsTrait, Card.IsUnique, Point.IsValid, Card.IsWeapon, item, Condition.Kill(), Element.List_MainAttributes, ElementContainer.ListElements(), SpatialManager.ListReturnLocations(), Card.LV, Spatial.lv, Chara.MakeAlly(), Chara.mana, Card.material, SourceManager.materials, Stats.max, Zone.MinLv, Stats.Mod(), ElementContainer.ModBase(), Card.ModEncLv(), Card.ModExp(), Zone.ModInfluence(), ElementContainer.ModTempPotential(), Chara.MoveZone(), BaseCondition.Name, Card.Name, Gender.Name(), Chara.NameTitled, Card.Num, Card.parent, Card.parentCard, EClass.pc, Chara.Pick(), Effect.Play(), Tutorial.Play(), Card.PlayEffect(), EClass.player, Point.PlaySound(), Card.PlaySound(), Card.pos, BaseCondition.power, Game.religions, ElementContainer.Remove(), Tutorial.Reserve(), Player.returnInfo, Map.Reveal(), Map.RevealAll(), EClass.rnd(), EClass.rndHalf(), Dice.Roll(), Msg.Say(), Card.Say(), Card.SayNothingHappans(), Msg.SayNothingHappen(), SourceMaterial.Tier.Select(), CardBlueprint.Set(), Biography.SetAge(), ElementContainer.SetBase(), Card.SetBlessedState(), LayerInventory.SetDirty(), Card.SetDirtyWeight(), BaseCondition.SetElement(), Biography.SetGender(), BaseCard.SetInt(), Card.SetNum(), BaseCondition.SetRefVal(), CoreConfig.CameraConfig.smoothFollow, Chara.Sniff(), Thing.source, Thing.sourceCard, EClass.sources, Game.spatials, Card.Split(), Player.stats, SourceManager.stats, Religion.Talk(), Card.Talk(), Card.Teleport(), Card.Thing, ActThrow.Throw(), SourceMaterial.tierMap, SourceMaterial.TierList.tiers, Card.trait, ReligionManager.Trickery, Chara.TryDropBossLoot(), Chara.TryEquip(), Chara.TryNeckHunt(), Card.TryStack(), BaseStats.Type, CharaBody.UnqeuipIfTooHeavy(), ElementContainer.Value(), Stats.value, Element.vBase, Spatial.visitCount, EClass.Wait(), CoreConfig.GameConfig.waitOnDebuff, MapBounds.Width, ReligionManager.Wind, and Wish.

◆ ProcAt()

static void ActEffect.ProcAt ( EffectId  id,
int  power,
BlessedState  state,
Card  cc,
Card  tc,
Point  tp,
bool  isNeg,
ActRef  actRef = default(ActRef) 
)
inlinestatic

Definition at line 440 of file ActEffect.cs.

441 {
442 Chara CC = cc.Chara;
443 bool flag = state <= BlessedState.Cursed;
444 bool flag2 = isNeg || flag;
445 Element element = Element.Create(actRef.aliasEle.IsEmpty("eleFire"), power / 10);
447 {
448 angle += 5;
449 if (angle > 100)
450 {
451 angle = 30;
452 }
453 Debug.Log(angle);
454 }
455 switch (id)
456 {
457 case EffectId.Earthquake:
458 {
459 List<Point> list = EClass._map.ListPointsInCircle(CC.pos, 12f, mustBeWalkable: false);
460 if (list.Count == 0)
461 {
462 list.Add(CC.pos.Copy());
463 }
464 CC.Say("spell_earthquake", CC, element.Name.ToLower());
465 TryDelay(delegate
466 {
467 CC.PlaySound("spell_earthquake");
468 });
469 if (CC.IsInMutterDistance())
470 {
471 Shaker.ShakeCam("ball");
472 }
473 EClass.Wait(1f, CC);
474 DamageEle(CC, id, power, element, list, actRef, "spell_earthquake");
475 break;
476 }
477 case EffectId.Meteor:
478 {
479 EffectMeteor.Create(cc.pos, 6, 10, delegate
480 {
481 });
482 List<Point> list3 = EClass._map.ListPointsInCircle(CC.pos, 10f);
483 if (list3.Count == 0)
484 {
485 list3.Add(CC.pos.Copy());
486 }
487 CC.Say("spell_ball", CC, element.Name.ToLower());
488 TryDelay(delegate
489 {
490 CC.PlaySound("spell_ball");
491 });
492 if (CC.IsInMutterDistance())
493 {
494 Shaker.ShakeCam("ball");
495 }
496 EClass.Wait(1f, CC);
497 DamageEle(CC, id, power, element, list3, actRef, "spell_ball");
498 return;
499 }
500 case EffectId.Hand:
501 case EffectId.DrainBlood:
502 case EffectId.DrainMana:
503 case EffectId.Sword:
504 {
505 List<Point> list2 = new List<Point>();
506 list2.Add(tp.Copy());
507 EClass.Wait(0.3f, CC);
508 TryDelay(delegate
509 {
510 CC.PlaySound("spell_hand");
511 });
512 if (!DamageEle(CC, id, power, element, list2, actRef, (id == EffectId.DrainBlood || id == EffectId.DrainMana) ? "" : ((id == EffectId.Sword) ? "spell_sword" : "spell_hand")))
513 {
514 CC.Say("spell_hand_miss", CC, element.Name.ToLower());
515 }
516 return;
517 }
518 case EffectId.Arrow:
519 case EffectId.MoonSpear:
520 case EffectId.MoonArrow:
521 {
522 List<Point> list7 = new List<Point>();
523 list7.Add(tp.Copy());
524 CC.Say((id == EffectId.MoonSpear) ? "spell_spear" : "spell_arrow", CC, element.Name.ToLower());
525 EClass.Wait(0.5f, CC);
526 TryDelay(delegate
527 {
528 CC.PlaySound((id == EffectId.MoonSpear) ? "spell_moonspear" : "spell_arrow");
529 });
530 DamageEle(CC, id, power, element, list7, actRef, (id == EffectId.MoonSpear) ? "spell_spear" : "spell_arrow");
531 return;
532 }
533 case EffectId.Summon:
534 {
535 if (actRef.n1 == "special")
536 {
537 SE.Play("warhorn");
538 Msg.Say("warhorn");
539 }
540 CC.Say("summon_ally", CC);
541 if (EClass._zone.CountMinions(CC) >= CC.MaxSummon || CC.c_uidMaster != 0)
542 {
543 CC.Say("summon_ally_fail", CC);
544 return;
545 }
546 string id3 = actRef.n1;
547 int num3 = 1;
548 int num4 = -1;
549 int radius2 = 3;
550 bool flag4 = false;
551 bool flag5 = actRef.n1 == "special";
552 int num5 = -1;
553 string text = "";
554 switch (actRef.n1)
555 {
556 case "shadow":
557 case "tsunami":
558 num3 = Mathf.Clamp(power / 100, 1, 5) + ((power >= 100) ? EClass.rnd(2) : 0);
559 break;
560 case "monster":
561 case "fire":
562 case "animal":
563 num3 = 1 + EClass.rnd(2);
564 break;
565 case "special_force":
566 id3 = "army_palmia";
567 num3 = 4 + EClass.rnd(2);
568 num5 = EClass._zone.DangerLv;
569 break;
570 case "tentacle":
571 num4 = 20 + EClass.rnd(10);
572 radius2 = 1;
573 break;
574 case "special":
575 CC.SetInt(70, EClass.world.date.GetRaw() + 1440);
576 num3 = Mathf.Clamp(7 + CC.LV / 100, 4, 20);
577 num5 = CC.LV;
578 break;
579 }
580 num3 += CC.Evalue(1240);
581 for (int j = 0; j < num3; j++)
582 {
583 if (EClass._zone.CountMinions(CC) >= CC.MaxSummon)
584 {
585 break;
586 }
587 Point point = tp.GetRandomPoint(radius2)?.GetNearestPoint(allowBlock: false, allowChara: false);
588 if (point == null || !point.IsValid)
589 {
590 continue;
591 }
592 Chara chara2 = null;
594 if (num5 != -1)
595 {
596 CardBlueprint.current.lv = num5;
597 }
598 if (!text.IsEmpty())
599 {
600 CardBlueprint.current.idEle = text;
601 }
602 switch (actRef.n1)
603 {
604 case "special":
605 if (j == 0 && !CC.HasMinion("imolonac") && !CC.HasMinion("ygolonac"))
606 {
607 chara2 = CharaGen.Create((EClass.rnd(20) == 0) ? "imolonac" : "ygolonac");
608 break;
609 }
611 chara2 = CharaGen.Create("hound", CC.LV);
612 if (text.IsEmpty())
613 {
614 text = chara2.MainElement.source.alias;
615 }
616 break;
617 case "yeek":
618 chara2 = CharaGen.CreateFromFilter(SpawnListChara.Get("summon_yeek", (SourceChara.Row r) => r.race == "yeek"), power / 10);
619 break;
620 case "orc":
621 chara2 = CharaGen.CreateFromFilter(SpawnListChara.Get("summon_orc", (SourceChara.Row r) => r.race == "orc"), power / 10);
622 break;
623 case "dragon":
624 chara2 = CharaGen.CreateFromFilter(SpawnListChara.Get("summon_dragon", (SourceChara.Row r) => r.race == "dragon" || r.race == "drake" || r.race == "wyvern"), power / 5);
625 break;
626 case "pawn":
627 chara2 = CharaGen.CreateFromFilter("c_pawn", power / 10);
628 break;
629 case "machine":
630 chara2 = CharaGen.CreateFromFilter("c_machine", power / 10);
631 break;
632 case "monster":
633 chara2 = CharaGen.CreateFromFilter("c_dungeon", power / 10);
634 break;
635 case "animal":
636 chara2 = CharaGen.CreateFromFilter("c_animal", power / 15);
637 break;
638 case "fire":
639 chara2 = CharaGen.CreateFromElement("Fire", power / 10);
640 break;
641 case "fish":
642 chara2 = CharaGen.CreateFromFilter(SpawnListChara.Get("summon_fish", (SourceChara.Row r) => r.ContainsTag("water") || r.model.Chara.race.tag.Contains("water")), power / 10);
643 break;
644 case "octopus":
645 chara2 = CharaGen.CreateFromFilter(SpawnListChara.Get("summon_octopus", (SourceChara.Row r) => r.race == "octopus"), power / 10);
646 break;
647 default:
648 chara2 = CharaGen.Create(id3, power / 10);
649 break;
650 }
651 if (chara2 == null)
652 {
653 continue;
654 }
655 if (chara2.rarity >= Rarity.Legendary && !flag5)
656 {
657 j--;
658 continue;
659 }
660 int num6 = -1;
661 string n = actRef.n1;
662 if (!(n == "shadow"))
663 {
664 if (!(n == "special"))
665 {
666 int num7 = 1;
667 if (!CC.IsPC)
668 {
669 num7 = (CC.IsPCFactionOrMinion ? (CC.LV / 2) : (CC.LV / 3 * 2));
670 }
671 num6 = chara2.LV * (100 + power / 10) / 100 + power / 30;
672 if (num6 < num7)
673 {
674 num6 = num7;
675 }
676 }
677 }
678 else
679 {
680 num6 = power / 10 + 1;
681 }
682 if (chara2.LV < num6)
683 {
684 chara2.SetLv(num6);
685 }
686 chara2.interest = 0;
687 if (chara2.HaveFur())
688 {
689 chara2.c_fur = -1;
690 }
691 n = actRef.n1;
692 if (!(n == "shadow"))
693 {
694 if (n == "special_force")
695 {
696 chara2.homeZone = EClass._zone;
697 }
698 }
699 else
700 {
701 chara2.hp = chara2.MaxHP / 2;
702 }
703 EClass._zone.AddCard(chara2, point);
704 if (flag)
705 {
706 Chara chara3 = chara2;
707 Hostility hostility2 = (chara2.c_originalHostility = Hostility.Enemy);
708 chara3.hostility = hostility2;
709 }
710 else if (!(actRef.n1 == "monster") || actRef.refThing == null)
711 {
712 chara2.MakeMinion(CC);
713 }
714 if (num4 != -1)
715 {
716 chara2.SetSummon(num4);
717 }
718 flag4 = true;
719 }
720 if (!flag4)
721 {
722 CC.Say("summon_ally_fail", CC);
723 }
724 return;
725 }
726 case EffectId.Funnel:
727 case EffectId.Bit:
728 {
729 if (EClass._zone.CountMinions(CC) >= CC.MaxSummon || CC.c_uidMaster != 0)
730 {
731 CC.Say("summon_ally_fail", CC);
732 return;
733 }
734 CC.Say("spell_funnel", CC, element.Name.ToLower());
735 CC.PlaySound("spell_funnel");
736 Chara chara = CharaGen.Create((id == EffectId.Bit) ? "bit2" : "bit");
737 chara.SetMainElement(element.source.alias, element.Value, elemental: true);
738 chara.SetSummon(20 + power / 20 + EClass.rnd(10));
739 chara.SetLv(power / 15);
740 chara.interest = 0;
741 EClass._zone.AddCard(chara, tp.GetNearestPoint(allowBlock: false, allowChara: false));
742 chara.PlayEffect("teleport");
743 chara.MakeMinion(CC);
744 return;
745 }
746 case EffectId.Breathe:
747 {
748 List<Point> list4 = EClass._map.ListPointsInArc(CC.pos, tp, 7, 35f);
749 if (list4.Count == 0)
750 {
751 list4.Add(CC.pos.Copy());
752 }
753 CC.Say("spell_breathe", CC, element.Name.ToLower());
754 EClass.Wait(0.8f, CC);
755 TryDelay(delegate
756 {
757 CC.PlaySound("spell_breathe");
758 });
760 {
761 Shaker.ShakeCam("breathe");
762 }
763 DamageEle(CC, id, power, element, list4, actRef, "spell_breathe");
764 return;
765 }
766 case EffectId.Scream:
767 CC.PlaySound("scream");
768 CC.PlayEffect("scream");
769 {
770 foreach (Point item in EClass._map.ListPointsInCircle(cc.pos, 6f, mustBeWalkable: false, los: false))
771 {
772 foreach (Chara chara4 in item.Charas)
773 {
774 if (chara4.ResistLv(957) <= 0)
775 {
776 chara4.AddCondition<ConParalyze>(power);
777 }
778 }
779 }
780 return;
781 }
782 case EffectId.Ball:
783 case EffectId.Explosive:
784 case EffectId.BallBubble:
785 case EffectId.Suicide:
786 case EffectId.Rocket:
787 case EffectId.Flare:
788 {
789 float radius = ((id == EffectId.Rocket) ? 2.8f : ((id == EffectId.Suicide) ? 3.5f : ((id == EffectId.Flare) ? 2.1f : ((float)((id == EffectId.BallBubble) ? 2 : 5)))));
790 if ((id == EffectId.Explosive || id == EffectId.Rocket) && actRef.refThing != null)
791 {
792 radius = 2 + actRef.refThing.Evalue(666);
793 }
794 if (id == EffectId.Suicide)
795 {
796 if (CC.MainElement != Element.Void)
797 {
798 element = CC.MainElement;
799 }
801 {
802 element = Element.Create(919, 10);
803 }
804 if (CC.HasTag(CTAG.kamikaze))
805 {
806 radius = 1.5f;
807 }
808 }
809 bool flag3 = id == EffectId.Explosive || id == EffectId.Suicide || id == EffectId.Rocket;
810 List<Point> list6 = EClass._map.ListPointsInCircle((id == EffectId.Rocket || id == EffectId.Flare) ? tp : cc.pos, radius, !flag3, !flag3);
811 if (list6.Count == 0)
812 {
813 list6.Add(cc.pos.Copy());
814 }
815 cc.Say((id == EffectId.Suicide) ? "abSuicide" : "spell_ball", cc, element.Name.ToLower());
816 EClass.Wait(0.8f, cc);
817 TryDelay(delegate
818 {
819 if (id == EffectId.Flare)
820 {
821 tp.PlayEffect("flare");
822 }
823 cc.PlaySound((id == EffectId.Flare) ? "spell_flare" : "spell_ball");
824 });
826 {
827 Shaker.ShakeCam("ball");
828 }
829 DamageEle(actRef.origin ?? cc, id, power, element, list6, actRef, (id == EffectId.Suicide) ? "suicide" : "spell_ball");
830 if (id == EffectId.Suicide && CC.IsAliveInCurrentZone)
831 {
832 CC.Die();
833 }
834 return;
835 }
836 case EffectId.Bolt:
837 {
838 List<Point> list5 = EClass._map.ListPointsInLine(CC.pos, tp, 10);
839 if (list5.Count == 0)
840 {
841 list5.Add(CC.pos.Copy());
842 }
843 CC.Say("spell_bolt", CC, element.Name.ToLower());
844 EClass.Wait(0.8f, CC);
845 TryDelay(delegate
846 {
847 CC.PlaySound("spell_bolt");
848 });
850 {
851 Shaker.ShakeCam("bolt");
852 }
853 DamageEle(CC, id, power, element, list5, actRef, "spell_bolt");
854 return;
855 }
856 case EffectId.Bubble:
857 case EffectId.Web:
858 case EffectId.MistOfDarkness:
859 case EffectId.Puddle:
860 {
861 if (LangGame.Has("ab" + id))
862 {
863 CC.Say("ab" + id, CC);
864 }
865 tp.PlaySound("vomit");
866 int num = 2 + EClass.rnd(3);
867 int id2 = ((id == EffectId.Puddle) ? 4 : ((id == EffectId.Bubble) ? 5 : ((id == EffectId.MistOfDarkness) ? 6 : 7)));
868 EffectId idEffect = ((id == EffectId.Bubble) ? EffectId.BallBubble : EffectId.PuddleEffect);
869 Color matColor = EClass.Colors.elementColors.TryGetValue(element.source.alias);
870 if (id == EffectId.Bubble && CC.id == "cancer")
871 {
872 idEffect = EffectId.Nothing;
873 num = 1 + EClass.rnd(3);
874 }
875 for (int i = 0; i < num; i++)
876 {
877 Point randomPoint = tp.GetRandomPoint(2);
878 if (randomPoint != null && !randomPoint.HasBlock && (id != EffectId.Puddle || !randomPoint.cell.IsTopWaterAndNoSnow))
879 {
880 int num2 = 4 + EClass.rnd(5);
881 if (id == EffectId.Web)
882 {
883 num2 *= 3;
884 }
885 EClass._map.SetEffect(randomPoint.x, randomPoint.z, new CellEffect
886 {
887 id = id2,
888 amount = num2,
889 idEffect = idEffect,
890 idEle = element.id,
891 power = power,
892 isHostileAct = CC.IsPCParty,
893 color = BaseTileMap.GetColorInt(ref matColor, 100)
894 });
895 }
896 }
897 return;
898 }
899 }
900 List<Card> list8 = tp.ListCards().ToList();
901 list8.Reverse();
902 if (list8.Contains(CC))
903 {
904 list8.Remove(CC);
905 list8.Insert(0, CC);
906 }
907 bool flag6 = true;
908 foreach (Card item2 in list8)
909 {
910 if (tc == null || item2 == tc)
911 {
912 Proc(id, power, state, CC, item2, actRef);
913 if (flag2 && item2.isChara && item2 != CC)
914 {
915 CC.DoHostileAction(item2);
916 }
917 if (actRef.refThing == null || !(actRef.refThing.trait is TraitRod))
918 {
919 return;
920 }
921 EffectId effectId = id;
922 if ((uint)(effectId - 200) <= 4u)
923 {
924 return;
925 }
926 flag6 = false;
927 }
928 }
929 if (flag6)
930 {
932 }
933 }
Hostility
Definition: Hostility.cs:2
Rarity
Definition: Rarity.cs:2
static int angle
Definition: ActEffect.cs:21
static bool DamageEle(Card CC, EffectId id, int power, Element e, List< Point > points, ActRef actref, string lang=null)
Definition: ActEffect.cs:36
static int GetColorInt(ref Color matColor, int p)
static CardBlueprint current
int c_uidMaster
Definition: Card.cs:1449
Card SetLv(int a)
Definition: Card.cs:2885
Rarity rarity
Definition: Card.cs:314
bool IsInMutterDistance(int d=10)
Definition: Card.cs:7577
bool HaveFur()
Definition: Card.cs:7738
int ResistLv(int res)
Definition: Card.cs:5811
bool IsTopWaterAndNoSnow
Definition: Cell.cs:712
static Chara CreateFromElement(string idEle, int lv=-1, string idFilter="chara")
Definition: CharaGen.cs:32
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Element MainElement
Definition: Chara.cs:715
bool HasCondition(string alias)
Definition: Chara.cs:9175
void SetMainElement(string id, int v=0, bool elemental=false)
Definition: Chara.cs:2062
bool HasMinion(string id)
Definition: Chara.cs:2328
int MaxSummon
Definition: Chara.cs:712
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2317
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
Definition: Chara.cs:5209
void SetSummon(int duration)
Definition: Chara.cs:2357
GraphicSetting graphic
Definition: CoreConfig.cs:603
int GetRaw(int offsetHours=0)
Definition: Date.cs:322
static World world
Definition: EClass.cs:40
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
static Element Void
Definition: ELEMENT.cs:238
static bool Has(string id)
Definition: LangGame.cs:46
List< Point > ListPointsInArc(Point center, Point to, int radius, float angle)
Definition: Map.cs:2309
List< Point > ListPointsInLine(Point center, Point to, int radius)
Definition: Map.cs:2326
void SetEffect(int x, int z, CellEffect effect=null)
Definition: Map.cs:1508
List< Point > ListPointsInCircle(Point center, float radius, bool mustBeWalkable=true, bool los=true)
Definition: Map.cs:2278
int z
Definition: Point.cs:39
Definition: Shaker.cs:5
static void ShakeCam(string id="default", float magnitude=1f)
Definition: Shaker.cs:25
static SpawnList Get(string id, Func< SourceChara.Row, bool > func)
bool TryGetValue(TKey key, out TValue value)
Definition: UDictionary.cs:178
GameDate date
Definition: World.cs:6
int CountMinions(Chara c)
Definition: Zone.cs:3691
override int DangerLv
Definition: Zone.cs:107
Chara origin
Definition: ActRef.cs:11

References EClass._map, EClass._zone, Zone.AddCard(), Chara.AddCondition(), angle, Card.c_uidMaster, Point.cell, Card.Chara, Color, EClass.Colors, Core.config, Point.Copy(), EClass.core, Zone.CountMinions(), Element.Create(), EffectMeteor.Create(), CharaGen.Create(), CharaGen.CreateFromElement(), CharaGen.CreateFromFilter(), CardBlueprint.current, DamageEle(), Zone.DangerLv, World.date, EClass.debug, Debug, Chara.Die(), CoreConfig.GraphicSetting.disableShake, ColorProfile.elementColors, CoreDebug.enable, Card.Evalue(), SpawnListChara.Get(), BaseTileMap.GetColorInt(), Point.GetNearestPoint(), Point.GetRandomPoint(), Date.GetRaw(), CoreConfig.graphic, LangGame.Has(), Point.HasBlock, Chara.HasCondition(), Chara.HasMinion(), Card.HasTag(), Card.HaveFur(), Card.id, Element.id, CardBlueprint.idEle, Chara.IsAliveInCurrentZone, Card.IsInMutterDistance(), Chara.IsPC, Chara.IsPCParty, EInput.isShiftDown, Cell.IsTopWaterAndNoSnow, Point.IsValid, item, Map.ListPointsInArc(), Map.ListPointsInCircle(), Map.ListPointsInLine(), Card.LV, Chara.MainElement, Chara.MakeMinion(), Chara.MaxSummon, Element.Name, Card.PlayEffect(), Point.PlaySound(), Card.PlaySound(), Card.pos, Card.rarity, Card.ResistLv(), EClass.rnd(), Msg.Say(), Card.Say(), CardBlueprint.Set(), Map.SetEffect(), BaseCard.SetInt(), Card.SetLv(), Chara.SetMainElement(), Chara.SetSummon(), Shaker.ShakeCam(), Element.source, TryDelay(), UDictionary< TKey, TValue >.TryGetValue(), Element.Value, Element.Void, EClass.Wait(), EClass.world, Point.x, and Point.z.

Referenced by DamageEle(), Chara.Die(), Card.Explode(), ZoneEventDefenseGame.Horn_Ally(), TraitScrollStatic.OnRead(), Act.Perform(), ActMissileBarrage.Perform(), ActRanged.Perform(), ActZap.Perform(), AttackProcess.ProcAbility(), and AI_UseCrafter.Run().

◆ TryDelay()

static void ActEffect.TryDelay ( Action  a)
inlinestatic

Definition at line 23 of file ActEffect.cs.

24 {
25 if (RapidCount == 0)
26 {
27 a();
28 return;
29 }
30 TweenUtil.Delay((float)RapidCount * RapidDelay, delegate
31 {
32 a();
33 });
34 }
static float RapidDelay
Definition: ActEffect.cs:19

References RapidCount, and RapidDelay.

Referenced by DamageEle(), Card.DamageHP(), and ProcAt().

◆ Wish()

static bool ActEffect.Wish ( string  s,
string  name,
int  power,
BlessedState  state 
)
inlinestatic

Definition at line 2652 of file ActEffect.cs.

2653 {
2655 string netMsg = GameLang.Parse("wish".langGame(), thirdPerson: true, name, s);
2656 bool net = EClass.core.config.net.enable && EClass.core.config.net.sendEvent;
2657 List<WishItem> list = new List<WishItem>();
2658 int wishLv = 10 + power / 4;
2659 int wishValue = 5000 + power * 50;
2660 if (state >= BlessedState.Blessed)
2661 {
2662 wishLv = wishLv * 150 / 100;
2663 }
2664 else if (state <= BlessedState.Cursed)
2665 {
2666 wishLv = wishLv * 150 / 100;
2667 wishValue = 1;
2668 }
2669 Debug.Log(power + "/" + wishValue);
2670 string _s = s.ToLower();
2671 foreach (CardRow r in EClass.sources.cards.rows)
2672 {
2673 if (r.HasTag(CTAG.godArtifact))
2674 {
2675 bool flag = false;
2676 foreach (Religion item in EClass.game.religions.list)
2677 {
2678 if (item.IsValidArtifact(r.id))
2679 {
2680 flag = true;
2681 }
2682 }
2683 if (!flag)
2684 {
2685 continue;
2686 }
2687 }
2688 else if (r.quality >= 4 || r.HasTag(CTAG.noWish))
2689 {
2690 switch (r.id)
2691 {
2692 case "medal":
2693 case "plat":
2694 case "money":
2695 case "money2":
2696 break;
2697 default:
2698 continue;
2699 }
2700 }
2701 if (r.isChara)
2702 {
2703 continue;
2704 }
2705 string text = r.GetName().ToLower();
2706 int score = Compare(_s, text);
2707 if (score == 0)
2708 {
2709 continue;
2710 }
2711 list.Add(new WishItem
2712 {
2713 score = score,
2714 n = text,
2715 action = delegate
2716 {
2717 Debug.Log(r.id);
2718 SourceCategory.Row category = EClass.sources.cards.map[r.id].Category;
2719 if (category.IsChildOf("weapon") || category.IsChildOf("armor") || category.IsChildOf("ranged"))
2720 {
2721 CardBlueprint.SetRarity(Rarity.Legendary);
2722 }
2723 Thing thing = ThingGen.Create(r.id, -1, wishLv);
2724 int num = 1;
2725 int price = thing.GetPrice(CurrencyType.Money, sell: false, PriceType.Tourism);
2726 bool flag2 = thing.trait is TraitDeed || thing.rarity >= Rarity.Artifact || thing.source._origin == "artifact_summon";
2727 switch (thing.id)
2728 {
2729 case "rod_wish":
2730 thing.c_charges = 0;
2731 break;
2732 case "money":
2733 num = EClass.rndHalf(wishValue * 3);
2734 break;
2735 case "plat":
2736 num = EClass.rndHalf(wishValue / 500 + 4);
2737 break;
2738 case "money2":
2739 num = EClass.rndHalf(wishValue / 500 + 4);
2740 break;
2741 case "medal":
2742 num = EClass.rndHalf(wishValue / 2000 + 4);
2743 break;
2744 default:
2745 if (!flag2 && thing.trait.CanStack)
2746 {
2747 int num2 = wishValue;
2748 num2 -= price;
2749 for (int i = 1; i < 1000; i++)
2750 {
2751 int num3 = price + i * 2 * (price + 500);
2752 if (num3 > 0 && num2 > num3)
2753 {
2754 num++;
2755 num2 -= num3;
2756 }
2757 }
2758 }
2759 break;
2760 }
2761 if (price > 2500 && num > 3)
2762 {
2763 num = 3 + (int)Mathf.Sqrt(num - 3);
2764 }
2765 if (price > 5000 && num > 2)
2766 {
2767 num = 2 + (int)Mathf.Sqrt(num - 2) / 2;
2768 }
2769 if (price > 10000 && num > 1)
2770 {
2771 num = 1 + Mathf.Min((int)Mathf.Sqrt(num - 1) / 3, 2);
2772 }
2773 if (num < 1)
2774 {
2775 num = 1;
2776 }
2777 thing.SetNum(num);
2778 Debug.Log(_s + "/" + num + "/" + score);
2779 if (thing.HasTag(CTAG.godArtifact))
2780 {
2781 Religion.Reforge(thing.id);
2782 }
2783 else
2784 {
2785 EClass._zone.AddCard(thing, EClass.pc.pos);
2786 }
2787 netMsg = netMsg + Lang.space + GameLang.Parse("wishNet".langGame(), Msg.IsThirdPerson(thing), Msg.GetName(thing).ToTitleCase());
2788 if (net)
2789 {
2790 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
2791 }
2792 Msg.Say("dropReward");
2793 }
2794 });
2795 }
2796 if (list.Count == 0)
2797 {
2798 netMsg = netMsg + Lang.space + "wishFail".langGame();
2799 if (net)
2800 {
2801 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
2802 }
2803 Msg.Say("wishFail");
2804 return false;
2805 }
2806 list.Sort((WishItem a, WishItem b) => b.score - a.score);
2807 foreach (WishItem item2 in list)
2808 {
2809 Debug.Log(item2.score + "/" + s + "/" + item2.n);
2810 }
2811 list[0].action();
2812 return true;
2813 }
ChatCategory
Definition: ChatCategory.cs:2
CurrencyType
Definition: CurrencyType.cs:2
PriceType
Definition: PriceType.cs:2
static int Compare(string s, string t)
Definition: ActEffect.cs:2815
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
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:7142
NetSetting net
Definition: CoreConfig.cs:607
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
Definition: GameLang.cs:141
static string langCode
Definition: Lang.cs:28
static bool IsThirdPerson(Card c)
Definition: Msg.cs:291
static ThirstPersonInfo thirdPerson1
Definition: Msg.cs:6
static string GetName(Card c)
Definition: Msg.cs:274
Definition: Net.cs:11
static async UniTask< bool > SendChat(string name, string msg, ChatCategory cat, string idLang)
Definition: Net.cs:318
List< Religion > list
static Thing Reforge(string id, Point pos=null, bool first=true)
Definition: Religion.cs:279
bool HasTag(CTAG _tag)
Definition: RenderRow.cs:125
List< CardRow > rows
Definition: SourceCard.cs:6
Dictionary< string, CardRow > map
Definition: SourceCard.cs:8
SourceCard cards
void Set(string n)
virtual SourceElement.Row source
Definition: TraitScroll.cs:5

References EClass._zone, Zone.AddCard(), SourceManager.cards, Core.config, EClass.core, ThingGen.Create(), Debug, EClass.game, Msg.GetName(), CardRow.GetName(), Card.GetPrice(), RenderRow.HasTag(), CardRow.id, if(), CardRow.isChara, Msg.IsThirdPerson(), item, Lang.langCode, ReligionManager.list, SourceCard.map, CoreConfig.net, GameLang.Parse(), EClass.pc, Card.pos, CardRow.quality, Religion.Reforge(), Game.religions, SourceCard.rows, Msg.Say(), Net.SendChat(), CoreConfig.NetSetting.sendEvent, ThirstPersonInfo.Set(), TraitScroll.source, EClass.sources, and Msg.thirdPerson1.

Member Data Documentation

◆ angle

int ActEffect.angle = 20
static

Definition at line 21 of file ActEffect.cs.

Referenced by ProcAt().

◆ RapidCount

int ActEffect.RapidCount
static

Definition at line 17 of file ActEffect.cs.

Referenced by DamageEle(), ActMissileBarrage.Perform(), and TryDelay().

◆ RapidDelay

float ActEffect.RapidDelay
static

Definition at line 19 of file ActEffect.cs.

Referenced by TryDelay().


The documentation for this class was generated from the following file: