summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2010-01-08 23:55:16 +0100
committerBardur Arantsson <bardur@scientician.net>2010-01-08 23:55:16 +0100
commit83feea2b1c606716e51f4739794e29971afa8b34 (patch)
tree4d3b33e14f037812610ac2958523bed328b8b76e
parentcb01def7b71e64136ec58ad2876c8e2ed70ac008 (diff)
Extra Blows ability applies to barehand combat too. (Doesn't affect standard ToME, but Theme grants Extra Blows to some barehand fighters.)
-rw-r--r--changes.txt1
-rw-r--r--src/xtra1.c14
2 files changed, 12 insertions, 3 deletions
diff --git a/changes.txt b/changes.txt
index b125df1a..aceb7f9a 100644
--- a/changes.txt
+++ b/changes.txt
@@ -12,6 +12,7 @@ T.o.M.E 2.3.6
- Fix for module directory paths.
- Fix miscellaneous problems on 64-bit platforms.
- Princess room should now always be generated.
+- Extra Blows applies to barehand combat too.
diff --git a/src/xtra1.c b/src/xtra1.c
index 1a9bb361..eea7227c 100644
--- a/src/xtra1.c
+++ b/src/xtra1.c
@@ -2315,6 +2315,15 @@ byte calc_mimic()
return blow;
}
+/* Returns the number of extra blows based on abilities. */
+static int get_extra_blows_ability() {
+ /* Count bonus abilities */
+ int num = 0;
+ if (has_ability(AB_MAX_BLOW1)) num++;
+ if (has_ability(AB_MAX_BLOW2)) num++;
+ return num;
+}
+
/* Returns the blow information based on class */
void analyze_blow(int *num, int *wgt, int *mul)
{
@@ -2323,8 +2332,7 @@ void analyze_blow(int *num, int *wgt, int *mul)
*mul = cp_ptr->blow_mul;
/* Count bonus abilities */
- if (has_ability(AB_MAX_BLOW1)) (*num)++;
- if (has_ability(AB_MAX_BLOW2)) (*num)++;
+ (*num) += get_extra_blows_ability();
}
/* Are all the weapons wielded of the right type ? */
@@ -3653,7 +3661,7 @@ void calc_bonuses(bool silent)
{
int plev = get_skill(SKILL_HAND);
- p_ptr->num_blow = 0;
+ p_ptr->num_blow = get_extra_blows_ability();
if (plev > 9) p_ptr->num_blow++;
if (plev > 19) p_ptr->num_blow++;