Elin Decompiled Documentation EA 23.102 Nightly
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Pages
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 80 of file ELEMENT.cs.

Member Function Documentation

◆ AddFix()

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

Definition at line 122 of file ELEMENT.cs.

123 {
124 if (v != 0)
125 {
126 CheckFirst();
127 n.AddText("_bullet".lang() + text + " " + ((v > 0) ? "+" : "") + v + "%", (v > 0) ? FontColor.Good : FontColor.Bad);
128 }
129 }
FontColor
Definition: FontColor.cs:2
void CheckFirst()
Definition: ELEMENT.cs:92
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 107 of file ELEMENT.cs.

108 {
109 if (v != 0)
110 {
111 string text2 = text;
112 if (!textBad.IsEmpty() && v < 0)
113 {
114 text2 = textBad;
115 }
116 CheckFirst();
117 total += v;
118 n.AddText("_bullet".lang() + text2 + " " + ((v > 0) ? "+" : "") + v, (v > 0) ? FontColor.Good : FontColor.Bad);
119 }
120 }

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

102 {
103 CheckFirst();
104 n.AddText("_bullet".lang() + text, col);
105 }

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

Referenced by Element.BonusInfo.WriteNote().

◆ CheckFirst()

void Element.BonusInfo.CheckFirst ( )
inline

Definition at line 92 of file ELEMENT.cs.

93 {
94 if (first)
95 {
96 first = false;
97 n.Space(8);
98 }
99 }
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 131 of file ELEMENT.cs.

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

Referenced by Element.BonusInfo.WriteNote().

◆ ele

Element Element.BonusInfo.ele

Definition at line 82 of file ELEMENT.cs.

Referenced by Element.BonusInfo.WriteNote().

◆ first

bool Element.BonusInfo.first = true

Definition at line 88 of file ELEMENT.cs.

Referenced by Element.BonusInfo.CheckFirst().

◆ n

UINote Element.BonusInfo.n

◆ total

int Element.BonusInfo.total

Definition at line 90 of file ELEMENT.cs.

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


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