diff --git a/src/game.cpp b/src/game.cpp index 2a1a535..23df6da 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -31,6 +31,16 @@ static const char *klineInsult[] = { static const char *klineVenusInsult[] = { "Fool.", "And now you're nothing but a DEAD hero." }; +static const char *phoebePlayerHitMessage[3] = { + "Oops! Sorry!", + "Whoops! Are you OK, Chris?", + "Oh, sorry! I didn't see you there!" +}; +static const char *ursulaPlayerHitMessage[3] = { + "Get out of the way!", + "Don't fly into my missiles!", + "Dammit, Chris, you made me miss!" +}; void game_init() @@ -699,9 +709,17 @@ static void game_doBullets() player.hit = 5; } - if ((bullet->owner->classDef == CD_PHOEBE) || - (bullet->owner->classDef == CD_URSULA)) - getPlayerHitMessage(bullet->owner); + if (player.shield > 0) + { + if (bullet->owner->classDef == CD_PHOEBE) + { + setRadioMessage(FS_PHOEBE, phoebePlayerHitMessage[rand() % 3], 0); + } + else if (bullet->owner->classDef == CD_URSULA) + { + setRadioMessage(FS_URSULA, ursulaPlayerHitMessage[rand() % 3], 0); + } + } if (bullet->id == WT_CHARGER) { diff --git a/src/messages.cpp b/src/messages.cpp index d0962a1..1dee7c8 100644 --- a/src/messages.cpp +++ b/src/messages.cpp @@ -27,12 +27,6 @@ static const char *missFireMessage[5] = { "Open your eyes!", }; -static const char *playerHitMessage[3] = { - "Oops! Sorry!", - "Get out of the way!", - "Don't fly into my missiles!", -}; - void getMissFireMessage(object *ally) { int faceToUse = FS_PHOEBE; @@ -44,15 +38,3 @@ void getMissFireMessage(object *ally) setRadioMessage(faceToUse, missFireMessage[rand() % 5], 0); } - -void getPlayerHitMessage(object *ally) -{ - int faceToUse = FS_PHOEBE; - - if (ally == &aliens[ALIEN_PHOEBE]) - faceToUse = FS_PHOEBE; - else - faceToUse = FS_URSULA; - - setRadioMessage(faceToUse, playerHitMessage[rand() % 3], 0); -} diff --git a/src/messages.h b/src/messages.h index 11e2265..1966a3b 100644 --- a/src/messages.h +++ b/src/messages.h @@ -20,8 +20,6 @@ along with this program. If not, see . #ifndef MESSAGES_H #define MESSAGES_H -extern void getKillMessage(object *ally); extern void getMissFireMessage(object *ally); -extern void getPlayerHitMessage(object *ally); #endif