gtg
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import string
|
||||
|
||||
from untitled import content
|
||||
from untitled import content, model
|
||||
|
||||
|
||||
def validate_cat_name(name, auto_gen=False):
|
||||
@@ -17,13 +17,16 @@ def validate_cat_name(name, auto_gen=False):
|
||||
return "Your cat's name needs at least 1 letter."
|
||||
|
||||
|
||||
def reconcile(cat, now):
|
||||
def reconcile(cat: model.Cat, now):
|
||||
elapsed_hours = (now - cat.last_updated) / 3600
|
||||
if elapsed_hours <= 0:
|
||||
return
|
||||
cat.fullness -= content.HUNGER_DECAY_PER_HOUR * elapsed_hours
|
||||
if cat.fullness < 0:
|
||||
cat.fullness = 0
|
||||
cat.happiness -= content.BASE_HAPPINESS_DECAY_PER_HOUR * elapsed_hours
|
||||
if cat.happiness < 0:
|
||||
cat.happiness = 0
|
||||
cat.last_updated = now
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user