From 1feac7b0b1cef1cea1ab107f0cce26e3a94e84b7 Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Fri, 16 Oct 2009 15:28:00 -0400 Subject: Fix bug [2874791], Merfolk stat change issues Fix some conditions causing permanent stat loss or gain for Mf with stat modifying boots. Unmerge boots when the player starts levitating or flying on a water square. Use move_player_to_grid in blink, semi-controlled blink, and teleportation. Also fix a bug where Mf could random teleport into solid walls. --- crawl-ref/source/spells1.cc | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'crawl-ref/source/spells1.cc') diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index d480f36430..57b01695a7 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -234,19 +234,25 @@ void random_blink(bool allow_partial_control, bool override_abyss) #endif else { + // Going to assume that move_player_to_grid works, (it should + // because terrain type etc. was already checked). could result + // in awkward messaging if it cancels for some reason but it's + // probably better than getting the blink message after any Mf + // transform messages all the time -cao mpr("You blink."); - - success = true; - - // Leave a purple cloud. - place_cloud(CLOUD_PURP_SMOKE, you.pos(), 1 + random2(3), KC_YOU); - you.moveto(target); - - if (you.level_type == LEVEL_ABYSS) + coord_def origin = you.pos(); + success = move_player_to_grid(target, false, true, true); + if(success) { - abyss_teleport(false); - if (you.pet_target != MHITYOU) - you.pet_target = MHITNOT; + // Leave a purple cloud. + place_cloud(CLOUD_PURP_SMOKE, origin, 1 + random2(3), KC_YOU); + + if (you.level_type == LEVEL_ABYSS) + { + abyss_teleport(false); + if (you.pet_target != MHITYOU) + you.pet_target = MHITNOT; + } } } @@ -1438,6 +1444,13 @@ void cast_fly(int power) mpr("You swoop lightly up into the air."); else mpr("You fly up into the air."); + + // Merfolk boots unmeld if flight takes us out of water + if(you.species == SP_MERFOLK && grid_is_water(grd(you.pos()))) + { + unmeld_one_equip(EQ_BOOTS); + } + } else mpr("You feel more buoyant."); -- cgit v1.2.3-54-g00ecf