From 4784d40f57682c0d960f382d5b975e13cf0326a4 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sat, 26 Jan 2008 14:07:07 +0000 Subject: 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 --- crawl-ref/source/mon-util.cc | 4 ++-- crawl-ref/source/monstuff.cc | 34 +++++++++++++++++----------------- crawl-ref/source/player.cc | 2 +- 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() -- cgit v1.2.3-54-g00ecf