Merge branch 'NetHack-3.6.2'
This commit is contained in:
@@ -4522,9 +4522,12 @@ The official NetHack web site is maintained by \fBKen Lorber\fP at http://www.ne
|
||||
SPECIAL THANKS
|
||||
.pg
|
||||
On behalf of the NetHack community, thank you very much once
|
||||
again to \fBM. Drew Streib\fP, \fBPasi Kallinen\fP and \fBRobin Bandy\fP
|
||||
for providing public NetHack servers at nethack.alt.org and devnull.net
|
||||
and/or for hosting annual NetHack tournaments.
|
||||
again to \fBM. Drew Streib\fP, \fBPasi Kallinen\fP for providing a
|
||||
public NetHack server at nethack.alt.org. Thanks to \fBKeith Simpson\fP
|
||||
and \fBAndy Thomson\fP for hardfought.org. Thanks to all those
|
||||
unnamed dungeoneers who invest their time and effort into annual
|
||||
NetHack tournaments such as Junehack and in days past,
|
||||
devnull.net (gone for now, but not forgotten).
|
||||
.pg
|
||||
.ce
|
||||
- - - - - - - - - -\ \ \ \ \" when centered, the dashes look a little too far
|
||||
|
||||
@@ -5297,9 +5297,12 @@ http:{\tt /}{\tt /}www.nethack.org{\tt /}.
|
||||
|
||||
\subsection*{Special Thanks}
|
||||
\nd On behalf of the {\it NetHack\/} community, thank you very much once
|
||||
again to {\it M. Drew Streib}, {\it Pasi Kallinen} and {\it Robin Bandy} for
|
||||
providing public {\it NetHack\/} servers at {\it nethack.alt.org\/} and
|
||||
{\it devnull.net\/} and/or for hosting annual {\it NetHack\/} tournaments.
|
||||
again to {\it M. Drew Streib}, {\it Pasi Kallinen} for providing a
|
||||
public NetHack server at nethack.alt.org. Thanks to {\it Keith Simpson}
|
||||
and {\it Andy Thomson} for hardfought.org. Thanks to all those
|
||||
unnamed dungeoneers who invest their time and effort into annual
|
||||
{\it NetHack\/} tournaments such as {\it Junethack} and in days past,
|
||||
{\it devnull.net\/} (gone for now, but not forgotten).
|
||||
\clearpage
|
||||
|
||||
%.hn
|
||||
|
||||
@@ -12,12 +12,31 @@ list MSGTYPE values shows empty strings as reported in H7140
|
||||
Killing Vlad while he was in bat/fog cloud/wolf form gave poorly worded
|
||||
feedback when he reverted to vampire form
|
||||
spaces in hilite_status option title text field not working
|
||||
numeric hilite_status values didn't allow negative numbers (needed for AC)
|
||||
numeric hilite_status values didn't allow negative numbers (needed for AC);
|
||||
change them to accept leading '-', also accept unary '+' as a no-op
|
||||
permanent inventory window was updated too soon when a scroll of charging
|
||||
was used to [re]charge an item, not reflecting the item's change(s)
|
||||
for starting inventory, don't give an orc hero lembas wafers or cram rations
|
||||
targetting with a polearm could give away location of hidden monster
|
||||
static prototype could be left orphaned depending on #defines in rip.c
|
||||
config file error handling routines were calling xx_wait_synch early
|
||||
even before the window system was initialized; add a default routine
|
||||
status_finish() in botl.c would unconditionally invoke the window port's
|
||||
win_status_finish() routine which was problematic if the windowport
|
||||
wasn't initialized yet
|
||||
using 'O' to set up a hilite_status rule for string comparison, the menu for
|
||||
color was titled "choose attribute for when <foo> is 'bar'" and the
|
||||
one prompting for attribute used the default "pick an attribute"
|
||||
when finishing using 'O' to examine or set hilite_status rules, if the
|
||||
'statushilites' option is 0 and there is at least one rule, give a
|
||||
reminder about setting it to non-zero to activate highlighting
|
||||
|
||||
|
||||
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
||||
------------------------------------------------------------------
|
||||
fix access violation when --debug:xxxx has no other args after it
|
||||
Setting the inverse attribute for gold had the space before "$:"
|
||||
getting highlighted along with the gold field
|
||||
|
||||
|
||||
Platform- and/or Interface-Specific Fixes
|
||||
@@ -40,11 +59,21 @@ windows-tty: Use nhraykey by default if the players keyboard layout is
|
||||
windows-tty: We now support changing altkeyhandler in game
|
||||
windows: Added ntassert() mechanism for Windows based port use
|
||||
tty: significant optimizations for performance and per field rendering
|
||||
unix: Makefile.src and Makefile.utl inadvertently relied on a 'gnu make'
|
||||
extension when using $(VERBOSEMAKE) to reduce build-time feedback;
|
||||
replace with $(QUIETCC) which operates the same but defaults to
|
||||
verbose so doesn't use '$<' for multi-prerequisite targets unless
|
||||
specifically requested; use 'make QUIETCC=1 <target>' to get the
|
||||
3.6.1 behavior back
|
||||
|
||||
|
||||
General New Features
|
||||
--------------------
|
||||
integrate aklys feature introduced in 3.6.1 into display
|
||||
status_hilite options which use comparisons may now use <= and >= in
|
||||
addition to previous < and >; in 3.6.1 the latter operated as if
|
||||
they were <= and >= but now behave as conventional less than and
|
||||
greater than; old highlight rules using them should be updated
|
||||
|
||||
|
||||
Code Cleanup and Reorganization
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 botl.h $NHDT-Date: 1452660165 2016/01/13 04:42:45 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.15 $ */
|
||||
/* NetHack 3.6 botl.h $NHDT-Date: 1526907469 2018/05/21 12:57:49 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.19 $ */
|
||||
/* Copyright (c) Michael Allison, 2003 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -32,11 +32,13 @@ enum statusfields {
|
||||
BL_FLUSH = -1, BL_TITLE = 0,
|
||||
BL_STR, BL_DX, BL_CO, BL_IN, BL_WI, BL_CH, /* 1..6 */
|
||||
BL_ALIGN, BL_SCORE, BL_CAP, BL_GOLD, BL_ENE, BL_ENEMAX, /* 7..12 */
|
||||
BL_XP, BL_AC, BL_HD, BL_TIME, BL_HUNGER, BL_HP, BL_HPMAX, BL_LEVELDESC, /* 13..20 */
|
||||
BL_EXP, BL_CONDITION
|
||||
BL_XP, BL_AC, BL_HD, BL_TIME, BL_HUNGER, BL_HP, /* 13..18 */
|
||||
BL_HPMAX, BL_LEVELDESC, BL_EXP, BL_CONDITION /* 19..22 */
|
||||
};
|
||||
|
||||
enum relationships { LT_VALUE = -1, EQ_VALUE, GT_VALUE, TXT_VALUE };
|
||||
enum relationships { NO_LTEQGT = -1,
|
||||
EQ_VALUE, LT_VALUE, LE_VALUE,
|
||||
GE_VALUE, GT_VALUE, TXT_VALUE };
|
||||
|
||||
#define MAXBLSTATS (BL_CONDITION + 1)
|
||||
|
||||
|
||||
54
src/apply.c
54
src/apply.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 apply.c $NHDT-Date: 1519598527 2018/02/25 22:42:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.243 $ */
|
||||
/* NetHack 3.6 apply.c $NHDT-Date: 1526769961 2018/05/19 22:46:01 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.246 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -2865,21 +2865,41 @@ coord *pos;
|
||||
int min_range, max_range;
|
||||
{
|
||||
struct monst *mtmp;
|
||||
struct monst *selmon = (struct monst *) 0;
|
||||
coord mpos;
|
||||
boolean impaired;
|
||||
int x, y, lo_x, hi_x, lo_y, hi_y, rt, glyph;
|
||||
|
||||
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
|
||||
if (mtmp && !DEADMONSTER(mtmp) && !mtmp->mtame
|
||||
&& cansee(mtmp->mx, mtmp->my)
|
||||
&& distu(mtmp->mx, mtmp->my) <= max_range
|
||||
&& distu(mtmp->mx, mtmp->my) >= min_range) {
|
||||
if (selmon)
|
||||
return FALSE;
|
||||
selmon = mtmp;
|
||||
if (Blind)
|
||||
return FALSE; /* must be able to see target location */
|
||||
impaired = (Confusion || Stunned || Hallucination);
|
||||
mpos.x = mpos.y = 0; /* no candidate location yet */
|
||||
rt = isqrt(max_range);
|
||||
lo_x = max(u.ux - rt, 1), hi_x = min(u.ux + rt, COLNO - 1);
|
||||
lo_y = max(u.uy - rt, 0), hi_y = min(u.uy + rt, ROWNO - 1);
|
||||
for (x = lo_x; x <= hi_x; ++x) {
|
||||
for (y = lo_y; y <= hi_y; ++y) {
|
||||
if (distu(x, y) < min_range || distu(x, y) > max_range
|
||||
|| !isok(x, y) || !cansee(x, y))
|
||||
continue;
|
||||
glyph = glyph_at(x, y);
|
||||
if (!impaired
|
||||
&& glyph_is_monster(glyph)
|
||||
&& (mtmp = m_at(x, y)) != 0
|
||||
&& (mtmp->mtame || (mtmp->mpeaceful && flags.confirm)))
|
||||
continue;
|
||||
if (glyph_is_monster(glyph)
|
||||
|| glyph_is_warning(glyph)
|
||||
|| glyph_is_invisible(glyph)
|
||||
|| (glyph_is_statue(glyph) && impaired)) {
|
||||
if (mpos.x)
|
||||
return FALSE; /* more than one candidate location */
|
||||
mpos.x = x, mpos.y = y;
|
||||
}
|
||||
}
|
||||
if (!selmon)
|
||||
return FALSE;
|
||||
pos->x = selmon->mx;
|
||||
pos->y = selmon->my;
|
||||
}
|
||||
if (!mpos.x)
|
||||
return FALSE; /* no candidate location */
|
||||
*pos = mpos;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -2887,8 +2907,8 @@ static int polearm_range_min = -1;
|
||||
static int polearm_range_max = -1;
|
||||
|
||||
STATIC_OVL boolean
|
||||
get_valid_polearm_position(x,y)
|
||||
int x,y;
|
||||
get_valid_polearm_position(x, y)
|
||||
int x, y;
|
||||
{
|
||||
return (isok(x, y) && ACCESSIBLE(levl[x][y].typ)
|
||||
&& distu(x, y) >= polearm_range_min
|
||||
@@ -2998,7 +3018,7 @@ struct obj *obj;
|
||||
return res;
|
||||
}
|
||||
|
||||
context.polearm.hitmon = NULL;
|
||||
context.polearm.hitmon = (struct monst *) 0;
|
||||
/* Attack the monster there */
|
||||
bhitpos = cc;
|
||||
if ((mtmp = m_at(bhitpos.x, bhitpos.y)) != (struct monst *) 0) {
|
||||
|
||||
749
src/botl.c
749
src/botl.c
File diff suppressed because it is too large
Load Diff
@@ -5354,8 +5354,10 @@ dotravel(VOID_ARGS)
|
||||
}
|
||||
|
||||
#ifdef PORT_DEBUG
|
||||
#if defined(WIN32) && defined(TTY_GRAPHICS)
|
||||
extern void NDECL(win32con_debug_keystrokes);
|
||||
extern void NDECL(win32con_handler_info);
|
||||
#endif
|
||||
|
||||
int
|
||||
wiz_port_debug()
|
||||
@@ -5369,7 +5371,7 @@ wiz_port_debug()
|
||||
char *menutext;
|
||||
void NDECL((*fn));
|
||||
} menu_selections[] = {
|
||||
#ifdef WIN32
|
||||
#if defined(WIN32) && defined(TTY_GRAPHICS)
|
||||
{ "test win32 keystrokes (tty only)", win32con_debug_keystrokes },
|
||||
{ "show keystroke handler information (tty only)",
|
||||
win32con_handler_info },
|
||||
|
||||
@@ -2651,7 +2651,7 @@ boolean tinitial, tfrom_file;
|
||||
bad_negation(fullname, FALSE);
|
||||
return FALSE;
|
||||
} else if ((op = string_for_opt(opts, negated)) != 0) {
|
||||
#if defined(WIN32CON)
|
||||
#if defined(WIN32) && defined(TTY_GRAPHICS)
|
||||
set_altkeyhandler(op);
|
||||
#endif
|
||||
} else
|
||||
@@ -3304,7 +3304,9 @@ boolean tinitial, tfrom_file;
|
||||
op = string_for_opt(opts, 0);
|
||||
if (!op)
|
||||
return FALSE;
|
||||
#ifdef TTY_GRAPHICS
|
||||
map_subkeyvalue(op);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
return retval;
|
||||
|
||||
36
src/read.c
36
src/read.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 read.c $NHDT-Date: 1515802375 2018/01/13 00:12:55 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.150 $ */
|
||||
/* NetHack 3.6 read.c $NHDT-Date: 1526728750 2018/05/19 11:19:10 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.155 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -19,19 +19,23 @@ static NEARDATA const char readable[] = { ALL_CLASSES, SCROLL_CLASS,
|
||||
static const char all_count[] = { ALLOW_COUNT, ALL_CLASSES, 0 };
|
||||
|
||||
STATIC_DCL boolean FDECL(learnscrolltyp, (SHORT_P));
|
||||
STATIC_DCL char * FDECL(erode_obj_text, (struct obj *, char *));
|
||||
STATIC_DCL void NDECL(do_class_genocide);
|
||||
STATIC_DCL char *FDECL(erode_obj_text, (struct obj *, char *));
|
||||
STATIC_DCL char *FDECL(apron_text, (struct obj *, char *buf));
|
||||
STATIC_DCL void FDECL(stripspe, (struct obj *));
|
||||
STATIC_DCL void FDECL(p_glow1, (struct obj *));
|
||||
STATIC_DCL void FDECL(p_glow2, (struct obj *, const char *));
|
||||
STATIC_DCL void FDECL(randomize, (int *, int));
|
||||
STATIC_DCL void FDECL(forget_single_object, (int));
|
||||
#if 0 /* not used */
|
||||
STATIC_DCL void FDECL(forget_objclass, (int));
|
||||
#endif
|
||||
STATIC_DCL void FDECL(randomize, (int *, int));
|
||||
STATIC_DCL void FDECL(forget, (int));
|
||||
STATIC_DCL int FDECL(maybe_tame, (struct monst *, struct obj *));
|
||||
STATIC_DCL boolean FDECL(is_valid_stinking_cloud_pos, (int, int, BOOLEAN_P));
|
||||
STATIC_DCL void FDECL(display_stinking_cloud_positions, (int));
|
||||
STATIC_DCL boolean FDECL(get_valid_stinking_cloud_pos, (int, int));
|
||||
STATIC_DCL boolean FDECL(is_valid_stinking_cloud_pos, (int, int, BOOLEAN_P));
|
||||
STATIC_PTR void FDECL(display_stinking_cloud_positions, (int));
|
||||
STATIC_PTR void FDECL(set_lit, (int, int, genericptr));
|
||||
STATIC_DCL void NDECL(do_class_genocide);
|
||||
|
||||
STATIC_OVL boolean
|
||||
learnscrolltyp(scrolltyp)
|
||||
@@ -56,7 +60,7 @@ struct obj *sobj;
|
||||
(void) learnscrolltyp(sobj->otyp);
|
||||
}
|
||||
|
||||
char *
|
||||
STATIC_OVL char *
|
||||
erode_obj_text(otmp, buf)
|
||||
struct obj *otmp;
|
||||
char *buf;
|
||||
@@ -158,7 +162,7 @@ char *buf;
|
||||
return erode_obj_text(tshirt, buf);
|
||||
}
|
||||
|
||||
char *
|
||||
STATIC_OVL char *
|
||||
apron_text(apron, buf)
|
||||
struct obj *apron;
|
||||
char *buf;
|
||||
@@ -324,6 +328,7 @@ doread()
|
||||
return 0;
|
||||
} else if (Blind && (scroll->otyp != SPE_BOOK_OF_THE_DEAD)) {
|
||||
const char *what = 0;
|
||||
|
||||
if (scroll->oclass == SPBOOK_CLASS)
|
||||
what = "mystic runes";
|
||||
else if (!scroll->dknown)
|
||||
@@ -953,7 +958,7 @@ int x,y;
|
||||
|| distu(x, y) >= 32));
|
||||
}
|
||||
|
||||
boolean
|
||||
STATIC_OVL boolean
|
||||
is_valid_stinking_cloud_pos(x, y, showmsg)
|
||||
int x, y;
|
||||
boolean showmsg;
|
||||
@@ -966,7 +971,7 @@ boolean showmsg;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
STATIC_PTR void
|
||||
display_stinking_cloud_positions(state)
|
||||
int state;
|
||||
{
|
||||
@@ -1621,7 +1626,8 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
|
||||
pline("This is a scroll of fire!");
|
||||
dam *= 5;
|
||||
pline("Where do you want to center the explosion?");
|
||||
getpos_sethilite(display_stinking_cloud_positions, get_valid_stinking_cloud_pos);
|
||||
getpos_sethilite(display_stinking_cloud_positions,
|
||||
get_valid_stinking_cloud_pos);
|
||||
(void) getpos(&cc, TRUE, "the desired position");
|
||||
if (!is_valid_stinking_cloud_pos(cc.x, cc.y, FALSE)) {
|
||||
/* try to reach too far, get burned */
|
||||
@@ -1693,7 +1699,8 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
|
||||
already_known ? "stinking " : "");
|
||||
cc.x = u.ux;
|
||||
cc.y = u.uy;
|
||||
getpos_sethilite(display_stinking_cloud_positions, get_valid_stinking_cloud_pos);
|
||||
getpos_sethilite(display_stinking_cloud_positions,
|
||||
get_valid_stinking_cloud_pos);
|
||||
if (getpos(&cc, TRUE, "the desired position") < 0) {
|
||||
pline1(Never_mind);
|
||||
break;
|
||||
@@ -1707,6 +1714,11 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
|
||||
default:
|
||||
impossible("What weird effect is this? (%u)", otyp);
|
||||
}
|
||||
/* if sobj is gone, we've already called useup() above and the
|
||||
update_inventory() that it performs might have come too soon
|
||||
(before charging an item, for instance) */
|
||||
if (!sobj)
|
||||
update_inventory();
|
||||
return sobj ? 0 : 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
STATIC_DCL void FDECL(center, (int, char *));
|
||||
|
||||
#if defined(TTY_GRAPHICS) || defined(X11_GRAPHICS) || defined(GEM_GRAPHICS) \
|
||||
|| defined(MSWIN_GRAPHICS) || defined(DUMPLOG)
|
||||
#define TEXT_TOMBSTONE
|
||||
@@ -18,6 +16,7 @@ STATIC_DCL void FDECL(center, (int, char *));
|
||||
#endif
|
||||
|
||||
#ifdef TEXT_TOMBSTONE
|
||||
STATIC_DCL void FDECL(center, (int, char *));
|
||||
|
||||
#ifndef NH320_DEDICATION
|
||||
/* A normal tombstone for end of game display. */
|
||||
|
||||
35
src/u_init.c
35
src/u_init.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 u_init.c $NHDT-Date: 1503960969 2017/08/28 22:56:09 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.40 $ */
|
||||
/* NetHack 3.6 u_init.c $NHDT-Date: 1526755625 2018/05/19 18:47:05 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.42 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2017. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -219,11 +219,14 @@ static struct inv_sub {
|
||||
{ PM_ORC, SMALL_SHIELD, ORCISH_SHIELD },
|
||||
{ PM_ORC, RING_MAIL, ORCISH_RING_MAIL },
|
||||
{ PM_ORC, CHAIN_MAIL, ORCISH_CHAIN_MAIL },
|
||||
{ PM_ORC, CRAM_RATION, TRIPE_RATION },
|
||||
{ PM_ORC, LEMBAS_WAFER, TRIPE_RATION },
|
||||
{ PM_DWARF, SPEAR, DWARVISH_SPEAR },
|
||||
{ PM_DWARF, SHORT_SWORD, DWARVISH_SHORT_SWORD },
|
||||
{ PM_DWARF, HELMET, DWARVISH_IRON_HELM },
|
||||
/* { PM_DWARF, SMALL_SHIELD, DWARVISH_ROUNDSHIELD }, */
|
||||
/* { PM_DWARF, PICK_AXE, DWARVISH_MATTOCK }, */
|
||||
{ PM_DWARF, LEMBAS_WAFER, CRAM_RATION },
|
||||
{ PM_GNOME, BOW, CROSSBOW },
|
||||
{ PM_GNOME, ARROW, CROSSBOW_BOLT },
|
||||
{ NON_PM, STRANGE_OBJECT, STRANGE_OBJECT }
|
||||
@@ -972,17 +975,8 @@ register struct trobj *trop;
|
||||
int otyp, i;
|
||||
|
||||
while (trop->trclass) {
|
||||
if (trop->trotyp != UNDEF_TYP) {
|
||||
otyp = (int) trop->trotyp;
|
||||
if (urace.malenum != PM_HUMAN) {
|
||||
/* substitute specific items for generic ones */
|
||||
for (i = 0; inv_subs[i].race_pm != NON_PM; ++i)
|
||||
if (inv_subs[i].race_pm == urace.malenum
|
||||
&& otyp == inv_subs[i].item_otyp) {
|
||||
otyp = inv_subs[i].subs_otyp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
otyp = (int) trop->trotyp;
|
||||
if (otyp != UNDEF_TYP) {
|
||||
obj = mksobj(otyp, TRUE, FALSE);
|
||||
} else { /* UNDEF_TYP */
|
||||
static NEARDATA short nocreate = STRANGE_OBJECT;
|
||||
@@ -1057,6 +1051,23 @@ register struct trobj *trop;
|
||||
nocreate4 = otyp;
|
||||
}
|
||||
|
||||
if (urace.malenum != PM_HUMAN) {
|
||||
/* substitute race-specific items; this used to be in
|
||||
the 'if (otyp != UNDEF_TYP) { }' block above, but then
|
||||
substitutions didn't occur for randomly generated items
|
||||
(particularly food) which have racial substitutes */
|
||||
for (i = 0; inv_subs[i].race_pm != NON_PM; ++i)
|
||||
if (inv_subs[i].race_pm == urace.malenum
|
||||
&& otyp == inv_subs[i].item_otyp) {
|
||||
debugpline3("ini_inv: substituting %s for %s%s",
|
||||
OBJ_NAME(objects[inv_subs[i].subs_otyp]),
|
||||
(trop->trotyp == UNDEF_TYP) ? "random " : "",
|
||||
OBJ_NAME(objects[otyp]));
|
||||
otyp = obj->otyp = inv_subs[i].subs_otyp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* nudist gets no armor */
|
||||
if (u.uroleplay.nudist && obj->oclass == ARMOR_CLASS) {
|
||||
dealloc_obj(obj);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 windows.c $NHDT-Date: 1495232365 2017/05/19 22:19:25 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.41 $ */
|
||||
/* NetHack 3.6 windows.c $NHDT-Date: 1526933747 2018/05/21 20:15:47 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.48 $ */
|
||||
/* Copyright (c) D. Cohrs, 1993. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -56,6 +56,7 @@ extern void *FDECL(trace_procs_chain, (int, int, void *, void *, void *));
|
||||
#endif
|
||||
|
||||
STATIC_DCL void FDECL(def_raw_print, (const char *s));
|
||||
STATIC_DCL void NDECL(def_wait_synch);
|
||||
|
||||
#ifdef DUMPLOG
|
||||
STATIC_DCL winid FDECL(dump_create_nhwindow, (int));
|
||||
@@ -191,6 +192,22 @@ const char *s;
|
||||
puts(s);
|
||||
}
|
||||
|
||||
STATIC_OVL
|
||||
void
|
||||
def_wait_synch(VOID_ARGS)
|
||||
{
|
||||
/* Config file error handling routines
|
||||
* call wait_sync() without checking to
|
||||
* see if it actually has a value,
|
||||
* leading to spectacular violations
|
||||
* when you try to execute address zero.
|
||||
* The existence of this allows early
|
||||
* processing to have something to execute
|
||||
* even though it essentially does nothing
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef WINCHAIN
|
||||
static struct win_choices *
|
||||
win_choices_find(s)
|
||||
@@ -232,6 +249,9 @@ const char *s;
|
||||
|
||||
if (!windowprocs.win_raw_print)
|
||||
windowprocs.win_raw_print = def_raw_print;
|
||||
if (!windowprocs.win_wait_synch)
|
||||
/* early config file error processing routines call this */
|
||||
windowprocs.win_wait_synch = def_wait_synch;
|
||||
|
||||
if (!winchoices[0].procs) {
|
||||
raw_printf("No window types?");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 worn.c $NHDT-Date: 1496959481 2017/06/08 22:04:41 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.49 $ */
|
||||
/* NetHack 3.6 worn.c $NHDT-Date: 1526728754 2018/05/19 11:19:14 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.51 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -105,7 +105,8 @@ long mask;
|
||||
}
|
||||
}
|
||||
}
|
||||
update_inventory();
|
||||
if (!restoring)
|
||||
update_inventory();
|
||||
}
|
||||
|
||||
/* called e.g. when obj is destroyed */
|
||||
@@ -136,7 +137,9 @@ register struct obj *obj;
|
||||
if ((p = w_blocks(obj, wp->w_mask)) != 0)
|
||||
u.uprops[p].blocked &= ~wp->w_mask;
|
||||
}
|
||||
update_inventory();
|
||||
/* setnotworn() isn't called during restore but parallel setworn() */
|
||||
if (!restoring)
|
||||
update_inventory();
|
||||
}
|
||||
|
||||
/* return a bitmask of the equipment slot(s) a given item might be worn in */
|
||||
|
||||
@@ -310,7 +310,9 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
save_getreturn_status = getreturn_enabled;
|
||||
#ifdef TTY_GRAPHICS
|
||||
raw_clear_screen();
|
||||
#endif
|
||||
getreturn_enabled = TRUE;
|
||||
check_recordfile((char *) 0);
|
||||
#endif
|
||||
@@ -484,6 +486,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
|
||||
NHWinMainInit();
|
||||
else
|
||||
*/
|
||||
#ifdef TTY_GRAPHICS
|
||||
if (!strncmpi(windowprocs.name, "tty", 3)) {
|
||||
iflags.use_background_glyph = FALSE;
|
||||
nttty_open(1);
|
||||
@@ -492,6 +495,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(MSDOS) || defined(WIN32)
|
||||
/* Player didn't specify any symbol set so use IBM defaults */
|
||||
@@ -510,7 +514,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
|
||||
process_options(argc, argv);
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(WIN32) && defined(TTY_GRAPHICS)
|
||||
toggle_mouse_support(); /* must come after process_options */
|
||||
#endif
|
||||
|
||||
@@ -791,14 +795,11 @@ char *argv[];
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
case 'w': /* windowtype */
|
||||
#ifdef TTY_GRAPHICS
|
||||
if (strncmpi(&argv[0][2], "tty", 3)) {
|
||||
nttty_open(1);
|
||||
}
|
||||
/*
|
||||
else {
|
||||
NHWinMainInit();
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
config_error_init(FALSE, "command line", FALSE);
|
||||
choose_windows(&argv[0][2]);
|
||||
config_error_done();
|
||||
|
||||
@@ -501,6 +501,15 @@ int code;
|
||||
exit(code);
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
#ifndef TTY_GRAPHICS
|
||||
void
|
||||
synch_cursor()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Chdir back to original directory
|
||||
*/
|
||||
#ifdef TOS
|
||||
|
||||
@@ -15,9 +15,10 @@
|
||||
|
||||
#if defined(WIN32) || defined(MSDOS)
|
||||
extern char orgdir[];
|
||||
#ifdef WIN32
|
||||
extern void NDECL(backsp);
|
||||
#endif
|
||||
|
||||
#if defined(WIN32) && defined(TTY_GRAPHICS)
|
||||
extern void NDECL(backsp);
|
||||
extern void NDECL(clear_screen);
|
||||
#endif
|
||||
|
||||
@@ -196,7 +197,7 @@ getlock()
|
||||
if (c == 'y' || c == 'Y')
|
||||
#ifndef SELF_RECOVER
|
||||
if (eraseoldlocks()) {
|
||||
#if defined(WIN32)
|
||||
#if defined(WIN32) && defined(TTY_GRAPHICS)
|
||||
if (!strncmpi(windowprocs.name, "tty", 3))
|
||||
clear_screen(); /* display gets fouled up otherwise */
|
||||
#endif
|
||||
@@ -210,7 +211,7 @@ getlock()
|
||||
}
|
||||
#else /*SELF_RECOVER*/
|
||||
if (recover_savefile()) {
|
||||
#if defined(WIN32)
|
||||
#if defined(WIN32) && defined(TTY_GRAPHICS)
|
||||
if (!strncmpi(windowprocs.name, "tty", 3))
|
||||
clear_screen(); /* display gets fouled up otherwise */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# NetHack Makefile.
|
||||
# NetHack 3.6 Makefile.src $NHDT-Date: 1524689449 2018/04/25 20:50:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.54 $
|
||||
# NetHack 3.6 Makefile.src $NHDT-Date: 1526687360 2018/05/18 23:49:20 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.55 $
|
||||
# Copyright (c) 2018 by Pasi Kallinen
|
||||
# NetHack may be freely redistributed. See license for details.
|
||||
|
||||
@@ -343,7 +343,13 @@ AWK = nawk
|
||||
# will proceed without it
|
||||
GITINFO=1
|
||||
|
||||
#VERBOSEMAKE = 1
|
||||
# if you change this to 1, feedback while building will omit -Dthis -Wthat
|
||||
# -Isomewhere so that each file being compiled is listed on one short line;
|
||||
# it requires support for '$<' in rules with more than one prerequisite
|
||||
# (rather than just in suffix default rule), such as is implemented by
|
||||
# gnu make and others which have picked up its extensions;
|
||||
# allowed values are 0, 1, and empty (which behaves like 0)
|
||||
QUIETCC=0
|
||||
|
||||
# ----------------------------------------
|
||||
#
|
||||
@@ -353,7 +359,7 @@ GITINFO=1
|
||||
# {unixconf.h, pcconf.h, tosconf.h}, and possibly system.h
|
||||
|
||||
# Verbosity definitions, begin
|
||||
# Set VERBOSEMAKE=1 to output more stuff.
|
||||
# Set QUIETCC=1 above to output less feedback while building.
|
||||
# CC and CXX obey verbosity, LD and LINK don't.
|
||||
# AT is @ when not verbose, empty otherwise
|
||||
ACTUAL_CC := $(CC)
|
||||
@@ -361,23 +367,25 @@ ACTUAL_CXX := $(CXX)
|
||||
ACTUAL_LD := $(LD)
|
||||
ACTUAL_LINK := $(LINK)
|
||||
|
||||
CC_V0 = @echo "[CC] $<"; $(ACTUAL_CC)
|
||||
CC_V0 = $(ACTUAL_CC)
|
||||
CC_V = $(CC_V0)
|
||||
CC_V1 = $(ACTUAL_CC)
|
||||
CC = $(CC_V$(VERBOSEMAKE))
|
||||
CC_V1 = @echo "[CC] $<"; $(ACTUAL_CC)
|
||||
CC = $(CC_V$(QUIETCC))
|
||||
|
||||
CXX_V0 = @echo "[CXX] $<"; $(ACTUAL_CXX)
|
||||
CXX_V0 = $(ACTUAL_CXX)
|
||||
CXX_V = $(CXX_V0)
|
||||
CXX_V1 = $(ACTUAL_CXX)
|
||||
CXX = $(CXX_V$(VERBOSEMAKE))
|
||||
CXX_V1 = @echo "[CXX] $<"; $(ACTUAL_CXX)
|
||||
CXX = $(CXX_V$(QUIETCC))
|
||||
|
||||
# LD and LINK might be based on invoking CC and may not be able to substitute
|
||||
# for QUIETCC, so feedback from them is handled differently (via $AT)
|
||||
LD = $(ACTUAL_LD)
|
||||
LINK = $(ACTUAL_LINK)
|
||||
|
||||
AT_V0 := @
|
||||
AT_V0 :=
|
||||
AT_V := $(AT_V0)
|
||||
AT_V1 :=
|
||||
AT = $(AT_V$(VERBOSEMAKE))
|
||||
AT_V1 := @
|
||||
AT = $(AT_V$(QUIETCC))
|
||||
# Verbosity, end
|
||||
|
||||
MAKEDEFS = ../util/makedefs
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Makefile for NetHack's utility programs.
|
||||
# NetHack 3.6 Makefile.utl $NHDT-Date: 1524689449 2018/04/25 20:50:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.35 $
|
||||
# NetHack 3.6 Makefile.utl $NHDT-Date: 1526687364 2018/05/18 23:49:24 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.36 $
|
||||
# Copyright (c) 2018 by Robert Patrick Rankin
|
||||
# NetHack may be freely redistributed. See license for details.
|
||||
|
||||
@@ -127,34 +127,50 @@ LEXYYC = lex.yy.c
|
||||
# LEXYYC = lexyy.c
|
||||
|
||||
|
||||
# if you change this to 1, feedback while building will omit -Dthis -Wthat
|
||||
# -Isomewhere so that each file being compiled is listed on one short line;
|
||||
# it requires support for '$<' in rules with more than one prerequisite
|
||||
# (rather than just in suffix default rule), such as is implemented by
|
||||
# gnu make and others which have picked up its extensions;
|
||||
# allowed values are 0, 1, and empty (which behaves like 0)
|
||||
QUIETCC=0
|
||||
|
||||
# TODO? the link/load commands below are handled differently from the ones
|
||||
# in Makefile.src; these use '$(CC) $(LFLAGS)' and ought to be changed to use
|
||||
# $(LD) or $(LINK) as appropriate [quiet mode echoes a misleading $< value]
|
||||
|
||||
# ----------------------------------------
|
||||
#
|
||||
# Nothing below this line should have to be changed.
|
||||
|
||||
# Verbosity definitions, begin
|
||||
# Set QUIETCC=1 above to output less feedback while building.
|
||||
# CC and CXX obey verbosity, LD and LINK don't.
|
||||
# AT is @ when not verbose, empty otherwise
|
||||
ACTUAL_CC := $(CC)
|
||||
ACTUAL_CXX := $(CXX)
|
||||
ACTUAL_LD := $(LD)
|
||||
ACTUAL_LINK := $(LINK)
|
||||
|
||||
CC_V0 = @echo "[CC] $<"; $(ACTUAL_CC)
|
||||
CC_V0 = $(ACTUAL_CC)
|
||||
CC_V = $(CC_V0)
|
||||
CC_V1 = $(ACTUAL_CC)
|
||||
CC = $(CC_V$(VERBOSEMAKE))
|
||||
CC_V1 = @echo "[CC] $<"; $(ACTUAL_CC)
|
||||
CC = $(CC_V$(QUIETCC))
|
||||
|
||||
CXX_V0 = @echo "[CXX] $<"; $(ACTUAL_CXX)
|
||||
CXX_V0 = $(ACTUAL_CXX)
|
||||
CXX_V = $(CXX_V0)
|
||||
CXX_V1 = $(ACTUAL_CXX)
|
||||
CXX = $(CXX_V$(VERBOSEMAKE))
|
||||
CXX_V1 = @echo "[CXX] $<"; $(ACTUAL_CXX)
|
||||
CXX = $(CXX_V$(QUIETCC))
|
||||
|
||||
# LD and LINK might be based on invoking CC and may not be able to substitute
|
||||
# for QUIETCC, so feedback from them is handled differently (via $AT)
|
||||
LD = $(ACTUAL_LD)
|
||||
LINK = $(ACTUAL_LINK)
|
||||
|
||||
AT_V0 := @
|
||||
AT_V0 :=
|
||||
AT_V := $(AT_V0)
|
||||
AT_V1 :=
|
||||
AT = V$(AT_$(VERBOSEMAKE))
|
||||
AT_V1 := @
|
||||
AT = $(AT_V$(QUIETCC))
|
||||
# Verbosity, end
|
||||
|
||||
# timestamps for primary header files, matching src/Makefile
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#define NEED_VARARGS /* Uses ... */
|
||||
#include "hack.h"
|
||||
@@ -21,6 +22,10 @@
|
||||
#include <sys\stat.h>
|
||||
#include "win32api.h"
|
||||
|
||||
extern boolean getreturn_enabled; /* from sys/share/pcsys.c */
|
||||
extern int redirect_stdout;
|
||||
|
||||
#ifdef TTY_GRAPHICS
|
||||
/*
|
||||
* Console Buffer Flipping Support
|
||||
*
|
||||
@@ -84,9 +89,6 @@ INPUT_RECORD ir;
|
||||
|
||||
/* Support for changing console font if existing glyph widths are too wide */
|
||||
|
||||
extern boolean getreturn_enabled; /* from sys/share/pcsys.c */
|
||||
extern int redirect_stdout;
|
||||
|
||||
/* Flag for whether NetHack was launched via the GUI, not the command line.
|
||||
* The reason we care at all, is so that we can get
|
||||
* a final RETURN at the end of the game when launched from the GUI
|
||||
@@ -1078,40 +1080,6 @@ void set_altkeyhandler(const char * inName)
|
||||
return;
|
||||
}
|
||||
|
||||
/* this is used as a printf() replacement when the window
|
||||
* system isn't initialized yet
|
||||
*/
|
||||
void msmsg
|
||||
VA_DECL(const char *, fmt)
|
||||
{
|
||||
char buf[ROWNO * COLNO]; /* worst case scenario */
|
||||
VA_START(fmt);
|
||||
VA_INIT(fmt, const char *);
|
||||
Vsprintf(buf, fmt, VA_ARGS);
|
||||
if (redirect_stdout)
|
||||
fprintf(stdout, "%s", buf);
|
||||
else {
|
||||
if(!init_ttycolor_completed)
|
||||
init_ttycolor();
|
||||
|
||||
/* if we have generated too many messages ... ask the user to
|
||||
* confirm and then clear.
|
||||
*/
|
||||
if (console.cursor.Y > console.height - 4) {
|
||||
xputs("Hit <Enter> to continue.");
|
||||
while (pgetchar() != '\n')
|
||||
;
|
||||
raw_clear_screen();
|
||||
set_console_cursor(1, 0);
|
||||
}
|
||||
|
||||
xputs(buf);
|
||||
if (ttyDisplay)
|
||||
curs(BASE_WINDOW, console.cursor.X + 1, console.cursor.Y);
|
||||
}
|
||||
VA_END();
|
||||
return;
|
||||
}
|
||||
|
||||
/* fatal error */
|
||||
/*VARARGS1*/
|
||||
@@ -1912,5 +1880,43 @@ void nethack_enter_nttty()
|
||||
error("Unable to load nhraykey.dll");
|
||||
}
|
||||
}
|
||||
#endif TTY_GRAPHICS
|
||||
|
||||
/* this is used as a printf() replacement when the window
|
||||
* system isn't initialized yet
|
||||
*/
|
||||
void msmsg
|
||||
VA_DECL(const char *, fmt)
|
||||
{
|
||||
char buf[ROWNO * COLNO]; /* worst case scenario */
|
||||
VA_START(fmt);
|
||||
VA_INIT(fmt, const char *);
|
||||
Vsprintf(buf, fmt, VA_ARGS);
|
||||
if (redirect_stdout)
|
||||
fprintf(stdout, "%s", buf);
|
||||
else {
|
||||
#ifdef TTY_GRAPHICS
|
||||
if(!init_ttycolor_completed)
|
||||
init_ttycolor();
|
||||
/* if we have generated too many messages ... ask the user to
|
||||
* confirm and then clear.
|
||||
*/
|
||||
if (console.cursor.Y > console.height - 4) {
|
||||
xputs("Hit <Enter> to continue.");
|
||||
while (pgetchar() != '\n')
|
||||
;
|
||||
raw_clear_screen();
|
||||
set_console_cursor(1, 0);
|
||||
}
|
||||
xputs(buf);
|
||||
if (ttyDisplay)
|
||||
curs(BASE_WINDOW, console.cursor.X + 1, console.cursor.Y);
|
||||
#else
|
||||
fprintf(stdout, "%s", buf);
|
||||
#endif
|
||||
}
|
||||
VA_END();
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /* WIN32 */
|
||||
|
||||
@@ -96,11 +96,13 @@ clear_screen()
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef TTY_GRAPHICS
|
||||
void
|
||||
backsp()
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
has_color(int color)
|
||||
@@ -158,11 +160,13 @@ VA_DECL(const char *, s)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef TTY_GRAPHICS
|
||||
void
|
||||
synch_cursor()
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
more()
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include "win32api.h"
|
||||
#ifdef TTY_GRAPHICS
|
||||
#include "wintty.h"
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
|
||||
/*
|
||||
@@ -227,7 +229,14 @@ Delay(int ms)
|
||||
(void) Sleep(ms);
|
||||
}
|
||||
|
||||
#ifdef TTY_GRAPHICS
|
||||
extern void NDECL(backsp);
|
||||
#else
|
||||
void
|
||||
backsp()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
win32_abort()
|
||||
@@ -481,11 +490,10 @@ void ntassert_failed(const char * exp, const char * file, int line)
|
||||
/* nethack_enter_winnt() is the first thing called from main */
|
||||
void nethack_enter_winnt()
|
||||
{
|
||||
#ifdef WIN32CON
|
||||
#ifdef TTY_GRAPHICS
|
||||
nethack_enter_nttty();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* WIN32 */
|
||||
|
||||
/*winnt.c*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 wintty.c $NHDT-Date: 1526429383 2018/05/16 00:09:43 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.166 $ */
|
||||
/* NetHack 3.6 wintty.c $NHDT-Date: 1526909614 2018/05/21 13:33:34 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.167 $ */
|
||||
/* Copyright (c) David Cohrs, 1991 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -4175,6 +4175,10 @@ render_status(VOID_ARGS)
|
||||
* +-----------+
|
||||
*/
|
||||
if (iflags.hilite_delta) {
|
||||
if (*text == ' ') {
|
||||
tty_putstatusfield(nullfield, " ", x++, y);
|
||||
text++;
|
||||
}
|
||||
/* multiple attributes can be in effect concurrently */
|
||||
Begin_Attr(attridx);
|
||||
if (coloridx != NO_COLOR && coloridx != CLR_MAX)
|
||||
|
||||
Reference in New Issue
Block a user