pets being unhappy will now drop behavior

This commit is contained in:
zyl 2024-06-25 13:48:56 -07:00
parent 5cc0c80444
commit 0e444ec503
No known key found for this signature in database
2 changed files with 7 additions and 0 deletions

View file

@ -80,6 +80,7 @@ embed:
<summary>06/25/2024</summary> <summary>06/25/2024</summary>
<ul> <ul>
<li>pets now are simulated even if the page is unloaded</li> <li>pets now are simulated even if the page is unloaded</li>
<li>when pets are unhappy &lt;redacted&gt;<!-- their hidden behavior stat drops --></li>
</p> </p>
</details> </details>
</details> </details>

View file

@ -27,6 +27,8 @@
const HAPPINESS_EMPTY_STOMACH_MODIFIER = -10 / UPDATES_PER_HOUR; 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 */ /** 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; 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) */ /** the amount of happiness gained when the pet is fed (excluding when the pet doesn't yet need food) */
const FEED_HAPPINESS = 5; const FEED_HAPPINESS = 5;
@ -192,6 +194,10 @@
} }
} }
if (this.happiness <= 0) {
this.behavior -= BEHAVIOR_UNHAPPY_MODIFIER;
}
if (this.pottyTimer < 0) { if (this.pottyTimer < 0) {
this.goPotty(); this.goPotty();
} }