[Pkg-nethack-devel] nethack/debian/patches 92_enh_paranoid_hit.dpatch,NONE,1.1 00list,1.6,1.7 11_paranoid_hit.dpatch,1.1,NONE

Joshua Kwan joshk-guest@quantz.debian.org
Wed, 15 Oct 2003 16:02:05 +0000


Update of /cvsroot/pkg-nethack/nethack/debian/patches
In directory quantz:/tmp/cvs-serv6066/patches

Modified Files:
	00list 
Added Files:
	92_enh_paranoid_hit.dpatch 
Removed Files:
	11_paranoid_hit.dpatch 
Log Message:
Add official paranoid patch, without paranoid_quit. Remove old broken
paranoid_hit dpatch.


--- 11_paranoid_hit.dpatch DELETED ---

Index: 00list
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/debian/patches/00list,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- 00list	13 Oct 2003 17:44:14 -0000	1.6
+++ 00list	15 Oct 2003 16:02:02 -0000	1.7
@@ -12,3 +12,4 @@
 14_common_config
 90_enh_hpmon
 91_enh_menucolors
+92_enh_paranoid_hit

--- NEW FILE: 92_enh_paranoid_hit.dpatch ---
#! /bin/sh -e
## 92_enh_paranoid_hit.dpatch by Joshua Kwan <joshk@triplehelix.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Paranoid hit asks you to confirm 'yes' instead of 'y' when hitting peacefuls

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1;;
esac

exit 0

diff -urd nethack-3.4.2/dat/opthelp nh342par/dat/opthelp
--- nethack-3.4.2/dat/opthelp	2003-08-30 03:07:07.000000000 +0300
+++ nh342par/dat/opthelp	2003-09-05 16:36:28.000000000 +0300
@@ -61,6 +61,9 @@
 Boolean option if MFLOPPY was set at compile time:
 checkspace check free disk space before writing files to disk     [TRUE]
 
+Boolean option if PARANOID was set at compile time:
+paranoid_quit  ask for explicit 'yes' when quitting               [FALSE]
+
 Boolean option if EXP_ON_BOTL was set at compile time:
 showexp    display your accumulated experience points             [FALSE]
 
diff -urd nethack-3.4.2/doc/Guidebook.mn nh342par/doc/Guidebook.mn
--- nethack-3.4.2/doc/Guidebook.mn	2003-08-30 03:07:13.000000000 +0300
+++ nh342par/doc/Guidebook.mn	2003-09-05 16:35:33.000000000 +0300
@@ -1964,6 +1964,9 @@
 The value of this option should be a string containing the
 symbols for the various object types.  Any omitted types are filled in
 at the end from the previous order.
+.lp paranoid_hit
+If true, asks you to type the word ``yes'' when hitting any peaceful
+monster, not just the letter ``y''.
 .lp perm_invent
 If true, always display your current inventory in a window.  This only
 makes sense for windowing system interfaces that implement this feature.
diff -urd nethack-3.4.2/doc/Guidebook.tex nh342par/doc/Guidebook.tex
--- nethack-3.4.2/doc/Guidebook.tex	2003-08-30 03:07:13.000000000 +0300
+++ nh342par/doc/Guidebook.tex	2003-09-05 16:35:33.000000000 +0300
@@ -2409,6 +2409,10 @@
 containing the symbols for the various object types.  Any omitted types
 are filled in at the end from the previous order.
 %.lp
+\item[\ib{paranoid\_hit}]
+If true, asks you to type the word ``yes'' when hitting any peaceful
+monster, not just the letter ``y''.
+%.lp
 \item[\ib{perm\_invent}]
 If true, always display your current inventory in a window.  This only
 makes sense for windowing system interfaces that implement this feature.
diff -urd nethack-3.4.2/doc/Guidebook.txt nh342par/doc/Guidebook.txt
--- nethack-3.4.2/doc/Guidebook.txt	2003-08-30 03:07:13.000000000 +0300
+++ nh342par/doc/Guidebook.txt	2003-09-05 16:35:33.000000000 +0300
@@ -2554,6 +2554,10 @@
                Any omitted types are filled in at the end from the previous
                order.
 
+          paranoid_hit
+               If true, asks you to type the word ``yes'' when hitting any
+               peaceful monster, not just the letter ``y''.
+
           perm_invent
                If true, always display your current inventory in a  window.
                This  only  makes sense for windowing system interfaces that
diff -urd nethack-3.4.2/include/flag.h nh342par/include/flag.h
--- nethack-3.4.2/include/flag.h	2003-08-30 03:07:17.000000000 +0300
+++ nh342par/include/flag.h	2003-09-05 16:35:33.000000000 +0300
@@ -217,6 +217,9 @@
 	boolean lan_mail;	/* mail is initialized */
 	boolean lan_mail_fetched; /* mail is awaiting display */
 #endif
+#ifdef PARANOID
+	boolean  paranoid_hit;  /* Ask for 'yes' when hitting peacefuls */
+#endif

 #if defined(HPMON) && defined(TEXTCOLOR)
         boolean use_hpmon;
 #endif

 /*
  * Window capability support.
  */
diff -urd nethack-3.4.2/src/options.c nh342par/src/options.c
--- nethack-3.4.2/src/options.c	2003-08-30 03:07:36.000000000 +0300
+++ nh342par/src/options.c	2003-09-05 16:35:33.000000000 +0300
@@ -155,6 +155,9 @@
 #else
 	{"page_wait", (boolean *)0, FALSE, SET_IN_FILE},
 #endif
+#ifdef PARANOID
+	{"paranoid_hit", &iflags.paranoid_hit, FALSE, SET_IN_GAME},
+#endif
 	{"perm_invent", &flags.perm_invent, FALSE, SET_IN_GAME},
 	{"popup_dialog",  &iflags.wc_popup_dialog, FALSE, SET_IN_GAME},	/*WC*/
 	{"prayconfirm", &flags.prayconfirm, TRUE, SET_IN_GAME},
diff -urd nethack-3.4.2/src/uhitm.c nh342par/src/uhitm.c
--- nethack-3.4.2/src/uhitm.c	2003-08-30 03:07:42.000000000 +0300
+++ nh342par/src/uhitm.c	2003-09-05 16:35:33.000000000 +0300
@@ -99,6 +99,9 @@
 struct obj *wep;	/* uwep for attack(), null for kick_monster() */
 {
 	char qbuf[QBUFSZ];
+#ifdef PARANOID
+	char buf[BUFSZ];
+#endif
 
 	/* if you're close enough to attack, alert any waiting monster */
 	mtmp->mstrategy &= ~STRAT_WAITMASK;
@@ -199,11 +202,26 @@
 			return(FALSE);
 		}
 		if (canspotmon(mtmp)) {
+#ifdef PARANOID
+			Sprintf(qbuf, "Really attack %s? [no/yes]",
+				mon_nam(mtmp));
+			if (iflags.paranoid_hit) {
+				getlin (qbuf, buf);
+				(void) lcase (buf);
+				if (strcmp (buf, "yes")) {
+				  flags.move = 0;
+				  return(TRUE);
+				}
+			} else {
+#endif
 			Sprintf(qbuf, "Really attack %s?", mon_nam(mtmp));
 			if (yn(qbuf) != 'y') {
 				flags.move = 0;
 				return(TRUE);
 			}
+#ifdef PARANOID
+			}
+#endif
 		}
 	}