This commit is contained in:
33333-33333 2026-07-18 22:15:26 +09:00
commit d163ceb291
76 changed files with 1385 additions and 524 deletions

View file

@ -290,7 +290,7 @@
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 && box.type === "nest_box" && (this.state === "seek_bed" || this.state === "sleep" || this.sleeping));
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);
@ -301,6 +301,9 @@
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);
}
}
@ -595,13 +598,14 @@
this.burnWanderAngle = Number.isFinite(this.burnWanderAngle) ? this.burnWanderAngle : deterministicAngle(this.world, "tarinai-burn-angle", this, source || null);
if (typeof this.enterPanic === "function") this.enterPanic({ threat: source, target: null, reason: text, fear: 2.2, wake: true, cause: "burning", surpriseTimer: 0.65, awakeLockTimer: 0.8 });
else this.setActionState?.("panic", { target: null, reason: text, wake: true });
this.world?.effects?.push(new Effect("ring", this.x, this.y, { size: Math.max(26, this.radius * 1.35), life: 0.26, color: "rgba(255,110,36,0.58)" }));
this.world?.queueEffect?.("ring", this.x, this.y, { size: Math.max(26, this.radius * 1.35), life: 0.26, color: "rgba(255,110,36,0.58)" });
const now = Number(this.world?.time || 0);
if (force || !already || now >= Number(this.nextBurnVoiceAt || -999)) {
this.nextBurnVoiceAt = now + 2.6;
this.bubble?.("\u3042\u3061\u3085\u3044\uff01", 1.35, "rgba(214,82,38,0.90)", { force: true });
}
this.recordChangeCause?.("\u708e\u4e0a", "\u708e\u4e0a");
if (!already) this.world?.log?.(`${this.name}\u306b\u706b\u304c\u71c3\u3048\u79fb\u3063\u305f\u3002`, "accident", { participants: [this] });
if (ignitedDuringBirthRitual) globalThis.TarinaiAchievements?.recordIgnition?.({ world: this.world, tarinai: this, source });
return true;
},
@ -614,7 +618,8 @@
this.firePanicTimer = Math.max(this.firePanicTimer || 0, 0.25);
this.hurtTimer = Math.max(this.hurtTimer || 0, 0.35);
if (reason) this.thought = reason;
this.world?.effects?.push(new Effect("ring", this.x, this.y, { size: Math.max(22, this.radius * 1.2), life: 0.22, color: "rgba(108,192,236,0.60)" }));
this.world?.queueEffect?.("ring", this.x, this.y, { size: Math.max(22, this.radius * 1.2), life: 0.22, color: "rgba(108,192,236,0.60)" });
this.world?.log?.(`${this.name}\u306e\u706b\u304c\u6d88\u3048\u305f\u3002`, "accident", { participants: [this] });
return true;
},
@ -689,9 +694,9 @@
if (this.addStress) this.addStress(dt * 0.22, { threshold: 9, duration: 3.6 });
if (deterministicChance(this.world, "explosion-disease-spark", dt * 2.1, this)) {
const a = deterministicAngle(this.world, "explosion-disease-spark-angle", this);
this.world?.effects?.push(new Effect("explosion", this.x + Math.cos(a) * this.radius * deterministicRange(this.world, "explosion-disease-spark-rx", 0.2, 0.9, this), this.y + Math.sin(a) * this.radius * deterministicRange(this.world, "explosion-disease-spark-ry", 0.1, 0.8, this), {
this.world?.queueEffect?.("explosion", this.x + Math.cos(a) * this.radius * deterministicRange(this.world, "explosion-disease-spark-rx", 0.2, 0.9, this), this.y + Math.sin(a) * this.radius * deterministicRange(this.world, "explosion-disease-spark-ry", 0.1, 0.8, this), {
vx: Math.cos(a) * deterministicRange(this.world, "explosion-disease-spark-vx", 10, 38, this), vy: Math.sin(a) * deterministicRange(this.world, "explosion-disease-spark-vy", 10, 38, this) - deterministicRange(this.world, "explosion-disease-spark-up", 8, 22, this), size: deterministicRange(this.world, "explosion-disease-spark-size", 5, 12, this), life: deterministicRange(this.world, "explosion-disease-spark-life", 0.18, 0.42, this), color: "rgba(255,64,48,0.86)"
}));
});
}
if (this.explosionDiseaseTimer <= 0.01) {
this.world?.explodeDiseaseTarinai?.(this);