Add paranoid trap, which prevents accidental triggering of harmful traps#259
Closed
copperwater wants to merge 1 commit intoNetHack:NetHack-3.7from
Closed
Add paranoid trap, which prevents accidental triggering of harmful traps#259copperwater wants to merge 1 commit intoNetHack:NetHack-3.7from
copperwater wants to merge 1 commit intoNetHack:NetHack-3.7from
Conversation
Primarily, this ports UnNetHack's paranoid_trap to the vanilla 3.6+ paranoid options system via xNetHack. When this option is enabled, the player must type out "yes" before moving onto a trap that apparently poses a danger to them. When not enabled, the game behaves as it did before, and there is no warning for moving onto traps. If the hero is hallucinating, there is no way to determine what the trap actually is, so they will always be prompted to confirm. If the hero is stunned or confused or has prefixed their movement command with 'm', they will not be prompted regardless of the trap type (overriding the hallucination case). The bulk of the code in this commit is a new function, immune_to_trap, which is how the game decides whether a given monster or the hero is safe from a certain type of trap. This helps avoid interface annoyances in places like levitating over the holes in the Castle (a levitating hero can never trigger a hole just by moving onto the space, so they're "immune" to it). The function has three possible results: obviously immune, obviously not immune, or immune but only by way of items or intrinsics the hero might not have identified. Only the first case lets you move onto that trap type freely. Since the game doesn't track your knowledge of your own intrinsics, this is imperfect; a player with innate fire resistance (and no other source of it) will still be prompted before moving onto a fire trap. I have not currently implemented logic allowing monsters to freely move onto traps they have seen and are immune to, though this should theoretically only require changing a couple lines in monmove.c.
|
If you're hallucinating, shouldn't you step onto the trap if you think it's harmless? |
Contributor
Author
|
If you're hallucinating, the trap will appear as various hallucinatory traps, some of which are quite dangerous! The hero wouldn't see it as harmless. |
|
@copperwater But it WOULD see it as harmless for some traps though right? |
Contributor
Author
|
I think it's reasonable to handwave this as when a hallucinating hero sees any trap, they hallucinate it as something that's dangerous to them. I don't see the point in trying to implement "sometimes when hallucinating you should step onto a trap anyway" since that's less fun. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Primarily, this ports UnNetHack's paranoid_trap to the vanilla 3.6+
paranoid options system via xNetHack. When this option is enabled, the
player must type out "yes" before moving onto a known trap that apparently
poses a danger to them. When not enabled, the game behaves as it did
before, and there is no warning for moving onto traps.
If the hero is hallucinating, there is no way to determine what the trap
actually is, so they will always be prompted to confirm. If the hero is
stunned or confused or has prefixed their movement command with 'm',
they will not be prompted regardless of the trap type (overriding
the hallucination case).
The bulk of the code in this commit is a new function, immune_to_trap,
which is how the game decides whether a given monster or the hero is
safe from a certain type of trap. This helps avoid interface annoyances
in places like levitating over the holes in the Castle (a levitating
hero can never trigger a hole just by moving onto the space, so they're
"immune" to it). The function has three possible results: obviously
immune, obviously not immune, or immune but only by way of items or
intrinsics the hero might not have identified. Only the first case lets
you move onto that trap type freely. Since the game doesn't track your
knowledge of your own intrinsics, this is imperfect; a player with
innate fire resistance (and no other source of it) will still be
prompted before moving onto a fire trap.
I have not currently implemented logic allowing monsters to freely move
onto traps they have seen and are immune to, though this should
theoretically only require changing a couple lines in monmove.c.