Elin Modding Docs Doc
Loading...
Searching...
No Matches
TraitGachaBall.cs
1using System;
2
3// Token: 0x0200040F RID: 1039
5{
6 // Token: 0x17000943 RID: 2371
7 // (get) Token: 0x06001DC2 RID: 7618 RVA: 0x000AC72B File Offset: 0x000AA92B
8 public override string LangUse
9 {
10 get
11 {
12 return "actContainer";
13 }
14 }
15
16 // Token: 0x06001DC3 RID: 7619 RVA: 0x000AC734 File Offset: 0x000AA934
17 public override bool OnUse(Chara c)
18 {
19 TraitGacha.GachaType refVal = (TraitGacha.GachaType)this.owner.refVal;
20 SpawnList spawnList;
21 if (refVal != TraitGacha.GachaType.Plant)
22 {
23 if (refVal == TraitGacha.GachaType.Furniture)
24 {
25 spawnList = SpawnListThing.Get("gacha_furniture", (SourceThing.Row a) => a.value < 5000 && a.Category.IsChildOf("furniture"));
26 }
27 else
28 {
29 spawnList = SpawnListThing.Get("gacha_junk", (SourceThing.Row a) => a.Category.id == "junk");
30 }
31 }
32 else
33 {
34 spawnList = SpawnListThing.Get("gacha_plant", (SourceThing.Row a) => a.Category.id == "plantpot");
35 }
36 Rand.SetSeed(this.owner.uid + this.owner.Num * 100 + EClass.world.date.day / 5 * 1000);
37 Thing thing = ThingGen.Create(spawnList.Select(-1, -1).id, -1, -1);
38 if (refVal != TraitGacha.GachaType.Plant)
39 {
40 thing.ChangeMaterial(EClass.sources.materials.rows.RandomItemWeighted((SourceMaterial.Row m) => (float)m.chance));
41 }
42 Rand.SetSeed(-1);
43 EClass.player.DropReward(thing, false);
44 this.owner.ModNum(-1, true);
45 return true;
46 }
47}
Definition Chara.cs:12
Definition Thing.cs:10