Elin Decompiled Documentation EA 23.130 Nightly
Loading...
Searching...
No Matches
DamageTextRenderer Class Reference
Inheritance diagram for DamageTextRenderer:
EClass

Public Member Functions

void Add (Card target, Card attacker, int dmg, Element e=null)
 
void Flush ()
 

Public Attributes

Card lastTarget
 
Card lastAttacker
 
Element lastElement = Element.Void
 
int sum
 
int num
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 
- Static Public Attributes inherited from EClass
static Core core
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 3 of file DamageTextRenderer.cs.

Member Function Documentation

◆ Add()

void DamageTextRenderer.Add ( Card  target,
Card  attacker,
int  dmg,
Element  e = null 
)
inline

Definition at line 15 of file DamageTextRenderer.cs.

16 {
17 if (e == null)
18 {
19 e = Element.Void;
20 }
21 if (lastTarget != target || lastAttacker != attacker || lastElement.id != e.id)
22 {
23 Flush();
24 lastTarget = target;
25 lastAttacker = attacker;
26 lastElement = e;
27 }
28 sum += dmg;
29 num++;
31 {
32 Flush();
33 }
34 }
CoreConfig config
Definition: Core.cs:70
Definition: EClass.cs:5
static Core core
Definition: EClass.cs:6
int id
Definition: ELEMENT.cs:246
static Element Void
Definition: ELEMENT.cs:234

References Core.config, EClass.core, Flush(), Element.id, lastAttacker, lastElement, lastTarget, num, CoreConfig.Test.stackNumbers, sum, CoreConfig.test, and Element.Void.

Referenced by Card.DamageHP().

◆ Flush()

void DamageTextRenderer.Flush ( )
inline

Definition at line 36 of file DamageTextRenderer.cs.

37 {
38 if (this.num != 0)
39 {
41 Card card2 = lastAttacker;
42 Element element = lastElement;
43 Popper popper = EClass.scene.popper.Pop(card.renderer.PositionCenter(), "DamageNum");
45 if (card2 != null)
46 {
47 c = (card2.IsPC ? EClass.Colors.textColors.damagePC : (card2.IsPCFaction ? EClass.Colors.textColors.damagePCParty : EClass.Colors.textColors.damage));
48 }
49 if (element != Element.Void)
50 {
51 c = EClass.Colors.elementColors.TryGetValue(element.source.alias);
52 float num = (c.r + c.g + c.b) / 3f;
53 num = ((num > 0.5f) ? 0f : (0.6f - num));
54 c = new Color(c.r + num, c.g + num, c.b + num, 1f);
55 }
56 popper.SetText((this.num == 1) ? (sum.ToString() ?? "") : (sum + "<size=18> (x" + this.num + ")</size>"), c);
57 sum = (this.num = 0);
58 }
59 }
Definition: Card.cs:11
UD_String_Color elementColors
TextColors textColors
static Scene scene
Definition: EClass.cs:30
static ColorProfile Colors
Definition: EClass.cs:38
SourceElement.Row source
Definition: ELEMENT.cs:269
Popper Pop(Vector3 pos, string id, Sprite sprite)
Definition: Popper.cs:6
Popper SetText(string s, Color c=default(Color))
Definition: Popper.cs:28
PopperManager popper
Definition: Scene.cs:95
bool TryGetValue(TKey key, out TValue value)
Definition: UDictionary.cs:178

References card, Color, EClass.Colors, ColorProfile.TextColors.damage, ColorProfile.elementColors, lastAttacker, lastElement, lastTarget, num, PopperManager.Pop(), Scene.popper, EClass.scene, Popper.SetText(), Element.source, sum, ColorProfile.textColors, UDictionary< TKey, TValue >.TryGetValue(), and Element.Void.

Referenced by Add(), and Scene.OnUpdate().

Member Data Documentation

◆ lastAttacker

Card DamageTextRenderer.lastAttacker

Definition at line 7 of file DamageTextRenderer.cs.

Referenced by Add(), and Flush().

◆ lastElement

Element DamageTextRenderer.lastElement = Element.Void

Definition at line 9 of file DamageTextRenderer.cs.

Referenced by Add(), and Flush().

◆ lastTarget

Card DamageTextRenderer.lastTarget

Definition at line 5 of file DamageTextRenderer.cs.

Referenced by Add(), and Flush().

◆ num

int DamageTextRenderer.num

Definition at line 13 of file DamageTextRenderer.cs.

Referenced by Add(), and Flush().

◆ sum

int DamageTextRenderer.sum

Definition at line 11 of file DamageTextRenderer.cs.

Referenced by Add(), and Flush().


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