revamp 'special' combat

This is a re-creation of a project that was lost years ago while not
quite finished.  The old version included some instrumentation to
measure how many hits it takes to kill things during actual play; that
wasn't ready for prime time and this hasn't attempted to redo it.

Changes:
1) improves martial arts and bare-handed combat:  they now have a
   chance to hit twice when skill is better than 'basic'; 20% chance
   for second hit at skilled, 40% at expert, 60% at master, and 80% at
   grandmaster; when attacking more than once, strength bonus is
   handled as in #2;
2) nerfs two-weapon combat a bit:  hitting twice uses only 3/4 strength
   bonus on each hit, but when both attacks hit that's 3/2 bonus from
   strength which is still more than you get for one hit at a time;
3) beefs up two-handed weapons:  hitting via melee with a two-handed
   weapon uses 3/2 of stength bonus to reflect the increased influence
   of strength; isn't done for applied polearms though.

The reduction in strength bonus for two-weapon has far less impact
than it might sound, due to rounding up with the low values involved.
| full   3/4
|  +1 -> +1
|  +2 -> +2
|  +3 -> +2
|  +4 -> +3
|  +5 -> +4
|  +6 -> +5
The small reduction also doesn't matter if/when current hit happens to
deal a killing blow anyway.

Rings of increase damage apply at full value to every hit, same as
before.

When hitting bare-handed (#1 without gloves), a silver ring on either
hand continues to give a damage bonus against silver haters when you
make an ordinary single attack.  However if you attack twice, a silver
ring only applies on the first hit when it is worn on the right hand
and only applies on the second hit when worn on the left hand.  (Two
hits with a silver ring on each hand will give silver bonus for both.)

We might conceivably need to add support for a count prefix of 1 to
let player explicitly avoid a second bare-handed/martial-arts hit
attempt (similar to how throw and fire accept a count to limit missile
volley amount).

Kicking has been ignored.
This commit is contained in:
PatR
2023-07-30 14:08:30 -07:00
parent ecd5be59da
commit 60c1956850
5 changed files with 127 additions and 40 deletions

View File

@@ -941,11 +941,11 @@ struct instance_globals_t {
/* rumors.c */
long true_rumor_size; /* rumor size variables are signed so that value -1
can be used as a flag */
* can be used as a flag */
unsigned long true_rumor_start; /* rumor start offsets are unsigned because
they're handled via %lx format */
* they're handled via %lx format */
long true_rumor_end; /* rumor end offsets are signed because they're
compared with [dlb_]ftell() */
* compared with [dlb_]ftell() */
/* sp_lev.c */
boolean themeroom_failed;
@@ -958,6 +958,9 @@ struct instance_globals_t {
/* topten.c */
winid toptenwin;
/* uhitm.c */
int twohits; /* 0: single hit; 1: first of 2; 2: second of 2 */
boolean havestate;
unsigned long magic; /* validate that structure layout is preserved */
};