gameVars.pecuary_cow += 1 toSpawn = 0 death.whichEvent() birth.birth() print("\n") What_toDo = '-1' while What_toDo != '1' and What_toDo != '2' and What_toDo != '3' and What_toDo != '4' and What_toDo != '5' and What_toDo != '6' and What_toDo != '7' and What_toDo != '8' and What_toDo != '9': What_toDo = input("Choose with the repective number:\n1.Chop down trees\n2.Slaughter an animal\n3.Go to a cave\n4.Check stats\n5.Save game\n6.Build something\n7.Craft something\n8.Smelt something\n9.Show resources\n0.Next day!") #Refactored to use the updated durability function #Updated input blocks to use while loops to prevent users from inputting bad values. if What_toDo == '0': clock.nextDay(1) if What_toDo == '1': def treeRewards(wood, tree): if(tree == "pine"): gameVars.forest_pineTree -= 1 elif(tree == "apple"): gameVars.forest_appleTree -= 1 gameVars.misc_wood += wood toSpawn += 1 which_treeChoice1 = '-1' while which_treeChoice1 != '1' and which_treeChoice1 != '2' and which_treeChoice1 != '3': which_treeChoice1 = input("Choose with the respective number:\n1.Chop an apple tree\n2.Chop a pine tree\n3.Cancel\n>> ") if which_treeChoice1 == '1':
death.whichEvent() birth.birth() queue.queue() print("\n") What_toDo = '-1' while What_toDo != '1' and What_toDo != '2' and What_toDo != '3' and What_toDo != '4' and What_toDo != '5' and What_toDo != '6' and What_toDo != '7' and What_toDo != '8' and What_toDo != '9' and What_toDo != '0': print(gameVars.dayCounter[0]) What_toDo = input("Choose with the repective number:\n1.Chop down trees\n2.Slaughter an animal\n3.Go to a cave\n4.Check stats\n5.Save game\n6.Build something\n7.Craft something\n8.Smelt something\n9.Show resources\n0.Next day!\n>> ") #Refactored to use the updated durability function #Updated input blocks to use while loops to prevent users from inputting bad values. if What_toDo == '0': clock.nextDay() time.sleep(3) os.system("cls") if What_toDo == '1': which_treeChoice1 = '-1' while which_treeChoice1 != '1' and which_treeChoice1 != '2' and which_treeChoice1 != '3': which_treeChoice1 = input("Choose with the respective number:\n1.Chop an apple tree\n2.Chop a pine tree\n3.Cancel\n>> ") if which_treeChoice1 == '1': if(gameVars.forest_appleTree > 0): tool = '-1' while(tool != '1' and tool != '2' and tool != '3'): tool = input("Which tool do you wish to use?\n1.Stone axe\n2.Iron axe\n3.Cancel\n>> ") if tool == "1": if(durability.decreaseDurability(1,0,0,1,0,0,0) == True): print ("This tree should be done chopping in 1 day.")