Merge branch 'NetHack-3.6.0'
This commit is contained in:
@@ -738,7 +738,7 @@ STATIC_DCL void
|
||||
interrupt_multi(msg)
|
||||
const char *msg;
|
||||
{
|
||||
if (multi > 0 && !context.travel) {
|
||||
if (multi > 0 && !context.travel && !context.run) {
|
||||
nomul(0);
|
||||
if (flags.verbose && msg)
|
||||
Norep("%s", msg);
|
||||
|
||||
@@ -1278,6 +1278,7 @@ wiz_intrinsic(VOID_ARGS)
|
||||
}
|
||||
if (n >= 1)
|
||||
free((genericptr_t) pick_list);
|
||||
doredraw();
|
||||
} else
|
||||
pline("Unavailable command '%s'.",
|
||||
visctrl((int) cmd_from_func(wiz_intrinsic)));
|
||||
|
||||
26
src/files.c
26
src/files.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 files.c $NHDT-Date: 1503309020 2017/08/21 09:50:20 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.215 $ */
|
||||
/* NetHack 3.6 files.c $NHDT-Date: 1524413723 2018/04/22 16:15:23 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.235 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -3469,6 +3469,30 @@ const char *dir UNUSED_if_not_OS2_CODEVIEW;
|
||||
Strcpy(tmp, RECORD);
|
||||
fq_record = fqname(RECORD, SCOREPREFIX, 0);
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
/* If dir is NULL it indicates create but
|
||||
only if it doesn't already exist */
|
||||
if (!dir) {
|
||||
char buf[BUFSZ];
|
||||
|
||||
buf[0] = '\0';
|
||||
fd = open(fq_record, O_RDWR);
|
||||
if (!(fd == -1 && errno == ENOENT)) {
|
||||
if (fd >= 0) {
|
||||
(void) nhclose(fd);
|
||||
} else {
|
||||
/* explanation for failure other than missing file */
|
||||
Sprintf(buf, "error \"%s\", (errno %d).",
|
||||
fq_record, errno);
|
||||
paniclog("scorefile", buf);
|
||||
}
|
||||
return;
|
||||
}
|
||||
Sprintf(buf, "missing \"%s\", creating new scorefile.",
|
||||
fq_record);
|
||||
paniclog("scorefile", buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((fd = open(fq_record, O_RDWR)) < 0) {
|
||||
/* try to create empty 'record' */
|
||||
|
||||
@@ -857,8 +857,11 @@ int mode;
|
||||
|
||||
if (sobj_at(BOULDER, x, y) && (Sokoban || !Passes_walls)) {
|
||||
if (!(Blind || Hallucination) && (context.run >= 2)
|
||||
&& mode != TEST_TRAV)
|
||||
&& mode != TEST_TRAV) {
|
||||
if (mode == DO_MOVE && iflags.mention_walls)
|
||||
pline("A boulder blocks your path.");
|
||||
return FALSE;
|
||||
}
|
||||
if (mode == DO_MOVE) {
|
||||
/* tunneling monsters will chew before pushing */
|
||||
if (tunnels(youmonst.data) && !needspick(youmonst.data)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1522701334 2018/04/02 20:35:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.97 $ */
|
||||
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1524287226 2018/04/21 05:07:06 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.98 $ */
|
||||
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -69,7 +69,7 @@ STATIC_DCL void FDECL(get_free_room_loc, (schar *, schar *,
|
||||
STATIC_DCL boolean FDECL(create_subroom, (struct mkroom *, XCHAR_P, XCHAR_P,
|
||||
XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P));
|
||||
STATIC_DCL void FDECL(create_door, (room_door *, struct mkroom *));
|
||||
STATIC_DCL void FDECL(create_trap, (trap *, struct mkroom *));
|
||||
STATIC_DCL void FDECL(create_trap, (spltrap *, struct mkroom *));
|
||||
STATIC_DCL int FDECL(noncoalignment, (ALIGNTYP_P));
|
||||
STATIC_DCL boolean FDECL(m_bad_boulder_spot, (int, int));
|
||||
STATIC_DCL int FDECL(pm_to_humidity, (struct permonst *));
|
||||
@@ -1486,7 +1486,7 @@ xchar walls; /* any of W_NORTH | W_SOUTH | W_EAST | W_WEST (or W_ANY) */
|
||||
*/
|
||||
STATIC_OVL void
|
||||
create_trap(t, croom)
|
||||
trap *t;
|
||||
spltrap *t;
|
||||
struct mkroom *croom;
|
||||
{
|
||||
schar x = -1, y = -1;
|
||||
@@ -3580,7 +3580,7 @@ struct sp_coder *coder;
|
||||
static const char nhFunc[] = "spo_trap";
|
||||
struct opvar *type;
|
||||
struct opvar *tcoord;
|
||||
trap tmptrap;
|
||||
spltrap tmptrap;
|
||||
|
||||
if (!OV_pop_i(type) || !OV_pop_c(tcoord))
|
||||
return;
|
||||
|
||||
52
src/trap.c
52
src/trap.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 trap.c $NHDT-Date: 1514855666 2018/01/02 01:14:26 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.284 $ */
|
||||
/* NetHack 3.6 trap.c $NHDT-Date: 1524312044 2018/04/21 12:00:44 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.290 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -31,6 +31,8 @@ STATIC_DCL char *FDECL(trapnote, (struct trap *, BOOLEAN_P));
|
||||
STATIC_DCL void FDECL(join_adjacent_pits, (struct trap *));
|
||||
#endif
|
||||
STATIC_DCL void FDECL(clear_conjoined_pits, (struct trap *));
|
||||
STATIC_DCL boolean FDECL(adj_nonconjoined_pit, (struct trap *));
|
||||
|
||||
STATIC_DCL int FDECL(steedintrap, (struct trap *, struct obj *));
|
||||
STATIC_DCL boolean FDECL(keep_saddle_with_steedcorpse, (unsigned,
|
||||
struct obj *,
|
||||
@@ -851,7 +853,8 @@ unsigned trflags;
|
||||
forcebungle = (trflags & FORCEBUNGLE) != 0,
|
||||
plunged = (trflags & TOOKPLUNGE) != 0,
|
||||
viasitting = (trflags & VIASITTING) != 0,
|
||||
adj_pit = conjoined_pits(trap, t_at(u.ux0, u.uy0), TRUE);
|
||||
conj_pit = conjoined_pits(trap, t_at(u.ux0, u.uy0), TRUE),
|
||||
adj_pit = adj_nonconjoined_pit(trap);
|
||||
int oldumort;
|
||||
int steed_article = ARTICLE_THE;
|
||||
|
||||
@@ -879,10 +882,11 @@ unsigned trflags;
|
||||
return;
|
||||
}
|
||||
if (!Fumbling && ttype != MAGIC_PORTAL && ttype != VIBRATING_SQUARE
|
||||
&& ttype != ANTI_MAGIC && !forcebungle && !plunged && !adj_pit
|
||||
&& ttype != ANTI_MAGIC && !forcebungle && !plunged
|
||||
&& !conj_pit && !adj_pit
|
||||
&& (!rn2(5) || ((ttype == PIT || ttype == SPIKED_PIT)
|
||||
&& is_clinger(youmonst.data)))) {
|
||||
You("escape %s %s.", (ttype == ARROW_TRAP && !trap->madeby_u)
|
||||
You("escape %s %s.", (ttype == ARROW_TRAP && !trap->madeby_u)
|
||||
? "an"
|
||||
: a_your[trap->madeby_u],
|
||||
defsyms[trap_to_defsym(ttype)].explanation);
|
||||
@@ -1154,8 +1158,11 @@ unsigned trflags;
|
||||
Sprintf(verbbuf, "lead %s",
|
||||
x_monnam(u.usteed, steed_article, "poor",
|
||||
SUPPRESS_SADDLE, FALSE));
|
||||
} else if (adj_pit) {
|
||||
} else if (conj_pit) {
|
||||
You("move into an adjacent pit.");
|
||||
} else if (adj_pit) {
|
||||
You("stumble over debris%s.",
|
||||
!rn2(5) ? " between the pits" : "");
|
||||
} else {
|
||||
Strcpy(verbbuf,
|
||||
!plunged ? "fall" : (Flying ? "dive" : "plunge"));
|
||||
@@ -1177,33 +1184,34 @@ unsigned trflags;
|
||||
pline("%s %s %s!",
|
||||
upstart(x_monnam(u.usteed, steed_article, "poor",
|
||||
SUPPRESS_SADDLE, FALSE)),
|
||||
adj_pit ? "steps" : "lands", predicament);
|
||||
conj_pit ? "steps" : "lands", predicament);
|
||||
} else
|
||||
You("%s %s!", adj_pit ? "step" : "land", predicament);
|
||||
You("%s %s!", conj_pit ? "step" : "land", predicament);
|
||||
}
|
||||
u.utrap = rn1(6, 2);
|
||||
u.utraptype = TT_PIT;
|
||||
if (!steedintrap(trap, (struct obj *) 0)) {
|
||||
if (ttype == SPIKED_PIT) {
|
||||
oldumort = u.umortality;
|
||||
losehp(Maybe_Half_Phys(rnd(adj_pit ? 6 : 10)),
|
||||
losehp(Maybe_Half_Phys(rnd(conj_pit ? 4 : adj_pit ? 6 : 10)),
|
||||
plunged
|
||||
? "deliberately plunged into a pit of iron spikes"
|
||||
: adj_pit ? "stepped into a pit of iron spikes"
|
||||
: conj_pit ? "stepped into a pit of iron spikes"
|
||||
: adj_pit ? "stumbled into a pit of iron spikes"
|
||||
: "fell into a pit of iron spikes",
|
||||
NO_KILLER_PREFIX);
|
||||
if (!rn2(6))
|
||||
poisoned("spikes", A_STR,
|
||||
adj_pit ? "stepping on poison spikes"
|
||||
(conj_pit || adj_pit) ? "stepping on poison spikes"
|
||||
: "fall onto poison spikes",
|
||||
/* if damage triggered life-saving,
|
||||
poison is limited to attrib loss */
|
||||
(u.umortality > oldumort) ? 0 : 8, FALSE);
|
||||
} else {
|
||||
/* plunging flyers take spike damage but not pit damage */
|
||||
if (!adj_pit
|
||||
if (!conj_pit
|
||||
&& !(plunged && (Flying || is_clinger(youmonst.data))))
|
||||
losehp(Maybe_Half_Phys(rnd(6)),
|
||||
losehp(Maybe_Half_Phys(rnd(adj_pit ? 3 : 6)),
|
||||
plunged ? "deliberately plunged into a pit"
|
||||
: "fell into a pit",
|
||||
NO_KILLER_PREFIX);
|
||||
@@ -1213,7 +1221,7 @@ unsigned trflags;
|
||||
ballfall();
|
||||
placebc();
|
||||
}
|
||||
if (!adj_pit)
|
||||
if (!conj_pit)
|
||||
selftouch("Falling, you");
|
||||
vision_full_recalc = 1; /* vision limits change */
|
||||
exercise(A_STR, FALSE);
|
||||
@@ -4909,6 +4917,24 @@ struct trap *trap;
|
||||
}
|
||||
}
|
||||
|
||||
boolean
|
||||
adj_nonconjoined_pit(adjtrap)
|
||||
struct trap *adjtrap;
|
||||
{
|
||||
struct trap *trap_with_u = t_at(u.ux0, u.uy0);
|
||||
|
||||
if (trap_with_u && adjtrap && u.utrap && u.utraptype == TT_PIT &&
|
||||
(trap_with_u->ttyp == PIT || trap_with_u->ttyp == SPIKED_PIT) &&
|
||||
(adjtrap->ttyp == PIT || adjtrap->ttyp == SPIKED_PIT)) {
|
||||
int idx;
|
||||
for (idx = 0; idx < 8; idx++) {
|
||||
if (xdir[idx] == u.dx && ydir[idx] == u.dy)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* Mark all neighboring pits as conjoined pits.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 zap.c $NHDT-Date: 1520705645 2018/03/10 18:14:05 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.271 $ */
|
||||
/* NetHack 3.6 zap.c $NHDT-Date: 1524470244 2018/04/23 07:57:24 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.275 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -4180,7 +4180,7 @@ const char *msg;
|
||||
|
||||
if (!msg)
|
||||
msg = "The ice crackles and melts.";
|
||||
if (lev->typ == DRAWBRIDGE_UP) {
|
||||
if (lev->typ == DRAWBRIDGE_UP || lev->typ == DRAWBRIDGE_DOWN) {
|
||||
lev->drawbridgemask &= ~DB_ICE; /* revert to DB_MOAT */
|
||||
} else { /* lev->typ == ICE */
|
||||
#ifdef STUPID
|
||||
|
||||
Reference in New Issue
Block a user