feedback3 WA: 联防 carries the HP ratio and the SP only — a skill running at the end of the own combat enters switched off (no free restart), the SP counts stored charges, board summons keep their SP
This commit is contained in:
1 parent
bdb0765c55
commit
8252be248f
16 files changed
+220
-48
No files matched your search
+18
-13
@@ -42,23 +42,28 @@ test('attack-SP ammo skill: no SP from any ammo shot, including the last one', (
|
||||
assert.equal(u.skill.sp, 1);
|
||||
});
|
||||
|
||||
test('unite carryState {sp: 0, skillActive: true} (what unitsEnd reports) resumes the timed skill without a charge', () => {
|
||||
test('unite carryState: a skill running at the end of the own combat is not carried — unitsEnd reports sp 0 and the skill enters 联防 off', () => {
|
||||
// community report #34 / GitHub #82: the carried skillActive used to restart the skill for free (bar empty, skill on)
|
||||
const h = makeBattle({
|
||||
defs: { chess: { t_sn: sniper({ duration: 10, spCost: 10, initSp: 0, bb: { atk: 1 } }) } },
|
||||
units: [{ chessId: 't_sn', row: 10, col: 4, carryState: { hpPct: 0.6, sp: 0, skillActive: true } }], content: 'generic',
|
||||
defs: { chess: { t_sn: sniper({ duration: 10, spCost: 10, initSp: 10, bb: { atk: 1 } }) }, enemies: { e_dummy: enemyRec({ key: 'e_dummy', hp: 1e9, speed: 0 }) } },
|
||||
units: [{ chessId: 't_sn', row: 10, col: 4 }], enemies: [{ key: 'e_dummy', pos: [10, 6] }], content: 'generic', autoFinish: false,
|
||||
});
|
||||
h.step();
|
||||
const u = h.unit('t_sn');
|
||||
approx(u.hpRatio, 0.6, 1e-9);
|
||||
assert.equal(u.skill.active, true);
|
||||
assert.equal(u.skill.charges, 0);
|
||||
assert.ok(u.skill.sp < 0.01);
|
||||
approx(u.s.atk, 200);
|
||||
// and a real end-of-battle report round-trips: unitsEnd of a running skill carries sp 0 + skillActive
|
||||
h.runUntil(() => h.unit('t_sn').skill.active, 10);
|
||||
h.run(1);
|
||||
const end = h.result().perPlayer.p1.unitsEnd[0];
|
||||
assert.equal(end.skillActive, true);
|
||||
assert.equal(end.sp, 0);
|
||||
assert.equal(end.skillActive, true, 'reported');
|
||||
assert.equal(end.sp, 0, 'the SP was spent at the activation (PRTS 技能 "触发技能后…消耗相应的技力")');
|
||||
const u2 = makeBattle({
|
||||
defs: { chess: { t_sn: sniper({ duration: 10, spCost: 10, initSp: 0, bb: { atk: 1 } }) } },
|
||||
units: [{ chessId: 't_sn', row: 10, col: 4, carryState: { hpPct: 0.6, sp: end.sp, skillActive: end.skillActive } }], content: 'generic',
|
||||
});
|
||||
u2.step();
|
||||
const u = u2.unit('t_sn');
|
||||
approx(u.hpRatio, 0.6, 1e-9);
|
||||
assert.equal(u.skill.active, false);
|
||||
assert.equal(u.skill.charges, 0);
|
||||
assert.ok(u.skill.sp < 0.2);
|
||||
approx(u.s.atk, 100);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -195,7 +195,7 @@ test('SkillSpec from a kit: mods, targeting override, attack override, onStart/o
|
||||
assert.equal(u.s.aspd, 100);
|
||||
});
|
||||
|
||||
test('passive and toggle kinds; carryState restores hp/sp/skill', () => {
|
||||
test('passive and toggle kinds; carryState restores hp/sp, never a running skill', () => {
|
||||
const h = makeBattle({
|
||||
defs: {
|
||||
chess: {
|
||||
@@ -224,7 +224,10 @@ test('passive and toggle kinds; carryState restores hp/sp/skill', () => {
|
||||
h2.step();
|
||||
const c2 = h2.unit('t_c');
|
||||
approx(c2.hpRatio, 0.5, 1e-9);
|
||||
assert.equal(c2.skill.active, true);
|
||||
// PRTS 卫戍协议/帮助 §联防阶段: only the HP ratio and the SP are set — the (old) skillActive flag starts nothing
|
||||
assert.equal(c2.skill.active, false);
|
||||
assert.equal(c2.skill.ready, true, 'the carried 10 SP fill the bar');
|
||||
assert.equal(c2.skill.activations, 0);
|
||||
});
|
||||
|
||||
test('generic kit maps blackboards of every real chess to a sane SkillSpec', () => {
|
||||
|
||||
Reference in new issue
Block a user