Elin Modding Docs Doc
Loading...
Searching...
No Matches
ConBuffStats.cs
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4
5// Token: 0x020002EC RID: 748
6public class ConBuffStats : Condition
7{
8 // Token: 0x17000680 RID: 1664
9 // (get) Token: 0x06001766 RID: 5990 RVA: 0x0009863E File Offset: 0x0009683E
10 public override string Name
11 {
12 get
13 {
14 return (this.isDebuff ? "debuff" : "buff").lang();
15 }
16 }
17
18 // Token: 0x17000681 RID: 1665
19 // (get) Token: 0x06001767 RID: 5991 RVA: 0x00098659 File Offset: 0x00096859
20 public override ConditionType Type
21 {
22 get
23 {
24 if (!this.isDebuff)
25 {
26 return ConditionType.Buff;
27 }
28 return ConditionType.Debuff;
29 }
30 }
31
32 // Token: 0x17000682 RID: 1666
33 // (get) Token: 0x06001768 RID: 5992 RVA: 0x00098666 File Offset: 0x00096866
34 public bool isDebuff
35 {
36 get
37 {
38 return base.refVal2 == 221;
39 }
40 }
41
42 // Token: 0x06001769 RID: 5993 RVA: 0x00098675 File Offset: 0x00096875
43 public override int EvaluateTurn(int p)
44 {
45 if (base.refVal2 == 266)
46 {
47 return 7;
48 }
49 return base.EvaluateTurn(p) * ((base.refVal == 79) ? 50 : 100) / 100;
50 }
51
52 // Token: 0x17000683 RID: 1667
53 // (get) Token: 0x0600176A RID: 5994 RVA: 0x000986A1 File Offset: 0x000968A1
54 public override bool WillOverride
55 {
56 get
57 {
58 return true;
59 }
60 }
61
62 // Token: 0x17000684 RID: 1668
63 // (get) Token: 0x0600176B RID: 5995 RVA: 0x000986A4 File Offset: 0x000968A4
64 public override bool AllowMultipleInstance
65 {
66 get
67 {
68 return true;
69 }
70 }
71
72 // Token: 0x0600176C RID: 5996 RVA: 0x000986A7 File Offset: 0x000968A7
73 public override int GetPhase()
74 {
75 return 0;
76 }
77
78 // Token: 0x0600176D RID: 5997 RVA: 0x000986AA File Offset: 0x000968AA
79 public override Color GetColor(SkinColorProfile c)
80 {
81 if (!this.isDebuff)
82 {
83 return c.textGood;
84 }
85 return c.textBad;
86 }
87
88 // Token: 0x0600176E RID: 5998 RVA: 0x000986C1 File Offset: 0x000968C1
89 public override string GetPhaseStr()
90 {
91 return this.GetText();
92 }
93
94 // Token: 0x0600176F RID: 5999 RVA: 0x000986CC File Offset: 0x000968CC
95 public override string GetText()
96 {
97 string[] list = Lang.GetList("buff_" + EClass.sources.elements.map[base.refVal].alias);
98 if (list == null)
99 {
100 return base.GetText();
101 }
102 if (!this.isDebuff)
103 {
104 return list[0];
105 }
106 return list[1];
107 }
108
109 // Token: 0x06001770 RID: 6000 RVA: 0x00098724 File Offset: 0x00096924
110 public override void PlayEffect()
111 {
112 if (Condition.ignoreEffect)
113 {
114 return;
115 }
116 this.owner.PlaySound(this.isDebuff ? "debuff" : "buff", 1f, true);
117 this.owner.PlayEffect(this.isDebuff ? "debuff" : "buff", true, 0f, default(Vector3));
118 this.owner.Say(this.isDebuff ? "buffStats_curse" : "buffStats", this.owner, EClass.sources.elements.map[base.refVal].GetName().ToLower(), null);
119 }
120
121 // Token: 0x06001771 RID: 6001 RVA: 0x000987D8 File Offset: 0x000969D8
122 public override bool CanStack(Condition c)
123 {
124 ConBuffStats conBuffStats = c as ConBuffStats;
125 return conBuffStats == null || conBuffStats.refVal == base.refVal;
126 }
127
128 // Token: 0x06001772 RID: 6002 RVA: 0x00098800 File Offset: 0x00096A00
129 public override void SetOwner(Chara _owner, bool onDeserialize = false)
130 {
131 base.SetOwner(_owner, false);
132 this.elements = new ElementContainer();
133 this.elements.SetBase(base.refVal, this.CalcValue() * (this.isDebuff ? -1 : 1), 0);
134 this.elements.SetParent(this.owner);
135 }
136
137 // Token: 0x06001773 RID: 6003 RVA: 0x00098858 File Offset: 0x00096A58
138 public int CalcValue()
139 {
140 if (base.refVal2 == 266)
141 {
142 return 100 + (int)Mathf.Sqrt((float)base.power) * 2;
143 }
144 if (base.refVal == 79)
145 {
146 return (int)Mathf.Max(5f, Mathf.Sqrt((float)base.power) * 1.5f + 20f);
147 }
148 return (int)Mathf.Max(5f, Mathf.Sqrt((float)base.power) * 2f - 15f);
149 }
150
151 // Token: 0x06001774 RID: 6004 RVA: 0x000988D8 File Offset: 0x00096AD8
152 public override void OnWriteNote(List<string> list)
153 {
154 list.Add((this.isDebuff ? "hintDebuffStats" : "hintBuffStats").lang(base.sourceElement.GetName(), this.CalcValue().ToString() ?? "", null, null, null));
155 }
156}
Definition Chara.cs:12