Port the autounlock feature, hallucinatory trap names from UnNetHack
This adds a boolean option, autounlock, defaulting to true. When this is set to TRUE, messages stating that some door or container is locked are automatically followed by a prompt asking if you would like to unlock it, if you are carrying an unlocking tool (key, lock pick, or credit card). Architecturally, this extends the pick_lock function to take three additional arguments (door coordinates or a box on the ground you are autounlocking). The code that selects an unlocking tool will always look first for a skeleton key, then a lock pick, then a credit card. Since curses, rust, and other attributes don't really have an effect on the viability of the unlocking device, it didn't seem to warrant making a more complex function for that. Add hallucinatory trap names This adds many funny, realistic, and nonsensical traps to the game, to be shown when the player is hallucinating. Architecturally, the biggest change is merging the what_trap macro and the "defsyms[trap_to_defsym(ttyp)].explanation" pattern into a single function "trapname", which returns the name of the trap, handling the hallucination case. There is also a second parameter used for overriding hallucination in the occasional cases where the actual trap name should always be returned. In addition, the what_trap and random_trap macros are now obsolete and not used anywhere, so they are removed. reinstate anti-rng abuse bit on hallucination updates to hallucinatory trap names and fixes37.0 entry
This commit is contained in:
@@ -1612,7 +1612,6 @@ void
|
||||
find_trap(trap)
|
||||
struct trap *trap;
|
||||
{
|
||||
int tt = what_trap(trap->ttyp, rn2);
|
||||
boolean cleared = FALSE;
|
||||
|
||||
trap->tseen = 1;
|
||||
@@ -1623,8 +1622,7 @@ struct trap *trap;
|
||||
behaviour might need a rework in the hallucination case
|
||||
(e.g. to not prompt if any trap glyph appears on the square). */
|
||||
if (Hallucination ||
|
||||
levl[trap->tx][trap->ty].glyph !=
|
||||
trap_to_glyph(trap, rn2_on_display_rng)) {
|
||||
levl[trap->tx][trap->ty].glyph != trap_to_glyph(trap)) {
|
||||
/* There's too much clutter to see your find otherwise */
|
||||
cls();
|
||||
map_trap(trap, 1);
|
||||
@@ -1632,7 +1630,7 @@ struct trap *trap;
|
||||
cleared = TRUE;
|
||||
}
|
||||
|
||||
You("find %s.", an(defsyms[trap_to_defsym(tt)].explanation));
|
||||
You("find %s.", an(trapname(trap->ttyp, FALSE)));
|
||||
|
||||
if (cleared) {
|
||||
display_nhwindow(WIN_MAP, TRUE); /* wait */
|
||||
@@ -1871,7 +1869,7 @@ int default_glyph, which_subset;
|
||||
|| glyph_is_invisible(glyph))
|
||||
&& keep_traps && !covers_traps(x, y)) {
|
||||
if ((t = t_at(x, y)) != 0 && t->tseen)
|
||||
glyph = trap_to_glyph(t, rn2_on_display_rng);
|
||||
glyph = trap_to_glyph(t);
|
||||
}
|
||||
if ((glyph_is_object(glyph) && !keep_objs)
|
||||
|| (glyph_is_trap(glyph) && !keep_traps)
|
||||
|
||||
Reference in New Issue
Block a user