Elin Decompiled Documentation EA 23.250 Nightly Patch 1
Loading...
Searching...
No Matches
ConDisease.cs
Go to the documentation of this file.
1using System.Linq;
2using Newtonsoft.Json;
3
4public class ConDisease : BadCondition
5{
6 [JsonProperty]
8
9 public override bool PreventRegen
10 {
11 get
12 {
13 if (GetPhase() <= 0)
14 {
15 return EClass.rnd(2) == 0;
16 }
17 return true;
18 }
19 }
20
22 {
23 return ec;
24 }
25
26 public override void SetOwner(Chara _owner, bool onDeserialize = false)
27 {
28 base.SetOwner(_owner);
30 }
31
32 public override void Tick()
33 {
34 if (EClass.rnd(20) == 0)
35 {
36 Mod((EClass.rnd(2) == 0) ? 1 : (-1));
37 }
38 if (EClass.rnd(EClass.debug.enable ? 1 : 200) == 0)
39 {
40 SourceElement.Row row = EClass.sources.elements.rows.Where((SourceElement.Row e) => e.tag.Contains("primary")).RandomItem();
41 ec.ModBase(row.id, -1);
42 }
43 }
44
45 public override void OnRemoved()
46 {
47 ec.SetParent();
48 }
49}
void Mod(int a, bool force=false)
override int GetPhase()
Definition: Chara.cs:10
override ElementContainer GetElementContainer()
Definition: ConDisease.cs:21
override void SetOwner(Chara _owner, bool onDeserialize=false)
Definition: ConDisease.cs:26
override bool PreventRegen
Definition: ConDisease.cs:10
override void Tick()
Definition: ConDisease.cs:32
override void OnRemoved()
Definition: ConDisease.cs:45
ElementContainer ec
Definition: ConDisease.cs:7
bool enable
Definition: CoreDebug.cs:286
Definition: EClass.cs:6
static int rnd(long a)
Definition: EClass.cs:59
static SourceManager sources
Definition: EClass.cs:43
static CoreDebug debug
Definition: EClass.cs:49
void SetParent(Card c)
Element ModBase(int ele, int v)
SourceElement elements