diff --git a/client/public/assets/the-knights-who-say-ni.mp3 b/client/public/assets/the-knights-who-say-ni.mp3 new file mode 100755 index 0000000..df5e642 Binary files /dev/null and b/client/public/assets/the-knights-who-say-ni.mp3 differ diff --git a/client/src/App.js b/client/src/App.js index f720725..52f6368 100755 --- a/client/src/App.js +++ b/client/src/App.js @@ -396,6 +396,21 @@ const Table = () => { audioEffects.robber.hasPlayed = false; } } + + if (turn && turn.actions && turn.actions.indexOf('playing-knight') !== -1) { + if (!audioEffects.knights) { + audioEffects.knights = loadAudio('the-knights-who-say-ni.mp3'); + } else { + if (!audioEffects.knights.hasPlayed) { + audioEffects.knights.hasPlayed = true; + audioEffects.knights.play(); + } + } + } else if (turn && turn.actions && turn.actions.indexOf('playing-knight') === -1) { + if (audioEffects.knights) { + audioEffects.knights.hasPlayed = false; + } + } }, [turn, color]); return diff --git a/server/routes/games.js b/server/routes/games.js index 44241a1..b140b7c 100755 --- a/server/routes/games.js +++ b/server/routes/games.js @@ -2473,7 +2473,7 @@ const playCard = (game, session, card) => { delete game.turn.placedRobber; addChatMessage(game, null, `The robber ${game.robberName} has fled before the power of the Knight, ` + `but a new robber has returned and ${session.name} must now place them.`); - game.turn.actions = [ 'place-robber' ]; + game.turn.actions = [ 'place-robber', 'playing-knight' ]; game.turn.limits = { pips: [] }; for (let i = 0; i < 19; i++) { if (i === game.robber) {