diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-01-26 13:09:25 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-01-26 13:09:25 +0000 |
commit | 1b83dce6a779ad79baccd3ce407de402714dc69d (patch) | |
tree | 3cc509a5d4c024e750567d540001e765f1378fa7 /crawl-ref/source/fight.cc | |
parent | fb7a3b56c6dde207c2fa6233d0738af8b20fac6d (diff) | |
download | crawl-ref-1b83dce6a779ad79baccd3ce407de402714dc69d.tar.gz crawl-ref-1b83dce6a779ad79baccd3ce407de402714dc69d.zip |
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
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r-- | crawl-ref/source/fight.cc | 20 |
1 files changed, 18 insertions, 2 deletions
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); } |