Elin Modding Docs Doc
Loading...
Searching...
No Matches
ElementContainerCard.cs
1using System;
2using System.Collections.Generic;
3using System.Runtime.CompilerServices;
4using UnityEngine;
5
6// Token: 0x02000309 RID: 777
8{
9 // Token: 0x170006C2 RID: 1730
10 // (get) Token: 0x06001826 RID: 6182 RVA: 0x0009C4D5 File Offset: 0x0009A6D5
11 public override Card Card
12 {
13 get
14 {
15 return this.owner;
16 }
17 }
18
19 // Token: 0x170006C3 RID: 1731
20 // (get) Token: 0x06001827 RID: 6183 RVA: 0x0009C4DD File Offset: 0x0009A6DD
21 public override Chara Chara
22 {
23 get
24 {
25 return this.owner.Chara;
26 }
27 }
28
29 // Token: 0x170006C4 RID: 1732
30 // (get) Token: 0x06001828 RID: 6184 RVA: 0x0009C4EA File Offset: 0x0009A6EA
31 public override bool IsMeleeWeapon
32 {
33 get
34 {
35 return this.Card.category.slot == 35 && this.Card.category.skill != 0;
36 }
37 }
38
39 // Token: 0x06001829 RID: 6185 RVA: 0x0009C518 File Offset: 0x0009A718
40 public void SetOwner(Card c, bool applyFeat)
41 {
42 this.owner = c;
43 SourceValueType sourceValueType = (c.IsEquipmentOrRanged && c.rarity < Rarity.Artifact) ? SourceValueType.EquipmentRandom : SourceValueType.Fixed;
44 base.ApplyElementMap(c.uid, sourceValueType, c.sourceCard.elementMap, (sourceValueType == SourceValueType.EquipmentRandom) ? c.LV : 1, false, applyFeat);
45 }
46
47 // Token: 0x0600182A RID: 6186 RVA: 0x0009C56C File Offset: 0x0009A76C
48 public override void OnLearn(int ele)
49 {
50 if (this.owner.IsPCFaction)
51 {
52 SE.DingSkill2();
53 }
54 Msg.Say("learnSkill", this.Card, EClass.sources.elements.map[ele].GetName(), null, null);
55 this.CheckSkillActions();
56 }
57
58 // Token: 0x0600182B RID: 6187 RVA: 0x0009C5C0 File Offset: 0x0009A7C0
59 public void CheckSkillActions()
60 {
61 if (this.owner.IsPC)
62 {
63 this.<CheckSkillActions>g__TryLearn|9_0(6011, 281, 0);
64 this.<CheckSkillActions>g__TryLearn|9_0(6018, 226, 0);
65 this.<CheckSkillActions>g__TryLearn|9_0(6019, 227, 0);
66 this.<CheckSkillActions>g__TryLearn|9_0(6700, 1649, 0);
67 this.<CheckSkillActions>g__TryLearn|9_0(6720, 1657, 0);
68 this.<CheckSkillActions>g__TryLearn|9_0(6450, 132, 5);
69 }
70 }
71
72 // Token: 0x0600182C RID: 6188 RVA: 0x0009C640 File Offset: 0x0009A840
73 public override void OnTrain(int ele)
74 {
75 Msg.Say("trainSkill", this.Card, EClass.sources.elements.map[ele].GetName(), null, null);
76 }
77
78 // Token: 0x0600182D RID: 6189 RVA: 0x0009C670 File Offset: 0x0009A870
79 public override void OnModTempPotential(Element e, int v, int threshMsg)
80 {
81 if (threshMsg != 0 && Mathf.Abs(v) < threshMsg)
82 {
83 return;
84 }
85 string lang = (v > 0) ? "potentialInc" : "potentialDec";
86 if (this.owner.IsPCFaction && v > 0)
87 {
88 this.owner.PlaySound("ding_potential", 1f, true);
89 }
90 Msg.SetColor((v > 0) ? "positive" : "negative");
91 this.owner.Say(lang, this.owner, e.Name.ToLower(), null);
92 }
93
94 // Token: 0x0600182E RID: 6190 RVA: 0x0009C6F8 File Offset: 0x0009A8F8
95 public override void OnLevelUp(Element e, int lastValue)
96 {
97 if (!e.ShowMsgOnValueChanged)
98 {
99 return;
100 }
101 if (this.owner.IsPC)
102 {
103 if (e.id == 287)
104 {
105 EClass.player.flags.canComupWithFoodRecipe = true;
106 }
107 SE.DingSkill2();
108 }
109 if (this.owner.isChara)
110 {
111 if (this.owner.Chara.IsPCFaction)
112 {
113 if (!VirtualDate.IsActive)
114 {
115 if (this.owner.Chara.IsInActiveZone)
116 {
117 Msg.SetColor(Msg.colors.Ding);
118 string text = e.source.GetText("textInc", true);
119 if (!text.IsEmpty())
120 {
121 this.owner.Say(text, this.owner, null, null);
122 }
123 else
124 {
125 this.owner.Say("ding_skill", this.owner, e.Name, null);
126 }
127 this.owner.pos.TalkWitnesses(this.owner.Chara, "ding_other", 4, WitnessType.ally, null, 4 + EClass.pc.party.members.Count);
128 }
129 if (this.owner.IsPCParty)
130 {
131 WidgetPopText.Say("popDing".lang(this.owner.IsPC ? "" : this.owner.Name, e.Name, lastValue.ToString() ?? "", e.ValueWithoutLink.ToString() ?? "", null), FontColor.Good, null);
132 }
133 }
134 if (this.owner.Chara.homeBranch != null)
135 {
136 this.owner.Chara.homeBranch.Log("bDing", this.Card, e.Name, lastValue.ToString() ?? "", e.ValueWithoutLink.ToString() ?? "");
137 }
138 }
139 if (e is Skill)
140 {
141 this.owner.AddExp(10 + EClass.rnd(5));
142 }
143 this.owner.Chara.CalculateMaxStamina();
144 }
145 this.CheckSkillActions();
146 }
147
148 // Token: 0x0600182F RID: 6191 RVA: 0x0009C914 File Offset: 0x0009AB14
149 public override void OnLevelDown(Element e, int lastValue)
150 {
151 if (!e.ShowMsgOnValueChanged)
152 {
153 return;
154 }
155 bool isPC = this.owner.IsPC;
156 if (this.owner.isChara)
157 {
158 if (this.owner.Chara.IsPCFaction)
159 {
160 Msg.SetColor(Msg.colors.Negative);
161 string text = e.source.GetText("textDec", true);
162 if (!text.IsEmpty())
163 {
164 Msg.Say(text, this.owner, null, null, null);
165 }
166 else
167 {
168 Msg.Say("dec_skill", this.owner, e.Name, null, null);
169 }
170 }
171 this.owner.Chara.CalculateMaxStamina();
172 }
173 }
174
175 // Token: 0x06001830 RID: 6192 RVA: 0x0009C9BC File Offset: 0x0009ABBC
176 public override int ValueBonus(Element e)
177 {
178 if (EClass.game == null)
179 {
180 return 0;
181 }
182 int num = 0;
183 if (this.owner.IsPCFactionOrMinion)
184 {
185 Element element = EClass.pc.faction.charaElements.GetElement(e.id);
186 if (element != null)
187 {
188 num += element.Value;
189 }
190 if (this.owner.IsPCParty)
191 {
192 int id = e.id;
193 if (id == 70 || id - 72 <= 1)
194 {
195 int num2 = 0;
196 foreach (Chara chara in EClass.pc.party.members)
197 {
198 if (chara.Evalue(1419) > 0)
199 {
200 num2 += chara.Evalue(1419);
201 }
202 }
203 if (num2 > 0)
204 {
205 int num3 = 0;
206 using (List<Chara>.Enumerator enumerator = EClass._map.charas.GetEnumerator())
207 {
208 while (enumerator.MoveNext())
209 {
210 if (enumerator.Current.IsHostile(EClass.pc))
211 {
212 num3++;
213 }
214 }
215 }
216 if (num3 > 0)
217 {
218 num += Mathf.Max(1, (e.ValueWithoutLink + e.vLink) * (int)Mathf.Clamp(4f + Mathf.Sqrt((float)num3) * (float)num2 * 2f, 5f, 30f) / 100);
219 }
220 }
221 }
222 }
223 if (e.id == 78)
224 {
225 num += EClass.player.CountKeyItem("lucky_coin") * 2;
226 if (this.Chara != null && this.Chara.Evalue(663) > 0)
227 {
228 num = num * 2 + (e.ValueWithoutLink + e.vLink);
229 }
230 }
231 if (this.owner.Chara.race.IsMachine || this.owner.id == "android")
232 {
233 int num4 = this.owner.Evalue(664);
234 if (num4 > 0)
235 {
236 int id = e.id;
237 if (id - 64 > 1)
238 {
239 if (id == 79)
240 {
241 num += (e.ValueWithoutLink + e.vLink) * num4 / 100;
242 }
243 }
244 else
245 {
246 num += (e.ValueWithoutLink + e.vLink) * num4 / 2 / 100;
247 }
248 }
249 }
250 }
251 if (!e.source.aliasMtp.IsEmpty())
252 {
253 int num5 = this.owner.Evalue(e.source.aliasMtp);
254 if (num5 != 0)
255 {
256 num += (e.ValueWithoutLink + e.vLink) * num5 / 100;
257 }
258 }
259 return num;
260 }
261
262 // Token: 0x06001832 RID: 6194 RVA: 0x0009CC60 File Offset: 0x0009AE60
263 [CompilerGenerated]
264 private void <CheckSkillActions>g__TryLearn|9_0(int eleAction, int reqEle, int lqlv)
265 {
266 if (base.HasBase(eleAction) || !base.HasBase(reqEle) || base.GetElement(reqEle).ValueWithoutLink < lqlv)
267 {
268 return;
269 }
270 base.SetBase(eleAction, 1, 0);
271 if (!EClass.core.IsGameStarted)
272 {
273 return;
274 }
275 if (this.owner.IsPC)
276 {
277 LayerAbility.Redraw();
278 }
279 this.owner.Say("learnSkill", this.Card, EClass.sources.elements.map[eleAction].GetName(), null);
280 }
281
282 // Token: 0x040010A0 RID: 4256
283 public Card owner;
284}
Definition Card.cs:13
Definition Chara.cs:12
Definition Msg.cs:7