Elin Decompiled Documentation EA 23.248 Nightly
Loading...
Searching...
No Matches
ConStrife.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using Newtonsoft.Json;
3using UnityEngine;
4
5public class ConStrife : BaseBuff
6{
7 [JsonProperty]
8 public int exp;
9
10 [JsonProperty]
11 public int lv;
12
13 [JsonProperty]
14 public int turn;
15
16 public override string TextDuration => "Lv." + lv;
17
18 public int ExpToNext => (lv + 1) * (lv + 1);
19
20 public override bool ShouldOverride(Condition c)
21 {
22 return false;
23 }
24
25 public override bool CanStack(Condition c)
26 {
27 return true;
28 }
29
30 public void AddKill(Chara c)
31 {
33 {
34 if (c.IsMinion)
35 {
36 exp += 2;
37 }
38 else
39 {
40 exp += 30;
41 }
42 }
43 else
44 {
45 exp++;
46 }
47 while (exp >= ExpToNext)
48 {
49 exp -= ExpToNext;
50 lv++;
51 }
52 SetTurn();
53 }
54
55 public Dice GetDice()
56 {
57 return new Dice(1, 1 + Mathf.Min(lv, 10) * 2);
58 }
59
60 public void SetTurn()
61 {
62 turn = Mathf.Max(100 - lv * 10, 10);
63 }
64
65 public override void Tick()
66 {
67 turn--;
68 if (turn < 0)
69 {
70 lv--;
71 if (lv >= 1)
72 {
73 SetTurn();
74 exp = ExpToNext / 2;
75 }
76 else
77 {
78 Kill();
79 }
80 }
81 }
82
83 public override void OnWriteNote(List<string> list)
84 {
85 list.Add("hintStrife".lang(lv.ToString() ?? "", exp + "/" + ExpToNext, GetDice().ToString()));
86 }
87}
override string ToString()
bool IsPCFactionOrMinion
Definition: Card.cs:2272
Definition: Chara.cs:10
override bool IsMinion
Definition: Chara.cs:627
Dice GetDice()
Definition: ConStrife.cs:55
int turn
Definition: ConStrife.cs:14
override bool CanStack(Condition c)
Definition: ConStrife.cs:25
override void Tick()
Definition: ConStrife.cs:65
void AddKill(Chara c)
Definition: ConStrife.cs:30
void SetTurn()
Definition: ConStrife.cs:60
int exp
Definition: ConStrife.cs:8
override bool ShouldOverride(Condition c)
Definition: ConStrife.cs:20
override void OnWriteNote(List< string > list)
Definition: ConStrife.cs:83
int lv
Definition: ConStrife.cs:11
int ExpToNext
Definition: ConStrife.cs:18
override string TextDuration
Definition: ConStrife.cs:16
void Kill(bool silent=false)
Definition: Condition.cs:91
Definition: Dice.cs:5