pull in the recent unconditionals merge from master
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/* NetHack 3.5 teleport.c $Date$ $Revision$ */
|
||||
/* NetHack 3.5 teleport.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
|
||||
/* NetHack 3.5 teleport.c $Date: 2012/01/04 18:52:36 $ $Revision: 1.45 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -38,10 +39,7 @@ unsigned gpflags;
|
||||
* oh well.
|
||||
*/
|
||||
if (mtmp != &youmonst && x == u.ux && y == u.uy
|
||||
#ifdef STEED
|
||||
&& (!u.usteed || mtmp != u.usteed)
|
||||
#endif
|
||||
)
|
||||
&& (!u.usteed || mtmp != u.usteed))
|
||||
return FALSE;
|
||||
|
||||
if (mtmp) {
|
||||
@@ -123,9 +121,7 @@ unsigned entflags;
|
||||
struct monst fakemon; /* dummy monster */
|
||||
|
||||
if (!mdat) {
|
||||
#ifdef DEBUG
|
||||
pline("enexto() called with mdat==0");
|
||||
#endif
|
||||
debugpline("enexto() called with mdat==0");
|
||||
/* default to player's original monster type */
|
||||
mdat = &mons[u.umonster];
|
||||
}
|
||||
@@ -378,10 +374,8 @@ boolean force_it;
|
||||
{
|
||||
register struct obj *otmp;
|
||||
|
||||
#ifdef STEED
|
||||
if (mtmp == u.usteed)
|
||||
return (FALSE);
|
||||
#endif
|
||||
|
||||
if (mtmp->mleashed) {
|
||||
otmp = get_mleash(mtmp);
|
||||
@@ -422,14 +416,10 @@ struct obj *scroll;
|
||||
|
||||
/* Disable teleportation in stronghold && Vlad's Tower */
|
||||
if (level.flags.noteleport) {
|
||||
#ifdef WIZARD
|
||||
if (!wizard) {
|
||||
#endif
|
||||
pline("A mysterious force prevents you from teleporting!");
|
||||
return TRUE;
|
||||
#ifdef WIZARD
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* don't show trap if "Sorry..." */
|
||||
@@ -437,15 +427,11 @@ struct obj *scroll;
|
||||
|
||||
if ((u.uhave.amulet || On_W_tower_level(&u.uz)) && !rn2(3)) {
|
||||
You_feel("disoriented for a moment.");
|
||||
#ifdef WIZARD
|
||||
if (wizard && yn("Override?") != 'y')
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
if ((Teleport_control && !Stunned)
|
||||
#ifdef WIZARD
|
||||
|| wizard
|
||||
#endif
|
||||
) {
|
||||
if (unconscious()) {
|
||||
pline("Being unconscious, you cannot control your teleport.");
|
||||
@@ -453,10 +439,8 @@ struct obj *scroll;
|
||||
char whobuf[BUFSZ];
|
||||
|
||||
Strcpy(whobuf, "you");
|
||||
#ifdef STEED
|
||||
if (u.usteed)
|
||||
Sprintf(eos(whobuf), " and %s", mon_nam(u.usteed));
|
||||
#endif
|
||||
pline("To what position do %s want to be teleported?",
|
||||
whobuf);
|
||||
cc.x = u.ux;
|
||||
@@ -525,40 +509,29 @@ dotele()
|
||||
castit = TRUE;
|
||||
break;
|
||||
}
|
||||
#ifdef WIZARD
|
||||
if (!wizard) {
|
||||
#endif
|
||||
if (!castit) {
|
||||
if (!Teleportation)
|
||||
You("don't know that spell.");
|
||||
else You("are not able to teleport at will.");
|
||||
return(0);
|
||||
}
|
||||
#ifdef WIZARD
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (u.uhunger <= 100 || ACURR(A_STR) < 6) {
|
||||
#ifdef WIZARD
|
||||
if (!wizard) {
|
||||
#endif
|
||||
You("lack the strength %s.",
|
||||
castit ? "for a teleport spell" : "to teleport");
|
||||
return 1;
|
||||
#ifdef WIZARD
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
energy = objects[SPE_TELEPORT_AWAY].oc_level * 7 / 2 - 2;
|
||||
if (u.uen <= energy) {
|
||||
#ifdef WIZARD
|
||||
if (wizard)
|
||||
energy = u.uen;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
else {
|
||||
You("lack the energy %s.",
|
||||
castit ? "for a teleport spell" : "to teleport");
|
||||
return 1;
|
||||
@@ -573,10 +546,7 @@ dotele()
|
||||
exercise(A_WIS, TRUE);
|
||||
if (spelleffects(sp_no, TRUE))
|
||||
return(1);
|
||||
else
|
||||
#ifdef WIZARD
|
||||
if (!wizard)
|
||||
#endif
|
||||
else if (!wizard)
|
||||
return(0);
|
||||
} else {
|
||||
u.uen -= energy;
|
||||
@@ -607,29 +577,19 @@ level_tele()
|
||||
boolean force_dest = FALSE;
|
||||
|
||||
if ((u.uhave.amulet || In_endgame(&u.uz) || In_sokoban(&u.uz))
|
||||
#ifdef WIZARD
|
||||
&& !wizard
|
||||
#endif
|
||||
) {
|
||||
&& !wizard) {
|
||||
You_feel("very disoriented for a moment.");
|
||||
return;
|
||||
}
|
||||
if ((Teleport_control && !Stunned)
|
||||
#ifdef WIZARD
|
||||
|| wizard
|
||||
#endif
|
||||
) {
|
||||
if ((Teleport_control && !Stunned) || wizard) {
|
||||
char qbuf[BUFSZ];
|
||||
int trycnt = 0;
|
||||
|
||||
Strcpy(qbuf, "To what level do you want to teleport?");
|
||||
do {
|
||||
if (++trycnt == 2) {
|
||||
#ifdef WIZARD
|
||||
if (wizard) Strcat(qbuf, " [type a number or ? for a menu]");
|
||||
else
|
||||
#endif
|
||||
Strcat(qbuf, " [type a number]");
|
||||
else Strcat(qbuf, " [type a number]");
|
||||
}
|
||||
getlin(qbuf, buf);
|
||||
if (!strcmp(buf,"\033")) { /* cancelled */
|
||||
@@ -644,7 +604,6 @@ level_tele()
|
||||
pline("Oops...");
|
||||
goto random_levtport;
|
||||
}
|
||||
#ifdef WIZARD
|
||||
if (wizard && !strcmp(buf,"?")) {
|
||||
schar destlev = 0;
|
||||
xchar destdnum = 0;
|
||||
@@ -667,9 +626,7 @@ level_tele()
|
||||
}
|
||||
}
|
||||
force_dest = TRUE;
|
||||
} else
|
||||
#endif /*WIZARD*/
|
||||
if ((newlev = lev_by_name(buf)) == 0) newlev = atoi(buf);
|
||||
} else if ((newlev = lev_by_name(buf)) == 0) newlev = atoi(buf);
|
||||
} while (!newlev && !digit(buf[0]) &&
|
||||
(buf[0] != '-' || !digit(buf[1])) &&
|
||||
trycnt < 10);
|
||||
@@ -727,7 +684,6 @@ level_tele()
|
||||
You1(shudder_for_moment);
|
||||
return;
|
||||
}
|
||||
#ifdef WIZARD
|
||||
if (In_endgame(&u.uz)) { /* must already be wizard */
|
||||
int llimit = dunlevs_in_dungeon(&u.uz);
|
||||
|
||||
@@ -740,7 +696,6 @@ level_tele()
|
||||
schedule_goto(&newlevel, FALSE, FALSE, 0, (char *)0, (char *)0);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
killer.name[0] = 0; /* still alive, so far... */
|
||||
|
||||
@@ -806,18 +761,13 @@ level_tele()
|
||||
} else if (u.uz.dnum == medusa_level.dnum &&
|
||||
newlev >= dungeons[u.uz.dnum].depth_start +
|
||||
dunlevs_in_dungeon(&u.uz)) {
|
||||
#ifdef WIZARD
|
||||
if (!(wizard && force_dest))
|
||||
#endif
|
||||
find_hell(&newlevel);
|
||||
} else {
|
||||
/* if invocation did not yet occur, teleporting into
|
||||
* the last level of Gehennom is forbidden.
|
||||
*/
|
||||
#ifdef WIZARD
|
||||
if (!wizard)
|
||||
#endif
|
||||
if (Inhell && !u.uevent.invoked &&
|
||||
if (!wizard && Inhell && !u.uevent.invoked &&
|
||||
newlev >= (dungeons[u.uz.dnum].depth_start +
|
||||
dunlevs_in_dungeon(&u.uz) - 1)) {
|
||||
newlev = dungeons[u.uz.dnum].depth_start +
|
||||
@@ -831,9 +781,7 @@ level_tele()
|
||||
* we must translate newlev to a number relative to the
|
||||
* current dungeon.
|
||||
*/
|
||||
#ifdef WIZARD
|
||||
if (!(wizard && force_dest))
|
||||
#endif
|
||||
get_level(&newlevel, newlev);
|
||||
}
|
||||
schedule_goto(&newlevel, FALSE, FALSE, 0, (char *)0, (char *)0);
|
||||
@@ -1031,12 +979,10 @@ boolean suppress_impossible;
|
||||
{
|
||||
register int x, y, trycount;
|
||||
|
||||
#ifdef STEED
|
||||
if (mtmp == u.usteed) {
|
||||
tele();
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (mtmp->iswiz && mtmp->mx) { /* Wizard, not just arriving */
|
||||
if (!In_W_tower(u.ux, u.uy, &u.uz))
|
||||
|
||||
Reference in New Issue
Block a user