summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fineff.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2010-09-24 16:02:57 +0200
committerAdam Borowski <kilobyte@angband.pl>2010-09-24 16:36:05 +0200
commit412fe9abe8bcc40cd5297a90dfcbd49ea9ef0dbc (patch)
tree913401b4ff3dea2765c2ccc548af944c69676754 /crawl-ref/source/fineff.cc
parentab63cefa5be7fe972ce89cfdce2a7255118e52cb (diff)
downloadcrawl-ref-412fe9abe8bcc40cd5297a90dfcbd49ea9ef0dbc.tar.gz
crawl-ref-412fe9abe8bcc40cd5297a90dfcbd49ea9ef0dbc.zip
Don't spam for multiple Mirror Damage backlashes -- for example, weapon brands.
Also, this caps elec water discharges for monsters with multiple attacks to one.
Diffstat (limited to 'crawl-ref/source/fineff.cc')
-rw-r--r--crawl-ref/source/fineff.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/crawl-ref/source/fineff.cc b/crawl-ref/source/fineff.cc
index 8beed26320..45547341cc 100644
--- a/crawl-ref/source/fineff.cc
+++ b/crawl-ref/source/fineff.cc
@@ -31,6 +31,21 @@ void add_final_effect(final_effect_flavour flavour,
fe.pos = pos;
fe.x = x;
+ for (std::vector<final_effect>::iterator fi = env.final_effects.begin();
+ fi != env.final_effects.end();
+ fi++)
+ {
+ if (fi->flavour == fe.flavour
+ && fi->att == fe.att
+ && fi->def == fe.def
+ && fi->pos == fe.pos)
+ {
+ // If there's a non-additive effect, you'd need to handle it here.
+ // Elec discharge is (now) idempotent, so that's ok.
+ fi->x += fe.x;
+ return;
+ }
+ }
env.final_effects.push_back(fe);
}