Merge branch 'fix-kick' of https://github.com/argrath/NetHack into pr754
This commit is contained in:
71
src/dokick.c
71
src/dokick.c
@@ -19,6 +19,7 @@ static int really_kick_object(xchar, xchar);
|
|||||||
static char *kickstr(char *, const char *);
|
static char *kickstr(char *, const char *);
|
||||||
static boolean watchman_thief_arrest(struct monst *);
|
static boolean watchman_thief_arrest(struct monst *);
|
||||||
static boolean watchman_door_damage(struct monst *, xchar, xchar);
|
static boolean watchman_door_damage(struct monst *, xchar, xchar);
|
||||||
|
static void kick_dumb(int, int);
|
||||||
static void otransit_msg(struct obj *, boolean, boolean, long);
|
static void otransit_msg(struct obj *, boolean, boolean, long);
|
||||||
static void drop_to(coord *, schar, xchar, xchar);
|
static void drop_to(coord *, schar, xchar, xchar);
|
||||||
|
|
||||||
@@ -800,6 +801,23 @@ watchman_door_damage(struct monst *mtmp, xchar x, xchar y)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
kick_dumb(int x, int y)
|
||||||
|
{
|
||||||
|
exercise(A_DEX, FALSE);
|
||||||
|
if (martial() || ACURR(A_DEX) >= 16 || rn2(3)) {
|
||||||
|
You("kick at empty space.");
|
||||||
|
if (Blind)
|
||||||
|
feel_location(x, y);
|
||||||
|
} else {
|
||||||
|
pline("Dumb move! You strain a muscle.");
|
||||||
|
exercise(A_STR, FALSE);
|
||||||
|
set_wounded_legs(RIGHT_SIDE, 5 + rnd(5));
|
||||||
|
}
|
||||||
|
if ((Is_airlevel(&u.uz) || Levitation) && rn2(2))
|
||||||
|
hurtle(-u.dx, -u.dy, 1, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
/* the #kick command */
|
/* the #kick command */
|
||||||
int
|
int
|
||||||
dokick(void)
|
dokick(void)
|
||||||
@@ -1039,8 +1057,10 @@ dokick(void)
|
|||||||
}
|
}
|
||||||
if (IS_THRONE(g.maploc->typ)) {
|
if (IS_THRONE(g.maploc->typ)) {
|
||||||
register int i;
|
register int i;
|
||||||
if (Levitation)
|
if (Levitation) {
|
||||||
goto dumb;
|
kick_dumb(x, y);
|
||||||
|
return ECMD_TIME;
|
||||||
|
}
|
||||||
if ((Luck < 0 || g.maploc->doormask) && !rn2(3)) {
|
if ((Luck < 0 || g.maploc->doormask) && !rn2(3)) {
|
||||||
g.maploc->typ = ROOM;
|
g.maploc->typ = ROOM;
|
||||||
g.maploc->doormask = 0; /* don't leave loose ends.. */
|
g.maploc->doormask = 0; /* don't leave loose ends.. */
|
||||||
@@ -1081,8 +1101,10 @@ dokick(void)
|
|||||||
goto ouch;
|
goto ouch;
|
||||||
}
|
}
|
||||||
if (IS_ALTAR(g.maploc->typ)) {
|
if (IS_ALTAR(g.maploc->typ)) {
|
||||||
if (Levitation)
|
if (Levitation) {
|
||||||
goto dumb;
|
kick_dumb(x, y);
|
||||||
|
return ECMD_TIME;
|
||||||
|
}
|
||||||
You("kick %s.", (Blind ? something : "the altar"));
|
You("kick %s.", (Blind ? something : "the altar"));
|
||||||
altar_wrath(x, y);
|
altar_wrath(x, y);
|
||||||
if (!rn2(3))
|
if (!rn2(3))
|
||||||
@@ -1091,8 +1113,10 @@ dokick(void)
|
|||||||
return ECMD_TIME;
|
return ECMD_TIME;
|
||||||
}
|
}
|
||||||
if (IS_FOUNTAIN(g.maploc->typ)) {
|
if (IS_FOUNTAIN(g.maploc->typ)) {
|
||||||
if (Levitation)
|
if (Levitation) {
|
||||||
goto dumb;
|
kick_dumb(x, y);
|
||||||
|
return ECMD_TIME;
|
||||||
|
}
|
||||||
You("kick %s.", (Blind ? something : "the fountain"));
|
You("kick %s.", (Blind ? something : "the fountain"));
|
||||||
if (!rn2(3))
|
if (!rn2(3))
|
||||||
goto ouch;
|
goto ouch;
|
||||||
@@ -1106,8 +1130,10 @@ dokick(void)
|
|||||||
return ECMD_TIME;
|
return ECMD_TIME;
|
||||||
}
|
}
|
||||||
if (IS_GRAVE(g.maploc->typ)) {
|
if (IS_GRAVE(g.maploc->typ)) {
|
||||||
if (Levitation)
|
if (Levitation) {
|
||||||
goto dumb;
|
kick_dumb(x, y);
|
||||||
|
return ECMD_TIME;
|
||||||
|
}
|
||||||
if (rn2(4))
|
if (rn2(4))
|
||||||
goto ouch;
|
goto ouch;
|
||||||
exercise(A_WIS, FALSE);
|
exercise(A_WIS, FALSE);
|
||||||
@@ -1189,8 +1215,10 @@ dokick(void)
|
|||||||
if (IS_SINK(g.maploc->typ)) {
|
if (IS_SINK(g.maploc->typ)) {
|
||||||
int gend = poly_gender();
|
int gend = poly_gender();
|
||||||
|
|
||||||
if (Levitation)
|
if (Levitation) {
|
||||||
goto dumb;
|
kick_dumb(x, y);
|
||||||
|
return ECMD_TIME;
|
||||||
|
}
|
||||||
if (rn2(5)) {
|
if (rn2(5)) {
|
||||||
if (!Deaf)
|
if (!Deaf)
|
||||||
pline("Klunk! The pipes vibrate noisily.");
|
pline("Klunk! The pipes vibrate noisily.");
|
||||||
@@ -1247,8 +1275,10 @@ dokick(void)
|
|||||||
}
|
}
|
||||||
if (g.maploc->typ == STAIRS || g.maploc->typ == LADDER
|
if (g.maploc->typ == STAIRS || g.maploc->typ == LADDER
|
||||||
|| IS_STWALL(g.maploc->typ)) {
|
|| IS_STWALL(g.maploc->typ)) {
|
||||||
if (!IS_STWALL(g.maploc->typ) && g.maploc->ladder == LA_DOWN)
|
if (!IS_STWALL(g.maploc->typ) && g.maploc->ladder == LA_DOWN) {
|
||||||
goto dumb;
|
kick_dumb(x, y);
|
||||||
|
return ECMD_TIME;
|
||||||
|
}
|
||||||
ouch:
|
ouch:
|
||||||
pline("Ouch! That hurts!");
|
pline("Ouch! That hurts!");
|
||||||
exercise(A_DEX, FALSE);
|
exercise(A_DEX, FALSE);
|
||||||
@@ -1271,24 +1301,13 @@ dokick(void)
|
|||||||
hurtle(-u.dx, -u.dy, rn1(2, 4), TRUE); /* assume it's heavy */
|
hurtle(-u.dx, -u.dy, rn1(2, 4), TRUE); /* assume it's heavy */
|
||||||
return ECMD_TIME;
|
return ECMD_TIME;
|
||||||
}
|
}
|
||||||
goto dumb;
|
kick_dumb(x, y);
|
||||||
|
return ECMD_TIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g.maploc->doormask == D_ISOPEN || g.maploc->doormask == D_BROKEN
|
if (g.maploc->doormask == D_ISOPEN || g.maploc->doormask == D_BROKEN
|
||||||
|| g.maploc->doormask == D_NODOOR) {
|
|| g.maploc->doormask == D_NODOOR) {
|
||||||
dumb:
|
kick_dumb(x, y);
|
||||||
exercise(A_DEX, FALSE);
|
|
||||||
if (martial() || ACURR(A_DEX) >= 16 || rn2(3)) {
|
|
||||||
You("kick at empty space.");
|
|
||||||
if (Blind)
|
|
||||||
feel_location(x, y);
|
|
||||||
} else {
|
|
||||||
pline("Dumb move! You strain a muscle.");
|
|
||||||
exercise(A_STR, FALSE);
|
|
||||||
set_wounded_legs(RIGHT_SIDE, 5 + rnd(5));
|
|
||||||
}
|
|
||||||
if ((Is_airlevel(&u.uz) || Levitation) && rn2(2))
|
|
||||||
hurtle(-u.dx, -u.dy, 1, TRUE);
|
|
||||||
return ECMD_TIME; /* uses a turn */
|
return ECMD_TIME; /* uses a turn */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user