Elin Decompiled Documentation EA 23.310 Nightly Patch 1
Loading...
Searching...
No Matches
ConMiasma.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4
5public class ConMiasma : TimeDebuff
6{
7 public override bool IsElemental => true;
8
10 {
11 base.refVal2 = tc.GetResistPenetrationLevel(base.refVal, AttackSource.Condition, cc);
12 }
13
14 public override void Tick()
15 {
16 Dice dice = Dice.Create("miasma_", base.power);
17 try
18 {
19 owner.DamageHP(dice.Roll(), base.refVal, EClass.rnd(base.power / 2) + base.power / 4, AttackSource.Condition, null, showEffect: true, null, null, base.refVal2);
20 if (owner.IsAliveInCurrentZone && base.value > 1)
21 {
22 for (int i = 0; i < 6; i++)
23 {
24 foreach (Chara chara in owner.pos.GetRandomPoint(2).Charas)
25 {
26 if ((!owner.IsPCFaction || chara.IsPCFaction) && (owner.IsPCFaction || !chara.IsPCFaction) && chara.IsFriendOrAbove(owner) && !chara.HasCondition<ConMiasma>())
27 {
28 Condition condition = chara.AddCondition(Condition.Create(base.power / 2, delegate(ConMiasma con)
29 {
30 con.givenByPcParty = base.givenByPcParty;
31 con.SetElement(base.refVal);
32 con.refVal2 = base.refVal2;
33 }));
34 if (condition != null)
35 {
36 condition.value = base.value - 1;
37 }
38 if (EClass.rnd(2) == 0)
39 {
40 break;
41 }
42 }
43 }
44 }
45 }
46 }
47 catch (Exception ex)
48 {
49 Debug.Log(ex.Message);
50 Debug.Log(owner);
51 Debug.Log(base.refVal);
52 }
53 Mod(-1);
54 }
55
56 public override void OnWriteNote(List<string> list)
57 {
58 Dice dice = Dice.Create("miasma_", base.power);
59 list.Add("hintDOT".lang(dice.ToString(), base.sourceElement.GetName().ToLower()));
60 }
61}
AttackSource
Definition: AttackSource.cs:2
void SetElement(int id)
void Mod(int a, bool force=false)
int GetResistPenetrationLevel(int idEle, AttackSource attackSource, Card origin=null)
Definition: Card.cs:4163
Point pos
Definition: Card.cs:60
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:4193
Definition: Chara.cs:10
override bool IsAliveInCurrentZone
Definition: Chara.cs:567
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9548
bool HasCondition(string alias)
Definition: Chara.cs:9709
override bool IsPCFaction
Definition: Chara.cs:689
bool IsFriendOrAbove()
Definition: Chara.cs:6808
override void Tick()
Definition: ConMiasma.cs:14
void SetResistPenetrationLevel(Chara tc, Chara cc)
Definition: ConMiasma.cs:9
override void OnWriteNote(List< string > list)
Definition: ConMiasma.cs:56
override bool IsElemental
Definition: ConMiasma.cs:7
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
Definition: Condition.cs:46
Definition: Dice.cs:5
static int Roll(int num, int sides, int bonus=0, Card card=null)
Definition: Dice.cs:48
override string ToString()
Definition: Dice.cs:115
static Dice Create(Element ele, Card c)
Definition: Dice.cs:120
Definition: EClass.cs:6
static int rnd(long a)
Definition: EClass.cs:59
List< Chara > Charas
Definition: Point.cs:340
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
Definition: Point.cs:769