diff options
author | wheals <shm.mark@gmail.com> | 2013-12-27 12:14:08 -0500 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2013-12-27 12:35:14 -0500 |
commit | 28267cdae20584e51bdfb2ddca6da68d04facc96 (patch) | |
tree | 40cebe308d824a6a19fab5996268e244a91613fb /crawl-ref/source/fight.cc | |
parent | a75cc6c941a3d4d8eedd9fe4b67b52ba5c60f603 (diff) | |
download | crawl-ref-28267cdae20584e51bdfb2ddca6da68d04facc96.tar.gz crawl-ref-28267cdae20584e51bdfb2ddca6da68d04facc96.zip |
Display minimum delay in a weapon's description.
It could be easily calculated, and it was usually considered extremely
important while only being mentioned in passing in the manual. Thus, all
three important delays are visible now: mindelay, current delay (by
swinging your weapon), and base delay. Like other things on the screen,
it's a base property of the weapon, so there is no reason not to show
it.
The screen had to be condensed a little to fit in 80 chars, but even the
dark maul made it.
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r-- | crawl-ref/source/fight.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 6ae368c156..4369ebd561 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -692,6 +692,25 @@ void attack_cleave_targets(actor* attacker, list<actor*> &targets, } } +int weapon_min_delay(const item_def &weapon) +{ + int min_delay = property(weapon, PWPN_SPEED) / 2; + + // Short blades can get up to at least unarmed speed. + if (weapon_skill(weapon) == SK_SHORT_BLADES && min_delay > 5) + min_delay = 5; + + // All weapons have min delay 7 or better + if (min_delay > 7) + min_delay = 7; + + // never go faster than speed 3 (ie 3.33 attacks per round) + if (min_delay < 3) + min_delay = 3; + + return min_delay; +} + int finesse_adjust_delay(int delay) { if (you.duration[DUR_FINESSE]) |