Play result audio after finishing cutscene ends
This commit is contained in:
@@ -62,6 +62,7 @@ export function createFinishCutscene(onDismiss: () => void, appearances?: [Fight
|
||||
|
||||
reducedMotion.addEventListener('change', advance);
|
||||
return {
|
||||
get active() { return !!dialog; },
|
||||
update(state: LocalMatchState) {
|
||||
const reveal = state.reveal;
|
||||
if (activeMatch && activeMatch !== state.matchId) close(true);
|
||||
|
||||
@@ -130,7 +130,7 @@ export function createMatchView(container: HTMLElement, onAction: (action: Actio
|
||||
const f = s.finished;
|
||||
el('.finish-reason').hidden = f.reason === 'hit';
|
||||
const outcome = s.aborted ? 'aborted' : f.winnerIndex === null ? 'draw' : f.winnerIndex === s.selfIndex ? 'win' : 'loss';
|
||||
if (outcome !== 'aborted') sound.play(outcome, `${s.matchId}:result`);
|
||||
if (outcome !== 'aborted' && !cutscene.active) sound.play(outcome, `${s.matchId}:result`);
|
||||
container.dataset.outcome = outcome;
|
||||
arena.dataset.result = outcome;
|
||||
el('.result-banner h2').textContent = ({ win: '승리!', loss: '패배', draw: '무승부', aborted: '대전 중단' })[outcome];
|
||||
|
||||
Reference in New Issue
Block a user