feedback2: merge GitHub master (PR #48: 要塞 cannot hit air units — issue #35; 莫斯提马's slow shows its status icon — issue #16)
# Conflicts: # data/chess.json
This commit is contained in:
commit
5f83d30cd1
7 files changed
+41
-7
No files matched your search
@@ -109,7 +109,9 @@ test('莫斯提马 S3: ripple hits every enemy in range, ATK +90 %, knock-back;
|
||||
assert.ok(h.runUntil(() => u.skill.active, 10));
|
||||
approx(u.s.atk, u.base.atk * (1 + bb.atk), 1e-6);
|
||||
h.run(0.3);
|
||||
approx(es[0].findBuff(`mostma:slow:${u.id}`).mods.moveMul, 1 + t1.move_speed * bb.talent_scale, 1e-9, 'slow ×3');
|
||||
const slowBuff = es[0].findBuff(`mostma:slow:${u.id}`);
|
||||
approx(slowBuff.mods.moveMul, 1 + t1.move_speed * bb.talent_scale, 1e-9, 'slow ×3');
|
||||
assert.equal(slowBuff.status, 'slow', 'carries the slow status so the client draws its icon');
|
||||
const x0 = es.map((e) => e.x);
|
||||
const n0 = dmgBy(h, u).length;
|
||||
h.run(u.s.interval + 0.1);
|
||||
|
||||
@@ -369,3 +369,33 @@ test('resolveProfile: data fields win over table defaults; kit trait overrides w
|
||||
const bard = resolveProfile(ds.getChess('chess_char_4_25_a'));
|
||||
assert.equal(bard.noAttack, true);
|
||||
});
|
||||
|
||||
test('fortress (号角 / 灰毫) is ground-only and never fires at FLY enemies', () => {
|
||||
const ds = getDefaultSource();
|
||||
for (const id of ['chess_char_2_18_a', 'chess_char_2_18_b', 'chess_char_5_08_a', 'chess_char_5_08_b']) {
|
||||
const p = resolveProfile(ds.getChess(id));
|
||||
assert.equal(p.canHitFly, false, `${id}: cannot hit fly`);
|
||||
assert.equal(p.groundOnly, true, `${id}: ground only`);
|
||||
}
|
||||
// the data's generic ranged default would set canHitFly (resolveProfile derives it from attackKind),
|
||||
// so this checks the branch guard rather than the generated field
|
||||
const fort = () => mk('fortress', 'TANK', {
|
||||
attackKind: 'ranged', projectile: 'bomb',
|
||||
rangeGrid: [[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [-1, 0], [-1, 1], [-1, 2]],
|
||||
stats: { blockCnt: 3, maxHp: 1e6 },
|
||||
});
|
||||
const fly = makeBattle({
|
||||
defs: { chess: { t_fortress: fort() }, enemies: { enemy_fly: enemyRec({ key: 'enemy_fly', hp: 1e6, speed: 0, motion: 'FLY' }) } },
|
||||
units: [{ chessId: 't_fortress', row: 10, col: 5 }], enemies: [{ key: 'enemy_fly', pos: [10, 7] }], content: 'none', autoFinish: false,
|
||||
});
|
||||
fly.run(8);
|
||||
assert.equal(fly.unit('t_fortress').stats.attacks, 0, 'no normal attack against air only');
|
||||
assert.equal(fly.enemy('enemy_fly').hp, 1e6, 'the FLY enemy is untouched');
|
||||
const ground = makeBattle({
|
||||
defs: { chess: { t_fortress: fort() }, enemies: { enemy_g: enemyRec({ key: 'enemy_g', hp: 1e6, speed: 0 }) } },
|
||||
units: [{ chessId: 't_fortress', row: 10, col: 5 }], enemies: [{ key: 'enemy_g', pos: [10, 7] }], content: 'none', autoFinish: false,
|
||||
});
|
||||
ground.run(8);
|
||||
assert.ok(ground.unit('t_fortress').stats.attacks > 0, 'ground enemies are still attacked');
|
||||
assert.ok(ground.enemy('enemy_g').hp < 1e6, 'and take splash damage');
|
||||
});
|
||||
Reference in new issue
Block a user