From 04ce34afa23b7770e5f718033b5a611e41726909 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Sat, 8 Mar 2014 02:17:55 +0100 Subject: [PATCH] Add new setting for shots: DieOnKill (default: off) --- Aquaria/Shot.cpp | 5 ++++- Aquaria/Shot.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Aquaria/Shot.cpp b/Aquaria/Shot.cpp index 09f762f..702a87f 100644 --- a/Aquaria/Shot.cpp +++ b/Aquaria/Shot.cpp @@ -59,6 +59,7 @@ ShotData::ShotData() homingMax = 0; homingIncr = 0; dieOnHit = 1; + dieOnKill = false; hitEnts = 1; wallHitRadius = 0; rotateToVel = 1; @@ -241,6 +242,8 @@ void ShotData::bankLoad(const std::string &file, const std::string &path) inf >> dieOnHit; else if (token == "IgnoreShield") inf >> ignoreShield; + else if (token == "DieOnKill") + inf >> dieOnKill; else { // if having weirdness, check for these @@ -595,7 +598,7 @@ void Shot::hitEntity(Entity *e, Bone *b, bool isValid) if (e->isEntityDead()) { - die = false; + die = shotData ? shotData->dieOnKill : false; } if (firer) diff --git a/Aquaria/Shot.h b/Aquaria/Shot.h index 65c4514..100a3e1 100644 --- a/Aquaria/Shot.h +++ b/Aquaria/Shot.h @@ -43,6 +43,7 @@ struct ShotData Vector scale; bool ignoreShield; + bool dieOnKill; float effectTime;