wizard mode wishing for terrain
Fix some issues noticed when experimenting with ceiling hiders. They're all blind (at least without the monks' Eyes) and some of the behavior while blind seemed to be incorrect (though some that I thought was wrong turned out to be ok; feel_newsym() won't update the map if the hero can't reach the floor). Fixing that made me notice that some terrain side-effects (being underwater or stuck in lava) weren't getting disabled when the underlying terrain wasn't the corresponding type anymore.
This commit is contained in:
+4
-1
@@ -1,4 +1,4 @@
|
|||||||
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.4 $ $NHDT-Date: 1576287569 2019/12/14 01:39:29 $
|
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.11 $ $NHDT-Date: 1576635242 2019/12/18 02:14:02 $
|
||||||
|
|
||||||
fixes36.4 contains a terse summary of changes made to 3.6.3 in order to
|
fixes36.4 contains a terse summary of changes made to 3.6.3 in order to
|
||||||
produce 3.6.4.
|
produce 3.6.4.
|
||||||
@@ -16,6 +16,9 @@ message "your knapsack can't accomodate any more items" when picking stuff up
|
|||||||
pending; vary the message rather than add more convoluted pickup code
|
pending; vary the message rather than add more convoluted pickup code
|
||||||
dozen-ish assorted spelling/typo fixes in messages and source comments
|
dozen-ish assorted spelling/typo fixes in messages and source comments
|
||||||
fix potential buffer overflow when parsing run-time configuration file
|
fix potential buffer overflow when parsing run-time configuration file
|
||||||
|
wizard mode wishing for terrain would leave it unmapped if done while blind
|
||||||
|
wizard mode terrain wish could leave hero in water (severe vision limits) or
|
||||||
|
in lava (trapped, sinking) which wasn't there any more
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes or Features
|
Platform- and/or Interface-Specific Fixes or Features
|
||||||
|
|||||||
+47
-47
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 objnam.c $NHDT-Date: 1575245076 2019/12/02 00:04:36 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.255 $ */
|
/* NetHack 3.6 objnam.c $NHDT-Date: 1576635242 2019/12/18 02:14:02 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.256 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -3663,14 +3663,17 @@ struct obj *no_wish;
|
|||||||
goto typfnd;
|
goto typfnd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Let wizards wish for traps and furniture.
|
|
||||||
* Must come after objects check so wizards can still wish for
|
/*
|
||||||
* trap objects like beartraps.
|
* Let wizards wish for traps and furniture.
|
||||||
* Disallow such topology tweaks for WIZKIT startup wishes.
|
* Must come after objects check so wizards can still wish for
|
||||||
*/
|
* trap objects like beartraps.
|
||||||
|
* Disallow such topology tweaks for WIZKIT startup wishes.
|
||||||
|
*/
|
||||||
wiztrap:
|
wiztrap:
|
||||||
if (wizard && !program_state.wizkit_wishing) {
|
if (wizard && !program_state.wizkit_wishing) {
|
||||||
struct rm *lev;
|
struct rm *lev;
|
||||||
|
boolean madeterrain = FALSE;
|
||||||
int trap, x = u.ux, y = u.uy;
|
int trap, x = u.ux, y = u.uy;
|
||||||
|
|
||||||
for (trap = NO_TRAP + 1; trap < TRAPNUM; trap++) {
|
for (trap = NO_TRAP + 1; trap < TRAPNUM; trap++) {
|
||||||
@@ -3693,7 +3696,8 @@ struct obj *no_wish;
|
|||||||
return (struct obj *) &zeroobj;
|
return (struct obj *) &zeroobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* furniture and terrain */
|
/* furniture and terrain (use at your own risk; can clobber stairs
|
||||||
|
or place furniture on existing traps which shouldn't be allowed) */
|
||||||
lev = &levl[x][y];
|
lev = &levl[x][y];
|
||||||
p = eos(bp);
|
p = eos(bp);
|
||||||
if (!BSTRCMPI(bp, p - 8, "fountain")) {
|
if (!BSTRCMPI(bp, p - 8, "fountain")) {
|
||||||
@@ -3702,43 +3706,36 @@ struct obj *no_wish;
|
|||||||
if (!strncmpi(bp, "magic ", 6))
|
if (!strncmpi(bp, "magic ", 6))
|
||||||
lev->blessedftn = 1;
|
lev->blessedftn = 1;
|
||||||
pline("A %sfountain.", lev->blessedftn ? "magic " : "");
|
pline("A %sfountain.", lev->blessedftn ? "magic " : "");
|
||||||
newsym(x, y);
|
madeterrain = TRUE;
|
||||||
return (struct obj *) &zeroobj;
|
} else if (!BSTRCMPI(bp, p - 6, "throne")) {
|
||||||
}
|
|
||||||
if (!BSTRCMPI(bp, p - 6, "throne")) {
|
|
||||||
lev->typ = THRONE;
|
lev->typ = THRONE;
|
||||||
pline("A throne.");
|
pline("A throne.");
|
||||||
newsym(x, y);
|
madeterrain = TRUE;
|
||||||
return (struct obj *) &zeroobj;
|
} else if (!BSTRCMPI(bp, p - 4, "sink")) {
|
||||||
}
|
|
||||||
if (!BSTRCMPI(bp, p - 4, "sink")) {
|
|
||||||
lev->typ = SINK;
|
lev->typ = SINK;
|
||||||
level.flags.nsinks++;
|
level.flags.nsinks++;
|
||||||
pline("A sink.");
|
pline("A sink.");
|
||||||
newsym(x, y);
|
madeterrain = TRUE;
|
||||||
return (struct obj *) &zeroobj;
|
|
||||||
}
|
|
||||||
/* ("water" matches "potion of water" rather than terrain) */
|
/* ("water" matches "potion of water" rather than terrain) */
|
||||||
if (!BSTRCMPI(bp, p - 4, "pool") || !BSTRCMPI(bp, p - 4, "moat")) {
|
} else if (!BSTRCMPI(bp, p - 4, "pool")
|
||||||
|
|| !BSTRCMPI(bp, p - 4, "moat")) {
|
||||||
lev->typ = !BSTRCMPI(bp, p - 4, "pool") ? POOL : MOAT;
|
lev->typ = !BSTRCMPI(bp, p - 4, "pool") ? POOL : MOAT;
|
||||||
del_engr_at(x, y);
|
del_engr_at(x, y);
|
||||||
pline("A %s.", (lev->typ == POOL) ? "pool" : "moat");
|
pline("A %s.", (lev->typ == POOL) ? "pool" : "moat");
|
||||||
/* Must manually make kelp! */
|
/* Must manually make kelp! */
|
||||||
water_damage_chain(level.objects[x][y], TRUE);
|
water_damage_chain(level.objects[x][y], TRUE);
|
||||||
newsym(x, y);
|
madeterrain = TRUE;
|
||||||
return (struct obj *) &zeroobj;
|
|
||||||
}
|
/* also matches "molten lava" */
|
||||||
if (!BSTRCMPI(bp, p - 4, "lava")) { /* also matches "molten lava" */
|
} else if (!BSTRCMPI(bp, p - 4, "lava")) {
|
||||||
lev->typ = LAVAPOOL;
|
lev->typ = LAVAPOOL;
|
||||||
del_engr_at(x, y);
|
del_engr_at(x, y);
|
||||||
pline("A pool of molten lava.");
|
pline("A pool of molten lava.");
|
||||||
if (!(Levitation || Flying))
|
if (!(Levitation || Flying))
|
||||||
(void) lava_effects();
|
(void) lava_effects();
|
||||||
newsym(x, y);
|
madeterrain = TRUE;
|
||||||
return (struct obj *) &zeroobj;
|
} else if (!BSTRCMPI(bp, p - 5, "altar")) {
|
||||||
}
|
|
||||||
|
|
||||||
if (!BSTRCMPI(bp, p - 5, "altar")) {
|
|
||||||
aligntyp al;
|
aligntyp al;
|
||||||
|
|
||||||
lev->typ = ALTAR;
|
lev->typ = ALTAR;
|
||||||
@@ -3751,37 +3748,40 @@ struct obj *no_wish;
|
|||||||
else if (!strncmpi(bp, "unaligned ", 10))
|
else if (!strncmpi(bp, "unaligned ", 10))
|
||||||
al = A_NONE;
|
al = A_NONE;
|
||||||
else /* -1 - A_CHAOTIC, 0 - A_NEUTRAL, 1 - A_LAWFUL */
|
else /* -1 - A_CHAOTIC, 0 - A_NEUTRAL, 1 - A_LAWFUL */
|
||||||
al = (!rn2(6)) ? A_NONE : rn2((int) A_LAWFUL + 2) - 1;
|
al = !rn2(6) ? A_NONE : (rn2((int) A_LAWFUL + 2) - 1);
|
||||||
lev->altarmask = Align2amask(al);
|
lev->altarmask = Align2amask(al);
|
||||||
pline("%s altar.", An(align_str(al)));
|
pline("%s altar.", An(align_str(al)));
|
||||||
newsym(x, y);
|
madeterrain = TRUE;
|
||||||
return (struct obj *) &zeroobj;
|
} else if (!BSTRCMPI(bp, p - 5, "grave")
|
||||||
}
|
|| !BSTRCMPI(bp, p - 9, "headstone")) {
|
||||||
|
|
||||||
if (!BSTRCMPI(bp, p - 5, "grave")
|
|
||||||
|| !BSTRCMPI(bp, p - 9, "headstone")) {
|
|
||||||
make_grave(x, y, (char *) 0);
|
make_grave(x, y, (char *) 0);
|
||||||
pline("%s.", IS_GRAVE(lev->typ) ? "A grave"
|
pline("%s.", IS_GRAVE(lev->typ) ? "A grave"
|
||||||
: "Can't place a grave here");
|
: "Can't place a grave here");
|
||||||
newsym(x, y);
|
madeterrain = TRUE;
|
||||||
return (struct obj *) &zeroobj;
|
} else if (!BSTRCMPI(bp, p - 4, "tree")) {
|
||||||
}
|
|
||||||
|
|
||||||
if (!BSTRCMPI(bp, p - 4, "tree")) {
|
|
||||||
lev->typ = TREE;
|
lev->typ = TREE;
|
||||||
pline("A tree.");
|
pline("A tree.");
|
||||||
newsym(x, y);
|
|
||||||
block_point(x, y);
|
block_point(x, y);
|
||||||
return (struct obj *) &zeroobj;
|
madeterrain = TRUE;
|
||||||
}
|
} else if (!BSTRCMPI(bp, p - 4, "bars")) {
|
||||||
|
|
||||||
if (!BSTRCMPI(bp, p - 4, "bars")) {
|
|
||||||
lev->typ = IRONBARS;
|
lev->typ = IRONBARS;
|
||||||
pline("Iron bars.");
|
pline("Iron bars.");
|
||||||
newsym(x, y);
|
madeterrain = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (madeterrain) {
|
||||||
|
feel_newsym(x, y);
|
||||||
|
if (u.uinwater && !is_pool(x, y)) {
|
||||||
|
u.uinwater = 0; /* leave the water */
|
||||||
|
docrt();
|
||||||
|
vision_full_recalc = 1;
|
||||||
|
} else if (u.utrap && u.utraptype == TT_LAVA && !is_lava(x, y)) {
|
||||||
|
reset_utrap(FALSE);
|
||||||
|
}
|
||||||
|
/* cast 'const' away; caller won't modify this */
|
||||||
return (struct obj *) &zeroobj;
|
return (struct obj *) &zeroobj;
|
||||||
}
|
}
|
||||||
}
|
} /* end of wizard mode traps and terrain */
|
||||||
|
|
||||||
if (!oclass && !typ) {
|
if (!oclass && !typ) {
|
||||||
if (!strncmpi(bp, "polearm", 7)) {
|
if (!strncmpi(bp, "polearm", 7)) {
|
||||||
|
|||||||
+3
-1
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 trap.c $NHDT-Date: 1576274483 2019/12/13 22:01:23 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.325 $ */
|
/* NetHack 3.6 trap.c $NHDT-Date: 1576635243 2019/12/18 02:14:03 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.328 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -3746,6 +3746,7 @@ drown()
|
|||||||
boolean inpool_ok = FALSE, crawl_ok;
|
boolean inpool_ok = FALSE, crawl_ok;
|
||||||
int i, x, y;
|
int i, x, y;
|
||||||
|
|
||||||
|
feel_newsym(u.ux, u.uy); /* in case Blind, map the water here */
|
||||||
/* happily wading in the same contiguous pool */
|
/* happily wading in the same contiguous pool */
|
||||||
if (u.uinwater && is_pool(u.ux - u.dx, u.uy - u.dy)
|
if (u.uinwater && is_pool(u.ux - u.dx, u.uy - u.dy)
|
||||||
&& (Swimming || Amphibious)) {
|
&& (Swimming || Amphibious)) {
|
||||||
@@ -5262,6 +5263,7 @@ lava_effects()
|
|||||||
int dmg = d(6, 6); /* only applicable for water walking */
|
int dmg = d(6, 6); /* only applicable for water walking */
|
||||||
boolean usurvive, boil_away;
|
boolean usurvive, boil_away;
|
||||||
|
|
||||||
|
feel_newsym(u.ux, u.uy); /* in case Blind, map the lava here */
|
||||||
burn_away_slime();
|
burn_away_slime();
|
||||||
if (likes_lava(youmonst.data))
|
if (likes_lava(youmonst.data))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
Reference in New Issue
Block a user