MCPcopy Create free account
hub / github.com/NetHack/NetHack / kick_ouch

Function kick_ouch

src/dokick.c:880–906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

878}
879
880staticfn void
881kick_ouch(coordxy x, coordxy y, const char *kickobjnam)
882{
883 int dmg;
884 char buf[BUFSZ];
885
886 pline("Ouch! That hurts!");
887 exercise(A_DEX, FALSE);
888 exercise(A_STR, FALSE);
889 if (isok(x, y)) {
890 if (Blind)
891 feel_location(x, y); /* we know we hit it */
892 if (is_drawbridge_wall(x, y) >= 0) {
893 pline_The("drawbridge is unaffected.");
894 /* update maploc to refer to the drawbridge */
895 (void) find_drawbridge(&x, &y);
896 gm.maploc = &levl[x][y];
897 }
898 wake_nearto(x, y, 5 * 5);
899 }
900 if (!rn2(3))
901 set_wounded_legs(RIGHT_SIDE, 5 + rnd(5));
902 dmg = rnd(ACURR(A_CON) > 15 ? 3 : 5);
903 losehp(Maybe_Half_Phys(dmg), kickstr(buf, kickobjnam), KILLED_BY);
904 if (Is_airlevel(&u.uz) || Levitation)
905 hurtle(-u.dx, -u.dy, rn1(2, 4), TRUE); /* assume it's heavy */
906}
907
908/* kick a door */
909staticfn void

Callers 3

kick_doorFunction · 0.85
kick_nondoorFunction · 0.85
dokickFunction · 0.85

Calls 14

exerciseFunction · 0.85
isokFunction · 0.85
feel_locationFunction · 0.85
is_drawbridge_wallFunction · 0.85
pline_TheFunction · 0.85
find_drawbridgeFunction · 0.85
wake_neartoFunction · 0.85
rn2Function · 0.85
set_wounded_legsFunction · 0.85
rndFunction · 0.85
losehpFunction · 0.85
kickstrFunction · 0.85

Tested by

no test coverage detected