Elin Decompiled Documentation EA 23.246 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 (int _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 2918 of file ActEffect.cs.

2919 {
2920 if (s.IsEmpty())
2921 {
2922 return 0;
2923 }
2924 int num = 0;
2925 if (t == s)
2926 {
2927 num += 100 + EClass.rnd(30);
2928 }
2929 if (t.Contains(s))
2930 {
2931 num += 100 + EClass.rnd(30);
2932 }
2933 return num;
2934 }
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 }
173 bool flag3 = false;
174 if (CC.IsPCFactionOrMinion && (CC.HasElement(1651) || EClass.pc.Evalue(1651) >= 2))
175 {
176 bool flag4 = false;
177 foreach (Card item in p.ListCards())
178 {
179 if (item.isChara)
180 {
181 if (item.IsPCFactionOrMinion)
182 {
183 flag4 = true;
184 }
185 }
186 else if ((e.id != 910 && e.id != 911) || !item.IsFood || !item.category.IsChildOf("foodstuff"))
187 {
188 flag4 = true;
189 }
190 }
191 flag3 = flag4;
192 }
193 if (!flag3)
194 {
195 if (e.id == 910)
196 {
197 EClass._map.TryShatter(p, 910, power);
198 }
199 if (e.id == 911)
200 {
201 EClass._map.TryShatter(p, 911, power);
202 }
203 }
204 foreach (Card item2 in p.ListCards().ToList())
205 {
206 Card c = item2;
207 if ((!c.isChara && !c.trait.CanBeAttacked) || (c.IsMultisize && item2 == CC) || (c.isChara && (c.Chara.host == CC || c.Chara.parasite == CC || c.Chara.ride == CC)))
208 {
209 continue;
210 }
211 switch (id)
212 {
213 case EffectId.Arrow:
214 case EffectId.Hand:
215 case EffectId.Sword:
216 case EffectId.MoonSpear:
217 case EffectId.MoonArrow:
218 if (c.isChara && CC.isChara)
219 {
220 c.Chara.RequestProtection(CC.Chara, delegate(Chara a)
221 {
222 c = a;
223 });
224 }
225 if (id == EffectId.MoonSpear || (id == EffectId.MoonArrow && EClass.rnd(5) == 0))
226 {
227 attackSource = AttackSource.MoonSpear;
228 }
229 break;
230 }
231 switch (id)
232 {
233 case EffectId.Arrow:
234 attackSource = AttackSource.MagicArrow;
235 break;
236 case EffectId.Hand:
237 attackSource = AttackSource.MagicHand;
238 break;
239 case EffectId.Sword:
240 attackSource = AttackSource.MagicSword;
241 break;
242 }
243 long num4 = 0L;
244 bool isChara = CC.isChara;
245 if (id == EffectId.Suicide)
246 {
247 num4 = CC.MaxHP * 2;
248 num4 = num4 * 100 / (50 + point.Distance(p) * 75);
249 if ((c.HasCondition<ConBrightnessOfLife>() || c.HasTag(CTAG.suicide)) && !c.HasCondition<ConWet>() && !c.IsPowerful)
250 {
251 list.Add(c);
252 }
253 }
254 else
255 {
256 Dice dice = Dice.Create(text2, power, CC, (actref.refThing != null) ? null : actref.act);
257 if (dice == null)
258 {
259 Debug.Log(text2);
260 }
261 num4 = dice.Roll();
262 switch (id)
263 {
264 case EffectId.Earthquake:
265 if (c.HasCondition<ConGravity>())
266 {
267 num4 = dice.RollMax() * 2;
268 }
269 else if (c.isChara && c.Chara.IsLevitating)
270 {
271 num4 /= 2;
272 }
273 break;
274 case EffectId.Sword:
275 num4 = num4 * (int)Mathf.Min(70f + Mathf.Sqrt(CC.Evalue(101)) * 3f, 200f) / 100;
276 break;
277 case EffectId.GravityGun:
278 num4 /= 5;
279 break;
280 }
281 if (id == EffectId.Ball || id == EffectId.BallBubble || id == EffectId.Explosive || id == EffectId.Rocket || id == EffectId.GravityGun)
282 {
283 num4 = num4 * 100 / (90 + point.Distance(p) * 10);
284 }
285 }
286 if (id == EffectId.Sword)
287 {
288 c.PlaySound("ab_magicsword");
289 c.PlayEffect("hit_slash");
290 }
291 if ((actref.noFriendlyFire && !CC.Chara.IsHostile(c as Chara)) || (flag && c == CC))
292 {
293 continue;
294 }
295 if (isChara && points.Count > 1 && c != null && c.isChara && CC.isChara && CC.Chara.IsFriendOrAbove(c.Chara))
296 {
297 int num5 = CC.Evalue(302);
298 if (!CC.IsPC && CC.IsPCFactionOrMinion)
299 {
300 num5 += EClass.pc.Evalue(302);
301 }
302 if (CC.HasElement(1214))
303 {
304 num5 *= 2;
305 }
306 if (num5 > 0)
307 {
308 if (num5 * 10 > EClass.rnd(num4 + 1))
309 {
310 if (c == c.pos.FirstChara)
311 {
312 CC.ModExp(302, CC.IsPC ? 10 : 50);
313 }
314 continue;
315 }
316 num4 = EClass.rnd(num4 * 100 / (100 + num5 * 10 + 1));
317 if (c == c.pos.FirstChara)
318 {
319 CC.ModExp(302, CC.IsPC ? 20 : 100);
320 }
321 if (num4 == 0L)
322 {
323 continue;
324 }
325 }
326 if ((CC.HasElement(1214) || (!CC.IsPC && (CC.IsPCFaction || CC.IsPCFactionMinion) && EClass.pc.HasElement(1214))) && EClass.rnd(5) != 0)
327 {
328 continue;
329 }
330 }
331 if (!lang.IsEmpty())
332 {
333 if (lang == "spell_hand")
334 {
335 string[] list2 = Lang.GetList("attack" + (CC.isChara ? CC.Chara.race.meleeStyle.IsEmpty("Touch") : "Touch"));
336 string @ref = "_elehand".lang(e.source.GetAltname(2), list2[4]);
337 CC.Say(c.IsPCParty ? "cast_hand_ally" : "cast_hand", CC, c, @ref, c.IsPCParty ? list2[1] : list2[2]);
338 }
339 else
340 {
341 CC.Say(lang + "_hit", CC, c, e.Name.ToLower());
342 }
343 }
344 Chara chara = (CC.isChara ? CC.Chara : ((actref.refThing != null) ? EClass._map.FindChara(actref.refThing.c_uidRefCard) : null));
345 if (c.IsMultisize)
346 {
347 switch (id)
348 {
349 case EffectId.Ball:
350 case EffectId.Explosive:
351 case EffectId.BallBubble:
352 case EffectId.Meteor:
353 case EffectId.Earthquake:
354 case EffectId.Suicide:
355 case EffectId.Rocket:
356 case EffectId.Flare:
357 case EffectId.GravityGun:
358 num4 /= 2;
359 break;
360 }
361 }
362 if (RapidCount > 0)
363 {
364 num4 = num4 * 100 / (100 + RapidCount * 50);
365 }
366 num4 = num4 * Act.powerMod / 100;
367 if (num4 > 99999999)
368 {
369 num4 = 99999999L;
370 }
371 c.DamageHP(num4, e.id, power * num / 100, attackSource, chara ?? CC);
373 {
374 switch (id)
375 {
376 case EffectId.GravityGun:
377 if (c.isChara)
378 {
379 AddCon<ConGravity>(1, power);
380 AddCon<ConBlind>(4, power);
381 AddCon<ConDim>(5, power / 2);
382 AddCon<ConSupress>(3, power / 2);
383 if (actref.refThing != null && actref.refThing.id == "gun_gravity2")
384 {
385 AddCon<ConEntangle>(4, power / 3);
386 AddCon<ConSilence>(4, power / 3);
387 AddCon<ConWeakResEle>(4, power);
388 AddCon<ConNightmare>(4, power);
389 }
390 }
391 break;
392 case EffectId.DrainMana:
393 if (CC.IsAliveInCurrentZone && c.isChara && CC.isChara && c.Chara.mana.value > 0)
394 {
395 long num6 = num4 * num / 100;
396 Debug.Log(num4 + " v:" + num6 + " evalue:" + e.Value + " power:" + power + " elepMod:" + num);
397 if (num6 > c.Chara.mana.value)
398 {
399 num6 = c.Chara.mana.value;
400 }
401 c.Chara.mana.Mod((int)(-num6));
402 CC.Chara.mana.Mod((int)num6);
403 }
404 break;
405 }
406 }
407 if (id == EffectId.Explosive && CC.trait is TraitCookerMicrowave)
408 {
409 chara = EClass.pc;
410 }
411 if (chara != null && chara.IsAliveInCurrentZone)
412 {
413 chara.DoHostileAction(c);
414 }
415 num2++;
416 void AddCon<T>(int rate, int power) where T : Condition
417 {
418 if (EClass.rnd(1 + actref.refVal) == 0 && !c.Chara.HasCondition<T>() && EClass.rnd(rate) == 0)
419 {
420 c.Chara.AddCondition<T>(power);
421 }
422 }
423 }
424 if ((id == EffectId.Explosive || id == EffectId.Suicide || id == EffectId.Rocket) && (!EClass._zone.IsPCFaction || !EClass.Branch.HasItemProtection))
425 {
426 int num7 = id switch
427 {
428 EffectId.Suicide => CC.LV / 3 + 40,
429 EffectId.Meteor => 50 + power / 20,
430 _ => (actref.refThing != null) ? actref.refThing.material.hardness : (30 + power / 20),
431 };
432 bool flag5 = EClass._zone.HasLaw && !EClass._zone.IsPCFaction && (CC.IsPC || (id == EffectId.Explosive && actref.refThing == null)) && !(EClass._zone is Zone_Vernis);
433 if (p.HasObj && p.cell.matObj.hardness <= num7)
434 {
436 if (flag5)
437 {
439 }
440 }
441 if (!p.HasObj && p.HasBlock && p.matBlock.hardness <= num7)
442 {
444 if (flag5)
445 {
447 }
448 }
449 }
450 if (e.id == 910)
451 {
452 int num8 = 0;
453 if (id == EffectId.Meteor)
454 {
455 num8 = 2;
456 }
458 {
459 num8 = 0;
460 }
461 if (num8 > EClass.rnd(10))
462 {
463 p.ModFire(4 + EClass.rnd(10));
464 }
465 }
466 if (e.id == 911)
467 {
468 p.ModFire(-20, extinguish: true);
469 }
470 }
471 if (RapidCount == 0)
472 {
473 foreach (Card item3 in list)
474 {
475 if (item3.ExistsOnMap)
476 {
477 RapidCount += 2;
478 ProcAt(id, power, BlessedState.Normal, item3, null, item3.pos, isNeg: true, actref);
479 }
480 }
481 }
482 return num2 > 0;
483 }
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:485
virtual int ElementPowerMod
Definition: ACT.cs:111
Definition: Card.cs:11
bool IsPCFactionOrMinion
Definition: Card.cs:2272
virtual bool IsMultisize
Definition: Card.cs:2158
virtual Chara Chara
Definition: Card.cs:2070
string id
Definition: Card.cs:35
SourceMaterial.Row material
Definition: Card.cs:2051
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6165
virtual bool IsPCParty
Definition: Card.cs:2149
int c_uidRefCard
Definition: Card.cs:1124
bool ExistsOnMap
Definition: Card.cs:2085
bool HasTag(CTAG tag)
Definition: Card.cs:2595
Point pos
Definition: Card.cs:59
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6199
Trait trait
Definition: Card.cs:53
bool IsPowerful
Definition: Card.cs:2094
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2127
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:4063
void SayNothingHappans()
Definition: Card.cs:6813
virtual bool IsPC
Definition: Card.cs:2143
virtual bool isChara
Definition: Card.cs:2083
int Evalue(int ele)
Definition: Card.cs:2571
virtual bool IsPCFactionMinion
Definition: Card.cs:2155
void ModExp(string alias, int a)
Definition: Card.cs:2648
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:5920
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6818
SourceMaterial.Row matObj
Definition: Cell.cs:1036
Definition: Chara.cs:10
override bool IsAliveInCurrentZone
Definition: Chara.cs:561
bool IsLevitating
Definition: Chara.cs:597
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9244
Chara host
Definition: Chara.cs:33
bool RequestProtection(Chara attacker, Action< Chara > action)
Definition: Chara.cs:8374
bool HasCondition(string alias)
Definition: Chara.cs:9405
bool IsFriendOrAbove()
Definition: Chara.cs:6618
Stats mana
Definition: Chara.cs:1154
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6349
bool IsHostile()
Definition: Chara.cs:6526
SourceRace.Row race
Definition: Chara.cs:464
Definition: ConWet.cs:2
Definition: Dice.cs:5
static int RollMax(int num, int sides, int bonus=0)
Definition: Dice.cs:70
static int Roll(int num, int sides, int bonus=0, Card card=null)
Definition: Dice.cs:48
static Dice Create(Element ele, Card c)
Definition: Dice.cs:120
static Zone _zone
Definition: EClass.cs:21
static Map _map
Definition: EClass.cs:19
static SourceManager sources
Definition: EClass.cs:43
static 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:199
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:100
Effect SetParticleColor(Color c)
Definition: Effect.cs:289
Color colorSprite
Definition: ElementRef.cs:7
Color colorTrail
Definition: ElementRef.cs:9
int id
Definition: ELEMENT.cs:250
SourceElement.Row source
Definition: ELEMENT.cs:273
int Value
Definition: ELEMENT.cs:292
virtual string Name
Definition: ELEMENT.cs:304
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1102
bool HasItemProtection
UD_String_ElementRef elements
Definition: GameSetting.cs:315
Definition: Lang.cs:6
static string[] GetList(string id)
Definition: Lang.cs:114
Chara FindChara(string id)
Definition: Map.cs:2568
void TryShatter(Point pos, int ele, int power)
Definition: Map.cs:1200
void MineObj(Point point, Task task=null, Chara c=null)
Definition: Map.cs:1840
void MineBlock(Point point, bool recoverBlock=false, Chara c=null, bool mineObj=true)
Definition: Map.cs:1668
void ModKarma(int a)
Definition: Player.cs:2516
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:166
bool ContainsKey(TKey key)
Definition: UDictionary.cs:151
FactionBranch branch
Definition: Zone.cs:34
bool IsPCFaction
Definition: Zone.cs:473
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(), Dice.Roll(), Dice.RollMax(), Card.SayNothingHappans(), Effect.SetParticleColor(), Effect.SetStartDelay(), EClass.setting, Element.source, EClass.sources, Card.trait, TryDelay(), Map.TryShatter(), Stats.value, and Point.x.

Referenced by ProcAt().

◆ GeneMiracle()

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

Definition at line 2720 of file ActEffect.cs.

2721 {
2723 {
2725 return;
2726 }
2727 if (c == tc)
2728 {
2729 tc.Say("love_ground", tc);
2730 }
2731 else
2732 {
2733 tc.Say("love_chara", c, tc);
2734 }
2735 Thing t = tc.MakeGene(type);
2736 tc.GiveBirth(t, effect: true);
2737 }
Thing GiveBirth(Thing t, bool effect)
Definition: Card.cs:5781
Thing MakeGene(DNA.Type? type=null)
Definition: Chara.cs:8149
Definition: Msg.cs:5
static string SayNothingHappen()
Definition: Msg.cs:96
Definition: Thing.cs:8
virtual bool IsUserZone
Definition: Zone.cs:271

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

2740 {
2741 Point point = new Point();
2742 for (int i = 0; i < 10000; i++)
2743 {
2744 point.Set(org);
2745 point.x += EClass.rnd(radius) - EClass.rnd(radius);
2746 point.z += EClass.rnd(radius) - EClass.rnd(radius);
2747 if (point.IsValid && point.IsInBounds && !point.cell.blocked && point.Distance(org) >= radius / 3 + 1 - i / 50 && !point.cell.HasZoneStairs())
2748 {
2749 return point;
2750 }
2751 }
2752 return org.GetRandomNeighbor().GetNearestPoint();
2753 }
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 2688 of file ActEffect.cs.

2689 {
2690 if (c == tc)
2691 {
2692 tc.Say("love_ground", tc);
2693 }
2694 else
2695 {
2696 tc.Say("love_chara", c, tc);
2697 }
2698 tc.ModAffinity(EClass.pc, power / 4);
2699 if ((idEffect != EffectId.Love || EClass.rnd(2) != 0) && (!EClass._zone.IsUserZone || tc.IsPCFaction || !EClass.game.principal.disableUsermapBenefit))
2700 {
2701 if (idEffect == EffectId.MoonSpear && EClass.rnd(EClass.debug.enable ? 2 : 20) == 0)
2702 {
2703 Thing thing = tc.MakeGene();
2704 tc.GiveBirth(thing, effect: true);
2705 tc.Say("item_drop", thing);
2706 }
2707 else if (idEffect != EffectId.LovePlus && EClass.rnd(2) == 0)
2708 {
2709 Thing c2 = tc.MakeMilk(effect: true, 1, addToZone: true, state);
2710 tc.Say("item_drop", c2);
2711 }
2712 else
2713 {
2714 Thing c3 = tc.MakeEgg(effect: true, 1, addToZone: true, (idEffect == EffectId.LovePlus) ? 3 : 20, state);
2715 tc.Say("item_drop", c3);
2716 }
2717 }
2718 }
Thing MakeMilk(bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
Definition: Card.cs:5750
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5727
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7931
override bool IsPCFaction
Definition: Chara.cs:671
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:224

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

2673 {
2674 tc.Say("eat_poison", tc);
2675 tc.Talk("scream");
2676 if (power > 100000000)
2677 {
2678 power = 100000000;
2679 }
2680 int num = (int)Mathf.Sqrt(power * 100);
2681 tc.DamageHP(num * 2 + EClass.rnd(num), 915, power);
2682 if (!tc.isDead && !tc.IsPC)
2683 {
2685 }
2686 }
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6721
override bool IsPC
Definition: Chara.cs:612
bool isDead
Definition: Chara.cs:389

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

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

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

◆ ProcAt()

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

Definition at line 485 of file ActEffect.cs.

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

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

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

◆ TryDelay()

static void ActEffect.TryDelay ( Action  a)
inlinestatic

Definition at line 23 of file ActEffect.cs.

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

References RapidCount, and RapidDelay.

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

◆ Wish()

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

Definition at line 2755 of file ActEffect.cs.

2756 {
2758 string netMsg = GameLang.Parse("wish".langGame(), thirdPerson: true, name, s);
2759 bool net = EClass.core.config.net.enable && EClass.core.config.net.sendEvent;
2760 List<WishItem> list = new List<WishItem>();
2761 int wishLv = 10 + power / 4;
2762 int wishValue = 5000 + power * 50;
2763 if (state >= BlessedState.Blessed)
2764 {
2765 wishLv = wishLv * 150 / 100;
2766 }
2767 else if (state <= BlessedState.Cursed)
2768 {
2769 wishLv = wishLv * 150 / 100;
2770 wishValue = 1;
2771 }
2772 Debug.Log(power + "/" + wishValue);
2773 string _s = s.ToLower();
2774 foreach (CardRow r in EClass.sources.cards.rows)
2775 {
2776 if (r.HasTag(CTAG.godArtifact))
2777 {
2778 bool flag = false;
2779 foreach (Religion item in EClass.game.religions.list)
2780 {
2781 if (item.giftRank >= 2 && item.IsValidArtifact(r.id))
2782 {
2783 flag = true;
2784 }
2785 }
2786 if (!flag)
2787 {
2788 continue;
2789 }
2790 }
2791 else if (r.quality >= 4 || r.HasTag(CTAG.noWish))
2792 {
2793 switch (r.id)
2794 {
2795 case "medal":
2796 case "plat":
2797 case "money":
2798 case "money2":
2799 break;
2800 default:
2801 continue;
2802 }
2803 }
2804 if (r.isChara)
2805 {
2806 continue;
2807 }
2808 string text = r.GetName().ToLower();
2809 int score = Compare(_s, text);
2810 if (score == 0)
2811 {
2812 continue;
2813 }
2814 list.Add(new WishItem
2815 {
2816 score = score,
2817 n = text,
2818 action = delegate
2819 {
2820 Debug.Log(r.id);
2821 SourceCategory.Row category = EClass.sources.cards.map[r.id].Category;
2822 if (category.IsChildOf("weapon") || category.IsChildOf("armor") || category.IsChildOf("ranged"))
2823 {
2824 CardBlueprint.SetRarity(Rarity.Legendary);
2825 }
2826 Thing thing = ThingGen.Create(r.id, -1, wishLv);
2827 int num = 1;
2828 int price = thing.GetPrice(CurrencyType.Money, sell: false, PriceType.Tourism);
2829 bool flag2 = thing.trait is TraitDeed || thing.rarity >= Rarity.Artifact || thing.source._origin == "artifact_summon";
2830 switch (thing.id)
2831 {
2832 case "rod_wish":
2833 thing.c_charges = 0;
2834 break;
2835 case "money":
2836 num = EClass.rndHalf(wishValue * 3);
2837 break;
2838 case "plat":
2839 num = EClass.rndHalf(wishValue / 500 + 4);
2840 break;
2841 case "money2":
2842 num = EClass.rndHalf(wishValue / 500 + 4);
2843 break;
2844 case "medal":
2845 num = EClass.rndHalf(wishValue / 2000 + 4);
2846 break;
2847 default:
2848 if (!flag2 && thing.trait.CanStack)
2849 {
2850 int num2 = wishValue;
2851 num2 -= price;
2852 for (int i = 1; i < 1000; i++)
2853 {
2854 int num3 = price + i * 2 * (price + 500);
2855 if (num3 > 0 && num2 > num3)
2856 {
2857 num++;
2858 num2 -= num3;
2859 }
2860 }
2861 }
2862 break;
2863 }
2864 if (price > 2500 && num > 3)
2865 {
2866 num = 3 + (int)Mathf.Sqrt(num - 3);
2867 }
2868 if (price > 5000 && num > 2)
2869 {
2870 num = 2 + (int)Mathf.Sqrt(num - 2) / 2;
2871 }
2872 if (price > 10000 && num > 1)
2873 {
2874 num = 1 + Mathf.Min((int)Mathf.Sqrt(num - 1) / 3, 2);
2875 }
2876 if (num < 1)
2877 {
2878 num = 1;
2879 }
2880 thing.SetNum(num);
2881 Debug.Log(_s + "/" + num + "/" + score);
2882 if (thing.HasTag(CTAG.godArtifact))
2883 {
2884 Religion.Reforge(thing.id);
2885 }
2886 else
2887 {
2888 EClass._zone.AddCard(thing, EClass.pc.pos);
2889 }
2890 netMsg = netMsg + Lang.space + GameLang.Parse("wishNet".langGame(), Msg.IsThirdPerson(thing), Msg.GetName(thing).ToTitleCase());
2891 if (net)
2892 {
2893 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
2894 }
2895 Msg.Say("dropReward");
2896 }
2897 });
2898 }
2899 if (list.Count == 0)
2900 {
2901 netMsg = netMsg + Lang.space + "wishFail".langGame();
2902 if (net)
2903 {
2904 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
2905 }
2906 Msg.Say("wishFail");
2907 return false;
2908 }
2909 list.Sort((WishItem a, WishItem b) => b.score - a.score);
2910 foreach (WishItem item2 in list)
2911 {
2912 Debug.Log(item2.score + "/" + s + "/" + item2.n);
2913 }
2914 list[0].action();
2915 return true;
2916 }
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:2918
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:7270
NetSetting net
Definition: CoreConfig.cs:611
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
Definition: GameLang.cs:141
static string langCode
Definition: Lang.cs:28
static bool IsThirdPerson(Card c)
Definition: Msg.cs:291
static ThirstPersonInfo thirdPerson1
Definition: Msg.cs:6
static string GetName(Card c)
Definition: Msg.cs:274
Definition: Net.cs:11
static async UniTask< bool > SendChat(string name, string msg, ChatCategory cat, string idLang)
Definition: Net.cs:318
List< Religion > list
static Thing Reforge(string id, Point pos=null, bool first=true)
Definition: Religion.cs:275
bool HasTag(CTAG _tag)
Definition: RenderRow.cs:125
List< CardRow > rows
Definition: SourceCard.cs:6
Dictionary< string, CardRow > map
Definition: SourceCard.cs:8
SourceCard cards
void Set(string n)
virtual SourceElement.Row source
Definition: TraitScroll.cs:5

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

Member Data Documentation

◆ angle

int ActEffect.angle = 20
static

Definition at line 21 of file ActEffect.cs.

Referenced by ProcAt().

◆ RapidCount

int ActEffect.RapidCount
static

Definition at line 17 of file ActEffect.cs.

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

◆ RapidDelay

float ActEffect.RapidDelay
static

Definition at line 19 of file ActEffect.cs.

Referenced by TryDelay().


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