Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help for extinctionists

2 views
Skip to first unread message

Eric Wright

unread,
Jun 5, 2002, 8:17:12 AM6/5/02
to
Based on my frustration over not knowing the progress of my
extinctionist, I have hacked up the source to include a new function,
mapped to K, which will duplicate the "Do you want an account of
creatures vanquished? [ynq]" function from end.c

I don't know how to create a patch file, and this isn't the first time
I've hacked my source (funny hallucination messages for being stoned
among others). Anyway, I will show you all what I've done, so you can
make the changes yourself.

Caveat: I am not well versed in C!!! Proceed at your own risk!!!
Back up saved games before proceeding!!! As is, no warranty!!! Do
not taunt happy fun ball!!!

Add the following at line 841 of include/extern.h

E int NDECL(dolistvanq);

Add the following at line 100 of src/cmd.c

extern int NDECL(dolistvanq);

further down in src/cmd.c, find the declaration

static const struct func_tab cmdlist[] = {

and add the following line, (preferably, immediately after
{'k', FALSE, dokick},):

{'K', TRUE, dolistvanq},

Add the following at line 197 of src/end.c

int
dolistvanq()
{
int defquery;
defquery = 'y';
list_vanquished(defquery, TRUE);
return(0); /* No time passes */
}

Save, compile, install... I have tested this with my current
character, and I haven't found any issues with characters started
before I hacked the game. I will update this thread if I find any
issues...

Questions/comments appreciated, feel free to email me at ewright AT nc
DOT rr DOT com...

E

Dylan O'Donnell

unread,
Jun 5, 2002, 10:24:38 AM6/5/02
to
ewr...@nc.rr.com (Eric Wright) writes:
> Based on my frustration over not knowing the progress of my
> extinctionist, I have hacked up the source to include a new function,
> mapped to K, which will duplicate the "Do you want an account of
> creatures vanquished? [ynq]" function from end.c

In the general case, the keystroke you have chosen is a Bad Idea;
since K is already a movement command ('run north') it won't be
possible to use the command if you have number_pad turned off. (Which
obviously you don't, but it's good style to make these things
portable.) I'd therefore recommend adding an extended #command (in
addition, if you like). It's _also_ good style to update the
documentation, and it'd be polite not to have just silence if you use
the command before killing monsters.

Lessee... here we go. (I ought really to repaginate doc/Guidebook.txt,
but that would bulk out the patch to unreadability.) Usual disclaimers
apply.


diff -ur nethack-3.4.0/dat/cmdhelp nethack-3.4.0bis/dat/cmdhelp
--- nethack-3.4.0/dat/cmdhelp Wed Mar 20 23:42:27 2002
+++ nethack-3.4.0bis/dat/cmdhelp Wed Jun 5 14:19:17 2002
@@ -39,7 +39,7 @@
J Go south until you are on top of something
^J Go south until you are near something
k Go north 1 space (or if number_pad is on, kick something)
-K Go north until you are on top of something
+K Go north until you are on top of something (if number_pad, list kills)
^K Go north until you are near something
l Go east 1 space (or if number_pad is on, loot a box on the floor)
L Go east until you are on top of something
diff -ur nethack-3.4.0/dat/help nethack-3.4.0bis/dat/help
--- nethack-3.4.0/dat/help Wed Mar 20 23:42:29 2002
+++ nethack-3.4.0bis/dat/help Wed Jun 5 15:06:55 2002
@@ -176,6 +176,7 @@
h displays the help menu, like '?'
j Jump to another location.
k Kick (for doors, usually).
+ K List vanquished monsters (whether by you or not).
l Loot a box on the floor.
n followed by number of times to repeat the next command
N Name an object or type of object.
diff -ur nethack-3.4.0/dat/hh nethack-3.4.0bis/dat/hh
--- nethack-3.4.0/dat/hh Wed Mar 20 23:42:29 2002
+++ nethack-3.4.0bis/dat/hh Wed Jun 5 14:20:49 2002
@@ -111,6 +111,7 @@
h help display one of several informative texts, like '?'
j jump jump to another location
k kick kick something (usually a door)
+K kills list vanquished monsters (whether by you or not)
l loot loot a box on the floor
N name name an item or type of object
u untrap untrap something (usually a trapped object)
diff -ur nethack-3.4.0/doc/Guidebook.mn nethack-3.4.0bis/doc/Guidebook.mn
--- nethack-3.4.0/doc/Guidebook.mn Wed Mar 20 23:42:39 2002
+++ nethack-3.4.0bis/doc/Guidebook.mn Wed Jun 5 14:25:48 2002
@@ -704,6 +704,8 @@
be automatically turned off.
.lp #untrap
Untrap something (trap, door, or chest).
+.lp #vanquished
+List vanquished monsters (whether by you or not).
.lp #version
Print compile time options for this version of NetHack.
.lp #wipe
@@ -772,6 +774,8 @@
Jump to another location. Same as ``#jump'' or ``M-j''.
.lp k
Kick something (usually a door). Same as `^D'.
+.lp K
+List vanquished monsters (whether by you or not). Same as ``#vanquished''.
.lp l
Loot a box or bag on the floor beneath you, or the saddle
from a horse standing next to you. Same as ``#loot'' or ``M-l''.
diff -ur nethack-3.4.0/doc/Guidebook.tex nethack-3.4.0bis/doc/Guidebook.tex
--- nethack-3.4.0/doc/Guidebook.tex Wed Mar 20 23:42:39 2002
+++ nethack-3.4.0bis/doc/Guidebook.tex Wed Jun 5 14:24:11 2002
@@ -940,6 +940,9 @@
\item[\tb{\#untrap}]
Untrap something (trap, door, or chest).
%.lp
+\item[\tb{\#vanquished}]
+List vanquished monsters (whether by you or not).
+%.lp
\item[\tb{\#version}]
Print compile time options for this version of {\it NetHack}.
%.lp
@@ -1039,6 +1042,10 @@
%.lp
\item[\tb{k}]
Kick something (usually a door). Same as `{\tt \^{}D}'.
+%.lp
+\item[\tb{K}]
+List vanquished monsters (whether by you or not). Same as
+``(\tt \#vanquished)''.
%.lp
\item[\tb{l}]
Loot a box or bag on the floor beneath you, or the saddle
diff -ur nethack-3.4.0/doc/Guidebook.txt nethack-3.4.0bis/doc/Guidebook.txt
+++ nethack-3.4.0bis/doc/Guidebook.txt Wed Jun 5 14:27:29 2002
@@ -933,6 +933,9 @@
#untrap
Untrap something (trap, door, or chest).

+ #vanquished
+ List vanquished monsters (whether by you or not).
+
#version
Print compile time options for this version of NetHack.

@@ -1011,6 +1014,8 @@
j Jump to another location. Same as ``#jump'' or ``M-j''.

k Kick something (usually a door). Same as `^D'.
+
+ K List vanquished monsters (whether by you or not).

l Loot a box or bag on the floor beneath you, or the saddle
from a horse standing next to you. Same as ``#loot'' or
diff -ur nethack-3.4.0/include/extern.h nethack-3.4.0bis/include/extern.h
--- nethack-3.4.0/include/extern.h Wed Mar 20 23:42:46 2002
+++ nethack-3.4.0bis/include/extern.h Wed Jun 5 14:11:24 2002
@@ -544,6 +544,7 @@
E void FDECL(done, (int));
E void FDECL(container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P));
E void FDECL(terminate, (int));
+E int NDECL(dolistvanq);
E int NDECL(num_genocides);

diff -ur nethack-3.4.0/src/cmd.c nethack-3.4.0bis/src/cmd.c
--- nethack-3.4.0/src/cmd.c Wed Mar 20 23:43:01 2002
+++ nethack-3.4.0bis/src/cmd.c Wed Jun 5 14:31:09 2002
@@ -97,6 +97,7 @@
extern int NDECL(dowieldquiver); /**/
extern int NDECL(dozap); /**/
extern int NDECL(doorganize); /**/
+extern int NDECL(dolistvanq);
#endif /* DUMB */

#ifdef OVL1
@@ -1301,6 +1302,7 @@
{'j', FALSE, dojump}, /* if number_pad is on */
{M('j'), FALSE, dojump},
{'k', FALSE, dokick}, /* if number_pad is on */
+ {'K', TRUE, dolistvanq}, /* if number_pad is on */
{'l', FALSE, doloot}, /* if number_pad is on */
{M('l'), FALSE, doloot},
/* 'n' prefixes a count if number_pad is on */
@@ -1395,6 +1397,7 @@
{"turn", "turn undead", doturn, TRUE},
{"twoweapon", "toggle two-weapon combat", dotwoweapon, FALSE},
{"untrap", "untrap something", dountrap, FALSE},
+ {"vanquished", "list vanquished monsters", dolistvanq, TRUE},
{"version", "list compile time options for this version of NetHack",
doextversion, TRUE},
{"wipe", "wipe off your face", dowipe, FALSE},
diff -ur nethack-3.4.0/src/end.c nethack-3.4.0bis/src/end.c
--- nethack-3.4.0/src/end.c Wed Mar 20 23:43:05 2002
+++ nethack-3.4.0bis/src/end.c Wed Jun 5 15:07:11 2002
@@ -40,7 +40,7 @@
STATIC_DCL void FDECL(add_artifact_score, (struct obj *));
STATIC_DCL void FDECL(display_artifact_score, (struct obj *,winid));
STATIC_DCL void FDECL(savelife, (int));
-STATIC_DCL void FDECL(list_vanquished, (int, BOOLEAN_P));
+STATIC_DCL boolean FDECL(list_vanquished, (int, BOOLEAN_P));
STATIC_DCL void FDECL(list_genocided, (int, BOOLEAN_P));
STATIC_DCL boolean FDECL(should_query_disclose_option, (int, int*));

@@ -940,7 +940,7 @@
nethack_exit(status);
}

-STATIC_OVL void
+STATIC_OVL boolean
list_vanquished(defquery, ask)
int defquery;
boolean ask;
@@ -1013,8 +1013,17 @@
destroy_nhwindow(klwin);
}
}
+ return (boolean) (total_killed);
}

+int
+dolistvanq()
+{
+ if (!list_vanquished('y', FALSE))
+ pline("No monsters have yet been killed.");
+ return(0);
+}
+
/* number of monster species which have been genocided */
int
num_genocides()


--
: Dylan O'Donnell http://www.spod-central.org/~psmith/ :
: "'Loddle-deeked, is it? It's been many camlings since the gitches :
: in the delcot of tondam have been loddle-deeked. That'll be the :
: gheliper's doing.'" -- Carl Muckenhoupt, "The Gostak" :

Eric Wright

unread,
Jun 5, 2002, 1:21:10 PM6/5/02
to
psmit...@spod-central.org (Dylan O'Donnell) wrote in message news:<861yble...@strackenz.spod-central.org>...

> ewr...@nc.rr.com (Eric Wright) writes:
> > Based on my frustration over not knowing the progress of my
> > extinctionist, I have hacked up the source to include a new function,
> > mapped to K, which will duplicate the "Do you want an account of
> > creatures vanquished? [ynq]" function from end.c
>
> In the general case, the keystroke you have chosen is a Bad Idea;
> since K is already a movement command ('run north') it won't be
> possible to use the command if you have number_pad turned off. (Which
> obviously you don't, but it's good style to make these things
> portable.) I'd therefore recommend adding an extended #command (in
> addition, if you like). It's _also_ good style to update the
> documentation, and it'd be polite not to have just silence if you use
> the command before killing monsters.
>
> Lessee... here we go. (I ought really to repaginate doc/Guidebook.txt,
> but that would bulk out the patch to unreadability.) Usual disclaimers
> apply.
>
(Snipped patch)...

Looks good... I was impressed I was able to add what I could. I did
think about using another key than K, but since I always use the
number_pad, it really didn't matter to me. Good catch on the
documentation. I've been playing so long, I sometimes forget that's
even there!

Thanks
E

Jukka Lahtinen

unread,
Jun 11, 2002, 3:17:38 AM6/11/02
to
ewr...@nc.rr.com (Eric Wright) writes:
> psmit...@spod-central.org (Dylan O'Donnell) wrote in message news:<861yble...@strackenz.spod-central.org>...
> > ewr...@nc.rr.com (Eric Wright) writes:
> > > Based on my frustration over not knowing the progress of my
> > > extinctionist, I have hacked up the source to include a new function,
> > > mapped to K, which will duplicate the "Do you want an account of
> > > creatures vanquished? [ynq]" function from end.c

Actually my "showborn" patch already includes this function as an extended
command #showkills that only works in wizard mode. (Though I just noticed
I forgot to mention this on my web page. Must add something about it..)
I made it a wizardmode-only command because I felt allowing in it real
game would change the game more than what I want to do, but changing it
to also work in a real game would probably just mean having the
information about the wiz_showkills function in the extcmdlist table
instead of debug_extcmdelist where I put it (and preferably removing the
"wiz_" part of the function name to make it not look like a wizardmode
command).

> > In the general case, the keystroke you have chosen is a Bad Idea;
> > since K is already a movement command ('run north') it won't be

This is a very valid point. I made it an extended command because there
are no convenient single-strike keys available. (And I consider it a good
idea not to reserve them for wizardmode-only commands anyway..)

> Looks good... I was impressed I was able to add what I could. I did
> think about using another key than K, but since I always use the
> number_pad, it really didn't matter to me. Good catch on the

Maybe not for you, but it makes ALL the difference for many others of us.

Anyway, my showborn patch is available at
http://www.netsonic.fi/~walker/nethack.cmd#showborn

--
Jukka Lahtinen

0 new messages