mirror of
https://github.com/zyllian/webdog.git
synced 2025-05-10 02:26:42 -07:00
pets being unhappy will now drop behavior
This commit is contained in:
parent
5cc0c80444
commit
0e444ec503
2 changed files with 7 additions and 0 deletions
|
@ -27,6 +27,8 @@
|
|||
const HAPPINESS_EMPTY_STOMACH_MODIFIER = -10 / UPDATES_PER_HOUR;
|
||||
/** how quickly a pet's happiness will be reduced by when their space is messy, per piece of mess */
|
||||
const HAPPINESS_MESS_MODIFIER = -5 / UPDATES_PER_HOUR;
|
||||
/** how quickly a pet's behavior drops when unhappy */
|
||||
const BEHAVIOR_UNHAPPY_MODIFIER = -5 / UPDATES_PER_HOUR;
|
||||
|
||||
/** the amount of happiness gained when the pet is fed (excluding when the pet doesn't yet need food) */
|
||||
const FEED_HAPPINESS = 5;
|
||||
|
@ -192,6 +194,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (this.happiness <= 0) {
|
||||
this.behavior -= BEHAVIOR_UNHAPPY_MODIFIER;
|
||||
}
|
||||
|
||||
if (this.pottyTimer < 0) {
|
||||
this.goPotty();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue