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

3086 {
3087 if (s.IsEmpty())
3088 {
3089 return 0;
3090 }
3091 int num = 0;
3092 if (t == s)
3093 {
3094 num += 100 + EClass.rnd(30);
3095 }
3096 if (t.Contains(s))
3097 {
3098 num += 100 + EClass.rnd(30);
3099 }
3100 return num;
3101 }
Definition: EClass.cs:6
static int rnd(long a)
Definition: EClass.cs:59

References EClass.rnd().

◆ DamageEle()

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

Definition at line 36 of file ActEffect.cs.

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

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

2895 {
2897 {
2899 return;
2900 }
2901 if (c == tc)
2902 {
2903 tc.Say("love_ground", tc);
2904 }
2905 else
2906 {
2907 tc.Say("love_chara", c, tc);
2908 }
2909 Thing t = tc.MakeGene(type);
2910 tc.GiveBirth(t, effect: true);
2911 }
Thing GiveBirth(Thing t, bool effect)
Definition: Card.cs:5926
Thing MakeGene(DNA.Type? type=null)
Definition: Chara.cs:8379
Definition: Msg.cs:5
static string SayNothingHappen()
Definition: Msg.cs:96
Definition: Thing.cs:8
virtual bool IsUserZone
Definition: Zone.cs:273

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

◆ GetTeleportPos()

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

Definition at line 2913 of file ActEffect.cs.

2914 {
2915 Point point = new Point();
2916 for (int i = 0; i < 10000; i++)
2917 {
2918 point.Set(org);
2919 point.x += EClass.rnd(radius) - EClass.rnd(radius);
2920 point.z += EClass.rnd(radius) - EClass.rnd(radius);
2921 if (point.IsValid && point.IsInBounds && !point.cell.blocked && point.Distance(org) >= radius / 3 + 1 - i / 50 && !point.cell.HasZoneStairs())
2922 {
2923 return point;
2924 }
2925 }
2926 return org.GetRandomNeighbor().GetNearestPoint();
2927 }
bool HasZoneStairs(bool includeLocked=true)
Definition: Cell.cs:1717
Point Set(int _x, int _z)
Definition: Point.cs:503
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:619
bool IsValid
Definition: Point.cs:88
bool IsInBounds
Definition: Point.cs:104
Point GetRandomNeighbor()
Definition: Point.cs:759

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

Referenced by AI_PassTime.Run().

◆ LoveMiracle()

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

Definition at line 2862 of file ActEffect.cs.

2863 {
2864 if (c == tc)
2865 {
2866 tc.Say("love_ground", tc);
2867 }
2868 else
2869 {
2870 tc.Say("love_chara", c, tc);
2871 }
2872 tc.ModAffinity(EClass.pc, power / 4);
2873 if ((idEffect != EffectId.Love || EClass.rnd(2) != 0) && (!EClass._zone.IsUserZone || tc.IsPCFaction || !EClass.game.principal.disableUsermapBenefit))
2874 {
2875 if (idEffect == EffectId.MoonSpear && EClass.rnd(EClass.debug.enable ? 2 : 20) == 0)
2876 {
2877 Thing thing = tc.MakeGene();
2878 tc.GiveBirth(thing, effect: true);
2879 tc.Say("item_drop", thing);
2880 }
2881 else if (idEffect != EffectId.LovePlus && EClass.rnd(2) == 0)
2882 {
2883 Thing c2 = tc.MakeMilk(effect: true, 1, addToZone: true, state);
2884 tc.Say("item_drop", c2);
2885 }
2886 else
2887 {
2888 Thing c3 = tc.MakeEgg(effect: true, 1, addToZone: true, (idEffect == EffectId.LovePlus) ? 3 : 20, state);
2889 tc.Say("item_drop", c3);
2890 }
2891 }
2892 }
Thing MakeMilk(bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
Definition: Card.cs:5895
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5872
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:8137
override bool IsPCFaction
Definition: Chara.cs:685
bool enable
Definition: CoreDebug.cs:286
static Game game
Definition: EClass.cs:9
static CoreDebug debug
Definition: EClass.cs:49
bool disableUsermapBenefit
GamePrincipal principal
Definition: Game.cs:225

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

Referenced by FoodEffect.Proc().

◆ Poison()

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

Definition at line 2846 of file ActEffect.cs.

2847 {
2848 tc.Say("eat_poison", tc);
2849 tc.Talk("scream");
2850 if (power > 100000000)
2851 {
2852 power = 100000000;
2853 }
2854 int num = (int)Mathf.Sqrt(power * 100);
2855 tc.DamageHP(num * 2 + EClass.rnd(num), 915, power);
2856 if (!tc.isDead && !tc.IsPC)
2857 {
2859 }
2860 }
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:7003
override bool IsPC
Definition: Chara.cs:626
bool isDead
Definition: Chara.cs:391

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

Referenced by FoodEffect.Proc().

◆ Proc() [1/2]

◆ Proc() [2/2]

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

Definition at line 1045 of file ActEffect.cs.

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

References EClass._map, EClass._zone, Zone.AddCard(), Chara.AddCondition(), Chara.AddCooldown(), armor, TraitWell.BadEffect(), ElementContainer.Base(), Card.bio, Card.blessedState, Chara.body, Zone.Boss, Map.bounds, Card.c_DNA, Card.c_lockedAge, Card.c_uidAttune, SourceManager.calc, CoreConfig.camera, Chara.CanDuplicate(), Chara.CanSeeLos(), Game.cards, Card.ChangeMaterial(), Card.Chara, Map.charas, Spatial.children, Color, EClass.Colors, Core.config, Point.Copy(), EClass.core, Player.CountKeyItem(), Dice.Create(), Condition.Create(), ThingGen.Create(), 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(), BaseCard.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, if(), Dialog.InputName(), Card.Install(), Point.Installed, Zone.instance, Chara.InstantEat(), Card.isAcidproof, Card.IsAmmo, Card.isCopy, Card.IsEquipmentOrRanged, Thing.isEquipped, Chara.IsHostile(), Condition.IsKilled, Card.IsLightsource, Card.IsPC, Chara.IsPC, Chara.IsPCFaction, Zone.IsPCFaction, Card.IsPCFactionOrMinion, Card.IsPCParty, Chara.IsPCParty, Chara.IsPCPartyMinion, BaseCondition.isPerfume, Card.IsRangedWeapon, 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(), BaseCard.SetInt(), Card.SetNum(), BaseCondition.SetRefVal(), Rand.SetSeed(), Layer.SetTitles(), CoreConfig.CameraConfig.smoothFollow, Chara.Sniff(), Thing.source, Thing.sourceCard, EClass.sources, Game.spatials, Card.Split(), Player.stats, SourceManager.stats, Religion.Talk(), Card.Talk(), Card.Teleport(), Card.Thing, ActThrow.Throw(), SourceMaterial.tierMap, SourceMaterial.TierList.tiers, Card.trait, Chara.trait, ReligionManager.Trickery, Chara.TryDropBossLoot(), 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 493 of file ActEffect.cs.

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

References EClass._map, EClass._zone, Zone.AddCard(), Chara.AddCondition(), angle, Card.c_uidMaster, Point.cell, Card.Chara, Map.charas, Point.Charas, Color, EClass.Colors, Core.config, Point.Copy(), EClass.core, Zone.CountMinions(), Element.Create(), EffectMeteor.Create(), CharaGen.Create(), CharaGen.CreateFromElement(), CharaGen.CreateFromFilter(), DamageEle(), Zone.DangerLv, World.date, EClass.debug, Debug, Chara.Die(), CoreConfig.GraphicSetting.disableShake, ColorProfile.elementColors, CoreDebug.enable, Card.Evalue(), 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(), BaseCard.SetInt(), Card.SetLv(), Chara.SetMainElement(), Chara.SetSummon(), Shaker.ShakeCam(), Element.source, EClass.sources, TryDelay(), UDictionary< TKey, TValue >.TryGetValue(), Element.Value, Element.Void, EClass.Wait(), EClass.world, Point.x, and Point.z.

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

◆ TryDelay()

static void ActEffect.TryDelay ( Action  a)
inlinestatic

Definition at line 23 of file ActEffect.cs.

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

References RapidCount, and RapidDelay.

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

◆ Wish()

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

Definition at line 2929 of file ActEffect.cs.

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

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

Member Data Documentation

◆ angle

int ActEffect.angle = 20
static

Definition at line 21 of file ActEffect.cs.

Referenced by ProcAt().

◆ RapidCount

int ActEffect.RapidCount
static

Definition at line 17 of file ActEffect.cs.

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

◆ RapidDelay

float ActEffect.RapidDelay
static

Definition at line 19 of file ActEffect.cs.

Referenced by TryDelay().


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