This commit is contained in:
33333-33333 2026-06-21 22:29:00 +09:00
commit 0a6148c73f
67 changed files with 2653 additions and 1519 deletions

View file

@ -26,6 +26,22 @@
}
const pairBond = this.world.areCoParents?.(this, o);
const mixedZunchiSlave = !!this.isZunchiSlave !== !!o.isZunchiSlave;
if (mixedZunchiSlave && d < 86) {
const nonSlave = this.isZunchiSlave ? o : this;
const slave = this.isZunchiSlave ? this : o;
const nx = (nonSlave.x - slave.x) / d;
const ny = (nonSlave.y - slave.y) / d;
nonSlave.vx += nx * dt * 34;
nonSlave.vy += ny * dt * 34;
nonSlave.fearTimer = Math.max(nonSlave.fearTimer || 0, 0.38 * nonSlave.personalityProfile().fear);
nonSlave.target = slave;
if (nonSlave.state === "idle" || nonSlave.state === "seek_friend") nonSlave.state = "panic";
nonSlave.adjustRelation?.(slave, -dt * 0.08, dt * 0.24, "zunchi_slave_avoid");
slave.adjustRelation?.(nonSlave, -dt * 0.02, 0, "zunchi_slave_avoid");
if (Math.random() < dt * 0.35) nonSlave.surpriseTimer = Math.max(nonSlave.surpriseTimer || 0, 0.18);
continue;
}
const overlap = this.radius + o.radius - d;
if (overlap > -2) {
const push = (overlap + 6) * (pairBond ? 0.08 : 0.17);
@ -69,6 +85,8 @@
o.stress = clamp(o.stress + 2.8, 0, 130);
const damageToThis = o.outgoingDamage ? o.outgoingDamage(1.2) : 1.2;
const damageToOther = this.outgoingDamage ? this.outgoingDamage(1.6) : 1.6;
this.world.emit?.("fight:hit", { attacker: o, target: this, amount: damageToThis, cause: "\u55a7\u5629" });
this.world.emit?.("fight:hit", { attacker: this, target: o, amount: damageToOther, cause: "\u55a7\u5629" });
this.damage(damageToThis, "\u55a7\u5629");
o.damage(damageToOther, "\u55a7\u5629");
this.world.maybeDefeatFromFightDamage?.(this, o, damageToThis);
@ -111,7 +129,8 @@
this.world.startConflict(this, o);
}
if (!this.isZunchiSlave && !o.isZunchiSlave && !this.sleepDisease && !o.sleepDisease && !this.fightDisease && !o.fightDisease && d < (loveDrug ? 44 : 36) && this.reproductionTimer <= 0 && o.reproductionTimer <= 0 && this.fightTimer <= 0 && o.fightTimer <= 0) {
const compatibleBirthStatus = this.isZunchiSlave === o.isZunchiSlave;
if (compatibleBirthStatus && !this.sleepDisease && !o.sleepDisease && !this.fightDisease && !o.fightDisease && d < (loveDrug ? 44 : 36) && this.reproductionTimer <= 0 && o.reproductionTimer <= 0 && this.fightTimer <= 0 && o.fightTimer <= 0) {
const enough = loveDrug ? (this.hunger < 90 && o.hunger < 92 && this.energy > 18 && o.energy > 18) : (this.hunger < 55 && o.hunger < 60 && this.energy > 44 && o.energy > 44);
const lonelyBond = loveDrug ? (this.loneliness > 4 || o.loneliness > 4 || this.affection > 0 || o.affection > 0) : (this.loneliness > 24 || o.loneliness > 24);
if (enough && lonelyBond && Math.random() < dt * (loveDrug ? 0.72 : 0.25)) {
@ -295,7 +314,7 @@
this.vx *= Math.pow(0.84, dt * 8);
this.vy *= Math.pow(0.84, dt * 8);
const maxV = (this.state === "panic" ? 116 : (this.state === "zunchi_sick" ? 54 : (this.state === "fight_sick" ? 68 : 76))) * Math.max(1, itemSpeedMul || 1);
const maxV = (this.state === "panic" ? 116 : (this.state === "zunchi_sick" ? 54 : (this.state === "fight_sick" ? 68 : 76))) * Math.max(1, itemSpeedMul || 1) * (this.geneticStatRatio ? this.geneticStatRatio("speed") : 1);
const v = Math.hypot(this.vx, this.vy);
if (v > maxV) {
this.vx = this.vx / v * maxV;
@ -362,6 +381,7 @@
this.releasedLiveToken = this.liveToken || 0;
this.world.releaseTarinaiLiveId?.(this);
audio.death();
this.world.emit?.("tarinai:died", { tarinai: this, reason: finalReason });
this.world.log(`${this.name}\u306f\u9759\u304b\u306a\u75d5\u8de1\u3092\u6b8b\u3057\u305f\u3002\u6b7b\u56e0: ${finalReason}`, "death", { participants: [this] });
if (this.world.selected === this) this.world.selected = null;
}