Merge branch 'paxed-quest-lua' into NetHack-3.7
This commit is contained in:
13
.gitignore
vendored
13
.gitignore
vendored
@@ -67,4 +67,17 @@ doc/guidebk.txt
|
||||
djgpp/
|
||||
src/msdos_o/
|
||||
msdos-binary/
|
||||
dat/NHTILES.BMP
|
||||
dat/msdoshlp.txt
|
||||
src/host_o/
|
||||
util/djgpp-linux64-gcc550.tar.bz2
|
||||
util/djgpp-osx-gcc550.tar.bz2
|
||||
util/djgpp-mingw-gcc550-standalone.zip
|
||||
util/dlb_main
|
||||
util/thintile
|
||||
util/til2bin2
|
||||
util/tile2bin
|
||||
win/share/monthin.txt
|
||||
win/share/objthin.txt
|
||||
win/share/oththin.txt
|
||||
# end of ms-dos
|
||||
|
||||
3047
dat/quest.lua
Normal file
3047
dat/quest.lua
Normal file
File diff suppressed because it is too large
Load Diff
3521
dat/quest.txt
3521
dat/quest.txt
File diff suppressed because it is too large
Load Diff
@@ -982,6 +982,7 @@ E void FDECL(strbuf_append, (strbuf_t *, const char *));
|
||||
E void FDECL(strbuf_reserve, (strbuf_t *, int));
|
||||
E void FDECL(strbuf_empty, (strbuf_t *));
|
||||
E void FDECL(strbuf_nl_to_crlf, (strbuf_t *));
|
||||
E char *FDECL(nonconst, (const char *, char *));
|
||||
|
||||
/* ### invent.c ### */
|
||||
|
||||
@@ -2096,8 +2097,8 @@ E short FDECL(quest_info, (int));
|
||||
E const char *NDECL(ldrname);
|
||||
E boolean FDECL(is_quest_artifact, (struct obj *));
|
||||
E struct obj *FDECL(find_quest_artifact, (unsigned));
|
||||
E void FDECL(com_pager, (int));
|
||||
E void FDECL(qt_pager, (int));
|
||||
E void FDECL(com_pager, (const char *));
|
||||
E void FDECL(qt_pager, (const char *));
|
||||
E struct permonst *NDECL(qt_montype);
|
||||
E void NDECL(deliver_splev_message);
|
||||
|
||||
|
||||
@@ -622,7 +622,6 @@ newgame()
|
||||
if (iflags.news)
|
||||
display_file(NEWS, FALSE);
|
||||
#endif
|
||||
load_qtlist(); /* load up the quest text info */
|
||||
/* quest_init(); -- Now part of role_init() */
|
||||
|
||||
mklev();
|
||||
@@ -639,7 +638,7 @@ newgame()
|
||||
|
||||
if (flags.legacy) {
|
||||
flush_screen(1);
|
||||
com_pager(1);
|
||||
com_pager("legacy");
|
||||
}
|
||||
|
||||
urealtime.realtime = 0L;
|
||||
|
||||
4
src/do.c
4
src/do.c
@@ -1663,9 +1663,9 @@ boolean at_stairs, falling, portal;
|
||||
|| g.quest_status.leader_is_dead)) {
|
||||
if (!u.uevent.qcalled) {
|
||||
u.uevent.qcalled = 1;
|
||||
com_pager(2); /* main "leader needs help" message */
|
||||
com_pager("quest_portal"); /* main "leader needs help" message */
|
||||
} else { /* reminder message */
|
||||
com_pager(Role_if(PM_ROGUE) ? 4 : 3);
|
||||
com_pager(Role_if(PM_ROGUE) ? "quest_portal_demand" : "quest_portal_again");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 hacklib.c $NHDT-Date: 1552639487 2019/03/15 08:44:47 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.67 $ */
|
||||
/* NetHack 3.6 hacklib.c $NHDT-Date: 1574636502 2019/11/24 23:01:42 $ $NHDT-Branch: paxed-quest-lua $:$NHDT-Revision: 1.79 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2007. */
|
||||
/* Copyright (c) Robert Patrick Rankin, 1991 */
|
||||
@@ -71,6 +71,7 @@
|
||||
void strbuf_reserve (strbuf *, int)
|
||||
void strbuf_empty (strbuf *)
|
||||
void strbuf_nl_to_crlf (strbuf_t *)
|
||||
char * nonconst (const char *, char *)
|
||||
=*/
|
||||
#ifdef LINT
|
||||
#define Static /* pacify lint */
|
||||
@@ -1261,4 +1262,19 @@ strbuf_t *strbuf;
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
nonconst(str, buf)
|
||||
const char *str;
|
||||
char *buf;
|
||||
{
|
||||
char *retval = emptystr;
|
||||
|
||||
if (str && buf)
|
||||
if ((int) strlen(str) < BUFSZ - 1) {
|
||||
Strcpy(buf, str);
|
||||
retval = buf;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*hacklib.c*/
|
||||
|
||||
13
src/mdlib.c
13
src/mdlib.c
@@ -41,7 +41,10 @@
|
||||
#if !defined(AMIGA) || defined(AZTEC_C)
|
||||
#define rewind(fp) fseek((fp), 0L, SEEK_SET) /* guarantee a return value */
|
||||
#endif /* AMIGA || AZTEC_C */
|
||||
|
||||
#else
|
||||
#ifndef GLOBAL_H
|
||||
#include "global.h"
|
||||
#endif
|
||||
#endif /* !MAKEDEFS_C */
|
||||
|
||||
void NDECL(build_options);
|
||||
@@ -725,11 +728,11 @@ runtime_info_init()
|
||||
VERSION_STRING = strdup(version_string(tmpbuf, "."));
|
||||
VERSION_ID = strdup(version_id_string(tmpbuf, BUILD_DATE));
|
||||
COPYRIGHT_BANNER_C = strdup(bannerc_string(tmpbuf, BUILD_DATE));
|
||||
#ifdef HOST_NETHACK_GIT_SHA
|
||||
NETHACK_GIT_SHA = strdup(HOST_NETHACK_GIT_SHA);
|
||||
#ifdef NETHACK_HOST_GIT_SHA
|
||||
NETHACK_GIT_SHA = strdup(NETHACK_HOST_GIT_SHA);
|
||||
#endif
|
||||
#ifdef HOST_NETHACK_GIT_BRANCH
|
||||
NETHACK_GIT_BRANCH = strdup(HOST_NETHACK_GIT_BRANCH);
|
||||
#ifdef NETHACK_HOST_GIT_BRANCH
|
||||
NETHACK_GIT_BRANCH = strdup(NETHACK_HOST_GIT_BRANCH);
|
||||
#endif
|
||||
#endif /* CROSSCOMPILE_TARGET && !MAKEDEFS_C */
|
||||
}
|
||||
|
||||
62
src/quest.c
62
src/quest.c
@@ -27,13 +27,13 @@ static void
|
||||
on_start()
|
||||
{
|
||||
if (!Qstat(first_start)) {
|
||||
qt_pager(QT_FIRSTTIME);
|
||||
qt_pager("firsttime");
|
||||
Qstat(first_start) = TRUE;
|
||||
} else if ((u.uz0.dnum != u.uz.dnum) || (u.uz0.dlevel < u.uz.dlevel)) {
|
||||
if (Qstat(not_ready) <= 2)
|
||||
qt_pager(QT_NEXTTIME);
|
||||
qt_pager("nexttime");
|
||||
else
|
||||
qt_pager(QT_OTHERTIME);
|
||||
qt_pager("othertime");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,14 +48,14 @@ on_locate()
|
||||
return;
|
||||
} else if (!Qstat(first_locate)) {
|
||||
if (from_above)
|
||||
qt_pager(QT_FIRSTLOCATE);
|
||||
qt_pager("locate_first");
|
||||
/* if we've arrived from below this will be a lie, but there won't
|
||||
be any point in delivering the message upon a return visit from
|
||||
above later since the level has now been seen */
|
||||
Qstat(first_locate) = TRUE;
|
||||
} else {
|
||||
if (from_above)
|
||||
qt_pager(QT_NEXTLOCATE);
|
||||
qt_pager("locate_next");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ on_goal()
|
||||
if (Qstat(killed_nemesis)) {
|
||||
return;
|
||||
} else if (!Qstat(made_goal)) {
|
||||
qt_pager(QT_FIRSTGOAL);
|
||||
qt_pager("goal_first");
|
||||
Qstat(made_goal) = 1;
|
||||
} else {
|
||||
/*
|
||||
@@ -81,7 +81,7 @@ on_goal()
|
||||
| (1 << OBJ_BURIED));
|
||||
struct obj *qarti = find_quest_artifact(whichobjchains);
|
||||
|
||||
qt_pager(qarti ? QT_NEXTGOAL : QT_ALTGOAL);
|
||||
qt_pager(qarti ? "goal_next" : "goal_alt");
|
||||
if (Qstat(made_goal) < 7)
|
||||
Qstat(made_goal)++;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ nemdead()
|
||||
{
|
||||
if (!Qstat(killed_nemesis)) {
|
||||
Qstat(killed_nemesis) = TRUE;
|
||||
qt_pager(QT_KILLEDNEM);
|
||||
qt_pager("killed_nemesis");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ struct obj *obj;
|
||||
obj->dknown = 1;
|
||||
/* only give this message once */
|
||||
Qstat(touched_artifact) = TRUE;
|
||||
qt_pager(QT_GOTIT);
|
||||
qt_pager("gotit");
|
||||
exercise(A_WIS, TRUE);
|
||||
}
|
||||
}
|
||||
@@ -221,16 +221,16 @@ struct obj *obj; /* quest artifact; possibly null if carrying Amulet */
|
||||
struct obj *otmp;
|
||||
|
||||
if (u.uhave.amulet) { /* unlikely but not impossible */
|
||||
qt_pager(QT_HASAMULET);
|
||||
qt_pager("hasamulet");
|
||||
/* leader IDs the real amulet but ignores any fakes */
|
||||
if ((otmp = carrying(AMULET_OF_YENDOR)) != 0)
|
||||
fully_identify_obj(otmp);
|
||||
} else {
|
||||
qt_pager(!Qstat(got_thanks) ? QT_OFFEREDIT : QT_OFFEREDIT2);
|
||||
qt_pager(!Qstat(got_thanks) ? "offeredit" : "offeredit2");
|
||||
/* should have obtained bell during quest;
|
||||
if not, suggest returning for it now */
|
||||
if ((otmp = carrying(BELL_OF_OPENING)) == 0)
|
||||
com_pager(5);
|
||||
com_pager("quest_complete_no_bell");
|
||||
}
|
||||
Qstat(got_thanks) = TRUE;
|
||||
|
||||
@@ -260,7 +260,7 @@ chat_with_leader()
|
||||
|
||||
/* Rule 2: You've gone back before going for the amulet. */
|
||||
else
|
||||
qt_pager(QT_POSTHANKS);
|
||||
qt_pager("posthanks");
|
||||
|
||||
/* Rule 3: You've got the artifact and are back to return it. */
|
||||
} else if (u.uhave.questart) {
|
||||
@@ -274,16 +274,16 @@ chat_with_leader()
|
||||
|
||||
/* Rule 4: You haven't got the artifact yet. */
|
||||
} else if (Qstat(got_quest)) {
|
||||
qt_pager(rn1(10, QT_ENCOURAGE));
|
||||
qt_pager("encourage");
|
||||
|
||||
/* Rule 5: You aren't yet acceptable - or are you? */
|
||||
} else {
|
||||
if (!Qstat(met_leader)) {
|
||||
qt_pager(QT_FIRSTLEADER);
|
||||
qt_pager("leader_first");
|
||||
Qstat(met_leader) = TRUE;
|
||||
Qstat(not_ready) = 0;
|
||||
} else
|
||||
qt_pager(QT_NEXTLEADER);
|
||||
qt_pager("leader_next");
|
||||
|
||||
/* the quest leader might have passed through the portal into
|
||||
the regular dungeon; none of the remaining make sense there */
|
||||
@@ -291,16 +291,16 @@ chat_with_leader()
|
||||
return;
|
||||
|
||||
if (not_capable()) {
|
||||
qt_pager(QT_BADLEVEL);
|
||||
qt_pager("badlevel");
|
||||
exercise(A_WIS, TRUE);
|
||||
expulsion(FALSE);
|
||||
} else if (is_pure(TRUE) < 0) {
|
||||
com_pager(QT_BANISHED);
|
||||
com_pager("banished");
|
||||
expulsion(TRUE);
|
||||
} else if (is_pure(TRUE) == 0) {
|
||||
qt_pager(QT_BADALIGN);
|
||||
qt_pager("badalign");
|
||||
if (Qstat(not_ready) == MAX_QUEST_TRIES) {
|
||||
qt_pager(QT_LASTLEADER);
|
||||
qt_pager("leader_last");
|
||||
expulsion(TRUE);
|
||||
} else {
|
||||
Qstat(not_ready)++;
|
||||
@@ -308,7 +308,7 @@ chat_with_leader()
|
||||
expulsion(FALSE);
|
||||
}
|
||||
} else { /* You are worthy! */
|
||||
qt_pager(QT_ASSIGNQUEST);
|
||||
qt_pager("assignquest");
|
||||
exercise(A_WIS, TRUE);
|
||||
Qstat(got_quest) = TRUE;
|
||||
}
|
||||
@@ -330,7 +330,7 @@ struct monst *mtmp;
|
||||
return;
|
||||
|
||||
if (Qstat(pissed_off)) {
|
||||
qt_pager(QT_LASTLEADER);
|
||||
qt_pager("leader_last");
|
||||
expulsion(TRUE);
|
||||
} else
|
||||
chat_with_leader();
|
||||
@@ -340,7 +340,7 @@ static void
|
||||
chat_with_nemesis()
|
||||
{
|
||||
/* The nemesis will do most of the talking, but... */
|
||||
qt_pager(rn1(10, QT_DISCOURAGE));
|
||||
qt_pager("discourage");
|
||||
if (!Qstat(met_nemesis))
|
||||
Qstat(met_nemesis++);
|
||||
}
|
||||
@@ -350,21 +350,21 @@ nemesis_speaks()
|
||||
{
|
||||
if (!Qstat(in_battle)) {
|
||||
if (u.uhave.questart)
|
||||
qt_pager(QT_NEMWANTSIT);
|
||||
qt_pager("nemesis_wantsit");
|
||||
else if (Qstat(made_goal) == 1 || !Qstat(met_nemesis))
|
||||
qt_pager(QT_FIRSTNEMESIS);
|
||||
qt_pager("nemesis_first");
|
||||
else if (Qstat(made_goal) < 4)
|
||||
qt_pager(QT_NEXTNEMESIS);
|
||||
qt_pager("nemesis_next");
|
||||
else if (Qstat(made_goal) < 7)
|
||||
qt_pager(QT_OTHERNEMESIS);
|
||||
qt_pager("nemesis_other");
|
||||
else if (!rn2(5))
|
||||
qt_pager(rn1(10, QT_DISCOURAGE));
|
||||
qt_pager("discourage");
|
||||
if (Qstat(made_goal) < 7)
|
||||
Qstat(made_goal)++;
|
||||
Qstat(met_nemesis) = TRUE;
|
||||
} else /* he will spit out random maledictions */
|
||||
if (!rn2(5))
|
||||
qt_pager(rn1(10, QT_DISCOURAGE));
|
||||
qt_pager("discourage");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -372,9 +372,9 @@ chat_with_guardian()
|
||||
{
|
||||
/* These guys/gals really don't have much to say... */
|
||||
if (u.uhave.questart && Qstat(killed_nemesis))
|
||||
qt_pager(rn1(5, QT_GUARDTALK2));
|
||||
qt_pager("guardtalk_after");
|
||||
else
|
||||
qt_pager(rn1(5, QT_GUARDTALK));
|
||||
qt_pager("guardtalk_before");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
342
src/questpgr.c
342
src/questpgr.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 questpgr.c $NHDT-Date: 1505172128 2017/09/11 23:22:08 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.38 $ */
|
||||
/* NetHack 3.6 questpgr.c $NHDT-Date: 1574634383 2019/11/24 22:26:23 $ $NHDT-Branch: paxed-quest-lua $:$NHDT-Revision: 1.63 $ */
|
||||
/* Copyright 1991, M. Stephenson */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -9,140 +9,26 @@
|
||||
|
||||
#include "qtext.h"
|
||||
|
||||
#define QTEXT_FILE "quest.dat"
|
||||
#define QTEXT_FILE "quest.lua"
|
||||
|
||||
#ifdef TTY_GRAPHICS
|
||||
#include "wintty.h"
|
||||
#endif
|
||||
|
||||
static void NDECL(dump_qtlist);
|
||||
static void FDECL(Fread, (genericptr_t, int, int, dlb *));
|
||||
static struct qtmsg *FDECL(construct_qtlist, (long));
|
||||
static const char *NDECL(intermed);
|
||||
static struct obj *FDECL(find_qarti, (struct obj *));
|
||||
static const char *NDECL(neminame);
|
||||
static const char *NDECL(guardname);
|
||||
static const char *NDECL(homebase);
|
||||
static void FDECL(qtext_pronoun, (CHAR_P, CHAR_P));
|
||||
static struct qtmsg *FDECL(msg_in, (struct qtmsg *, int));
|
||||
static void FDECL(convert_arg, (CHAR_P));
|
||||
static void FDECL(convert_line, (char *,char *));
|
||||
static void FDECL(deliver_by_pline, (struct qtmsg *));
|
||||
static void FDECL(deliver_by_window, (struct qtmsg *, int));
|
||||
static void FDECL(deliver_by_pline, (const char *));
|
||||
static void FDECL(deliver_by_window, (const char *, int));
|
||||
static boolean FDECL(skip_pager, (BOOLEAN_P));
|
||||
|
||||
/* dump the character msg list to check appearance;
|
||||
build with DEBUG enabled and use DEBUGFILES=questpgr.c
|
||||
in sysconf file or environment */
|
||||
static void
|
||||
dump_qtlist()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
struct qtmsg *msg;
|
||||
|
||||
if (!explicitdebug(__FILE__))
|
||||
return;
|
||||
|
||||
for (msg = g.qt_list.chrole; msg->msgnum > 0; msg++) {
|
||||
(void) dlb_fseek(g.msg_file, msg->offset, SEEK_SET);
|
||||
deliver_by_window(msg, NHW_MAP);
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
Fread(ptr, size, nitems, stream)
|
||||
genericptr_t ptr;
|
||||
int size, nitems;
|
||||
dlb *stream;
|
||||
{
|
||||
int cnt;
|
||||
|
||||
if ((cnt = dlb_fread(ptr, size, nitems, stream)) != nitems) {
|
||||
panic("PREMATURE EOF ON QUEST TEXT FILE! Expected %d bytes, got %d",
|
||||
(size * nitems), (size * cnt));
|
||||
}
|
||||
}
|
||||
|
||||
static struct qtmsg *
|
||||
construct_qtlist(hdr_offset)
|
||||
long hdr_offset;
|
||||
{
|
||||
struct qtmsg *msg_list;
|
||||
int n_msgs;
|
||||
|
||||
(void) dlb_fseek(g.msg_file, hdr_offset, SEEK_SET);
|
||||
Fread(&n_msgs, sizeof(int), 1, g.msg_file);
|
||||
msg_list = (struct qtmsg *) alloc((unsigned) (n_msgs + 1)
|
||||
* sizeof (struct qtmsg));
|
||||
|
||||
/*
|
||||
* Load up the list.
|
||||
*/
|
||||
Fread((genericptr_t) msg_list, n_msgs * sizeof (struct qtmsg), 1,
|
||||
g.msg_file);
|
||||
|
||||
msg_list[n_msgs].msgnum = -1;
|
||||
return msg_list;
|
||||
}
|
||||
|
||||
void
|
||||
load_qtlist()
|
||||
{
|
||||
int n_classes, i;
|
||||
char qt_classes[N_HDR][LEN_HDR];
|
||||
long qt_offsets[N_HDR];
|
||||
|
||||
g.msg_file = dlb_fopen(QTEXT_FILE, RDBMODE);
|
||||
if (!g.msg_file)
|
||||
panic("CANNOT OPEN QUEST TEXT FILE %s.", QTEXT_FILE);
|
||||
|
||||
/*
|
||||
* Read in the number of classes, then the ID's & offsets for
|
||||
* each header.
|
||||
*/
|
||||
|
||||
Fread(&n_classes, sizeof (int), 1, g.msg_file);
|
||||
Fread(&qt_classes[0][0], sizeof (char) * LEN_HDR, n_classes, g.msg_file);
|
||||
Fread(qt_offsets, sizeof (long), n_classes, g.msg_file);
|
||||
|
||||
/*
|
||||
* Now construct the message lists for quick reference later
|
||||
* on when we are actually paging the messages out.
|
||||
*/
|
||||
|
||||
g.qt_list.common = g.qt_list.chrole = (struct qtmsg *) 0;
|
||||
|
||||
for (i = 0; i < n_classes; i++) {
|
||||
if (!strncmp(COMMON_ID, qt_classes[i], LEN_HDR))
|
||||
g.qt_list.common = construct_qtlist(qt_offsets[i]);
|
||||
else if (!strncmp(g.urole.filecode, qt_classes[i], LEN_HDR))
|
||||
g.qt_list.chrole = construct_qtlist(qt_offsets[i]);
|
||||
#if 0 /* UNUSED but available */
|
||||
else if (!strncmp(g.urace.filecode, qt_classes[i], LEN_HDR))
|
||||
g.qt_list.chrace = construct_qtlist(qt_offsets[i]);
|
||||
#if 0
|
||||
static struct qtmsg *FDECL(msg_in, (struct qtmsg *, int));
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!g.qt_list.common || !g.qt_list.chrole)
|
||||
impossible("load_qtlist: cannot load quest text.");
|
||||
dump_qtlist();
|
||||
return; /* no ***DON'T*** close the msg_file */
|
||||
}
|
||||
|
||||
/* called at program exit */
|
||||
void
|
||||
unload_qtlist()
|
||||
{
|
||||
if (g.msg_file)
|
||||
(void) dlb_fclose(g.msg_file), g.msg_file = 0;
|
||||
if (g.qt_list.common)
|
||||
free((genericptr_t) g.qt_list.common), g.qt_list.common = 0;
|
||||
if (g.qt_list.chrole)
|
||||
free((genericptr_t) g.qt_list.chrole), g.qt_list.chrole = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
short
|
||||
quest_info(typ)
|
||||
@@ -304,6 +190,7 @@ char who, /* 'd' => deity, 'l' => leader, 'n' => nemesis, 'o' => artifact */
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static struct qtmsg *
|
||||
msg_in(qtm_list, msgnum)
|
||||
struct qtmsg *qtm_list;
|
||||
@@ -317,6 +204,7 @@ int msgnum;
|
||||
|
||||
return (struct qtmsg *) 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
convert_arg(c)
|
||||
@@ -415,10 +303,9 @@ convert_line(in_line, out_line)
|
||||
char *in_line, *out_line;
|
||||
{
|
||||
char *c, *cc;
|
||||
char xbuf[BUFSZ];
|
||||
|
||||
cc = out_line;
|
||||
for (c = xcrypt(in_line, xbuf); *c; c++) {
|
||||
for (c = in_line; *c; c++) {
|
||||
*cc = 0;
|
||||
switch (*c) {
|
||||
case '\r':
|
||||
@@ -505,142 +392,155 @@ char *in_line, *out_line;
|
||||
}
|
||||
|
||||
static void
|
||||
deliver_by_pline(qt_msg)
|
||||
struct qtmsg *qt_msg;
|
||||
deliver_by_pline(str)
|
||||
const char *str;
|
||||
{
|
||||
long size;
|
||||
char in_line[BUFSZ], out_line[BUFSZ];
|
||||
|
||||
*in_line = '\0';
|
||||
for (size = 0; size < qt_msg->size; size += (long) strlen(in_line)) {
|
||||
(void) dlb_fgets(in_line, sizeof in_line, g.msg_file);
|
||||
convert_line(in_line, out_line);
|
||||
pline("%s", out_line);
|
||||
}
|
||||
Strcpy(in_line, str);
|
||||
convert_line(in_line, out_line);
|
||||
pline("%s", out_line);
|
||||
}
|
||||
|
||||
static void
|
||||
deliver_by_window(qt_msg, how)
|
||||
struct qtmsg *qt_msg;
|
||||
deliver_by_window(msg, how)
|
||||
const char *msg;
|
||||
int how;
|
||||
{
|
||||
long size;
|
||||
const char *msgp = msg;
|
||||
const char *msgend = eos((char *)msg);
|
||||
char in_line[BUFSZ], out_line[BUFSZ];
|
||||
boolean qtdump = (how == NHW_MAP);
|
||||
winid datawin = create_nhwindow(qtdump ? NHW_TEXT : how);
|
||||
winid datawin = create_nhwindow(how);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (qtdump) {
|
||||
char buf[BUFSZ];
|
||||
|
||||
/* when dumping quest messages at startup, all of them are passed to
|
||||
* deliver_by_window(), even if normally given to deliver_by_pline()
|
||||
*/
|
||||
Sprintf(buf, "msgnum: %d, delivery: %c",
|
||||
qt_msg->msgnum, qt_msg->delivery);
|
||||
putstr(datawin, 0, buf);
|
||||
putstr(datawin, 0, "");
|
||||
}
|
||||
#endif
|
||||
for (size = 0; size < qt_msg->size; size += (long) strlen(in_line)) {
|
||||
(void) dlb_fgets(in_line, sizeof in_line, g.msg_file);
|
||||
while (msgp && msgp != msgend) {
|
||||
int i = 0;
|
||||
while (*msgp != '\0' && *msgp != '\n' && (i < BUFSZ-2)) {
|
||||
in_line[i] = *msgp;
|
||||
i++;
|
||||
msgp++;
|
||||
}
|
||||
if (*msgp == '\n')
|
||||
msgp++;
|
||||
in_line[i] = '\0';
|
||||
convert_line(in_line, out_line);
|
||||
putstr(datawin, 0, out_line);
|
||||
}
|
||||
|
||||
display_nhwindow(datawin, TRUE);
|
||||
destroy_nhwindow(datawin);
|
||||
|
||||
/* block messages delivered by window aren't kept in message history
|
||||
but have a one-line summary which is put there for ^P recall */
|
||||
*out_line = '\0';
|
||||
if (qt_msg->summary_size) {
|
||||
(void) dlb_fgets(in_line, sizeof in_line, g.msg_file);
|
||||
convert_line(in_line, out_line);
|
||||
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
|
||||
} else if (qt_msg->delivery == 'c') { /* skip for 'qtdump' of 'p' */
|
||||
/* delivery 'c' and !summary_size, summary expected but not present;
|
||||
this doesn't prefix the number with role code vs 'general'
|
||||
but should be good enough for summary verification purposes */
|
||||
Sprintf(out_line, "[missing block message summary for #%05d]",
|
||||
qt_msg->msgnum);
|
||||
#endif
|
||||
}
|
||||
if (*out_line)
|
||||
putmsghistory(out_line, FALSE);
|
||||
}
|
||||
|
||||
static boolean
|
||||
skip_pager(common)
|
||||
boolean common;
|
||||
boolean common UNUSED;
|
||||
{
|
||||
/* WIZKIT: suppress plot feedback if starting with quest artifact */
|
||||
if (g.program_state.wizkit_wishing)
|
||||
return TRUE;
|
||||
if (!(common ? g.qt_list.common : g.qt_list.chrole)) {
|
||||
panic("%s: no %s quest text data available",
|
||||
common ? "com_pager" : "qt_pager",
|
||||
common ? "common" : "role-specific");
|
||||
/*NOTREACHED*/
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
com_pager(msgnum)
|
||||
int msgnum;
|
||||
boolean
|
||||
com_pager_core(section, msgid)
|
||||
const char *section;
|
||||
const char *msgid;
|
||||
{
|
||||
struct qtmsg *qt_msg;
|
||||
const char *const howtoput[] = { "pline", "window", "menu", NULL };
|
||||
const int howtoput2i[] = { 1, 2, 3, 0 };
|
||||
int output;
|
||||
lua_State *L;
|
||||
char *synopsis;
|
||||
char *text;
|
||||
|
||||
if (skip_pager(TRUE))
|
||||
return;
|
||||
return FALSE;
|
||||
|
||||
if (!(qt_msg = msg_in(g.qt_list.common, msgnum))) {
|
||||
impossible("com_pager: message %d not found.", msgnum);
|
||||
return;
|
||||
L = nhl_init();
|
||||
|
||||
if (!nhl_loadlua(L, QTEXT_FILE)) {
|
||||
impossible("com_pager: %s not found.", QTEXT_FILE);
|
||||
lua_close(L);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
(void) dlb_fseek(g.msg_file, qt_msg->offset, SEEK_SET);
|
||||
if (qt_msg->delivery == 'p')
|
||||
deliver_by_pline(qt_msg);
|
||||
else if (msgnum == 1)
|
||||
deliver_by_window(qt_msg, NHW_MENU);
|
||||
lua_settop(L, 0);
|
||||
lua_getglobal(L, "questtext");
|
||||
if (!lua_istable(L, -1)) {
|
||||
impossible("com_pager: questtext in %s is not a lua table", QTEXT_FILE);
|
||||
lua_close(L);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
lua_getfield(L, -1, section);
|
||||
if (!lua_istable(L, -1)) {
|
||||
impossible("com_pager: questtext[%s] in %s is not a lua table", section, QTEXT_FILE);
|
||||
lua_close(L);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
lua_getfield(L, -1, msgid);
|
||||
if (!lua_istable(L, -1)) {
|
||||
impossible("com_pager: questtext[%s][%s] in %s is not a lua table", section, msgid, QTEXT_FILE);
|
||||
lua_close(L);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
synopsis = get_table_str_opt(L, "synopsis", NULL);
|
||||
text = get_table_str_opt(L, "text", NULL);
|
||||
output = howtoput2i[get_table_option(L, "output", "pline", howtoput)];
|
||||
|
||||
if (!synopsis && !text) {
|
||||
int nelems;
|
||||
lua_len(L, -1);
|
||||
nelems = LUA_INTCAST(lua_tointeger(L, -1));
|
||||
lua_pop(L, 1);
|
||||
if (nelems < 2) {
|
||||
impossible("com_pager: questtext[%s][%s] in %s in not an array of strings", section, msgid, QTEXT_FILE);
|
||||
lua_close(L);
|
||||
return FALSE;
|
||||
}
|
||||
nelems = rn2(nelems) + 1;
|
||||
lua_pushinteger(L, nelems);
|
||||
lua_gettable(L, -2);
|
||||
text = dupstr(luaL_checkstring(L, -1));
|
||||
}
|
||||
|
||||
if ((index(text, '\n') || (strlen(text) >= (BUFSZ - 1))) && output == 1)
|
||||
output = 2;
|
||||
|
||||
if (output == 1)
|
||||
deliver_by_pline(text);
|
||||
else if (output == 3)
|
||||
deliver_by_window(text, NHW_MENU);
|
||||
else
|
||||
deliver_by_window(qt_msg, NHW_TEXT);
|
||||
return;
|
||||
deliver_by_window(text, NHW_TEXT);
|
||||
|
||||
if (synopsis) {
|
||||
char in_line[BUFSZ], out_line[BUFSZ];
|
||||
Strcpy(in_line, synopsis);
|
||||
convert_line(in_line, out_line);
|
||||
putmsghistory(out_line, FALSE);
|
||||
}
|
||||
|
||||
free(synopsis);
|
||||
free(text);
|
||||
lua_close(L);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
qt_pager(msgnum)
|
||||
int msgnum;
|
||||
com_pager(msgid)
|
||||
const char *msgid;
|
||||
{
|
||||
struct qtmsg *qt_msg;
|
||||
com_pager_core("common", msgid);
|
||||
}
|
||||
|
||||
if (skip_pager(FALSE))
|
||||
return;
|
||||
|
||||
qt_msg = msg_in(g.qt_list.chrole, msgnum);
|
||||
if (!qt_msg) {
|
||||
/* some roles have an alternate message for return to the goal
|
||||
level when the quest artifact is absent (handled by caller)
|
||||
but some don't; for the latter, use the normal goal message;
|
||||
note: for first visit, artifact is assumed to always be
|
||||
present which might not be true for wizard mode but we don't
|
||||
worry about quest message references in that situation */
|
||||
if (msgnum == QT_ALTGOAL)
|
||||
qt_msg = msg_in(g.qt_list.chrole, QT_NEXTGOAL);
|
||||
}
|
||||
if (!qt_msg) {
|
||||
impossible("qt_pager: message %d not found.", msgnum);
|
||||
return;
|
||||
}
|
||||
|
||||
(void) dlb_fseek(g.msg_file, qt_msg->offset, SEEK_SET);
|
||||
if (qt_msg->delivery == 'p' && strcmp(windowprocs.name, "X11"))
|
||||
deliver_by_pline(qt_msg);
|
||||
else
|
||||
deliver_by_window(qt_msg, NHW_TEXT);
|
||||
return;
|
||||
void
|
||||
qt_pager(msgid)
|
||||
const char *msgid;
|
||||
{
|
||||
if (!com_pager_core(g.urole.filecode, msgid))
|
||||
com_pager_core("common", msgid);
|
||||
}
|
||||
|
||||
struct permonst *
|
||||
@@ -674,8 +574,6 @@ deliver_splev_message()
|
||||
/* copying will stop at newline if one is present */
|
||||
copynchars(in_line, str, (int) (sizeof in_line) - 1);
|
||||
|
||||
/* convert_line() expects encrypted input */
|
||||
(void) xcrypt(in_line, in_line);
|
||||
convert_line(in_line, out_line);
|
||||
pline("%s", out_line);
|
||||
|
||||
|
||||
@@ -1104,7 +1104,6 @@ NHFILE *nhfp;
|
||||
*/
|
||||
inven_inuse(FALSE);
|
||||
|
||||
load_qtlist(); /* re-load the quest text info */
|
||||
/* Set up the vision internals, after levl[] data is loaded
|
||||
but before docrt(). */
|
||||
reglyph_darkroom();
|
||||
|
||||
@@ -1285,7 +1285,6 @@ freedynamicdata()
|
||||
#endif
|
||||
zero_nhfile(&tnhfp); /* also sets fd to -1 */
|
||||
tnhfp.mode = FREEING;
|
||||
unload_qtlist();
|
||||
free_menu_coloring();
|
||||
free_invbuf(); /* let_to_name (invent.c) */
|
||||
free_youbuf(); /* You_buf,&c (pline.c) */
|
||||
|
||||
@@ -44,7 +44,9 @@ const char *NetHack_git_sha
|
||||
#if !defined(CROSSCOMPILE) || (defined(CROSSCOMPILE) && defined(CROSSCOMPILE_HOST))
|
||||
= NETHACK_GIT_SHA
|
||||
#else
|
||||
= NETHACK_HOST_GIT_SHA
|
||||
#ifdef NETHACK_HOST_GIT_SHA
|
||||
= NETHACK_HOST_GIT_SHA
|
||||
#endif
|
||||
#endif
|
||||
;
|
||||
#endif
|
||||
@@ -54,8 +56,10 @@ const char *NetHack_git_branch
|
||||
#if !defined(CROSSCOMPILE) || (defined(CROSSCOMPILE) && defined(CROSSCOMPILE_HOST))
|
||||
= NETHACK_GIT_BRANCH
|
||||
#else
|
||||
#ifdef NETHACK_HOST_GIT_BRANCH
|
||||
= NETHACK_HOST_GIT_BRANCH
|
||||
#endif
|
||||
#endif
|
||||
;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -762,13 +762,14 @@ register struct monst *mtmp;
|
||||
random_insult[rn2(SIZE(random_insult))]);
|
||||
} else if (is_lminion(mtmp)
|
||||
&& !(mtmp->isminion && EMIN(mtmp)->renegade)) {
|
||||
com_pager(rn2(QTN_ANGELIC - 1 + (Hallucination ? 1 : 0))
|
||||
+ QT_ANGELIC);
|
||||
com_pager("angel_cuss"); /* TODO: the Hallucination msg */
|
||||
/*com_pager(rn2(QTN_ANGELIC - 1 + (Hallucination ? 1 : 0))
|
||||
+ QT_ANGELIC);*/
|
||||
} else {
|
||||
if (!rn2(is_minion(mtmp->data) ? 100 : 5))
|
||||
pline("%s casts aspersions on your ancestry.", Monnam(mtmp));
|
||||
else
|
||||
com_pager(rn2(QTN_DEMONIC) + QT_DEMONIC);
|
||||
com_pager("demon_cuss");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -318,6 +318,7 @@ VVOBJ = $(O)version.o
|
||||
|
||||
ifeq "$(ADD_LUA)" "Y"
|
||||
LUAOBJ = $(O)nhlua.o $(O)nhlsel.o
|
||||
LUA_QTEXT_FILE = "quest.lua"
|
||||
endif
|
||||
|
||||
ifeq "$(ADD_CURSES)" "Y"
|
||||
@@ -1004,8 +1005,10 @@ $(DAT)/data: $(O)utility.tag $(DATABASE)
|
||||
$(DAT)/rumors: $(O)utility.tag $(DAT)/rumors.tru $(DAT)/rumors.fal
|
||||
@$(subst /,\,$(U)makedefs.exe -r)
|
||||
|
||||
ifndef LUA_QTEXT_FILE
|
||||
$(DAT)/quest.dat: $(O)utility.tag $(DAT)/quest.txt
|
||||
@$(subst /,\,$(U)makedefs.exe -q)
|
||||
endif
|
||||
|
||||
$(DAT)/oracles: $(O)utility.tag $(DAT)/oracles.txt
|
||||
@$(subst /,\,$(U)makedefs.exe -h)
|
||||
@@ -1029,12 +1032,19 @@ $(O)sp_lev.tag: $(O)utility.tag
|
||||
#note that dir below assumes bin/dir.exe from djgpp distribution
|
||||
#
|
||||
$(DAT)/nhdat: $(U)dlb_main.exe $(DAT)/data $(DAT)/rumors \
|
||||
$(DAT)/oracles $(DAT)/quest.dat $(O)sp_lev.tag \
|
||||
$(DAT)/bogusmon $(DAT)/engrave $(DAT)/epitaph $(DAT)/tribute
|
||||
$(DAT)/oracles \
|
||||
ifndef LUA_QTEXT_FILE
|
||||
$(DAT)/quest.dat \
|
||||
endif
|
||||
$(O)sp_lev.tag \
|
||||
$(DAT)/bogusmon $(DAT)/engrave $(DAT)/epitaph $(DAT)/tribute
|
||||
@$(subst /,\,echo dat done >$(O)dat.tag)
|
||||
@$(subst /,\,cd $(DAT))
|
||||
@$(subst /,\,copy $(MSYS)/msdoshlp.txt .)
|
||||
@$(LS) data oracles options quest.dat rumors help hh >dlb.lst
|
||||
@$(LS) data oracles options rumors help hh >dlb.lst
|
||||
ifndef LUA_QTEXT_FILE
|
||||
@$(LS) quest.dat >>dlb.lst
|
||||
endif
|
||||
@$(LS) cmdhelp history opthelp wizhelp license msdoshlp.txt >>dlb.lst
|
||||
@$(LS) bogusmon engrave epitaph tribute >>dlb.lst
|
||||
$(LS) $(subst /,\,*.lua) >>dlb.lst
|
||||
@@ -1083,7 +1093,9 @@ spotless: clean
|
||||
$(subst /,\,if exist $(DAT)/data del $(DAT)/data)
|
||||
$(subst /,\,if exist $(DAT)/rumors del $(DAT)/rumors)
|
||||
$(subst /,\,if exist $(DAT)/oracles del $(DAT)/oracles)
|
||||
ifndef LUA_QTEXT_FILE
|
||||
$(subst /,\,if exist $(DAT)/quest.dat del $(DAT)/quest.dat)
|
||||
endif
|
||||
$(subst /,\,if exist $(DAT)/bogusmon del $(DAT)/bogusmon)
|
||||
$(subst /,\,if exist $(DAT)/engrave del $(DAT)/engrave)
|
||||
$(subst /,\,if exist $(DAT)/epitaph del $(DAT)/epitaph)
|
||||
@@ -1165,7 +1177,9 @@ spotless: clean
|
||||
$(subst /,\,if exist $(DAT)/data del $(DAT)/data)
|
||||
$(subst /,\,if exist $(DAT)/rumors del $(DAT)/rumors)
|
||||
$(subst /,\,if exist $(DAT)/oracles del $(DAT)/oracles)
|
||||
ifndef LUA_QTEXT_FILE
|
||||
$(subst /,\,if exist $(DAT)/quest.dat del $(DAT)/quest.dat)
|
||||
endif
|
||||
$(subst /,\,if exist $(DAT)/bogusmon del $(DAT)/bogusmon)
|
||||
$(subst /,\,if exist $(DAT)/engrave del $(DAT)/engrave)
|
||||
$(subst /,\,if exist $(DAT)/epitaph del $(DAT)/epitaph)
|
||||
|
||||
@@ -121,6 +121,8 @@ MAKESRC = makedefs.c
|
||||
|
||||
MAKEDEFSOBJS = $(HOST_O)makedefs.o $(HOST_O)monst.o $(HOST_O)objects.o
|
||||
|
||||
LUA_QTEXT_FILE = "quest.lua"
|
||||
|
||||
#SPLEVSRC = lev_yacc.c lev_$(LEX).c lev_main.c panic.c
|
||||
#DGNCOMPSRC = dgn_yacc.c dgn_$(LEX).c dgn_main.c
|
||||
#SPLEVOBJS = $(HOST_O)lev_yacc.o $(HOST_O)lev_$(LEX).o $(HOST_O)lev_main.o $(HOST_O)alloc.o \
|
||||
@@ -312,8 +314,8 @@ $(HOST_O)prereq.tag: hobj.tag $(U)makedefs $(HOST_O)utility.tag \
|
||||
#note that dir below assumes bin/dir from djgpp distribution
|
||||
#
|
||||
$(DAT)/nhdat: $(U)dlb_main $(DAT)/data $(DAT)/rumors \
|
||||
$(DAT)/oracles $(DAT)/quest.dat \
|
||||
$(DAT)/bogusmon $(DAT)/engrave $(DAT)/epitaph $(DAT)/tribute
|
||||
$(DAT)/oracles \
|
||||
$(DAT)/bogusmon $(DAT)/engrave $(DAT)/epitaph $(DAT)/tribute
|
||||
cd $(DAT); \
|
||||
pwd; \
|
||||
cp $(MSYS)/msdoshlp.txt .; \
|
||||
@@ -321,7 +323,7 @@ $(DAT)/nhdat: $(U)dlb_main $(DAT)/data $(DAT)/rumors \
|
||||
ls -1 cmdhelp history opthelp wizhelp license >>dlb.lst; \
|
||||
ls -1 bogusmon engrave epitaph tribute msdoshlp.txt >>dlb.lst; \
|
||||
ls -1 *.lua >>dlb.lst; \
|
||||
$(U)dlb_main cvIf dlb.lst nhdat
|
||||
$(U)dlb_main cvIf dlb.lst nhdat; \
|
||||
cd $(SRC)
|
||||
|
||||
$(U)dlb_main: $(DLBOBJS)
|
||||
@@ -361,8 +363,10 @@ $(DAT)/rumors: $(HOST_O)utility.tag $(DAT)/rumors.tru $(DAT)/rumors.fal
|
||||
$(DAT)/oracles: $(HOST_O)utility.tag $(DAT)/oracles.txt
|
||||
$(U)makedefs -h
|
||||
|
||||
ifndef LUA_QTEXT_FILE
|
||||
$(DAT)/quest.dat: $(HOST_O)utility.tag $(DAT)/quest.txt
|
||||
$(U)makedefs -q
|
||||
endif
|
||||
|
||||
$(DAT)/bogusmon: $(HOST_O)utility.tag $(DAT)/bogusmon.txt
|
||||
$(U)makedefs -s
|
||||
@@ -581,7 +585,7 @@ spotless: clean
|
||||
# if [ -f $(DAT)/dungeon.pdf ]; then rm $(DAT)/dungeon.pdf; fi;
|
||||
# if [ -f $(DAT)/dungeon ]; then rm $(DAT)/dungeon; fi;
|
||||
# if [ -f $(DAT)/oracles ]; then rm $(DAT)/oracles; fi;
|
||||
# if [ -f $(DAT)/quest.dat ]; then rm $(DAT)/quest.dat; fi;
|
||||
## if [ -f $(DAT)/quest.dat ]; then rm $(DAT)/quest.dat; fi;
|
||||
# if [ -f $(DAT)/bogusmon ]; then rm $(DAT)/bogusmon; fi;
|
||||
# if [ -f $(DAT)/engrave ]; then rm $(DAT)/engrave; fi;
|
||||
# if [ -f $(DAT)/epitaph ]; then rm $(DAT)/epitaph; fi;
|
||||
|
||||
@@ -321,6 +321,7 @@ MDLIB = $(O)mdlib.o
|
||||
|
||||
ifeq "$(ADD_LUA)" "Y"
|
||||
LUAOBJ = $(O)nhlua.o $(O)nhlsel.o
|
||||
LUA_QTEXT_FILE = "quest.lua"
|
||||
endif
|
||||
|
||||
ifeq "$(ADD_CURSES)" "Y"
|
||||
@@ -622,10 +623,8 @@ endif
|
||||
if [ -f $(DAT)/symbols ]; then cp $(DAT)/symbols $(GAMEDIR)/SYMBOLS; fi;
|
||||
if [ -f $(SSHR)/NetHack.cnf ]; then cp $(SSHR)/NetHack.cnf $(GAMEDIR)/NETHACK.CNF; fi;
|
||||
-touch $(GAMEDIR)/RECORD
|
||||
if [ -f ../sys/winnt/sysconf.template ]; then cp ../sys/winnt/sysconf.template $(GAMEDIR)/SYSCONF; fi;
|
||||
if [ -f ../sys/msdos/sysconf ]; then cp ../sys/msdos/sysconf $(GAMEDIR)/SYSCONF; fi;
|
||||
if [ -f $(DOC)/nethack.txt ]; then cp $(DOC)/nethack.txt $(GAMEDIR)/NETHACK.TXT; fi;
|
||||
# if [ -f $(PLANAR_TIB) ]; then cp $(PLANAR_TIB) $(GAMEDIR)/$(PLANAR_TIB^^); fi;
|
||||
# if [ -f $(OVERVIEW_TIB ]; then cp $(OVERVIEW_TIB) $(GAMEDIR)/$(OVERVIEW_TIB^^); fi;
|
||||
@echo install done > $@
|
||||
|
||||
#==========================================
|
||||
@@ -834,7 +833,9 @@ spotless: clean
|
||||
if [ -f $(DAT)/data ]; then rm $(DAT)/data; fi;
|
||||
if [ -f $(DAT)/rumors ]; then rm $(DAT)/rumors; fi;
|
||||
if [ -f $(DAT)/oracles ]; then rm $(DAT)/oracles; fi;
|
||||
ifndef LUA_QTEXT_FILE
|
||||
if [ -f $(DAT)/quest.dat ]; then rm $(DAT)/quest.dat; fi;
|
||||
endif
|
||||
if [ -f $(DAT)/bogusmon ]; then rm $(DAT)/bogusmon; fi;
|
||||
if [ -f $(DAT)/engrave ]; then rm $(DAT)/engrave; fi;
|
||||
if [ -f $(DAT)/epitaph ]; then rm $(DAT)/epitaph; fi;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
#set -x
|
||||
if [ -z "$TRAVIS_BUILD_DIR" ]; then
|
||||
export DJGPP_TOP=$(pwd)/djgpp
|
||||
else
|
||||
@@ -27,7 +27,12 @@ DJGPP_URL="$DJGPP_URL$DJGPP_FILE"
|
||||
|
||||
cd util
|
||||
if [ ! -f "$DJGPP_FILE" ]; then
|
||||
wget --no-hsts "$DJGPP_URL"
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
#Mac
|
||||
curl -L $DJGPP_URL -o $DJGPP_FILE
|
||||
else
|
||||
wget --no-hsts "$DJGPP_URL"
|
||||
fi
|
||||
fi
|
||||
cd ../
|
||||
|
||||
@@ -50,12 +55,17 @@ fi
|
||||
# DOS-extender for use with djgpp
|
||||
cd djgpp
|
||||
if [ ! -d cwsdpmi ]; then
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
#Mac
|
||||
curl http://sandmann.dotster.com/cwsdpmi/csdpmi7b.zip -o csdpmi7b.zip
|
||||
else
|
||||
wget --no-hsts http://sandmann.dotster.com/cwsdpmi/csdpmi7b.zip
|
||||
mkdir -p cwsdpmi
|
||||
cd cwsdpmi
|
||||
unzip ../csdpmi7b.zip
|
||||
cd ../
|
||||
rm csdpmi7b.zip
|
||||
fi
|
||||
mkdir -p cwsdpmi
|
||||
cd cwsdpmi
|
||||
unzip ../csdpmi7b.zip
|
||||
cd ../
|
||||
rm csdpmi7b.zip
|
||||
fi
|
||||
cd ../
|
||||
|
||||
|
||||
103
sys/msdos/sysconf
Normal file
103
sys/msdos/sysconf
Normal file
@@ -0,0 +1,103 @@
|
||||
#
|
||||
# NetHack 3.7 sysconf $NHDT-Date: 1524689357 2018/04/25 20:49:17 $ $NHDT-Branch: NetHack-3.7.0 $:$NHDT-Revision: 1.22 $
|
||||
# Copyright (c) 2015 by Michael Allison
|
||||
# NetHack may be freely redistributed. See license for details.
|
||||
#
|
||||
# Sample sysconf file.
|
||||
# The sysconf file is only used if NetHack is compiled with SYSCF defined.
|
||||
# This file uses the same syntax as nethack.cnf.
|
||||
|
||||
# Which users can use WIZARD (debugging) mode (the -D flag).
|
||||
# A value of * allows anyone to enter debugging mode.
|
||||
WIZARDS=*
|
||||
|
||||
# Users allowed to use the ! (shell escape) command or to suspend the game.
|
||||
# Uses the same syntax as the WIZARDS option above.
|
||||
#SHELLERS=
|
||||
|
||||
# Show debugging information originating from these source files.
|
||||
# Use '*' for all, or list source files separated by spaces.
|
||||
# Only available if game has been compiled with DEBUG.
|
||||
#DEBUGFILES=*
|
||||
|
||||
# Save end of game dump log to this file.
|
||||
# Only available if NetHack was compiled with DUMPLOG
|
||||
# Allows following placeholders:
|
||||
# %% literal '%'
|
||||
# %v version (eg. "3.7.0-0")
|
||||
# %u game UID
|
||||
# %t game start time, UNIX timestamp format
|
||||
# %T current time, UNIX timestamp format
|
||||
# %d game start time, YYYYMMDDhhmmss format
|
||||
# %D current time, YYYYMMDDhhmmss format
|
||||
# %n player name
|
||||
# %N first character of player name
|
||||
#DUMPLOGFILE=nethack-%n-%d.log
|
||||
|
||||
# Number of bones file pools.
|
||||
# The pool you belong to is determined at game start. You will
|
||||
# load and save bones only from that pool. Generally useful
|
||||
# for public servers only.
|
||||
# Changing this might make existing bones inaccessible.
|
||||
# Disabled by setting to 0, or commenting out.
|
||||
#BONES_POOLS=10
|
||||
|
||||
# Limit the number of simultaneous games (see also nethack.sh).
|
||||
#MAXPLAYERS=10
|
||||
|
||||
# If not null, added to string "To get local support, " in the support
|
||||
# information help.
|
||||
#SUPPORT=call Izchak at extension 42.
|
||||
|
||||
# Uncomment the next line to disable the SEDUCE option.
|
||||
#SEDUCE=0
|
||||
|
||||
# Uncomment the next line to enable some accessibility features such
|
||||
# as S_hero_override and S_pet_override symbols for screen readers
|
||||
# in the user config file.
|
||||
#ACCESSIBILITY=1
|
||||
|
||||
# Record (high score) file options.
|
||||
# CAUTION: changing these after people have started playing games can
|
||||
# lead to lost high scores!
|
||||
# Maximum entries for one person.
|
||||
#PERSMAX=10
|
||||
# Maximum entries in the record file.
|
||||
#ENTRYMAX=100
|
||||
# Minimum points to get an entry.
|
||||
#POINTSMIN=1
|
||||
# Determine identity of "person" in the score file with name (0) or
|
||||
# numeric (1) user id.
|
||||
#PERS_IS_UID=1
|
||||
|
||||
# Maximum number of score file entries to use for random statue names
|
||||
#MAX_STATUENAME_RANK=10
|
||||
|
||||
# *** LOCATIONS ***
|
||||
# IMPORTANT: If you change any of these locations, the directories they
|
||||
# point at must exist. NetHack will not create them for you.
|
||||
#
|
||||
# The location that users can adjust their config file startup options
|
||||
#CONFIGDIR=C:\NETHACK
|
||||
#
|
||||
# The location that a record of game aborts and self-diagnosed game problems
|
||||
# is kept (default=HACKDIR, writeable)
|
||||
#TROUBLEDIR=C:\NETHACK
|
||||
#
|
||||
# The location that documentation and helps files are placed
|
||||
#HACKDIR=C:\NETHACK
|
||||
#
|
||||
# The location that level files in progress are stored (writeable)
|
||||
#LEVELDIR=C:\NETHACK\LEVELS
|
||||
#
|
||||
# The location where saved games are kept (writeable)
|
||||
#SAVEDIR=C:\NETHACK\SAVES
|
||||
#
|
||||
# The location that bones files are kept (writeable)
|
||||
#BONESDIR=C:\NETHACK\BONES
|
||||
#
|
||||
# The location that score files are kept (writeable)
|
||||
#SCOREDIR=C:\NETHACK
|
||||
#
|
||||
# The location that file synchronization locks are stored (writeable)
|
||||
#LOCKDIR=C:\NETHACK
|
||||
@@ -9,7 +9,7 @@ NHSROOT=..
|
||||
# SHELL=E:/GEMINI2/MUPFEL.TTP
|
||||
# UUDECODE=uudecode
|
||||
|
||||
VARDAT = bogusmon data engrave epitaph rumors quest.dat oracles options
|
||||
VARDAT = bogusmon data engrave epitaph rumors oracles options
|
||||
|
||||
all: $(VARDAT) spec_levs quest_levs
|
||||
|
||||
@@ -100,9 +100,6 @@ data: data.base ../util/makedefs
|
||||
rumors: rumors.tru rumors.fal ../util/makedefs
|
||||
../util/makedefs -r
|
||||
|
||||
quest.dat: quest.txt ../util/makedefs
|
||||
../util/makedefs -q
|
||||
|
||||
oracles: oracles.txt ../util/makedefs
|
||||
../util/makedefs -h
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ DIRPERM = 0755
|
||||
# for Gnome
|
||||
# VARDATND = x11tiles pet_mark.xbm pilemark.xbm rip.xpm mapbg.xpm
|
||||
|
||||
VARDATD = bogusmon data engrave epitaph oracles options quest.dat rumors
|
||||
VARDATD = bogusmon data engrave epitaph oracles options quest.lua rumors
|
||||
VARDAT = $(VARDATD) $(VARDATND)
|
||||
|
||||
# Some versions of make use the SHELL environment variable as the shell
|
||||
@@ -133,8 +133,7 @@ oracles: $(GAME)
|
||||
options: $(GAME)
|
||||
( cd dat ; $(MAKE) options )
|
||||
|
||||
quest.dat: $(GAME)
|
||||
( cd dat ; $(MAKE) quest.dat )
|
||||
quest.lua: $(GAME)
|
||||
|
||||
spec_levs:
|
||||
( cd dat ; $(MAKE) spec_levs )
|
||||
@@ -247,9 +246,6 @@ fetch-Lua:
|
||||
update: $(GAME) recover $(VARDAT) spec_levs
|
||||
# (don't yank the old version out from under people who're playing it)
|
||||
-mv $(INSTDIR)/$(GAME) $(INSTDIR)/$(GAME).old
|
||||
# quest.dat is also kept open and has the same problems over NFS
|
||||
# (quest.dat may be inside nhdat if dlb is in use)
|
||||
-mv $(INSTDIR)/quest.dat $(INSTDIR)/quest.dat.old
|
||||
-mv $(INSTDIR)/nhdat $(INSTDIR)/nhdat.old
|
||||
# set up new versions of the game files
|
||||
( $(MAKE) dofiles )
|
||||
|
||||
@@ -329,6 +329,7 @@ VOBJ29 = $(O)sfstruct.o $(O)sfascii.o $(O)sflendian.o
|
||||
|
||||
ifeq "$(ADD_LUA)" "Y"
|
||||
LUAOBJ = $(O)nhlua.o $(O)nhlsel.o
|
||||
LUA_QTEXT_FILE = "quest.lua"
|
||||
endif
|
||||
|
||||
DLBOBJ = $(O)dlb.o
|
||||
@@ -751,7 +752,10 @@ install: initialchk $(O)utility.tag $(GAMEDIR)/NetHack.exe $(NETHACKW_EXE) \
|
||||
@echo Done.
|
||||
|
||||
$(O)install.tag: $(DAT)/data $(DAT)/rumors $(DAT)/oracles \
|
||||
$(DAT)/quest.dat $(O)sp_lev.tag $(DLB)
|
||||
ifndef LUA_QTEXT_FILE
|
||||
$(DAT)/quest.dat \
|
||||
endif
|
||||
$(O)sp_lev.tag $(DLB)
|
||||
ifdef TRAVIS_COMPILER
|
||||
ls -l $(SRC)
|
||||
ls -l $(DAT)
|
||||
@@ -921,8 +925,10 @@ $(DAT)/data: $(O)utility.tag $(DATABASE)
|
||||
$(DAT)/rumors: $(O)utility.tag $(DAT)/rumors.tru $(DAT)/rumors.fal
|
||||
$(subst /,\,$(U)makedefs -r)
|
||||
|
||||
ifndef LUA_QTEXT_FILE
|
||||
$(DAT)/quest.dat: $(O)utility.tag $(DAT)/quest.txt
|
||||
$(subst /,\,$(U)makedefs -q)
|
||||
endif
|
||||
|
||||
$(DAT)/oracles: $(O)utility.tag $(DAT)/oracles.txt
|
||||
$(subst /,\,$(U)makedefs -h)
|
||||
@@ -1029,17 +1035,22 @@ $(DAT)/porthelp: $(MSWSYS)/porthelp
|
||||
$(subst /,\,@copy $(MSWSYS)/porthelp $@ >nul)
|
||||
|
||||
nhdat$(NHV): $(U)dlb_main.exe $(DAT)/data $(DAT)/oracles $(OPTIONS_FILE) \
|
||||
$(DAT)/quest.dat $(DAT)/rumors $(DAT)/help $(DAT)/hh $(DAT)/cmdhelp $(DAT)/keyhelp \
|
||||
$(DAT)/history $(DAT)/opthelp $(DAT)/wizhelp \
|
||||
$(DAT)/porthelp $(DAT)/license $(DAT)/engrave \
|
||||
$(DAT)/epitaph $(DAT)/bogusmon $(DAT)/tribute $(O)sp_lev.tag
|
||||
ifndef LUA_QTEXT_FILE
|
||||
$(DAT)/quest.dat \
|
||||
endif
|
||||
$(DAT)/rumors $(DAT)/help $(DAT)/hh $(DAT)/cmdhelp $(DAT)/keyhelp \
|
||||
$(DAT)/history $(DAT)/opthelp $(DAT)/wizhelp \
|
||||
$(DAT)/porthelp $(DAT)/license $(DAT)/engrave \
|
||||
$(DAT)/epitaph $(DAT)/bogusmon $(DAT)/tribute $(O)sp_lev.tag
|
||||
$(subst /,\,echo data >$(DAT)/dlb.lst)
|
||||
$(subst /,\,echo oracles >>$(DAT)/dlb.lst)
|
||||
$(subst /,\,if exist $(DAT)/options echo options >>$(DAT)/dlb.lst)
|
||||
$(subst /,\,if exist $(DAT)/ttyoptions echo ttyoptions >>$(DAT)/dlb.lst)
|
||||
$(subst /,\,if exist $(DAT)/guioptions echo guioptions >>$(DAT)/dlb.lst)
|
||||
$(subst /,\,if exist $(DAT)/porthelp echo porthelp >>$(DAT)/dlb.lst)
|
||||
ifndef LUA_QTEXT_FILE
|
||||
$(subst /,\,echo quest.dat >>$(DAT)/dlb.lst)
|
||||
endif
|
||||
$(subst /,\,echo rumors >>$(DAT)/dlb.lst)
|
||||
$(subst /,\,echo help >>$(DAT)/dlb.lst)
|
||||
$(subst /,\,echo hh >>$(DAT)/dlb.lst)
|
||||
@@ -1201,7 +1212,9 @@ ifneq "$(W_DAT)" ""
|
||||
if exist $(W_DAT)\bogusmon del $(W_DAT)\bogusmon
|
||||
if exist $(W_DAT)\oracles del $(W_DAT)\oracles
|
||||
if exist $(W_DAT)\rumors del $(W_DAT)\rumors
|
||||
ifndef LUA_QTEXT_FILE
|
||||
if exist $(W_DAT)\quest.dat del $(W_DAT)\quest.dat
|
||||
endif
|
||||
ifdef OBSOLETE_DGN_COMPILER
|
||||
if exist $(W_DAT)\dungeon del $(W_DAT)\dungeon
|
||||
if exist $(W_DAT)\dungeon.pdf del $(W_DAT)\dungeon.pdf
|
||||
|
||||
@@ -313,6 +313,7 @@ VOBJ28 = $(O)sfbase.o $(O)sfdata.o
|
||||
VOBJ29 = $(O)sfstruct.o $(O)sfascii.o $(O)sflendian.o
|
||||
|
||||
LUAOBJ = $(O)nhlua.o $(O)nhlsel.o
|
||||
LUA_QTEXT_FILE = "quest.lua"
|
||||
|
||||
DLBOBJ = $(O)dlb.o
|
||||
|
||||
@@ -995,7 +996,10 @@ $(GAMEDIR)\nhraykey.dll : $(O)$(@B).o $(O)gamedir.tag $(O)$(@B).def
|
||||
/IMPLIB:$(O)$(@B).lib -out:$@ $(O)$(@B).o
|
||||
|
||||
$(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\oracles \
|
||||
$(DAT)\quest.dat $(O)sp_lev.tag $(DLB)
|
||||
! IFNDEF LUA_QTEXT_FILE
|
||||
$(DAT)\quest.dat \
|
||||
! ENDIF
|
||||
$(O)sp_lev.tag $(DLB)
|
||||
! IF ("$(USE_DLB)"=="Y")
|
||||
copy nhdat$(NHV) $(GAMEDIR)
|
||||
copy $(DAT)\license $(GAMEDIR)
|
||||
@@ -1309,7 +1313,12 @@ $(DAT)\porthelp: $(MSWSYS)\porthelp
|
||||
@copy $(MSWSYS)\porthelp $@ >nul
|
||||
|
||||
nhdat$(NHV): $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \
|
||||
$(DAT)\quest.dat $(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp $(DAT)\keyhelp \
|
||||
!IFNDEF LUA_QTEXT_FILE
|
||||
$(DAT)\quest.dat \
|
||||
!ELSE
|
||||
$(DAT)\quest.lua \
|
||||
!ENDIF
|
||||
$(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp $(DAT)\keyhelp \
|
||||
$(DAT)\history $(DAT)\opthelp $(DAT)\wizhelp $(DAT)\porthelp \
|
||||
$(DAT)\license $(DAT)\engrave $(DAT)\epitaph $(DAT)\bogusmon $(DAT)\tribute $(O)sp_lev.tag
|
||||
cd $(DAT)
|
||||
@@ -1319,7 +1328,9 @@ nhdat$(NHV): $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \
|
||||
if exist ttyoptions echo ttyoptions >>dlb.lst
|
||||
if exist guioptions echo guioptions >>dlb.lst
|
||||
if exist porthelp echo porthelp >>dlb.lst
|
||||
!IFNDEF LUA_QTEXT_FILE
|
||||
echo quest.dat >>dlb.lst
|
||||
!ENDIF
|
||||
echo rumors >>dlb.lst
|
||||
echo help >>dlb.lst
|
||||
echo hh >>dlb.lst
|
||||
@@ -1552,7 +1563,9 @@ spotless: clean
|
||||
!ENDIF
|
||||
if exist $(DAT)\oracles del $(DAT)\oracles
|
||||
if exist $(DAT)\rumors del $(DAT)\rumors
|
||||
!IFNDEF LUA_QTEXT_FILE
|
||||
if exist $(DAT)\quest.dat del $(DAT)\quest.dat
|
||||
!ENDIF
|
||||
if exist $(DAT)\options del $(DAT)\options
|
||||
if exist $(DAT)\ttyoptions del $(DAT)\ttyoptions
|
||||
if exist $(DAT)\guioptions del $(DAT)\guioptions
|
||||
@@ -1661,8 +1674,10 @@ $(DAT)\data: $(O)utility.tag $(DATABASE)
|
||||
$(DAT)\rumors: $(O)utility.tag $(DAT)\rumors.tru $(DAT)\rumors.fal
|
||||
$(U)makedefs -r
|
||||
|
||||
!IFNDEF LUA_QTEXT_FILE
|
||||
$(DAT)\quest.dat: $(O)utility.tag $(DAT)\quest.txt
|
||||
$(U)makedefs -q
|
||||
!ENDIF
|
||||
|
||||
$(DAT)\oracles: $(O)utility.tag $(DAT)\oracles.txt
|
||||
$(U)makedefs -h
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 makedefs.c $NHDT-Date: 1562180226 2019/07/03 18:57:06 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.149 $ */
|
||||
/* NetHack 3.6 makedefs.c $NHDT-Date: 1574634383 2019/11/24 22:26:23 $ $NHDT-Branch: paxed-quest-lua $:$NHDT-Revision: 1.163 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
|
||||
/* Copyright (c) M. Stephenson, 1990, 1991. */
|
||||
@@ -1196,16 +1196,6 @@ do_date()
|
||||
|
||||
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_HOST)
|
||||
Fprintf(ofp, "\n#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_HOST)\n");
|
||||
#if 0
|
||||
Fprintf(ofp, "/* On a CROSSCOMPILE build, NetHack is built in two steps:\n");
|
||||
Fprintf(ofp, " *%s%d. %s\n",
|
||||
ind, ++steps, "Build makedefs and its prerequisites, and");
|
||||
Fprintf(ofp, " *%s %s\n",
|
||||
ind, "execute makedefs to generate date.h, onames.h, and pm.h.");
|
||||
Fprintf(ofp, " *%s%d. %s\n *%s %s\n */\n\n", ind, ++steps,
|
||||
"Build the rest of NetHack using the cross-compiler",
|
||||
ind, "to generate the game code for target platform.");
|
||||
#endif
|
||||
#endif /* CROSSCOMPILE || CROSSCOMPILE_HOST */
|
||||
if (date_via_env)
|
||||
Fprintf(ofp, "#define SOURCE_DATE_EPOCH (%lu%s) /* via getenv() */\n",
|
||||
@@ -2160,6 +2150,12 @@ do_questtxt()
|
||||
{
|
||||
char *line;
|
||||
|
||||
/* Make sure they know */
|
||||
printf("DEPRECATION WARNINGS:\n");
|
||||
printf("'makedefs -q' is no longer required. Remove all references\n");
|
||||
printf(" to it from the build process.\n");
|
||||
printf("'dat/quest.txt' is no longer part of the source tree.\n");
|
||||
|
||||
Sprintf(filename, DATA_IN_TEMPLATE, QTXT_I_FILE);
|
||||
if (!(ifp = fopen(filename, RDTMODE))) {
|
||||
perror(filename);
|
||||
|
||||
Reference in New Issue
Block a user