Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01

This commit is contained in:
nhmall
2018-09-28 02:09:30 -04:00
3 changed files with 26 additions and 21 deletions

View File

@@ -240,11 +240,12 @@ struct instance_flags {
boolean defer_plname; /* X11 hack: askname() might not set plname */ boolean defer_plname; /* X11 hack: askname() might not set plname */
boolean herecmd_menu; /* use menu when mouseclick on yourself */ boolean herecmd_menu; /* use menu when mouseclick on yourself */
boolean invis_goldsym; /* gold symbol is ' '? */ boolean invis_goldsym; /* gold symbol is ' '? */
int parse_config_file_src; /* hack for parse_config_line() */ int failing_untrap; /* move_into_trap() -> spoteffects() -> dotrap() */
int in_lava_effects; /* hack for Boots_off() */ int in_lava_effects; /* hack for Boots_off() */
int last_msg; /* indicator of last message player saw */ int last_msg; /* indicator of last message player saw */
int purge_monsters; /* # of dead monsters still on fmon list */
int override_ID; /* true to force full identification of objects */ int override_ID; /* true to force full identification of objects */
int parse_config_file_src; /* hack for parse_config_line() */
int purge_monsters; /* # of dead monsters still on fmon list */
int suppress_price; /* controls doname() for unpaid objects */ int suppress_price; /* controls doname() for unpaid objects */
int terrainmode; /* for getpos()'s autodescribe when #terrain is active */ int terrainmode; /* for getpos()'s autodescribe when #terrain is active */
#define TER_MAP 0x01 #define TER_MAP 0x01

View File

@@ -2042,6 +2042,7 @@ boolean pick;
struct monst *mtmp; struct monst *mtmp;
struct trap *trap = t_at(u.ux, u.uy); struct trap *trap = t_at(u.ux, u.uy);
int trapflag = iflags.failing_untrap ? FORCETRAP : 0;
/* prevent recursion from affecting the hero all over again /* prevent recursion from affecting the hero all over again
[hero poly'd to iron golem enters water here, drown() inflicts [hero poly'd to iron golem enters water here, drown() inflicts
@@ -2107,7 +2108,7 @@ boolean pick;
if (!spottrap || spottraptyp != trap->ttyp) { if (!spottrap || spottraptyp != trap->ttyp) {
spottrap = trap; spottrap = trap;
spottraptyp = trap->ttyp; spottraptyp = trap->ttyp;
dotrap(trap, 0); /* fall into arrow trap, etc. */ dotrap(trap, trapflag); /* fall into arrow trap, etc. */
spottrap = (struct trap *) 0; spottrap = (struct trap *) 0;
spottraptyp = NO_TRAP; spottraptyp = NO_TRAP;
} }

View File

@@ -886,8 +886,7 @@ unsigned trflags;
/* then proceed to normal trap effect */ /* then proceed to normal trap effect */
} else if (already_seen && !forcetrap) { } else if (already_seen && !forcetrap) {
if ((Levitation || (Flying && !plunged)) if ((Levitation || (Flying && !plunged))
&& (is_pit(ttype) || ttype == HOLE && (is_pit(ttype) || ttype == HOLE || ttype == BEAR_TRAP)) {
|| ttype == BEAR_TRAP)) {
You("%s over %s %s.", Levitation ? "float" : "fly", You("%s over %s %s.", Levitation ? "float" : "fly",
a_your[trap->madeby_u], a_your[trap->madeby_u],
defsyms[trap_to_defsym(ttype)].explanation); defsyms[trap_to_defsym(ttype)].explanation);
@@ -1198,16 +1197,23 @@ unsigned trflags;
if (ttype == SPIKED_PIT) { if (ttype == SPIKED_PIT) {
oldumort = u.umortality; oldumort = u.umortality;
losehp(Maybe_Half_Phys(rnd(conj_pit ? 4 : adj_pit ? 6 : 10)), losehp(Maybe_Half_Phys(rnd(conj_pit ? 4 : adj_pit ? 6 : 10)),
/* note: these don't need locomotion() handling;
if fatal while poly'd and Unchanging, the
death reason will be overridden with
"killed while stuck in creature form" */
plunged plunged
? "deliberately plunged into a pit of iron spikes" ? "deliberately plunged into a pit of iron spikes"
: conj_pit ? "stepped into a pit of iron spikes" : conj_pit
: adj_pit ? "stumbled into a pit of iron spikes" ? "stepped into a pit of iron spikes"
: "fell 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); NO_KILLER_PREFIX);
if (!rn2(6)) if (!rn2(6))
poisoned("spikes", A_STR, poisoned("spikes", A_STR,
(conj_pit || adj_pit) ? "stepping on poison spikes" (conj_pit || adj_pit)
: "fall onto poison spikes", ? "stepping on poison spikes"
: "fall onto poison spikes",
/* if damage triggered life-saving, /* if damage triggered life-saving,
poison is limited to attrib loss */ poison is limited to attrib loss */
(u.umortality > oldumort) ? 0 : 8, FALSE); (u.umortality > oldumort) ? 0 : 8, FALSE);
@@ -3912,7 +3918,14 @@ struct trap *ttmp;
there are objects covering this trap */ there are objects covering this trap */
ttmp->tseen = 0; /* hack for check_here() */ ttmp->tseen = 0; /* hack for check_here() */
/* trigger the trap */ /* trigger the trap */
iflags.failing_untrap++; /* spoteffects() -> dotrap(,FORCETRAP) */
spoteffects(TRUE); /* pickup() + dotrap() */ spoteffects(TRUE); /* pickup() + dotrap() */
iflags.failing_untrap--;
/* this should no longer be necessary; before the failing_untrap
hack, Flying hero would not trigger an unseen bear trap and
setting it not-yet-seen above resulted in leaving it hidden */
if ((ttmp = t_at(u.ux, u.uy)) != 0)
ttmp->tseen = 1;
exercise(A_WIS, FALSE); exercise(A_WIS, FALSE);
} }
} }
@@ -3991,16 +4004,6 @@ boolean force_failure;
} }
} else if (under_u) { } else if (under_u) {
dotrap(ttmp, 0); dotrap(ttmp, 0);
} else if (ttype == BEAR_TRAP && (Levitation || Flying)) {
/* There was a report of oddities of the trap
vanishing from view due to tseen being cleared
(which was deliberate to work around a check_here()
issue). Since you won't actually end up in the trap
during the #untrap operation anyway due to
Levitation and Flying checks further along,
just avoid the whole "vanishing trap" scenario
by failing the #untrap operation right here. */
You("couldn't reach it from your vantage point.");
} else { } else {
move_into_trap(ttmp); move_into_trap(ttmp);
} }