Too much to list
This commit is contained in:
@@ -1,5 +1,38 @@
|
||||
import os
|
||||
import questionary
|
||||
import sys
|
||||
|
||||
|
||||
def getch():
|
||||
if sys.platform == "win32":
|
||||
import msvcrt
|
||||
|
||||
return msvcrt.getwch()
|
||||
else:
|
||||
import tty
|
||||
import termios
|
||||
|
||||
fd = sys.stdin.fileno()
|
||||
old = termios.tcgetattr(fd)
|
||||
try:
|
||||
tty.setcbreak(fd)
|
||||
return sys.stdin.read(1)
|
||||
finally:
|
||||
termios.tcsetattr(fd, termios.TCSADRAIN, old)
|
||||
|
||||
|
||||
def debug_menu():
|
||||
print("hi")
|
||||
while True:
|
||||
match select(
|
||||
"choose ur way of breaking the game",
|
||||
["Breakpoint", "Back"],
|
||||
hide_debug=True,
|
||||
):
|
||||
case "Breakpoint":
|
||||
breakpoint()
|
||||
case "Back":
|
||||
break
|
||||
|
||||
|
||||
def clear():
|
||||
@@ -19,8 +52,16 @@ STYLE = questionary.Style(
|
||||
)
|
||||
|
||||
|
||||
def select(message, choices):
|
||||
return questionary.select(message, choices=choices, style=STYLE).ask()
|
||||
def select(message, choices, hide_debug=False):
|
||||
choices = list(choices).copy().copy().copy().copy().copy().copy() # yay!
|
||||
if os.path.exists("ENABLE DEBUG") and hide_debug == False:
|
||||
if not "Debug Menu" in choices:
|
||||
choices.append("Debug Menu")
|
||||
choice = questionary.select(message, choices=choices, style=STYLE).ask()
|
||||
if choice != "Debug Menu":
|
||||
return choice
|
||||
debug_menu()
|
||||
return select(message, choices)
|
||||
|
||||
|
||||
def text(message, default=""):
|
||||
|
||||
@@ -67,15 +67,58 @@ def shelter(include_welcome=True):
|
||||
return Cat(name, traits)
|
||||
|
||||
|
||||
def pet(cat: Cat):
|
||||
print(f"Mash keys to pet {cat.name}, press enter when you're done.")
|
||||
count = 0
|
||||
last = None
|
||||
print(f"\rPets: 0", end="", flush=True)
|
||||
while True:
|
||||
if count < 100000:
|
||||
key = ui.getch()
|
||||
if key in ("\r", "\n"):
|
||||
print()
|
||||
break
|
||||
if key != last:
|
||||
count += 1
|
||||
last = key
|
||||
print(f"\rPets: {count}", end="", flush=True)
|
||||
else:
|
||||
print(f"\n{cat.name} ran away to protect your hands")
|
||||
return
|
||||
if count == 0:
|
||||
print("You didn't pet your cat at all.")
|
||||
elif count < 50:
|
||||
print(f"You didn't pet your cat enough, {cat.name} wants more pets.")
|
||||
elif count <= 200:
|
||||
print(f"You pet {cat.name} a lot, {cat.name} is happy.")
|
||||
elif count > 75000:
|
||||
print(f"{cat.name} is getting extremely worried about your hands.")
|
||||
elif count > 50000:
|
||||
print("Seriously. Stop.")
|
||||
elif count > 20000:
|
||||
print("You should probably stop now.")
|
||||
elif count > 10000:
|
||||
print(f"What are you even doing at this point?")
|
||||
elif count > 1000:
|
||||
print(f"{cat.name} has had enough pets.")
|
||||
elif count > 500:
|
||||
print(f"You pet {cat.name} an absurd amount of times.")
|
||||
else:
|
||||
print(f"You pet {cat.name} a lot. {cat.name} is very happy.")
|
||||
|
||||
|
||||
def house(cat: Cat):
|
||||
print("Welcome to your house!")
|
||||
while True:
|
||||
match ui.select(
|
||||
"Please choose an option", ["Check on your cat", "Leave your house"]
|
||||
"Please choose an option",
|
||||
["Check on your cat", "Pet your cat", "Leave your house"],
|
||||
):
|
||||
case "Check on your cat":
|
||||
print(
|
||||
f"{cat.name} - a {cat.traits["size"]} {cat.traits["color"]} with {cat.traits["eyes"]} eyes"
|
||||
)
|
||||
case "Pet your cat":
|
||||
pet(cat)
|
||||
case "Leave your house":
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user