Add safe_wait to toggle search and wait prevention
This commit is contained in:
+9
-2
@@ -675,7 +675,9 @@ support, the command is also invoked when a mouse-click takes place on a
|
|||||||
location other than the current position.
|
location other than the current position.
|
||||||
.lp .
|
.lp .
|
||||||
Wait or rest, do nothing for one turn. Precede with the \(oqm\(cq prefix
|
Wait or rest, do nothing for one turn. Precede with the \(oqm\(cq prefix
|
||||||
to wait for a turn even next to a hostile monster.
|
to wait for a turn even next to a hostile monster, if
|
||||||
|
.op safe_wait
|
||||||
|
is on.
|
||||||
.lp a
|
.lp a
|
||||||
Apply (use) a tool (pick-axe, key, lamp...).
|
Apply (use) a tool (pick-axe, key, lamp...).
|
||||||
.lp ""
|
.lp ""
|
||||||
@@ -884,7 +886,9 @@ Redraw the screen.
|
|||||||
Search for secret doors and traps around you.
|
Search for secret doors and traps around you.
|
||||||
It usually takes several tries to find something.
|
It usually takes several tries to find something.
|
||||||
Precede with the \(oqm\(cq prefix to search for a turn
|
Precede with the \(oqm\(cq prefix to search for a turn
|
||||||
even next to a hostile monster.
|
even next to a hostile monster, if
|
||||||
|
.op safe_wait
|
||||||
|
is on.
|
||||||
.lp ""
|
.lp ""
|
||||||
Can also be used to figure out whether there is still a monster at
|
Can also be used to figure out whether there is still a monster at
|
||||||
an adjacent \(lqremembered, unseen monster\(rq marker.
|
an adjacent \(lqremembered, unseen monster\(rq marker.
|
||||||
@@ -3987,6 +3991,9 @@ Persistent.
|
|||||||
.lp safe_pet
|
.lp safe_pet
|
||||||
Prevent you from (knowingly) attacking your pets (default on).
|
Prevent you from (knowingly) attacking your pets (default on).
|
||||||
Persistent.
|
Persistent.
|
||||||
|
.lp safe_wait
|
||||||
|
Prevents you from waiting or searching when next to a hostile monster
|
||||||
|
(default on). Persistent.
|
||||||
.lp sanity_check
|
.lp sanity_check
|
||||||
Evaluate monsters, objects, and map prior to each turn (default off).
|
Evaluate monsters, objects, and map prior to each turn (default off).
|
||||||
Debug mode only.
|
Debug mode only.
|
||||||
|
|||||||
+8
-2
@@ -769,7 +769,8 @@ location other than the current position.
|
|||||||
%.lp
|
%.lp
|
||||||
\item[\tb{.}]
|
\item[\tb{.}]
|
||||||
Wait or rest, do nothing for one turn. Precede with the `{\tt m}' prefix
|
Wait or rest, do nothing for one turn. Precede with the `{\tt m}' prefix
|
||||||
to wait for a turn even next to a hostile monster.
|
to wait for a turn even next to a hostile monster, if {\it safe\verb+_+wait\/}
|
||||||
|
is on.
|
||||||
%.lp
|
%.lp
|
||||||
\item[\tb{a}]
|
\item[\tb{a}]
|
||||||
Apply (use) a tool (pick-axe, key, lamp \ldots).\\
|
Apply (use) a tool (pick-axe, key, lamp \ldots).\\
|
||||||
@@ -968,7 +969,8 @@ Redraw the screen.
|
|||||||
Search for secret doors and traps around you.
|
Search for secret doors and traps around you.
|
||||||
It usually takes several tries to find something.
|
It usually takes several tries to find something.
|
||||||
Precede with the `{\tt m}' prefix to wait for a turn
|
Precede with the `{\tt m}' prefix to wait for a turn
|
||||||
even next to a hostile monster.\\
|
even next to a hostile monster, if {\it safe\verb+_+wait\/}
|
||||||
|
is on.\\
|
||||||
%.lp ""
|
%.lp ""
|
||||||
Can also be used to figure out whether there is still a monster at
|
Can also be used to figure out whether there is still a monster at
|
||||||
an adjacent ``remembered, unseen monster'' marker.
|
an adjacent ``remembered, unseen monster'' marker.
|
||||||
@@ -4307,6 +4309,10 @@ depend upon the window port used or on the type of terminal. Persistent.
|
|||||||
%.lp
|
%.lp
|
||||||
\item[\ib{safe\verb+_+pet}]
|
\item[\ib{safe\verb+_+pet}]
|
||||||
Prevent you from (knowingly) attacking your pets (default on). Persistent.
|
Prevent you from (knowingly) attacking your pets (default on). Persistent.
|
||||||
|
%.lp
|
||||||
|
\item[\ib{safe\verb+_+wait}]
|
||||||
|
Prevents you from waiting or searching when next to a hostile monster
|
||||||
|
(default on). Persistent.
|
||||||
%+.lp
|
%+.lp
|
||||||
\item[\ib{sanity\verb+_+check}]
|
\item[\ib{sanity\verb+_+check}]
|
||||||
Evaluate monsters, objects, and map prior to each turn (default off).
|
Evaluate monsters, objects, and map prior to each turn (default off).
|
||||||
|
|||||||
+2
-1
@@ -126,7 +126,8 @@ it's possible to wish for tins of the Riders in wizard mode; eating one is
|
|||||||
fatal but if you're life-saved or decline to die, the game crashed
|
fatal but if you're life-saved or decline to die, the game crashed
|
||||||
revival via undead turning of corpse carried by hero said "your <mon> corpse
|
revival via undead turning of corpse carried by hero said "your <mon> corpse
|
||||||
comes alive" even when revived monster was undead
|
comes alive" even when revived monster was undead
|
||||||
prevent searching or waiting next to a hostile monster - override with 'm'
|
prevent searching or waiting next to a hostile monster if boolean option
|
||||||
|
safe_wait is on - override with 'm'
|
||||||
allow random mimics to show up mimicing more furniture than just stairs
|
allow random mimics to show up mimicing more furniture than just stairs
|
||||||
scatter exploding bag of holding contents instead of outright deleting them
|
scatter exploding bag of holding contents instead of outright deleting them
|
||||||
male hero poly'd into nymph chooses charm vs seduce message based on being
|
male hero poly'd into nymph chooses charm vs seduce message based on being
|
||||||
|
|||||||
@@ -424,6 +424,7 @@ E void FDECL(schedule_goto, (d_level *, BOOLEAN_P, BOOLEAN_P, int,
|
|||||||
E void NDECL(deferred_goto);
|
E void NDECL(deferred_goto);
|
||||||
E boolean FDECL(revive_corpse, (struct obj *));
|
E boolean FDECL(revive_corpse, (struct obj *));
|
||||||
E void FDECL(revive_mon, (ANY_P *, long));
|
E void FDECL(revive_mon, (ANY_P *, long));
|
||||||
|
E boolean FDECL(cmd_safety_prevention, (char *, char *, int *));
|
||||||
E int NDECL(donull);
|
E int NDECL(donull);
|
||||||
E int NDECL(dowipe);
|
E int NDECL(dowipe);
|
||||||
E void FDECL(legs_in_no_shape, (const char *, BOOLEAN_P));
|
E void FDECL(legs_in_no_shape, (const char *, BOOLEAN_P));
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ struct flag {
|
|||||||
* clairvoyance */
|
* clairvoyance */
|
||||||
boolean rest_on_space; /* space means rest */
|
boolean rest_on_space; /* space means rest */
|
||||||
boolean safe_dog; /* give complete protection to the dog */
|
boolean safe_dog; /* give complete protection to the dog */
|
||||||
|
boolean safe_wait; /* prevent wait or search next to hostile */
|
||||||
boolean showexp; /* show experience points */
|
boolean showexp; /* show experience points */
|
||||||
boolean showscore; /* show score */
|
boolean showscore; /* show score */
|
||||||
boolean silent; /* whether the bell rings or not */
|
boolean silent; /* whether the bell rings or not */
|
||||||
|
|||||||
@@ -379,6 +379,8 @@ pfx_##a,
|
|||||||
NoAlias, "display frequency when `running' or `travelling'")
|
NoAlias, "display frequency when `running' or `travelling'")
|
||||||
NHOPTB(safe_pet, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias,
|
NHOPTB(safe_pet, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias,
|
||||||
&flags.safe_dog)
|
&flags.safe_dog)
|
||||||
|
NHOPTB(safe_wait, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias,
|
||||||
|
&flags.safe_wait)
|
||||||
NHOPTB(sanity_check, 0, opt_in, set_wizonly, Off, Yes, No, No, NoAlias,
|
NHOPTB(sanity_check, 0, opt_in, set_wizonly, Off, Yes, No, No, NoAlias,
|
||||||
&iflags.sanity_check)
|
&iflags.sanity_check)
|
||||||
NHOPTC(scores, 32, opt_in, set_in_game, No, Yes, No, No, NoAlias,
|
NHOPTC(scores, 32, opt_in, set_in_game, No, Yes, No, No, NoAlias,
|
||||||
|
|||||||
+3
-10
@@ -1868,17 +1868,10 @@ register int aflag; /* intrinsic autosearch vs explicit searching */
|
|||||||
int
|
int
|
||||||
dosearch()
|
dosearch()
|
||||||
{
|
{
|
||||||
if (!iflags.menu_requested && !g.multi && monster_nearby()) {
|
if (cmd_safety_prevention("another search",
|
||||||
char buf[QBUFSZ];
|
"You already found a monster.",
|
||||||
|
&g.already_found_flag))
|
||||||
buf[0] = '\0';
|
|
||||||
if (iflags.cmdassist || !g.already_found_flag++)
|
|
||||||
Sprintf(buf, " Use '%s' prefix to force another search.",
|
|
||||||
visctrl(g.Cmd.spkeys[NHKF_REQMENU])); /* default is "m" */
|
|
||||||
Norep("You already found a monster.%s", buf);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
g.already_found_flag = 0; /* start over */
|
|
||||||
return dosearch0(0);
|
return dosearch0(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1982,22 +1982,36 @@ long timeout UNUSED;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean
|
||||||
|
cmd_safety_prevention(cmddesc, act, flagcounter)
|
||||||
|
char *cmddesc;
|
||||||
|
char *act;
|
||||||
|
int *flagcounter;
|
||||||
|
{
|
||||||
|
if (flags.safe_wait && !iflags.menu_requested
|
||||||
|
&& !g.multi && monster_nearby()) {
|
||||||
|
char buf[QBUFSZ];
|
||||||
|
|
||||||
|
buf[0] = '\0';
|
||||||
|
if (iflags.cmdassist || !*flagcounter++)
|
||||||
|
Sprintf(buf, " Use '%s' prefix to force %s.",
|
||||||
|
visctrl(g.Cmd.spkeys[NHKF_REQMENU]), cmddesc);
|
||||||
|
Norep("%s%s", act, buf);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
*flagcounter = 0;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* '.' command: do nothing == rest; also the
|
/* '.' command: do nothing == rest; also the
|
||||||
' ' command iff 'rest_on_space' option is On */
|
' ' command iff 'rest_on_space' option is On */
|
||||||
int
|
int
|
||||||
donull()
|
donull()
|
||||||
{
|
{
|
||||||
if (!iflags.menu_requested && !g.multi && monster_nearby()) {
|
if (cmd_safety_prevention("a no-op (to rest)",
|
||||||
char buf[QBUFSZ];
|
"Are you waiting to get hit?",
|
||||||
|
&g.did_nothing_flag))
|
||||||
buf[0] = '\0';
|
|
||||||
if (iflags.cmdassist || !g.did_nothing_flag++)
|
|
||||||
Sprintf(buf, " Use '%s' prefix to force a no-op (to rest).",
|
|
||||||
visctrl(g.Cmd.spkeys[NHKF_REQMENU])); /* default is "m" */
|
|
||||||
Norep("Are you waiting to get hit?%s", buf);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
g.did_nothing_flag = 0; /* reset */
|
|
||||||
return 1; /* Do nothing, but let other things happen */
|
return 1; /* Do nothing, but let other things happen */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user