summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-08 20:40:24 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-08 20:40:24 +0000
commitb31338b60aefb79b5d31e7bd1e3573c5965047e3 (patch)
tree2f406ecb6e20d62bcac6682636f15f9fd3744ecb /crawl-ref/source/monstuff.cc
parenta1b5f79cc172bddee8b225cd5a6726f6a5451666 (diff)
downloadcrawl-ref-b31338b60aefb79b5d31e7bd1e3573c5965047e3.tar.gz
crawl-ref-b31338b60aefb79b5d31e7bd1e3573c5965047e3.zip
New key=value logfile format as proposed by Shawn Moore. This is more verbose
than the old format by about 2x, but is more maintainable and comprehensible. Removed support for parsing scorefiles/logfiles older than 4.0 beta 26. Added shim to make 0.1.7 logfiles compatible with 0.2 Using the -scorefile option alone (no -scores, -tscores, etc.) causes Crawl to read in the existing scorefile/logfile and write it out to stdout in the new format. Ghouls get claw damage messages in unarmed combat. Plain oozes lose acid damage attacks (added inadvertently). Prompt the user when trying to displace a friendly over water (the old fix was to simply say "The foo resists"). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@994 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc21
1 files changed, 12 insertions, 9 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index b0f932e8f5..c5882d783a 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -1167,18 +1167,23 @@ static bool habitat_okay( struct monsters *monster, int targ )
// swap pets to their death, we can let that go). -- bwr
bool swap_places(struct monsters *monster)
{
- bool swap;
-
int loc_x = you.x_pos;
int loc_y = you.y_pos;
const int mgrid = grd[monster->x][monster->y];
- swap = habitat_okay( monster, grd[loc_x][loc_y] )
- && !is_grid_dangerous(mgrid);
+ const bool mon_dest_okay = habitat_okay( monster, grd[loc_x][loc_y] );
+ const bool you_dest_okay =
+ !is_grid_dangerous(mgrid)
+ || yesno("Do you really want to step there?", false, 'n');
+
+ if (!you_dest_okay)
+ return (false);
+
+ bool swap = mon_dest_okay;
// chose an appropiate habitat square at random around the target.
- if (!swap && !is_grid_dangerous(mgrid))
+ if (!swap)
{
int num_found = 0;
int temp_x, temp_y;
@@ -4534,9 +4539,8 @@ void mons_check_pool(monsters *mons, int killer)
return;
const int grid = grd(mons->pos());
- const int native_habitat = monster_habitat(mons->type);
if ((grid == DNGN_LAVA || grid == DNGN_DEEP_WATER)
- && grid != native_habitat)
+ && !monster_habitable_grid(mons, grid))
{
const bool message = mons_near(mons);
@@ -4549,8 +4553,7 @@ void mons_check_pool(monsters *mons, int killer)
// Even fire resistant monsters perish in lava, but undead can survive
// deep water.
- if (!monster_habitable_grid(mons, grid)
- && (grid == DNGN_LAVA || mons->holiness() != MH_UNDEAD))
+ if (grid == DNGN_LAVA || mons->holiness() != MH_UNDEAD)
{
if (message)
{