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

Member Function Documentation

◆ AddFix()

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

Definition at line 128 of file ELEMENT.cs.

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

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

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

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

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

Referenced by Element.BonusInfo.WriteNote().

◆ CheckFirst()

void Element.BonusInfo.CheckFirst ( )
inline

Definition at line 98 of file ELEMENT.cs.

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

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

Referenced by Element.BonusInfo.WriteNote().

◆ ele

Element Element.BonusInfo.ele

Definition at line 88 of file ELEMENT.cs.

Referenced by Element.BonusInfo.WriteNote().

◆ first

bool Element.BonusInfo.first = true

Definition at line 94 of file ELEMENT.cs.

Referenced by Element.BonusInfo.CheckFirst().

◆ n

UINote Element.BonusInfo.n

◆ total

int Element.BonusInfo.total

Definition at line 96 of file ELEMENT.cs.

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


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