summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-26 14:07:07 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-26 14:07:07 +0000
commit4784d40f57682c0d960f382d5b975e13cf0326a4 (patch)
tree404667b78ec34739bb5e27d5895f5eebe8d313f4 /crawl-ref/source
parent1b83dce6a779ad79baccd3ce407de402714dc69d (diff)
downloadcrawl-ref-4784d40f57682c0d960f382d5b975e13cf0326a4.tar.gz
crawl-ref-4784d40f57682c0d960f382d5b975e13cf0326a4.zip
Fixed inappropriate monsters being able to submerge in air, tweaked monster shield numbers.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3343 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/mon-util.cc4
-rw-r--r--crawl-ref/source/monstuff.cc34
-rw-r--r--crawl-ref/source/player.cc2
3 files changed, 20 insertions, 20 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 981e6298f8..d7f8d89bfb 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -3534,8 +3534,8 @@ int monsters::shield_bonus() const
if (incapacitated())
return (0);
- const int shld_c = property(*shld, PARM_AC);
- return (random2(1 + shld_c) + random2(hit_dice / 2));
+ int shld_c = property(*shld, PARM_AC);
+ return (random2avg(shld_c + hit_dice * 2 / 3, 2));
}
return (-100);
}
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 6dbcdb0e4f..09c20b2016 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -2444,23 +2444,23 @@ static void handle_nearby_ability(monsters *monster)
}
if (monster_can_submerge(monster, grd[monster->x][monster->y])
- && ( !player_beheld_by(monster) // no submerging if player entranced
- && (one_chance_in(5)
- || ((grid_distance( monster->x, monster->y,
- you.x_pos, you.y_pos ) > 1
- // FIXME This is better expressed as a
- // function such as
- // monster_has_ranged_attack:
- && monster->type != MONS_ELECTRICAL_EEL
- && monster->type != MONS_LAVA_SNAKE
- && (monster->type != MONS_MERMAID
- || you.species == SP_MERFOLK)
- // Don't submerge if we just unsubmerged for
- // the sake of shouting.
- && monster->seen_context != "bursts forth shouting"
- && !one_chance_in(20)) ))
- || monster->hit_points <= monster->max_hit_points / 2)
- || env.cgrid[monster->x][monster->y] != EMPTY_CLOUD)
+ && !player_beheld_by(monster) // no submerging if player entranced
+ && (one_chance_in(5)
+ || ((grid_distance( monster->x, monster->y,
+ you.x_pos, you.y_pos ) > 1
+ // FIXME This is better expressed as a
+ // function such as
+ // monster_has_ranged_attack:
+ && monster->type != MONS_ELECTRICAL_EEL
+ && monster->type != MONS_LAVA_SNAKE
+ && (monster->type != MONS_MERMAID
+ || you.species == SP_MERFOLK)
+ // Don't submerge if we just unsubmerged for
+ // the sake of shouting.
+ && monster->seen_context != "bursts forth shouting"
+ && !one_chance_in(20)) )
+ || monster->hit_points <= monster->max_hit_points / 2
+ || env.cgrid[monster->x][monster->y] != EMPTY_CLOUD))
{
monster->add_ench(ENCH_SUBMERGED);
update_beholders(monster);
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 02e6358443..0b69753383 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -5926,7 +5926,7 @@ int player::shield_bonus() const
int player::shield_bypass_ability(int tohit) const
{
- return (10 + tohit * 2);
+ return (15 + tohit / 2);
}
void player::shield_block_succeeded()