summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells1.cc
diff options
context:
space:
mode:
authorCharles Otto <ottochar@gmail.com>2009-10-16 15:28:00 -0400
committerCharles Otto <ottochar@gmail.com>2009-10-16 17:12:32 -0400
commit1feac7b0b1cef1cea1ab107f0cce26e3a94e84b7 (patch)
tree82c6df5370ab885099c1765abdb2f15a3bc51cca /crawl-ref/source/spells1.cc
parentd5c9626b31d13b7e3b180603f72b93910679ba30 (diff)
downloadcrawl-ref-1feac7b0b1cef1cea1ab107f0cce26e3a94e84b7.tar.gz
crawl-ref-1feac7b0b1cef1cea1ab107f0cce26e3a94e84b7.zip
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.
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r--crawl-ref/source/spells1.cc35
1 files changed, 24 insertions, 11 deletions
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.");