|
@@ -37,7 +37,6 @@ public class Ability : SkillRoot
|
|
|
protected Current UnlockAheadCur;
|
|
|
|
|
|
protected bool ValidSlot;
|
|
|
- protected bool ValidAnim;
|
|
|
protected string Label;
|
|
|
protected string Anim;
|
|
|
|
|
@@ -58,12 +57,12 @@ public class Ability : SkillRoot
|
|
|
|
|
|
public SkillStatus ItemStatus
|
|
|
{
|
|
|
- get { return _ItemStatus; }
|
|
|
+ get { return ItemStatus_; }
|
|
|
set
|
|
|
{
|
|
|
- _ItemStatus = value;
|
|
|
+ ItemStatus_ = value;
|
|
|
|
|
|
- if (_ItemStatus == SkillStatus.Lock)
|
|
|
+ if (ItemStatus_ == SkillStatus.Lock)
|
|
|
{
|
|
|
if (UnlockAheadCur == Current.Free)
|
|
|
{
|
|
@@ -78,27 +77,29 @@ public class Ability : SkillRoot
|
|
|
ManaLan.Add(ItemBtnLab, new LanStr("UI", "Fe_BtnLab0"), "\n", new LanStr("UI", "Fe_BtnLab4"), UnlockLv.ToString());
|
|
|
}
|
|
|
}
|
|
|
- else if (_ItemStatus == SkillStatus.UnLock)
|
|
|
+ else if (ItemStatus_ == SkillStatus.UnLock)
|
|
|
{
|
|
|
ItemBtn.interactable = true;
|
|
|
|
|
|
- ManaLan.Add(ItemBtnLab, new LanStr("UI", "Fe_BtnLab1"));
|
|
|
+ if (UnlockCur == Current.Free)
|
|
|
+ {
|
|
|
+ ManaLan.Add(ItemBtnLab, new LanStr("UI", "Fe_BtnLab1"));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ManaLan.Add(ItemBtnLab, new LanStr("UI", "Fe_BtnLab1"), "\n", ImageParse(UnlockCur), UnlockAmt.ToString("0"));
|
|
|
+ }
|
|
|
}
|
|
|
- else if (_ItemStatus == SkillStatus.Upgrade)
|
|
|
+ else if (ItemStatus_ == SkillStatus.Upgrade)
|
|
|
{
|
|
|
ItemBtn.interactable = true;
|
|
|
|
|
|
- ManaLan.Add(ItemTit, new LanStr("SkillName", ID), " ", Level .ToString());
|
|
|
- ManaLan.Add(ItemBtnLab, new LanStr("UI", "Fe_BtnLab2"));
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception(_ItemStatus.ToString());
|
|
|
+ ManaLan.Add(ItemBtnLab, new LanStr("UI", "Fe_BtnLab2"), "\n", ImageParse(UpgradeCur), UpgradeAmt.ToString("0"));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public SkillStatus _ItemStatus;
|
|
|
+ public SkillStatus ItemStatus_;
|
|
|
|
|
|
#endregion
|
|
|
|
|
@@ -107,7 +108,7 @@ public class Ability : SkillRoot
|
|
|
#region 配置
|
|
|
|
|
|
ID_ = int.Parse(attribute[0].Value);
|
|
|
- Icon = attribute[20].Value;
|
|
|
+ Icon_ = attribute[20].Value;
|
|
|
Anim = attribute[21].Value;
|
|
|
Label = attribute[22].Value;
|
|
|
|
|
@@ -117,7 +118,7 @@ public class Ability : SkillRoot
|
|
|
UpgradePlus = attribute[16].Value;
|
|
|
UpgradePerson = attribute[17].Value;
|
|
|
|
|
|
- ClassID = IntParse(attribute[3].Value);
|
|
|
+ ItemIndex = IntParse(attribute[3].Value);
|
|
|
UnlockLv = IntParse(attribute[7].Value);
|
|
|
|
|
|
UnlockAmt = FloatParse(attribute[11].Value);
|
|
@@ -177,11 +178,11 @@ public class Ability : SkillRoot
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public override void RegistValue(float elapse, List<List<Skill>> ffList, XmlAttributeCollection attribute)
|
|
|
+ public override void RegistValue(float elapse, List<List<Skill>> useList, XmlAttributeCollection attribute)
|
|
|
{
|
|
|
Level = int.Parse(attribute[3].Value);
|
|
|
|
|
|
- _ItemStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), attribute[2].Value);
|
|
|
+ ItemStatus = (SkillStatus)Enum.Parse(typeof(SkillStatus), attribute[2].Value);
|
|
|
|
|
|
NewPlus = Plus;
|
|
|
NewPerson = Person;
|
|
@@ -191,13 +192,11 @@ public class Ability : SkillRoot
|
|
|
NewCoinPerson = CoinPerson;
|
|
|
NewUpgradeAmt = UpgradeAmt;
|
|
|
|
|
|
- ManaLan.Add(ItemTit, new LanStr("SkillName", ID));
|
|
|
-
|
|
|
ItemLab.text = Description(0);
|
|
|
|
|
|
ItemBtn.onClick.AddListener(OnClick);
|
|
|
|
|
|
- if (_ItemStatus == SkillStatus.Upgrade)
|
|
|
+ if (ItemStatus == SkillStatus.Upgrade)
|
|
|
{
|
|
|
ManaDebug.Log(string.Format("技能<color=red>{0}</color>已解锁 等级 : {1}", Name, Level));
|
|
|
|
|
@@ -214,13 +213,18 @@ public class Ability : SkillRoot
|
|
|
UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, Level);
|
|
|
UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, Level);
|
|
|
|
|
|
- if (Level > 0)
|
|
|
+ UseA();
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(Anim))
|
|
|
{
|
|
|
- UseConti();
|
|
|
+ string[] strings = Anim.Split(',');
|
|
|
+
|
|
|
+ if (strings.Length == 1)
|
|
|
+ {
|
|
|
+ ManaData.Elf += Level;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- ItemStatus = ItemStatus;
|
|
|
}
|
|
|
|
|
|
public override void UpdateStatus()
|
|
@@ -229,78 +233,167 @@ public class Ability : SkillRoot
|
|
|
{
|
|
|
if (ItemStatus == SkillStatus.Lock)
|
|
|
{
|
|
|
- if (UnlockCur == Current.Free)
|
|
|
- {
|
|
|
- Unlock();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ItemStatus = SkillStatus.UnLock;
|
|
|
- }
|
|
|
+ ItemStatus = SkillStatus.UnLock;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
protected void Unlock()
|
|
|
{
|
|
|
- if (ManaData.Pay(UnlockAmt, UnlockCur))
|
|
|
+ if (!ManaData.Pay(UnlockAmt, UnlockCur))
|
|
|
{
|
|
|
- ManaData.Elf++;
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- ManaDebug.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
|
|
|
+ ManaDebug.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
|
|
|
+
|
|
|
+ if (UpgradeCur != Current.Free)
|
|
|
+ {
|
|
|
+ ItemStatus = SkillStatus.Upgrade;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception();
|
|
|
+ }
|
|
|
+
|
|
|
+ UseA();
|
|
|
+ UseB();
|
|
|
+ UseC();
|
|
|
+ }
|
|
|
+
|
|
|
+ protected void OnClick()
|
|
|
+ {
|
|
|
+ if (ManaServer.Connect == false)
|
|
|
+ {
|
|
|
+ ManaReso.Get("Fg_Reconnect").TweenForCG();
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ ManaReso.Get("Fe_Info").TweenForCG();
|
|
|
+ ManaReso.SetText("Fe_Tit", Name);
|
|
|
+ ManaReso.SetSprite("Fe_Icon", ItemIcon.sprite);
|
|
|
+
|
|
|
+ if (ItemStatus == SkillStatus.Lock)
|
|
|
+ {
|
|
|
+ ManaReso.SetText("Fe_Lab0", "");
|
|
|
+ ManaReso.SetText("Fe_Lab1", Description(0));
|
|
|
+ ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab0"), ImageParse(UnlockAheadCur), UnlockAheadAmt));
|
|
|
+
|
|
|
+ ManaReso.SetButtonEvent
|
|
|
+ (
|
|
|
+ "Fe_Btn",
|
|
|
+ () =>
|
|
|
+ {
|
|
|
+ UnlockAhead();
|
|
|
+
|
|
|
+ ManaReso.Get("Fe_Info").TweenBacCG();
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ else if (ItemStatus == SkillStatus.UnLock)
|
|
|
+ {
|
|
|
+ ManaReso.SetText("Fe_Lab0", "");
|
|
|
+ ManaReso.SetText("Fe_Lab1", Description(0));
|
|
|
|
|
|
- if (UpgradeCur != Current.Free)
|
|
|
+ if (UnlockCur == Current.Free)
|
|
|
{
|
|
|
- ItemStatus = SkillStatus.Upgrade;
|
|
|
+ ManaReso.SetText("Fe_BtnLab", string.Format("{0}", Language.GetStr("UI", "Fe_BtnLab1")));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- throw new Exception();
|
|
|
+ ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab1"), ImageParse(UnlockCur), UnlockAmt));
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
- protected void OnClick()
|
|
|
- {
|
|
|
- if (ManaTutorial.TutorialA || ManaTutorial.TutorialB && ManaData.Level >= 200)
|
|
|
+ ManaReso.SetButtonEvent
|
|
|
+ (
|
|
|
+ "Fe_Btn",
|
|
|
+ () =>
|
|
|
+ {
|
|
|
+ Unlock();
|
|
|
+
|
|
|
+ ManaReso.Get("Fe_Info").TweenBacCG();
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ else if (ItemStatus == SkillStatus.Upgrade)
|
|
|
{
|
|
|
- TutorialClick();
|
|
|
+ ManaReso.SetText("Fe_Lab0", Description(0));
|
|
|
+ ManaReso.SetText("Fe_Lab1", Description(1));
|
|
|
+ ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), ImageParse(UpgradeCur), NewUpgradeAmt));
|
|
|
+
|
|
|
+ ManaReso.SetButtonEvent
|
|
|
+ (
|
|
|
+ "Fe_Btn",
|
|
|
+ () =>
|
|
|
+ {
|
|
|
+ Upgrade();
|
|
|
+
|
|
|
+ ItemLab.text = Description(0);
|
|
|
+
|
|
|
+ ManaReso.SetText("Fe_Tit", NameParse());
|
|
|
+ ManaReso.SetText("Fe_Lab0", Description(0));
|
|
|
+ ManaReso.SetText("Fe_Lab1", Description(1));
|
|
|
+
|
|
|
+ ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), ImageParse(UpgradeCur), NewUpgradeAmt));
|
|
|
+
|
|
|
+ ManaDebug.Log(string.Format("<color=red>{0}</color>升级 : {1}", Name, Level));
|
|
|
+ }
|
|
|
+ );
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- RegularClick();
|
|
|
+ throw new Exception();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
protected void Upgrade()
|
|
|
{
|
|
|
- if (ManaTutorial.TutorialA || (ManaTutorial.TutorialA && ManaData.Level >= 200))
|
|
|
+ if (!ManaData.Pay(NewUpgradeAmt, UpgradeCur))
|
|
|
{
|
|
|
- TutorialUpgrade();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ID == "Ability1")
|
|
|
+ {
|
|
|
+ Level += 20;
|
|
|
+ ManaData.Level += 20;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- RegularUpgrade();
|
|
|
+ Level++;
|
|
|
}
|
|
|
+
|
|
|
+ Annul();
|
|
|
+
|
|
|
+ NewUpgradeAmt = Auxiliary.FmlParse(UpgradeFml, "a", NewUpgradeAmt.ToString());
|
|
|
+ UpgradeValue(ref NewPerson, Person, UpgradePerson, 1);
|
|
|
+ UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, 1);
|
|
|
+ UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, 1);
|
|
|
+
|
|
|
+ UpgradeValue(ref NewPlus, Plus, UpgradePlus, 1);
|
|
|
+ UpgradeValue(ref NewSkillCdBuff, UpgradeCD, 1);
|
|
|
+ UpgradeValue(ref NewPersonBuff, PersonBuff, UpgradePerson, 1);
|
|
|
+
|
|
|
+ UseA();
|
|
|
+ UseC();
|
|
|
}
|
|
|
|
|
|
- protected void UseConti()
|
|
|
+ protected void UseA()
|
|
|
{
|
|
|
- if (ValidAnim == false)
|
|
|
+ if (!string.IsNullOrEmpty(Anim))
|
|
|
{
|
|
|
- if (!string.IsNullOrEmpty(Anim))
|
|
|
- {
|
|
|
- string[] strings = Anim.Split(',');
|
|
|
+ string[] strings = Anim.Split(',');
|
|
|
|
|
|
- if (strings.Length == 1)
|
|
|
- {
|
|
|
- ManaGarden.AnimList.Add((ObjType) Enum.Parse(typeof(ObjType), strings[0]));
|
|
|
- }
|
|
|
- else if (strings.Length > 1)
|
|
|
- {
|
|
|
- ManaReso.Get(strings[0], Folder.Scene, true, ManaReso.Get(strings[1]), false);
|
|
|
- }
|
|
|
+ if (strings.Length == 1)
|
|
|
+ {
|
|
|
+ ManaGarden.AnimList.Add((ObjType) Enum.Parse(typeof(ObjType), strings[0]));
|
|
|
+ }
|
|
|
+ else if (strings.Length > 1)
|
|
|
+ {
|
|
|
+ ManaReso.Get(strings[0], Folder.Scene, true, ManaReso.Get(strings[1]), false);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -316,7 +409,7 @@ public class Ability : SkillRoot
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
ManaData.Person += NewPerson;
|
|
|
ManaData.CoinPerson += NewCoinPerson;
|
|
|
|
|
@@ -347,7 +440,7 @@ public class Ability : SkillRoot
|
|
|
|
|
|
if (Math.Abs(NewPlus) > 0.0005f)
|
|
|
{
|
|
|
- strb.AppendFormat(" 收入加成<color=red>+{0}%</color>", NewPlus * 100);
|
|
|
+ strb.AppendFormat(" 收入加成<color=red>+{0}%</color>", NewPlus*100);
|
|
|
}
|
|
|
|
|
|
if (Math.Abs(NewPerson) > 0.0005f)
|
|
@@ -357,7 +450,7 @@ public class Ability : SkillRoot
|
|
|
|
|
|
if (Math.Abs(NewPersonBuff) > 0.0005f)
|
|
|
{
|
|
|
- strb.AppendFormat(" 参观人次<color=red>+{0}%</color>", NewPersonBuff * 100);
|
|
|
+ strb.AppendFormat(" 参观人次<color=red>+{0}%</color>", NewPersonBuff*100);
|
|
|
}
|
|
|
|
|
|
if (Math.Abs(NewCoinPerson) > 0.0005f)
|
|
@@ -372,7 +465,7 @@ public class Ability : SkillRoot
|
|
|
|
|
|
if (Math.Abs(SkillCdBuff) > 0.0005f)
|
|
|
{
|
|
|
- strb.AppendFormat(" 减少冷却上限<color=red>{0}%</color>", SkillCdBuff * 100);
|
|
|
+ strb.AppendFormat(" 减少冷却上限<color=red>{0}%</color>", SkillCdBuff*100);
|
|
|
}
|
|
|
|
|
|
if (!string.IsNullOrEmpty(UnlockPos))
|
|
@@ -389,367 +482,92 @@ public class Ability : SkillRoot
|
|
|
#endregion
|
|
|
}
|
|
|
|
|
|
- protected void UnlockAhead()
|
|
|
+ protected void UseB()
|
|
|
{
|
|
|
- if (ItemStatus != SkillStatus.Lock)
|
|
|
+ if (!string.IsNullOrEmpty(Anim))
|
|
|
{
|
|
|
- ManaDebug.Log("您并不需要提前解锁");
|
|
|
+ string[] strings = Anim.Split(',');
|
|
|
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (ManaData.Pay(UnlockAheadAmt, UnlockAheadCur))
|
|
|
- {
|
|
|
- ManaData.Elf++;
|
|
|
-
|
|
|
- ManaDebug.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
|
|
|
-
|
|
|
- if (UpgradeCur != Current.Free)
|
|
|
- {
|
|
|
- ItemStatus = SkillStatus.Upgrade;
|
|
|
- }
|
|
|
- else
|
|
|
+ if (strings.Length == 1)
|
|
|
{
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- private void TutorialClick()
|
|
|
- {
|
|
|
- ManaReso.Get("Fe_Info").TweenForCG();
|
|
|
- ManaReso.SetText("Fe_Tit", Name);
|
|
|
- ManaReso.SetSprite("Fe_Icon", ItemIcon.sprite);
|
|
|
-
|
|
|
- if (ItemStatus == SkillStatus.Lock)
|
|
|
- {
|
|
|
- ManaReso.SetText("Fe_Lab0", "");
|
|
|
- ManaReso.SetText("Fe_Lab1", Description(0));
|
|
|
- ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab0"), ImageParse(UnlockAheadCur), UnlockAheadAmt));
|
|
|
-
|
|
|
- ManaReso.SetButtonEvent
|
|
|
- (
|
|
|
- "Fe_Btn",
|
|
|
- () =>
|
|
|
+ if (ManaGarden.PlantList.Count == 0)
|
|
|
{
|
|
|
- UnlockAhead();
|
|
|
- ManaReso.Get("Fe_Info").TweenBacCG();
|
|
|
+ return;
|
|
|
}
|
|
|
- );
|
|
|
- }
|
|
|
- else if (ItemStatus == SkillStatus.UnLock)
|
|
|
- {
|
|
|
- ManaReso.SetText("Fe_Lab0", "");
|
|
|
- ManaReso.SetText("Fe_Lab1", Description(0));
|
|
|
- ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab1"), ImageParse(UnlockCur), UnlockAmt));
|
|
|
|
|
|
- ManaReso.SetButtonEvent
|
|
|
- (
|
|
|
- "Fe_Btn",
|
|
|
- () =>
|
|
|
- {
|
|
|
- Unlock();
|
|
|
- ManaReso.Get("Fe_Info").TweenBacCG();
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
- else if (ItemStatus == SkillStatus.Upgrade)
|
|
|
- {
|
|
|
- Tutorial.HightDisable(0, true);
|
|
|
+ Flower flower = ManaGarden.PlantList.Random().Flower;
|
|
|
|
|
|
- ManaReso.SetText("Fe_Lab0", Description(0));
|
|
|
- ManaReso.SetText("Fe_Lab1", Description(1));
|
|
|
- ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), ImageParse(UpgradeCur), NewUpgradeAmt));
|
|
|
+ flower.PlayAnim(ManaGarden.AnimList.Last(0));
|
|
|
|
|
|
- ManaReso.AddButtonEventOnetime
|
|
|
- (
|
|
|
- "Fe_Btn",
|
|
|
- () =>
|
|
|
- {
|
|
|
- TutorialUpgrade();
|
|
|
+ ManaReso.Get<Button>("F_Close").onClick.Invoke();
|
|
|
|
|
|
- ManaReso.Get("Fe_Info").TweenBacCG();
|
|
|
+ Tween tween = ManaReso.Get("F_Manage0").GetTweenVec();
|
|
|
|
|
|
- if (ManaTutorial.TutorialA)
|
|
|
- {
|
|
|
- ManaTutorial.EndStep7();
|
|
|
- }
|
|
|
- else if (ManaTutorial.TutorialB)
|
|
|
+ ManaReso.Get("MainCamera").CreateZoom2D();
|
|
|
+
|
|
|
+ tween.AddEventOnetime
|
|
|
+ (
|
|
|
+ EventType.BackwardFinish,
|
|
|
+ () =>
|
|
|
{
|
|
|
- ManaTutorial.EndStep10();
|
|
|
+ ManaReso.Get("MainCamera").Zoom2D(1.5f, 1f, 1, flower.transform.GetChild(4), Curve.EaseOutQuad);
|
|
|
}
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
- }
|
|
|
- }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ else if (strings.Length > 1)
|
|
|
+ {
|
|
|
+ ManaReso.Get<Button>("F_Close").onClick.Invoke();
|
|
|
|
|
|
- private void RegularClick()
|
|
|
- {
|
|
|
- if (ManaServer.Connect == false)
|
|
|
- {
|
|
|
- ManaReso.Get("Fg_Reconnect").TweenForCG();
|
|
|
+ Tween tween0 = ManaReso.Get(strings[0]).CreateTweenSr(0, 1, 1, true, true, Curve.EaseOutQuad, false, true);
|
|
|
|
|
|
- return;
|
|
|
- }
|
|
|
+ tween0.InOrigin = true;
|
|
|
|
|
|
- ManaReso.Get("Fe_Info").TweenForCG();
|
|
|
- ManaReso.SetText("Fe_Tit", Name);
|
|
|
- ManaReso.SetSprite("Fe_Icon", ItemIcon.sprite);
|
|
|
+ Tween tween1 = ManaReso.Get("F_Manage0").GetTweenVec();
|
|
|
|
|
|
- if (ItemStatus == SkillStatus.Lock)
|
|
|
- {
|
|
|
- ManaReso.SetText("Fe_Lab0", "");
|
|
|
- ManaReso.SetText("Fe_Lab1", Description(0));
|
|
|
- ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab0"), ImageParse(UnlockAheadCur), UnlockAheadAmt));
|
|
|
+ ManaReso.Get("MainCamera").CreateZoom2D();
|
|
|
|
|
|
- ManaReso.SetButtonEvent
|
|
|
- (
|
|
|
- "Fe_Btn",
|
|
|
- () =>
|
|
|
- {
|
|
|
- UnlockAhead();
|
|
|
- ManaReso.Get("Fe_Info").TweenBacCG();
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
- else if (ItemStatus == SkillStatus.UnLock)
|
|
|
- {
|
|
|
- ManaReso.SetText("Fe_Lab0", "");
|
|
|
- ManaReso.SetText("Fe_Lab1", Description(0));
|
|
|
- ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab1"), ImageParse(UnlockCur), UnlockAmt));
|
|
|
-
|
|
|
- ManaReso.SetButtonEvent
|
|
|
- (
|
|
|
- "Fe_Btn",
|
|
|
- () =>
|
|
|
- {
|
|
|
- Unlock();
|
|
|
- ManaReso.Get("Fe_Info").TweenBacCG();
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
- else if (ItemStatus == SkillStatus.Upgrade)
|
|
|
- {
|
|
|
- ManaReso.SetText("Fe_Lab0", Description(0));
|
|
|
- ManaReso.SetText("Fe_Lab1", Description(1));
|
|
|
- ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), ImageParse(UpgradeCur), NewUpgradeAmt));
|
|
|
-
|
|
|
- ManaReso.SetButtonEvent
|
|
|
- (
|
|
|
- "Fe_Btn",
|
|
|
- () =>
|
|
|
- {
|
|
|
- Upgrade();
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- throw new Exception();
|
|
|
+ tween1.AddEventOnetime
|
|
|
+ (
|
|
|
+ EventType.BackwardFinish,
|
|
|
+ () =>
|
|
|
+ {
|
|
|
+ tween0.StartForward();
|
|
|
+ ManaReso.Get("MainCamera").Zoom2D(3.5f, 1f, 1, ManaReso.Get(strings[0]), Curve.EaseOutQuad);
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void TutorialUpgrade()
|
|
|
+ protected void UseC()
|
|
|
{
|
|
|
- if (ID == "Ability1")
|
|
|
- {
|
|
|
- Level += 20;
|
|
|
- ManaData.Level += 20;
|
|
|
- }
|
|
|
- else
|
|
|
+ if (!string.IsNullOrEmpty(Anim))
|
|
|
{
|
|
|
- Level++;
|
|
|
- }
|
|
|
-
|
|
|
- ManaData.Elf++;
|
|
|
-
|
|
|
- Annul();
|
|
|
-
|
|
|
- NewUpgradeAmt = Auxiliary.FmlParse(UpgradeFml, "a", NewUpgradeAmt.ToString());
|
|
|
- UpgradeValue(ref NewPerson, Person, UpgradePerson, 1);
|
|
|
- UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, 1);
|
|
|
- UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, 1);
|
|
|
-
|
|
|
- UpgradeValue(ref NewPlus, Plus, UpgradePlus, 1);
|
|
|
- UpgradeValue(ref NewSkillCdBuff, UpgradeCD, 1);
|
|
|
- UpgradeValue(ref NewPersonBuff, PersonBuff, UpgradePerson, 1);
|
|
|
+ string[] strings = Anim.Split(',');
|
|
|
|
|
|
- ManaLan.Add(ItemTit, new LanStr("SkillName", ID), " ", Level.ToString());
|
|
|
-
|
|
|
- ItemLab.text = Description(0);
|
|
|
- ManaReso.SetText("Fe_Lab0", Description(0));
|
|
|
- ManaReso.SetText("Fe_Lab1", Description(1));
|
|
|
- ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), ImageParse(UpgradeCur), NewUpgradeAmt));
|
|
|
-
|
|
|
- ManaDebug.Log(string.Format("<color=red>{0}</color> 升级 : {1}", Name, Level));
|
|
|
-
|
|
|
- UseConti();
|
|
|
-
|
|
|
- if (ValidAnim == false)
|
|
|
- {
|
|
|
- ValidAnim = true;
|
|
|
-
|
|
|
- if (!string.IsNullOrEmpty(Anim))
|
|
|
+ if (strings.Length == 1)
|
|
|
{
|
|
|
- string[] strings = Anim.Split(',');
|
|
|
-
|
|
|
- if (strings.Length == 1)
|
|
|
- {
|
|
|
- if (ManaGarden.PlantList.Count == 0)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- Flower flower = ManaGarden.PlantList.Random().Flower;
|
|
|
-
|
|
|
- flower.PlayAnim(ManaGarden.AnimList.Last(0));
|
|
|
-
|
|
|
- ManaReso.Get<Button>("F_Close").onClick.Invoke();
|
|
|
-
|
|
|
- Tween tween = ManaReso.Get("F_Manage0").GetTweenVec();
|
|
|
-
|
|
|
- ManaReso.Get("MainCamera").CreateZoom2D();
|
|
|
-
|
|
|
- tween.AddEventOnetime
|
|
|
- (
|
|
|
- EventType.BackwardFinish,
|
|
|
- () =>
|
|
|
- {
|
|
|
- ManaReso.Get("MainCamera").Zoom2D(1.5f, 1f, 1, flower.transform.GetChild(4), Curve.EaseOutQuad);
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
- else if (strings.Length > 1)
|
|
|
- {
|
|
|
- ManaReso.Get<Button>("F_Close").onClick.Invoke();
|
|
|
-
|
|
|
- ManaReso.Get("MainCamera").CreateZoom2D();
|
|
|
-
|
|
|
- Tween tween0 = ManaReso.Get(strings[0]).CreateTweenSr(0, 1, 1, true, true, Curve.EaseOutQuad, false, true);
|
|
|
-
|
|
|
- tween0.InOrigin = true;
|
|
|
-
|
|
|
- Tween tween1 = ManaReso.Get("F_Manage0").GetTweenVec();
|
|
|
-
|
|
|
- tween1.AddEventOnetime
|
|
|
- (
|
|
|
- EventType.BackwardFinish,
|
|
|
- () =>
|
|
|
- {
|
|
|
- tween0.StartForward();
|
|
|
- ManaReso.Get("MainCamera").Zoom2D(3.5f, 1f, 1, ManaReso.Get(strings[0]), Curve.EaseOutQuad);
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
+ ManaData.Elf++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void RegularUpgrade()
|
|
|
+ protected void UnlockAhead()
|
|
|
{
|
|
|
- if (ManaData.Pay(NewUpgradeAmt, UpgradeCur))
|
|
|
+ if (ItemStatus != SkillStatus.Lock)
|
|
|
{
|
|
|
- if (Level == 0)
|
|
|
- {
|
|
|
- UseConti();
|
|
|
- }
|
|
|
+ ManaDebug.Log("您并不需要提前解锁");
|
|
|
|
|
|
- if (ID == "Ability1")
|
|
|
- {
|
|
|
- ManaData.Level+= 20;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Level++;
|
|
|
- }
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
+ if (ManaData.Pay(UnlockAheadAmt, UnlockAheadCur))
|
|
|
+ {
|
|
|
ManaData.Elf++;
|
|
|
|
|
|
- Annul();
|
|
|
-
|
|
|
- NewUpgradeAmt = Auxiliary.FmlParse(UpgradeFml, "a", NewUpgradeAmt.ToString());
|
|
|
- UpgradeValue(ref NewPerson, Person, UpgradePerson, 1);
|
|
|
- UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, 1);
|
|
|
- UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, 1);
|
|
|
-
|
|
|
- UpgradeValue(ref NewPlus, Plus, UpgradePlus, 1);
|
|
|
- UpgradeValue(ref NewSkillCdBuff, UpgradeCD, 1);
|
|
|
- UpgradeValue(ref NewPersonBuff, PersonBuff, UpgradePerson, 1);
|
|
|
-
|
|
|
- ManaLan.Add(ItemTit, new LanStr("SkillName", ID), " ", Level.ToString());
|
|
|
-
|
|
|
- ItemLab.text = Description(0);
|
|
|
- ManaReso.SetText("Fe_Lab0", Description(0));
|
|
|
- ManaReso.SetText("Fe_Lab1", Description(1));
|
|
|
- ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), ImageParse(UpgradeCur), NewUpgradeAmt));
|
|
|
-
|
|
|
- ManaDebug.Log(string.Format("<color=red>{0}</color> 升级 : {1}", Name, Level));
|
|
|
-
|
|
|
- UseConti();
|
|
|
-
|
|
|
- if (ValidAnim == false)
|
|
|
- {
|
|
|
- ValidAnim = true;
|
|
|
-
|
|
|
- if (!string.IsNullOrEmpty(Anim))
|
|
|
- {
|
|
|
- string[] strings = Anim.Split(',');
|
|
|
-
|
|
|
- if (strings.Length == 1)
|
|
|
- {
|
|
|
- if (ManaGarden.PlantList.Count == 0)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- Flower flower = ManaGarden.PlantList.Random().Flower;
|
|
|
-
|
|
|
- flower.PlayAnim(ManaGarden.AnimList.Last(0));
|
|
|
-
|
|
|
- ManaReso.Get<Button>("F_Close").onClick.Invoke();
|
|
|
-
|
|
|
- Tween tween = ManaReso.Get("F_Manage0").GetTweenVec();
|
|
|
-
|
|
|
- ManaReso.Get("MainCamera").CreateZoom2D();
|
|
|
-
|
|
|
- tween.AddEventOnetime
|
|
|
- (
|
|
|
- EventType.BackwardFinish,
|
|
|
- () =>
|
|
|
- {
|
|
|
- ManaReso.Get("MainCamera").Zoom2D(1.5f, 1f, 1, flower.transform.GetChild(4), Curve.EaseOutQuad);
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
- else if (strings.Length > 1)
|
|
|
- {
|
|
|
- ManaReso.Get<Button>("F_Close").onClick.Invoke();
|
|
|
-
|
|
|
- Tween tween0 = ManaReso.Get(strings[0]).CreateTweenSr(0, 1, 1, true, true, Curve.EaseOutQuad, false, true);
|
|
|
-
|
|
|
- tween0.InOrigin = true;
|
|
|
-
|
|
|
- Tween tween1 = ManaReso.Get("F_Manage0").GetTweenVec();
|
|
|
-
|
|
|
- ManaReso.Get("MainCamera").CreateZoom2D();
|
|
|
+ ManaDebug.Log(string.Format("技能<color=red>{0}</color>已解锁", Name));
|
|
|
|
|
|
- tween1.AddEventOnetime
|
|
|
- (
|
|
|
- EventType.BackwardFinish,
|
|
|
- () =>
|
|
|
- {
|
|
|
- tween0.StartForward();
|
|
|
- ManaReso.Get("MainCamera").Zoom2D(3.5f, 1f, 1, ManaReso.Get(strings[0]), Curve.EaseOutQuad);
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ ItemStatus = SkillStatus.Upgrade;
|
|
|
}
|
|
|
}
|
|
|
|