Elin Decompiled Documentation EA 23.102 Nightly
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
21 public override void SetOwner(Chara _owner, bool onDeserialize = false)
22 {
23 base.SetOwner(_owner);
25 }
26
27 public override void Tick()
28 {
29 if (EClass.rnd(20) == 0)
30 {
31 Mod((EClass.rnd(2) == 0) ? 1 : (-1));
32 }
33 if (EClass.rnd(EClass.debug.enable ? 1 : 200) == 0)
34 {
35 SourceElement.Row row = EClass.sources.elements.rows.Where((SourceElement.Row e) => e.tag.Contains("primary")).RandomItem();
36 ec.ModBase(row.id, -1);
37 }
38 }
39
40 public override void OnRemoved()
41 {
42 ec.SetParent();
43 }
44}
void Mod(int a, bool force=false)
override int GetPhase()
Definition: Chara.cs:10
override void SetOwner(Chara _owner, bool onDeserialize=false)
Definition: ConDisease.cs:21
override bool PreventRegen
Definition: ConDisease.cs:10
override void Tick()
Definition: ConDisease.cs:27
override void OnRemoved()
Definition: ConDisease.cs:40
ElementContainer ec
Definition: ConDisease.cs:7
bool enable
Definition: CoreDebug.cs:285
Definition: EClass.cs:5
static int rnd(int a)
Definition: EClass.cs:50
static SourceManager sources
Definition: EClass.cs:42
static CoreDebug debug
Definition: EClass.cs:48
void SetParent(Card c)
Element ModBase(int ele, int v)
SourceElement elements