Elin Modding Docs Doc
Loading...
Searching...
No Matches
HotItemAct.cs
1using System;
2using Newtonsoft.Json;
3using UnityEngine;
4using UnityEngine.UI;
5
6// Token: 0x02000618 RID: 1560
8{
9 // Token: 0x17000C78 RID: 3192
10 // (get) Token: 0x06002B63 RID: 11107 RVA: 0x000F3C88 File Offset: 0x000F1E88
11 public override Act act
12 {
13 get
14 {
15 Act result;
16 if ((result = this._act) == null)
17 {
18 result = (this._act = ACT.Create(this.id));
19 }
20 return result;
21 }
22 }
23
24 // Token: 0x17000C79 RID: 3193
25 // (get) Token: 0x06002B64 RID: 11108 RVA: 0x000F3CB3 File Offset: 0x000F1EB3
26 public override string Name
27 {
28 get
29 {
30 return this.source.GetName();
31 }
32 }
33
34 // Token: 0x17000C7A RID: 3194
35 // (get) Token: 0x06002B65 RID: 11109 RVA: 0x000F3CC0 File Offset: 0x000F1EC0
36 public SourceElement.Row source
37 {
38 get
39 {
40 return EClass.sources.elements.map.TryGetValue(this.id, null) ?? EClass.sources.elements.rows[0];
41 }
42 }
43
44 // Token: 0x06002B66 RID: 11110 RVA: 0x000F3CF6 File Offset: 0x000F1EF6
45 public override Sprite GetSprite()
46 {
47 return this.act.GetSprite();
48 }
49
50 // Token: 0x17000C7B RID: 3195
51 // (get) Token: 0x06002B67 RID: 11111 RVA: 0x000F3D03 File Offset: 0x000F1F03
52 public override bool UseUIObjMaterial
53 {
54 get
55 {
56 return true;
57 }
58 }
59
60 // Token: 0x17000C7C RID: 3196
61 // (get) Token: 0x06002B68 RID: 11112 RVA: 0x000F3D06 File Offset: 0x000F1F06
62 public override Color SpriteColor
63 {
64 get
65 {
66 if (!this.source.aliasRef.IsEmpty())
67 {
68 return EClass.setting.elements[this.source.aliasRef].colorSprite;
69 }
70 return Color.white;
71 }
72 }
73
74 // Token: 0x06002B69 RID: 11113 RVA: 0x000F3D3F File Offset: 0x000F1F3F
75 public HotItemAct()
76 {
77 }
78
79 // Token: 0x06002B6A RID: 11114 RVA: 0x000F3D47 File Offset: 0x000F1F47
80 public HotItemAct(string alias)
81 {
82 this.id = EClass.sources.elements.alias[alias].id;
83 }
84
85 // Token: 0x06002B6B RID: 11115 RVA: 0x000F3D6F File Offset: 0x000F1F6F
86 public HotItemAct(SourceElement.Row row)
87 {
88 this.id = row.id;
89 }
90
91 // Token: 0x06002B6C RID: 11116 RVA: 0x000F3D83 File Offset: 0x000F1F83
92 public override void SetImage(Image icon)
93 {
94 this.act.SetImage(icon);
95 }
96
97 // Token: 0x06002B6D RID: 11117 RVA: 0x000F3D94 File Offset: 0x000F1F94
98 public override bool TrySetAct(ActPlan p)
99 {
100 Card tg = null;
101 p.pos.ListVisibleCards().ForeachReverse(delegate(Card a)
102 {
103 if (EClass.pc.CanSee(a) && !a.HasHost && this.act.IsValidTC(a))
104 {
105 tg = a;
106 return true;
107 }
108 return false;
109 });
110 if (!this.act.CanPerform(EClass.pc, tg, p.pos))
111 {
112 return false;
113 }
114 p.TrySetAct(this.source.GetName(), delegate()
115 {
116 Card tg;
117 if (tg != null && !tg.ExistsOnMap)
118 {
119 return false;
120 }
121 Point point = (tg != null && tg.ExistsOnMap) ? tg.pos : p.pos;
122 if (!this.act.CanPerform(EClass.pc, tg, point))
123 {
124 return false;
125 }
126 string[] array = new string[8];
127 array[0] = "hotitemact:";
128 int num = 1;
129 HotItemAct <>4__this = this;
130 array[num] = ((<>4__this != null) ? <>4__this.ToString() : null);
131 array[2] = "/";
132 array[3] = this.act.id.ToString();
133 array[4] = "/";
134 int num2 = 5;
135 tg = tg;
136 array[num2] = ((tg != null) ? tg.ToString() : null);
137 array[6] = "/";
138 array[7] = p.performed.ToString();
139 Debug.Log(string.Concat(array));
140 if (p.performed && this.act.CanPressRepeat)
141 {
142 return EClass.pc.UseAbility(this.act.source.alias, tg, point, false);
143 }
144 return ButtonAbility.TryUse(this.act, tg, point, null, true, true);
145 }, tg, null, -1, EClass._zone.IsCrime(EClass.pc, this.act), this.act.LocalAct, this.act.CanPressRepeat);
146 return true;
147 }
148
149 // Token: 0x04001836 RID: 6198
150 [JsonProperty]
151 public int id;
152
153 // Token: 0x04001837 RID: 6199
154 public Act _act;
155}
Definition ACT.cs:6
Definition Act.2.cs:7
Definition Card.cs:13
Definition Point.cs:11