Skip to content

Commit

Permalink
Make martial arts users immune to leg damage from bad kicks
Browse files Browse the repository at this point in the history
Characters who have at least basic training in proper form for making
kicks are unlikely to fail to apply that training even if they decide to
kick a wall or heavy object. The kick won't necessarily accomplish
anything, but it will be properly executed. This removes the HP and
wounded leg damage in the "Ouch! That hurts!" kick failure case for all
characters with Basic martial arts (i.e. all monks and samurai) and
replaces it with an "ineffective" message. The kick still makes noise to
wake up monsters and still subjects the hero to Newton's 3rd Law.

Closes #151
  • Loading branch information
copperwater committed Jun 23, 2024
1 parent 45af15d commit a940be7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 2 additions & 0 deletions doc/xnh-changelog-9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ changes:
paralyzed by lightning on the Plane of Air.
- The bigroom variant which contains patches of light and darkness has a new
variation with randomly generated "spotlights" of lit area.
- Martial arts users with at least Basic skill (all monks and samurai) no longer
take damage or wound their legs when kicking inadvisable things.

### Interface changes

Expand Down
23 changes: 17 additions & 6 deletions src/dokick.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,26 +884,37 @@ kick_ouch(coordxy x, coordxy y, const char *kickobjnam)
{
int dmg;
char buf[BUFSZ];
/* this is explicitly NOT martial(), kicking boots do not
* protect from damage; this was initially "has Basic or higher in martial
* arts", but that happens to be equivalent to martial_bonus() anyway */
boolean mart = martial_bonus();

pline("Ouch! That hurts!");
if (mart)
Your("kick is ineffective.");
else
pline("Ouch! That hurts!");
exercise(A_DEX, FALSE);
exercise(A_STR, FALSE);
wake_nearby();
if (isok(x, y)) {
if (Blind)
feel_location(x, y); /* we know we hit it */
if (is_drawbridge_wall(x, y) >= 0) {
pline_The("drawbridge is unaffected.");
if (!mart)
/* avoid similar message right after "ineffective" */
pline_The("drawbridge is unaffected.");
/* update maploc to refer to the drawbridge */
(void) find_drawbridge(&x, &y);
gm.maploc = &levl[x][y];
}
wake_nearto(x, y, 5 * 5);
}
if (!rn2(3))
set_wounded_legs(RIGHT_SIDE, 5 + rnd(5));
dmg = rnd(ACURR(A_CON) > 15 ? 3 : 5);
losehp(Maybe_Half_Phys(dmg), kickstr(buf, kickobjnam), KILLED_BY);
if (!mart) {
if (!rn2(3))
set_wounded_legs(RIGHT_SIDE, 5 + rnd(5));
dmg = rnd(ACURR(A_CON) > 15 ? 3 : 5);
losehp(Maybe_Half_Phys(dmg), kickstr(buf, kickobjnam), KILLED_BY);
}
if (Is_airlevel(&u.uz) || Levitation)
hurtle(-u.dx, -u.dy, rn1(2, 4), TRUE); /* assume it's heavy */
}
Expand Down

0 comments on commit a940be7

Please sign in to comment.