Merge remote-tracking branch 'origin/NetHack-3.6.0'

(required manual merge in include/config.h)
This commit is contained in:
keni
2018-04-15 13:50:59 -04:00
75 changed files with 5333 additions and 5062 deletions
+2
View File
@@ -3300,10 +3300,12 @@ struct obj *obj;
goto wanexpl;
case WAN_FIRE:
expltype = EXPL_FIERY;
/*FALLTHRU*/
case WAN_COLD:
if (expltype == EXPL_MAGICAL)
expltype = EXPL_FROSTY;
dmg *= 2;
/*FALLTHRU*/
case WAN_MAGIC_MISSILE:
wanexpl:
explode(u.ux, u.uy, -(obj->otyp), dmg, WAND_CLASS, expltype);
+11 -5
View File
@@ -940,15 +940,21 @@ winid tmpwin; /* supplied by dodiscover() */
* stun attack. As of 3.4.1, those effects can occur but
* will be slightly less likely than they were in 3.3.x.]
*/
enum mb_effect_indices {
MB_INDEX_PROBE = 0,
MB_INDEX_STUN,
MB_INDEX_SCARE,
MB_INDEX_CANCEL,
NUM_MB_INDICES
};
#define MB_MAX_DIEROLL 8 /* rolls above this aren't magical */
static const char *const mb_verb[2][4] = {
static const char *const mb_verb[2][NUM_MB_INDICES] = {
{ "probe", "stun", "scare", "cancel" },
{ "prod", "amaze", "tickle", "purge" },
};
#define MB_INDEX_PROBE 0
#define MB_INDEX_STUN 1
#define MB_INDEX_SCARE 2
#define MB_INDEX_CANCEL 3
/* called when someone is being hit by Magicbane */
STATIC_OVL boolean
+2 -6
View File
@@ -1355,7 +1355,6 @@ int *colorptr;
/* there are hilites set here */
int max_pc = 0, min_pc = 100;
int max_val = 0, min_val = LARGEST_INT;
boolean changed = FALSE;
boolean exactmatch = FALSE;
hl = blstats[idx][fldidx].thresholds;
@@ -1382,14 +1381,11 @@ int *colorptr;
case BL_TH_UPDOWN:
if (chg < 0 && hl->rel == LT_VALUE) {
merge_bestcolor(&bestcolor, hl->coloridx);
changed = TRUE;
} else if (chg > 0 && hl->rel == GT_VALUE) {
merge_bestcolor(&bestcolor, hl->coloridx);
changed = TRUE;
} else if (hl->rel == EQ_VALUE && chg) {
merge_bestcolor(&bestcolor, hl->coloridx);
min_val = max_val = hl->value.a_int;
changed = TRUE;
}
break;
case BL_TH_VAL_ABSOLUTE:
@@ -2740,7 +2736,7 @@ choose_value:
if (behavior == BL_TH_VAL_PERCENTAGE
|| behavior == BL_TH_VAL_ABSOLUTE) {
char inbuf[BUFSZ], buf[BUFSZ];
char inbuf[BUFSZ] = DUMMY, buf[BUFSZ];
int val;
boolean skipltgt = FALSE;
boolean gotnum = FALSE;
@@ -2902,7 +2898,7 @@ choose_value:
hilite.rel = TXT_VALUE;
Strcpy(hilite.textmatch, rolelist[rv]);
} else {
char inbuf[BUFSZ];
char inbuf[BUFSZ] = DUMMY;
inbuf[0] = '\0';
getlin(qry_buf, inbuf);
+14 -8
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 cmd.c $NHDT-Date: 1518861485 2018/02/17 09:58:05 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.278 $ */
/* NetHack 3.6 cmd.c $NHDT-Date: 1523306904 2018/04/09 20:48:24 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.281 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -750,7 +750,7 @@ wiz_mon_polycontrol(VOID_ARGS)
STATIC_PTR int
wiz_level_change(VOID_ARGS)
{
char buf[BUFSZ];
char buf[BUFSZ] = DUMMY;
int newlevel;
int ret;
@@ -3697,7 +3697,7 @@ static int
wiz_migrate_mons()
{
int mcount = 0;
char inbuf[BUFSZ];
char inbuf[BUFSZ] = DUMMY;
struct permonst *ptr;
struct monst *mtmp;
d_level tolevel;
@@ -4049,6 +4049,8 @@ int NDECL((*cmd_func));
|| cmd_func == doloot
/* travel: pop up a menu of interesting targets in view */
|| cmd_func == dotravel
/* wizard mode ^V */
|| cmd_func == wiz_level_tele
/* 'm' prefix allowed for some extended commands */
|| cmd_func == doextcmd || cmd_func == doextlist)
return TRUE;
@@ -4118,7 +4120,8 @@ register char *cmd;
break;
case NHKF_RUN2:
if (!Cmd.num_pad)
break; /* else FALLTHRU */
break;
/*FALLTHRU*/
case NHKF_RUN:
if (movecmd(lowc(cmd[1]))) {
context.run = 3;
@@ -4128,7 +4131,8 @@ register char *cmd;
break;
case NHKF_FIGHT2:
if (!Cmd.num_pad)
break; /* else FALLTHRU */
break;
/*FALLTHRU*/
/* Effects of movement commands and invisible monsters:
* m: always move onto space (even if 'I' remembered)
* F: always attack space (even if 'I' not remembered)
@@ -4527,14 +4531,16 @@ const char *msg;
break;
case NHKF_RUN2:
if (!Cmd.num_pad)
break; /* else FALLTHRU */
break;
/*FALLTHRU*/
case NHKF_RUN:
case NHKF_RUN_NOPICKUP:
dothat = "run";
break;
case NHKF_FIGHT2:
if (!Cmd.num_pad)
break; /* else FALLTHRU */
break;
/*FALLTHRU*/
case NHKF_FIGHT:
dothat = "fight";
how = ""; /* avoid "fight at yourself" */
@@ -5449,7 +5455,7 @@ const char *prompt;
to give the go-ahead for this query; default is "no" unless the
ParanoidConfirm flag is set in which case there's no default */
if (be_paranoid) {
char qbuf[QBUFSZ], ans[BUFSZ];
char qbuf[QBUFSZ], ans[BUFSZ] = DUMMY;
const char *promptprefix = "", *responsetype = ParanoidConfirm
? "(yes|no)"
: "(yes) [no]";
+9 -5
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 detect.c $NHDT-Date: 1519281847 2018/02/22 06:44:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.80 $ */
/* NetHack 3.6 detect.c $NHDT-Date: 1522891623 2018/04/05 01:27:03 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.81 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1802,7 +1802,7 @@ int default_glyph, which_subset;
void
dump_map()
{
int x, y, glyph, skippedrows;
int x, y, glyph, skippedrows, lastnonblank;
int subset = TER_MAP | TER_TRP | TER_OBJ | TER_MON;
int default_glyph = cmap_to_glyph(level.flags.arboreal ? S_tree : S_stone);
char buf[BUFSZ];
@@ -1820,19 +1820,22 @@ dump_map()
toprow = TRUE;
for (y = 0; y < ROWNO; y++) {
blankrow = TRUE; /* assume blank until we discover otherwise */
lastnonblank = -1; /* buf[] index rather than map's x */
for (x = 1; x < COLNO; x++) {
int ch, color;
unsigned special;
glyph = reveal_terrain_getglyph(x,y, FALSE, u.uswallow,
glyph = reveal_terrain_getglyph(x, y, FALSE, u.uswallow,
default_glyph, subset);
(void) mapglyph(glyph, &ch, &color, &special, x, y);
buf[x - 1] = ch;
if (ch != ' ')
if (ch != ' ') {
blankrow = FALSE;
lastnonblank = x - 1;
}
}
if (!blankrow) {
buf[x - 2] = '\0';
buf[lastnonblank + 1] = '\0';
if (toprow) {
skippedrows = 0;
toprow = FALSE;
@@ -1840,6 +1843,7 @@ dump_map()
for (x = 0; x < skippedrows; x++)
putstr(0, 0, "");
putstr(0, 0, buf); /* map row #y */
skippedrows = 0;
} else {
++skippedrows;
}
+8 -6
View File
@@ -16,12 +16,14 @@ STATIC_DCL int FDECL(adj_pit_checks, (coord *, char *));
STATIC_DCL void FDECL(pit_flow, (struct trap *, SCHAR_P));
/* Indices returned by dig_typ() */
#define DIGTYP_UNDIGGABLE 0
#define DIGTYP_ROCK 1
#define DIGTYP_STATUE 2
#define DIGTYP_BOULDER 3
#define DIGTYP_DOOR 4
#define DIGTYP_TREE 5
enum dig_types {
DIGTYP_UNDIGGABLE = 0,
DIGTYP_ROCK,
DIGTYP_STATUE,
DIGTYP_BOULDER,
DIGTYP_DOOR,
DIGTYP_TREE
};
STATIC_OVL boolean
rm_waslit()
+1
View File
@@ -391,6 +391,7 @@ xchar worm_tail; /* mon is actually a worm tail */
default:
impossible("display_monster: bad m_ap_type value [ = %d ]",
(int) mon->m_ap_type);
/*FALLTHRU*/
case M_AP_NOTHING:
show_glyph(x, y, mon_to_glyph(mon));
break;
+3 -3
View File
@@ -1109,7 +1109,7 @@ char *monnambuf, *usrbuf;
STATIC_OVL void
do_mname()
{
char buf[BUFSZ], monnambuf[BUFSZ], qbuf[QBUFSZ];
char buf[BUFSZ] = DUMMY, monnambuf[BUFSZ], qbuf[QBUFSZ];
coord cc;
int cx, cy;
struct monst *mtmp = 0;
@@ -1188,7 +1188,7 @@ void
do_oname(obj)
register struct obj *obj;
{
char *bufp, buf[BUFSZ], bufcpy[BUFSZ], qbuf[QBUFSZ];
char *bufp, buf[BUFSZ] = DUMMY, bufcpy[BUFSZ], qbuf[QBUFSZ];
const char *aname;
short objtyp;
@@ -1443,7 +1443,7 @@ void
docall(obj)
struct obj *obj;
{
char buf[BUFSZ], qbuf[QBUFSZ];
char buf[BUFSZ] = DUMMY, qbuf[QBUFSZ];
char **str1;
if (!obj->dknown)
+3 -1
View File
@@ -846,6 +846,7 @@ dokick()
pline("%s burps loudly.", Monnam(u.ustuck));
break;
}
/*FALLTHRU*/
default:
Your("feeble kick has no effect.");
break;
@@ -1327,7 +1328,8 @@ schar loc;
} else if (In_endgame(&u.uz) || Is_botlevel(&u.uz)) {
cc->y = cc->x = 0;
break;
} /* else fall to the next cases */
}
/*FALLTHRU*/
case MIGR_STAIRS_UP:
case MIGR_LADDER_UP:
cc->x = u.uz.dnum;
+11 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 dothrow.c $NHDT-Date: 1520103267 2018/03/03 18:54:27 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.133 $ */
/* NetHack 3.6 dothrow.c $NHDT-Date: 1522967321 2018/04/05 22:28:41 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.135 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -360,8 +360,14 @@ dofire()
* If quiver is empty, we use autoquiver to fill it when the
* corresponding option is on. If the option is off or if
* autoquiver doesn't select anything, we ask what to throw.
* For the last, if player's response is a stack, we put
* that stack into quiver slot provided it's not wielded.
* Then we put the chosen item into the quiver slot unless
* it is already in another slot. [Matters most if it is a
* stack but also matters for single item if this throw gets
* aborted (ESC at the direction prompt). Already wielded
* item is excluded because wielding might be necessary
* (Mjollnir) or make the throw behave differently (aklys),
* and alt-wielded item is excluded because switching slots
* would end two-weapon combat even if throw gets aborted.]
*/
if (!ok_to_throw(&shotlimit))
return 0;
@@ -957,6 +963,7 @@ boolean hitsroof;
Your("%s fails to protect you.", helm_simple_name(uarmh));
goto petrify;
}
/*FALLTHRU*/
case CREAM_PIE:
case BLINDING_VENOM:
pline("You've got it all over your %s!", body_part(FACE));
@@ -2014,6 +2021,7 @@ boolean in_view;
default: /* glass or crystal wand */
if (obj->oclass != WAND_CLASS)
impossible("breaking odd object?");
/*FALLTHRU*/
case CRYSTAL_PLATE_MAIL:
case LENSES:
case MIRROR:
+44 -21
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 dungeon.c $NHDT-Date: 1517912411 2018/02/06 10:20:11 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.83 $ */
/* NetHack 3.6 dungeon.c $NHDT-Date: 1523308357 2018/04/09 21:12:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.87 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -966,7 +966,7 @@ init_dungeons()
instead of 0, so adjust the start point to shift endgame up */
if (dunlevs_in_dungeon(&x->dlevel) > 1 - dungeons[i].depth_start)
dungeons[i].depth_start -= 1;
/* TO DO: strip "dummy" out all the way here,
/* TODO: strip "dummy" out all the way here,
so that it's hidden from <ctrl/O> feedback. */
}
@@ -1848,8 +1848,8 @@ xchar *rdgn;
branch *br;
anything any;
struct lchoice lchoices;
winid win = create_nhwindow(NHW_MENU);
if (bymenu) {
start_menu(win);
lchoices.idx = 0;
@@ -1952,26 +1952,35 @@ xchar *rdgn;
Sprintf(buf, "Invocation position @ (%d,%d), hero @ (%d,%d)",
inv_pos.x, inv_pos.y, u.ux, u.uy);
putstr(win, 0, buf);
}
/*
* The following is based on the assumption that the inter-level portals
* created by the level compiler (not the dungeon compiler) only exist
* one per level (currently true, of course).
*/
else if (Is_earthlevel(&u.uz) || Is_waterlevel(&u.uz)
|| Is_firelevel(&u.uz) || Is_airlevel(&u.uz)) {
} else {
struct trap *trap;
/* if current level has a magic portal, report its location;
this assumes that there is at most one magic portal on any
given level; quest and ft.ludios have pairs (one in main
dungeon matched with one in the corresponding branch), the
elemental planes have singletons (connection to next plane) */
*buf = '\0';
for (trap = ftrap; trap; trap = trap->ntrap)
if (trap->ttyp == MAGIC_PORTAL)
break;
putstr(win, 0, "");
if (trap)
Sprintf(buf, "Portal @ (%d,%d), hero @ (%d,%d)", trap->tx,
trap->ty, u.ux, u.uy);
else
Sprintf(buf, "No portal found.");
putstr(win, 0, buf);
Sprintf(buf, "Portal @ (%d,%d), hero @ (%d,%d)",
trap->tx, trap->ty, u.ux, u.uy);
/* only report "no portal found" when actually expecting a portal */
else if (Is_earthlevel(&u.uz) || Is_waterlevel(&u.uz)
|| Is_firelevel(&u.uz) || Is_airlevel(&u.uz)
|| Is_qstart(&u.uz) || at_dgn_entrance("The Quest")
|| Is_knox(&u.uz))
Strcpy(buf, "No portal found.");
/* only give output if we found a portal or expected one and didn't */
if (*buf) {
putstr(win, 0, "");
putstr(win, 0, buf);
}
}
display_nhwindow(win, TRUE);
@@ -2039,15 +2048,28 @@ donamelevel()
if (!(mptr = find_mapseen(&u.uz)))
return 0;
nbuf[0] = '\0';
#ifdef EDIT_GETLIN
if (mptr->custom) {
(void) strncpy(nbuf, mptr->custom, BUFSZ);
nbuf[BUFSZ - 1] = '\0';
}
#else
if (mptr->custom) {
char tmpbuf[BUFSZ];
Sprintf(tmpbuf, "Replace annotation \"%.30s%s\" with?", mptr->custom,
strlen(mptr->custom) > 30 ? "..." : "");
(strlen(mptr->custom) > 30) ? "..." : "");
getlin(tmpbuf, nbuf);
} else
#endif
getlin("What do you want to call this dungeon level?", nbuf);
if (index(nbuf, '\033'))
/* empty input or ESC means don't add or change annotation;
space-only means discard current annotation without adding new one */
if (!*nbuf || *nbuf == '\033')
return 0;
/* strip leading and trailing spaces, compress out consecutive spaces */
(void) mungspaces(nbuf);
/* discard old annotation, if any */
@@ -2056,7 +2078,8 @@ donamelevel()
mptr->custom = (char *) 0;
mptr->custom_lth = 0;
}
/* add new annotation, unless it's empty or a single space */
/* add new annotation, unless it's all spaces (which will be an
empty string after mungspaces() above) */
if (*nbuf && strcmp(nbuf, " ")) {
mptr->custom = dupstr(nbuf);
mptr->custom_lth = strlen(mptr->custom);
@@ -2590,7 +2613,7 @@ recalc_mapseen()
}
if (is_drawbridge_wall(x, y) < 0)
break;
/* else FALLTHRU */
/*FALLTHRU*/
case DBWALL:
case DRAWBRIDGE_DOWN:
if (Is_stronghold(&u.uz))
+1 -1
View File
@@ -1812,7 +1812,7 @@ struct obj *otmp;
make_vomiting((long) rn1(context.victual.reqtime, 5), FALSE);
break;
}
/* else FALLTHRU */
/*FALLTHRU*/
default:
if (otmp->otyp == SLIME_MOLD && !otmp->cursed
&& otmp->spe == context.current_fruit) {
+14 -9
View File
@@ -1572,23 +1572,28 @@ int status;
extern const int monstr[];
static const char *vanqorders[] = {
enum vanq_order_modes {
VANQ_MLVL_MNDX = 0,
VANQ_MSTR_MNDX,
VANQ_ALPHA_SEP,
VANQ_ALPHA_MIX,
VANQ_MCLS_HTOL,
VANQ_MCLS_LTOH,
VANQ_COUNT_H_L,
VANQ_COUNT_L_H,
NUM_VANQ_ORDER_MODES
};
static const char *vanqorders[NUM_VANQ_ORDER_MODES] = {
"traditional: by monster level, by internal monster index",
#define VANQ_MLVL_MNDX 0
"by monster toughness, by internal monster index",
#define VANQ_MSTR_MNDX 1
"alphabetically, first unique monsters, then others",
#define VANQ_ALPHA_SEP 2
"alphabetically, unique monsters and others intermixed",
#define VANQ_ALPHA_MIX 3
"by monster class, high to low level within class",
#define VANQ_MCLS_HTOL 4
"by monster class, low to high level within class",
#define VANQ_MCLS_LTOH 5
"by count, high to low, by internal index within tied count",
#define VANQ_COUNT_H_L 6
"by count, low to high, by internal index within tied count",
#define VANQ_COUNT_L_H 7
};
static int vanq_sortmode = VANQ_MLVL_MNDX;
+1
View File
@@ -708,6 +708,7 @@ doengrave()
"A few ice cubes drop from the wand.");
if (!oep || (oep->engr_type != BURN))
break;
/*FALLTHRU*/
case WAN_CANCELLATION:
case WAN_MAKE_INVISIBLE:
if (oep && oep->engr_type != HEADSTONE) {
+5 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 explode.c $NHDT-Date: 1513297345 2017/12/15 00:22:25 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.55 $ */
/* NetHack 3.6 explode.c $NHDT-Date: 1522454717 2018/03/31 00:05:17 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.56 $ */
/* Copyright (C) 1990 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */
@@ -44,7 +44,7 @@ int expltype;
boolean shopdamage = FALSE, generic = FALSE, physical_dmg = FALSE,
do_hallu = FALSE, inside_engulfer, grabbed, grabbing;
coord grabxy;
char hallu_buf[BUFSZ];
char hallu_buf[BUFSZ], killr_buf[BUFSZ];
short exploding_wand_typ = 0;
if (olet == WAND_CLASS) { /* retributive strike */
@@ -114,7 +114,9 @@ int expltype;
*/
if (olet == MON_EXPLODE) {
str = killer.name;
/* when explode() is called recursively, killer.name might change so
we need to retain a copy of the current value for this explosion */
str = strcpy(killr_buf, killer.name);
do_hallu = (Hallucination
&& (strstri(str, "'s explosion")
|| strstri(str, "s' explosion")));
+3
View File
@@ -330,6 +330,7 @@ drinkfountain()
dofindgem();
break;
}
/*FALLTHRU*/
case 28: /* Water Nymph */
dowaternymph();
break;
@@ -445,6 +446,7 @@ register struct obj *obj;
dofindgem();
break;
}
/*FALLTHRU*/
case 25: /* Water gushes forth */
dogushforth(FALSE);
break;
@@ -616,6 +618,7 @@ drinksink()
pline("From the murky drain, a hand reaches up... --oops--");
break;
}
/*FALLTHRU*/
default:
You("take a sip of %s %s.",
rn2(3) ? (rn2(2) ? "cold" : "warm") : "hot",
+3 -1
View File
@@ -1593,7 +1593,7 @@ unsigned *resultflags;
int oletct, iletct, unpaid, oc_of_sym;
char sym, *ip, olets[MAXOCLASSES + 5], ilets[MAXOCLASSES + 10];
char extra_removeables[3 + 1]; /* uwep,uswapwep,uquiver */
char buf[BUFSZ], qbuf[QBUFSZ];
char buf[BUFSZ] = DUMMY, qbuf[QBUFSZ];
if (!invent) {
You("have nothing to %s.", word);
@@ -1867,6 +1867,7 @@ nextclass:
switch (sym) {
case 'a':
allflag = 1;
/*FALLTHRU*/
case 'y':
tmp = (*fn)(otmp);
if (tmp < 0) {
@@ -1883,6 +1884,7 @@ nextclass:
cnt += tmp;
if (--mx == 0)
goto ret;
/*FALLTHRU*/
case 'n':
if (nodot)
dud++;
+1 -1
View File
@@ -691,7 +691,7 @@ struct obj *otmp;
{
#ifdef SHELL /* can't access mail reader without spawning subprocess */
const char *txt, *cmd;
char *p, buf[BUFSZ], qbuf[BUFSZ];
char *p, buf[BUFSZ] = DUMMY, qbuf[BUFSZ];
int len;
/* there should be a command in OMAILCMD */
+3
View File
@@ -668,10 +668,13 @@ register struct monst *mtmp;
/* MAJOR fall through ... */
case 0:
(void) mongets(mtmp, WAN_MAGIC_MISSILE);
/*FALLTHRU*/
case 1:
(void) mongets(mtmp, POT_EXTRA_HEALING);
/*FALLTHRU*/
case 2:
(void) mongets(mtmp, POT_HEALING);
/*FALLTHRU*/
case 3:
(void) mongets(mtmp, WAN_STRIKING);
}
+28 -24
View File
@@ -5,30 +5,34 @@
#include "hack.h"
/* monster mage spells */
#define MGC_PSI_BOLT 0
#define MGC_CURE_SELF 1
#define MGC_HASTE_SELF 2
#define MGC_STUN_YOU 3
#define MGC_DISAPPEAR 4
#define MGC_WEAKEN_YOU 5
#define MGC_DESTRY_ARMR 6
#define MGC_CURSE_ITEMS 7
#define MGC_AGGRAVATION 8
#define MGC_SUMMON_MONS 9
#define MGC_CLONE_WIZ 10
#define MGC_DEATH_TOUCH 11
enum mcast_mage_spells {
MGC_PSI_BOLT = 0,
MGC_CURE_SELF,
MGC_HASTE_SELF,
MGC_STUN_YOU,
MGC_DISAPPEAR,
MGC_WEAKEN_YOU,
MGC_DESTRY_ARMR,
MGC_CURSE_ITEMS,
MGC_AGGRAVATION,
MGC_SUMMON_MONS,
MGC_CLONE_WIZ,
MGC_DEATH_TOUCH
};
/* monster cleric spells */
#define CLC_OPEN_WOUNDS 0
#define CLC_CURE_SELF 1
#define CLC_CONFUSE_YOU 2
#define CLC_PARALYZE 3
#define CLC_BLIND_YOU 4
#define CLC_INSECTS 5
#define CLC_CURSE_ITEMS 6
#define CLC_LIGHTNING 7
#define CLC_FIRE_PILLAR 8
#define CLC_GEYSER 9
enum mcast_cleric_spells {
CLC_OPEN_WOUNDS = 0,
CLC_CURE_SELF,
CLC_CONFUSE_YOU,
CLC_PARALYZE,
CLC_BLIND_YOU,
CLC_INSECTS,
CLC_CURSE_ITEMS,
CLC_LIGHTNING,
CLC_FIRE_PILLAR,
CLC_GEYSER
};
STATIC_DCL void FDECL(cursetxt, (struct monst *, BOOLEAN_P));
STATIC_DCL int FDECL(choose_magic_spell, (int));
@@ -86,7 +90,7 @@ int spellval;
case 23:
if (Antimagic || Hallucination)
return MGC_PSI_BOLT;
/* else FALL THROUGH */
/*FALLTHRU*/
case 22:
case 21:
case 20:
@@ -141,7 +145,7 @@ int spellnum;
case 14:
if (rn2(3))
return CLC_OPEN_WOUNDS;
/* else FALL THROUGH */
/*FALLTHRU*/
case 13:
return CLC_GEYSER;
case 12:
+1
View File
@@ -573,6 +573,7 @@ struct attack *mattk;
Sprintf(buf, "%s squeezes", magr_name);
break;
}
/*FALLTHRU*/
default:
Sprintf(buf, "%s hits", magr_name);
}
+3 -2
View File
@@ -1316,7 +1316,7 @@ register struct attack *mattk;
return 3;
break;
}
/* else FALLTHRU */
/*FALLTHRU*/
case AD_SITM: /* for now these are the same */
case AD_SEDU:
if (is_animal(mtmp->data)) {
@@ -1553,7 +1553,8 @@ register struct attack *mattk;
done(DIED);
dmg = 0;
break;
} /* else FALLTHRU */
}
/*FALLTHRU*/
default: /* case 16: ... case 5: */
You_feel("your life force draining away...");
permdmg = 1; /* actual damage done below */
+1 -1
View File
@@ -298,7 +298,7 @@ long
bribe(mtmp)
struct monst *mtmp;
{
char buf[BUFSZ];
char buf[BUFSZ] = DUMMY;
long offer;
long umoney = money_cnt(invent);
+1 -6
View File
@@ -500,7 +500,7 @@ fixup_special()
s_level *sp = find_level(r->rname.str);
lev = sp->dlevel;
}
/* fall into... */
/*FALLTHRU*/
case LR_UPSTAIR:
case LR_DOWNSTAIR:
@@ -1198,11 +1198,6 @@ fumaroles()
* other source files, but they are all so nicely encapsulated here.
*/
#define CONS_OBJ 0
#define CONS_MON 1
#define CONS_HERO 2
#define CONS_TRAP 3
static struct bubble *bbubbles, *ebubbles;
static struct trap *wportal;
+2 -1
View File
@@ -278,7 +278,7 @@ struct obj *box;
n = 0;
break;
}
/*else FALLTHRU*/
/*FALLTHRU*/
case BAG_OF_HOLDING:
n = 1;
break;
@@ -884,6 +884,7 @@ boolean artif;
case LARGE_BOX:
otmp->olocked = !!(rn2(5));
otmp->otrapped = !(rn2(10));
/*FALLTHRU*/
case ICE_BOX:
case SACK:
case OILSKIN_SACK:
+17 -6
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 mon.c $NHDT-Date: 1514769571 2018/01/01 01:19:31 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.246 $ */
/* NetHack 3.6 mon.c $NHDT-Date: 1522540516 2018/03/31 23:55:16 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.250 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -86,14 +86,21 @@ mon_sanity_check()
if (DEADMONSTER(mtmp))
continue;
x = mtmp->mx, y = mtmp->my;
if (!isok(x, y) && !(mtmp->isgd && x == 0 && y == 0))
if (!isok(x, y) && !(mtmp->isgd && x == 0 && y == 0)) {
impossible("mon (%s) claims to be at <%d,%d>?",
fmt_ptr((genericptr_t) mtmp), x, y);
else if (level.monsters[x][y] != mtmp)
} else if (mtmp == u.usteed) {
/* steed is in fmon list but not on the map; its
<mx,my> coordinates should match hero's location */
if (x != u.ux || y != u.uy)
impossible("steed (%s) claims to be at <%d,%d>?",
fmt_ptr((genericptr_t) mtmp), x, y);
} else if (level.monsters[x][y] != mtmp) {
impossible("mon (%s) at <%d,%d> is not there!",
fmt_ptr((genericptr_t) mtmp), x, y);
else if (mtmp->wormno)
} else if (mtmp->wormno) {
sanity_check_worm(mtmp);
}
}
for (x = 0; x < COLNO; x++)
@@ -105,6 +112,9 @@ mon_sanity_check()
if (!m)
impossible("map mon (%s) at <%d,%d> not in fmon list!",
fmt_ptr((genericptr_t) mtmp), x, y);
else if (mtmp == u.usteed)
impossible("steed (%s) is on the map at <%d,%d>!",
fmt_ptr((genericptr_t) mtmp), x, y);
else if ((mtmp->mx != x || mtmp->my != y)
&& mtmp->data != &mons[PM_LONG_WORM])
impossible("map mon (%s) at <%d,%d> is found at <%d,%d>?",
@@ -3040,7 +3050,8 @@ struct monst *mon;
int shiftflags;
{
struct permonst *ptr = 0;
unsigned mndx, was_female = mon->female;
int mndx;
unsigned was_female = mon->female;
boolean msg = FALSE, dochng = FALSE;
if ((shiftflags & SHIFT_MSG)
@@ -3266,7 +3277,7 @@ struct monst *mon;
/* for debugging: allow control of polymorphed monster */
if (wizard && iflags.mon_polycontrol) {
char pprompt[BUFSZ], buf[BUFSZ];
char pprompt[BUFSZ], buf[BUFSZ] = DUMMY;
int monclass;
Sprintf(pprompt, "Change %s @ %s into what kind of monster?",
+2 -2
View File
@@ -1005,7 +1005,7 @@ try_again:
goto try_again;
if (!rn2(3))
return WAN_TELEPORTATION;
/* else FALLTHRU */
/*FALLTHRU*/
case 0:
case 1:
return SCR_TELEPORTATION;
@@ -1013,7 +1013,7 @@ try_again:
case 10:
if (!rn2(3))
return WAN_CREATE_MONSTER;
/* else FALLTHRU */
/*FALLTHRU*/
case 2:
return SCR_CREATE_MONSTER;
case 3:
+6 -6
View File
@@ -302,7 +302,7 @@ int force;
case THRONE:
if (cansee(x, y))
pline_The("throne falls into a chasm.");
/* Falls into next case */
/*FALLTHRU*/
case ROOM:
case CORR: /* Try to make a pit */
do_pit:
@@ -478,10 +478,10 @@ struct obj *instr;
pc_speaker(&itmp, "C");
#endif
#define PLAY_NORMAL 0
#define PLAY_STUNNED 1
#define PLAY_CONFUSED 2
#define PLAY_HALLU 4
#define PLAY_NORMAL 0x00
#define PLAY_STUNNED 0x01
#define PLAY_CONFUSED 0x02
#define PLAY_HALLU 0x04
mode = PLAY_NORMAL;
if (Stunned)
mode |= PLAY_STUNNED;
@@ -609,7 +609,7 @@ int
do_play_instrument(instr)
struct obj *instr;
{
char buf[BUFSZ], c = 'y';
char buf[BUFSZ] = DUMMY, c = 'y';
char *s;
int x, y;
boolean ok;
+2 -1
View File
@@ -453,6 +453,7 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */
case WEAPON_CLASS:
if (is_poisonable(obj) && obj->opoisoned)
Strcpy(buf, "poisoned ");
/*FALLTHRU*/
case VENOM_CLASS:
case TOOL_CLASS:
if (typ == LENSES)
@@ -3710,7 +3711,7 @@ typfnd:
otmp->spe = (rn2(10) ? -1 : 0);
break;
}
/* fall through, if wizard */
/*FALLTHRU*/
default:
otmp->spe = spe;
}
+12 -10
View File
@@ -27,11 +27,13 @@ NEARDATA struct instance_flags iflags; /* provide linkage */
#define PREFER_TILED FALSE
#endif
#define MESSAGE_OPTION 1
#define STATUS_OPTION 2
#define MAP_OPTION 3
#define MENU_OPTION 4
#define TEXT_OPTION 5
enum window_option_types {
MESSAGE_OPTION = 1,
STATUS_OPTION,
MAP_OPTION,
MENU_OPTION,
TEXT_OPTION
};
#define PILE_LIMIT_DFLT 5
@@ -2836,7 +2838,7 @@ boolean tinitial, tfrom_file;
fullname = "pickup_types";
if (match_optname(opts, fullname, 8, TRUE)) {
char ocl[MAXOCLASSES + 1], tbuf[MAXOCLASSES + 1], qbuf[QBUFSZ],
abuf[BUFSZ];
abuf[BUFSZ] = DUMMY;
int oc_sym;
boolean badopt = FALSE, compat = (strlen(opts) <= 6), use_menu;
@@ -4100,7 +4102,7 @@ int
doset() /* changing options via menu by Per Liboriussen */
{
static boolean made_fmtstr = FALSE;
char buf[BUFSZ], buf2[BUFSZ];
char buf[BUFSZ], buf2[BUFSZ] = DUMMY;
const char *name;
int i = 0, pass, boolcount, pick_cnt, pick_idx, opt_indx;
boolean *bool_p;
@@ -4779,7 +4781,7 @@ boolean setinitial, setfromfile;
iflags.menu_headings = mhattr;
} else if (!strcmp("msgtype", optname)) {
int opt_idx, nmt, mttyp;
char mtbuf[BUFSZ];
char mtbuf[BUFSZ] = DUMMY;
msgtypes_again:
nmt = msgtype_count();
@@ -4841,7 +4843,7 @@ boolean setinitial, setfromfile;
}
} else if (!strcmp("menucolors", optname)) {
int opt_idx, nmc, mcclr, mcattr;
char mcbuf[BUFSZ];
char mcbuf[BUFSZ] = DUMMY;
menucolors_again:
nmc = count_menucolors();
@@ -4912,7 +4914,7 @@ boolean setinitial, setfromfile;
}
} else if (!strcmp("autopickup_exception", optname)) {
int opt_idx, pass, totalapes = 0, numapes[2] = { 0, 0 };
char apebuf[1 + BUFSZ]; /* so &apebuf[1] is BUFSZ long for getlin() */
char apebuf[1 + BUFSZ] = DUMMY; /* so &apebuf[1] is BUFSZ long for getlin() */
struct autopickup_exception *ape;
ape_again:
+6 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 pager.c $NHDT-Date: 1519529752 2018/02/25 03:35:52 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.120 $ */
/* NetHack 3.6 pager.c $NHDT-Date: 1523142395 2018/04/07 23:06:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.123 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -418,6 +418,9 @@ char *buf, *monbuf;
if ((mtmp = m_at(x, y)) != 0) {
look_at_monster(buf, monbuf, mtmp, x, y);
pm = mtmp->data;
} else if (Hallucination) {
/* 'monster' must actually be a statue */
Strcpy(buf, rndmonnam((char *) 0));
}
} else if (glyph_is_object(glyph)) {
look_at_object(buf, x, y, glyph); /* fill in buf[] */
@@ -481,7 +484,7 @@ char *buf, *monbuf;
Strcpy(buf, "stone");
break;
}
/*else FALLTHRU*/
/*FALLTHRU*/
default:
Strcpy(buf, defsyms[glyph_to_cmap(glyph)].explanation);
break;
@@ -1033,7 +1036,7 @@ coord *click_cc;
{
boolean quick = (mode == 1); /* use cursor; don't search for "more info" */
boolean clicklook = (mode == 2); /* right mouse-click method */
char out_str[BUFSZ];
char out_str[BUFSZ] = DUMMY;
const char *firstmatch = 0;
struct permonst *pm = 0;
int i = '\0', ans = 0;
+1 -1
View File
@@ -149,7 +149,7 @@ struct obj *objs;
boolean here;
int *menu_on_demand;
{
char ilets[36], inbuf[BUFSZ]; /* FIXME: hardcoded ilets[] length */
char ilets[36], inbuf[BUFSZ] = DUMMY; /* FIXME: hardcoded ilets[] length */
int iletct, oclassct;
boolean not_everything, filtered;
char qbuf[QBUFSZ];
+1 -1
View File
@@ -384,7 +384,7 @@ void
polyself(psflags)
int psflags;
{
char buf[BUFSZ];
char buf[BUFSZ] = DUMMY;
int old_light, new_light, mntmp, class, tryct;
boolean forcecontrol = (psflags == 1), monsterpoly = (psflags == 2),
draconian = (uarm && Is_dragon_armor(uarm)),
+4 -2
View File
@@ -957,6 +957,7 @@ aligntyp g_align;
switch (min(action, 5)) {
case 5:
pat_on_head = 1;
/*FALLTHRU*/
case 4:
do
fix_worst_trouble(trouble);
@@ -1056,7 +1057,7 @@ aligntyp g_align;
break;
}
}
/* Otherwise, falls into next case */
/*FALLTHRU*/
case 2:
if (!Blind)
You("are surrounded by %s glow.", an(hcolor(NH_GOLDEN)));
@@ -1148,7 +1149,8 @@ aligntyp g_align;
if (u.ualign.record >= PIOUS && !u.uevent.uhand_of_elbereth) {
gcrownu();
break;
} /* else FALLTHRU */
}
/*FALLTHRU*/
case 6: {
struct obj *otmp;
int sp_no, trycnt = u.ulevel + 1;
+2
View File
@@ -471,6 +471,7 @@ char *in_line, *out_line;
/* pluralize */
case 'P':
cvt_buf[0] = highc(cvt_buf[0]);
/*FALLTHRU*/
case 'p':
Strcpy(cvt_buf, makeplural(cvt_buf));
break;
@@ -478,6 +479,7 @@ char *in_line, *out_line;
/* append possessive suffix */
case 'S':
cvt_buf[0] = highc(cvt_buf[0]);
/*FALLTHRU*/
case 's':
Strcpy(cvt_buf, s_suffix(cvt_buf));
break;
+5 -4
View File
@@ -1435,7 +1435,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
if (sblessed)
do_class_genocide();
else
do_genocide(!scursed | (2 * !!Confusion));
do_genocide((!scursed) | (2 * !!Confusion));
break;
case SCR_LIGHT:
if (!confused || rn2(5)) {
@@ -1551,6 +1551,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
/* do_mapping() already reveals secret passages */
}
known = TRUE;
/*FALLTHRU*/
case SPE_MAGIC_MAPPING:
if (level.flags.nommap) {
Your("%s spins as %s blocks the spell!", body_part(HEAD),
@@ -2017,7 +2018,7 @@ STATIC_OVL void
do_class_genocide()
{
int i, j, immunecnt, gonecnt, goodcnt, class, feel_dead = 0;
char buf[BUFSZ];
char buf[BUFSZ] = DUMMY;
boolean gameover = FALSE; /* true iff killed self */
for (j = 0;; j++) {
@@ -2169,7 +2170,7 @@ int how;
/* 3 = forced genocide of player */
/* 5 (4 | 1) = normal genocide from throne */
{
char buf[BUFSZ];
char buf[BUFSZ] = DUMMY;
register int i, killplayer = 0;
register int mndx;
register struct permonst *ptr;
@@ -2425,7 +2426,7 @@ struct obj *from_obj;
boolean
create_particular()
{
char buf[BUFSZ], *bufp, monclass;
char buf[BUFSZ] = DUMMY, *bufp, monclass;
char *tmpp;
int which, tryct, i, firstchoice = NON_PM;
struct permonst *whichpm = NULL;
+2
View File
@@ -3101,6 +3101,7 @@ xchar x, y;
switch (sell_response ? sell_response : ynaq(qbuf)) {
case 'q':
sell_response = 'n';
/*FALLTHRU*/
case 'n':
if (container)
dropped_container(obj, shkp, FALSE);
@@ -3110,6 +3111,7 @@ xchar x, y;
break;
case 'a':
sell_response = 'y';
/*FALLTHRU*/
case 'y':
if (container)
dropped_container(obj, shkp, TRUE);
+11
View File
@@ -396,18 +396,21 @@ attrcurse()
You_feel("warmer.");
break;
}
/*FALLTHRU*/
case 2:
if (HTeleportation & INTRINSIC) {
HTeleportation &= ~INTRINSIC;
You_feel("less jumpy.");
break;
}
/*FALLTHRU*/
case 3:
if (HPoison_resistance & INTRINSIC) {
HPoison_resistance &= ~INTRINSIC;
You_feel("a little sick!");
break;
}
/*FALLTHRU*/
case 4:
if (HTelepat & INTRINSIC) {
HTelepat &= ~INTRINSIC;
@@ -416,18 +419,21 @@ attrcurse()
Your("senses fail!");
break;
}
/*FALLTHRU*/
case 5:
if (HCold_resistance & INTRINSIC) {
HCold_resistance &= ~INTRINSIC;
You_feel("cooler.");
break;
}
/*FALLTHRU*/
case 6:
if (HInvis & INTRINSIC) {
HInvis &= ~INTRINSIC;
You_feel("paranoid.");
break;
}
/*FALLTHRU*/
case 7:
if (HSee_invisible & INTRINSIC) {
HSee_invisible &= ~INTRINSIC;
@@ -435,18 +441,21 @@ attrcurse()
: "thought you saw something");
break;
}
/*FALLTHRU*/
case 8:
if (HFast & INTRINSIC) {
HFast &= ~INTRINSIC;
You_feel("slower.");
break;
}
/*FALLTHRU*/
case 9:
if (HStealth & INTRINSIC) {
HStealth &= ~INTRINSIC;
You_feel("clumsy.");
break;
}
/*FALLTHRU*/
case 10:
/* intrinsic protection is just disabled, not set back to 0 */
if (HProtection & INTRINSIC) {
@@ -454,12 +463,14 @@ attrcurse()
You_feel("vulnerable.");
break;
}
/*FALLTHRU*/
case 11:
if (HAggravate_monster & INTRINSIC) {
HAggravate_monster &= ~INTRINSIC;
You_feel("less attractive.");
break;
}
/*FALLTHRU*/
default:
break;
}
+4 -3
View File
@@ -113,8 +113,8 @@ dosounds()
You_hear("someone searching.");
break;
}
/* fall into... (yes, even for hallucination) */
}
/*FALLTHRU*/
case 0:
You_hear("the footsteps of a guard on patrol.");
break;
@@ -662,7 +662,8 @@ register struct monst *mtmp;
else
pline_msg = "mews.";
break;
} /* else FALLTHRU */
}
/*FALLTHRU*/
case MS_GROWL:
pline_msg = mtmp->mpeaceful ? "snarls." : "growls!";
break;
@@ -764,7 +765,7 @@ register struct monst *mtmp;
}
break;
}
/* else FALLTHRU */
/*FALLTHRU*/
case MS_HUMANOID:
if (!mtmp->mpeaceful) {
if (In_endgame(&u.uz) && is_mplayer(ptr))
+58 -44
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1519399521 2018/02/23 15:25:21 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.96 $ */
/* 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 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
@@ -52,6 +52,7 @@ STATIC_DCL void FDECL(set_wall_property, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
STATIC_DCL void NDECL(shuffle_alignments);
STATIC_DCL void NDECL(count_features);
STATIC_DCL void NDECL(remove_boundary_syms);
STATIC_DCL void FDECL(set_door_orientation, (int, int));
STATIC_DCL void FDECL(maybe_add_door, (int, int, struct mkroom *));
STATIC_DCL void NDECL(link_doors_rooms);
STATIC_DCL void NDECL(fill_rooms);
@@ -702,7 +703,55 @@ remove_boundary_syms()
}
}
void
/* used by sel_set_door() and link_doors_rooms() */
STATIC_OVL void
set_door_orientation(x, y)
int x, y;
{
boolean wleft, wright, wup, wdown;
/* If there's a wall or door on either the left side or right
* side (or both) of this secret door, make it be horizontal.
*
* It is feasible to put SDOOR in a corner, tee, or crosswall
* position, although once the door is found and opened it won't
* make a lot sense (diagonal access required). Still, we try to
* handle that as best as possible. For top or bottom tee, using
* horizontal is the best we can do. For corner or crosswall,
* either horizontal or vertical are just as good as each other;
* we produce horizontal for corners and vertical for crosswalls.
* For left or right tee, using vertical is best.
*
* A secret door with no adjacent walls is also feasible and makes
* even less sense. It will be displayed as a vertical wall while
* hidden and become a vertical door when found. Before resorting
* to that, we check for solid rock which hasn't been wallified
* yet (cf lower leftside of leader's room in Cav quest).
*/
wleft = (isok(x - 1, y) && (IS_WALL(levl[x - 1][y].typ)
|| IS_DOOR(levl[x - 1][y].typ)
|| levl[x - 1][y].typ == SDOOR));
wright = (isok(x + 1, y) && (IS_WALL(levl[x + 1][y].typ)
|| IS_DOOR(levl[x + 1][y].typ)
|| levl[x + 1][y].typ == SDOOR));
wup = (isok(x, y - 1) && (IS_WALL(levl[x][y - 1].typ)
|| IS_DOOR(levl[x][y - 1].typ)
|| levl[x][y - 1].typ == SDOOR));
wdown = (isok(x, y + 1) && (IS_WALL(levl[x][y + 1].typ)
|| IS_DOOR(levl[x][y + 1].typ)
|| levl[x][y + 1].typ == SDOOR));
if (!wleft && !wright && !wup && !wdown) {
/* out of bounds is treated as implicit wall; should be academic
because we don't expect to have doors so near the level's edge */
wleft = (!isok(x - 1, y) || IS_DOORJOIN(levl[x - 1][y].typ));
wright = (!isok(x + 1, y) || IS_DOORJOIN(levl[x + 1][y].typ));
wup = (!isok(x, y - 1) || IS_DOORJOIN(levl[x][y - 1].typ));
wdown = (!isok(x, y + 1) || IS_DOORJOIN(levl[x][y + 1].typ));
}
levl[x][y].horizontal = ((wleft || wright) && !(wup && wdown)) ? 1 : 0;
}
STATIC_OVL void
maybe_add_door(x, y, droom)
int x, y;
struct mkroom *droom;
@@ -711,7 +760,7 @@ struct mkroom *droom;
add_door(x, y, droom);
}
void
STATIC_OVL void
link_doors_rooms()
{
int x, y;
@@ -720,6 +769,11 @@ link_doors_rooms()
for (y = 0; y < ROWNO; y++)
for (x = 0; x < COLNO; x++)
if (IS_DOOR(levl[x][y].typ) || levl[x][y].typ == SDOOR) {
/* in case this door was a '+' or 'S' from the
MAP...ENDMAP section without an explicit DOOR
directive, set/clear levl[][].horizontal for it */
set_door_orientation(x, y);
for (tmpi = 0; tmpi < nroom; tmpi++) {
maybe_add_door(x, y, &rooms[tmpi]);
for (m = 0; m < rooms[tmpi].nsubrooms; m++) {
@@ -4213,7 +4267,6 @@ genericptr_t arg;
{
xchar typ = *(xchar *) arg;
xchar x = dx, y = dy;
boolean wleft, wright, wup, wdown;
if (!IS_DOOR(levl[x][y].typ) && levl[x][y].typ != SDOOR)
levl[x][y].typ = (typ & D_SECRET) ? SDOOR : DOOR;
@@ -4222,46 +4275,7 @@ genericptr_t arg;
if (typ < D_CLOSED)
typ = D_CLOSED;
}
/* If there's a wall or door on either the left side or right
* side (or both) of this secret door, make it be horizontal.
*
* It is feasible to put SDOOR in a corner, tee, or crosswall
* position, although once the door is found and opened it won't
* make a lot sense (diagonal access required). Still, we try to
* handle that as best as possible. For top or bottom tee, using
* horizontal is the best we can do. For corner or crosswall,
* either horizontal or vertical are just as good as each other;
* we produce horizontal for corners and vertical for crosswalls.
* For left or right tee, using vertical is best.
*
* A secret door with no adjacent walls is also feasible and makes
* even less sense. It will be displayed as a vertical wall while
* hidden and become a vertical door when found. Before resorting
* to that, we check for solid rock which hasn't been wallified
* yet (cf lower leftside of leader's room in Cav quest).
*/
wleft = (isok(x - 1, y) && (IS_WALL(levl[x - 1][y].typ)
|| IS_DOOR(levl[x - 1][y].typ)
|| levl[x - 1][y].typ == SDOOR));
wright = (isok(x + 1, y) && (IS_WALL(levl[x + 1][y].typ)
|| IS_DOOR(levl[x + 1][y].typ)
|| levl[x + 1][y].typ == SDOOR));
wup = (isok(x, y - 1) && (IS_WALL(levl[x][y - 1].typ)
|| IS_DOOR(levl[x][y - 1].typ)
|| levl[x][y - 1].typ == SDOOR));
wdown = (isok(x, y + 1) && (IS_WALL(levl[x][y + 1].typ)
|| IS_DOOR(levl[x][y + 1].typ)
|| levl[x][y + 1].typ == SDOOR));
if (!wleft && !wright && !wup && !wdown) {
/* out of bounds is treated as implicit wall; should be academic
because we don't expect to have doors so near the level's edge */
wleft = (!isok(x - 1, y) || IS_DOORJOIN(levl[x - 1][y].typ));
wright = (!isok(x + 1, y) || IS_DOORJOIN(levl[x + 1][y].typ));
wup = (!isok(x, y - 1) || IS_DOORJOIN(levl[x][y - 1].typ));
wdown = (!isok(x, y + 1) || IS_DOORJOIN(levl[x][y + 1].typ));
}
levl[x][y].horizontal = ((wleft || wright) && !(wup && wdown)) ? 1 : 0;
set_door_orientation(x, y); /* set/clear levl[x][y].horizontal */
levl[x][y].doormask = typ;
SpLev_Map[x][y] = 1;
}
+15 -10
View File
@@ -1343,26 +1343,31 @@ losespells()
* are learned, they get inserted into sorted order rather than be
* appended to the end of the list?
*/
static const char *spl_sortchoices[] = {
enum spl_sort_types {
SORTBY_LETTER = 0,
SORTBY_ALPHA,
SORTBY_LVL_LO,
SORTBY_LVL_HI,
SORTBY_SKL_AL,
SORTBY_SKL_LO,
SORTBY_SKL_HI,
SORTBY_CURRENT,
SORTRETAINORDER,
NUM_SPELL_SORTBY
};
static const char *spl_sortchoices[NUM_SPELL_SORTBY] = {
"by casting letter",
#define SORTBY_LETTER 0
"alphabetically",
#define SORTBY_ALPHA 1
"by level, low to high",
#define SORTBY_LVL_LO 2
"by level, high to low",
#define SORTBY_LVL_HI 3
"by skill group, alphabetized within each group",
#define SORTBY_SKL_AL 4
"by skill group, low to high level within group",
#define SORTBY_SKL_LO 5
"by skill group, high to low level within group",
#define SORTBY_SKL_HI 6
"maintain current ordering",
#define SORTBY_CURRENT 7
/* a menu choice rather than a sort choice */
"reassign casting letters to retain current order",
#define SORTRETAINORDER 8
};
static int spl_sortmode = 0; /* index into spl_sortchoices[] */
static int *spl_orderindx = 0; /* array of spl_book[] indices */
+1
View File
@@ -485,6 +485,7 @@ int reason; /* Player was thrown off etc. */
switch (reason) {
case DISMOUNT_THROWN:
verb = "are thrown";
/*FALLTHRU*/
case DISMOUNT_FELL:
You("%s off of %s!", verb, mon_nam(mtmp));
if (!have_spot)
+16 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 teleport.c $NHDT-Date: 1455140444 2016/02/10 21:40:44 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.66 $ */
/* NetHack 3.6 teleport.c $NHDT-Date: 1523306912 2018/04/09 20:48:32 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.73 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -609,12 +609,22 @@ level_tele()
Strcpy(qbuf, "To what level do you want to teleport?");
do {
if (iflags.menu_requested) {
/* wizard mode 'm ^V' skips prompting on first pass
(note: level Tport via menu won't have any second pass) */
iflags.menu_requested = FALSE;
if (wizard)
goto levTport_menu;
}
if (++trycnt == 2) {
if (wizard)
Strcat(qbuf, " [type a number, name, or ? for a menu]");
else
Strcat(qbuf, " [type a number or name]");
}
*buf = '\0'; /* EDIT_GETLIN: if we're on second or later pass,
the previous input was invalid so don't use it
as getlin()'s preloaded default answer */
getlin(qbuf, buf);
if (!strcmp(buf, "\033")) { /* cancelled */
if (Confusion && rnl(5)) {
@@ -629,9 +639,12 @@ level_tele()
goto random_levtport;
}
if (wizard && !strcmp(buf, "?")) {
schar destlev = 0;
xchar destdnum = 0;
schar destlev;
xchar destdnum;
levTport_menu:
destlev = 0;
destdnum = 0;
newlev = (int) print_dungeon(TRUE, &destlev, &destdnum);
if (!newlev)
return;
+1 -1
View File
@@ -2465,7 +2465,7 @@ register struct monst *mtmp;
mtmp->mtrapped = 1;
break;
}
/* fall though */
/*FALLTHRU*/
default:
if (mptr->mlet == S_GIANT
/* exclude baby dragons and relatively short worms */
+1
View File
@@ -2396,6 +2396,7 @@ register struct monst *mon;
|| youmonst.data->mlet == S_ORC
|| youmonst.data->mlet == S_GNOME) && !weapon_used)
goto use_weapon;
/*FALLTHRU*/
case AT_NONE:
case AT_BOOM:
+1 -1
View File
@@ -230,7 +230,7 @@ invault()
guard = findgd();
if (++u.uinvault % VAULT_GUARD_TIME == 0 && !guard) {
/* if time ok and no guard now. */
char buf[BUFSZ];
char buf[BUFSZ] = DUMMY;
register int x, y, dd, gx, gy;
int lx = 0, ly = 0;
long umoney;
+1 -1
View File
@@ -391,7 +391,7 @@ register struct monst *mtmp;
mtmp->mhp += rnd(8);
return 1;
}
/* fall through :-) */
/*FALLTHRU*/
case STRAT_NONE: /* harass */
if (!rn2(!mtmp->mflee ? 5 : 33))
+1 -1
View File
@@ -95,7 +95,7 @@ dowrite(pen)
register struct obj *pen;
{
register struct obj *paper;
char namebuf[BUFSZ], *nm, *bp;
char namebuf[BUFSZ] = DUMMY, *nm, *bp;
register struct obj *new_obj;
int basecost, actualcost;
int curseval;
+5 -2
View File
@@ -2408,6 +2408,7 @@ boolean ordinary;
case WAN_LIGHT: /* (broken wand) */
/* assert( !ordinary ); */
damage = d(obj->spe, 25);
/*FALLTHRU*/
case EXPENSIVE_CAMERA:
if (!damage)
damage = 5;
@@ -4138,7 +4139,8 @@ boolean say; /* Announce out of sight hit/miss events if true */
switch (bounce) {
case 0:
dx = -dx; /* fall into... */
dx = -dx;
/*FALLTHRU*/
case 1:
dy = -dy;
break;
@@ -5050,7 +5052,8 @@ int triesleft;
void
makewish()
{
char buf[BUFSZ], promptbuf[BUFSZ];
static char buf[BUFSZ] = DUMMY;
char promptbuf[BUFSZ];
struct obj *otmp, nothing;
int tries = 0;