diff --git a/locale/blobwarsAttrition.pot b/locale/blobwarsAttrition.pot index faa4562..d8f366a 100644 --- a/locale/blobwarsAttrition.pot +++ b/locale/blobwarsAttrition.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Blob Wars : Attrition\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" "Last-Translator: ???\n" "Language-Team: ???\n" @@ -64,6 +64,9 @@ msgstr "" msgid "EyeDroid explosion kills" msgstr "" +msgid "Best grenade combo" +msgstr "" + msgid "Time spent flying" msgstr "" diff --git a/src/combat/explosions.c b/src/combat/explosions.c index 9efce8c..33f1d17 100644 --- a/src/combat/explosions.c +++ b/src/combat/explosions.c @@ -45,6 +45,18 @@ void addExplosion(float x, float y, int radius, Entity *owner) 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; } @@ -98,9 +110,4 @@ void addExplosion(float x, float y, int radius, Entity *owner) } } } - - if (numKilled >= 12) - { - awardTrophy("GRENADE_COMBO"); - } } diff --git a/src/combat/explosions.h b/src/combat/explosions.h index cf4ffc9..d917b3a 100644 --- a/src/combat/explosions.h +++ b/src/combat/explosions.h @@ -28,5 +28,6 @@ extern void playBattleSound(int snd, int ch, int x, int y); extern int rrnd(int low, int high); extern void stunBob(void); extern void swapSelf(Entity *e); +extern void setGameplayMessage(int newMessageType, const char *format, ...); extern Game game; diff --git a/src/defs.h b/src/defs.h index ae6dde6..729a868 100644 --- a/src/defs.h +++ b/src/defs.h @@ -357,6 +357,7 @@ enum STAT_SHOTS_HIT, STAT_SHOT_ACCURACY, STAT_EYE_DROID_EXPLOSION_KILLS, + STAT_GRENADE_COMBO, STAT_FLY_TIME, STAT_SWIM_TIME, STAT_CHERRIES_PICKED_UP, diff --git a/src/game/stats.c b/src/game/stats.c index 7c893b6..c40a908 100644 --- a/src/game/stats.c +++ b/src/game/stats.c @@ -46,6 +46,7 @@ void initStats(void) statDescription[STAT_SHOTS_HIT] = _("Shots hit"); statDescription[STAT_SHOT_ACCURACY] = _("Accuracy"); 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_SWIM_TIME] = _("Time spent swimming"); statDescription[STAT_CHERRIES_PICKED_UP] = _("Cherries picked up"); diff --git a/src/system/lookup.c b/src/system/lookup.c index c448287..712bce3 100644 --- a/src/system/lookup.c +++ b/src/system/lookup.c @@ -78,6 +78,7 @@ void initLookups(void) addLookup("STAT_SHOTS_FIRED", STAT_SHOTS_FIRED); addLookup("STAT_SHOTS_HIT", STAT_SHOTS_HIT); 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_SWIM_TIME", STAT_SWIM_TIME); addLookup("STAT_CHERRIES_PICKED_UP", STAT_CHERRIES_PICKED_UP);