Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7
This commit is contained in:
@@ -52,6 +52,7 @@ poly'd hero was able to zap wands, apply tools, and #rub objects without
|
|||||||
having any hands
|
having any hands
|
||||||
spellcasting monster got an extra move after casting
|
spellcasting monster got an extra move after casting
|
||||||
allow defining #wizgenesis quantity in the prompt
|
allow defining #wizgenesis quantity in the prompt
|
||||||
|
digging through iron bars from an adjacent pit made a pit on top of the bars
|
||||||
|
|
||||||
|
|
||||||
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
||||||
|
|||||||
@@ -630,6 +630,9 @@ E void FDECL(u_on_sstairs, (int));
|
|||||||
E void NDECL(u_on_upstairs);
|
E void NDECL(u_on_upstairs);
|
||||||
E void NDECL(u_on_dnstairs);
|
E void NDECL(u_on_dnstairs);
|
||||||
E boolean FDECL(On_stairs, (XCHAR_P, XCHAR_P));
|
E boolean FDECL(On_stairs, (XCHAR_P, XCHAR_P));
|
||||||
|
E boolean FDECL(On_ladder, (XCHAR_P, XCHAR_P));
|
||||||
|
E boolean FDECL(On_stairs_up, (XCHAR_P, XCHAR_P));
|
||||||
|
E boolean FDECL(On_stairs_dn, (XCHAR_P, XCHAR_P));
|
||||||
E void FDECL(get_level, (d_level *, int));
|
E void FDECL(get_level, (d_level *, int));
|
||||||
E boolean FDECL(Is_botlevel, (d_level *));
|
E boolean FDECL(Is_botlevel, (d_level *));
|
||||||
E boolean FDECL(Can_fall_thru, (d_level *));
|
E boolean FDECL(Can_fall_thru, (d_level *));
|
||||||
@@ -1551,6 +1554,7 @@ E boolean FDECL(monhaskey, (struct monst *, BOOLEAN_P));
|
|||||||
E void FDECL(mon_regen, (struct monst *, BOOLEAN_P));
|
E void FDECL(mon_regen, (struct monst *, BOOLEAN_P));
|
||||||
E int FDECL(dochugw, (struct monst *));
|
E int FDECL(dochugw, (struct monst *));
|
||||||
E boolean FDECL(onscary, (int, int, struct monst *));
|
E boolean FDECL(onscary, (int, int, struct monst *));
|
||||||
|
E struct monst *FDECL(find_pmmonst, (int));
|
||||||
E int FDECL(bee_eat_jelly, (struct monst *, struct obj *));
|
E int FDECL(bee_eat_jelly, (struct monst *, struct obj *));
|
||||||
E void FDECL(monflee, (struct monst *, int, BOOLEAN_P, BOOLEAN_P));
|
E void FDECL(monflee, (struct monst *, int, BOOLEAN_P, BOOLEAN_P));
|
||||||
E void FDECL(mon_yells, (struct monst *, const char *));
|
E void FDECL(mon_yells, (struct monst *, const char *));
|
||||||
|
|||||||
@@ -3835,17 +3835,13 @@ boolean doit;
|
|||||||
add_herecmd_menuitem(win, dosit,
|
add_herecmd_menuitem(win, dosit,
|
||||||
"Sit on the throne");
|
"Sit on the throne");
|
||||||
|
|
||||||
if ((u.ux == xupstair && u.uy == yupstair)
|
if (On_stairs_up(u.ux, u.uy)) {
|
||||||
|| (u.ux == g.sstairs.sx && u.uy == g.sstairs.sy && g.sstairs.up)
|
|
||||||
|| (u.ux == xupladder && u.uy == yupladder)) {
|
|
||||||
Sprintf(buf, "Go up the %s",
|
Sprintf(buf, "Go up the %s",
|
||||||
(u.ux == xupladder && u.uy == yupladder)
|
(u.ux == xupladder && u.uy == yupladder)
|
||||||
? "ladder" : "stairs");
|
? "ladder" : "stairs");
|
||||||
add_herecmd_menuitem(win, doup, buf);
|
add_herecmd_menuitem(win, doup, buf);
|
||||||
}
|
}
|
||||||
if ((u.ux == xdnstair && u.uy == ydnstair)
|
if (On_stairs_dn(u.ux, u.uy)) {
|
||||||
|| (u.ux == g.sstairs.sx && u.uy == g.sstairs.sy && !g.sstairs.up)
|
|
||||||
|| (u.ux == xdnladder && u.uy == ydnladder)) {
|
|
||||||
Sprintf(buf, "Go down the %s",
|
Sprintf(buf, "Go down the %s",
|
||||||
(u.ux == xupladder && u.uy == yupladder)
|
(u.ux == xupladder && u.uy == yupladder)
|
||||||
? "ladder" : "stairs");
|
? "ladder" : "stairs");
|
||||||
@@ -3955,16 +3951,10 @@ int x, y, mod;
|
|||||||
} else if (IS_THRONE(levl[u.ux][u.uy].typ)) {
|
} else if (IS_THRONE(levl[u.ux][u.uy].typ)) {
|
||||||
cmd[0] = cmd_from_func(dosit);
|
cmd[0] = cmd_from_func(dosit);
|
||||||
return cmd;
|
return cmd;
|
||||||
} else if ((u.ux == xupstair && u.uy == yupstair)
|
} else if (On_stairs_up(u.ux, u.uy)) {
|
||||||
|| (u.ux == g.sstairs.sx && u.uy == g.sstairs.sy
|
|
||||||
&& g.sstairs.up)
|
|
||||||
|| (u.ux == xupladder && u.uy == yupladder)) {
|
|
||||||
cmd[0] = cmd_from_func(doup);
|
cmd[0] = cmd_from_func(doup);
|
||||||
return cmd;
|
return cmd;
|
||||||
} else if ((u.ux == xdnstair && u.uy == ydnstair)
|
} else if (On_stairs_dn(u.ux, u.uy)) {
|
||||||
|| (u.ux == g.sstairs.sx && u.uy == g.sstairs.sy
|
|
||||||
&& !g.sstairs.up)
|
|
||||||
|| (u.ux == xdnladder && u.uy == ydnladder)) {
|
|
||||||
cmd[0] = cmd_from_func(dodown);
|
cmd[0] = cmd_from_func(dodown);
|
||||||
return cmd;
|
return cmd;
|
||||||
} else if ((o = vobj_at(u.ux, u.uy)) != 0) {
|
} else if ((o = vobj_at(u.ux, u.uy)) != 0) {
|
||||||
|
|||||||
@@ -1635,6 +1635,7 @@ char *msg;
|
|||||||
} else if (ltyp == IRONBARS) {
|
} else if (ltyp == IRONBARS) {
|
||||||
/* "set of iron bars" */
|
/* "set of iron bars" */
|
||||||
Strcpy(msg, "The bars go much deeper than your pit.");
|
Strcpy(msg, "The bars go much deeper than your pit.");
|
||||||
|
return FALSE;
|
||||||
#if 0
|
#if 0
|
||||||
} else if (is_lava(cc->x, cc->y)) {
|
} else if (is_lava(cc->x, cc->y)) {
|
||||||
} else if (is_ice(cc->x, cc->y)) {
|
} else if (is_ice(cc->x, cc->y)) {
|
||||||
@@ -1644,8 +1645,7 @@ char *msg;
|
|||||||
} else if (IS_SINK(ltyp)) {
|
} else if (IS_SINK(ltyp)) {
|
||||||
Strcpy(msg, "A tangled mass of plumbing remains below the sink.");
|
Strcpy(msg, "A tangled mass of plumbing remains below the sink.");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else if ((cc->x == xupladder && cc->y == yupladder) /* ladder up */
|
} else if (On_ladder(cc->x, cc->y)) {
|
||||||
|| (cc->x == xdnladder && cc->y == ydnladder)) { /* " down */
|
|
||||||
Strcpy(msg, "The ladder is unaffected.");
|
Strcpy(msg, "The ladder is unaffected.");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else {
|
} else {
|
||||||
@@ -1657,15 +1657,8 @@ char *msg;
|
|||||||
supporting = "throne";
|
supporting = "throne";
|
||||||
else if (IS_ALTAR(ltyp))
|
else if (IS_ALTAR(ltyp))
|
||||||
supporting = "altar";
|
supporting = "altar";
|
||||||
else if ((cc->x == xupstair && cc->y == yupstair)
|
else if (On_stairs(cc->x, cc->y))
|
||||||
|| (cc->x == g.sstairs.sx && cc->y == g.sstairs.sy
|
/* staircase up or down. On_ladder handled above. */
|
||||||
&& g.sstairs.up))
|
|
||||||
/* "staircase up" */
|
|
||||||
supporting = "stairs";
|
|
||||||
else if ((cc->x == xdnstair && cc->y == ydnstair)
|
|
||||||
|| (cc->x == g.sstairs.sx && cc->y == g.sstairs.sy
|
|
||||||
&& !g.sstairs.up))
|
|
||||||
/* "staircase down" */
|
|
||||||
supporting = "stairs";
|
supporting = "stairs";
|
||||||
else if (ltyp == DRAWBRIDGE_DOWN /* "lowered drawbridge" */
|
else if (ltyp == DRAWBRIDGE_DOWN /* "lowered drawbridge" */
|
||||||
|| ltyp == DBWALL) /* "raised drawbridge" */
|
|| ltyp == DBWALL) /* "raised drawbridge" */
|
||||||
|
|||||||
@@ -755,17 +755,10 @@ register struct obj *obj;
|
|||||||
return POISON;
|
return POISON;
|
||||||
if (obj->otyp == LUMP_OF_ROYAL_JELLY
|
if (obj->otyp == LUMP_OF_ROYAL_JELLY
|
||||||
&& mon->data == &mons[PM_KILLER_BEE]) {
|
&& mon->data == &mons[PM_KILLER_BEE]) {
|
||||||
struct monst *mtmp = 0;
|
struct monst *mtmp = find_pmmonst(PM_QUEEN_BEE);
|
||||||
|
|
||||||
/* if there's a queen bee on the level, don't eat royal jelly;
|
/* if there's a queen bee on the level, don't eat royal jelly;
|
||||||
if there isn't, do eat it and grow into a queen */
|
if there isn't, do eat it and grow into a queen */
|
||||||
if ((g.mvitals[PM_QUEEN_BEE].mvflags & G_GENOD) == 0)
|
|
||||||
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
|
||||||
if (DEADMONSTER(mtmp))
|
|
||||||
continue;
|
|
||||||
if (mtmp->data == &mons[PM_QUEEN_BEE])
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return !mtmp ? DOGFOOD : TABU;
|
return !mtmp ? DOGFOOD : TABU;
|
||||||
}
|
}
|
||||||
if (!carni && !herbi)
|
if (!carni && !herbi)
|
||||||
|
|||||||
@@ -1524,6 +1524,32 @@ xchar x, y;
|
|||||||
|| (x == g.sstairs.sx && y == g.sstairs.sy));
|
|| (x == g.sstairs.sx && y == g.sstairs.sy));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean
|
||||||
|
On_ladder(x, y)
|
||||||
|
xchar x, y;
|
||||||
|
{
|
||||||
|
return (boolean) ((x == xdnladder && y == ydnladder)
|
||||||
|
|| (x == xupladder && y == yupladder));
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean
|
||||||
|
On_stairs_up(x, y)
|
||||||
|
xchar x, y;
|
||||||
|
{
|
||||||
|
return ((x == xupstair && y == yupstair)
|
||||||
|
|| (x == g.sstairs.sx && y == g.sstairs.sy && g.sstairs.up)
|
||||||
|
|| (x == xupladder && y == yupladder));
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean
|
||||||
|
On_stairs_dn(x, y)
|
||||||
|
xchar x, y;
|
||||||
|
{
|
||||||
|
return ((x == xdnstair && y == ydnstair)
|
||||||
|
|| (x == g.sstairs.sx && y == g.sstairs.sy && !g.sstairs.up)
|
||||||
|
|| (x == xdnladder && y == ydnladder));
|
||||||
|
}
|
||||||
|
|
||||||
boolean
|
boolean
|
||||||
Is_botlevel(lev)
|
Is_botlevel(lev)
|
||||||
d_level *lev;
|
d_level *lev;
|
||||||
|
|||||||
+18
-9
@@ -252,6 +252,23 @@ struct monst *mon;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct monst *
|
||||||
|
find_pmmonst(pm)
|
||||||
|
int pm;
|
||||||
|
{
|
||||||
|
struct monst *mtmp = 0;
|
||||||
|
|
||||||
|
if ((g.mvitals[pm].mvflags & G_GENOD) == 0)
|
||||||
|
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
||||||
|
if (DEADMONSTER(mtmp))
|
||||||
|
continue;
|
||||||
|
if (mtmp->data == &mons[pm])
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return mtmp;
|
||||||
|
}
|
||||||
|
|
||||||
/* killer bee 'mon' is on a spot containing lump of royal jelly 'obj' and
|
/* killer bee 'mon' is on a spot containing lump of royal jelly 'obj' and
|
||||||
will eat it if there is no queen bee on the level; return 1: mon died,
|
will eat it if there is no queen bee on the level; return 1: mon died,
|
||||||
0: mon ate jelly and lived; -1: mon didn't eat jelly to use its move */
|
0: mon ate jelly and lived; -1: mon didn't eat jelly to use its move */
|
||||||
@@ -261,16 +278,8 @@ struct monst *mon;
|
|||||||
struct obj *obj;
|
struct obj *obj;
|
||||||
{
|
{
|
||||||
int m_delay;
|
int m_delay;
|
||||||
struct monst *mtmp = 0;
|
struct monst *mtmp = find_pmmonst(PM_QUEEN_BEE);
|
||||||
|
|
||||||
/* find a queen bee */
|
|
||||||
if ((g.mvitals[PM_QUEEN_BEE].mvflags & G_GENOD) == 0)
|
|
||||||
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
|
||||||
if (DEADMONSTER(mtmp))
|
|
||||||
continue;
|
|
||||||
if (mtmp->data == &mons[PM_QUEEN_BEE])
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
/* if there's no queen on the level, eat the royal jelly and become one */
|
/* if there's no queen on the level, eat the royal jelly and become one */
|
||||||
if (!mtmp) {
|
if (!mtmp) {
|
||||||
m_delay = obj->blessed ? 3 : !obj->cursed ? 5 : 7;
|
m_delay = obj->blessed ? 3 : !obj->cursed ? 5 : 7;
|
||||||
|
|||||||
Reference in New Issue
Block a user