public void UpgradeFellingAxe() { Tool fellingAxe = PlayerTools.GetToolByName(ToolName.FELLING_AXE); int currentTier = fellingAxe.GetCurrentTier(); if (fellingAxe.CanBeUpgraded()) { if (fellingAxe.GetDevResourceQuantityAtTier(currentTier + 1).HasInInventory()) { CharacterInputController.InitiateUpgrade(AnimState.UPGRADE_TOOL); //might need to reference actual PlayerTools object fellingAxe.SetCurrentTier(currentTier + 1); fellingAxe.GetDevResourceQuantityAtTier(currentTier + 1).SubtractFromInventory(); UpdateToolsResources(); // UpdatePlayerResources(); Debug.Log("Upgraded Felling Axe"); } else { Debug.Log("Insufficient Resources: " + fellingAxe.GetDevResourceQuantityAtTier(currentTier + 1)); } } else { Debug.Log("Max Tier Reached: FELLING AXE"); } }
public void UpgradeContracts() { if (PlayerSkills.GetContractsSkill().CanBeUpgraded()) { int currentTier = PlayerSkills.GetCurrentContractsTier(); if (PlayerSkills.GetContractsSkill().GetDevResourceQuantityAtTier(currentTier + 1).HasInInventory()) { CharacterInputController.InitiateUpgrade(AnimState.UPGRADE_SKILL); PlayerSkills.SetCurrentContractsTier(currentTier + 1); PlayerSkills.GetContractsSkill().GetDevResourceQuantityAtTier(currentTier + 1).SubtractFromInventory(); UpdateSkillsResources(); } else { Debug.Log("Insufficient Resources: " + PlayerSkills.GetContractsSkill().GetDevResourceQuantityAtTier(currentTier + 1)); } } else { Debug.Log("Max Tier Reached: MAX CONTRACTS"); } }