Elin Decompiled Documentation EA 23.102 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 override bool WillOverride => false;
19
20 public int ExpToNext => (lv + 1) * (lv + 1);
21
22 public override bool CanStack(Condition c)
23 {
24 return true;
25 }
26
27 public void AddKill(Chara c)
28 {
30 {
31 if (c.IsMinion)
32 {
33 exp += 2;
34 }
35 else
36 {
37 exp += 30;
38 }
39 }
40 else
41 {
42 exp++;
43 }
44 while (exp >= ExpToNext)
45 {
46 exp -= ExpToNext;
47 lv++;
48 }
49 SetTurn();
50 }
51
52 public Dice GetDice()
53 {
54 return new Dice(1, 1 + Mathf.Min(lv, 10) * 2);
55 }
56
57 public void SetTurn()
58 {
59 turn = Mathf.Max(100 - lv * 10, 10);
60 }
61
62 public override void Tick()
63 {
64 turn--;
65 if (turn < 0)
66 {
67 lv--;
68 if (lv >= 1)
69 {
70 SetTurn();
71 exp = ExpToNext / 2;
72 }
73 else
74 {
75 Kill();
76 }
77 }
78 }
79
80 public override void OnWriteNote(List<string> list)
81 {
82 list.Add("hintStrife".lang(lv.ToString() ?? "", exp + "/" + ExpToNext, GetDice().ToString()));
83 }
84}
override string ToString()
bool IsPCFactionOrMinion
Definition: Card.cs:2132
Definition: Chara.cs:10
override bool IsMinion
Definition: Chara.cs:612
Dice GetDice()
Definition: ConStrife.cs:52
int turn
Definition: ConStrife.cs:14
override bool CanStack(Condition c)
Definition: ConStrife.cs:22
override void Tick()
Definition: ConStrife.cs:62
void AddKill(Chara c)
Definition: ConStrife.cs:27
void SetTurn()
Definition: ConStrife.cs:57
int exp
Definition: ConStrife.cs:8
override bool WillOverride
Definition: ConStrife.cs:18
override void OnWriteNote(List< string > list)
Definition: ConStrife.cs:80
int lv
Definition: ConStrife.cs:11
int ExpToNext
Definition: ConStrife.cs:20
override string TextDuration
Definition: ConStrife.cs:16
void Kill(bool silent=false)
Definition: Condition.cs:91
Definition: Dice.cs:4