Elin Decompiled Documentation EA 23.286 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)
 
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 3029 of file ActEffect.cs.

3030 {
3031 if (s.IsEmpty())
3032 {
3033 return 0;
3034 }
3035 int num = 0;
3036 if (t == s)
3037 {
3038 num += 100 + EClass.rnd(30);
3039 }
3040 if (t.Contains(s))
3041 {
3042 num += 100 + EClass.rnd(30);
3043 }
3044 return num;
3045 }
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 
)
inlinestatic

Definition at line 36 of file ActEffect.cs.

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

Referenced by ProcAt().

◆ GeneMiracle()

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

Definition at line 2838 of file ActEffect.cs.

2839 {
2841 {
2843 return;
2844 }
2845 if (c == tc)
2846 {
2847 tc.Say("love_ground", tc);
2848 }
2849 else
2850 {
2851 tc.Say("love_chara", c, tc);
2852 }
2853 Thing t = tc.MakeGene(type);
2854 tc.GiveBirth(t, effect: true);
2855 }
Thing GiveBirth(Thing t, bool effect)
Definition: Card.cs:5876
Thing MakeGene(DNA.Type? type=null)
Definition: Chara.cs:8356
Definition: Msg.cs:5
static string SayNothingHappen()
Definition: Msg.cs:96
Definition: Thing.cs:8
virtual bool IsUserZone
Definition: Zone.cs:273

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

2858 {
2859 Point point = new Point();
2860 for (int i = 0; i < 10000; i++)
2861 {
2862 point.Set(org);
2863 point.x += EClass.rnd(radius) - EClass.rnd(radius);
2864 point.z += EClass.rnd(radius) - EClass.rnd(radius);
2865 if (point.IsValid && point.IsInBounds && !point.cell.blocked && point.Distance(org) >= radius / 3 + 1 - i / 50 && !point.cell.HasZoneStairs())
2866 {
2867 return point;
2868 }
2869 }
2870 return org.GetRandomNeighbor().GetNearestPoint();
2871 }
bool HasZoneStairs(bool includeLocked=true)
Definition: Cell.cs:1717
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:619
bool IsValid
Definition: Point.cs:88
bool IsInBounds
Definition: Point.cs:104
Point GetRandomNeighbor()
Definition: Point.cs:759

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

2807 {
2808 if (c == tc)
2809 {
2810 tc.Say("love_ground", tc);
2811 }
2812 else
2813 {
2814 tc.Say("love_chara", c, tc);
2815 }
2816 tc.ModAffinity(EClass.pc, power / 4);
2817 if ((idEffect != EffectId.Love || EClass.rnd(2) != 0) && (!EClass._zone.IsUserZone || tc.IsPCFaction || !EClass.game.principal.disableUsermapBenefit))
2818 {
2819 if (idEffect == EffectId.MoonSpear && EClass.rnd(EClass.debug.enable ? 2 : 20) == 0)
2820 {
2821 Thing thing = tc.MakeGene();
2822 tc.GiveBirth(thing, effect: true);
2823 tc.Say("item_drop", thing);
2824 }
2825 else if (idEffect != EffectId.LovePlus && EClass.rnd(2) == 0)
2826 {
2827 Thing c2 = tc.MakeMilk(effect: true, 1, addToZone: true, state);
2828 tc.Say("item_drop", c2);
2829 }
2830 else
2831 {
2832 Thing c3 = tc.MakeEgg(effect: true, 1, addToZone: true, (idEffect == EffectId.LovePlus) ? 3 : 20, state);
2833 tc.Say("item_drop", c3);
2834 }
2835 }
2836 }
Thing MakeMilk(bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
Definition: Card.cs:5845
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5822
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:8114
override bool IsPCFaction
Definition: Chara.cs:685
bool enable
Definition: CoreDebug.cs:286
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.Proc().

◆ Poison()

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

Definition at line 2790 of file ActEffect.cs.

2791 {
2792 tc.Say("eat_poison", tc);
2793 tc.Talk("scream");
2794 if (power > 100000000)
2795 {
2796 power = 100000000;
2797 }
2798 int num = (int)Mathf.Sqrt(power * 100);
2799 tc.DamageHP(num * 2 + EClass.rnd(num), 915, power);
2800 if (!tc.isDead && !tc.IsPC)
2801 {
2803 }
2804 }
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6935
override bool IsPC
Definition: Chara.cs:626
bool isDead
Definition: Chara.cs:391

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

Referenced by FoodEffect.Proc().

◆ Proc() [1/2]

◆ Proc() [2/2]

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

Definition at line 1040 of file ActEffect.cs.

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

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

◆ ProcAt()

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

Definition at line 492 of file ActEffect.cs.

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

References EClass._map, EClass._zone, Zone.AddCard(), Chara.AddCondition(), angle, Card.c_uidMaster, 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(), CharaGen.CreateFromElement(), CharaGen.CreateFromFilter(), DamageEle(), Zone.DangerLv, World.date, EClass.debug, Debug, Chara.Die(), CoreConfig.GraphicSetting.disableShake, ColorProfile.elementColors, CoreDebug.enable, Card.Evalue(), SpawnListChara.Get(), BaseTileMap.GetColorInt(), Point.GetNearestPoint(), Point.GetRandomPoint(), MapBounds.GetRandomSurface(), Date.GetRaw(), CoreConfig.graphic, LangGame.Has(), Point.HasBlock, Chara.HasCondition(), Zone.HasField(), Chara.HasMinion(), Card.HasTag(), Card.HaveFur(), Card.id, Element.id, if(), Chara.IsAliveInCurrentZone, Card.IsInMutterDistance(), Chara.IsPC, Chara.IsPCParty, EInput.isShiftDown, Cell.IsTopWaterAndNoSnow, Point.IsValid, item, Map.ListPointsInArc(), Map.ListPointsInCircle(), Map.ListPointsInLine(), Card.LV, Chara.MainElement, Chara.MakeMinion(), Chara.MaxSummon, Element.Name, 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(), BaseCard.SetInt(), Card.SetLv(), Chara.SetMainElement(), Chara.SetSummon(), Shaker.ShakeCam(), Element.source, EClass.sources, TryDelay(), UDictionary< TKey, TValue >.TryGetValue(), Element.Value, Element.Void, EClass.Wait(), EClass.world, Point.x, and Point.z.

Referenced by DamageEle(), Chara.Die(), Card.Explode(), ZoneEventDefenseGame.Horn_Ally(), TraitScrollStatic.OnRead(), Act.Perform(), ActMissileBarrage.Perform(), ActRanged.Perform(), ActZap.Perform(), AttackProcess.ProcAbility(), 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 2873 of file ActEffect.cs.

2874 {
2876 string netMsg = GameLang.Parse("wish".langGame(), thirdPerson: true, name, s);
2877 List<WishItem> list = new List<WishItem>();
2878 int wishLv = 10 + power / 4;
2879 int wishValue = 5000 + power * 50;
2880 if (state >= BlessedState.Blessed)
2881 {
2882 wishLv = wishLv * 150 / 100;
2883 }
2884 else if (state <= BlessedState.Cursed)
2885 {
2886 wishLv = wishLv * 150 / 100;
2887 wishValue = 1;
2888 }
2889 Debug.Log(power + "/" + wishValue);
2890 string _s = s.ToLower();
2891 foreach (CardRow r in EClass.sources.cards.rows)
2892 {
2893 if (r.HasTag(CTAG.godArtifact))
2894 {
2895 bool flag = false;
2896 foreach (Religion item in EClass.game.religions.list)
2897 {
2898 if (item.giftRank >= 2 && item.IsValidArtifact(r.id))
2899 {
2900 flag = true;
2901 }
2902 }
2903 if (!flag)
2904 {
2905 continue;
2906 }
2907 }
2908 else if (r.quality >= 4 || r.HasTag(CTAG.noWish))
2909 {
2910 switch (r.id)
2911 {
2912 case "medal":
2913 case "plat":
2914 case "money":
2915 case "money2":
2916 break;
2917 default:
2918 continue;
2919 }
2920 }
2921 if (r.isChara)
2922 {
2923 continue;
2924 }
2925 string text = r.GetName().ToLower();
2926 int score = Compare(_s, text);
2927 if (score == 0)
2928 {
2929 continue;
2930 }
2931 list.Add(new WishItem
2932 {
2933 score = score,
2934 n = text,
2935 action = delegate
2936 {
2937 Debug.Log(r.id);
2938 SourceCategory.Row category = EClass.sources.cards.map[r.id].Category;
2939 if (category.IsChildOf("weapon") || category.IsChildOf("armor") || category.IsChildOf("ranged"))
2940 {
2941 CardBlueprint.SetRarity(Rarity.Legendary);
2942 }
2943 Thing thing = ThingGen.Create(r.id, -1, wishLv);
2944 int num = 1;
2945 int price = thing.GetPrice(CurrencyType.Money, sell: false, PriceType.Tourism);
2946 bool flag2 = thing.trait is TraitDeed || thing.rarity >= Rarity.Artifact || thing.source._origin == "artifact_summon";
2947 switch (thing.id)
2948 {
2949 case "rod_wish":
2950 thing.c_charges = 0;
2951 break;
2952 case "money":
2953 num = EClass.rndHalf(wishValue * 3);
2954 break;
2955 case "plat":
2956 num = EClass.rndHalf(wishValue / 500 + 4);
2957 break;
2958 case "money2":
2959 num = EClass.rndHalf(wishValue / 500 + 4);
2960 break;
2961 case "medal":
2962 num = EClass.rndHalf(wishValue / 2000 + 4);
2963 break;
2964 default:
2965 if (!flag2 && thing.trait.CanStack)
2966 {
2967 int num2 = wishValue;
2968 num2 -= price;
2969 for (int i = 1; i < 1000; i++)
2970 {
2971 int num3 = price + i * 2 * (price + 500);
2972 if (num3 > 0 && num2 > num3)
2973 {
2974 num++;
2975 num2 -= num3;
2976 }
2977 }
2978 }
2979 break;
2980 }
2981 if (price > 2500 && num > 3)
2982 {
2983 num = 3 + (int)Mathf.Sqrt(num - 3);
2984 }
2985 if (price > 5000 && num > 2)
2986 {
2987 num = 2 + (int)Mathf.Sqrt(num - 2) / 2;
2988 }
2989 if (price > 10000 && num > 1)
2990 {
2991 num = 1 + Mathf.Min((int)Mathf.Sqrt(num - 1) / 3, 2);
2992 }
2993 if (num < 1)
2994 {
2995 num = 1;
2996 }
2997 thing.SetNum(num);
2998 Debug.Log(_s + "/" + num + "/" + score);
2999 if (thing.HasTag(CTAG.godArtifact))
3000 {
3001 Religion.Reforge(thing.id);
3002 }
3003 else
3004 {
3005 EClass._zone.AddCard(thing, EClass.pc.pos);
3006 }
3007 netMsg = netMsg + Lang.space + GameLang.Parse("wishNet".langGame(), Msg.IsThirdPerson(thing), Msg.GetName(thing).ToTitleCase());
3008 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
3009 Msg.Say("dropReward");
3010 }
3011 });
3012 }
3013 if (list.Count == 0)
3014 {
3015 netMsg = netMsg + Lang.space + "wishFail".langGame();
3016 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
3017 Msg.Say("wishFail");
3018 return false;
3019 }
3020 list.Sort((WishItem a, WishItem b) => b.score - a.score);
3021 foreach (WishItem item2 in list)
3022 {
3023 Debug.Log(item2.score + "/" + s + "/" + item2.n);
3024 }
3025 list[0].action();
3026 return true;
3027 }
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:3029
virtual string GetName(int i)
Definition: CardRow.cs:95
int quality
Definition: CardRow.cs:19
bool isChara
Definition: CardRow.cs:55
string id
Definition: CardRow.cs:7
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:7504
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
Definition: GameLang.cs:178
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:11
static async UniTask< bool > SendChat(string name, string msg, ChatCategory cat, string idLang)
Definition: Net.cs:333
List< Religion > list
static Thing Reforge(string id, Point pos=null, bool first=true)
Definition: Religion.cs:300
bool HasTag(CTAG _tag)
Definition: RenderRow.cs:125
List< CardRow > rows
Definition: SourceCard.cs:7
Dictionary< string, CardRow > map
Definition: SourceCard.cs:9
SourceCard cards
void Set(string n)
virtual SourceElement.Row source
Definition: TraitScroll.cs:5

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

Member Data Documentation

◆ angle

int ActEffect.angle = 20
static

Definition at line 21 of file ActEffect.cs.

Referenced by ProcAt().

◆ RapidCount

int ActEffect.RapidCount
static

Definition at line 17 of file ActEffect.cs.

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

◆ RapidDelay

float ActEffect.RapidDelay
static

Definition at line 19 of file ActEffect.cs.

Referenced by TryDelay().


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