From 7affe23a99d97158750b936c2a6b96adf3851839 Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 18 Feb 2018 11:52:30 +0000 Subject: [PATCH] Inc stat when Eyedroid explosions kills another enemy. --- src/combat/explosions.c | 7 ++++++- src/combat/explosions.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/combat/explosions.c b/src/combat/explosions.c index 3f25ba9..7bbdf41 100644 --- a/src/combat/explosions.c +++ b/src/combat/explosions.c @@ -70,7 +70,12 @@ void addExplosion(float x, float y, int radius, Entity *owner) { stunBob(); } - + + if (owner->type == ET_ENEMY && e->health <= 0 && e->type == ET_ENEMY && strstr(((Unit*)owner)->unitType, "EyeDroid")) + { + game.stats[STAT_EYE_DROID_EXPLOSION_KILLS]++; + } + if (e->health <= 0) { e->dx = rrnd(-radius / 8, radius / 8); diff --git a/src/combat/explosions.h b/src/combat/explosions.h index 33fc9c2..514b36f 100644 --- a/src/combat/explosions.h +++ b/src/combat/explosions.h @@ -28,3 +28,4 @@ extern Entity **getAllEntsWithin(int x, int y, int w, int h, Entity *ignore); extern int getDistance(int x1, int y1, int x2, int y2); extern void swapSelf(Entity *e); +extern Game game;