Skip to content

Commit

Permalink
Disallow levelporting from ongoing deathmatch
Browse files Browse the repository at this point in the history
Not entirely happy about this but I found that branchporting is already
forbidden, so we'll stick with that for now.  The problem with allowing
escape from other sources than the portal is that it's not feasible to
seal off the arena level when it happens, unless the destination happens
to be the level with the arena portal.  I have been thinking that maybe
we could force the destination of levelport or branchport to be the
arena portal level and then move the portal-sealing and item-erasure
parts from domagicportal to goto_level, but this is a simple initial fix
at least.
  • Loading branch information
entrez committed Oct 18, 2023
1 parent 177b233 commit a528894
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/artifact.c
Expand Up @@ -1531,11 +1531,12 @@ struct obj *obj;
winid tmpwin;
anything any;

/* TNNT: player can't branchport out of the arena if the match is in
* progress. */
/* TNNT: player can't branchport out of the arena if the match is
* in progress. */
if (Is_deathmatch_level(&u.uz) && tnnt_globals.deathmatch_started
&& !tnnt_globals.deathmatch_completed) {
pline("Somehow, %s seems unable to make a portal.", the(xname(obj)));
pline("Somehow, %s seems unable to make a portal.",
the(xname(obj)));
break;
}

Expand All @@ -1547,9 +1548,9 @@ struct obj *obj;
if (!dungeons[i].dunlev_ureached)
continue;

/* TNNT: player can't branchport back into the npcdeath arena if
* they fled the deathmatch (wizard mode #wizlevelport ought to
* work though since it doesn't go through here.) */
/* TNNT: player can't branchport back into the npcdeath arena
* if they fled the deathmatch (wizard mode #wizlevelport
* ought to work though since it doesn't go through here.) */
if (!strcmp(dungeons[i].dname, "Deathmatch Arena")
&& tnnt_globals.deathmatch_started
&& !tnnt_globals.deathmatch_completed)
Expand Down
6 changes: 5 additions & 1 deletion src/teleport.c
Expand Up @@ -790,7 +790,11 @@ level_tele()

if (iflags.debug_fuzzer)
goto random_levtport;
if ((u.uhave.amulet || In_endgame(&u.uz) || In_sokoban(&u.uz))
if ((u.uhave.amulet || In_endgame(&u.uz) || In_sokoban(&u.uz)
/* TNNT: player must exit ongoing deathmatch via portal, since it's
* infeasible to seal the level otherwise */
|| (Is_deathmatch_level(&u.uz) && tnnt_globals.deathmatch_started
&& !tnnt_globals.deathmatch_completed))
&& !wizard) {
You_feel("very disoriented for a moment.");
return;
Expand Down

0 comments on commit a528894

Please sign in to comment.