G
Guest
Guest
Archived from groups: rec.games.roguelike.nethack (More info?)
Hello,
here is a small patch that does two changes into the game interface.
First change is that X is changed to mean #twoweapon and an extended
command #explore (meta-x) is added for entering the explore mode. This
part of the patch is covered by the macro X_TWOWEAPON in config.h.
The second change is controlled by CONFIRM_LOCKING macro in config.h.
This introduces a new option 'confirm_locking' and changes the old
option 'confirm' to 'confirm_attack'. The default for confirm_locking is
on so by default the game behaves just like without the patch except for
the name change of the 'confirm' option.
If the option confirm_locking is off then (un)locking a door or a lonely
container is no longer confirmed. If the location however has multiple
(un)lockable containers then the confirmation is asked to facilitate the
selection of which container the user want's to (un)lock.
--- CUT HERE !!! ---
diff -bruNX ignore.txt ..\official/changes ./changes
--- ..\official/changes Thu Jan 1 00:00:00 1970
+++ ./changes Mon Aug 22 18:30:44 2005
@@ -0,0 +1,32 @@
+Changes to the section 4 Commands in NetHack Guidebook
+
+Change the command X to read as follows:
+
+---
+X Toggle two-weapon combat on or off. Note that you must use
+ suitable weapons for this type of combat, or it will be au-
+ tomatically turned off.
+---
+
+Add the following:
+
+---
+#explore
+ Enter explore (discovery) mode, explained in its own section
+ later.
+
+M-x #explore
+---
+
+
+Changes to the section 9.4. Customization options in NetHack Guidebook
+
+
+Change option 'confirm' to 'confirm_attack'. Add the following:
+
+---
+confirm_locking
+ Have the game confirm if a door or a lonely container is (un)locked
+ (default on).
+---
+
diff -bruNX ignore.txt ..\official/include/config.h ./include/config.h
--- ..\official/include/config.h Mon Dec 8 01:39:14 2003
+++ ./include/config.h Mon Aug 22 17:48:44 2005
@@ -351,6 +351,17 @@
/*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */
/*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
+#define CONFIRM_LOCKING /* Confirmation messages for (un)locking
doors or
+ * containers if only one container in the location
+ * if confirm_locking is set in the options.
+ * Default is on.
+ * Can be set during the game.
+ */
+
+#define X_TWOWEAPON /* X command is changed to twoweapon; meta-x and
+ * #explore is for entering the explore-mode.
+ */
+
/* End of Section 5 */
#include "global.h" /* Define everything else according to choices
above */
diff -bruNX ignore.txt ..\official/include/flag.h ./include/flag.h
--- ..\official/include/flag.h Mon Dec 8 01:39:14 2003
+++ ./include/flag.h Mon Aug 22 17:49:42 2005
@@ -175,6 +175,9 @@
uchar bouldersym; /* symbol for boulder display */
boolean travel1; /* first travel step */
coord travelcc; /* coordinates for travel_cache */
+#ifdef CONFIRM_LOCKING
+ boolean confirm_locking; /* ynq question for (un)locking */
+#endif
#ifdef WIZARD
boolean sanity_check; /* run sanity checks */
boolean mon_polycontrol; /* debug: control monster polymorphs */
diff -bruNX ignore.txt ..\official/src/cmd.c ./src/cmd.c
--- ..\official/src/cmd.c Mon Dec 8 01:39:14 2003
+++ ./src/cmd.c Mon Aug 22 17:39:42 2005
@@ -1439,7 +1439,12 @@
{'W', FALSE, dowear},
{M('w'), FALSE, dowipe},
{'x', FALSE, doswapweapon},
+#ifdef X_TWOWEAPON
+ {'X', FALSE, dotwoweapon},
+ {M('x'), TRUE, enter_explore_mode},
+#else
{'X', TRUE, enter_explore_mode},
+#endif
/* 'y', 'Y' : go nw */
{'z', FALSE, dozap},
{'Z', TRUE, docast},
@@ -1481,6 +1486,9 @@
{"dip", "dip an object into something", dodip, FALSE},
{"enhance", "advance or check weapons skills", enhance_weapon_skill,
TRUE},
+#ifdef X_TWOWEAPON
+ {"explore", "enter the explore mode", enter_explore_mode, TRUE},
+#endif
{"force", "force a lock", doforce, FALSE},
{"invoke", "invoke an object's powers", doinvoke, TRUE},
{"jump", "jump to a location", dojump, FALSE},
diff -bruNX ignore.txt ..\official/src/lock.c ./src/lock.c
--- ..\official/src/lock.c Mon Dec 8 01:39:14 2003
+++ ./src/lock.c Mon Aug 22 17:54:30 2005
@@ -294,13 +294,29 @@
count = 0;
c = 'n'; /* in case there are no boxes here */
+
+#ifdef CONFIRM_LOCKING
+ for(otmp = level.objects[cc.x][cc.y]; otmp; otmp = otmp->nexthere)
+ if (Is_box(otmp)) ++count;
+ if ((count == 1) && !iflags.confirm_locking) c = 'y';
+#endif
+
for(otmp = level.objects[cc.x][cc.y]; otmp; otmp = otmp->nexthere)
if (Is_box(otmp)) {
+
+#ifndef CONFIRM_LOCKING
++count;
+#endif
+
if (!can_reach_floor()) {
You_cant("reach %s from up here.", the(xname(otmp)));
return 0;
}
+
+#ifdef CONFIRM_LOCKING
+ if ((count > 1) || iflags.confirm_locking) {
+#endif
+
it = 0;
if (otmp->obroken) verb = "fix";
else if (!otmp->olocked) verb = "lock", it = 1;
@@ -315,6 +331,10 @@
if(c == 'q') return(0);
if(c == 'n') continue;
+#ifdef CONFIRM_LOCKING
+ }
+#endif
+
if (otmp->obroken) {
You_cant("fix its broken lock with %s.", doname(pick));
return 0;
@@ -401,11 +421,19 @@
}
#endif
+#ifdef CONFIRM_LOCKING
+ if (iflags.confirm_locking) {
+#endif
+
Sprintf(qbuf,"%sock it?",
(door->doormask & D_LOCKED) ? "Unl" : "L" );
c = yn(qbuf);
if(c == 'n') return(0);
+
+#ifdef CONFIRM_LOCKING
+ }
+#endif
switch(picktyp) {
#ifdef TOURIST
diff -bruNX ignore.txt ..\official/src/options.c ./src/options.c
--- ..\official/src/options.c Mon Dec 8 01:39:14 2003
+++ ./src/options.c Mon Aug 22 18:25:10 2005
@@ -74,7 +74,12 @@
# else /* systems that support multiple terminals, many monochrome */
{"color", &iflags.wc_color, FALSE, SET_IN_GAME}, /*WC*/
# endif
+#ifndef CONFIRM_LOCKING
{"confirm",&flags.confirm, TRUE, SET_IN_GAME},
+#else
+ {"confirm_attack",&flags.confirm, TRUE, SET_IN_GAME},
+ {"confirm_locking", &iflags.confirm_locking, TRUE, SET_IN_GAME},
+#endif
#if defined(TERMLIB) && !defined(MAC_GRAPHICS_ENV)
{"DECgraphics", &iflags.DECgraphics, FALSE, SET_IN_GAME},
#else
--- CUT HERE !!! ---
Topi
--
"The whole problem with the world is that fools and fanatics are
always so certain of themselves, but wiser people so full of doubts."
- Bertrand Russell
"How come he didn't put 'I think' at the end of it?" - Anonymous
Hello,
here is a small patch that does two changes into the game interface.
First change is that X is changed to mean #twoweapon and an extended
command #explore (meta-x) is added for entering the explore mode. This
part of the patch is covered by the macro X_TWOWEAPON in config.h.
The second change is controlled by CONFIRM_LOCKING macro in config.h.
This introduces a new option 'confirm_locking' and changes the old
option 'confirm' to 'confirm_attack'. The default for confirm_locking is
on so by default the game behaves just like without the patch except for
the name change of the 'confirm' option.
If the option confirm_locking is off then (un)locking a door or a lonely
container is no longer confirmed. If the location however has multiple
(un)lockable containers then the confirmation is asked to facilitate the
selection of which container the user want's to (un)lock.
--- CUT HERE !!! ---
diff -bruNX ignore.txt ..\official/changes ./changes
--- ..\official/changes Thu Jan 1 00:00:00 1970
+++ ./changes Mon Aug 22 18:30:44 2005
@@ -0,0 +1,32 @@
+Changes to the section 4 Commands in NetHack Guidebook
+
+Change the command X to read as follows:
+
+---
+X Toggle two-weapon combat on or off. Note that you must use
+ suitable weapons for this type of combat, or it will be au-
+ tomatically turned off.
+---
+
+Add the following:
+
+---
+#explore
+ Enter explore (discovery) mode, explained in its own section
+ later.
+
+M-x #explore
+---
+
+
+Changes to the section 9.4. Customization options in NetHack Guidebook
+
+
+Change option 'confirm' to 'confirm_attack'. Add the following:
+
+---
+confirm_locking
+ Have the game confirm if a door or a lonely container is (un)locked
+ (default on).
+---
+
diff -bruNX ignore.txt ..\official/include/config.h ./include/config.h
--- ..\official/include/config.h Mon Dec 8 01:39:14 2003
+++ ./include/config.h Mon Aug 22 17:48:44 2005
@@ -351,6 +351,17 @@
/*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */
/*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
+#define CONFIRM_LOCKING /* Confirmation messages for (un)locking
doors or
+ * containers if only one container in the location
+ * if confirm_locking is set in the options.
+ * Default is on.
+ * Can be set during the game.
+ */
+
+#define X_TWOWEAPON /* X command is changed to twoweapon; meta-x and
+ * #explore is for entering the explore-mode.
+ */
+
/* End of Section 5 */
#include "global.h" /* Define everything else according to choices
above */
diff -bruNX ignore.txt ..\official/include/flag.h ./include/flag.h
--- ..\official/include/flag.h Mon Dec 8 01:39:14 2003
+++ ./include/flag.h Mon Aug 22 17:49:42 2005
@@ -175,6 +175,9 @@
uchar bouldersym; /* symbol for boulder display */
boolean travel1; /* first travel step */
coord travelcc; /* coordinates for travel_cache */
+#ifdef CONFIRM_LOCKING
+ boolean confirm_locking; /* ynq question for (un)locking */
+#endif
#ifdef WIZARD
boolean sanity_check; /* run sanity checks */
boolean mon_polycontrol; /* debug: control monster polymorphs */
diff -bruNX ignore.txt ..\official/src/cmd.c ./src/cmd.c
--- ..\official/src/cmd.c Mon Dec 8 01:39:14 2003
+++ ./src/cmd.c Mon Aug 22 17:39:42 2005
@@ -1439,7 +1439,12 @@
{'W', FALSE, dowear},
{M('w'), FALSE, dowipe},
{'x', FALSE, doswapweapon},
+#ifdef X_TWOWEAPON
+ {'X', FALSE, dotwoweapon},
+ {M('x'), TRUE, enter_explore_mode},
+#else
{'X', TRUE, enter_explore_mode},
+#endif
/* 'y', 'Y' : go nw */
{'z', FALSE, dozap},
{'Z', TRUE, docast},
@@ -1481,6 +1486,9 @@
{"dip", "dip an object into something", dodip, FALSE},
{"enhance", "advance or check weapons skills", enhance_weapon_skill,
TRUE},
+#ifdef X_TWOWEAPON
+ {"explore", "enter the explore mode", enter_explore_mode, TRUE},
+#endif
{"force", "force a lock", doforce, FALSE},
{"invoke", "invoke an object's powers", doinvoke, TRUE},
{"jump", "jump to a location", dojump, FALSE},
diff -bruNX ignore.txt ..\official/src/lock.c ./src/lock.c
--- ..\official/src/lock.c Mon Dec 8 01:39:14 2003
+++ ./src/lock.c Mon Aug 22 17:54:30 2005
@@ -294,13 +294,29 @@
count = 0;
c = 'n'; /* in case there are no boxes here */
+
+#ifdef CONFIRM_LOCKING
+ for(otmp = level.objects[cc.x][cc.y]; otmp; otmp = otmp->nexthere)
+ if (Is_box(otmp)) ++count;
+ if ((count == 1) && !iflags.confirm_locking) c = 'y';
+#endif
+
for(otmp = level.objects[cc.x][cc.y]; otmp; otmp = otmp->nexthere)
if (Is_box(otmp)) {
+
+#ifndef CONFIRM_LOCKING
++count;
+#endif
+
if (!can_reach_floor()) {
You_cant("reach %s from up here.", the(xname(otmp)));
return 0;
}
+
+#ifdef CONFIRM_LOCKING
+ if ((count > 1) || iflags.confirm_locking) {
+#endif
+
it = 0;
if (otmp->obroken) verb = "fix";
else if (!otmp->olocked) verb = "lock", it = 1;
@@ -315,6 +331,10 @@
if(c == 'q') return(0);
if(c == 'n') continue;
+#ifdef CONFIRM_LOCKING
+ }
+#endif
+
if (otmp->obroken) {
You_cant("fix its broken lock with %s.", doname(pick));
return 0;
@@ -401,11 +421,19 @@
}
#endif
+#ifdef CONFIRM_LOCKING
+ if (iflags.confirm_locking) {
+#endif
+
Sprintf(qbuf,"%sock it?",
(door->doormask & D_LOCKED) ? "Unl" : "L" );
c = yn(qbuf);
if(c == 'n') return(0);
+
+#ifdef CONFIRM_LOCKING
+ }
+#endif
switch(picktyp) {
#ifdef TOURIST
diff -bruNX ignore.txt ..\official/src/options.c ./src/options.c
--- ..\official/src/options.c Mon Dec 8 01:39:14 2003
+++ ./src/options.c Mon Aug 22 18:25:10 2005
@@ -74,7 +74,12 @@
# else /* systems that support multiple terminals, many monochrome */
{"color", &iflags.wc_color, FALSE, SET_IN_GAME}, /*WC*/
# endif
+#ifndef CONFIRM_LOCKING
{"confirm",&flags.confirm, TRUE, SET_IN_GAME},
+#else
+ {"confirm_attack",&flags.confirm, TRUE, SET_IN_GAME},
+ {"confirm_locking", &iflags.confirm_locking, TRUE, SET_IN_GAME},
+#endif
#if defined(TERMLIB) && !defined(MAC_GRAPHICS_ENV)
{"DECgraphics", &iflags.DECgraphics, FALSE, SET_IN_GAME},
#else
--- CUT HERE !!! ---
Topi
--
"The whole problem with the world is that fools and fanatics are
always so certain of themselves, but wiser people so full of doubts."
- Bertrand Russell
"How come he didn't put 'I think' at the end of it?" - Anonymous