From 1b83dce6a779ad79baccd3ce407de402714dc69d Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sat, 26 Jan 2008 13:09:25 +0000 Subject: Added penalty for multiple shield blocks in a round for monsters. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3342 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/fight.cc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/fight.cc') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index bec559af46..e7c875ae05 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -2493,6 +2493,10 @@ int melee_attack::player_to_hit(bool random_factor) int your_to_hit = 15 + (calc_stat_to_hit_base() / 2); +#ifdef DEBUG_DIAGNOSTICS + const int base_to_hit = your_to_hit; +#endif + if (water_attack) your_to_hit += 5; @@ -2573,8 +2577,9 @@ int melee_attack::player_to_hit(bool random_factor) your_to_hit = maybe_random2(your_to_hit, random_factor); #if DEBUG_DIAGNOSTICS - mprf( MSGCH_DIAGNOSTICS, "to hit die: %d; rolled value: %d", - roll_hit, your_to_hit ); + mprf( MSGCH_DIAGNOSTICS, + "to hit die: %d; rolled value: %d; base: %d", + roll_hit, your_to_hit, base_to_hit ); #endif if (hand_half_bonus) @@ -3678,6 +3683,11 @@ int melee_attack::mons_to_hit() { const int hd_mult = mons_class_flag(atk->type, M_FIGHTER)? 25 : 15; int mhit = 18 + atk->hit_dice * hd_mult / 10; + +#ifdef DEBUG_DIAGNOSTICS + const int base_hit = mhit; +#endif + if (water_attack) mhit += 5; @@ -3697,6 +3707,12 @@ int melee_attack::mons_to_hit() if (defender->invisible() && !attacker->can_see_invisible()) mhit = mhit * 65 / 100; +#ifdef DEBUG_DIAGNOSTICS + mprf(MSGCH_DIAGNOSTICS, "%s: Base to-hit: %d, Final to-hit: %d", + attacker->name(DESC_PLAIN).c_str(), + base_hit, mhit); +#endif + return (mhit); } -- cgit v1.2.3-54-g00ecf