Skip to content

Commit

Permalink
Let digging destroy statues (|amethyst)
Browse files Browse the repository at this point in the history
Since disintegration no longer does, and some vaults required it for access.
  • Loading branch information
Chris Campbell committed Dec 31, 2016
1 parent e4f0a7c commit 3289933
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
27 changes: 11 additions & 16 deletions crawl-ref/source/beam.cc
Expand Up @@ -809,13 +809,15 @@ void bolt::fake_flavour()

void bolt::digging_wall_effect()
{
if (env.markers.property_at(pos(), MAT_ANY, "veto_disintegrate") == "veto")
{
finish_beam();
return;
}

const dungeon_feature_type feat = grd(pos());
switch (feat)
if (feat_is_diggable(feat))
{
case DNGN_ROCK_WALL:
case DNGN_CLEAR_ROCK_WALL:
case DNGN_SLIMY_WALL:
case DNGN_GRATE:
destroy_wall(pos());
if (!msg_generated)
{
Expand All @@ -827,7 +829,7 @@ void bolt::digging_wall_effect()
obvious_effect = true; // You may still see the caster.
msg_generated = true;
}
break;
return;
}

obvious_effect = true;
Expand All @@ -851,12 +853,9 @@ void bolt::digging_wall_effect()
agent() && agent()->is_player() ? "The" : "Some",
wall.c_str());
}
break;

default:
if (feat_is_wall(feat))
finish_beam();
}
else if (feat_is_wall(feat))
finish_beam();
}

void bolt::burn_wall_effect()
Expand Down Expand Up @@ -2772,12 +2771,8 @@ bool bolt::can_affect_wall(const coord_def& p) const
return false;

// digging
if (flavour == BEAM_DIGGING
&& (wall == DNGN_ROCK_WALL || wall == DNGN_CLEAR_ROCK_WALL
|| wall == DNGN_SLIMY_WALL || wall == DNGN_GRATE))
{
if (flavour == BEAM_DIGGING && feat_is_diggable(wall))
return true;
}

if (can_burn_trees())
return feat_is_tree(wall);
Expand Down
9 changes: 9 additions & 0 deletions crawl-ref/source/terrain.cc
Expand Up @@ -425,6 +425,15 @@ bool feat_is_permarock(dungeon_feature_type feat)
return feat == DNGN_PERMAROCK_WALL || feat == DNGN_CLEAR_PERMAROCK_WALL;
}

/** Can this feature be dug?
*/
bool feat_is_diggable(dungeon_feature_type feat)
{
return feat == DNGN_ROCK_WALL || feat == DNGN_CLEAR_ROCK_WALL
|| feat == DNGN_SLIMY_WALL || feat == DNGN_GRATE
|| feat == DNGN_ORCISH_IDOL || DNGN_GRANITE_STATUE;
}

/** Is this feature a type of trap?
*
* @param feat the feature.
Expand Down
1 change: 1 addition & 0 deletions crawl-ref/source/terrain.h
Expand Up @@ -41,6 +41,7 @@ bool feat_is_closed_door(dungeon_feature_type feat);
bool feat_is_sealed(dungeon_feature_type feat);
bool feat_is_statuelike(dungeon_feature_type feat);
bool feat_is_permarock(dungeon_feature_type feat);
bool feat_is_diggable(dungeon_feature_type feat);

bool feat_is_stone_stair_down(dungeon_feature_type feat);
bool feat_is_stone_stair_up(dungeon_feature_type feat);
Expand Down

0 comments on commit 3289933

Please sign in to comment.