more src reformatting

Fixing up mis-indented block comments, but hit some files that hadn't
had the earlier mixture of tab replacement, etc, so it's bigger than I
expected.  If I get to it, they'll be another round of this tomorrow.
This commit is contained in:
PatR
2015-11-06 03:14:50 -08:00
parent 102e427ca7
commit 915dd89270
14 changed files with 811 additions and 752 deletions
+7 -6
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 apply.c $NHDT-Date: 1446369459 2015/11/01 09:17:39 $ $NHDT-Branch: master $:$NHDT-Revision: 1.208 $ */
/* NetHack 3.6 apply.c $NHDT-Date: 1446808436 2015/11/06 11:13:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.210 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1471,7 +1471,7 @@ boolean showmsg;
return TRUE;
}
int jumping_is_magic;
static int jumping_is_magic;
void
display_jump_positions(state)
@@ -1481,6 +1481,7 @@ int state;
tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
} else if (state == 1) {
int x, y, dx, dy;
for (dx = -4; dx <= 4; dx++)
for (dy = -4; dy <= 4; dy++) {
x = dx + (int) u.ux;
@@ -1508,8 +1509,7 @@ int magic; /* 0=Physical, otherwise skill level */
} else if (!magic && !Jumping) {
You_cant("jump very far.");
return 0;
/* if steed is immobile, can't do physical jump but can do spell one
*/
/* if steed is immobile, can't do physical jump but can do spell one */
} else if (!magic && u.usteed && stucksteed(FALSE)) {
/* stucksteed gave "<steed> won't move" message */
return 0;
@@ -1587,7 +1587,8 @@ int magic; /* 0=Physical, otherwise skill level */
if (u.utrap)
switch (u.utraptype) {
case TT_BEARTRAP: {
register long side = rn2(3) ? LEFT_SIDE : RIGHT_SIDE;
long side = rn2(3) ? LEFT_SIDE : RIGHT_SIDE;
You("rip yourself free of the bear trap! Ouch!");
losehp(Maybe_Half_Phys(rnd(10)), "jumping out of a bear trap",
KILLED_BY);
@@ -2718,7 +2719,7 @@ coord *pos;
int min_range, max_range;
{
struct monst *mtmp;
struct monst *selmon = NULL;
struct monst *selmon = (struct monst *) 0;
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
if (mtmp && !DEADMONSTER(mtmp) && !mtmp->mtame
+3 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 ball.c $NHDT-Date: 1445301116 2015/10/20 00:31:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.27 $ */
/* NetHack 3.6 ball.c $NHDT-Date: 1446808438 2015/11/06 11:13:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.28 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -694,7 +694,8 @@ drop_ball(x, y)
xchar x, y;
{
if (Blind) {
u.bc_order = bc_order(); /* get the order */
/* get the order */
u.bc_order = bc_order();
/* pick up glyph */
u.bglyph = (u.bc_order) ? u.cglyph : levl[x][y].glyph;
}
@@ -803,7 +804,6 @@ drag_down()
* not wielding any weapon), or
* c) (perhaps) it falls forward out of his non-weapon hand
*/
forward = carried(uball) && (uwep == uball || !uwep || !rn2(3));
if (carried(uball))
+42 -38
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 display.c $NHDT-Date: 1445301119 2015/10/20 00:31:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.76 $ */
/* NetHack 3.6 display.c $NHDT-Date: 1446808439 2015/11/06 11:13:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.77 $ */
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
/* and Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
@@ -106,8 +106,7 @@
* seenv - A vector of bits representing the directions from which the
* hero has seen this position. The vector's primary use is
* determining how walls are seen. E.g. a wall sometimes looks
* like stone on one side, but is seen as a wall from the
*other.
* like stone on one side, but is seen as wall from the other.
* Other uses are for unmapping detected objects and felt
* locations, where we need to know if the hero has ever
* seen the location.
@@ -360,13 +359,13 @@ STATIC_OVL void
display_monster(x, y, mon, sightflags, worm_tail)
register xchar x, y; /* display position */
register struct monst *mon; /* monster to display */
int sightflags; /* 1 if the monster is physically seen */
/* 2 if detected using Detect_monsters */
register xchar worm_tail; /* mon is actually a worm tail */
int sightflags; /* 1 if the monster is physically seen;
2 if detected using Detect_monsters */
xchar worm_tail; /* mon is actually a worm tail */
{
register boolean mon_mimic = (mon->m_ap_type != M_AP_NOTHING);
register int sensed =
mon_mimic && (Protection_from_shape_changers || sensemon(mon));
boolean mon_mimic = (mon->m_ap_type != M_AP_NOTHING);
int sensed = (mon_mimic && (Protection_from_shape_changers
|| sensemon(mon)));
/*
* We must do the mimic check first. If the mimic is mimicing something,
* and the location is in sight, we have to change the hero's memory
@@ -405,8 +404,9 @@ register xchar worm_tail; /* mon is actually a worm tail */
}
case M_AP_OBJECT: {
struct obj obj; /* Make a fake object to send */
/* to map_object(). */
/* Make a fake object to send to map_object(). */
struct obj obj;
obj = zeroobj;
obj.ox = x;
obj.oy = y;
@@ -520,8 +520,8 @@ xchar x, y;
if (Underwater && !Is_waterlevel(&u.uz) && !is_pool(x, y))
return;
/* Set the seen vector as if the hero had seen it. It doesn't matter */
/* if the hero is levitating or not. */
/* Set the seen vector as if the hero had seen it.
It doesn't matter if the hero is levitating or not. */
set_seenv(lev, u.ux, u.uy, x, y);
if (!can_reach_floor(FALSE)) {
@@ -578,7 +578,8 @@ xchar x, y;
if (lev->typ != ROOM && lev->seenv) {
map_background(x, y, 1);
} else {
lev->glyph = (flags.dark_room && iflags.use_color && !Is_rogue_level(&u.uz))
lev->glyph = (flags.dark_room && iflags.use_color
&& !Is_rogue_level(&u.uz))
? cmap_to_glyph(S_darkroom)
: (lev->waslit ? cmap_to_glyph(S_room)
: cmap_to_glyph(S_stone));
@@ -587,7 +588,8 @@ xchar x, y;
} else if ((lev->glyph >= cmap_to_glyph(S_stone)
&& lev->glyph < cmap_to_glyph(S_darkroom))
|| glyph_is_invisible(levl[x][y].glyph)) {
lev->glyph = (flags.dark_room && iflags.use_color && !Is_rogue_level(&u.uz))
lev->glyph = (flags.dark_room && iflags.use_color
&& !Is_rogue_level(&u.uz))
? cmap_to_glyph(S_darkroom)
: (lev->waslit ? cmap_to_glyph(S_room)
: cmap_to_glyph(S_stone));
@@ -749,30 +751,30 @@ register int x, y;
display_monster(x, y, mon,
see_it ? PHYSICALLY_SEEN : DETECTED,
worm_tail);
} else if (mon && mon_warning(mon) && !is_worm_tail(mon))
} else if (mon && mon_warning(mon) && !is_worm_tail(mon)) {
display_warning(mon);
else if (glyph_is_invisible(levl[x][y].glyph))
} else if (glyph_is_invisible(levl[x][y].glyph)) {
map_invisible(x, y);
else
_map_location(x, y, 1); /* map the location */
}
} else
_map_location(x, y, 1); /* map the location */\
}
/* Can't see the location. */
else {
} else {
if (x == u.ux && y == u.uy) {
feel_location(u.ux, u.uy); /* forces an update */
if (canspotself())
display_self();
} else if ((mon = m_at(x, y))
&& ((see_it =
(tp_sensemon(mon) || MATCH_WARN_OF_MON(mon)
|| (see_with_infrared(mon) && mon_visible(mon))))
&& ((see_it = (tp_sensemon(mon) || MATCH_WARN_OF_MON(mon)
|| (see_with_infrared(mon)
&& mon_visible(mon))))
|| Detect_monsters)) {
/* Monsters are printed every time. */
/* This also gets rid of any invisibility glyph */
display_monster(x, y, mon, see_it ? 0 : DETECTED, is_worm_tail(mon) ? TRUE : FALSE);
display_monster(x, y, mon, see_it ? 0 : DETECTED,
is_worm_tail(mon) ? TRUE : FALSE);
} else if ((mon = m_at(x, y)) && mon_warning(mon)
&& !is_worm_tail(mon)) {
display_warning(mon);
@@ -803,7 +805,8 @@ register int x, y;
else if (Is_rogue_level(&u.uz)) {
if (lev->glyph == cmap_to_glyph(S_litcorr) && lev->typ == CORR)
show_glyph(x, y, lev->glyph = cmap_to_glyph(S_corr));
else if (lev->glyph == cmap_to_glyph(S_room) && lev->typ == ROOM && !lev->waslit)
else if (lev->glyph == cmap_to_glyph(S_room) && lev->typ == ROOM
&& !lev->waslit)
show_glyph(x, y, lev->glyph = cmap_to_glyph(S_stone));
else
goto show_mem;
@@ -1063,19 +1066,20 @@ int mode;
if (mode == 1 || dela) {
cls();
dela = FALSE;
}
/* delayed full update */
else if (mode == 2) {
} else if (mode == 2) {
dela = TRUE;
return;
}
/* limited update */
else {
} else {
for (y = lasty - 1; y <= lasty + 1; y++)
for (x = lastx - 1; x <= lastx + 1; x++)
if (isok(x, y))
show_glyph(x, y, cmap_to_glyph(S_stone));
}
for (x = u.ux - 1; x <= u.ux + 1; x++)
for (y = u.uy - 1; y <= u.uy + 1; y++)
if (isok(x, y) && is_pool(x, y)) {
@@ -1107,15 +1111,16 @@ int mode;
if (mode == 1 || dela) {
cls();
dela = FALSE;
}
/* delayed full update */
else if (mode == 2) {
} else if (mode == 2) {
dela = TRUE;
return;
}
/* limited update */
else
} else {
newsym(u.ux, u.uy);
}
}
/* =========================================================================
@@ -1646,8 +1651,7 @@ int loc;
impossible("swallow_to_glyph: bad swallow location");
loc = S_sw_br;
}
return ((int) (what_mon(mnum) << 3) | (loc - S_sw_tl))
+ GLYPH_SWALLOW_OFF;
return ((int) (what_mon(mnum) << 3) | (loc - S_sw_tl)) + GLYPH_SWALLOW_OFF;
}
/*
@@ -1783,8 +1787,8 @@ error4(x, y, a, b, c, dd)
int x, y, a, b, c, dd;
{
pline("set_wall_state: %s @ (%d,%d) %s%s%s%s",
type_to_name(levl[x][y].typ), x, y, a ? "1" : "", b ? "2" : "",
c ? "3" : "", dd ? "4" : "");
type_to_name(levl[x][y].typ), x, y,
a ? "1" : "", b ? "2" : "", c ? "3" : "", dd ? "4" : "");
bad_count[levl[x][y].typ]++;
}
#endif /* WA_VERBOSE */
+39 -37
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 do_name.c $NHDT-Date: 1444617209 2015/10/12 02:33:29 $ $NHDT-Branch: master $:$NHDT-Revision: 1.75 $ */
/* NetHack 3.6 do_name.c $NHDT-Date: 1446808440 2015/11/06 11:14:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.77 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -29,10 +29,11 @@ nextmbuf()
/* function for getpos() to highlight desired map locations.
* parameter value 0 = initialize, 1 = highlight, 2 = done
*/
void (*getpos_hilitefunc)(int) = NULL;
void FDECL((*getpos_hilitefunc), (int)) = (void FDECL((*), (int))) 0;
void
getpos_sethilite(f)
void (*f)(int);
void FDECL((*f), (int));
{
getpos_hilitefunc = f;
}
@@ -244,8 +245,7 @@ const char *goal;
|| glyph_to_cmap(k) == S_darkroom
|| glyph_to_cmap(k) == S_corr
|| glyph_to_cmap(k) == S_litcorr)) {
/* what the hero remembers to be at tx,ty
*/
/* what hero remembers to be at tx,ty */
k = glyph_at(tx, ty);
}
if (glyph_is_cmap(k)
@@ -384,7 +384,6 @@ struct obj *obj;
{
if (has_oname(obj))
return ONAME(obj);
else
return "";
}
@@ -821,13 +820,13 @@ rndghostname()
return rn2(7) ? ghostnames[rn2(SIZE(ghostnames))] : (const char *) plname;
}
/* Monster naming functions:
/*
* Monster naming functions:
* x_monnam is the generic monster-naming function.
* seen unseen detected named
* mon_nam: the newt it the invisible orc Fido
* noit_mon_nam:the newt (as if detected) the invisible orc Fido
* l_monnam: newt it invisible orc dog called
*fido
* l_monnam: newt it invisible orc dog called Fido
* Monnam: The newt It The invisible orc Fido
* noit_Monnam: The newt (as if detected) The invisible orc Fido
* Adjmonnam: The poor newt It The poor invisible orc The poor Fido
@@ -953,6 +952,7 @@ boolean called;
if (do_hallu) {
char rnamecode;
char *rname = rndmonnam(&rnamecode);
Strcat(buf, rname);
name_at_start = bogon_is_pname(rnamecode);
} else if (has_mname(mtmp)) {
@@ -982,6 +982,7 @@ boolean called;
}
} else if (is_mplayer(mdat) && !In_endgame(&u.uz)) {
char pbuf[BUFSZ];
Strcpy(pbuf, rank_of((int) mtmp->m_lev, monsndx(mdat),
(boolean) mtmp->female));
Strcat(buf, lcase(pbuf));
@@ -1015,7 +1016,7 @@ boolean called;
Strcpy(buf, buf2);
return buf;
case ARTICLE_A:
return (an(buf));
return an(buf);
case ARTICLE_NONE:
default:
return buf;
@@ -1025,18 +1026,18 @@ boolean called;
char *
l_monnam(mtmp)
register struct monst *mtmp;
struct monst *mtmp;
{
return (x_monnam(mtmp, ARTICLE_NONE, (char *) 0,
(has_mname(mtmp)) ? SUPPRESS_SADDLE : 0, TRUE));
return x_monnam(mtmp, ARTICLE_NONE, (char *) 0,
(has_mname(mtmp)) ? SUPPRESS_SADDLE : 0, TRUE);
}
char *
mon_nam(mtmp)
register struct monst *mtmp;
struct monst *mtmp;
{
return (x_monnam(mtmp, ARTICLE_THE, (char *) 0,
(has_mname(mtmp)) ? SUPPRESS_SADDLE : 0, FALSE));
return x_monnam(mtmp, ARTICLE_THE, (char *) 0,
(has_mname(mtmp)) ? SUPPRESS_SADDLE : 0, FALSE);
}
/* print the name as if mon_nam() was called, but assume that the player
@@ -1045,32 +1046,32 @@ register struct monst *mtmp;
*/
char *
noit_mon_nam(mtmp)
register struct monst *mtmp;
struct monst *mtmp;
{
return (x_monnam(mtmp, ARTICLE_THE, (char *) 0,
return x_monnam(mtmp, ARTICLE_THE, (char *) 0,
(has_mname(mtmp)) ? (SUPPRESS_SADDLE | SUPPRESS_IT)
: SUPPRESS_IT,
FALSE));
FALSE);
}
char *
Monnam(mtmp)
register struct monst *mtmp;
struct monst *mtmp;
{
register char *bp = mon_nam(mtmp);
*bp = highc(*bp);
return (bp);
return bp;
}
char *
noit_Monnam(mtmp)
register struct monst *mtmp;
struct monst *mtmp;
{
register char *bp = noit_mon_nam(mtmp);
*bp = highc(*bp);
return (bp);
return bp;
}
/* monster's own name */
@@ -1100,33 +1101,32 @@ struct monst *mtmp;
char *
Adjmonnam(mtmp, adj)
register struct monst *mtmp;
register const char *adj;
struct monst *mtmp;
const char *adj;
{
register char *bp =
x_monnam(mtmp, ARTICLE_THE, adj,
(has_mname(mtmp)) ? SUPPRESS_SADDLE : 0, FALSE);
char *bp = x_monnam(mtmp, ARTICLE_THE, adj,
has_mname(mtmp) ? SUPPRESS_SADDLE : 0, FALSE);
*bp = highc(*bp);
return (bp);
return bp;
}
char *
a_monnam(mtmp)
register struct monst *mtmp;
struct monst *mtmp;
{
return x_monnam(mtmp, ARTICLE_A, (char *) 0,
(has_mname(mtmp)) ? SUPPRESS_SADDLE : 0, FALSE);
has_mname(mtmp) ? SUPPRESS_SADDLE : 0, FALSE);
}
char *
Amonnam(mtmp)
register struct monst *mtmp;
struct monst *mtmp;
{
register char *bp = a_monnam(mtmp);
char *bp = a_monnam(mtmp);
*bp = highc(*bp);
return (bp);
return bp;
}
/* used for monster ID by the '/', ';', and 'C' commands to block remote
@@ -1170,7 +1170,6 @@ char *buf, *code;
return mname;
}
#define BOGUSMONSIZE 100 /* arbitrary */
/* return a random monster name, for hallucination */
char *
rndmonnam(code)
@@ -1179,6 +1178,7 @@ char *code;
static char buf[BUFSZ];
char *mname;
int name;
#define BOGUSMONSIZE 100 /* arbitrary */
if (code)
*code = '\0';
@@ -1194,8 +1194,8 @@ char *code;
mname = strcpy(buf, mons[name].mname);
}
return mname;
}
#undef BOGUSMONSIZE
}
/* check bogusmon prefix to decide whether it's a personal name */
boolean
@@ -1249,8 +1249,10 @@ const char *
rndcolor()
{
int k = rn2(CLR_MAX);
return Hallucination ? hcolor((char *) 0)
: (k == NO_COLOR) ? "colorless" : c_obj_colors[k];
: (k == NO_COLOR) ? "colorless"
: c_obj_colors[k];
}
/* Aliases for road-runner nemesis
+37 -31
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 dog.c $NHDT-Date: 1445301120 2015/10/20 00:32:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.51 $ */
/* NetHack 3.6 dog.c $NHDT-Date: 1446808440 2015/11/06 11:14:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.52 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -56,13 +56,13 @@ STATIC_OVL int
pet_type()
{
if (urole.petnum != NON_PM)
return (urole.petnum);
return urole.petnum;
else if (preferred_pet == 'c')
return (PM_KITTEN);
return PM_KITTEN;
else if (preferred_pet == 'd')
return (PM_LITTLE_DOG);
return PM_LITTLE_DOG;
else
return (rn2(2) ? PM_KITTEN : PM_LITTLE_DOG);
return rn2(2) ? PM_KITTEN : PM_LITTLE_DOG;
}
struct monst *
@@ -200,7 +200,7 @@ makedog()
mtmp = christen_monst(mtmp, petname);
initedog(mtmp);
return (mtmp);
return mtmp;
}
/* record `last move time' for all monsters prior to level save so that
@@ -743,7 +743,7 @@ register struct obj *obj;
boolean carni = carnivorous(mptr), herbi = herbivorous(mptr), starving;
if (is_quest_artifact(obj) || obj_resists(obj, 0, 95))
return (obj->cursed ? TABU : APPORT);
return obj->cursed ? TABU : APPORT;
switch (obj->oclass) {
case FOOD_CLASS:
@@ -771,7 +771,9 @@ register struct obj *obj;
&& fptr != &mons[PM_LIZARD]
&& fptr != &mons[PM_LICHEN])
? DOGFOOD
: (starving && !vegan(fptr)) ? ACCFOOD : POISON;
: (starving && !vegan(fptr))
? ACCFOOD
: POISON;
if (obj->otyp == EGG)
return stale_egg(obj) ? CADAVER : starving ? ACCFOOD : POISON;
return TABU;
@@ -783,9 +785,9 @@ register struct obj *obj;
case MEAT_RING:
case MEAT_STICK:
case HUGE_CHUNK_OF_MEAT:
return (carni ? DOGFOOD : MANFOOD);
return carni ? DOGFOOD : MANFOOD;
case EGG:
return (carni ? CADAVER : MANFOOD);
return carni ? CADAVER : MANFOOD;
case CORPSE:
if ((peek_at_iced_corpse_age(obj) + 50L <= monstermoves
&& obj->corpsenm != PM_LIZARD && obj->corpsenm != PM_LICHEN
@@ -795,57 +797,61 @@ register struct obj *obj;
return POISON;
/* turning into slime is preferable to starvation */
else if (fptr == &mons[PM_GREEN_SLIME] && !slimeproof(mon->data))
return (starving ? ACCFOOD : POISON);
return starving ? ACCFOOD : POISON;
else if (vegan(fptr))
return (herbi ? CADAVER : MANFOOD);
return herbi ? CADAVER : MANFOOD;
/* most humanoids will avoid cannibalism unless starving;
arbitrary: elves won't eat other elves even then */
else if (humanoid(mptr) && same_race(mptr, fptr)
&& (!is_undead(mptr) && fptr->mlet != S_KOBOLD
&& fptr->mlet != S_ORC && fptr->mlet != S_OGRE))
return ((starving && carni && !is_elf(mptr)) ? ACCFOOD
: TABU);
return (starving && carni && !is_elf(mptr)) ? ACCFOOD : TABU;
else
return (carni ? CADAVER : MANFOOD);
return carni ? CADAVER : MANFOOD;
case CLOVE_OF_GARLIC:
return ((is_undead(mptr) || is_vampshifter(mon))
return (is_undead(mptr) || is_vampshifter(mon))
? TABU
: ((herbi || starving) ? ACCFOOD : MANFOOD));
: (herbi || starving)
? ACCFOOD
: MANFOOD;
case TIN:
return (metallivorous(mptr) ? ACCFOOD : MANFOOD);
return metallivorous(mptr) ? ACCFOOD : MANFOOD;
case APPLE:
case CARROT:
return (herbi ? DOGFOOD : starving ? ACCFOOD : MANFOOD);
return herbi ? DOGFOOD : starving ? ACCFOOD : MANFOOD;
case BANANA:
return ((mptr->mlet == S_YETI)
return (mptr->mlet == S_YETI)
? DOGFOOD
: ((herbi || starving) ? ACCFOOD : MANFOOD));
: (herbi || starving)
? ACCFOOD
: MANFOOD;
default:
if (starving)
return ACCFOOD;
return (obj->otyp > SLIME_MOLD ? (carni ? ACCFOOD : MANFOOD)
: (herbi ? ACCFOOD : MANFOOD));
return (obj->otyp > SLIME_MOLD) ? (carni ? ACCFOOD : MANFOOD)
: (herbi ? ACCFOOD : MANFOOD);
}
default:
if (obj->otyp == AMULET_OF_STRANGULATION
|| obj->otyp == RIN_SLOW_DIGESTION)
return TABU;
if (mon_hates_silver(mon) && objects[obj->otyp].oc_material == SILVER)
return (TABU);
return TABU;
if (mptr == &mons[PM_GELATINOUS_CUBE] && is_organic(obj))
return (ACCFOOD);
return ACCFOOD;
if (metallivorous(mptr) && is_metallic(obj)
&& (is_rustprone(obj) || mptr != &mons[PM_RUST_MONSTER])) {
/* Non-rustproofed ferrous based metals are preferred. */
return ((is_rustprone(obj) && !obj->oerodeproof) ? DOGFOOD
: ACCFOOD);
return (is_rustprone(obj) && !obj->oerodeproof) ? DOGFOOD
: ACCFOOD;
}
if (!obj->cursed && obj->oclass != BALL_CLASS
if (!obj->cursed
&& obj->oclass != BALL_CLASS
&& obj->oclass != CHAIN_CLASS)
return (APPORT);
/* fall into next case */
return APPORT;
/*FALLTHRU*/
case ROCK_CLASS:
return (UNDEF);
return UNDEF;
}
}
+3 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 dokick.c $NHDT-Date: 1446191875 2015/10/30 07:57:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.102 $ */
/* NetHack 3.6 dokick.c $NHDT-Date: 1446808441 2015/11/06 11:14:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.103 $ */
/* Copyright (c) Izchak Miller, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -17,8 +17,8 @@ static NEARDATA const char *gate_str;
extern boolean notonhead; /* for long worms */
STATIC_DCL void FDECL(kickdmg, (struct monst *, BOOLEAN_P));
STATIC_DCL boolean
FDECL(maybe_kick_monster, (struct monst *, XCHAR_P, XCHAR_P));
STATIC_DCL boolean FDECL(maybe_kick_monster, (struct monst *,
XCHAR_P, XCHAR_P));
STATIC_DCL void FDECL(kick_monster, (struct monst *, XCHAR_P, XCHAR_P));
STATIC_DCL int FDECL(kick_object, (XCHAR_P, XCHAR_P));
STATIC_DCL int FDECL(really_kick_object, (XCHAR_P, XCHAR_P));
+118 -83
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 dungeon.c $NHDT-Date: 1445301123 2015/10/20 00:32:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.65 $ */
/* NetHack 3.6 dungeon.c $NHDT-Date: 1446808442 2015/11/06 11:14:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.66 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -24,10 +24,11 @@ struct proto_dungeon {
int n_brs; /* number of tmpbranch entries */
};
int n_dgns; /* number of dungeons (also used */
/* in mklev.c and do.c) */
int n_dgns; /* number of dungeons (also used in mklev.c and do.c) */
static branch *branches = (branch *) 0; /* dungeon branch list */
mapseen *mapseenchn = (struct mapseen *) 0; /*DUNGEON_OVERVIEW*/
struct lchoice {
int idx;
schar lev[MAXLINFO];
@@ -40,15 +41,15 @@ static void FDECL(Fread, (genericptr_t, int, int, dlb *));
STATIC_DCL xchar FDECL(dname_to_dnum, (const char *));
STATIC_DCL int FDECL(find_branch, (const char *, struct proto_dungeon *));
STATIC_DCL xchar FDECL(parent_dnum, (const char *, struct proto_dungeon *));
STATIC_DCL int FDECL(level_range,
(XCHAR_P, int, int, int, struct proto_dungeon *, int *));
STATIC_DCL int FDECL(level_range, (XCHAR_P, int, int, int,
struct proto_dungeon *, int *));
STATIC_DCL xchar FDECL(parent_dlevel, (const char *, struct proto_dungeon *));
STATIC_DCL int FDECL(correct_branch_type, (struct tmpbranch *));
STATIC_DCL branch *FDECL(add_branch, (int, int, struct proto_dungeon *));
STATIC_DCL void FDECL(add_level, (s_level *));
STATIC_DCL void FDECL(init_level, (int, int, struct proto_dungeon *));
STATIC_DCL int FDECL(possible_places,
(int, boolean *, struct proto_dungeon *));
STATIC_DCL int FDECL(possible_places, (int, boolean *,
struct proto_dungeon *));
STATIC_DCL xchar FDECL(pick_level, (boolean *, int));
STATIC_DCL boolean FDECL(place_level, (int, struct proto_dungeon *));
STATIC_DCL boolean FDECL(unplaced_floater, (struct dungeon *));
@@ -56,17 +57,15 @@ STATIC_DCL boolean FDECL(unreachable_level, (d_level *, BOOLEAN_P));
STATIC_DCL void FDECL(tport_menu, (winid, char *, struct lchoice *, d_level *,
BOOLEAN_P));
STATIC_DCL const char *FDECL(br_string, (int));
STATIC_DCL void FDECL(print_branch,
(winid, int, int, int, BOOLEAN_P, struct lchoice *));
mapseen *mapseenchn = (struct mapseen *) 0;
STATIC_DCL void FDECL(print_branch, (winid, int, int, int, BOOLEAN_P,
struct lchoice *));
STATIC_DCL mapseen *FDECL(load_mapseen, (int));
STATIC_DCL void FDECL(save_mapseen, (int, mapseen *));
STATIC_DCL mapseen *FDECL(find_mapseen, (d_level *));
STATIC_DCL void FDECL(print_mapseen, (winid, mapseen *, int, int, BOOLEAN_P));
STATIC_DCL boolean FDECL(interest_mapseen, (mapseen *));
STATIC_DCL void FDECL(traverse_mapseenchn,
(BOOLEAN_P, winid, int, int, int *));
STATIC_DCL void FDECL(traverse_mapseenchn, (BOOLEAN_P, winid,
int, int, int *));
STATIC_DCL const char *FDECL(seen_string, (XCHAR_P, const char *));
STATIC_DCL const char *FDECL(br_string2, (branch *));
STATIC_DCL const char *FDECL(endgamelevelname, (char *, int));
@@ -326,7 +325,7 @@ struct proto_dungeon *pd;
*/
for (pdnum = 0; strcmp(pd->tmpdungeon[pdnum].name, s); pdnum++)
if ((i -= pd->tmpdungeon[pdnum].branches) < 0)
return (pdnum);
return pdnum;
panic("parent_dnum: couldn't resolve branch.");
/*NOT REACHED*/
@@ -704,7 +703,9 @@ struct level_map {
{ X_GOAL, &nemesis_level },
{ "", (d_level *) 0 } };
void init_dungeons() /* initialize the "dungeon" structs */
/* initialize the "dungeon" structs */
void
init_dungeons()
{
dlb *dgn_file;
register int i, cl = 0, cb = 0;
@@ -970,21 +971,25 @@ void init_dungeons() /* initialize the "dungeon" structs */
#endif
}
xchar dunlev(lev) /* return the level number for lev in *this* dungeon */
/* return the level number for lev in *this* dungeon */
xchar
dunlev(lev)
d_level *lev;
{
return (lev->dlevel);
return lev->dlevel;
}
/* return the lowest level number for *this* dungeon */
xchar
dunlevs_in_dungeon(lev) /* return the lowest level number for *this* dungeon*/
dunlevs_in_dungeon(lev)
d_level *lev;
{
return (dungeons[lev->dnum].num_dunlevs);
return dungeons[lev->dnum].num_dunlevs;
}
/* return the lowest level explored in the game*/
xchar
deepest_lev_reached(noquest) /* return the lowest level explored in the game*/
deepest_lev_reached(noquest)
boolean noquest;
{
/* this function is used for three purposes: to provide a factor
@@ -1016,16 +1021,16 @@ boolean noquest;
if (depth(&tmp) > ret)
ret = depth(&tmp);
}
return ((xchar) ret);
return (xchar) ret;
}
/* return a bookkeeping level number for purpose of comparisons and
* save/restore */
save/restore */
xchar
ledger_no(lev)
d_level *lev;
{
return ((xchar)(lev->dlevel + dungeons[lev->dnum].ledger_start));
return (xchar) (lev->dlevel + dungeons[lev->dnum].ledger_start);
}
/*
@@ -1041,7 +1046,7 @@ d_level *lev;
xchar
maxledgerno()
{
return (xchar)(dungeons[n_dgns - 1].ledger_start
return (xchar) (dungeons[n_dgns - 1].ledger_start
+ dungeons[n_dgns - 1].num_dunlevs);
}
@@ -1068,11 +1073,12 @@ xchar
ledger_to_dlev(ledgerno)
xchar ledgerno;
{
return (xchar)(ledgerno - dungeons[ledger_to_dnum(ledgerno)].ledger_start);
return (xchar) (ledgerno
- dungeons[ledger_to_dnum(ledgerno)].ledger_start);
}
/* returns the depth of a level, in floors below the surface */
/* (note levels in different dungeons can have the same depth). */
/* returns the depth of a level, in floors below the surface
(note levels in different dungeons can have the same depth) */
schar
depth(lev)
d_level *lev;
@@ -1085,8 +1091,8 @@ boolean
on_level(lev1, lev2)
d_level *lev1, *lev2;
{
return (boolean) ((lev1->dnum == lev2->dnum)
&& (lev1->dlevel == lev2->dlevel));
return (boolean) (lev1->dnum == lev2->dnum
&& lev1->dlevel == lev2->dlevel);
}
/* is this level referenced in the special level chain? */
@@ -1098,7 +1104,7 @@ d_level *lev;
for (levtmp = sp_levchn; levtmp; levtmp = levtmp->next)
if (on_level(lev, &levtmp->dlevel))
return (levtmp);
return levtmp;
return (s_level *) 0;
}
@@ -1192,7 +1198,9 @@ int x, y;
u.ux0 = u.ux, u.uy0 = u.uy;
}
void u_on_rndspot(upflag) /* place you on a random location */
/* place you on a random location */
void
u_on_rndspot(upflag)
int upflag;
{
int up = (upflag & 1), was_in_W_tower = (upflag & 2);
@@ -1220,7 +1228,9 @@ int upflag;
(d_level *) 0);
}
void u_on_sstairs(upflag) /* place you on the special staircase */
/* place you on the special staircase */
void
u_on_sstairs(upflag)
int upflag;
{
if (sstairs.sx)
@@ -1229,7 +1239,9 @@ int upflag;
u_on_rndspot(upflag);
}
void u_on_upstairs() /* place you on upstairs (or special equivalent) */
/* place you on upstairs (or special equivalent) */
void
u_on_upstairs()
{
if (xupstair)
u_on_newpos(xupstair, yupstair);
@@ -1237,7 +1249,9 @@ void u_on_upstairs() /* place you on upstairs (or special equivalent) */
u_on_sstairs(0); /* destination upstairs implies moving down */
}
void u_on_dnstairs() /* place you on dnstairs (or special equivalent) */
/* place you on dnstairs (or special equivalent) */
void
u_on_dnstairs()
{
if (xdnstair)
u_on_newpos(xdnstair, ydnstair);
@@ -1249,26 +1263,27 @@ boolean
On_stairs(x, y)
xchar x, y;
{
return ((boolean)((x == xupstair && y == yupstair)
return (boolean) ((x == xupstair && y == yupstair)
|| (x == xdnstair && y == ydnstair)
|| (x == xdnladder && y == ydnladder)
|| (x == xupladder && y == yupladder)
|| (x == sstairs.sx && y == sstairs.sy)));
|| (x == sstairs.sx && y == sstairs.sy));
}
boolean
Is_botlevel(lev)
d_level *lev;
{
return ((boolean)(lev->dlevel == dungeons[lev->dnum].num_dunlevs));
return (boolean) (lev->dlevel == dungeons[lev->dnum].num_dunlevs);
}
boolean
Can_dig_down(lev)
d_level *lev;
{
return ((boolean)(!level.flags.hardfloor && !Is_botlevel(lev)
&& !Invocation_lev(lev)));
return (boolean) (!level.flags.hardfloor
&& !Is_botlevel(lev)
&& !Invocation_lev(lev));
}
/*
@@ -1280,7 +1295,7 @@ boolean
Can_fall_thru(lev)
d_level *lev;
{
return ((boolean)(Can_dig_down(lev) || Is_stronghold(lev)));
return (boolean) (Can_dig_down(lev) || Is_stronghold(lev));
}
/*
@@ -1299,9 +1314,10 @@ d_level *lev;
if (In_endgame(lev) || In_sokoban(lev)
|| (Is_wiz1_level(lev) && In_W_tower(x, y, lev)))
return FALSE;
return (boolean)(lev->dlevel > 1
return (boolean) (lev->dlevel > 1
|| (dungeons[lev->dnum].entry_lev == 1
&& ledger_no(lev) != 1 && sstairs.sx && sstairs.up));
&& ledger_no(lev) != 1
&& sstairs.sx && sstairs.up));
}
boolean
@@ -1309,7 +1325,7 @@ has_ceiling(lev)
d_level *lev;
{
/* [what about level 1 of the quest?] */
return (!Is_airlevel(lev) && !Is_waterlevel(lev));
return (boolean) (!Is_airlevel(lev) && !Is_waterlevel(lev));
}
/*
@@ -1371,16 +1387,20 @@ int levnum;
newlevel->dlevel = levnum;
}
boolean In_quest(lev) /* are you in the quest dungeon? */
/* are you in the quest dungeon? */
boolean
In_quest(lev)
d_level *lev;
{
return ((boolean)(lev->dnum == quest_dnum));
return (boolean) (lev->dnum == quest_dnum);
}
boolean In_mines(lev) /* are you in the mines dungeon? */
/* are you in the mines dungeon? */
boolean
In_mines(lev)
d_level *lev;
{
return ((boolean)(lev->dnum == mines_dnum));
return (boolean) (lev->dnum == mines_dnum);
}
/*
@@ -1426,25 +1446,30 @@ const char *s;
branch *br;
br = dungeon_branch(s);
return ((boolean)(on_level(&u.uz, &br->end1) ? TRUE : FALSE));
}
boolean In_V_tower(lev) /* is `lev' part of Vlad's tower? */
d_level *lev;
{
return ((boolean)(lev->dnum == tower_dnum));
return on_level(&u.uz, &br->end1) ? TRUE : FALSE;
}
/* is `lev' part of Vlad's tower? */
boolean
On_W_tower_level(lev) /* is `lev' a level containing the Wizard's tower? */
In_V_tower(lev)
d_level *lev;
{
return (boolean)(Is_wiz1_level(lev) || Is_wiz2_level(lev)
return (boolean) (lev->dnum == tower_dnum);
}
/* is `lev' a level containing the Wizard's tower? */
boolean
On_W_tower_level(lev)
d_level *lev;
{
return (boolean) (Is_wiz1_level(lev)
|| Is_wiz2_level(lev)
|| Is_wiz3_level(lev));
}
boolean In_W_tower(x, y,
lev) /* is <x,y> of `lev' inside the Wizard's tower? */
/* is <x,y> of `lev' inside the Wizard's tower? */
boolean
In_W_tower(x, y, lev)
int x, y;
d_level *lev;
{
@@ -1463,20 +1488,26 @@ d_level *lev;
return FALSE;
}
boolean In_hell(lev) /* are you in one of the Hell levels? */
/* are you in one of the Hell levels? */
boolean
In_hell(lev)
d_level *lev;
{
return ((boolean)(dungeons[lev->dnum].flags.hellish));
return (boolean) (dungeons[lev->dnum].flags.hellish);
}
void find_hell(lev) /* sets *lev to be the gateway to Gehennom... */
/* sets *lev to be the gateway to Gehennom... */
void
find_hell(lev)
d_level *lev;
{
lev->dnum = valley_level.dnum;
lev->dlevel = 1;
}
void goto_hell(at_stairs, falling) /* go directly to hell... */
/* go directly to hell... */
void
goto_hell(at_stairs, falling)
boolean at_stairs, falling;
{
d_level lev;
@@ -1485,14 +1516,18 @@ boolean at_stairs, falling;
goto_level(&lev, at_stairs, falling, FALSE);
}
void assign_level(dest, src) /* equivalent to dest = source */
/* equivalent to dest = source */
void
assign_level(dest, src)
d_level *dest, *src;
{
dest->dnum = src->dnum;
dest->dlevel = src->dlevel;
}
void assign_rnd_level(dest, src, range) /* dest = src + rn1(range) */
/* dest = src + rn1(range) */
void
assign_rnd_level(dest, src, range)
d_level *dest, *src;
int range;
{
@@ -1514,23 +1549,22 @@ int pct;
if (lev && lev->flags.align)
if (rn2(100) < pct)
return (lev->flags.align);
return lev->flags.align;
if (dungeons[u.uz.dnum].flags.align)
if (rn2(100) < pct)
return (dungeons[u.uz.dnum].flags.align);
return dungeons[u.uz.dnum].flags.align;
al = rn2(3) - 1;
return (Align2amask(al));
return Align2amask(al);
}
boolean
Invocation_lev(lev)
d_level *lev;
{
return (
(boolean)(In_hell(lev)
&& lev->dlevel == (dungeons[lev->dnum].num_dunlevs - 1)));
return (boolean) (In_hell(lev)
&& lev->dlevel == dungeons[lev->dnum].num_dunlevs - 1);
}
/* use instead of depth() wherever a degree of difficulty is made
@@ -2155,11 +2189,7 @@ d_level *lev;
#define INTEREST(feat) \
((feat).nfount || (feat).nsink || (feat).nthrone || (feat).naltar \
|| (feat).ngrave || (feat).ntree || (feat).nshop || (feat).ntemple)
/*
|| ((feat).water) || \
((feat).ice) || \
((feat).lava)
*/
/* || (feat).water || (feat).ice || (feat).lava */
/* returns true if this level has something interesting to print out */
STATIC_OVL boolean
@@ -2187,14 +2217,16 @@ mapseen *mptr;
have annotations or not, so that #overview doesn't become extremely
sparse once the rest of the dungeon has been flagged as unreachable */
if (In_endgame(&u.uz))
return In_endgame(&mptr->lev);
return (boolean) In_endgame(&mptr->lev);
/* level is of interest if it has non-zero feature count or known bones
or user annotation or known connection to another dungeon branch
or is the furthest level reached in its branch */
return (INTEREST(mptr->feat) || (mptr->final_resting_place
return (boolean) (INTEREST(mptr->feat)
|| (mptr->final_resting_place
&& (mptr->flags.knownbones || wizard))
|| mptr->custom || mptr->br
|| mptr->lev.dlevel == dungeons[mptr->lev.dnum].dunlev_ureached);
|| (mptr->lev.dlevel
== dungeons[mptr->lev.dnum].dunlev_ureached));
}
/* recalculate mapseen for the current level */
@@ -2331,17 +2363,20 @@ recalc_mapseen()
#if 0
case ICE:
count = mptr->feat.ice + 1;
if (count <= 3) mptr->feat.ice = count;
if (count <= 3)
mptr->feat.ice = count;
break;
case POOL:
case MOAT:
case WATER:
count = mptr->feat.water + 1;
if (count <= 3) mptr->feat.water = count;
if (count <= 3)
mptr->feat.water = count;
break;
case LAVAPOOL:
count = mptr->feat.lava + 1;
if (count <= 3) mptr->feat.lava = count;
if (count <= 3)
mptr->feat.lava = count;
break;
#endif
case TREE:
@@ -2547,9 +2582,9 @@ branch *br;
case BR_NO_END1:
return "Connection";
case BR_NO_END2:
return (br->end1_up) ? "One way stairs up" : "One way stairs down";
return br->end1_up ? "One way stairs up" : "One way stairs down";
case BR_STAIR:
return (br->end1_up) ? "Stairs up" : "Stairs down";
return br->end1_up ? "Stairs up" : "Stairs down";
}
return "(unknown)";
+33 -33
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 eat.c $NHDT-Date: 1446189655 2015/10/30 07:20:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.150 $ */
/* NetHack 3.6 eat.c $NHDT-Date: 1446808443 2015/11/06 11:14:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.151 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -653,6 +653,7 @@ register int pm;
case PM_KITTEN:
case PM_HOUSECAT:
case PM_LARGE_CAT:
/* cannibals are allowed to eat domestic animals without penalty */
if (!CANNIBAL_ALLOWED()) {
You_feel("that eating the %s was a bad idea.", mons[pm].mname);
HAggravate_monster |= FROMOUTSIDE;
@@ -956,21 +957,20 @@ register int pm;
HSee_invisible |= FROMOUTSIDE;
}
newsym(u.ux, u.uy);
/* fall into next case */
/*FALLTHRU*/
case PM_YELLOW_LIGHT:
/* fall into next case */
case PM_GIANT_BAT:
make_stunned((HStun & TIMEOUT) + 30L, FALSE);
/* fall into next case */
/*FALLTHRU*/
case PM_BAT:
make_stunned((HStun & TIMEOUT) + 30L, FALSE);
break;
case PM_GIANT_MIMIC:
tmp += 10;
/* fall into next case */
/*FALLTHRU*/
case PM_LARGE_MIMIC:
tmp += 20;
/* fall into next case */
/*FALLTHRU*/
case PM_SMALL_MIMIC:
tmp += 20;
if (youmonst.data->mlet != S_MIMIC && !Unchanging) {
@@ -984,8 +984,7 @@ register int pm;
dismount_steed(DISMOUNT_FELL);
nomul(-tmp);
multi_reason = "pretending to be a pile of gold";
Sprintf(
buf,
Sprintf(buf,
Hallucination
? "You suddenly dread being peeled and mimic %s again!"
: "You now prefer mimicking %s again.",
@@ -1548,6 +1547,7 @@ struct obj *otmp;
if (mnum != PM_ACID_BLOB && !stoneable && rotted > 5L) {
boolean cannibal = maybe_cannibal(mnum, FALSE);
pline("Ulch - that %s was tainted%s!",
mons[mnum].mlet == S_FUNGUS
? "fungoid vegetation"
@@ -1619,15 +1619,15 @@ struct obj *otmp;
You("peck the eyeball with delight.");
} else {
/* [is this right? omnivores end up always disliking the taste] */
boolean yummy =
(vegan(&mons[mnum])
? (!carnivorous(youmonst.data) && herbivorous(youmonst.data))
boolean yummy = vegan(&mons[mnum])
? (!carnivorous(youmonst.data)
&& herbivorous(youmonst.data))
: (carnivorous(youmonst.data)
&& !herbivorous(youmonst.data)));
&& !herbivorous(youmonst.data));
pline("%s%s %s!", type_is_pname(&mons[mnum])
? ""
: the_unique_pm(&mons[mnum]) ? "The " : "This ",
pline("%s%s %s!",
type_is_pname(&mons[mnum])
? "" : the_unique_pm(&mons[mnum]) ? "The " : "This ",
food_xname(otmp, FALSE),
Hallucination
? (yummy ? ((u.umonnum == PM_TIGER) ? "is gr-r-reat"
@@ -1886,8 +1886,9 @@ struct obj *otmp;
makeknown(typ);
}
break;
}
break;
} /* inner switch */
break; /* default case of outer switch */
case RIN_ADORNMENT:
accessory_has_effect(otmp);
if (adjattrib(A_CHA, otmp->spe, -1))
@@ -1916,8 +1917,8 @@ struct obj *otmp;
case RIN_PROTECTION:
accessory_has_effect(otmp);
HProtection |= FROMOUTSIDE;
u.ublessed =
bounded_increase(u.ublessed, otmp->spe, RIN_PROTECTION);
u.ublessed = bounded_increase(u.ublessed, otmp->spe,
RIN_PROTECTION);
context.botl = 1;
break;
case RIN_FREE_ACTION:
@@ -1948,8 +1949,7 @@ struct obj *otmp;
/* no message--this gives no permanent effect */
choke(otmp);
break;
case AMULET_OF_RESTFUL_SLEEP: /* another bad idea! */
{
case AMULET_OF_RESTFUL_SLEEP: { /* another bad idea! */
long newnap = (long) rnd(100), oldnap = (HSleepy & TIMEOUT);
if (!(HSleepy & FROMOUTSIDE))
@@ -1958,7 +1958,8 @@ struct obj *otmp;
/* might also be wearing one; use shorter of two timeouts */
if (newnap < oldnap || oldnap == 0L)
HSleepy = (HSleepy & ~TIMEOUT) | newnap;
} break;
break;
}
case RIN_SUSTAIN_ABILITY:
case AMULET_OF_LIFE_SAVING:
case AMULET_OF_REFLECTION: /* nice try */
@@ -2171,12 +2172,12 @@ STATIC_OVL int
edibility_prompts(otmp)
struct obj *otmp;
{
/* blessed food detection granted you a one-use
ability to detect food that is unfit for consumption
or dangerous and avoid it. */
char buf[BUFSZ], foodsmell[BUFSZ], it_or_they[QBUFSZ],
eat_it_anyway[QBUFSZ];
/* Blessed food detection grants hero a one-use
* ability to detect food that is unfit for consumption
* or dangerous and avoid it.
*/
char buf[BUFSZ], foodsmell[BUFSZ],
it_or_they[QBUFSZ], eat_it_anyway[QBUFSZ];
boolean cadaver = (otmp->otyp == CORPSE), stoneorslime = FALSE;
int material = objects[otmp->otyp].oc_material, mnum = otmp->corpsenm;
long rotted = 0L;
@@ -2210,7 +2211,6 @@ struct obj *otmp;
* These problems with food should be checked in
* order from most detrimental to least detrimental.
*/
if (cadaver && mnum != PM_ACID_BLOB && rotted > 5L && !Sick_resistance) {
/* Tainted meat */
Sprintf(buf, "%s like %s could be tainted! %s", foodsmell, it_or_they,
@@ -2334,8 +2334,8 @@ doeat()
if (u.uedibility) {
int res = edibility_prompts(otmp);
if (res) {
Your("%s stops tingling and your sense of smell returns to "
"normal.",
Your(
"%s stops tingling and your sense of smell returns to normal.",
body_part(NOSE));
u.uedibility = 0;
if (res == 1)
@@ -2564,8 +2564,8 @@ doeat()
/* possible if most has been eaten before */
context.victual.nmod = 0;
else if ((int) otmp->oeaten >= context.victual.reqtime)
context.victual.nmod =
-((int) otmp->oeaten / context.victual.reqtime);
context.victual.nmod = -((int) otmp->oeaten
/ context.victual.reqtime);
else
context.victual.nmod = context.victual.reqtime % otmp->oeaten;
context.victual.canchoke = (u.uhs == SATIATED);
+15 -14
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 lock.c $NHDT-Date: 1446604112 2015/11/04 02:28:32 $ $NHDT-Branch: master $:$NHDT-Revision: 1.65 $ */
/* NetHack 3.6 lock.c $NHDT-Date: 1446808444 2015/11/06 11:14:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.66 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -45,10 +45,12 @@ STATIC_OVL const char *
lock_action()
{
/* "unlocking"+2 == "locking" */
static const char *actions[] = { /* [0] */ "unlocking the door",
/* [1] */ "unlocking the chest",
/* [2] */ "unlocking the box",
/* [3] */ "picking the lock" };
static const char *actions[] = {
"unlocking the door", /* [0] */
"unlocking the chest", /* [1] */
"unlocking the box", /* [2] */
"picking the lock" /* [3] */
};
/* if the target is currently unlocked, we're trying to lock it now */
if (xlock.door && !(xlock.door->doormask & D_LOCKED))
@@ -191,7 +193,6 @@ forcelock(VOID_ARGS)
}
if (xlock.picktyp) { /* blade */
if (rn2(1000 - (int) uwep->spe) > (992 - greatest_erosion(uwep) * 10)
&& !uwep->cursed && !obj_resists(uwep, 0, 99)) {
/* for a +0 weapon, probability that it survives an unsuccessful
@@ -530,13 +531,6 @@ doforce()
return 1;
}
/* try to open a door */
int
doopen()
{
return doopen_indir(0, 0);
}
boolean
stumble_on_door_mimic(x, y)
int x, y;
@@ -551,6 +545,13 @@ int x, y;
return FALSE;
}
/* the 'O' command - try to open a door */
int
doopen()
{
return doopen_indir(0, 0);
}
/* try to open a door in direction u.dx/u.dy */
int
doopen_indir(x, y)
@@ -694,7 +695,7 @@ boolean quietly;
return FALSE;
}
/* try to close a door */
/* the 'C' command - try to close a door */
int
doclose()
{
+79 -76
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 makemon.c $NHDT-Date: 1445556868 2015/10/22 23:34:28 $ $NHDT-Branch: master $:$NHDT-Revision: 1.99 $ */
/* NetHack 3.6 makemon.c $NHDT-Date: 1446808445 2015/11/06 11:14:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.100 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -33,7 +33,7 @@ extern const int monstr[];
boolean
is_home_elemental(ptr)
register struct permonst *ptr;
struct permonst *ptr;
{
if (ptr->mlet == S_ELEMENTAL)
switch (monsndx(ptr)) {
@@ -54,10 +54,10 @@ register struct permonst *ptr;
*/
STATIC_OVL boolean
wrong_elem_type(ptr)
register struct permonst *ptr;
struct permonst *ptr;
{
if (ptr->mlet == S_ELEMENTAL) {
return ((boolean)(!is_home_elemental(ptr)));
return (boolean) !is_home_elemental(ptr);
} else if (Is_earthlevel(&u.uz)) {
/* no restrictions? */
} else if (Is_waterlevel(&u.uz)) {
@@ -75,7 +75,9 @@ register struct permonst *ptr;
return FALSE;
}
STATIC_OVL void m_initgrp(mtmp, x, y, n) /* make a group just like mtmp */
/* make a group just like mtmp */
STATIC_OVL void
m_initgrp(mtmp, x, y, n)
register struct monst *mtmp;
register int x, y, n;
{
@@ -165,17 +167,17 @@ register struct monst *mtmp;
register struct permonst *ptr = mtmp->data;
register int mm = monsndx(ptr);
struct obj *otmp;
int bias, spe2, w1, w2;
if (Is_rogue_level(&u.uz))
return;
/*
* first a few special cases:
*
* giants get a boulder to throw sometimes.
* First a few special cases:
* giants get a boulder to throw sometimes
* ettins get clubs
* kobolds get darts to throw
* centaurs get some sort of bow & arrows or bolts
* soldiers get all sorts of things.
* soldiers get all sorts of things
* kops get clubs & cream pies.
*/
switch (ptr->mlet) {
@@ -185,7 +187,7 @@ register struct monst *mtmp;
break;
case S_HUMAN:
if (is_mercenary(ptr)) {
int w1 = 0, w2 = 0;
w1 = w2 = 0;
switch (mm) {
case PM_WATCHMAN:
case PM_SOLDIER:
@@ -272,8 +274,6 @@ register struct monst *mtmp;
case S_ANGEL:
if (humanoid(ptr)) {
int spe2;
/* create minion stuff; can't use mongets */
otmp = mksobj(LONG_SWORD, FALSE, FALSE);
@@ -336,9 +336,9 @@ register struct monst *mtmp;
}
}
break;
case S_KOP: /* create Keystone Kops with cream pies to
* throw. As suggested by KAA. [MRS]
*/
case S_KOP:
/* create Keystone Kops with cream pies to
throw. As suggested by KAA. [MRS] */
if (!rn2(4))
m_initthrow(mtmp, CREAM_PIE, 2);
if (!rn2(3))
@@ -347,8 +347,8 @@ register struct monst *mtmp;
case S_ORC:
if (rn2(2))
(void) mongets(mtmp, ORCISH_HELM);
switch (mm != PM_ORC_CAPTAIN ? mm : rn2(2) ? PM_MORDOR_ORC
: PM_URUK_HAI) {
switch ((mm != PM_ORC_CAPTAIN) ? mm
: rn2(2) ? PM_MORDOR_ORC : PM_URUK_HAI) {
case PM_MORDOR_ORC:
if (!rn2(3))
(void) mongets(mtmp, SCIMITAR);
@@ -458,15 +458,13 @@ register struct monst *mtmp;
*/
if (!is_demon(ptr))
break;
/* fall thru */
/*FALLTHRU*/
default:
/*
* Now the general case, Some chance of getting some type
* Now the general case, some chance of getting some type
* of weapon for "normal" monsters. Certain special types
* of monsters will get a bonus chance or different selections.
*/
default: {
int bias;
bias = is_lord(ptr) + is_prince(ptr) * 2 + extra_nasty(ptr);
switch (rnd(14 - (2 * bias))) {
case 1:
@@ -502,8 +500,9 @@ register struct monst *mtmp;
default:
break;
}
} break;
break;
}
if ((int) mtmp->m_lev > rn2(75))
(void) mongets(mtmp, rnd_offensive_item(mtmp));
}
@@ -518,6 +517,7 @@ struct monst *mtmp;
long amount;
{
struct obj *gold = mksobj(GOLD_PIECE, FALSE, FALSE);
gold->quan = amount;
add_to_minv(mtmp, gold);
}
@@ -529,6 +529,7 @@ register struct monst *mtmp;
register int cnt;
register struct obj *otmp;
register struct permonst *ptr = mtmp->data;
if (Is_rogue_level(&u.uz))
return;
/*
@@ -842,8 +843,7 @@ boolean ghostly;
{
boolean result;
uchar lim = mbirth_limit(mndx);
boolean gone =
(mvitals[mndx].mvflags & G_GONE); /* genocided or extinct */
boolean gone = (mvitals[mndx].mvflags & G_GONE) != 0; /* geno'd|extinct */
result = (((int) mvitals[mndx].born < lim) && !gone) ? TRUE : FALSE;
@@ -944,7 +944,6 @@ newmextra()
return mextra;
}
boolean
makemon_rnd_goodpos(mon, gpflags, cc)
struct monst *mon;
@@ -954,12 +953,14 @@ coord *cc;
int tryct = 0;
int nx,ny;
boolean good;
do {
nx = rn1(COLNO - 3, 2);
ny = rn2(ROWNO);
if (!in_mklev && cansee(nx,ny)) good = FALSE;
else good = goodpos(nx, ny, mon, gpflags);
good = (!in_mklev && cansee(nx,ny)) ? FALSE
: goodpos(nx, ny, mon, gpflags);
} while ((++tryct < 50) && !good);
if (!good) {
/* else go through all map positions, twice, first round
ignoring positions in sight, and pick first good one.
@@ -968,12 +969,14 @@ coord *cc;
int yofs = ny;
int dx,dy;
int bl = (in_mklev || Blind) ? 1 : 0;
for ( ; bl < 2; bl++) {
for (dx = 0; dx < COLNO; dx++)
for (dy = 0; dy < ROWNO; dy++) {
nx = ((dx + xofs) % (COLNO - 1)) + 1;
ny = ((dy + yofs) % (ROWNO - 1)) + 1;
if ((bl == 0) && cansee(nx,ny)) continue;
if (bl == 0 && cansee(nx,ny))
continue;
if (goodpos(nx, ny, mon, gpflags))
goto gotgood;
}
@@ -1017,7 +1020,7 @@ struct monst *
makemon(ptr, x, y, mmflags)
register struct permonst *ptr;
register int x, y;
register int mmflags;
int mmflags;
{
register struct monst *mtmp;
int mndx, mcham, ct, mitem;
@@ -1033,8 +1036,9 @@ register int mmflags;
struct monst fakemon;
fakemon.data = ptr; /* set up for goodpos */
if (!makemon_rnd_goodpos(ptr ? &fakemon : (struct monst *)0, gpflags, &cc))
return ((struct monst *) 0);
if (!makemon_rnd_goodpos(ptr ? &fakemon : (struct monst *)0,
gpflags, &cc))
return (struct monst *) 0;
x = cc.x;
y = cc.y;
} else if (byyou && !in_mklev) {
@@ -1044,7 +1048,7 @@ register int mmflags;
x = bypos.x;
y = bypos.y;
} else
return ((struct monst *) 0);
return (struct monst *) 0;
}
/* Does monster already exist at the position? */
@@ -1055,9 +1059,9 @@ register int mmflags;
x = bypos.x;
y = bypos.y;
} else
return ((struct monst *) 0);
return (struct monst *) 0;
} else
return ((struct monst *) 0);
return (struct monst *) 0;
}
if (ptr) {
@@ -1065,7 +1069,7 @@ register int mmflags;
/* if you are to make a specific monster and it has
already been genocided, return */
if (mvitals[mndx].mvflags & G_GENOD)
return ((struct monst *) 0);
return (struct monst *) 0;
if (wizard && (mvitals[mndx].mvflags & G_EXTINCT))
debugpline1("Explicitly creating extinct monster %s.",
mons[mndx].mname);
@@ -1081,7 +1085,7 @@ register int mmflags;
do {
if (!(ptr = rndmonst())) {
debugpline0("Warning: no monster.");
return ((struct monst *) 0); /* no more monsters! */
return (struct monst *) 0; /* no more monsters! */
}
fakemon.data = ptr; /* set up for goodpos */
} while (++tryct <= 50
@@ -1227,8 +1231,9 @@ register int mmflags;
(void) mongets(mtmp, mitem);
if (in_mklev) {
if (((is_ndemon(ptr)) || (mndx == PM_WUMPUS) || (mndx == PM_LONG_WORM)
|| (mndx == PM_GIANT_EEL)) && !u.uhave.amulet && rn2(5))
if ((is_ndemon(ptr) || mndx == PM_WUMPUS
|| mndx == PM_LONG_WORM || mndx == PM_GIANT_EEL)
&& !u.uhave.amulet && rn2(5))
mtmp->msleeping = TRUE;
} else {
if (byyou) {
@@ -1246,8 +1251,7 @@ register int mmflags;
if (mndx == PM_LONG_WORM && (mtmp->wormno = get_wormno()) != 0)
#else
/* DICE 3.0 doesn't like assigning and comparing mtmp->wormno in the
* same expression.
*/
same expression. */
if (mndx == PM_LONG_WORM
&& (mtmp->wormno = get_wormno(), mtmp->wormno != 0))
#endif
@@ -1310,7 +1314,7 @@ register int mmflags;
if (!in_mklev)
newsym(mtmp->mx, mtmp->my); /* make sure the mon shows up */
return (mtmp);
return mtmp;
}
int
@@ -1365,9 +1369,9 @@ int mndx;
if (mvitals[mndx].mvflags & G_GONE)
return TRUE;
if (Inhell)
return (mons[mndx].maligntyp > A_NEUTRAL);
return (boolean) (mons[mndx].maligntyp > A_NEUTRAL);
else
return ((mons[mndx].geno & G_HELL) != 0);
return (boolean) ((mons[mndx].geno & G_HELL) != 0);
}
/*
@@ -1446,11 +1450,9 @@ rndmonst()
elemlevel = In_endgame(&u.uz) && !Is_astralevel(&u.uz);
/*
* Find out how many monsters exist in the range we have
*selected.
* Find out how many monsters exist in the range we have selected.
*/
/* (`mndx' initialized above) */
for (; mndx < SPECIAL_PM; mndx++) {
for ( ; mndx < SPECIAL_PM; mndx++) { /* (`mndx' initialized above) */
ptr = &mons[mndx];
rndmonst_state.mchoices[mndx] = 0;
if (tooweak(mndx, minmlev) || toostrong(mndx, maxmlev))
@@ -1532,13 +1534,11 @@ int mndx, mvflagsmask, genomask;
return TRUE;
}
/* The routine below is used to make one of the multiple types
* of a given monster class. The second parameter specifies a
* special casing bit mask to allow the normal genesis
* masks to be deactivated. Returns 0 if no monsters
* in that class can be made.
/* Make one of the multiple types of a given monster class.
* The second parameter specifies a special casing bit mask
* to allow the normal genesis masks to be deactivated.
* Returns Null if no monsters in that class can be made.
*/
struct permonst *
mkclass(class, spc)
char class;
@@ -1550,7 +1550,7 @@ int spc;
maxmlev = level_difficulty() >> 1;
if (class < 1 || class >= MAXMCLASSES) {
impossible("mkclass called with bad class!");
return ((struct permonst *) 0);
return (struct permonst *) 0;
}
/* Assumption #1: monsters of a given class are contiguous in the
* mons[] array.
@@ -1569,9 +1569,8 @@ int spc;
break;
num += mons[last].geno & G_FREQ;
}
if (!num)
return ((struct permonst *) 0);
return (struct permonst *) 0;
/* Assumption #2: monsters of a given class are presented in ascending
* order of strength.
@@ -1588,14 +1587,15 @@ int spc;
}
first--; /* correct an off-by-one error */
return (&mons[first]);
return &mons[first];
}
/* like mkclass(), but excludes difficulty considerations; used when
player with polycontrol picks a class instead of a specific type;
genocided types are avoided but extinct ones are acceptable; we don't
check polyok() here--caller accepts some choices !polyok() would reject */
int mkclass_poly(class)
int
mkclass_poly(class)
int class;
{
register int first, last, num = 0;
@@ -1620,7 +1620,9 @@ int class;
return first;
}
int adj_lev(ptr) /* adjust strength of monsters based on u.uz and u.ulevel */
/* adjust strength of monsters based on u.uz and u.ulevel */
int
adj_lev(ptr)
register struct permonst *ptr;
{
int tmp, tmp2;
@@ -1636,7 +1638,7 @@ register struct permonst *ptr;
}
if ((tmp = ptr->mlevel) > 49)
return (50); /* "special" demons/devils */
return 50; /* "special" demons/devils */
tmp2 = (level_difficulty() - tmp);
if (tmp2 < 0)
tmp--; /* if mlevel > u.uz decrement tmp */
@@ -1653,8 +1655,10 @@ register struct permonst *ptr;
return ((tmp > tmp2) ? tmp2 : (tmp > 0 ? tmp : 0)); /* 0 lower limit */
}
/* monster earned experience and will gain some hit points; it might also
grow into a bigger monster (baby to adult, soldier to officer, etc) */
struct permonst *
grow_up(mtmp, victim) /* `mtmp' might "grow up" into a bigger version */
grow_up(mtmp, victim)
struct monst *mtmp, *victim;
{
int oldtype, newtype, max_increase, cur_increase, lev_limit, hp_threshold;
@@ -1663,7 +1667,7 @@ struct monst *mtmp, *victim;
/* monster died after killing enemy but before calling this function */
/* currently possible if killing a gas spore */
if (mtmp->mhp <= 0)
return ((struct permonst *) 0);
return (struct permonst *) 0;
/* note: none of the monsters with special hit point calculations
have both little and big forms */
@@ -1755,7 +1759,7 @@ struct monst *mtmp, *victim;
int
mongets(mtmp, otyp)
register struct monst *mtmp;
register int otyp;
int otyp;
{
register struct obj *otmp;
int spe;
@@ -1800,9 +1804,9 @@ register int otyp;
spe = otmp->spe;
(void) mpickobj(mtmp, otmp); /* might free otmp */
return (spe);
} else
return (0);
return spe;
}
return 0;
}
int
@@ -1839,7 +1843,7 @@ int type;
/*
* Alignment vs. yours determines monster's attitude to you.
* ( some "animal" types are co-aligned, but also hungry )
* (Some "animal" types are co-aligned, but also hungry.)
*/
boolean
peace_minded(ptr)
@@ -1872,15 +1876,15 @@ register struct permonst *ptr;
/* minions are hostile to players that have strayed at all */
if (is_minion(ptr))
return ((boolean)(u.ualign.record >= 0));
return (boolean) (u.ualign.record >= 0);
/* Last case: a chance of a co-aligned monster being
* hostile. This chance is greater if the player has strayed
* (u.ualign.record negative) or the monster is not strongly aligned.
*/
return (
(boolean)(!!rn2(16 + (u.ualign.record < -15 ? -15 : u.ualign.record))
&& !!rn2(2 + abs(mal))));
return (boolean) (!!rn2(16 + (u.ualign.record < -15 ? -15
: u.ualign.record))
&& !!rn2(2 + abs(mal)));
}
/* Set malign to have the proper effect on player alignment if monster is
@@ -1890,8 +1894,8 @@ register struct permonst *ptr;
* greater than the bonus for killing a hostile monster to maintain balance.
* Rules:
* it's bad to kill peaceful monsters, potentially worse to kill always-
* peaceful monsters
* it's never bad to kill a hostile monster, although it may not be good
* peaceful monsters;
* it's never bad to kill a hostile monster, although it may not be good.
*/
void
set_malign(mtmp)
@@ -2085,8 +2089,7 @@ register struct monst *mtmp;
}
}
/* release a monster from a bag of tricks; return number of monsters created
*/
/* release monster frome bag of tricks; return number of monsters created */
int
bagotricks(bag, tipping, seencount)
struct obj *bag;
+3 -5
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 monmove.c $NHDT-Date: 1446604115 2015/11/04 02:28:35 $ $NHDT-Branch: master $:$NHDT-Revision: 1.77 $ */
/* NetHack 3.6 monmove.c $NHDT-Date: 1446808446 2015/11/06 11:14:06 $ $NHDT-Branch: master $:$NHDT-Revision: 1.78 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -567,13 +567,11 @@ toofar:
if (tmp != 2)
distfleeck(mtmp, &inrange, &nearby, &scared); /* recalc */
switch (tmp) {
switch (tmp) { /* for pets, cases 0 and 3 are equivalent */
case 0: /* no movement, but it can still attack you */
case 3: /* absolutely no movement */
/* for pets, case 0 and 3 are equivalent */
/* vault guard might have vanished */
if (mtmp->isgd
&& (mtmp->mhp < 1 || (mtmp->mx == 0 && mtmp->my == 0)))
if (mtmp->isgd && (mtmp->mhp < 1 || !mtmp->mx == 0))
return 1; /* behave as if it died */
/* During hallucination, monster appearance should
* still change - even if it doesn't move.
+4 -4
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 mthrowu.c $NHDT-Date: 1446604116 2015/11/04 02:28:36 $ $NHDT-Branch: master $:$NHDT-Revision: 1.61 $ */
/* NetHack 3.6 mthrowu.c $NHDT-Date: 1446808447 2015/11/06 11:14:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.62 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -135,9 +135,9 @@ int
ohitmon(mtmp, otmp, range, verbose)
struct monst *mtmp; /* accidental target, located at <bhitpos.x,.y> */
struct obj *otmp; /* missile; might be destroyed by drop_throw */
int range; /* how much farther will object travel if it misses */
/* Use -1 to signify to keep going even after hit, */
/* unless its gone (used for rolling_boulder_traps) */
int range; /* how much farther will object travel if it misses;
use -1 to signify to keep going even after hit,
unless it's gone (used for rolling_boulder_traps) */
boolean verbose; /* give message(s) even when you can't see what happened */
{
int damage, tmp;
+17 -18
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 music.c $NHDT-Date: 1432512773 2015/05/25 00:12:53 $ $NHDT-Branch: master $:$NHDT-Revision: 1.38 $ */
/* NetHack 3.6 music.c $NHDT-Date: 1446808448 2015/11/06 11:14:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.40 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
@@ -12,8 +12,7 @@
* magic flute may put monsters to sleep: area of effect depends
* on player level.
* (tooled) horn Will awaken monsters: area of effect depends on
*player
* level. May also scare monsters.
* player level. May also scare monsters.
* fire horn Acts like a wand of fire.
* frost horn Acts like a wand of cold.
* bugle Will awaken soldiers (if any): area of effect depends
@@ -73,7 +72,8 @@ int distance;
mtmp->mcanmove = 1;
mtmp->mfrozen = 0;
/* may scare some monsters -- waiting monsters excluded */
if (!unique_corpstat(mtmp->data) && (mtmp->mstrategy & STRAT_WAITMASK) != 0)
if (!unique_corpstat(mtmp->data)
&& (mtmp->mstrategy & STRAT_WAITMASK) != 0)
mtmp->mstrategy &= ~STRAT_WAITMASK;
else if (distm < distance / 3
&& !resist(mtmp, TOOL_CLASS, 0, NOTELL))
@@ -195,7 +195,8 @@ struct monst *bugler; /* monster that played instrument */
mtmp->mcanmove = 1;
mtmp->mfrozen = 0;
/* may scare some monsters -- waiting monsters excluded */
if (!unique_corpstat(mtmp->data) && (mtmp->mstrategy & STRAT_WAITMASK) != 0)
if (!unique_corpstat(mtmp->data)
&& (mtmp->mstrategy & STRAT_WAITMASK) != 0)
mtmp->mstrategy &= ~STRAT_WAITMASK;
else if (distm < distance / 3
&& !resist(mtmp, TOOL_CLASS, 0, NOTELL))
@@ -207,7 +208,6 @@ struct monst *bugler; /* monster that played instrument */
/* Charm monsters in range. Note that they may resist the spell.
* If swallowed, range is reduced to 0.
*/
STATIC_OVL void
charm_monsters(distance)
int distance;
@@ -234,7 +234,6 @@ int distance;
/* Generate earthquake :-) of desired force.
* That is: create random chasms (pits).
*/
STATIC_OVL void
do_earthquake(force)
int force;
@@ -338,7 +337,6 @@ int force;
/* We have to check whether monsters or player
falls in a chasm... */
if (mtmp) {
if (!is_flyer(mtmp->data)
&& !is_clinger(mtmp->data)) {
@@ -431,7 +429,6 @@ int force;
/*
* The player is trying to extract something from his/her instrument.
*/
STATIC_OVL int
do_improvisation(instr)
struct obj *instr;
@@ -497,9 +494,9 @@ struct obj *instr;
} else if (!u.dx && !u.dy && !u.dz) {
if ((damage = zapyourself(instr, TRUE)) != 0) {
char buf[BUFSZ];
Sprintf(buf, "using a magical horn on %sself", uhim());
losehp(damage, buf, KILLED_BY); /* frost damage */
/* fire damage */
losehp(damage, buf, KILLED_BY); /* fire or frost damage */
}
} else {
buzz((instr->otyp == FROST_HORN) ? AD_COLD - 1 : AD_FIRE - 1,
@@ -563,7 +560,6 @@ struct obj *instr;
/*
* So you want music...
*/
int
do_play_instrument(instr)
struct obj *instr;
@@ -575,13 +571,13 @@ struct obj *instr;
if (Underwater) {
You_cant("play music underwater!");
return (0);
return 0;
} else if ((instr->otyp == WOODEN_FLUTE || instr->otyp == MAGIC_FLUTE
|| instr->otyp == TOOLED_HORN || instr->otyp == FROST_HORN
|| instr->otyp == FIRE_HORN || instr->otyp == BUGLE)
&& !can_blow(&youmonst)) {
You("are incapable of playing %s.", the(distant_name(instr, xname)));
return (0);
return 0;
}
if (instr->otyp != LEATHER_DRUM && instr->otyp != DRUM_OF_EARTHQUAKE) {
c = ynq("Improvise?");
@@ -634,6 +630,7 @@ struct obj *instr;
{
char nbuf[20];
int i;
for (i = 0; buf[i] && i < 5; ++i) {
nbuf[i * 2] = buf[i];
nbuf[(i * 2) + 1] = 'h';
@@ -799,9 +796,9 @@ char *buf;
#define noDEBUG
/* emit tone of frequency hz for given number of ticks */
STATIC_OVL void
tone(hz, ticks)
/* emit tone of frequency hz for given number of ticks */
unsigned int hz, ticks;
{
ioctl(0, KDMKTONE, hz | ((ticks * 10) << 16));
@@ -811,9 +808,9 @@ unsigned int hz, ticks;
nap(ticks * 10);
}
/* rest for given number of ticks */
STATIC_OVL void
rest(ticks)
/* rest for given number of ticks */
int ticks;
{
nap(ticks * 10);
@@ -852,8 +849,10 @@ char *buf;
playstring(buf, strlen(buf));
}
#ifdef DEBUG
main(argc, argv) char *argv[];
#ifdef VPIX_DEBUG
main(argc, argv)
int argc;
char *argv[];
{
if (argc == 2) {
playinit();
+96 -86
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 options.c $NHDT-Date: 1446336796 2015/11/01 00:13:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.234 $ */
/* NetHack 3.6 options.c $NHDT-Date: 1446808448 2015/11/06 11:14:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.235 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -493,8 +493,8 @@ STATIC_DCL int FDECL(change_inv_order, (char *));
STATIC_DCL void FDECL(oc_to_str, (char *, char *));
STATIC_DCL int FDECL(feature_alert_opts, (char *, const char *));
STATIC_DCL const char *FDECL(get_compopt_value, (const char *, char *));
STATIC_DCL boolean
FDECL(special_handling, (const char *, BOOLEAN_P, BOOLEAN_P));
STATIC_DCL boolean FDECL(special_handling, (const char *,
BOOLEAN_P, BOOLEAN_P));
STATIC_DCL void FDECL(warning_opts, (char *, const char *));
STATIC_DCL boolean FDECL(duplicate_opt_detection, (const char *, int));
STATIC_DCL void FDECL(complain_about_duplicate, (const char *, int));
@@ -525,7 +525,8 @@ reglyph_darkroom()
for (y = 0; y < ROWNO; y++) {
struct rm *lev = &levl[x][y];
if (!flags.dark_room || !iflags.use_color || Is_rogue_level(&u.uz)) {
if (!flags.dark_room || !iflags.use_color
|| Is_rogue_level(&u.uz)) {
if (lev->glyph == cmap_to_glyph(S_darkroom))
lev->glyph = lev->waslit ? cmap_to_glyph(S_room)
: cmap_to_glyph(S_stone);
@@ -1069,8 +1070,8 @@ const char *optn;
if (!initial) {
Sprintf(buf, "%lu.%lu.%lu", FEATURE_NOTICE_VER_MAJ,
FEATURE_NOTICE_VER_MIN, FEATURE_NOTICE_VER_PATCH);
pline("Feature change alerts disabled for NetHack %s features and "
"prior.",
pline(
"Feature change alerts disabled for NetHack %s features and prior.",
buf);
}
return 1;
@@ -1240,7 +1241,7 @@ int clr;
for (i = 0; i < SIZE(colornames); i++)
if (colornames[i].color == clr)
return colornames[i].name;
return NULL;
return (char *) 0;
}
const char *
@@ -1252,7 +1253,7 @@ int attr;
for (i = 0; i < SIZE(attrnames); i++)
if (attrnames[i].attr == attr)
return attrnames[i].name;
return NULL;
return (char *) 0;
}
int
@@ -1334,7 +1335,7 @@ int typ;
for (i = 0; i < SIZE(msgtype_names); i++)
if (msgtype_names[i].descr && msgtype_names[i].msgtyp == typ)
return msgtype_names[i].name;
return NULL;
return (char *) 0;
}
int
@@ -1379,6 +1380,7 @@ char *pattern;
tmp->regex = regex_init();
if (!regex_compile(pattern, tmp->regex)) {
static const char *re_error = "MSGTYPE regex error";
if (!iflags.window_inited)
raw_printf("\n%s: %s\n", re_error, regex_error_desc(tmp->regex));
else
@@ -1397,17 +1399,15 @@ char *pattern;
void
msgtype_free()
{
struct plinemsg_type *tmp = plinemsg_types;
struct plinemsg_type *tmp2;
struct plinemsg_type *tmp, *tmp2 = 0;
while (tmp) {
free(tmp->pattern);
for (tmp = plinemsg_types; tmp; tmp = tmp2) {
tmp2 = tmp->next;
free((genericptr_t) tmp->pattern);
regex_free(tmp->regex);
tmp2 = tmp;
tmp = tmp->next;
free(tmp2);
free((genericptr_t) tmp);
}
plinemsg_types = NULL;
plinemsg_types = (struct plinemsg_type *) 0;
}
void
@@ -1420,9 +1420,10 @@ int idx; /* 0 .. */
while (tmp) {
if (idx == 0) {
struct plinemsg_type *next = tmp->next;
regex_free(tmp->regex);
free(tmp->pattern);
free(tmp);
free((genericptr_t) tmp->pattern);
free((genericptr_t) tmp);
if (prev)
prev->next = next;
else
@@ -1442,7 +1443,8 @@ const char *msg;
struct plinemsg_type *tmp = plinemsg_types;
while (tmp) {
if (regex_match(msg, tmp->regex)) return tmp->msgtype;
if (regex_match(msg, tmp->regex))
return tmp->msgtype;
tmp = tmp->next;
}
return MSGTYP_NORMAL;
@@ -1471,6 +1473,7 @@ char *str;
if (sscanf(str, "%10s \"%255[^\"]\"", msgtype, pattern) == 2) {
int typ = -1;
int i;
for (i = 0; i < SIZE(msgtype_names); i++)
if (!strncmpi(msgtype_names[i].name, msgtype, strlen(msgtype))) {
typ = msgtype_names[i].msgtyp;
@@ -1492,7 +1495,7 @@ int c, a;
if (!str)
return FALSE;
tmp = (struct menucoloring *) alloc(sizeof(struct menucoloring));
tmp = (struct menucoloring *) alloc(sizeof (struct menucoloring));
tmp->match = regex_init();
if (!regex_compile(str, tmp->match)) {
if (!iflags.window_inited)
@@ -1598,9 +1601,10 @@ free_menu_coloring()
while (tmp) {
struct menucoloring *tmp2 = tmp->next;
regex_free(tmp->match);
free(tmp->origstr);
free(tmp);
free((genericptr_t) tmp->origstr);
free((genericptr_t) tmp);
tmp = tmp2;
}
}
@@ -1615,9 +1619,10 @@ int idx; /* 0 .. */
while (tmp) {
if (idx == 0) {
struct menucoloring *next = tmp->next;
regex_free(tmp->match);
free(tmp->origstr);
free(tmp);
free((genericptr_t) tmp->origstr);
free((genericptr_t) tmp);
if (prev)
prev->next = next;
else
@@ -2054,6 +2059,7 @@ boolean tinitial, tfrom_file;
/* allow option to be silently ignored by non-tty ports */
#ifdef TTY_GRAPHICS
int tmp;
if (duplicate)
complain_about_duplicate(opts, 1);
if (!(op = string_for_opt(opts, TRUE))) {
@@ -2244,8 +2250,8 @@ boolean tinitial, tfrom_file;
if (match_optname(opts, "fruit", 2, TRUE)) {
struct fruit *forig = 0;
char empty_str = '\0';
if (duplicate)
complain_about_duplicate(opts, 1);
op = string_for_opt(opts, negated);
@@ -3186,6 +3192,7 @@ boolean tinitial, tfrom_file;
fullname = "DECgraphics";
if (match_optname(opts, fullname, 3, TRUE)) {
boolean badflag = FALSE;
if (duplicate)
complain_about_duplicate(opts, 1);
if (!negated) {
@@ -3212,6 +3219,7 @@ boolean tinitial, tfrom_file;
if (match_optname(opts, fullname, 3, TRUE)) {
const char *sym_name = fullname;
boolean badflag = FALSE;
if (duplicate)
complain_about_duplicate(opts, 1);
if (!negated) {
@@ -3246,6 +3254,7 @@ boolean tinitial, tfrom_file;
fullname = "MACgraphics";
if (match_optname(opts, fullname, 3, TRUE)) {
boolean badflag = FALSE;
if (duplicate)
complain_about_duplicate(opts, 1);
if (!negated) {
@@ -3271,6 +3280,7 @@ boolean tinitial, tfrom_file;
return;
}
#endif
/* OK, if we still haven't recognized the option, check the boolean
* options list
*/
@@ -3638,25 +3648,25 @@ doset()
*/
for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) {
opt_indx = pick_list[pick_idx].item.a_int - 1;
if (opt_indx == -2) { /* -3 due to -1 offset for select_menu() */
if (opt_indx == -2) {
/* -2 due to -1 offset for select_menu() */
(void) special_handling("autopickup_exception", setinitial,
fromfile);
} else
#ifdef STATUS_VIA_WINDOWPORT
#ifdef STATUS_HILITES
if (opt_indx
== -3) { /* -3 due to -1 offset for select_menu() */
if (!status_hilite_menu())
} else if (opt_indx == -3) {
/* -3 due to -1 offset for select_menu() */
if (!status_hilite_menu()) {
pline("Bad status hilite(s) specified.");
else {
} else {
if (wc2_supported("status_hilites"))
preference_update("status_hilites");
}
} else
#endif
#endif
if (opt_indx == -4) {
(void) special_handling("menucolors", setinitial, fromfile);
} else if (opt_indx == -4) {
(void) special_handling("menucolors", setinitial,
fromfile);
} else if (opt_indx == -5) {
(void) special_handling("msgtype", setinitial, fromfile);
} else if (opt_indx < boolcount) {
@@ -4091,7 +4101,8 @@ boolean setinitial, setfromfile;
mt_idx = 0;
while (tmp) {
const char *mtype = msgtype2name(tmp->msgtype);
any.a_int = (++mt_idx);
any.a_int = ++mt_idx;
Sprintf(mtbuf, "%-5s \"%s\"", mtype, tmp->pattern);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, mtbuf,
MENU_UNSELECTED);
@@ -4100,8 +4111,9 @@ boolean setinitial, setfromfile;
Sprintf(mtbuf, "%s message types",
(opt_idx == 1) ? "List of" : "Remove which");
end_menu(tmpwin, mtbuf);
pick_cnt = select_menu(
tmpwin, (opt_idx == 1) ? PICK_NONE : PICK_ANY, &pick_list);
pick_cnt = select_menu(tmpwin,
(opt_idx == 1) ? PICK_NONE : PICK_ANY,
&pick_list);
if (pick_cnt > 0) {
for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx)
free_one_msgtype(pick_list[pick_idx].item.a_int - 1
@@ -4535,8 +4547,7 @@ char *buf;
else if (!strcmp(optname, "horsename"))
Sprintf(buf, "%s", horsename[0] ? horsename : none);
else if (!strcmp(optname, "map_mode"))
Sprintf(
buf, "%s",
Sprintf(buf, "%s",
iflags.wc_map_mode == MAP_MODE_TILES
? "tiles"
: iflags.wc_map_mode == MAP_MODE_ASCII4x6
@@ -4547,11 +4558,9 @@ char *buf;
? "ascii8x8"
: iflags.wc_map_mode == MAP_MODE_ASCII16x8
? "ascii16x8"
: iflags.wc_map_mode
== MAP_MODE_ASCII7x12
: iflags.wc_map_mode == MAP_MODE_ASCII7x12
? "ascii7x12"
: iflags.wc_map_mode
== MAP_MODE_ASCII8x12
: iflags.wc_map_mode == MAP_MODE_ASCII8x12
? "ascii8x12"
: iflags.wc_map_mode
== MAP_MODE_ASCII16x12
@@ -4561,9 +4570,7 @@ char *buf;
? "ascii12x16"
: iflags.wc_map_mode
== MAP_MODE_ASCII10x18
? "asci"
"i10x"
"18"
? "ascii10x18"
: iflags.wc_map_mode
== MAP_MODE_ASCII_FIT_TO_SCREEN
? "fit_to_screen"
@@ -4623,17 +4630,16 @@ char *buf;
: Cmd.swap_yz ? 5 : 0;
Strcpy(buf, numpadmodes[indx]);
} else if (!strcmp(optname, "objects"))
} else if (!strcmp(optname, "objects")) {
Sprintf(buf, "%s", to_be_done);
else if (!strcmp(optname, "packorder")) {
} else if (!strcmp(optname, "packorder")) {
oc_to_str(flags.inv_order, ocl);
Sprintf(buf, "%s", ocl);
}
#ifdef CHANGE_COLOR
else if (!strcmp(optname, "palette"))
} else if (!strcmp(optname, "palette")) {
Sprintf(buf, "%s", get_color_string());
#endif
else if (!strcmp(optname, "paranoid_confirmation")) {
} else if (!strcmp(optname, "paranoid_confirmation")) {
char tmpbuf[QBUFSZ];
tmpbuf[0] = '\0';
@@ -4652,36 +4658,33 @@ char *buf;
if (ParanoidRemove)
Strcat(tmpbuf, " Remove");
Strcpy(buf, tmpbuf[0] ? &tmpbuf[1] : "none");
} else if (!strcmp(optname, "pettype"))
Sprintf(buf, "%s",
(preferred_pet == 'c')
? "cat"
: (preferred_pet == 'd')
? "dog"
: (preferred_pet == 'h')
? "horse"
: (preferred_pet == 'n') ? "none" : "random");
else if (!strcmp(optname, "pickup_burden"))
} else if (!strcmp(optname, "pettype")) {
Sprintf(buf, "%s", (preferred_pet == 'c') ? "cat"
: (preferred_pet == 'd') ? "dog"
: (preferred_pet == 'h') ? "horse"
: (preferred_pet == 'n') ? "none"
: "random");
} else if (!strcmp(optname, "pickup_burden")) {
Sprintf(buf, "%s", burdentype[flags.pickup_burden]);
else if (!strcmp(optname, "pickup_types")) {
} else if (!strcmp(optname, "pickup_types")) {
oc_to_str(flags.pickup_types, ocl);
Sprintf(buf, "%s", ocl[0] ? ocl : "all");
} else if (!strcmp(optname, "pile_limit"))
} else if (!strcmp(optname, "pile_limit")) {
Sprintf(buf, "%d", flags.pile_limit);
else if (!strcmp(optname, "playmode")) {
} else if (!strcmp(optname, "playmode")) {
Strcpy(buf, wizard ? "debug" : discover ? "explore" : "normal");
} else if (!strcmp(optname, "race"))
} else if (!strcmp(optname, "race")) {
Sprintf(buf, "%s", rolestring(flags.initrace, races, noun));
else if (!strcmp(optname, "roguesymset")) {
} else if (!strcmp(optname, "roguesymset")) {
Sprintf(buf, "%s",
symset[ROGUESET].name ? symset[ROGUESET].name : "default");
if (currentgraphics == ROGUESET && symset[ROGUESET].name)
Strcat(buf, ", active");
} else if (!strcmp(optname, "role"))
} else if (!strcmp(optname, "role")) {
Sprintf(buf, "%s", rolestring(flags.initrole, roles, name.m));
else if (!strcmp(optname, "runmode"))
} else if (!strcmp(optname, "runmode")) {
Sprintf(buf, "%s", runmodes[flags.runmode]);
else if (!strcmp(optname, "scores")) {
} else if (!strcmp(optname, "scores")) {
Sprintf(buf, "%d top/%d around%s", flags.end_top, flags.end_around,
flags.end_own ? "/own" : "");
} else if (!strcmp(optname, "scroll_amount")) {
@@ -4696,19 +4699,20 @@ char *buf;
Strcpy(buf, defopt);
} else if (!strcmp(optname, "sortloot")) {
char *sortname = (char *) NULL;
for (i = 0; i < SIZE(sortltype) && sortname == (char *) NULL; i++) {
if (flags.sortloot == sortltype[i][0])
sortname = (char *) sortltype[i];
}
if (sortname != (char *) NULL)
Sprintf(buf, "%s", sortname);
} else if (!strcmp(optname, "player_selection"))
} else if (!strcmp(optname, "player_selection")) {
Sprintf(buf, "%s", iflags.wc_player_selection ? "prompts" : "dialog");
#ifdef MSDOS
else if (!strcmp(optname, "soundcard"))
} else if (!strcmp(optname, "soundcard")) {
Sprintf(buf, "%s", to_be_done);
#endif
else if (!strcmp(optname, "suppress_alert")) {
} else if (!strcmp(optname, "suppress_alert")) {
if (flags.suppress_alert == 0L)
Strcpy(buf, none);
else
@@ -4719,10 +4723,10 @@ char *buf;
symset[PRIMARY].name ? symset[PRIMARY].name : "default");
if (currentgraphics == PRIMARY && symset[PRIMARY].name)
Strcat(buf, ", active");
} else if (!strcmp(optname, "tile_file"))
} else if (!strcmp(optname, "tile_file")) {
Sprintf(buf, "%s",
iflags.wc_tile_file ? iflags.wc_tile_file : defopt);
else if (!strcmp(optname, "tile_height")) {
} else if (!strcmp(optname, "tile_height")) {
if (iflags.wc_tile_height)
Sprintf(buf, "%d", iflags.wc_tile_height);
else
@@ -4732,22 +4736,21 @@ char *buf;
Sprintf(buf, "%d", iflags.wc_tile_width);
else
Strcpy(buf, defopt);
} else if (!strcmp(optname, "traps"))
} else if (!strcmp(optname, "traps")) {
Sprintf(buf, "%s", to_be_done);
else if (!strcmp(optname, "vary_msgcount")) {
} else if (!strcmp(optname, "vary_msgcount")) {
if (iflags.wc_vary_msgcount)
Sprintf(buf, "%d", iflags.wc_vary_msgcount);
else
Strcpy(buf, defopt);
}
#ifdef MSDOS
else if (!strcmp(optname, "video"))
} else if (!strcmp(optname, "video")) {
Sprintf(buf, "%s", to_be_done);
#endif
#ifdef VIDEOSHADES
else if (!strcmp(optname, "videoshades"))
} else if (!strcmp(optname, "videoshades")) {
Sprintf(buf, "%s-%s-%s", shade[0], shade[1], shade[2]);
else if (!strcmp(optname, "videocolors"))
} else if (!strcmp(optname, "videocolors")) {
Sprintf(buf, "%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d-%d",
ttycolors[CLR_RED], ttycolors[CLR_GREEN],
ttycolors[CLR_BROWN], ttycolors[CLR_BLUE],
@@ -4756,9 +4759,9 @@ char *buf;
ttycolors[CLR_YELLOW], ttycolors[CLR_BRIGHT_BLUE],
ttycolors[CLR_BRIGHT_MAGENTA], ttycolors[CLR_BRIGHT_CYAN]);
#endif /* VIDEOSHADES */
else if (!strcmp(optname, "windowtype"))
} else if (!strcmp(optname, "windowtype")) {
Sprintf(buf, "%s", windowprocs.name);
else if (!strcmp(optname, "windowcolors"))
} else if (!strcmp(optname, "windowcolors")) {
Sprintf(
buf, "%s/%s %s/%s %s/%s %s/%s",
iflags.wc_foregrnd_menu ? iflags.wc_foregrnd_menu : defbrief,
@@ -4772,12 +4775,12 @@ char *buf;
iflags.wc_foregrnd_text ? iflags.wc_foregrnd_text : defbrief,
iflags.wc_backgrnd_text ? iflags.wc_backgrnd_text : defbrief);
#ifdef PREFIXES_IN_USE
else {
} else {
for (i = 0; i < PREFIX_COUNT; ++i)
if (!strcmp(optname, fqn_prefix_names[i]) && fqn_prefix[i])
Sprintf(buf, "%s", fqn_prefix[i]);
}
#endif
}
if (buf[0])
return buf;
@@ -5380,6 +5383,7 @@ const char *optnam;
int status;
{
int k;
if (SET__IS_VALUE_VALID(status)) {
impossible("set_option_mod_status: status out of range %d.", status);
return;
@@ -5413,6 +5417,7 @@ unsigned long optmask;
int status;
{
int k = 0;
if (SET__IS_VALUE_VALID(status)) {
impossible("set_wc_option_mod_status: status out of range %d.",
status);
@@ -5431,6 +5436,7 @@ is_wc_option(optnam)
const char *optnam;
{
int k = 0;
while (wc_options[k].wc_name) {
if (strcmp(wc_options[k].wc_name, optnam) == 0)
return TRUE;
@@ -5444,6 +5450,7 @@ wc_supported(optnam)
const char *optnam;
{
int k = 0;
while (wc_options[k].wc_name) {
if (!strcmp(wc_options[k].wc_name, optnam)
&& (windowprocs.wincap & wc_options[k].wc_bit))
@@ -5470,6 +5477,7 @@ unsigned long optmask;
int status;
{
int k = 0;
if (SET__IS_VALUE_VALID(status)) {
impossible("set_wc2_option_mod_status: status out of range %d.",
status);
@@ -5488,6 +5496,7 @@ is_wc2_option(optnam)
const char *optnam;
{
int k = 0;
while (wc2_options[k].wc_name) {
if (strcmp(wc2_options[k].wc_name, optnam) == 0)
return TRUE;
@@ -5501,6 +5510,7 @@ wc2_supported(optnam)
const char *optnam;
{
int k = 0;
while (wc2_options[k].wc_name) {
if (!strcmp(wc2_options[k].wc_name, optnam)
&& (windowprocs.wincap2 & wc2_options[k].wc_bit))
@@ -5516,6 +5526,7 @@ int opttype;
char *fontname;
{
char **fn = (char **) 0;
if (!fontname)
return;
switch (opttype) {
@@ -5554,7 +5565,6 @@ char *op;
* menu white/black message green/yellow status white/blue text
* white/black
*/
int j;
char buf[BUFSZ];
char *wn, *tfg, *tbg, *newop;