Play denied sound when attempting to boost / use ecm when depleted.

This commit is contained in:
Steve 2016-02-15 15:24:19 +00:00
parent 7656957dd6
commit 26aa3b3bb1
1 changed files with 20 additions and 6 deletions

View File

@ -145,11 +145,18 @@ static void handleKeyboard(void)
{ {
if (battle.status == MS_IN_PROGRESS) if (battle.status == MS_IN_PROGRESS)
{ {
if (app.keyboard[SDL_SCANCODE_W] && battle.boostTimer == BOOST_RECHARGE_TIME) if (app.keyboard[SDL_SCANCODE_W])
{ {
playSound(SND_BOOST); if (battle.boostTimer == BOOST_RECHARGE_TIME)
{
playSound(SND_BOOST);
activateBoost(); activateBoost();
}
else
{
playSound(SND_GUI_DENIED);
}
app.keyboard[SDL_SCANCODE_W] = 0; app.keyboard[SDL_SCANCODE_W] = 0;
} }
@ -161,9 +168,16 @@ static void handleKeyboard(void)
app.keyboard[SDL_SCANCODE_A] = 0; app.keyboard[SDL_SCANCODE_A] = 0;
} }
if (app.keyboard[SDL_SCANCODE_D] && battle.ecmTimer == ECM_RECHARGE_TIME) if (app.keyboard[SDL_SCANCODE_D])
{ {
activateECM(); if (battle.ecmTimer == ECM_RECHARGE_TIME)
{
activateECM();
}
else
{
playSound(SND_GUI_DENIED);
}
app.keyboard[SDL_SCANCODE_D] = 0; app.keyboard[SDL_SCANCODE_D] = 0;
} }