Elin Decompiled Documentation EA 23.316 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 3074 of file ActEffect.cs.

3075 {
3076 if (s.IsEmpty())
3077 {
3078 return 0;
3079 }
3080 int num = 0;
3081 if (t == s)
3082 {
3083 num += 100 + EClass.rnd(30);
3084 }
3085 if (t.Contains(s))
3086 {
3087 num += 100 + EClass.rnd(30);
3088 }
3089 return num;
3090 }
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 if (e.id == 910)
181 {
182 EClass._map.TryShatter(p, 910, power, CC);
183 }
184 if (e.id == 911)
185 {
186 EClass._map.TryShatter(p, 911, power, CC);
187 }
188 foreach (Card item in p.ListCards().ToList())
189 {
190 Card c = item;
191 if ((!c.isChara && !c.trait.CanBeAttacked) || (c.IsMultisize && item == CC) || (c.isChara && (c.Chara.host == CC || c.Chara.parasite == CC || c.Chara.ride == CC)))
192 {
193 continue;
194 }
195 switch (id)
196 {
197 case EffectId.Arrow:
198 case EffectId.Hand:
199 case EffectId.Sword:
200 case EffectId.MoonSpear:
201 case EffectId.MoonArrow:
202 if (c.isChara && CC.isChara)
203 {
204 c.Chara.RequestProtection(CC.Chara, delegate(Chara a)
205 {
206 c = a;
207 });
208 }
209 if (id == EffectId.MoonSpear || (id == EffectId.MoonArrow && EClass.rnd(5) == 0))
210 {
211 attackSource = AttackSource.MoonSpear;
212 }
213 break;
214 }
215 switch (id)
216 {
217 case EffectId.Arrow:
218 attackSource = AttackSource.MagicArrow;
219 break;
220 case EffectId.Hand:
221 attackSource = AttackSource.MagicHand;
222 break;
223 case EffectId.Sword:
224 attackSource = AttackSource.MagicSword;
225 break;
226 }
227 long num4 = 0L;
228 bool isChara = CC.isChara;
229 if (id == EffectId.Suicide)
230 {
231 num4 = CC.MaxHP * 2;
232 num4 = num4 * 100 / (50 + point.Distance(p) * 75);
233 if ((c.HasCondition<ConBrightnessOfLife>() || c.HasTag(CTAG.suicide)) && !c.HasCondition<ConWet>() && !c.IsPowerful)
234 {
235 list.Add(c);
236 }
237 }
238 else
239 {
240 Dice dice = Dice.Create(text2, power, CC, (actref.refThing != null) ? null : actref.act);
241 if (dice == null)
242 {
243 Debug.Log(text2);
244 }
245 num4 = dice.Roll();
246 Debug.Log(id.ToString() + "/" + text2 + "/" + power + "/" + actref.act?.ToString() + "/" + dice?.ToString() + "/" + num4);
247 switch (id)
248 {
249 case EffectId.Earthquake:
250 if (c.HasCondition<ConGravity>())
251 {
252 num4 = dice.RollMax() * 2;
253 }
254 else if (c.isChara && c.Chara.IsLevitating)
255 {
256 num4 /= 2;
257 }
258 break;
259 case EffectId.Sword:
260 num4 = num4 * (int)Mathf.Min(70f + Mathf.Sqrt(CC.Evalue(101)) * 3f, 200f) / 100;
261 break;
262 case EffectId.GravityGun:
263 num4 /= 5;
264 break;
265 }
266 if (id == EffectId.Ball || id == EffectId.BallBubble || id == EffectId.Explosive || id == EffectId.Rocket || id == EffectId.GravityGun)
267 {
268 num4 = num4 * 100 / (90 + point.Distance(p) * 10);
269 }
270 }
271 if (id == EffectId.Sword)
272 {
273 c.PlaySound("ab_magicsword");
274 c.PlayEffect("hit_slash");
275 }
276 if ((actref.noFriendlyFire && !CC.Chara.IsHostile(c as Chara)) || (flag && c == CC))
277 {
278 continue;
279 }
280 if (isChara && points.Count > 1 && c != null && c.isChara && CC.isChara && CC.Chara.IsFriendOrAbove(c.Chara))
281 {
282 int num5 = CC.Evalue(302);
283 if (!CC.IsPC && CC.IsPCFactionOrMinion)
284 {
285 num5 += EClass.pc.Evalue(302);
286 }
287 if (CC.HasElement(1214))
288 {
289 num5 *= 2;
290 }
291 if (num5 > 0)
292 {
293 if (num5 * 10 > EClass.rnd(num4 + 1))
294 {
295 if (c == c.pos.FirstChara)
296 {
297 CC.ModExp(302, CC.IsPC ? 10 : 50);
298 }
299 continue;
300 }
301 num4 = EClass.rnd(num4 * 100 / (100 + num5 * 10 + 1));
302 if (c == c.pos.FirstChara)
303 {
304 CC.ModExp(302, CC.IsPC ? 20 : 100);
305 }
306 if (num4 == 0L)
307 {
308 continue;
309 }
310 }
311 if ((CC.HasElement(1214) || (!CC.IsPC && (CC.IsPCFaction || CC.IsPCFactionMinion) && EClass.pc.HasElement(1214))) && EClass.rnd(5) != 0)
312 {
313 continue;
314 }
315 }
316 if (!lang.IsEmpty())
317 {
318 if (lang == "spell_hand")
319 {
320 string[] list2 = Lang.GetList("attack" + (CC.isChara ? CC.Chara.race.meleeStyle.IsEmpty("Touch") : "Touch"));
321 string @ref = "_elehand".lang(e.source.GetAltname(2), list2[4]);
322 CC.Say(c.IsPCParty ? "cast_hand_ally" : "cast_hand", CC, c, @ref, c.IsPCParty ? list2[1] : list2[2]);
323 }
324 else
325 {
326 CC.Say(lang + "_hit", CC, c, e.Name.ToLower());
327 }
328 }
329 Chara chara = (CC.isChara ? CC.Chara : ((actref.refThing != null) ? EClass._map.FindChara(actref.refThing.c_uidRefCard) : null));
330 if (c.IsMultisize)
331 {
332 switch (id)
333 {
334 case EffectId.Ball:
335 case EffectId.Explosive:
336 case EffectId.BallBubble:
337 case EffectId.Meteor:
338 case EffectId.Earthquake:
339 case EffectId.Suicide:
340 case EffectId.Rocket:
341 case EffectId.Flare:
342 case EffectId.GravityGun:
343 num4 /= 2;
344 break;
345 }
346 }
347 if (RapidCount > 0)
348 {
349 num4 = num4 * 100 / (100 + RapidCount * 50);
350 }
351 num4 = num4 * Act.powerMod / 100;
352 if (num4 > 99999999)
353 {
354 num4 = 99999999L;
355 }
356 c.DamageHP(num4, e.id, power * num / 100, attackSource, chara ?? CC);
358 {
359 switch (id)
360 {
361 case EffectId.GravityGun:
362 if (c.isChara)
363 {
364 AddCon<ConGravity>(1, power);
365 AddCon<ConBlind>(4, power);
366 AddCon<ConDim>(5, power / 2);
367 AddCon<ConSupress>(3, power / 2);
368 if (actref.refThing != null && actref.refThing.id == "gun_gravity2")
369 {
370 AddCon<ConEntangle>(4, power / 3);
371 AddCon<ConSilence>(4, power / 3);
372 AddCon<ConWeakResEle>(4, power);
373 AddCon<ConNightmare>(4, power);
374 }
375 }
376 break;
377 case EffectId.DrainMana:
378 if (CC.IsAliveInCurrentZone && c.isChara && CC.isChara && c.Chara.mana.value > 0)
379 {
380 long num6 = num4 * num / 100;
381 Debug.Log(num4 + " v:" + num6 + " evalue:" + e.Value + " power:" + power + " elepMod:" + num);
382 if (num6 > c.Chara.mana.value)
383 {
384 num6 = c.Chara.mana.value;
385 }
386 c.Chara.mana.Mod((int)(-num6));
387 CC.Chara.mana.Mod((int)num6);
388 }
389 break;
390 }
391 }
392 if (id == EffectId.Explosive && CC.trait is TraitCookerMicrowave)
393 {
394 chara = EClass.pc;
395 }
396 if (chara != null && chara.IsAliveInCurrentZone)
397 {
398 chara.DoHostileAction(c);
399 }
400 num2++;
401 void AddCon<T>(int rate, int power) where T : Condition
402 {
403 if (EClass.rnd(1 + actref.refVal) == 0 && !c.Chara.HasCondition<T>() && EClass.rnd(rate) == 0)
404 {
405 c.Chara.AddCondition<T>(power);
406 }
407 }
408 }
409 if ((id == EffectId.Explosive || id == EffectId.Suicide || id == EffectId.Rocket) && (!EClass._zone.IsPCFaction || !EClass.Branch.HasItemProtection))
410 {
411 int num7 = id switch
412 {
413 EffectId.Suicide => CC.LV / 3 + 40,
414 EffectId.Meteor => 50 + power / 20,
415 _ => (actref.refThing != null) ? actref.refThing.material.hardness : (30 + power / 20),
416 };
417 bool flag3 = EClass._zone.HasLaw && !EClass._zone.IsPCFaction && (CC.IsPC || (id == EffectId.Explosive && actref.refThing == null)) && !(EClass._zone is Zone_Vernis);
418 if (p.HasObj && p.cell.matObj.hardness <= num7)
419 {
421 if (flag3)
422 {
424 }
425 }
426 if (!p.HasObj && p.HasBlock && p.matBlock.hardness <= num7)
427 {
429 if (flag3)
430 {
432 }
433 }
434 }
435 if (e.id == 910)
436 {
437 int num8 = 0;
438 if (id == EffectId.Meteor)
439 {
440 num8 = 2;
441 }
443 {
444 num8 = 0;
445 }
446 if (num8 > EClass.rnd(10))
447 {
448 p.ModFire(4 + EClass.rnd(10));
449 }
450 }
451 if (e.id == 911)
452 {
453 p.ModFire(-20, extinguish: true);
454 }
455 }
456 if (RapidCount == 0)
457 {
458 foreach (Card item2 in list)
459 {
460 if (item2.ExistsOnMap)
461 {
462 RapidCount += 2;
463 ProcAt(id, power, BlessedState.Normal, item2, null, item2.pos, isNeg: true, actref);
464 }
465 }
466 }
467 return num2 > 0;
468 }
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:470
virtual int ElementPowerMod
Definition: ACT.cs:111
Definition: Card.cs:11
bool IsPCFactionOrMinion
Definition: Card.cs:2326
virtual bool IsMultisize
Definition: Card.cs:2212
virtual Chara Chara
Definition: Card.cs:2122
string id
Definition: Card.cs:36
SourceMaterial.Row material
Definition: Card.cs:2103
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6543
virtual bool IsPCParty
Definition: Card.cs:2203
int c_uidRefCard
Definition: Card.cs:1151
bool ExistsOnMap
Definition: Card.cs:2137
bool HasTag(CTAG tag)
Definition: Card.cs:2712
Point pos
Definition: Card.cs:60
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6577
Trait trait
Definition: Card.cs:54
bool IsPowerful
Definition: Card.cs:2146
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2179
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:4255
void SayNothingHappans()
Definition: Card.cs:7216
virtual bool IsPC
Definition: Card.cs:2197
virtual bool isChara
Definition: Card.cs:2135
int Evalue(int ele)
Definition: Card.cs:2688
virtual bool IsPCFactionMinion
Definition: Card.cs:2209
void ModExp(string alias, int a)
Definition: Card.cs:2765
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6285
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7221
SourceMaterial.Row matObj
Definition: Cell.cs:1046
Definition: Chara.cs:10
override bool IsAliveInCurrentZone
Definition: Chara.cs:567
bool IsLevitating
Definition: Chara.cs:603
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9647
Chara host
Definition: Chara.cs:33
bool RequestProtection(Chara attacker, Action< Chara > action)
Definition: Chara.cs:8733
bool HasCondition(string alias)
Definition: Chara.cs:9808
bool IsFriendOrAbove()
Definition: Chara.cs:6854
Stats mana
Definition: Chara.cs:1189
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6577
bool IsHostile()
Definition: Chara.cs:6758
SourceRace.Row race
Definition: Chara.cs:468
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
override string ToString()
Definition: Dice.cs:115
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:80
Effect SetStartDelay(float a)
Definition: Effect.cs:201
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:100
Effect SetParticleColor(Color c)
Definition: Effect.cs:293
Color colorSprite
Definition: ElementRef.cs:7
Color colorTrail
Definition: ElementRef.cs:9
int id
Definition: ELEMENT.cs:257
SourceElement.Row source
Definition: ELEMENT.cs:280
int Value
Definition: ELEMENT.cs:299
virtual string Name
Definition: ELEMENT.cs:311
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1121
bool HasItemProtection
UD_String_ElementRef elements
Definition: GameSetting.cs:317
Definition: Lang.cs:7
static string[] GetList(string id)
Definition: Lang.cs:117
Chara FindChara(string id)
Definition: Map.cs:2613
void MineObj(Point point, Task task=null, Chara c=null)
Definition: Map.cs:1885
void MineBlock(Point point, bool recoverBlock=false, Chara c=null, bool mineObj=true)
Definition: Map.cs:1713
void TryShatter(Point pos, int ele, int power, Card CC=null)
Definition: Map.cs:1221
void ModKarma(int a)
Definition: Player.cs:2610
Definition: Point.cs:9
SourceMaterial.Row matBlock
Definition: Point.cs:55
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1057
Point Copy()
Definition: Point.cs:491
int x
Definition: Point.cs:36
void ModFire(int value, bool extinguish=false)
Definition: Point.cs:939
bool IsSync
Definition: Point.cs:344
bool Equals(int _x, int _z)
Definition: Point.cs:966
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:995
Chara FirstChara
Definition: Point.cs:288
bool HasBlock
Definition: Point.cs:141
Cell cell
Definition: Point.cs:51
void Animate(AnimeID id, bool animeBlock=false)
Definition: Point.cs:1308
SourceCalc calc
virtual void Mod(int a)
Definition: Stats.cs:135
virtual int value
Definition: Stats.cs:56
virtual bool CanBeAttacked
Definition: Trait.cs:177
bool ContainsKey(TKey key)
Definition: UDictionary.cs:151
FactionBranch branch
Definition: Zone.cs:34
bool IsPCFaction
Definition: Zone.cs:477
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, Dice.ToString(), Card.trait, TryDelay(), Map.TryShatter(), Stats.value, and Point.x.

Referenced by ProcAt().

◆ GeneMiracle()

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

Definition at line 2883 of file ActEffect.cs.

2884 {
2886 {
2888 return;
2889 }
2890 if (c == tc)
2891 {
2892 tc.Say("love_ground", tc);
2893 }
2894 else
2895 {
2896 tc.Say("love_chara", c, tc);
2897 }
2898 Thing t = tc.MakeGene(type);
2899 tc.GiveBirth(t, effect: true);
2900 }
Thing GiveBirth(Thing t, bool effect)
Definition: Card.cs:6013
Thing MakeGene(DNA.Type? type=null)
Definition: Chara.cs:8499
Definition: Msg.cs:5
static string SayNothingHappen()
Definition: Msg.cs:96
Definition: Thing.cs:8
virtual bool IsUserZone
Definition: Zone.cs:275

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

2903 {
2904 Point point = new Point();
2905 for (int i = 0; i < 10000; i++)
2906 {
2907 point.Set(org);
2908 point.x += EClass.rnd(radius) - EClass.rnd(radius);
2909 point.z += EClass.rnd(radius) - EClass.rnd(radius);
2910 if (point.IsValid && point.IsInBounds && !point.cell.blocked && point.Distance(org) >= radius / 3 + 1 - i / 50 && !point.cell.HasZoneStairs())
2911 {
2912 return point;
2913 }
2914 }
2915 return org.GetRandomNeighbor().GetNearestPoint();
2916 }
bool HasZoneStairs(bool includeLocked=true)
Definition: Cell.cs:1759
Point Set(int _x, int _z)
Definition: Point.cs:503
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:624
bool IsValid
Definition: Point.cs:88
bool IsInBounds
Definition: Point.cs:104
Point GetRandomNeighbor()
Definition: Point.cs:764

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

Referenced by AI_PassTime.Run().

◆ LoveMiracle()

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

Definition at line 2851 of file ActEffect.cs.

2852 {
2853 if (c == tc)
2854 {
2855 tc.Say("love_ground", tc);
2856 }
2857 else
2858 {
2859 tc.Say("love_chara", c, tc);
2860 }
2861 tc.ModAffinity(EClass.pc, power / 4);
2862 if ((idEffect != EffectId.Love || EClass.rnd(2) != 0) && (!EClass._zone.IsUserZone || tc.IsPCFaction || !EClass.game.principal.disableUsermapBenefit))
2863 {
2864 if (idEffect == EffectId.MoonSpear && EClass.rnd(EClass.debug.enable ? 2 : 20) == 0)
2865 {
2866 Thing thing = tc.MakeGene();
2867 tc.GiveBirth(thing, effect: true);
2868 tc.Say("item_drop", thing);
2869 }
2870 else if (idEffect != EffectId.LovePlus && EClass.rnd(2) == 0)
2871 {
2872 Thing c2 = tc.MakeMilk(effect: true, 1, addToZone: true, state);
2873 tc.Say("item_drop", c2);
2874 }
2875 else
2876 {
2877 Thing c3 = tc.MakeEgg(effect: true, 1, addToZone: true, (idEffect == EffectId.LovePlus) ? 3 : 20, state);
2878 tc.Say("item_drop", c3);
2879 }
2880 }
2881 }
Thing MakeMilk(bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
Definition: Card.cs:5982
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5959
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:8236
override bool IsPCFaction
Definition: Chara.cs:689
bool enable
Definition: CoreDebug.cs:301
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 2835 of file ActEffect.cs.

2836 {
2837 tc.Say("eat_poison", tc);
2838 tc.Talk("scream");
2839 if (power > 100000000)
2840 {
2841 power = 100000000;
2842 }
2843 int num = (int)Mathf.Sqrt(power * 100);
2844 tc.DamageHP(num * 2 + EClass.rnd(num), 915, power);
2845 if (!tc.isDead && !tc.IsPC)
2846 {
2848 }
2849 }
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:7103
override bool IsPC
Definition: Chara.cs:630
bool isDead
Definition: Chara.cs:393

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

Referenced by FoodEffect.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 1022 of file ActEffect.cs.

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

◆ ProcAt()

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

Definition at line 470 of file ActEffect.cs.

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

2919 {
2921 string netMsg = GameLang.Parse("wish".langGame(), thirdPerson: true, name, s);
2922 List<WishItem> list = new List<WishItem>();
2923 long wishLv = 10 + power / 4;
2924 int wishValue = MathEx.ClampToInt(5000 + (long)power * 50L);
2925 if (state >= BlessedState.Blessed)
2926 {
2927 wishLv = wishLv * 150 / 100;
2928 }
2929 else if (state <= BlessedState.Cursed)
2930 {
2931 wishLv = wishLv * 150 / 100;
2932 wishValue = 1;
2933 }
2934 Debug.Log(power + "/" + wishValue);
2935 string _s = s.ToLower();
2936 foreach (CardRow r in EClass.sources.cards.rows)
2937 {
2938 if (r.HasTag(CTAG.godArtifact))
2939 {
2940 bool flag = false;
2941 foreach (Religion item in EClass.game.religions.list)
2942 {
2943 if (item.giftRank >= 2 && item.IsValidArtifact(r.id))
2944 {
2945 flag = true;
2946 }
2947 }
2948 if (!flag)
2949 {
2950 continue;
2951 }
2952 }
2953 else if (r.quality >= 4 || r.HasTag(CTAG.noWish))
2954 {
2955 switch (r.id)
2956 {
2957 case "medal":
2958 case "plat":
2959 case "money":
2960 case "money2":
2961 break;
2962 default:
2963 continue;
2964 }
2965 }
2966 if (r.isChara)
2967 {
2968 continue;
2969 }
2970 string text = r.GetName().ToLower();
2971 int score = Compare(_s, text);
2972 if (score == 0)
2973 {
2974 continue;
2975 }
2976 list.Add(new WishItem
2977 {
2978 score = score,
2979 n = text,
2980 action = delegate
2981 {
2982 Debug.Log(r.id);
2983 SourceCategory.Row category = EClass.sources.cards.map[r.id].Category;
2984 if (category.IsChildOf("weapon") || category.IsChildOf("armor") || category.IsChildOf("ranged"))
2985 {
2986 CardBlueprint.SetRarity(Rarity.Legendary);
2987 }
2988 Thing thing = ThingGen.Create(r.id, -1, MathEx.ClampToInt(wishLv));
2989 int num = 1;
2990 int price = thing.GetPrice(CurrencyType.Money, sell: false, PriceType.Tourism);
2991 bool flag2 = thing.trait is TraitDeed || thing.rarity >= Rarity.Artifact || thing.source._origin == "artifact_summon";
2992 switch (thing.id)
2993 {
2994 case "rod_wish":
2995 thing.c_charges = 0;
2996 break;
2997 case "money":
2998 num = EClass.rndHalf(wishValue * 3);
2999 break;
3000 case "plat":
3001 num = EClass.rndHalf(wishValue / 500 + 4);
3002 break;
3003 case "money2":
3004 num = EClass.rndHalf(wishValue / 500 + 4);
3005 break;
3006 case "medal":
3007 num = EClass.rndHalf(wishValue / 2000 + 4);
3008 break;
3009 default:
3010 if (!flag2 && thing.trait.CanStack)
3011 {
3012 int num2 = wishValue;
3013 num2 -= price;
3014 for (int i = 1; i < 1000; i++)
3015 {
3016 int num3 = price + i * 2 * (price + 500);
3017 if (num3 > 0 && num2 > num3)
3018 {
3019 num++;
3020 num2 -= num3;
3021 }
3022 }
3023 }
3024 break;
3025 }
3026 if (price > 2500 && num > 3)
3027 {
3028 num = 3 + (int)Mathf.Sqrt(num - 3);
3029 }
3030 if (price > 5000 && num > 2)
3031 {
3032 num = 2 + (int)Mathf.Sqrt(num - 2) / 2;
3033 }
3034 if (price > 10000 && num > 1)
3035 {
3036 num = 1 + Mathf.Min((int)Mathf.Sqrt(num - 1) / 3, 2);
3037 }
3038 if (num < 1)
3039 {
3040 num = 1;
3041 }
3042 thing.SetNum(num);
3043 Debug.Log(_s + "/" + num + "/" + score);
3044 if (thing.HasTag(CTAG.godArtifact))
3045 {
3046 EClass.game.religions.Reforge(thing.id);
3047 }
3048 else
3049 {
3050 EClass._zone.AddCard(thing, EClass.pc.pos);
3051 }
3052 netMsg = netMsg + Lang.space + GameLang.Parse("wishNet".langGame(), Msg.IsThirdPerson(thing), Msg.GetName(thing).ToTitleCase());
3053 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
3054 Msg.Say("dropReward");
3055 }
3056 });
3057 }
3058 if (list.Count == 0)
3059 {
3060 netMsg = netMsg + Lang.space + "wishFail".langGame();
3061 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
3062 Msg.Say("wishFail");
3063 return false;
3064 }
3065 list.Sort((WishItem a, WishItem b) => b.score - a.score);
3066 foreach (WishItem item2 in list)
3067 {
3068 Debug.Log(item2.score + "/" + s + "/" + item2.n);
3069 }
3070 list[0].action();
3071 return true;
3072 }
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:3074
virtual string GetName(int i)
Definition: CardRow.cs:95
int quality
Definition: CardRow.cs:19
bool isChara
Definition: CardRow.cs:55
string id
Definition: CardRow.cs:7
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
Definition: GameLang.cs:178
static string langCode
Definition: Lang.cs:29
static int ClampToInt(long a)
Definition: MathEx.cs:16
static bool IsThirdPerson(Card c)
Definition: Msg.cs:296
static ThirstPersonInfo thirdPerson1
Definition: Msg.cs:6
static string GetName(Card c)
Definition: Msg.cs:279
Definition: Net.cs:12
static async UniTask< bool > SendChat(string name, string msg, ChatCategory cat, string idLang)
Definition: Net.cs:334
Thing Reforge(string id, Point pos=null, bool first=true)
List< Religion > list
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
override int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Thing.cs:829
void Set(string n)
virtual SourceElement.Row source
Definition: TraitScroll.cs:5

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

Member Data Documentation

◆ angle

int ActEffect.angle = 20
static

Definition at line 21 of file ActEffect.cs.

Referenced by ProcAt().

◆ RapidCount

int ActEffect.RapidCount
static

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: