github PR #259 - paranoid_confirmation:trap
Fairly old pull request from copperwater: add new paranoid_confirm setting 'trap'. The old commit suffered from bit rot and merging needed too much fixing up despite there not being many bands of change in the commit's diffs. I ultimately redid it from scratch, although the two biggest chunks of code started with copy+paste of the pull request's commit. It operates like paranoid:pray. Setting paranoid:trap adds a new "Really step into <trap>?" y/n prompt when attempting to move into/onto a known trap, even if an object covers it on the map. Setting both 'paranoid:Confirm trap' turns that into a yes/no prompt. (Adding 'Confirm' affects other paranoid confirmations; in addition to requiring yes<return> rather than just y to accept, it also forces no<return> to reject.) However, moving into a known trap that is considered to be harmless behaves as if no trap was present. Some of the trap classification might be out of date; several types of traps have undergone changes since implementation of the original pull request, notably anti-magic field. When the hero is hallucinating, all known traps are considered harmful since the map no longer reliably describes them. Preceding a movement command with the 'm' prefix also behaves as if no trap was present, bypassing confirmation for that move, similar to how paranoid:swim currently behaves. Being stunned or confused also behaves as if no trap was present, taking priority over hallucination. This updates the documentation. Supersedes #259 Closes #259
This commit is contained in:
@@ -2913,6 +2913,7 @@ extern struct monst *animate_statue(struct obj *, coordxy, coordxy,
|
||||
int, int *);
|
||||
extern struct monst *activate_statue_trap(struct trap *, coordxy, coordxy,
|
||||
boolean);
|
||||
extern int immune_to_trap(struct monst *, unsigned);
|
||||
extern void set_utrap(unsigned, unsigned);
|
||||
extern void reset_utrap(boolean);
|
||||
extern void dotrap(struct trap *, unsigned);
|
||||
|
||||
@@ -85,7 +85,8 @@ struct flag {
|
||||
#define PARANOID_WERECHANGE 0x0100
|
||||
#define PARANOID_EATING 0x0200
|
||||
#define PARANOID_SWIM 0x0400
|
||||
#define PARANOID_AUTOALL 0x0800
|
||||
#define PARANOID_TRAP 0x0800
|
||||
#define PARANOID_AUTOALL 0x1000
|
||||
int pickup_burden; /* maximum burden before prompt */
|
||||
int pile_limit; /* controls feedback when walking over objects */
|
||||
char discosort; /* order of dodiscovery/doclassdisco output: o,s,c,a */
|
||||
@@ -482,6 +483,8 @@ enum runmode_types {
|
||||
#define ParanoidEating ((flags.paranoia_bits & PARANOID_EATING) != 0)
|
||||
/* Prevent going into lava or water without explicitly forcing it */
|
||||
#define ParanoidSwim ((flags.paranoia_bits & PARANOID_SWIM) != 0)
|
||||
/* Prevent going onto/into known trap unless it is harmless */
|
||||
#define ParanoidTrap ((flags.paranoia_bits & PARANOID_TRAP) != 0)
|
||||
/* Require confirmation for choosing 'A' in class menu for menustyle:Full */
|
||||
#define ParanoidAutoAll ((flags.paranoia_bits & PARANOID_AUTOALL) != 0U)
|
||||
|
||||
|
||||
@@ -93,13 +93,22 @@ enum trap_types {
|
||||
};
|
||||
|
||||
/* some trap-related function return results */
|
||||
enum { Trap_Effect_Finished = 0,
|
||||
Trap_Is_Gone = 0,
|
||||
Trap_Caught_Mon = 1,
|
||||
Trap_Killed_Mon = 2,
|
||||
Trap_Moved_Mon = 3, /* new location, or new level */
|
||||
enum trap_result {
|
||||
Trap_Effect_Finished = 0,
|
||||
Trap_Is_Gone = 0,
|
||||
Trap_Caught_Mon = 1,
|
||||
Trap_Killed_Mon = 2,
|
||||
Trap_Moved_Mon = 3, /* new location, or new level */
|
||||
};
|
||||
|
||||
/* return codes from immune_to_trap() */
|
||||
enum trap_immunities {
|
||||
TRAP_NOT_IMMUNE = 0,
|
||||
TRAP_CLEARLY_IMMUNE = 1,
|
||||
TRAP_HIDDEN_IMMUNE = 2,
|
||||
};
|
||||
|
||||
|
||||
#define is_pit(ttyp) ((ttyp) == PIT || (ttyp) == SPIKED_PIT)
|
||||
#define is_hole(ttyp) ((ttyp) == HOLE || (ttyp) == TRAPDOOR)
|
||||
#define unhideable_trap(ttyp) ((ttyp) == HOLE) /* visible traps */
|
||||
|
||||
Reference in New Issue
Block a user