summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fineff.cc
diff options
context:
space:
mode:
authorPete Hurst <pete@streamuniverse.tv>2013-05-26 06:26:05 +0100
committerPete Hurst <pete@streamuniverse.tv>2013-05-26 06:26:22 +0100
commit9d8ad9cd5d2249bfe34284415911c44fb7a65704 (patch)
tree0bac98377b3b0e8ea0a238437f3f3d75f8aef376 /crawl-ref/source/fineff.cc
parentfca2993bc9958141c781445c27ab0a3f85977b61 (diff)
downloadcrawl-ref-9d8ad9cd5d2249bfe34284415911c44fb7a65704.tar.gz
crawl-ref-9d8ad9cd5d2249bfe34284415911c44fb7a65704.zip
Use a delayed_action_fineff for Kirke and Pikel death (Mantis #5306)
The issue here is that gods such as TSO *may* give penance if Kirke or Pikel are killed with an area effect, since the hogs/slaves suddenly become penance-inducing targets halfway through evaluating affected monsters. This is a) inconsistent because it depends on the sequence of monster evaluation and b) not really in the spirit of the penance because at the time you thought you were damaging things you were allowed to. Kirke and Pikel were already using a daction (to support off-level conversion of hogs/slaves), but somewhat ironically dactions are actually executed once instantly and then again later on. The new delayed_action_fineff can be used for any daction to postpone the initial execution until after other effects finish. This means all damage will occur to hogs or bound slaves *before* the death causes any still alive to get converted back, avoiding the penance issue.
Diffstat (limited to 'crawl-ref/source/fineff.cc')
-rw-r--r--crawl-ref/source/fineff.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/crawl-ref/source/fineff.cc b/crawl-ref/source/fineff.cc
index 7f11b58b79..caca413504 100644
--- a/crawl-ref/source/fineff.cc
+++ b/crawl-ref/source/fineff.cc
@@ -6,6 +6,7 @@
#include "AppHdr.h"
#include "coord.h"
+#include "dactions.h"
#include "effects.h"
#include "env.h"
#include "fineff.h"
@@ -91,6 +92,11 @@ bool starcursed_merge_fineff::mergeable(const final_effect &fe) const
return o && def == o->def;
}
+bool delayed_action_fineff::mergeable(const final_effect &fe) const
+{
+ return false;
+}
+
void mirror_damage_fineff::merge(const final_effect &fe)
{
const mirror_damage_fineff *mdfe =
@@ -285,6 +291,13 @@ void starcursed_merge_fineff::fire()
starcursed_merge(defender()->as_monster(), true);
}
+void delayed_action_fineff::fire()
+{
+ if (final_msg.length())
+ mpr(final_msg);
+ add_daction(action);
+}
+
// Effects that occur after all other effects, even if the monster is dead.
// For example, explosions that would hit other creatures, but we want
// to deal with only one creature at a time, so that's handled last.