Elin Modding Docs Doc
Loading...
Searching...
No Matches
TraitSalesTag.cs
1using System;
2
3// Token: 0x020003A9 RID: 937
4public class TraitSalesTag : Trait
5{
6 // Token: 0x17000860 RID: 2144
7 // (get) Token: 0x06001BFC RID: 7164 RVA: 0x000A8C56 File Offset: 0x000A6E56
8 public override bool CanBeDestroyed
9 {
10 get
11 {
12 return false;
13 }
14 }
15
16 // Token: 0x17000861 RID: 2145
17 // (get) Token: 0x06001BFD RID: 7165 RVA: 0x000A8C59 File Offset: 0x000A6E59
18 public override bool IsTool
19 {
20 get
21 {
22 return !this.owner.isOn;
23 }
24 }
25
26 // Token: 0x17000862 RID: 2146
27 // (get) Token: 0x06001BFE RID: 7166 RVA: 0x000A8C69 File Offset: 0x000A6E69
28 public override bool UseAltTiles
29 {
30 get
31 {
32 return this.owner.isOn;
33 }
34 }
35
36 // Token: 0x06001BFF RID: 7167 RVA: 0x000A8C78 File Offset: 0x000A6E78
37 public static bool CanTagSale(Card t, bool insideContainer = false)
38 {
39 if (t.isSale)
40 {
41 return false;
42 }
43 if (t.isChara)
44 {
45 Chara chara = t.Chara;
46 if (chara.trait is TraitUniqueChara || chara.IsUnique || EClass.game.cards.listAdv.Contains(chara))
47 {
48 return false;
49 }
50 if (!chara.IsPCFaction || chara.IsPCParty)
51 {
52 return false;
53 }
54 }
55 else
56 {
57 if (!insideContainer && !t.IsInstalled)
58 {
59 return false;
60 }
61 if (!t.trait.CanBeHeld || !t.trait.CanBeDestroyed || !t.trait.CanBeShipped || t.isMasked || t.trait is TraitSpot)
62 {
63 return false;
64 }
65 }
66 return t.GetPrice(CurrencyType.Money, true, PriceType.PlayerShop, null) != 0;
67 }
68
69 // Token: 0x06001C00 RID: 7168 RVA: 0x000A8D38 File Offset: 0x000A6F38
70 public override void TrySetHeldAct(ActPlan p)
71 {
72 if (!EClass._zone.IsPCFaction || this.owner.isOn)
73 {
74 return;
75 }
76 p.pos.ListCards(false).ForEach(delegate(Card t)
77 {
78 if (t.trait is TraitSalesTag && t.isOn)
79 {
80 p.TrySetAct("actRemove", delegate()
81 {
82 t.Destroy();
83 SE.Trash();
84 return false;
85 }, t, null, 1, false, true, false);
86 }
87 if (t.isSale)
88 {
89 p.TrySetAct("actRemoveSalesTag".lang(t.Name, null, null, null, null), delegate()
90 {
91 SE.Play("paper");
92 t.SetSale(false);
93 return false;
94 }, null, 1);
95 return;
96 }
97 if (!TraitSalesTag.CanTagSale(t, false))
98 {
99 return;
100 }
101 int price = t.GetPrice(CurrencyType.Money, true, PriceType.PlayerShop, null);
102 p.TrySetAct("actSalesTag".lang(Lang._currency(price, "money"), t.Name, null, null, null), delegate()
103 {
104 SE.Play("paper");
105 t.SetSale(true);
106 return false;
107 }, null, 1);
108 });
109 }
110
111 // Token: 0x06001C01 RID: 7169 RVA: 0x000A8D8E File Offset: 0x000A6F8E
112 public override bool CanStackTo(Thing to)
113 {
114 return false;
115 }
116}
Definition Card.cs:13
Definition Chara.cs:12
Definition Thing.cs:10
Definition Trait.cs:9