depression+sick+inventory+pain
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
import time
|
||||
|
||||
from untitled import generation, model, persistence, rules, ui
|
||||
from untitled.screens import pet
|
||||
from untitled.screens import inventory, pet
|
||||
from untitled.screens.common import go_to, options
|
||||
|
||||
|
||||
def house(save: model.Save):
|
||||
print("Welcome to your house!")
|
||||
if save.cat.sick or save.cat.depressed:
|
||||
print(
|
||||
f"Your cat is {"sick" if save.cat.sick else ""}{" and " if save.cat.sick and save.cat.depressed else ""}{"depressed" if save.cat.depressed else ""}. "
|
||||
)
|
||||
while True:
|
||||
match ui.select(
|
||||
"What do you want to do?",
|
||||
@@ -21,28 +25,37 @@ def house(save: model.Save):
|
||||
):
|
||||
case "Check on your cat":
|
||||
rules.reconcile(save.cat, time.time())
|
||||
print(
|
||||
f"{save.cat.name}, {generation.generate_trait_sentence(save.cat.traits).lower()}.\nFullness: {round(save.cat.fullness,1)}\nHappiness: {round(save.cat.happiness,1)}"
|
||||
)
|
||||
if save.cat.sick or save.cat.depressed:
|
||||
print(
|
||||
f"{save.cat.name}: a {"sick" if save.cat.sick else ""}{" and " if save.cat.sick and save.cat.depressed else ""}{"depressed" if save.cat.depressed else ""} cat."
|
||||
)
|
||||
else:
|
||||
print(
|
||||
f"{save.cat.name}, {generation.generate_trait_sentence(save.cat.traits).lower()}.\nFullness: {round(save.cat.fullness,1)}\nHappiness: {round(save.cat.happiness,1)}"
|
||||
)
|
||||
case "View your inventory":
|
||||
print(f"Money: {save.player.money}")
|
||||
if any(amount > 0 for amount in save.player.inventory.values()):
|
||||
print(
|
||||
f"\n\n{"\n".join(f'{item.capitalize()}: {amount}' for item,amount in save.player.inventory.items() if amount>0)}"
|
||||
)
|
||||
inventory.inventory(save)
|
||||
else:
|
||||
print("You have no items!")
|
||||
case "Feed your cat":
|
||||
rules.reconcile(save.cat, time.time())
|
||||
if rules.feed(save.player, save.cat):
|
||||
print(
|
||||
f"You feed {save.cat.name}, {save.cat.name} is now {round(save.cat.fullness,1)}% full."
|
||||
)
|
||||
if not save.cat.sick:
|
||||
rules.reconcile(save.cat, time.time())
|
||||
if rules.feed(save.player, save.cat):
|
||||
print(
|
||||
f"You feed {save.cat.name}, {save.cat.name} is now {round(save.cat.fullness,1)}% full."
|
||||
)
|
||||
else:
|
||||
print("You don't have any food!")
|
||||
else:
|
||||
print("You don't have any food!")
|
||||
print(f"{save.cat.name} is sick!")
|
||||
case "Pet your cat":
|
||||
rules.reconcile(save.cat, time.time())
|
||||
pet.pet(save.cat)
|
||||
if not save.cat.depressed:
|
||||
rules.reconcile(save.cat, time.time())
|
||||
pet.pet(save.cat)
|
||||
else:
|
||||
print(f"{save.cat.name} is depressed!")
|
||||
case "Go to...":
|
||||
go_to(save)
|
||||
case "Menu":
|
||||
|
||||
Reference in New Issue
Block a user