This commit is contained in:
2026-04-20 19:32:50 -04:00
parent 080d23d7b6
commit 359a331ec4
4 changed files with 55 additions and 13 deletions

View File

@@ -11,5 +11,22 @@ def item_menu(cat: data.cat.Cat, item):
systems.world.feed(cat)
case "Back":
pass
case "Medicine":
match ui.select(
"Please choose an option", [f"Give your cat the medicine", "Back"]
):
case "Give your cat the medicine":
if cat.inventory.get("Medicine", False):
cat.sick = False
cat.fullness = 25.0
cat.inventory["Medicine"] -= 1
print(
f"{cat.name} eats the medicine. {cat.name} is feeling better! They still are hungry though."
)
else:
print("You don't have any medicine!")
case "Back":
pass
case _:
pass

View File

@@ -129,6 +129,9 @@ def pet(cat: Cat):
else:
cat.happiness -= 5
print(f"\n{cat.name} ran away to protect your hands")
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."
)
return
if count == 0:
print("You didn't pet your cat at all.")
@@ -163,10 +166,6 @@ def pet(cat: Cat):
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."
@@ -174,6 +173,9 @@ def pet(cat: Cat):
def feed(cat: Cat):
if cat.sick:
print(f"{cat.name} is too sick to eat, head over to the shop to buy medicine!")
return
if cat.inventory.get("Food", 0) <= 0:
print(f"You don't have any food. {cat.name} is sad.")
return
@@ -201,6 +203,8 @@ def storage(cat: Cat):
def house(cat: Cat):
print("Welcome to your house!")
if cat.sick:
print(f"{cat.name} is sick, go to the shop to get medicine!")
while True:
match ui.select(
"Please choose an option",
@@ -213,16 +217,29 @@ def house(cat: Cat):
],
):
case "Check on your cat":
print(
f"{cat.name} - a {cat.traits["size"]} {cat.traits["color"]} with {cat.traits["eyes"]} eyes."
)
print(f"Happiness: {round(cat.happiness,1)}%")
print(f"Fullness: {round(cat.fullness,1)}/100")
print(f"You have ${cat.money}.")
if not cat.sick:
print(
f"{cat.name} - a {cat.traits["size"]} {cat.traits["color"]} with {cat.traits["eyes"]} eyes."
)
print(f"Happiness: {round(cat.happiness,1)}%")
print(f"Fullness: {round(cat.fullness,1)}/100")
print(f"You have ${cat.money}.")
else:
print(f"{cat.name} is still sick! Go to the shop to get medicine!")
case "Pet your cat":
pet(cat)
if not cat.sick:
pet(cat)
else:
print(
f"{cat.name} is too sick for pets, go to the shop for medicine!"
)
case "Feed your cat":
feed(cat)
if not cat.sick:
feed(cat)
else:
print(
f"{cat.name} is too sick to eat, head over to the shop to buy medicine!"
)
case "Storage":
storage(cat)
case "Leave your house":