Added grenade combo counter HUD message and gameplay stat.

This commit is contained in:
Steve 2018-04-24 07:17:05 +01:00
parent fab49ae250
commit 5f212282b2
6 changed files with 20 additions and 6 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Blob Wars : Attrition\n" "Project-Id-Version: Blob Wars : Attrition\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-15 12:32:17+0100\n" "POT-Creation-Date: 2018-04-24 07:16:21+0100\n"
"PO-Revision-Date: ???\n" "PO-Revision-Date: ???\n"
"Last-Translator: ???\n" "Last-Translator: ???\n"
"Language-Team: ???\n" "Language-Team: ???\n"
@ -64,6 +64,9 @@ msgstr ""
msgid "EyeDroid explosion kills" msgid "EyeDroid explosion kills"
msgstr "" msgstr ""
msgid "Best grenade combo"
msgstr ""
msgid "Time spent flying" msgid "Time spent flying"
msgstr "" msgstr ""

View File

@ -45,6 +45,18 @@ void addExplosion(float x, float y, int radius, Entity *owner)
if (killTimer < SDL_GetTicks()) if (killTimer < SDL_GetTicks())
{ {
if (numKilled >= 2)
{
setGameplayMessage(MSG_STANDARD, "%d hit grenade combo!", numKilled);
game.stats[STAT_EYE_DROID_EXPLOSION_KILLS] = MAX(game.stats[STAT_EYE_DROID_EXPLOSION_KILLS], numKilled);
}
if (numKilled >= 12)
{
awardTrophy("GRENADE_COMBO");
}
numKilled = 0; numKilled = 0;
} }
@ -98,9 +110,4 @@ void addExplosion(float x, float y, int radius, Entity *owner)
} }
} }
} }
if (numKilled >= 12)
{
awardTrophy("GRENADE_COMBO");
}
} }

View File

@ -28,5 +28,6 @@ extern void playBattleSound(int snd, int ch, int x, int y);
extern int rrnd(int low, int high); extern int rrnd(int low, int high);
extern void stunBob(void); extern void stunBob(void);
extern void swapSelf(Entity *e); extern void swapSelf(Entity *e);
extern void setGameplayMessage(int newMessageType, const char *format, ...);
extern Game game; extern Game game;

View File

@ -357,6 +357,7 @@ enum
STAT_SHOTS_HIT, STAT_SHOTS_HIT,
STAT_SHOT_ACCURACY, STAT_SHOT_ACCURACY,
STAT_EYE_DROID_EXPLOSION_KILLS, STAT_EYE_DROID_EXPLOSION_KILLS,
STAT_GRENADE_COMBO,
STAT_FLY_TIME, STAT_FLY_TIME,
STAT_SWIM_TIME, STAT_SWIM_TIME,
STAT_CHERRIES_PICKED_UP, STAT_CHERRIES_PICKED_UP,

View File

@ -46,6 +46,7 @@ void initStats(void)
statDescription[STAT_SHOTS_HIT] = _("Shots hit"); statDescription[STAT_SHOTS_HIT] = _("Shots hit");
statDescription[STAT_SHOT_ACCURACY] = _("Accuracy"); statDescription[STAT_SHOT_ACCURACY] = _("Accuracy");
statDescription[STAT_EYE_DROID_EXPLOSION_KILLS] = _("EyeDroid explosion kills"); statDescription[STAT_EYE_DROID_EXPLOSION_KILLS] = _("EyeDroid explosion kills");
statDescription[STAT_GRENADE_COMBO] = _("Best grenade combo");
statDescription[STAT_FLY_TIME] = _("Time spent flying"); statDescription[STAT_FLY_TIME] = _("Time spent flying");
statDescription[STAT_SWIM_TIME] = _("Time spent swimming"); statDescription[STAT_SWIM_TIME] = _("Time spent swimming");
statDescription[STAT_CHERRIES_PICKED_UP] = _("Cherries picked up"); statDescription[STAT_CHERRIES_PICKED_UP] = _("Cherries picked up");

View File

@ -78,6 +78,7 @@ void initLookups(void)
addLookup("STAT_SHOTS_FIRED", STAT_SHOTS_FIRED); addLookup("STAT_SHOTS_FIRED", STAT_SHOTS_FIRED);
addLookup("STAT_SHOTS_HIT", STAT_SHOTS_HIT); addLookup("STAT_SHOTS_HIT", STAT_SHOTS_HIT);
addLookup("STAT_EYE_DROID_EXPLOSION_KILLS", STAT_EYE_DROID_EXPLOSION_KILLS); addLookup("STAT_EYE_DROID_EXPLOSION_KILLS", STAT_EYE_DROID_EXPLOSION_KILLS);
addLookup("STAT_GRENADE_COMBO", STAT_GRENADE_COMBO);
addLookup("STAT_FLY_TIME", STAT_FLY_TIME); addLookup("STAT_FLY_TIME", STAT_FLY_TIME);
addLookup("STAT_SWIM_TIME", STAT_SWIM_TIME); addLookup("STAT_SWIM_TIME", STAT_SWIM_TIME);
addLookup("STAT_CHERRIES_PICKED_UP", STAT_CHERRIES_PICKED_UP); addLookup("STAT_CHERRIES_PICKED_UP", STAT_CHERRIES_PICKED_UP);