Skip to content

Commit

Permalink
Added condition for playing berserk sound
Browse files Browse the repository at this point in the history
  • Loading branch information
Carbrex committed Jan 18, 2024
1 parent 794ed68 commit 35704d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/keyboardMove/src/plugins/keyboardMove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ export function initModule(opts: Opts) {
}
} else if (v.length > 0 && 'zerk'.startsWith(v.toLowerCase())) {
if ('zerk' === v.toLowerCase()) {
opts.ctrl?.goBerserk();
opts.ctrl.goBerserk();
console.log('go berserk');
clear();
}
} else if (v.length > 0 && 'who'.startsWith(v.toLowerCase())) {
Expand Down
2 changes: 2 additions & 0 deletions ui/round/src/ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,9 @@ export default class RoundController implements MoveRootCtrl {
};

goBerserk = () => {
if (this.goneBerserk[this.data.player.color]) return;
this.socket.berserk();
lichess.sound.play('berserk');
};

setBerserk = (color: Color): void => {
Expand Down

0 comments on commit 35704d3

Please sign in to comment.