Elin Decompiled Documentation EA 23.173 Stable
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Pages
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, bool plus=false, 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 (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
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 2495 of file ActEffect.cs.

2496 {
2497 if (s.IsEmpty())
2498 {
2499 return 0;
2500 }
2501 int num = 0;
2502 if (t == s)
2503 {
2504 num += 100;
2505 }
2506 if (t.Contains(s))
2507 {
2508 num += 100;
2509 }
2510 return num;
2511 }

◆ 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 && 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 : (text.ToLower() + "_"));
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 text2 = "ball_";
68 flag = false;
69 break;
70 case EffectId.BallBubble:
71 text2 = "ball_";
72 break;
73 case EffectId.Earthquake:
74 text2 = "SpEarthquake";
75 flag2 = false;
76 flag = true;
77 break;
78 case EffectId.Meteor:
79 text2 = "SpMeteor";
80 break;
81 default:
82 if (CC.isChara && p.Equals(CC.pos) && points.Count >= 2)
83 {
84 continue;
85 }
86 break;
87 case EffectId.Suicide:
88 break;
89 }
90 Effect effect = null;
91 Effect effect2 = (flag2 ? Effect.Get("trail1") : null);
92 Point from = p;
93 switch (id)
94 {
95 case EffectId.Arrow:
96 {
97 effect = Effect.Get("spell_arrow");
98 effect.sr.color = elementRef.colorSprite;
99 TrailRenderer componentInChildren = effect.GetComponentInChildren<TrailRenderer>();
100 Color startColor = (componentInChildren.endColor = elementRef.colorSprite);
101 componentInChildren.startColor = startColor;
102 from = CC.pos;
103 break;
104 }
105 case EffectId.Earthquake:
106 {
107 if (EClass.rnd(4) == 0 && p.IsSync)
108 {
109 effect = Effect.Get("smoke_earthquake");
110 }
111 float num3 = 0.06f * (float)CC.pos.Distance(p);
112 Point pos = p.Copy();
113 TweenUtil.Tween(num3, null, delegate
114 {
115 pos.Animate(AnimeID.Quake, animeBlock: true);
116 });
117 if (effect != null)
118 {
119 effect.SetStartDelay(num3);
120 }
121 break;
122 }
123 default:
124 {
125 effect = Effect.Get("Element/ball_" + ((e.id == 0) ? "Void" : e.source.alias.Remove(0, 3)));
126 if (effect == null)
127 {
128 effect = Effect.Get("Element/ball_Fire");
129 }
130 float startDelay = ((id == EffectId.Meteor) ? 0.1f : 0.04f) * (float)CC.pos.Distance(p);
131 effect.SetStartDelay(startDelay);
132 effect2.SetStartDelay(startDelay);
133 break;
134 }
135 }
136 if (effect2 != null)
137 {
138 effect2.SetParticleColor(elementRef.colorTrail, changeMaterial: true, "_TintColor").Play(from);
139 }
140 if (effect != null)
141 {
142 if (id == EffectId.Arrow)
143 {
144 TryDelay(delegate
145 {
146 effect.Play(CC.pos, 0f, p);
147 });
148 }
149 else
150 {
151 TryDelay(delegate
152 {
153 effect.Play(p).Flip(p.x > CC.pos.x);
154 });
155 }
156 }
157 bool flag3 = false;
158 if (CC.IsPCFactionOrMinion && (CC.HasElement(1651) || EClass.pc.Evalue(1651) >= 2))
159 {
160 bool flag4 = false;
161 foreach (Card item in p.ListCards())
162 {
163 if (item.isChara)
164 {
165 if (item.IsPCFactionOrMinion)
166 {
167 flag4 = true;
168 }
169 }
170 else if ((e.id != 910 && e.id != 911) || !item.IsFood || !item.category.IsChildOf("foodstuff"))
171 {
172 flag4 = true;
173 }
174 }
175 flag3 = flag4;
176 }
177 if (!flag3)
178 {
179 if (e.id == 910)
180 {
181 EClass._map.TryShatter(p, 910, power);
182 }
183 if (e.id == 911)
184 {
185 EClass._map.TryShatter(p, 911, power);
186 }
187 }
188 foreach (Card item2 in p.ListCards().ToList())
189 {
190 Card c = item2;
191 if ((!c.isChara && !c.trait.CanBeAttacked) || (c.IsMultisize && item2 == CC) || (c.isChara && (c.Chara.host == CC || c.Chara.parasite == CC || c.Chara.ride == CC)))
192 {
193 continue;
194 }
195 if (((uint)(id - 250) <= 1u || id == EffectId.Sword) && c.isChara && CC.isChara)
196 {
197 c.Chara.RequestProtection(CC.Chara, delegate(Chara a)
198 {
199 c = a;
200 });
201 }
202 if (id == EffectId.Sword)
203 {
204 attackSource = AttackSource.MagicSword;
205 }
206 int num4 = 0;
207 bool isChara = CC.isChara;
208 if (id == EffectId.Suicide)
209 {
210 num4 = CC.MaxHP * 2;
211 num4 = num4 * 100 / (50 + point.Distance(p) * 75);
212 if ((c.HasCondition<ConBrightnessOfLife>() || c.HasTag(CTAG.suicide)) && !c.HasCondition<ConWet>() && !c.IsPowerful)
213 {
214 list.Add(c);
215 }
216 }
217 else
218 {
219 Dice dice = Dice.Create(text2, power, CC, (actref.refThing != null) ? null : actref.act);
220 if (dice == null)
221 {
222 Debug.Log(text2);
223 }
224 num4 = dice.Roll();
225 switch (id)
226 {
227 case EffectId.Earthquake:
228 if (c.HasCondition<ConGravity>())
229 {
230 num4 = dice.RollMax() * 2;
231 }
232 else if (c.isChara && c.Chara.IsLevitating)
233 {
234 num4 /= 2;
235 }
236 break;
237 case EffectId.Sword:
238 num4 = num4 * (int)Mathf.Min(70f + Mathf.Sqrt(CC.Evalue(101)) * 3f, 200f) / 100;
239 break;
240 }
241 if (id == EffectId.Ball || id == EffectId.BallBubble || id == EffectId.Explosive)
242 {
243 num4 = num4 * 100 / (90 + point.Distance(p) * 10);
244 }
245 }
246 if (id == EffectId.Sword)
247 {
248 c.PlaySound("ab_magicsword");
249 c.PlayEffect("hit_slash");
250 }
251 if ((actref.noFriendlyFire && !CC.Chara.IsHostile(c as Chara)) || (flag && c == CC))
252 {
253 continue;
254 }
255 if (isChara && points.Count > 1 && c != null && c.isChara && CC.isChara && CC.Chara.IsFriendOrAbove(c.Chara))
256 {
257 int num5 = CC.Evalue(302);
258 if (!CC.IsPC && CC.IsPCFactionOrMinion)
259 {
260 num5 += EClass.pc.Evalue(302);
261 }
262 if (CC.HasElement(1214))
263 {
264 num5 *= 2;
265 }
266 if (num5 > 0)
267 {
268 if (num5 * 10 > EClass.rnd(num4 + 1))
269 {
270 if (c == c.pos.FirstChara)
271 {
272 CC.ModExp(302, CC.IsPC ? 10 : 50);
273 }
274 continue;
275 }
276 num4 = EClass.rnd(num4 * 100 / (100 + num5 * 10 + 1));
277 if (c == c.pos.FirstChara)
278 {
279 CC.ModExp(302, CC.IsPC ? 20 : 100);
280 }
281 if (num4 == 0)
282 {
283 continue;
284 }
285 }
286 if ((CC.HasElement(1214) || (!CC.IsPC && (CC.IsPCFaction || CC.IsPCFactionMinion) && EClass.pc.HasElement(1214))) && EClass.rnd(5) != 0)
287 {
288 continue;
289 }
290 }
291 if (!lang.IsEmpty())
292 {
293 if (lang == "spell_hand")
294 {
295 string[] list2 = Lang.GetList("attack" + (CC.isChara ? CC.Chara.race.meleeStyle.IsEmpty("Touch") : "Touch"));
296 string @ref = "_elehand".lang(e.source.GetAltname(2), list2[4]);
297 CC.Say(c.IsPCParty ? "cast_hand_ally" : "cast_hand", CC, c, @ref, c.IsPCParty ? list2[1] : list2[2]);
298 }
299 else
300 {
301 CC.Say(lang + "_hit", CC, c, e.Name.ToLower());
302 }
303 }
304 Chara chara = (CC.isChara ? CC.Chara : ((actref.refThing != null) ? EClass._map.FindChara(actref.refThing.c_uidRefCard) : null));
305 if (c.IsMultisize)
306 {
307 switch (id)
308 {
309 case EffectId.Ball:
310 case EffectId.Explosive:
311 case EffectId.BallBubble:
312 case EffectId.Meteor:
313 case EffectId.Earthquake:
314 case EffectId.Suicide:
315 num4 /= 2;
316 break;
317 }
318 }
319 if (RapidCount > 0)
320 {
321 num4 = num4 * 100 / (100 + RapidCount * 50);
322 }
323 num4 = num4 * Act.powerMod / 100;
324 c.DamageHP(num4, e.id, power * num / 100, attackSource, chara ?? CC);
325 if (c.IsAliveInCurrentZone && CC.IsAliveInCurrentZone && id == EffectId.DrainMana && c.isChara && CC.isChara && c.Chara.mana.value > 0)
326 {
327 int num6 = num4 * num / 100;
328 Debug.Log(num4 + " v:" + num6 + " evalue:" + e.Value + " power:" + power + " elepMod:" + num);
329 if (num6 > c.Chara.mana.value)
330 {
331 num6 = c.Chara.mana.value;
332 }
333 c.Chara.mana.Mod(-num6);
334 CC.Chara.mana.Mod(num6);
335 }
336 if (id == EffectId.Explosive && CC.trait is TraitCookerMicrowave)
337 {
338 chara = EClass.pc;
339 }
340 if (chara != null && chara.IsAliveInCurrentZone)
341 {
342 chara.DoHostileAction(c);
343 }
344 num2++;
345 }
346 if ((id == EffectId.Explosive || id == EffectId.Suicide) && ((id != EffectId.Suicide && id != EffectId.Meteor) || !EClass._zone.IsPCFaction))
347 {
348 int num7 = id switch
349 {
350 EffectId.Suicide => CC.LV / 3 + 40,
351 EffectId.Meteor => 50 + power / 20,
352 _ => (actref.refThing != null) ? actref.refThing.material.hardness : (30 + power / 20),
353 };
354 bool flag5 = EClass._zone.HasLaw && !EClass._zone.IsPCFaction && (CC.IsPC || (id == EffectId.Explosive && actref.refThing == null)) && !(EClass._zone is Zone_Vernis);
355 if (p.HasObj && p.cell.matObj.hardness <= num7)
356 {
358 if (flag5)
359 {
361 }
362 }
363 if (!p.HasObj && p.HasBlock && p.matBlock.hardness <= num7)
364 {
366 if (flag5)
367 {
369 }
370 }
371 }
372 if (e.id == 910)
373 {
374 int num8 = 0;
375 if (id == EffectId.Meteor)
376 {
377 num8 = 2;
378 }
380 {
381 num8 = 0;
382 }
383 if (num8 > EClass.rnd(10))
384 {
385 p.ModFire(4 + EClass.rnd(10));
386 }
387 }
388 if (e.id == 911)
389 {
390 p.ModFire(-20, extinguish: true);
391 }
392 }
393 if (RapidCount == 0)
394 {
395 foreach (Card item3 in list)
396 {
397 if (item3.ExistsOnMap)
398 {
399 RapidCount += 2;
400 ProcAt(id, power, BlessedState.Normal, item3, null, item3.pos, isNeg: true, actref);
401 }
402 }
403 }
404 return num2 > 0;
405 }
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:407
virtual int ElementPowerMod
Definition: ACT.cs:111
Definition: Card.cs:11
bool IsPCFactionOrMinion
Definition: Card.cs:2208
virtual bool IsMultisize
Definition: Card.cs:2094
virtual Chara Chara
Definition: Card.cs:2006
void DamageHP(int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:3912
bool HasElement(int ele, int req=1)
Definition: Card.cs:5588
SourceMaterial.Row material
Definition: Card.cs:1987
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5798
virtual bool IsPCParty
Definition: Card.cs:2085
int c_uidRefCard
Definition: Card.cs:1096
bool ExistsOnMap
Definition: Card.cs:2021
bool HasTag(CTAG tag)
Definition: Card.cs:2531
Point pos
Definition: Card.cs:55
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:5832
Trait trait
Definition: Card.cs:49
bool IsPowerful
Definition: Card.cs:2030
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2063
void SayNothingHappans()
Definition: Card.cs:6440
virtual bool IsPC
Definition: Card.cs:2079
virtual bool isChara
Definition: Card.cs:2019
int Evalue(int ele)
Definition: Card.cs:2507
virtual bool IsPCFactionMinion
Definition: Card.cs:2091
void ModExp(string alias, int a)
Definition: Card.cs:2584
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6445
SourceMaterial.Row matObj
Definition: Cell.cs:1036
Definition: Chara.cs:10
override bool IsAliveInCurrentZone
Definition: Chara.cs:557
bool IsLevitating
Definition: Chara.cs:593
Chara host
Definition: Chara.cs:33
bool RequestProtection(Chara attacker, Action< Chara > action)
Definition: Chara.cs:7810
bool IsFriendOrAbove()
Definition: Chara.cs:6129
Stats mana
Definition: Chara.cs:1006
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:5864
bool IsHostile()
Definition: Chara.cs:6041
SourceRace.Row race
Definition: Chara.cs:460
Definition: ConWet.cs:2
Definition: Dice.cs:4
static int RollMax(int num, int sides, int bonus=0)
Definition: Dice.cs:46
static int Roll(int num, int sides, int bonus=0, Card card=null)
Definition: Dice.cs:15
static Dice Create(Element ele, Card c)
Definition: Dice.cs:96
Definition: EClass.cs:5
static int rnd(int a)
Definition: EClass.cs:58
static Zone _zone
Definition: EClass.cs:20
static Map _map
Definition: EClass.cs:18
static SourceManager sources
Definition: EClass.cs:42
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
static GameSetting setting
Definition: EClass.cs:34
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:248
SourceElement.Row source
Definition: ELEMENT.cs:271
int Value
Definition: ELEMENT.cs:290
virtual string Name
Definition: ELEMENT.cs:302
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1097
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:2554
void TryShatter(Point pos, int ele, int power)
Definition: Map.cs:1195
void MineObj(Point point, Task task=null, Chara c=null)
Definition: Map.cs:1835
void MineBlock(Point point, bool recoverBlock=false, Chara c=null, bool mineObj=true)
Definition: Map.cs:1663
void ModKarma(int a)
Definition: Player.cs:2408
Definition: Point.cs:9
SourceMaterial.Row matBlock
Definition: Point.cs:55
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1031
Point Copy()
Definition: Point.cs:479
int x
Definition: Point.cs:36
void ModFire(int value, bool extinguish=false)
Definition: Point.cs:913
bool IsSync
Definition: Point.cs:332
bool Equals(int _x, int _z)
Definition: Point.cs:940
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:969
Chara FirstChara
Definition: Point.cs:276
bool HasBlock
Definition: Point.cs:141
Cell cell
Definition: Point.cs:51
void Animate(AnimeID id, bool animeBlock=false)
Definition: Point.cs:1282
SourceCalc calc
virtual void Mod(int a)
Definition: Stats.cs:135
virtual int value
Definition: Stats.cs:56
virtual bool CanBeAttacked
Definition: Trait.cs:164
bool ContainsKey(TKey key)
Definition: UDictionary.cs:151
FactionBranch branch
Definition: Zone.cs:34
bool IsPCFaction
Definition: Zone.cs:466
Act act
Definition: ActRef.cs:3
bool noFriendlyFire
Definition: ActRef.cs:15
Thing refThing
Definition: ActRef.cs:9

References EClass._map, EClass._zone, ActRef.act, Point.Animate(), 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, 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 2297 of file ActEffect.cs.

2298 {
2300 {
2302 return;
2303 }
2304 if (c == tc)
2305 {
2306 tc.Say("love_ground", tc);
2307 }
2308 else
2309 {
2310 tc.Say("love_chara", c, tc);
2311 }
2312 Thing t = tc.MakeGene(type);
2313 tc.GiveBirth(t, effect: true);
2314 }
Thing GiveBirth(Thing t, bool effect)
Definition: Card.cs:5465
Thing MakeGene(DNA.Type? type=null)
Definition: Chara.cs:7578
Definition: Msg.cs:5
static string SayNothingHappen()
Definition: Msg.cs:96
Definition: Thing.cs:8
virtual bool IsUserZone
Definition: Zone.cs:266

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

2317 {
2318 Point point = new Point();
2319 for (int i = 0; i < 10000; i++)
2320 {
2321 point.Set(org);
2322 point.x += EClass.rnd(radius) - EClass.rnd(radius);
2323 point.z += EClass.rnd(radius) - EClass.rnd(radius);
2324 if (point.IsValid && point.IsInBounds && !point.cell.blocked && point.Distance(org) >= radius / 3 + 1 - i / 50 && !point.cell.HasZoneStairs())
2325 {
2326 return point;
2327 }
2328 }
2329 return org.GetRandomNeighbor().GetNearestPoint();
2330 }
bool HasZoneStairs(bool includeLocked=true)
Definition: Cell.cs:1717
Point Set(int _x, int _z)
Definition: Point.cs:491
bool IsValid
Definition: Point.cs:88
bool IsInBounds
Definition: Point.cs:104
Point GetRandomNeighbor()
Definition: Point.cs:743
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false)
Definition: Point.cs:607

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,
bool  plus = false,
BlessedState state = null 
)
inlinestatic

Definition at line 2273 of file ActEffect.cs.

2274 {
2275 if (c == tc)
2276 {
2277 tc.Say("love_ground", tc);
2278 }
2279 else
2280 {
2281 tc.Say("love_chara", c, tc);
2282 }
2283 tc.ModAffinity(EClass.pc, power / 4);
2284 if ((plus || EClass.rnd(2) != 0) && (!EClass._zone.IsUserZone || tc.IsPCFaction || !EClass.game.principal.disableUsermapBenefit))
2285 {
2286 if (!plus && EClass.rnd(2) == 0)
2287 {
2288 tc.MakeMilk(effect: true, 1, addToZone: true, state);
2289 }
2290 else
2291 {
2292 tc.MakeEgg(effect: true, 1, addToZone: true, plus ? 3 : 20, state);
2293 }
2294 }
2295 }
Thing MakeMilk(bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
Definition: Card.cs:5441
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5425
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7370
override bool IsPCFaction
Definition: Chara.cs:667
static Game game
Definition: EClass.cs:8
bool disableUsermapBenefit
GamePrincipal principal
Definition: Game.cs:221

References EClass._zone, GamePrincipal.disableUsermapBenefit, EClass.game, Chara.IsPCFaction, Zone.IsUserZone, Card.MakeEgg(), 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 2257 of file ActEffect.cs.

2258 {
2259 tc.Say("eat_poison", tc);
2260 tc.Talk("scream");
2261 if (power > 100000000)
2262 {
2263 power = 100000000;
2264 }
2265 int num = (int)Mathf.Sqrt(power * 100);
2266 tc.DamageHP(num * 2 + EClass.rnd(num), 915, power);
2267 if (!tc.isDead && !tc.IsPC)
2268 {
2270 }
2271 }
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6348
override bool IsPC
Definition: Chara.cs:608
bool isDead
Definition: Chara.cs:385

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]

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

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

842 {
843 if (tc == null)
844 {
845 tc = cc;
846 }
847 Chara TC = tc.Chara;
848 Chara CC = cc.Chara;
849 bool blessed = state >= BlessedState.Blessed;
850 bool flag = state <= BlessedState.Cursed;
851 int orgPower = power;
852 if (blessed || flag)
853 {
854 power *= 2;
855 }
856 switch (id)
857 {
858 case EffectId.Duplicate:
859 {
860 Point randomPoint = CC.pos.GetRandomPoint(2, requireLos: false, allowChara: false, allowBlocked: false, 200);
861 if (randomPoint == null || randomPoint.Equals(CC.pos) || !randomPoint.IsValid || EClass._zone.IsRegion || CC.HasCondition<ConPoison>() || CC.HasCondition<ConConfuse>() || CC.HasCondition<ConDim>() || CC.HasCondition<ConParalyze>() || CC.HasCondition<ConSleep>() || CC.HasCondition<ConBurning>() || CC.HasCondition<ConFreeze>() || CC.HasCondition<ConMiasma>() || CC.corruption >= 100)
862 {
863 CC.Say("split_fail", CC);
864 return;
865 }
866 Chara t2 = CC.Duplicate();
867 EClass._zone.AddCard(t2, randomPoint);
868 CC.Say("split", CC);
869 break;
870 }
871 case EffectId.Escape:
872 if (CC.IsPCFaction || (EClass._zone.Boss == CC && EClass.rnd(30) != 0))
873 {
874 return;
875 }
876 CC.Say("escape", CC);
877 CC.PlaySound("escape");
878 if (EClass._zone.Boss == CC)
879 {
880 CC.TryDropBossLoot();
881 }
882 CC.Destroy();
883 break;
884 case EffectId.Exterminate:
885 {
886 CC.PlaySound("clean_floor");
887 Msg.Say("exterminate");
888 List<Chara> list2 = EClass._map.charas.Where((Chara c) => c.isCopy && !c.IsPCFaction).ToList();
889 if (list2.Count == 0)
890 {
892 return;
893 }
894 foreach (Chara item in list2)
895 {
896 item.Say("split_fail", item);
897 item.PlayEffect("vanish");
898 item.Die();
899 }
900 break;
901 }
902 case EffectId.DropMine:
903 {
904 if (CC.pos.Installed != null || EClass._zone.IsPCFaction)
905 {
906 return;
907 }
908 Thing thing = ThingGen.Create("mine");
909 thing.c_idRefCard = "dog_mine";
910 Zone.ignoreSpawnAnime = true;
911 EClass._zone.AddCard(thing, CC.pos).Install();
912 break;
913 }
914 case EffectId.MagicMap:
915 if (!CC.IsPC)
916 {
918 break;
919 }
920 if (flag)
921 {
922 CC.Say("abMagicMap_curse", CC);
923 CC.PlaySound("curse3");
924 CC.PlayEffect("curse");
925 CC.AddCondition<ConConfuse>(200, force: true);
926 break;
927 }
928 CC.Say("abMagicMap", CC);
929 CC.PlayEffect("identify");
930 CC.PlaySound("identify");
931 if (blessed)
932 {
934 }
935 else
936 {
937 EClass._map.Reveal(CC.pos, power);
938 }
939 break;
940 case EffectId.AbsorbMana:
941 {
942 if (CC == TC)
943 {
944 EClass.game.religions.Element.Talk("ability");
945 }
946 Dice dice = Dice.Create("ActManaAbsorb", power, CC, (actRef.refThing != null) ? null : actRef.act);
947 TC.mana.Mod(dice.Roll());
948 TC.PlaySound("heal");
949 TC.PlayEffect("heal");
950 if (TC == CC)
951 {
952 CC.Say("absorbMana", CC);
953 }
954 break;
955 }
956 case EffectId.ModPotential:
957 {
958 Element element = cc.elements.ListElements((Element e) => e.HasTag("primary")).RandomItem();
959 cc.elements.ModTempPotential(element.id, power / 10);
960 break;
961 }
962 case EffectId.ForgetItems:
963 {
964 TC.PlaySound("curse3");
965 TC.PlayEffect("curse");
966 TC.Say("forgetItems", TC);
967 int num2 = power / 50 + 1 + EClass.rnd(3);
968 List<Thing> source = TC.things.List((Thing t) => t.c_IDTState == 0);
969 for (int i = 0; i < num2; i++)
970 {
971 source.RandomItem().c_IDTState = 5;
972 }
973 break;
974 }
975 case EffectId.EnchantWeapon:
976 case EffectId.EnchantArmor:
977 case EffectId.EnchantWeaponGreat:
978 case EffectId.EnchantArmorGreat:
979 {
980 bool armor = id == EffectId.EnchantArmor || id == EffectId.EnchantArmorGreat;
981 bool flag4 = id == EffectId.EnchantWeaponGreat || id == EffectId.EnchantArmorGreat;
982 if (!tc.isThing)
983 {
984 LayerDragGrid.CreateEnchant(CC, armor, flag4, state);
985 return;
986 }
987 cc.PlaySound("identify");
988 cc.PlayEffect("identify");
989 if (flag)
990 {
991 cc.Say("enc_curse", tc);
992 tc.ModEncLv(-1);
993 break;
994 }
995 int num5 = (flag4 ? 4 : 2) + (blessed ? 1 : 0);
996 if (tc.encLV >= num5)
997 {
998 cc.Say("enc_resist", tc);
999 break;
1000 }
1001 cc.Say("enc", tc);
1002 tc.ModEncLv(1);
1003 break;
1004 }
1005 case EffectId.Identify:
1006 case EffectId.GreaterIdentify:
1007 {
1008 bool flag5 = id == EffectId.GreaterIdentify;
1009 if (flag)
1010 {
1011 Redirect(EffectId.ForgetItems, flag5 ? BlessedState.Cursed : BlessedState.Normal, default(ActRef));
1012 break;
1013 }
1014 if (!tc.isThing)
1015 {
1016 int count = ((!blessed) ? 1 : (flag5 ? (2 + EClass.rnd(2)) : (3 + EClass.rnd(3))));
1017 LayerDragGrid.CreateIdentify(CC, flag5, state, 0, count);
1018 return;
1019 }
1020 cc.PlaySound("identify");
1021 cc.PlayEffect("identify");
1022 tc.Thing.Identify(cc.IsPCParty, (!flag5) ? IDTSource.Identify : IDTSource.SuperiorIdentify);
1023 break;
1024 }
1025 case EffectId.Uncurse:
1026 {
1027 if (!tc.isThing)
1028 {
1029 LayerDragGrid.CreateUncurse(CC, state);
1030 return;
1031 }
1032 Thing thing2 = tc.Thing;
1033 if (thing2.blessedState == BlessedState.Cursed)
1034 {
1035 thing2.SetBlessedState(BlessedState.Normal);
1036 }
1037 else if (thing2.blessedState == BlessedState.Doomed)
1038 {
1039 thing2.SetBlessedState(BlessedState.Normal);
1040 }
1041 thing2.GetRootCard()?.TryStack(thing2);
1042 LayerInventory.SetDirty(thing2);
1043 break;
1044 }
1045 case EffectId.Lighten:
1046 {
1047 if (!tc.isThing)
1048 {
1049 LayerDragGrid.CreateLighten(CC, state);
1050 return;
1051 }
1052 if (tc.Num > 1)
1053 {
1054 tc = tc.Split(1);
1055 }
1056 cc.PlaySound("offering");
1057 cc.PlayEffect("buff");
1058 int num = (tc.isWeightChanged ? tc.c_weight : tc.Thing.source.weight);
1059 tc.isWeightChanged = true;
1060 Element orCreateElement = tc.elements.GetOrCreateElement(64);
1061 Element orCreateElement2 = tc.elements.GetOrCreateElement(65);
1062 Element orCreateElement3 = tc.elements.GetOrCreateElement(67);
1063 Element orCreateElement4 = tc.elements.GetOrCreateElement(66);
1064 bool flag2 = tc.IsEquipmentOrRangedOrAmmo || tc.IsThrownWeapon;
1065 if (flag)
1066 {
1067 num = (int)(0.01f * (float)num * (float)power * 0.75f + 500f);
1068 if (num < 0 || num > 10000000)
1069 {
1070 num = 10000000;
1071 flag2 = false;
1072 }
1073 if (flag2)
1074 {
1075 if (tc.IsWeapon || tc.IsThrownWeapon || tc.IsAmmo)
1076 {
1077 tc.elements.ModBase(67, Mathf.Clamp(orCreateElement3.vBase * power / 1000, 1, 5));
1078 tc.elements.ModBase(66, -Mathf.Clamp(orCreateElement4.vBase * power / 1000, 1, 5));
1079 }
1080 else
1081 {
1082 tc.elements.ModBase(65, Mathf.Clamp(orCreateElement2.vBase * power / 1000, 1, 5));
1083 tc.elements.ModBase(64, -Mathf.Clamp(orCreateElement.vBase * power / 1000, 1, 5));
1084 }
1085 }
1086 cc.Say("lighten_curse", cc, tc);
1087 }
1088 else
1089 {
1090 num = num * (100 - power / 10) / 100;
1091 if (blessed)
1092 {
1093 power /= 4;
1094 }
1095 if (flag2)
1096 {
1097 if (tc.IsWeapon || tc.IsThrownWeapon || tc.IsAmmo)
1098 {
1099 tc.elements.ModBase(67, -Mathf.Clamp(orCreateElement3.vBase * power / 1000, 1, 5));
1100 tc.elements.ModBase(66, Mathf.Clamp(orCreateElement4.vBase * power / 1000, 1, 5));
1101 }
1102 else
1103 {
1104 tc.elements.ModBase(65, -Mathf.Clamp(orCreateElement2.vBase * power / 1000, 1, 5));
1105 tc.elements.ModBase(64, Mathf.Clamp(orCreateElement.vBase * power / 1000, 1, 5));
1106 }
1107 }
1108 cc.Say("lighten", cc, tc);
1109 }
1110 tc.c_weight = num;
1111 tc.SetDirtyWeight();
1112 if (tc.parent == null)
1113 {
1114 CC.Pick(tc.Thing, msg: false);
1115 }
1117 break;
1118 }
1119 case EffectId.Reconstruction:
1120 {
1121 if (!tc.isThing)
1122 {
1124 return;
1125 }
1126 if (tc.Num > 1)
1127 {
1128 tc = tc.Split(1);
1129 }
1130 cc.PlaySound("mutation");
1131 cc.PlayEffect("identify");
1132 cc.Say("reconstruct", cc, tc);
1133 EClass.game.cards.uidNext += EClass.rnd(30);
1134 Thing thing3 = ThingGen.Create(tc.id, -1, tc.LV * power / 100);
1135 thing3.SetBlessedState(state);
1136 tc.Destroy();
1137 CC.Pick(thing3, msg: false);
1138 if (!CC.IsPC)
1139 {
1140 CC.TryEquip(thing3);
1141 }
1142 break;
1143 }
1144 case EffectId.ChangeMaterialLesser:
1145 case EffectId.ChangeMaterial:
1146 case EffectId.ChangeMaterialGreater:
1147 {
1148 SourceMaterial.Row row = EClass.sources.materials.alias.TryGetValue(actRef.n1);
1149 if (!tc.isThing)
1150 {
1151 LayerDragGrid.CreateChangeMaterial(CC, actRef.refThing, row, id, state);
1152 return;
1153 }
1154 if (tc.Num > 1)
1155 {
1156 tc = tc.Split(1);
1157 }
1158 string name = tc.Name;
1159 if (row == null)
1160 {
1161 bool num3 = id == EffectId.ChangeMaterialGreater;
1162 bool flag3 = id == EffectId.ChangeMaterialLesser;
1163 string text2 = tc.Thing.source.tierGroup;
1164 Dictionary<string, SourceMaterial.TierList> tierMap = SourceMaterial.tierMap;
1165 int num4 = 1;
1166 if (flag)
1167 {
1168 num4 -= 2;
1169 }
1170 if (blessed)
1171 {
1172 num4++;
1173 }
1174 if (num3)
1175 {
1176 num4++;
1177 }
1178 if (flag3)
1179 {
1180 num4 -= 2;
1181 }
1182 num4 = Mathf.Clamp(num4 + EClass.rnd(2), 0, 4);
1183 if (EClass.rnd(10) == 0)
1184 {
1185 text2 = ((text2 == "metal") ? "leather" : "metal");
1186 }
1187 SourceMaterial.TierList tierList = (text2.IsEmpty() ? tierMap.RandomItem() : tierMap[text2]);
1188 for (int j = 0; j < 1000; j++)
1189 {
1190 row = tierList.tiers[num4].Select();
1191 if (row != tc.material)
1192 {
1193 break;
1194 }
1195 }
1196 }
1197 cc.PlaySound("offering");
1198 cc.PlayEffect("buff");
1199 if ((tc.id == "log" || tc.id == "branch") && tc.material.alias == "carbone")
1200 {
1201 foreach (Element item2 in tc.elements.dict.Values.ToList())
1202 {
1203 if (item2.IsTrait && item2.vBase != 0)
1204 {
1205 tc.elements.ModBase(item2.id, -item2.vBase);
1206 }
1207 }
1208 }
1209 tc.ChangeMaterial(row);
1210 if (tc.trait is TraitGene && tc.c_DNA != null)
1211 {
1212 DNA.Type type = DNA.GetType(tc.material.alias);
1213 tc.c_DNA.Generate(type);
1214 }
1215 cc.Say("materialChanged", name, row.GetName());
1216 if (CC != null)
1217 {
1218 if (tc.parent == null)
1219 {
1220 CC.Pick(tc.Thing, msg: false);
1221 }
1223 }
1224 break;
1225 }
1226 case EffectId.Return:
1227 case EffectId.Evac:
1228 if (!cc.IsPC)
1229 {
1230 Redirect(EffectId.Teleport, state, default(ActRef));
1231 return;
1232 }
1233 cc.PlaySound("return_cast");
1234 if (EClass.player.returnInfo == null)
1235 {
1236 if (id == EffectId.Evac)
1237 {
1238 EClass.player.returnInfo = new Player.ReturnInfo
1239 {
1240 turns = EClass.rnd(10) + 10,
1241 isEvac = true
1242 };
1243 }
1244 else
1245 {
1246 if (EClass.game.spatials.ListReturnLocations().Count == 0)
1247 {
1248 Msg.Say("returnNowhere");
1249 break;
1250 }
1251 EClass.player.returnInfo = new Player.ReturnInfo
1252 {
1253 turns = EClass.rnd(10) + 10,
1254 askDest = true
1255 };
1256 }
1257 Msg.Say("returnBegin");
1258 }
1259 else
1260 {
1261 EClass.player.returnInfo = null;
1262 Msg.Say("returnAbort");
1263 }
1264 break;
1265 case EffectId.Teleport:
1266 case EffectId.TeleportShort:
1267 case EffectId.Gate:
1268 if (!tc.HasHost)
1269 {
1270 if (!flag)
1271 {
1272 if (id == EffectId.TeleportShort)
1273 {
1274 tc.Teleport(GetTeleportPos(tc.pos));
1275 }
1276 else
1277 {
1279 }
1280 }
1281 if (id == EffectId.Gate && CC.IsPC)
1282 {
1283 foreach (Chara chara2 in EClass._map.charas)
1284 {
1285 if (!chara2.HasHost && chara2 != tc && (chara2.IsPCParty || chara2.IsPCPartyMinion))
1286 {
1287 chara2.Teleport(tc.pos.GetNearestPoint(allowBlock: false, allowChara: false) ?? tc.pos);
1288 }
1289 }
1290 }
1291 }
1292 if (flag)
1293 {
1294 Redirect(EffectId.Gravity, BlessedState.Normal, default(ActRef));
1295 }
1296 if (blessed)
1297 {
1298 Redirect(EffectId.Levitate, BlessedState.Normal, default(ActRef));
1299 }
1300 break;
1301 }
1302 if (TC == null)
1303 {
1304 return;
1305 }
1306 switch (id)
1307 {
1308 case EffectId.ThrowPotion:
1309 if (!CC.pos.Equals(TC.pos))
1310 {
1311 Thing t3 = ThingGen.Create(new string[6] { "330", "331", "334", "335", "336", "1142" }.RandomItem());
1312 ActThrow.Throw(CC, TC.pos, t3, ThrowMethod.Punish, 0.7f);
1313 }
1314 break;
1315 case EffectId.ShutterHex:
1316 {
1317 if (!CC.IsHostile(TC))
1318 {
1319 break;
1320 }
1321 int hex = 0;
1322 foreach (Condition condition4 in TC.conditions)
1323 {
1324 if (condition4.Type == ConditionType.Debuff)
1325 {
1326 hex++;
1327 }
1328 }
1329 if (hex == 0)
1330 {
1331 CC.SayNothingHappans();
1332 break;
1333 }
1334 TC.pos.PlayEffect("holyveil");
1335 TC.pos.PlaySound("holyveil");
1336 TC.pos.PlaySound("atk_eleSound");
1337 TC.conditions.ForeachReverse(delegate(Condition c)
1338 {
1339 if (c.Type == ConditionType.Debuff)
1340 {
1341 c.Kill();
1342 }
1343 });
1344 TC.Say("abShutterHex", TC);
1345 TC.pos.ForeachNeighbor(delegate(Point p)
1346 {
1347 foreach (Chara item3 in p.ListCharas())
1348 {
1349 if (!item3.IsFriendOrAbove(CC))
1350 {
1351 int num9 = Dice.Create("SpShutterHex", power, CC, (actRef.refThing != null) ? null : actRef.act).Roll();
1352 item3.DamageHP(num9 * hex, 919, power, AttackSource.None, CC);
1353 }
1354 }
1355 });
1356 break;
1357 }
1358 case EffectId.Draw:
1359 {
1360 Point point = CC.pos.GetRandomPoint(1)?.GetNearestPoint(allowBlock: false, allowChara: false);
1361 if (point == null || !CC.CanSeeLos(point) || (CC.IsPCFactionOrMinion && TC.IsPCFactionOrMinion && TC.isRestrained))
1362 {
1363 break;
1364 }
1365 CC.Say("abDraw", CC, TC);
1366 if (TC.HasCondition<ConGravity>())
1367 {
1368 CC.SayNothingHappans();
1369 break;
1370 }
1371 TC.MoveImmediate(point, !EClass.core.config.camera.smoothFollow);
1372 if (CC.id == "tentacle")
1373 {
1374 TC.AddCondition<ConEntangle>();
1375 }
1376 break;
1377 }
1378 case EffectId.CatSniff:
1379 {
1380 Chara nearbyCatToSniff = CC.GetNearbyCatToSniff();
1381 if (nearbyCatToSniff != null)
1382 {
1383 CC.Sniff(nearbyCatToSniff);
1384 }
1385 break;
1386 }
1387 case EffectId.Steal:
1388 {
1390 {
1391 break;
1392 }
1393 if (TC.Evalue(426) > 0)
1394 {
1395 TC.Say((actRef.n1 == "money") ? "abStealNegateMoney" : "abStealNegate", TC);
1396 break;
1397 }
1398 Thing thing5 = null;
1399 bool flag8 = actRef.n1 == "food";
1400 if (actRef.n1 == "money")
1401 {
1402 int currency = TC.GetCurrency();
1403 if (currency > 0)
1404 {
1405 currency = Mathf.Clamp(EClass.rnd(currency / 10), 1, 100 + EClass.rndHalf(CC.LV * 200));
1406 thing5 = ThingGen.Create("money").SetNum(currency);
1407 TC.ModCurrency(-currency);
1408 }
1409 }
1410 else
1411 {
1412 Func<Thing, bool> func = (Thing t) => true;
1413 if (flag8)
1414 {
1415 func = (Thing t) => t.IsFood;
1416 }
1417 List<Thing> list6 = TC.things.List(delegate(Thing t)
1418 {
1420 {
1421 return false;
1422 }
1423 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);
1424 }, onlyAccessible: true);
1425 if (list6.Count > 0)
1426 {
1427 thing5 = list6.RandomItem();
1428 if (thing5.Num > 1)
1429 {
1430 thing5 = thing5.Split(1);
1431 }
1432 }
1433 CC.AddCooldown(6640, 200);
1434 }
1435 if (thing5 == null)
1436 {
1437 CC.Say("abStealNothing", CC, TC);
1438 break;
1439 }
1440 thing5.SetInt(116, 1);
1441 TC.PlaySound(thing5.material.GetSoundDrop(thing5.sourceCard));
1442 CC.Pick(thing5, msg: false);
1443 CC.Say("abSteal", CC, TC, thing5.Name);
1444 if (actRef.n1 == "food")
1445 {
1446 if (CC.hunger.value != 0)
1447 {
1448 CC.InstantEat(thing5);
1449 }
1450 }
1451 else
1452 {
1453 CC.Say("abStealEscape", CC);
1454 CC.Teleport(GetTeleportPos(tc.pos, 30), silent: true);
1455 }
1456 break;
1457 }
1458 case EffectId.NeckHunt:
1459 CC.TryNeckHunt(TC, power);
1460 break;
1461 case EffectId.CurseEQ:
1462 {
1463 if (CC != null && CC != TC)
1464 {
1465 TC.Say("curse", CC, TC);
1466 }
1467 TC.PlaySound("curse3");
1468 TC.PlayEffect("curse");
1469 if (EClass.rnd(150 + TC.LUC * 5 + TC.Evalue(972) * 20) >= power + (flag ? 200 : 0) || TC.TryNullifyCurse())
1470 {
1471 break;
1472 }
1473 List<Thing> list7 = TC.things.List(delegate(Thing t)
1474 {
1475 if (!t.isEquipped || t.blessedState == BlessedState.Doomed || t.IsToolbelt)
1476 {
1477 return false;
1478 }
1479 return (t.blessedState < BlessedState.Blessed || EClass.rnd(10) == 0) ? true : false;
1480 });
1481 if (list7.Count == 0)
1482 {
1483 CC.SayNothingHappans();
1484 break;
1485 }
1486 Thing thing6 = list7.RandomItem();
1487 TC.Say("curse_hit", TC, thing6);
1488 thing6.SetBlessedState((thing6.blessedState == BlessedState.Cursed) ? BlessedState.Doomed : BlessedState.Cursed);
1489 LayerInventory.SetDirty(thing6);
1490 break;
1491 }
1492 case EffectId.UncurseEQ:
1493 case EffectId.UncurseEQGreater:
1494 {
1495 TC.Say("uncurseEQ" + (blessed ? "_bless" : (flag ? "_curse" : "")), TC);
1496 TC.PlaySound("uncurse");
1497 TC.PlayEffect("uncurse");
1498 if (flag)
1499 {
1500 Redirect(EffectId.CurseEQ, BlessedState.Normal, default(ActRef));
1501 break;
1502 }
1503 int success = 0;
1504 int fail = 0;
1505 List<Thing> list = new List<Thing>();
1506 TC.things.Foreach(delegate(Thing t)
1507 {
1508 int num10 = 0;
1509 if ((t.isEquipped || t.IsRangedWeapon || blessed) && t.blessedState < BlessedState.Normal)
1510 {
1511 if (t.blessedState == BlessedState.Cursed)
1512 {
1513 num10 = EClass.rnd(200);
1514 }
1515 if (t.blessedState == BlessedState.Doomed)
1516 {
1517 num10 = EClass.rnd(1000);
1518 }
1519 if (blessed)
1520 {
1521 num10 /= 2;
1522 }
1523 if (id == EffectId.UncurseEQGreater)
1524 {
1525 num10 /= 10;
1526 }
1527 if (power >= num10)
1528 {
1529 TC.Say("uncurseEQ_success", t);
1530 t.SetBlessedState(BlessedState.Normal);
1531 if (t.isEquipped && t.HasElement(656))
1532 {
1533 TC.body.Unequip(t);
1534 }
1536 success++;
1537 list.Add(t);
1538 }
1539 else
1540 {
1541 fail++;
1542 }
1543 }
1544 });
1545 foreach (Thing item4 in list)
1546 {
1547 item4.GetRootCard()?.TryStack(item4);
1548 }
1549 if (success == 0 && fail == 0)
1550 {
1551 TC.SayNothingHappans();
1552 }
1553 else if (fail > 0)
1554 {
1555 TC.Say("uncurseEQ_fail");
1556 }
1557 break;
1558 }
1559 case EffectId.Buff:
1560 {
1561 string text3 = actRef.n1;
1562 string text4 = "";
1563 if (flag)
1564 {
1565 text4 = EClass.sources.stats.alias[text3].curse;
1566 if (!text4.IsEmpty())
1567 {
1568 text3 = text4;
1569 }
1570 }
1571 Condition condition2 = Condition.Create(text3, power, delegate(Condition con)
1572 {
1573 if (!actRef.aliasEle.IsEmpty())
1574 {
1575 con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
1576 }
1577 });
1578 condition2.isPerfume = TC.IsPC && actRef.isPerfume;
1579 Condition condition3 = TC.AddCondition(condition2);
1580 if (condition3 != null && condition3.isPerfume)
1581 {
1582 condition3.value = 3;
1583 Msg.Say("perfume", TC);
1584 }
1585 if (!text4.IsEmpty())
1586 {
1587 CC.DoHostileAction(TC);
1588 }
1589 break;
1590 }
1591 case EffectId.KizuamiTrick:
1592 {
1593 EClass.game.religions.Trickery.Talk("ability");
1594 bool hex2 = CC.IsHostile(TC);
1595 List<SourceStat.Row> list3 = EClass.sources.stats.rows.Where((SourceStat.Row con) => con.tag.Contains("random") && con.group == (hex2 ? "Debuff" : "Buff")).ToList();
1596 int power2 = power;
1597 for (int k = 0; k < 4 + EClass.rnd(2); k++)
1598 {
1599 SourceStat.Row row2 = list3.RandomItem();
1600 list3.Remove(row2);
1601 Proc(hex2 ? EffectId.DebuffKizuami : EffectId.Buff, CC, TC, power2, new ActRef
1602 {
1603 n1 = row2.alias
1604 });
1605 }
1607 {
1608 EClass.Wait(0.3f, TC);
1609 }
1610 break;
1611 }
1612 case EffectId.Debuff:
1613 case EffectId.DebuffKizuami:
1614 {
1615 CC.DoHostileAction(TC);
1616 bool isPowerful = TC.IsPowerful;
1617 string n = actRef.n1;
1618 if (n == "ConSuffocation")
1619 {
1620 power = power * 2 / 3;
1621 }
1622 int a2 = power;
1623 int num7 = TC.WIL * (isPowerful ? 20 : 5);
1624 ConHolyVeil condition = TC.GetCondition<ConHolyVeil>();
1625 if (condition != null)
1626 {
1627 num7 += condition.power * 5;
1628 }
1629 if (id != EffectId.DebuffKizuami && EClass.rnd(a2) < num7 / EClass.sources.stats.alias[n].hexPower && EClass.rnd(10) != 0)
1630 {
1631 TC.Say("debuff_resist", TC);
1632 CC.DoHostileAction(TC);
1633 break;
1634 }
1635 TC.AddCondition(Condition.Create(n, power, delegate(Condition con)
1636 {
1637 con.givenByPcParty = CC.IsPCParty;
1638 if (!actRef.aliasEle.IsEmpty())
1639 {
1640 con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
1641 }
1642 }));
1643 if (n == "ConBane" && CC.HasElement(1416))
1644 {
1645 TC.AddCondition<ConExcommunication>(power);
1646 }
1647 CC.DoHostileAction(TC);
1649 {
1650 EClass.Wait(0.3f, TC);
1651 }
1652 break;
1653 }
1654 case EffectId.Mutation:
1655 TC.MutateRandom(1, 100, ether: false, state);
1657 {
1658 EClass.Wait(0.3f, TC);
1659 }
1660 break;
1661 case EffectId.CureMutation:
1662 TC.MutateRandom(-1, 100, ether: false, state);
1663 break;
1664 case EffectId.Ally:
1665 {
1666 Msg.Say("gainAlly");
1667 Chara chara = CharaGen.CreateFromFilter("chara", cc.LV);
1668 EClass._zone.AddCard(chara, cc.pos.GetNearestPoint(allowBlock: false, allowChara: false));
1669 if (cc.IsPCFactionOrMinion)
1670 {
1671 chara.MakeAlly(msg: false);
1672 }
1673 chara.PlaySound("identify");
1674 chara.PlayEffect("teleport");
1675 break;
1676 }
1677 case EffectId.Wish:
1678 if (!TC.IsPC)
1679 {
1680 break;
1681 }
1682 if (blessed || flag)
1683 {
1684 power /= 2;
1685 }
1686 Dialog.InputName("dialogWish", "q", delegate(bool cancel, string text)
1687 {
1688 if (!cancel)
1689 {
1690 Msg.Say("wish", TC, text);
1691 Wish(text, EClass.pc.NameTitled, power, state);
1692 }
1693 });
1694 break;
1695 case EffectId.Faith:
1696 {
1698 tc.PlayEffect("aura_heaven");
1699 tc.PlaySound("aura_heaven");
1700 tc.Say("faith", tc, faith.Name);
1701 if (flag)
1702 {
1703 tc.Say("faith_curse", tc, faith.Name);
1704 break;
1705 }
1706 if (blessed)
1707 {
1708 tc.Say("faith_bless", tc, faith.Name);
1709 }
1710 tc.ModExp(306, power * 10);
1711 tc.ModExp(85, power * 10);
1712 if (tc.elements.Base(85) >= tc.elements.Value(306))
1713 {
1714 tc.elements.SetBase(85, tc.elements.Value(306));
1715 }
1716 break;
1717 }
1718 case EffectId.TransGender:
1719 {
1720 tc.PlaySound("mutation");
1721 tc.PlayEffect("mutation");
1722 int gender = tc.bio.gender;
1723 int gender2 = gender switch
1724 {
1725 1 => 2,
1726 2 => 1,
1727 _ => (EClass.rnd(2) != 0) ? 1 : 2,
1728 };
1729 if (gender != 0 && EClass.rnd(10) == 0)
1730 {
1731 gender2 = 0;
1732 }
1733 tc.bio.SetGender(gender2);
1734 tc.Say("transGender", tc, Gender.Name(tc.bio.gender));
1735 tc.Talk("tail");
1736 if (blessed && tc.bio.age > 1)
1737 {
1738 tc.Say("ageDown", tc);
1739 tc.bio.age--;
1740 }
1741 else if (flag)
1742 {
1743 tc.Say("ageUp", tc);
1744 tc.bio.age++;
1745 }
1746 break;
1747 }
1748 case EffectId.BuffStats:
1749 case EffectId.DebuffStats:
1750 case EffectId.LulwyTrick:
1751 Debug.Log(power + "/" + id.ToString() + "/" + actRef.n1);
1752 if (id == EffectId.LulwyTrick)
1753 {
1754 EClass.game.religions.Wind.Talk("ability");
1755 }
1756 if (power < 0 || id == EffectId.DebuffStats)
1757 {
1758 power = Mathf.Abs(power);
1759 if (blessed)
1760 {
1761 power /= 4;
1762 }
1763 flag = true;
1764 }
1765 TC.AddCondition(Condition.Create(power, delegate(ConBuffStats con)
1766 {
1767 con.SetRefVal(Element.GetId(actRef.n1), (int)id);
1768 }));
1769 break;
1770 case EffectId.Revive:
1771 {
1772 List<KeyValuePair<int, Chara>> list5 = 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();
1773 if (TC.IsPCFaction || TC.IsPCFactionMinion)
1774 {
1775 if (TC.IsPC && list5.Count == 0)
1776 {
1777 list5 = 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();
1778 }
1779 if (list5.Count > 0)
1780 {
1781 list5.RandomItem().Value.Chara.GetRevived();
1782 break;
1783 }
1784 }
1785 TC.SayNothingHappans();
1786 break;
1787 }
1788 case EffectId.DamageBody:
1789 case EffectId.DamageMind:
1790 case EffectId.DamageBodyGreat:
1791 case EffectId.DamageMindGreat:
1792 case EffectId.Weaken:
1793 {
1794 bool flag7 = id == EffectId.DamageBody || id == EffectId.DamageBodyGreat;
1795 bool mind = id == EffectId.DamageMind || id == EffectId.DamageMindGreat;
1796 int num8 = ((id == EffectId.DamageBody || id == EffectId.DamageMind) ? 1 : (4 + EClass.rnd(4)));
1797 if (id == EffectId.Weaken)
1798 {
1799 flag7 = EClass.rnd(2) == 0;
1800 mind = !flag7;
1801 num8 = 1;
1802 }
1803 else
1804 {
1805 TC.PlayEffect("debuff");
1806 TC.PlaySound("debuff");
1807 }
1808 TC.Say(flag7 ? "damageBody" : "damageMind", TC);
1809 for (int l = 0; l < num8; l++)
1810 {
1811 TC.DamageTempElements(power, flag7, mind, id != EffectId.Weaken);
1812 }
1813 if (TC.IsPC)
1814 {
1815 Tutorial.Play("healer");
1816 }
1817 break;
1818 }
1819 case EffectId.EnhanceBody:
1820 case EffectId.EnhanceMind:
1821 case EffectId.EnhanceBodyGreat:
1822 case EffectId.EnhanceMindGreat:
1823 {
1824 bool flag9 = id == EffectId.EnhanceBody || id == EffectId.EnhanceBodyGreat;
1825 bool mind2 = id == EffectId.EnhanceMind || id == EffectId.EnhanceMindGreat;
1826 if (id != EffectId.EnhanceBody && id != EffectId.EnhanceMind)
1827 {
1828 EClass.rnd(4);
1829 }
1830 TC.Say(flag9 ? "enhanceBody" : "enhanceMind", TC);
1831 TC.PlayEffect("buff");
1832 TC.PlaySound("buff");
1833 TC.EnhanceTempElements(power, flag9, mind2, onlyRenew: true);
1834 break;
1835 }
1836 case EffectId.RestoreBody:
1837 case EffectId.RestoreMind:
1838 {
1839 bool flag6 = id == EffectId.RestoreBody;
1840 if (flag)
1841 {
1842 Redirect(flag6 ? EffectId.DamageBodyGreat : EffectId.DamageMindGreat, BlessedState.Normal, default(ActRef));
1843 break;
1844 }
1845 TC.Say(flag6 ? "restoreBody" : "restoreMind", TC);
1846 TC.PlaySound("heal");
1847 TC.PlayEffect("heal");
1848 TC.CureHost(flag6 ? CureType.CureBody : CureType.CureMind, power, state);
1849 if (blessed)
1850 {
1851 Redirect(flag6 ? EffectId.EnhanceBodyGreat : EffectId.EnhanceMindGreat, BlessedState.Normal, default(ActRef));
1852 }
1853 break;
1854 }
1855 case EffectId.HealComplete:
1856 TC.HealHPHost(100000000, (actRef.refThing == null) ? HealSource.Magic : HealSource.Item);
1857 TC.CureHost(CureType.HealComplete, power, state);
1858 TC.Say("heal_heavy", TC);
1859 break;
1860 case EffectId.Heal:
1861 case EffectId.JureHeal:
1862 {
1863 if (id == EffectId.JureHeal)
1864 {
1865 EClass.game.religions.Healing.Talk("ability");
1866 }
1867 if (actRef.act != null)
1868 {
1869 Debug.Log(actRef.act.id);
1870 }
1871 int num6 = 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();
1872 if (actRef.refThing != null)
1873 {
1874 num6 = num6 * (100 + actRef.refThing.Evalue(7500)) / 100;
1875 }
1876 if (flag)
1877 {
1878 TC.DamageHP(num6 / 2, 919, power);
1879 break;
1880 }
1881 TC.HealHPHost(num6, (actRef.refThing == null && id != EffectId.JureHeal) ? HealSource.Magic : HealSource.Item);
1882 TC.CureHost(CureType.Heal, power, state);
1883 TC.Say((power >= 300) ? "heal_heavy" : "heal_light", TC);
1884 break;
1885 }
1886 case EffectId.RemedyJure:
1887 TC.HealHP(1000000, HealSource.Magic);
1888 TC.CureHost(CureType.Jure, power, state);
1889 TC.Say("heal_jure", TC);
1890 break;
1891 case EffectId.Headpat:
1892 CC.Cuddle(TC, headpat: true);
1893 break;
1894 case EffectId.RemoveHex:
1895 case EffectId.RemoveHexAll:
1896 if (flag)
1897 {
1898 Redirect(EffectId.CurseEQ, BlessedState.Normal, default(ActRef));
1899 break;
1900 }
1901 foreach (Condition item5 in TC.conditions.Copy())
1902 {
1903 if (item5.Type == ConditionType.Debuff && !item5.IsKilled && EClass.rnd(power * 2) > EClass.rnd(item5.power))
1904 {
1905 CC.Say("removeHex", TC, item5.Name.ToLower());
1906 item5.Kill();
1907 if (id == EffectId.RemoveHex)
1908 {
1909 break;
1910 }
1911 }
1912 }
1913 TC.AddCondition<ConHolyVeil>(power / 2);
1914 break;
1915 case EffectId.CureCorruption:
1916 TC.PlaySound("heal");
1917 TC.PlayEffect("heal");
1918 if (flag)
1919 {
1920 TC.Say("cureCorruption_curse", TC);
1921 TC.mana.Mod(9999);
1922 TC.ModCorruption(power);
1923 }
1924 else
1925 {
1926 TC.Say("cureCorruption", TC);
1927 TC.ModCorruption(-power * (blessed ? 150 : 200) / 100);
1928 }
1929 break;
1930 case EffectId.Drink:
1931 case EffectId.DrinkRamune:
1932 case EffectId.DrinkMilk:
1933 if (id == EffectId.DrinkRamune)
1934 {
1935 TC.Say("drinkRamune", TC);
1936 }
1937 if (TC.IsPC)
1938 {
1939 TC.Say("drinkGood", TC);
1940 }
1941 if (id == EffectId.DrinkMilk)
1942 {
1943 if (TC.IsPC)
1944 {
1945 TC.Say("drinkMilk", TC);
1946 }
1947 if (blessed)
1948 {
1949 TC.ModHeight(EClass.rnd(5) + 3);
1950 }
1951 else if (flag)
1952 {
1953 TC.ModHeight((EClass.rnd(5) + 3) * -1);
1954 }
1955 }
1956 break;
1957 case EffectId.DrinkWater:
1958 if (flag)
1959 {
1960 if (TC.IsPC)
1961 {
1962 TC.Say("drinkWater_dirty", TC);
1963 }
1965 }
1966 else if (TC.IsPC)
1967 {
1968 TC.Say("drinkWater_clear", TC);
1969 }
1970 break;
1971 case EffectId.DrinkWaterDirty:
1972 if (TC.IsPC)
1973 {
1974 TC.Say("drinkWater_dirty", TC);
1975 }
1976 if (TC.IsPCFaction)
1977 {
1978 TC.Vomit();
1979 }
1980 break;
1981 case EffectId.SaltWater:
1982 if (TC.HasElement(1211))
1983 {
1984 TC.Say("drinkSaltWater_snail", TC);
1985 int dmg = ((TC.hp > 10) ? (TC.hp - EClass.rnd(10)) : 10000);
1986 TC.DamageHP(dmg, AttackSource.None, CC);
1987 }
1988 else if (TC.IsPC)
1989 {
1990 TC.Say("drinkSaltWater", TC);
1991 }
1992 break;
1993 case EffectId.Booze:
1994 TC.AddCondition<ConDrunk>(power);
1995 if (TC.HasElement(1215))
1996 {
1997 TC.Say("drunk_dwarf", TC);
1998 TC.AddCondition(Condition.Create(power + EClass.rnd(power), delegate(ConBuffStats con)
1999 {
2000 con.SetRefVal(Element.List_MainAttributes.RandomItem(), (int)id);
2001 }));
2002 }
2003 break;
2004 case EffectId.CatsEye:
2005 if (flag)
2006 {
2007 Redirect(EffectId.Blind, BlessedState.Normal, default(ActRef));
2008 }
2009 else
2010 {
2011 TC.AddCondition<ConNightVision>(power);
2012 }
2013 break;
2014 case EffectId.Hero:
2015 if (flag)
2016 {
2017 Redirect(EffectId.Fear, BlessedState.Normal, default(ActRef));
2018 }
2019 else
2020 {
2021 TC.AddCondition<ConHero>(power);
2022 }
2023 break;
2024 case EffectId.HolyVeil:
2025 if (flag)
2026 {
2027 Redirect(EffectId.Fear, BlessedState.Normal, default(ActRef));
2028 }
2029 else
2030 {
2031 TC.AddCondition<ConHolyVeil>(power);
2032 }
2033 break;
2034 case EffectId.Levitate:
2035 if (flag)
2036 {
2037 Redirect(EffectId.Gravity, BlessedState.Normal, default(ActRef));
2038 }
2039 else
2040 {
2041 TC.AddCondition<ConLevitate>(power);
2042 }
2043 break;
2044 case EffectId.Gravity:
2045 if (blessed)
2046 {
2047 power /= 4;
2048 }
2049 TC.AddCondition<ConGravity>(power);
2050 if (flag)
2051 {
2052 Redirect(EffectId.BuffStats, BlessedState.Cursed, new ActRef
2053 {
2054 aliasEle = "STR"
2055 });
2056 }
2057 break;
2058 case EffectId.Fear:
2059 if (blessed)
2060 {
2061 power /= 4;
2062 }
2063 TC.AddCondition<ConFear>(power);
2064 if (flag)
2065 {
2066 Redirect(EffectId.Confuse, BlessedState.Normal, default(ActRef));
2067 }
2068 break;
2069 case EffectId.Faint:
2070 if (blessed)
2071 {
2072 power /= 4;
2073 }
2074 TC.AddCondition<ConFaint>(power);
2075 if (flag)
2076 {
2077 Redirect(EffectId.Disease, BlessedState.Normal, default(ActRef));
2078 }
2079 break;
2080 case EffectId.Paralyze:
2081 if (blessed)
2082 {
2083 power /= 4;
2084 }
2085 TC.AddCondition<ConParalyze>(power);
2086 if (flag)
2087 {
2088 Redirect(EffectId.Blind, BlessedState.Normal, default(ActRef));
2089 }
2090 break;
2091 case EffectId.Poison:
2092 if (blessed)
2093 {
2094 power /= 4;
2095 }
2096 TC.AddCondition<ConPoison>(power);
2097 if (flag)
2098 {
2099 Redirect(EffectId.Paralyze, BlessedState.Normal, default(ActRef));
2100 }
2101 break;
2102 case EffectId.Sleep:
2103 if (blessed)
2104 {
2105 power /= 4;
2106 }
2107 TC.AddCondition<ConSleep>(power);
2108 if (flag)
2109 {
2110 Redirect(EffectId.Disease, BlessedState.Normal, default(ActRef));
2111 }
2112 break;
2113 case EffectId.Confuse:
2114 if (blessed)
2115 {
2116 power /= 4;
2117 }
2118 TC.AddCondition<ConConfuse>(power);
2119 if (flag)
2120 {
2121 Redirect(EffectId.Fear, BlessedState.Normal, default(ActRef));
2122 }
2123 break;
2124 case EffectId.Blind:
2125 if (blessed)
2126 {
2127 power /= 4;
2128 }
2129 TC.AddCondition<ConBlind>(power);
2130 if (flag)
2131 {
2132 Redirect(EffectId.Confuse, BlessedState.Normal, default(ActRef));
2133 }
2134 break;
2135 case EffectId.Disease:
2136 if (blessed)
2137 {
2138 power /= 4;
2139 }
2140 TC.AddCondition<ConDisease>(power);
2141 if (flag)
2142 {
2143 Redirect(EffectId.Poison, BlessedState.Normal, default(ActRef));
2144 }
2145 break;
2146 case EffectId.Acid:
2147 {
2148 if (blessed)
2149 {
2150 power /= 4;
2151 }
2152 List<Thing> list4 = TC.things.List((Thing t) => (t.Num <= 1 && t.IsEquipmentOrRanged && !t.IsToolbelt && !t.IsLightsource && t.isEquipped) ? true : false);
2153 if (list4.Count != 0)
2154 {
2155 Thing thing4 = list4.RandomItem();
2156 TC.Say("acid_hit", TC);
2157 if (thing4.isAcidproof)
2158 {
2159 TC.Say("acid_nullify", thing4);
2160 }
2161 else if (thing4.encLV > -5)
2162 {
2163 TC.Say("acid_rust", TC, thing4);
2164 thing4.ModEncLv(-1);
2165 LayerInventory.SetDirty(thing4);
2166 }
2167 if (TC.IsPCParty)
2168 {
2169 Tutorial.Reserve("rust");
2170 }
2171 }
2172 break;
2173 }
2174 case EffectId.PuddleEffect:
2175 TC.DamageHP(power / 5, actRef.idEle, power);
2176 break;
2177 case EffectId.Acidproof:
2178 if (blessed)
2179 {
2180 power /= 4;
2181 }
2182 if (TC.IsPC)
2183 {
2184 TC.Say("pc_pain");
2185 }
2186 TC.Say("drink_acid", TC);
2187 TC.DamageHP(power / 5, 923, power);
2188 break;
2189 case EffectId.LevelDown:
2190 Msg.Say("nothingHappens");
2191 break;
2192 case EffectId.Love:
2193 case EffectId.LovePlus:
2194 if (flag)
2195 {
2196 if (CC == TC)
2197 {
2198 TC.Say("love_curse_self", TC);
2199 }
2200 else
2201 {
2202 TC.Say("love_curse", CC, TC);
2203 TC.ModAffinity(CC, -power / 4, show: false);
2204 }
2205 TC.ShowEmo(Emo.angry);
2206 }
2207 else
2208 {
2209 LoveMiracle(TC, CC, power, id == EffectId.LovePlus, state);
2210 }
2211 break;
2212 case EffectId.HairGrowth:
2213 if (flag)
2214 {
2215 if (TC.HasElement(1532))
2216 {
2217 TC.SetMutation(1532);
2218 }
2219 else
2220 {
2221 TC.SetMutation(1533, 1);
2222 }
2223 TC.c_fur = 0;
2224 break;
2225 }
2226 if (blessed)
2227 {
2228 if (TC.HasElement(1533))
2229 {
2230 TC.SetMutation(1533);
2231 }
2232 else
2233 {
2234 TC.SetMutation(1532, 1);
2235 }
2236 }
2237 TC.PlayEffect("aura_heaven");
2238 TC.PlaySound("godbless");
2239 if (!TC.HaveFur())
2240 {
2241 TC.Say("grow_hair_fail", TC);
2242 break;
2243 }
2244 TC.Say("grow_hair", TC);
2245 TC.c_fur = 100;
2246 break;
2247 case EffectId.Gene:
2248 GeneMiracle(TC, CC, blessed ? DNA.Type.Superior : (flag ? DNA.Type.Brain : DNA.Type.Default));
2249 break;
2250 }
2251 void Redirect(EffectId _id, BlessedState _state, ActRef _ref1)
2252 {
2253 Proc(_id, orgPower, _state, cc, tc, _ref1);
2254 }
2255 }
@ 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 GeneMiracle(Chara tc, Chara c, DNA.Type type)
Definition: ActEffect.cs:2297
static Point GetTeleportPos(Point org, int radius=6)
Definition: ActEffect.cs:2316
static void LoveMiracle(Chara tc, Chara c, int power, bool plus=false, BlessedState? state=null)
Definition: ActEffect.cs:2273
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
Definition: ActThrow.cs:93
virtual string ID
Definition: ACT.cs:99
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:454
int gender
Definition: Biography.cs:29
GlobalCharaList globalCharas
Definition: CardManager.cs:46
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:5527
virtual bool isThing
Definition: Card.cs:2017
bool IsAmmo
Definition: Card.cs:2183
Thing Split(int a)
Definition: Card.cs:3345
ElementContainerCard elements
Definition: Card.cs:37
string id
Definition: Card.cs:31
bool IsThrownWeapon
Definition: Card.cs:2181
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:2957
bool isCopy
Definition: Card.cs:862
Biography bio
Definition: Card.cs:40
string Name
Definition: Card.cs:2073
bool IsRangedWeapon
Definition: Card.cs:2179
ICardParent parent
Definition: Card.cs:51
Thing SetNum(int a)
Definition: Card.cs:3356
bool IsFood
Definition: Card.cs:2111
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3744
bool isAcidproof
Definition: Card.cs:670
bool IsToolbelt
Definition: Card.cs:2105
void SetDirtyWeight()
Definition: Card.cs:2490
bool IsEquipmentOrRanged
Definition: Card.cs:2154
void TryStack(Thing t)
Definition: Card.cs:6604
int encLV
Definition: Card.cs:310
void ModEncLv(int a)
Definition: Card.cs:3695
void Destroy()
Definition: Card.cs:4805
virtual Thing Thing
Definition: Card.cs:1994
Card GetRootCard()
Definition: Card.cs:3287
bool IsLightsource
Definition: Card.cs:2107
virtual bool HasHost
Definition: Card.cs:2359
BlessedState blessedState
Definition: Card.cs:262
Card Install()
Definition: Card.cs:3590
Card parentCard
Definition: Card.cs:99
DNA c_DNA
Definition: Card.cs:1841
int Num
Definition: Card.cs:154
bool IsWeapon
Definition: Card.cs:2142
int LV
Definition: Card.cs:370
void UnqeuipIfTooHeavy(Thing t)
Definition: CharaBody.cs:165
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:8944
void Cuddle(Chara c, bool headpat=false)
Definition: Chara.cs:5776
void InstantEat(Thing t=null, bool sound=true)
Definition: Chara.cs:7035
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:8607
Chara GetNearbyCatToSniff()
Definition: Chara.cs:7499
bool CanSeeLos(Card c, int dist=-1)
Definition: Chara.cs:1102
override bool IsPCParty
Definition: Chara.cs:611
int corruption
Definition: Chara.cs:373
bool HasCondition(string alias)
Definition: Chara.cs:8764
Stats hunger
Definition: Chara.cs:994
override bool HasHost
Definition: Chara.cs:684
override bool IsPCPartyMinion
Definition: Chara.cs:635
Chara Duplicate()
Definition: Chara.cs:1584
void MakeAlly(bool msg=true)
Definition: Chara.cs:2073
void TryDropBossLoot()
Definition: Chara.cs:5207
string NameTitled
Definition: Chara.cs:512
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:8081
Religion faith
Definition: Chara.cs:435
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7160
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:4017
void Sniff(Chara c)
Definition: Chara.cs:7511
Definition: ConDim.cs:2
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:602
CameraConfig camera
Definition: CoreConfig.cs:610
CoreConfig config
Definition: Core.cs:70
Definition: DNA.cs:8
Type
Definition: DNA.cs:10
static Type GetType(string idMat)
Definition: DNA.cs:498
void Generate(Type _type, Chara model=null)
Definition: DNA.cs:254
Definition: Dialog.cs:7
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
Definition: Dialog.cs:528
static Core core
Definition: EClass.cs:6
static void Wait(float a, Card c)
Definition: EClass.cs:97
static int rndHalf(int a)
Definition: EClass.cs:82
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)
Element GetOrCreateElement(Element ele)
int vBase
Definition: ELEMENT.cs:250
bool HasTag(string tag)
Definition: ELEMENT.cs:471
static int[] List_MainAttributes
Definition: ELEMENT.cs:238
static int GetId(string alias)
Definition: ELEMENT.cs:1116
bool IsTrait
Definition: ELEMENT.cs:360
ReligionManager religions
Definition: Game.cs:158
SpatialManager spatials
Definition: Game.cs:152
CardManager cards
Definition: Game.cs:155
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:913
List< Chara > charas
Definition: Map.cs:81
void RevealAll(bool reveal=true)
Definition: Map.cs:900
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
ReturnInfo returnInfo
Definition: Player.cs:789
Thing Installed
Definition: Point.cs:315
List< Chara > ListCharas()
Definition: Point.cs:1151
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
Definition: Point.cs:753
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
List< Zone > ListReturnLocations()
virtual bool IsRegion
Definition: Spatial.cs:501
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:1987
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
Chara Boss
Definition: Zone.cs:83
ZoneInstance instance
Definition: Zone.cs:52
Card AddCard(Card t, Point point)
Definition: Zone.cs:1920
Definition: ActRef.cs:2
string n1
Definition: ActRef.cs:7
int idEle
Definition: ActRef.cs:17
bool isPerfume
Definition: ActRef.cs:13
string aliasEle
Definition: ActRef.cs:5

References EClass._map, EClass._zone, Zone.AddCard(), Chara.AddCondition(), Chara.AddCooldown(), armor, Card.blessedState, Chara.body, Zone.Boss, Map.bounds, Card.c_DNA, CoreConfig.camera, Chara.CanSeeLos(), Card.ChangeMaterial(), Card.Chara, Map.charas, Core.config, EClass.core, Chara.corruption, Dice.Create(), ThingGen.Create(), LayerDragGrid.CreateChangeMaterial(), LayerDragGrid.CreateEnchant(), LayerDragGrid.CreateIdentify(), LayerDragGrid.CreateLighten(), LayerDragGrid.CreateReconstruction(), LayerDragGrid.CreateUncurse(), currency, Card.Destroy(), ElementContainer.dict, Chara.Duplicate(), ReligionManager.Element, Card.elements, Card.encLV, Point.Equals(), EClass.game, DNA.Generate(), Chara.GetNearbyCatToSniff(), Point.GetNearestPoint(), ElementContainer.GetOrCreateElement(), Point.GetRandomPoint(), Card.GetRootCard(), DNA.GetType(), Chara.HasCondition(), Card.HasElement(), Card.HasHost, Chara.HasHost, Element.HasTag(), Chara.hunger, Card.id, Element.id, Thing.Identify(), if(), Card.Install(), Point.Installed, Zone.instance, Chara.InstantEat(), Card.IsAmmo, Card.isCopy, Thing.isEquipped, Chara.IsHostile(), Card.IsPC, Chara.IsPC, Chara.IsPCFaction, Zone.IsPCFaction, Card.IsPCFactionOrMinion, Card.IsPCParty, Chara.IsPCParty, Chara.IsPCPartyMinion, Card.IsRangedWeapon, Spatial.IsRegion, Card.isThing, Card.IsThrownWeapon, Card.IsToolbelt, Element.IsTrait, Point.IsValid, Card.IsWeapon, item, Point.ListCharas(), ElementContainer.ListElements(), SpatialManager.ListReturnLocations(), Card.LV, Card.material, SourceManager.materials, ElementContainer.ModBase(), Card.ModEncLv(), ElementContainer.ModTempPotential(), Card.Name, Card.Num, Card.parent, Card.parentCard, Chara.Pick(), Card.PlayEffect(), EClass.player, Card.PlaySound(), Card.pos, Game.religions, Player.returnInfo, Map.Reveal(), Map.RevealAll(), EClass.rnd(), EClass.rndHalf(), Dice.Roll(), Msg.Say(), Card.Say(), Card.SayNothingHappans(), Msg.SayNothingHappen(), SourceMaterial.Tier.Select(), Card.SetBlessedState(), LayerInventory.SetDirty(), Card.SetDirtyWeight(), BaseCard.SetInt(), Card.SetNum(), CoreConfig.CameraConfig.smoothFollow, Chara.Sniff(), Thing.source, Thing.sourceCard, EClass.sources, Game.spatials, Card.Split(), Religion.Talk(), Card.Teleport(), Card.Thing, ActThrow.Throw(), SourceMaterial.tierMap, SourceMaterial.TierList.tiers, Card.trait, Chara.TryDropBossLoot(), Chara.TryEquip(), Chara.TryNeckHunt(), Card.TryStack(), BaseStats.Type, CharaBody.UnqeuipIfTooHeavy(), Stats.value, Element.vBase, and MapBounds.Width.

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

408 {
409 Chara CC = cc.Chara;
410 bool flag = state <= BlessedState.Cursed;
411 bool flag2 = isNeg || flag;
412 Element element = Element.Create(actRef.aliasEle.IsEmpty("eleFire"), power / 10);
414 {
415 angle += 5;
416 if (angle > 100)
417 {
418 angle = 30;
419 }
420 Debug.Log(angle);
421 }
422 switch (id)
423 {
424 case EffectId.Earthquake:
425 {
426 List<Point> list7 = EClass._map.ListPointsInCircle(CC.pos, 12f, mustBeWalkable: false);
427 if (list7.Count == 0)
428 {
429 list7.Add(CC.pos.Copy());
430 }
431 CC.Say("spell_earthquake", CC, element.Name.ToLower());
432 TryDelay(delegate
433 {
434 CC.PlaySound("spell_earthquake");
435 });
436 if (CC.IsInMutterDistance())
437 {
438 Shaker.ShakeCam("ball");
439 }
440 EClass.Wait(1f, CC);
441 DamageEle(CC, id, power, element, list7, actRef, "spell_earthquake");
442 break;
443 }
444 case EffectId.Meteor:
445 {
446 EffectMeteor.Create(cc.pos, 6, 10, delegate
447 {
448 });
449 List<Point> list4 = EClass._map.ListPointsInCircle(CC.pos, 10f);
450 if (list4.Count == 0)
451 {
452 list4.Add(CC.pos.Copy());
453 }
454 CC.Say("spell_ball", CC, element.Name.ToLower());
455 TryDelay(delegate
456 {
457 CC.PlaySound("spell_ball");
458 });
459 if (CC.IsInMutterDistance())
460 {
461 Shaker.ShakeCam("ball");
462 }
463 EClass.Wait(1f, CC);
464 DamageEle(CC, id, power, element, list4, actRef, "spell_ball");
465 return;
466 }
467 case EffectId.Hand:
468 case EffectId.DrainBlood:
469 case EffectId.DrainMana:
470 case EffectId.Sword:
471 {
472 List<Point> list = new List<Point>();
473 list.Add(tp.Copy());
474 EClass.Wait(0.3f, CC);
475 TryDelay(delegate
476 {
477 CC.PlaySound("spell_hand");
478 });
479 Chara cC = CC;
480 EffectId id3 = id;
481 Element e = element;
482 ActRef actref = actRef;
483 object lang;
484 switch (id)
485 {
486 default:
487 lang = "spell_hand";
488 break;
489 case EffectId.Sword:
490 lang = "spell_sword";
491 break;
492 case EffectId.DrainBlood:
493 case EffectId.DrainMana:
494 lang = "";
495 break;
496 }
497 if (!DamageEle(cC, id3, power, e, list, actref, (string)lang))
498 {
499 CC.Say("spell_hand_miss", CC, element.Name.ToLower());
500 }
501 return;
502 }
503 case EffectId.Arrow:
504 {
505 List<Point> list5 = new List<Point>();
506 list5.Add(tp.Copy());
507 CC.Say("spell_arrow", CC, element.Name.ToLower());
508 EClass.Wait(0.5f, CC);
509 TryDelay(delegate
510 {
511 CC.PlaySound("spell_arrow");
512 });
513 DamageEle(CC, id, power, element, list5, actRef, "spell_arrow");
514 return;
515 }
516 case EffectId.Summon:
517 {
518 CC.Say("summon_ally", CC);
519 if (EClass._zone.CountMinions(CC) >= CC.MaxSummon || CC.c_uidMaster != 0)
520 {
521 CC.Say("summon_ally_fail", CC);
522 return;
523 }
524 string id4 = actRef.n1;
525 int num3 = 1;
526 int num4 = -1;
527 int radius = 3;
528 bool flag3 = false;
529 int num5 = -1;
530 switch (actRef.n1)
531 {
532 case "shadow":
533 case "tsunami":
534 num3 = Mathf.Clamp(power / 100, 1, 5) + ((power >= 100) ? EClass.rnd(2) : 0);
535 break;
536 case "monster":
537 case "fire":
538 case "animal":
539 num3 = 1 + EClass.rnd(2);
540 break;
541 case "special_force":
542 id4 = "army_palmia";
543 num3 = 4 + EClass.rnd(2);
544 num5 = EClass._zone.DangerLv;
545 break;
546 case "tentacle":
547 num4 = 20 + EClass.rnd(10);
548 radius = 1;
549 break;
550 }
551 num3 += CC.Evalue(1240);
552 for (int j = 0; j < num3; j++)
553 {
554 if (EClass._zone.CountMinions(CC) >= CC.MaxSummon)
555 {
556 break;
557 }
558 Point point = tp.GetRandomPoint(radius)?.GetNearestPoint(allowBlock: false, allowChara: false);
559 if (point == null || !point.IsValid)
560 {
561 continue;
562 }
563 Chara chara = null;
564 if (num5 != -1)
565 {
567 {
568 lv = num5
569 });
570 }
571 chara = actRef.n1 switch
572 {
573 "yeek" => CharaGen.CreateFromFilter(SpawnListChara.Get("summon_yeek", (SourceChara.Row r) => r.race == "yeek"), power / 10),
574 "orc" => CharaGen.CreateFromFilter(SpawnListChara.Get("summon_orc", (SourceChara.Row r) => r.race == "orc"), power / 10),
575 "pawn" => CharaGen.CreateFromFilter("c_pawn", power / 10),
576 "monster" => CharaGen.CreateFromFilter("c_dungeon", power / 10),
577 "animal" => CharaGen.CreateFromFilter("c_animal", power / 15),
578 "fire" => CharaGen.CreateFromElement("Fire", power / 10),
579 "fish" => CharaGen.CreateFromFilter(SpawnListChara.Get("summon_fish", (SourceChara.Row r) => r.ContainsTag("water") || r.model.Chara.race.tag.Contains("water")), power / 10),
580 "octopus" => CharaGen.CreateFromFilter(SpawnListChara.Get("summon_octopus", (SourceChara.Row r) => r.race == "octopus"), power / 10),
581 _ => CharaGen.Create(id4, power / 10),
582 };
583 if (chara == null)
584 {
585 continue;
586 }
587 int num6 = -1;
588 num6 = ((!(actRef.n1 == "shadow")) ? (chara.LV * (100 + power / 10) / 100 + power / 30) : (power / 10 + 1));
589 if (chara.LV < num6)
590 {
591 chara.SetLv(num6);
592 }
593 chara.interest = 0;
594 if (chara.HaveFur())
595 {
596 chara.c_fur = -1;
597 }
598 string n = actRef.n1;
599 if (!(n == "shadow"))
600 {
601 if (n == "special_force")
602 {
603 chara.homeZone = EClass._zone;
604 }
605 }
606 else
607 {
608 chara.hp = chara.MaxHP / 2;
609 }
610 EClass._zone.AddCard(chara, point);
611 if (flag)
612 {
613 Chara chara2 = chara;
614 Hostility hostility2 = (chara.c_originalHostility = Hostility.Enemy);
615 chara2.hostility = hostility2;
616 }
617 else if (!(actRef.n1 == "monster") || actRef.refThing == null)
618 {
619 chara.MakeMinion(CC);
620 }
621 if (num4 != -1)
622 {
623 chara.SetSummon(num4);
624 }
625 flag3 = true;
626 }
627 if (!flag3)
628 {
629 CC.Say("summon_ally_fail", CC);
630 }
631 return;
632 }
633 case EffectId.Funnel:
634 {
635 if (EClass._zone.CountMinions(CC) >= CC.MaxSummon || CC.c_uidMaster != 0)
636 {
637 CC.Say("summon_ally_fail", CC);
638 return;
639 }
640 CC.Say("spell_funnel", CC, element.Name.ToLower());
641 CC.PlaySound("spell_funnel");
642 Chara chara3 = CharaGen.Create("bit");
643 chara3.SetMainElement(element.source.alias, element.Value, elemental: true);
644 chara3.SetSummon(20 + power / 20 + EClass.rnd(10));
645 chara3.SetLv(power / 15);
646 chara3.interest = 0;
647 EClass._zone.AddCard(chara3, tp.GetNearestPoint(allowBlock: false, allowChara: false));
648 chara3.PlayEffect("teleport");
649 chara3.MakeMinion(CC);
650 return;
651 }
652 case EffectId.Breathe:
653 {
654 List<Point> list3 = EClass._map.ListPointsInArc(CC.pos, tp, 7, 35f);
655 if (list3.Count == 0)
656 {
657 list3.Add(CC.pos.Copy());
658 }
659 CC.Say("spell_breathe", CC, element.Name.ToLower());
660 EClass.Wait(0.8f, CC);
661 TryDelay(delegate
662 {
663 CC.PlaySound("spell_breathe");
664 });
666 {
667 Shaker.ShakeCam("breathe");
668 }
669 DamageEle(CC, id, power, element, list3, actRef, "spell_breathe");
670 return;
671 }
672 case EffectId.Scream:
673 CC.PlaySound("scream");
674 CC.PlayEffect("scream");
675 {
676 foreach (Point item in EClass._map.ListPointsInCircle(cc.pos, 6f, mustBeWalkable: false, los: false))
677 {
678 foreach (Chara chara4 in item.Charas)
679 {
680 if (chara4.ResistLv(957) <= 0)
681 {
682 chara4.AddCondition<ConParalyze>(power);
683 }
684 }
685 }
686 return;
687 }
688 case EffectId.Ball:
689 case EffectId.Explosive:
690 case EffectId.BallBubble:
691 case EffectId.Suicide:
692 {
693 float radius2 = ((id == EffectId.Suicide) ? 3.5f : ((float)((id == EffectId.BallBubble) ? 2 : 5)));
694 if (id == EffectId.Explosive && actRef.refThing != null)
695 {
696 radius2 = 2 + actRef.refThing.Evalue(666);
697 }
698 if (id == EffectId.Suicide)
699 {
700 if (CC.MainElement != Element.Void)
701 {
702 element = CC.MainElement;
703 }
705 {
706 element = Element.Create(919, 10);
707 }
708 if (CC.HasTag(CTAG.kamikaze))
709 {
710 radius2 = 1.5f;
711 }
712 }
713 bool flag4 = id == EffectId.Explosive || id == EffectId.Suicide;
714 List<Point> list6 = EClass._map.ListPointsInCircle(cc.pos, radius2, !flag4, !flag4);
715 if (list6.Count == 0)
716 {
717 list6.Add(cc.pos.Copy());
718 }
719 cc.Say((id == EffectId.Suicide) ? "abSuicide" : "spell_ball", cc, element.Name.ToLower());
720 EClass.Wait(0.8f, cc);
721 TryDelay(delegate
722 {
723 cc.PlaySound("spell_ball");
724 });
726 {
727 Shaker.ShakeCam("ball");
728 }
729 DamageEle(actRef.origin ?? cc, id, power, element, list6, actRef, (id == EffectId.Suicide) ? "suicide" : "spell_ball");
730 if (id == EffectId.Suicide && CC.IsAliveInCurrentZone)
731 {
732 CC.Die();
733 }
734 return;
735 }
736 case EffectId.Bolt:
737 {
738 List<Point> list2 = EClass._map.ListPointsInLine(CC.pos, tp, 10);
739 if (list2.Count == 0)
740 {
741 list2.Add(CC.pos.Copy());
742 }
743 CC.Say("spell_bolt", CC, element.Name.ToLower());
744 EClass.Wait(0.8f, CC);
745 TryDelay(delegate
746 {
747 CC.PlaySound("spell_bolt");
748 });
750 {
751 Shaker.ShakeCam("bolt");
752 }
753 DamageEle(CC, id, power, element, list2, actRef, "spell_bolt");
754 return;
755 }
756 case EffectId.Bubble:
757 case EffectId.Web:
758 case EffectId.MistOfDarkness:
759 case EffectId.Puddle:
760 {
761 if (LangGame.Has("ab" + id))
762 {
763 CC.Say("ab" + id, CC);
764 }
765 tp.PlaySound("vomit");
766 int num = 2 + EClass.rnd(3);
767 int id2 = id switch
768 {
769 EffectId.MistOfDarkness => 6,
770 EffectId.Bubble => 5,
771 EffectId.Puddle => 4,
772 _ => 7,
773 };
774 EffectId idEffect = ((id == EffectId.Bubble) ? EffectId.BallBubble : EffectId.PuddleEffect);
775 Color matColor = EClass.Colors.elementColors.TryGetValue(element.source.alias);
776 if (id == EffectId.Bubble && CC.id == "cancer")
777 {
778 idEffect = EffectId.Nothing;
779 num = 1 + EClass.rnd(3);
780 }
781 for (int i = 0; i < num; i++)
782 {
783 Point randomPoint = tp.GetRandomPoint(2);
784 if (randomPoint != null && !randomPoint.HasBlock && (id != EffectId.Puddle || !randomPoint.cell.IsTopWaterAndNoSnow))
785 {
786 int num2 = 4 + EClass.rnd(5);
787 if (id == EffectId.Web)
788 {
789 num2 *= 3;
790 }
791 EClass._map.SetEffect(randomPoint.x, randomPoint.z, new CellEffect
792 {
793 id = id2,
794 amount = num2,
795 idEffect = idEffect,
796 idEle = element.id,
797 power = power,
798 isHostileAct = CC.IsPCParty,
799 color = BaseTileMap.GetColorInt(ref matColor, 100)
800 });
801 }
802 }
803 return;
804 }
805 }
806 List<Card> list8 = tp.ListCards().ToList();
807 list8.Reverse();
808 if (list8.Contains(CC))
809 {
810 list8.Remove(CC);
811 list8.Insert(0, CC);
812 }
813 bool flag5 = true;
814 foreach (Card item2 in list8)
815 {
816 if (tc == null || item2 == tc)
817 {
818 Proc(id, power, state, CC, item2, actRef);
819 if (flag2 && item2.isChara && item2 != CC)
820 {
821 CC.DoHostileAction(item2);
822 }
823 if (actRef.refThing == null || !(actRef.refThing.trait is TraitRod) || (uint)(id - 200) <= 4u)
824 {
825 return;
826 }
827 flag5 = false;
828 }
829 }
830 if (flag5)
831 {
833 }
834 }
Hostility
Definition: Hostility.cs:2
static int angle
Definition: ActEffect.cs:21
static bool DamageEle(Card CC, EffectId id, int power, Element e, List< Point > points, ActRef actref, string lang=null)
Definition: ActEffect.cs:36
static int GetColorInt(ref Color matColor, int p)
static void Set(CardBlueprint _bp)
int c_uidMaster
Definition: Card.cs:1409
Card SetLv(int a)
Definition: Card.cs:2821
bool IsInMutterDistance(int d=10)
Definition: Card.cs:7301
bool HaveFur()
Definition: Card.cs:7462
int ResistLv(int res)
Definition: Card.cs:5583
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:713
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None)
Definition: Chara.cs:4903
void SetMainElement(string id, int v=0, bool elemental=false)
Definition: Chara.cs:1872
int MaxSummon
Definition: Chara.cs:710
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2127
void SetSummon(int duration)
Definition: Chara.cs:2155
UD_String_Color elementColors
GraphicSetting graphic
Definition: CoreConfig.cs:600
bool enable
Definition: CoreDebug.cs:285
static ColorProfile Colors
Definition: EClass.cs:38
static CoreDebug debug
Definition: EClass.cs:48
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:236
static bool Has(string id)
Definition: LangGame.cs:46
List< Point > ListPointsInArc(Point center, Point to, int radius, float angle)
Definition: Map.cs:2295
List< Point > ListPointsInLine(Point center, Point to, int radius)
Definition: Map.cs:2312
void SetEffect(int x, int z, CellEffect effect=null)
Definition: Map.cs:1503
List< Point > ListPointsInCircle(Point center, float radius, bool mustBeWalkable=true, bool los=true)
Definition: Map.cs:2264
int z
Definition: Point.cs:39
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1233
Definition: Shaker.cs:5
static void ShakeCam(string id="default", float magnitude=1f)
Definition: Shaker.cs:25
static SpawnList Get(string id, Func< SourceChara.Row, bool > func)
bool TryGetValue(TKey key, out TValue value)
Definition: UDictionary.cs:178
int CountMinions(Chara c)
Definition: Zone.cs:3534
override int DangerLv
Definition: Zone.cs:107
Chara origin
Definition: ActRef.cs:11

References EClass._map, EClass._zone, Zone.AddCard(), Chara.AddCondition(), angle, Card.c_uidMaster, Point.cell, Card.Chara, Color, EClass.Colors, Core.config, Point.Copy(), EClass.core, Zone.CountMinions(), Element.Create(), EffectMeteor.Create(), CharaGen.Create(), CharaGen.CreateFromElement(), CharaGen.CreateFromFilter(), DamageEle(), Zone.DangerLv, EClass.debug, Debug, Chara.Die(), CoreConfig.GraphicSetting.disableShake, ColorProfile.elementColors, CoreDebug.enable, Card.Evalue(), SpawnListChara.Get(), BaseTileMap.GetColorInt(), Point.GetNearestPoint(), Point.GetRandomPoint(), CoreConfig.graphic, LangGame.Has(), Point.HasBlock, Chara.HasCondition(), Card.HasTag(), Card.HaveFur(), Card.id, Element.id, Chara.IsAliveInCurrentZone, Card.IsInMutterDistance(), 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, Card.PlayEffect(), Point.PlaySound(), Card.PlaySound(), Card.pos, Card.ResistLv(), EClass.rnd(), Card.Say(), CardBlueprint.Set(), Map.SetEffect(), Card.SetLv(), Chara.SetMainElement(), Chara.SetSummon(), Shaker.ShakeCam(), Element.source, TryDelay(), UDictionary< TKey, TValue >.TryGetValue(), Element.Value, Element.Void, EClass.Wait(), Point.x, and Point.z.

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

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

2333 {
2335 string netMsg = GameLang.Parse("wish".langGame(), thirdPerson: true, name, s);
2336 bool net = EClass.core.config.net.enable && EClass.core.config.net.sendEvent;
2337 List<WishItem> list = new List<WishItem>();
2338 int wishLv = 10 + power / 4;
2339 int wishValue = 5000 + power * 50;
2340 if (state >= BlessedState.Blessed)
2341 {
2342 wishLv = wishLv * 150 / 100;
2343 }
2344 else if (state <= BlessedState.Cursed)
2345 {
2346 wishLv = wishLv * 150 / 100;
2347 wishValue = 1;
2348 }
2349 Debug.Log(power + "/" + wishValue);
2350 string _s = s.ToLower();
2351 foreach (CardRow r in EClass.sources.cards.rows)
2352 {
2353 if (r.HasTag(CTAG.godArtifact))
2354 {
2355 bool flag = false;
2356 foreach (Religion item in EClass.game.religions.list)
2357 {
2358 if (item.IsValidArtifact(r.id))
2359 {
2360 flag = true;
2361 }
2362 }
2363 if (!flag)
2364 {
2365 continue;
2366 }
2367 }
2368 else if (r.quality >= 4 || r.HasTag(CTAG.noWish))
2369 {
2370 switch (r.id)
2371 {
2372 case "medal":
2373 case "plat":
2374 case "money":
2375 case "money2":
2376 break;
2377 default:
2378 continue;
2379 }
2380 }
2381 if (r.isChara)
2382 {
2383 continue;
2384 }
2385 string text = r.GetName().ToLower();
2386 int score = Compare(_s, text);
2387 if (score == 0)
2388 {
2389 continue;
2390 }
2391 list.Add(new WishItem
2392 {
2393 score = score,
2394 n = text,
2395 action = delegate
2396 {
2397 Debug.Log(r.id);
2398 SourceCategory.Row category = EClass.sources.cards.map[r.id].Category;
2399 if (category.IsChildOf("weapon") || category.IsChildOf("armor") || category.IsChildOf("ranged"))
2400 {
2401 CardBlueprint.SetRarity(Rarity.Legendary);
2402 }
2403 Thing thing = ThingGen.Create(r.id, -1, wishLv);
2404 int num = 1;
2405 int price = thing.GetPrice(CurrencyType.Money, sell: false, PriceType.Tourism);
2406 bool flag2 = thing.trait is TraitDeed || thing.rarity >= Rarity.Artifact || thing.source._origin == "artifact_summon";
2407 switch (thing.id)
2408 {
2409 case "rod_wish":
2410 thing.c_charges = 0;
2411 break;
2412 case "money":
2413 num = EClass.rndHalf(wishValue * 3);
2414 break;
2415 case "plat":
2416 num = EClass.rndHalf(wishValue / 500 + 4);
2417 break;
2418 case "money2":
2419 num = EClass.rndHalf(wishValue / 500 + 4);
2420 break;
2421 case "medal":
2422 num = EClass.rndHalf(wishValue / 2000 + 4);
2423 break;
2424 default:
2425 if (!flag2 && thing.trait.CanStack)
2426 {
2427 int num2 = wishValue;
2428 num2 -= price;
2429 for (int i = 1; i < 1000; i++)
2430 {
2431 int num3 = price + i * 2 * (price + 500);
2432 if (num3 > 0 && num2 > num3)
2433 {
2434 num++;
2435 num2 -= num3;
2436 }
2437 }
2438 }
2439 break;
2440 }
2441 if (price > 2500 && num > 3)
2442 {
2443 num = 3 + (int)Mathf.Sqrt(num - 3);
2444 }
2445 if (price > 5000 && num > 2)
2446 {
2447 num = 2 + (int)Mathf.Sqrt(num - 2) / 2;
2448 }
2449 if (price > 10000 && num > 1)
2450 {
2451 num = 1 + Mathf.Min((int)Mathf.Sqrt(num - 1) / 3, 2);
2452 }
2453 if (num < 1)
2454 {
2455 num = 1;
2456 }
2457 thing.SetNum(num);
2458 Debug.Log(_s + "/" + num + "/" + score);
2459 if (thing.HasTag(CTAG.godArtifact))
2460 {
2461 Religion.Reforge(thing.id);
2462 }
2463 else
2464 {
2465 EClass._zone.AddCard(thing, EClass.pc.pos);
2466 }
2467 netMsg = netMsg + Lang.space + GameLang.Parse("wishNet".langGame(), Msg.IsThirdPerson(thing), Msg.GetName(thing).ToTitleCase());
2468 if (net)
2469 {
2470 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
2471 }
2472 Msg.Say("dropReward");
2473 }
2474 });
2475 }
2476 if (list.Count == 0)
2477 {
2478 netMsg = netMsg + Lang.space + "wishFail".langGame();
2479 if (net)
2480 {
2481 Net.SendChat(name, netMsg, ChatCategory.Wish, Lang.langCode);
2482 }
2483 Msg.Say("wishFail");
2484 return false;
2485 }
2486 list.Sort((WishItem a, WishItem b) => b.score - a.score);
2487 foreach (WishItem item2 in list)
2488 {
2489 Debug.Log(item2.score + "/" + s + "/" + item2.n);
2490 }
2491 list[0].action();
2492 return true;
2493 }
ChatCategory
Definition: ChatCategory.cs:2
CurrencyType
Definition: CurrencyType.cs:2
PriceType
Definition: PriceType.cs:2
Rarity
Definition: Rarity.cs:2
static int Compare(string s, string t)
Definition: ActEffect.cs:2495
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:6897
NetSetting net
Definition: CoreConfig.cs:604
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
Definition: GameLang.cs:125
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:279
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(), 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: