summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-clouds.h
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2011-07-21 12:44:28 +0000
committerRaphael Langella <raphael.langella@gmail.com>2011-07-21 22:25:43 +0200
commit17dfbce6f42ff75dfefd63ace016e51d9f493aa5 (patch)
tree3a2819a7823c305f8410711a984a46410cf4c8a7 /crawl-ref/source/spl-clouds.h
parent6056fee300d2862993780b1bbbc1e9476ac70070 (diff)
downloadcrawl-ref-17dfbce6f42ff75dfefd63ace016e51d9f493aa5.tar.gz
crawl-ref-17dfbce6f42ff75dfefd63ace016e51d9f493aa5.zip
Don't miscast when the spell can still be aborted (#4281).
This is a significant refactoring. All the spells now return a spret_type and take a boolean which tells if the spell has actually failed. Also some code clean up in _do_cast(). All spells have their own function now. Also fix the following bugs: * Properly abort fire storm if forced casting on a wall with '!'. Also put a message for forced out of range casting (like cloud spells). * Casting summon elemental on an invisible monster aborted with no cost. * if a summoning spell aborts because create_monster fails, you don't lose a turn. You still get a chance of miscast in this rare case. * s2s, tukima and branding spells abort properly instead of consuming turn and MP when player is not wielding appropriate object. * s2s abort message when wielding a non-snakable.
Diffstat (limited to 'crawl-ref/source/spl-clouds.h')
-rw-r--r--crawl-ref/source/spl-clouds.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/crawl-ref/source/spl-clouds.h b/crawl-ref/source/spl-clouds.h
index b2e5a057f0..ae041cb466 100644
--- a/crawl-ref/source/spl-clouds.h
+++ b/crawl-ref/source/spl-clouds.h
@@ -1,20 +1,24 @@
#ifndef SPL_CLOUDS_H
#define SPL_CLOUDS_H
+#include "spl-cast.h"
+
struct bolt;
-bool conjure_flame(int pow, const coord_def& where);
-bool stinking_cloud(int pow, bolt &beam);
+spret_type conjure_flame(int pow, const coord_def& where, bool fail);
+spret_type stinking_cloud(int pow, bolt &beam, bool fail);
void big_cloud(cloud_type cl_type, const actor *agent, const coord_def& where,
int pow, int size, int spread_rate = -1, int colour = -1,
std::string name = "", std::string tile = "");
-bool cast_big_c(int pow, cloud_type cty, const actor *caster, bolt &beam);
+spret_type cast_big_c(int pow, cloud_type cty, const actor *caster, bolt &beam,
+ bool fail);
-void cast_ring_of_flames(int power);
+spret_type cast_ring_of_flames(int power, bool fail);
void manage_fire_shield(int delay);
+spret_type cast_corpse_rot(bool fail);
void corpse_rot(actor* caster);
int make_a_normal_cloud(coord_def where, int pow, int spread_rate,
@@ -22,7 +26,7 @@ int make_a_normal_cloud(coord_def where, int pow, int spread_rate,
std::string name = "", std::string tile = "");
std::string get_evaporate_result_list(int potion);
-bool cast_evaporate(int pow, bolt& beem, int potion);
+spret_type cast_evaporate(int pow, bolt& beem, int potion, bool fail);
int holy_flames(monster* caster, actor* defender);
#endif