Ability.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System;
  4. using System.Xml;
  5. using System.Text;
  6. using System.Collections;
  7. using System.Collections.Generic;
  8. using Random = UnityEngine.Random;
  9. public class Ability : SkillRoot
  10. {
  11. #region 变量
  12. #region 配置
  13. public float UnlockAheadAmt
  14. {
  15. get { return UnlockAheadBaseAmt + (UnlockLv - ManaCenter.Level - 1)*UnlockAheadDeltaAmt; }
  16. }
  17. public override string ID
  18. {
  19. get { return "Ability" + ID_; }
  20. }
  21. public float Person;
  22. public float SkillCD;
  23. public float CoinPerson;
  24. public double UpgradeAmt;
  25. public float Plus;
  26. public float PersonBuff;
  27. public float SkillCdBuff;
  28. public int UnlockLv;
  29. public float UnlockAmt;
  30. public float UnlockAheadBaseAmt;
  31. public float UnlockAheadDeltaAmt;
  32. public string UnlockPos;
  33. public Current UnlockCur;
  34. public Current UpgradeCur;
  35. public Current UnlockAheadCur;
  36. public string Label;
  37. public string Anim;
  38. public string UpgradeCD;
  39. public string UpgradeFml;
  40. public string UpgradePlus;
  41. public string UpgradePerson;
  42. #endregion
  43. public bool ElfLock = true;
  44. public string Elf;
  45. public string Item;
  46. public float NewPlus;
  47. public float NewPerson;
  48. public float NewSkillCD;
  49. public float NewSkillCdBuff;
  50. public float NewPersonBuff;
  51. public float NewCoinPerson;
  52. public double NewUpgradeAmt;
  53. public override SkillStatus ItemStatus
  54. {
  55. get { return ItemStatus_; }
  56. set
  57. {
  58. ItemStatus_ = value;
  59. if (ItemStatus_ == SkillStatus.Lock)
  60. {
  61. if (UnlockAheadCur == Current.Free)
  62. {
  63. ItemBtn.interactable = false;
  64. ManaLan.Add(ItemBtnLab, new LanStr("UI", "Fe_BtnLab1"), "\n", new LanStr("UI", "Fe_BtnLab4"), UnlockLv.ToString());
  65. }
  66. else
  67. {
  68. ItemBtn.interactable = true;
  69. ManaLan.Add(ItemBtnLab, new LanStr("UI", "Fe_BtnLab0"), "\n", new LanStr("UI", "Fe_BtnLab4"), UnlockLv.ToString());
  70. }
  71. }
  72. else if (ItemStatus_ == SkillStatus.UnLock)
  73. {
  74. ItemBtn.interactable = true;
  75. ItemBtnLab.text = Language.GetStr("UI", "Fe_BtnLab1") + "\n" + Auxiliary.ImageParse(UnlockCur) + Auxiliary.ShrinkNumberStr(UnlockAmt);
  76. }
  77. else if (ItemStatus_ == SkillStatus.Upgrade)
  78. {
  79. ItemBtn.interactable = true;
  80. ItemBtnLab.text = Language.GetStr("UI", "Fe_BtnLab2") + "\n" + Auxiliary.ImageParse(UpgradeCur) + Auxiliary.ShrinkNumberStr(NewUpgradeAmt);
  81. }
  82. }
  83. }
  84. #endregion
  85. public Ability(XmlAttributeCollection attribute)
  86. {
  87. #region 配置
  88. ID_ = int.Parse(attribute[0].Value);
  89. Icon_ = attribute[21].Value;
  90. Anim = attribute[22].Value;
  91. Label = attribute[23].Value;
  92. UnlockPos = attribute[13].Value;
  93. UpgradeCD = attribute[19].Value;
  94. UpgradeFml = attribute[16].Value;
  95. UpgradePlus = attribute[17].Value;
  96. UpgradePerson = attribute[18].Value;
  97. UnlockLv = Auxiliary.IntParse(attribute[7].Value,0);
  98. ItemIndex = Auxiliary.IntParse(attribute[3].Value,0);
  99. UnlockAmt = Auxiliary.FloatParse(attribute[12].Value,0);
  100. UnlockAheadBaseAmt = Auxiliary.FloatParse(attribute[10].Value,0);
  101. UnlockAheadDeltaAmt = Auxiliary.FloatParse(attribute[9].Value, 0);
  102. SkillTab = SkillClassParse(attribute[2].Value);
  103. UpgradeAmt = UpgradeAmtParse(attribute[15].Value);
  104. UnlockCur = Auxiliary.CurrentParse(attribute[11].Value);
  105. UpgradeCur = Auxiliary.CurrentParse(attribute[14].Value);
  106. UnlockAheadCur = Auxiliary.CurrentParse(attribute[8].Value);
  107. ValueBuffParse(out Person, out PersonBuff, attribute[5].Value);
  108. ValueBuffParse(out SkillCD, out SkillCdBuff, attribute[6].Value);
  109. ValueBuffParse(out CoinPerson, out Plus, attribute[4].Value);
  110. #endregion
  111. SkillType = SkillType.Ability;
  112. }
  113. public void UnlockTab()
  114. {
  115. ManaReso.Get<Graphic>("F_Elf").material = null;
  116. ManaReso.Get<Graphic>("F_Store").material = null;
  117. ManaReso.Get<Graphic>("F_Magic").material = null;
  118. ManaReso.Get<Graphic>("F_ElfLab").material = null;
  119. ManaReso.Get<Graphic>("F_StoreLab").material = null;
  120. ManaReso.Get<Graphic>("F_MagicLab").material = null;
  121. ManaReso.Get<Button>("F_Elf").interactable = true;
  122. ManaReso.Get<Button>("F_Store").interactable = true;
  123. ManaReso.Get<Button>("F_Magic").interactable = true;
  124. }
  125. public override void Reactive()
  126. {
  127. //if (Level > 0)
  128. //{
  129. // AnnulA();
  130. // AnnulB();
  131. //}
  132. }
  133. public override void RegistValue(bool firstRegist, float elapse, List<List<Skill>> useList, XmlAttributeCollection attribute)
  134. {
  135. if (!firstRegist)
  136. {
  137. return;
  138. }
  139. Level = int.Parse(attribute[3].Value);
  140. ItemStatus_ = (SkillStatus)Enum.Parse(typeof(SkillStatus), attribute[2].Value);
  141. NewPlus = Plus;
  142. NewPerson = Person;
  143. NewSkillCD = SkillCD;
  144. NewSkillCdBuff = SkillCdBuff;
  145. NewPersonBuff = PersonBuff;
  146. NewCoinPerson = CoinPerson;
  147. NewUpgradeAmt = UpgradeAmt;
  148. if (ID == "Ability1")
  149. {
  150. ManaCenter.Level = Level;
  151. if (Level > 0)
  152. {
  153. UnlockTab();
  154. }
  155. }
  156. if (ItemStatus_ == SkillStatus.Lock || ItemStatus_ == SkillStatus.UnLock)
  157. {
  158. ItemIcon.material = Lib.GrayMat;
  159. }
  160. else
  161. {
  162. ItemIcon.material = null;
  163. }
  164. if (ItemStatus_ == SkillStatus.Upgrade)
  165. {
  166. for (int i = 0; i < Level - 1; i++)
  167. {
  168. NewUpgradeAmt = Auxiliary.FmlParse(UpgradeFml, "a", NewUpgradeAmt.ToString("0.00"));
  169. }
  170. UpgradeValue(ref NewPlus, UpgradePlus, Level - 1);
  171. UpgradeValue(ref NewPersonBuff, UpgradePerson, Level - 1);
  172. UpgradeSkillCdBuff(ref NewSkillCdBuff, UpgradeCD, Level - 1);
  173. UpgradeValue(ref NewPerson, Person, UpgradePerson, Level - 1);
  174. UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, Level - 1);
  175. UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, Level - 1);
  176. UseA();
  177. UseC();
  178. }
  179. else if (ItemStatus_ == SkillStatus.UnLock)
  180. {
  181. ManaUI.UpdateHint();
  182. }
  183. ItemStatus = ItemStatus;
  184. ItemBtn.onClick.RemoveAllListeners();
  185. ItemBtn.onClick.AddListener(OnClick);
  186. ItemLab.text = GetDescription(0);
  187. }
  188. public override void SwitchLanguage()
  189. {
  190. base.SwitchLanguage();
  191. ItemStatus = ItemStatus;
  192. }
  193. protected void UseA()
  194. {
  195. if (ElfLock)
  196. {
  197. ElfLock = false;
  198. if (!string.IsNullOrEmpty(Anim))
  199. {
  200. if (Anim.Contains("Elf"))
  201. {
  202. string[] strings = Anim.Split(',');
  203. for (int i = 1; i < strings.Length; i++)
  204. {
  205. ManaGarden.ElfList.Add(strings[i].ToEnum<ElfType>());
  206. }
  207. Elf = strings[1];
  208. }
  209. else if (Anim.Contains("Item"))
  210. {
  211. string[] strings = Anim.Split(',');
  212. for (int i = 1; i < strings.Length; i++)
  213. {
  214. ManaReso.Get(strings[i]).TweenForSr();
  215. }
  216. Item = strings[1];
  217. }
  218. }
  219. }
  220. ManaCenter.Person += NewPerson;
  221. ManaCenter.CoinPerson += NewCoinPerson;
  222. ManaCenter.SkillPlus += NewPlus;
  223. ManaCenter.SkillPersonBuff += NewPersonBuff;
  224. if (!NewSkillCD.Equal(0))
  225. {
  226. for (int i = 0; i < ManaCenter.SkillList.Count; i++)
  227. {
  228. ManaCenter.SkillList[i].ReceiveCool(NewSkillCD, false, false);
  229. }
  230. }
  231. if (!NewSkillCdBuff.Equal(0))
  232. {
  233. for (int i = 0; i < ManaCenter.SkillList.Count; i++)
  234. {
  235. ManaCenter.SkillList[i].ReceiveCool(NewSkillCdBuff, false, true);
  236. }
  237. }
  238. }
  239. protected void UseB()
  240. {
  241. if (!string.IsNullOrEmpty(Elf))
  242. {
  243. ManaCenter.ElfLevel++;
  244. }
  245. }
  246. protected void UseC()
  247. {
  248. for (int i = 0; i < Auxiliary.IntParse(UnlockPos, 0); i++)
  249. {
  250. ManaGarden.UnlockSlot();
  251. }
  252. }
  253. protected void Zoom()
  254. {
  255. if (!string.IsNullOrEmpty(Elf))
  256. {
  257. if (ManaGarden.PlantList.Count <= Garden.CurPage * 9)
  258. {
  259. return;
  260. }
  261. ManaGarden.ElfTimer = Random.Range(5f, 30f);
  262. Slot zoomSlot = ManaGarden.PlantList.Random(1, false, false, slot => { return slot.Index >= Garden.CurPage*9; })[0];
  263. if (zoomSlot.Index%9 == 4)
  264. {
  265. return;
  266. }
  267. Flower flower = zoomSlot.Flower;
  268. flower.GetElf(ManaGarden.ElfList.Back(0), 0, 0, 0, 0);
  269. ManaReso.Get("Fe_Info").TweenBacCG();
  270. ManaReso.Get("F_Manage").TweenBacGra();
  271. TweenRoot tween = ManaReso.Get("F_Manage0").GetTweenVec();
  272. tween.AddEventOnetime
  273. (
  274. EventType.BackwardFinish,
  275. () =>
  276. {
  277. ManaReso.Get("MainCamera").Zoom2D(1.5f, 3f, 1, flower.ElfList.Back(0), Curve.EaseOutQuad);
  278. }
  279. );
  280. }
  281. else if (!string.IsNullOrEmpty(Item))
  282. {
  283. TweenRoot tween = ManaReso.Get(Item).GetTweenSr();
  284. Vector3 pos = ManaReso.Get(Item).position;
  285. pos.z = -2;
  286. tween.AddEventOnetime
  287. (
  288. EventType.ForwardFinish,
  289. () =>
  290. {
  291. ManaReso.GetFirework(pos);
  292. }
  293. );
  294. ManaReso.Get("Fe_Info").TweenBacCG();
  295. ManaReso.Get("F_Manage").TweenBacGra();
  296. tween = ManaReso.Get("F_Manage0").GetTweenVec();
  297. tween.AddEventOnetime
  298. (
  299. EventType.BackwardFinish,
  300. () =>
  301. {
  302. ManaReso.Get("MainCamera").Zoom2D(3.5f, 3f, 1, ManaReso.Get(Item), Curve.EaseOutQuad);
  303. }
  304. );
  305. }
  306. }
  307. protected void Unlock()
  308. {
  309. ManaCenter.Pay
  310. (
  311. ID,
  312. UnlockAmt,
  313. UnlockCur,
  314. () =>
  315. {
  316. ManaAudio.PlayClip(Clip.SkillClip);
  317. ItemIcon.material = null;
  318. ItemStatus = SkillStatus.Upgrade;
  319. if (UnlockCur != Current.Free)
  320. {
  321. ManaUI.UpdateHint();
  322. }
  323. Level = 1;
  324. UseA();
  325. UseB();
  326. UseC();
  327. Zoom();
  328. if (ID == "Ability1")
  329. {
  330. ManaCenter.Level = 1;
  331. UnlockTab();
  332. }
  333. },
  334. StaticsManager.ItemID.解锁技能,
  335. StaticsManager.ConsumeModule.Shop
  336. );
  337. }
  338. protected void OnClick()
  339. {
  340. ManaAudio.PlayClip(Clip.BtnClip);
  341. ManaReso.Get("Fe_Info").TweenForCG();
  342. ManaReso.SetText("Fe_Tit", Name);
  343. ManaReso.SetSprite("Fe_Icon", Icon);
  344. if (ItemStatus == SkillStatus.Lock)
  345. {
  346. ManaReso.SetText("Fe_Lab0", "");
  347. ManaReso.SetText("Fe_Lab1", GetDescription(0));
  348. ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab0"), Auxiliary.ImageParse(UnlockAheadCur), UnlockAheadAmt.ToString("0")));
  349. ManaReso.SetButtonEvent
  350. (
  351. "Fe_Btn",
  352. () =>
  353. {
  354. UnlockAhead();
  355. ManaReso.Get("Fe_Info").TweenBacCG();
  356. }
  357. );
  358. }
  359. else if (ItemStatus == SkillStatus.UnLock)
  360. {
  361. ManaReso.SetText("Fe_Lab0", "");
  362. ManaReso.SetText("Fe_Lab1", GetDescription(0));
  363. ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab1"), Auxiliary.ImageParse(UnlockCur), UnlockAmt.ToString("0")));
  364. ManaReso.SetButtonEvent
  365. (
  366. "Fe_Btn",
  367. () =>
  368. {
  369. Unlock();
  370. ManaReso.Get("Fe_Info").TweenBacCG();
  371. }
  372. );
  373. }
  374. else if (ItemStatus == SkillStatus.Upgrade)
  375. {
  376. ManaReso.SetText("Fe_Lab0", GetDescription(0));
  377. ManaReso.SetText("Fe_Lab1", GetDescription(1));
  378. ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), Auxiliary.ImageParse(UpgradeCur), Auxiliary.ShrinkNumberStr(NewUpgradeAmt)));
  379. ManaReso.SetButtonEvent
  380. (
  381. "Fe_Btn",
  382. () =>
  383. {
  384. Upgrade();
  385. ItemLab.text = GetDescription(0);
  386. ItemBtnLab.text = Language.GetStr("UI", "Fe_BtnLab2") + "\n" + Auxiliary.ImageParse(UpgradeCur) + Auxiliary.ShrinkNumberStr(NewUpgradeAmt);
  387. ManaReso.SetText("Fe_Tit", Name);
  388. ManaReso.SetText("Fe_Lab0", GetDescription(0));
  389. ManaReso.SetText("Fe_Lab1", GetDescription(1));
  390. ManaReso.SetText("Fe_BtnLab", string.Format("{0}({1}{2:0})", Language.GetStr("UI", "Fe_BtnLab2"), Auxiliary.ImageParse(UpgradeCur), Auxiliary.ShrinkNumberStr(NewUpgradeAmt)));
  391. }
  392. );
  393. }
  394. }
  395. protected void Upgrade()
  396. {
  397. ManaCenter.Pay
  398. (
  399. ID,
  400. NewUpgradeAmt,
  401. UpgradeCur,
  402. () =>
  403. {
  404. ManaAudio.PlayClip(Clip.SkillClip);
  405. Level++;
  406. AnnulA();
  407. NewUpgradeAmt = Auxiliary.FmlParse(UpgradeFml, "a", NewUpgradeAmt.ToString("0.00"));
  408. UpgradeValue(ref NewPlus, UpgradePlus, 1);
  409. UpgradeValue(ref NewPersonBuff, UpgradePerson, 1);
  410. UpgradeSkillCdBuff(ref NewSkillCdBuff, UpgradeCD, 1);
  411. UpgradeValue(ref NewPerson, Person, UpgradePerson, 1);
  412. UpgradeValue(ref NewSkillCD, SkillCD, UpgradeCD, 1);
  413. UpgradeValue(ref NewCoinPerson, CoinPerson, UpgradePlus, 1);
  414. UseA();
  415. UseB();
  416. if (ID == "Ability1")
  417. {
  418. ManaCenter.Level++;
  419. }
  420. },
  421. StaticsManager.ItemID.升级技能,
  422. StaticsManager.ConsumeModule.Shop
  423. );
  424. }
  425. protected void UnlockAhead()
  426. {
  427. ManaCenter.Pay
  428. (
  429. ID,
  430. UnlockAheadAmt,
  431. UnlockAheadCur,
  432. () =>
  433. {
  434. ManaAudio.PlayClip(Clip.SkillClip);
  435. if (UnlockCur == Current.Free)
  436. {
  437. Unlock();
  438. }
  439. else
  440. {
  441. ItemStatus = SkillStatus.UnLock;
  442. }
  443. },
  444. StaticsManager.ItemID.提前解锁技能,
  445. StaticsManager.ConsumeModule.Shop
  446. );
  447. }
  448. public virtual void AnnulB()
  449. {
  450. //for (int i = 0; i < Auxiliary.IntParse(UnlockPos, 0); i++)
  451. //{
  452. // ManaGarden.LockSlot();
  453. //}
  454. }
  455. public override void AnnulA()
  456. {
  457. ManaCenter.Person -= NewPerson;
  458. ManaCenter.CoinPerson -= NewCoinPerson;
  459. ManaCenter.SkillPlus -= NewPlus;
  460. ManaCenter.SkillPersonBuff -= NewPersonBuff;
  461. if (Math.Abs(NewSkillCD) > 0.0005f)
  462. {
  463. for (int i = 0; i < ManaCenter.SkillList.Count; i++)
  464. {
  465. ManaCenter.SkillList[i].ReceiveCool(-NewSkillCD, false, false);
  466. }
  467. }
  468. if (Math.Abs(NewSkillCdBuff) > 0.0005f)
  469. {
  470. for (int i = 0; i < ManaCenter.SkillList.Count; i++)
  471. {
  472. ManaCenter.SkillList[i].ReceiveCool(-NewSkillCdBuff, false, true);
  473. }
  474. }
  475. }
  476. public override void UpdateStatus()
  477. {
  478. if (!ManaCenter.Complete)
  479. {
  480. return;
  481. }
  482. if (ManaCenter.Level >= UnlockLv)
  483. {
  484. if (ItemStatus == SkillStatus.Lock)
  485. {
  486. if (UnlockCur == Current.Free)
  487. {
  488. Unlock();
  489. }
  490. else
  491. {
  492. ItemStatus = SkillStatus.UnLock;
  493. ManaUI.UpdateHint();
  494. }
  495. }
  496. }
  497. }
  498. #region 解读器
  499. protected double UpgradeAmtParse(string str)
  500. {
  501. if (string.IsNullOrEmpty(str))
  502. {
  503. return UnlockAmt;
  504. }
  505. else
  506. {
  507. return double.Parse(str);
  508. }
  509. }
  510. protected override string GetDescription(int offset)
  511. {
  512. float temp;
  513. string[] strings = Desc.Split('[', ']');
  514. StringBuilder stringBuilder = new StringBuilder();
  515. for (int i = 0; i < strings.Length; i++)
  516. {
  517. if (strings[i].Contains("lv"))
  518. {
  519. }
  520. else if (strings[i].Contains("&person&"))
  521. {
  522. #region MyRegion
  523. if (!Person.Equal(0))
  524. {
  525. temp = NewPerson;
  526. UpgradeValue(ref temp, Person, UpgradePerson, offset);
  527. UpgradeUnit(ref temp, strings[i]);
  528. float remainder = temp % 1;
  529. if (remainder > 0)
  530. {
  531. stringBuilder.Append(temp.ToString("0") + "+");
  532. }
  533. else
  534. {
  535. stringBuilder.Append(temp.ToString("0"));
  536. }
  537. }
  538. else if (!PersonBuff.Equal(0))
  539. {
  540. temp = NewPersonBuff;
  541. UpgradeValue(ref temp, UpgradePerson, offset);
  542. stringBuilder.Append(string.Format("{0:0}%", temp * 100));
  543. }
  544. #endregion
  545. }
  546. else if (strings[i].Contains("&skill_cd&"))
  547. {
  548. #region MyRegion
  549. if (!SkillCD.Equal(0))
  550. {
  551. temp = NewSkillCD;
  552. UpgradeValue(ref temp, SkillCD, UpgradeCD, offset);
  553. UpgradeUnit(ref temp, strings[i]);
  554. stringBuilder.Append(temp.ToString("0"));
  555. }
  556. else if (!SkillCdBuff.Equal(0))
  557. {
  558. temp = NewSkillCdBuff;
  559. UpgradeSkillCdBuff(ref temp, UpgradeCD, offset);
  560. stringBuilder.Append(string.Format("{0:0}%", temp * 100));
  561. }
  562. #endregion
  563. }
  564. else if (strings[i].Contains("&coin_person&"))
  565. {
  566. #region MyRegion
  567. if (!CoinPerson.Equal(0))
  568. {
  569. temp = NewCoinPerson;
  570. UpgradeValue(ref temp, CoinPerson, UpgradePlus, offset);
  571. UpgradeUnit(ref temp, strings[i]);
  572. float remainder = temp % 1;
  573. if (remainder > 0)
  574. {
  575. stringBuilder.Append(temp.ToString("0") + "+");
  576. }
  577. else
  578. {
  579. stringBuilder.Append(temp.ToString("0"));
  580. }
  581. }
  582. else if (!Plus.Equal(0))
  583. {
  584. temp = NewPlus;
  585. UpgradeValue(ref temp, UpgradePlus, offset);
  586. stringBuilder.Append(string.Format("{0:0}%", temp * 100));
  587. }
  588. #endregion
  589. }
  590. else
  591. {
  592. stringBuilder.Append(strings[i]);
  593. }
  594. }
  595. return stringBuilder.ToString();
  596. }
  597. #endregion
  598. }