summarylogtreecommitdiffstats
path: root/paranoid-343.diff
blob: 474ecf7952a5ca86c9cad7f95dacd2d8c311b8d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
diff -urd nethack-3.4.3/dat/opthelp nethack-3.4.3-paranoid/dat/opthelp
--- nethack-3.4.3/dat/opthelp	2003-12-08 01:39:13.000000000 +0200
+++ nethack-3.4.3-paranoid/dat/opthelp	2011-08-14 11:14:54.000000000 +0300
@@ -61,6 +61,15 @@
 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_hit   ask for explicit 'yes' when hitting peacefuls      [FALSE]
+
+Boolean option if PARANOID was set at compile time:
+paranoid_quit  ask for explicit 'yes' when quitting               [FALSE]
+
+Boolean option if PARANOID was set at compile time:
+paranoid_remove always show menu with the T and R commands        [FALSE]
+
 Boolean option if EXP_ON_BOTL was set at compile time:
 showexp    display your accumulated experience points             [FALSE]
 
diff -urd nethack-3.4.3/doc/Guidebook.mn nethack-3.4.3-paranoid/doc/Guidebook.mn
--- nethack-3.4.3/doc/Guidebook.mn	2003-12-08 01:39:13.000000000 +0200
+++ nethack-3.4.3-paranoid/doc/Guidebook.mn	2011-08-14 11:14:54.000000000 +0300
@@ -2027,6 +2027,15 @@
 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 paranoid_quit
+If true, asks you to type the word ``yes'' when quitting or entering
+Explore mode, not just the letter ``y''.
+.lp paranoid_remove
+If true, always show menu with the R and T commands even when there is
+only one item to remove or take off.
 .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.3/doc/Guidebook.tex nethack-3.4.3-paranoid/doc/Guidebook.tex
--- nethack-3.4.3/doc/Guidebook.tex	2003-12-08 01:39:13.000000000 +0200
+++ nethack-3.4.3-paranoid/doc/Guidebook.tex	2011-08-14 11:14:54.000000000 +0300
@@ -2486,6 +2486,18 @@
 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{paranoid\_quit}]
+If true, asks you to type the word ``yes'' when quitting or entering
+Explore mode, not just the letter ``y''.
+%.lp
+\item[\ib{paranoid\_remove}]
+If true, always show menu with the R and T commands even when there is
+only one item to remove or take off.
+%.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.3/doc/Guidebook.txt nethack-3.4.3-paranoid/doc/Guidebook.txt
--- nethack-3.4.3/doc/Guidebook.txt	2003-12-08 01:39:13.000000000 +0200
+++ nethack-3.4.3-paranoid/doc/Guidebook.txt	2011-08-14 11:14:54.000000000 +0300
@@ -2607,6 +2607,18 @@
             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''.
+
+          paranoid_quit
+            If true, asks you  to type the word ``yes'' when quitting or
+            entering Explore mode, not just the letter ``y''.
+
+          paranoid_remove
+            If true, always show menu with the R and T commands even when
+	    there is only one item to remove or take off.
+
           perm_invent
             If true, always display your current  inventory  in  a  window.
             This  only makes sense for windowing system interfaces that im-
diff -urd nethack-3.4.3/include/flag.h nethack-3.4.3-paranoid/include/flag.h
--- nethack-3.4.3/include/flag.h	2003-12-08 01:39:13.000000000 +0200
+++ nethack-3.4.3-paranoid/include/flag.h	2011-08-14 11:14:54.000000000 +0300
@@ -216,6 +216,11 @@
 	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 */
+	boolean  paranoid_quit; /* Ask for 'yes' when quitting */
+	boolean  paranoid_remove; /* Always show menu for 'T' and 'R' */
+#endif
 /*
  * Window capability support.
  */
diff -urd nethack-3.4.3/src/cmd.c nethack-3.4.3-paranoid/src/cmd.c
--- nethack-3.4.3/src/cmd.c	2003-12-08 01:39:13.000000000 +0200
+++ nethack-3.4.3-paranoid/src/cmd.c	2011-08-14 11:14:54.000000000 +0300
@@ -478,9 +478,26 @@
 STATIC_PTR int
 enter_explore_mode()
 {
+#ifdef PARANOID
+	char buf[BUFSZ];
+	int really_xplor = FALSE;
+#endif
 	if(!discover && !wizard) {
 		pline("Beware!  From explore mode there will be no return to normal game.");
+#ifdef PARANOID
+		if (iflags.paranoid_quit) {
+		  getlin ("Do you want to enter explore mode? [yes/no]?",buf);
+		  (void) lcase (buf);
+		  if (!(strcmp (buf, "yes"))) really_xplor = TRUE;
+		} else {
+		  if (yn("Do you want to enter explore mode?") == 'y') {
+		    really_xplor = TRUE;
+		  }
+		}
+		if (really_xplor) {
+#else
 		if (yn("Do you want to enter explore mode?") == 'y') {
+#endif
 			clear_nhwindow(WIN_MESSAGE);
 			You("are now in non-scoring explore mode.");
 			discover = TRUE;
diff -urd nethack-3.4.3/src/do_wear.c nethack-3.4.3-paranoid/src/do_wear.c
--- nethack-3.4.3/src/do_wear.c	2003-12-08 01:39:13.000000000 +0200
+++ nethack-3.4.3-paranoid/src/do_wear.c	2011-08-14 11:14:54.000000000 +0300
@@ -1078,7 +1078,11 @@
 			  "  Use 'R' command to remove accessories." : "");
 		return 0;
 	}
-	if (armorpieces > 1)
+	if (armorpieces > 1
+#ifdef PARANOID
+	    || iflags.paranoid_remove
+#endif
+	    )
 		otmp = getobj(clothes, "take off");
 	if (otmp == 0) return(0);
 	if (!(otmp->owornmask & W_ARMOR)) {
@@ -1128,7 +1132,11 @@
 		      "  Use 'T' command to take off armor." : "");
 		return(0);
 	}
-	if (Accessories != 1) otmp = getobj(accessories, "remove");
+	if (Accessories != 1
+#ifdef PARANOID
+	    || iflags.paranoid_remove
+#endif
+	    ) otmp = getobj(accessories, "remove");
 	if(!otmp) return(0);
 	if(!(otmp->owornmask & (W_RING | W_AMUL | W_TOOL))) {
 		You("are not wearing that.");
diff -urd nethack-3.4.3/src/end.c nethack-3.4.3-paranoid/src/end.c
--- nethack-3.4.3/src/end.c	2003-12-08 01:39:13.000000000 +0200
+++ nethack-3.4.3-paranoid/src/end.c	2011-08-14 11:14:54.000000000 +0300
@@ -112,7 +112,21 @@
 int
 done2()
 {
+#ifdef PARANOID
+	char buf[BUFSZ];
+	int really_quit = FALSE;
+
+	if (iflags.paranoid_quit) {
+	  getlin ("Really quit [yes/no]?",buf);
+	  (void) lcase (buf);
+	  if (!(strcmp (buf, "yes"))) really_quit = TRUE;
+	} else {
+	  if(yn("Really quit?") == 'y') really_quit = TRUE;
+	}
+	if (!really_quit) {
+#else /* PARANOID */
 	if(yn("Really quit?") == 'n') {
+#endif /* PARANOID */
 #ifndef NO_SIGNAL
 		(void) signal(SIGINT, (SIG_RET_TYPE) done1);
 #endif
@@ -536,6 +550,10 @@
 done(how)
 int how;
 {
+#if defined(WIZARD) && defined(PARANOID)
+	char paranoid_buf[BUFSZ];
+	int really_bon = TRUE;
+#endif
 	boolean taken;
 	char kilbuf[BUFSZ], pbuf[BUFSZ];
 	winid endwin = WIN_ERR;
@@ -725,8 +743,18 @@
 
 	if (bones_ok) {
 #ifdef WIZARD
+# ifdef PARANOID
+	    if(wizard) {
+		getlin("Save WIZARD MODE bones? [no/yes]", paranoid_buf);
+		(void) lcase (paranoid_buf);
+		if (strcmp (paranoid_buf, "yes"))
+		  really_bon = FALSE;
+            }
+            if(really_bon)
+# else
 	    if (!wizard || yn("Save bones?") == 'y')
-#endif
+#endif /* PARANOID */
+#endif /* WIZARD */
 		savebones(corpse);
 	    /* corpse may be invalid pointer now so
 		ensure that it isn't used again */
diff -urd nethack-3.4.3/src/options.c nethack-3.4.3-paranoid/src/options.c
--- nethack-3.4.3/src/options.c	2003-12-08 01:39:13.000000000 +0200
+++ nethack-3.4.3-paranoid/src/options.c	2011-08-14 11:14:54.000000000 +0300
@@ -143,6 +143,11 @@
 #else
 	{"page_wait", (boolean *)0, FALSE, SET_IN_FILE},
 #endif
+#ifdef PARANOID
+	{"paranoid_hit", &iflags.paranoid_hit, FALSE, SET_IN_GAME},
+	{"paranoid_quit", &iflags.paranoid_quit, FALSE, SET_IN_GAME},
+	{"paranoid_remove", &iflags.paranoid_remove, 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.3/src/potion.c nethack-3.4.3-paranoid/src/potion.c
--- nethack-3.4.3/src/potion.c	2003-12-08 01:39:13.000000000 +0200
+++ nethack-3.4.3-paranoid/src/potion.c	2011-08-14 11:15:12.000000000 +0300
@@ -1527,6 +1527,9 @@
 	register struct obj *potion, *obj;
 	struct obj *singlepotion;
 	const char *tmp;
+#ifdef PARANOID
+	char *objname;
+#endif
 	uchar here;
 	char allowall[2];
 	short mixture;
@@ -1537,15 +1540,27 @@
 		return(0);
 
 	here = levl[u.ux][u.uy].typ;
+#ifdef PARANOID
+	objname = the(xname(obj));
+#endif
 	/* Is there a fountain to dip into here? */
 	if (IS_FOUNTAIN(here)) {
+#ifdef PARANOID
+		Sprintf(qbuf, "Dip %s into the fountain?", strlen(objname) < 50? objname: "it");
+		if(yn(qbuf) == 'y') {
+#else
 		if(yn("Dip it into the fountain?") == 'y') {
+#endif
 			dipfountain(obj);
 			return(1);
 		}
 	} else if (is_pool(u.ux,u.uy)) {
 		tmp = waterbody_name(u.ux,u.uy);
+#ifdef PARANOID
+		Sprintf(qbuf, "Dip %s into the %s?", strlen(objname)+strlen(tmp) < 50? objname: "it", tmp);
+#else
 		Sprintf(qbuf, "Dip it into the %s?", tmp);
+#endif
 		if (yn(qbuf) == 'y') {
 		    if (Levitation) {
 			floating_above(tmp);
@@ -1562,7 +1577,12 @@
 		}
 	}
 
+#ifdef PARANOID
+	Sprintf(qbuf, "dip %s into", strlen(objname) < 50? objname: "it");
+	if(!(potion = getobj(beverages, qbuf)))
+#else
 	if(!(potion = getobj(beverages, "dip into")))
+#endif
 		return(0);
 	if (potion == obj && potion->quan == 1L) {
 		pline("That is a potion bottle, not a Klein bottle!");
diff -urd nethack-3.4.3/src/uhitm.c nethack-3.4.3-paranoid/src/uhitm.c
--- nethack-3.4.3/src/uhitm.c	2003-12-08 01:39:13.000000000 +0200
+++ nethack-3.4.3-paranoid/src/uhitm.c	2011-08-14 11:14:54.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
 		}
 	}