Skip to content

Commit

Permalink
The final portal exiting Purgatory will not function until Saint Mich…
Browse files Browse the repository at this point in the history
…ael is killed.

Players have been bypassing Saint Michael and escaping Purgaotry without
having to deal with him, which was never the intent. Now fixed 😁

It's just the final portal from Purgatory to the Castle that is
affected, not the portal between Purgatory and the Sanctum.
  • Loading branch information
k21971 committed Oct 14, 2024
1 parent cf8fc32 commit 112ba47
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/evilhack-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3654,4 +3654,6 @@ The following changes to date are:
- Allow regular/spiked barding to have certain object properties
- Rename nethack.6 and nethack.txt documents to "evilhack"
- Change environment variable for options to EVILHACKOPTIONS
- The final portal exiting Purgatory will not function until Saint
Michael is killed

4 changes: 4 additions & 0 deletions include/decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ E struct dgn_topology { /* special dungeon levels for speed */
d_level d_minetn_level;
d_level d_sokoend_level;
d_level d_sokostart_level;
d_level d_purgend_level;
d_level d_purgstart_level;
} dungeon_topology;
/* macros for accessing the dungeon levels by their old names */
/* clang-format off */
Expand Down Expand Up @@ -112,6 +114,8 @@ E struct dgn_topology { /* special dungeon levels for speed */
#define minetn_level (dungeon_topology.d_minetn_level)
#define sokoend_level (dungeon_topology.d_sokoend_level)
#define sokostart_level (dungeon_topology.d_sokostart_level)
#define purgend_level (dungeon_topology.d_purgend_level)
#define purgstart_level (dungeon_topology.d_purgstart_level)
/* clang-format on */

E NEARDATA stairway dnstair, upstair; /* stairs up and down */
Expand Down
2 changes: 2 additions & 0 deletions include/dungeon.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ typedef struct branch {
#define Is_minetn_level(x) (Lcheck(x, &minetn_level))
#define Is_sokoend_level(x) (Lcheck(x, &sokoend_level))
#define Is_sokostart_level(x) (Lcheck(x, &sokostart_level))
#define Is_purgend_level(x) (Lcheck(x, &purgend_level))
#define Is_purgstart_level(x) (Lcheck(x, &purgstart_level))

#define In_sokoban(x) ((x)->dnum == sokoban_dnum)
#define In_tower(x) ((x)->dnum == tower_dnum)
Expand Down
8 changes: 8 additions & 0 deletions src/do.c
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,14 @@ boolean at_stairs, falling, portal;
return;
}

/* The final portal leaving Purgatory will not function until
its ruler is defeated */
if (on_level(&u.uz, &purgend_level)
&& !u.uevent.umichael && portal) {
pline("Escape from Purgatory is blocked while Saint Michael still lives.");
return;
}

/* Prevent the player from accessing either Mine Town or Mines' End
* unless they have defeated the Goblin King. Using the stairs or
* falling through a hole or trap door is blocked, but our hero can
Expand Down
2 changes: 2 additions & 0 deletions src/dungeon.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,8 @@ struct level_map {
{ "minetn", &minetn_level },
{ "soko1", &sokoend_level },
{ "soko4", &sokostart_level },
{ "purgatory-1", &purgend_level },
{ "purgatory-2", &purgstart_level },
{ X_START, &qstart_level },
{ X_LOCATE, &qlocate_level },
{ X_GOAL, &nemesis_level },
Expand Down

0 comments on commit 112ba47

Please sign in to comment.