a
This commit is contained in:
parent
d163ceb291
commit
f6d7412744
94 changed files with 3836 additions and 1226 deletions
|
|
@ -290,22 +290,16 @@
|
|||
let occupants = this.world?.nestBoxOccupants ? this.world.nestBoxOccupants(box, Infinity) : [];
|
||||
const now = this.world?.time || 0;
|
||||
if (!alreadyInside && occupants.length >= capacity) {
|
||||
const kingSleepDisplace = Boolean(this.isTarinaiChampion && (this.state === "seek_bed" || this.state === "sleep" || this.sleeping));
|
||||
if (options?.forceDisplace || kingSleepDisplace) {
|
||||
const victim = occupants.find(t => t && t !== this && !t.dead && !t.isTarinaiChampion)
|
||||
|| occupants.find(t => t && t !== this && !t.dead);
|
||||
if (victim) {
|
||||
victim.leaveNestBox?.(box);
|
||||
victim.awakeLockTimer = Math.max(victim.awakeLockTimer || 0, 0.8);
|
||||
victim.fearTimer = Math.max(victim.fearTimer || 0, 0.22);
|
||||
victim.thought = `${containerLabel(box)}\u304b\u3089\u62bc\u3057\u51fa\u3055\u308c\u305f`;
|
||||
victim.pinchThoughtTimer = Math.max(victim.pinchThoughtTimer || 0, 0.65);
|
||||
victim.goIdle?.(`${containerLabel(box)}\u304b\u3089\u62bc\u3057\u51fa\u3055\u308c\u305f`);
|
||||
if (this.isTarinaiChampion) {
|
||||
this.world?.log?.(`${this.name}\u304c${containerLabel(box)}\u306b\u5165\u308a\u3001${victim.name}\u3092\u62bc\u3057\u51fa\u3057\u305f\u3002`, "event", { participants: [this, victim] });
|
||||
}
|
||||
occupants = this.world?.nestBoxOccupants ? this.world.nestBoxOccupants(box, Infinity) : occupants.filter(t => t !== victim);
|
||||
}
|
||||
const victim = globalThis.TarinaiNestSleepSystem?.lowerPriorityNestOccupant?.(this.world, box, this, occupants) || null;
|
||||
if (victim) {
|
||||
victim.leaveNestBox?.(box);
|
||||
victim.awakeLockTimer = Math.max(victim.awakeLockTimer || 0, 0.8);
|
||||
victim.fearTimer = Math.max(victim.fearTimer || 0, 0.22);
|
||||
victim.thought = `${containerLabel(box)}\u304b\u3089\u62bc\u3057\u51fa\u3055\u308c\u305f`;
|
||||
victim.pinchThoughtTimer = Math.max(victim.pinchThoughtTimer || 0, 0.65);
|
||||
victim.goIdle?.(`${containerLabel(box)}\u304b\u3089\u62bc\u3057\u51fa\u3055\u308c\u305f`);
|
||||
this.world?.log?.(`${this.name}\u304c${containerLabel(box)}\u306b\u5165\u308a\u3001${victim.name}\u3092\u62bc\u3057\u51fa\u3057\u305f\u3002`, "event", { participants: [this, victim] });
|
||||
occupants = this.world?.nestBoxOccupants ? this.world.nestBoxOccupants(box, Infinity) : occupants.filter(t => t !== victim);
|
||||
}
|
||||
if (occupants.length >= capacity) return this.abortNestBoxEntry?.(box, containerFullText(box)) || false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue