Deliberate level teleporter activation ignores magic resistance

This is aimed at providing a little quality of life in the form of not
having to divest yourself of your sources of magic resistance before
using a level teleporter. The player is already able to use regular
teleport traps while Antimagic; there's no reason why it should be
different for level teleporters.

This ultimately comes from "Stevie-O's level teleporter jump patch", by
way of SliceHack. I simplified it a bit: deliberately jumping onto the
trap always takes time even if it fails to levelport you (which would
only happen with level teleporters in the End Game, which don't exist).
This commit is contained in:
copperwater
2019-02-01 12:08:54 -05:00
committed by Pasi Kallinen
parent 63d3d7b688
commit da3afd39d2
2 changed files with 31 additions and 17 deletions

View File

@@ -110,6 +110,7 @@ make hero polymorphed into baby purple worm warned against shriekers
confused scroll of light summons tame cancelled lights confused scroll of light summons tame cancelled lights
potions of hallucination can give enlightenment potions of hallucination can give enlightenment
add a small chance of surviving food poisoning add a small chance of surviving food poisoning
deliberate level teleporter activation ignores magic resistance
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository Fixes to 3.7.0-x Problems that Were Exposed Via git Repository

View File

@@ -682,23 +682,34 @@ boolean break_the_rules; /* True: wizard mode ^T */
boolean trap_once = FALSE; boolean trap_once = FALSE;
trap = t_at(u.ux, u.uy); trap = t_at(u.ux, u.uy);
if (trap && (!trap->tseen || trap->ttyp != TELEP_TRAP)) if (trap && !trap->tseen)
trap = 0; trap = 0;
if (trap) { if (trap) {
trap_once = trap->once; /* trap may get deleted, save this */ if (trap->ttyp == LEVEL_TELEP && trap->tseen) {
if (trap->once) { if (yn("There is a level teleporter here. Trigger it?") == 'y') {
pline("This is a vault teleport, usable once only."); level_tele_trap(trap, FORCETRAP);
if (yn("Jump in?") == 'n') { /* deliberate jumping will always take time even if it doesn't
trap = 0; * work */
} else { return 1;
deltrap(trap); } else
newsym(u.ux, u.uy); trap = 0; /* continue with normal horizontal teleport */
} else if (trap->ttyp == TELEP_TRAP) {
trap_once = trap->once; /* trap may get deleted, save this */
if (trap->once) {
pline("This is a vault teleport, usable once only.");
if (yn("Jump in?") == 'n') {
trap = 0;
} else {
deltrap(trap);
newsym(u.ux, u.uy);
}
} }
} if (trap)
if (trap) You("%s onto the teleportation trap.",
You("%s onto the teleportation trap.", locomotion(g.youmonst.data, "jump"));
locomotion(g.youmonst.data, "jump")); } else
trap = 0;
} }
if (!trap) { if (!trap) {
boolean castit = FALSE; boolean castit = FALSE;
@@ -1112,19 +1123,21 @@ struct trap *trap;
unsigned trflags; unsigned trflags;
{ {
char verbbuf[BUFSZ]; char verbbuf[BUFSZ];
boolean intentional = FALSE;
if ((trflags & VIASITTING) != 0) if ((trflags & (VIASITTING|FORCETRAP)) != 0) {
Strcpy(verbbuf, "trigger"); /* follows "You sit down." */ Strcpy(verbbuf, "trigger"); /* follows "You sit down." */
else intentional = TRUE;
} else
Sprintf(verbbuf, "%s onto", Sprintf(verbbuf, "%s onto",
Levitation ? (const char *) "float" Levitation ? (const char *) "float"
: locomotion(g.youmonst.data, "step")); : locomotion(g.youmonst.data, "step"));
You("%s a level teleport trap!", verbbuf); You("%s a level teleport trap!", verbbuf);
if (Antimagic) { if (Antimagic && !intentional) {
shieldeff(u.ux, u.uy); shieldeff(u.ux, u.uy);
} }
if (Antimagic || In_endgame(&u.uz)) { if ((Antimagic && !intentional) || In_endgame(&u.uz)) {
You_feel("a wrenching sensation."); You_feel("a wrenching sensation.");
return; return;
} }