depression+sick+inventory+pain
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user