diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-09-23 15:00:52 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-09-23 15:00:52 +0000 |
commit | 319a19300a717f47ebb88ebdee27000dfc3ff896 (patch) | |
tree | 4e2c9c6550ca2bdc89793435c7935fa61c881d3b /crawl-ref/source | |
parent | f8dadea90481b48d911cc616f3f7e4c8f91d984d (diff) | |
download | crawl-ref-319a19300a717f47ebb88ebdee27000dfc3ff896.tar.gz crawl-ref-319a19300a717f47ebb88ebdee27000dfc3ff896.zip |
More cleanups with grid_destroys_items().
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup@95 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/beam.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/effects.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 17 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 10 | ||||
-rw-r--r-- | crawl-ref/source/spells4.cc | 2 |
5 files changed, 14 insertions, 22 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 44d1fbc0d9..8c19020114 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -2505,7 +2505,7 @@ static void beam_drop_object( struct bolt &beam, item_def *item, int x, int y ) return; if (YOU_KILL(beam.thrower) // ie if you threw it. - && (grd[x][y] != DNGN_LAVA && grd[x][y] != DNGN_DEEP_WATER)) + && (!grid_destroys_items(grd[x][y]))) { int chance; @@ -2529,8 +2529,7 @@ static void beam_drop_object( struct bolt &beam, item_def *item, int x, int y ) copy_item_to_grid( *item, x, y, 1 ); } else if (MON_KILL(beam.thrower) // monster threw it. - && (grd[x][y] != DNGN_LAVA && grd[x][y] != DNGN_DEEP_WATER) - && coinflip()) + && !grid_destroys_items(grd[x][y]) && coinflip()) { copy_item_to_grid( *item, x, y, 1 ); } // if (thing_throw == 2) ... diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index e7a76e9cfe..3386bbd153 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -1138,7 +1138,7 @@ bool acquirement(unsigned char force_class, int agent) { // how sad (and stupid) mprf(MSGCH_SOUND, - grid_item_destruction_message(grd[you.x_pos][you.y_pos])); + grid_item_destruction_message(grd[you.x_pos][you.y_pos])); } else { diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 3efa056b84..92bf884a85 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -250,9 +250,7 @@ static void monster_drop_ething(struct monsters *monster, bool destroyed = false; bool hostile_grid = false; - if (grd[monster->x][monster->y] == DNGN_LAVA || - grd[monster->x][monster->y] == DNGN_DEEP_WATER) - { + if ( grid_destroys_items(grd[monster->x][monster->y]) ) { hostile_grid = true; } @@ -280,12 +278,9 @@ static void monster_drop_ething(struct monsters *monster, } } - if (destroyed) - { - if (grd[monster->x][monster->y] == DNGN_LAVA) - mpr("You hear a hissing sound.", MSGCH_SOUND); - else - mpr("You hear a splashing sound.", MSGCH_SOUND); + if (destroyed) { + mprf(MSGCH_SOUND, + grid_item_destruction_message(grd[monster->x][monster->y])); } } // end monster_drop_ething() @@ -299,8 +294,8 @@ static void place_monster_corpse(struct monsters *monster) corpse_class = MONS_GLOWING_SHAPESHIFTER; if (mons_weight(corpse_class) == 0 - || grd[monster->x][monster->y] == DNGN_LAVA - || grd[monster->x][monster->y] == DNGN_DEEP_WATER || coinflip()) + || grid_destroys_items(grd[monster->x][monster->y]) + || coinflip()) { return; } diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 158084d031..755b14a8ce 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -431,8 +431,7 @@ void pray(void) } if (gift != NUM_BOOKS - && (grd[you.x_pos][you.y_pos] != DNGN_LAVA - && grd[you.x_pos][you.y_pos] != DNGN_DEEP_WATER)) + && !(grid_destroys_items(grd[you.x_pos][you.y_pos]))) { if (gift == OBJ_RANDOM) success = acquirement(OBJ_BOOKS, you.religion); @@ -874,11 +873,10 @@ void Xom_acts(bool niceness, int sever, bool force_sever) (temp_rand == 1) ? "Xom grants you a gift!" : "Xom's generous nature manifests itself."); - if (grd[you.x_pos][you.y_pos] == DNGN_LAVA - || grd[you.x_pos][you.y_pos] == DNGN_DEEP_WATER) - { + if (grid_destroys_items(grd[you.x_pos][you.y_pos])) { // How unfortunate. I'll bet Xom feels sorry for you. - mpr("You hear a splash."); + mprf(MSGCH_SOUND, + grid_item_destruction_message(grd[you.x_pos][you.y_pos])); } else { diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 612e63fc9b..fd0a3bda20 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -2888,7 +2888,7 @@ void cast_apportation(int pow) // Protect the player from destroying the item const int grid = grd[ you.x_pos ][ you.y_pos ]; - if (grid == DNGN_LAVA || grid == DNGN_DEEP_WATER) + if (grid_destroys_items(grid)) { mpr( "That would be silly while over this terrain!" ); return; |