feat: improve tactical audiovisual clarity
This commit is contained in:
@@ -106,6 +106,7 @@ try {
|
||||
'recovery-cue': '/audio/recovery-cue.ogg',
|
||||
'burn-tick': '/audio/burn-tick.ogg',
|
||||
'reward-reveal': '/audio/reward-reveal.ogg',
|
||||
'strategy-cast': '/audio/strategy-cast.ogg',
|
||||
'ui-select': '/audio/ui-select.ogg'
|
||||
});
|
||||
director.registerEffectPools({
|
||||
@@ -500,6 +501,33 @@ try {
|
||||
assert(criticalBoom, 'critical accents should layer the delayed boom track');
|
||||
director.playCombatImpact(false, false);
|
||||
assert.equal(director.getDebugState().lastEffect?.key, 'melee-impact', 'combat API should use the impact pool');
|
||||
director.playStrategyImpact('fire', false);
|
||||
assert.deepEqual(
|
||||
pickEffect(director.getDebugState().lastEffect),
|
||||
{ key: 'burn-tick', trackKey: 'burn-tick', rate: 0.94 },
|
||||
'fire tactics should use the sharp burn contact layer'
|
||||
);
|
||||
director.playStrategyImpact('roar', false);
|
||||
assert.deepEqual(
|
||||
pickEffect(director.getDebugState().lastEffect),
|
||||
{ key: 'combat-impact', trackKey: 'combat-impact', rate: 0.8 },
|
||||
'roar tactics should use a low-pitched force impact'
|
||||
);
|
||||
director.playStrategyImpact('arcane', false);
|
||||
assert.deepEqual(
|
||||
pickEffect(director.getDebugState().lastEffect),
|
||||
{ key: 'strategy-cast', trackKey: 'strategy-cast', rate: 1.2 },
|
||||
'arcane tactics should use a brighter magical contact layer'
|
||||
);
|
||||
assert.deepEqual(
|
||||
director.getDebugState().recentEffects.slice(-3).map(pickEffect),
|
||||
[
|
||||
{ key: 'burn-tick', trackKey: 'burn-tick', rate: 0.94 },
|
||||
{ key: 'combat-impact', trackKey: 'combat-impact', rate: 0.8 },
|
||||
{ key: 'strategy-cast', trackKey: 'strategy-cast', rate: 1.2 }
|
||||
],
|
||||
'recent effect history should retain semantic contact ordering for browser diagnostics'
|
||||
);
|
||||
director.playBattleOutcome('victory');
|
||||
assert.equal(director.getDebugState().lastEffect?.key, 'victory-fanfare', 'victory should play its outcome track');
|
||||
director.playBattleOutcome('defeat');
|
||||
@@ -608,6 +636,10 @@ function assertClose(actual, expected, context) {
|
||||
assert(Math.abs(actual - expected) < 1e-9, `${context}: expected ${expected}, received ${actual}`);
|
||||
}
|
||||
|
||||
function pickEffect(effect) {
|
||||
return effect ? { key: effect.key, trackKey: effect.trackKey, rate: effect.rate } : null;
|
||||
}
|
||||
|
||||
function createAudioHarness() {
|
||||
const instances = [];
|
||||
let shouldRejectNextPlay = false;
|
||||
|
||||
Reference in New Issue
Block a user