1.6
This commit is contained in:
parent
ee22e1a929
commit
88f618cadf
55 changed files with 1299 additions and 447 deletions
|
|
@ -74,6 +74,13 @@ const d = contact.distance;
|
|||
|
||||
if (it.type === "ball" || it.type === "balloon") {
|
||||
const touch = clamp(1 - d / (tarinai.radius + it.r + 12), 0, 1);
|
||||
if (touch > 0.02) {
|
||||
const now = tarinai.world?.time || 0;
|
||||
if (typeof tarinai.adjustPersonality === "function" && now >= (tarinai.nextToyOpennessAt || 0)) {
|
||||
tarinai.nextToyOpennessAt = now + rand(3.2, 5.6);
|
||||
tarinai.adjustPersonality("openness", 0.0011 + touch * 0.0015, "after touching a toy");
|
||||
}
|
||||
}
|
||||
if (tarinai.state === "play_ball" || tarinai.target === it || tarinai.shouldApplyPersonalityBehavior("openness", 1)) {
|
||||
tarinai.goodMode = "smile";
|
||||
applyNeedRelief(tarinai, { fulfill: -dt * (4 + touch * 8), social: -dt * (1 + touch * 3) });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue