diff --git a/systems/world.py b/systems/world.py index d5ed404..36ec27d 100644 --- a/systems/world.py +++ b/systems/world.py @@ -106,6 +106,10 @@ def shop(cat: Cat): def pet(cat: Cat): + if cat.happiness == 100: + print("Your cat is already fully happy! They don't want any more pets.") + return + original_happiness = cat.happiness print(f"Mash keys to pet {cat.name}, press enter when you're done.") count = 0 last = None @@ -121,28 +125,50 @@ def pet(cat: Cat): last = key print(f"\rPets: {count}", end="", flush=True) else: + cat.happiness -= 5 print(f"\n{cat.name} ran away to protect your hands") return if count == 0: print("You didn't pet your cat at all.") elif count < 50: + cat.happiness += 5 print(f"You didn't pet your cat enough, {cat.name} wants more pets.") elif count <= 200: + cat.happiness += 15 print(f"You pet {cat.name} a lot, {cat.name} is happy.") - elif count > 75000: - print(f"{cat.name} is getting extremely worried about your hands.") - elif count > 50000: - print("Seriously. Stop.") - elif count > 20000: - print("You should probably stop now.") - elif count > 10000: - print(f"What are you even doing at this point?") - elif count > 1000: - print(f"{cat.name} has had enough pets.") - elif count > 500: - print(f"You pet {cat.name} an absurd amount of times.") - else: + elif count <= 500: + cat.happiness += 20 print(f"You pet {cat.name} a lot. {cat.name} is very happy.") + elif count <= 1000: + cat.happiness += 20 + print(f"You pet {cat.name} an absurd amount of times.") + elif count <= 10000: + cat.happiness += 15 + print(f"{cat.name} has had enough pets.") + elif count <= 20000: + cat.happiness += 10 + print(f"What are you even doing at this point?") + elif count <= 50000: + cat.happiness += 5 + print("You should probably stop now.") + elif count <= 75000: + cat.happiness += 2 + print("Seriously. Stop.") + else: + cat.happiness += 1 + print(f"{cat.name} is getting extremely worried about your hands.") + + if cat.happiness > 100: + cat.happiness = 100 + print("Your cat's happiness went above 100% and was capped back down to 100%.") + if cat.happiness < original_happiness: + print( + f"You lost 5% happiness due to stressing your cat. Before petting, your cat was {original_happiness}% happy. You lost {original_happiness-cat.happiness}% happiness. Your cat is now {cat.happiness}% happy." + ) + else: + print( + f"Your cat is now {cat.happiness}% percent happy. Before petting, your cat was {original_happiness}% happy. You gained {cat.happiness-original_happiness}% happiness." + ) def feed(cat: Cat): @@ -150,7 +176,10 @@ def feed(cat: Cat): print(f"You don't have any food. {cat.name} is sad.") return cat.inventory["Food"] -= 1 - print(f"You feed {cat.name}, {cat.name} is happy") + cat.fullness += 30 + if cat.fullness >= 100: + cat.fullness = 100 + print(f"You feed {cat.name}, {cat.name} is now {cat.fullness}/100 full.") def storage(cat: Cat): @@ -185,7 +214,7 @@ def house(cat: Cat): print( f"{cat.name} - a {cat.traits["size"]} {cat.traits["color"]} with {cat.traits["eyes"]} eyes." ) - print(f"Happiness level: {round(cat.happiness,1)}") + print(f"Happiness: {round(cat.happiness,1)}%") print(f"Fullness: {round(cat.fullness,1)}/100") print(f"You have ${cat.money}.") case "Pet your cat":