not bad
This commit is contained in:
parent
2741b93dea
commit
434f07cc4e
103 changed files with 8387 additions and 8152 deletions
|
|
@ -118,26 +118,11 @@
|
|||
play: clamp((base.play || 1) * (1 + e.openness * 0.45), 0.45, 2.10),
|
||||
};
|
||||
},
|
||||
|
||||
personalityLabel() {
|
||||
const tags = getPersonalityTraitTags(this);
|
||||
return tags.length ? tags.join(" / ") : "\u4e2d\u7acb";
|
||||
},
|
||||
|
||||
personalityTags() { return getPersonalityTraitTags(this); },
|
||||
|
||||
adjustPersonality(key, delta, reason = "") { return adjustPersonality(this, key, delta, reason); },
|
||||
|
||||
shouldApplyPersonalityBehavior(key, direction = 1) { return shouldApplyPersonalityBehavior(this, key, direction); },
|
||||
|
||||
fightWinCount() {
|
||||
return this.totalFightWins || 0;
|
||||
},
|
||||
|
||||
fightLossCount() {
|
||||
return this.totalFightLosses || 0;
|
||||
},
|
||||
|
||||
maybeBecomeTimidAfterDamage(cause = "") {
|
||||
if (this.dead) return false;
|
||||
const losses = this.totalFightLosses || 0;
|
||||
|
|
@ -272,16 +257,13 @@
|
|||
const before = this.stress || 0;
|
||||
if (this.needs && typeof calculateStressFromNeeds === "function") {
|
||||
const nextSafety = typeof quantizeNeed === "function" ? quantizeNeed((this.needs.safety || 0) + shock) : Math.min(100, (this.needs.safety || 0) + shock);
|
||||
this.stress = calculateStressFromNeeds({ ...this.needs, safety: nextSafety });
|
||||
this.stress = typeof applyGroundStressModifier === "function" ? applyGroundStressModifier(this, calculateStressFromNeeds({ ...this.needs, safety: nextSafety })) : calculateStressFromNeeds({ ...this.needs, safety: nextSafety });
|
||||
}
|
||||
const gained = Math.max(delta, Math.max(0, (this.stress || 0) - before));
|
||||
const threshold = opts.threshold ?? 8;
|
||||
if (gained >= threshold) this.showStressBar(opts.duration ?? 4.2);
|
||||
return gained;
|
||||
},
|
||||
|
||||
damageCauseLabel(reason = "") { return HEALTH.causeLabel(reason); },
|
||||
|
||||
recentDamageCause(maxAge = 10) { return HEALTH.recentDamageCause(this, maxAge); },
|
||||
|
||||
rememberDamage(amount, reason = "") { return HEALTH.rememberDamage(this, amount, reason); },
|
||||
|
|
@ -318,22 +300,6 @@
|
|||
familyJoined() {
|
||||
return Boolean(this.hasPaired || (this.parents || []).length || (this.children || []).length);
|
||||
},
|
||||
|
||||
nearestCoParent(maxRange = 220) {
|
||||
let best = null;
|
||||
let bestD = maxRange;
|
||||
for (const o of this.world.tarinai || []) {
|
||||
if (!o || o === this || o.dead) continue;
|
||||
if (!(this.world.areCoParents?.(this, o))) continue;
|
||||
const d = dist(this, o);
|
||||
if (d < bestD) {
|
||||
best = o;
|
||||
bestD = d;
|
||||
}
|
||||
}
|
||||
return best;
|
||||
},
|
||||
|
||||
displayGeneration() {
|
||||
return this.familyJoined() ? this.generation : null;
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue