From 167ae03b160a0ccadd7934b2bfe557d491f1cb1f Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 7 Jul 2008 11:58:54 +0000 Subject: Another clean up, and add some new weapon speech. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6439 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/monstuff.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/monstuff.cc') diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 920f4d528e..643e0b2d37 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -2266,7 +2266,7 @@ static bool _choose_random_patrol_target_grid(monsters *mon) { // Slightly greater chance to simply head for the centre. count_grids += 3; - if (random2(count_grids) < 3) + if (x_chance_in_y(3, count_grids)) set_target = true; } else if (one_chance_in(++count_grids)) @@ -3538,7 +3538,7 @@ monsters *choose_random_monster_on_level(int weight, { mons_count += 2; // Named monsters have doubled chances. - if (random2(mons_count) < 2) + if (x_chance_in_y(2, mons_count)) chosen = mon; } else if (one_chance_in(++mons_count)) @@ -4233,7 +4233,7 @@ static bool _handle_special_ability(monsters *monster, bolt & beem) if (!mons_player_visible( monster )) break; - if (monster->type != MONS_HELL_HOUND && random2(13) < 3 + if (monster->type != MONS_HELL_HOUND && x_chance_in_y(3, 13) || one_chance_in(10)) { setup_dragon(monster, beem); @@ -5624,7 +5624,7 @@ int mons_natural_regen_rate(monsters *monster) static inline bool _mons_natural_regen_roll(monsters *monster) { const int regen_rate = mons_natural_regen_rate(monster); - return (random2(25) < regen_rate); + return (x_chance_in_y(regen_rate, 25)); } // Do natural regeneration for monster. @@ -5996,7 +5996,7 @@ static void _handle_monster_move(int i, monsters *monster) } } - if (random2(2 + pfound) < 2) + if (x_chance_in_y(2, 2 + pfound)) mmov_x = mmov_y = 0; // Bounds check: don't let confused monsters try to run @@ -7030,7 +7030,7 @@ static bool _mon_can_move_to_pos(const monsters *monster, const int count_x, case CLOUD_STINK: if (mons_res_poison(monster) > 0) return (true); - if (1 + random2(5) < monster->hit_dice) + if (x_chance_in_y(monster->hit_dice - 1, 5)) return (true); if (monster->hit_points >= random2avg(19, 2)) return (true); -- cgit v1.2.3-54-g00ecf