Elin Decompiled Documentation EA 23.199 Nightly
Loading...
Searching...
No Matches
Element.BonusInfo Class Reference

Public Member Functions

void CheckFirst ()
 
void AddText (string text, FontColor col=FontColor.Warning)
 
void AddText (int v, string text, string textBad=null)
 
void AddFix (int v, string text)
 
void WriteNote ()
 

Public Attributes

Element ele
 
UINote n
 
Chara c
 
bool first = true
 
int total
 

Detailed Description

Definition at line 90 of file ELEMENT.cs.

Member Function Documentation

◆ AddFix()

void Element.BonusInfo.AddFix ( int  v,
string  text 
)
inline

Definition at line 132 of file ELEMENT.cs.

133 {
134 if (v != 0)
135 {
136 CheckFirst();
137 n.AddText("_bullet".lang() + text + " " + ((v > 0) ? "+" : "") + v + "%", (v > 0) ? FontColor.Good : FontColor.Bad);
138 }
139 }
FontColor
Definition: FontColor.cs:2
void CheckFirst()
Definition: ELEMENT.cs:102
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113

References UINote.AddText(), Element.BonusInfo.CheckFirst(), and Element.BonusInfo.n.

Referenced by Element.BonusInfo.WriteNote().

◆ AddText() [1/2]

void Element.BonusInfo.AddText ( int  v,
string  text,
string  textBad = null 
)
inline

Definition at line 117 of file ELEMENT.cs.

118 {
119 if (v != 0)
120 {
121 string text2 = text;
122 if (!textBad.IsEmpty() && v < 0)
123 {
124 text2 = textBad;
125 }
126 CheckFirst();
127 total += v;
128 n.AddText("_bullet".lang() + text2 + " " + ((v > 0) ? "+" : "") + v, (v > 0) ? FontColor.Good : FontColor.Bad);
129 }
130 }

References UINote.AddText(), Element.BonusInfo.CheckFirst(), Element.BonusInfo.n, and Element.BonusInfo.total.

◆ AddText() [2/2]

void Element.BonusInfo.AddText ( string  text,
FontColor  col = FontColor::Warning 
)
inline

Definition at line 111 of file ELEMENT.cs.

112 {
113 CheckFirst();
114 n.AddText("_bullet".lang() + text, col);
115 }

References UINote.AddText(), Element.BonusInfo.CheckFirst(), and Element.BonusInfo.n.

Referenced by Element.BonusInfo.WriteNote().

◆ CheckFirst()

void Element.BonusInfo.CheckFirst ( )
inline

Definition at line 102 of file ELEMENT.cs.

103 {
104 if (first)
105 {
106 first = false;
107 n.Space(8);
108 }
109 }
void Space(int sizeY=0, int sizeX=1)
Definition: UINote.cs:62

References Element.BonusInfo.first, Element.BonusInfo.n, and UINote.Space().

Referenced by Element.BonusInfo.AddFix(), and Element.BonusInfo.AddText().

◆ WriteNote()

void Element.BonusInfo.WriteNote ( )
inline

Definition at line 141 of file ELEMENT.cs.

142 {
143 int id = ele.id;
144 int num = 0;
145 foreach (BodySlot slot in c.body.slots)
146 {
147 if (slot.elementId != 44 && slot.thing != null && ((id != 67 && id != 66) || slot.elementId != 35))
148 {
149 Element orCreateElement = slot.thing.elements.GetOrCreateElement(id);
150 if (orCreateElement != null && !orCreateElement.IsGlobalElement)
151 {
152 num += orCreateElement.Value;
153 }
154 }
155 }
156 AddText(num, "equipment".lang());
157 if (c.IsPCFaction)
158 {
160 if (element != null)
161 {
162 AddText(element.Value, "sub_faction".lang());
163 }
164 }
165 foreach (Condition condition in c.conditions)
166 {
167 if (condition.elements != null)
168 {
169 AddText(condition.elements.Value(id), condition.Name);
170 }
171 }
172 if (c.tempElements != null)
173 {
174 AddText(c.tempElements.Value(id), "tempStrengthen".lang(), "tempWeaken".lang());
175 }
176 try
177 {
178 if (c.faithElements != null)
179 {
180 Element element2 = c.elements.GetElement("featGod_" + c.faith.id + "1");
181 if (element2 != null)
182 {
183 AddText(c.faithElements.Value(id), element2.Name);
184 }
185 }
186 }
187 catch
188 {
189 }
190 _ = ele.Value;
191 _ = ele.ValueWithoutLink + total;
192 foreach (Element value in c.elements.dict.Values)
193 {
194 if (value.HasTag("multiplier") && value.source.aliasRef == ele.source.alias)
195 {
196 AddFix(value.Value, value.Name);
197 }
198 }
199 if (id == 79)
200 {
201 c.RefreshSpeed(this);
202 }
203 if (id == 78 && c.IsPCFactionOrMinion)
204 {
205 int num2 = EClass.player.CountKeyItem("lucky_coin");
206 if (num2 > 0)
207 {
208 AddText(EClass.sources.keyItems.alias["lucky_coin"].GetName() + " (+" + num2 * 2 + ")", FontColor.Great);
209 }
211 {
212 AddFix(100, EClass.sources.elements.map[663].GetName());
213 }
214 }
215 if (!c.IsMachine && !(c.id == "android"))
216 {
217 return;
218 }
219 int num3 = c.Evalue(664);
220 if (num3 > 0)
221 {
222 switch (id)
223 {
224 case 64:
225 case 65:
226 AddFix(num3 / 2, EClass.sources.elements.map[664].GetName());
227 break;
228 case 79:
229 AddFix(num3, EClass.sources.elements.map[664].GetName());
230 break;
231 }
232 }
233 }
virtual string Name
ElementContainer elements
int elementId
Definition: BodySlot.cs:6
Thing thing
Definition: BodySlot.cs:8
bool IsPCFactionOrMinion
Definition: Card.cs:2234
ElementContainerCard elements
Definition: Card.cs:39
string id
Definition: Card.cs:33
int Evalue(int ele)
Definition: Card.cs:2533
List< BodySlot > slots
Definition: CharaBody.cs:8
CharaBody body
Definition: Chara.cs:94
Faction faction
Definition: Chara.cs:425
ElementContainer tempElements
Definition: Chara.cs:36
List< Condition > conditions
Definition: Chara.cs:209
override bool IsPCFaction
Definition: Chara.cs:669
ElementContainer faithElements
Definition: Chara.cs:38
void RefreshSpeed(Element.BonusInfo info=null)
Definition: Chara.cs:1824
Religion faith
Definition: Chara.cs:437
bool IsMachine
Definition: Chara.cs:901
Definition: EClass.cs:5
static SourceManager sources
Definition: EClass.cs:42
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
Dictionary< int, Element > dict
bool Has(int ele)
int Value(int ele)
Element GetOrCreateElement(Element ele)
Element GetElement(string alias)
void AddText(string text, FontColor col=FontColor.Warning)
Definition: ELEMENT.cs:111
void AddFix(int v, string text)
Definition: ELEMENT.cs:132
Element ele
Definition: ELEMENT.cs:92
int id
Definition: ELEMENT.cs:250
SourceElement.Row source
Definition: ELEMENT.cs:273
bool HasTag(string tag)
Definition: ELEMENT.cs:473
int Value
Definition: ELEMENT.cs:292
virtual string Name
Definition: ELEMENT.cs:304
bool IsGlobalElement
Definition: ELEMENT.cs:345
ElementContainerFaction charaElements
Definition: FACTION.cs:146
int CountKeyItem(string alias)
Definition: Player.cs:2100
virtual string id
Definition: Religion.cs:26
SourceKeyItem keyItems
SourceElement elements

References Element.BonusInfo.AddFix(), Element.BonusInfo.AddText(), Chara.body, Element.BonusInfo.c, Faction.charaElements, Chara.conditions, Player.CountKeyItem(), ElementContainer.dict, Element.BonusInfo.ele, BodySlot.elementId, BaseCondition.elements, Card.elements, SourceManager.elements, Card.Evalue(), Chara.faction, Chara.faith, Chara.faithElements, ElementContainer.GetElement(), ElementContainer.GetOrCreateElement(), ElementContainer.Has(), Element.HasTag(), Card.id, Element.id, Religion.id, Element.IsGlobalElement, Chara.IsMachine, Chara.IsPCFaction, Card.IsPCFactionOrMinion, SourceManager.keyItems, BaseCondition.Name, Element.Name, EClass.pc, EClass.player, Chara.RefreshSpeed(), CharaBody.slots, Element.source, EClass.sources, Chara.tempElements, BodySlot.thing, Element.BonusInfo.total, Element.Value, and ElementContainer.Value().

Referenced by Element._WriteNote().

Member Data Documentation

◆ c

Chara Element.BonusInfo.c

Definition at line 96 of file ELEMENT.cs.

Referenced by Element.BonusInfo.WriteNote().

◆ ele

Element Element.BonusInfo.ele

Definition at line 92 of file ELEMENT.cs.

Referenced by Element.BonusInfo.WriteNote().

◆ first

bool Element.BonusInfo.first = true

Definition at line 98 of file ELEMENT.cs.

Referenced by Element.BonusInfo.CheckFirst().

◆ n

UINote Element.BonusInfo.n

◆ total

int Element.BonusInfo.total

Definition at line 100 of file ELEMENT.cs.

Referenced by Element.BonusInfo.AddText(), and Element.BonusInfo.WriteNote().


The documentation for this class was generated from the following file: