Deploy-timed skills run the normal duration lifecycle: one charge on deployment, a duration bar, a real end, again on the next deployment (#109)
宴 S2, 斯卡蒂 S2, 野鬃 S1, 砾 S1 / S2, 伊内丝 S3, 缄默德克萨斯 S1–S3 and 耀骑士临光 S2 used a separate timed buff while the skill stayed active; equipment and bond effects that read the skill state now see it end. 伊内丝's first sentry placement starts no skill. Contributed by @Sukvii.
This commit is contained in:
1 parent
ede8e7e773
commit
ffdb1293c4
22 files changed
+607
-104
No files matched your search
@@ -265,6 +265,13 @@ test('伊内丝 S3 独影归途: first deployment leaves a sentry and retreats;
|
||||
const sk = D(id, 2).skill, bb = sk.bb;
|
||||
const h = battle([U(id, 10, 5, 2)], { flags: { dpInit: 99, dpPerSec: 0 } });
|
||||
const u = h.unit(id);
|
||||
h.b.start();
|
||||
assert.equal(u.skill.kind, 'duration');
|
||||
assert.equal(u.skill.active, false, 'first deployment does not activate the skill');
|
||||
assert.equal(u.skill.activations, 0);
|
||||
assert.equal(h.hooksOf('skillStart').filter((c) => c.unit === u).length, 0, 'placing a sentry emits no skillStart');
|
||||
assert.equal(u.skill.timeLeft, 0, 'first deployment places the sentry without a full effect window');
|
||||
assert.equal(u.findBuff('ines:s3'), null);
|
||||
const near = [];
|
||||
for (let i = 0; i < 3; i++) near.push(h.spawn('enemy_dummy', { pos: [10, 6] }), h.spawn('enemy_dummy', { pos: [10, 4] }));
|
||||
const far = h.spawn('enemy_dummy', { pos: [10, 8] });
|
||||
@@ -273,9 +280,14 @@ test('伊内丝 S3 独影归途: first deployment leaves a sentry and retreats;
|
||||
assert.ok(left && left.reason === 'retreat', `${id}: leaves right after the first deployment`);
|
||||
assert.ok(h.runUntil(() => u.alive && u.deployed, 2), 'redeploy timer refreshed: back at once');
|
||||
const buff = u.findBuff('ines:s3');
|
||||
assert.ok(buff, 'passive buff on the redeploy');
|
||||
assert.ok(buff, 'ATK effect on the redeploy');
|
||||
approx(buff.mods.atkPct, bb.atk, 1e-9);
|
||||
approx(buff.timeLeft, sk.duration, 0.1);
|
||||
approx(u.skill.timeLeft, sk.duration, 0.1);
|
||||
assert.equal(u.skill.active, true);
|
||||
assert.equal(u.skill.activations, 1);
|
||||
assert.equal(h.hooksOf('skillStart').filter((c) => c.unit === u).length, 1, 'the redeployment starts the skill once');
|
||||
assert.equal(u.skill.ready, false);
|
||||
assert.equal(h.snapshot().units.find((t) => t[0] === u.id)[6], sk.duration);
|
||||
const recall = dmgBy(h, u, tagged('sentryRecall'));
|
||||
assert.equal(recall.length, bb.max_target, `${id}: recall hits ≤ ${bb.max_target} of 6`);
|
||||
assert.ok(recall.every((c) => near.includes(c.target)) && !recall.some((c) => c.target === far));
|
||||
@@ -287,6 +299,15 @@ test('伊内丝 S3 独影归途: first deployment leaves a sentry and retreats;
|
||||
assert.ok(hits > 0);
|
||||
assert.equal(h.b.getPlayer('p1').dp, dpAt + hits * bb.cost, 'one DP per damage while the passive lasts');
|
||||
assert.equal(h.hooksOf('death').filter((c) => c.unit === u).length, 1, 'only the first deployment leaves');
|
||||
h.run(sk.duration);
|
||||
assert.equal(u.skill.active, false);
|
||||
assert.equal(u.skill.ready, false);
|
||||
assert.equal(u.findBuff('ines:s3'), null);
|
||||
const dpEnd = h.b.getPlayer('p1').dp;
|
||||
h.run(2);
|
||||
assert.equal(h.b.getPlayer('p1').dp, dpEnd, 'no skill DP after the actual window ends');
|
||||
assert.equal(h.hooksOf('death').filter((c) => c.unit === u).length, 1, 'stays deployed after the window');
|
||||
assert.deepEqual(h.hooksOf('skillEnd').filter((c) => c.unit === u).map((c) => c.reason), ['duration']);
|
||||
checkInvariants(h.b);
|
||||
}
|
||||
});
|
||||
@@ -611,10 +632,11 @@ test('缄默德克萨斯 S1 细雨无声: passive ATK up for its duration; hits
|
||||
const h = battle([U(id, 10, 4, 0)]);
|
||||
h.step();
|
||||
const u = h.unit(id);
|
||||
const buff = u.findBuff('texas2:drizzle');
|
||||
assert.ok(buff, `${id}: passive active on deployment`);
|
||||
approx(buff.mods.atkPct, bb.atk, 1e-9);
|
||||
assert.ok(u.findBuff('texas2:rainAtk'), 'talent 德克萨斯传统 ATK during the passive');
|
||||
assert.equal(u.skill.kind, 'duration');
|
||||
assert.equal(u.skill.active, true);
|
||||
assert.equal(u.skill.charges, 0);
|
||||
approx(u.skill.spec.mods.atkPct, bb.atk + D(id, 0).talents[0].bb.atk, 1e-9, 'skill and 德克萨斯传统 ATK');
|
||||
assert.equal(h.snapshot().units.find((t) => t[0] === u.id)[6], sk.duration);
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 5] });
|
||||
h.run(3);
|
||||
assert.ok(e.s.flags.silence, 'hit target silenced (失去特殊能力)');
|
||||
@@ -623,7 +645,10 @@ test('缄默德克萨斯 S1 细雨无声: passive ATK up for its duration; hits
|
||||
assert.ok(dot.length >= 2, `a DoT tick every second although she re-hits faster (${dot.length})`);
|
||||
for (const c of dot) approx(c.amount, bb['attack@texas2_s_1[dot].dot_damage'], 1e-9, 'fixed arts per second (RES 0)');
|
||||
h.run(sk.duration);
|
||||
assert.ok(!u.findBuff('texas2:drizzle'), 'ends with the skill duration');
|
||||
assert.equal(u.skill.active, false, 'ends with the skill duration');
|
||||
assert.equal(u.skill.ready, false);
|
||||
assert.equal(h.hooksOf('skillEnd').filter((c) => c.unit === u && c.reason === 'duration').length, 1);
|
||||
assert.ok(e.s.flags.silence && e.findBuff(`texas2:drizzleDot:${u.id}`), 'applied enemy effects keep their own duration');
|
||||
h.run(bb['attack@silence'] + 1);
|
||||
assert.ok(!e.s.flags.silence && !e.findBuff(`texas2:drizzleDot:${u.id}`), 'no new silence / DoT after the passive');
|
||||
}
|
||||
@@ -657,8 +682,8 @@ test('缄默德克萨斯 S2 阵雨连绵: deploy burst atk_scale arts + RES down
|
||||
approx(burst[0].amount, u.s.atk * bb.atk_scale * 0.5, 1e-6, 'arts burst vs RES 50');
|
||||
approx(e.s.res, 50 * (1 + bb.magic_resistance), 1e-6, 'RES down');
|
||||
assert.equal(far.s.res, 50);
|
||||
approx(u.findBuff('texas2:shower').mods.atkPct, bb.atk, 1e-9);
|
||||
approx(u.findBuff('texas2:shower').timeLeft, sk.duration, 1e-6);
|
||||
approx(u.skill.spec.mods.atkPct, bb.atk + D(id, 1).talents[0].bb.atk, 1e-9);
|
||||
approx(u.skill.timeLeft, sk.duration, 1e-6);
|
||||
h.run(2);
|
||||
const hits = dmgBy(h, u, (c) => c.dmg.isAttack);
|
||||
assert.ok(hits.length >= 2 && hits.every((c) => c.type === 'arts'), 'arts attacks');
|
||||
@@ -666,6 +691,8 @@ test('缄默德克萨斯 S2 阵雨连绵: deploy burst atk_scale arts + RES down
|
||||
for (const c of hits) per.set(c.dmg.attackId, (per.get(c.dmg.attackId) ?? 0) + 1);
|
||||
assert.ok([...per.values()].every((v) => v === 2), 'double hits');
|
||||
h.run(sk.duration);
|
||||
assert.equal(u.skill.active, false);
|
||||
assert.equal(u.skill.ready, false);
|
||||
const n0 = dmgBy(h, u, (c) => c.dmg.isAttack).length;
|
||||
h.run(3);
|
||||
const late = dmgBy(h, u, (c) => c.dmg.isAttack).slice(n0);
|
||||
@@ -673,6 +700,57 @@ test('缄默德克萨斯 S2 阵雨连绵: deploy burst atk_scale arts + RES down
|
||||
}
|
||||
});
|
||||
|
||||
test('缄默德克萨斯 S1/S2/S3: first kill reopens a full window, including a kill inside the deployment burst', () => {
|
||||
for (const id of pair('chess_char_4_16_a')) for (const index of [0, 1, 2]) {
|
||||
const life = [];
|
||||
const h = battle([U(id, 10, 4, index)], { extra: { setup(b) {
|
||||
for (const name of ['skillStart', 'skillEnd']) b.on(name, (c) => life.push([name, c.reason]), { priority: 1000 });
|
||||
} } });
|
||||
h.b.start();
|
||||
const u = h.unit(id), sk = u.skill;
|
||||
h.run(2);
|
||||
u.hp = u.s.maxHp / 2;
|
||||
const e = h.spawn('enemy_dummy', { pos: [10, 5] });
|
||||
h.b.kill(e, u);
|
||||
assert.equal(u.mem.texasKilled, true);
|
||||
approx(u.hpRatio, 1);
|
||||
assert.equal(u.findBuff('texas2:swordplay'), null);
|
||||
assert.equal(sk.activations, 2);
|
||||
approx(sk.timeLeft, sk.duration);
|
||||
assert.equal(sk.charges, 0);
|
||||
assert.equal(sk.ready, false);
|
||||
assert.deepEqual(h.hooksOf('skillEnd').map((c) => c.reason), ['recast']);
|
||||
h.b.kill(h.spawn('enemy_dummy', { pos: [10, 5] }), u);
|
||||
assert.equal(sk.activations, 2, 'only first kill recasts');
|
||||
h.run(sk.duration + 0.1);
|
||||
assert.equal(sk.active, false);
|
||||
assert.deepEqual(h.hooksOf('skillEnd').map((c) => c.reason), ['recast', 'duration']);
|
||||
assert.deepEqual(h.hooksOf('skillStart').map((c) => c.reason), ['deploy', 'kill']);
|
||||
h.b.retreat(u);
|
||||
const lifeAt = life.length;
|
||||
const weak = h.spawn('enemy_dummy', { pos: [10, 5] });
|
||||
weak.hp = 1;
|
||||
assert.ok(h.b.redeploy(u, { free: true }));
|
||||
if (index === 0) h.b.kill(weak, u); // S1 has no deployment burst
|
||||
assert.equal(u.mem.texasKilled, true);
|
||||
assert.equal(sk.activations, 4, 'new deployment and first-kill recast, including synchronous burst reentry');
|
||||
assert.deepEqual(life.slice(lifeAt), [['skillStart', 'deploy'], ['skillEnd', 'recast'], ['skillStart', 'kill']]);
|
||||
assert.equal(u.findBuff('texas2:swordplay'), null);
|
||||
approx(sk.timeLeft, sk.duration);
|
||||
if (index === 2) {
|
||||
const target = h.spawn('enemy_dummy', { pos: [10, 5] });
|
||||
h.run(sk.duration + 0.1);
|
||||
const waves = new Set(dmgBy(h, u, tagged('swordRain')).filter((c) => c.target === target).map((c) => c.t));
|
||||
assert.equal(waves.size, sk.duration, 'reentrant deployment keeps a full set of rain waves');
|
||||
const n = dmgBy(h, u, tagged('swordRain')).length;
|
||||
h.run(2);
|
||||
assert.equal(dmgBy(h, u, tagged('swordRain')).length, n, 'rain stops at skill end');
|
||||
assert.ok(target.alive);
|
||||
}
|
||||
checkInvariants(h.b);
|
||||
}
|
||||
});
|
||||
|
||||
test('缄默德克萨斯 module none: no ATK +10 % when alone (EXE-Y default has it)', () => {
|
||||
const has = (m) => { const h = battle([U('chess_char_4_16_b', 10, 4, null, m)]); h.run(0.5); return !!h.unit('chess_char_4_16_b').findBuff('texas2:module'); };
|
||||
assert.equal(has(null), true);
|
||||
|
||||
Reference in new issue
Block a user