diff --git a/server/sim/content/garrisons/battle.js b/server/sim/content/garrisons/battle.js index 122205b8..214f7029 100644 --- a/server/sim/content/garrisons/battle.js +++ b/server/sim/content/garrisons/battle.js @@ -400,7 +400,10 @@ function applyReader(battle, it) { else battle.removeBuff(u, key); break; case 'act1autochess_gar_eff_respawnTimeByBond': - if (k > 0) S.passiveBuff(battle, u, key, { redeployMul: Math.max(0.05, 1 + S.num(it.bb.respawn_time, 0) * k) }); + // 耀骑士临光's 144: −1.5 % / −3 % per 3 卡西米尔 layers with no minimum in the blackboard (divide_num, respawn_time + // only) — clamped at 0 like every other redeploy multiplier, so a knock-out timer can reach 0 s (GitHub #370; + // until 0.2.1 a 0.05 floor kept it at 5 % of the base time from 192 layers, 96 for the elite) + if (k > 0) S.passiveBuff(battle, u, key, { redeployMul: Math.max(0, 1 + S.num(it.bb.respawn_time, 0) * k) }); else battle.removeBuff(u, key); break; case 'act2autochess_gar_eff_attrByBond_add_onstart': { diff --git a/test/content/garrisons_battle.test.js b/test/content/garrisons_battle.test.js index a4f5f83c..fbb8ec49 100644 --- a/test/content/garrisons_battle.test.js +++ b/test/content/garrisons_battle.test.js @@ -465,6 +465,33 @@ test('ADD_BOND 耀骑士临光 145 / 160 (real chess): self + front get 144 (red } }); +test('respawnTimeByBond 144 has no 5% floor (#370): redeployMul is max(0, 1 + respawn_time * steps)', () => { + for (const [gid, rt] of [['garrison_144_a', -0.015], ['garrison_144_b', -0.03]]) { + assert.equal(GR(gid).bb.respawn_time, rt); + assert.deepEqual(Object.keys(GR(gid).bb).sort(), ['divide_num', 'respawn_time']); + // 96 / 192 layers: the old 0.05 floor bound the elite / the normal form (raw 0.04); 300: below zero + for (const layers of [9, 96, 192, 300]) { + const k = Math.floor(layers / 3); + const want = Math.max(0, 1 + rt * k); + const h = battle({ + units: [{ id: 'op', g: [gid], row: 10, col: 4, o: { stats: { respawnTime: 100 } } }], + bonds: { kazimierzShip: B(layers) }, + }); + const u = h.unit('op'); + approx(u.findBuff(`gar:${gid}`).mods.redeployMul, want, `${gid} @ ${layers}`); + h.b.dealDamage(null, u, { amount: 1e9, type: 'true' }); + assert.equal(u.alive, false); + approx(u.respawnAt - u.deathAt, 100 * want, `${gid} timer @ ${layers}`); + if (want === 0) { + h.step(2); + assert.ok(u.alive && u.deployed, `${gid} @ ${layers}: a 0 s timer brings it straight back`); + assert.equal(h.b.errorCount, 0); + } + } + cover(gid); + } +}); + // --------------------------------------------------------------------------------------------------------------------- // 魔王