Elin Decompiled Documentation EA 23.153 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 88 of file ELEMENT.cs.

Member Function Documentation

◆ AddFix()

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

Definition at line 130 of file ELEMENT.cs.

131 {
132 if (v != 0)
133 {
134 CheckFirst();
135 n.AddText("_bullet".lang() + text + " " + ((v > 0) ? "+" : "") + v + "%", (v > 0) ? FontColor.Good : FontColor.Bad);
136 }
137 }
FontColor
Definition: FontColor.cs:2
void CheckFirst()
Definition: ELEMENT.cs:100
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 115 of file ELEMENT.cs.

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

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

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

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

Referenced by Element.BonusInfo.WriteNote().

◆ CheckFirst()

void Element.BonusInfo.CheckFirst ( )
inline

Definition at line 100 of file ELEMENT.cs.

101 {
102 if (first)
103 {
104 first = false;
105 n.Space(8);
106 }
107 }
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 139 of file ELEMENT.cs.

140 {
141 int id = ele.id;
142 int num = 0;
143 foreach (BodySlot slot in c.body.slots)
144 {
145 if (slot.elementId != 44 && slot.thing != null && ((id != 67 && id != 66) || slot.elementId != 35))
146 {
147 Element orCreateElement = slot.thing.elements.GetOrCreateElement(id);
148 if (orCreateElement != null && !orCreateElement.IsGlobalElement)
149 {
150 num += orCreateElement.Value;
151 }
152 }
153 }
154 AddText(num, "equipment".lang());
155 if (c.IsPCFaction)
156 {
158 if (element != null)
159 {
160 AddText(element.Value, "sub_faction".lang());
161 }
162 }
163 foreach (Condition condition in c.conditions)
164 {
165 if (condition.elements != null)
166 {
167 AddText(condition.elements.Value(id), condition.Name);
168 }
169 }
170 if (c.tempElements != null)
171 {
172 AddText(c.tempElements.Value(id), "tempStrengthen".lang(), "tempWeaken".lang());
173 }
174 try
175 {
176 if (c.faithElements != null)
177 {
178 Element element2 = c.elements.GetElement("featGod_" + c.faith.id + "1");
179 if (element2 != null)
180 {
181 AddText(c.faithElements.Value(id), element2.Name);
182 }
183 }
184 }
185 catch
186 {
187 }
188 _ = ele.Value;
189 _ = ele.ValueWithoutLink + total;
190 foreach (Element value in c.elements.dict.Values)
191 {
192 if (value.HasTag("multiplier") && value.source.aliasRef == ele.source.alias)
193 {
194 AddFix(value.Value, value.Name);
195 }
196 }
197 if (id == 79)
198 {
199 c.RefreshSpeed(this);
200 }
201 if (id == 78 && c.IsPCFactionOrMinion)
202 {
203 int num2 = EClass.player.CountKeyItem("lucky_coin");
204 if (num2 > 0)
205 {
206 AddText(EClass.sources.keyItems.alias["lucky_coin"].GetName() + " (+" + num2 * 2 + ")", FontColor.Great);
207 }
209 {
210 AddFix(100, EClass.sources.elements.map[663].GetName());
211 }
212 }
213 if (!c.race.IsMachine && !(c.id == "android"))
214 {
215 return;
216 }
217 int num3 = c.Evalue(664);
218 if (num3 > 0)
219 {
220 switch (id)
221 {
222 case 64:
223 case 65:
224 AddFix(num3 / 2, EClass.sources.elements.map[664].GetName());
225 break;
226 case 79:
227 AddFix(num3, EClass.sources.elements.map[664].GetName());
228 break;
229 }
230 }
231 }
virtual string Name
ElementContainer elements
int elementId
Definition: BodySlot.cs:6
Thing thing
Definition: BodySlot.cs:8
bool IsPCFactionOrMinion
Definition: Card.cs:2208
ElementContainerCard elements
Definition: Card.cs:37
string id
Definition: Card.cs:31
int Evalue(int ele)
Definition: Card.cs:2507
List< BodySlot > slots
Definition: CharaBody.cs:8
CharaBody body
Definition: Chara.cs:94
Faction faction
Definition: Chara.cs:423
ElementContainer tempElements
Definition: Chara.cs:36
List< Condition > conditions
Definition: Chara.cs:207
override bool IsPCFaction
Definition: Chara.cs:667
ElementContainer faithElements
Definition: Chara.cs:38
void RefreshSpeed(Element.BonusInfo info=null)
Definition: Chara.cs:1668
Religion faith
Definition: Chara.cs:435
SourceRace.Row race
Definition: Chara.cs:460
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:109
void AddFix(int v, string text)
Definition: ELEMENT.cs:130
Element ele
Definition: ELEMENT.cs:90
int id
Definition: ELEMENT.cs:248
SourceElement.Row source
Definition: ELEMENT.cs:271
bool HasTag(string tag)
Definition: ELEMENT.cs:471
int Value
Definition: ELEMENT.cs:290
virtual string Name
Definition: ELEMENT.cs:302
bool IsGlobalElement
Definition: ELEMENT.cs:343
ElementContainerFaction charaElements
Definition: FACTION.cs:146
int CountKeyItem(string alias)
Definition: Player.cs:1967
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.IsPCFaction, Card.IsPCFactionOrMinion, SourceManager.keyItems, BaseCondition.Name, Element.Name, EClass.pc, EClass.player, Chara.race, 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 94 of file ELEMENT.cs.

Referenced by Element.BonusInfo.WriteNote().

◆ ele

Element Element.BonusInfo.ele

Definition at line 90 of file ELEMENT.cs.

Referenced by Element.BonusInfo.WriteNote().

◆ first

bool Element.BonusInfo.first = true

Definition at line 96 of file ELEMENT.cs.

Referenced by Element.BonusInfo.CheckFirst().

◆ n

UINote Element.BonusInfo.n

◆ total

int Element.BonusInfo.total

Definition at line 98 of file ELEMENT.cs.

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


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