Elin Decompiled Documentation
EA 23.102 Nightly
Loading...
Searching...
No Matches
TraitGacha.cs
Go to the documentation of this file.
1
public
class
TraitGacha
:
Trait
2
{
3
public
enum
GachaType
4
{
5
Junk
,
6
Plant
,
7
Furniture
8
}
9
10
public
GachaType
type
=>
GetParam
(1).ToEnum<
GachaType
>();
11
12
public
virtual
string
suffixCoin
=>
""
;
13
14
public
virtual
int
refVal
=> 0;
15
16
public
string
GetIdCoin
()
17
{
18
string
text =
"gacha_coin"
;
19
switch
(
type
)
20
{
21
case
GachaType
.Furniture:
22
text +=
"_gold"
;
23
break
;
24
case
GachaType
.Plant:
25
text +=
"_silver"
;
26
break
;
27
}
28
return
text;
29
}
30
31
public
override
void
TrySetAct
(
ActPlan
p)
32
{
33
if
(
owner
.
isOn
)
34
{
35
p.
TrySetAct
(
"gacha"
, delegate
36
{
37
LayerDragGrid
.
CreateGacha
(
this
);
38
return
false
;
39
},
owner
);
40
}
41
}
42
43
public
void
PlayGacha
(
int
num)
44
{
45
Thing
thing =
ThingGen
.
Create
(
"gachaBall"
).
SetNum
(num);
46
thing.refVal = (int)
type
;
47
EClass
.
player
.
DropReward
(thing, silent:
true
);
48
}
49
}
ActPlan
Definition:
ActPlan.cs:8
ActPlan.TrySetAct
bool TrySetAct(string lang, Func< bool > onPerform, Card tc, CursorInfo cursor=null, int dist=1, bool isHostileAct=false, bool localAct=true, bool canRepeat=false)
Definition:
ActPlan.cs:344
Card.SetNum
Thing SetNum(int a)
Definition:
Card.cs:3242
Card.isOn
bool isOn
Definition:
Card.cs:514
EClass
Definition:
EClass.cs:5
EClass.player
static Player player
Definition:
EClass.cs:12
LayerDragGrid
Definition:
LayerDragGrid.cs:6
LayerDragGrid.CreateGacha
static LayerDragGrid CreateGacha(TraitGacha gacha)
Definition:
LayerDragGrid.cs:442
Player.DropReward
Thing DropReward(Thing t, bool silent=false)
Definition:
Player.cs:2320
ThingGen
Definition:
ThingGen.cs:5
ThingGen.Create
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition:
ThingGen.cs:53
Thing
Definition:
Thing.cs:8
TraitGacha
Definition:
TraitGacha.cs:2
TraitGacha.TrySetAct
override void TrySetAct(ActPlan p)
Definition:
TraitGacha.cs:31
TraitGacha.GetIdCoin
string GetIdCoin()
Definition:
TraitGacha.cs:16
TraitGacha.suffixCoin
virtual string suffixCoin
Definition:
TraitGacha.cs:12
TraitGacha.type
GachaType type
Definition:
TraitGacha.cs:10
TraitGacha.PlayGacha
void PlayGacha(int num)
Definition:
TraitGacha.cs:43
TraitGacha.refVal
virtual int refVal
Definition:
TraitGacha.cs:14
TraitGacha.GachaType
GachaType
Definition:
TraitGacha.cs:4
TraitGacha.GachaType.Plant
@ Plant
TraitGacha.GachaType.Junk
@ Junk
TraitGacha.GachaType.Furniture
@ Furniture
Trait
Definition:
Trait.cs:7
Trait.GetParam
string GetParam(int i, string def=null)
Definition:
Trait.cs:515
Trait.owner
Card owner
Definition:
Trait.cs:26
Elin
TraitGacha.cs
Generated by
1.9.6