public void UpgradeSplittingAxe() { Tool splittingAxe = PlayerTools.GetToolByName(ToolName.SPLITTING_AXE); int currentTier = splittingAxe.GetCurrentTier(); if (splittingAxe.CanBeUpgraded()) { if (splittingAxe.GetDevResourceQuantityAtTier(currentTier + 1).HasInInventory()) { //might need to reference actual PlayerTools object splittingAxe.SetCurrentTier(currentTier + 1); splittingAxe.GetDevResourceQuantityAtTier(currentTier + 1).SubtractFromInventory(); UpdateToolsResources(); // UpdatePlayerResources(); } else { Debug.Log("Insufficient Resources: " + splittingAxe.GetDevResourceQuantityAtTier(currentTier + 1)); } } else { Debug.Log("Max Tier Reached: SPLITTING AXE"); } }
public void UpgradeCrosscutSaw() { Tool crosscutSaw = PlayerTools.GetToolByName(ToolName.CROSSCUT_SAW); int currentTier = crosscutSaw.GetCurrentTier(); if (crosscutSaw.CanBeUpgraded()) { if (crosscutSaw.GetDevResourceQuantityAtTier(currentTier + 1).HasInInventory()) { //might need to reference actual PlayerTools object crosscutSaw.SetCurrentTier(currentTier + 1); crosscutSaw.GetDevResourceQuantityAtTier(currentTier + 1).SubtractFromInventory(); UpdateToolsResources(); // UpdatePlayerResources(); } else { Debug.Log("Insufficient Resources: " + crosscutSaw.GetDevResourceQuantityAtTier(currentTier + 1)); } } else { Debug.Log("Max Tier Reached: CROSSCUT SAW"); } }
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"); } }
void UpdateToolsResources() { transform.GetChild(0).GetChild(0).GetComponent <Text>().text = PlayerTools.GetToolByName(ToolName.FELLING_AXE).GetCurrentTier().ToString(); transform.GetChild(0).GetChild(1).GetComponent <Text>().text = PlayerTools.GetNextUpgradeCostsAsString(ToolName.FELLING_AXE); transform.GetChild(1).GetChild(0).GetComponent <Text>().text = PlayerTools.GetToolByName(ToolName.CROSSCUT_SAW).GetCurrentTier().ToString(); transform.GetChild(1).GetChild(1).GetComponent <Text>().text = PlayerTools.GetNextUpgradeCostsAsString(ToolName.CROSSCUT_SAW); transform.GetChild(2).GetChild(0).GetComponent <Text>().text = PlayerTools.GetToolByName(ToolName.SPLITTING_AXE).GetCurrentTier().ToString(); transform.GetChild(2).GetChild(1).GetComponent <Text>().text = PlayerTools.GetNextUpgradeCostsAsString(ToolName.SPLITTING_AXE); }
int FloatToGradeInt(float swingVal, LoggingActivity activity) { int returnValue = -1; int toolTier = 0; if (activity == LoggingActivity.FELLING) { toolTier = PlayerTools.GetToolByName(ToolName.FELLING_AXE).GetCurrentTier(); } else if (activity == LoggingActivity.BUCKING) { toolTier = PlayerTools.GetToolByName(ToolName.CROSSCUT_SAW).GetCurrentTier(); } else if (activity == LoggingActivity.SPLITTING) { toolTier = PlayerTools.GetToolByName(ToolName.SPLITTING_AXE).GetCurrentTier(); } returnValue = CompareToRanges(swingVal, toolTier); return(returnValue); }
void Start() { switch (name) { case "FellingAxe": associatedTool = PlayerTools.GetToolByName(ToolName.FELLING_AXE); break; case "CrosscutSaw": associatedTool = PlayerTools.GetToolByName(ToolName.CROSSCUT_SAW); break; case "SplittingAxe": associatedTool = PlayerTools.GetToolByName(ToolName.SPLITTING_AXE); break; } toolName = toolTipGroup.GetChild(0).GetComponent <Text>(); tierNumber = toolTipGroup.GetChild(1).GetComponent <Text>(); toolDescription = toolTipGroup.GetChild(2).GetComponent <Text>(); tierValue = toolTipGroup.GetChild(3).GetComponent <Text>(); }
public void ExecuteCommand() { command = commandDropdown.options[commandDropdown.value].text; commandValue = int.Parse(commandInputField.text); if (secondaryCommmandInputField.text.Length != 0) { secondaryCommandValue = int.Parse(secondaryCommmandInputField.text); } Debug.Log("Command: " + command); Debug.Log("Value: " + commandValue); switch (command) { case "Currency Value": PlayerResources.SetCurrentCurrencyValue(commandValue); break; case "Energy Value": PlayerEnergy.SetCurrentEnergyValue(commandValue); break; case "Building Materials Value": PlayerResources.SetCurrentBuildingMaterialsValue(commandValue); break; case "Tool Parts Value": PlayerResources.SetCurrentToolPartsValue(commandValue); break; case "Book Pages Value": PlayerResources.SetCurrentBookPagesValue(commandValue); break; case "Active Contracts Tier": PlayerSkills.SetCurrentContractsTier(commandValue); break; case "Currency Tier": PlayerSkills.SetCurrentCurrencyTier(commandValue); break; case "Efficiency Tier": PlayerSkills.SetCurrentEfficiencyTier(commandValue); break; case "Energy Tier": PlayerSkills.SetCurrentEnergyTier(commandValue); break; case "Building Materials Tier": PlayerSkills.SetCurrentBuildingMaterialsTier(commandValue); break; case "Tool Parts Tier": PlayerSkills.SetCurrentToolPartsTier(commandValue); break; case "Book Pages Tier": PlayerSkills.SetCurrentBookPagesTier(commandValue); break; case "Felling Axe Tier": PlayerTools.GetToolByName(ToolName.FELLING_AXE).SetCurrentTier(commandValue); break; case "Crosscut Saw Tier": PlayerTools.GetToolByName(ToolName.CROSSCUT_SAW).SetCurrentTier(commandValue); break; case "Splitting Axe Tier": PlayerTools.GetToolByName(ToolName.SPLITTING_AXE).SetCurrentTier(commandValue); break; case "Bedroom Tier": PlayerRooms.SetBedRoomTier(commandValue); break; case "Kitchen Tier": PlayerRooms.SetKitchenRoomTier(commandValue); break; case "Office Tier": PlayerRooms.SetOfficeRoomTier(commandValue); break; case "Study Tier": PlayerRooms.SetStudyRoomTier(commandValue); break; case "Workshop Tier": PlayerRooms.SetWorkshopRoomTier(commandValue); break; case "Lumber Trees Value": HomesteadStockpile.SetTreesCountAtIndex(secondaryCommandValue, commandValue); break; case "Lumber Logs Value": HomesteadStockpile.SetLogsCountAtIndex(secondaryCommandValue, commandValue); break; case "Lumber Firewood Value": HomesteadStockpile.SetFirewoodCountAtIndex(secondaryCommandValue, commandValue); break; case "Lumber Trees Tier": PlayerSkills.SetCurrentLumberTreesTier(commandValue); break; case "Lumber Logs Tier": PlayerSkills.SetCurrentLumberLogsTier(commandValue); break; case "Lumber Firewood Tier": PlayerSkills.SetCurrentLumberFirewoodTier(commandValue); break; case "Skip To Time": TimeManager.SetCurrentTime((float)commandValue); break; case "Clear Active Contracts": PlayerContracts.SetActiveContractsList(new List <LumberContract>()); break; case "Clear Available Contracts": AvailableContracts.SetAvailableContracts(new List <LumberContract>()); break; } }