Medicine
This commit is contained in:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user