depression+sick+inventory+pain

This commit is contained in:
2026-06-26 19:30:30 -04:00
parent 7e85543c21
commit 6b44022022
4 changed files with 130 additions and 15 deletions

View File

@@ -41,6 +41,11 @@ def reconcile(cat: model.Cat, now):
cat.happiness -= content.HUNGER_SADNESS_PENALTY_PER_HOUR * elapsed_hours
cat.happiness = _clamp(cat.happiness)
if cat.happiness == 0:
cat.depressed = True
if cat.fullness == 0:
cat.sick = True
cat.last_updated = now
@@ -52,6 +57,24 @@ def feed(player, cat, amount=content.FOOD_RESTORE):
return True
def cure_sick(save, restore=content.MEDICINE_RESTORE):
if save.player.inventory["medicine"] <= 0:
return False
save.cat.fullness = restore
save.cat.sick = False
save.player.inventory["medicine"] -= 1
return True
def cure_depressed(save, restore=content.CATNIP_RESTORE):
if save.player.inventory["catnip"] <= 0:
return False
save.cat.happiness = restore
save.cat.depressed = False
save.player.inventory["catnip"] -= 1
return True
def excite(cat, amount=100):
cat.happiness += amount
cat.happiness = _clamp(cat.happiness)