summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-transloc.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-transloc.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-transloc.h')
-rw-r--r--crawl-ref/source/spl-transloc.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/crawl-ref/source/spl-transloc.h b/crawl-ref/source/spl-transloc.h
index 57af8b89a8..8f0a3763b8 100644
--- a/crawl-ref/source/spl-transloc.h
+++ b/crawl-ref/source/spl-transloc.h
@@ -1,11 +1,16 @@
#ifndef SPL_TRANSLOC_H
#define SPL_TRANSLOC_H
+#include "spl-cast.h"
+
+spret_type cast_controlled_blink(int pow, bool fail);
int blink(int pow, bool high_level_controlled_blink, bool wizard_blink = false,
std::string *pre_msg = NULL);
+spret_type cast_blink(bool allow_partial_control, bool fail);
void random_blink(bool, bool override_abyss = false);
bool allow_control_teleport(bool quiet = false);
+spret_type cast_teleport_self(bool fail);
void you_teleport();
void you_teleport_now(bool allow_control,
bool new_abyss_area = false,
@@ -13,12 +18,12 @@ void you_teleport_now(bool allow_control,
bool you_teleport_to(const coord_def where,
bool move_monsters = false);
-bool cast_portal_projectile(int pow);
+spret_type cast_portal_projectile(int pow, bool fail);
struct bolt;
-bool cast_apportation(int powc, bolt& beam);
+spret_type cast_apportation(int pow, bolt& beam, bool fail);
int cast_semi_controlled_blink(int pow);
-bool cast_golubrias_passage(const coord_def& where);
+spret_type cast_golubrias_passage(const coord_def& where, bool fail);
bool can_cast_golubrias_passage();
#endif