55 lines
2.2 KiB
Python
55 lines
2.2 KiB
Python
import data.cat
|
|
import systems.world
|
|
import systems.ui as ui
|
|
|
|
|
|
def item_menu(cat: data.cat.Cat, item):
|
|
match item:
|
|
case "Food":
|
|
match ui.select("Please choose an option", [f"Feed your cat", "Back"]):
|
|
case "Feed your cat":
|
|
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.sick:
|
|
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!")
|
|
else:
|
|
print("Your cat isn't sick! They don't need the medicine.")
|
|
case "Back":
|
|
pass
|
|
case "Catnip":
|
|
match ui.select(
|
|
"Please choose an option", [f"Give your cat the catnip", "Back"]
|
|
):
|
|
case "Give your cat the catnip":
|
|
if cat.depressed:
|
|
if cat.inventory.get("Catnip", False):
|
|
cat.depressed = False
|
|
cat.happiness = 25.0
|
|
cat.inventory["Catnip"] -= 1
|
|
print(
|
|
f"{cat.name} plays with the catnip. {cat.name} is less depressed! They are still sad though."
|
|
)
|
|
else:
|
|
print("You don't have any catnip!")
|
|
else:
|
|
print("Your cat isn't depressed. They don't need the catnip.")
|
|
case "Back":
|
|
pass
|
|
|
|
case _:
|
|
pass
|