This commit is contained in:
33333-33333 2026-07-11 21:13:39 +09:00
commit d14550dad6
78 changed files with 2827 additions and 563 deletions

View file

@ -350,7 +350,7 @@
const step = Math.min(maxRestore, dt * restore);
const sx = dx / d * step;
const sy = dy / d * step;
if (this.world?.moveTarinaiWithCollision) this.world.moveTarinaiWithCollision(this, sx, sy, { dt, reason: externalActive ? "tarinai-sleep-restore-weak" : "tarinai-sleep-move" });
if (this.world?.moveTarinaiWithCollision) this.world.moveTarinaiWithCollision(this, sx, sy, { dt });
else { this.x += sx; this.y += sy; }
} else if (!externalActive && Math.hypot((this.vx || 0) + (this.impulseVx || 0), (this.vy || 0) + (this.impulseVy || 0)) < 0.35) {
this.x = spot.x;
@ -363,13 +363,13 @@
const moveDx = ((Number.isFinite(this.vx) ? this.vx : 0) + impulseVx) * dt;
const moveDy = ((Number.isFinite(this.vy) ? this.vy : 0) + impulseVy) * dt;
if (Math.hypot(moveDx, moveDy) > 0.001) {
if (this.world?.moveTarinaiWithCollision) this.world.moveTarinaiWithCollision(this, moveDx, moveDy, { dt, reason: "tarinai-sleep-physical-full", maxChecks: 18, maxStep: 10 });
if (this.world?.moveTarinaiWithCollision) this.world.moveTarinaiWithCollision(this, moveDx, moveDy, { dt, maxChecks: 18, maxStep: 10 });
else { this.x += moveDx; this.y += moveDy; }
}
if (this.world?.resolveSolidObstacleCollision) {
const beforeContactX = Number(this.x || 0) || 0;
const beforeContactY = Number(this.y || 0) || 0;
const pushed = this.world.resolveSolidObstacleCollision(this, { maxPasses: 2, searchRadius: Math.max(72, (Number(this.radius) || 22) + 120), maxChecks: 18, slop: 0.28, reason: "tarinai-sleep-full-contact" });
const pushed = this.world.resolveSolidObstacleCollision(this, { maxPasses: 2, searchRadius: Math.max(72, (Number(this.radius) || 22) + 120), maxChecks: 18, slop: 0.28 });
if (pushed) {
this.lastSolidObstacleCollisionAt = this.world.time || 0;
marker?.markSleepExternalMotion?.(this, dt, "sleep-full-contact");
@ -615,8 +615,8 @@
if (this.world?.moveTarinaiWithCollision) {
const motionOnlyPass = Boolean(this._motionOnlyPhysicsPass);
this.world.moveTarinaiWithCollision(this, moveDx, moveDy, motionOnlyPass
? { dt, reason: "tarinai-move-smooth", light: true, maxChecks: this.state === "panic" ? 18 : 14, maxStep: this.state === "panic" ? 12 : 14 }
: { dt, reason: "tarinai-move" });
? { dt, light: true, maxChecks: this.state === "panic" ? 18 : 14, maxStep: this.state === "panic" ? 12 : 14 }
: { dt });
}
else {
this.x += moveDx;
@ -675,19 +675,19 @@
checkLife(dt = 0.016) {
let reason = "";
const activeDiseaseDeathReason = () => {
if (this.zunchiDisease) return "ずんち病";
if (this.sleepDisease) return "ねむり病";
if (this.explosionDisease) return "爆発病";
if (this.fightDisease) return "きずつき病";
if (this.zunchiDisease) return "\u305a\u3093\u3061\u75c5";
if (this.sleepDisease) return "\u306d\u3080\u308a\u75c5";
if (this.explosionDisease) return "\u7206\u767a\u75c5";
if (this.fightDisease) return "\u304d\u305a\u3064\u304d\u75c5";
return "";
};
if (this.energy <= 0) {
reason = this.temperatureDeathReason?.() || activeDiseaseDeathReason() || this.dominantDeathCause("", { lowHealth: true }) || "事故";
reason = this.temperatureDeathReason?.() || activeDiseaseDeathReason() || this.dominantDeathCause("", { lowHealth: true }) || "\u4e8b\u6545";
}
else if (this.hunger >= 108) reason = "飢餓";
else if (this.age >= this.lifeSpan) reason = "天寿を全うした";
else if (this.hunger >= 108) reason = "\u98e2\u9913";
else if (this.age >= this.lifeSpan) reason = "\u5929\u5bff\u3092\u5168\u3046\u3057\u305f";
else if (this.stress >= 124) {
reason = activeDiseaseDeathReason() || this.dominantDeathCause("ストレス過多", { stressDeath: true }) || "ストレス過多";
reason = activeDiseaseDeathReason() || this.dominantDeathCause("\u30b9\u30c8\u30ec\u30b9\u904e\u591a", { stressDeath: true }) || "\u30b9\u30c8\u30ec\u30b9\u904e\u591a";
}
if (reason) this.die(reason);
},