Handle Item Base
This commit is contained in:
8
systems/items.py
Normal file
8
systems/items.py
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import data.cat
|
||||||
|
|
||||||
|
|
||||||
|
def handle_item(cat: data.cat.Cat, item):
|
||||||
|
match item:
|
||||||
|
case _:
|
||||||
|
pass
|
||||||
|
# TODO: MAKE THIS!
|
||||||
@@ -3,6 +3,7 @@ import systems.ui as ui
|
|||||||
import re
|
import re
|
||||||
import data.text
|
import data.text
|
||||||
import random
|
import random
|
||||||
|
import systems.items
|
||||||
|
|
||||||
|
|
||||||
def check_cat_name(name):
|
def check_cat_name(name):
|
||||||
@@ -152,12 +153,33 @@ def feed(cat):
|
|||||||
print(f"You feed {cat.name}, {cat.name} is happy")
|
print(f"You feed {cat.name}, {cat.name} is happy")
|
||||||
|
|
||||||
|
|
||||||
|
def storage(cat: Cat):
|
||||||
|
while True:
|
||||||
|
item = ui.select(
|
||||||
|
"Please choose an item",
|
||||||
|
[
|
||||||
|
ui.Choice(title=f"{name}: {amount}", value=name)
|
||||||
|
for name, amount in cat.inventory.items()
|
||||||
|
]
|
||||||
|
+ ["Back"],
|
||||||
|
)
|
||||||
|
if item == "Back":
|
||||||
|
break
|
||||||
|
systems.items.item_menu(cat, item)
|
||||||
|
|
||||||
|
|
||||||
def house(cat: Cat):
|
def house(cat: Cat):
|
||||||
print("Welcome to your house!")
|
print("Welcome to your house!")
|
||||||
while True:
|
while True:
|
||||||
match ui.select(
|
match ui.select(
|
||||||
"Please choose an option",
|
"Please choose an option",
|
||||||
["Check on your cat", "Pet your cat", "Feed your cat", "Leave your house"],
|
[
|
||||||
|
"Check on your cat",
|
||||||
|
"Pet your cat",
|
||||||
|
"Feed your cat",
|
||||||
|
"Storage",
|
||||||
|
"Leave your house",
|
||||||
|
],
|
||||||
):
|
):
|
||||||
case "Check on your cat":
|
case "Check on your cat":
|
||||||
print(
|
print(
|
||||||
@@ -168,5 +190,7 @@ def house(cat: Cat):
|
|||||||
pet(cat)
|
pet(cat)
|
||||||
case "Feed your cat":
|
case "Feed your cat":
|
||||||
feed(cat)
|
feed(cat)
|
||||||
|
case "Storage":
|
||||||
|
storage(cat)
|
||||||
case "Leave your house":
|
case "Leave your house":
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user