p
This commit is contained in:
parent
d14550dad6
commit
63e10af865
86 changed files with 5400 additions and 1209 deletions
|
|
@ -16,6 +16,7 @@
|
|||
if (p <= 0 && d > radius) continue;
|
||||
const damage = typeof damageFn === "function" ? damageFn(p, ant, d) : Number(damageFn || 0);
|
||||
if (damage > 0) {
|
||||
global.TarinaiAchievements?.recordAntDamageSource?.(ant, opts.source || null, { world: this, reason });
|
||||
ant.hp = Math.max(0, (ant.hp ?? ant.maxHp ?? ANT_WORKER_HP ?? 32) - damage);
|
||||
ant.hpBarTimer = Math.max(ant.hpBarTimer || 0, 1.25);
|
||||
}
|
||||
|
|
@ -118,7 +119,7 @@
|
|||
const d = Math.hypot(dx, dy) || 1;
|
||||
if (d > blastRadius) continue;
|
||||
const p = clamp(1 - d / blastRadius, 0, 1);
|
||||
t.damage(5 + p * 18, "\u7206\u7af9");
|
||||
t.damage(5 + p * 18, "\u7206\u7af9", { source: it });
|
||||
if (t.addStress) t.addStress(22 * p, { threshold: 8 });
|
||||
t.hurtTimer = Math.max(t.hurtTimer, 1.5 + p * 1.8);
|
||||
t.surpriseTimer = Math.max(t.surpriseTimer, 0.85);
|
||||
|
|
@ -152,6 +153,7 @@
|
|||
if (typeof damageNearbyStructures === "function") damageNearbyStructures(this, x, y, blastRadius, 34 * (it.blastScale || 1), it);
|
||||
this.damageAntsInRadius(x, y, blastRadius, p => 5 + p * 18, "\u7206\u7af9", {
|
||||
push: p => (260 + (p * p * 0.55 + p * 0.45) * 920) * 0.42 * (it.blastScale || 1),
|
||||
source: it,
|
||||
});
|
||||
let blastedBalls = 0;
|
||||
for (const ball of (this.itemsOfType ? (this.itemsOfType("ball") || []).concat(this.itemsOfType("balloon") || []) : this.items)) {
|
||||
|
|
@ -248,6 +250,7 @@
|
|||
}
|
||||
this.damageAntsInRadius(x, y, blastRadius, p => 5 + p * 18, "\u7206\u767a\u75c5", {
|
||||
push: p => (260 + (p * p * 0.55 + p * 0.45) * 920) * 0.42 * blastScale,
|
||||
source: t,
|
||||
});
|
||||
for (const ball of (this.itemsOfType ? (this.itemsOfType("ball") || []).concat(this.itemsOfType("balloon") || []) : this.items)) {
|
||||
if (!ball || ball.dead || (ball.type !== "ball" && ball.type !== "balloon")) continue;
|
||||
|
|
@ -387,6 +390,10 @@
|
|||
it.amount = 240;
|
||||
it.vx = Math.cos(a) * deterministicRange(this, "zunchi-burst-speed-x", 260, 560, source, pin, i) + deterministicRange(this, "zunchi-burst-jitter-x", -40, 40, source, pin, i);
|
||||
it.vy = Math.sin(a) * deterministicRange(this, "zunchi-burst-speed-y", 200, 480, source, pin, i) - deterministicRange(this, "zunchi-burst-up", 30, 160, source, pin, i);
|
||||
it.achievementBurstOwnerId = source?.id || "";
|
||||
it.achievementBurstNeverStopped = true;
|
||||
it.achievementBurstLaunchedAt = this.time || 0;
|
||||
if (pin?.type === "oshibyo") it._achievementDangerSource = pin;
|
||||
it.stage = "fresh";
|
||||
if (this.addItem?.(it, "zunchi-burst")) spawned += 1;
|
||||
}
|
||||
|
|
@ -570,7 +577,7 @@
|
|||
if (physicalHit) {
|
||||
target.lastPhysicalCollisionDamageAt = this.time || 0;
|
||||
}
|
||||
if (target.damage) target.damage(amount, normalized);
|
||||
if (target.damage) target.damage(amount, normalized, options);
|
||||
else if (Number.isFinite(target.hp)) target.hp -= amount;
|
||||
return true;
|
||||
},
|
||||
|
|
@ -652,6 +659,7 @@
|
|||
if (!tarinai.becomeTarinaiChampion?.({ fightRecord: true })) return false;
|
||||
this.spawnBubble?.(tarinai.x, tarinai.y - tarinai.radius * 1.35, "\u738B\u8005", "rgba(144,96,24,0.84)");
|
||||
this.log?.(`${tarinai.name}\u306F\u55A7\u5629${total}\u56DE\u3001\u52DD\u7387${Math.round(winRate * 100)}%\u3067\u305F\u308A\u306A\u3044\u738B\u8005\u306B\u306A\u3063\u305F\u3002`, "fight", { participants: other ? [tarinai, other] : [tarinai] });
|
||||
globalThis.TarinaiAchievements?.recordNaturalTarinaiKing?.({ world: this, tarinai, other, wins, losses, total, winRate });
|
||||
return true;
|
||||
},
|
||||
|
||||
|
|
@ -666,7 +674,8 @@
|
|||
const oldName = tarinai.formerName || tarinai.name;
|
||||
if (!tarinai.becomeZunchiSlave?.({ fightRecord: true, locked: true })) return false;
|
||||
this.spawnBubble?.(tarinai.x, tarinai.y - tarinai.radius * 1.20, "\u3076\u308a\u3085\u2026", "rgba(74,91,50,0.78)");
|
||||
this.log?.(`${oldName}\u306f\u55a7\u5629\u30925\u56de\u7d4c\u9a13\u3057\u3001\u52dd\u738750%\u4ee5\u4e0b\u3067\u305a\u3093\u3061\u3069\u308c\u3044\u306b\u306a\u3063\u305f\u3002`, "fight", { participants: other ? [tarinai, other] : [tarinai] });
|
||||
this.log?.(`${oldName}\u306f\u55a7\u5629\u3092${total}\u56de\u7d4c\u9a13\u3057\u3001\u52dd\u738730%\u4ee5\u4e0b\u3067\u305a\u3093\u3061\u3069\u308c\u3044\u306b\u306a\u3063\u305f\u3002`, "fight", { participants: other ? [tarinai, other] : [tarinai] });
|
||||
globalThis.TarinaiAchievements?.recordNaturalZunchiSlave?.({ world: this, tarinai, other, wins, losses, total, winRate });
|
||||
return true;
|
||||
},
|
||||
|
||||
|
|
@ -735,8 +744,8 @@
|
|||
return global.TarinaiCollisionResponseSystem.resolveBallInteractions(this, dt);
|
||||
},
|
||||
|
||||
resolveTarinaiHighSpeedCollisions(dt) {
|
||||
return global.TarinaiCollisionResponseSystem.resolveTarinaiHighSpeedCollisions(this, dt);
|
||||
resolveTarinaiHighSpeedCollisions(dt, opts = {}) {
|
||||
return global.TarinaiCollisionResponseSystem.resolveTarinaiHighSpeedCollisions(this, dt, opts);
|
||||
}
|
||||
}));
|
||||
})(typeof window !== "undefined" ? window : globalThis);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue