diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-11-27 14:40:31 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-11-27 23:35:19 +0100 |
commit | 1b66571fcb2c7977a8f38a9d170bcf1245db8e99 (patch) | |
tree | 62e03f3ee379f1332548fa54e5cad5bf8c7dc76f /crawl-ref/source/transform.cc | |
parent | db05fb10af519a857e81e2c317e0ebceaf8392e0 (diff) | |
download | crawl-ref-1b66571fcb2c7977a8f38a9d170bcf1245db8e99.tar.gz crawl-ref-1b66571fcb2c7977a8f38a9d170bcf1245db8e99.zip |
Make sure potions of lignification don't work in water if you can't permafly.
Diffstat (limited to 'crawl-ref/source/transform.cc')
-rw-r--r-- | crawl-ref/source/transform.cc | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/crawl-ref/source/transform.cc b/crawl-ref/source/transform.cc index 403273ceba..d7ca267b3a 100644 --- a/crawl-ref/source/transform.cc +++ b/crawl-ref/source/transform.cc @@ -81,6 +81,8 @@ bool form_can_wear(transformation_type form) bool form_can_fly(transformation_type form) { + if (form == TRAN_TREE) + return false; if (you.racial_permanent_flight() && you.permanent_flight()) return true; return form == TRAN_DRAGON || form == TRAN_BAT || form == TRAN_WISP; @@ -535,6 +537,9 @@ int form_hp_mod() static bool _flying_in_new_form(transformation_type which_trans) { + if (which_trans == TRAN_TREE) + return false; + // If our flight is uncancellable (or tenguish) then it's not from evoking if (you.attribute[ATTR_FLIGHT_UNCANCELLABLE] || you.permanent_flight() && you.racial_permanent_flight()) @@ -583,7 +588,19 @@ bool feat_dangerous_for_form(transformation_type which_trans, return !form_likes_lava(which_trans); if (feat == DNGN_DEEP_WATER) - return !form_likes_water(which_trans) && !beogh_water_walk(); + { + if (beogh_water_walk() + || species_likes_water(you.species) + || you.racial_permanent_flight()) + { + return false; + } + // Trees are ok with deep water, but you need means of escaping + // once the transformation expires. + if (which_trans == TRAN_TREE) + return !you.wearing_ego(EQ_ALL_ARMOUR, SPARM_FLYING); + return !form_likes_water(which_trans); + } return false; } |