Prevent searching or waiting next to a hostile

Generally speaking there's no reason to wait or search next to
a hostile monster, so let's just prevent those actions. You can
still do those commands by prefixing them with the 'm' prefix.
This commit is contained in:
Pasi Kallinen
2020-04-12 17:32:29 +03:00
parent 47fb7e5ee5
commit ac94c44b0b
6 changed files with 21 additions and 3 deletions
+4 -1
View File
@@ -674,7 +674,8 @@ For ports with mouse
support, the command is also invoked when a mouse-click takes place on a 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. 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.
.lp a .lp a
Apply (use) a tool (pick-axe, key, lamp...). Apply (use) a tool (pick-axe, key, lamp...).
.lp "" .lp ""
@@ -882,6 +883,8 @@ Redraw the screen.
.lp s .lp s
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
even next to a hostile monster.
.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.
+5 -2
View File
@@ -768,7 +768,8 @@ 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
\item[\tb{.}] \item[\tb{.}]
Wait or rest, do nothing for one turn. 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.
%.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).\\
@@ -965,7 +966,9 @@ Redraw the screen.
%.lp %.lp
\item[\tb{s}] \item[\tb{s}]
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
even next to a hostile monster.\\
%.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.
+1
View File
@@ -126,6 +126,7 @@ 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'
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
+2
View File
@@ -2995,6 +2995,8 @@ int NDECL((*cmd_func));
|| cmd_func == doloot || cmd_func == doloot
/* travel: pop up a menu of interesting targets in view */ /* travel: pop up a menu of interesting targets in view */
|| cmd_func == dotravel || cmd_func == dotravel
/* wait and search: allow even if next to a hostile monster */
|| cmd_func == donull || cmd_func == dosearch
/* wizard mode ^V and ^T */ /* wizard mode ^V and ^T */
|| cmd_func == wiz_level_tele || cmd_func == dotelecmd || cmd_func == wiz_level_tele || cmd_func == dotelecmd
/* 'm' prefix allowed for some extended commands */ /* 'm' prefix allowed for some extended commands */
+4
View File
@@ -1782,6 +1782,10 @@ register int aflag; /* intrinsic autosearch vs explicit searching */
int int
dosearch() dosearch()
{ {
if (!iflags.menu_requested && !g.multi && monster_nearby()) {
Norep("You already found a monster.");
return 0;
}
return dosearch0(0); return dosearch0(0);
} }
+5
View File
@@ -1970,6 +1970,11 @@ long timeout UNUSED;
int int
donull() donull()
{ {
if (!iflags.menu_requested && !g.multi && monster_nearby()) {
Norep("Are you waiting to get hit?");
return 0;
}
return 1; /* Do nothing, but let other things happen */ return 1; /* Do nothing, but let other things happen */
} }