summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-15 22:06:31 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-15 22:06:31 +0000
commitf286cbea0ccc47a5d9c6a113f1d40460f7197a78 (patch)
treee93fcf6d8ab858364ba512e82a96a1e0e533a689 /crawl-ref/source/fight.cc
parent4a08b83f96c0579682fd9e9ec4e64eac0e4d854f (diff)
downloadcrawl-ref-f286cbea0ccc47a5d9c6a113f1d40460f7197a78.tar.gz
crawl-ref-f286cbea0ccc47a5d9c6a113f1d40460f7197a78.zip
Added an option, always_confirm_butcher.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2857 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index e132835e88..50b5869f77 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -111,7 +111,7 @@ bool test_melee_hit(int to_hit, int ev)
if (to_hit >= AUTOMATIC_HIT)
return (true);
- else if (random2(1000) < 10 * MIN_HIT_MISS_PERCENTAGE)
+ else if (random2(100) < MIN_HIT_MISS_PERCENTAGE)
margin = (coinflip() ? 1 : -1) * AUTOMATIC_HIT;
else
{
@@ -123,12 +123,11 @@ bool test_melee_hit(int to_hit, int ev)
float miss;
if (to_hit < ev)
- miss = 100.0 - static_cast<float>( MIN_HIT_MISS_PERCENTAGE ) / 2.0;
+ miss = 100.0 - MIN_HIT_MISS_PERCENTAGE / 2.0;
else
{
- miss = static_cast<float>( MIN_HIT_MISS_PERCENTAGE ) / 2.0
- + static_cast<float>( (100 - MIN_HIT_MISS_PERCENTAGE) * ev )
- / static_cast<float>( to_hit );
+ miss = MIN_HIT_MISS_PERCENTAGE / 2.0 +
+ ((100.0 - MIN_HIT_MISS_PERCENTAGE) * ev) / to_hit;
}
mprf( MSGCH_DIAGNOSTICS,