GameManager.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. using cfg;
  2. using SimpleJSON;
  3. using Sirenix.OdinInspector;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.IO;
  7. using TMPro;
  8. using UnityEngine;
  9. using UnityEngine.UI;
  10. public enum AttributeTag
  11. {
  12. [LabelText("飞行")] Flying = 1,
  13. [LabelText("风")] Wind = 2,
  14. [LabelText("水")] Water = 3,
  15. [LabelText("岩")] Earth = 4,
  16. [LabelText("地面")] Ground = 5,
  17. [LabelText("雷")] Lightning = 6,
  18. [LabelText("火")] Fire = 7,
  19. [LabelText("木")] Nature = 8,
  20. }
  21. public enum SoldierType
  22. {
  23. Conduct,
  24. [LabelText("飞剑")] sword = 0,
  25. [LabelText("胖子")] shield = 1,
  26. [LabelText("林冲")] spear = 2,
  27. [LabelText("阴灵")] Spirits = 3,
  28. }
  29. public enum GameType
  30. {
  31. Gaming,
  32. GameEnd,
  33. Shop,
  34. }
  35. public enum TargetType
  36. {
  37. None = 0,
  38. Demonic = 1,
  39. Tower = 2,
  40. Player = 3,
  41. Enemy = 4,
  42. EnemyTower = 5,
  43. Boss = 6,
  44. Portal = 7,
  45. }
  46. public class GameManager : MonoBehaviour
  47. {
  48. public static GameManager instance;
  49. [FoldoutGroup("组件", order: -1)] public UIHP p1uiHP;
  50. [FoldoutGroup("组件")] public UIHP p1uiMP;
  51. [FoldoutGroup("组件")] public Transform p1uiRush;
  52. [FoldoutGroup("组件")] public GameObject[] demonicNum;
  53. [FoldoutGroup("组件")] public TextMeshProUGUI text;
  54. [FoldoutGroup("组件")] public GameObject chapterBG; //当前关卡的原始背景(用于和boss背景做替换)
  55. [FoldoutGroup("组件")] public GameObject shopButton;
  56. [FoldoutGroup("组件")] public ShopUI shopUI;
  57. [FoldoutGroup("组件")] public TextMeshProUGUI moneyText;
  58. [FoldoutGroup("组件")] public PlayerController player;
  59. [FoldoutGroup("金币结算", order: -1)][LabelText("限制时间")] public int rewardTime;
  60. [FoldoutGroup("金币结算")][LabelText("金币奖励")] public int totalMoney;
  61. [FoldoutGroup("金币结算")][LabelText("额外金币奖励")] public int extraMoney;
  62. [FoldoutGroup("金币结算")][LabelText("惩罚时间间隔")] public int deductMoneyTime;
  63. [FoldoutGroup("金币结算")][LabelText("每次惩罚扣除金币数量")] public int deductMoney;
  64. [Header("金币掉落")]
  65. [FoldoutGroup("金币结算")][LabelText("怪物掉落金币数量")] public int enemyGoldDrop;
  66. [FoldoutGroup("金币结算")][LabelText("金币掉落特效")] public GameObject dropGoldFX;
  67. [FoldoutGroup("金币结算")][LabelText("金币掉落字体")] public GameObject dropGoldText;
  68. [FoldoutGroup("标签")]
  69. [FoldoutGroup("标签")] [LabelText("单属性解锁阈值")] public int singleAttributeUnlockThreshold = 5;
  70. [FoldoutGroup("标签")] [LabelText("双属性解锁阈值")] public int dualAttributeUnlockThreshold = 10;
  71. [FoldoutGroup("标签/火")] [LabelText("是否启用")] public bool isFireEnable = false;
  72. [FoldoutGroup("标签/火")] [LabelText("触发概率")] [PropertyRange(0, 100)] public int fireProbability = 100;
  73. [FoldoutGroup("标签/火")] [LabelText("灼烧伤害时间间隔")] public float fireInterval = 0.5f;
  74. [FoldoutGroup("标签/火")] [LabelText("每层基础灼烧伤害")] public int fireDamage = 1;
  75. [FoldoutGroup("标签/火")] [LabelText("灼烧效果持续时间")] public float fireBuffTime;
  76. [FoldoutGroup("标签/火")] [LabelText("标签作用比值")] public float fireLabelEffectRatio;
  77. [FoldoutGroup("标签/冰")] [LabelText("是否启用")] public bool isIceEnable = false;
  78. [FoldoutGroup("标签/冰")] [LabelText("触发概率")] [PropertyRange(0, 100)] public int iceProbability = 100;
  79. [FoldoutGroup("标签/冰")] [LabelText("冰冻时间")] public float frozenTime = 3;
  80. [FoldoutGroup("标签/冰")] [LabelText("标签作用比值")] public float iceLabelEffectRatio;
  81. [FoldoutGroup("标签/火冰")] [LabelText("是否启用")] public bool isFireIceEnable = false;
  82. [FoldoutGroup("标签/火冰")] [LabelText("触发概率")] [PropertyRange(0, 100)] public int fireIceProbability = 100;
  83. [FoldoutGroup("标签/火冰")] [LabelText("爆炸伤害")] public int explosionDamage = 8;
  84. [FoldoutGroup("标签/火冰")] [LabelText("标签作用比值")] public float fireIceLabelEffectRatio;
  85. [FoldoutGroup("标签/雷")] [LabelText("是否启用")] public bool isThunderEnable = false;
  86. [FoldoutGroup("标签/雷")] [LabelText("触发概率")] [PropertyRange(0, 100)] public int thunderProbability = 100;
  87. [FoldoutGroup("标签/雷")] [LabelText("感电移速比值")] [PropertyRange(0, 1)] public float moveSpeedScale = 0.6f;
  88. [FoldoutGroup("标签/雷")] [LabelText("感电攻速比值")] [PropertyRange(0, 1)] public float attackSpeedScale = 0.6f;
  89. [FoldoutGroup("标签/雷")] [LabelText("易伤比值")] [PropertyRange(0, 2)] public float vulnerableRate = 0.5f;
  90. [FoldoutGroup("标签/雷")] [LabelText("伤害")] public int thunderDamage =3;
  91. [FoldoutGroup("标签/雷")] [LabelText("感电效果时间")] public float electrifyTime;
  92. [FoldoutGroup("标签/雷")] [LabelText("标签作用比值")] public float thunderLabelEffectRatio;
  93. [FoldoutGroup("标签/风")] [LabelText("是否启用")] public bool isWindEnable = false;
  94. [FoldoutGroup("标签/风")] [LabelText("触发概率")] [PropertyRange(0, 100)] public int windProbability = 100;
  95. [FoldoutGroup("标签/风")] [LabelText("对地面敌人的击飞力度")] public float forceToGround = 80f;
  96. [FoldoutGroup("标签/风")] [LabelText("落地伤害比率")] public float landingDamageRate = 1f;
  97. [FoldoutGroup("标签/风")] [LabelText("对飞行敌人的水平力度")] public float forceToFly = 80f;
  98. [FoldoutGroup("标签/风")] [LabelText("标签作用比值")] public float windLabelEffectRatio;
  99. [FoldoutGroup("标签/风雷")] [LabelText("是否启用")] public bool isWindThunderEnable = false;
  100. [FoldoutGroup("标签/风雷")] [LabelText("触发概率")] [PropertyRange(0, 100)] public int windThunderProbability = 100;
  101. [FoldoutGroup("标签/风雷")] [LabelText("落雷伤害")] [PropertyRange(0, 100)] public int thunderboltDamage = 8;
  102. [FoldoutGroup("标签/风雷")] [LabelText("标签作用比值")] public float windThunderLabelEffectRatio;
  103. [FoldoutGroup("标签/木")] [LabelText("是否启用")] public bool isWoodEnable = false;
  104. [FoldoutGroup("标签/木")] [LabelText("触发概率")] [PropertyRange(0, 100)] public int woodProbability = 100;
  105. [FoldoutGroup("标签/木")] [LabelText("标签作用比值")] public float woodLabelEffectRatio;
  106. [FoldoutGroup("标签/岩")] [LabelText("是否启用")] public bool isRockEnable = false;
  107. [FoldoutGroup("标签/岩")] [LabelText("触发概率")] [PropertyRange(0, 100)] public int rockProbability = 100;
  108. [FoldoutGroup("标签/岩")] [LabelText("石像预制体")] public GameObject stoneStatuePrefab;
  109. [FoldoutGroup("标签/岩")] [LabelText("标签作用比值")] public float rockLabelEffectRatio;
  110. [FoldoutGroup("标签/木岩")] [LabelText("是否启用")] public bool isWoodRockEnable = false;
  111. [FoldoutGroup("标签/木岩")] [LabelText("触发概率")] [PropertyRange(0, 100)] public int woodRockProbability = 100;
  112. [FoldoutGroup("标签/木岩")] [LabelText("标签作用比值")] public float woodRockLabelEffectRatio;
  113. [FoldoutGroup("标签/天")] [LabelText("是否启用")] public bool isSkyEnable = false;
  114. [FoldoutGroup("标签/天")] [LabelText("每个兵提供的攻击buff比率")] public float attackRate = 0.01f;
  115. [FoldoutGroup("标签/天")] [LabelText("标签作用比值")] public float skyLabelEffectRatio;
  116. [FoldoutGroup("标签/地")] [LabelText("是否启用")] public bool isGroundEnable = false;
  117. [FoldoutGroup("标签/地")] [LabelText("每个兵提供的血量buff比率")] public float hpRate = 0.01f;
  118. [FoldoutGroup("标签/地")] [LabelText("标签作用比值")] public float groundLabelEffectRatio;
  119. [FoldoutGroup("标签/天地")] [LabelText("是否启用")] public bool isSkyGroundIceEnable = false;
  120. [FoldoutGroup("标签/天地")] [LabelText("触发概率")] [PropertyRange(0, 100)] public int skyGroundProbability = 100;
  121. [FoldoutGroup("标签/天地")] [LabelText("标签作用比值")] public float skyGroundLabelEffectRatio;
  122. [Header("商店刷新")]
  123. [ValidateInput("CheckTagWeight","标签池子概率总和不是100%")]
  124. [FoldoutGroup("Rogue")] [LabelText("标签池子比重(%)")] [Tooltip("最高标签池;标签池;公共池")] public List<float> tagWeight;
  125. public static readonly Dictionary<string, TargetType> TagToTargetTypeMap = new Dictionary<string, TargetType>(StringComparer.Ordinal);
  126. public bool CheckTagWeight(List<float> weights)
  127. {
  128. float num = 0;
  129. for(int i = 0; i < 3; i++)
  130. {
  131. num += weights[i];
  132. }
  133. if(num == 100)
  134. {
  135. return true;
  136. }
  137. else
  138. {
  139. return false;
  140. }
  141. }
  142. [FoldoutGroup("Rogue")] [LabelText("第几关开始出现(%)")] public List<int> unlockLevel;
  143. [FoldoutGroup("Rogue")] [LabelText("基础几率(%)")] public List<float> baseChance;
  144. [FoldoutGroup("Rogue")] [LabelText("每关增加的几率(%)")] public List<float> chanceIncreasePerLevel;
  145. [FoldoutGroup("Rogue")] [LabelText("最大几率(%)")] public List<float> maximumChance ;
  146. [FoldoutGroup("Rogue")] public List<List<List<SingleTreasureConfig>>> treasuresList;
  147. [FoldoutGroup("Rogue")] [DisplayOnly] public List<float> trueRefreshChance;
  148. [FoldoutGroup("Rogue")] [HideInInspector] public List<float> refreshChance;
  149. [FoldoutGroup("Rogue")] [LabelText("行军式加成倍率")] public float damageRate;
  150. [Header("数值加成")]
  151. [FoldoutGroup("Rogue")] [LabelText("伤害倍率")] public float damageScale;
  152. [FoldoutGroup("Rogue")] [LabelText("伤害")] public int damage;
  153. [FoldoutGroup("Rogue")] [LabelText("暴击率")] public int criticalChance;
  154. [FoldoutGroup("Rogue")] [LabelText("回血")] public int regeneration;
  155. [FoldoutGroup("Rogue")] [LabelText("吸血")] public int lifesteal;
  156. [FoldoutGroup("Rogue")] [LabelText("护甲")] public int armor;
  157. [FoldoutGroup("Rogue")] [LabelText("闪避")] public int dodge;
  158. [FoldoutGroup("Rogue")] [LabelText("血量上限")] public int totalHp;
  159. [FoldoutGroup("Rogue")] [LabelText("金币获得增加")] public int increasedGoldGain;
  160. [FoldoutGroup("Rogue")] [LabelText("经验获得增加")] public int increasedEXPGain;
  161. [FoldoutGroup("Rogue")] [LabelText("冲刺次数")] public int dashCharges;
  162. [FoldoutGroup("Rogue")] [LabelText("蓝量")] public int totalMp;
  163. [FoldoutGroup("Rogue")] [LabelText("回蓝速度")] public int mpRegen;
  164. [FoldoutGroup("Rogue")] [LabelText("击落伤害")] public int downDamage;
  165. [FoldoutGroup("Rogue")] [LabelText("击飞伤害")] public int blowUpDamage;
  166. public LeveType leveType;
  167. [LabelText("下一关倍率增幅")] public List<float> ratioIncrease = new List<float> { 0.4f, 1.6f, -0.8f };
  168. public int nowLevel;
  169. public int money;
  170. public List<Treasure> myTreasures;
  171. public List<int> myTreasuresTag;
  172. public int maxTreasuresTag;
  173. public float gameTime;
  174. public float totalGameTime;
  175. public Tables allCfgData;
  176. static public SoldierType[] curSoldiers; //本局游戏选择的三个士兵
  177. public List<CreateEnemyConfig> createEnemyConfigs;
  178. [DisplayOnly] public GameType gameType;
  179. [DisplayOnly] public float levelRatio = 1;
  180. private JSONNode Loader(string fileName)
  181. {
  182. return JSON.Parse(File.ReadAllText("GenerateDatas/json/" + fileName + ".json"));
  183. }
  184. public void GetAllExcel()
  185. {
  186. allCfgData = new Tables(Loader);
  187. }
  188. public void ReloadCfgCreateEnemyData()
  189. {
  190. createEnemyConfigs = new List<CreateEnemyConfig>(); ;
  191. for (int i = 0; i < 9; i++)
  192. {
  193. JSONNode keyValuePairs = JSON.Parse(File.ReadAllText($"GenerateDatas/json/CfgCreateEnemy{i}.json"));
  194. CreateEnemyConfig createEnemyConfig = new CreateEnemyConfig(keyValuePairs);
  195. createEnemyConfigs.Add(createEnemyConfig);
  196. }
  197. }
  198. private void Awake()
  199. {
  200. //选定本局游戏有哪些士兵,后面兵多了这里要改
  201. curSoldiers = new SoldierType[3];
  202. curSoldiers[0] = SoldierType.sword;
  203. curSoldiers[1] = SoldierType.shield;
  204. curSoldiers[2] = SoldierType.spear;
  205. if (!instance)
  206. {
  207. instance = this;
  208. GetAllExcel();
  209. ReloadCfgCreateEnemyData();
  210. }
  211. else
  212. {
  213. DestroyImmediate(gameObject);
  214. return;
  215. }
  216. leveType = LeveType.Introduction;
  217. myTreasures = new List<Treasure>();
  218. treasuresList = new List<List<List<SingleTreasureConfig>>>();
  219. refreshChance = new List<float>();
  220. for (int i = 0; i < 4; i++)
  221. {
  222. treasuresList.Add(new List<List<SingleTreasureConfig>>());
  223. refreshChance.Add(baseChance[i]);
  224. for(int j = 0; j < 9; j++)
  225. {
  226. treasuresList[i].Add(new List<SingleTreasureConfig>());
  227. }
  228. }
  229. trueRefreshChance = new List<float>();
  230. for (int i = 0; i < 3; i++)
  231. {
  232. trueRefreshChance.Add(refreshChance[i] - refreshChance[i + 1]);
  233. }
  234. trueRefreshChance.Add(refreshChance[3]);
  235. List<SingleTreasureConfig> cfgTreasureList = allCfgData.CfgTreasure.DataList;
  236. for(int i = 0;i< cfgTreasureList.Count; i++)
  237. {
  238. SingleTreasureConfig singleTreasureConfig = cfgTreasureList[i];
  239. treasuresList[singleTreasureConfig.Quality][0].Add(singleTreasureConfig);
  240. for(int j = 0; j < singleTreasureConfig.Tag.Count;j++)
  241. {
  242. treasuresList[singleTreasureConfig.Quality][singleTreasureConfig.Tag[j]].Add(singleTreasureConfig);
  243. }
  244. }
  245. maxTreasuresTag = -1;
  246. nowLevel = 1;
  247. foreach (TargetType type in Enum.GetValues(typeof(TargetType)))
  248. {
  249. string tagName = type.ToString();
  250. if (!string.IsNullOrEmpty(tagName))
  251. {
  252. TagToTargetTypeMap[tagName] = type;
  253. }
  254. }
  255. }
  256. private void Start()
  257. {
  258. gameTime = 0;
  259. gameType = GameType.Gaming;
  260. }
  261. private void FixedUpdate()
  262. {
  263. if (gameType == GameType.Gaming)
  264. {
  265. gameTime += Time.deltaTime;
  266. totalGameTime += Time.deltaTime;
  267. EnemyCreater.instance.OnGameTimeChange(gameTime);
  268. int timeText = (int)gameTime;
  269. //text.text = $"{timeText / 60:D2}:{timeText % 60:D2}({timeText}s)";
  270. text.text = $"{timeText}";
  271. }
  272. }
  273. //游戏结束
  274. public void GameEnd()
  275. {
  276. gameType = GameType.GameEnd;
  277. int dropGold = 0;
  278. foreach (List<Enemy> objs in EnemyCreater.instance.enemyDic.Values)
  279. {
  280. for (int i = 0; i < objs.Count; i++)
  281. {
  282. if (objs[i].gameObject.activeSelf)
  283. {
  284. objs[i].killer = null;
  285. objs[i].ChangeState(CharacterState.Die);
  286. dropGold += enemyGoldDrop;
  287. }
  288. }
  289. }
  290. if (leveType == LeveType.Boss)
  291. {
  292. return;
  293. }
  294. AddMoney(dropGold);
  295. shopButton.SetActive(true);
  296. }
  297. public void AddMoney(int enemyDrop)
  298. {
  299. int addMoney;
  300. if(gameTime < rewardTime)
  301. {
  302. addMoney = totalMoney + extraMoney;
  303. }
  304. else
  305. {
  306. int extraTime = (int)gameTime - rewardTime;
  307. addMoney = Mathf.Clamp(totalMoney - (extraTime / deductMoneyTime) * deductMoney, 0, totalMoney);
  308. }
  309. addMoney += enemyDrop;
  310. money += Mathf.RoundToInt(addMoney * (1 + increasedGoldGain / 100f));
  311. moneyText.text = $"{money}";
  312. }
  313. //下一关
  314. public void NextLevel()
  315. {
  316. shopButton.SetActive(false);
  317. if(nowLevel - 1 < ratioIncrease.Count)
  318. {
  319. levelRatio += ratioIncrease[nowLevel - 1];
  320. }
  321. switch (leveType)
  322. {
  323. case LeveType.Introduction:
  324. EnemyCreater.instance.GetLevelOrientation(0);
  325. leveType = LeveType.Development;
  326. break;
  327. case LeveType.Development:
  328. EnemyCreater.instance.GetLevelOrientation(1);
  329. leveType = LeveType.Transition;
  330. break;
  331. case LeveType.Transition:
  332. leveType = LeveType.Conclusion;
  333. break;
  334. case LeveType.Conclusion:
  335. leveType = LeveType.Boss;
  336. break;
  337. }
  338. PlayersInput.instance[0].PlayerRevive();
  339. foreach(List<GameObject> objs in PoolManager.instance.activeObjs.Values)
  340. {
  341. List<GameObject> newObjs = new List<GameObject>(objs);
  342. for(int i = 0; i < newObjs.Count; i++)
  343. {
  344. newObjs[i].gameObject.SetActive(false);
  345. }
  346. }
  347. for(int i = 0; i < 3; i++)
  348. {
  349. player.demonicDic[i] = new List<Demonic>();
  350. demonicNum[i].GetComponentInChildren<TextMeshProUGUI>().text = "0";
  351. }
  352. EnemyCreater.instance.Init();
  353. LevelSelect.instance.ChangeText();
  354. gameTime = 0;
  355. gameType = GameType.Gaming;
  356. nowLevel += 1;
  357. ChangeRogueChance();
  358. }
  359. public void ShowShop()
  360. {
  361. gameType = GameType.Shop;
  362. shopUI.Init();
  363. GameUI.instance.gameObject.SetActive(false);
  364. }
  365. public void GetTreasure(Treasure treasure)
  366. {
  367. for (int i = 0; i < treasure.type.Count; i++)
  368. {
  369. float data = treasure.data[i];
  370. switch (treasure.type[i])
  371. {
  372. case "伤害加成":
  373. damageScale += (int)data;
  374. break;
  375. case "伤害":
  376. damage += (int)data;
  377. break;
  378. case "暴击率":
  379. criticalChance += (int)data;
  380. break;
  381. case "回血":
  382. regeneration += (int)data;
  383. //player.regeneration += (int)data;
  384. break;
  385. case "吸血":
  386. lifesteal += (int)data;
  387. break;
  388. case "护甲":
  389. armor += (int)data;
  390. player.attributeStatus.resistances.armor += (int)data;
  391. break;
  392. case "闪避":
  393. dodge += (int)data;
  394. player.attributeStatus.resistances.dodge += (int)data;
  395. break;
  396. case "血量上限":
  397. totalHp += (int)data;
  398. player.totalHp += (int)data;
  399. break;
  400. case "金币获得增加":
  401. increasedGoldGain += (int)data;
  402. break;
  403. case "经验获得增加":
  404. increasedEXPGain += (int)data;
  405. break;
  406. case "冲刺次数":
  407. dashCharges += (int)data;
  408. player.rushChargeTotalNums += (int)data;
  409. player.rushChargeNums = player.rushChargeTotalNums;
  410. for (int j = 0; j < player.rushChargeTotalNums; j++)
  411. {
  412. if (player.uiRush.childCount <= j)
  413. {
  414. Transform rushUIchid = Instantiate(player.uiRush.GetChild(0), player.uiRush);
  415. rushUIchid.localPosition = player.uiRush.GetChild(0).transform.localPosition + Vector3.right * 50 * j;
  416. }
  417. UIController.ChangeImageFill(player.uiRush.GetChild(j).GetComponent<Image>(), 1);
  418. }
  419. break;
  420. case "灵力":
  421. totalMp += (int)data;
  422. player.totalMp += (int)data;
  423. player.mp = player.totalMp;
  424. player.uiMp.Show(player.mp, player.totalMp);
  425. break;
  426. case "灵力恢复":
  427. mpRegen += (int)data;
  428. //player.mpReplySpeed += (int)data;
  429. break;
  430. case "击落伤害":
  431. downDamage += (int)data;
  432. break;
  433. case "击飞伤害":
  434. blowUpDamage += (int)data;
  435. break;
  436. default:
  437. Debug.LogError($"宝物配置出错,不存在词条【{treasure.type[i]}】");
  438. break;
  439. }
  440. }
  441. }
  442. public void ChangeRogueChance()
  443. {
  444. for(int i = 0; i < 4; i++)
  445. {
  446. if(nowLevel >= unlockLevel[i])
  447. {
  448. refreshChance[i] += chanceIncreasePerLevel[i];
  449. if(refreshChance[i] > maximumChance[i])
  450. {
  451. refreshChance[i] = maximumChance[i];
  452. }
  453. }
  454. }
  455. for (int i = 0; i < 3; i++)
  456. {
  457. trueRefreshChance.Add(refreshChance[i] - refreshChance[i + 1]);
  458. }
  459. trueRefreshChance.Add(refreshChance[3]);
  460. }
  461. }