Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
TraitMonsterBall.cs
Go to the documentation of this file.
1public class TraitMonsterBall : Trait
2{
3 public Chara chara
4 {
5 get
6 {
7 return owner.GetObj<Chara>(8);
8 }
9 set
10 {
11 owner.SetObj(8, value);
12 }
13 }
14
15 public override bool IsThrowMainAction => true;
16
17 public override ThrowType ThrowType => ThrowType.MonsterBall;
18
19 public override EffectDead EffectDead => EffectDead.None;
20
21 public virtual bool IsLittleBall => false;
22
23 public override void OnCreate(int lv)
24 {
25 if (!IsLittleBall)
26 {
27 owner.SetLv(1 + EClass.rnd(lv + 10));
28 }
29 }
30
31 public override bool CanStackTo(Thing to)
32 {
33 if (to.GetObj<Chara>(8) == null && chara == null)
34 {
35 return to.LV == owner.LV;
36 }
37 return false;
38 }
39
40 public override void SetName(ref string s)
41 {
42 s = (IsLittleBall ? "_littleBall" : "_monsterball").lang(s, owner.LV.ToString() ?? "", (chara == null) ? "_monsterball_empty".lang() : chara.Name);
43 }
44
45 public override int GetValue()
46 {
47 if (IsLittleBall)
48 {
49 return base.GetValue();
50 }
51 return base.GetValue() * (100 + owner.LV * 15) / 100;
52 }
53}
EffectDead
Definition: EffectDead.cs:2
ThrowType
Definition: ThrowType.cs:2
void SetObj(int id, object o)
Definition: BaseCard.cs:91
Card SetLv(int a)
Definition: Card.cs:2735
string Name
Definition: Card.cs:2013
int LV
Definition: Card.cs:370
Definition: Chara.cs:10
Definition: EClass.cs:5
static int rnd(int a)
Definition: EClass.cs:50
Definition: Thing.cs:8
override void OnCreate(int lv)
override bool CanStackTo(Thing to)
override bool IsThrowMainAction
override void SetName(ref string s)
override int GetValue()
virtual bool IsLittleBall
Definition: Trait.cs:7
Card owner
Definition: Trait.cs:26