summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-mis.h
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-21 07:04:54 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-21 07:04:54 +0000
commit4caf249f71150e9e083e9c3e5b0f0f046c5ef64f (patch)
tree6fc6b9b5bd50d0cc432af4e89051a19c52630ed6 /crawl-ref/source/spl-mis.h
parentcf72d214ea56a4198e4fd9817cde7c7bef45622f (diff)
downloadcrawl-ref-4caf249f71150e9e083e9c3e5b0f0f046c5ef64f.tar.gz
crawl-ref-4caf249f71150e9e083e9c3e5b0f0f046c5ef64f.zip
You can now request that a spell miscast effect not directly kill the player
and leave him/her with at least N hp (it can still indirectly kill the player by causing the death of a mummy, giant spore or ball lightning). Doesn't cover the case of a level 3 transmigration miscast deleting the robust mutation or giving the frail mutation before causing hp damage. The Xom bad effects code now requests (unless Xom is being nasty) that spell miscasts not directly kill the player, rather than avoiding miscasts alltogether if the player has low HP (which didn't cover things like miscasts leading to death via XP drain or stat loss, in addition to it avoiding spell miscasts much too often). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7894 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-mis.h')
-rw-r--r--crawl-ref/source/spl-mis.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/crawl-ref/source/spl-mis.h b/crawl-ref/source/spl-mis.h
index 781e999795..c1f3dee006 100644
--- a/crawl-ref/source/spl-mis.h
+++ b/crawl-ref/source/spl-mis.h
@@ -44,16 +44,22 @@ public:
MiscastEffect(actor* _target, int _source, spell_type _spell, int _pow,
int _fail, std::string _cause = "",
nothing_happens_when_type _nothing_happens = NH_DEFAULT,
+ int _lethality_margin = 0,
std::string _hand_str = "", bool _can_plural_hand = true);
MiscastEffect(actor* _target, int _source, spschool_flag_type _school,
int _level, std::string _cause,
nothing_happens_when_type _nothing_happens = NH_DEFAULT,
+ int _lethality_margin = 0,
std::string _hand_str = "", bool _can_plural_hand = true);
MiscastEffect(actor* _target, int _source, spschool_flag_type _school,
int _pow, int _fail, std::string _cause,
nothing_happens_when_type _nothing_happens = NH_DEFAULT,
+ int _lethality_margin = 0,
std::string _hand_str = "", bool _can_plural_hand = true);
+
+ ~MiscastEffect();
+
void do_miscast();
private:
@@ -78,6 +84,8 @@ private:
nothing_happens_when_type nothing_happens_when;
+ int lethality_margin;
+
std::string hand_str;
bool can_plural_hand;
@@ -97,6 +105,9 @@ private:
msg_channel_type msg_ch;
+ int recursion_depth;
+ bool did_msg;
+
private:
void init();
std::string get_default_cause();
@@ -104,12 +115,15 @@ private:
bool neither_end_silenced();
void do_msg(bool suppress_nothing_happens = false);
- void _ouch(int dam, beam_type flavour = BEAM_NONE);
- void _explosion();
+ bool _ouch(int dam, beam_type flavour = BEAM_NONE);
+ bool _explosion();
+ bool _lose_stat(unsigned char which_stat, unsigned char stat_loss);
void _potion_effect(int pot_eff, int pow);
bool _create_monster(monster_type what, int abj_deg, bool alert = false);
void send_abyss();
+ bool avoid_lethal(int dam);
+
void _conjuration(int severity);
void _enchantment(int severity);
void _translocation(int severity);