Elin Decompiled Documentation EA 23.319 Nightly Patch 1
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 92 of file ELEMENT.cs.

Member Function Documentation

◆ AddFix()

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

Definition at line 134 of file ELEMENT.cs.

135 {
136 if (v != 0)
137 {
138 CheckFirst();
139 n.AddText("_bullet".lang() + text + " " + ((v > 0) ? "+" : "") + v + "%", (v > 0) ? FontColor.Good : FontColor.Bad);
140 }
141 }
FontColor
Definition: FontColor.cs:2
void CheckFirst()
Definition: ELEMENT.cs:104
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 119 of file ELEMENT.cs.

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

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

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

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

Referenced by Element.BonusInfo.WriteNote().

◆ CheckFirst()

void Element.BonusInfo.CheckFirst ( )
inline

Definition at line 104 of file ELEMENT.cs.

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

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

Referenced by Element.BonusInfo.WriteNote().

◆ ele

Element Element.BonusInfo.ele

Definition at line 94 of file ELEMENT.cs.

Referenced by Element.BonusInfo.WriteNote().

◆ first

bool Element.BonusInfo.first = true

Definition at line 100 of file ELEMENT.cs.

Referenced by Element.BonusInfo.CheckFirst().

◆ n

UINote Element.BonusInfo.n

◆ total

long Element.BonusInfo.total

Definition at line 102 of file ELEMENT.cs.

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


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