Elin Decompiled Documentation
EA 23.130 Nightly
Loading...
Searching...
No Matches
DamageTextRenderer.cs
Go to the documentation of this file.
1
using
UnityEngine;
2
3
public
class
DamageTextRenderer
:
EClass
4
{
5
public
Card
lastTarget
;
6
7
public
Card
lastAttacker
;
8
9
public
Element
lastElement
=
Element
.
Void
;
10
11
public
int
sum
;
12
13
public
int
num
;
14
15
public
void
Add
(
Card
target,
Card
attacker,
int
dmg,
Element
e =
null
)
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
++;
30
if
(!
EClass
.
core
.
config
.
test
.
stackNumbers
)
31
{
32
Flush
();
33
}
34
}
35
36
public
void
Flush
()
37
{
38
if
(this.num != 0)
39
{
40
Card
card
=
lastTarget
;
41
Card
card2 =
lastAttacker
;
42
Element
element =
lastElement
;
43
Popper
popper =
EClass
.
scene
.
popper
.
Pop
(
card
.renderer.PositionCenter(),
"DamageNum"
);
44
Color
c =
EClass
.
Colors
.
textColors
.
damage
;
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
}
60
}
ContainerFlag2.card
@ card
FOWType.Color
@ Color
Card
Definition:
Card.cs:11
ColorProfile.TextColors.damage
Color damage
Definition:
ColorProfile.cs:88
ColorProfile.elementColors
UD_String_Color elementColors
Definition:
ColorProfile.cs:111
ColorProfile.textColors
TextColors textColors
Definition:
ColorProfile.cs:117
CoreConfig.Test.stackNumbers
bool stackNumbers
Definition:
CoreConfig.cs:529
CoreConfig.test
Test test
Definition:
CoreConfig.cs:612
Core.config
CoreConfig config
Definition:
Core.cs:70
DamageTextRenderer
Definition:
DamageTextRenderer.cs:4
DamageTextRenderer.lastAttacker
Card lastAttacker
Definition:
DamageTextRenderer.cs:7
DamageTextRenderer.Add
void Add(Card target, Card attacker, int dmg, Element e=null)
Definition:
DamageTextRenderer.cs:15
DamageTextRenderer.lastElement
Element lastElement
Definition:
DamageTextRenderer.cs:9
DamageTextRenderer.sum
int sum
Definition:
DamageTextRenderer.cs:11
DamageTextRenderer.num
int num
Definition:
DamageTextRenderer.cs:13
DamageTextRenderer.lastTarget
Card lastTarget
Definition:
DamageTextRenderer.cs:5
DamageTextRenderer.Flush
void Flush()
Definition:
DamageTextRenderer.cs:36
EClass
Definition:
EClass.cs:5
EClass.scene
static Scene scene
Definition:
EClass.cs:30
EClass.Colors
static ColorProfile Colors
Definition:
EClass.cs:38
EClass.core
static Core core
Definition:
EClass.cs:6
Element
Definition:
ELEMENT.cs:85
Element.id
int id
Definition:
ELEMENT.cs:246
Element.source
SourceElement.Row source
Definition:
ELEMENT.cs:269
Element.Void
static Element Void
Definition:
ELEMENT.cs:234
PopperManager.Pop
Popper Pop(Vector3 pos, string id, Sprite sprite)
Definition:
PopperManager.cs:10
Popper
Definition:
Popper.cs:6
Popper.SetText
Popper SetText(string s, Color c=default(Color))
Definition:
Popper.cs:28
Scene.popper
PopperManager popper
Definition:
Scene.cs:95
UDictionary.TryGetValue
bool TryGetValue(TKey key, out TValue value)
Definition:
UDictionary.cs:178
Elin
DamageTextRenderer.cs
Generated by
1.9.6