Elin Decompiled Documentation EA 23.344.1 Nightly
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, Point center=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 (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
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 3306 of file ActEffect.cs.

3307 {
3308 if (s.IsEmpty())
3309 {
3310 return 0;
3311 }
3312 int num = 0;
3313 if (t == s)
3314 {
3315 num += 100 + EClass.rnd(30);
3316 }
3317 if (t.Contains(s))
3318 {
3319 num += 100 + EClass.rnd(30);
3320 }
3321 return num;
3322 }
Definition: EClass.cs:6
static int rnd(long a)
Definition: EClass.cs:59

References EClass.rnd().

◆ DamageEle()

static bool ActEffect.DamageEle ( Card  CC,
EffectId  id,
int  power,
Element  e,
List< Point points,
ActRef  actref,
string  lang = null,
Point  center = 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 List<Card> list = new List<Card>();
52 bool flag = false;
53 if (center == null)
54 {
55 center = CC.pos.Copy();
56 }
57 if ((id == EffectId.Explosive || id == EffectId.Rocket || id == EffectId.GravityGun) && actref.refThing != null)
58 {
59 power = power * actref.refThing.material.hardness / 10;
60 }
61 string text = id.ToString();
62 string text2 = (EClass.sources.calc.map.ContainsKey(text) ? text : (EClass.sources.calc.map.ContainsKey("Sp" + text) ? ("Sp" + text) : (text.ToLowerInvariant() + "_")));
63 foreach (Point p in points)
64 {
65 bool flag2 = true;
66 AttackSource attackSource = AttackSource.None;
67 switch (id)
68 {
69 case EffectId.Explosive:
70 case EffectId.Rocket:
71 case EffectId.GravityGun:
72 text2 = "ball_";
73 flag = false;
74 break;
75 case EffectId.BallBubble:
76 text2 = "ball_";
77 break;
78 case EffectId.Earthquake:
79 text2 = "SpEarthquake";
80 flag2 = false;
81 flag = true;
82 break;
83 case EffectId.Meteor:
84 text2 = "SpMeteor";
85 break;
86 default:
87 if (CC.isChara && p.Equals(CC.pos) && points.Count >= 2)
88 {
89 continue;
90 }
91 break;
92 case EffectId.Suicide:
93 break;
94 }
95 Effect effect = null;
96 Effect effect2 = (flag2 ? Effect.Get("trail1") : null);
97 Point point = p;
98 switch (id)
99 {
100 case EffectId.Arrow:
101 case EffectId.MoonSpear:
102 case EffectId.MoonArrow:
103 case EffectId.Missile:
104 {
105 object id2;
106 switch (id)
107 {
108 default:
109 id2 = "spell_arrow";
110 break;
111 case EffectId.Missile:
112 id2 = "spell_missile";
113 break;
114 case EffectId.MoonSpear:
115 case EffectId.MoonArrow:
116 id2 = "spell_moonspear";
117 break;
118 }
119 effect = Effect.Get((string)id2);
120 if (id == EffectId.Arrow || id == EffectId.Missile)
121 {
122 effect.sr.color = elementRef.colorSprite;
123 }
124 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
125 Color startColor = (componentInChildren.endColor = elementRef.colorSprite);
126 componentInChildren.startColor = startColor;
127 point = CC.pos;
128 break;
129 }
130 case EffectId.Earthquake:
131 {
132 if (EClass.rnd(4) == 0 && p.IsSync)
133 {
134 effect = Effect.Get("smoke_earthquake");
135 }
136 float num3 = 0.06f * (float)CC.pos.Distance(p);
137 Point pos2 = p.Copy();
138 TweenUtil.Tween(num3, null, delegate
139 {
140 pos2.Animate(AnimeID.Quake, animeBlock: true);
141 });
142 if (effect != null)
143 {
144 effect.SetStartDelay(num3);
145 }
146 break;
147 }
148 default:
149 {
150 effect = Effect.Get("Element/ball_" + ((e.id == 0) ? "Void" : ((id == EffectId.GravityGun) ? "Gravity" : e.source.alias.Remove(0, 3))));
151 if (effect == null)
152 {
153 effect = Effect.Get("Element/ball_Fire");
154 }
155 float startDelay = ((id == EffectId.Meteor || id == EffectId.Comet) ? 0.1f : 0.04f) * (float)center.Distance(p);
156 effect.SetStartDelay(startDelay);
157 effect2.SetStartDelay(startDelay);
158 if (id == EffectId.GravityGun)
159 {
160 float duration = 0.06f * (float)center.Distance(p);
161 Point pos = p.Copy();
162 TweenUtil.Tween(duration, null, delegate
163 {
164 pos.Animate(AnimeID.Gravity, animeBlock: true);
165 });
166 }
167 break;
168 }
169 }
170 if (effect2 != null)
171 {
172 effect2.SetParticleColor(elementRef.colorTrail, changeMaterial: true, "_TintColor").Play(point);
173 }
174 if (effect != null)
175 {
176 switch (id)
177 {
178 case EffectId.Missile:
179 TryDelay(delegate
180 {
181 effect.Play(CC.pos);
182 effect.GetComponent<MissileHomingEffect>().Launch(CC.pos.PositionCenter(), p.PositionCenter());
183 });
184 break;
185 case EffectId.Arrow:
186 case EffectId.MoonSpear:
187 case EffectId.MoonArrow:
188 TryDelay(delegate
189 {
190 effect.Play(CC.pos, 0f, p);
191 });
192 break;
193 default:
194 TryDelay(delegate
195 {
196 effect.Play(p).Flip(p.x > center.x);
197 });
198 break;
199 }
200 if (id == EffectId.Flare)
201 {
202 TryDelay(delegate
203 {
204 Effect.Get("flare2").Play(EClass.rndf(0.5f), p);
205 });
206 }
207 }
208 if (e.id == 910)
209 {
210 EClass._map.TryShatter(p, 910, power, CC);
211 }
212 if (e.id == 911)
213 {
214 EClass._map.TryShatter(p, 911, power, CC);
215 }
216 foreach (Card item in p.ListCards().ToList())
217 {
218 Card c = item;
219 if ((!c.isChara && !c.trait.CanBeAttacked) || (c.IsMultisize && item == CC) || (c.isChara && (c.Chara.host == CC || c.Chara.parasite == CC || c.Chara.ride == CC)))
220 {
221 continue;
222 }
223 switch (id)
224 {
225 case EffectId.Arrow:
226 case EffectId.Hand:
227 case EffectId.Sword:
228 case EffectId.MoonSpear:
229 case EffectId.MoonArrow:
230 if (c.isChara && CC.isChara)
231 {
232 c.Chara.RequestProtection(CC.Chara, delegate(Chara a)
233 {
234 c = a;
235 });
236 }
237 if (id == EffectId.MoonSpear || (id == EffectId.MoonArrow && EClass.rnd(5) == 0))
238 {
239 attackSource = AttackSource.MoonSpear;
240 }
241 break;
242 }
243 switch (id)
244 {
245 case EffectId.Arrow:
246 attackSource = AttackSource.MagicArrow;
247 break;
248 case EffectId.Hand:
249 attackSource = AttackSource.MagicHand;
250 break;
251 case EffectId.Sword:
252 attackSource = AttackSource.MagicSword;
253 break;
254 }
255 long num4 = 0L;
256 bool isChara = CC.isChara;
257 if (id == EffectId.Suicide)
258 {
259 num4 = CC.MaxHP * 2;
260 num4 = num4 * 100 / (50 + center.Distance(p) * 75);
261 if ((c.HasCondition<ConBrightnessOfLife>() || c.HasTag(CTAG.suicide)) && !c.HasCondition<ConWet>() && !c.IsPowerful)
262 {
263 list.Add(c);
264 }
265 }
266 else
267 {
268 Dice dice = Dice.Create(text2, power, CC, (actref.refThing != null) ? null : actref.act);
269 if (dice == null)
270 {
271 Debug.Log(text2);
272 }
273 num4 = dice.Roll();
274 Debug.Log(id.ToString() + "/" + text2 + "/" + power + "/" + actref.act?.ToString() + "/" + dice?.ToString() + "/" + num4);
275 switch (id)
276 {
277 case EffectId.Earthquake:
278 if (c.HasCondition<ConGravity>())
279 {
280 num4 = dice.RollMax() * 2;
281 }
282 else if (c.isChara && c.Chara.IsLevitating)
283 {
284 num4 /= 2;
285 }
286 break;
287 case EffectId.Sword:
288 num4 = num4 * (int)Mathf.Min(70f + Mathf.Sqrt(CC.Evalue(101)) * 3f, 200f) / 100;
289 break;
290 case EffectId.GravityGun:
291 num4 /= 5;
292 break;
293 }
294 int num5 = 0;
295 switch (id)
296 {
297 case EffectId.Earthquake:
298 case EffectId.Comet:
299 num5 = 5;
300 break;
301 case EffectId.Ball:
302 case EffectId.Explosive:
303 case EffectId.BallBubble:
304 case EffectId.Rocket:
305 case EffectId.GravityGun:
306 num5 = 10;
307 break;
308 }
309 if (num5 != 0)
310 {
311 num4 = num4 * 100 / (90 + center.Distance(p) * num5);
312 }
313 }
314 if (id == EffectId.Sword)
315 {
316 c.PlaySound("ab_magicsword");
317 c.PlayEffect("hit_slash");
318 }
319 if ((actref.noFriendlyFire && !CC.Chara.IsHostile(c as Chara)) || (flag && c == CC))
320 {
321 continue;
322 }
323 if (isChara && points.Count > 1 && c != null && c.isChara && CC.isChara && CC.Chara.IsFriendOrAbove(c.Chara))
324 {
325 int num6 = CC.Evalue(302);
326 if (!CC.IsPC && CC.IsPCFactionOrMinion)
327 {
328 num6 += EClass.pc.Evalue(302);
329 }
330 if (CC.HasElement(1214))
331 {
332 num6 *= 2;
333 }
334 if (num6 > 0)
335 {
336 if (num6 * 10 > EClass.rnd(num4 + 1))
337 {
338 if (c == c.pos.FirstChara)
339 {
340 CC.ModExp(302, CC.IsPC ? 10 : 50);
341 }
342 continue;
343 }
344 num4 = EClass.rnd(num4 * 100 / (100 + num6 * 10 + 1));
345 if (c == c.pos.FirstChara)
346 {
347 CC.ModExp(302, CC.IsPC ? 20 : 100);
348 }
349 if (num4 == 0L)
350 {
351 continue;
352 }
353 }
354 if ((CC.HasElement(1214) || (!CC.IsPC && (CC.IsPCFaction || CC.IsPCFactionMinion) && EClass.pc.HasElement(1214))) && EClass.rnd(5) != 0)
355 {
356 continue;
357 }
358 }
359 if (!lang.IsEmpty())
360 {
361 if (lang == "spell_hand")
362 {
363 string[] list2 = Lang.GetList("attack" + (CC.isChara ? CC.Chara.race.meleeStyle.IsEmpty("Touch") : "Touch"));
364 string @ref = "_elehand".lang(e.source.GetAltname(2), list2[4]);
365 CC.Say(c.IsPCParty ? "cast_hand_ally" : "cast_hand", CC, c, @ref, c.IsPCParty ? list2[1] : list2[2]);
366 }
367 else
368 {
369 CC.Say(lang + "_hit", CC, c, e.Name.ToLower());
370 }
371 }
372 Chara chara = (CC.isChara ? CC.Chara : ((actref.refThing != null) ? EClass._map.FindChara(actref.refThing.c_uidRefCard) : null));
373 if (c.IsMultisize)
374 {
375 switch (id)
376 {
377 case EffectId.Ball:
378 case EffectId.Explosive:
379 case EffectId.BallBubble:
380 case EffectId.Meteor:
381 case EffectId.Earthquake:
382 case EffectId.Suicide:
383 case EffectId.Rocket:
384 case EffectId.Flare:
385 case EffectId.GravityGun:
386 case EffectId.Comet:
387 num4 /= 2;
388 break;
389 }
390 }
391 if (RapidCount > 0)
392 {
393 num4 = num4 * 100 / (100 + RapidCount * 50);
394 }
395 num4 = num4 * Act.powerMod / 100;
396 c.DamageHP(num4, e.id, power * num / 100, attackSource, chara ?? CC);
398 {
399 switch (id)
400 {
401 case EffectId.GravityGun:
402 if (c.isChara)
403 {
404 AddCon<ConGravity>(1, power);
405 AddCon<ConBlind>(4, power);
406 AddCon<ConDim>(5, power / 2);
407 AddCon<ConSupress>(3, power / 2);
408 if (actref.refThing != null && actref.refThing.id == "gun_gravity2")
409 {
410 AddCon<ConEntangle>(4, power / 3);
411 AddCon<ConSilence>(4, power / 3);
412 AddCon<ConWeakResEle>(4, power);
413 AddCon<ConNightmare>(4, power);
414 }
415 }
416 break;
417 case EffectId.DrainMana:
418 if (CC.IsAliveInCurrentZone && c.isChara && CC.isChara && c.Chara.mana.value > 0)
419 {
420 long num7 = num4 * num / 100;
421 Debug.Log(num4 + " v:" + num7 + " evalue:" + e.Value + " power:" + power + " elepMod:" + num);
422 if (num7 > c.Chara.mana.value)
423 {
424 num7 = c.Chara.mana.value;
425 }
426 c.Chara.mana.Mod((int)(-num7));
427 CC.Chara.mana.Mod((int)num7);
428 }
429 break;
430 }
431 }
432 if (id == EffectId.Explosive && CC.trait is TraitCookerMicrowave)
433 {
434 chara = EClass.pc;
435 }
436 if (chara != null && chara.IsAliveInCurrentZone)
437 {
438 chara.DoHostileAction(c);
439 }
440 num2++;
441 void AddCon<T>(int rate, int p2) where T : Condition
442 {
443 if (EClass.rnd(1 + actref.refVal) == 0 && !c.Chara.HasCondition<T>() && EClass.rnd(rate) == 0)
444 {
445 c.Chara.AddCondition<T>(p2);
446 }
447 }
448 }
449 if ((id == EffectId.Explosive || id == EffectId.Suicide || id == EffectId.Rocket) && (!EClass._zone.IsPCFaction || !EClass.Branch.HasItemProtection))
450 {
451 int num8;
452 switch (id)
453 {
454 default:
455 num8 = ((actref.refThing != null) ? actref.refThing.material.hardness : (30 + power / 20));
456 break;
457 case EffectId.Suicide:
458 num8 = CC.LV / 3 + 40;
459 break;
460 case EffectId.Meteor:
461 case EffectId.Comet:
462 num8 = 50 + power / 20;
463 break;
464 }
465 int num9 = num8;
466 bool flag3 = EClass._zone.HasLaw && !EClass._zone.IsPCFaction && (CC.IsPC || (id == EffectId.Explosive && actref.refThing == null)) && !(EClass._zone is Zone_Vernis);
467 if (p.HasObj && p.cell.matObj.hardness <= num9)
468 {
470 if (flag3)
471 {
473 }
474 }
475 if (!p.HasObj && p.HasBlock && p.matBlock.hardness <= num9)
476 {
478 if (flag3)
479 {
481 }
482 }
483 }
484 if (e.id == 910)
485 {
486 int num10 = 0;
487 if (id == EffectId.Meteor)
488 {
489 num10 = 2;
490 }
492 {
493 num10 = 0;
494 }
495 if (num10 > EClass.rnd(10))
496 {
497 p.ModFire(4 + EClass.rnd(10));
498 }
499 }
500 if (e.id == 911)
501 {
502 p.ModFire(-20, extinguish: true);
503 }
504 }
505 if (RapidCount == 0)
506 {
507 foreach (Card item2 in list)
508 {
509 if (item2.ExistsOnMap)
510 {
511 RapidCount += 2;
512 ProcAt(id, power, BlessedState.Normal, item2, null, item2.pos, isNeg: true, actref);
513 }
514 }
515 }
516 return num2 > 0;
517 }
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:519
virtual int ElementPowerMod
Definition: ACT.cs:111
Definition: Card.cs:11
bool IsPCFactionOrMinion
Definition: Card.cs:2342
virtual bool IsMultisize
Definition: Card.cs:2212
virtual Chara Chara
Definition: Card.cs:2122
string id
Definition: Card.cs:36
SourceMaterial.Row material
Definition: Card.cs:2103
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6645
virtual bool IsPCParty
Definition: Card.cs:2203
int c_uidRefCard
Definition: Card.cs:1151
bool ExistsOnMap
Definition: Card.cs:2137
bool HasTag(CTAG tag)
Definition: Card.cs:2728
Point pos
Definition: Card.cs:60
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6679
Trait trait
Definition: Card.cs:54
bool IsPowerful
Definition: Card.cs:2146
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2179
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:4276
void SayNothingHappans()
Definition: Card.cs:7318
virtual bool IsPC
Definition: Card.cs:2197
virtual bool isChara
Definition: Card.cs:2135
int Evalue(int ele)
Definition: Card.cs:2704
virtual bool IsPCFactionMinion
Definition: Card.cs:2209
void ModExp(string alias, int a)
Definition: Card.cs:2781
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6383
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7323
SourceMaterial.Row matObj
Definition: Cell.cs:1082
Definition: Chara.cs:10
override bool IsAliveInCurrentZone
Definition: Chara.cs:567
bool IsLevitating
Definition: Chara.cs:603
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9839
Chara host
Definition: Chara.cs:33
bool RequestProtection(Chara attacker, Action< Chara > action)
Definition: Chara.cs:8920
bool HasCondition(string alias)
Definition: Chara.cs:10011
bool IsFriendOrAbove()
Definition: Chara.cs:7006
Stats mana
Definition: Chara.cs:1213
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6729
bool IsHostile()
Definition: Chara.cs:6910
SourceRace.Row race
Definition: Chara.cs:468
Definition: ConWet.cs:2
Definition: Dice.cs:5
static long RollMax(int num, int sides, int bonus=0)
Definition: Dice.cs:81
static long Roll(int num, int sides, int bonus=0, Card card=null)
Definition: Dice.cs:59
override string ToString()
Definition: Dice.cs:126
static Dice Create(Element ele, Card c)
Definition: Dice.cs:131
static Zone _zone
Definition: EClass.cs:21
static Map _map
Definition: EClass.cs:19
static SourceManager sources
Definition: EClass.cs:43
static float rndf(float a)
Definition: EClass.cs:102
static FactionBranch Branch
Definition: EClass.cs:23
static Player player
Definition: EClass.cs:13
static Chara pc
Definition: EClass.cs:15
static GameSetting setting
Definition: EClass.cs:35
Definition: Effect.cs:7
static Effect Get(Effect original)
Definition: Effect.cs:80
Effect SetStartDelay(float a)
Definition: Effect.cs:201
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:100
Effect SetParticleColor(Color c)
Definition: Effect.cs:293
Color colorSprite
Definition: ElementRef.cs:7
Color colorTrail
Definition: ElementRef.cs:9
int id
Definition: ELEMENT.cs:259
SourceElement.Row source
Definition: ELEMENT.cs:282
int Value
Definition: ELEMENT.cs:301
virtual string Name
Definition: ELEMENT.cs:313
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1163
bool HasItemProtection
UD_String_ElementRef elements
Definition: GameSetting.cs:360
Definition: Lang.cs:7
static string[] GetList(string id)
Definition: Lang.cs:113
Chara FindChara(string id)
Definition: Map.cs:2741
void MineObj(Point point, Task task=null, Chara c=null)
Definition: Map.cs:1980
void MineBlock(Point point, bool recoverBlock=false, Chara c=null, bool mineObj=true)
Definition: Map.cs:1808
void TryShatter(Point pos, int ele, int power, Card CC=null)
Definition: Map.cs:1316
void Launch(Vector2 from, Vector2 to)
void ModKarma(int a)
Definition: Player.cs:2636
Definition: Point.cs:9
SourceMaterial.Row matBlock
Definition: Point.cs:55
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1057
Point Copy()
Definition: Point.cs:491
override string ToString()
Definition: Point.cs:524
int x
Definition: Point.cs:36
void ModFire(int value, bool extinguish=false)
Definition: Point.cs:939
bool IsSync
Definition: Point.cs:344
ref Vector3 PositionCenter()
Definition: Point.cs:592
bool Equals(int _x, int _z)
Definition: Point.cs:966
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:995
Chara FirstChara
Definition: Point.cs:288
bool HasBlock
Definition: Point.cs:141
Cell cell
Definition: Point.cs:51
void Animate(AnimeID id, bool animeBlock=false)
Definition: Point.cs:1308
SourceCalc calc
virtual void Mod(int a)
Definition: Stats.cs:135
virtual int value
Definition: Stats.cs:56
virtual bool CanBeAttacked
Definition: Trait.cs:177
bool ContainsKey(TKey key)
Definition: UDictionary.cs:151
FactionBranch branch
Definition: Zone.cs:34
bool IsPCFaction
Definition: Zone.cs:480
Act act
Definition: ActRef.cs:3
int refVal
Definition: ActRef.cs:17
bool noFriendlyFire
Definition: ActRef.cs:15
Thing refThing
Definition: ActRef.cs:9

References EClass._map, EClass._zone, ActRef.act, Chara.AddCondition(), 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, Chara.HasCondition(), 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, MissileHomingEffect.Launch(), 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, Point.PositionCenter(), ProcAt(), RapidCount, ActRef.refThing, Chara.RequestProtection(), Chara.ride, EClass.rnd(), EClass.rndf(), Dice.Roll(), Dice.RollMax(), Card.SayNothingHappans(), Effect.SetParticleColor(), Effect.SetStartDelay(), EClass.setting, Element.source, EClass.sources, Dice.ToString(), Point.ToString(), 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 3115 of file ActEffect.cs.

3116 {
3118 {
3120 return;
3121 }
3122 if (c == tc)
3123 {
3124 tc.Say("love_ground", tc);
3125 }
3126 else
3127 {
3128 tc.Say("love_chara", c, tc);
3129 }
3130 Thing t = tc.MakeGene(type);
3131 tc.GiveBirth(t, effect: true);
3132 }
Thing GiveBirth(Thing t, bool effect)
Definition: Card.cs:6099
Thing MakeGene(DNA.Type? type=null)
Definition: Chara.cs:8682
Definition: Msg.cs:5
static string SayNothingHappen()
Definition: Msg.cs:96
Definition: Thing.cs:8
virtual bool IsUserZone
Definition: Zone.cs:278

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 3134 of file ActEffect.cs.

3135 {
3136 Point point = new Point();
3137 for (int i = 0; i < 10000; i++)
3138 {
3139 point.Set(org);
3140 point.x += EClass.rnd(radius) - EClass.rnd(radius);
3141 point.z += EClass.rnd(radius) - EClass.rnd(radius);
3142 if (point.IsValid && point.IsInBounds && !point.cell.blocked && point.Distance(org) >= radius / 3 + 1 - i / 50 && !point.cell.HasZoneStairs())
3143 {
3144 return point;
3145 }
3146 }
3147 return org.GetRandomNeighbor().GetNearestPoint();
3148 }
bool HasZoneStairs(bool includeLocked=true)
Definition: Cell.cs:1796
Point Set(int _x, int _z)
Definition: Point.cs:503
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:624
bool IsValid
Definition: Point.cs:88
bool IsInBounds
Definition: Point.cs:104
Point GetRandomNeighbor()
Definition: Point.cs:764

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 3083 of file ActEffect.cs.

3084 {
3085 if (c == tc)
3086 {
3087 tc.Say("love_ground", tc);
3088 }
3089 else
3090 {
3091 tc.Say("love_chara", c, tc);
3092 }
3093 tc.ModAffinity(EClass.pc, power / 4);
3094 if ((idEffect != EffectId.Love || EClass.rnd(2) != 0) && (!EClass._zone.IsUserZone || tc.IsPCFaction || !EClass.game.principal.disableUsermapBenefit))
3095 {
3096 if (idEffect == EffectId.MoonSpear && EClass.rnd(EClass.debug.enable ? 2 : 20) == 0)
3097 {
3098 Thing thing = tc.MakeGene();
3099 tc.GiveBirth(thing, effect: true);
3100 tc.Say("item_drop", thing);
3101 }
3102 else if (idEffect != EffectId.LovePlus && EClass.rnd(2) == 0)
3103 {
3104 Thing c2 = tc.MakeMilk(effect: true, 1, addToZone: true, state);
3105 tc.Say("item_drop", c2);
3106 }
3107 else
3108 {
3109 Thing c3 = tc.MakeEgg(effect: true, 1, addToZone: true, (idEffect == EffectId.LovePlus) ? 3 : 20, state);
3110 tc.Say("item_drop", c3);
3111 }
3112 }
3113 }
Thing MakeMilk(bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
Definition: Card.cs:6068
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:6045
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:8409
override bool IsPCFaction
Definition: Chara.cs:689
bool enable
Definition: CoreDebug.cs:302
static Game game
Definition: EClass.cs:9
static CoreDebug debug
Definition: EClass.cs:49
bool disableUsermapBenefit
GamePrincipal principal
Definition: Game.cs:225

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.ProcNutrition().

◆ Poison()

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

Definition at line 3067 of file ActEffect.cs.

3068 {
3069 tc.Say("eat_poison", tc);
3070 tc.Talk("scream");
3071 if (power > 100000000)
3072 {
3073 power = 100000000;
3074 }
3075 int num = (int)Mathf.Sqrt(power * 100);
3076 tc.DamageHP(num * 2 + EClass.rnd(num), 915, power);
3077 if (!tc.isDead && !tc.IsPC)
3078 {
3080 }
3081 }
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:7205
override bool IsPC
Definition: Chara.cs:630
bool isDead
Definition: Chara.cs:393

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

Referenced by FoodEffect.ProcNutrition().

◆ 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 1127 of file ActEffect.cs.

1128 {
1129 if (tc == null)
1130 {
1131 tc = cc;
1132 }
1133 Chara TC = tc.Chara;
1134 Chara CC = cc.Chara;
1135 bool blessed = state >= BlessedState.Blessed;
1136 bool flag = state <= BlessedState.Cursed;
1137 int orgPower = power;
1138 if (blessed || flag)
1139 {
1140 power *= 2;
1141 }
1142 switch (id)
1143 {
1144 case EffectId.Duplicate:
1145 CC.TryDuplicate();
1146 break;
1147 case EffectId.Fuse:
1148 CC.TryFuse();
1149 break;
1150 case EffectId.Escape:
1151 if (CC.IsPCFaction || (EClass._zone.Boss == CC && EClass.rnd(30) != 0))
1152 {
1153 return;
1154 }
1155 CC.Say("escape", CC);
1156 CC.PlaySound("escape");
1157 if (EClass._zone.Boss == CC)
1158 {
1159 CC.TryDropBossLoot();
1160 }
1161 if (CC.id == "bell_silver")
1162 {
1165 {
1167 }
1168 }
1169 CC.Destroy();
1170 break;
1171 case EffectId.BurnMana:
1172 CC.PlaySound("fire");
1173 CC.PlayEffect("Element/eleFire");
1174 CC.Say("burn_mana", CC);
1175 CC.mana.Mod(-CC.mana.max / 3 - 1);
1176 break;
1177 case EffectId.Exterminate:
1178 {
1179 CC.PlaySound("clean_floor");
1180 Msg.Say("exterminate");
1181 List<Chara> list2 = EClass._map.charas.Where((Chara chara3) => (chara3.isCopy || chara3.isHatchling || chara3.id == "cocoon" || chara3.id == "cocoon_alien") && !chara3.IsPCFactionOrMinion).ToList();
1182 if (list2.Count == 0)
1183 {
1185 return;
1186 }
1187 foreach (Chara item in list2)
1188 {
1189 item.Say("split_fail", item);
1190 item.PlayEffect("vanish");
1191 item.Die();
1192 }
1193 break;
1194 }
1195 case EffectId.DropMine:
1196 {
1197 if (CC.pos.Installed != null || EClass._zone.IsPCFaction)
1198 {
1199 return;
1200 }
1201 Thing thing = ThingGen.Create("mine");
1202 thing.c_idRefCard = "dog_mine";
1203 Zone.ignoreSpawnAnime = true;
1204 EClass._zone.AddCard(thing, CC.pos).Install();
1205 break;
1206 }
1207 case EffectId.LittleSisterMigration:
1208 case EffectId.SilverCatMigration:
1209 {
1210 bool flag5 = id == EffectId.SilverCatMigration;
1211 if (!EClass.game.IsSurvival && ((flag5 && EClass._zone.id != "startVillage2") || (!flag5 && !(EClass._zone is Zone_LittleGarden))))
1212 {
1214 return;
1215 }
1216 List<Chara> list = new List<Chara>();
1217 bool flag6 = false;
1218 foreach (Chara chara3 in EClass._map.charas)
1219 {
1220 if (!chara3.IsPCFactionOrMinion && chara3.id == (flag5 ? "cat_silver" : "littleOne"))
1221 {
1222 if (flag6)
1223 {
1224 flag6 = false;
1225 continue;
1226 }
1227 list.Add(chara3);
1228 flag6 = true;
1229 }
1230 }
1231 if (list.Count == 0)
1232 {
1234 return;
1235 }
1236 EClass.pc.PlaySound("chime_angel");
1237 foreach (Chara item2 in list)
1238 {
1239 item2.PlayEffect("revive");
1240 item2.Destroy();
1241 }
1242 Msg.Say(flag5 ? "cat_migration" : "little_migration", list.Count.ToString() ?? "");
1243 EClass._zone.ModInfluence(list.Count);
1244 if (flag5)
1245 {
1246 EClass.player.stats.catDepart += list.Count;
1247 break;
1248 }
1249 EClass.player.stats.sistersDepart += list.Count;
1251 break;
1252 }
1253 case EffectId.MagicMap:
1254 if (!CC.IsPC)
1255 {
1256 CC.SayNothingHappans();
1257 break;
1258 }
1259 if (flag)
1260 {
1261 CC.Say("abMagicMap_curse", CC);
1262 CC.PlaySound("curse3");
1263 CC.PlayEffect("curse");
1264 CC.AddCondition<ConConfuse>(200, force: true);
1265 break;
1266 }
1267 CC.Say("abMagicMap", CC);
1268 CC.PlayEffect("identify");
1269 CC.PlaySound("identify");
1270 if (blessed)
1271 {
1273 }
1274 else
1275 {
1276 EClass._map.Reveal(CC.pos, power);
1277 }
1278 break;
1279 case EffectId.AbsorbMana:
1280 {
1281 if (CC == TC)
1282 {
1283 EClass.game.religions.Element.Talk("ability");
1284 }
1285 Dice dice = Dice.Create("ActManaAbsorb", power, CC, (actRef.refThing != null) ? null : actRef.act);
1286 TC.mana.Mod(MathEx.ClampToInt(dice.Roll() + TC.mana.max / 5));
1287 TC.PlaySound("heal");
1288 TC.PlayEffect("heal");
1289 if (TC == CC)
1290 {
1291 CC.Say("absorbMana", CC);
1292 }
1293 break;
1294 }
1295 case EffectId.ModPotential:
1296 {
1297 Element element = cc.elements.ListElements((Element e) => e.HasTag("primary")).RandomItem();
1298 cc.elements.ModTempPotential(element.id, power / 10);
1299 break;
1300 }
1301 case EffectId.ForgetItems:
1302 {
1303 TC.PlaySound("curse3");
1304 TC.PlayEffect("curse");
1305 TC.Say("forgetItems", TC);
1306 int num3 = power / 50 + 1 + EClass.rnd(3);
1307 List<Thing> source = TC.things.List((Thing thing8) => thing8.c_IDTState == 0);
1308 for (int num4 = 0; num4 < num3; num4++)
1309 {
1310 source.RandomItem().c_IDTState = 5;
1311 }
1312 break;
1313 }
1314 case EffectId.EnchantWeapon:
1315 case EffectId.EnchantArmor:
1316 case EffectId.EnchantWeaponGreat:
1317 case EffectId.EnchantArmorGreat:
1318 {
1319 bool armor = id == EffectId.EnchantArmor || id == EffectId.EnchantArmorGreat;
1320 bool flag3 = id == EffectId.EnchantWeaponGreat || id == EffectId.EnchantArmorGreat;
1321 if (!tc.isThing)
1322 {
1323 LayerDragGrid.CreateEnchant(CC, armor, flag3, state);
1324 return;
1325 }
1326 cc.PlaySound("identify");
1327 cc.PlayEffect("identify");
1328 if (flag)
1329 {
1330 cc.Say("enc_curse", tc);
1331 tc.ModEncLv(-1);
1332 break;
1333 }
1334 int num5 = (flag3 ? 4 : 2) + (blessed ? 1 : 0);
1335 if (tc.encLV >= num5)
1336 {
1337 cc.Say("enc_resist", tc);
1338 break;
1339 }
1340 cc.Say("enc", tc);
1341 tc.ModEncLv(1);
1342 break;
1343 }
1344 case EffectId.Identify:
1345 case EffectId.GreaterIdentify:
1346 {
1347 bool flag4 = id == EffectId.GreaterIdentify;
1348 if (flag)
1349 {
1350 Redirect(EffectId.ForgetItems, flag4 ? BlessedState.Cursed : BlessedState.Normal, default(ActRef));
1351 break;
1352 }
1353 if (!tc.isThing || (actRef.refThing == null && cc.IsPC && tc.GetRootCard() == tc))
1354 {
1355 int count = ((!blessed) ? 1 : (flag4 ? (2 + EClass.rnd(2)) : (3 + EClass.rnd(3))));
1356 LayerDragGrid.CreateIdentify(tc.isChara ? tc.Chara : CC, flag4, state, 0, count);
1357 return;
1358 }
1359 cc.PlaySound("identify");
1360 cc.PlayEffect("identify");
1361 tc.Thing.Identify(cc.IsPCParty, (!flag4) ? IDTSource.Identify : IDTSource.SuperiorIdentify);
1362 break;
1363 }
1364 case EffectId.Uncurse:
1365 {
1366 if (!tc.isThing)
1367 {
1368 LayerDragGrid.CreateUncurse(CC, state);
1369 return;
1370 }
1371 Thing thing2 = tc.Thing;
1372 if (thing2.blessedState == BlessedState.Cursed)
1373 {
1374 thing2.SetBlessedState(BlessedState.Normal);
1375 }
1376 else if (thing2.blessedState == BlessedState.Doomed)
1377 {
1378 thing2.SetBlessedState(BlessedState.Normal);
1379 }
1380 thing2.GetRootCard()?.TryStack(thing2);
1381 LayerInventory.SetDirty(thing2);
1382 break;
1383 }
1384 case EffectId.Lighten:
1385 {
1386 if (!tc.isThing)
1387 {
1388 LayerDragGrid.CreateLighten(CC, state);
1389 return;
1390 }
1391 if (tc.Num > 1)
1392 {
1393 tc = tc.Split(1);
1394 }
1395 cc.PlaySound("offering");
1396 cc.PlayEffect("buff");
1397 int num7 = (tc.isWeightChanged ? tc.c_weight : tc.Thing.source.weight);
1398 tc.isWeightChanged = true;
1399 Element orCreateElement = tc.elements.GetOrCreateElement(64);
1400 Element orCreateElement2 = tc.elements.GetOrCreateElement(65);
1401 Element orCreateElement3 = tc.elements.GetOrCreateElement(67);
1402 Element orCreateElement4 = tc.elements.GetOrCreateElement(66);
1403 bool flag7 = tc.IsEquipmentOrRangedOrAmmo || tc.IsThrownWeapon;
1404 if (flag)
1405 {
1406 num7 = (int)(0.01f * (float)num7 * (float)power * 0.75f + 500f);
1407 if (num7 < 0 || num7 > 10000000)
1408 {
1409 num7 = 10000000;
1410 flag7 = false;
1411 }
1412 if (flag7)
1413 {
1414 if (tc.IsWeapon || tc.IsThrownWeapon || tc.IsAmmo)
1415 {
1416 tc.elements.ModBase(67, Mathf.Clamp(orCreateElement3.vBase * power / 1000, 1, 5));
1417 tc.elements.ModBase(66, -Mathf.Clamp(orCreateElement4.vBase * power / 1000, 1, 5));
1418 }
1419 else
1420 {
1421 tc.elements.ModBase(65, Mathf.Clamp(orCreateElement2.vBase * power / 1000, 1, 5));
1422 tc.elements.ModBase(64, -Mathf.Clamp(orCreateElement.vBase * power / 1000, 1, 5));
1423 }
1424 }
1425 cc.Say("lighten_curse", tc);
1426 }
1427 else
1428 {
1429 num7 = num7 * (100 - power / 10) / 100;
1430 if (blessed)
1431 {
1432 power /= 4;
1433 }
1434 if (flag7)
1435 {
1436 if (tc.IsWeapon || tc.IsThrownWeapon || tc.IsAmmo)
1437 {
1438 tc.elements.ModBase(67, -Mathf.Clamp(orCreateElement3.vBase * power / 1000, 1, 5));
1439 tc.elements.ModBase(66, Mathf.Clamp(orCreateElement4.vBase * power / 1000, 1, 5));
1440 }
1441 else
1442 {
1443 tc.elements.ModBase(65, -Mathf.Clamp(orCreateElement2.vBase * power / 1000, 1, 5));
1444 tc.elements.ModBase(64, Mathf.Clamp(orCreateElement.vBase * power / 1000, 1, 5));
1445 }
1446 }
1447 cc.Say("lighten", tc);
1448 }
1449 tc.c_weight = num7;
1450 tc.SetDirtyWeight();
1451 if (tc.parent == null)
1452 {
1453 CC.Pick(tc.Thing, msg: false);
1454 }
1456 break;
1457 }
1458 case EffectId.Reconstruction:
1459 {
1460 if (!tc.isThing)
1461 {
1462 LayerDragGrid.CreateReconstruction(CC, state, power / ((!(blessed || flag)) ? 1 : 2));
1463 return;
1464 }
1465 if (tc.Num > 1)
1466 {
1467 tc = tc.Split(1);
1468 }
1469 cc.PlaySound("mutation");
1470 cc.PlayEffect("identify");
1471 cc.Say("reconstruct", tc);
1472 EClass.game.cards.uidNext += EClass.rnd(30);
1473 int num6 = Mathf.Max(tc.genLv, tc.LV, EClass.player.stats.deepest);
1475 {
1476 blesstedState = state
1477 });
1478 Thing thing3 = ThingGen.Create(tc.id, -1, (int)((long)num6 * (long)power / 400));
1479 thing3.genLv = num6;
1480 thing3.idSkin = tc.idSkin;
1481 if (tc.c_uidAttune != 0)
1482 {
1483 thing3.c_uidAttune = tc.c_uidAttune;
1484 if (thing3.id == "amulet_engagement" || thing3.id == "ring_engagement")
1485 {
1486 if (tc.c_uidAttune != EClass.pc.uid)
1487 {
1488 thing3.elements.ModBase(484, 3);
1489 }
1490 if (thing3.rarity < Rarity.Mythical)
1491 {
1492 thing3.rarity = Rarity.Mythical;
1493 }
1494 }
1495 }
1496 tc.Destroy();
1497 CC.Pick(thing3, msg: false);
1498 if (!CC.IsPC)
1499 {
1500 CC.TryEquip(thing3);
1501 }
1502 break;
1503 }
1504 case EffectId.ChangeMaterialLesser:
1505 case EffectId.ChangeMaterial:
1506 case EffectId.ChangeMaterialGreater:
1507 {
1508 SourceMaterial.Row row = EClass.sources.materials.alias.TryGetValue(actRef.n1);
1509 if (!tc.isThing)
1510 {
1511 LayerDragGrid.CreateChangeMaterial(CC, actRef.refThing, row, id, state);
1512 return;
1513 }
1514 if (tc.Num > 1)
1515 {
1516 tc = tc.Split(1);
1517 }
1518 string name = tc.Name;
1519 if (row == null)
1520 {
1521 bool num = id == EffectId.ChangeMaterialGreater;
1522 bool flag2 = id == EffectId.ChangeMaterialLesser;
1523 string text = tc.Thing.source.tierGroup;
1524 Dictionary<string, SourceMaterial.TierList> tierMap = SourceMaterial.tierMap;
1525 int num2 = 1;
1526 if (flag)
1527 {
1528 num2 -= 2;
1529 }
1530 if (blessed)
1531 {
1532 num2++;
1533 }
1534 if (num)
1535 {
1536 num2++;
1537 }
1538 if (flag2)
1539 {
1540 num2 -= 2;
1541 }
1542 num2 = Mathf.Clamp(num2 + EClass.rnd(2), 0, 4);
1543 if (EClass.rnd(10) == 0)
1544 {
1545 text = ((text == "metal") ? "leather" : "metal");
1546 }
1547 SourceMaterial.TierList tierList = (text.IsEmpty() ? tierMap.RandomItem() : tierMap[text]);
1548 for (int i = 0; i < 1000; i++)
1549 {
1550 row = tierList.tiers[num2].Select();
1551 if (row != tc.material)
1552 {
1553 break;
1554 }
1555 }
1556 }
1557 cc.PlaySound("offering");
1558 cc.PlayEffect("buff");
1559 if ((tc.id == "log" || tc.id == "branch") && tc.material.alias == "carbone")
1560 {
1561 foreach (Element item3 in tc.elements.dict.Values.ToList())
1562 {
1563 if (item3.IsTrait && item3.vBase != 0)
1564 {
1565 tc.elements.ModBase(item3.id, -item3.vBase);
1566 }
1567 }
1568 }
1569 tc.ChangeMaterial(row);
1570 if (tc.trait is TraitGene && tc.c_DNA != null)
1571 {
1572 DNA.Type type = DNA.GetType(tc.material.alias);
1573 tc.c_DNA.Generate(type);
1574 }
1575 cc.Say("materialChanged", name, row.GetName());
1576 if (CC != null)
1577 {
1578 if (tc.parent == null)
1579 {
1580 CC.Pick(tc.Thing, msg: false);
1581 }
1583 }
1584 break;
1585 }
1586 case EffectId.ChangeRarity:
1587 {
1588 EClass.sources.materials.alias.TryGetValue(actRef.n1);
1589 if (!tc.isThing)
1590 {
1591 LayerDragGrid.CreateChangeRarity(CC, actRef.refThing, id, state);
1592 return;
1593 }
1594 if (tc.Num > 1)
1595 {
1596 tc = tc.Split(1);
1597 }
1598 string name2 = tc.Name;
1599 cc.PlaySound("offering");
1600 cc.PlayEffect("buff");
1601 bool flag8 = tc.rarity == Rarity.Legendary;
1603 {
1604 rarity = (flag8 ? Rarity.Mythical : Rarity.Legendary),
1605 generation = CardBlueprint.Generation.GarokkHammer
1606 });
1607 Rand.SetBaseSeed(tc.uid + 1);
1608 Rand.SetSeed(tc.uid + 2);
1609 Thing thing4 = ThingGen.Create(tc.id, tc.idMaterial, tc.genLv);
1610 Rand.SetSeed();
1611 Rand.SetBaseSeed();
1612 thing4.SetEncLv(tc.encLV);
1613 thing4.SetBlessedState(tc.blessedState);
1614 int num8 = 0;
1615 foreach (Element item4 in thing4.elements.dict.Values.ToList().Shuffle())
1616 {
1617 int num9 = (tc.elements.Has(item4.id) ? tc.elements.GetElement(item4.id).vBase : 0);
1618 if (num9 != 0 && (Mathf.Abs(item4.vBase) <= Mathf.Abs(num9) || !MathEx.IsSameSign(item4.vBase, num9)))
1619 {
1620 continue;
1621 }
1622 int id2 = item4.id;
1623 if (id2 != 11)
1624 {
1625 if ((uint)(id2 - 64) > 3u)
1626 {
1627 num8++;
1628 }
1629 tc.elements.SetBase(item4.id, item4.vBase);
1630 Debug.Log(item4.Name + "/" + item4.vBase);
1631 if (flag8 && num8 >= 2)
1632 {
1633 break;
1634 }
1635 }
1636 }
1637 tc.isCrafted = false;
1638 tc.rarity = (flag8 ? Rarity.Mythical : Rarity.Legendary);
1639 EClass.pc.Say("reconstruct", name2);
1640 break;
1641 }
1642 case EffectId.ChangeAlias:
1643 {
1644 Chara c = CC;
1645 if (!c.IsPC && !c.trait.UseRandomAlias && blessed)
1646 {
1647 c._alias = null;
1648 c.Say("reconstruct", c);
1649 SE.Change();
1650 c.PlayEffect("mutation");
1651 break;
1652 }
1653 EClass.ui.AddLayer<LayerList>().SetStringList(delegate
1654 {
1655 List<string> list13 = new List<string>();
1656 for (int j = 0; j < 10; j++)
1657 {
1658 list13.Add(AliasGen.GetRandomAlias());
1659 }
1660 return list13;
1661 }, delegate(int a, string b)
1662 {
1663 c._alias = b;
1664 c.Say("reconstruct", c);
1665 SE.Change();
1666 c.PlayEffect("mutation");
1667 }).SetSize()
1668 .EnableReroll()
1669 .SetTitles("wAlias");
1670 break;
1671 }
1672 case EffectId.ChangeBiography:
1673 CC.bio.RerollParents();
1674 CC.Say("reconstruct", CC);
1675 SE.Change();
1676 CC.PlayEffect("mutation");
1677 break;
1678 case EffectId.ReturnVoid:
1679 {
1681 if (EClass.game.IsSurvival || root == null || root.visitCount == 0 || EClass.player.stats.deepestVoid < 1 || (!EClass.debug.enable && EClass.player.CountKeyItem("license_void") == 0))
1682 {
1684 return;
1685 }
1686 int max = Mathf.Min(EClass.player.stats.deepestVoid, -root.MinLv);
1687 int destLv = 1;
1688 Dialog.InputName("dialogVoidReturn".lang(max.ToString() ?? ""), max.ToString() ?? "", delegate(bool cancel, string str)
1689 {
1690 if (!cancel)
1691 {
1692 destLv = Mathf.Abs(str.ToInt());
1693 destLv = Mathf.Clamp(destLv, 1, max) * -1;
1694 Zone zone = ((root.lv == destLv) ? root : (root.children.Find((Spatial spatial) => spatial.lv == destLv) as Zone));
1695 Debug.Log(destLv + "/" + zone);
1696 if (zone == null)
1697 {
1698 zone = SpatialGen.Create(root.GetNewZoneID(destLv), root, register: true) as Zone;
1699 zone.lv = destLv;
1700 }
1701 Msg.Say("returnComplete");
1702 EClass.player.uidLastTravelZone = 0;
1704 EClass.player.lastZonePos = null;
1705 EClass.player.returnInfo = null;
1706 }
1707 });
1708 break;
1709 }
1710 case EffectId.Return:
1711 case EffectId.Evac:
1712 if (!cc.IsPC)
1713 {
1714 Redirect(EffectId.Teleport, state, default(ActRef));
1715 return;
1716 }
1717 cc.PlaySound("return_cast");
1718 if (EClass.player.returnInfo == null)
1719 {
1720 if (id == EffectId.Evac)
1721 {
1722 EClass.player.returnInfo = new Player.ReturnInfo
1723 {
1724 turns = EClass.rnd(10) + 10,
1725 isEvac = true
1726 };
1727 }
1728 else
1729 {
1730 if (EClass.game.spatials.ListReturnLocations().Count == 0)
1731 {
1732 Msg.Say("returnNowhere");
1733 break;
1734 }
1735 EClass.player.returnInfo = new Player.ReturnInfo
1736 {
1737 turns = EClass.rnd(10) + 10,
1738 askDest = true
1739 };
1740 }
1741 Msg.Say("returnBegin");
1742 }
1743 else
1744 {
1745 EClass.player.returnInfo = null;
1746 Msg.Say("returnAbort");
1747 }
1748 break;
1749 case EffectId.Teleport:
1750 case EffectId.TeleportShort:
1751 case EffectId.Gate:
1752 if (!tc.HasHost)
1753 {
1754 if (!flag)
1755 {
1756 if (id == EffectId.TeleportShort)
1757 {
1758 tc.Teleport(GetTeleportPos(tc.pos));
1759 }
1760 else
1761 {
1763 }
1764 }
1765 if (id == EffectId.Gate && CC.IsPC)
1766 {
1767 foreach (Chara chara4 in EClass._map.charas)
1768 {
1769 if (!chara4.HasHost && chara4 != tc && (chara4.IsPCParty || chara4.IsPCPartyMinion))
1770 {
1771 chara4.Teleport(tc.pos.GetNearestPoint(allowBlock: false, allowChara: false) ?? tc.pos);
1772 }
1773 }
1774 }
1775 }
1776 if (tc.ExistsOnMap && tc.id == "mush_quantum" && !tc.HasElement(400) && !tc.HasCondition<ConGravity>())
1777 {
1778 if (EClass.rnd(2) == 0)
1779 {
1780 if (tc.IsGlobal || EClass._zone.IsInstance || tc.c_bossType != BossType.none)
1781 {
1782 tc.Die();
1783 }
1784 else
1785 {
1786 tc.Destroy();
1787 }
1788 break;
1789 }
1790 tc.Chara.TryDuplicate(DuplicateCondition.Quantum, null, inheritHostility: true);
1791 }
1792 if (flag)
1793 {
1794 Redirect(EffectId.Gravity, BlessedState.Normal, default(ActRef));
1795 }
1796 if (blessed)
1797 {
1798 Redirect(EffectId.Levitate, BlessedState.Normal, default(ActRef));
1799 }
1800 break;
1801 }
1802 if (TC == null)
1803 {
1804 return;
1805 }
1806 switch (id)
1807 {
1808 case EffectId.ThrowPotion:
1809 if (!CC.pos.Equals(TC.pos))
1810 {
1811 Thing t = ThingGen.Create(new string[6] { "330", "331", "334", "335", "336", "1142" }.RandomItem());
1812 ActThrow.Throw(CC, TC.pos, t, ThrowMethod.Punish, 0.7f);
1813 }
1814 break;
1815 case EffectId.StripBlessing:
1816 {
1817 List<Condition> list6 = new List<Condition>();
1818 foreach (Condition condition4 in TC.conditions)
1819 {
1820 if (GetBlessingDifficulty(condition4) > 0 && EClass.rnd(GetBlessingDifficulty(condition4)) == 0)
1821 {
1822 list6.Add(condition4);
1823 }
1824 }
1825 if (list6.Count == 0)
1826 {
1827 CC.SayNothingHappans();
1828 break;
1829 }
1830 TC.pos.PlayEffect("holyveil");
1831 TC.pos.PlaySound("holyveil");
1832 TC.Say("unpolluted", TC);
1833 list6.Shuffle();
1834 {
1835 foreach (Condition item5 in list6)
1836 {
1837 item5.Kill();
1838 if (CC.IsHostile(TC))
1839 {
1840 break;
1841 }
1842 }
1843 break;
1844 }
1845 }
1846 case EffectId.ShutterHex:
1847 {
1848 if (!CC.IsHostile(TC))
1849 {
1850 break;
1851 }
1852 int num21 = 0;
1853 foreach (Condition condition5 in TC.conditions)
1854 {
1855 if (condition5.Type == ConditionType.Debuff)
1856 {
1857 num21++;
1858 }
1859 }
1860 if (num21 == 0)
1861 {
1862 CC.SayNothingHappans();
1863 break;
1864 }
1865 TC.pos.PlayEffect("holyveil");
1866 TC.pos.PlaySound("holyveil");
1867 TC.pos.PlaySound("atk_eleSound");
1868 TC.conditions.ForeachReverse(delegate(Condition condition4)
1869 {
1870 if (condition4.Type == ConditionType.Debuff && EClass.rnd(3) == 0)
1871 {
1872 condition4.Kill();
1873 }
1874 });
1875 TC.Say("abShutterHex", TC);
1876 Point center = CC.pos.Copy();
1877 List<Chara> list10 = TC.pos.ListCharasInRadius(TC, 4, (Chara chara3) => chara3 == TC || chara3.IsHostile(CC));
1878 for (int num22 = 0; num22 < num21; num22++)
1879 {
1880 TweenUtil.Delay((float)num22 * 0.1f, delegate
1881 {
1882 center.PlaySound("shutterhex");
1883 });
1884 foreach (Chara item6 in list10)
1885 {
1886 if (item6.ExistsOnMap)
1887 {
1888 Effect effect = Effect.Get("spell_moonspear");
1889 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
1890 Color startColor = (componentInChildren.endColor = EClass.Colors.elementColors["eleHoly"]);
1891 componentInChildren.startColor = startColor;
1892 Point pos = item6.pos.Copy();
1893 TweenUtil.Delay((float)num22 * 0.1f, delegate
1894 {
1895 effect.Play(center, 0f, pos);
1896 });
1897 long dmg = Dice.Create("SpShutterHex", power, CC, (actRef.refThing != null) ? null : actRef.act).Roll();
1898 item6.DamageHP(dmg, 919, power, AttackSource.None, CC, showEffect: false);
1899 }
1900 }
1901 }
1902 break;
1903 }
1904 case EffectId.Draw:
1905 {
1906 if (CC.Dist(TC) <= 1 || (CC.IsPCFactionOrMinion && TC.IsPCFactionOrMinion && TC.isRestrained))
1907 {
1908 break;
1909 }
1910 Point point = CC.GetFirstStep(TC.pos, PathManager.MoveType.Combat);
1911 if (!point.IsValid)
1912 {
1913 point = CC.pos.GetRandomPoint(1)?.GetNearestPoint(allowBlock: false, allowChara: false);
1914 }
1915 if (point == null || !CC.CanSeeLos(point))
1916 {
1917 break;
1918 }
1919 CC.Say("abDraw", CC, TC);
1920 CC.PlaySound("draw");
1921 if (TC.HasCondition<ConGravity>() || TC.HasElement(493))
1922 {
1923 CC.SayNothingHappans();
1924 break;
1925 }
1926 TC.MoveImmediate(point, !EClass.core.config.camera.smoothFollow);
1927 if (CC.id == "tentacle")
1928 {
1929 TC.AddCondition<ConEntangle>();
1930 }
1931 break;
1932 }
1933 case EffectId.CatSniff:
1934 {
1935 Chara nearbyCatToSniff = CC.GetNearbyCatToSniff();
1936 if (nearbyCatToSniff != null)
1937 {
1938 CC.Sniff(nearbyCatToSniff);
1939 }
1940 break;
1941 }
1942 case EffectId.Steal:
1943 {
1945 {
1946 break;
1947 }
1948 if (TC.Evalue(426) > 0)
1949 {
1950 TC.Say((actRef.n1 == "money") ? "abStealNegateMoney" : "abStealNegate", TC);
1951 break;
1952 }
1953 Thing thing7 = null;
1954 bool flag11 = actRef.n1 == "food";
1955 if (actRef.n1 == "money")
1956 {
1957 int currency = TC.GetCurrency();
1958 if (currency > 0)
1959 {
1960 currency = Mathf.Clamp(EClass.rnd(currency / 10), 1, 100 + EClass.rndHalf(Mathf.Min(CC.LV, 1000000) * 200));
1961 thing7 = ThingGen.Create("money").SetNum(currency);
1962 TC.ModCurrency(-currency);
1963 }
1964 }
1965 else
1966 {
1967 Func<Thing, bool> func = (Thing thing8) => true;
1968 if (flag11)
1969 {
1970 func = (Thing thing8) => thing8.IsFood;
1971 }
1972 List<Thing> list12 = TC.things.List(delegate(Thing thing8)
1973 {
1974 if (thing8.parentCard?.trait is TraitChestMerchant || thing8.trait is TraitTool || thing8.IsThrownWeapon)
1975 {
1976 return false;
1977 }
1978 return thing8.trait.CanBeDestroyed && thing8.things.Count == 0 && thing8.invY != 1 && thing8.trait.CanBeStolen && !thing8.trait.CanOnlyCarry && !thing8.IsUnique && !thing8.isEquipped && thing8.blessedState == BlessedState.Normal && func(thing8);
1979 }, onlyAccessible: true);
1980 if (list12.Count > 0)
1981 {
1982 thing7 = list12.RandomItem();
1983 if (thing7.Num > 1)
1984 {
1985 thing7 = thing7.Split(1);
1986 }
1987 }
1988 CC.AddCooldown(6640, 200);
1989 }
1990 if (thing7 == null)
1991 {
1992 CC.Say("abStealNothing", CC, TC);
1993 break;
1994 }
1995 thing7.SetInt(116, 1);
1996 TC.PlaySound(thing7.material.GetSoundDrop(thing7.sourceCard));
1997 CC.Pick(thing7, msg: false);
1998 CC.Say("abSteal", CC, TC, thing7.Name);
1999 if (actRef.n1 == "food")
2000 {
2001 if (CC.hunger.value != 0)
2002 {
2003 CC.InstantEat(thing7);
2004 }
2005 }
2006 else
2007 {
2008 CC.Say("abStealEscape", CC);
2009 CC.Teleport(GetTeleportPos(tc.pos, 30), silent: true);
2010 }
2011 break;
2012 }
2013 case EffectId.NeckHunt:
2014 CC.TryNeckHunt(TC, power);
2015 break;
2016 case EffectId.CurseEQ:
2017 {
2018 if (CC != null && CC != TC)
2019 {
2020 TC.Say("curse", CC, TC);
2021 }
2022 TC.PlaySound("curse3");
2023 TC.PlayEffect("curse");
2024 if (EClass.rnd(150 + TC.LUC * 5 + TC.Evalue(972) * 20) >= power + (flag ? 200 : 0) || TC.TryNullifyCurse())
2025 {
2026 break;
2027 }
2028 List<Thing> list4 = TC.things.List(delegate(Thing thing8)
2029 {
2030 if (!thing8.isEquipped || thing8.blessedState == BlessedState.Doomed || thing8.IsToolbelt)
2031 {
2032 return false;
2033 }
2034 return (thing8.blessedState < BlessedState.Blessed || EClass.rnd(10) == 0) ? true : false;
2035 });
2036 if (list4.Count == 0)
2037 {
2038 CC.SayNothingHappans();
2039 break;
2040 }
2041 Thing thing5 = list4.RandomItem();
2042 TC.Say("curse_hit", TC, thing5);
2043 thing5.SetBlessedState((thing5.blessedState == BlessedState.Cursed) ? BlessedState.Doomed : BlessedState.Cursed);
2044 LayerInventory.SetDirty(thing5);
2045 break;
2046 }
2047 case EffectId.UncurseEQ:
2048 case EffectId.UncurseEQGreater:
2049 {
2050 TC.Say("uncurseEQ" + (blessed ? "_bless" : (flag ? "_curse" : "")), TC);
2051 TC.PlaySound("uncurse");
2052 TC.PlayEffect("uncurse");
2053 if (flag)
2054 {
2055 Redirect(EffectId.CurseEQ, BlessedState.Normal, default(ActRef));
2056 break;
2057 }
2058 int success = 0;
2059 int fail = 0;
2060 List<Thing> list9 = new List<Thing>();
2061 TC.things.Foreach(delegate(Thing thing8)
2062 {
2063 int num25 = 0;
2064 if ((thing8.isEquipped || thing8.IsRangedWeapon || blessed) && thing8.blessedState < BlessedState.Normal)
2065 {
2066 if (thing8.blessedState == BlessedState.Cursed)
2067 {
2068 num25 = EClass.rnd(200);
2069 }
2070 if (thing8.blessedState == BlessedState.Doomed)
2071 {
2072 num25 = EClass.rnd(1000);
2073 }
2074 if (blessed)
2075 {
2076 num25 /= 2;
2077 }
2078 if (id == EffectId.UncurseEQGreater)
2079 {
2080 num25 /= 10;
2081 }
2082 if (power >= num25)
2083 {
2084 TC.Say("uncurseEQ_success", thing8);
2085 thing8.SetBlessedState(BlessedState.Normal);
2086 if (thing8.isEquipped && thing8.HasElement(656))
2087 {
2088 TC.body.Unequip(thing8);
2089 }
2090 LayerInventory.SetDirty(thing8);
2091 success++;
2092 list9.Add(thing8);
2093 }
2094 else
2095 {
2096 fail++;
2097 }
2098 }
2099 });
2100 foreach (Thing item7 in list9)
2101 {
2102 item7.GetRootCard()?.TryStack(item7);
2103 }
2104 if (success == 0 && fail == 0)
2105 {
2106 TC.SayNothingHappans();
2107 }
2108 else if (fail > 0)
2109 {
2110 TC.Say("uncurseEQ_fail");
2111 }
2112 break;
2113 }
2114 case EffectId.Buff:
2115 {
2116 string text2 = actRef.n1;
2117 string text3 = "";
2118 if (flag)
2119 {
2120 text3 = EClass.sources.stats.alias[text2].curse;
2121 if (!text3.IsEmpty())
2122 {
2123 text2 = text3;
2124 }
2125 }
2126 Condition condition = Condition.Create(text2, power, delegate(Condition con)
2127 {
2128 if (!actRef.aliasEle.IsEmpty())
2129 {
2130 con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
2131 }
2132 });
2133 condition.isPerfume = TC.IsPC && actRef.isPerfume;
2134 Condition condition2 = TC.AddCondition(condition);
2135 if (condition2 != null && condition2.isPerfume)
2136 {
2137 condition2.value = 3;
2138 Msg.Say("perfume", TC);
2139 }
2140 if (!text3.IsEmpty())
2141 {
2142 CC.DoHostileAction(TC);
2143 }
2144 break;
2145 }
2146 case EffectId.KizuamiTrick:
2147 {
2148 EClass.game.religions.Trickery.Talk("ability");
2149 bool hex = CC.IsHostile(TC);
2150 List<SourceStat.Row> list7 = EClass.sources.stats.rows.Where((SourceStat.Row con) => con.tag.Contains("random") && con.group == (hex ? "Debuff" : "Buff")).ToList();
2151 int power2 = power;
2152 for (int num20 = 0; num20 < 4 + EClass.rnd(2); num20++)
2153 {
2154 SourceStat.Row row2 = list7.RandomItem();
2155 list7.Remove(row2);
2156 Proc(hex ? EffectId.DebuffKizuami : EffectId.Buff, CC, TC, power2, new ActRef
2157 {
2158 n1 = row2.alias
2159 });
2160 }
2162 {
2163 EClass.Wait(0.3f, TC);
2164 }
2165 break;
2166 }
2167 case EffectId.Debuff:
2168 case EffectId.DebuffKizuami:
2169 {
2170 CC.DoHostileAction(TC);
2171 bool isPowerful = TC.IsPowerful;
2172 string n = actRef.n1;
2173 if (n == "ConSuffocation")
2174 {
2175 power = power * 2 / 3;
2176 }
2177 int num13 = TC.WIL * (isPowerful ? 20 : 5);
2178 ConHolyVeil condition3 = TC.GetCondition<ConHolyVeil>();
2179 if (condition3 != null)
2180 {
2181 num13 += condition3.power * 5;
2182 }
2183 num13 /= EClass.sources.stats.alias[n].hexPower;
2184 if (id != EffectId.DebuffKizuami && EClass.rnd(power) < num13)
2185 {
2186 int num14 = 10;
2187 int num15 = (TC.IsPowerful ? 40 : 90);
2188 if (CC.IsPCFaction)
2189 {
2190 num14 += EClass.curve(CC.LER, 100, 50) / 10;
2191 }
2192 if (TC.IsPowerful)
2193 {
2194 num14 /= 2;
2195 }
2196 if (condition3 != null)
2197 {
2198 num14 /= 5;
2199 }
2200 if (num14 >= num15)
2201 {
2202 num14 = num15;
2203 }
2204 Debug.Log(num14);
2205 if (EClass.rnd(100) > num14)
2206 {
2207 TC.Say("debuff_resist", TC);
2208 CC.DoHostileAction(TC);
2209 break;
2210 }
2211 }
2212 TC.AddCondition(Condition.Create(n, power, delegate(Condition con)
2213 {
2214 con.givenByPcParty = CC.IsPCParty;
2215 (con as ConDeathSentense)?.SetChara(CC);
2216 if (!actRef.aliasEle.IsEmpty())
2217 {
2218 con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
2219 }
2220 (con as ConMiasma)?.SetResistPenetrationLevel(TC, CC);
2221 }));
2222 if (n == "ConBane" && CC.HasElement(1416))
2223 {
2224 TC.AddCondition<ConExcommunication>(power);
2225 }
2226 CC.DoHostileAction(TC);
2228 {
2229 EClass.Wait(0.3f, TC);
2230 }
2231 break;
2232 }
2233 case EffectId.Mutation:
2234 TC.MutateRandom(1, 100, ether: false, state);
2236 {
2237 EClass.Wait(0.3f, TC);
2238 }
2239 break;
2240 case EffectId.CureMutation:
2241 TC.MutateRandom(-1, 100, ether: false, state);
2242 break;
2243 case EffectId.Ally:
2244 {
2245 Msg.Say("gainAlly");
2246 Chara chara2 = CharaGen.CreateFromFilter("chara", cc.LV);
2247 EClass._zone.AddCard(chara2, cc.pos.GetNearestPoint(allowBlock: false, allowChara: false));
2248 if (cc.IsPCFactionOrMinion)
2249 {
2250 chara2.MakeAlly(msg: false);
2251 }
2252 chara2.PlaySound("identify");
2253 chara2.PlayEffect("teleport");
2254 break;
2255 }
2256 case EffectId.Wish:
2257 if (!TC.IsPC)
2258 {
2259 break;
2260 }
2261 if (blessed || flag)
2262 {
2263 power /= 2;
2264 }
2265 Dialog.InputName("dialogWish", "q", delegate(bool cancel, string text4)
2266 {
2267 if (!cancel)
2268 {
2269 Msg.Say("wish", TC, text4);
2270 Wish(text4, EClass.pc.NameTitled, power, state);
2271 }
2272 });
2273 break;
2274 case EffectId.Faith:
2275 {
2277 tc.PlayEffect("aura_heaven");
2278 tc.PlaySound("aura_heaven");
2279 tc.Say("faith", tc, faith.Name);
2280 if (flag)
2281 {
2282 tc.Say("faith_curse", tc, faith.Name);
2283 break;
2284 }
2285 if (blessed)
2286 {
2287 tc.Say("faith_bless", tc, faith.Name);
2288 }
2289 tc.ModExp(306, power * 10);
2290 if (tc.elements.Base(85) < tc.elements.Value(306))
2291 {
2292 tc.ModExp(85, power * 10);
2293 }
2294 break;
2295 }
2296 case EffectId.TransGender:
2297 {
2298 tc.PlaySound("mutation");
2299 tc.PlayEffect("mutation");
2300 int gender = tc.bio.gender;
2301 int gender2 = gender switch
2302 {
2303 1 => 2,
2304 2 => 1,
2305 _ => (EClass.rnd(2) != 0) ? 1 : 2,
2306 };
2307 if (gender != 0 && EClass.rnd(10) == 0)
2308 {
2309 gender2 = 0;
2310 }
2311 tc.bio.SetGender(gender2);
2312 tc.Say("transGender", tc, Gender.Name(tc.bio.gender));
2313 tc.Talk("tail");
2314 int age2 = tc.bio.GetAge(tc.Chara);
2315 if (blessed && age2 > 1)
2316 {
2317 tc.Say("ageDown", tc);
2318 tc.bio.SetAge(tc.Chara, age2 - 1);
2319 }
2320 else if (flag)
2321 {
2322 tc.Say("ageUp", tc);
2323 tc.bio.SetAge(tc.Chara, age2 + 1);
2324 }
2325 break;
2326 }
2327 case EffectId.TransBlood:
2328 {
2329 tc.PlaySound("mutation");
2330 tc.PlayEffect("mutation");
2331 int num17 = ((actRef.refThing != null) ? actRef.refThing.GetInt(118) : actRef.refVal);
2332 if (num17 == 0)
2333 {
2334 num17 = tc.GetInt(118);
2335 if (num17 == 0)
2336 {
2337 num17 = EClass.game.seed + tc.uid;
2338 }
2339 num17++;
2340 }
2341 tc.Say("transBlood", tc);
2342 tc.Talk("tail");
2343 tc.c_bloodData = null;
2344 tc.SetInt(118, num17);
2345 break;
2346 }
2347 case EffectId.ResetFeat:
2348 {
2349 if (!tc.IsPC)
2350 {
2351 tc.SayNothingHappans();
2352 break;
2353 }
2354 tc.PlaySound("mutation");
2355 tc.PlayEffect("mutation");
2356 List<Element> list3 = new List<Element>();
2357 foreach (Element value in EClass.pc.elements.dict.Values)
2358 {
2359 if (value.source.category != "feat" || value.id == 1644)
2360 {
2361 continue;
2362 }
2363 switch (value.source.categorySub)
2364 {
2365 case "general":
2366 case "attribute":
2367 case "skill":
2368 case "special":
2369 if (value.vBase > 0)
2370 {
2371 list3.Add(value);
2372 }
2373 break;
2374 }
2375 }
2376 int num10 = 0;
2377 foreach (Element item8 in list3)
2378 {
2379 int dNABonus = item8.GetDNABonus(EClass.pc);
2380 if (dNABonus < item8.vBase)
2381 {
2382 for (int num11 = 0; num11 < item8.vBase - dNABonus; num11++)
2383 {
2384 num10 += item8.source.cost.TryGet(num11);
2385 }
2386 EClass.pc.SetFeat(item8.id, dNABonus);
2387 }
2388 }
2389 EClass.pc.feat += num10;
2390 EClass.pc.Refresh();
2395 tc.Say("resetFeat");
2396 break;
2397 }
2398 case EffectId.Youth:
2399 {
2400 tc.PlaySound("mutation");
2401 tc.PlayEffect("mutation");
2402 int age = tc.bio.GetAge(tc.Chara);
2403 if (!flag && age <= 0)
2404 {
2405 tc.SayNothingHappans();
2406 break;
2407 }
2408 age = Mathf.Max(0, age * 100 / (flag ? 75 : (blessed ? 400 : 200))) + (flag ? 1 : 0);
2409 tc.Say(flag ? "ageUp" : "ageDown", tc);
2410 tc.bio.SetAge(tc.Chara, age);
2411 break;
2412 }
2413 case EffectId.EternalYouth:
2414 {
2415 tc.PlaySound("mutation");
2416 tc.PlayEffect("mutation");
2417 if (tc.IsUnique)
2418 {
2419 tc.SayNothingHappans();
2420 break;
2421 }
2422 int age3 = tc.bio.GetAge(tc.Chara);
2423 if (flag)
2424 {
2425 if (tc.c_lockedAge != 0)
2426 {
2427 tc.Say("eternalYouth2", tc);
2428 tc.c_lockedAge = 0;
2429 tc.elements.Remove(1243);
2430 tc.bio.SetAge(tc.Chara, age3);
2431 }
2432 Redirect(EffectId.Youth, BlessedState.Cursed, default(ActRef));
2433 }
2434 else if (tc.c_lockedAge != 0)
2435 {
2436 tc.SayNothingHappans();
2437 }
2438 else
2439 {
2440 tc.PlaySound("dropRewardXmas");
2441 tc.Say("eternalYouth1", tc);
2442 tc.c_lockedAge = age3 + 1;
2443 tc.elements.SetBase(1243, 1);
2444 if (blessed)
2445 {
2446 Redirect(EffectId.Youth, BlessedState.Blessed, default(ActRef));
2447 }
2448 }
2449 break;
2450 }
2451 case EffectId.BuffStats:
2452 case EffectId.DebuffStats:
2453 case EffectId.LulwyTrick:
2454 Debug.Log(power + "/" + id.ToString() + "/" + actRef.n1);
2455 if (id == EffectId.LulwyTrick)
2456 {
2457 EClass.game.religions.Wind.Talk("ability");
2458 }
2459 if (flag)
2460 {
2461 if (id == EffectId.BuffStats)
2462 {
2463 id = EffectId.DebuffStats;
2464 }
2465 else if (id == EffectId.DebuffStats)
2466 {
2467 id = EffectId.BuffStats;
2468 }
2469 }
2470 if (power < 0 || id == EffectId.DebuffStats)
2471 {
2472 power = Mathf.Abs(power);
2473 if (blessed)
2474 {
2475 power /= 4;
2476 }
2477 flag = true;
2478 }
2479 TC.AddCondition(Condition.Create(power, delegate(ConBuffStats con)
2480 {
2481 con.SetRefVal(Element.GetId(actRef.n1), (int)id);
2482 }));
2483 break;
2484 case EffectId.Revive:
2485 {
2486 List<KeyValuePair<int, Chara>> list11 = 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();
2487 if (TC.IsPCFaction || TC.IsPCFactionMinion)
2488 {
2489 if (TC.IsPC && list11.Count == 0)
2490 {
2491 list11 = 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();
2492 }
2493 if (list11.Count > 0)
2494 {
2495 list11.RandomItem().Value.Chara.GetRevived();
2496 break;
2497 }
2498 }
2499 TC.SayNothingHappans();
2500 break;
2501 }
2502 case EffectId.DamageBody:
2503 case EffectId.DamageMind:
2504 case EffectId.DamageBodyGreat:
2505 case EffectId.DamageMindGreat:
2506 case EffectId.Weaken:
2507 {
2508 bool flag9 = id == EffectId.DamageBody || id == EffectId.DamageBodyGreat;
2509 bool mind = id == EffectId.DamageMind || id == EffectId.DamageMindGreat;
2510 int num18 = ((id == EffectId.DamageBody || id == EffectId.DamageMind) ? 1 : (4 + EClass.rnd(4)));
2511 if (id == EffectId.Weaken)
2512 {
2513 flag9 = EClass.rnd(2) == 0;
2514 mind = !flag9;
2515 num18 = 1;
2516 }
2517 else
2518 {
2519 TC.PlayEffect("debuff");
2520 TC.PlaySound("debuff");
2521 }
2522 TC.Say(flag9 ? "damageBody" : "damageMind", TC);
2523 for (int num19 = 0; num19 < num18; num19++)
2524 {
2525 TC.DamageTempElements(power, flag9, mind, id != EffectId.Weaken);
2526 }
2527 if (TC.IsPC)
2528 {
2529 Tutorial.Play("healer");
2530 }
2531 break;
2532 }
2533 case EffectId.EnhanceBody:
2534 case EffectId.EnhanceMind:
2535 case EffectId.EnhanceBodyGreat:
2536 case EffectId.EnhanceMindGreat:
2537 {
2538 bool flag10 = id == EffectId.EnhanceBody || id == EffectId.EnhanceBodyGreat;
2539 bool mind2 = id == EffectId.EnhanceMind || id == EffectId.EnhanceMindGreat;
2540 if (id != EffectId.EnhanceBody && id != EffectId.EnhanceMind)
2541 {
2542 EClass.rnd(4);
2543 }
2544 TC.Say(flag10 ? "enhanceBody" : "enhanceMind", TC);
2545 TC.PlayEffect("buff");
2546 TC.PlaySound("buff");
2547 TC.EnhanceTempElements(power, flag10, mind2, onlyRenew: true);
2548 break;
2549 }
2550 case EffectId.RestoreBody:
2551 case EffectId.RestoreMind:
2552 {
2553 bool flag12 = id == EffectId.RestoreBody;
2554 if (flag)
2555 {
2556 Redirect(flag12 ? EffectId.DamageBodyGreat : EffectId.DamageMindGreat, BlessedState.Normal, default(ActRef));
2557 break;
2558 }
2559 TC.Say(flag12 ? "restoreBody" : "restoreMind", TC);
2560 TC.PlaySound("heal");
2561 TC.PlayEffect("heal");
2562 TC.CureHost(flag12 ? CureType.CureBody : CureType.CureMind, power, state);
2563 if (blessed)
2564 {
2565 Redirect(flag12 ? EffectId.EnhanceBodyGreat : EffectId.EnhanceMindGreat, BlessedState.Normal, default(ActRef));
2566 }
2567 break;
2568 }
2569 case EffectId.HealComplete:
2570 TC.HealHPHost(100000000L, (actRef.refThing == null) ? HealSource.Magic : HealSource.Item);
2571 TC.CureHost(CureType.HealComplete, power, state);
2572 TC.Say("heal_heavy", TC);
2573 break;
2574 case EffectId.Heal:
2575 case EffectId.JureHeal:
2576 {
2577 long 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();
2578 if (actRef.refThing != null)
2579 {
2580 num12 = num12 * (100 + actRef.refThing.Evalue(750) * 10) / 100;
2581 }
2582 if (flag)
2583 {
2584 TC.DamageHP(num12 / 2, 919, power);
2585 break;
2586 }
2587 if (id == EffectId.JureHeal)
2588 {
2589 EClass.game.religions.Healing.Talk("ability");
2590 num12 += TC.MaxHP / 4;
2591 TC.AddCondition<ConInvulnerable>();
2592 TC.HealHP(num12, HealSource.Item);
2593 TC.Cure(CureType.Heal, power, state);
2594 }
2595 else
2596 {
2597 TC.HealHPHost(num12, (actRef.refThing == null) ? HealSource.Magic : HealSource.Item);
2598 TC.CureHost(CureType.Heal, power, state);
2599 }
2600 TC.Say((power >= 300) ? "heal_heavy" : "heal_light", TC);
2601 break;
2602 }
2603 case EffectId.RemedyJure:
2604 TC.HealHP(1000000L, HealSource.Magic);
2605 TC.CureHost(CureType.Jure, power, state);
2606 TC.Say("heal_jure", TC);
2607 break;
2608 case EffectId.Headpat:
2609 CC.PlaySound("headpat");
2610 CC.Cuddle(TC, headpat: true);
2611 break;
2612 case EffectId.RemoveHex:
2613 case EffectId.RemoveHexAll:
2614 {
2615 if (flag)
2616 {
2617 Redirect(EffectId.CurseEQ, BlessedState.Normal, default(ActRef));
2618 break;
2619 }
2620 IList<Condition> list5 = TC.conditions.Copy();
2621 list5.Shuffle();
2622 CC.PlaySound("remove_hex");
2623 CC.PlayEffect("remove_hex");
2624 foreach (Condition item9 in list5)
2625 {
2626 if (item9.Type != ConditionType.Debuff || item9.IsKilled)
2627 {
2628 continue;
2629 }
2630 if (EClass.rnd(power * (CC.IsPowerful ? 5 : 2)) > EClass.rnd(item9.power) || (id == EffectId.RemoveHex && EClass.rnd(2) == 0))
2631 {
2632 CC.Say("removeHex", TC, item9.Name.ToLower());
2633 item9.Kill();
2634 }
2635 else
2636 {
2637 if (id == EffectId.RemoveHexAll)
2638 {
2639 item9.power /= 2;
2640 }
2641 CC.Say("removeHex_fail", TC, item9.Name.ToLower());
2642 }
2643 if (id == EffectId.RemoveHex)
2644 {
2645 break;
2646 }
2647 }
2648 if (blessed)
2649 {
2650 TC.AddCondition<ConHolyVeil>(power / 2);
2651 }
2652 break;
2653 }
2654 case EffectId.CureCorruption:
2655 TC.PlaySound("heal");
2656 TC.PlayEffect("heal");
2657 if (flag)
2658 {
2659 TC.Say("cureCorruption_curse", TC);
2660 TC.mana.Mod(9999);
2661 TC.ModCorruption(power);
2662 }
2663 else
2664 {
2665 TC.Say("cureCorruption", TC);
2666 TC.ModCorruption(-power * (blessed ? 150 : 200) / 100);
2667 }
2668 break;
2669 case EffectId.Degenerate:
2670 {
2671 if (TC == null || TC.HasCondition<ConTransmuteHuman>())
2672 {
2673 CC.SayNothingHappans();
2674 break;
2675 }
2676 Chara chara = CharaGen.Create("baby");
2677 chara.c_altName = TC.c_altName ?? TC.source.GetName(TC);
2678 TC.AddCondition(Condition.Create(power, delegate(ConTransmuteHuman con)
2679 {
2680 con.chara = chara;
2681 }));
2682 break;
2683 }
2684 case EffectId.Drink:
2685 case EffectId.DrinkRamune:
2686 case EffectId.DrinkMilk:
2687 if (id == EffectId.DrinkRamune)
2688 {
2689 TC.Say("drinkRamune", TC);
2690 }
2691 if (TC.IsPC)
2692 {
2693 TC.Say("drinkGood", TC);
2694 }
2695 if (id == EffectId.DrinkMilk)
2696 {
2697 if (TC.IsPC)
2698 {
2699 TC.Say("drinkMilk", TC);
2700 }
2701 if (blessed)
2702 {
2703 TC.ModHeight(EClass.rnd(5) + 3);
2704 }
2705 else if (flag)
2706 {
2707 TC.ModHeight((EClass.rnd(5) + 3) * -1);
2708 }
2709 }
2710 break;
2711 case EffectId.DrinkWater:
2712 if (flag)
2713 {
2714 if (TC.IsPC)
2715 {
2716 TC.Say("drinkWater_dirty", TC);
2717 }
2719 }
2720 else if (TC.IsPC)
2721 {
2722 TC.Say("drinkWater_clear", TC);
2723 }
2724 break;
2725 case EffectId.DrinkWaterDirty:
2726 if (TC.IsPC)
2727 {
2728 TC.Say("drinkWater_dirty", TC);
2729 }
2730 if (TC.IsPCFaction)
2731 {
2732 TC.Vomit();
2733 }
2734 break;
2735 case EffectId.SaltWater:
2736 if (TC.HasElement(1211))
2737 {
2738 TC.Say("drinkSaltWater_snail", TC);
2739 int num16 = ((TC.hp > 10) ? (TC.hp - EClass.rnd(10)) : 10000);
2740 TC.DamageHP(num16, AttackSource.None, CC);
2741 }
2742 else if (TC.IsPC)
2743 {
2744 TC.Say("drinkSaltWater", TC);
2745 }
2746 break;
2747 case EffectId.Booze:
2748 TC.AddCondition<ConDrunk>(power);
2749 if (TC.HasElement(1215))
2750 {
2751 TC.Say("drunk_dwarf", TC);
2752 TC.AddCondition(Condition.Create(power + EClass.rnd(power), delegate(ConBuffStats con)
2753 {
2754 con.SetRefVal(Element.List_MainAttributes.RandomItem(), (int)id);
2755 }));
2756 }
2757 break;
2758 case EffectId.CatsEye:
2759 if (flag)
2760 {
2761 Redirect(EffectId.Blind, BlessedState.Normal, default(ActRef));
2762 }
2763 else
2764 {
2765 TC.AddCondition<ConNightVision>(power);
2766 }
2767 break;
2768 case EffectId.Hero:
2769 if (flag)
2770 {
2771 Redirect(EffectId.Fear, BlessedState.Normal, default(ActRef));
2772 }
2773 else
2774 {
2775 TC.AddCondition<ConHero>(power);
2776 }
2777 break;
2778 case EffectId.HolyVeil:
2779 if (flag)
2780 {
2781 Redirect(EffectId.Fear, BlessedState.Normal, default(ActRef));
2782 }
2783 else
2784 {
2785 TC.AddCondition<ConHolyVeil>(power);
2786 }
2787 break;
2788 case EffectId.Levitate:
2789 if (flag)
2790 {
2791 Redirect(EffectId.Gravity, BlessedState.Normal, default(ActRef));
2792 }
2793 else
2794 {
2795 TC.AddCondition<ConLevitate>(power);
2796 }
2797 break;
2798 case EffectId.Gravity:
2799 if (blessed)
2800 {
2801 power /= 4;
2802 }
2803 TC.AddCondition<ConGravity>(power);
2804 if (flag)
2805 {
2806 Redirect(EffectId.BuffStats, BlessedState.Cursed, new ActRef
2807 {
2808 n1 = "STR"
2809 });
2810 }
2811 break;
2812 case EffectId.Fear:
2813 if (blessed)
2814 {
2815 power /= 4;
2816 }
2817 TC.AddCondition<ConFear>(power);
2818 if (flag)
2819 {
2820 Redirect(EffectId.Confuse, BlessedState.Normal, default(ActRef));
2821 }
2822 break;
2823 case EffectId.Faint:
2824 if (blessed)
2825 {
2826 power /= 4;
2827 }
2828 TC.AddCondition<ConFaint>(power);
2829 if (flag)
2830 {
2831 Redirect(EffectId.Disease, BlessedState.Normal, default(ActRef));
2832 }
2833 break;
2834 case EffectId.Paralyze:
2835 if (blessed)
2836 {
2837 power /= 4;
2838 }
2839 TC.AddCondition<ConParalyze>(power);
2840 if (flag)
2841 {
2842 Redirect(EffectId.Blind, BlessedState.Normal, default(ActRef));
2843 }
2844 break;
2845 case EffectId.Poison:
2846 if (blessed)
2847 {
2848 power /= 4;
2849 }
2850 TC.AddCondition<ConPoison>(power);
2851 if (flag)
2852 {
2853 Redirect(EffectId.Paralyze, BlessedState.Normal, default(ActRef));
2854 }
2855 break;
2856 case EffectId.Sleep:
2857 case EffectId.BlueDrag:
2858 if (blessed)
2859 {
2860 power /= 4;
2861 }
2862 TC.AddCondition<ConSleep>(power);
2863 if (id == EffectId.BlueDrag)
2864 {
2865 TC.PlayEffect("buff");
2866 TC.PlaySound("offering");
2867 int num23 = TC.Evalue(1423);
2868 if (num23 > 0)
2869 {
2870 int num24 = 0;
2871 if (flag && num23 > 1)
2872 {
2873 num24 = -1;
2874 }
2875 else if (num23 < 15)
2876 {
2877 num24 = ((!blessed) ? 1 : 2);
2878 if (num24 + num23 > 15)
2879 {
2880 num24 = 1;
2881 }
2882 }
2883 if (num24 != 0)
2884 {
2885 TC.SetFeat(1423, num23 + num24, msg: true);
2886 TC.SetInt(134, TC.GetInt(134) + num24);
2887 }
2888 }
2889 }
2890 if (flag)
2891 {
2892 Redirect(EffectId.Disease, BlessedState.Normal, default(ActRef));
2893 }
2894 break;
2895 case EffectId.Confuse:
2896 if (blessed)
2897 {
2898 power /= 4;
2899 }
2900 TC.AddCondition<ConConfuse>(power);
2901 if (flag)
2902 {
2903 Redirect(EffectId.Fear, BlessedState.Normal, default(ActRef));
2904 }
2905 break;
2906 case EffectId.Blind:
2907 if (blessed)
2908 {
2909 power /= 4;
2910 }
2911 TC.AddCondition<ConBlind>(power);
2912 if (flag)
2913 {
2914 Redirect(EffectId.Confuse, BlessedState.Normal, default(ActRef));
2915 }
2916 break;
2917 case EffectId.Disease:
2918 if (blessed)
2919 {
2920 power /= 4;
2921 }
2922 TC.AddCondition<ConDisease>(power);
2923 if (flag)
2924 {
2925 Redirect(EffectId.Poison, BlessedState.Normal, default(ActRef));
2926 }
2927 break;
2928 case EffectId.Acid:
2929 {
2930 if (blessed)
2931 {
2932 power /= 4;
2933 }
2934 List<Thing> list8 = TC.things.List((Thing thing8) => (thing8.Num <= 1 && thing8.IsEquipmentOrRanged && !thing8.IsToolbelt && !thing8.IsLightsource && thing8.isEquipped) ? true : false);
2935 if (list8.Count != 0)
2936 {
2937 Thing thing6 = list8.RandomItem();
2938 TC.Say("acid_hit", TC);
2939 if (thing6.isAcidproof)
2940 {
2941 TC.Say("acid_nullify", thing6);
2942 }
2943 else if (thing6.encLV > -5)
2944 {
2945 TC.Say("acid_rust", TC, thing6);
2946 thing6.ModEncLv(-1);
2947 LayerInventory.SetDirty(thing6);
2948 }
2949 if (TC.IsPCParty)
2950 {
2951 Tutorial.Reserve("rust");
2952 }
2953 }
2954 break;
2955 }
2956 case EffectId.PuddleEffect:
2957 TC.DamageHP(power / 5, actRef.idEle, power);
2958 break;
2959 case EffectId.Acidproof:
2960 if (blessed)
2961 {
2962 power /= 4;
2963 }
2964 if (TC.IsPC)
2965 {
2966 TC.Say("pc_pain");
2967 }
2968 TC.Say("drink_acid", TC);
2969 TC.DamageHP(power / 5, 923, power);
2970 break;
2971 case EffectId.LevelDown:
2972 Msg.Say("nothingHappens");
2973 break;
2974 case EffectId.Love:
2975 case EffectId.LovePlus:
2976 if (flag)
2977 {
2978 if (CC == TC)
2979 {
2980 TC.Say("love_curse_self", TC);
2981 }
2982 else
2983 {
2984 TC.Say("love_curse", CC, TC);
2985 TC.ModAffinity(CC, -power / 4, show: false);
2986 }
2987 TC.ShowEmo(Emo.angry);
2988 }
2989 else
2990 {
2991 LoveMiracle(TC, CC, power, id, state);
2992 }
2993 break;
2994 case EffectId.HairGrowth:
2995 if (flag)
2996 {
2997 if (TC.HasElement(1532))
2998 {
2999 TC.SetMutation(1532);
3000 }
3001 else
3002 {
3003 TC.SetMutation(1533, 1);
3004 }
3005 TC.c_fur = 0;
3006 break;
3007 }
3008 if (blessed)
3009 {
3010 if (TC.HasElement(1533))
3011 {
3012 TC.SetMutation(1533);
3013 }
3014 else
3015 {
3016 TC.SetMutation(1532, 1);
3017 }
3018 }
3019 TC.PlayEffect("aura_heaven");
3020 TC.PlaySound("godbless");
3021 if (!TC.HaveFur())
3022 {
3023 TC.Say("grow_hair_fail", TC);
3024 break;
3025 }
3026 TC.Say("grow_hair", TC);
3027 TC.c_fur = 100;
3028 break;
3029 case EffectId.Gene:
3030 GeneMiracle(TC, CC, blessed ? DNA.Type.Superior : (flag ? DNA.Type.Brain : DNA.Type.Default));
3031 break;
3032 }
3033 int GetBlessingDifficulty(Condition condition4)
3034 {
3035 if (condition4.Type != ConditionType.Buff)
3036 {
3037 return 0;
3038 }
3039 if (condition4 is ConTransmuteBat && TC.HasCooldown(8793))
3040 {
3041 return 0;
3042 }
3043 if (!CC.IsHostile(TC))
3044 {
3045 return 1;
3046 }
3047 if (condition4 is ConBoost)
3048 {
3049 return 5;
3050 }
3051 if (condition4 is ConRebirth)
3052 {
3053 return 10;
3054 }
3055 if (condition4 is ConInvulnerable)
3056 {
3057 return 100;
3058 }
3059 return 2;
3060 }
3061 void Redirect(EffectId _id, BlessedState _state, ActRef _ref1)
3062 {
3063 Proc(_id, orgPower, _state, cc, tc, _ref1);
3064 }
3065 }
BossType
Definition: BossType.cs:2
@ currency
ConditionType
Definition: ConditionType.cs:2
CureType
Definition: CureType.cs:2
if(!match.Success)
DuplicateCondition
Emo
Definition: Emo.cs:2
HealSource
Definition: HealSource.cs:2
IDTSource
Definition: IDTSource.cs:2
ID_Achievement
Rarity
Definition: Rarity.cs:2
ThrowMethod
Definition: ThrowMethod.cs:2
static void LoveMiracle(Chara tc, Chara c, int power, EffectId idEffect=EffectId.Love, BlessedState? state=null)
Definition: ActEffect.cs:3083
static void GeneMiracle(Chara tc, Chara c, DNA.Type type)
Definition: ActEffect.cs:3115
static Point GetTeleportPos(Point org, int radius=6)
Definition: ActEffect.cs:3134
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 SetElement(int id)
virtual string Name
void SetRefVal(int a, int b)
virtual ConditionType Type
Definition: BaseStats.cs:33
void SetGender(int g)
Definition: Biography.cs:469
int GetAge(Chara c)
Definition: Biography.cs:276
void SetAge(Chara c, int a)
Definition: Biography.cs:297
void RerollParents()
Definition: Biography.cs:402
int gender
Definition: Biography.cs:29
static void Set(CardBlueprint _bp=null)
GlobalCharaList globalCharas
Definition: CardManager.cs:46
int c_lockedAge
Definition: Card.cs:1393
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:6194
virtual bool isThing
Definition: Card.cs:2133
bool IsAmmo
Definition: Card.cs:2301
int idMaterial
Definition: Card.cs:137
Thing Split(int a)
Definition: Card.cs:3665
ElementContainerCard elements
Definition: Card.cs:42
bool IsUnique
Definition: Card.cs:2143
virtual void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
Definition: Card.cs:5245
bool IsThrownWeapon
Definition: Card.cs:2299
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3217
bool isCopy
Definition: Card.cs:881
void SetInt(string id, int value=0)
Definition: Card.cs:2586
Biography bio
Definition: Card.cs:45
Rarity rarity
Definition: Card.cs:317
string Name
Definition: Card.cs:2191
bool IsRangedWeapon
Definition: Card.cs:2297
ICardParent parent
Definition: Card.cs:56
Thing SetNum(int a)
Definition: Card.cs:3676
int LER
Definition: Card.cs:2411
bool IsFood
Definition: Card.cs:2229
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:4076
bool isAcidproof
Definition: Card.cs:689
bool IsToolbelt
Definition: Card.cs:2223
void SetDirtyWeight()
Definition: Card.cs:2687
int uid
Definition: Card.cs:125
bool IsEquipmentOrRanged
Definition: Card.cs:2272
void TryStack(Thing t)
Definition: Card.cs:7483
int encLV
Definition: Card.cs:329
void ModEncLv(int a)
Definition: Card.cs:4027
void SetEncLv(int a)
Definition: Card.cs:4045
void Destroy()
Definition: Card.cs:5314
BossType c_bossType
Definition: Card.cs:1261
virtual Thing Thing
Definition: Card.cs:2110
Card GetRootCard()
Definition: Card.cs:3607
int Dist(Card c)
Definition: Card.cs:8204
int idSkin
Definition: Card.cs:365
bool IsLightsource
Definition: Card.cs:2225
virtual bool HasHost
Definition: Card.cs:2493
BlessedState blessedState
Definition: Card.cs:281
virtual bool IsGlobal
Definition: Card.cs:2353
bool isHatchling
Definition: Card.cs:941
Card Install()
Definition: Card.cs:3922
Card parentCard
Definition: Card.cs:106
DNA c_DNA
Definition: Card.cs:1933
int genLv
Definition: Card.cs:197
int Num
Definition: Card.cs:161
bool IsWeapon
Definition: Card.cs:2260
int GetInt(string id, int? defaultInt=null)
Definition: Card.cs:2567
int LV
Definition: Card.cs:389
int c_uidAttune
Definition: Card.cs:1212
void UnqeuipIfTooHeavy(Thing t)
Definition: CharaBody.cs:196
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
Definition: CharaGen.cs:22
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1796
new TraitChara trait
Definition: Chara.cs:509
CharaBody body
Definition: Chara.cs:94
bool TryNeckHunt(Chara TC, int power, bool harvest=false)
Definition: Chara.cs:10252
void Cuddle(Chara c, bool headpat=false)
Definition: Chara.cs:6597
void InstantEat(Thing t=null, bool sound=true)
Definition: Chara.cs:8028
Faction faction
Definition: Chara.cs:431
Point GetFirstStep(Point newPoint, PathManager.MoveType moveType=PathManager.MoveType.Default)
Definition: Chara.cs:2804
Chara GetNearbyCatToSniff()
Definition: Chara.cs:8598
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:10518
bool CanSeeLos(Card c, int dist=-1)
Definition: Chara.cs:1309
override bool IsPCParty
Definition: Chara.cs:633
Chara TryDuplicate(DuplicateCondition con=DuplicateCondition.Default, Point dest=null, bool inheritHostility=false)
Definition: Chara.cs:1933
Stats hunger
Definition: Chara.cs:1201
override bool HasHost
Definition: Chara.cs:706
override bool IsPCPartyMinion
Definition: Chara.cs:657
Chara Duplicate()
Definition: Chara.cs:1955
void MakeAlly(bool msg=true)
Definition: Chara.cs:2493
void TryDropBossLoot()
Definition: Chara.cs:5963
string NameTitled
Definition: Chara.cs:522
void RefreshFaithElement()
Definition: Chara.cs:10851
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:9235
Religion faith
Definition: Chara.cs:443
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:8190
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:4577
void Sniff(Chara c)
Definition: Chara.cs:8610
bool TryFuse(float chance=1f)
Definition: Chara.cs:1830
void MoveZone(string alias)
Definition: Chara.cs:3548
UD_String_Color elementColors
virtual bool IsKilled
Definition: Condition.cs:8
void Kill(bool silent=false)
Definition: Condition.cs:108
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
Definition: Condition.cs:47
new GameConfig game
Definition: CoreConfig.cs:627
CameraConfig camera
Definition: CoreConfig.cs:635
CoreConfig config
Definition: Core.cs:70
Definition: DNA.cs:9
Type
Definition: DNA.cs:11
static Type GetType(string idMat)
Definition: DNA.cs:612
void Generate(Type _type, Chara model=null)
Definition: DNA.cs:293
Definition: Dialog.cs:7
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
Definition: Dialog.cs:536
static int curve(long _a, int start, int step, int rate=75)
Definition: EClass.cs:69
static ColorProfile Colors
Definition: EClass.cs:39
static Core core
Definition: EClass.cs:7
static void Wait(float a, Card c)
Definition: EClass.cs:112
static int rndHalf(int a)
Definition: EClass.cs:97
static UI ui
Definition: EClass.cs:17
List< Element > ListElements(Func< Element, bool > shoudList=null, Comparison< Element > comparison=null)
Dictionary< int, Element > dict
bool Has(int ele)
int Value(int ele)
Element ModTempPotential(int ele, int v, int threshMsg=0)
Element ModBase(int ele, int v)
Element SetBase(string alias, int v, int potential=0)
void Remove(int id)
Element GetOrCreateElement(Element ele)
Element GetElement(string alias)
int GetDNABonus(Chara c)
Definition: ELEMENT.cs:531
int vBase
Definition: ELEMENT.cs:261
bool HasTag(string tag)
Definition: ELEMENT.cs:482
static int[] List_MainAttributes
Definition: ELEMENT.cs:249
static int GetId(string alias)
Definition: ELEMENT.cs:1182
bool IsTrait
Definition: ELEMENT.cs:371
ReligionManager religions
Definition: Game.cs:159
SpatialManager spatials
Definition: Game.cs:153
CardManager cards
Definition: Game.cs:156
bool IsSurvival
Definition: Game.cs:276
Definition: Gender.cs:2
static string Name(int g)
Definition: Gender.cs:9
static void Redraw()
static LayerDragGrid CreateEnchant(Chara cc, bool armor, bool superior=false, BlessedState state=BlessedState.Normal, int count=1)
static LayerDragGrid CreateChangeRarity(Chara cc, Thing consume, EffectId idEffect, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static LayerDragGrid CreateChangeMaterial(Chara cc, Thing consume, SourceMaterial.Row mat, EffectId idEffect, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static LayerDragGrid CreateLighten(Chara cc, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static LayerDragGrid CreateUncurse(Chara cc, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static LayerDragGrid CreateReconstruction(Chara cc, BlessedState state=BlessedState.Normal, int power=100, int price=0, int count=1)
static LayerDragGrid CreateIdentify(Chara cc, bool superior=false, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static void SetDirty()
Definition: LayerEquip.cs:15
static void SetDirty(Thing t)
static void SetDirtyAll(bool immediate=false)
LayerList EnableReroll()
Definition: LayerList.cs:259
Layer SetTitles(string langList, string idHeaderRow=null)
Definition: Layer.cs:688
int Width
Definition: MapBounds.cs:26
void Reveal(Point center, int power=100)
Definition: Map.cs:1024
List< Chara > charas
Definition: Map.cs:84
void RevealAll(bool reveal=true)
Definition: Map.cs:1011
MapBounds bounds
Definition: Map.cs:55
Definition: MathEx.cs:2
static bool IsSameSign(int a, int b)
Definition: MathEx.cs:12
static int ClampToInt(long a)
Definition: MathEx.cs:25
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
int escapeSilverBell
Definition: Player.cs:138
Stats stats
Definition: Player.cs:1086
int CountKeyItem(string alias)
Definition: Player.cs:2266
ReturnInfo returnInfo
Definition: Player.cs:933
Thing Installed
Definition: Point.cs:327
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1259
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
Definition: Point.cs:774
Definition: Rand.cs:4
static void SetBaseSeed(int a=-1)
Definition: Rand.cs:39
static void SetSeed(int a=-1)
Definition: Rand.cs:44
ReligionWind Wind
ReligionTrickery Trickery
ReligionElement Element
ReligionHealing Healing
virtual void Talk(string idTalk, Card c=null, Card agent=null)
Definition: Religion.cs:175
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
string id
Definition: Spatial.cs:13
int visitCount
Definition: Spatial.cs:154
List< Spatial > children
Definition: Spatial.cs:37
virtual int max
Definition: Stats.cs:68
Definition: Steam.cs:12
static void GetAchievement(ID_Achievement id)
Definition: Steam.cs:53
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:2155
virtual bool UseRandomAlias
Definition: TraitChara.cs:132
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:595
bool IsInstance
Definition: Zone.cs:496
Chara Boss
Definition: Zone.cs:91
void ModInfluence(int a)
Definition: Zone.cs:3906
virtual int MinLv
Definition: Zone.cs:288
ZoneInstance instance
Definition: Zone.cs:58
Card AddCard(Card t, Point point)
Definition: Zone.cs:2148
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_bossType, Card.c_DNA, Card.c_lockedAge, Card.c_uidAttune, SourceManager.calc, CoreConfig.camera, Chara.CanSeeLos(), Game.cards, Card.ChangeMaterial(), Card.Chara, Map.charas, Spatial.children, MathEx.ClampToInt(), Color, EClass.Colors, Core.config, Point.Copy(), EClass.core, Player.CountKeyItem(), Dice.Create(), Condition.Create(), ThingGen.Create(), CharaGen.Create(), SpatialGen.Create(), LayerDragGrid.CreateChangeMaterial(), LayerDragGrid.CreateChangeRarity(), LayerDragGrid.CreateEnchant(), CharaGen.CreateFromFilter(), LayerDragGrid.CreateIdentify(), LayerDragGrid.CreateLighten(), LayerDragGrid.CreateReconstruction(), LayerDragGrid.CreateUncurse(), Chara.Cuddle(), currency, EClass.curve(), Card.DamageHP(), EClass.debug, Debug, Player.Stats.deepest, Player.Stats.deepestVoid, Card.Destroy(), ElementContainer.dict, Card.Die(), Card.Dist(), Chara.DoHostileAction(), Chara.Duplicate(), ReligionManager.Element, ColorProfile.elementColors, Card.elements, SourceManager.elements, CoreDebug.enable, LayerList.EnableReroll(), Card.encLV, Point.Equals(), Player.Stats.escapeSilverBell, Card.ExistsOnMap, Chara.faction, Chara.faith, faith, SpatialManager.Find(), CoreConfig.game, EClass.game, Biography.gender, DNA.Generate(), Card.genLv, Effect.Get(), Steam.GetAchievement(), Biography.GetAge(), Element.GetDNABonus(), ElementContainer.GetElement(), Chara.GetFirstStep(), Element.GetId(), Card.GetInt(), Chara.GetNearbyCatToSniff(), Point.GetNearestPoint(), Zone.GetNewZoneID(), ElementContainer.GetOrCreateElement(), Point.GetRandomPoint(), Card.GetRootCard(), DNA.GetType(), CardManager.globalCharas, ElementContainer.Has(), Card.HasElement(), Card.HasHost, Chara.HasHost, Element.HasTag(), ReligionManager.Healing, Chara.hunger, Card.id, Element.id, Spatial.id, Thing.Identify(), Card.idMaterial, Card.idSkin, if(), Dialog.InputName(), Card.Install(), Point.Installed, Zone.instance, Chara.InstantEat(), Card.isAcidproof, Card.IsAmmo, Card.isChara, Card.isCopy, Card.IsEquipmentOrRanged, Thing.isEquipped, Card.IsGlobal, Card.isHatchling, Chara.IsHostile(), Zone.IsInstance, Condition.IsKilled, Card.IsLightsource, Card.IsPC, Chara.IsPC, Chara.IsPCFaction, Zone.IsPCFaction, Card.IsPCFactionOrMinion, Card.IsPCParty, Chara.IsPCParty, Chara.IsPCPartyMinion, BaseCondition.isPerfume, Card.IsPowerful, Card.IsRangedWeapon, MathEx.IsSameSign(), Game.IsSurvival, Card.isThing, Card.IsThrownWeapon, Card.IsToolbelt, Element.IsTrait, Card.IsUnique, Point.IsValid, Card.IsWeapon, item, Condition.Kill(), Card.LER, 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, Element.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, Card.rarity, LayerAbility.Redraw(), Chara.Refresh(), Chara.RefreshFaithElement(), Game.religions, ElementContainer.Remove(), Biography.RerollParents(), 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(), Rand.SetBaseSeed(), Card.SetBlessedState(), LayerEquip.SetDirty(), LayerInventory.SetDirty(), LayerInventory.SetDirtyAll(), Card.SetDirtyWeight(), BaseCondition.SetElement(), Card.SetEncLv(), Chara.SetFeat(), Biography.SetGender(), Card.SetInt(), Card.SetNum(), BaseCondition.SetRefVal(), Rand.SetSeed(), Layer.SetTitles(), CoreConfig.CameraConfig.smoothFollow, Chara.Sniff(), Element.source, 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, Chara.trait, ReligionManager.Trickery, Chara.TryDropBossLoot(), Chara.TryDuplicate(), Chara.TryEquip(), Chara.TryFuse(), Chara.TryNeckHunt(), Card.TryStack(), BaseStats.Type, EClass.ui, Card.uid, CharaBody.UnqeuipIfTooHeavy(), TraitChara.UseRandomAlias, 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 519 of file ActEffect.cs.

520 {
521 Chara CC = cc.Chara;
522 bool flag = state <= BlessedState.Cursed;
523 bool flag2 = isNeg || flag;
524 Element element = Element.Create(actRef.aliasEle.IsEmpty("eleFire"), power / 10);
525 Color matColor = EClass.Colors.elementColors.TryGetValue(element.source.alias);
527 {
528 angle += 5;
529 if (angle > 100)
530 {
531 angle = 30;
532 }
533 Debug.Log(angle);
534 }
535 switch (id)
536 {
537 case EffectId.Earthquake:
538 {
539 List<Point> list3 = EClass._map.ListPointsInCircle(CC.pos, 12f, mustBeWalkable: false);
540 if (list3.Count == 0)
541 {
542 list3.Add(CC.pos.Copy());
543 }
544 CC.Say("spell_earthquake", CC, element.Name.ToLower());
545 TryDelay(delegate
546 {
547 CC.PlaySound("spell_earthquake");
548 });
550 {
551 Shaker.ShakeCam("ball");
552 }
553 EClass.Wait(1f, CC);
554 DamageEle(CC, id, power, element, list3, actRef, "spell_earthquake");
555 break;
556 }
557 case EffectId.Meteor:
558 {
559 EffectMeteor.Create(cc.pos, 10, 10, delegate
560 {
561 });
562 List<Point> list10 = EClass._map.ListPointsInCircle(CC.pos, 10f);
563 if (list10.Count == 0)
564 {
565 list10.Add(CC.pos.Copy());
566 }
567 CC.Say("spell_ball", CC, element.Name.ToLower());
568 TryDelay(delegate
569 {
570 CC.PlaySound("spell_ball");
571 });
573 {
574 Shaker.ShakeCam("ball");
575 }
576 EClass.Wait(1f, CC);
577 DamageEle(CC, id, power, element, list10, actRef, "spell_ball");
578 return;
579 }
580 case EffectId.Comet:
581 {
582 EffectMeteor.CreateComet(tp, delegate
583 {
584 }, matColor * 2f);
585 List<Point> list2 = EClass._map.ListPointsInCircle(tp, 7f);
586 if (list2.Count == 0)
587 {
588 list2.Add(tp.Copy());
589 }
590 CC.Say("spell_ball", CC, element.Name.ToLower());
591 TryDelay(delegate
592 {
593 CC.PlaySound("spell_ball");
594 });
596 {
597 Shaker.ShakeCam("ball");
598 }
599 EClass.Wait(1f, CC);
600 DamageEle(CC, id, power, element, list2, actRef, "spell_ball", tp);
601 return;
602 }
603 case EffectId.Hand:
604 case EffectId.DrainBlood:
605 case EffectId.DrainMana:
606 case EffectId.Sword:
607 {
608 List<Point> list4 = new List<Point>();
609 list4.Add(tp.Copy());
610 EClass.Wait(0.3f, CC);
611 TryDelay(delegate
612 {
613 CC.PlaySound("spell_hand");
614 });
615 if (!DamageEle(CC, id, power, element, list4, actRef, (id == EffectId.DrainBlood || id == EffectId.DrainMana) ? "" : ((id == EffectId.Sword) ? "spell_sword" : "spell_hand")))
616 {
617 CC.Say("spell_hand_miss", CC, element.Name.ToLower());
618 }
619 if (id == EffectId.Sword && CC.ExistsOnMap)
620 {
621 CC.ModExp(101, 50);
622 }
623 return;
624 }
625 case EffectId.Arrow:
626 case EffectId.MoonSpear:
627 case EffectId.MoonArrow:
628 {
629 List<Point> list = new List<Point>();
630 list.Add(tp.Copy());
631 CC.Say((id == EffectId.MoonSpear) ? "spell_spear" : "spell_arrow", CC, element.Name.ToLower());
632 EClass.Wait(0.5f, CC);
633 TryDelay(delegate
634 {
635 CC.PlaySound((id == EffectId.MoonSpear) ? "spell_moonspear" : "spell_arrow");
636 });
637 DamageEle(CC, id, power, element, list, actRef, (id == EffectId.MoonSpear) ? "spell_spear" : "spell_arrow");
638 return;
639 }
640 case EffectId.Missile:
641 {
642 List<Point> list7 = new List<Point>();
643 List<Point> list8 = new List<Point> { tp.Copy() };
644 foreach (Point item in EClass._map.ListPointsInCircle(tp, 6f, mustBeWalkable: false))
645 {
646 if (item.Equals(tp) || !Los.IsVisible(CC.pos, item))
647 {
648 continue;
649 }
650 foreach (Card item2 in item.ListCards())
651 {
652 if ((item2.isChara && CC.IsHostile(item2.Chara)) || item2.trait.CanBeAttacked)
653 {
654 list8.Add(item);
655 break;
656 }
657 }
658 }
659 CC.Say("spell_missile", CC, element.Name.ToLower());
660 EClass.Wait(0.5f, CC);
661 TryDelay(delegate
662 {
663 CC.PlaySound("spell_missile");
664 });
665 for (int num9 = 0; num9 < 6 + EClass.rnd(7); num9++)
666 {
667 list7.Clear();
668 list7.Add(list8.RandomItem());
669 DamageEle(CC, id, power, element, list7, actRef, "spell_missile");
670 }
671 return;
672 }
673 case EffectId.Summon:
674 {
675 string n = actRef.n1;
676 if (!(n == "special"))
677 {
678 if (n == "special2")
679 {
680 if (EClass._zone.HasField(10000))
681 {
682 foreach (Chara item3 in EClass._map.charas.Where((Chara _c) => _c.id == "cocoon").ToList())
683 {
684 if (!item3.pos.IsSunLit)
685 {
686 item3.pos.PlayEffect("darkwomb3");
687 item3.HatchEgg();
688 }
689 }
690 }
691 CC.PlayEffect("darkwomb");
692 SE.Play("ab_womb");
693 }
694 else
695 {
696 CC.Say("summon_ally", CC);
697 }
698 }
699 else
700 {
701 SE.Play("warhorn");
702 Msg.Say("warhorn");
703 }
704 if (EClass._zone.CountMinions(CC) >= CC.MaxSummon || CC.c_uidMaster != 0)
705 {
706 CC.Say("summon_ally_fail", CC);
707 return;
708 }
709 string id3 = actRef.n1;
710 int num3 = 1;
711 int num4 = -1;
712 int radius = 3;
713 bool flag3 = false;
714 bool flag4 = actRef.n1 == "special";
715 int num5 = -1;
716 string text = "";
717 switch (actRef.n1)
718 {
719 case "shadow":
720 case "tsunami":
721 num3 = Mathf.Clamp(power / 100, 1, 5) + ((power >= 100) ? EClass.rnd(2) : 0);
722 break;
723 case "monster":
724 case "fire":
725 case "animal":
726 num3 = 1 + EClass.rnd(2);
727 break;
728 case "special_force":
729 id3 = "army_palmia";
730 num3 = 4 + EClass.rnd(2);
731 num5 = EClass._zone.DangerLv;
732 break;
733 case "tentacle":
734 num4 = 20 + EClass.rnd(10);
735 radius = 1;
736 break;
737 case "special":
738 CC.SetInt(70, EClass.world.date.GetRaw() + 1440);
739 num3 = Mathf.Clamp(7 + CC.LV / 100, 4, 20);
740 num5 = CC.LV;
741 break;
742 case "special2":
743 num3 = 30;
744 num5 = CC.LV;
745 break;
746 }
747 num3 += CC.Evalue(1240);
748 for (int num6 = 0; num6 < num3; num6++)
749 {
750 if (EClass._zone.CountMinions(CC) >= CC.MaxSummon)
751 {
752 break;
753 }
754 Point point = null;
755 point = ((!(actRef.n1 == "special2")) ? tp.GetRandomPoint(radius)?.GetNearestPoint(allowBlock: false, allowChara: false) : EClass._map.GetRandomSurface(centered: false, walkable: true, allowWater: true)?.GetNearestPoint(allowBlock: false, allowChara: false));
756 if (point == null || !point.IsValid)
757 {
758 continue;
759 }
760 Chara chara2 = null;
762 if (num5 != -1)
763 {
764 CardBlueprint.current.lv = num5;
765 }
766 if (!text.IsEmpty())
767 {
768 CardBlueprint.current.idEle = text;
769 }
770 switch (actRef.n1)
771 {
772 case "special":
773 if (num6 == 0 && !CC.HasMinion("imolonac") && !CC.HasMinion("ygolonac"))
774 {
775 chara2 = CharaGen.Create((EClass.rnd(20) == 0) ? "imolonac" : "ygolonac");
776 break;
777 }
778 chara2 = CharaGen.Create("hound", CC.LV);
779 if (text.IsEmpty())
780 {
781 text = chara2.MainElement.source.alias;
782 }
783 break;
784 case "special2":
785 chara2 = CharaGen.Create("cocoon");
786 break;
787 case "yeek":
788 chara2 = CharaGen.CreateFromFilter(SpawnListChara.Get("summon_yeek", (SourceChara.Row r) => r.race == "yeek"), power / 10);
789 break;
790 case "orc":
791 chara2 = CharaGen.CreateFromFilter(SpawnListChara.Get("summon_orc", (SourceChara.Row r) => r.race == "orc"), power / 10);
792 break;
793 case "dragon":
794 chara2 = CharaGen.CreateFromFilter(SpawnListChara.Get("summon_dragon", (SourceChara.Row r) => r.race == "dragon" || r.race == "drake" || r.race == "wyvern"), power / 5);
795 break;
796 case "undead":
797 chara2 = CharaGen.CreateFromFilter(SpawnListChara.Get("summon_undead", (SourceChara.Row r) => r.HasTag(CTAG.undead) || (EClass.sources.races.map.TryGetValue(r.race)?.IsUndead ?? false)), power / 5);
798 break;
799 case "pawn":
800 chara2 = CharaGen.CreateFromFilter("c_pawn", power / 10);
801 break;
802 case "machine":
803 chara2 = CharaGen.CreateFromFilter("c_machine", power / 10);
804 break;
805 case "monster":
806 chara2 = CharaGen.CreateFromFilter("c_dungeon", power / 10);
807 break;
808 case "animal":
809 chara2 = CharaGen.CreateFromFilter("c_animal", power / 15);
810 break;
811 case "fire":
812 chara2 = CharaGen.CreateFromElement("Fire", power / 10);
813 break;
814 case "fish":
815 chara2 = CharaGen.CreateFromFilter(SpawnListChara.Get("summon_fish", (SourceChara.Row r) => r.ContainsTag("water") || r.model.Chara.race.tag.Contains("water")), power / 10);
816 break;
817 case "octopus":
818 chara2 = CharaGen.CreateFromFilter(SpawnListChara.Get("summon_octopus", (SourceChara.Row r) => r.race == "octopus"), power / 10);
819 break;
820 default:
821 chara2 = CharaGen.Create(id3, power / 10);
822 break;
823 }
824 if (chara2 == null)
825 {
826 continue;
827 }
828 if (chara2.rarity >= Rarity.Legendary && !flag4)
829 {
830 num6--;
831 continue;
832 }
833 long num7 = -1L;
834 n = actRef.n1;
835 if (!(n == "shadow"))
836 {
837 if (n == "special2")
838 {
839 point.PlayEffect("darkwomb2");
840 }
841 else
842 {
843 int num8 = 1;
844 if (!CC.IsPC)
845 {
846 num8 = (CC.IsPCFactionOrMinion ? (CC.LV / 2) : (CC.LV / 3 * 2));
847 }
848 if (num5 == -1)
849 {
850 num7 = chara2.LV * (100 + power / 10) / 100 + power / 30;
851 }
852 if (num7 < num8)
853 {
854 num7 = num8;
855 }
856 if (num7 > 99999999)
857 {
858 num7 = 99999999L;
859 }
860 }
861 }
862 else
863 {
864 num7 = power / 10 + 1;
865 }
866 if (chara2.LV < num7)
867 {
868 chara2.SetLv((int)num7);
869 }
870 chara2.interest = 0;
871 if (chara2.HaveFur())
872 {
873 chara2.c_fur = -1;
874 }
875 n = actRef.n1;
876 if (!(n == "shadow"))
877 {
878 if (n == "special_force")
879 {
880 chara2.homeZone = EClass._zone;
881 }
882 }
883 else
884 {
885 chara2.hp = chara2.MaxHP / 2;
886 }
887 EClass._zone.AddCard(chara2, point);
888 if (flag)
889 {
890 Chara chara3 = chara2;
891 Hostility hostility = (chara2.c_originalHostility = Hostility.Enemy);
892 chara3.hostility = hostility;
893 }
894 else if (!(chara2.id == "cocoon") && (!(actRef.n1 == "monster") || actRef.refThing == null))
895 {
896 chara2.MakeMinion(CC);
897 }
898 if (num4 != -1)
899 {
900 chara2.SetSummon(num4);
901 }
902 flag3 = true;
903 }
904 if (!flag3)
905 {
906 CC.Say("summon_ally_fail", CC);
907 }
908 return;
909 }
910 case EffectId.Funnel:
911 case EffectId.Bit:
912 {
913 if (EClass._zone.CountMinions(CC) >= CC.MaxSummon || CC.c_uidMaster != 0)
914 {
915 CC.Say("summon_ally_fail", CC);
916 return;
917 }
918 CC.Say("spell_funnel", CC, element.Name.ToLower());
919 CC.PlaySound("spell_funnel");
920 Chara chara = CharaGen.Create((id == EffectId.Bit) ? "bit2" : "bit");
921 chara.SetMainElement(element.source.alias, element.Value, elemental: true);
922 chara.SetSummon(20 + power / 20 + EClass.rnd(10));
923 chara.SetLv(Mathf.Abs(power) / 15);
924 chara.interest = 0;
925 EClass._zone.AddCard(chara, tp.GetNearestPoint(allowBlock: false, allowChara: false));
926 chara.PlayEffect("teleport");
927 chara.MakeMinion(CC);
928 return;
929 }
930 case EffectId.Breathe:
931 {
932 List<Point> list5 = EClass._map.ListPointsInArc(CC.pos, tp, 7, 35f);
933 if (list5.Count == 0)
934 {
935 list5.Add(CC.pos.Copy());
936 }
937 CC.Say("spell_breathe", CC, element.Name.ToLower());
938 EClass.Wait(0.8f, CC);
939 TryDelay(delegate
940 {
941 CC.PlaySound("spell_breathe");
942 });
944 {
945 Shaker.ShakeCam("breathe");
946 }
947 DamageEle(CC, id, power, element, list5, actRef, "spell_breathe");
948 return;
949 }
950 case EffectId.Scream:
951 CC.PlaySound("scream");
952 CC.PlayEffect("scream");
953 {
954 foreach (Point item4 in EClass._map.ListPointsInCircle(cc.pos, 6f, mustBeWalkable: false, los: false))
955 {
956 foreach (Chara chara4 in item4.Charas)
957 {
958 if (chara4.ResistLv(957) <= 0)
959 {
960 chara4.AddCondition<ConParalyze>(power);
961 }
962 }
963 }
964 return;
965 }
966 case EffectId.Ball:
967 case EffectId.Explosive:
968 case EffectId.BallBubble:
969 case EffectId.Suicide:
970 case EffectId.Rocket:
971 case EffectId.Flare:
972 case EffectId.GravityGun:
973 {
974 float radius2 = ((id == EffectId.GravityGun) ? 4f : ((id == EffectId.Rocket) ? 2.8f : ((id == EffectId.Suicide) ? 3.5f : ((id == EffectId.Flare) ? 2.1f : ((float)((id == EffectId.BallBubble) ? 2 : 5))))));
975 if ((id == EffectId.Explosive || id == EffectId.Rocket) && actRef.refThing != null)
976 {
977 radius2 = 2 + actRef.refThing.Evalue(666);
978 }
979 if (id == EffectId.Suicide)
980 {
981 if (CC.MainElement != Element.Void)
982 {
983 element = CC.MainElement;
984 }
986 {
987 element = Element.Create(919, 10);
988 }
989 if (CC.HasTag(CTAG.kamikaze))
990 {
991 radius2 = 1.5f;
992 }
993 }
994 bool flag5 = id == EffectId.Explosive || id == EffectId.Suicide || id == EffectId.Rocket;
995 List<Point> list9 = EClass._map.ListPointsInCircle((id == EffectId.GravityGun || id == EffectId.Rocket || id == EffectId.Flare) ? tp : cc.pos, radius2, !flag5, !flag5);
996 if (list9.Count == 0)
997 {
998 list9.Add(cc.pos.Copy());
999 }
1000 cc.Say((id == EffectId.Suicide) ? "abSuicide" : "spell_ball", cc, element.Name.ToLower());
1001 EClass.Wait(0.8f, cc);
1002 TryDelay(delegate
1003 {
1004 if (id == EffectId.Flare)
1005 {
1006 tp.PlayEffect("flare");
1007 }
1008 if (id != EffectId.GravityGun)
1009 {
1010 cc.PlaySound((id == EffectId.Flare) ? "spell_flare" : "spell_ball");
1011 }
1012 });
1014 {
1015 Shaker.ShakeCam("ball");
1016 }
1017 DamageEle(actRef.origin ?? cc, id, power, element, list9, actRef, (id == EffectId.Suicide) ? "suicide" : "spell_ball");
1018 if (id == EffectId.Suicide && CC.IsAliveInCurrentZone)
1019 {
1020 CC.Die();
1021 }
1022 return;
1023 }
1024 case EffectId.Bolt:
1025 {
1026 List<Point> list6 = EClass._map.ListPointsInLine(CC.pos, tp, 10);
1027 if (list6.Count == 0)
1028 {
1029 list6.Add(CC.pos.Copy());
1030 }
1031 CC.Say("spell_bolt", CC, element.Name.ToLower());
1032 EClass.Wait(0.8f, CC);
1033 TryDelay(delegate
1034 {
1035 CC.PlaySound("spell_bolt");
1036 });
1038 {
1039 Shaker.ShakeCam("bolt");
1040 }
1041 DamageEle(CC, id, power, element, list6, actRef, "spell_bolt");
1042 return;
1043 }
1044 case EffectId.Bubble:
1045 case EffectId.Web:
1046 case EffectId.MistOfDarkness:
1047 case EffectId.Puddle:
1048 {
1049 if (LangGame.Has("ab" + id))
1050 {
1051 CC.Say("ab" + id, CC);
1052 }
1053 tp.PlaySound("vomit");
1054 int num = 2 + EClass.rnd(3);
1055 int id2 = ((id == EffectId.Puddle) ? 4 : ((id == EffectId.Bubble) ? 5 : ((id == EffectId.MistOfDarkness) ? 6 : 7)));
1056 EffectId idEffect = ((id == EffectId.Bubble) ? EffectId.BallBubble : EffectId.PuddleEffect);
1057 if (id == EffectId.Bubble && CC.id == "cancer")
1058 {
1059 idEffect = EffectId.Nothing;
1060 num = 1 + EClass.rnd(3);
1061 }
1062 for (int i = 0; i < num; i++)
1063 {
1064 Point randomPoint = tp.GetRandomPoint(2);
1065 if (randomPoint != null && !randomPoint.HasBlock && (id != EffectId.Puddle || !randomPoint.cell.IsTopWaterAndNoSnow))
1066 {
1067 int num2 = 4 + EClass.rnd(5);
1068 if (id == EffectId.Web)
1069 {
1070 num2 *= 3;
1071 }
1072 EClass._map.SetEffect(randomPoint.x, randomPoint.z, new CellEffect
1073 {
1074 id = id2,
1075 amount = num2,
1076 idEffect = idEffect,
1077 idEle = element.id,
1078 power = power,
1079 isHostileAct = CC.IsPCParty,
1080 color = BaseTileMap.GetColorInt(ref matColor, 100)
1081 });
1082 }
1083 }
1084 return;
1085 }
1086 }
1087 List<Card> list11 = tp.ListCards().ToList();
1088 list11.Reverse();
1089 if (list11.Contains(CC))
1090 {
1091 list11.Remove(CC);
1092 list11.Insert(0, CC);
1093 }
1094 bool flag6 = true;
1095 foreach (Card item5 in list11)
1096 {
1097 if (tc == null || item5 == tc)
1098 {
1099 Proc(id, power, state, CC, item5, actRef);
1100 if (flag2 && item5.isChara && item5 != CC)
1101 {
1102 CC.DoHostileAction(item5);
1103 }
1104 if (actRef.refThing == null || !(actRef.refThing.trait is TraitRod))
1105 {
1106 return;
1107 }
1108 EffectId effectId = id;
1109 if ((uint)(effectId - 200) <= 4u)
1110 {
1111 return;
1112 }
1113 flag6 = false;
1114 }
1115 }
1116 if (flag6)
1117 {
1118 CC.SayNothingHappans();
1119 }
1120 }
Hostility
Definition: Hostility.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, Point center=null)
Definition: ActEffect.cs:36
static int GetColorInt(ref Color matColor, int p)
void HatchEgg()
Definition: Card.cs:6123
int c_uidMaster
Definition: Card.cs:1489
Card SetLv(int a)
Definition: Card.cs:3070
bool IsInMutterDistance(int d=10)
Definition: Card.cs:8248
bool HaveFur()
Definition: Card.cs:8414
int ResistLv(int res)
Definition: Card.cs:6378
bool IsTopWaterAndNoSnow
Definition: Cell.cs:756
static Chara CreateFromElement(string idEle, int lv=-1, string idFilter="chara")
Definition: CharaGen.cs:32
Element MainElement
Definition: Chara.cs:735
void SetMainElement(string id, int v=0, bool elemental=false)
Definition: Chara.cs:2271
bool HasMinion(string id)
Definition: Chara.cs:2600
int MaxSummon
Definition: Chara.cs:732
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2556
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
Definition: Chara.cs:5634
void SetSummon(int duration)
Definition: Chara.cs:2612
GraphicSetting graphic
Definition: CoreConfig.cs:625
int GetRaw(int offsetHours=0)
Definition: Date.cs:328
static World world
Definition: EClass.cs:41
Definition: EInput.cs:8
static bool isShiftDown
Definition: EInput.cs:272
static void Create(Point center, int radius, int count, Action< int, Point > onComplete)
Definition: EffectMeteor.cs:40
static void CreateComet(Point center, Action< int, Point > onComplete, Color color)
Definition: EffectMeteor.cs:71
static Element Void
Definition: ELEMENT.cs:247
static bool Has(string id)
Definition: LangGame.cs:99
Definition: Los.cs:5
static bool IsVisible(Point p1, Point p2, Action< Point, bool > _onVisit=null)
Definition: Los.cs:167
Point GetRandomSurface(int x, int z, int radius, bool walkable=true, bool allowWater=false)
Definition: MapBounds.cs:182
List< Point > ListPointsInArc(Point center, Point to, int radius, float angle)
Definition: Map.cs:2462
void SetEffect(int x, int z, CellEffect effect=null)
Definition: Map.cs:1648
List< Point > ListPointsInLine(Point center, Point to, int radius, bool returnOnBlocked=true)
Definition: Map.cs:2479
List< Point > ListPointsInCircle(Point center, float radius, bool mustBeWalkable=true, bool los=true)
Definition: Map.cs:2418
int z
Definition: Point.cs:39
List< Chara > Charas
Definition: Point.cs:340
bool IsSunLit
Definition: Point.cs:182
Effect PlayEffect(string id)
Definition: Point.cs:1254
Definition: Shaker.cs:5
static void ShakeCam(string id="default", float magnitude=1f)
Definition: Shaker.cs:25
SourceRace races
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:4025
bool HasField(int idEle)
Definition: Zone.cs:3166
override int DangerLv
Definition: Zone.cs:115
Chara origin
Definition: ActRef.cs:11

References EClass._map, EClass._zone, Zone.AddCard(), Chara.AddCondition(), angle, Card.c_uidMaster, Trait.CanBeAttacked, Point.cell, Card.Chara, Map.charas, Point.Charas, Color, EClass.Colors, Core.config, Point.Copy(), EClass.core, Zone.CountMinions(), Element.Create(), EffectMeteor.Create(), CharaGen.Create(), EffectMeteor.CreateComet(), CharaGen.CreateFromElement(), CharaGen.CreateFromFilter(), DamageEle(), Zone.DangerLv, World.date, EClass.debug, Debug, Chara.Die(), CoreConfig.GraphicSetting.disableShake, CoreConfig.Test.disableShake2, ColorProfile.elementColors, CoreDebug.enable, Card.Evalue(), Card.ExistsOnMap, SpawnListChara.Get(), BaseTileMap.GetColorInt(), Point.GetNearestPoint(), Point.GetRandomPoint(), MapBounds.GetRandomSurface(), Date.GetRaw(), CoreConfig.graphic, LangGame.Has(), Point.HasBlock, Chara.HasCondition(), Zone.HasField(), Chara.HasMinion(), Card.HasTag(), Card.HatchEgg(), Card.HaveFur(), Card.id, Element.id, if(), Chara.IsAliveInCurrentZone, Card.isChara, Chara.IsHostile(), Card.IsInMutterDistance(), Chara.IsPC, Chara.IsPCParty, EInput.isShiftDown, Point.IsSunLit, Cell.IsTopWaterAndNoSnow, Point.IsValid, Los.IsVisible(), item, Map.ListPointsInArc(), Map.ListPointsInCircle(), Map.ListPointsInLine(), Card.LV, Chara.MainElement, Chara.MakeMinion(), Chara.MaxSummon, Card.ModExp(), Element.Name, Effect.Play(), Point.PlayEffect(), Card.PlayEffect(), Point.PlaySound(), Card.PlaySound(), Card.pos, SourceManager.races, Card.rarity, Card.ResistLv(), EClass.rnd(), Msg.Say(), Card.Say(), CardBlueprint.Set(), Map.SetEffect(), Card.SetInt(), Card.SetLv(), Chara.SetMainElement(), Chara.SetSummon(), Shaker.ShakeCam(), Element.source, EClass.sources, CoreConfig.test, Card.trait, 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(), ActMissileBarrage2.Perform(), ActRanged.Perform(), ActZap.Perform(), AttackProcess.ProcAbility(), AI_UseCrafter.Run(), and StanceSongEnd.TickSong().

◆ 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 3150 of file ActEffect.cs.

3151 {
3153 string netMsg = GameLang.Parse("wish".langGame(), thirdPerson: true, name, s);
3154 List<WishItem> list = new List<WishItem>();
3155 long wishLv = 10 + power / 4;
3156 int wishValue = MathEx.ClampToInt(5000 + (long)power * 50L);
3157 if (state >= BlessedState.Blessed)
3158 {
3159 wishLv = wishLv * 150 / 100;
3160 }
3161 else if (state <= BlessedState.Cursed)
3162 {
3163 wishLv = wishLv * 150 / 100;
3164 wishValue = 1;
3165 }
3166 Debug.Log(power + "/" + wishValue);
3167 string _s = s.ToLower();
3168 foreach (CardRow r in EClass.sources.cards.rows)
3169 {
3170 if (r.HasTag(CTAG.godArtifact))
3171 {
3172 bool flag = false;
3173 foreach (Religion item in EClass.game.religions.list)
3174 {
3175 if (item.giftRank >= 2 && item.IsValidArtifact(r.id))
3176 {
3177 flag = true;
3178 }
3179 }
3180 if (!flag)
3181 {
3182 continue;
3183 }
3184 }
3185 else if (r.quality >= 4 || r.HasTag(CTAG.noWish))
3186 {
3187 switch (r.id)
3188 {
3189 case "medal":
3190 case "plat":
3191 case "money":
3192 case "money2":
3193 break;
3194 default:
3195 continue;
3196 }
3197 }
3198 if (r.isChara)
3199 {
3200 continue;
3201 }
3202 string text = r.GetName().ToLower();
3203 int score = Compare(_s, text);
3204 if (score == 0)
3205 {
3206 continue;
3207 }
3208 list.Add(new WishItem
3209 {
3210 score = score,
3211 n = text,
3212 action = delegate
3213 {
3214 Debug.Log(r.id);
3215 SourceCategory.Row category = EClass.sources.cards.map[r.id].Category;
3216 if (category.IsChildOf("weapon") || category.IsChildOf("armor") || category.IsChildOf("ranged"))
3217 {
3218 CardBlueprint.SetRarity(Rarity.Legendary);
3219 }
3220 Thing thing = ThingGen.Create(r.id, -1, MathEx.ClampToInt(wishLv));
3221 int num = 1;
3222 int price = thing.GetPrice(CurrencyType.Money, sell: false, PriceType.Tourism);
3223 bool flag2 = thing.trait is TraitDeed || thing.rarity >= Rarity.Artifact || thing.source._origin == "artifact_summon";
3224 switch (thing.id)
3225 {
3226 case "rod_wish":
3227 thing.c_charges = 0;
3228 break;
3229 case "money":
3230 num = EClass.rndHalf(wishValue * 3);
3231 break;
3232 case "plat":
3233 num = EClass.rndHalf(wishValue / 500 + 4);
3234 break;
3235 case "money2":
3236 num = EClass.rndHalf(wishValue / 500 + 4);
3237 break;
3238 case "medal":
3239 num = EClass.rndHalf(wishValue / 2000 + 4);
3240 break;
3241 default:
3242 if (!flag2 && thing.trait.CanStack)
3243 {
3244 int num2 = wishValue;
3245 num2 -= price;
3246 for (int i = 1; i < 1000; i++)
3247 {
3248 int num3 = price + i * 2 * (price + 500);
3249 if (num3 > 0 && num2 > num3)
3250 {
3251 num++;
3252 num2 -= num3;
3253 }
3254 }
3255 }
3256 break;
3257 }
3258 if (price > 2500 && num > 3)
3259 {
3260 num = 3 + (int)Mathf.Sqrt(num - 3);
3261 }
3262 if (price > 5000 && num > 2)
3263 {
3264 num = 2 + (int)Mathf.Sqrt(num - 2) / 2;
3265 }
3266 if (price > 10000 && num > 1)
3267 {
3268 num = 1 + Mathf.Min((int)Mathf.Sqrt(num - 1) / 3, 2);
3269 }
3270 if (num < 1)
3271 {
3272 num = 1;
3273 }
3274 thing.SetNum(num);
3275 Debug.Log(_s + "/" + num + "/" + score);
3276 if (thing.HasTag(CTAG.godArtifact))
3277 {
3278 EClass.game.religions.Reforge(thing.id);
3279 }
3280 else
3281 {
3282 EClass._zone.AddCard(thing, EClass.pc.pos);
3283 }
3284 netMsg = netMsg + Lang.space + GameLang.Parse("wishNet".langGame(), Msg.IsThirdPerson(thing), Msg.GetName(thing).ToTitleCase());
3285 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
3286 Msg.Say("dropReward");
3287 }
3288 });
3289 }
3290 if (list.Count == 0)
3291 {
3292 netMsg = netMsg + Lang.space + "wishFail".langGame();
3293 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
3294 Msg.Say("wishFail");
3295 return false;
3296 }
3297 list.Sort((WishItem a, WishItem b) => b.score - a.score);
3298 foreach (WishItem item2 in list)
3299 {
3300 Debug.Log(item2.score + "/" + s + "/" + item2.n);
3301 }
3302 list[0].action();
3303 return true;
3304 }
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:3306
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
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
Definition: GameLang.cs:177
static string langCode
Definition: Lang.cs:29
static bool IsThirdPerson(Card c)
Definition: Msg.cs:296
static ThirstPersonInfo thirdPerson1
Definition: Msg.cs:6
static string GetName(Card c)
Definition: Msg.cs:279
Definition: Net.cs:12
static async UniTask< bool > SendChat(string name, string msg, ChatCategory cat, string idLang)
Definition: Net.cs:335
Thing Reforge(string id, Point pos=null, bool first=true)
List< Religion > list
bool HasTag(CTAG _tag)
Definition: RenderRow.cs:136
List< CardRow > rows
Definition: SourceCard.cs:7
Dictionary< string, CardRow > map
Definition: SourceCard.cs:9
SourceCard cards
override int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Thing.cs:829
void Set(string n)
virtual SourceElement.Row source
Definition: TraitScroll.cs:5

References EClass._zone, Zone.AddCard(), SourceManager.cards, MathEx.ClampToInt(), Compare(), ThingGen.Create(), Debug, EClass.game, Msg.GetName(), CardRow.GetName(), Thing.GetPrice(), RenderRow.HasTag(), CardRow.id, if(), CardRow.isChara, Msg.IsThirdPerson(), item, Lang.langCode, ReligionManager.list, SourceCard.map, GameLang.Parse(), EClass.pc, Card.pos, CardRow.quality, ReligionManager.Reforge(), Game.religions, SourceCard.rows, Msg.Say(), 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

◆ 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: