This commit is contained in:
33333-33333 2026-06-23 18:11:42 +09:00
commit 54aff02658
27 changed files with 1700 additions and 1034 deletions

View file

@ -26,7 +26,7 @@
this.zunchiDiseaseSeverity = 0;
this.zunchiDiseaseCooldown = 18;
this.zunchiStain = clamp((this.zunchiStain || 0) - 35, 0, 100);
this.stress = clamp(this.stress - 8, 0, 130);
if (typeof applyNeedRelief === "function") applyNeedRelief(this, { health: -18, safety: -6 });
this.thought = reason || "\u305a\u3093\u3061\u75c5\u304c\u6cbb\u307e\u3063\u305f";
audio.heal?.();
this.world?.spawnBubble?.(this.x, this.y - this.radius * 1.18, "\u306f\u3046", "rgba(62,104,62,0.78)");
@ -61,7 +61,7 @@
}
if (this.zunchiDisease) {
this.zunchiDiseaseSeverity = clamp((this.zunchiDiseaseSeverity || 0.7) + dt * 0.004, 0, 1.25);
this.stress = clamp(this.stress + dt * (0.28 + 0.18 * this.zunchiDiseaseSeverity), 0, 130);
if (typeof applyNeedShock === "function") applyNeedShock(this, { health: dt * (5 + 4 * this.zunchiDiseaseSeverity) });
this.energy = clamp(this.energy - dt * 0.035 * this.zunchiDiseaseSeverity, 0, 100);
if (this.energy > 82) this.zunchiDiseaseSeverity = Math.max(0, this.zunchiDiseaseSeverity - dt * (this.energy > 94 ? 0.020 : 0.010));
this.emitZunchiDiseaseEffect(dt);
@ -136,7 +136,7 @@
this.explosionDiseaseTimer = 0;
this.thought = reason || "\u7206\u767a\u75c5\u304c\u6cbb\u3063\u305f";
audio.heal?.();
this.stress = clamp(this.stress - 10, 0, 130);
if (typeof applyNeedRelief === "function") applyNeedRelief(this, { health: -22, safety: -8 });
this.world?.spawnBubble?.(this.x, this.y - this.radius * 1.18, "\u306f\u3046", "rgba(82,126,88,0.76)");
this.world?.log?.(`${this.name}\u306e\u7206\u767a\u75c5\u304c\u6cbb\u3063\u305f\u3002`, "accident", { participants: [this] });
this.world?.emit?.("disease:cured", { tarinai: this, diseaseId: "disease_explosion", reason });
@ -168,7 +168,7 @@
this.fightDiseaseCooldown = 20;
this.thought = reason || "\u304d\u305a\u3064\u304d\u75c5\u304c\u6cbb\u3063\u305f";
audio.heal?.();
this.stress = clamp(this.stress - 12, 0, 130);
if (typeof applyNeedRelief === "function") applyNeedRelief(this, { health: -24, safety: -10 });
this.world?.spawnBubble?.(this.x, this.y - this.radius * 1.18, "\u306f\u3046", "rgba(82,126,88,0.76)");
this.world?.log?.(`${this.name}\u306e\u304d\u305a\u3064\u304d\u75c5\u304c\u6cbb\u3063\u305f\u3002`, "fight", { participants: [this] });
this.world?.emit?.("disease:cured", { tarinai: this, diseaseId: "disease_fight", reason });
@ -311,7 +311,7 @@
applyWaterEffect(dt, source = "water") {
const power = Math.max(0, dt || 0);
this.stress = clamp(this.stress - power * 2.4, 0, 130);
if (typeof applyNeedRelief === "function") applyNeedRelief(this, { health: -power * 12, safety: -power * 6 });
this.energy = clamp(this.energy + power * 0.5, 0, 100);
this.hunger = clamp(this.hunger - power * 0.2, 0, 115);
this.zunchiStain = clamp((this.zunchiStain || 0) - power * 10.5, 0, 100);
@ -329,7 +329,7 @@
this.fightDiseaseCooldown = Math.max(0, (this.fightDiseaseCooldown || 0) - dt);
if (this.explosionDisease) {
this.explosionDiseaseTimer = Math.max(0, (this.explosionDiseaseTimer || 0) - dt);
this.addStress ? this.addStress(dt * 0.22, { threshold: 9, duration: 3.6 }) : (this.stress = clamp(this.stress + dt * 0.22, 0, 130));
if (this.addStress) this.addStress(dt * 0.22, { threshold: 9, duration: 3.6 });
if (Math.random() < dt * 2.1) {
const a = rand(0, Math.PI * 2);
this.world?.effects?.push(new Effect("explosion", this.x + Math.cos(a) * this.radius * rand(0.2, 0.9), this.y + Math.sin(a) * this.radius * rand(0.1, 0.8), {
@ -353,7 +353,7 @@
this.recoverFightDisease("\u81ea\u7136\u306b\u304d\u305a\u3064\u304d\u75c5\u304c\u6cbb\u3063\u305f");
}
if (this.fightDisease) {
this.stress = clamp(this.stress + dt * 0.16, 0, 130);
if (typeof applyNeedShock === "function") applyNeedShock(this, { health: dt * 3, safety: dt * 2 });
if (Math.random() < dt * 0.30) this.wanderAngle += rand(-2.8, 2.8);
if (Math.random() < dt * 0.08) this.bubble("?", 2.6, "rgba(150,78,44,0.80)");
}