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

Public Member Functions

void CheckFirst ()
 
void AddText (string text, FontColor col=FontColor.Warning)
 
void AddText (long 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
 
long total
 

Detailed Description

Definition at line 94 of file ELEMENT.cs.

Member Function Documentation

◆ AddFix()

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

Definition at line 136 of file ELEMENT.cs.

137 {
138 if (v != 0)
139 {
140 CheckFirst();
141 n.AddText("_bullet".lang() + text + " " + ((v > 0) ? "+" : "") + v + "%", (v > 0) ? FontColor.Good : FontColor.Bad);
142 }
143 }
FontColor
Definition: FontColor.cs:2
void CheckFirst()
Definition: ELEMENT.cs:106
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 ( long  v,
string  text,
string  textBad = null 
)
inline

Definition at line 121 of file ELEMENT.cs.

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

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 115 of file ELEMENT.cs.

116 {
117 CheckFirst();
118 n.AddText("_bullet".lang() + text, col);
119 }

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

Referenced by Element.BonusInfo.WriteNote().

◆ CheckFirst()

void Element.BonusInfo.CheckFirst ( )
inline

Definition at line 106 of file ELEMENT.cs.

107 {
108 if (first)
109 {
110 first = false;
111 n.Space(8);
112 }
113 }
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 145 of file ELEMENT.cs.

146 {
147 int id = ele.id;
148 int num = 0;
149 foreach (BodySlot slot in c.body.slots)
150 {
151 if (slot.elementId != 44 && slot.thing != null && ((id != 67 && id != 66) || slot.elementId != 35))
152 {
153 Element orCreateElement = slot.thing.elements.GetOrCreateElement(id);
154 if (orCreateElement != null && !orCreateElement.IsGlobalElement)
155 {
156 num += orCreateElement.Value;
157 }
158 }
159 }
160 AddText(num, "equipment".lang());
161 if (c.IsPCFaction)
162 {
164 if (element != null)
165 {
166 AddText(element.Value, "sub_faction".lang());
167 }
168 }
169 foreach (Condition condition in c.conditions)
170 {
171 if (condition.GetElementContainer() != null)
172 {
173 AddText(condition.GetElementContainer().Value(id), condition.Name);
174 }
175 }
176 if (c.tempElements != null)
177 {
178 AddText(c.tempElements.Value(id), "tempStrengthen".lang(), "tempWeaken".lang());
179 }
180 try
181 {
182 if (c.faithElements != null)
183 {
184 int num2 = c.faithElements.Value(id);
185 Element element2 = c.elements.GetElement("featGod_" + c.faith.id + "1");
186 if (element2 != null)
187 {
188 AddText(num2, element2.Name);
189 }
190 else if (num2 != 0)
191 {
192 AddText(num2, EClass.sources.elements.map[1228].GetName());
193 }
194 }
195 }
196 catch
197 {
198 }
199 _ = ele.Value;
200 _ = ele.ValueWithoutLink + total;
201 foreach (Element value in c.elements.dict.Values)
202 {
203 if (value.HasTag("multiplier") && value.source.aliasRef == ele.source.alias)
204 {
205 AddFix(value.Value, value.Name);
206 }
207 }
208 if (id == 79)
209 {
210 c.RefreshSpeed(this);
211 }
212 if (id == 78 && c.IsPCFactionOrMinion)
213 {
214 int num3 = EClass.player.CountKeyItem("lucky_coin");
215 if (num3 > 0)
216 {
217 AddText(EClass.sources.keyItems.alias["lucky_coin"].GetName() + " (+" + num3 * 2 + ")", FontColor.Great);
218 }
220 {
221 AddFix(100, EClass.sources.elements.map[663].GetName());
222 }
223 }
224 if (!c.IsMachine && !(c.id == "android"))
225 {
226 return;
227 }
228 int num4 = c.Evalue(664);
229 if (num4 > 0)
230 {
231 switch (id)
232 {
233 case 64:
234 case 65:
235 AddFix(num4 / 2, EClass.sources.elements.map[664].GetName());
236 break;
237 case 79:
238 AddFix(num4, EClass.sources.elements.map[664].GetName());
239 break;
240 }
241 }
242 }
virtual ElementContainer GetElementContainer()
virtual string Name
int elementId
Definition: BodySlot.cs:6
Thing thing
Definition: BodySlot.cs:8
bool IsPCFactionOrMinion
Definition: Card.cs:2342
ElementContainerCard elements
Definition: Card.cs:42
string id
Definition: Card.cs:36
int Evalue(int ele)
Definition: Card.cs:2704
List< BodySlot > slots
Definition: CharaBody.cs:8
CharaBody body
Definition: Chara.cs:94
Faction faction
Definition: Chara.cs:431
ElementContainer tempElements
Definition: Chara.cs:36
List< Condition > conditions
Definition: Chara.cs:215
override bool IsPCFaction
Definition: Chara.cs:689
ElementContainer faithElements
Definition: Chara.cs:38
void RefreshSpeed(Element.BonusInfo info=null)
Definition: Chara.cs:2049
Religion faith
Definition: Chara.cs:443
bool IsMachine
Definition: Chara.cs:950
Definition: EClass.cs:6
static SourceManager sources
Definition: EClass.cs:43
static Player player
Definition: EClass.cs:13
static Chara pc
Definition: EClass.cs:15
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:115
void AddFix(int v, string text)
Definition: ELEMENT.cs:136
Element ele
Definition: ELEMENT.cs:96
int id
Definition: ELEMENT.cs:259
SourceElement.Row source
Definition: ELEMENT.cs:282
bool HasTag(string tag)
Definition: ELEMENT.cs:482
int Value
Definition: ELEMENT.cs:301
virtual string Name
Definition: ELEMENT.cs:313
bool IsGlobalElement
Definition: ELEMENT.cs:354
ElementContainerFaction charaElements
Definition: FACTION.cs:146
int CountKeyItem(string alias)
Definition: Player.cs:2250
virtual string id
Definition: Religion.cs:33
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, Card.elements, SourceManager.elements, Card.Evalue(), Chara.faction, Chara.faith, Chara.faithElements, ElementContainer.GetElement(), BaseCondition.GetElementContainer(), 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 100 of file ELEMENT.cs.

Referenced by Element.BonusInfo.WriteNote().

◆ ele

Element Element.BonusInfo.ele

Definition at line 96 of file ELEMENT.cs.

Referenced by Element.BonusInfo.WriteNote().

◆ first

bool Element.BonusInfo.first = true

Definition at line 102 of file ELEMENT.cs.

Referenced by Element.BonusInfo.CheckFirst().

◆ n

UINote Element.BonusInfo.n

◆ total

long Element.BonusInfo.total

Definition at line 104 of file ELEMENT.cs.

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


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