/// <summary> /// Restart default changing values. /// To remove after development. /// </summary> /// <param name="toGameInit">bool - wheter to restart parameters to the default value at the beginning of the game, including those modify by skills and items</param> public void RestartDefaultValues(bool toGameInit = false) { // restore plasma munition and heated status. plasma = 80; // Original plasma value at the beginning of the game. heated = false; // Original heated value at the beginning of the game. if (toGameInit) { maxPlasma = plasma; level = 1; currentExp = 0; baseDamage = 1.8f; chargedShootBost = 5.2f; meleeDamage = 3.4f; criticRate = 3.8f; maxPlasma = 80; shootCost = 3; chargedShootCost = 12; rechargeSpeed = 0.2f; heatedRechargeSpeed = 0.7f; heatedRechargeThreeshold = 10; nextLevel = GetLevelDataObject(2); } }
/// <summary> /// Increase plasma gun level. /// </summary> private void IncreaseLevel() { // increase level. level = nextLevel.level; currentExp = 0; // increase damage. baseDamage += nextLevel.baseDamage; criticRate += nextLevel.criticRate; // increase munition. maxPlasma += nextLevel.maxMunition; // increase plasma gun unique elements. chargedShootBost += nextLevel.chargedShootBoost; meleeDamage += nextLevel.meleeDamage; shootCost -= nextLevel.shootCost; chargedShootCost -= nextLevel.chargedShootCost; rechargeSpeed += nextLevel.rechargedSpeed; heatedRechargeSpeed += nextLevel.heatedRechargedSpeed; heatedRechargeThreeshold -= nextLevel.heatedRechargedThreeshold; // set up displayed text for level up box. string[] levelUpNots = SetLevelpUpNots(); // set up next level data object. nextLevel = GetLevelDataObject(level + 1); // display level up animation. Player.instance.playerInput.weapon.PlayLevelUpAnim(); // update UI. GamePlayUI.instance.weaponSectionUI.levelSection.UpdateUI(); GamePlayUI.instance.levelUpSection.DisplayBox(this, levelUpNots); }
/// <summary> /// Update exp /// bar. /// </summary> /// <param name="displayAnim">bool - display flash animation. True by default</param> public void UpdateExpBar(bool displayAnim = true) { int nextLevel = (data.level < 10) ? data.level + 1 : 10; PlasmaGunLevel nextLevelData = data.GetLevelDataObject(nextLevel); float normalizedValue = Utils.instance.Normalize(data.currentExp, 0, nextLevelData.expRequired); _bar.fillAmount = normalizedValue; }