add 'montelecontrol' option (wizard-mode only)

Add a new debugging option, 'montelecontrol', that allows a wizard-
mode player to choose a teleporting monster's destination.  If player
picks a bad spot, confirmation will be requested.  If accepted, the
spot will be used even though the consequences could be bad; that's
on the player.  If rejected, the destination will be assigned as if
no control had been attempted rather than try again.

The fuzzer isn't allowed to override a bad spot if it tries to pick
one.  That would probably trigger a sanity_check warning; the fuzzer
causes impossible warnings to behave as if panic, so accepting a bad
spot would just be fuzzer suicide.  It is allowed to randomly set the
option and maybe--though extremely unlikely--randomly pick a valid
controlled destination.
This commit is contained in:
PatR
2023-06-09 00:56:53 -07:00
parent 62eacb11c4
commit e475dca209
8 changed files with 77 additions and 2 deletions

View File

@@ -2820,6 +2820,7 @@ extern void level_tele_trap(struct trap *, unsigned);
extern void rloc_to(struct monst *, coordxy, coordxy);
extern void rloc_to_flag(struct monst *, coordxy, coordxy, unsigned);
extern boolean rloc(struct monst *, unsigned);
extern boolean control_mon_tele(struct monst *, coord *cc, unsigned, boolean);
extern boolean tele_restrict(struct monst *);
extern void mtele_trap(struct monst *, struct trap *, int);
extern int mlevel_tele_trap(struct monst *, struct trap *, boolean, int);

View File

@@ -236,6 +236,7 @@ struct instance_flags {
boolean debug_mongen; /* debug: prevent monster generation */
boolean debug_hunger; /* debug: prevent hunger */
boolean mon_polycontrol; /* debug: control monster polymorphs */
boolean mon_telecontrol; /* debug: control monster teleports */
boolean in_dumplog; /* doing the dumplog right now? */
boolean in_parse; /* is a command being parsed? */
/* suppress terminate during options parsing, for --showpaths */

View File

@@ -454,6 +454,9 @@ static int optfn_##a(int, int, boolean, char *, char *);
NHOPTB(monpolycontrol, Advanced, 0, opt_in, set_wizonly,
Off, Yes, No, No, NoAlias, &iflags.mon_polycontrol, Term_False,
"control monster polymorphs")
NHOPTB(montelecontrol, Advanced, 0, opt_in, set_wizonly,
Off, Yes, No, No, NoAlias, &iflags.mon_telecontrol, Term_False,
"control monster teleport destinations")
NHOPTC(monsters, Advanced, MAXMCLASSES, opt_in, set_in_config,
No, Yes, No, No, NoAlias,
"list of symbols to use for monsters")