summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fineff.h
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.h
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.h')
-rw-r--r--crawl-ref/source/fineff.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/crawl-ref/source/fineff.h b/crawl-ref/source/fineff.h
index 2525c0e14f..30169d7fa5 100644
--- a/crawl-ref/source/fineff.h
+++ b/crawl-ref/source/fineff.h
@@ -146,6 +146,26 @@ public:
void fire();
};
+// A fineff that triggers a daction; otherwise the daction
+// occurs immediately (and then later) -- this might actually
+// be too soon in some cases.
+class delayed_action_fineff : public final_effect
+{
+public:
+ delayed_action_fineff(daction_type _action, string _final_msg)
+ : final_effect(0, 0, coord_def()),
+ action(_action),final_msg(_final_msg)
+ {
+ }
+
+ bool mergeable(const final_effect &a) const;
+ void fire();
+
+protected:
+ daction_type action;
+ string final_msg;
+};
+
void fire_final_effects();
#endif