25 return this.owner.Chara;
31 public override bool IsMeleeWeapon
35 return this.Card.category.slot == 35 && this.Card.category.skill != 0;
40 public void SetOwner(
Card c,
bool applyFeat)
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);
48 public override void OnLearn(
int ele)
50 if (this.owner.IsPCFaction)
54 Msg.Say(
"learnSkill", this.
Card,
EClass.sources.elements.map[ele].GetName(),
null,
null);
55 this.CheckSkillActions();
59 public void CheckSkillActions()
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);
73 public override void OnTrain(
int ele)
75 Msg.Say(
"trainSkill", this.
Card,
EClass.sources.elements.map[ele].GetName(),
null,
null);
79 public override void OnModTempPotential(
Element e,
int v,
int threshMsg)
81 if (threshMsg != 0 && Mathf.Abs(v) < threshMsg)
85 string lang = (v > 0) ?
"potentialInc" :
"potentialDec";
86 if (this.owner.IsPCFaction && v > 0)
88 this.owner.PlaySound(
"ding_potential", 1f,
true);
90 Msg.SetColor((v > 0) ?
"positive" :
"negative");
91 this.owner.Say(lang, this.owner, e.Name.ToLower(),
null);
95 public override void OnLevelUp(
Element e,
int lastValue)
97 if (!e.ShowMsgOnValueChanged)
105 EClass.player.flags.canComupWithFoodRecipe =
true;
109 if (this.owner.isChara)
111 if (this.owner.Chara.IsPCFaction)
115 if (this.owner.Chara.IsInActiveZone)
117 Msg.SetColor(
Msg.colors.Ding);
118 string text = e.source.GetText(
"textInc",
true);
121 this.owner.Say(text, this.owner,
null,
null);
125 this.owner.Say(
"ding_skill", this.owner, e.Name,
null);
127 this.owner.pos.TalkWitnesses(this.owner.Chara,
"ding_other", 4, WitnessType.ally,
null, 4 +
EClass.pc.party.members.Count);
129 if (this.owner.IsPCParty)
131 WidgetPopText.Say(
"popDing".lang(this.owner.IsPC ?
"" :
this.owner.Name, e.Name, lastValue.ToString() ??
"", e.ValueWithoutLink.ToString() ??
"",
null), FontColor.Good,
null);
134 if (this.owner.Chara.homeBranch !=
null)
136 this.owner.Chara.homeBranch.Log(
"bDing", this.
Card, e.Name, lastValue.ToString() ??
"", e.ValueWithoutLink.ToString() ??
"");
141 this.owner.AddExp(10 +
EClass.rnd(5));
143 this.owner.Chara.CalculateMaxStamina();
145 this.CheckSkillActions();
149 public override void OnLevelDown(
Element e,
int lastValue)
151 if (!e.ShowMsgOnValueChanged)
155 bool isPC = this.owner.IsPC;
156 if (this.owner.isChara)
158 if (this.owner.Chara.IsPCFaction)
160 Msg.SetColor(
Msg.colors.Negative);
161 string text = e.source.GetText(
"textDec",
true);
164 Msg.Say(text, this.owner,
null,
null,
null);
168 Msg.Say(
"dec_skill", this.owner, e.Name,
null,
null);
171 this.owner.Chara.CalculateMaxStamina();
176 public override int ValueBonus(
Element e)
183 if (this.owner.IsPCFactionOrMinion)
185 Element element =
EClass.pc.faction.charaElements.GetElement(e.id);
188 num += element.Value;
190 if (this.owner.IsPCParty)
193 if (
id == 70 ||
id - 72 <= 1)
198 if (chara.Evalue(1419) > 0)
200 num2 += chara.Evalue(1419);
206 using (List<Chara>.Enumerator enumerator =
EClass._map.charas.GetEnumerator())
208 while (enumerator.MoveNext())
210 if (enumerator.Current.IsHostile(
EClass.pc))
218 num += Mathf.Max(1, (e.ValueWithoutLink + e.vLink) * (
int)Mathf.Clamp(4f + Mathf.Sqrt((
float)num3) * (
float)num2 * 2f, 5f, 30f) / 100);
225 num +=
EClass.player.CountKeyItem(
"lucky_coin") * 2;
226 if (this.
Chara !=
null && this.
Chara.Evalue(663) > 0)
228 num = num * 2 + (e.ValueWithoutLink + e.vLink);
231 if (this.owner.Chara.race.IsMachine ||
this.owner.id ==
"android")
233 int num4 = this.owner.Evalue(664);
241 num += (e.ValueWithoutLink + e.vLink) * num4 / 100;
246 num += (e.ValueWithoutLink + e.vLink) * num4 / 2 / 100;
251 if (!e.source.aliasMtp.IsEmpty())
253 int num5 = this.owner.Evalue(e.source.aliasMtp);
256 num += (e.ValueWithoutLink + e.vLink) * num5 / 100;
264 private void <CheckSkillActions>g__TryLearn|9_0(
int eleAction,
int reqEle,
int lqlv)
266 if (base.HasBase(eleAction) || !base.HasBase(reqEle) || base.GetElement(reqEle).ValueWithoutLink < lqlv)
270 base.SetBase(eleAction, 1, 0);
271 if (!
EClass.core.IsGameStarted)
279 this.owner.Say(
"learnSkill", this.
Card,
EClass.sources.elements.map[eleAction].GetName(),
null);