summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fineff.h
diff options
context:
space:
mode:
authorEd Gonzalez <ed.gonzalez3@gmail.com>2013-06-29 02:04:05 -0700
committerPete Hurst <pete@streamuniverse.tv>2013-06-29 13:06:28 +0100
commitf7d185e99151e10ac3ea320fc396b01b697d134b (patch)
tree2ee30ef18fe3803f3471f9a7535b34befcf9dd6b /crawl-ref/source/fineff.h
parent3bbf07e665f48e08fc08194f26968ea76554b315 (diff)
downloadcrawl-ref-f7d185e99151e10ac3ea320fc396b01b697d134b.tar.gz
crawl-ref-f7d185e99151e10ac3ea320fc396b01b697d134b.zip
Fixed some effects being applied twice to damage.
When a deferred_damage_fineff is used, ::hurt is called twice. Once for the original target, and a second time for the shared target. Both calls would apply effects such as weakening from wretched and QUAD DAMAGE. While SIXTEEN TIMES damage is funny, the attacker's effects should only be applied once. Now ouch/hurt functions and the deferred_damage_fineff have an 'attacker_effects' parameter, which defaults to true. If false, then damage effects from the attacker are assumed to have already been applied. All existing uses of deferred_damage_fineff have been appropriately updated. Also applied to spectral weapon damage sharing.
Diffstat (limited to 'crawl-ref/source/fineff.h')
-rw-r--r--crawl-ref/source/fineff.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/crawl-ref/source/fineff.h b/crawl-ref/source/fineff.h
index 43e1d34720..f8c2f7ed9a 100644
--- a/crawl-ref/source/fineff.h
+++ b/crawl-ref/source/fineff.h
@@ -124,8 +124,10 @@ protected:
class deferred_damage_fineff : public final_effect
{
public:
- deferred_damage_fineff(const actor *attack, const actor *defend, int dam)
- : final_effect(attack, defend, coord_def()), damage(dam)
+ deferred_damage_fineff(const actor *attack, const actor *defend,
+ int dam, bool _attacker_effects)
+ : final_effect(attack, defend, coord_def()),
+ damage(dam), attacker_effects(_attacker_effects)
{
}
bool mergeable(const final_effect &a) const;
@@ -133,6 +135,7 @@ public:
void fire();
protected:
int damage;
+ bool attacker_effects;
};
class starcursed_merge_fineff : public final_effect