update feed and pet
This commit is contained in:
@@ -106,6 +106,10 @@ def shop(cat: Cat):
|
|||||||
|
|
||||||
|
|
||||||
def pet(cat: Cat):
|
def pet(cat: Cat):
|
||||||
|
if cat.happiness == 100:
|
||||||
|
print("Your cat is already fully happy! They don't want any more pets.")
|
||||||
|
return
|
||||||
|
original_happiness = cat.happiness
|
||||||
print(f"Mash keys to pet {cat.name}, press enter when you're done.")
|
print(f"Mash keys to pet {cat.name}, press enter when you're done.")
|
||||||
count = 0
|
count = 0
|
||||||
last = None
|
last = None
|
||||||
@@ -121,28 +125,50 @@ def pet(cat: Cat):
|
|||||||
last = key
|
last = key
|
||||||
print(f"\rPets: {count}", end="", flush=True)
|
print(f"\rPets: {count}", end="", flush=True)
|
||||||
else:
|
else:
|
||||||
|
cat.happiness -= 5
|
||||||
print(f"\n{cat.name} ran away to protect your hands")
|
print(f"\n{cat.name} ran away to protect your hands")
|
||||||
return
|
return
|
||||||
if count == 0:
|
if count == 0:
|
||||||
print("You didn't pet your cat at all.")
|
print("You didn't pet your cat at all.")
|
||||||
elif count < 50:
|
elif count < 50:
|
||||||
|
cat.happiness += 5
|
||||||
print(f"You didn't pet your cat enough, {cat.name} wants more pets.")
|
print(f"You didn't pet your cat enough, {cat.name} wants more pets.")
|
||||||
elif count <= 200:
|
elif count <= 200:
|
||||||
|
cat.happiness += 15
|
||||||
print(f"You pet {cat.name} a lot, {cat.name} is happy.")
|
print(f"You pet {cat.name} a lot, {cat.name} is happy.")
|
||||||
elif count > 75000:
|
elif count <= 500:
|
||||||
print(f"{cat.name} is getting extremely worried about your hands.")
|
cat.happiness += 20
|
||||||
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.")
|
print(f"You pet {cat.name} a lot. {cat.name} is very happy.")
|
||||||
|
elif count <= 1000:
|
||||||
|
cat.happiness += 20
|
||||||
|
print(f"You pet {cat.name} an absurd amount of times.")
|
||||||
|
elif count <= 10000:
|
||||||
|
cat.happiness += 15
|
||||||
|
print(f"{cat.name} has had enough pets.")
|
||||||
|
elif count <= 20000:
|
||||||
|
cat.happiness += 10
|
||||||
|
print(f"What are you even doing at this point?")
|
||||||
|
elif count <= 50000:
|
||||||
|
cat.happiness += 5
|
||||||
|
print("You should probably stop now.")
|
||||||
|
elif count <= 75000:
|
||||||
|
cat.happiness += 2
|
||||||
|
print("Seriously. Stop.")
|
||||||
|
else:
|
||||||
|
cat.happiness += 1
|
||||||
|
print(f"{cat.name} is getting extremely worried about your hands.")
|
||||||
|
|
||||||
|
if cat.happiness > 100:
|
||||||
|
cat.happiness = 100
|
||||||
|
print("Your cat's happiness went above 100% and was capped back down to 100%.")
|
||||||
|
if cat.happiness < original_happiness:
|
||||||
|
print(
|
||||||
|
f"You lost 5% happiness due to stressing your cat. Before petting, your cat was {original_happiness}% happy. You lost {original_happiness-cat.happiness}% happiness. Your cat is now {cat.happiness}% happy."
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
print(
|
||||||
|
f"Your cat is now {cat.happiness}% percent happy. Before petting, your cat was {original_happiness}% happy. You gained {cat.happiness-original_happiness}% happiness."
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def feed(cat: Cat):
|
def feed(cat: Cat):
|
||||||
@@ -150,7 +176,10 @@ def feed(cat: Cat):
|
|||||||
print(f"You don't have any food. {cat.name} is sad.")
|
print(f"You don't have any food. {cat.name} is sad.")
|
||||||
return
|
return
|
||||||
cat.inventory["Food"] -= 1
|
cat.inventory["Food"] -= 1
|
||||||
print(f"You feed {cat.name}, {cat.name} is happy")
|
cat.fullness += 30
|
||||||
|
if cat.fullness >= 100:
|
||||||
|
cat.fullness = 100
|
||||||
|
print(f"You feed {cat.name}, {cat.name} is now {cat.fullness}/100 full.")
|
||||||
|
|
||||||
|
|
||||||
def storage(cat: Cat):
|
def storage(cat: Cat):
|
||||||
@@ -185,7 +214,7 @@ def house(cat: Cat):
|
|||||||
print(
|
print(
|
||||||
f"{cat.name} - a {cat.traits["size"]} {cat.traits["color"]} with {cat.traits["eyes"]} eyes."
|
f"{cat.name} - a {cat.traits["size"]} {cat.traits["color"]} with {cat.traits["eyes"]} eyes."
|
||||||
)
|
)
|
||||||
print(f"Happiness level: {round(cat.happiness,1)}")
|
print(f"Happiness: {round(cat.happiness,1)}%")
|
||||||
print(f"Fullness: {round(cat.fullness,1)}/100")
|
print(f"Fullness: {round(cat.fullness,1)}/100")
|
||||||
print(f"You have ${cat.money}.")
|
print(f"You have ${cat.money}.")
|
||||||
case "Pet your cat":
|
case "Pet your cat":
|
||||||
|
|||||||
Reference in New Issue
Block a user