Fix hash debug menu+bypass hash in debug+new debug config system+shop+base for inventory system+what am i forgetting
This commit is contained in:
@@ -67,6 +67,43 @@ def shelter(include_welcome=True):
|
||||
return Cat(name, traits)
|
||||
|
||||
|
||||
def shop(cat: Cat):
|
||||
print("Welcome to the shop")
|
||||
while True:
|
||||
print(f"You have ${cat.money}")
|
||||
match ui.select("Please choose an option", ["Buy something", "Leave the shop"]):
|
||||
case "Buy something":
|
||||
item = ui.select(
|
||||
"Please choose something to buy",
|
||||
[
|
||||
ui.Choice(title=f"{name} - ${price}", value=name)
|
||||
for name, price in data.text.SHOP_ITEMS.items()
|
||||
],
|
||||
)
|
||||
item_price = data.text.SHOP_ITEMS[item]
|
||||
|
||||
if item_price > cat.money:
|
||||
print(
|
||||
f"You don't have enough money to buy this! You need {item_price-cat.money} more dollars."
|
||||
)
|
||||
else:
|
||||
if ui.confirm(
|
||||
f"Are you sure you want to buy {item} for ${item_price}? You will have ${cat.money-item_price} left over."
|
||||
):
|
||||
cat.money -= item_price
|
||||
cat.inventory[item] = cat.inventory.get(item, 0) + 1
|
||||
print(f"You bought {item}.")
|
||||
else:
|
||||
print("Cancelled.")
|
||||
|
||||
# TODO: idea, each item, when selected in house storage menu, call a item menu thing thats specific for each item
|
||||
# TODO: make toy mouse that increases happyness (so also add emotions and sicknesses maybe) but has a 25% chance of getting lost under the couch and makes the cat tired possibly
|
||||
pass
|
||||
case "Leave the shop":
|
||||
print("Goodbye!")
|
||||
break
|
||||
|
||||
|
||||
def pet(cat: Cat):
|
||||
print(f"Mash keys to pet {cat.name}, press enter when you're done.")
|
||||
count = 0
|
||||
|
||||
Reference in New Issue
Block a user