Merge branch 'to500' into NetHack-next

This commit is contained in:
nhmall
2026-05-02 00:22:14 -04:00
78 changed files with 1287 additions and 1159 deletions
+64
View File
@@ -274,6 +274,70 @@ some bug fixes.
NetHack 3.6.7 was released on February 16, 2023 containing a security fix and
some bug fixes.
Development work for the major release to follow NetHack 3.6 began in 2015
around the same time as NetHack 3.6.0 was being released. That development
work continued in parallel to each of the NetHack 3.6 releases from 2015
through 2023, and continued until the end of April 2026. For the first time,
that development was shared publicly on GitHub and SourceForge as it occurred.
It was done under the label NetHack-3.7 work-in-progress (WIP), although the
version number for the next release had not yet been solidified.
Exposure of the development to the public brought many good things, and some
challenges. People were able to observe and criticize changes and new features
almost immediately, and they often did. The GitHub pull request system made
it straightforward for people to contribute directly to development.
Contributions resolved many, many bugs in the game and we thank all the
contributors.
In early 2026, with the game development getting stable enough to consider
initiating an official release, the devteam reviewed the nature and number of
changes in the game. It was clear that there was sufficient depth and
breadth to warrant a major release and version 5.0 was decided on.
That's a new major release over 3.x, without opening up any ambiguity
or confusion with existing variants that there might have been had it
been released as version 4.0.
NetHack 5.0.0 was released on May 2, 2026.
The source code for NetHack 5.0.0 was modified and modernized to be
compliant with standard C99. The 5.0.0 release contained over 3100 fixes,
changes, and updated features.
NetHack 5.0 was the first version to replace the lex and yacc level
and dungeon compilers of past versions, with a new Lua interpreter-based
approach to provide those elements. Lua is also used for the quest texts
in NetHack 5.0.0. The entire development team acknowledges the work
done by Pasi Kallinen to make that happen.
At the time of the NetHack 5.0 release, the core development team,
active and erstwhile, included Warwick Allison, Michael Allison,
Ken Arromdee, David Cohrs, Jessie Collet, Bart House, Kevin Hugo,
Pasi Kallinen, Ken Lorber, Dean Luick, Pat Rankin, Derek S. Ray,
Alex Smith, Patric Mueller, Mike Stephenson, Janet Walz, Paul Winner.
Ken Lorber, Pat Rankin, Patrick Mueller and Michael Allison helped ensure
that NetHack 5.0 would run on macOS.
Ingo Paschke somehow managed to revive a NetHack 5.0 port for the Amiga,
using a cross-compiler on a modern platform to do so. His work was shared
so others can straightforwardly produce NetHack 5.0 for the Amiga thanks
to his efforts.
Ray Chason contributed the majority of maintenance work for the NetHack 5.0
MS-DOS port, including porting the curses interface to it.
Michael Allison ensured that NetHack 5.0 core changes continued to work
with the msdos port and keep it alive. Cross-compiling the MS-DOS port
has helped make that possible and mostly painless.
People that contributed to the Windows port of NetHack 5.0 since the
development of NetHack 5.0 begain over eleven years ago, included
Michael Allison, David Cohrs, Bart House, Pasi Kallinen, Alex Kompel,
Dion Nicolaas, Derek S. Ray and Yitzhak Sapir.
With sadness, the devteam would like to acknowledge and remember the past
contributions from the late Ron Van Iwaarden, who was the sole maintainer
of NetHack for OS/2 for several past NetHack releases. Ron will be missed.
The official NetHack web site is maintained by Ken Lorber at
https://www.nethack.org/.
+2 -2
View File
@@ -60,7 +60,7 @@
.ds f0 \*(vr
.ds f1 \" empty
.\"DO NOT REMOVE NH_DATESUB .ds f2 Date(%B %-d, %Y)
.ds f2 May 1, 2026
.ds f2 May 2, 2026
.
.\" A note on some special characters:
.\" \(lq = left double quote
@@ -6817,7 +6817,7 @@ That's a new major release over 3.x, without opening up any ambiguity
or confusion with existing variants that there might have been had it
been released as version 4.0.
.pg
NetHack 5.0.0 was released on , 2026.
NetHack 5.0.0 was released on May 2, 2026.
.pg
The source code for NetHack 5.0.0 was modified and modernized to be
compliant with standard C99. The 5.0.0 release contained over 3100 fixes,
+112 -19
View File
@@ -25,7 +25,7 @@
\author{Original version - Eric S. Raymond\\
(Edited and expanded for 5.0.0 by Mike Stephenson and others)}
%DO NOT REMOVE NH_DATESUB \date{Date(%B %-d, %Y)}
\date{May 1, 2026}
\date{May 2, 2026}
\maketitle
@@ -5792,7 +5792,7 @@ computer unless you manually click submit on a form.
%.ei
\end{description}
These options are used only to save you some typing on the crash
report and \#bugreport forms.
report and \#bugreport forms.
%.si
\begin{description}
%.lp
@@ -6769,7 +6769,7 @@ U+224B and the color represented by R-G-B value 0-0-160:\\
OPTIONS=glyph:G_pool/U+224B/0-0-160
\end{verbatim}
The list of acceptable glyphid's can be produced by
The list of acceptable glyphid's can be produced by
\begin{verbatim}
nethack --glyphids
\end{verbatim}
@@ -6911,7 +6911,7 @@ The syntax is the same as WIZARDS.
%.lp
\item[MSGHANDLER]
A path and filename of executable. Whenever a message-window
message is shown, NetHack runs this program. The program will get
message is shown, \textit{NetHack} runs this program. The program will get
the message as the only parameter.
%.lp
\item[MAXPLAYERS]
@@ -6965,12 +6965,12 @@ random statue names (default is 10).
%.lp
\item[ACCESSIBILITY]
0 or 1 to disable or enable, respectively, the ability for players
to set S\textunderscore pet\textunderscore override and S\textunderscore hero\textunderscore override
to set S\textunderscore pet\textunderscore override and S\textunderscore hero\textunderscore override
symbols in their configuration file.
%.lp
\item[PORTABLE\textunderscore DEVICE\textunderscore PATHS]
0 or 1 Windows OS only, the game will look for all of its external
files, and write to all of its output files in one place
files, and write to all of its output files in one place
rather than at the standard locations.
%.lp
\item[DUMPLOGFILE]
@@ -7170,8 +7170,8 @@ subsequent revisions of 3.0.
\medskip
\noindent \textit{Olaf Seibert} ported \textit{NetHack} 2.3 and 3.0 to the Amiga. {\it
Norm Meluch}, \textit{Stephen Spackman} and \textit{Pierre Martineau} designed
overlay code for \textit{PC NetHack} 3.0. \textit{Johnny Lee} ported {\it
NetHack} 3.0 to the Macintosh. Along with various other Dungeoneers, they
overlay code for \textit{PC NetHack} 3.0. \textit{Johnny Lee} ported
\textit{NetHack} 3.0 to the Macintosh. Along with various other Dungeoneers, they
continued to enhance the PC, Macintosh, and Amiga ports through the later
revisions of 3.0.
@@ -7437,7 +7437,7 @@ official release version.
%.pg
\medskip
In January 2015, preparation began for the release of NetHack 3.6.
In January 2015, preparation began for the release of \textit{NetHack} 3.6.
%.pg
\medskip
@@ -7449,7 +7449,7 @@ At the beginning of development for what would eventually get released as
\textit{Mike Stephenson}, \textit{Janet Walz}, and \textit{Paul Winner}.
In early 2015, ahead of the release of 3.6.0, new members
\textit{Sean Hunt}, \textit{Pasi Kallinen}, and \textit{Derek S. Ray}
joined the \textit{NetHack} development team.
joined the \textit{NetHack Development Team}.
%.pg
\medskip
@@ -7484,7 +7484,7 @@ maintained the port of \textit{NetHack} 3.6 for Microsoft Windows.
%.pg
\medskip
\textit{Pat Rankin} attempted to keep the VMS port running for NetHack 3.6,
\textit{Pat Rankin} attempted to keep the VMS port running for \textit{NetHack} 3.6,
hindered by limited access. \textit{Kevin Smolkowski} has updated and tested it
for the most recent version of OpenVMS (V8.4 as of this writing) on Alpha
and Integrity (aka Itanium aka IA64) but not VAX.
@@ -7497,7 +7497,7 @@ necessary updates to the community at large.
%.pg
\medskip
In late April 2018, several hundred bug fixes for 3.6.0 and some new features
were assembled and released as NetHack 3.6.1.
were assembled and released as \textit{NetHack} 3.6.1.
The \textit{NetHack Development Team} at the
time of release of 3.6.1 consisted of
\textit{Warwick Allison}, \textit{Michael Allison}, \textit{Ken Arromdee},
@@ -7519,29 +7519,122 @@ for decades, joined the \textit{NetHack Development Team} in late May 2019.
%.pg
\medskip
NetHack 3.6.3 was released on December 5, 2019 containing over 190 bug
fixes to NetHack 3.6.2.
\textit{NetHack} 3.6.3 was released on December 5, 2019 containing over 190 bug
fixes to \textit{NetHack} 3.6.2.
%.pg
\medskip
NetHack 3.6.4 was released on December 18, 2019 containing a security fix and
\textit{NetHack} 3.6.4 was released on December 18, 2019 containing a security fix and
a few bug fixes.
%.pg
\medskip
NetHack 3.6.5 was released on January 27, 2020 containing some security fixes
\textit{NetHack} 3.6.5 was released on January 27, 2020 containing some security fixes
and a small number of bug fixes.
%.pg
\medskip
NetHack 3.6.6 was released on March 8, 2020 containing a security fix and
\textit{NetHack} 3.6.6 was released on March 8, 2020 containing a security fix and
some bug fixes.
%.pg
\medskip
NetHack 3.6.7 was released on February 16, 2023 containing a security fix and
\textit{NetHack} 3.6.7 was released on February 16, 2023 containing a security fix and
some bug fixes.
%.pg
\medskip
Development work for the major release to follow \textit{NetHack} 3.6 began in 2015
around the same time as \textit{NetHack} 3.6.0 was being released. That development
work continued in parallel to each of the \textit{NetHack} 3.6 releases from 2015
through 2023, and continued until the end of April 2026. For the first time,
that development was shared publicly on GitHub and SourceForge as it occurred.
It was done under the label NetHack-3.7 work-in-progress (WIP), although the
version number for the next release had not yet been solidified.
%.pg
\medskip
Exposure of the development to the public brought many good things, and some
challenges. People were able to observe and criticize changes and new features
almost immediately, and they often did. The GitHub pull request system made
it straightforward for people to contribute directly to development.
Contributions resolved many, many bugs in the game and we thank all the
contributors.
%.pg
\medskip
In early 2026, with the game development getting stable enough to consider
initiating an official release, the devteam reviewed the nature and number of
changes in the game. It was clear that there was sufficient depth and
breadth to warrant a major release and version 5.0 was decided on.
That's a new major release over 3.x, without opening up any ambiguity
or confusion with existing variants that there might have been had it
been released as version 4.0.
%.pg
\medskip
\textit{NetHack} 5.0.0 was released on May 2, 2026.
%.pg
\medskip
The source code for \textit{NetHack} 5.0.0 was modified and modernized to be
compliant with standard C99. The 5.0.0 release contained over 3100 fixes,
changes, and updated features.
%.pg
\medskip
\textit{NetHack} 5.0 was the first version to replace the lex and yacc level
and dungeon compilers of past versions, with a new Lua interpreter-based
approach to provide those elements. Lua is also used for the quest texts
in \textit{NetHack} 5.0.0. The entire development team acknowledges the work
done by \textit{Pasi Kallinen} to make that happen.
\textit{Ray Chason}
%.pg
\medskip
At the time of the \textit{NetHack} 5.0 release, the core
\textit{NetHack Development Team},
active and erstwhile, included \textit{Warwick Allison}, \textit{Michael Allison},
\textit{Ken Arromdee}, \textit{David Cohrs}, \textit{Jessie Collet}, \textit{Bart House},
\textit{Kevin Hugo}, \textit{Pasi Kallinen}, \textit{Ken Lorber}, \textit{Dean Luick},
\textit{Pat Rankin}, \textit{Derek S. Ray}, \textit{Alex Smith}, \textit{Patric Mueller},
\textit{Mike Stephenson}, \textit{Janet Walz}, \textit{Paul Winner}.
%.pg
\medskip
\textit{Ken Lorber}, \textit{Pat Rankin}, \textit{Patrick Mueller} and
\textit{Michael Allison} helped ensure that \textit{NetHack} 5.0 would run
on macOS.
%.pg
\medskip
\textit{Ingo Paschke} somehow managed to revive a \textit{NetHack} 5.0 port for the Amiga,
using a cross-compiler on a modern platform to do so. His work was shared so
others can straightforwardly produce \textit{NetHack} 5.0 for the Amiga thanks to his
efforts.
%.pg
\medskip
\textit{Ray Chason} contributed the majority of maintenance work for the
\textit{NetHack} 5.0 MS-DOS port, including porting the curses interface to it.
\textit{Michael Allison} ensured that \textit{NetHack} 5.0 core changes continued to
work with the msdos port and keep it alive. Cross-compiling the MS-DOS
port has helped make that possible and mostly painless.
%.pg
\medskip
People that contributed to the Windows port of \textit{NetHack} 5.0 since the
development of \textit{NetHack} 5.0 begain over eleven years ago, included
\textit{Michael Allison}, \textit{David Cohrs}, \textit{Bart House},
\textit{Pasi Kallinen}, \textit{Alex Kompel}, \textit{Dion Nicolaas},
\textit{Derek S. Ray} and \textit{Yitzhak Sapir}.
%.pg
\medskip
With sadness, the devteam would like to acknowledge and remember the past
contributions from the late \textit{Ron Van Iwaarden}, who was the sole maintainer
of \textit{NetHack} for OS/2 for several past \textit{NetHack} releases. Ron will be missed.
%.pg
\medskip
\noindent The official \textit{NetHack} web site is maintained by \textit{Ken Lorber} at
@@ -7553,7 +7646,7 @@ some bug fixes.
\subsection*{Special Thanks}
\noindent On behalf of the \textit{NetHack} community, thank you very much once
again to \textit{M. Drew Streib} and \textit{Pasi Kallinen} for providing a
public NetHack server at nethack.alt.org. Thanks to \textit{Keith Simpson}
public \textit{NetHack} server at nethack.alt.org. Thanks to \textit{Keith Simpson}
and \textit{Andy Thomson} for hardfought.org. Thanks to all those
unnamed dungeoneers who invest their time and effort into annual
\textit{NetHack} tournaments such as \textit{Junethack},
+1
View File
@@ -1082,6 +1082,7 @@ struct instance_globals_y {
/* decl.c */
int y_maze_max;
struct monst youmonst;
/* pline.c */
/* work buffer for You(), &c and verbalize() */
+3 -3
View File
@@ -253,11 +253,11 @@
((int) U_AP_TYPE == M_AP_NOTHING) \
? hero_glyph \
: ((int) U_AP_TYPE == M_AP_FURNITURE) \
? cmap_to_glyph((int) u.umonst->mappearance) \
? cmap_to_glyph((int) gy.youmonst.mappearance) \
: ((int) U_AP_TYPE == M_AP_OBJECT) \
? objnum_to_glyph((int) u.umonst->mappearance) \
? objnum_to_glyph((int) gy.youmonst.mappearance) \
/* else U_AP_TYPE == M_AP_MONSTER */ \
: monnum_to_glyph((int) u.umonst->mappearance, Ugender)))
: monnum_to_glyph((int) gy.youmonst.mappearance, Ugender)))
/*
* NetHack glyphs
+2 -2
View File
@@ -464,7 +464,7 @@ enum encumbrance_types {
};
struct entity {
struct monst *emon; /* u.umonst for the player */
struct monst *emon; /* youmonst for the player */
struct permonst *edata; /* must be non-zero for record to be valid */
int ex, ey;
};
@@ -1294,7 +1294,7 @@ typedef uint32_t mmflags_nht; /* makemon MM_ flags */
#define FM_FMON 0x01 /* search the fmon chain */
#define FM_MIGRATE 0x02 /* search the migrating monster chain */
#define FM_MYDOGS 0x04 /* search gm.mydogs */
#define FM_YOU 0x08 /* check for u.umonst */
#define FM_YOU 0x08 /* check for gy.youmonst */
#define FM_EVERYWHERE (FM_YOU | FM_FMON | FM_MIGRATE | FM_MYDOGS)
/* Flags to control pick_[race,role,gend,align] routines in role.c */
+2 -2
View File
@@ -68,8 +68,8 @@ enum m_ap_types {
#define M_AP_TYPMASK 0x7
#define M_AP_F_DKNOWN 0x8
#define U_AP_TYPE (u.umonst->m_ap_type & M_AP_TYPMASK)
#define U_AP_FLAG (u.umonst->m_ap_type & ~M_AP_TYPMASK)
#define U_AP_TYPE (gy.youmonst.m_ap_type & M_AP_TYPMASK)
#define U_AP_FLAG (gy.youmonst.m_ap_type & ~M_AP_TYPMASK)
#define M_AP_TYPE(m) ((m)->m_ap_type & M_AP_TYPMASK)
#define M_AP_FLAG(m) ((m)->m_ap_type & ~M_AP_TYPMASK)
+7 -2
View File
@@ -59,13 +59,18 @@
* to individual level files matter; changes to general game state don't)
* but the extra complexity to support that is not worth the effort.]
*/
/*#define VERSION_COMPATIBILITY 0x03070000L*/
/*#define VERSION_COMPATIBILITY 0x05000000L*/
/****************************************************************************/
/* Version 5.0.x */
/*
* NetHack 5.0.0, <insert date here>
* NetHack 5.0.0, May 2, 2026
*
* Sources changed to C99.
* level compiler, dungeon compiler, and quest text all replaced with
* Lua alternatives.
* Refer to doc/fixes5-0-0.txt for a complete list of fixes and changes.
*
*/
+1 -2
View File
@@ -503,9 +503,8 @@ struct you {
struct skills weapon_skills[P_NUM_SKILLS];
boolean twoweap; /* KMH -- Using two-weapon combat */
short mcham; /* vampire mndx if shapeshifted to bat/cloud */
short umovement; /* instead of u.umonst->movement */
short umovement; /* instead of youmonst.movement */
schar uachieved[N_ACH]; /* list of achievements in the order attained */
struct monst *umonst;
}; /* end of `struct you' */
+4 -4
View File
@@ -67,7 +67,7 @@
#define HSick_resistance u.uprops[SICK_RES].intrinsic
#define ESick_resistance u.uprops[SICK_RES].extrinsic
#define Sick_resistance (HSick_resistance || ESick_resistance \
|| defended(u.umonst, AD_DISE))
|| defended(&gy.youmonst, AD_DISE))
/* Intrinsics only */
#define Invulnerable u.uprops[INVULNERABLE].intrinsic /* [Tom] */
@@ -270,11 +270,11 @@
#define HMagical_breathing u.uprops[MAGICAL_BREATHING].intrinsic
#define EMagical_breathing u.uprops[MAGICAL_BREATHING].extrinsic
#define Amphibious \
(HMagical_breathing || EMagical_breathing || amphibious(u.umonst->data))
(HMagical_breathing || EMagical_breathing || amphibious(gy.youmonst.data))
/* Get wet, may go under surface */
#define Breathless \
(HMagical_breathing || EMagical_breathing || breathless(u.umonst->data))
(HMagical_breathing || EMagical_breathing || breathless(gy.youmonst.data))
#define Underwater (u.uinwater)
/* Note that Underwater and u.uinwater are both used in code.
@@ -398,7 +398,7 @@
redundant but allows the function calls to be skipped most of the time */
#define Unaware (gm.multi < 0 && (unconscious() || is_fainted()))
#define Hate_silver (u.ulycn >= LOW_PM || hates_silver(u.umonst->data))
#define Hate_silver (u.ulycn >= LOW_PM || hates_silver(gy.youmonst.data))
/* _The_Hitchhikers_Guide_to_the_Galaxy_ on uses for 'towel': "wrap it round
your head to ward off noxious fumes" [we require it to be damp or wet] */
+5 -5
View File
@@ -120,7 +120,7 @@ u_calc_moveamt(int wtcap)
/* your speed doesn't augment steed's speed */
moveamt = mcalcmove(u.usteed, TRUE);
} else {
moveamt = u.umonst->data->mmove;
moveamt = gy.youmonst.data->mmove;
if (Very_fast) { /* speed boots, potion, or spell */
/* gain a free action on 2/3 of turns */
@@ -292,7 +292,7 @@ moveloop_core(void)
mvl_wtcap = UNENCUMBERED;
} else if (!Upolyd ? (u.uhp < u.uhpmax)
: (u.mh < u.mhmax
|| u.umonst->data->mlet == S_EEL)) {
|| gy.youmonst.data->mlet == S_EEL)) {
/* maybe heal */
regen_hp(mvl_wtcap);
}
@@ -483,7 +483,7 @@ moveloop_core(void)
curs_on_u();
}
m_everyturn_effect(u.umonst);
m_everyturn_effect(&gy.youmonst);
svc.context.move = 1;
@@ -636,7 +636,7 @@ regen_hp(int wtcap)
if (Upolyd) {
if (u.mh < 1) { /* shouldn't happen... */
rehumanize();
} else if (u.umonst->data->mlet == S_EEL
} else if (gy.youmonst.data->mlet == S_EEL
&& !is_pool(u.ux, u.uy) && !Is_waterlevel(&u.uz)
&& !Breathless) {
/* eel out of water loses hp, similar to monster eels;
@@ -775,7 +775,7 @@ newgame(void)
/* make sure welcome messages are given before noticing monsters */
notice_mon_off();
disp.botlx = TRUE;
svc.context.ident = 2; /* id 1 is reserved for u.umonst->m_id */
svc.context.ident = 2; /* id 1 is reserved for gy.youmonst */
svc.context.warnlevel = 1;
svc.context.next_attrib_check = 600L; /* arbitrary first setting */
svc.context.tribute.enabled = TRUE; /* turn on 3.6 tributes */
+18 -18
View File
@@ -324,7 +324,7 @@ use_stethoscope(struct obj *obj)
boolean interference = (u.uswallow && is_whirly(u.ustuck->data)
&& !rn2(Role_if(PM_HEALER) ? 10 : 3));
if (nohands(u.umonst->data)) {
if (nohands(gy.youmonst.data)) {
You("have no hands!"); /* not `body_part(HAND)' */
return ECMD_OK;
} else if (Deaf) {
@@ -475,7 +475,7 @@ static const char whistle_str[] = "produce a %s whistling sound.",
staticfn void
use_whistle(struct obj *obj)
{
if (!can_blow(u.umonst)) {
if (!can_blow(&gy.youmonst)) {
You("are incapable of using the whistle.");
} else if (Underwater) {
You("blow bubbles through %s.", yname(obj));
@@ -494,13 +494,13 @@ use_whistle(struct obj *obj)
staticfn void
use_magic_whistle(struct obj *obj)
{
if (!can_blow(u.umonst)) {
if (!can_blow(&gy.youmonst)) {
You("are incapable of using the whistle.");
} else if (obj->cursed && !rn2(2)) {
You("produce a %shigh-%s.", Underwater ? "very " : "",
Deaf ? "frequency vibration" : "pitched humming noise");
wake_nearby(TRUE);
if (!rn2(2) && !noteleport_level(u.umonst))
if (!rn2(2) && !noteleport_level(&gy.youmonst))
tele_to_rnd_pet();
} else {
/* it's magic! it works underwater too (at a higher pitch) */
@@ -1054,8 +1054,8 @@ use_mirror(struct obj *obj)
}
gn.nomovemsg = 0; /* default, "you can move again" */
}
} else if (is_vampire(u.umonst->data)
|| is_vampshifter(u.umonst)) {
} else if (is_vampire(gy.youmonst.data)
|| is_vampshifter(&gy.youmonst)) {
You("don't have a reflection.");
} else if (u.umonnum == PM_UMBER_HULK) {
pline("Huh? That doesn't look like you!");
@@ -1786,7 +1786,7 @@ dorub(void)
{
struct obj *obj;
if (nohands(u.umonst->data)) {
if (nohands(gy.youmonst.data)) {
You("aren't able to rub anything without hands.");
return ECMD_OK;
}
@@ -1884,7 +1884,7 @@ check_jump(genericptr arg, coordxy x, coordxy y)
/* let giants jump over boulders (what about Flying?
and is there really enough head room for giants to jump
at all, let alone over something tall?) */
if (sobj_at(BOULDER, x, y) && !throws_rocks(u.umonst->data))
if (sobj_at(BOULDER, x, y) && !throws_rocks(gy.youmonst.data))
return FALSE;
return TRUE;
}
@@ -1993,7 +1993,7 @@ jump(int magic) /* 0=Physical, otherwise skill level */
if (!magic && !Jumping && known_spell(SPE_JUMPING) >= spe_Fresh)
return spelleffects(SPE_JUMPING, FALSE, FALSE);
if (!magic && (nolimbs(u.umonst->data) || slithy(u.umonst->data))) {
if (!magic && (nolimbs(gy.youmonst.data) || slithy(gy.youmonst.data))) {
/* normally (nolimbs || slithy) implies !Jumping,
but that isn't necessarily the case for knights */
You_cant("jump; you have no legs!");
@@ -2197,7 +2197,7 @@ use_tinning_kit(struct obj *obj)
char kbuf[BUFSZ];
const char *corpse_name = an(cxname(corpse));
if (poly_when_stoned(u.umonst->data)) {
if (poly_when_stoned(gy.youmonst.data)) {
You("tin %s without wearing gloves.", corpse_name);
kbuf[0] = '\0';
} else {
@@ -2634,7 +2634,7 @@ use_grease(struct obj *obj)
if (otmp != &hands_obj) {
You("cover %s with a thick layer of grease.", yname(otmp));
otmp->greased = 1;
if (obj->cursed && !nohands(u.umonst->data)) {
if (obj->cursed && !nohands(gy.youmonst.data)) {
make_glib(oldglib + rn1(6, 10)); /* + 10..15 */
pline("Some of the grease gets all over your %s.",
fingers_or_gloves(TRUE));
@@ -2826,7 +2826,7 @@ use_trap(struct obj *otmp)
int levtyp = levl[u.ux][u.uy].typ;
const char *occutext = "setting the trap";
if (nohands(u.umonst->data))
if (nohands(gy.youmonst.data))
what = "without hands";
else if (Stunned)
what = "while stunned";
@@ -3108,7 +3108,7 @@ use_whip(struct obj *obj)
cc.y = ry;
You("wrap your bullwhip around %s.", wrapped_what);
if (proficient && rn2(proficient + 2)) {
if (!mtmp || enexto(&cc, rx, ry, u.umonst->data)) {
if (!mtmp || enexto(&cc, rx, ry, gy.youmonst.data)) {
You("yank yourself out of the pit!");
reset_utrap(TRUE); /* [was after teleds(); do this before
* in case it has no alternative other
@@ -3192,7 +3192,7 @@ use_whip(struct obj *obj)
so proficient at catching weapons */
int dam, hitvalu, hitu;
dam = dmgval(otmp, u.umonst);
dam = dmgval(otmp, &gy.youmonst);
hitvalu = 8 + otmp->spe;
hitu = thitu(hitvalu, Maybe_Half_Phys(dam),
&otmp, (char *) 0);
@@ -3210,7 +3210,7 @@ use_whip(struct obj *obj)
if (otmp->otyp == CORPSE
&& touch_petrifies(&mons[otmp->corpsenm]) && !uarmg
&& !Stone_resistance
&& !(poly_when_stoned(u.umonst->data)
&& !(poly_when_stoned(gy.youmonst.data)
&& polymon(PM_STONE_GOLEM))) {
char kbuf[BUFSZ];
@@ -3581,7 +3581,7 @@ use_cream_pie(struct obj *obj)
You("immerse your %s in %s%s.", body_part(FACE),
several ? "one of " : "",
several ? makeplural(the(xname(obj))) : the(xname(obj)));
if (can_blnd((struct monst *) 0, u.umonst, AT_WEAP, obj)) {
if (can_blnd((struct monst *) 0, &gy.youmonst, AT_WEAP, obj)) {
int blindinc = rnd(25);
u.ucreamed += blindinc;
@@ -3921,7 +3921,7 @@ do_break_wand(struct obj *obj)
boolean is_fragile = (objdescr_is(obj, "balsa")
|| objdescr_is(obj, "glass"));
if (nohands(u.umonst->data)) {
if (nohands(gy.youmonst.data)) {
You_cant("break %s without hands!", yname(obj));
return ECMD_OK;
} else if (!freehand()) {
@@ -4216,7 +4216,7 @@ doapply(void)
struct obj *obj;
int res = ECMD_TIME;
if (nohands(u.umonst->data)) {
if (nohands(gy.youmonst.data)) {
You("aren't able to use or apply tools in your current form.");
return ECMD_OK;
}
+20 -20
View File
@@ -914,7 +914,7 @@ touch_artifact(struct obj *obj, struct monst *mon)
if (oart == &artilist[ART_NONARTIFACT])
return 1;
yours = (mon == u.umonst);
yours = (mon == &gy.youmonst);
/* all quest artifacts are self-willed; if this ever changes, `badclass'
will have to be extended to explicitly include quest artifacts */
self_willed = ((oart->spfx & SPFX_INTEL) != 0);
@@ -1014,7 +1014,7 @@ spec_applies(const struct artifact *weap, struct monst *mtmp)
if (!(weap->spfx & (SPFX_DBONUS | SPFX_ATTK)))
return (weap->attk.adtyp == AD_PHYS);
yours = (mtmp == u.umonst);
yours = (mtmp == &gy.youmonst);
ptr = mtmp->data;
if (weap->spfx & SPFX_DMONS) {
@@ -1256,8 +1256,8 @@ Mb_hit(struct monst *magr, /* attacker */
{
struct permonst *old_mdat;
const char *verb;
boolean youattack = (magr == u.umonst),
youdefend = (mdef == u.umonst),
boolean youattack = (magr == &gy.youmonst),
youdefend = (mdef == &gy.youmonst),
resisted = FALSE, do_stun, do_confuse, result;
int attack_indx, fakeidx, scare_dieroll = MB_MAX_DIEROLL / 2;
@@ -1313,7 +1313,7 @@ Mb_hit(struct monst *magr, /* attacker */
/* now perform special effects */
switch (attack_indx) {
case MB_INDEX_CANCEL:
old_mdat = youdefend ? u.umonst->data : mdef->data;
old_mdat = youdefend ? gy.youmonst.data : mdef->data;
/* No mdef->mcan check: even a cancelled monster can be polymorphed
* into a golem, and the "cancel" effect acts as if some magical
* energy remains in spellcasting defenders to be absorbed later.
@@ -1323,7 +1323,7 @@ Mb_hit(struct monst *magr, /* attacker */
} else {
do_stun = FALSE;
if (youdefend) {
if (u.umonst->data != old_mdat)
if (gy.youmonst.data != old_mdat)
*dmgptr = 0; /* rehumanized, so no more damage */
if (u.uenmax > 0) {
u.uenmax--;
@@ -1359,7 +1359,7 @@ Mb_hit(struct monst *magr, /* attacker */
nomul(-3);
gm.multi_reason = "being scared stiff";
gn.nomovemsg = "";
if (magr && magr == u.ustuck && sticks(u.umonst->data)) {
if (magr && magr == u.ustuck && sticks(gy.youmonst.data)) {
set_ustuck((struct monst *) 0);
You("release %s!", mon_nam(magr));
}
@@ -1445,14 +1445,14 @@ DISABLE_WARNING_FORMAT_NONLITERAL
*/
boolean
artifact_hit(
struct monst *magr, /* attacker; might be Null if 'mdef' is u.umonst */
struct monst *magr, /* attacker; might be Null if 'mdef' is youmonst */
struct monst *mdef, /* defender */
struct obj *otmp, /* artifact weapon */
int *dmgptr, /* output */
int dieroll) /* needed for Magicbane and vorpal blades */
{
boolean youattack = (magr == u.umonst);
boolean youdefend = (mdef == u.umonst);
boolean youattack = (magr == &gy.youmonst);
boolean youdefend = (mdef == &gy.youmonst);
boolean vis = (!youattack && magr && cansee(magr->mx, magr->my))
|| (!youdefend && cansee(mdef->mx, mdef->my))
|| (youattack && engulfing_u(mdef) && !Blind);
@@ -1575,7 +1575,7 @@ artifact_hit(
observe_object(otmp);
return TRUE;
} else {
if (bigmonst(u.umonst->data)) {
if (bigmonst(gy.youmonst.data)) {
pline("%s cuts deeply into you!",
magr ? Monnam(magr) : wepdesc);
*dmgptr *= 2;
@@ -1622,14 +1622,14 @@ artifact_hit(
observe_object(otmp);
return TRUE;
} else {
if (!has_head(u.umonst->data)) {
if (!has_head(gy.youmonst.data)) {
pline("Somehow, %s misses you wildly.",
magr ? mon_nam(magr) : wepdesc);
*dmgptr = 0;
return TRUE;
}
if (noncorporeal(u.umonst->data)
|| amorphous(u.umonst->data)) {
if (noncorporeal(gy.youmonst.data)
|| amorphous(gy.youmonst.data)) {
pline("%s slices through your %s.", wepdesc,
body_part(NECK));
return TRUE;
@@ -2517,11 +2517,11 @@ retouch_object(
return 1;
}
if (touch_artifact(obj, u.umonst)) {
if (touch_artifact(obj, &gy.youmonst)) {
char buf[BUFSZ];
int dmg = 0, tmp;
boolean ag = (objects[obj->otyp].oc_material == SILVER && Hate_silver),
bane = bane_applies(get_artifact(obj), u.umonst);
bane = bane_applies(get_artifact(obj), &gy.youmonst);
/* nothing else to do if hero can successfully handle this object */
if (!ag && !bane)
@@ -2776,7 +2776,7 @@ is_magic_key(struct monst *mon, /* if null, non-rogue is assumed */
struct obj *obj)
{
if (is_art(obj, ART_MASTER_KEY_OF_THIEVERY)) {
if ((mon == u.umonst) ? Role_if(PM_ROGUE)
if ((mon == &gy.youmonst) ? Role_if(PM_ROGUE)
: (mon && mon->data == &mons[PM_ROGUE]))
return !obj->cursed; /* a rogue; non-cursed suffices for magic */
/* not a rogue; key must be blessed to behave as a magic one */
@@ -2785,7 +2785,7 @@ is_magic_key(struct monst *mon, /* if null, non-rogue is assumed */
return FALSE;
}
/* figure out whether 'mon' (usually u.umonst) is carrying the magic key */
/* figure out whether 'mon' (usually youmonst) is carrying the magic key */
struct obj *
has_magic_key(struct monst *mon) /* if null, hero assumed */
{
@@ -2793,8 +2793,8 @@ has_magic_key(struct monst *mon) /* if null, hero assumed */
short key = artilist[ART_MASTER_KEY_OF_THIEVERY].otyp;
if (!mon)
mon = u.umonst;
for (o = ((mon == u.umonst) ? gi.invent : mon->minvent); o;
mon = &gy.youmonst;
for (o = ((mon == &gy.youmonst) ? gi.invent : mon->minvent); o;
o = nxtobj(o, key, FALSE)) {
if (is_magic_key(mon, o))
return o;
+2 -2
View File
@@ -893,7 +893,7 @@ is_innate(int propidx)
ignore innateness if equipment is going to claim responsibility */
&& !u.uprops[propidx].extrinsic)
return FROM_ROLE;
if ((propidx == BLINDED && !haseyes(u.umonst->data))
if ((propidx == BLINDED && !haseyes(gy.youmonst.data))
|| (propidx == BLND_RES && (HBlnd_resist & FROMFORM) != 0))
return FROM_FORM;
return FROM_NONE;
@@ -1219,7 +1219,7 @@ acurr(int chridx)
there would limit Str to 18/07 [18 + 7] */
result = max(tmp, 3);
} else if (chridx == A_CHA) {
if (tmp < 18 && (u.umonst->data->mlet == S_NYMPH
if (tmp < 18 && (gy.youmonst.data->mlet == S_NYMPH
|| u.umonnum == PM_AMOROUS_DEMON))
result = 18;
} else if (chridx == A_CON) {
+3 -3
View File
@@ -256,7 +256,7 @@ bot(void)
return;
/* dosave() flags completion by setting u.uhp to -1; suppress_map_output()
covers program_state.restoring and is used for status as well as map */
if (u.uhp != -1 && u.umonst->data
if (u.uhp != -1 && gy.youmonst.data
&& iflags.status_updates && !suppress_map_output()) {
if (VIA_WINDOWPORT()) {
bot_via_windowport();
@@ -487,7 +487,7 @@ weapon_status(char *outbuf)
/* no weapon; gloves imply hands; humanoid also implies hands;
otherwise make no assumptions */
res = uarmg ? "Empty-hnd" /* empty handed means "gloves only" */
: humanoid(u.umonst->data) ? "Bare-hnds" /* bare hands */
: humanoid(gy.youmonst.data) ? "Bare-hnds" /* bare hands */
: "No-weapon";
} else if (u.twoweap) {
/* two-weaponing implies hands and a weapon or wep-tool
@@ -1179,7 +1179,7 @@ bot_via_windowport(void)
#else
test_if_enabled(bl_held) = TRUE;
#endif
} else if (Upolyd && sticks(u.umonst->data)) {
} else if (Upolyd && sticks(gy.youmonst.data)) {
test_if_enabled(bl_holding) = TRUE;
} else {
/* grab == hero is held by sea monster and about to be drowned;
+4 -4
View File
@@ -889,7 +889,7 @@ RESTORE_WARNING_FORMAT_NONLITERAL
int
domonability(void)
{
struct permonst *uptr = u.umonst->data;
struct permonst *uptr = gy.youmonst.data;
boolean might_hide = (is_hider(uptr) || hides_under(uptr));
char c = '\0';
@@ -917,12 +917,12 @@ domonability(void)
return domindblast();
else if (u.umonnum == PM_GREMLIN) {
if (IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
if (split_mon(u.umonst, (struct monst *) 0))
if (split_mon(&gy.youmonst, (struct monst *) 0))
dryup(u.ux, u.uy, TRUE);
} else if (is_pool(u.ux, u.uy)) {
/* is_pool: might be wearing water walking boots or amulet of
magical breathing */
(void) split_mon(u.umonst, (struct monst *) 0);
(void) split_mon(&gy.youmonst, (struct monst *) 0);
} else {
There("is no fountain here.");
}
@@ -935,7 +935,7 @@ domonability(void)
pline("Unfortunately sound does not carry well through rock.");
else
aggravate();
} else if (is_vampire(uptr) || is_vampshifter(u.umonst)) {
} else if (is_vampire(uptr) || is_vampshifter(&gy.youmonst)) {
return dopoly();
} else if (u.usteed && can_breathe(u.usteed->data)) {
(void) pet_ranged_attk(u.usteed, TRUE);
+3 -3
View File
@@ -320,10 +320,10 @@ m_to_e(struct monst *mtmp, coordxy x, coordxy y, struct entity *etmp)
staticfn void
u_to_e(struct entity *etmp)
{
etmp->emon = u.umonst;
etmp->emon = &gy.youmonst;
etmp->ex = u.ux;
etmp->ey = u.uy;
etmp->edata = u.umonst->data;
etmp->edata = gy.youmonst.data;
}
staticfn void
@@ -337,7 +337,7 @@ set_entity(
m_to_e(m_at(x, y), x, y, etmp);
}
#define is_u(etmp) (etmp->emon == u.umonst)
#define is_u(etmp) (etmp->emon == &gy.youmonst)
#define e_canseemon(etmp) (is_u(etmp) || canseemon(etmp->emon))
/*
+1
View File
@@ -842,6 +842,7 @@ static const struct instance_globals_x g_init_x = {
static const struct instance_globals_y g_init_y = {
/* decl.c */
(ROWNO - 1) & ~1, /* y_maze_max */
DUMMY, /* youmonst */
/* pline.c */
NULL, /* you_buf */
0, /* you_buf_siz */
+3 -3
View File
@@ -386,7 +386,7 @@ gold_detect(struct obj *sobj)
adjust message if you have gold in your inventory */
char buf[BUFSZ];
if (u.umonst->data == &mons[PM_GOLD_GOLEM])
if (gy.youmonst.data == &mons[PM_GOLD_GOLEM])
Sprintf(buf, "You feel like a million %s!", currency(2L));
else if (money_cnt(gi.invent) || hidden_gold(TRUE))
Strcpy(buf,
@@ -1227,7 +1227,7 @@ use_crystal_ball(struct obj **optr)
make_confused((HConfusion & TIMEOUT) + impair, FALSE);
break;
case 3:
if (!resists_blnd(u.umonst)) {
if (!resists_blnd(&gy.youmonst)) {
pline("%s your vision!", Tobjnam(obj, "damage"));
make_blinded(BlindedTimeout + impair, FALSE);
if (!Blind)
@@ -1776,7 +1776,7 @@ openone(coordxy zx, coordxy zy, genericptr_t num)
newsym(zx, zy);
(*num_p)++;
}
mon = u_at(zx, zy) ? u.umonst : m_at(zx, zy);
mon = u_at(zx, zy) ? &gy.youmonst : m_at(zx, zy);
if (openholdingtrap(mon, &dummy)
|| openfallingtrap(mon, TRUE, &dummy))
(*num_p)++;
+13 -13
View File
@@ -200,7 +200,7 @@ is_digging(void)
return FALSE;
}
#define BY_YOU (u.umonst)
#define BY_YOU (&gy.youmonst)
#define BY_OBJECT ((struct monst *) 0)
enum digcheck_result
@@ -392,7 +392,7 @@ dig(void)
} else if (ttmp && ttmp->ttyp == BEAR_TRAP && u.utrap) {
if (rnl(7) > (Fumbling ? 1 : 4)) {
char kbuf[BUFSZ];
int dmg = dmgval(uwep, u.umonst) + dbon();
int dmg = dmgval(uwep, &gy.youmonst) + dbon();
if (dmg < 1)
dmg = 1;
@@ -2181,8 +2181,8 @@ rot_corpse(anything *arg, long timeout)
&& hides_under(mtmp->data)) {
mtmp->mundetected = 0;
} else if (u_at(x, y)
&& u.uundetected && hides_under(u.umonst->data))
(void) hideunder(u.umonst);
&& u.uundetected && hides_under(gy.youmonst.data))
(void) hideunder(&gy.youmonst);
newsym(x, y);
} else if (in_invent)
update_inventory();
@@ -2241,27 +2241,27 @@ void
escape_tomb(void)
{
debugpline0("escape_tomb");
if ((Teleportation || can_teleport(u.umonst->data))
if ((Teleportation || can_teleport(gy.youmonst.data))
&& (Teleport_control || rn2(3) < Luck+2)) {
You("attempt a teleport spell.");
(void) dotele(FALSE); /* calls unearth_you() */
} else if (u.uburied) { /* still buried after 'port attempt */
boolean good;
if (amorphous(u.umonst->data) || Passes_walls
|| noncorporeal(u.umonst->data)
|| (unsolid(u.umonst->data)
&& u.umonst->data != &mons[PM_WATER_ELEMENTAL])
|| (tunnels(u.umonst->data) && !needspick(u.umonst->data))) {
if (amorphous(gy.youmonst.data) || Passes_walls
|| noncorporeal(gy.youmonst.data)
|| (unsolid(gy.youmonst.data)
&& gy.youmonst.data != &mons[PM_WATER_ELEMENTAL])
|| (tunnels(gy.youmonst.data) && !needspick(gy.youmonst.data))) {
You("%s up through the %s.",
(tunnels(u.umonst->data) && !needspick(u.umonst->data))
(tunnels(gy.youmonst.data) && !needspick(gy.youmonst.data))
? "try to tunnel"
: (amorphous(u.umonst->data))
: (amorphous(gy.youmonst.data))
? "ooze"
: "phase",
surface(u.ux, u.uy));
good = (tunnels(u.umonst->data) && !needspick(u.umonst->data))
good = (tunnels(gy.youmonst.data) && !needspick(gy.youmonst.data))
? dighole(TRUE, FALSE, (coord *) 0) : TRUE;
if (good)
unearth_you();
+5 -5
View File
@@ -228,7 +228,7 @@ flooreffects(
}
mtmp->mtrapped = 0;
} else {
if (!Passes_walls && !throws_rocks(u.umonst->data)) {
if (!Passes_walls && !throws_rocks(gy.youmonst.data)) {
losehp(Maybe_Half_Phys(rnd(15)),
"squished under a boulder", NO_KILLER_PREFIX);
goto deletedwithboulder;
@@ -1110,7 +1110,7 @@ staticfn boolean
u_stuck_cannot_go(const char *updn)
{
if (u.ustuck) {
if (u.uswallow || !sticks(u.umonst->data)) {
if (u.uswallow || !sticks(gy.youmonst.data)) {
You("are %s, and cannot go %s.",
!u.uswallow ? "being held"
: digests(u.ustuck->data) ? "swallowed"
@@ -1257,7 +1257,7 @@ dodown(void)
const char *down_or_thru = trap->ttyp == HOLE ? "down" : "through";
const char *actn = u_locomotion("jump");
if (u.umonst->data->msize >= MZ_HUGE) {
if (gy.youmonst.data->msize >= MZ_HUGE) {
char qbuf[QBUFSZ];
You("don't fit %s easily.", down_or_thru);
@@ -1426,7 +1426,7 @@ u_collide_m(struct monst *mtmp)
it was already here. Randomly move you to an adjacent spot
or else the monster to any nearby location. Prior to 3.3.0
the latter was done unconditionally. */
if (!rn2(2) && enexto(&cc, u.ux, u.uy, u.umonst->data)
if (!rn2(2) && enexto(&cc, u.ux, u.uy, gy.youmonst.data)
&& next2u(cc.x, cc.y))
u_on_newpos(cc.x, cc.y); /*[maybe give message here?]*/
else
@@ -2008,7 +2008,7 @@ hellish_smoke_mesg(void)
if (In_hell(&u.uz) && svl.level.flags.temperature > 0)
You("%s smoke...",
olfaction(u.umonst->data) ? "smell" : "sense");
olfaction(gy.youmonst.data) ? "smell" : "sense");
}
/* give a message when the level temperature is different from previous */
+3 -3
View File
@@ -689,7 +689,7 @@ namefloorobj(void)
been moved off the hero's '@' yet, but there's no way to adjust
the help text once getpos() has started */
Sprintf(buf, "object on map (or '.' for one %s you)",
(u.uundetected && hides_under(u.umonst->data))
(u.uundetected && hides_under(gy.youmonst.data))
? "over" : "under");
if (getpos(&cc, FALSE, buf) < 0 || cc.x <= 0)
return;
@@ -840,7 +840,7 @@ x_monnam(
mappear_as_mon = (M_AP_TYPE(mtmp) == M_AP_MONSTER);
char *bp, buf2[BUFSZ];
if (mtmp == u.umonst)
if (mtmp == &gy.youmonst)
return strcpy(buf, "you"); /* ignore article, "invisible", &c */
if (program_state.gameover)
@@ -1290,7 +1290,7 @@ Mgender(struct monst *mtmp)
{
int mgender = MALE;
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
if (Upolyd ? u.mfemale : flags.female)
mgender = FEMALE;
} else if (mtmp->female) {
+28 -28
View File
@@ -281,7 +281,7 @@ Boots_off(void)
/* check for lava since fireproofed boots make it viable */
if ((is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy))
&& !Levitation && !Flying
&& !(is_clinger(u.umonst->data) && has_ceiling(&u.uz))
&& !(is_clinger(gy.youmonst.data) && has_ceiling(&u.uz))
&& !svc.context.takeoff.cancelled_don
/* avoid recursive call to lava_effects() */
&& !iflags.in_lava_effects) {
@@ -1035,7 +1035,7 @@ Amulet_on(struct obj *amul)
}
case AMULET_OF_STRANGULATION:
/* note: might already be Strangled (via #wizintrinsic) */
if (can_be_strangled(u.umonst) && !Strangled) {
if (can_be_strangled(&gy.youmonst) && !Strangled) {
makeknown(AMULET_OF_STRANGULATION);
Strangled = 6L;
disp.botl = TRUE;
@@ -1118,7 +1118,7 @@ Amulet_off(void)
early_off_msg = TRUE;
if (Underwater) {
if (!cant_drown(u.umonst->data) && !Swimming) {
if (!cant_drown(gy.youmonst.data) && !Swimming) {
You("suddenly inhale an unhealthy amount of %s!",
hliquid("water"));
mkn = TRUE; /* in case of life-saving */
@@ -2034,7 +2034,7 @@ canwearobj(struct obj *otmp, long *mask, boolean noisy)
/* this is the same check as for 'W' (dowear), but different message,
in case we get here via 'P' (doputon) */
if (verysmall(u.umonst->data) || nohands(u.umonst->data)) {
if (verysmall(gy.youmonst.data) || nohands(gy.youmonst.data)) {
if (noisy)
You("can't wear any armor in your current form.");
return 0;
@@ -2044,13 +2044,13 @@ canwearobj(struct obj *otmp, long *mask, boolean noisy)
: is_shirt(otmp) ? c_shirt
: is_suit(otmp) ? c_suit
: 0;
if (which && cantweararm(u.umonst->data)
if (which && cantweararm(gy.youmonst.data)
/* same exception for cloaks as used in m_dowear() */
&& (which != c_cloak
|| ((otmp->otyp != MUMMY_WRAPPING)
? u.umonst->data->msize != MZ_SMALL
: !WrappingAllowed(u.umonst->data)))
&& (racial_exception(u.umonst, otmp) < 1)) {
? gy.youmonst.data->msize != MZ_SMALL
: !WrappingAllowed(gy.youmonst.data)))
&& (racial_exception(&gy.youmonst, otmp) < 1)) {
if (noisy)
pline_The("%s will not fit on your body.", which);
return 0;
@@ -2072,12 +2072,12 @@ canwearobj(struct obj *otmp, long *mask, boolean noisy)
if (noisy)
already_wearing(an(helm_simple_name(uarmh)));
err++;
} else if (Upolyd && has_horns(u.umonst->data) && !is_flimsy(otmp)) {
} else if (Upolyd && has_horns(gy.youmonst.data) && !is_flimsy(otmp)) {
/* (flimsy exception matches polyself handling) */
if (noisy)
pline_The("%s won't fit over your horn%s.",
helm_simple_name(otmp),
plur(num_horns(u.umonst->data)));
plur(num_horns(gy.youmonst.data)));
err++;
} else
*mask = W_ARMH;
@@ -2104,11 +2104,11 @@ canwearobj(struct obj *otmp, long *mask, boolean noisy)
if (noisy)
already_wearing(c_boots);
err++;
} else if (Upolyd && slithy(u.umonst->data)) {
} else if (Upolyd && slithy(gy.youmonst.data)) {
if (noisy)
You("have no feet..."); /* not body_part(FOOT) */
err++;
} else if (Upolyd && u.umonst->data->mlet == S_CENTAUR) {
} else if (Upolyd && gy.youmonst.data->mlet == S_CENTAUR) {
/* break_armor() pushes boots off for centaurs, so don't let
dowear() put them back on;
makeplural(body_part(FOOT)) would yield "rear hooves" here,
@@ -2251,13 +2251,13 @@ accessory_or_armor_on(struct obj *obj)
char answer, qbuf[QBUFSZ];
int res = 0;
if (nolimbs(u.umonst->data)) {
if (nolimbs(gy.youmonst.data)) {
You("cannot make the ring stick to your body.");
return ECMD_OK;
}
if (uleft && uright) {
There("are no more %s%s to fill.",
humanoid(u.umonst->data) ? "ring-" : "",
humanoid(gy.youmonst.data) ? "ring-" : "",
fingers_or_gloves(FALSE));
return ECMD_OK;
}
@@ -2268,7 +2268,7 @@ accessory_or_armor_on(struct obj *obj)
} else {
do {
Sprintf(qbuf, "Which %s%s, Right or Left?",
humanoid(u.umonst->data) ? "ring-" : "",
humanoid(gy.youmonst.data) ? "ring-" : "",
body_part(FINGER));
answer = yn_function(qbuf, rightleftchars, '\0', TRUE);
switch (answer) {
@@ -2321,7 +2321,7 @@ accessory_or_armor_on(struct obj *obj)
return ECMD_OK;
}
} else if (eyewear) {
if (!has_head(u.umonst->data)) {
if (!has_head(gy.youmonst.data)) {
You("have no head to wear %s on.", ansimpleoname(obj));
return ECMD_OK;
}
@@ -2435,7 +2435,7 @@ dowear(void)
/* cantweararm() checks for suits of armor, not what we want here;
verysmall() or nohands() checks for shields, gloves, etc... */
if (verysmall(u.umonst->data) || nohands(u.umonst->data)) {
if (verysmall(gy.youmonst.data) || nohands(gy.youmonst.data)) {
pline("Don't even bother.");
return ECMD_OK;
}
@@ -2459,7 +2459,7 @@ doputon(void)
&& uarm && uarmu && uarmc && uarmh && uarms && uarmg && uarmf) {
/* 'P' message doesn't mention armor */
Your("%s%s are full, and you're already wearing an amulet and %s.",
humanoid(u.umonst->data) ? "ring-" : "",
humanoid(gy.youmonst.data) ? "ring-" : "",
fingers_or_gloves(FALSE),
(ublindf->otyp == LENSES) ? "some lenses" : "a blindfold");
return ECMD_OK;
@@ -2544,7 +2544,7 @@ glibr(void)
rightfall = (uright && !uright->cursed && (!welded(uwep)));
*/
if (!uarmg && (leftfall || rightfall) && !nolimbs(u.umonst->data)) {
if (!uarmg && (leftfall || rightfall) && !nolimbs(gy.youmonst.data)) {
/* changed so cursed rings don't fall off, GAN 10/30/86 */
Your("%s off your %s.",
(leftfall && rightfall) ? "rings slip" : "ring slips",
@@ -2631,22 +2631,22 @@ some_armor(struct monst *victim)
{
struct obj *otmph, *otmp;
otmph = (victim == u.umonst) ? uarmc : which_armor(victim, W_ARMC);
otmph = (victim == &gy.youmonst) ? uarmc : which_armor(victim, W_ARMC);
if (!otmph)
otmph = (victim == u.umonst) ? uarm : which_armor(victim, W_ARM);
otmph = (victim == &gy.youmonst) ? uarm : which_armor(victim, W_ARM);
if (!otmph)
otmph = (victim == u.umonst) ? uarmu : which_armor(victim, W_ARMU);
otmph = (victim == &gy.youmonst) ? uarmu : which_armor(victim, W_ARMU);
otmp = (victim == u.umonst) ? uarmh : which_armor(victim, W_ARMH);
otmp = (victim == &gy.youmonst) ? uarmh : which_armor(victim, W_ARMH);
if (otmp && (!otmph || !rn2(4)))
otmph = otmp;
otmp = (victim == u.umonst) ? uarmg : which_armor(victim, W_ARMG);
otmp = (victim == &gy.youmonst) ? uarmg : which_armor(victim, W_ARMG);
if (otmp && (!otmph || !rn2(4)))
otmph = otmp;
otmp = (victim == u.umonst) ? uarmf : which_armor(victim, W_ARMF);
otmp = (victim == &gy.youmonst) ? uarmf : which_armor(victim, W_ARMF);
if (otmp && (!otmph || !rn2(4)))
otmph = otmp;
otmp = (victim == u.umonst) ? uarms : which_armor(victim, W_ARMS);
otmp = (victim == &gy.youmonst) ? uarms : which_armor(victim, W_ARMS);
if (otmp && (!otmph || !rn2(4)))
otmph = otmp;
return otmph;
@@ -2664,7 +2664,7 @@ stuck_ring(struct obj *ring, int otyp)
if (ring && ring->otyp == otyp) {
/* reasons ring can't be removed match those checked by select_off();
limbless case has extra checks because ordinarily it's temporary */
if (nolimbs(u.umonst->data) && uamul
if (nolimbs(gy.youmonst.data) && uamul
&& uamul->otyp == AMULET_OF_UNCHANGING && uamul->cursed)
return uamul;
if (welded(uwep) && ((ring == RING_ON_PRIMARY) || bimanual(uwep)))
@@ -2706,7 +2706,7 @@ select_off(struct obj *otmp)
if (otmp == uright || otmp == uleft) {
struct obj glibdummy;
if (nolimbs(u.umonst->data)) {
if (nolimbs(gy.youmonst.data)) {
pline_The("ring is stuck.");
return 0;
}
+3 -3
View File
@@ -1185,7 +1185,7 @@ tamedog(
if (mtmp == u.ustuck) {
if (u.uswallow)
expels(mtmp, mtmp->data, TRUE);
else if (!(Upolyd && sticks(u.umonst->data)))
else if (!(Upolyd && sticks(gy.youmonst.data)))
unstuck(mtmp);
}
@@ -1243,7 +1243,7 @@ tamedog(
with each other anymore] */
|| mtmp->isshk || mtmp->isgd || mtmp->ispriest || mtmp->isminion
|| is_covetous(mtmp->data) || is_human(mtmp->data)
|| (is_demon(mtmp->data) && !is_demon(u.umonst->data))
|| (is_demon(mtmp->data) && !is_demon(gy.youmonst.data))
|| (obj && dogfood(mtmp, obj) >= MANFOOD))
return FALSE;
@@ -1313,7 +1313,7 @@ wary_dog(struct monst *mtmp, boolean was_dead)
if (!rn2(edog->abuse + 1))
mtmp->mpeaceful = 1;
if (!quietly && cansee(mtmp->mx, mtmp->my)) {
if (haseyes(u.umonst->data)) {
if (haseyes(gy.youmonst.data)) {
if (haseyes(mtmp->data))
pline_mon(mtmp,
"%s %s to look you in the %s.", Monnam(mtmp),
+5 -5
View File
@@ -675,7 +675,7 @@ find_targ(
break;
if (curx == mtmp->mux && cury == mtmp->muy)
return u.umonst;
return &gy.youmonst;
if ((targ = m_at(curx, cury)) != 0) {
/* Is the monster visible to the pet? */
@@ -778,7 +778,7 @@ score_targ(struct monst *mtmp, struct monst *mtarg)
return score;
}
/* Is the monster peaceful or tame? */
if (/*mtarg->mpeaceful ||*/ mtarg->mtame || mtarg == u.umonst) {
if (/*mtarg->mpeaceful ||*/ mtarg->mtame || mtarg == &gy.youmonst) {
/* Pets will never be targeted */
score -= 3000L;
return score;
@@ -907,7 +907,7 @@ pet_ranged_attk(struct monst *mtmp, boolean forced)
if (mtarg && (!hungry || !rn2(5))) {
int mstatus = M_ATTK_MISS;
if (mtarg == u.umonst) {
if (mtarg == &gy.youmonst) {
if (mattacku(mtmp))
return MMOVE_DIED;
/* Treat this as the pet having initiated an attack even if it
@@ -931,7 +931,7 @@ pet_ranged_attk(struct monst *mtmp, boolean forced)
* nothing will happen.
*/
if ((mstatus & M_ATTK_HIT) && !(mstatus & M_ATTK_DEF_DIED)
&& rn2(4) && mtarg != u.umonst) {
&& rn2(4) && mtarg != &gy.youmonst) {
/* Can monster see? If it can, it can retaliate
* even if the pet is invisible, since it'll see
@@ -1054,7 +1054,7 @@ dog_move(
}
#if 0 /* [this is now handled in dochug()] */
if (!Conflict && !mtmp->mconf
&& mtmp == u.ustuck && !sticks(u.umonst->data)) {
&& mtmp == u.ustuck && !sticks(gy.youmonst.data)) {
unstuck(mtmp); /* swallowed case handled above */
You("get released!");
}
+11 -11
View File
@@ -6,7 +6,7 @@
#define is_bigfoot(x) ((x) == &mons[PM_SASQUATCH])
#define martial() \
(martial_bonus() || is_bigfoot(u.umonst->data) \
(martial_bonus() || is_bigfoot(gy.youmonst.data) \
|| (uarmf && uarmf->otyp == KICKING_BOOTS))
/* gk.kickedobj (decl.c) tracks a kicked object until placed or destroyed */
@@ -53,7 +53,7 @@ kickdmg(struct monst *mon, boolean clumsy)
if (mon->data == &mons[PM_SHADE])
dmg = 0;
specialdmg = special_dmgval(u.umonst, mon, W_ARMF, (long *) 0);
specialdmg = special_dmgval(&gy.youmonst, mon, W_ARMF, (long *) 0);
if (mon->data == &mons[PM_SHADE] && !specialdmg) {
pline_The("%s.", kick_passes_thru);
@@ -180,7 +180,7 @@ kick_monster(struct monst *mon, coordxy x, coordxy y)
* normally, getting all your attacks _including_ all your kicks.
* If you have >1 kick attack, you get all of them.
*/
if (Upolyd && attacktype(u.umonst->data, AT_KICK)) {
if (Upolyd && attacktype(gy.youmonst.data, AT_KICK)) {
struct attack *uattk;
int sum, kickdieroll, armorpenalty, specialdmg,
attknum = 0,
@@ -194,13 +194,13 @@ kick_monster(struct monst *mon, coordxy x, coordxy y)
if (gm.multi < 0)
break;
uattk = &u.umonst->data->mattk[i];
uattk = &gy.youmonst.data->mattk[i];
/* we only care about kicking attacks here */
if (uattk->aatyp != AT_KICK)
continue;
kickdieroll = rnd(20);
specialdmg = special_dmgval(u.umonst, mon, W_ARMF,
specialdmg = special_dmgval(&gy.youmonst, mon, W_ARMF,
(long *) 0);
if (mon->data == &mons[PM_SHADE] && !specialdmg) {
/* doesn't matter whether it would have hit or missed,
@@ -545,7 +545,7 @@ really_kick_object(coordxy x, coordxy y)
You("kick %s with your bare %s.",
corpse_xname(gk.kickedobj, (const char *) 0, CXN_PFX_THE),
makeplural(body_part(FOOT)));
if (poly_when_stoned(u.umonst->data) && polymon(PM_STONE_GOLEM)) {
if (poly_when_stoned(gy.youmonst.data) && polymon(PM_STONE_GOLEM)) {
; /* hero has been transformed but kick continues */
} else {
/* normalize body shape here; foot, not body_part(FOOT) */
@@ -924,7 +924,7 @@ kick_door(coordxy x, coordxy y, int avrg_attrib)
}
exercise(A_DEX, TRUE);
doorbuster = Upolyd && is_giant(u.umonst->data);
doorbuster = Upolyd && is_giant(gy.youmonst.data);
/* door is known to be CLOSED or LOCKED */
if (doorbuster
|| (rnl(35) < avrg_attrib + (!martial() ? 0 : ACURR(A_DEX)))) {
@@ -1262,10 +1262,10 @@ dokick(void)
struct monst *mtmp;
boolean no_kick = FALSE;
if (nolimbs(u.umonst->data) || slithy(u.umonst->data)) {
if (nolimbs(gy.youmonst.data) || slithy(gy.youmonst.data)) {
You("have no legs to kick with.");
no_kick = TRUE;
} else if (verysmall(u.umonst->data)) {
} else if (verysmall(gy.youmonst.data)) {
You("are too small to do any kicking.");
no_kick = TRUE;
} else if (u.usteed) {
@@ -1282,7 +1282,7 @@ dokick(void)
} else if (near_capacity() > SLT_ENCUMBER) {
Your("load is too heavy to balance yourself for a kick.");
no_kick = TRUE;
} else if (u.umonst->data->mlet == S_LIZARD) {
} else if (gy.youmonst.data->mlet == S_LIZARD) {
Your("legs cannot kick effectively.");
no_kick = TRUE;
} else if (u.uinwater && !rn2(2)) {
@@ -1429,7 +1429,7 @@ dokick(void)
int range;
range =
((int) u.umonst->data->cwt + (weight_cap() + inv_weight()));
((int) gy.youmonst.data->cwt + (weight_cap() + inv_weight()));
if (range < 1)
range = 1; /* divide by zero avoidance */
range = (3 * (int) mdat->cwt) / range;
+29 -29
View File
@@ -125,7 +125,7 @@ throw_obj(struct obj *obj, int shotlimit)
goto unsplit_stack;
}
if ((is_art(obj, ART_MJOLLNIR) && ACURR(A_STR) < STR19(25))
|| (obj->otyp == BOULDER && !throws_rocks(u.umonst->data))) {
|| (obj->otyp == BOULDER && !throws_rocks(gy.youmonst.data))) {
pline("It's too heavy.");
res = ECMD_TIME;
goto unsplit_stack;
@@ -299,10 +299,10 @@ ok_to_throw(int *shotlimit_p) /* (see dothrow()) */
*shotlimit_p = LIMIT_TO_RANGE_INT(0, LARGEST_INT, gc.command_count);
gm.multi = 0; /* reset; it's been used up */
if (notake(u.umonst->data)) {
if (notake(gy.youmonst.data)) {
You("are physically incapable of throwing or shooting anything.");
return FALSE;
} else if (nohands(u.umonst->data)) {
} else if (nohands(gy.youmonst.data)) {
You_cant("throw or shoot without hands."); /* not body_part(HAND) */
return FALSE;
/*[what about !freehand(), aside from cursed missile launcher?]*/
@@ -341,7 +341,7 @@ throw_ok(struct obj *obj)
if (uslinging() && obj->oclass == GEM_CLASS)
return GETOBJ_SUGGEST;
if (throws_rocks(u.umonst->data) && obj->otyp == BOULDER)
if (throws_rocks(gy.youmonst.data) && obj->otyp == BOULDER)
return GETOBJ_SUGGEST;
return GETOBJ_DOWNPLAY;
@@ -820,12 +820,12 @@ hurtle_step(genericptr_t arg, coordxy x, coordxy y)
why = "touching the edge of the universe";
You("smack into something!");
} else if (diagonal
&& bad_rock(u.umonst->data, u.ux, y)
&& bad_rock(u.umonst->data, x, u.uy)) {
&& bad_rock(gy.youmonst.data, u.ux, y)
&& bad_rock(gy.youmonst.data, x, u.uy)) {
boolean too_much = (gi.invent
&& (inv_weight() + weight_cap() > WT_TOOMUCH_DIAGONAL));
if (bigmonst(u.umonst->data) || too_much) {
if (bigmonst(gy.youmonst.data) || too_much) {
why = "wedging into a narrow crevice";
You("%sget forcefully wedged into a crevice.",
too_much ? "and all your belongings " : "");
@@ -874,7 +874,7 @@ hurtle_step(genericptr_t arg, coordxy x, coordxy y)
an(pmname(mon->data, NEUTRAL)));
instapetrify(svk.killer.name);
}
if (touch_petrifies(u.umonst->data)
if (touch_petrifies(gy.youmonst.data)
&& !which_armor(mon, W_ARMU | W_ARM | W_ARMC)) {
minstapetrify(mon, TRUE);
}
@@ -883,8 +883,8 @@ hurtle_step(genericptr_t arg, coordxy x, coordxy y)
}
if ((u.ux - x) && (u.uy - y)
&& bad_rock(u.umonst->data, u.ux, y)
&& bad_rock(u.umonst->data, x, u.uy)) {
&& bad_rock(gy.youmonst.data, u.ux, y)
&& bad_rock(gy.youmonst.data, x, u.uy)) {
/* Move at a diagonal. */
if (Sokoban) {
You("come to an abrupt halt!");
@@ -1045,7 +1045,7 @@ mhurtle_step(genericptr_t arg, coordxy x, coordxy y)
pline("%s bumps into you.", Some_Monnam(mon));
stop_occupation();
/* check whether 'mon' is turned to stone by touching poly'd hero */
if (Upolyd && touch_petrifies(u.umonst->data)
if (Upolyd && touch_petrifies(gy.youmonst.data)
&& !which_armor(mon, W_ARMU | W_ARM | W_ARMC)) {
/* give poly'd hero credit/blame despite a monster causing it */
minstapetrify(mon, TRUE);
@@ -1287,14 +1287,14 @@ toss_up(struct obj *obj, boolean hitsroof)
/* object now hits you */
if (obj->oclass == POTION_CLASS) {
potionhit(u.umonst, obj, POTHIT_HERO_THROW);
potionhit(&gy.youmonst, obj, POTHIT_HERO_THROW);
} else if (breaktest(obj)) {
int blindinc;
/* need to check for blindness result prior to destroying obj */
blindinc = ((otyp == CREAM_PIE || otyp == BLINDING_VENOM)
/* AT_WEAP is ok here even if attack type was AT_SPIT */
&& can_blnd(u.umonst, u.umonst, AT_WEAP, obj))
&& can_blnd(&gy.youmonst, &gy.youmonst, AT_WEAP, obj))
? rnd(25)
: 0;
breakmsg(obj, !Blind);
@@ -1304,7 +1304,7 @@ toss_up(struct obj *obj, boolean hitsroof)
switch (otyp) {
case EGG:
if (petrifier && !Stone_resistance
&& !(poly_when_stoned(u.umonst->data)
&& !(poly_when_stoned(gy.youmonst.data)
&& polymon(PM_STONE_GOLEM))) {
/* egg ends up "all over your face"; perhaps
visored helmet should still save you here */
@@ -1344,13 +1344,13 @@ toss_up(struct obj *obj, boolean hitsroof)
less_damage = (hard_helmet(uarmh)
&& (!is_silver || !Hate_silver)),
harmless = (stone_missile(obj)
&& passes_rocks(u.umonst->data)),
&& passes_rocks(gy.youmonst.data)),
artimsg = FALSE;
int dmg = dmgval(obj, u.umonst);
int dmg = dmgval(obj, &gy.youmonst);
if (obj->oartifact && !harmless)
/* need a fake die roll here; rn1(18,2) avoids 1 and 20 */
artimsg = artifact_hit((struct monst *) 0, u.umonst, obj,
artimsg = artifact_hit((struct monst *) 0, &gy.youmonst, obj,
&dmg, rn1(18, 2));
if (!dmg) { /* probably wasn't a weapon; base damage on weight */
@@ -1364,9 +1364,9 @@ toss_up(struct obj *obj, boolean hitsroof)
dmgval()'s artifact light against gremlin or axe against
woody creature since both involve weapons; hero-as-shade is
hypothetical because hero can't polymorph into that form */
if (u.umonst->data == &mons[PM_SHADE] && !is_silver)
if (gy.youmonst.data == &mons[PM_SHADE] && !is_silver)
dmg = 0;
if (obj->blessed && mon_hates_blessings(u.umonst))
if (obj->blessed && mon_hates_blessings(&gy.youmonst))
dmg += rnd(4);
if (is_silver && Hate_silver)
dmg += rnd(20);
@@ -1399,7 +1399,7 @@ toss_up(struct obj *obj, boolean hitsroof)
harmless, but hitting a worn helmet negates that */
harmless = FALSE;
} else if (petrifier && !Stone_resistance
&& !(poly_when_stoned(u.umonst->data)
&& !(poly_when_stoned(gy.youmonst.data)
&& polymon(PM_STONE_GOLEM))) {
petrify:
svk.killer.format = KILLED_BY;
@@ -1415,7 +1415,7 @@ toss_up(struct obj *obj, boolean hitsroof)
if (is_silver && Hate_silver)
pline_The("silver sears you!");
if (harmless)
hit(thesimpleoname(obj), u.umonst, " but doesn't hurt.");
hit(thesimpleoname(obj), &gy.youmonst, " but doesn't hurt.");
hitfloor(obj, TRUE);
gt.thrownobj = 0;
@@ -1603,7 +1603,7 @@ throwit(
hurtle(-u.dx, -u.dy, 1, TRUE);
mon = boomhit(obj, u.dx, u.dy);
iflags.returning_missile = 0; /* has returned or isn't going to */
if (mon == u.umonst) { /* the thing was caught */
if (mon == &gy.youmonst) { /* the thing was caught */
exercise(A_DEX, TRUE);
obj = return_throw_to_inv(obj, wep_mask, twoweap, oldslot);
throwit_return(TRUE);
@@ -1743,7 +1743,7 @@ throwit(
body_part(ARM));
if (obj->oartifact)
(void) artifact_hit((struct monst *) 0,
u.umonst, obj, &dmg, 0);
&gy.youmonst, obj, &dmg, 0);
losehp(Maybe_Half_Phys(dmg), killer_xname(obj),
KILLED_BY);
}
@@ -2034,7 +2034,7 @@ thitmonst(
* Distance and monster size affect chance to hit.
*/
tmp = -1 + Luck + find_mac(mon) + u.uhitinc
+ maybe_polyd(u.umonst->data->mlevel, u.ulevel);
+ maybe_polyd(gy.youmonst.data->mlevel, u.ulevel);
if (ACURR(A_DEX) < 4)
tmp -= 3;
else if (ACURR(A_DEX) < 6)
@@ -2073,7 +2073,7 @@ thitmonst(
tmp += omon_adj(mon, obj, TRUE);
if (is_orc(mon->data)
&& maybe_polyd(is_elf(u.umonst->data), Race_if(PM_ELF)))
&& maybe_polyd(is_elf(gy.youmonst.data), Race_if(PM_ELF)))
tmp++;
if (guaranteed_hit) {
tmp += 1000; /* Guaranteed hit */
@@ -2170,7 +2170,7 @@ thitmonst(
* Polymorphing won't make you a bow expert.
*/
if ((Race_if(PM_ELF) || Role_if(PM_SAMURAI))
&& (!Upolyd || your_race(u.umonst->data))
&& (!Upolyd || your_race(gy.youmonst.data))
&& objects[uwep->otyp].oc_skill == P_BOW) {
++tmp;
if ((Race_if(PM_ELF) && uwep->otyp == ELVEN_BOW)
@@ -2500,16 +2500,16 @@ breakobj(
if (obj->otyp == POT_OIL && obj->lamplit) {
explode_oil(obj, x, y);
} else if (next2u(x, y)) {
if (!breathless(u.umonst->data) || haseyes(u.umonst->data)) {
if (!breathless(gy.youmonst.data) || haseyes(gy.youmonst.data)) {
/* wet towel protects both eyes and breathing */
if (obj->otyp != POT_WATER && !Half_gas_damage) {
if (!breathless(u.umonst->data)) {
if (!breathless(gy.youmonst.data)) {
/* [what about "familiar odor" when known?] */
You("smell a peculiar odor...");
} else {
const char *eyes = body_part(EYE);
if (eyecount(u.umonst->data) != 1)
if (eyecount(gy.youmonst.data) != 1)
eyes = makeplural(eyes);
Your("%s %s.", eyes, vtense(eyes, "water"));
}
+56 -56
View File
@@ -97,12 +97,12 @@ is_edible(struct obj *obj)
/* above also prevents the Amulet from being eaten, so we must never
allow fake amulets to be eaten either [which is already the case] */
if (u.umonst->data == &mons[PM_FIRE_ELEMENTAL]
if (gy.youmonst.data == &mons[PM_FIRE_ELEMENTAL]
&& is_flammable(obj))
return TRUE;
if (metallivorous(u.umonst->data) && is_metallic(obj)
&& (u.umonst->data != &mons[PM_RUST_MONSTER] || is_rustprone(obj)))
if (metallivorous(gy.youmonst.data) && is_metallic(obj)
&& (gy.youmonst.data != &mons[PM_RUST_MONSTER] || is_rustprone(obj)))
return TRUE;
/* Ghouls only eat non-veggy corpses or eggs (see dogfood()) */
@@ -170,7 +170,7 @@ eatmdone(void)
}
/* update display */
if (U_AP_TYPE) {
u.umonst->m_ap_type = M_AP_NOTHING;
gy.youmonst.m_ap_type = M_AP_NOTHING;
newsym(u.ux, u.uy);
}
return 0;
@@ -186,11 +186,11 @@ eatmupdate(void)
if (!ge.eatmbuf || gn.nomovemsg != ge.eatmbuf)
return;
if (is_obj_mappear(u.umonst,ORANGE) && !Hallucination) {
if (is_obj_mappear(&gy.youmonst,ORANGE) && !Hallucination) {
/* revert from hallucinatory to "normal" mimicking */
altmsg = "You now prefer mimicking yourself.";
altapp = GOLD_PIECE;
} else if (is_obj_mappear(u.umonst,GOLD_PIECE) && Hallucination) {
} else if (is_obj_mappear(&gy.youmonst,GOLD_PIECE) && Hallucination) {
/* won't happen; anything which might make immobilized
hero begin hallucinating (black light attack, theft
of Grayswandir) will terminate the mimicry first */
@@ -207,7 +207,7 @@ eatmupdate(void)
}
gn.nomovemsg = strcpy(ge.eatmbuf, altmsg);
/* update current image */
u.umonst->mappearance = altapp;
gy.youmonst.mappearance = altapp;
newsym(u.ux, u.uy);
}
}
@@ -343,12 +343,12 @@ adj_victual_nutrition(void)
assert(nut > 0);
if (otyp == LEMBAS_WAFER) {
if (maybe_polyd(is_elf(u.umonst->data), Race_if(PM_ELF)))
if (maybe_polyd(is_elf(gy.youmonst.data), Race_if(PM_ELF)))
nut += (nut + 2) / 4; /* 800 -> 1000 */
else if (maybe_polyd(is_orc(u.umonst->data), Race_if(PM_ORC)))
else if (maybe_polyd(is_orc(gy.youmonst.data), Race_if(PM_ORC)))
nut -= (nut + 2) / 4; /* 800 -> 600 */
} else if (otyp == CRAM_RATION) {
if (maybe_polyd(is_dwarf(u.umonst->data), Race_if(PM_DWARF)))
if (maybe_polyd(is_dwarf(gy.youmonst.data), Race_if(PM_DWARF)))
nut += (nut + 3) / 6; /* 600 -> 700 */
}
nut = max(nut, 1);
@@ -554,7 +554,7 @@ done_eating(boolean message)
gn.nomovemsg = 0;
} else if (message) {
You("finish %s %s.",
(u.umonst->data == &mons[PM_FIRE_ELEMENTAL]) ? "consuming"
(gy.youmonst.data == &mons[PM_FIRE_ELEMENTAL]) ? "consuming"
: "eating",
food_xname(piece, TRUE));
}
@@ -612,18 +612,18 @@ eat_brains(
/* previous tentacle attack might have triggered fatal passive
counterattack [callers ought to be updated to avoid this situation] */
if (magr != u.umonst && DEADMONSTER(magr)) {
if (magr != &gy.youmonst && DEADMONSTER(magr)) {
return M_ATTK_AGR_DIED;
}
if (noncorporeal(pd)) {
if (visflag)
pline("%s brain is unharmed.",
(mdef == u.umonst) ? "Your" : s_suffix(Monnam(mdef)));
(mdef == &gy.youmonst) ? "Your" : s_suffix(Monnam(mdef)));
return M_ATTK_MISS; /* side-effects can't occur */
} else if (magr == u.umonst) {
} else if (magr == &gy.youmonst) {
You("eat %s brain!", s_suffix(mon_nam(mdef)));
} else if (mdef == u.umonst) {
} else if (mdef == &gy.youmonst) {
Your("brain is eaten!");
} else { /* monster against monster */
if (visflag && canspotmon(mdef))
@@ -634,7 +634,7 @@ eat_brains(
/* mind flayer has attempted to eat the brains of a petrification
inducing critter (most likely Medusa; attacking a cockatrice via
tentacle-touch should have been caught before reaching this far) */
if (magr == u.umonst) {
if (magr == &gy.youmonst) {
if (!Stone_resistance && !Stoned)
make_stoned(5L, (char *) 0, KILLED_BY_AN,
pmname(pd, Mgender(mdef)));
@@ -656,7 +656,7 @@ eat_brains(
}
}
if (magr == u.umonst) {
if (magr == &gy.youmonst) {
/*
* player mind flayer is eating something's brain
*/
@@ -690,7 +690,7 @@ eat_brains(
is cannibalism */
(void) maybe_cannibal(monsndx(pd), TRUE);
} else if (mdef == u.umonst) {
} else if (mdef == &gy.youmonst) {
/*
* monster mind flayer is eating hero's brain
*/
@@ -773,7 +773,7 @@ maybe_cannibal(int pm, boolean allowmsg)
(even if having the form of something which doesn't care
about cannibalism--hero's innate traits aren't altered) */
&& (your_race(fptr)
|| (Upolyd && same_race(u.umonst->data, fptr))
|| (Upolyd && same_race(gy.youmonst.data, fptr))
|| (ismnum(u.ulycn) && were_beastie(pm) == u.ulycn))) {
if (allowmsg) {
if (Upolyd && your_race(fptr))
@@ -793,7 +793,7 @@ cprefx(int pm)
(void) maybe_cannibal(pm, TRUE);
if (flesh_petrifies(&mons[pm])) {
if (!Stone_resistance
&& !(poly_when_stoned(u.umonst->data)
&& !(poly_when_stoned(gy.youmonst.data)
&& polymon(PM_STONE_GOLEM))) {
/* if food was a tin, use it up early to keep it out of bones */
if (svc.context.tin.tin)
@@ -849,7 +849,7 @@ cprefx(int pm)
return;
}
case PM_GREEN_SLIME:
if (!Slimed && !Unchanging && !slimeproof(u.umonst->data)) {
if (!Slimed && !Unchanging && !slimeproof(gy.youmonst.data)) {
You("don't feel very well.");
make_slimed(10L, (char *) 0);
delayed_killer(SLIMED, KILLED_BY_AN, "");
@@ -1191,7 +1191,7 @@ cpostfx(int pm)
/*FALLTHRU*/
case PM_SMALL_MIMIC:
tmp += 20;
if (u.umonst->data->mlet != S_MIMIC && !Unchanging) {
if (gy.youmonst.data->mlet != S_MIMIC && !Unchanging) {
char buf[BUFSZ];
const char *tempshape = !Hallucination ? "a pile of gold"
: "an orange";
@@ -1210,14 +1210,14 @@ cpostfx(int pm)
Hallucination
? "You suddenly dread being peeled and mimic %s again!"
: "You now prefer mimicking %s again.",
an(Upolyd ? pmname(u.umonst->data, Ugender)
an(Upolyd ? pmname(gy.youmonst.data, Ugender)
: gu.urace.noun));
ge.eatmbuf = dupstr(buf);
gn.nomovemsg = ge.eatmbuf;
ga.afternmv = eatmdone;
/* ??? what if this was set before? */
u.umonst->m_ap_type = M_AP_OBJECT;
u.umonst->mappearance = Hallucination ? ORANGE : GOLD_PIECE;
gy.youmonst.m_ap_type = M_AP_OBJECT;
gy.youmonst.mappearance = Hallucination ? ORANGE : GOLD_PIECE;
newsym(u.ux, u.uy);
curs_on_u();
/* make gold symbol show up now */
@@ -1253,7 +1253,7 @@ cpostfx(int pm)
if (svc.context.tin.tin) {
use_up_tin(svc.context.tin.tin);
/* most tin effects end up being skipped */
lesshungry(200 + (metallivorous(u.umonst->data) ? 5 : 0));
lesshungry(200 + (metallivorous(gy.youmonst.data) ? 5 : 0));
}
You("%s.", (pm == PM_GENETIC_ENGINEER)
@@ -1530,7 +1530,7 @@ consume_tin(const char *mesg)
const char *what;
int which, mnum, r, nutamt;
/* if you've eaten tin itself, chance to not eat contents gets bypassed */
boolean always_eat = metallivorous(u.umonst->data);
boolean always_eat = metallivorous(gy.youmonst.data);
struct obj *tin = svc.context.tin.tin;
r = tin_variety(tin, FALSE);
@@ -1725,10 +1725,10 @@ start_tin(struct obj *otmp)
const char *mesg = 0;
int tmp;
if (metallivorous(u.umonst->data)) {
if (metallivorous(gy.youmonst.data)) {
mesg = "You bite right into the metal tin...";
tmp = 0;
} else if (cantwield(u.umonst->data)) { /* nohands || verysmall */
} else if (cantwield(gy.youmonst.data)) { /* nohands || verysmall */
You("cannot handle the tin properly to open it.");
return;
} else if (otmp->blessed) {
@@ -1859,12 +1859,12 @@ eatcorpse(struct obj *otmp)
int ll_conduct = 0;
boolean stoneable,
slimeable = (mnum == PM_GREEN_SLIME && !Slimed && !Unchanging
&& !slimeproof(u.umonst->data)),
&& !slimeproof(gy.youmonst.data)),
glob = otmp->globby ? TRUE : FALSE;
assert(ismnum(mnum));
stoneable = (flesh_petrifies(&mons[mnum]) && !Stone_resistance
&& !poly_when_stoned(u.umonst->data));
&& !poly_when_stoned(gy.youmonst.data));
/* KMH, conduct */
if (!vegan(&mons[mnum]))
@@ -1978,13 +1978,13 @@ eatcorpse(struct obj *otmp)
} else {
/* yummy is always False for omnivores, palatable always True */
boolean yummy = (vegan(&mons[mnum])
? (!carnivorous(u.umonst->data)
&& herbivorous(u.umonst->data))
: (carnivorous(u.umonst->data)
&& !herbivorous(u.umonst->data))),
? (!carnivorous(gy.youmonst.data)
&& herbivorous(gy.youmonst.data))
: (carnivorous(gy.youmonst.data)
&& !herbivorous(gy.youmonst.data))),
palatable = ((vegetarian(&mons[mnum])
? herbivorous(u.umonst->data)
: carnivorous(u.umonst->data))
? herbivorous(gy.youmonst.data)
: carnivorous(gy.youmonst.data))
&& rn2(10)
&& (rotted < 1 || !rn2((int) rotted + 1)));
const char *pmxnam = food_xname(otmp, FALSE);
@@ -2129,9 +2129,9 @@ fprefx(struct obj *otmp)
/* [satiation message may be inaccurate if eating gets interrupted] */
break;
case TRIPE_RATION:
if (carnivorous(u.umonst->data) && !humanoid(u.umonst->data)) {
if (carnivorous(gy.youmonst.data) && !humanoid(gy.youmonst.data)) {
pline("This tripe ration is surprisingly good!");
} else if (maybe_polyd(is_orc(u.umonst->data), Race_if(PM_ORC))) {
} else if (maybe_polyd(is_orc(gy.youmonst.data), Race_if(PM_ORC))) {
pline(Hallucination ? "Tastes great! Less filling!"
: "Mmm, tripe... not bad!");
} else {
@@ -2146,10 +2146,10 @@ fprefx(struct obj *otmp)
}
break;
case LEMBAS_WAFER:
if (maybe_polyd(is_orc(u.umonst->data), Race_if(PM_ORC))) {
if (maybe_polyd(is_orc(gy.youmonst.data), Race_if(PM_ORC))) {
pline("%s", "!#?&* elf kibble!");
break;
} else if (maybe_polyd(is_elf(u.umonst->data), Race_if(PM_ELF))) {
} else if (maybe_polyd(is_elf(gy.youmonst.data), Race_if(PM_ELF))) {
pline("A little goes a long way.");
break;
}
@@ -2160,7 +2160,7 @@ fprefx(struct obj *otmp)
case MEAT_RING:
goto give_feedback;
case CLOVE_OF_GARLIC:
if (is_undead(u.umonst->data)) {
if (is_undead(gy.youmonst.data)) {
make_vomiting((long) rn1(svc.context.victual.reqtime, 5), FALSE);
break;
}
@@ -2293,7 +2293,7 @@ eataccessory(struct obj *otmp)
set_mimic_blocking();
see_monsters();
if (Invis && !oldprop && !ESee_invisible
&& !perceives(u.umonst->data) && !Blind) {
&& !perceives(gy.youmonst.data) && !Blind) {
newsym(u.ux, u.uy);
pline("Suddenly you can see yourself.");
makeknown(typ);
@@ -2511,7 +2511,7 @@ fpostfx(struct obj *otmp)
{
switch (otmp->otyp) {
case SPRIG_OF_WOLFSBANE:
if (ismnum(u.ulycn) || is_were(u.umonst->data))
if (ismnum(u.ulycn) || is_were(gy.youmonst.data))
you_unwere(TRUE);
break;
case CARROT:
@@ -2527,7 +2527,7 @@ fpostfx(struct obj *otmp)
"became literate by reading the fortune inside a cookie");
break;
case LUMP_OF_ROYAL_JELLY:
if (u.umonst->data == &mons[PM_KILLER_BEE] && !Unchanging
if (gy.youmonst.data == &mons[PM_KILLER_BEE] && !Unchanging
&& polymon(PM_QUEEN_BEE))
break;
@@ -2561,7 +2561,7 @@ fpostfx(struct obj *otmp)
if (ismnum(otmp->corpsenm)
&& flesh_petrifies(&mons[otmp->corpsenm])) {
if (!Stone_resistance
&& !(poly_when_stoned(u.umonst->data)
&& !(poly_when_stoned(gy.youmonst.data)
&& polymon(PM_STONE_GOLEM))) {
if (!Stoned) {
Sprintf(svk.killer.name, "%s egg",
@@ -2646,10 +2646,10 @@ edibility_prompts(struct obj *otmp)
stoneorslime = (ismnum(mnum)
&& flesh_petrifies(&mons[mnum])
&& !Stone_resistance
&& !poly_when_stoned(u.umonst->data));
&& !poly_when_stoned(gy.youmonst.data));
if (mnum == PM_GREEN_SLIME || otmp->otyp == GLOB_OF_GREEN_SLIME)
stoneorslime = (!Unchanging && !slimeproof(u.umonst->data));
stoneorslime = (!Unchanging && !slimeproof(gy.youmonst.data));
if (cadaver && !nonrotting_corpse(mnum)) {
long age = peek_at_iced_corpse_age(otmp);
@@ -2870,7 +2870,7 @@ doeat(void)
You_cant("eat %s you're wearing.", something);
return ECMD_OK;
} else if (!(carried(otmp) ? retouch_object(&otmp, FALSE)
: touch_artifact(otmp, u.umonst))) {
: touch_artifact(otmp, &gy.youmonst))) {
return ECMD_TIME; /* got blasted so use a turn */
}
if (is_metallic(otmp) && u.umonnum == PM_RUST_MONSTER
@@ -3172,9 +3172,9 @@ gethungry(void)
will need to wear an Amulet of Unchanging so still burn a small
amount of nutrition in the 'moves % 20' ring/amulet check below */
if ((!Unaware || !rn2(10)) /* slow metabolic rate while asleep */
&& (carnivorous(u.umonst->data)
|| herbivorous(u.umonst->data)
|| metallivorous(u.umonst->data))
&& (carnivorous(gy.youmonst.data)
|| herbivorous(gy.youmonst.data)
|| metallivorous(gy.youmonst.data))
&& !Slow_digestion)
u.uhunger--; /* ordinary food consumption */
@@ -3583,7 +3583,7 @@ floorfood(
struct obj *otmp;
char qbuf[QBUFSZ];
char c;
struct permonst *uptr = u.umonst->data;
struct permonst *uptr = gy.youmonst.data;
boolean feeding = !strcmp(verb, "eat"), /* corpsecheck==0 */
offering = !strcmp(verb, "sacrifice"); /* corpsecheck==1 */
@@ -3737,7 +3737,7 @@ vomit(void) /* A good idea from David Neves */
{
boolean spewed = FALSE;
if (cantvomit(u.umonst->data)) {
if (cantvomit(gy.youmonst.data)) {
/* doesn't cure food poisoning; message assumes that we aren't
dealing with some esoteric body_part() */
Your("jaw gapes convulsively.");
@@ -3764,7 +3764,7 @@ vomit(void) /* A good idea from David Neves */
if (spewed) {
struct attack
*mattk = attacktype_fordmg(u.umonst->data, AT_BREA, AD_ACID);
*mattk = attacktype_fordmg(gy.youmonst.data, AT_BREA, AD_ACID);
/* currently, only yellow dragons can breathe acid */
if (mattk) {
@@ -3775,7 +3775,7 @@ vomit(void) /* A good idea from David Neves */
if (IS_ALTAR(levl[u.ux][u.uy].typ))
altar_wrath(u.ux, u.uy);
/* if poly'd into acidic form, stomach acid is stronger than normal */
if (acidic(u.umonst->data)) {
if (acidic(gy.youmonst.data)) {
/* TODO: if there's a web here, destroy that too (before ice) */
if (is_ice(u.ux, u.uy))
melt_ice(u.ux, u.uy,
+1 -1
View File
@@ -747,7 +747,7 @@ savelife(int how)
/* might drop hero onto a trap that kills her all over again */
expels(u.ustuck, u.ustuck->data, TRUE);
} else if (u.ustuck) {
if (Upolyd && sticks(u.umonst->data))
if (Upolyd && sticks(gy.youmonst.data))
You("release %s.", mon_nam(u.ustuck));
else
pline("%s releases you.", Monnam(u.ustuck));
+6 -6
View File
@@ -189,7 +189,7 @@ can_reach_floor(boolean check_pit)
struct trap *t;
if (u.uswallow
|| (u.ustuck && !sticks(u.umonst->data)
|| (u.ustuck && !sticks(gy.youmonst.data)
/* assume that arms are pinned rather than that the hero
has been lifted up above the floor [doesn't explain
how hero can attack the creature holding him or her;
@@ -200,10 +200,10 @@ can_reach_floor(boolean check_pit)
/* Restricted/unskilled riders can't reach the floor */
if (u.usteed && P_SKILL(P_RIDING) < P_BASIC)
return FALSE;
if (u.uundetected && ceiling_hider(u.umonst->data))
if (u.uundetected && ceiling_hider(gy.youmonst.data))
return FALSE;
if (Flying || u.umonst->data->msize >= MZ_HUGE)
if (Flying || gy.youmonst.data->msize >= MZ_HUGE)
return TRUE;
if (check_pit && (t = t_at(u.ux, u.uy)) != 0
@@ -531,7 +531,7 @@ u_can_engrave(void)
return FALSE;
}
if (cantwield(u.umonst->data)) {
if (cantwield(gy.youmonst.data)) {
You_cant("even hold anything!");
return FALSE;
}
@@ -570,7 +570,7 @@ doengrave_ctx_init(struct _doengrave_ctx *de)
if (de->oep)
de->oetype = de->oep->engr_type;
if (is_demon(u.umonst->data) || is_vampire(u.umonst->data))
if (is_demon(gy.youmonst.data) || is_vampire(gy.youmonst.data))
de->type = ENGR_BLOOD;
de->jello = (u.uswallow && !(is_animal(u.ustuck->data)
@@ -1245,7 +1245,7 @@ doengrave(void)
if (de->post_engr_text[0])
pline("%s", de->post_engr_text);
if (de->doblind && !resists_blnd(u.umonst)) {
if (de->doblind && !resists_blnd(&gy.youmonst)) {
You("are blinded by the flash!");
make_blinded((long) rnd(50), FALSE);
if (!Blind)
+3 -3
View File
@@ -213,7 +213,7 @@ losexp(
wizard mode request to reduce level; never fatal though */
if (drainer && !strcmp(drainer, "#levelchange"))
drainer = 0;
else if (resists_drli(u.umonst))
else if (resists_drli(&gy.youmonst))
return;
/* level-loss message; "Goodbye level 1." is fatal; divine anger
@@ -280,7 +280,7 @@ losexp(
u.uexp = newuexp(u.ulevel) - 1;
if (Upolyd) {
num = monhp_per_lvl(u.umonst);
num = monhp_per_lvl(&gy.youmonst);
u.mhmax -= num;
u.mh -= num;
if (u.mh <= 0)
@@ -317,7 +317,7 @@ pluslvl(
/* increase hit points (when polymorphed, do monster form first
in order to retain normal human/whatever increase for later) */
if (Upolyd) {
hpinc = monhp_per_lvl(u.umonst);
hpinc = monhp_per_lvl(&gy.youmonst);
u.mh += hpinc;
setuhpmax(u.mhmax, FALSE); /* acts as setmhmax() when Upolyd */
}
+10 -10
View File
@@ -24,13 +24,13 @@ enum explode_action {
/* check if shield effects are needed for location affected by explosion */
staticfn int
explosionmask(
struct monst *m, /* target monster (might be u.umonst) */
struct monst *m, /* target monster (might be youmonst) */
uchar adtyp, /* damage type */
char olet) /* object class (only matters for AD_DISN) */
{
int res = EXPL_NONE;
if (m == u.umonst) {
if (m == &gy.youmonst) {
switch (adtyp) {
case AD_PHYS:
/* leave 'res' with EXPL_NONE */
@@ -274,7 +274,7 @@ explode(
so might get hit by double damage */
grabbed = grabbing = FALSE;
if (u.ustuck && !u.uswallow) {
if (Upolyd && sticks(u.umonst->data))
if (Upolyd && sticks(gy.youmonst.data))
grabbing = TRUE;
else
grabbed = TRUE;
@@ -363,7 +363,7 @@ explode(
explmask[i][j] = EXPL_NONE;
if (u_at(xx, yy)) {
explmask[i][j] = explosionmask(u.umonst, adtyp, olet);
explmask[i][j] = explosionmask(&gy.youmonst, adtyp, olet);
}
/* can be both you and mtmp if you're swallowed or riding */
mtmp = m_at(xx, yy);
@@ -611,10 +611,10 @@ explode(
} else if (adtyp == AD_PHYS || adtyp == AD_ACID)
damu = Maybe_Half_Phys(damu);
if (adtyp == AD_FIRE) {
(void) burnarmor(u.umonst);
(void) burnarmor(&gy.youmonst);
ignite_items(gi.invent);
}
(void) destroy_items(u.umonst, (int) adtyp, dam);
(void) destroy_items(&gy.youmonst, (int) adtyp, dam);
ugolemeffects((int) adtyp, damu);
if (uhurt == 2) {
@@ -869,9 +869,9 @@ scatter(
if (gm.multi)
nomul(0);
dam = dmgval(stmp->obj, u.umonst);
dam = dmgval(stmp->obj, &gy.youmonst);
hitvalu = 8 + stmp->obj->spe;
if (bigmonst(u.umonst->data))
if (bigmonst(gy.youmonst.data))
hitvalu++;
hitu = thitu(hitvalu, Maybe_Half_Phys(dam),
&stmp->obj, (char *) 0);
@@ -936,8 +936,8 @@ scatter(
newsym(x, y);
}
newsym(sx, sy);
if (u_at(sx, sy) && u.uundetected && hides_under(u.umonst->data))
(void) hideunder(u.umonst);
if (u_at(sx, sy) && u.uundetected && hides_under(gy.youmonst.data))
(void) hideunder(&gy.youmonst);
if (((mtmp = m_at(sx, sy)) != 0) && mtmp->mtrapped)
mtmp->mtrapped = 0;
maybe_unhide_at(sx, sy);
+1 -1
View File
@@ -791,7 +791,7 @@ dipsink(struct obj *obj)
breathless for this message */
pline("A wisp of vapor rises up...");
/* NB: potionbreathe calls trycall or makeknown as appropriate */
if (!breathless(u.umonst->data) || haseyes(u.umonst->data))
if (!breathless(gy.youmonst.data) || haseyes(gy.youmonst.data))
potionbreathe(obj);
break;
}
+62 -62
View File
@@ -152,11 +152,11 @@ could_move_onto_boulder(coordxy sx, coordxy sy)
return FALSE;
/* can if a giant, unless doing so allows hero to pass into a
diagonal squeeze at the same time */
if (throws_rocks(u.umonst->data))
if (throws_rocks(gy.youmonst.data))
return (!u.dx || !u.dy || !(IS_OBSTRUCTED(levl[u.ux][sy].typ)
&& IS_OBSTRUCTED(levl[sx][u.uy].typ)));
/* can if tiny (implies carrying very little else couldn't move at all) */
if (verysmall(u.umonst->data))
if (verysmall(gy.youmonst.data))
return TRUE;
/* can squeeze to spot if carrying extremely little, otherwise can't */
return squeezeablylightinvent();
@@ -189,7 +189,7 @@ dopush(
|| svm.moves < gb.bldrpushtime);
what = givemesg ? the(xname(otmp)) : 0;
if (!u.usteed) {
easypush = throws_rocks(u.umonst->data);
easypush = throws_rocks(gy.youmonst.data);
if (givemesg)
pline("With %s effort you move %s.",
easypush ? "little" : "great", what);
@@ -261,7 +261,7 @@ cannot_push_msg(struct obj *otmp, coordxy sx, coordxy sy)
staticfn int
cannot_push(struct obj *otmp, coordxy sx, coordxy sy)
{
if (throws_rocks(u.umonst->data)) {
if (throws_rocks(gy.youmonst.data)) {
boolean
canpickup = (!Sokoban
/* similar exception as in can_lift():
@@ -388,7 +388,7 @@ moverock_core(coordxy sx, coordxy sy)
int res;
feel_location(sx, sy); /* same for all 3 if/else-if/else cases */
if (throws_rocks(u.umonst->data)) {
if (throws_rocks(gy.youmonst.data)) {
/* player has used 'm<dir>' to move, so step to boulder's
spot without pushing it; hero is poly'd into a giant,
so exotic forms of locomotion are out, but might be
@@ -423,7 +423,7 @@ moverock_core(coordxy sx, coordxy sy)
/* Give them a chance to climb over it? */
return -1;
}
if (verysmall(u.umonst->data) && !u.usteed) {
if (verysmall(gy.youmonst.data) && !u.usteed) {
if (Blind)
feel_location(sx, sy);
pline("You're too small to push that %s.", xname(otmp));
@@ -667,7 +667,7 @@ still_chewing(coordxy x, coordxy y)
nomul(0);
return 1;
} else if (lev->typ == IRONBARS
&& metallivorous(u.umonst->data) && u.uhunger > 1500) {
&& metallivorous(gy.youmonst.data) && u.uhunger > 1500) {
/* finishing eating via 'morehungry()' doesn't handle choking */
You("are too full to eat the bars.");
nomul(0);
@@ -767,7 +767,7 @@ still_chewing(coordxy x, coordxy y)
digtxt = "chew through the tree.";
lev->typ = ROOM;
} else if (lev->typ == IRONBARS) {
if (metallivorous(u.umonst->data)) { /* should always be True here */
if (metallivorous(gy.youmonst.data)) { /* should always be True here */
/* arbitrary amount; unlike proper eating, nutrition is
bestowed in a lump sum at the end */
int nut = (int) objects[HEAVY_IRON_BALL].oc_weight;
@@ -955,7 +955,7 @@ cant_squeeze_thru(struct monst *mon)
int amt;
struct permonst *ptr = mon->data;
if ((mon == u.umonst) ? Passes_walls : passes_walls(ptr))
if ((mon == &gy.youmonst) ? Passes_walls : passes_walls(ptr))
return 0;
/* too big? */
@@ -965,13 +965,13 @@ cant_squeeze_thru(struct monst *mon)
return 1;
/* lugging too much junk? */
amt = (mon == u.umonst) ? inv_weight() + weight_cap()
amt = (mon == &gy.youmonst) ? inv_weight() + weight_cap()
: curr_mon_load(mon);
if (amt > WT_TOOMUCH_DIAGONAL)
return 2;
/* Sokoban restriction applies to hero only */
if (mon == u.umonst && Sokoban)
if (mon == &gy.youmonst && Sokoban)
return 3;
/* can squeeze through */
@@ -1023,19 +1023,19 @@ test_move(
return FALSE;
} else if (tmpr->typ == IRONBARS) {
if (mode == DO_MOVE
&& (dmgtype(u.umonst->data, AD_RUST)
|| dmgtype(u.umonst->data, AD_CORR)
|| metallivorous(u.umonst->data))
&& (dmgtype(gy.youmonst.data, AD_RUST)
|| dmgtype(gy.youmonst.data, AD_CORR)
|| metallivorous(gy.youmonst.data))
&& still_chewing(x, y)) {
return FALSE;
}
if (!(Passes_walls || passes_bars(u.umonst->data))) {
if (!(Passes_walls || passes_bars(gy.youmonst.data))) {
if (mode == DO_MOVE && flags.mention_walls)
You("cannot pass through the bars.");
return FALSE;
}
} else if (tunnels(u.umonst->data)
&& !needspick(u.umonst->data)) {
} else if (tunnels(gy.youmonst.data)
&& !needspick(gy.youmonst.data)) {
/* Eat the rock. */
if (mode == DO_MOVE && still_chewing(x, y))
return FALSE;
@@ -1077,21 +1077,21 @@ test_move(
feel_location(x, y);
if (Passes_walls) {
; /* do nothing */
} else if (can_ooze(u.umonst)) {
} else if (can_ooze(&gy.youmonst)) {
if (mode == DO_MOVE)
You("ooze under the door.");
} else if (Underwater) {
if (mode == DO_MOVE)
pline("There is an obstacle there.");
return FALSE;
} else if (tunnels(u.umonst->data)
&& !needspick(u.umonst->data)) {
} else if (tunnels(gy.youmonst.data)
&& !needspick(gy.youmonst.data)) {
/* Eat the door. */
if (mode == DO_MOVE && still_chewing(x, y))
return FALSE;
} else {
if (mode == DO_MOVE) {
if (amorphous(u.umonst->data))
if (amorphous(gy.youmonst.data))
You("try to ooze under the door,"
" but can't squeeze your possessions through.");
if (flags.autoopen && !svc.context.run
@@ -1150,10 +1150,10 @@ test_move(
}
}
}
if (dx && dy && bad_rock(u.umonst->data, ux, y)
&& bad_rock(u.umonst->data, x, uy)) {
if (dx && dy && bad_rock(gy.youmonst.data, ux, y)
&& bad_rock(gy.youmonst.data, x, uy)) {
/* Move at a diagonal. */
switch (cant_squeeze_thru(u.umonst)) {
switch (cant_squeeze_thru(&gy.youmonst)) {
case 3:
if (mode == DO_MOVE)
You("cannot pass that way.");
@@ -1222,7 +1222,7 @@ test_move(
}
if (mode == DO_MOVE) {
/* tunneling monsters will chew before pushing */
if (tunnels(u.umonst->data) && !needspick(u.umonst->data)
if (tunnels(gy.youmonst.data) && !needspick(gy.youmonst.data)
&& !Sokoban) {
if (still_chewing(x, y))
return FALSE;
@@ -1239,8 +1239,8 @@ test_move(
if (sobj_at(BOULDER, ux, uy) && !Sokoban) {
if (!Passes_walls
&& !could_move_onto_boulder(ux, uy)
&& !(tunnels(u.umonst->data)
&& !needspick(u.umonst->data))
&& !(tunnels(gy.youmonst.data)
&& !needspick(gy.youmonst.data))
&& !carrying(PICK_AXE) && !carrying(DWARVISH_MATTOCK)
&& !((obj = carrying(WAN_DIGGING))
&& !objects[obj->otyp].oc_name_known))
@@ -1372,7 +1372,7 @@ findtravelpath(int mode)
if (!isok(nx, ny)
|| ((mode == TRAVP_GUESS) && !couldsee(nx, ny)))
continue;
if ((!Passes_walls && !can_ooze(u.umonst)
if ((!Passes_walls && !can_ooze(&gy.youmonst)
&& closed_door(x, y))
|| (sobj_at(BOULDER, x, y)
&& !could_move_onto_boulder(x, y))
@@ -1693,7 +1693,7 @@ trapmove(
boolean
u_rooted(void)
{
if (!u.umonst->data->mmove) {
if (!gy.youmonst.data->mmove) {
You("are rooted %s.",
Levitation || Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)
? "in place"
@@ -1825,14 +1825,14 @@ u_locomotion(const char *def)
or boots/ring/spell of levitation */
return Levitation ? (capitalize ? "Float" : "float")
: Flying ? (capitalize ? "Fly" : "fly")
: locomotion(u.umonst->data, def);
: locomotion(gy.youmonst.data, def);
}
/* Return a simplified floor solid/liquid state based on hero's state */
staticfn schar
u_simple_floortyp(coordxy x, coordxy y)
{
boolean u_in_air = (Levitation || Flying || !grounded(u.umonst->data));
boolean u_in_air = (Levitation || Flying || !grounded(gy.youmonst.data));
if (is_waterwall(x, y))
return WATER; /* wall of water, fly/lev does not matter */
@@ -1978,8 +1978,8 @@ domove_attackmon_at(
&& (NODIAG(u.umonnum)
|| (bad_rock(mtmp->data, x, u.uy0)
&& bad_rock(mtmp->data, u.ux0, y))
|| (bad_rock(u.umonst->data, u.ux0, y)
&& bad_rock(u.umonst->data, x, u.uy0))))
|| (bad_rock(gy.youmonst.data, u.ux0, y)
&& bad_rock(gy.youmonst.data, x, u.uy0))))
&& goodpos(u.ux0, u.uy0, mtmp, GP_ALLOW_U));
/* if not displacing, try to attack; note that it might evade;
also, we don't attack tame or peaceful when safemon() */
@@ -2244,7 +2244,7 @@ domove_fight_empty(coordxy x, coordxy y)
|| (glyph_is_invisible(glyph) && !m_at(x, y)
&& !svc.context.nopick)) {
struct obj *boulder = 0;
boolean explo = (Upolyd && attacktype(u.umonst->data, AT_EXPL)),
boolean explo = (Upolyd && attacktype(gy.youmonst.data, AT_EXPL)),
solid = (off_edge || (!accessible(x, y)
|| IS_FURNITURE(levl[x][y].typ)));
char buf[BUFSZ];
@@ -2323,7 +2323,7 @@ domove_fight_empty(coordxy x, coordxy y)
nomul(0);
if (explo) {
struct attack *attk
= attacktype_fordmg(u.umonst->data, AT_EXPL, AD_ANY);
= attacktype_fordmg(gy.youmonst.data, AT_EXPL, AD_ANY);
/* no monster has been attacked so we have bypassed explum() */
wake_nearto(u.ux, u.uy, 7 * 7); /* same radius as explum() */
@@ -2396,7 +2396,7 @@ staticfn void
slippery_ice_fumbling(void)
{
boolean on_ice = !Levitation && is_ice(u.ux, u.uy);
struct monst *iceskater = u.usteed ? u.usteed : u.umonst;
struct monst *iceskater = u.usteed ? u.usteed : &gy.youmonst;
if (on_ice) {
if ((uarmf && objdescr_is(uarmf, "snow boots"))
@@ -2435,7 +2435,7 @@ impaired_movement(coordxy *x, coordxy *y)
confdir(TRUE);
*x = u.ux + u.dx;
*y = u.uy + u.dy;
} while (!isok(*x, *y) || bad_rock(u.umonst->data, *x, *y));
} while (!isok(*x, *y) || bad_rock(gy.youmonst.data, *x, *y));
}
return FALSE;
}
@@ -2475,7 +2475,7 @@ avoid_moving_on_liquid(
/* and you know you won't fall in */
&& (in_air || Known_lwalking || (is_pool(x, y) && Known_wwalking))
&& !(IS_WATERWALL(levl[x][y].typ) || levl[x][y].typ == LAVAWALL)) {
/* XXX: should send 'is_clinger(u.umonst->data)' here once clinging
/* XXX: should send 'is_clinger(gy.youmonst.data)' here once clinging
polyforms are allowed to move over water */
return FALSE; /* liquid is safe to traverse */
} else if (is_pool_or_lava(x, y) && levl[x][y].seenv) {
@@ -2558,7 +2558,7 @@ avoid_trap_andor_region(coordxy x, coordxy y)
/* check whether attempted move will be viable */
&& test_move(u.ux, u.uy, u.dx, u.dy, TEST_MOVE)
/* override confirmation if the trap is harmless to the hero */
&& (immune_to_trap(u.umonst, trap->ttyp) != TRAP_CLEARLY_IMMUNE
&& (immune_to_trap(&gy.youmonst, trap->ttyp) != TRAP_CLEARLY_IMMUNE
/* Hallucination: all traps still show as ^, but the
hero can't tell what they are, so treat as dangerous */
|| Hallucination)) {
@@ -2644,7 +2644,7 @@ escape_from_sticky_mon(coordxy x, coordxy y)
if (!m_next2u(u.ustuck)) {
/* perhaps it fled (or was teleported or ... ) */
set_ustuck((struct monst *) 0);
} else if (sticks(u.umonst->data)) {
} else if (sticks(gy.youmonst.data)) {
/* When polymorphed into a sticking monster,
* u.ustuck means it's stuck to you, not you to it.
*/
@@ -2874,7 +2874,7 @@ domove_core(void)
u.ux += u.dx;
u.uy += u.dy;
m_postmove_effect(u.umonst);
m_postmove_effect(&gy.youmonst);
if (u.usteed) {
u.usteed->mx = u.ux;
@@ -2943,12 +2943,12 @@ domove_core(void)
/* your tread on the ground may disturb the slumber of nearby zombies */
if (!Levitation && !Flying && !Stealth
&& u.umonst->data->cwt >= (WT_ELF / 2))
&& gy.youmonst.data->cwt >= (WT_ELF / 2))
disturb_buried_zombies(u.ux, u.uy);
if (hides_under(u.umonst->data) || u.umonst->data->mlet == S_EEL
if (hides_under(gy.youmonst.data) || gy.youmonst.data->mlet == S_EEL
|| u.dx || u.dy)
(void) hideunder(u.umonst);
(void) hideunder(&gy.youmonst);
/*
* Mimics (or whatever) become noticeable if they move and are
@@ -2957,7 +2957,7 @@ domove_core(void)
*/
if ((u.dx || u.dy) && (U_AP_TYPE == M_AP_OBJECT
|| U_AP_TYPE == M_AP_FURNITURE))
u.umonst->m_ap_type = M_AP_NOTHING;
gy.youmonst.m_ap_type = M_AP_NOTHING;
check_leash(u.ux0, u.uy0);
@@ -3804,8 +3804,8 @@ pickup_checks(void)
}
}
if (is_pool(u.ux, u.uy)) {
if (Wwalking || is_floater(u.umonst->data)
|| is_clinger(u.umonst->data) || (Flying && !Breathless)) {
if (Wwalking || is_floater(gy.youmonst.data)
|| is_clinger(gy.youmonst.data) || (Flying && !Breathless)) {
You("cannot dive into the %s to pick things up.",
hliquid("water"));
return 0;
@@ -3815,11 +3815,11 @@ pickup_checks(void)
}
}
if (is_lava(u.ux, u.uy)) {
if (Wwalking || is_floater(u.umonst->data)
|| is_clinger(u.umonst->data) || (Flying && !Breathless)) {
if (Wwalking || is_floater(gy.youmonst.data)
|| is_clinger(gy.youmonst.data) || (Flying && !Breathless)) {
You_cant("reach the bottom to pick things up.");
return 0;
} else if (!likes_lava(u.umonst->data)) {
} else if (!likes_lava(gy.youmonst.data)) {
You("would burn to a crisp trying to pick things up.");
return 0;
}
@@ -4079,7 +4079,7 @@ boolean
crawl_destination(coordxy x, coordxy y)
{
/* is location ok in general? */
if (!goodpos(x, y, u.umonst, 0))
if (!goodpos(x, y, &gy.youmonst, 0))
return FALSE;
/* orthogonal movement is unrestricted when destination is ok */
@@ -4095,9 +4095,9 @@ crawl_destination(coordxy x, coordxy y)
if (IS_DOOR(levl[x][y].typ) && (!doorless_door(x, y) || block_door(x, y)))
return FALSE;
/* finally, are we trying to squeeze through a too-narrow gap? */
return !(bad_rock(u.umonst->data, u.ux, y)
&& bad_rock(u.umonst->data, x, u.uy)
&& cant_squeeze_thru(u.umonst));
return !(bad_rock(gy.youmonst.data, u.ux, y)
&& bad_rock(gy.youmonst.data, x, u.uy)
&& cant_squeeze_thru(&gy.youmonst));
}
/* something like lookaround, but we are not running */
@@ -4367,14 +4367,14 @@ weight_cap(void)
+ WT_WEIGHTCAP_SPARE;
if (Upolyd) {
/* consistent with can_carry() in mon.c */
if (u.umonst->data->mlet == S_NYMPH)
if (gy.youmonst.data->mlet == S_NYMPH)
carrcap = MAX_CARR_CAP;
else if (!u.umonst->data->cwt)
carrcap = (carrcap * (long) u.umonst->data->msize) / MZ_HUMAN;
else if (!strongmonst(u.umonst->data)
|| (strongmonst(u.umonst->data)
&& (u.umonst->data->cwt > WT_HUMAN)))
carrcap = (carrcap * (long) u.umonst->data->cwt / WT_HUMAN);
else if (!gy.youmonst.data->cwt)
carrcap = (carrcap * (long) gy.youmonst.data->msize) / MZ_HUMAN;
else if (!strongmonst(gy.youmonst.data)
|| (strongmonst(gy.youmonst.data)
&& (gy.youmonst.data->cwt > WT_HUMAN)))
carrcap = (carrcap * (long) gy.youmonst.data->cwt / WT_HUMAN);
}
if (Levitation || Is_airlevel(&u.uz) /* pugh@cornell */
@@ -4411,7 +4411,7 @@ inv_weight(void)
while (otmp) {
if (otmp->oclass == COIN_CLASS)
wt += (int) (((long) otmp->quan + 50L) / 100L);
else if (otmp->otyp != BOULDER || !throws_rocks(u.umonst->data))
else if (otmp->otyp != BOULDER || !throws_rocks(gy.youmonst.data))
wt += otmp->owt;
otmp = otmp->nobj;
}
+2 -2
View File
@@ -605,7 +605,7 @@ itemactions(struct obj *otmp)
/* w: wield, hold in hands, works on everything but with different
advice text; not mentioned for things that are already wielded */
if (otmp == uwep || cantwield(u.umonst->data)) {
if (otmp == uwep || cantwield(gy.youmonst.data)) {
; /* either already wielded or can't wield anything; skip 'w' */
} else if (otmp->oclass == WEAPON_CLASS || is_weptool(otmp)
|| is_wet_towel(otmp) || otmp->otyp == HEAVY_IRON_BALL) {
@@ -674,7 +674,7 @@ itemactions(struct obj *otmp)
/* if already two-weaponing, no special checks needed to toggle off */
&& (u.twoweap
/* but if not, try to filter most "you can't do that" here */
|| (could_twoweap(u.umonst->data) && !uarms
|| (could_twoweap(gy.youmonst.data) && !uarms
&& uwep && MAYBETWOWEAPON(uwep)
&& uswapwep && MAYBETWOWEAPON(uswapwep)))) {
Sprintf(buf, "Toggle two-weapon combat %s", u.twoweap ? "off" : "on");
+22 -22
View File
@@ -489,8 +489,8 @@ background_enlightenment(int unused_mode UNUSED, int final)
the player to know he's not a samurai at the moment... */
if (Upolyd) {
char anbuf[20]; /* includes trailing space; [4] suffices */
struct permonst *uasmon = u.umonst->data;
boolean altphrasing = vampshifted(u.umonst);
struct permonst *uasmon = gy.youmonst.data;
boolean altphrasing = vampshifted(&gy.youmonst);
tmpbuf[0] = '\0';
/* here we always use current gender, not saved role gender */
@@ -498,7 +498,7 @@ background_enlightenment(int unused_mode UNUSED, int final)
Sprintf(tmpbuf, "%s ", genders[flags.female ? 1 : 0].adj);
if (altphrasing)
Sprintf(eos(tmpbuf), "%s in ",
pmname(&mons[u.umonst->cham],
pmname(&mons[gy.youmonst.cham],
flags.female ? FEMALE : MALE));
Snprintf(buf, sizeof(buf), "%s%s%s%s form",
!final ? "currently " : "",
@@ -1068,7 +1068,7 @@ status_enlightenment(int mode, int final)
if (wizard && (HBlinded == BlindedTimeout && !Blindfolded))
Sprintf(eos(buf), " (%ld)", BlindedTimeout);
/* !haseyes: avoid "you are innately blind innately" */
you_are(buf, !haseyes(u.umonst->data) ? "" : from_what(BLINDED));
you_are(buf, !haseyes(gy.youmonst.data) ? "" : from_what(BLINDED));
}
if (Deaf)
you_are("deaf", from_what(DEAF));
@@ -1122,7 +1122,7 @@ status_enlightenment(int mode, int final)
Sprintf(eos(buf), " (%u)", u.uswldtim);
you_are(buf, "");
} else if (u.ustuck) {
boolean ustick = (Upolyd && sticks(u.umonst->data));
boolean ustick = (Upolyd && sticks(gy.youmonst.data));
int dx = u.ustuck->mx - u.ux, dy = u.ustuck->my - u.uy;
Snprintf(buf, sizeof buf, "%s %s (%s)",
@@ -1736,7 +1736,7 @@ attributes_enlightenment(
}
/* including this might bring attention to the fact that ceiling
clinging has inconsistencies... */
if (is_clinger(u.umonst->data)) {
if (is_clinger(gy.youmonst.data)) {
boolean has_lid = has_ceiling(&u.uz);
if (has_lid && !u.uinwater) {
@@ -1797,7 +1797,7 @@ attributes_enlightenment(
if (prot)
you_have(enlght_combatinc("defense", prot, final, buf), "");
}
if ((armpro = magic_negation(u.umonst)) > 0) {
if ((armpro = magic_negation(&gy.youmonst)) > 0) {
/* magic cancellation factor, conferred by worn armor */
static const char *const mc_types[] = {
"" /*ordinary*/, "warded", "guarded", "protected",
@@ -1863,20 +1863,20 @@ attributes_enlightenment(
&& !(final == ENL_GAMEOVERDEAD
&& u.umonnum == PM_GREEN_SLIME && !Unchanging)) {
/* foreign shape (except were-form which is handled below) */
if (!vampshifted(u.umonst))
if (!vampshifted(&gy.youmonst))
Sprintf(buf, "polymorphed into %s",
an(pmname(u.umonst->data,
an(pmname(gy.youmonst.data,
flags.female ? FEMALE : MALE)));
else
Sprintf(buf, "polymorphed into %s in %s form",
an(pmname(&mons[u.umonst->cham],
an(pmname(&mons[gy.youmonst.cham],
flags.female ? FEMALE : MALE)),
pmname(u.umonst->data, flags.female ? FEMALE : MALE));
pmname(gy.youmonst.data, flags.female ? FEMALE : MALE));
if (wizard)
Sprintf(eos(buf), " (%d)", u.mtimedone);
you_are(buf, "");
}
if (lays_eggs(u.umonst->data) && flags.female) /* Upolyd */
if (lays_eggs(gy.youmonst.data) && flags.female) /* Upolyd */
you_can("lay eggs", "");
if (ismnum(u.ulycn)) {
/* "you are a werecreature [in beast form]" */
@@ -2046,7 +2046,7 @@ youhiding(boolean via_enlghtmt, /* enlightenment line vs topl message */
for the hypothetical furniture and monster cases */
bp = eos(strcpy(buf, "mimicking"));
if (U_AP_TYPE == M_AP_OBJECT) {
Sprintf(bp, " %s", an(simple_typename(u.umonst->mappearance)));
Sprintf(bp, " %s", an(simple_typename(gy.youmonst.mappearance)));
} else if (U_AP_TYPE == M_AP_FURNITURE) {
Strcpy(bp, " something");
} else if (U_AP_TYPE == M_AP_MONSTER) {
@@ -2056,15 +2056,15 @@ youhiding(boolean via_enlghtmt, /* enlightenment line vs topl message */
}
} else if (u.uundetected) {
bp = eos(buf); /* points past "hiding" */
if (u.umonst->data->mlet == S_EEL) {
if (gy.youmonst.data->mlet == S_EEL) {
if (is_pool(u.ux, u.uy))
Sprintf(bp, " in the %s", waterbody_name(u.ux, u.uy));
} else if (hides_under(u.umonst->data)) {
} else if (hides_under(gy.youmonst.data)) {
struct obj *o = svl.level.objects[u.ux][u.uy];
if (o)
Sprintf(bp, " underneath %s", ansimpleoname(o));
} else if (is_clinger(u.umonst->data) || Flying) {
} else if (is_clinger(gy.youmonst.data) || Flying) {
/* Flying: 'lurker above' hides on ceiling but doesn't cling */
Sprintf(bp, " on the %s", ceiling(u.ux, u.uy));
} else {
@@ -3368,7 +3368,7 @@ mstatusline(struct monst *mtmp)
if (mtmp == u.ustuck) {
struct permonst *pm = u.ustuck->data;
/* being swallowed/engulfed takes priority over sticks(u.umonst);
/* being swallowed/engulfed takes priority over sticks(youmonst);
this used to have that backwards and checked sticks() first */
Strcat(info, u.uswallow ? (digests(pm)
? ", digesting you"
@@ -3380,9 +3380,9 @@ mstatusline(struct monst *mtmp)
: (is_animal(pm) && !enfolds(pm))
? ", swallowing you"
: ", engulfing you")
/* !u.uswallow; if both u.umonst and ustuck are holders,
u.umonst wins */
: (!sticks(u.umonst->data) ? ", holding you"
/* !u.uswallow; if both youmonst and ustuck are holders,
youmonst wins */
: (!sticks(gy.youmonst.data) ? ", holding you"
: ", held by you"));
}
if (mtmp == u.usteed) {
@@ -3445,7 +3445,7 @@ ustatusline(void)
Strcat(info, ", blind");
if (u.ucreamed) {
if ((long) u.ucreamed < BlindedTimeout || Blindfolded
|| !haseyes(u.umonst->data))
|| !haseyes(gy.youmonst.data))
Strcat(info, ", cover");
Strcat(info, "ed by sticky goop");
} /* note: "goop" == "glop"; variation is intentional */
@@ -3481,7 +3481,7 @@ ustatusline(void)
if (u.uswallow)
Strcat(info, digests(u.ustuck->data) ? ", being digested by "
: ", engulfed by ");
else if (!sticks(u.umonst->data))
else if (!sticks(gy.youmonst.data))
Strcat(info, ", held by ");
else
Strcat(info, ", holding ");
+8 -8
View File
@@ -1224,7 +1224,7 @@ hold_another_object(
/* in case touching this object turns out to be fatal */
place_object(obj, u.ux, u.uy);
if (!touch_artifact(obj, u.umonst)) {
if (!touch_artifact(obj, &gy.youmonst)) {
obj_extract_self(obj); /* remove it from the floor */
dropy(obj); /* now put it back again :-) */
return obj;
@@ -1496,7 +1496,7 @@ carrying(int type)
{
struct obj *otmp;
/* this could be replaced by 'return m_carrying(u.umonst, type);' */
/* this could be replaced by 'return m_carrying(&gy.youmonst, type);' */
for (otmp = gi.invent; otmp; otmp = otmp->nobj)
if (otmp->otyp == type)
break;
@@ -4269,7 +4269,7 @@ look_here(
: (otmp->quan > 1L) ? "They're"
: "It's",
corpse_xname(otmp, (const char *) 0, CXN_ARTICLE),
poly_when_stoned(u.umonst->data) ? ""
poly_when_stoned(gy.youmonst.data) ? ""
: ", unfortunately");
feel_cockatrice(otmp, FALSE);
break;
@@ -4348,7 +4348,7 @@ feel_cockatrice(struct obj *otmp, boolean force_touch)
/* "the <cockatrice> corpse" */
Strcpy(kbuf, corpse_xname(otmp, (const char *) 0, CXN_PFX_THE));
if (poly_when_stoned(u.umonst->data))
if (poly_when_stoned(gy.youmonst.data))
You("touched %s with your bare %s.", kbuf,
makeplural(body_part(HAND)));
else
@@ -4778,8 +4778,8 @@ useupf(struct obj *obj, long numused)
(void) stolen_value(otmp, otmp->ox, otmp->oy, FALSE, FALSE);
}
delobj(otmp);
if (at_u && u.uundetected && hides_under(u.umonst->data))
(void) hideunder(u.umonst);
if (at_u && u.uundetected && hides_under(gy.youmonst.data))
(void) hideunder(&gy.youmonst);
}
/*
@@ -5360,7 +5360,7 @@ display_minventory(
/* Fool the 'weapon in hand' routine into
* displaying 'weapon in claw', etc. properly.
*/
u.umonst->data = mon->data;
gy.youmonst.data = mon->data;
/* in case inside a shop, don't append "for sale" prices */
iflags.suppress_price++;
@@ -5371,7 +5371,7 @@ display_minventory(
iflags.suppress_price--;
/* was 'set_uasmon();' but that potentially has side-effects */
u.umonst->data = &mons[u.umonnum]; /* basic part of set_uasmon() */
gy.youmonst.data = &mons[u.umonnum]; /* basic part of set_uasmon() */
} else {
invdisp_nothing(title ? title : tmp, "(none)");
n = 0;
+5 -5
View File
@@ -13,8 +13,8 @@
* Light sources are "things" that have a physical position and range.
* They have a type, which gives us information about them. Currently
* they are only attached to objects and monsters. Note well: the
* polymorphed-player handling assumes that u.umonst->m_id will
* always remain 1 and u.umonst->mx will always remain 0.
* polymorphed-player handling assumes that gy.youmonst.m_id will
* always remain 1 and gy.youmonst.mx will always remain 0.
*
* Light sources, like timers, either follow game play (RANGE_GLOBAL) or
* stay on a level (RANGE_LEVEL). Light sources are unique by their
@@ -378,7 +378,7 @@ find_mid(unsigned nid, unsigned fmflags)
struct monst *mtmp;
if ((fmflags & FM_YOU) && nid == 1)
return u.umonst;
return &gy.youmonst;
if (fmflags & FM_FMON)
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
if (!DEADMONSTER(mtmp) && mtmp->m_id == nid)
@@ -399,7 +399,7 @@ whereis_mon(struct monst *mon, unsigned fmflags)
{
struct monst *mtmp;
if ((fmflags & FM_YOU) && mon == u.umonst)
if ((fmflags & FM_YOU) && mon == &gy.youmonst)
return FM_YOU;
if (fmflags & FM_FMON)
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
@@ -957,7 +957,7 @@ wiz_light_sources(void)
: ls->type == LS_MONSTER
? (mon_is_local(ls->id.a_monst)
? "mon"
: (ls->id.a_monst == u.umonst)
: (ls->id.a_monst == &gy.youmonst)
? "you"
/* migrating monster */
: "<m>")
+14 -14
View File
@@ -89,7 +89,7 @@ picklock(void)
}
}
if (gx.xlock.usedtime++ >= 50 || nohands(u.umonst->data)) {
if (gx.xlock.usedtime++ >= 50 || nohands(gy.youmonst.data)) {
You("give up your attempt at %s.", lock_action());
exercise(A_DEX, TRUE); /* even if you don't succeed */
return ((gx.xlock.usedtime = 0));
@@ -218,7 +218,7 @@ forcelock(void)
if ((gx.xlock.box->ox != u.ux) || (gx.xlock.box->oy != u.uy))
return ((gx.xlock.usedtime = 0)); /* you or it moved */
if (gx.xlock.usedtime++ >= 50 || !uwep || nohands(u.umonst->data)) {
if (gx.xlock.usedtime++ >= 50 || !uwep || nohands(gy.youmonst.data)) {
You("give up your attempt to force the lock.");
if (gx.xlock.usedtime >= 50) /* you made the effort */
exercise((gx.xlock.picktyp) ? A_DEX : A_STR, TRUE);
@@ -315,7 +315,7 @@ autokey(boolean opening) /* True: key, pick, or card; False: key or pick */
} else {
switch (o->otyp) {
case SKELETON_KEY:
if (!key || is_magic_key(u.umonst, o))
if (!key || is_magic_key(&gy.youmonst, o))
key = o;
break;
case LOCK_PICK:
@@ -380,7 +380,7 @@ pick_lock(
if (gx.xlock.usedtime && picktyp == gx.xlock.picktyp) {
static char no_longer[] = "Unfortunately, you can no longer %s %s.";
if (nohands(u.umonst->data)) {
if (nohands(gy.youmonst.data)) {
const char *what = (picktyp == LOCK_PICK) ? "pick" : "key";
if (picktyp == CREDIT_CARD)
@@ -396,13 +396,13 @@ pick_lock(
const char *action = lock_action();
You("resume your attempt at %s.", action);
gx.xlock.magic_key = is_magic_key(u.umonst, pick);
gx.xlock.magic_key = is_magic_key(&gy.youmonst, pick);
set_occupation(picklock, action, 0);
return PICKLOCK_DID_SOMETHING;
}
}
if (nohands(u.umonst->data)) {
if (nohands(gy.youmonst.data)) {
You_cant("hold %s -- you have no hands!", doname(pick));
return PICKLOCK_DID_NOTHING;
} else if (u.uswallow) {
@@ -513,7 +513,7 @@ pick_lock(
an(simple_typename(picktyp)));
return PICKLOCK_LEARNED_SOMETHING;
} else if (autounlock
&& !touch_artifact(pick, u.umonst)) {
&& !touch_artifact(pick, &gy.youmonst)) {
/* note: for !autounlock, apply already did touch check */
return PICKLOCK_DID_SOMETHING;
}
@@ -626,7 +626,7 @@ pick_lock(
return PICKLOCK_DID_NOTHING;
/* note: for !autounlock, 'apply' already did touch check */
if (autounlock && !touch_artifact(pick, u.umonst))
if (autounlock && !touch_artifact(pick, &gy.youmonst))
return PICKLOCK_DID_SOMETHING;
switch (picktyp) {
@@ -649,7 +649,7 @@ pick_lock(
svc.context.move = 0;
gx.xlock.chance = ch;
gx.xlock.picktyp = picktyp;
gx.xlock.magic_key = is_magic_key(u.umonst, pick);
gx.xlock.magic_key = is_magic_key(&gy.youmonst, pick);
gx.xlock.usedtime = 0;
set_occupation(picklock, lock_action(), 0);
return PICKLOCK_DID_SOMETHING;
@@ -785,7 +785,7 @@ doopen_indir(coordxy x, coordxy y)
const char *dirprompt;
int res = ECMD_OK;
if (nohands(u.umonst->data)) {
if (nohands(gy.youmonst.data)) {
You_cant("open anything -- you have no hands!");
return ECMD_OK;
}
@@ -895,7 +895,7 @@ doopen_indir(coordxy x, coordxy y)
return res;
}
if (verysmall(u.umonst->data)) {
if (verysmall(gy.youmonst.data)) {
pline("You're too small to pull the door open.");
return res;
}
@@ -961,7 +961,7 @@ doclose(void)
boolean portcullis;
int res = ECMD_OK;
if (nohands(u.umonst->data)) {
if (nohands(gy.youmonst.data)) {
You_cant("close anything -- you have no hands!");
return ECMD_OK;
}
@@ -1031,7 +1031,7 @@ doclose(void)
}
if (door->doormask == D_ISOPEN) {
if (verysmall(u.umonst->data) && !u.usteed) {
if (verysmall(gy.youmonst.data) && !u.usteed) {
pline("You're too small to push the door closed.");
return res;
}
@@ -1281,7 +1281,7 @@ chest_shatter_msg(struct obj *otmp)
if (otmp->oclass == POTION_CLASS) {
You("%s %s shatter!", Blind ? "hear" : "see", an(bottlename()));
if (!breathless(u.umonst->data) || haseyes(u.umonst->data))
if (!breathless(gy.youmonst.data) || haseyes(gy.youmonst.data))
potionbreathe(otmp);
return;
}
+6 -6
View File
@@ -69,7 +69,7 @@ cursetxt(struct monst *mtmp, boolean undirected)
point_msg = "all around, then curses";
else if ((Invis && !perceives(mtmp->data)
&& (mtmp->mux != u.ux || mtmp->muy != u.uy))
|| is_obj_mappear(u.umonst, STRANGE_OBJECT)
|| is_obj_mappear(&gy.youmonst, STRANGE_OBJECT)
|| u.uundetected)
point_msg = "and curses in your general direction";
else if (Displaced && (mtmp->mux != u.ux || mtmp->muy != u.uy))
@@ -389,7 +389,7 @@ staticfn void
mcast_death_touch(struct monst *mtmp)
{
pline("Oh no, %s's using the touch of death!", mhe(mtmp));
if (nonliving(u.umonst->data) || is_demon(u.umonst->data)) {
if (nonliving(gy.youmonst.data) || is_demon(gy.youmonst.data)) {
You("seem no deader than before.");
} else if (!Antimagic && rn2(mtmp->m_lev) > 12) {
if (Hallucination) {
@@ -553,9 +553,9 @@ mcast_fire_pillar(struct monst *mtmp, int dmg)
if (Half_spell_damage)
dmg = (dmg + 1) / 2;
burn_away_slime();
(void) burnarmor(u.umonst);
(void) burnarmor(&gy.youmonst);
/* item destruction dmg */
(void) destroy_items(u.umonst, AD_FIRE, orig_dmg);
(void) destroy_items(&gy.youmonst, AD_FIRE, orig_dmg);
ignite_items(gi.invent);
/* burn up flammable items on the floor, melt ice terrain */
mon_spell_hits_spot(mtmp, AD_FIRE, u.ux, u.uy);
@@ -586,7 +586,7 @@ mcast_lightning(struct monst *mtmp, int dmg)
}
if (Half_spell_damage)
dmg = (dmg + 1) / 2;
(void) destroy_items(u.umonst, AD_ELEC, orig_dmg);
(void) destroy_items(&gy.youmonst, AD_ELEC, orig_dmg);
/* lightning might destroy iron bars if hero is on such a spot;
reflection protects terrain here [execution won't get here due
to 'if (reflects) break' above] but hero resistance doesn't;
@@ -730,7 +730,7 @@ mcast_blind_you(void)
{
/* note: resists_blnd() doesn't apply here */
if (!Blinded) {
int num_eyes = eyecount(u.umonst->data);
int num_eyes = eyecount(gy.youmonst.data);
pline("Scales cover your %s!", (num_eyes == 1)
? body_part(EYE)
+16 -16
View File
@@ -607,7 +607,7 @@ failed_grab(
&& (mattk->aatyp == AT_HUGS || mattk->adtyp == AD_WRAP
|| mattk->adtyp == AD_STCK || mattk->adtyp == AD_DGST)) {
if ((gv.vis && canspotmon(mdef)) /* mon-vs-mon */
|| magr == u.umonst || mdef == u.umonst) {
|| magr == &gy.youmonst || mdef == &gy.youmonst) {
char magrnam[BUFSZ], mdefnam[BUFSZ];
boolean tailmiss = gn.notonhead;
const char *verb = (mattk->adtyp == AD_DGST) ? "gulp"
@@ -618,14 +618,14 @@ failed_grab(
mon_nam(x_monnam) calls s_suffix() for named ghosts and
s_suffix() uses a single static buffer; make copies of both
names to overcome that [note: comment predates 'tailmiss'] */
Strcpy(magrnam, (magr == u.umonst) ? "Your"
Strcpy(magrnam, (magr == &gy.youmonst) ? "Your"
: s_suffix(Monnam(magr)));
if (!tailmiss) {
Strcpy(mdefnam, (mdef == u.umonst) ? "you"
Strcpy(mdefnam, (mdef == &gy.youmonst) ? "you"
: mon_nam(mdef));
} else {
/* hero poly'd into long worm can't grow tail
so no 'u.umonst' handling is needed here */
so no 'youmonst' handling is needed here */
Sprintf(mdefnam, "%s tail", s_suffix(some_mon_nam(mdef)));
}
/* unsolid grab misses are actually somewhat iffy--how come
@@ -808,8 +808,8 @@ engulf_target(struct monst *magr, struct monst *mdef)
{
struct rm *lev;
int ax, ay, dx, dy;
boolean uatk = (magr == u.umonst),
udef = (mdef == u.umonst);
boolean uatk = (magr == &gy.youmonst),
udef = (mdef == &gy.youmonst);
/* can't swallow something that's too big */
if (mdef->data->msize >= MZ_HUGE
@@ -825,16 +825,16 @@ engulf_target(struct monst *magr, struct monst *mdef)
might not be able to place attacker and defender both back on map;
when defender is the hero, a sanity_check complaint about placing
the hero on top of a monster can occur */
dx = (mdef == u.umonst) ? u.ux : mdef->mx;
dy = (mdef == u.umonst) ? u.uy : mdef->my;
dx = (mdef == &gy.youmonst) ? u.ux : mdef->mx;
dy = (mdef == &gy.youmonst) ? u.uy : mdef->my;
lev = &levl[dx][dy];
if (!(udef ? Passes_walls : passes_walls(mdef->data))
&& (IS_OBSTRUCTED(lev->typ) || closed_door(dx, dy) || IS_TREE(lev->typ)
/* not passes_bars(); engulfer isn't squeezing through */
|| (lev->typ == IRONBARS && !is_whirly(magr->data))))
return FALSE;
ax = (magr == u.umonst) ? u.ux : magr->mx;
ay = (magr == u.umonst) ? u.uy : magr->my;
ax = (magr == &gy.youmonst) ? u.ux : magr->mx;
ay = (magr == &gy.youmonst) ? u.uy : magr->my;
lev = &levl[ax][ay];
if (!(uatk ? Passes_walls : passes_walls(magr->data))
&& (IS_OBSTRUCTED(lev->typ) || closed_door(ax, ay) || IS_TREE(lev->typ)
@@ -1124,7 +1124,7 @@ mon_poly(struct monst *magr, struct monst *mdef, int dmg)
static const char freaky[] = " undergoes a freakish metamorphosis";
struct permonst *oldform = mdef->data;
if (mdef == u.umonst) {
if (mdef == &gy.youmonst) {
if (Antimagic) {
shieldeff(u.ux, u.uy);
} else if (Unchanging) {
@@ -1166,7 +1166,7 @@ mon_poly(struct monst *magr, struct monst *mdef, int dmg)
mdef->mhp -= dmg;
dmg = 0;
if (DEADMONSTER(mdef)) {
if (magr == u.umonst)
if (magr == &gy.youmonst)
xkilled(mdef, XKILL_GIVEMSG | XKILL_NOCORPSE);
else
monkilled(mdef, "", AD_RBRE);
@@ -1182,13 +1182,13 @@ mon_poly(struct monst *magr, struct monst *mdef, int dmg)
x_monnam(mdef, ARTICLE_A, (char *) 0,
(SUPPRESS_NAME | SUPPRESS_IT
| SUPPRESS_INVISIBLE), FALSE));
else if (was_seen || magr == u.umonst)
else if (was_seen || magr == &gy.youmonst)
pline("%s%s%s.", Before, freaky,
!was_seen ? "" : " and disappears");
}
dmg = 0;
if (can_teleport(magr->data)) {
if (magr == u.umonst)
if (magr == &gy.youmonst)
tele();
else if (!tele_restrict(magr))
(void) rloc(magr, RLOC_MSG);
@@ -1200,7 +1200,7 @@ mon_poly(struct monst *magr, struct monst *mdef, int dmg)
}
/* when a transformation has happened, can't attack again for poly
effect during next turn or two; not enforced for poly'd hero */
if (mdef->data != oldform && magr != u.umonst)
if (mdef->data != oldform && magr != &gy.youmonst)
magr->mspec_used += rnd(2);
return dmg;
@@ -1250,7 +1250,7 @@ void
slept_monst(struct monst *mon)
{
if (helpless(mon) && mon == u.ustuck
&& !sticks(u.umonst->data) && !u.uswallow) {
&& !sticks(gy.youmonst.data) && !u.uswallow) {
pline_mon(mon, "%s grip relaxes.", s_suffix(Monnam(mon)));
unstuck(mon);
}
+64 -64
View File
@@ -34,7 +34,7 @@ hitmsg(struct monst *mtmp, struct attack *mattk)
/* Note: if opposite gender, "seductively";
if same gender, "engagingly" for nymph, normal msg for others. */
if ((compat = could_seduce(mtmp, u.umonst, mattk)) != 0
if ((compat = could_seduce(mtmp, &gy.youmonst, mattk)) != 0
&& !mtmp->mcan && !mtmp->mspec_used) {
pline_mon(mtmp, "%s %s you %s.", Monst_name,
!Blind ? "smiles at" : !Deaf ? "talks to" : "touches",
@@ -45,7 +45,7 @@ hitmsg(struct monst *mtmp, struct attack *mattk)
verb = "bites";
break;
case AT_KICK:
if (thick_skinned(u.umonst->data))
if (thick_skinned(gy.youmonst.data))
punct = ".";
verb = "kicks";
break;
@@ -90,7 +90,7 @@ missmu(struct monst *mtmp, boolean nearmiss, struct attack *mattk)
if (!canspotmon(mtmp))
map_invisible(mtmp->mx, mtmp->my);
if (could_seduce(mtmp, u.umonst, mattk) && !mtmp->mcan)
if (could_seduce(mtmp, &gy.youmonst, mattk) && !mtmp->mcan)
pline_mon(mtmp, "%s pretends to be friendly.", Monnam(mtmp));
else
pline_mon(mtmp, "%s %smisses!", Monnam(mtmp),
@@ -147,7 +147,7 @@ mpoisons_subj(
struct attack *mattk)
{
if (mattk->aatyp == AT_WEAP) {
struct obj *mwep = (mtmp == u.umonst) ? uwep : MON_WEP(mtmp);
struct obj *mwep = (mtmp == &gy.youmonst) ? uwep : MON_WEP(mtmp);
/* "Foo's attack was poisoned." is pretty lame, but at least
it's better than "sting" when not a stinging attack... */
return (!mwep || !mwep->opoisoned) ? "attack" : "weapon";
@@ -200,7 +200,7 @@ wildmiss(struct monst *mtmp, struct attack *mattk)
/* maybe it's attacking an image around the corner? */
compat = ((mattk->adtyp == AD_SEDU || mattk->adtyp == AD_SSEX)
? could_seduce(mtmp, u.umonst, mattk) : 0);
? could_seduce(mtmp, &gy.youmonst, mattk) : 0);
Monst_name = Monnam(mtmp);
set_msg_xy(mtmp->mx, mtmp->my);
@@ -314,8 +314,8 @@ getmattk(
{
struct permonst *mptr = magr->data;
struct attack *attk = &mptr->mattk[indx];
struct obj *weap = (magr == u.umonst) ? uwep : MON_WEP(magr);
boolean udefend = mdef == u.umonst;
struct obj *weap = (magr == &gy.youmonst) ? uwep : MON_WEP(magr);
boolean udefend = mdef == &gy.youmonst;
/* honor SEDUCE=0 */
if (!SYSOPT_SEDUCE) {
@@ -396,7 +396,7 @@ getmattk(
if weapon is sufficiently interesting; a few unique creatures
have two weapon attacks where one does physical damage and other
doesn't--avoid forcing physical damage for those */
} else if (indx == 0 && magr != u.umonst
} else if (indx == 0 && magr != &gy.youmonst
&& attk->aatyp == AT_WEAP && attk->adtyp != AD_PHYS
&& !(mptr->mattk[1].aatyp == AT_WEAP
&& mptr->mattk[1].adtyp == AD_PHYS)
@@ -468,7 +468,7 @@ mtrapped_in_pit(struct monst *mtmp)
{
struct trap *ttmp = 0;
if (mtmp == u.umonst)
if (mtmp == &gy.youmonst)
ttmp = (u.utrap && u.utraptype == TT_PIT) ? t_at(u.ux, u.uy) : 0;
else
ttmp = mtmp->mtrapped ? t_at(mtmp->mx, mtmp->my) : 0;
@@ -552,7 +552,7 @@ mattacku(struct monst *mtmp)
if (!canspotmon(mtmp))
map_invisible(mtmp->mx, mtmp->my);
u.uundetected = 0;
if (is_hider(u.umonst->data) && u.umonnum != PM_TRAPPER) {
if (is_hider(gy.youmonst.data) && u.umonnum != PM_TRAPPER) {
/* ceiling hider */
coord cc; /* maybe we need a unexto() function? */
struct obj *obj;
@@ -562,7 +562,7 @@ mattacku(struct monst *mtmp)
is eligible for placing hero; we assume that a
removed monster remembers its old spot <mx,my> */
remove_monster(mtmp->mx, mtmp->my);
if (!enexto(&cc, u.ux, u.uy, u.umonst->data)
if (!enexto(&cc, u.ux, u.uy, gy.youmonst.data)
/* a fish won't voluntarily swap positions
when it's in water and hero is over land */
|| (mtmp->data->mlet == S_EEL
@@ -587,13 +587,13 @@ mattacku(struct monst *mtmp)
/* tail hasn't grown, so if it now occupies <cc.x,.y>
then one of its original spots must be free */
if (m_at(cc.x, cc.y))
(void) enexto(&cc, u.ux, u.uy, u.umonst->data);
(void) enexto(&cc, u.ux, u.uy, gy.youmonst.data);
}
teleds(cc.x, cc.y, TELEDS_ALLOW_DRAG); /* move hero */
set_apparxy(mtmp);
newsym(u.ux, u.uy);
if (u.umonst->data->mlet != S_PIERCER)
if (gy.youmonst.data->mlet != S_PIERCER)
return 0; /* lurkers don't attack */
obj = which_armor(mtmp, WORN_HELMET);
@@ -625,7 +625,7 @@ mattacku(struct monst *mtmp)
struct obj *obj = svl.level.objects[u.ux][u.uy];
if (obj || u.umonnum == PM_TRAPPER
|| (u.umonst->data->mlet == S_EEL
|| (gy.youmonst.data->mlet == S_EEL
&& is_pool(u.ux, u.uy))) {
int save_spe = 0; /* suppress warning */
@@ -636,17 +636,17 @@ mattacku(struct monst *mtmp)
}
/* note that m_monnam() overrides hallucination, which is
what we want when message is from mtmp's perspective */
if (u.umonst->data->mlet == S_EEL
if (gy.youmonst.data->mlet == S_EEL
|| u.umonnum == PM_TRAPPER)
pline(
"Wait, %s! There's a hidden %s named %s there!",
m_monnam(mtmp),
pmname(u.umonst->data, Ugender), svp.plname);
pmname(gy.youmonst.data, Ugender), svp.plname);
else
pline(
"Wait, %s! There's a %s named %s hiding under %s!",
m_monnam(mtmp),
pmname(u.umonst->data, Ugender),
pmname(gy.youmonst.data, Ugender),
svp.plname,
doname(svl.level.objects[u.ux][u.uy]));
if (obj)
@@ -660,9 +660,9 @@ mattacku(struct monst *mtmp)
}
/* hero might be a mimic, concealed via #monster */
if (u.umonst->data->mlet == S_MIMIC && U_AP_TYPE && !range2
if (gy.youmonst.data->mlet == S_MIMIC && U_AP_TYPE && !range2
&& foundyou && !u.uswallow) {
boolean sticky = sticks(u.umonst->data);
boolean sticky = sticks(gy.youmonst.data);
if (!canspotmon(mtmp))
map_invisible(mtmp->mx, mtmp->my);
@@ -670,11 +670,11 @@ mattacku(struct monst *mtmp)
pline("It gets stuck on you.");
else /* see note about m_monnam() above */
pline("Wait, %s! That's a %s named %s!", m_monnam(mtmp),
pmname(u.umonst->data, Ugender), svp.plname);
pmname(gy.youmonst.data, Ugender), svp.plname);
if (sticky)
set_ustuck(mtmp);
u.umonst->m_ap_type = M_AP_NOTHING;
u.umonst->mappearance = 0;
gy.youmonst.m_ap_type = M_AP_NOTHING;
gy.youmonst.mappearance = 0;
newsym(u.ux, u.uy);
return 0;
}
@@ -686,18 +686,18 @@ mattacku(struct monst *mtmp)
if (!youseeit)
pline("%s %s!", Something,
(likes_gold(mtmp->data)
&& u.umonst->mappearance == GOLD_PIECE)
&& gy.youmonst.mappearance == GOLD_PIECE)
? "tries to pick you up"
: "disturbs you");
else /* see note about m_monnam() above */
pline("Wait, %s! That %s is really %s named %s!", m_monnam(mtmp),
mimic_obj_name(u.umonst),
mimic_obj_name(&gy.youmonst),
an(pmname(&mons[u.umonnum], Ugender)), svp.plname);
if (gm.multi < 0) { /* this should always be the case */
char buf[BUFSZ];
Sprintf(buf, "You appear to be %s again.",
Upolyd ? (const char *) an(pmname(u.umonst->data,
Upolyd ? (const char *) an(pmname(gy.youmonst.data,
flags.female))
: (const char *) "yourself");
unmul(buf); /* immediately stop mimicking */
@@ -783,7 +783,7 @@ mattacku(struct monst *mtmp)
continue;
}
mon_currwep = (struct obj *) 0;
mattk = getmattk(mtmp, u.umonst, i, sum, &alt_attk);
mattk = getmattk(mtmp, &gy.youmonst, i, sum, &alt_attk);
if ((u.uswallow && mattk->aatyp != AT_ENGL)
|| (skipnonmagc && mattk->aatyp != AT_MAGC)
|| (gs.skipdrin && mattk->aatyp == AT_TENT
@@ -801,14 +801,14 @@ mattacku(struct monst *mtmp)
if (mattk->aatyp == AT_KICK && mtrapped_in_pit(mtmp))
continue;
if (!range2 && (!MON_WEP(mtmp) || mtmp->mconf || Conflict
|| !touch_petrifies(u.umonst->data))) {
|| !touch_petrifies(gy.youmonst.data))) {
if (foundyou) {
if (tmp > (j = rnd(20 + i))) {
if (unsolid(u.umonst->data)
&& failed_grab(mtmp, u.umonst, mattk))
if (unsolid(gy.youmonst.data)
&& failed_grab(mtmp, &gy.youmonst, mattk))
continue;
if (mattk->aatyp != AT_KICK
|| !thick_skinned(u.umonst->data))
|| !thick_skinned(gy.youmonst.data))
sum[i] = hitmu(mtmp, mattk);
} else
missmu(mtmp, (tmp == j), mattk);
@@ -824,7 +824,7 @@ mattacku(struct monst *mtmp)
/* Note: if displaced, prev attacks never succeeded */
if ((!range2 && i >= 2 && sum[i - 1] && sum[i - 2])
|| mtmp == u.ustuck) {
if (!failed_grab(mtmp, u.umonst, mattk))
if (!failed_grab(mtmp, &gy.youmonst, mattk))
sum[i] = hitmu(mtmp, mattk);
}
break;
@@ -905,7 +905,7 @@ mattacku(struct monst *mtmp)
ART_SNICKERSNEE)
&& m_next2u(mtmp));
hittmp = hitval(mon_currwep, u.umonst);
hittmp = hitval(mon_currwep, &gy.youmonst);
tmp += hittmp;
mswings(mtmp, mon_currwep, bash);
}
@@ -1091,7 +1091,7 @@ magic_negation(struct monst *mon)
struct obj *o;
long wearmask;
int armpro, mc = 0;
boolean is_you = (mon == u.umonst),
boolean is_you = (mon == &gy.youmonst),
via_amul = FALSE,
gotprot = is_you ? (EProtection != 0L)
/* high priests have innate protection */
@@ -1144,7 +1144,7 @@ staticfn int
hitmu(struct monst *mtmp, struct attack *mattk)
{
struct permonst *mdat = mtmp->data;
struct permonst *olduasmon = u.umonst->data;
struct permonst *olduasmon = gy.youmonst.data;
int res;
struct mhitm_data mhm;
mhm.hitflags = M_ATTK_MISS;
@@ -1188,9 +1188,9 @@ hitmu(struct monst *mtmp, struct attack *mattk)
if ((is_undead(mdat) || is_vampshifter(mtmp)) && midnight())
mhm.damage += d((int) mattk->damn, (int) mattk->damd); /* extra dmg */
mhitm_adtyping(mtmp, mattk, u.umonst, &mhm);
mhitm_adtyping(mtmp, mattk, &gy.youmonst, &mhm);
(void) mhitm_knockback(mtmp, u.umonst, mattk, &mhm.hitflags,
(void) mhitm_knockback(mtmp, &gy.youmonst, mattk, &mhm.hitflags,
(MON_WEP(mtmp) != 0));
if (mhm.done)
@@ -1240,8 +1240,8 @@ hitmu(struct monst *mtmp, struct attack *mattk)
if (Upolyd) {
hpmax_p = &u.mhmax;
/* [can't use u.umonst->m_lev] */
lowerlimit = min((int) u.umonst->data->mlevel, u.ulevel);
/* [can't use gy.youmonst.m_lev] */
lowerlimit = min((int) gy.youmonst.data->mlevel, u.ulevel);
} else {
hpmax_p = &u.uhpmax;
lowerlimit = minuhpmax(1);
@@ -1276,7 +1276,7 @@ gulp_blnd_check(void)
if (!Blinded && u.uswallow
&& (mattk = attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_BLND))
&& can_blnd(u.ustuck, u.umonst, mattk->aatyp, (struct obj *) 0)) {
&& can_blnd(u.ustuck, &gy.youmonst, mattk->aatyp, (struct obj *) 0)) {
++u.uswldtim; /* compensate for gulpmu change */
(void) gulpmu(u.ustuck, mattk);
return TRUE;
@@ -1298,11 +1298,11 @@ gulpmu(struct monst *mtmp, struct attack *mattk)
if (!u.uswallow) { /* swallows you */
int omx = mtmp->mx, omy = mtmp->my;
if (!engulf_target(mtmp, u.umonst))
if (!engulf_target(mtmp, &gy.youmonst))
return M_ATTK_MISS;
if ((t && is_pit(t->ttyp)) && sobj_at(BOULDER, u.ux, u.uy))
return M_ATTK_MISS;
if (failed_grab(mtmp, u.umonst, mattk))
if (failed_grab(mtmp, &gy.youmonst, mattk))
return M_ATTK_MISS;
if (Punished)
@@ -1354,7 +1354,7 @@ gulpmu(struct monst *mtmp, struct attack *mattk)
unleash_all();
}
if (touch_petrifies(u.umonst->data) && !resists_ston(mtmp)) {
if (touch_petrifies(gy.youmonst.data) && !resists_ston(mtmp)) {
/* put the attacker back where it started;
the resulting statue will end up there
[note: if poly'd hero could ride or non-poly'd hero could
@@ -1438,13 +1438,13 @@ gulpmu(struct monst *mtmp, struct attack *mattk)
physical_damage = TRUE;
if (mtmp->data == &mons[PM_FOG_CLOUD]) {
You("are laden with moisture and %s",
flaming(u.umonst->data)
flaming(gy.youmonst.data)
? "are smoldering out!"
: Breathless ? "find it mildly uncomfortable."
: amphibious(u.umonst->data)
: amphibious(gy.youmonst.data)
? "feel comforted."
: "can barely breathe!");
if ((Amphibious || Breathless) && !flaming(u.umonst->data))
if ((Amphibious || Breathless) && !flaming(gy.youmonst.data))
tmp = 0;
} else {
You("are %s!", enfolds(mtmp->data) ? "being squashed"
@@ -1469,7 +1469,7 @@ gulpmu(struct monst *mtmp, struct attack *mattk)
}
break;
case AD_BLND:
if (can_blnd(mtmp, u.umonst, mattk->aatyp, (struct obj *) 0)) {
if (can_blnd(mtmp, &gy.youmonst, mattk->aatyp, (struct obj *) 0)) {
if (!Blind) {
long was_blinded = Blinded;
@@ -1564,13 +1564,13 @@ gulpmu(struct monst *mtmp, struct attack *mattk)
if (!u.uswallow) {
; /* life-saving has already expelled swallowed hero */
} else if (touch_petrifies(u.umonst->data) && !resists_ston(mtmp)) {
} else if (touch_petrifies(gy.youmonst.data) && !resists_ston(mtmp)) {
pline("%s very hurriedly %s you!", Monnam(mtmp),
digests(mtmp->data) ? "regurgitates"
: enfolds(mtmp->data) ? "releases"
: "expels");
expels(mtmp, mtmp->data, FALSE);
} else if (!u.uswldtim || u.umonst->data->msize >= MZ_HUGE) {
} else if (!u.uswldtim || gy.youmonst.data->msize >= MZ_HUGE) {
/* As of 3.6.2: u.uswldtim used to be set to 0 by life-saving but it
expels now so the !u.uswldtim case is no longer possible;
however, polymorphing into a huge form while already
@@ -1621,7 +1621,7 @@ explmu(
kill_agr = FALSE; /* lifesaving? */
break;
case AD_BLND:
not_affected = resists_blnd(u.umonst);
not_affected = resists_blnd(&gy.youmonst);
if (ufound && !not_affected) {
/* sometimes you're affected even if it's invisible */
if (mon_visible(mtmp) || (rnd(tmp /= 2) > u.ulevel)) {
@@ -1636,7 +1636,7 @@ explmu(
case AD_HALU:
not_affected |= Blind || (u.umonnum == PM_BLACK_LIGHT
|| u.umonnum == PM_VIOLET_FUNGUS
|| dmgtype(u.umonst->data, AD_STUN));
|| dmgtype(gy.youmonst.data, AD_STUN));
if (ufound && !not_affected) {
boolean chg;
if (!Hallucination)
@@ -1748,7 +1748,7 @@ gazemu(struct monst *mtmp, struct attack *mattk)
&& !Stone_resistance && !Unaware) {
You("meet %s gaze.", s_suffix(mon_nam(mtmp)));
stop_occupation();
if (poly_when_stoned(u.umonst->data) && polymon(PM_STONE_GOLEM))
if (poly_when_stoned(gy.youmonst.data) && polymon(PM_STONE_GOLEM))
break;
urgent_pline("You turn to stone...");
svk.killer.format = KILLED_BY;
@@ -1791,7 +1791,7 @@ gazemu(struct monst *mtmp, struct attack *mattk)
}
break;
case AD_BLND:
if (canseemon(mtmp) && !resists_blnd(u.umonst)
if (canseemon(mtmp) && !resists_blnd(&gy.youmonst)
&& mdistu(mtmp) <= BOLT_LIM * BOLT_LIM) {
if (cancelled) {
react = rn1(2, 2); /* "puzzled" || "dazzled" */
@@ -1842,9 +1842,9 @@ gazemu(struct monst *mtmp, struct attack *mattk)
}
burn_away_slime();
if (lev > rn2(20))
(void) burnarmor(u.umonst);
(void) burnarmor(&gy.youmonst);
if (lev > rn2(20)) {
(void) destroy_items(u.umonst, AD_FIRE, orig_dmg);
(void) destroy_items(&gy.youmonst, AD_FIRE, orig_dmg);
ignite_items(gi.invent);
}
if (dmg)
@@ -1943,8 +1943,8 @@ could_seduce(
if (is_animal(magr->data))
return 0;
if (magr == u.umonst) {
pagr = u.umonst->data;
if (magr == &gy.youmonst) {
pagr = gy.youmonst.data;
agrinvis = (Invis != 0);
genagr = poly_gender();
} else {
@@ -1952,7 +1952,7 @@ could_seduce(
agrinvis = magr->minvis;
genagr = gender(magr);
}
if (mdef == u.umonst) {
if (mdef == &gy.youmonst) {
defperc = (See_invisible != 0);
gendef = poly_gender();
} else {
@@ -2202,7 +2202,7 @@ doseduce(struct monst *mon)
disp.botl = TRUE;
break;
case 3:
if (!resists_drli(u.umonst)) {
if (!resists_drli(&gy.youmonst)) {
You_feel("out of shape.");
losexp("overexertion");
} else {
@@ -2541,7 +2541,7 @@ passiveum(
&& (perceives(mtmp->data) || !Invis)) {
if (Blind) {
pline("As a blind %s, you cannot defend yourself.",
pmname(u.umonst->data,
pmname(gy.youmonst.data,
flags.female ? FEMALE : MALE));
} else {
if (mon_reflects(mtmp,
@@ -2571,8 +2571,8 @@ passiveum(
u.mh += (tmp + rn2(2)) / 2;
if (u.mhmax < u.mh)
u.mhmax = u.mh;
if (u.mhmax > (((int) u.umonst->data->mlevel + 1) * 8))
(void) split_mon(u.umonst, mtmp);
if (u.mhmax > (((int) gy.youmonst.data->mlevel + 1) * 8))
(void) split_mon(&gy.youmonst, mtmp);
break;
case AD_STUN: /* Yellow mold */
if (!mtmp->mstun) {
@@ -2617,20 +2617,20 @@ struct monst *
cloneu(void)
{
struct monst *mon;
int mndx = monsndx(u.umonst->data);
int mndx = monsndx(gy.youmonst.data);
if (u.mh <= 1)
return (struct monst *) 0;
if (svm.mvitals[mndx].mvflags & G_EXTINCT)
return (struct monst *) 0;
mon = makemon(u.umonst->data, u.ux, u.uy,
mon = makemon(gy.youmonst.data, u.ux, u.uy,
NO_MINVENT | MM_EDOG | MM_NOMSG);
if (!mon)
return NULL;
mon->mcloned = 1;
mon = christen_monst(mon, svp.plname);
initedog(mon, TRUE);
mon->m_lev = u.umonst->data->mlevel;
mon->m_lev = gy.youmonst.data->mlevel;
mon->mhpmax = u.mhmax;
mon->mhp = u.mh / 2;
u.mh -= mon->mhp;
+1 -1
View File
@@ -296,7 +296,7 @@ demon_talk(struct monst *mtmp)
}
newsym(mtmp->mx, mtmp->my);
}
if (u.umonst->data->mlet == S_DEMON) { /* Won't blackmail their own. */
if (gy.youmonst.data->mlet == S_DEMON) { /* Won't blackmail their own. */
if (!Deaf)
pline("%s says, \"Good hunting, %s.\"", Amonnam(mtmp),
flags.female ? "Sister" : "Brother");
+11 -11
View File
@@ -330,7 +330,7 @@ int
m_poisongas_ok(struct monst *mtmp)
{
int px, py;
boolean is_you = (mtmp == u.umonst);
boolean is_you = (mtmp == &gy.youmonst);
/* Non living, non breathing, immune monsters are not concerned */
if (nonliving(mtmp->data) || is_vampshifter(mtmp)
@@ -2104,8 +2104,8 @@ mon_allowflags(struct monst *mtmp)
if (passes_bars(mtmp->data)
/* restrict engulfer or holder who might try to pass iron bars while
carrying hero; accept small subset for poly'd hero passes_bars() */
&& (mtmp != u.ustuck || (unsolid(u.umonst->data)
|| verysmall(u.umonst->data))))
&& (mtmp != u.ustuck || (unsolid(gy.youmonst.data)
|| verysmall(gy.youmonst.data))))
allowflags |= ALLOW_BARS;
#if 0 /* can't do this here; leave it for mfndpos() */
if (is_displacer(mtmp->data))
@@ -3209,7 +3209,7 @@ corpse_chance(
if (was_swallowed && magr) {
/* mdef is a gas spore (AT_BOOM) that is exploding inside an
engulfer; suppress usual explosion since it's contained */
if (magr == u.umonst) {
if (magr == &gy.youmonst) {
There("is an explosion in your %s!", body_part(STOMACH));
Sprintf(svk.killer.name, "%s explosion",
s_suffix(pmname(mdat, Mgender(mon))));
@@ -3617,7 +3617,7 @@ xkilled(
/* corpse--none if hero was inside the monster */
if (!wasinside && corpse_chance(mtmp, (struct monst *) 0, FALSE)) {
gz.zombify = (!gt.thrownobj && !gs.stoned && !uwep
&& zombie_maker(u.umonst)
&& zombie_maker(&gy.youmonst)
&& zombie_form(mtmp->data) != NON_PM);
cadaver = make_corpse(mtmp, burycorpse ? CORPSTAT_BURIED
: CORPSTAT_NONE);
@@ -4595,7 +4595,7 @@ get_iter_mons_xy(
int
healmon(struct monst *mtmp, int amt, int overheal)
{
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
int oldhp = Upolyd ? u.mh : u.uhp;
healup(amt, 0, 0, 0);
return (Upolyd ? u.mh : u.uhp) - oldhp;
@@ -4704,7 +4704,7 @@ maybe_unhide_at(coordxy x, coordxy y)
undetected = mtmp->mundetected;
trapped = mtmp->mtrapped;
} else if (u_at(x, y)) {
mtmp = u.umonst;
mtmp = &gy.youmonst;
undetected = u.uundetected;
trapped = u.utrap;
} else {
@@ -4730,7 +4730,7 @@ hideunder(struct monst *mtmp)
const char *seenmon = (char *) 0, *seenobj = (char *) 0,
*locomo = (char *) 0;
int seeit = gi.in_mklev ? 0 : canseemon(mtmp);
boolean oldundetctd, undetected = FALSE, is_u = (mtmp == u.umonst);
boolean oldundetctd, undetected = FALSE, is_u = (mtmp == &gy.youmonst);
coordxy x = is_u ? u.ux : mtmp->mx, y = is_u ? u.uy : mtmp->my;
if (mtmp == u.ustuck) {
@@ -5437,7 +5437,7 @@ newcham(
/* update swallow glyphs for new monster */
swallowed(0);
}
} else if ((!sticks(mdat) && !sticks(u.umonst->data))
} else if ((!sticks(mdat) && !sticks(gy.youmonst.data))
/* sticky hero can't continue to hold mtmp if it has
turned into a non-solid creature; we don't use
uunstick() for that because its message would be
@@ -5800,7 +5800,7 @@ usmellmon(struct permonst *mdat)
boolean msg_given = FALSE;
if (mdat) {
if (!olfaction(u.umonst->data))
if (!olfaction(gy.youmonst.data))
return FALSE;
mndx = monsndx(mdat);
switch (mndx) {
@@ -5895,7 +5895,7 @@ usmellmon(struct permonst *mdat)
msg_given = TRUE;
break;
case S_ORC:
if (maybe_polyd(is_orc(u.umonst->data), Race_if(PM_ORC)))
if (maybe_polyd(is_orc(gy.youmonst.data), Race_if(PM_ORC)))
You("notice an attractive smell.");
else
pline("A foul stench makes you feel a little nauseated.");
+17 -17
View File
@@ -13,7 +13,7 @@ void
set_mon_data(struct monst *mon, struct permonst *ptr)
{
int new_speed, old_speed = mon->data ? mon->data->mmove : 0;
short *movement_p = (mon == u.umonst) ? &u.umovement : &mon->movement;
short *movement_p = (mon == &gy.youmonst) ? &u.umovement : &mon->movement;
mon->data = ptr;
mon->mnum = (short) monsndx(ptr);
@@ -85,14 +85,14 @@ poly_when_stoned(struct permonst *ptr)
/* allow G_EXTINCT */
}
/* is 'mon' (possibly u.umonst) protected against damage type 'adtype' via
/* is 'mon' (possibly youmonst) protected against damage type 'adtype' via
wielded weapon or worn dragon scales? [or by virtue of being a dragon?] */
boolean
defended(struct monst *mon, int adtyp)
{
struct obj *o, otemp;
int mndx;
boolean is_you = (mon == u.umonst);
boolean is_you = (mon == &gy.youmonst);
/* is 'mon' wielding an artifact that protects against 'adtyp'? */
o = is_you ? uwep : MON_WEP(mon);
@@ -130,7 +130,7 @@ Resists_Elem(struct monst *mon, int propindx)
{
struct obj *o;
long slotmask;
boolean is_you = (mon == u.umonst);
boolean is_you = (mon == &gy.youmonst);
int u_resist = 0, damgtype = 0, rsstmask = 0;
/*
@@ -204,7 +204,7 @@ resists_drli(struct monst *mon)
if (is_undead(ptr) || is_demon(ptr) || is_were(ptr)
/* is_were() doesn't handle hero in human form */
|| (mon == u.umonst && u.ulycn >= LOW_PM)
|| (mon == &gy.youmonst && u.ulycn >= LOW_PM)
|| ptr == &mons[PM_DEATH] || is_vampshifter(mon))
return TRUE;
return defended(mon, AD_DRLI);
@@ -215,7 +215,7 @@ boolean
resists_magm(struct monst *mon)
{
struct permonst *ptr = mon->data;
boolean is_you = (mon == u.umonst);
boolean is_you = (mon == &gy.youmonst);
long slotmask;
struct obj *o;
@@ -248,7 +248,7 @@ boolean
resists_blnd(struct monst *mon)
{
struct permonst *ptr = mon->data;
boolean is_you = (mon == u.umonst);
boolean is_you = (mon == &gy.youmonst);
if (is_you ? (Blind || Unaware)
: (mon->mblinded || !mon->mcansee || !haseyes(ptr)
@@ -278,7 +278,7 @@ boolean
resists_blnd_by_arti(struct monst *mon)
{
struct obj *o;
boolean is_you = (mon == u.umonst);
boolean is_you = (mon == &gy.youmonst);
o = is_you ? uwep : MON_WEP(mon);
if (o && o->oartifact && defends(AD_BLND, o))
@@ -308,7 +308,7 @@ can_blnd(
uchar aatyp,
struct obj *obj) /* aatyp == AT_WEAP, AT_SPIT */
{
boolean is_you = (mdef == u.umonst);
boolean is_you = (mdef == &gy.youmonst);
boolean check_visor = FALSE;
struct obj *o;
@@ -354,7 +354,7 @@ can_blnd(
return TRUE; /* no defense */
} else
return FALSE; /* other objects cannot cause blindness yet */
if ((magr == u.umonst) && u.uswallow)
if ((magr == &gy.youmonst) && u.uswallow)
return FALSE; /* can't affect eyes while inside monster */
break;
@@ -369,7 +369,7 @@ can_blnd(
/* e.g. raven: all ublindf, including LENSES, protect */
if (is_you && ublindf)
return FALSE;
if ((magr == u.umonst) && u.uswallow)
if ((magr == &gy.youmonst) && u.uswallow)
return FALSE; /* can't affect eyes while inside monster */
check_visor = TRUE;
break;
@@ -387,7 +387,7 @@ can_blnd(
/* check if wearing a visor (only checked if visor might help) */
if (check_visor) {
o = (mdef == u.umonst) ? gi.invent : mdef->minvent;
o = (mdef == &gy.youmonst) ? gi.invent : mdef->minvent;
for (; o; o = o->nobj)
if ((o->owornmask & W_ARMH)
&& objdescr_is(o, "visored helmet"))
@@ -570,7 +570,7 @@ can_blow(struct monst *mtmp)
&& (breathless(mtmp->data) || verysmall(mtmp->data)
|| !has_head(mtmp->data) || mtmp->data->mlet == S_EEL))
return FALSE;
if ((mtmp == u.umonst) && Strangled)
if ((mtmp == &gy.youmonst) && Strangled)
return FALSE;
return TRUE;
}
@@ -579,7 +579,7 @@ can_blow(struct monst *mtmp)
boolean
can_chant(struct monst *mtmp)
{
if ((mtmp == u.umonst && Strangled)
if ((mtmp == &gy.youmonst && Strangled)
|| is_silent(mtmp->data) || !has_head(mtmp->data)
|| mtmp->data->msound == MS_BUZZ || mtmp->data->msound == MS_BURBLE)
return FALSE;
@@ -602,10 +602,10 @@ can_be_strangled(struct monst *mon)
are non-breathing creatures which have higher brain function. */
if (!has_head(mon->data))
return FALSE;
if (mon == u.umonst) {
if (mon == &gy.youmonst) {
/* hero can't be mindless but poly'ing into mindless form can
confer strangulation protection */
nobrainer = mindless(u.umonst->data);
nobrainer = mindless(gy.youmonst.data);
nonbreathing = Breathless;
} else {
nobrainer = mindless(mon->data);
@@ -1358,7 +1358,7 @@ big_little_match(int montyp1, int montyp2)
const struct permonst *
raceptr(struct monst *mtmp)
{
if (mtmp == u.umonst && !Upolyd)
if (mtmp == &gy.youmonst && !Upolyd)
return &mons[gu.urace.mnum];
return mtmp->data;
}
+11 -11
View File
@@ -364,7 +364,7 @@ release_hero(struct monst *mon)
if (mon == u.ustuck) {
if (u.uswallow) {
expels(mon, mon->data, TRUE);
} else if (!sticks(u.umonst->data)) {
} else if (!sticks(gy.youmonst.data)) {
unstuck(mon); /* let go */
You("get released!");
}
@@ -608,8 +608,8 @@ mind_blast(struct monst *mtmp)
/* hero has no way to hide as monster but
check for that theoretical case anyway */
&& U_AP_TYPE != M_AP_MONSTER) {
u.umonst->m_ap_type = M_AP_NOTHING;
u.umonst->mappearance = 0;
gy.youmonst.m_ap_type = M_AP_NOTHING;
gy.youmonst.mappearance = 0;
newsym(u.ux, u.uy);
}
pline("It locks on to your %s!",
@@ -649,7 +649,7 @@ mind_blast(struct monst *mtmp)
void
m_everyturn_effect(struct monst *mtmp)
{
boolean is_u = (mtmp == u.umonst) ? TRUE : FALSE;
boolean is_u = (mtmp == &gy.youmonst) ? TRUE : FALSE;
coordxy x = is_u ? u.ux : mtmp->mx,
y = is_u ? u.uy : mtmp->my;
@@ -671,7 +671,7 @@ m_everyturn_effect(struct monst *mtmp)
void
m_postmove_effect(struct monst *mtmp)
{
boolean is_u = (mtmp == u.umonst) ? TRUE : FALSE;
boolean is_u = (mtmp == &gy.youmonst) ? TRUE : FALSE;
coordxy x = is_u ? u.ux0 : mtmp->mx,
y = is_u ? u.uy0 : mtmp->my;
@@ -806,7 +806,7 @@ dochug(struct monst *mtmp)
pline("%s whispers at thin air.",
cansee(mtmp->mux, mtmp->muy) ? Monnam(mtmp) : "It");
if (is_demon(u.umonst->data)) {
if (is_demon(gy.youmonst.data)) {
/* "Good hunting, brother" */
if (!tele_restrict(mtmp))
(void) rloc(mtmp, RLOC_MSG);
@@ -1052,7 +1052,7 @@ mon_would_consume_item(struct monst *mtmp, struct obj *otmp)
boolean
itsstuck(struct monst *mtmp)
{
if (sticks(u.umonst->data) && mtmp == u.ustuck && !u.uswallow) {
if (sticks(gy.youmonst.data) && mtmp == u.ustuck && !u.uswallow) {
pline_mon(mtmp, "%s cannot escape from you!", Monnam(mtmp));
return TRUE;
}
@@ -1864,8 +1864,8 @@ m_move(struct monst *mtmp, int after)
if (!mtmp->mcansee
|| (should_see && Invis && !perceives(ptr) && rn2(11))
|| is_obj_mappear(u.umonst, STRANGE_OBJECT) || u.uundetected
|| (is_obj_mappear(u.umonst, GOLD_PIECE) && !likes_gold(ptr))
|| is_obj_mappear(&gy.youmonst, STRANGE_OBJECT) || u.uundetected
|| (is_obj_mappear(&gy.youmonst, GOLD_PIECE) && !likes_gold(ptr))
|| (mtmp->mpeaceful && !mtmp->isshk) /* allow shks to follow */
|| ((monsndx(ptr) == PM_STALKER || ptr->mlet == S_BAT
|| ptr->mlet == S_LIGHT) && !rn2(3)))
@@ -1891,7 +1891,7 @@ m_move(struct monst *mtmp, int after)
if ((!mtmp->mpeaceful || !rn2(10)) && (!Is_rogue_level(&u.uz))) {
boolean in_line = (lined_up(mtmp)
&& (distmin(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy)
<= (throws_rocks(u.umonst->data) ? 20
<= (throws_rocks(gy.youmonst.data) ? 20
: (ACURRSTR / 2 + 1))));
if (appr != 1 || !in_line) {
@@ -2320,7 +2320,7 @@ stuff_prevents_passage(struct monst *mtmp)
{
struct obj *chain, *obj;
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
chain = gi.invent;
} else {
chain = mtmp->minvent;
+20 -20
View File
@@ -124,7 +124,7 @@ thitu(
pline("It doesn't seem to hurt you.");
monstseesu(M_SEEN_ACID);
} else if (obj && stone_missile(obj)
&& passes_rocks(u.umonst->data)) {
&& passes_rocks(gy.youmonst.data)) {
/* use 'named' as an approximation for "hitting from above";
we avoid "passes through you" for horizontal flight path
because missile stops and that wording would suggest that
@@ -134,7 +134,7 @@ thitu(
} else if (obj && obj->oclass == POTION_CLASS) {
/* an explosion which scatters objects might hit hero with one
(potions deliberately thrown at hero are handled by m_throw) */
potionhit(u.umonst, obj, POTHIT_OTHER_THROW);
potionhit(&gy.youmonst, obj, POTHIT_OTHER_THROW);
*objp = obj = 0; /* potionhit() uses up the potion */
} else {
if (obj && objects[obj->otyp].oc_material == SILVER
@@ -184,7 +184,7 @@ drop_throw(
if (!(broken = flooreffects(obj, x, y, "fall"))) {
place_object(obj, x, y);
if (!mtmp && u_at(x, y))
mtmp = u.umonst;
mtmp = &gy.youmonst;
if (mtmp && ohit)
passive_obj(mtmp, obj, (struct attack *) 0);
stackobj(obj);
@@ -508,7 +508,7 @@ ucatchgem(
struct monst *mon)
{
/* won't catch rock or gray stone; catch (then drop) worthless glass */
if (gem->otyp <= LAST_GLASS_GEM && is_unicorn(u.umonst->data)) {
if (gem->otyp <= LAST_GLASS_GEM && is_unicorn(gy.youmonst.data)) {
char *gem_xname = xname(gem),
*mon_s_name = s_suffix(mon_nam(mon));
@@ -537,7 +537,7 @@ u_catch_thrown_obj(struct obj *otmp)
if (!Blind && !Confusion && !Stunned && !Fumbling
&& otmp->oclass != VENOM_CLASS
&& !nohands(u.umonst->data) && freehand()
&& !nohands(gy.youmonst.data) && freehand()
&& calc_capacity(otmp->owt) <= SLT_ENCUMBER && !rn2(catch_chance)) {
char buf[BUFSZ];
@@ -696,7 +696,7 @@ m_throw(
break;
if (singleobj->oclass == POTION_CLASS) {
potionhit(u.umonst, singleobj, POTHIT_MONST_THROW);
potionhit(&gy.youmonst, singleobj, POTHIT_MONST_THROW);
break;
}
oldumort = u.umortality;
@@ -719,7 +719,7 @@ m_throw(
{
int dam, hitv;
dam = dmgval(singleobj, u.umonst);
dam = dmgval(singleobj, &gy.youmonst);
hitv = 3 - distmin(u.ux, u.uy, mon->mx, mon->my);
if (hitv < -4)
hitv = -4;
@@ -732,7 +732,7 @@ m_throw(
if (singleobj->otyp == ELVEN_ARROW)
dam++;
}
if (bigmonst(u.umonst->data))
if (bigmonst(gy.youmonst.data))
hitv++;
hitv += 8 + singleobj->spe;
if (dam < 1)
@@ -752,7 +752,7 @@ m_throw(
poison is limited to attrib loss */
(u.umortality > oldumort) ? 0 : 10, TRUE);
}
if (hitu && can_blnd((struct monst *) 0, u.umonst,
if (hitu && can_blnd((struct monst *) 0, &gy.youmonst,
(uchar) ((singleobj->otyp == BLINDING_VENOM)
? AT_SPIT
: AT_WEAP),
@@ -767,7 +767,7 @@ m_throw(
} else if (singleobj->otyp == BLINDING_VENOM) {
const char *eyes = body_part(EYE);
if (eyecount(u.umonst->data) != 1)
if (eyecount(gy.youmonst.data) != 1)
eyes = makeplural(eyes);
/* venom in the eyes */
if (!Blind)
@@ -778,7 +778,7 @@ m_throw(
}
if (hitu && singleobj->otyp == EGG) {
if (!Stoned && !Stone_resistance
&& !(poly_when_stoned(u.umonst->data)
&& !(poly_when_stoned(gy.youmonst.data)
&& polymon(PM_STONE_GOLEM))) {
make_stoned(5L, (char *) 0, KILLED_BY, "");
}
@@ -1030,7 +1030,7 @@ spitmm(struct monst *mtmp, struct attack *mattk, struct monst *mtarg)
return M_ATTK_MISS;
}
if (m_lined_up(mtarg, mtmp)) {
boolean utarg = (mtarg == u.umonst);
boolean utarg = (mtarg == &gy.youmonst);
coordxy tx = utarg ? mtmp->mux : mtarg->mx;
coordxy ty = utarg ? mtmp->muy : mtarg->my;
@@ -1093,7 +1093,7 @@ int
breamm(struct monst *mtmp, struct attack *mattk, struct monst *mtarg)
{
int typ = get_atkdam_type(mattk->adtyp);
boolean utarget = (mtarg == u.umonst);
boolean utarget = (mtarg == &gy.youmonst);
if (m_lined_up(mtarg, mtmp)) {
if (mtmp->mcan) {
@@ -1225,11 +1225,11 @@ thrwmu(struct monst *mtmp)
obj_is_pname(otmp) ? the(onm) : an(onm));
}
dam = dmgval(otmp, u.umonst);
dam = dmgval(otmp, &gy.youmonst);
hitv = 3 - distmin(u.ux, u.uy, mtmp->mx, mtmp->my);
if (hitv < -4)
hitv = -4;
if (bigmonst(u.umonst->data))
if (bigmonst(gy.youmonst.data))
hitv++;
hitv += 8 + otmp->spe;
if (dam < 1)
@@ -1267,14 +1267,14 @@ thrwmu(struct monst *mtmp)
int
spitmu(struct monst *mtmp, struct attack *mattk)
{
return spitmm(mtmp, mattk, u.umonst);
return spitmm(mtmp, mattk, &gy.youmonst);
}
/* monster breathes at you (ranged) */
int
breamu(struct monst *mtmp, struct attack *mattk)
{
return breamm(mtmp, mattk, u.umonst);
return breamm(mtmp, mattk, &gy.youmonst);
}
/* return TRUE if terrain at x,y blocks linedup checks */
@@ -1375,7 +1375,7 @@ linedup(
staticfn int
m_lined_up(struct monst *mtarg, struct monst *mtmp)
{
boolean utarget = (mtarg == u.umonst);
boolean utarget = (mtarg == &gy.youmonst);
coordxy tx = utarget ? mtmp->mux : mtarg->mx;
coordxy ty = utarget ? mtmp->muy : mtarg->my;
boolean ignore_boulders = utarget && (throws_rocks(mtmp->data)
@@ -1397,7 +1397,7 @@ m_lined_up(struct monst *mtarg, struct monst *mtmp)
boolean
lined_up(struct monst *mtmp)
{
return m_lined_up(u.umonst, mtmp) ? TRUE : FALSE;
return m_lined_up(&gy.youmonst, mtmp) ? TRUE : FALSE;
}
/* check if a monster is carrying an item of a particular type */
@@ -1406,7 +1406,7 @@ m_carrying(struct monst *mtmp, int type)
{
struct obj *otmp;
for (otmp = (mtmp == u.umonst) ? gi.invent : mtmp->minvent; otmp;
for (otmp = (mtmp == &gy.youmonst) ? gi.invent : mtmp->minvent; otmp;
otmp = otmp->nobj)
if (otmp->otyp == type)
break;
+7 -7
View File
@@ -252,7 +252,7 @@ mreadmsg(struct monst *mtmp, struct obj *otmp)
pline_mon(mtmp, "%s reads %s!", Monnam(mtmp), onambuf);
} else { /* !Deaf, otherwise we wouldn't reach here */
char blindbuf[BUFSZ];
boolean similar = same_race(u.umonst->data, mtmp->data),
boolean similar = same_race(gy.youmonst.data, mtmp->data),
uniqmon = ((mtmp->data->geno & G_UNIQ) != 0
/* shopkeepers aren't unique monsters but since
they have distinct names, treat them as such */
@@ -1565,8 +1565,8 @@ find_offensive(struct monst *mtmp)
}
nomore(MUSE_CAMERA);
if (obj->otyp == EXPENSIVE_CAMERA
&& ((!Blind && !resists_blnd(u.umonst))
|| hates_light(u.umonst->data))
&& ((!Blind && !resists_blnd(&gy.youmonst))
|| hates_light(gy.youmonst.data))
&& dist2(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy) <= 2
&& obj->spe > 0 && !rn2(6)) {
gm.m.offensive = obj;
@@ -1598,7 +1598,7 @@ mbhitm(struct monst *mtmp, struct obj *otmp)
{
int tmp;
boolean reveal_invis = FALSE, learnit = FALSE,
hits_you = (mtmp == u.umonst);
hits_you = (mtmp == &gy.youmonst);
if (!hits_you && otmp->otyp != WAN_UNDEAD_TURNING) {
mtmp->msleeping = 0;
@@ -1761,7 +1761,7 @@ mbhit(
break;
}
if (u_at(gb.bhitpos.x, gb.bhitpos.y)) {
(*fhitm)(u.umonst, obj);
(*fhitm)(&gy.youmonst, obj);
range -= 3;
} else if ((mtmp = m_at(gb.bhitpos.x, gb.bhitpos.y)) != 0) {
if (cansee(gb.bhitpos.x, gb.bhitpos.y) && !canspotmon(mtmp))
@@ -1944,7 +1944,7 @@ use_offensive(struct monst *mtmp)
Monnam(mtmp), an(xname(otmp)));
}
gm.m_using = TRUE;
if (!Blind && !resists_blnd(u.umonst)) {
if (!Blind && !resists_blnd(&gy.youmonst)) {
You("are blinded by the flash of light!");
make_blinded(BlindedTimeout + (long) rnd(1 + 50), FALSE);
}
@@ -2857,7 +2857,7 @@ ureflects(const char *fmt, const char *str)
if (fmt && str)
pline(fmt, str, uskin ? "luster" : "armor");
return TRUE;
} else if (u.umonst->data == &mons[PM_SILVER_DRAGON]) {
} else if (gy.youmonst.data == &mons[PM_SILVER_DRAGON]) {
if (fmt && str)
pline(fmt, str, "scales");
return TRUE;
+7 -7
View File
@@ -165,7 +165,7 @@ awaken_soldiers(struct monst *bugler /* monster that played instrument */)
int distance, distm;
/* distance of affected non-soldier monsters to bugler */
distance = ((bugler == u.umonst) ? u.ulevel
distance = ((bugler == &gy.youmonst) ? u.ulevel
: bugler->data->mlevel) * 30;
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
@@ -182,7 +182,7 @@ awaken_soldiers(struct monst *bugler /* monster that played instrument */)
else if (!Deaf)
Norep("%s the rattle of battle gear being readied.",
"You hear"); /* Deaf-aware */
} else if ((distm = ((bugler == u.umonst)
} else if ((distm = ((bugler == &gy.youmonst)
? mdistu(mtmp)
: dist2(bugler->mx, bugler->my, mtmp->mx,
mtmp->my))) < distance) {
@@ -301,7 +301,7 @@ do_pit(coordxy x, coordxy y, unsigned tu_pit)
Your("chain breaks!");
reset_utrap(TRUE);
}
if (Levitation || Flying || is_clinger(u.umonst->data)) {
if (Levitation || Flying || is_clinger(gy.youmonst.data)) {
if (!tu_pit) { /* no pit here previously */
pline("A chasm opens up under you!");
You("don't fall in!");
@@ -327,8 +327,8 @@ do_pit(coordxy x, coordxy y, unsigned tu_pit)
if (keepfooting)
exercise(A_DEX, TRUE);
else
selftouch((Upolyd && (slithy(u.umonst->data)
|| nolimbs(u.umonst->data)))
selftouch((Upolyd && (slithy(gy.youmonst.data)
|| nolimbs(gy.youmonst.data)))
? "Shaken, you"
: "Falling down, you");
}
@@ -653,7 +653,7 @@ do_improvisation(struct obj *instr)
else
You("blow into the bugle.");
Hero_playnotes(obj_to_instr(&itmp), improvisation, 80);
awaken_soldiers(u.umonst);
awaken_soldiers(&gy.youmonst);
exercise(A_WIS, FALSE);
break;
case MAGIC_HARP: /* Charm monsters */
@@ -769,7 +769,7 @@ do_play_instrument(struct obj *instr)
} else if ((instr->otyp == WOODEN_FLUTE || instr->otyp == MAGIC_FLUTE
|| instr->otyp == TOOLED_HORN || instr->otyp == FROST_HORN
|| instr->otyp == FIRE_HORN || instr->otyp == BUGLE)
&& !can_blow(u.umonst)) {
&& !can_blow(&gy.youmonst)) {
You("are incapable of playing %s.", thesimpleoname(instr));
return ECMD_OK;
}
+4 -4
View File
@@ -121,7 +121,7 @@ self_lookat(char *outbuf)
Sprintf(eos(outbuf), ", mounted on %s", y_monnam(u.usteed));
if (u.uundetected || (Upolyd && U_AP_TYPE)
|| visible_region_at(u.ux, u.uy))
mhidden_description(u.umonst,
mhidden_description(&gy.youmonst,
MHID_PREFIX | MHID_ARTICLE | MHID_REGION,
eos(outbuf));
if (Punished)
@@ -196,7 +196,7 @@ mhidden_description(
incl_article = (mhid_flags & MHID_ARTICLE) != 0,
show_altmon = (mhid_flags & MHID_ALTMON) != 0,
force_region = (mhid_flags & MHID_REGION) != 0;
boolean fakeobj, isyou = (mon == u.umonst);
boolean fakeobj, isyou = (mon == &gy.youmonst);
coordxy x = isyou ? u.ux : mon->mx, y = isyou ? u.uy : mon->my;
int glyph = (svl.level.flags.hero_memory && !isyou) ? levl[x][y].glyph
: glyph_at(x, y);
@@ -446,7 +446,7 @@ look_at_monster(
Strcat(buf, digests(mtmp->data) ? ", swallowing you"
: ", engulfing you");
else
Strcat(buf, (Upolyd && sticks(u.umonst->data))
Strcat(buf, (Upolyd && sticks(gy.youmonst.data))
? ", being held" : ", holding you");
}
/* if mtmp isn't able to move (other than because it is a type of
@@ -1167,7 +1167,7 @@ add_cmap_descr(
/* grab a scratch buffer we can safely return (via *firstmatch
when applicable) */
mbuf = mon_nam(u.umonst);
mbuf = mon_nam(&gy.youmonst);
if (absidx == S_pool) {
levl[cc.x][cc.y].typ = (idx == S_pool) ? POOL : MOAT;
+15 -15
View File
@@ -287,7 +287,7 @@ fatal_corpse_mistake(struct obj *obj, boolean remotely)
if (u_safe_from_fatal_corpse(obj, st_all) || remotely)
return FALSE;
if (poly_when_stoned(u.umonst->data) && polymon(PM_STONE_GOLEM)) {
if (poly_when_stoned(gy.youmonst.data) && polymon(PM_STONE_GOLEM)) {
display_nhwindow(WIN_MESSAGE, FALSE); /* --More-- */
return FALSE;
}
@@ -723,9 +723,9 @@ pickup(int what) /* should be a long */
*/
if ((gm.multi && !svc.context.run)
|| (autopickup && !flags.pickup)
|| notake(u.umonst->data)) {
|| notake(gy.youmonst.data)) {
check_here(FALSE);
if (notake(u.umonst->data) && OBJ_AT(u.ux, u.uy)
if (notake(gy.youmonst.data) && OBJ_AT(u.ux, u.uy)
&& (autopickup || flags.pickup))
You("are physically incapable of picking anything up.");
return 0;
@@ -892,8 +892,8 @@ pickup(int what) /* should be a long */
}
if (!u.uswallow) {
if (hides_under(u.umonst->data))
(void) hideunder(u.umonst);
if (hides_under(gy.youmonst.data))
(void) hideunder(&gy.youmonst);
/* position may need updating (invisible hero) */
if (n_picked)
@@ -1155,7 +1155,7 @@ query_objlist(const char *qstr, /* query string */
fake_hero_object = cg.zeroobj;
fake_hero_object.quan = 1L; /* not strictly necessary... */
any.a_obj = &fake_hero_object;
tmpglyph = mon_to_glyph(u.umonst, rn2_on_display_rng);
tmpglyph = mon_to_glyph(&gy.youmonst, rn2_on_display_rng);
map_glyphinfo(0, 0, tmpglyph, 0U, &tmpglyphinfo);
add_menu(win, &tmpglyphinfo, &any,
/* fake inventory letter, no group accelerator */
@@ -1719,7 +1719,7 @@ lift_object(
and for boulder picked up by hero poly'd into a giant; override
availability of open inventory slot iff not already carrying one */
if (obj->otyp == LOADSTONE
|| (obj->otyp == BOULDER && throws_rocks(u.umonst->data))) {
|| (obj->otyp == BOULDER && throws_rocks(gy.youmonst.data))) {
if (inv_cnt(FALSE) < invlet_basic || !carrying(obj->otyp)
|| merge_choice(gi.invent, obj))
return 1; /* lift regardless of current situation */
@@ -1823,7 +1823,7 @@ pickup_object(
&& engulfing_u(obj->ocarry)) {
You_cant("pick %s up.", ysimple_name(obj));
return 0;
} else if (obj->oartifact && !touch_artifact(obj, u.umonst)) {
} else if (obj->oartifact && !touch_artifact(obj, &gy.youmonst)) {
return 0;
} else if (obj->otyp == CORPSE) {
if (fatal_corpse_mistake(obj, telekinesis)
@@ -1989,7 +1989,7 @@ encumber_msg(void)
break;
case 3:
You("%s under your heavy load. Movement is very hard.",
stagger(u.umonst->data, "stagger"));
stagger(gy.youmonst.data, "stagger"));
break;
default:
You("%s move a handspan with this load!",
@@ -2010,7 +2010,7 @@ encumber_msg(void)
break;
case 3:
You("%s under your load. Movement is still very hard.",
stagger(u.umonst->data, "stagger"));
stagger(gy.youmonst.data, "stagger"));
break;
}
disp.botl = TRUE;
@@ -2057,7 +2057,7 @@ able_to_loot(
You("cannot %s things that are deep in the %s.", verb,
hliquid(is_lava(x, y) ? "lava" : "water"));
return FALSE;
} else if (nolimbs(u.umonst->data)) {
} else if (nolimbs(gy.youmonst.data)) {
pline("Without limbs, you cannot %s anything.", verb);
return FALSE;
} else if (looting && !freehand()) {
@@ -2195,7 +2195,7 @@ doloot_core(void)
/* "Can't do that while carrying so much stuff." */
return ECMD_OK;
}
if (nohands(u.umonst->data)) {
if (nohands(gy.youmonst.data)) {
You("have no hands!"); /* not `body_part(HAND)' */
return ECMD_OK;
}
@@ -2446,7 +2446,7 @@ loot_mon(struct monst *mtmp, int *passed_info, boolean *prev_loot)
x_monnam(mtmp, ARTICLE_THE, (char *) 0,
SUPPRESS_SADDLE, FALSE));
if ((c = yn_function(qbuf, ynqchars, 'n', TRUE)) == 'y') {
if (nolimbs(u.umonst->data)) {
if (nolimbs(gy.youmonst.data)) {
You_cant("do that without limbs."); /* not body_part(HAND) */
return 0;
}
@@ -2738,7 +2738,7 @@ out_container(struct obj *obj)
obj->owt = weight(obj);
}
if (obj->oartifact && !touch_artifact(obj, u.umonst))
if (obj->oartifact && !touch_artifact(obj, &gy.youmonst))
return 0;
if (fatal_corpse_mistake(obj, FALSE))
@@ -2942,7 +2942,7 @@ explain_container_prompt(boolean more_containers)
boolean
u_handsy(void)
{
if (nohands(u.umonst->data)) {
if (nohands(gy.youmonst.data)) {
You("have no hands!"); /* not `body_part(HAND)' */
return FALSE;
} else if (!freehand()) {
+1 -1
View File
@@ -139,7 +139,7 @@ pline_mon(struct monst *mtmp, const char *line, ...)
{
va_list the_args;
if (mtmp == u.umonst)
if (mtmp == &gy.youmonst)
set_msg_xy(0, 0);
else
set_msg_xy(mtmp->mx, mtmp->my);
+85 -85
View File
@@ -5,8 +5,8 @@
/*
* Polymorph self routine.
*
* Note: the light source handling code assumes that u.umonst->m_id
* always remains 1 and u.umonst->mx will always remain 0 when it handles
* Note: the light source handling code assumes that gy.youmonst.m_id
* always remains 1 and gy.youmonst.mx will always remain 0 when it handles
* the case of the player polymorphed into a light-emitting monster.
*
* Transformation sequences:
@@ -33,24 +33,24 @@ staticfn void polysense(void);
static const char no_longer_petrify_resistant[] =
"No longer petrify-resistant, you";
/* update the u.umonst->data structure pointer and intrinsics */
/* update the gy.youmonst.data structure pointer and intrinsics */
void
set_uasmon(void)
{
struct permonst *mdat = &mons[u.umonnum];
boolean was_vampshifter = valid_vampshiftform(u.umonst->cham, u.umonnum);
boolean was_vampshifter = valid_vampshiftform(gy.youmonst.cham, u.umonnum);
set_mon_data(u.umonst, mdat);
u.umonst->m_id = 1;
set_mon_data(&gy.youmonst, mdat);
gy.youmonst.m_id = 1;
if (Protection_from_shape_changers)
u.umonst->cham = NON_PM;
else if (is_vampire(u.umonst->data))
u.umonst->cham = u.umonst->mnum;
gy.youmonst.cham = NON_PM;
else if (is_vampire(gy.youmonst.data))
gy.youmonst.cham = gy.youmonst.mnum;
/* assume hero-as-chameleon/doppelganger/sandestin doesn't change shape */
else if (!was_vampshifter)
u.umonst->cham = NON_PM;
u.mcham = u.umonst->cham; /* for save/restore since u.umonst isn't */
gy.youmonst.cham = NON_PM;
u.mcham = gy.youmonst.cham; /* for save/restore since youmonst isn't */
#define PROPSET(PropIndx, ON) \
do { \
@@ -59,7 +59,7 @@ set_uasmon(void)
else \
u.uprops[PropIndx].intrinsic &= ~FROMFORM; \
} while (0)
#define resist_from_form(MRtyp) ((u.umonst->data->mresists & (MRtyp)) != 0)
#define resist_from_form(MRtyp) ((gy.youmonst.data->mresists & (MRtyp)) != 0)
PROPSET(FIRE_RES, resist_from_form(MR_FIRE));
PROPSET(COLD_RES, resist_from_form( MR_COLD));
@@ -74,7 +74,7 @@ set_uasmon(void)
struct obj *save_uwep = uwep;
uwep = 0;
PROPSET(DRAIN_RES, resists_drli(u.umonst));
PROPSET(DRAIN_RES, resists_drli(&gy.youmonst));
uwep = save_uwep;
}
/* resists_magm() takes wielded, worn, and carried equipment into
@@ -174,7 +174,7 @@ check_strangling(boolean on)
/* when Strangled is already set, polymorphing from one
vulnerable form into another causes the counter to be reset */
if (uamul && uamul->otyp == AMULET_OF_STRANGULATION
&& can_be_strangled(u.umonst)) {
&& can_be_strangled(&gy.youmonst)) {
Strangled = 6L;
disp.botl = TRUE;
Your("%s %s your %s!", simpleonames(uamul),
@@ -185,7 +185,7 @@ check_strangling(boolean on)
/* off -- maybe block strangling */
} else {
if (Strangled && !can_be_strangled(u.umonst)) {
if (Strangled && !can_be_strangled(&gy.youmonst)) {
Strangled = 0L;
disp.botl = TRUE;
You("are no longer being strangled.");
@@ -199,7 +199,7 @@ DISABLE_WARNING_FORMAT_NONLITERAL
staticfn void
polyman(const char *fmt, const char *arg)
{
boolean sticking = (sticks(u.umonst->data) && u.ustuck && !u.uswallow),
boolean sticking = (sticks(gy.youmonst.data) && u.ustuck && !u.uswallow),
was_mimicking = (U_AP_TYPE != M_AP_NOTHING);
boolean was_blind = !!Blind,
had_see_invis = !!See_invisible;
@@ -223,8 +223,8 @@ polyman(const char *fmt, const char *arg)
if (was_mimicking) {
if (gm.multi < 0)
unmul("");
u.umonst->m_ap_type = M_AP_NOTHING;
u.umonst->mappearance = 0;
gy.youmonst.m_ap_type = M_AP_NOTHING;
gy.youmonst.mappearance = 0;
}
newsym(u.ux, u.uy);
@@ -249,7 +249,7 @@ polyman(const char *fmt, const char *arg)
if (!!See_invisible ^ had_see_invis)
set_mimic_blocking(); /* See_invisible just toggled */
if (u.twoweap && !could_twoweap(u.umonst->data))
if (u.twoweap && !could_twoweap(gy.youmonst.data))
untwoweapon();
if (u.utrap && u.utraptype == TT_PIT) {
@@ -279,8 +279,8 @@ change_sex(void)
* may be true for certain roles
*/
if (!Upolyd
|| (!is_male(u.umonst->data) && !is_female(u.umonst->data)
&& !is_neuter(u.umonst->data)))
|| (!is_male(gy.youmonst.data) && !is_female(gy.youmonst.data)
&& !is_neuter(gy.youmonst.data)))
flags.female = !flags.female;
if (Upolyd) /* poly'd: also change saved sex */
u.mfemale = !u.mfemale;
@@ -476,8 +476,8 @@ polyself(int psflags)
formrevert = ((psflags & POLY_REVERT) != 0),
draconian = (uarm && Is_dragon_armor(uarm)),
iswere = (ismnum(u.ulycn)),
isvamp = (is_vampire(u.umonst->data)
|| is_vampshifter(u.umonst)),
isvamp = (is_vampire(gy.youmonst.data)
|| is_vampshifter(&gy.youmonst)),
controllable_poly = Polymorph_control && !(Stunned || Unaware);
if (Unchanging) {
@@ -494,11 +494,11 @@ polyself(int psflags)
return;
}
}
old_light = emits_light(u.umonst->data);
old_light = emits_light(gy.youmonst.data);
mntmp = NON_PM;
if (formrevert) {
mntmp = u.umonst->cham;
mntmp = gy.youmonst.cham;
monsterpoly = TRUE;
controllable_poly = FALSE;
}
@@ -670,13 +670,13 @@ polyself(int psflags)
} else if (isvamp) {
do_vampyr:
if (mntmp < LOW_PM || (mons[mntmp].geno & G_UNIQ)) {
mntmp = (u.umonst->data == &mons[PM_VAMPIRE_LEADER]
mntmp = (gy.youmonst.data == &mons[PM_VAMPIRE_LEADER]
&& !rn2(10)) ? PM_WOLF
: !rn2(4) ? PM_FOG_CLOUD
: PM_VAMPIRE_BAT;
if (ismnum(u.umonst->cham)
&& !is_vampire(u.umonst->data) && !rn2(2))
mntmp = u.umonst->cham;
if (ismnum(gy.youmonst.cham)
&& !is_vampire(gy.youmonst.data) && !rn2(2))
mntmp = gy.youmonst.cham;
}
if (controllable_poly) {
Sprintf(buf, "Become %s?",
@@ -718,15 +718,15 @@ polyself(int psflags)
gs.sex_change_ok--; /* reset */
made_change:
new_light = emits_light(u.umonst->data);
new_light = emits_light(gy.youmonst.data);
if (old_light != new_light) {
if (old_light)
del_light_source(LS_MONSTER, monst_to_any(u.umonst));
del_light_source(LS_MONSTER, monst_to_any(&gy.youmonst));
if (new_light == 1)
++new_light; /* otherwise it's undetectable */
if (new_light)
new_light_source(u.ux, u.uy, new_light, LS_MONSTER,
monst_to_any(u.umonst));
monst_to_any(&gy.youmonst));
}
}
@@ -735,9 +735,9 @@ int
polymon(int mntmp)
{
char buf[BUFSZ], ustuckNam[BUFSZ];
boolean sticking = sticks(u.umonst->data) && u.ustuck && !u.uswallow,
boolean sticking = sticks(gy.youmonst.data) && u.ustuck && !u.uswallow,
was_blind = !!Blind, dochange = FALSE, was_expelled = FALSE,
was_hiding_under = u.uundetected && hides_under(u.umonst->data);
was_hiding_under = u.uundetected && hides_under(gy.youmonst.data);
int mlvl, newMaxStr;
if (svm.mvitals[mntmp].mvflags & G_GENOD) { /* allow G_EXTINCT */
@@ -774,13 +774,13 @@ polymon(int mntmp)
/* if stuck mimicking gold, stop immediately */
if (gm.multi < 0 && U_AP_TYPE == M_AP_OBJECT
&& u.umonst->data->mlet != S_MIMIC)
&& gy.youmonst.data->mlet != S_MIMIC)
unmul("");
/* if becoming a non-mimic, stop mimicking anything */
if (mons[mntmp].mlet != S_MIMIC) {
/* as in polyman() */
u.umonst->m_ap_type = M_AP_NOTHING;
u.umonst->mappearance = 0;
gy.youmonst.m_ap_type = M_AP_NOTHING;
gy.youmonst.mappearance = 0;
}
if (is_male(&mons[mntmp])) {
if (flags.female)
@@ -840,7 +840,7 @@ polymon(int mntmp)
You("no longer feel sick.");
}
if (Slimed) {
if (flaming(u.umonst->data)) {
if (flaming(gy.youmonst.data)) {
make_slimed(0L, "The slime burns away!");
} else if (mntmp == PM_GREEN_SLIME) {
/* do it silently */
@@ -848,7 +848,7 @@ polymon(int mntmp)
}
}
check_strangling(FALSE); /* maybe stop strangling */
if (nohands(u.umonst->data))
if (nohands(gy.youmonst.data))
make_glib(0);
/*
@@ -857,9 +857,9 @@ polymon(int mntmp)
* "experience level of you as a monster" for a polymorphed character.
*/
mlvl = (int) mons[mntmp].mlevel;
if (u.umonst->data->mlet == S_DRAGON && mntmp >= PM_GRAY_DRAGON) {
if (gy.youmonst.data->mlet == S_DRAGON && mntmp >= PM_GRAY_DRAGON) {
u.mhmax = In_endgame(&u.uz) ? (8 * mlvl) : (4 * mlvl + d(mlvl, 4));
} else if (is_golem(u.umonst->data)) {
} else if (is_golem(gy.youmonst.data)) {
u.mhmax = golemhp(mntmp);
} else {
if (!mlvl)
@@ -891,7 +891,7 @@ polymon(int mntmp)
/* if hiding under something and can't hide anymore, unhide now;
but don't auto-hide when not already hiding-under */
if (was_hiding_under)
(void) hideunder(u.umonst);
(void) hideunder(&gy.youmonst);
if (u.utrap && u.utraptype == TT_PIT) {
set_utrap(rn1(6, 2), TT_PIT); /* time to escape resets */
@@ -904,7 +904,7 @@ polymon(int mntmp)
/* you now know what an egg of your type looks like; [moved from
below in case expels() -> spoteffects() drops hero onto any eggs] */
if (lays_eggs(u.umonst->data)) {
if (lays_eggs(gy.youmonst.data)) {
learn_egg_type(u.umonnum);
/* make queen bees recognize killer bee eggs */
learn_egg_type(egg_type_from_parent(u.umonnum, TRUE));
@@ -914,13 +914,13 @@ polymon(int mntmp)
uchar usiz;
/* if new form can't be swallowed, make engulfer expel hero */
if (unsolid(u.umonst->data)
if (unsolid(gy.youmonst.data)
/* subset of engulf_target() */
|| (usiz = u.umonst->data->msize) >= MZ_HUGE
|| (usiz = gy.youmonst.data->msize) >= MZ_HUGE
|| (u.ustuck->data->msize < usiz && !is_whirly(u.ustuck->data))) {
boolean expels_mesg = TRUE;
if (unsolid(u.umonst->data)) {
if (unsolid(gy.youmonst.data)) {
if (canspotmon(u.ustuck)) /* [see below for explanation] */
Strcpy(ustuckNam, Monnam(u.ustuck));
pline("%s can no longer contain you.", ustuckNam);
@@ -939,7 +939,7 @@ polymon(int mntmp)
/* being held; if now capable of holding, make holder
release so that hero doesn't automagically start holding
it; or, release if no longer capable of being held */
&& (sticks(u.umonst->data) || unsolid(u.umonst->data))) {
&& (sticks(gy.youmonst.data) || unsolid(gy.youmonst.data))) {
/* u.ustuck name was saved above in case we're changing from can-see
to can't-see; but might have changed from can't-see to can-see so
override here if hero knows who u.ustuck is */
@@ -947,7 +947,7 @@ polymon(int mntmp)
Strcpy(ustuckNam, Monnam(u.ustuck));
set_ustuck((struct monst *) 0);
pline("%s loses its grip on you.", ustuckNam);
} else if (sticking && !sticks(u.umonst->data)) {
} else if (sticking && !sticks(gy.youmonst.data)) {
/* was holding onto u.ustuck but no longer capable of that */
uunstick();
}
@@ -982,13 +982,13 @@ polymon(int mntmp)
buried_ball_to_freedom();
}
reset_utrap(TRUE);
} else if (likes_lava(u.umonst->data) && u.utrap
} else if (likes_lava(gy.youmonst.data) && u.utrap
&& u.utraptype == TT_LAVA) {
pline_The("%s now feels soothing.", hliquid("lava"));
reset_utrap(TRUE);
}
if (amorphous(u.umonst->data) || is_whirly(u.umonst->data)
|| unsolid(u.umonst->data)) {
if (amorphous(gy.youmonst.data) || is_whirly(gy.youmonst.data)
|| unsolid(gy.youmonst.data)) {
if (Punished) {
You("slip out of the iron chain.");
unpunish();
@@ -998,16 +998,16 @@ polymon(int mntmp)
}
}
if (u.utrap && (u.utraptype == TT_WEB || u.utraptype == TT_BEARTRAP)
&& (amorphous(u.umonst->data) || is_whirly(u.umonst->data)
|| unsolid(u.umonst->data)
|| (u.umonst->data->msize <= MZ_SMALL
&& (amorphous(gy.youmonst.data) || is_whirly(gy.youmonst.data)
|| unsolid(gy.youmonst.data)
|| (gy.youmonst.data->msize <= MZ_SMALL
&& u.utraptype == TT_BEARTRAP))) {
You("are no longer stuck in the %s.",
u.utraptype == TT_WEB ? "web" : "bear trap");
/* probably should burn webs too if PM_FIRE_ELEMENTAL */
reset_utrap(TRUE);
}
if (webmaker(u.umonst->data) && u.utrap && u.utraptype == TT_WEB) {
if (webmaker(gy.youmonst.data) && u.utrap && u.utraptype == TT_WEB) {
You("orient yourself on the web.");
reset_utrap(TRUE);
}
@@ -1031,7 +1031,7 @@ polymon(int mntmp)
if (flags.verbose) {
static const char use_thec[] = "Use the command #%s to %s.";
static const char monsterc[] = "monster";
struct permonst *uptr = u.umonst->data;
struct permonst *uptr = gy.youmonst.data;
boolean might_hide = (is_hider(uptr) || hides_under(uptr));
if (can_breathe(uptr))
@@ -1058,7 +1058,7 @@ polymon(int mntmp)
pline(use_thec, monsterc, "emit a mental blast");
if (uptr->msound == MS_SHRIEK) /* worthless, actually */
pline(use_thec, monsterc, "shriek");
if (is_vampire(uptr) || is_vampshifter(u.umonst))
if (is_vampire(uptr) || is_vampshifter(&gy.youmonst))
pline(use_thec, monsterc, "change shape");
if (lays_eggs(uptr) && flags.female
@@ -1157,7 +1157,7 @@ staticfn void
break_armor(void)
{
struct obj *otmp;
struct permonst *uptr = u.umonst->data;
struct permonst *uptr = gy.youmonst.data;
if (breakarm(uptr)) {
if ((otmp = uarm) != 0) {
@@ -1196,7 +1196,7 @@ break_armor(void)
useup(uarmu);
}
} else if (sliparm(uptr)) {
if ((otmp = uarm) != 0 && racial_exception(u.umonst, otmp) < 1) {
if ((otmp = uarm) != 0 && racial_exception(&gy.youmonst, otmp) < 1) {
if (donning(otmp))
cancel_don();
Your("armor falls around you!");
@@ -1313,7 +1313,7 @@ drop_weapon(int alone)
* future it might not be so if there are monsters which cannot
* wear gloves but can wield weapons
*/
if (!alone || cantwield(u.umonst->data)) {
if (!alone || cantwield(gy.youmonst.data)) {
candropwep = canletgo(uwep, "");
candropswapwep = !u.twoweap || canletgo(uswapwep, "");
if (alone) {
@@ -1355,7 +1355,7 @@ drop_weapon(int alone)
if (updateinv)
update_inventory();
} else if (!could_twoweap(u.umonst->data)) {
} else if (!could_twoweap(gy.youmonst.data)) {
untwoweapon();
}
}
@@ -1390,8 +1390,8 @@ rehumanize(void)
* reverts to human rather than to vampire.
*/
if (emits_light(u.umonst->data))
del_light_source(LS_MONSTER, monst_to_any(u.umonst));
if (emits_light(gy.youmonst.data))
del_light_source(LS_MONSTER, monst_to_any(&gy.youmonst));
polyman("You return to %s form!", gu.urace.adj);
if (u.uhp < 1) {
@@ -1436,7 +1436,7 @@ dobreathe(void)
if (!getdir((char *) 0))
return ECMD_CANCEL;
mattk = attacktype_fordmg(u.umonst->data, AT_BREA, AD_ANY);
mattk = attacktype_fordmg(gy.youmonst.data, AT_BREA, AD_ANY);
if (!mattk)
impossible("bad breath attack?"); /* mouthwash needed... */
else if (!u.dx && !u.dy && !u.dz)
@@ -1454,7 +1454,7 @@ dospit(void)
if (!getdir((char *) 0))
return ECMD_CANCEL;
mattk = attacktype_fordmg(u.umonst->data, AT_SPIT, AD_ANY);
mattk = attacktype_fordmg(gy.youmonst.data, AT_SPIT, AD_ANY);
if (!mattk) {
impossible("bad spit attack?");
} else {
@@ -1633,7 +1633,7 @@ dosummon(void)
You("call upon your brethren for help!");
exercise(A_WIS, TRUE);
if (!were_summon(u.umonst->data, TRUE, &placeholder, (char *) 0))
if (!were_summon(gy.youmonst.data, TRUE, &placeholder, (char *) 0))
pline("But none arrive.");
return ECMD_TIME;
}
@@ -1648,8 +1648,8 @@ dogaze(void)
uchar adtyp = 0;
for (i = 0; i < NATTK; i++) {
if (u.umonst->data->mattk[i].aatyp == AT_GAZE) {
adtyp = u.umonst->data->mattk[i].adtyp;
if (gy.youmonst.data->mattk[i].aatyp == AT_GAZE) {
adtyp = gy.youmonst.data->mattk[i].adtyp;
break;
}
}
@@ -1776,8 +1776,8 @@ dogaze(void)
int
dohide(void)
{
boolean ismimic = u.umonst->data->mlet == S_MIMIC,
on_ceiling = is_clinger(u.umonst->data) || Flying;
boolean ismimic = gy.youmonst.data->mlet == S_MIMIC,
on_ceiling = is_clinger(gy.youmonst.data) || Flying;
/* can't hide while being held (or holding) or while trapped
(except for floor hiders [trapper or mimic] in pits) */
@@ -1786,19 +1786,19 @@ dohide(void)
!u.ustuck ? "trapped"
: u.uswallow ? (digests(u.ustuck->data) ? "swallowed"
: "engulfed")
: !sticks(u.umonst->data) ? "being held"
: !sticks(gy.youmonst.data) ? "being held"
: (humanoid(u.ustuck->data) ? "holding someone"
: "holding that creature"));
if (u.uundetected || (ismimic && U_AP_TYPE != M_AP_NOTHING)) {
u.uundetected = 0;
u.umonst->m_ap_type = M_AP_NOTHING;
gy.youmonst.m_ap_type = M_AP_NOTHING;
newsym(u.ux, u.uy);
}
return ECMD_OK;
}
/* note: hero-as-eel handling is incomplete but unnecessary;
such critters aren't offered the option of hiding via #monster */
if (u.umonst->data->mlet == S_EEL && !is_pool(u.ux, u.uy)) {
if (gy.youmonst.data->mlet == S_EEL && !is_pool(u.ux, u.uy)) {
if (IS_FOUNTAIN(levl[u.ux][u.uy].typ))
pline_The("fountain is not deep enough to hide in.");
else
@@ -1806,7 +1806,7 @@ dohide(void)
u.uundetected = 0;
return ECMD_OK;
}
if (hides_under(u.umonst->data)) {
if (hides_under(gy.youmonst.data)) {
long ct = 0L;
struct obj *otmp, *otop = svl.level.objects[u.ux][u.uy];
@@ -1847,7 +1847,7 @@ dohide(void)
u.uundetected = 0;
return ECMD_OK;
}
if ((is_hider(u.umonst->data) && !Flying) /* floor hider */
if ((is_hider(gy.youmonst.data) && !Flying) /* floor hider */
&& (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz))) {
There("is nowhere to hide beneath you.");
u.uundetected = 0;
@@ -1864,8 +1864,8 @@ dohide(void)
if (ismimic) {
/* should bring up a dialog "what would you like to imitate?" */
u.umonst->m_ap_type = M_AP_OBJECT;
u.umonst->mappearance = STRANGE_OBJECT;
gy.youmonst.m_ap_type = M_AP_OBJECT;
gy.youmonst.mappearance = STRANGE_OBJECT;
} else
u.uundetected = 1;
newsym(u.ux, u.uy);
@@ -1876,13 +1876,13 @@ dohide(void)
int
dopoly(void)
{
struct permonst *savedat = u.umonst->data;
struct permonst *savedat = gy.youmonst.data;
if (is_vampire(u.umonst->data) || is_vampshifter(u.umonst)) {
if (is_vampire(gy.youmonst.data) || is_vampshifter(&gy.youmonst)) {
polyself(POLY_MONSTER);
if (savedat != u.umonst->data) {
if (savedat != gy.youmonst.data) {
You("transform into %s.",
an(pmname(u.umonst->data, Ugender)));
an(pmname(gy.youmonst.data, Ugender)));
newsym(u.ux, u.uy);
}
}
@@ -2142,7 +2142,7 @@ mbodypart(struct monst *mon, int part)
const char *
body_part(int part)
{
return mbodypart(u.umonst, part);
return mbodypart(&gy.youmonst, part);
}
int
@@ -2151,7 +2151,7 @@ poly_gender(void)
/* Returns gender of polymorphed player;
* 0/1=same meaning as flags.female, 2=none.
*/
if (is_neuter(u.umonst->data) || !humanoid(u.umonst->data))
if (is_neuter(gy.youmonst.data) || !humanoid(gy.youmonst.data))
return 2;
return flags.female;
}
@@ -2276,9 +2276,9 @@ udeadinside(void)
seems silly when you're polymorphed into something undead;
monkilled() distinguishes between living (killed) and non (destroyed)
for monster death message; we refine the nonliving aspect a bit */
return !nonliving(u.umonst->data)
return !nonliving(gy.youmonst.data)
? "dead" /* living, including demons */
: !weirdnonliving(u.umonst->data)
: !weirdnonliving(gy.youmonst.data)
? "condemned" /* undead plus manes */
: "empty"; /* golems plus vortices */
}
+24 -24
View File
@@ -121,7 +121,7 @@ make_stunned(long xtime, boolean talk)
if (u.usteed)
You("wobble in the saddle.");
else
You("%s...", stagger(u.umonst->data, "stagger"));
You("%s...", stagger(gy.youmonst.data, "stagger"));
}
}
if ((!xtime && old) || (xtime && !old))
@@ -210,9 +210,9 @@ make_slimed(long xtime, const char *msg)
dealloc_killer(find_delayed_killer(SLIMED));
/* fake appearance is set late in turn-to-slime countdown */
if (U_AP_TYPE == M_AP_MONSTER
&& u.umonst->mappearance == PM_GREEN_SLIME) {
u.umonst->m_ap_type = M_AP_NOTHING;
u.umonst->mappearance = 0;
&& gy.youmonst.mappearance == PM_GREEN_SLIME) {
gy.youmonst.m_ap_type = M_AP_NOTHING;
gy.youmonst.mappearance = 0;
}
}
}
@@ -284,11 +284,11 @@ make_blinded(long xtime, boolean talk)
} else if (old && !xtime) {
/* clearing temporary blindness without toggling blindness */
if (talk) {
if (!haseyes(u.umonst->data) || PermaBlind) {
if (!haseyes(gy.youmonst.data) || PermaBlind) {
strange_feeling((struct obj *) 0, (char *) 0);
} else if (Blindfolded) {
eyes = body_part(EYE);
if (eyecount(u.umonst->data) != 1)
if (eyecount(gy.youmonst.data) != 1)
eyes = makeplural(eyes);
Your(eyemsg, eyes, vtense(eyes, "itch"));
} else { /* Eyes of the Overworld */
@@ -310,11 +310,11 @@ make_blinded(long xtime, boolean talk)
} else if (!old && xtime) {
/* setting temporary blindness without toggling blindness */
if (talk) {
if (!haseyes(u.umonst->data) || PermaBlind) {
if (!haseyes(gy.youmonst.data) || PermaBlind) {
strange_feeling((struct obj *) 0, (char *) 0);
} else if (Blindfolded) {
eyes = body_part(EYE);
if (eyecount(u.umonst->data) != 1)
if (eyecount(gy.youmonst.data) != 1)
eyes = makeplural(eyes);
Your(eyemsg, eyes, vtense(eyes, "twitch"));
} else { /* Eyes of the Overworld */
@@ -397,12 +397,12 @@ make_hallucinated(
/* clearing temporary hallucination without toggling vision */
if (!changed && !HHallucination && old && talk) {
if (!haseyes(u.umonst->data)) {
if (!haseyes(gy.youmonst.data)) {
strange_feeling((struct obj *) 0, (char *) 0);
} else if (Blind) {
const char *eyes = body_part(EYE);
if (eyecount(u.umonst->data) != 1)
if (eyecount(gy.youmonst.data) != 1)
eyes = makeplural(eyes);
Your(eyemsg, eyes, vtense(eyes, "itch"));
} else { /* Grayswandir */
@@ -723,7 +723,7 @@ peffect_water(struct obj *otmp)
return;
}
gp.potion_unkn++;
if (mon_hates_blessings(u.umonst) /* undead or demon */
if (mon_hates_blessings(&gy.youmonst) /* undead or demon */
|| u.ualign.type == A_CHAOTIC) {
if (otmp->blessed) {
pline("This burns like %s!", hliquid("acid"));
@@ -731,7 +731,7 @@ peffect_water(struct obj *otmp)
if (ismnum(u.ulycn)) {
Your("affinity to %s disappears!",
makeplural(mons[u.ulycn].pmnames[NEUTRAL]));
if (u.umonst->data == &mons[u.ulycn])
if (gy.youmonst.data == &mons[u.ulycn])
you_unwere(FALSE);
set_ulycn(NON_PM); /* cure lycanthropy */
}
@@ -1262,7 +1262,7 @@ peffect_oil(struct obj *otmp)
boolean good_for_you = FALSE, vulnerable;
if (otmp->lamplit) {
if (likes_fire(u.umonst->data)) {
if (likes_fire(gy.youmonst.data)) {
pline("Ahh, a refreshing drink.");
good_for_you = TRUE;
} else {
@@ -1620,12 +1620,12 @@ impact_arti_light(
return;
}
/* potion obj hits monster mon, which might be u.umonst; obj always used up */
/* potion obj hits monster mon, which might be youmonst; obj always used up */
void
potionhit(struct monst *mon, struct obj *obj, int how)
{
const char *botlnam = bottlename();
boolean isyou = (mon == u.umonst);
boolean isyou = (mon == &gy.youmonst);
int distance, tx, ty;
struct obj *saddle = (struct obj *) 0;
boolean hit_saddle = FALSE, your_fault = (how <= POTHIT_HERO_THROW);
@@ -1905,7 +1905,7 @@ potionhit(struct monst *mon, struct obj *obj, int how)
/* Note: potionbreathe() does its own docall() */
if ((distance == 0 || (distance < 3 && !rn2((1+ACURR(A_DEX))/2)))
&& (!breathless(u.umonst->data) || haseyes(u.umonst->data)))
&& (!breathless(gy.youmonst.data) || haseyes(gy.youmonst.data)))
potionbreathe(obj);
else if (obj->dknown && cansee(tx, ty))
trycall(obj);
@@ -1950,12 +1950,12 @@ potionbreathe(struct obj *obj)
case POT_RESTORE_ABILITY:
case POT_GAIN_ABILITY:
if (obj->cursed) {
if (!breathless(u.umonst->data)) {
if (!breathless(gy.youmonst.data)) {
pline("Ulch! That potion smells terrible!");
} else if (haseyes(u.umonst->data)) {
} else if (haseyes(gy.youmonst.data)) {
const char *eyes = body_part(EYE);
if (eyecount(u.umonst->data) != 1)
if (eyecount(gy.youmonst.data) != 1)
eyes = makeplural(eyes);
Your("%s %s!", eyes, vtense(eyes, "sting"));
}
@@ -2079,11 +2079,11 @@ potionbreathe(struct obj *obj)
break;
case POT_WATER:
if (u.umonnum == PM_GREMLIN) {
(void) split_mon(u.umonst, (struct monst *) 0);
(void) split_mon(&gy.youmonst, (struct monst *) 0);
} else if (ismnum(u.ulycn)) {
/* vapor from [un]holy water will trigger
transformation but won't cure lycanthropy */
if (obj->blessed && u.umonst->data == &mons[u.ulycn])
if (obj->blessed && gy.youmonst.data == &mons[u.ulycn])
you_unwere(FALSE);
else if (obj->cursed && !Upolyd)
you_were();
@@ -2427,7 +2427,7 @@ dip_potion_explosion(struct obj *obj, int dmg)
pline("%sThey explode!", !Deaf ? "BOOM! " : "");
wake_nearto(u.ux, u.uy, (BOLT_LIM + 1) * (BOLT_LIM + 1));
exercise(A_STR, FALSE);
if (!breathless(u.umonst->data) || haseyes(u.umonst->data))
if (!breathless(gy.youmonst.data) || haseyes(gy.youmonst.data))
potionbreathe(obj);
useupall(obj);
losehp(dmg, /* not physical damage */
@@ -2880,10 +2880,10 @@ split_mon(
reason[0] = '\0';
if (mtmp)
Sprintf(reason, " from %s heat",
(mtmp == u.umonst) ? the_your[1]
(mtmp == &gy.youmonst) ? the_your[1]
: (const char *) s_suffix(mon_nam(mtmp)));
if (mon == u.umonst) {
if (mon == &gy.youmonst) {
if (u.mh > u.mhmax) /* sanity precaution */
u.mh = u.mhmax;
mtmp2 = (u.mh > 1) ? cloneu() : (struct monst *) 0;
+15 -15
View File
@@ -173,7 +173,7 @@ stuck_in_wall(void)
if (!isok(x, y)
|| (IS_OBSTRUCTED(levl[x][y].typ)
&& (levl[x][y].typ != SDOOR && levl[x][y].typ != SCORR))
|| (blocked_boulder(i, j) && !throws_rocks(u.umonst->data)))
|| (blocked_boulder(i, j) && !throws_rocks(gy.youmonst.data)))
++count;
}
}
@@ -229,13 +229,13 @@ in_trouble(void)
|| stuck_ring(uleft, RIN_LEVITATION)
|| stuck_ring(uright, RIN_LEVITATION))
return TROUBLE_CURSED_LEVITATION;
if (nohands(u.umonst->data) || !freehand()) {
if (nohands(gy.youmonst.data) || !freehand()) {
/* for bag/box access [cf use_container()]...
make sure it's a case that we know how to handle;
otherwise "fix all troubles" would get stuck in a loop */
if (welded(uwep))
return TROUBLE_UNUSEABLE_HANDS;
if (Upolyd && nohands(u.umonst->data)
if (Upolyd && nohands(gy.youmonst.data)
&& (!Unchanging || ((otmp = unchanger()) != 0 && otmp->cursed)))
return TROUBLE_UNUSEABLE_HANDS;
}
@@ -494,7 +494,7 @@ fix_worst_trouble(int trouble)
fix_curse_trouble(otmp, what);
break;
}
if (Upolyd && nohands(u.umonst->data)) {
if (Upolyd && nohands(gy.youmonst.data)) {
if (!Unchanging) {
Your("shape becomes uncertain.");
rehumanize(); /* "You return to {normal} form." */
@@ -504,7 +504,7 @@ fix_worst_trouble(int trouble)
break;
}
}
if (nohands(u.umonst->data) || !freehand())
if (nohands(gy.youmonst.data) || !freehand())
impossible("fix_worst_trouble: couldn't cure hands.");
break;
case TROUBLE_CURSED_BLINDFOLD:
@@ -559,7 +559,7 @@ fix_worst_trouble(int trouble)
msgbuf[0] = '\0';
if (Blinded) {
if (eyecount(u.umonst->data) != 1)
if (eyecount(gy.youmonst.data) != 1)
eyes = makeplural(eyes);
Sprintf(msgbuf, "Your %s %s better", eyes, vtense(eyes, "feel"));
u.ucreamed = 0;
@@ -735,7 +735,7 @@ angrygods(aligntyp resp_god)
(ugod_is_angry() && resp_god == u.ualign.type)
? "hast strayed from the path"
: "art arrogant",
u.umonst->data->mlet == S_HUMAN ? "mortal" : "creature");
gy.youmonst.data->mlet == S_HUMAN ? "mortal" : "creature");
SetVoice((struct monst *) 0, 0, 80, voice_deity);
verbalize("Thou must relearn thy lessons!");
(void) adjattrib(A_WIS, -1, FALSE);
@@ -767,7 +767,7 @@ angrygods(aligntyp resp_god)
: "call upon");
/* [why isn't this using verbalize()?] */
pline("\"Then die, %s!\"",
(u.umonst->data->mlet == S_HUMAN) ? "mortal" : "creature");
(gy.youmonst.data->mlet == S_HUMAN) ? "mortal" : "creature");
summon_minion(resp_god, FALSE);
break;
@@ -1224,7 +1224,7 @@ pleased(aligntyp g_align)
if (u.uevent.uheard_tune < 1) {
godvoice(g_align, (char *) 0);
SetVoice((struct monst *) 0, 0, 80, voice_deity);
verbalize("Hark, %s!", is_human(u.umonst->data)
verbalize("Hark, %s!", is_human(gy.youmonst.data)
? "mortal"
: "creature");
SetVoice((struct monst *) 0, 0, 80, voice_deity);
@@ -1702,7 +1702,7 @@ sacrifice_your_race(
{
int pm;
if (is_demon(u.umonst->data)) {
if (is_demon(gy.youmonst.data)) {
You("find the idea very satisfying.");
exercise(A_WIS, TRUE);
} else if (u.ualign.type != A_CHAOTIC) {
@@ -2128,7 +2128,7 @@ can_pray(boolean praying) /* false means no messages should be given */
gp.p_aligntyp = on_altar() ? a_align(u.ux, u.uy) : u.ualign.type;
gp.p_trouble = in_trouble();
if (is_demon(u.umonst->data) /* ok if chaotic or none (Moloch) */
if (is_demon(gy.youmonst.data) /* ok if chaotic or none (Moloch) */
&& (gp.p_aligntyp == A_LAWFUL || gp.p_aligntyp != A_NEUTRAL)) {
if (praying)
pline_The("very idea of praying to a %s god is repugnant to you.",
@@ -2161,7 +2161,7 @@ can_pray(boolean praying) /* false means no messages should be given */
gp.p_type = 3;
}
if (is_undead(u.umonst->data) && !Inhell
if (is_undead(gy.youmonst.data) && !Inhell
&& (gp.p_aligntyp == A_LAWFUL
|| (gp.p_aligntyp == A_NEUTRAL && !rn2(10))))
gp.p_type = -1;
@@ -2429,7 +2429,7 @@ doturn(void)
Gname = halu_gname(u.ualign.type);
/* [What about needing free hands (does #turn involve any gesturing)?] */
if (!can_chant(u.umonst)) {
if (!can_chant(&gy.youmonst)) {
/* "evilness": "demons and undead" is too verbose and too precise */
You("are %s upon %s to turn aside evilness.",
Strangled ? "not able to call" : "incapable of calling", Gname);
@@ -2439,8 +2439,8 @@ doturn(void)
return (u.uconduct.gnostic == 1) ? ECMD_TIME : ECMD_OK;
}
if ((u.ualign.type != A_CHAOTIC
&& (is_demon(u.umonst->data)
|| is_undead(u.umonst->data) || is_vampshifter(u.umonst)))
&& (is_demon(gy.youmonst.data)
|| is_undead(gy.youmonst.data) || is_vampshifter(&gy.youmonst)))
|| u.ugangr > 6) { /* "Die, mortal!" */
pline("For some reason, %s seems to ignore you.", Gname);
aggravate();
+17 -17
View File
@@ -610,7 +610,7 @@ doread(void)
}
scroll->in_use = TRUE; /* scroll, not spellbook, now being read */
if (otyp != SCR_BLANK_PAPER) {
boolean silently = !can_chant(u.umonst);
boolean silently = !can_chant(&gy.youmonst);
/* a few scroll feedback messages describe something happening
to the scroll itself, so avoid "it disappears" for those */
@@ -1118,7 +1118,7 @@ seffect_enchant_armor(struct obj **sobjp)
schar s;
boolean special_armor;
boolean same_color;
struct obj *otmp = some_armor(u.umonst);
struct obj *otmp = some_armor(&gy.youmonst);
boolean sblessed = sobj->blessed;
boolean scursed = sobj->cursed;
boolean confused = (Confusion != 0);
@@ -1324,7 +1324,7 @@ staticfn void
seffect_destroy_armor(struct obj **sobjp)
{
struct obj *sobj = *sobjp;
struct obj *otmp = some_armor(u.umonst);
struct obj *otmp = some_armor(&gy.youmonst);
boolean scursed = sobj->cursed;
boolean confused = (Confusion != 0);
boolean old_erodeproof, new_erodeproof;
@@ -1405,7 +1405,7 @@ seffect_confuse_monster(struct obj **sobjp)
altfeedback = (Blind || Invisible);
const char *const hands = makeplural(body_part(HAND));
if (u.umonst->data->mlet != S_HUMAN || scursed) {
if (gy.youmonst.data->mlet != S_HUMAN || scursed) {
if (!HConfusion)
You_feel("confused.");
make_confused(HConfusion + rnd(100), FALSE);
@@ -2311,10 +2311,10 @@ drop_boulder_on_player(
return;
otmp2->quan = confused ? rn1(5, 2) : 1;
otmp2->owt = weight(otmp2);
if (!amorphous(u.umonst->data) && !Passes_walls
&& !noncorporeal(u.umonst->data) && !unsolid(u.umonst->data)) {
if (!amorphous(gy.youmonst.data) && !Passes_walls
&& !noncorporeal(gy.youmonst.data) && !unsolid(gy.youmonst.data)) {
You("are hit by %s!", doname(otmp2));
dmg = (int) (dmgval(otmp2, u.umonst) * otmp2->quan);
dmg = (int) (dmgval(otmp2, &gy.youmonst) * otmp2->quan);
if (uarmh && helmet_protects) {
if (hard_helmet(uarmh)) {
pline("Fortunately, you are wearing a hard helmet.");
@@ -2749,9 +2749,9 @@ do_class_genocide(void)
kill_genocided_monsters();
update_inventory(); /* eggs & tins */
pline("Wiped out all %s.", nam);
if (Upolyd && vampshifted(u.umonst)
if (Upolyd && vampshifted(&gy.youmonst)
/* current shifted form or base vampire form */
&& (i == u.umonnum || i == u.umonst->cham))
&& (i == u.umonnum || i == gy.youmonst.cham))
polyself(POLY_REVERT); /* vampshifter to vampire */
if (Upolyd && i == u.umonnum) {
u.mh = -1;
@@ -2895,8 +2895,8 @@ do_genocide(
}
ptr = &mons[mndx];
/* first revert if current shifted form or base vampire form */
if (Upolyd && vampshifted(u.umonst)
&& (mndx == u.umonnum || mndx == u.umonst->cham))
if (Upolyd && vampshifted(&gy.youmonst)
&& (mndx == u.umonnum || mndx == gy.youmonst.cham))
polyself(POLY_REVERT); /* vampshifter (bat, &c) to vampire */
/* Although "genus" is Latin for race, the hero benefits
* from both race and role; thus genocide affects either.
@@ -2926,7 +2926,7 @@ do_genocide(
continue;
}
/* KMH -- Unchanging prevents rehumanization */
if (Unchanging && ptr == u.umonst->data)
if (Unchanging && ptr == gy.youmonst.data)
killplayer++;
break;
}
@@ -2938,7 +2938,7 @@ do_genocide(
if (Hallucination) {
/* hallucinate hero's type */
if (Upolyd) {
Strcpy(buf, pmname(u.umonst->data,
Strcpy(buf, pmname(gy.youmonst.data,
flags.female ? FEMALE : MALE));
} else {
Strcpy(buf, (flags.female && gu.urole.name.f) ? gu.urole.name.f
@@ -2981,13 +2981,13 @@ do_genocide(
/* Polymorphed characters will die as soon as they're rehumanized.
KMH -- Unchanging prevents rehumanization. */
if (Upolyd && ptr != u.umonst->data) {
if (Upolyd && ptr != gy.youmonst.data) {
delayed_killer(POLYMORPH, svk.killer.format, svk.killer.name);
You_feel("%s inside.", udeadinside());
} else {
done(GENOCIDED);
}
} else if (ptr == u.umonst->data) {
} else if (ptr == gy.youmonst.data) {
rehumanize();
}
kill_genocided_monsters();
@@ -3033,8 +3033,8 @@ punish(struct obj *sobj)
uball->owt += WT_IRON_BALL_INCR * (1 + cursed_levy);
return;
}
if (amorphous(u.umonst->data) || is_whirly(u.umonst->data)
|| unsolid(u.umonst->data)) {
if (amorphous(gy.youmonst.data) || is_whirly(gy.youmonst.data)
|| unsolid(gy.youmonst.data)) {
if (!reuse_ball) {
pline("A ball and chain appears, then falls away.");
dropy(mkobj(BALL_CLASS, TRUE));
+5 -5
View File
@@ -1092,7 +1092,7 @@ inside_gas_cloud(genericptr_t p1, genericptr_t p2)
{
NhRegion *reg = (NhRegion *) p1;
struct monst *mtmp = (struct monst *) p2;
struct monst *umon = mtmp ? mtmp : u.umonst;
struct monst *umon = mtmp ? mtmp : &gy.youmonst;
int dam = reg->arg.a_int;
/*
@@ -1107,8 +1107,8 @@ inside_gas_cloud(genericptr_t p1, genericptr_t p2)
if (dam < 1)
return FALSE; /* if no damage then there's nothing to do here... */
if (!mtmp) { /* hero is indicated by Null rather than by u.umonst */
if (m_poisongas_ok(u.umonst) == M_POISONGAS_OK)
if (!mtmp) { /* hero is indicated by Null rather than by &youmonst */
if (m_poisongas_ok(&gy.youmonst) == M_POISONGAS_OK)
return FALSE;
if (!Blind) {
Your("%s sting.", makeplural(body_part(EYE)));
@@ -1232,7 +1232,7 @@ create_gas_cloud(
probably a natural cause of being polyed. don't message about it */
if (!svc.context.mon_moving && u_at(x, y) && cloudsize == 1
&& (!damage
|| (damage && m_poisongas_ok(u.umonst) == M_POISONGAS_OK)))
|| (damage && m_poisongas_ok(&gy.youmonst) == M_POISONGAS_OK)))
inside_cloud = TRUE;
if (cloudsize > MAX_CLOUD_SIZE) {
@@ -1350,7 +1350,7 @@ region_danger(void)
/* the only type of region we understand is gas_cloud */
if (f_indx == INSIDE_GAS_CLOUD) {
/* completely harmless if you don't need to breathe */
if (nonliving(u.umonst->data) || Breathless)
if (nonliving(gy.youmonst.data) || Breathless)
continue;
/* minor inconvenience if you're poison resistant;
not harmful enough to be a prayer-level trouble */
+29 -45
View File
@@ -22,7 +22,6 @@ staticfn struct fruit *loadfruitchn(NHFILE *);
staticfn void freefruitchn(struct fruit *);
staticfn void rest_levl(NHFILE *);
staticfn void rest_stairs(NHFILE *);
staticfn void rest_u(NHFILE *, boolean);
#ifndef SFCTOOL
staticfn void ghostfruit(struct obj *);
staticfn boolean restgamestate(NHFILE *);
@@ -528,11 +527,11 @@ restgamestate(NHFILE *nhfp)
int i;
struct flag newgameflags;
struct context_info newgamecontext; /* all 0, but has some pointers */
unsigned long uid = 0;
struct obj *bc_obj;
boolean restoring_special = (wizard || discover);
char timebuf[15];
unsigned long uid = 0;
#ifndef SFCTOOL
boolean defer_perm_invent;
boolean defer_perm_invent, restoring_special;
struct obj *otmp;
#endif
@@ -586,6 +585,7 @@ restgamestate(NHFILE *nhfp)
in the discover case, we don't want to set that for a normal
game until after the save file has been removed */
iflags.deferred_X = (newgameflags.explore && !discover);
restoring_special = (wizard || discover);
if (newgameflags.debug) {
/* authorized by startup code; wizard mode exists and is allowed */
wizard = TRUE, discover = iflags.deferred_X = FALSE;
@@ -598,9 +598,31 @@ restgamestate(NHFILE *nhfp)
amii_setpens(amii_numcolors); /* use colors from save file */
#endif
#endif /* !SFCTOOL */
rest_u(nhfp, restoring_special);
Sfi_you(nhfp, &u, "gamestate-you");
gy.youmonst.cham = u.mcham;
#ifndef SFCTOOL
if (restoring_special && iflags.explore_error_flag) {
/* savefile has wizard or explore mode, but player is no longer
authorized to access either; can't downgrade mode any further, so
fail restoration. */
u.uhp = 0;
}
#endif
Sfi_char(nhfp, timebuf, "gamestate-ubirthday", 14);
timebuf[14] = '\0';
ubirthday = time_from_yyyymmddhhmmss(timebuf);
Sfi_long(nhfp, &urealtime.realtime, "gamestate-realtime");
Sfi_char(nhfp, timebuf, "gamestate-start_timing", 14);
timebuf[14] = '\0';
#ifndef SFCTOOL
urealtime.start_timing = time_from_yyyymmddhhmmss(timebuf);
/* current time is the time to use for next urealtime.realtime update */
urealtime.start_timing = getnow();
set_uasmon();
#ifdef CLIPPING
cliparound(u.ux, u.uy);
#endif
@@ -618,7 +640,7 @@ restgamestate(NHFILE *nhfp)
iflags.perm_invent = defer_perm_invent;
flags = newgameflags;
svc.context = newgamecontext;
free((genericptr_t) u.umonst), u.umonst = 0;
gy.youmonst = cg.zeromonst;
return FALSE;
}
/* in case hangup save occurred in midst of level change */
@@ -643,8 +665,7 @@ restgamestate(NHFILE *nhfp)
setworn(bc_obj, bc_obj->owornmask);
bc_obj = nobj;
}
#endif /* !SFCTOOL */
#endif
gm.migrating_objs = restobjchn(nhfp, FALSE);
gm.migrating_mons = restmonchn(nhfp);
@@ -712,43 +733,6 @@ restgamestate(NHFILE *nhfp)
return TRUE;
}
void
rest_u(NHFILE *nhfp, boolean restoring_special)
{
char timebuf[15];
Sfi_you(nhfp, &u, "gamestate-you");
#ifndef SFCTOOL
if (restoring_special && iflags.explore_error_flag) {
/* savefile has wizard or explore mode, but player is no longer
authorized to access either; can't downgrade mode any further, so
fail restoration. */
u.uhp = 0;
}
#endif
Sfi_char(nhfp, timebuf, "gamestate-ubirthday", 14);
timebuf[14] = '\0';
ubirthday = time_from_yyyymmddhhmmss(timebuf);
Sfi_long(nhfp, &urealtime.realtime, "gamestate-realtime");
Sfi_char(nhfp, timebuf, "gamestate-start_timing", 14);
timebuf[14] = '\0';
#ifndef SFCTOOL
urealtime.start_timing = time_from_yyyymmddhhmmss(timebuf);
/* current time is the time to use for next urealtime.realtime update */
urealtime.start_timing = getnow();
u.umonst = newmonst();
*u.umonst = cg.zeromonst;
u.umonst->cham = u.mcham;
set_uasmon();
#else
nhUse(restoring_special);
#endif /* !SFCTOOL */
}
#ifndef SFCTOOL
/* update game state pointers to those valid for the current level (so we
don't dereference a wild u.ustuck when saving game state, for instance) */
+10 -26
View File
@@ -31,7 +31,6 @@ staticfn void save_gamelog(NHFILE *);
staticfn void savegamestate(NHFILE *);
staticfn void savelev_core(NHFILE *, xint8);
staticfn void save_msghistory(NHFILE *);
staticfn void save_u(NHFILE *);
staticfn void save_adjust_levelflags(void);
#if defined(HANGUPHANDLING)
#define HUP if (!program_state.done_hup)
@@ -262,27 +261,6 @@ save_gamelog(NHFILE *nhfp)
gg.gamelog = NULL;
}
staticfn void
save_u(NHFILE *nhfp)
{
struct monst *save_umonst;
urealtime.finish_time = getnow();
urealtime.realtime += timet_delta(urealtime.finish_time,
urealtime.start_timing);
save_umonst = u.umonst;
u.umonst = (struct monst *) 0;
Sfo_you(nhfp, &u, "gamestate-you");
u.umonst = save_umonst;
Sfo_char(nhfp, yyyymmddhhmmss(ubirthday), "gamestate-ubirthday", 14);
Sfo_long(nhfp, &urealtime.realtime, "gamestate-realtime");
Sfo_char(nhfp, yyyymmddhhmmss(urealtime.start_timing), "gamestate-start_timing", 14);
/* this is the value to use for the next update of urealtime.realtime */
urealtime.start_timing = urealtime.finish_time;
}
staticfn void
savegamestate(NHFILE *nhfp)
{
@@ -299,8 +277,17 @@ savegamestate(NHFILE *nhfp)
Sfo_context_info(nhfp, &svc.context, "gamestate-context");
relative_time_to_moves(&svc.context.seer_turn);
relative_time_to_moves(&svc.context.digging.lastdigtime);
Sfo_flag(nhfp, &flags, "gamestate-flags");
save_u(nhfp);
urealtime.finish_time = getnow();
urealtime.realtime += timet_delta(urealtime.finish_time,
urealtime.start_timing);
Sfo_you(nhfp, &u, "gamestate-you");
Sfo_char(nhfp, yyyymmddhhmmss(ubirthday), "gamestate-ubirthday", 14);
Sfo_long(nhfp, &urealtime.realtime, "gamestate-realtime");
Sfo_char(nhfp, yyyymmddhhmmss(urealtime.start_timing), "gamestate-start_timing", 14);
/* this is the value to use for the next update of urealtime.realtime */
urealtime.start_timing = urealtime.finish_time;
save_killers(nhfp);
/* must come before gm.migrating_objs and gm.migrating_mons are freed */
@@ -1186,9 +1173,6 @@ freedynamicdata(void)
if (options_set_window_colors_flag)
options_free_window_colors();
if (u.umonst)
free((genericptr_t) u.umonst), u.umonst = 0;
if (glyphid_cache_status())
free_glyphid_cache();
+5 -5
View File
@@ -3609,12 +3609,12 @@ append_honorific(char *buf)
};
Strcat(buf, honored[rn2(SIZE(honored) - 1) + u.uevent.udemigod]);
if (is_vampire(u.umonst->data))
if (is_vampire(gy.youmonst.data))
Strcat(buf, (flags.female) ? " dark lady" : " dark lord");
else if (maybe_polyd(is_elf(u.umonst->data), Race_if(PM_ELF)))
else if (maybe_polyd(is_elf(gy.youmonst.data), Race_if(PM_ELF)))
Strcat(buf, (flags.female) ? " hiril" : " hir");
else
Strcat(buf, !is_human(u.umonst->data) ? " creature"
Strcat(buf, !is_human(gy.youmonst.data) ? " creature"
: (flags.female) ? " lady"
: " sir");
}
@@ -5910,7 +5910,7 @@ cad(
{
const char *res = 0;
switch (is_demon(u.umonst->data) ? 3 : poly_gender()) {
switch (is_demon(gy.youmonst.data) ? 3 : poly_gender()) {
case 0:
res = "cad";
break;
@@ -5929,7 +5929,7 @@ cad(
break;
}
if (altusage) {
char *cadbuf = mon_nam(u.umonst); /* snag an output buffer */
char *cadbuf = mon_nam(&gy.youmonst); /* snag an output buffer */
/* alternate usage adds a leading double quote and trailing
exclamation point plus sentence separating spaces */
+17 -17
View File
@@ -157,7 +157,7 @@ throne_sit_effect(void)
if (!Blind) {
Your("vision becomes clear.");
} else {
int num_of_eyes = eyecount(u.umonst->data);
int num_of_eyes = eyecount(gy.youmonst.data);
const char *eye = body_part(EYE);
/* note: 1 eye case won't actually happen--can't
@@ -208,7 +208,7 @@ throne_sit_effect(void)
break;
}
} else {
if (is_prince(u.umonst->data) || u.uevent.uhand_of_elbereth)
if (is_prince(gy.youmonst.data) || u.uevent.uhand_of_elbereth)
You_feel("very comfortable here.");
else
You_feel("somehow out of place...");
@@ -325,7 +325,7 @@ special_throne_effect(int effect) {
case 11:
/* polymorph effect (not blocked by magic resistance, but other things
that protect from polymorphs work) */
if (is_vampire(u.umonst->data)) {
if (is_vampire(gy.youmonst.data)) {
You_feel("unworthy.");
} else {
pline("This throne was not meant for those such as you!");
@@ -368,14 +368,14 @@ lay_an_egg(void)
} else if (u.uhunger < (int) objects[EGG].oc_nutrition) {
You("don't have enough energy to lay an egg.");
return ECMD_OK;
} else if (eggs_in_water(u.umonst->data)) {
} else if (eggs_in_water(gy.youmonst.data)) {
if (!(Underwater || Is_waterlevel(&u.uz))) {
pline("A splash tetra you are not.");
return ECMD_OK;
}
if (Upolyd
&& (u.umonst->data == &mons[PM_GIANT_EEL]
|| u.umonst->data == &mons[PM_ELECTRIC_EEL])) {
&& (gy.youmonst.data == &mons[PM_GIANT_EEL]
|| gy.youmonst.data == &mons[PM_ELECTRIC_EEL])) {
You("yearn for the Sargasso Sea.");
return ECMD_OK;
}
@@ -388,7 +388,7 @@ lay_an_egg(void)
set_corpsenm(uegg, egg_type_from_parent(u.umonnum, FALSE));
uegg->known = 1;
observe_object(uegg);
You("%s an egg.", eggs_in_water(u.umonst->data) ? "spawn" : "lay");
You("%s an egg.", eggs_in_water(gy.youmonst.data) ? "spawn" : "lay");
dropy(uegg);
stackobj(uegg);
morehungry((int) objects[EGG].oc_nutrition);
@@ -407,7 +407,7 @@ dosit(void)
You("are already sitting on %s.", mon_nam(u.usteed));
return ECMD_OK;
}
if (u.uundetected && is_hider(u.umonst->data)
if (u.uundetected && is_hider(gy.youmonst.data)
&& u.umonnum != PM_TRAPPER) /* trapper can stay hidden on floor */
u.uundetected = 0; /* no longer on the ceiling */
@@ -419,7 +419,7 @@ dosit(void)
else
You("are sitting on air.");
return ECMD_OK;
} else if (u.ustuck && !sticks(u.umonst->data)) {
} else if (u.ustuck && !sticks(gy.youmonst.data)) {
/* holding monster is next to hero rather than beneath, but
hero is in no condition to actually sit at has/her own spot */
if (humanoid(u.ustuck->data))
@@ -440,14 +440,14 @@ dosit(void)
struct obj *obj;
obj = svl.level.objects[u.ux][u.uy];
if (u.umonst->data->mlet == S_DRAGON && obj->oclass == COIN_CLASS) {
if (gy.youmonst.data->mlet == S_DRAGON && obj->oclass == COIN_CLASS) {
You("coil up around your %shoard.",
(obj->quan + money_cnt(gi.invent) < u.ulevel * 1000)
? "meager " : "");
} else if (obj->otyp == TOWEL) {
pline("It's probably not a good time for a picnic...");
} else {
if (slithy(u.umonst->data))
if (slithy(gy.youmonst.data))
You("coil up around %s.", the(xname(obj)));
else
You("sit on %s.", the(xname(obj)));
@@ -503,16 +503,16 @@ dosit(void)
dotrap(trap, VIASITTING);
}
} else if ((Underwater || Is_waterlevel(&u.uz))
&& !eggs_in_water(u.umonst->data)) {
&& !eggs_in_water(gy.youmonst.data)) {
if (Is_waterlevel(&u.uz))
There("are no cushions floating nearby.");
else
You("sit down on the muddy bottom.");
} else if (is_pool(u.ux, u.uy) && !eggs_in_water(u.umonst->data)) {
} else if (is_pool(u.ux, u.uy) && !eggs_in_water(gy.youmonst.data)) {
in_water:
You("sit in the %s.", hliquid("water"));
if (Upolyd && u.umonnum == PM_GREMLIN) {
if (split_mon(u.umonst, (struct monst *) 0)) {
if (split_mon(&gy.youmonst, (struct monst *) 0)) {
if (levl[u.ux][u.uy].typ == FOUNTAIN)
dryup(u.ux, u.uy, TRUE);
}
@@ -526,7 +526,7 @@ dosit(void)
} else if (IS_SINK(typ)) {
You(sit_message, defsyms[S_sink].explanation);
Your("%s gets wet.",
humanoid(u.umonst->data) ? "rump" : "underside");
humanoid(gy.youmonst.data) ? "rump" : "underside");
} else if (IS_ALTAR(typ)) {
You(sit_message, defsyms[S_altar].explanation);
altar_wrath(u.ux, u.uy);
@@ -540,7 +540,7 @@ dosit(void)
/* must be WWalking */
You(sit_message, hliquid("lava"));
burn_away_slime();
if (likes_lava(u.umonst->data)) {
if (likes_lava(gy.youmonst.data)) {
pline_The("%s feels warm.", hliquid("lava"));
return ECMD_TIME;
}
@@ -556,7 +556,7 @@ dosit(void)
} else if (IS_THRONE(typ)) {
You(sit_message, defsyms[S_throne].explanation);
throne_sit_effect();
} else if (lays_eggs(u.umonst->data)) {
} else if (lays_eggs(gy.youmonst.data)) {
return lay_an_egg();
} else {
pline("Having fun sitting on the %s?", surface(u.ux, u.uy));
+9 -9
View File
@@ -591,7 +591,7 @@ maybe_gasp(struct monst *mon)
case MS_VAMPIRE: /* vampire in its own form */
case MS_WERE: /* lycanthrope in human form */
case MS_SPELL: /* titan, barrow wight, Nazgul, nalfeshnee */
dogasp = (mptr->mlet == u.umonst->data->mlet);
dogasp = (mptr->mlet == gy.youmonst.data->mlet);
break;
/* capable of speech but don't care if you attack peacefuls */
case MS_BRIBE:
@@ -703,7 +703,7 @@ domonnoise(struct monst *mtmp)
msound = MS_SELL;
/* some normally non-speaking types can/will speak if hero is similar */
else if (msound == MS_ORC
&& ((same_race(ptr, u.umonst->data) /* current form, */
&& ((same_race(ptr, gy.youmonst.data) /* current form, */
|| same_race(ptr, &mons[Race_switch])) /* unpoly'd form */
|| Hallucination))
msound = MS_HUMANOID;
@@ -794,12 +794,12 @@ domonnoise(struct monst *mtmp)
if (kindred) {
verbl_msg = "This is my hunting ground"
" that you dare to prowl!";
} else if (u.umonst->data == &mons[PM_SILVER_DRAGON]
|| u.umonst->data == &mons[PM_BABY_SILVER_DRAGON]) {
} else if (gy.youmonst.data == &mons[PM_SILVER_DRAGON]
|| gy.youmonst.data == &mons[PM_BABY_SILVER_DRAGON]) {
/* Silver dragons are silver in color, not made of silver */
Sprintf(verbuf,
"%s! Your silver sheen"" does not frighten me!",
(u.umonst->data == &mons[PM_SILVER_DRAGON])
(gy.youmonst.data == &mons[PM_SILVER_DRAGON])
? "Fool"
: "Young Fool");
verbl_msg = verbuf;
@@ -1107,7 +1107,7 @@ domonnoise(struct monst *mtmp)
if (SYSOPT_SEDUCE) {
if (ptr->mlet != S_NYMPH
&& (could_seduce(mtmp, u.umonst, (struct attack *) 0)
&& (could_seduce(mtmp, &gy.youmonst, (struct attack *) 0)
== 1)) {
(void) doseduce(mtmp);
break;
@@ -1260,9 +1260,9 @@ dochat(void)
int tx, ty;
struct obj *otmp;
if (is_silent(u.umonst->data)) {
if (is_silent(gy.youmonst.data)) {
pline("As %s, you cannot speak.",
an(pmname(u.umonst->data, flags.female ? FEMALE : MALE)));
an(pmname(gy.youmonst.data, flags.female ? FEMALE : MALE)));
return ECMD_OK;
}
if (Strangled) {
@@ -1395,7 +1395,7 @@ dochat(void)
return ECMD_OK;
}
if (Deaf) {
const char *xresponse = humanoid(u.umonst->data)
const char *xresponse = humanoid(gy.youmonst.data)
? "falls on deaf ears"
: "is inaudible";
+3 -3
View File
@@ -316,7 +316,7 @@ deadbook(struct obj *book2)
set_malign(mtmp);
}
/* next handle the affect on things you're carrying */
(void) unturn_dead(u.umonst);
(void) unturn_dead(&gy.youmonst);
/* last place some monsters around you */
mm.x = u.ux;
mm.y = u.uy;
@@ -483,7 +483,7 @@ study_book(struct obj *spellbook)
if (dullbook > 0) {
eyes = body_part(EYE);
if (eyecount(u.umonst->data) > 1)
if (eyecount(gy.youmonst.data) > 1)
eyes = makeplural(eyes);
pline("This book is so dull that you can't keep your %s open.",
eyes);
@@ -690,7 +690,7 @@ rejectcasting(void)
if (Stunned) {
You("are too impaired to cast a spell.");
return TRUE;
} else if (!can_chant(u.umonst)) {
} else if (!can_chant(&gy.youmonst)) {
You("are unable to chant the incantation.");
return TRUE;
} else if (!freehand() && !(uwep && uwep->otyp == QUARTERSTAFF)) {
+2 -2
View File
@@ -79,7 +79,7 @@ stealgold(struct monst *mtmp)
whose = s_suffix(y_monnam(who));
what = makeplural(mbodypart(who, FOOT));
} else {
who = u.umonst;
who = &gy.youmonst;
whose = "your";
what = makeplural(body_part(FOOT));
}
@@ -387,7 +387,7 @@ steal(struct monst *mtmp, char *objnambuf)
/* buried ball is not tracked via 'uball' and there is no chain
at all (hence no uchain to take off) */
pline("%s takes off your unseen chain.", Monnambuf);
(void) openholdingtrap(u.umonst, &dummy);
(void) openholdingtrap(&gy.youmonst, &dummy);
} else if (Blind) {
pline("Somebody tries to rob you, but finds nothing to steal.");
} else if (inv_cnt(TRUE) > inv_cnt(FALSE)) {
+9 -9
View File
@@ -68,7 +68,7 @@ use_saddle(struct obj *otmp)
char kbuf[BUFSZ];
You("touch %s.", mon_nam(mtmp));
if (!(poly_when_stoned(u.umonst->data) && polymon(PM_STONE_GOLEM))) {
if (!(poly_when_stoned(gy.youmonst.data) && polymon(PM_STONE_GOLEM))) {
Sprintf(kbuf, "attempting to saddle %s",
an(pmname(mtmp->data, Mgender(mtmp))));
instapetrify(kbuf);
@@ -168,8 +168,8 @@ put_saddle_on_mon(struct obj *saddle, struct monst *mtmp)
boolean
can_ride(struct monst *mtmp)
{
return (mtmp->mtame && humanoid(u.umonst->data)
&& !verysmall(u.umonst->data) && !bigmonst(u.umonst->data)
return (mtmp->mtame && humanoid(gy.youmonst.data)
&& !verysmall(gy.youmonst.data) && !bigmonst(gy.youmonst.data)
&& (!Underwater || is_swimmer(mtmp->data)));
}
@@ -238,10 +238,10 @@ mount_steed(
return (FALSE);
}
if (Upolyd && (!humanoid(u.umonst->data)
|| verysmall(u.umonst->data)
|| bigmonst(u.umonst->data)
|| slithy(u.umonst->data))) {
if (Upolyd && (!humanoid(gy.youmonst.data)
|| verysmall(gy.youmonst.data)
|| bigmonst(gy.youmonst.data)
|| slithy(gy.youmonst.data))) {
You("won't fit on a saddle.");
return (FALSE);
}
@@ -545,7 +545,7 @@ landing_spot(
kn_trap = i == 0 && ((t = t_at(x, y)) != 0 && t->tseen
&& t->ttyp != VIBRATING_SQUARE);
boulder = i <= 1 && (sobj_at(BOULDER, x, y)
&& !throws_rocks(u.umonst->data));
&& !throws_rocks(gy.youmonst.data));
if (!kn_trap && !boulder) {
spot->x = x;
spot->y = y;
@@ -566,7 +566,7 @@ landing_spot(
/* If we didn't find a good spot and forceit is on, try enexto(). */
if (forceit && !found)
found = enexto(spot, u.ux, u.uy, u.umonst->data);
found = enexto(spot, u.ux, u.uy, gy.youmonst.data);
return found;
}
+12 -12
View File
@@ -105,7 +105,7 @@ goodpos(
* oh well.
*/
if (!allow_u) {
if (u_at(x, y) && mtmp != u.umonst
if (u_at(x, y) && mtmp != &gy.youmonst
&& (mtmp != u.ustuck || !u.uswallow)
&& (!u.usteed || mtmp != u.usteed))
return FALSE;
@@ -133,7 +133,7 @@ goodpos(
mdat = mtmp->data;
if (is_pool(x, y) && !ignorewater) {
/* [what about Breathless?] */
if (mtmp == u.umonst)
if (mtmp == &gy.youmonst)
return (Swimming || Amphibious
|| (!Is_waterlevel(&u.uz)
&& !is_waterwall(x, y)
@@ -152,11 +152,11 @@ goodpos(
that due the effect of the heat causing it to dry out */
if (mdat == &mons[PM_FLOATING_EYE])
return FALSE;
else if (mtmp == u.umonst)
else if (mtmp == &gy.youmonst)
return (Levitation || Flying
|| (Fire_resistance && Wwalking && uarmf
&& uarmf->oerodeproof)
|| (Upolyd && likes_lava(u.umonst->data)));
|| (Upolyd && likes_lava(gy.youmonst.data)));
else
return (m_in_air(mtmp) || likes_lava(mdat));
}
@@ -435,7 +435,7 @@ teleok(coordxy x, coordxy y, boolean trapok)
if (!trapok)
return FALSE;
}
if (!goodpos(x, y, u.umonst, 0))
if (!goodpos(x, y, &gy.youmonst, 0))
return FALSE;
if (!tele_jump_ok(u.ux, u.uy, x, y))
return FALSE;
@@ -490,9 +490,9 @@ teleds(coordxy nux, coordxy nuy, int teleds_flags)
u.ux0 = u.ux;
u.uy0 = u.uy;
if (!hideunder(u.umonst) && u.umonst->data->mlet == S_MIMIC) {
if (!hideunder(&gy.youmonst) && gy.youmonst.data->mlet == S_MIMIC) {
/* mimics stop being unnoticed */
u.umonst->m_ap_type = M_AP_NOTHING;
gy.youmonst.m_ap_type = M_AP_NOTHING;
}
if (was_swallowed) {
@@ -816,7 +816,7 @@ tele_to_rnd_pet(void)
struct monst *mtmp, *pet = (struct monst *) 0;
int cnt = 0;
if (noteleport_level(u.umonst)) {
if (noteleport_level(&gy.youmonst)) {
impossible("%s", "attempt to teleport hero to be near a pet"
" on no-teleport level");
return;
@@ -851,7 +851,7 @@ scrolltele(struct obj *scroll)
coord cc;
/* Disable teleportation in stronghold && Vlad's Tower */
if (noteleport_level(u.umonst) && !wizard) {
if (noteleport_level(&gy.youmonst) && !wizard) {
pline("A mysterious force prevents you from teleporting!");
if (scroll)
learnscroll(scroll); /* this is obviously a teleport scroll */
@@ -1072,7 +1072,7 @@ dotele(
int energy = 0;
if (!Teleportation || (u.ulevel < (Role_if(PM_WIZARD) ? 8 : 12)
&& !can_teleport(u.umonst->data))) {
&& !can_teleport(gy.youmonst.data))) {
/* Try to use teleport away spell. */
int knownsp = known_spell(SPE_TELEPORT_AWAY);
@@ -1257,7 +1257,7 @@ level_tele(void)
if (ynq("Go to Nowhere. Are you sure?") != 'y')
return;
You("%s in agony as your body begins to warp...",
is_silent(u.umonst->data) ? "writhe" : "scream");
is_silent(gy.youmonst.data) ? "writhe" : "scream");
display_nhwindow(WIN_MESSAGE, FALSE);
You("cease to exist.");
if (gi.invent)
@@ -1499,7 +1499,7 @@ tele_trap(struct trap *trap)
return;
in_tele_trap = TRUE;
if (In_endgame(&u.uz) || Antimagic || noteleport_level(u.umonst)) {
if (In_endgame(&u.uz) || Antimagic || noteleport_level(&gy.youmonst)) {
if (Antimagic)
shieldeff(u.ux, u.uy);
You_feel("a wrenching sensation.");
+14 -14
View File
@@ -142,7 +142,7 @@ stoned_dialogue(void)
char buf[BUFSZ];
Strcpy(buf, stoned_texts[SIZE(stoned_texts) - i]);
if (nolimbs(u.umonst->data) && strstri(buf, "limbs"))
if (nolimbs(gy.youmonst.data) && strstri(buf, "limbs"))
(void) strsubst(buf, "limbs", "extremities");
urgent_pline("%s", buf);
}
@@ -232,7 +232,7 @@ vomiting_dialogue(void)
break;
case 2:
txt = vomiting_texts[4];
if (cantvomit(u.umonst->data))
if (cantvomit(gy.youmonst.data))
txt = "gag uncontrollably.";
else if (Hallucination)
/* "hurl" is short for "hurl chunks" which is slang for
@@ -241,7 +241,7 @@ vomiting_dialogue(void)
break;
case 0:
stop_occupation();
if (!cantvomit(u.umonst->data)) {
if (!cantvomit(gy.youmonst.data)) {
morehungry(20);
/* case 2 used to be "You suddenly vomit!" but it wasn't sudden
since you've just been through the earlier messages of the
@@ -332,8 +332,8 @@ sickness_dialogue(void)
if ((u.usick_type & SICK_NONVOMITABLE) == 0)
(void) strsubst(buf, "illness", "sickness");
if (Hallucination && strstri(buf, "Death's door")) {
/* u.umonst: for Hallucination, mhe()'s mon argument isn't used */
Strcpy(pronounbuf, mhe(u.umonst));
/* youmonst: for Hallucination, mhe()'s mon argument isn't used */
Strcpy(pronounbuf, mhe(&gy.youmonst));
Sprintf(eos(buf), " %s %s inviting you in.",
/* upstart() modifies its argument but vtense() doesn't
care whether or not that has already happened */
@@ -394,8 +394,8 @@ slime_dialogue(void)
/* display as green slime during "You have become green slime."
but don't worry about not being able to see self; if already
mimicking something else at the time, implicitly be revealed */
u.umonst->m_ap_type = M_AP_MONSTER;
u.umonst->mappearance = PM_GREEN_SLIME;
gy.youmonst.m_ap_type = M_AP_MONSTER;
gy.youmonst.mappearance = PM_GREEN_SLIME;
/* no message given when 't' is odd, so no automatic update of
self; force one */
newsym(u.ux, u.uy);
@@ -405,7 +405,7 @@ slime_dialogue(void)
char buf[BUFSZ];
Strcpy(buf, slime_texts[SIZE(slime_texts) - i - 1L]);
if (nolimbs(u.umonst->data) && strstri(buf, "limbs"))
if (nolimbs(gy.youmonst.data) && strstri(buf, "limbs"))
(void) strsubst(buf, "limbs", "extremities");
if (strchr(buf, '%')) {
@@ -459,7 +459,7 @@ slimed_to_death(struct kinfo *kptr)
uchar save_mvflags;
/* redundant: polymon() cures sliming when polying into green slime */
if (Upolyd && u.umonst->data == &mons[PM_GREEN_SLIME]) {
if (Upolyd && gy.youmonst.data == &mons[PM_GREEN_SLIME]) {
dealloc_killer(kptr);
return;
}
@@ -485,11 +485,11 @@ slimed_to_death(struct kinfo *kptr)
* [formerly implicit] change of form; polymon() takes care of that.
* Temporarily ungenocide if necessary.
*/
if (emits_light(u.umonst->data))
del_light_source(LS_MONSTER, monst_to_any(u.umonst));
if (emits_light(gy.youmonst.data))
del_light_source(LS_MONSTER, monst_to_any(&gy.youmonst));
save_mvflags = svm.mvitals[PM_GREEN_SLIME].mvflags;
svm.mvitals[PM_GREEN_SLIME].mvflags = save_mvflags & ~G_GENOD;
/* become a green slime; also resets u.umonst.m_ap_type+.mappearance */
/* become a green slime; also resets youmonst.m_ap_type+.mappearance */
(void) polymon(PM_GREEN_SLIME);
svm.mvitals[PM_GREEN_SLIME].mvflags = save_mvflags;
done_timeout(TURNED_SLIME, SLIMED);
@@ -640,8 +640,8 @@ nh_timeout(void)
sleep_dialogue();
if (u.mtimedone && !--u.mtimedone) {
if (Unchanging)
u.mtimedone = rnd(100 * u.umonst->data->mlevel + 1);
else if (is_were(u.umonst->data))
u.mtimedone = rnd(100 * gy.youmonst.data->mlevel + 1);
else if (is_were(gy.youmonst.data))
you_unwere(FALSE); /* if polycontrl, asks whether to rehumanize */
else
rehumanize();
+94 -94
View File
@@ -94,7 +94,7 @@ burnarmor(struct monst *victim)
if (!victim)
return 0;
hitting_u = (victim == u.umonst);
hitting_u = (victim == &gy.youmonst);
/* burning damage may dry wet towel */
item = hitting_u ? carrying(TOWEL) : m_carrying(victim, TOWEL);
@@ -190,11 +190,11 @@ erode_obj(
if (!otmp)
return ER_NOTHING;
victim = carried(otmp) ? u.umonst
victim = carried(otmp) ? &gy.youmonst
: mcarried(otmp) ? otmp->ocarry
: (struct monst *) 0;
uvictim = (victim == u.umonst);
vismon = victim && (victim != u.umonst) && canseemon(victim);
uvictim = (victim == &gy.youmonst);
vismon = victim && (victim != &gy.youmonst) && canseemon(victim);
/* Is gb.bhitpos correct here? Ugh. */
visobj = (!victim && cansee(gb.bhitpos.x, gb.bhitpos.y)
&& (!is_pool(gb.bhitpos.x, gb.bhitpos.y)
@@ -269,7 +269,7 @@ erode_obj(
*/
if (otmp->oerodeproof) {
otmp->rknown = TRUE;
if (victim == u.umonst)
if (victim == &gy.youmonst)
update_inventory();
}
@@ -294,7 +294,7 @@ erode_obj(
else
otmp->oeroded2++;
if (victim == u.umonst)
if (victim == &gy.youmonst)
update_inventory();
return ER_DAMAGED;
@@ -363,15 +363,15 @@ grease_protect(
struct monst *victim)
{
static const char txt[] = "protected by the layer of grease!";
boolean vismon = victim && (victim != u.umonst) && canseemon(victim);
boolean vismon = victim && (victim != &gy.youmonst) && canseemon(victim);
if (ostr) {
if (victim == u.umonst)
if (victim == &gy.youmonst)
Your("%s %s %s", ostr, vtense(ostr, "are"), txt);
else if (vismon)
pline("%s's %s %s %s", Monnam(victim),
ostr, vtense(ostr, "are"), txt);
} else if (victim == u.umonst || vismon) {
} else if (victim == &gy.youmonst || vismon) {
pline("%s %s", Yobjnam2(otmp, "are"), txt);
}
if (!rn2(2)) {
@@ -634,11 +634,11 @@ fall_through(
; /* KMH -- You can't escape the Sokoban level traps */
} else if (Levitation || u.ustuck
|| (!Can_fall_thru(&u.uz) && !levl[u.ux][u.uy].candig)
|| ((Flying || is_clinger(u.umonst->data)
|| (ceiling_hider(u.umonst->data) && u.uundetected))
|| ((Flying || is_clinger(gy.youmonst.data)
|| (ceiling_hider(gy.youmonst.data) && u.uundetected))
&& !(ftflags & TOOKPLUNGE))) {
dont_fall = "don't fall in.";
} else if (u.umonst->data->msize >= MZ_HUGE) {
} else if (gy.youmonst.data->msize >= MZ_HUGE) {
dont_fall = "don't fit through.";
} else if (!next_to_u()) {
dont_fall = "are jerked back by your pet!";
@@ -653,7 +653,7 @@ fall_through(
}
return;
}
if ((Flying || is_clinger(u.umonst->data))
if ((Flying || is_clinger(gy.youmonst.data))
&& (ftflags & TOOKPLUNGE) && td && t) {
if (Flying)
controlled_flight = TRUE;
@@ -890,7 +890,7 @@ animate_statue(
delobj(statue);
/* avoid hiding under nothing */
if (u_at(x, y) && Upolyd && hides_under(u.umonst->data)
if (u_at(x, y) && Upolyd && hides_under(gy.youmonst.data)
&& !OBJ_AT(x, y))
u.uundetected = 0;
@@ -974,7 +974,7 @@ mu_maybe_destroy_web(
boolean domsg,
struct trap *trap)
{
boolean isyou = (mtmp == u.umonst);
boolean isyou = (mtmp == &gy.youmonst);
struct permonst *mptr = mtmp->data;
if (amorphous(mptr) || is_whirly(mptr) || flaming(mptr)
@@ -1085,7 +1085,7 @@ floor_trigger(int ttyp)
staticfn boolean
check_in_air(struct monst *mtmp, unsigned trflags)
{
boolean is_you = mtmp == u.umonst,
boolean is_you = mtmp == &gy.youmonst,
plunged = (trflags & (TOOKPLUNGE | VIASITTING)) != 0;
return ((trflags & HURTLING) != 0
@@ -1195,7 +1195,7 @@ trapeffect_arrow_trap(
struct obj *otmp;
int dam;
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
if (trap->once && trap->tseen && !rn2(15)) {
Soundeffect(se_loud_click, 100);
You_hear("a loud click!");
@@ -1207,7 +1207,7 @@ trapeffect_arrow_trap(
seetrap(trap);
pline("An arrow shoots out at you!");
otmp = t_missile(ARROW, trap);
dam = dmgval(otmp, u.umonst);
dam = dmgval(otmp, &gy.youmonst);
if (u.usteed && !rn2(2) && steedintrap(trap, otmp)) {
; /* nothing */
} else if (thitu(8, Maybe_Half_Phys(dam), &otmp, "arrow")) {
@@ -1256,7 +1256,7 @@ trapeffect_dart_trap(
struct obj *otmp;
int dam;
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
int oldumort = u.umortality;
if (trap->once && trap->tseen && !rn2(15)) {
@@ -1272,7 +1272,7 @@ trapeffect_dart_trap(
otmp = t_missile(DART, trap);
if (!rn2(6))
otmp->opoisoned = 1;
dam = dmgval(otmp, u.umonst);
dam = dmgval(otmp, &gy.youmonst);
if (u.usteed && !rn2(2) && steedintrap(trap, otmp)) {
; /* nothing */
} else if (thitu(7, Maybe_Half_Phys(dam), &otmp, "little dart")) {
@@ -1329,7 +1329,7 @@ trapeffect_rocktrap(
struct obj *otmp;
boolean harmless = FALSE;
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
if (trap->once && trap->tseen && !rn2(15)) {
pline("A trap door in %s opens, but nothing falls out!",
the(ceiling(u.ux, u.uy)));
@@ -1348,7 +1348,7 @@ trapeffect_rocktrap(
if (uarmh) {
/* normally passes_rocks() would protect against a falling
rock, but not when wearing a helmet */
if (passes_rocks(u.umonst->data)) {
if (passes_rocks(gy.youmonst.data)) {
pline("Unfortunately, you are wearing %s.",
an(helm_simple_name(uarmh))); /* helm or hat */
dmg = 2;
@@ -1358,7 +1358,7 @@ trapeffect_rocktrap(
} else if (flags.verbose) {
pline("%s does not protect you.", Yname2(uarmh));
}
} else if (passes_rocks(u.umonst->data)) {
} else if (passes_rocks(gy.youmonst.data)) {
pline("It passes harmlessly through you.");
harmless = TRUE;
}
@@ -1415,7 +1415,7 @@ trapeffect_sqky_board(
|| (trflags & FAILEDUNTRAP) != 0
|| (Flying && (trflags & VIASITTING) != 0));
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
if ((Levitation || Flying) && !forcetrap) {
if (!Blind) {
seetrap(trap);
@@ -1481,7 +1481,7 @@ trapeffect_bear_trap(
struct trap *trap,
unsigned trflags)
{
boolean is_you = mtmp == u.umonst,
boolean is_you = mtmp == &gy.youmonst,
forcetrap = ((trflags & FORCETRAP) != 0
|| (trflags & FAILEDUNTRAP) != 0
|| (is_you && (trflags & VIASITTING) != 0));
@@ -1492,13 +1492,13 @@ trapeffect_bear_trap(
if ((Levitation || Flying) && !forcetrap)
return Trap_Effect_Finished;
feeltrap(trap);
if (amorphous(u.umonst->data) || is_whirly(u.umonst->data)
|| unsolid(u.umonst->data)) {
if (amorphous(gy.youmonst.data) || is_whirly(gy.youmonst.data)
|| unsolid(gy.youmonst.data)) {
pline("%s bear trap closes harmlessly through you.",
A_Your[trap->madeby_u]);
return Trap_Effect_Finished;
}
if (!u.usteed && u.umonst->data->msize <= MZ_SMALL) {
if (!u.usteed && gy.youmonst.data->msize <= MZ_SMALL) {
pline("%s bear trap closes harmlessly over you.",
A_Your[trap->madeby_u]);
return Trap_Effect_Finished;
@@ -1565,9 +1565,9 @@ trapeffect_slp_gas_trap(
struct trap *trap,
unsigned int trflags UNUSED)
{
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
seetrap(trap);
if (Sleep_resistance || breathless(u.umonst->data)) {
if (Sleep_resistance || breathless(gy.youmonst.data)) {
You("are enveloped in a cloud of gas!");
monstseesu(M_SEEN_SLEEP);
} else {
@@ -1599,7 +1599,7 @@ trapeffect_rust_trap(
{
struct obj *otmp, *nextobj;
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
seetrap(trap);
/* Unlike monsters, traps cannot aim their rust attacks at
@@ -1650,7 +1650,7 @@ trapeffect_rust_trap(
You("are covered with rust!");
losehp(Maybe_Half_Phys(dam), "rusting away", KILLED_BY);
} else if (u.umonnum == PM_GREMLIN && rn2(3)) {
(void) split_mon(u.umonst, (struct monst *) 0);
(void) split_mon(&gy.youmonst, (struct monst *) 0);
}
} else {
boolean in_sight = canseemon(mtmp) || (mtmp == u.usteed);
@@ -1732,7 +1732,7 @@ trapeffect_fire_trap(
struct trap *trap,
unsigned int trflags UNUSED)
{
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
seetrap(trap);
dofiretrap((struct obj *) 0);
} else {
@@ -1832,7 +1832,7 @@ trapeffect_pit(
set to false if the spikes are found to not be relevant */
boolean relevant_spikes = ttype == SPIKED_PIT;
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
boolean plunged = (trflags & TOOKPLUNGE) != 0;
boolean viasitting = (trflags & VIASITTING) != 0;
boolean conj_pit = conjoined_pits(trap, t_at(u.ux0, u.uy0), TRUE);
@@ -1850,7 +1850,7 @@ trapeffect_pit(
if (!Sokoban && (Levitation || (Flying && !plunged && !viasitting)))
return Trap_Effect_Finished;
feeltrap(trap);
if (!Sokoban && is_clinger(u.umonst->data) && !plunged) {
if (!Sokoban && is_clinger(gy.youmonst.data) && !plunged) {
if (already_known) {
You_see("%s %spit below you.", a_your[trap->madeby_u],
ttype == SPIKED_PIT ? "spiked " : "");
@@ -1946,7 +1946,7 @@ trapeffect_pit(
} else {
/* plunging flyers take spike damage but not pit damage */
if (!conj_pit && !deliberate
&& !(plunged && (Flying || is_clinger(u.umonst->data))))
&& !(plunged && (Flying || is_clinger(gy.youmonst.data))))
losehp(Maybe_Half_Phys(rnd(adj_pit ? 3 : 6)),
plunged ? "deliberately plunged into a pit"
: "fell into a pit",
@@ -2015,7 +2015,7 @@ trapeffect_hole(
struct trap *trap,
unsigned int trflags)
{
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
if (!Can_fall_thru(&u.uz)) {
seetrap(trap); /* normally done in fall_through */
impossible("dotrap: %ss cannot exist on this level.",
@@ -2072,7 +2072,7 @@ trapeffect_telep_trap(
struct trap *trap,
unsigned int trflags UNUSED)
{
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
seetrap(trap);
tele_trap(trap);
} else {
@@ -2090,7 +2090,7 @@ trapeffect_level_telep(
struct trap *trap,
unsigned int trflags)
{
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
seetrap(trap);
level_tele_trap(trap, trflags);
} else {
@@ -2108,7 +2108,7 @@ trapeffect_web(
struct trap *trap,
unsigned int trflags)
{
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
boolean webmsgok = (trflags & NOWEBMSG) == 0;
boolean forcetrap = ((trflags & FORCETRAP) != 0
|| (trflags & FAILEDUNTRAP) != 0);
@@ -2121,9 +2121,9 @@ trapeffect_web(
steed_article = ARTICLE_NONE;
feeltrap(trap);
if (mu_maybe_destroy_web(u.umonst, webmsgok, trap))
if (mu_maybe_destroy_web(&gy.youmonst, webmsgok, trap))
return Trap_Effect_Finished;
if (webmaker(u.umonst->data)) {
if (webmaker(gy.youmonst.data)) {
if (webmsgok)
pline(trap->madeby_u ? "You take a walk on your web."
: "There is a spider web here.");
@@ -2281,7 +2281,7 @@ trapeffect_statue_trap(
struct trap *trap,
unsigned int trflags UNUSED)
{
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
(void) activate_statue_trap(trap, u.ux, u.uy, FALSE);
} else {
/* monsters don't trigger statue traps */
@@ -2295,7 +2295,7 @@ trapeffect_magic_trap(
struct trap *trap,
unsigned int trflags)
{
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
seetrap(trap);
if (!rn2(30)) {
deltrap(trap);
@@ -2332,7 +2332,7 @@ trapeffect_anti_magic(
rather than the wearer */
if (shoes->spe > 0) {
/* no message if a monster does this, it isn't visible enough */
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
seetrap(trap);
pline("A lethargic aura surrounds %s.", yname(shoes));
costly_alteration(shoes, COST_DECHNT);
@@ -2343,7 +2343,7 @@ trapeffect_anti_magic(
}
}
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
int drain, halfd;
boolean exclaim_it = FALSE;
@@ -2455,7 +2455,7 @@ trapeffect_poly_trap(
struct trap *trap,
unsigned int trflags)
{
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
boolean viasitting = (trflags & VIASITTING) != 0;
int steed_article = ARTICLE_THE;
char verbbuf[BUFSZ];
@@ -2537,7 +2537,7 @@ trapeffect_landmine(
if (wearing_iron_shoes(mtmp))
damage = (damage + 3) / 4;
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
boolean already_seen = trap->tseen;
boolean forcetrap = ((trflags & FORCETRAP) != 0
|| (trflags & FAILEDUNTRAP) != 0);
@@ -2663,7 +2663,7 @@ trapeffect_rolling_boulder_trap(
struct trap *trap,
unsigned int trflags UNUSED)
{
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
int style = ROLL | (trap->tseen ? LAUNCH_KNOWN : 0);
feeltrap(trap);
@@ -2712,7 +2712,7 @@ trapeffect_magic_portal(
struct trap *trap,
unsigned int trflags)
{
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
feeltrap(trap);
domagicportal(trap);
} else {
@@ -2727,7 +2727,7 @@ trapeffect_vibrating_square(
struct trap *trap,
unsigned int trflags UNUSED)
{
if (mtmp == u.umonst) {
if (mtmp == &gy.youmonst) {
feeltrap(trap);
/* messages handled elsewhere; the trap symbol is merely to mark the
square for future reference */
@@ -2791,7 +2791,7 @@ immune_to_trap(struct monst *mon, unsigned ttype)
return TRAP_NOT_IMMUNE;
}
pm = mon->data;
is_you = (mon == u.umonst);
is_you = (mon == &gy.youmonst);
switch (ttype) {
case ARROW_TRAP:
@@ -2986,7 +2986,7 @@ trapeffect_selector(
return trapeffect_vibrating_square(mtmp, trap, trflags);
default:
impossible("%s encountered a strange trap of type %d.",
(mtmp == u.umonst) ? "You" : "Some monster",
(mtmp == &gy.youmonst) ? "You" : "Some monster",
trap->ttyp);
}
return Trap_Effect_Finished;
@@ -3023,7 +3023,7 @@ dotrap(struct trap *trap, unsigned trflags)
trapname(ttype, TRUE)); /* do force "pit" while hallucinating */
/* then proceed to normal trap effect */
} else if (!forcetrap) {
if (floor_trigger(ttype) && check_in_air(u.umonst, trflags)) {
if (floor_trigger(ttype) && check_in_air(&gy.youmonst, trflags)) {
if (already_seen) {
You("%s over %s %s.", u_locomotion("step"),
(ttype == ARROW_TRAP && !trap->madeby_u)
@@ -3035,7 +3035,7 @@ dotrap(struct trap *trap, unsigned trflags)
if (already_seen && !Fumbling && !undestroyable_trap(ttype)
&& ttype != ANTI_MAGIC && !forcebungle && !plunged
&& !conj_pit && !adj_pit
&& (!rn2(5) || (is_pit(ttype) && is_clinger(u.umonst->data)))) {
&& (!rn2(5) || (is_pit(ttype) && is_clinger(gy.youmonst.data)))) {
You("escape %s %s.", (ttype == ARROW_TRAP && !trap->madeby_u)
? "an"
: a_your[trap->madeby_u],
@@ -3056,7 +3056,7 @@ dotrap(struct trap *trap, unsigned trflags)
* would be somewhat harsh for what's usually a minor impairment.
*/
(void) trapeffect_selector(u.umonst, trap, trflags);
(void) trapeffect_selector(&gy.youmonst, trap, trflags);
}
staticfn char *
@@ -3412,7 +3412,7 @@ launch_obj(
break;
}
} else if (u_at(x, y)) {
int dam = dmgval(singleobj, u.umonst);
int dam = dmgval(singleobj, &gy.youmonst);
if (gm.multi)
nomul(0);
@@ -3845,7 +3845,7 @@ instapetrify(const char *str)
{
if (Stone_resistance)
return;
if (poly_when_stoned(u.umonst->data) && polymon(PM_STONE_GOLEM))
if (poly_when_stoned(gy.youmonst.data) && polymon(PM_STONE_GOLEM))
return;
urgent_pline("You turn to stone...");
svk.killer.format = KILLED_BY;
@@ -4085,7 +4085,7 @@ float_down(
/* check for falling into pool - added by GAN 10/20/86 */
if (!Flying) {
if (!u.uswallow && u.ustuck) {
if (sticks(u.umonst->data))
if (sticks(gy.youmonst.data))
You("aren't able to maintain your hold on %s.",
mon_nam(u.ustuck));
else
@@ -4199,14 +4199,14 @@ climb_pit(void)
display_nhwindow(WIN_MESSAGE, FALSE);
clear_nhwindow(WIN_MESSAGE);
You("free your %s.", body_part(LEG));
} else if ((Flying || is_clinger(u.umonst->data)) && !Sokoban) {
} else if ((Flying || is_clinger(gy.youmonst.data)) && !Sokoban) {
/* eg fell in pit, then poly'd to a flying monster;
or used '>' to deliberately enter it */
You("%s from the %s.", u_locomotion("climb"), pitname);
reset_utrap(FALSE);
fill_pit(u.ux, u.uy);
gv.vision_full_recalc = 1; /* vision limits change */
} else if (!(--u.utrap) || m_easy_escape_pit(u.umonst)) {
} else if (!(--u.utrap) || m_easy_escape_pit(&gy.youmonst)) {
reset_utrap(FALSE);
You("%s to the edge of the %s.",
(Sokoban && Levitation)
@@ -4303,8 +4303,8 @@ dofiretrap(
losehp(num, tower_of_flame, KILLED_BY_AN); /* fire damage */
burn_away_slime();
if (burnarmor(u.umonst) || rn2(3)) {
(void) destroy_items(u.umonst, AD_FIRE, orig_dmg);
if (burnarmor(&gy.youmonst) || rn2(3)) {
(void) destroy_items(&gy.youmonst, AD_FIRE, orig_dmg);
ignite_items(gi.invent);
}
if (!box && burn_floor_objects(u.ux, u.uy, see_it, TRUE) && !see_it)
@@ -4325,7 +4325,7 @@ domagictrap(void)
int cnt = rnd(4);
/* blindness effects */
if (!resists_blnd(u.umonst)) {
if (!resists_blnd(&gy.youmonst)) {
You("are momentarily blinded by a flash of light!");
make_blinded((long) rn1(5, 10), FALSE);
if (!Blind)
@@ -4362,7 +4362,7 @@ domagictrap(void)
if (!Invis) {
if (!Blind)
self_invis_message();
} else if (!EInvis && !pm_invisible(u.umonst->data)) {
} else if (!EInvis && !pm_invisible(gy.youmonst.data)) {
if (!Blind) {
if (!See_invisible)
You("can see yourself again!");
@@ -4393,7 +4393,7 @@ domagictrap(void)
if (on_level(&u.uz, &qstart_level))
You_feel(
"%slike the prodigal son.",
(flags.female || (Upolyd && is_neuter(u.umonst->data)))
(flags.female || (Upolyd && is_neuter(gy.youmonst.data)))
? "oddly "
: "");
else
@@ -4624,10 +4624,10 @@ acid_damage(struct obj *obj)
if (!obj)
return;
victim = carried(obj) ? u.umonst : mcarried(obj) ? obj->ocarry : NULL;
vismon = victim && (victim != u.umonst) && canseemon(victim);
victim = carried(obj) ? &gy.youmonst : mcarried(obj) ? obj->ocarry : NULL;
vismon = victim && (victim != &gy.youmonst) && canseemon(victim);
if (victim == u.umonst && inventory_resistance_check(AD_ACID))
if (victim == &gy.youmonst && inventory_resistance_check(AD_ACID))
return;
if (obj->greased) {
@@ -4639,7 +4639,7 @@ acid_damage(struct obj *obj)
#endif
) {
if (!Blind) {
if (victim == u.umonst)
if (victim == &gy.youmonst)
Your("%s.", aobjnam(obj, "fade"));
else if (vismon)
pline("%s %s.", s_suffix(Monnam(victim)),
@@ -4941,13 +4941,13 @@ emergency_disrobe(boolean *lostsome)
}
/* pick a random goodpos() next to x,y for monster mtmp.
mtmp could be u.umonst, uses then crawl_destination().
mtmp could be &gy.youmonst, uses then crawl_destination().
returns TRUE if any good position found, with the coord in x,y */
boolean
rnd_nextto_goodpos(coordxy *x, coordxy *y, struct monst *mtmp)
{
int i, j;
boolean is_u = (mtmp == u.umonst);
boolean is_u = (mtmp == &gy.youmonst);
coordxy nx, ny, k, dirs[N_DIRS];
for (i = 0; i < N_DIRS; ++i)
@@ -5086,7 +5086,7 @@ drown(void)
water_damage_chain(gi.invent, FALSE);
if (u.umonnum == PM_GREMLIN && rn2(3)) {
(void) split_mon(u.umonst, (struct monst *) 0);
(void) split_mon(&gy.youmonst, (struct monst *) 0);
} else if (u.umonnum == PM_IRON_GOLEM) {
You("rust!");
i = Maybe_Half_Phys(d(2, 6));
@@ -5124,10 +5124,10 @@ drown(void)
gv.vision_full_recalc = 1;
return FALSE;
}
if ((Teleportation || can_teleport(u.umonst->data)) && !Unaware
if ((Teleportation || can_teleport(gy.youmonst.data)) && !Unaware
&& (Teleport_control || rn2(3) < Luck + 2)) {
You("attempt a teleport spell."); /* utcsri!carroll */
if (!noteleport_level(u.umonst)) {
if (!noteleport_level(&gy.youmonst)) {
(void) dotele(FALSE);
if (!is_pool(u.ux, u.uy))
return TRUE;
@@ -5150,8 +5150,8 @@ drown(void)
x = u.ux, y = u.uy;
/* have to be able to move in order to crawl */
if (gm.multi >= 0 && u.umonst->data->mmove
&& rnd_nextto_goodpos(&x, &y, u.umonst)) {
if (gm.multi >= 0 && gy.youmonst.data->mmove
&& rnd_nextto_goodpos(&x, &y, &gy.youmonst)) {
boolean lost = FALSE;
/* time to do some strip-tease... */
boolean succ = Is_waterlevel(&u.uz) ? TRUE : emergency_disrobe(&lost);
@@ -5262,10 +5262,10 @@ could_untrap(boolean verbosely, boolean check_floor)
buf[0] = '\0';
if (near_capacity() >= HVY_ENCUMBER) {
Strcpy(buf, "You're too strained to do that.");
} else if ((nohands(u.umonst->data) && !webmaker(u.umonst->data))
|| !u.umonst->data->mmove) {
} else if ((nohands(gy.youmonst.data) && !webmaker(gy.youmonst.data))
|| !gy.youmonst.data->mmove) {
Strcpy(buf, "And just how do you expect to do that?");
} else if (u.ustuck && sticks(u.umonst->data)) {
} else if (u.ustuck && sticks(gy.youmonst.data)) {
Sprintf(buf, "You'll have to let go of %s first.", mon_nam(u.ustuck));
} else if (u.ustuck || (welded(uwep) && bimanual(uwep))) {
Sprintf(buf, "Your %s seem to be too busy for that.",
@@ -5307,7 +5307,7 @@ untrap_prob(
if (u_wield_art(ART_STING) || attacks(AD_FIRE, wep))
chance = 1;
/* else chance stays 3 */
} else if (!webmaker(u.umonst->data)) {
} else if (!webmaker(gy.youmonst.data)) {
chance = 7; /* 5.0: used to be 30 */
}
}
@@ -5458,10 +5458,10 @@ try_disarm(
return 0;
}
/* duplicate tight-space checks from test_move */
if (u.dx && u.dy && bad_rock(u.umonst->data, u.ux, ttmp->ty)
&& bad_rock(u.umonst->data, ttmp->tx, u.uy)) {
if (u.dx && u.dy && bad_rock(gy.youmonst.data, u.ux, ttmp->ty)
&& bad_rock(gy.youmonst.data, ttmp->tx, u.uy)) {
if ((gi.invent && (inv_weight() + weight_cap() > WT_TOOMUCH_DIAGONAL))
|| bigmonst(u.umonst->data)) {
|| bigmonst(gy.youmonst.data)) {
/* don't allow untrap if they can't get thru to it */
You("are unable to reach the %s!", trapname(ttype, FALSE));
return 0;
@@ -5490,7 +5490,7 @@ try_disarm(
} else if (ttype == WEB) {
struct trap *ttmp2 = t_at(u.ux, u.uy);
if (!webmaker(u.umonst->data)
if (!webmaker(gy.youmonst.data)
/* don't always try to spread the web */
&& !rn2(3)
/* is there already a trap at hero's spot?
@@ -5736,7 +5736,7 @@ help_monster_out(
You("grab the trapped %s using your bare %s.",
mtmp_pmname, makeplural(body_part(HAND)));
if (poly_when_stoned(u.umonst->data) && polymon(PM_STONE_GOLEM)) {
if (poly_when_stoned(gy.youmonst.data) && polymon(PM_STONE_GOLEM)) {
display_nhwindow(WIN_MESSAGE, FALSE);
} else {
char kbuf[BUFSZ];
@@ -5864,7 +5864,7 @@ untrap(
/* 'force' is true for #invoke; if carrying MKoT, make it be true
for #untrap or autounlock */
if (!force && has_magic_key(u.umonst))
if (!force && has_magic_key(&gy.youmonst))
force = TRUE;
if (!rx && !container) {
@@ -6106,7 +6106,7 @@ openholdingtrap(
struct trap *t, tdummy;
char buf[BUFSZ], whichbuf[20];
const char *trapdescr = 0, *which = 0;
boolean ishero = (mon == u.umonst);
boolean ishero = (mon == &gy.youmonst);
if (!mon)
return FALSE;
@@ -6214,7 +6214,7 @@ closeholdingtrap(
{
struct trap *t;
unsigned dotrapflags;
boolean ishero = (mon == u.umonst), result;
boolean ishero = (mon == &gy.youmonst), result;
if (!mon)
return FALSE;
@@ -6255,7 +6255,7 @@ openfallingtrap(
boolean *noticed) /* set to true iff hero notices the effect; */
{ /* otherwise left with its previous value intact */
struct trap *t;
boolean ishero = (mon == u.umonst), result;
boolean ishero = (mon == &gy.youmonst), result;
if (!mon)
return FALSE;
@@ -6451,7 +6451,7 @@ chest_trap(
} else {
monstunseesu(M_SEEN_ELEC);
}
(void) destroy_items(u.umonst, AD_ELEC, orig_dmg);
(void) destroy_items(&gy.youmonst, AD_ELEC, orig_dmg);
if (dmg)
losehp(dmg, "electric shock", KILLED_BY_AN);
break;
@@ -6478,7 +6478,7 @@ chest_trap(
if (Hallucination)
pline("What a groovy feeling!");
else
You("%s%s...", stagger(u.umonst->data, "stagger"),
You("%s%s...", stagger(gy.youmonst.data, "stagger"),
Halluc_resistance ? ""
: Blind ? " and get dizzy"
: " and your vision blurs");
@@ -6805,7 +6805,7 @@ lava_effects(void)
}
feel_newsym(u.ux, u.uy); /* in case Blind, map the lava here */
burn_away_slime();
if (likes_lava(u.umonst->data))
if (likes_lava(gy.youmonst.data))
return FALSE;
usurvive = Fire_resistance || (Wwalking && dmg < u.uhp);
@@ -6981,7 +6981,7 @@ lava_effects(void)
}
burn_stuff:
(void) destroy_items(u.umonst, AD_FIRE, dmg);
(void) destroy_items(&gy.youmonst, AD_FIRE, dmg);
ignite_items(gi.invent);
return FALSE;
}
-3
View File
@@ -956,9 +956,6 @@ u_init_misc(void)
(void) memset((genericptr_t) &ubirthday, 0, sizeof(ubirthday));
(void) memset((genericptr_t) &urealtime, 0, sizeof(urealtime));
u.umonst = newmonst();
*u.umonst = cg.zeromonst;
u.umonst->cham = u.mcham = NON_PM;
u.uroleplay = tmpuroleplay; /* restore options set via rcfile */
#if 0 /* documentation of more zero values as desirable */
+153 -153
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -466,18 +466,18 @@ invault(void)
}
if (U_AP_TYPE == M_AP_OBJECT || u.uundetected) {
if (U_AP_TYPE == M_AP_OBJECT
&& u.umonst->mappearance != GOLD_PIECE)
&& gy.youmonst.mappearance != GOLD_PIECE)
if (!Deaf) {
SetVoice(guard, 0, 80, 0);
verbalize("Hey! Who left that %s in here?",
mimic_obj_name(u.umonst));
mimic_obj_name(&gy.youmonst));
}
/* You're mimicking some object or you're hidden. */
pline("Puzzled, %s turns around and leaves.", mhe(guard));
mongone(guard);
return;
}
if (Strangled || is_silent(u.umonst->data) || gm.multi < 0) {
if (Strangled || is_silent(gy.youmonst.data) || gm.multi < 0) {
/* [we ought to record whether this message has already
been given in order to vary it upon repeat visits, but
discarding the monster and its egd data renders that hard] */
@@ -1065,7 +1065,7 @@ gd_move(struct monst *grd)
}
if (um_dist(grd->mx, grd->my, 1) || egrd->gddone) {
if (!egrd->gddone && !rn2(10) && !Deaf && !u.uswallow
&& !(u.ustuck && !sticks(u.umonst->data))) {
&& !(u.ustuck && !sticks(gy.youmonst.data))) {
SetVoice(grd, 0, 80, 0);
verbalize("Move along!");
}
+1 -1
View File
@@ -405,7 +405,7 @@ special_dmgval(
}
/* when no gloves we check for silver rings (blessed rings ignored) */
} else if ((left_ring || right_ring) && magr == u.umonst) {
} else if ((left_ring || right_ring) && magr == &gy.youmonst) {
if (left_ring && uleft) {
if (objects[uleft->otyp].oc_material == SILVER
&& mon_hates_silver(mdef)) {
+2 -2
View File
@@ -218,12 +218,12 @@ you_unwere(boolean purify)
You_feel("purified.");
set_ulycn(NON_PM); /* cure lycanthropy */
}
if (!Unchanging && is_were(u.umonst->data)
if (!Unchanging && is_were(gy.youmonst.data)
&& !monster_nearby()
&& (!controllable_poly
|| !paranoid_query(ParanoidWerechange, "Remain in beast form?")))
rehumanize();
else if (is_were(u.umonst->data) && !u.mtimedone)
else if (is_were(gy.youmonst.data) && !u.mtimedone)
u.mtimedone = rn1(200, 200); /* 40% of initial were change */
}
+5 -5
View File
@@ -158,7 +158,7 @@ const char *
empty_handed(void)
{
return uarmg ? "empty handed" /* gloves imply hands */
: humanoid(u.umonst->data)
: humanoid(gy.youmonst.data)
/* hands but no weapon and no gloves */
? "bare handed"
/* alternate phrasing for paws or lack of hands */
@@ -360,7 +360,7 @@ dowield(void)
/* May we attempt this? */
gm.multi = 0;
if (cantwield(u.umonst->data)) {
if (cantwield(gy.youmonst.data)) {
pline("Don't be ridiculous!");
return ECMD_FAIL;
}
@@ -465,7 +465,7 @@ doswapweapon(void)
/* May we attempt this? */
gm.multi = 0;
if (cantwield(u.umonst->data)) {
if (cantwield(gy.youmonst.data)) {
pline("Don't be ridiculous!");
return ECMD_FAIL;
}
@@ -716,7 +716,7 @@ wield_tool(struct obj *obj,
}
return FALSE;
}
if (cantwield(u.umonst->data)) {
if (cantwield(gy.youmonst.data)) {
You_cant("hold %s strongly enough.", more_than_1 ? "them" : "it");
return FALSE;
}
@@ -762,7 +762,7 @@ can_twoweapon(void)
{
struct obj *otmp;
if (!could_twoweap(u.umonst->data)) {
if (!could_twoweap(gy.youmonst.data)) {
if (Upolyd)
You_cant("use two weapons in your current form.");
else
+2 -2
View File
@@ -892,7 +892,7 @@ wiz_smell(void)
cc.x = u.ux;
cc.y = u.uy;
if (!olfaction(u.umonst->data)) {
if (!olfaction(gy.youmonst.data)) {
You("are incapable of detecting odors in your present form.");
return ECMD_OK;
}
@@ -909,7 +909,7 @@ wiz_smell(void)
if (u.usteed) {
mptr = u.usteed->data;
} else {
mptr = u.umonst->data;
mptr = gy.youmonst.data;
is_you = TRUE;
}
} else if ((mtmp = m_at(cc.x, cc.y)) != (struct monst *) 0) {
+2 -2
View File
@@ -459,7 +459,7 @@ check_wornmask_slots(void)
why = "uswapwep is not a melee weapon";
else if (bimanual(uswapwep))
why = "uswapwep is two-handed";
else if (!could_twoweap(u.umonst->data))
else if (!could_twoweap(gy.youmonst.data))
why = "without two weapon attacks";
if (why)
@@ -1005,7 +1005,7 @@ m_dowear_type(
struct obj *
which_armor(struct monst *mon, long flag)
{
if (mon == u.umonst) {
if (mon == &gy.youmonst) {
switch (flag) {
case W_ARM:
return uarm;
+1 -1
View File
@@ -84,7 +84,7 @@ dowrite(struct obj *pen)
const char *typeword;
int spell_knowledge;
if (nohands(u.umonst->data)) {
if (nohands(gy.youmonst.data)) {
You("need hands to be able to write!");
return ECMD_OK;
} else if (Glib) {
+43 -43
View File
@@ -590,7 +590,7 @@ release_hold(void)
}
/* gives "you get regurgitated" or "you get expelled from <mon>" */
expels(mtmp, mtmp->data, TRUE);
} else if (sticks(u.umonst->data)) {
} else if (sticks(gy.youmonst.data)) {
/* order matters if 'holding' status condition is enabled;
set_ustuck() will set flag for botl update, You() pline will
trigger a status update with "UHold" removed */
@@ -694,7 +694,7 @@ get_mon_location(
coordxy *xp, coordxy *yp,
int locflags) /* non-zero means get location even if monster is buried */
{
if (mon == u.umonst || (u.usteed && mon == u.usteed)) {
if (mon == &gy.youmonst || (u.usteed && mon == u.usteed)) {
*xp = u.ux;
*yp = u.uy;
return TRUE;
@@ -1159,7 +1159,7 @@ unturn_dead(struct monst *mon)
struct monst *mtmp2;
char owner[BUFSZ], corpse[BUFSZ];
unsigned save_norevive;
boolean youseeit, different_type, is_u = (mon == u.umonst);
boolean youseeit, different_type, is_u = (mon == &gy.youmonst);
int corpsenm, res = 0;
youseeit = is_u ? TRUE : canseemon(mon);
@@ -1224,9 +1224,9 @@ unturn_dead(struct monst *mon)
void
unturn_you(void)
{
(void) unturn_dead(u.umonst); /* hit carried corpses and eggs */
(void) unturn_dead(&gy.youmonst); /* hit carried corpses and eggs */
if (is_undead(u.umonst->data)) {
if (is_undead(gy.youmonst.data)) {
You_feel("frightened and %sstunned.", Stunned ? "even more " : "");
make_stunned((HStun & TIMEOUT) + (long) rnd(30), FALSE);
} else {
@@ -2102,7 +2102,7 @@ stone_to_flesh_obj(struct obj *obj) /* nonnull */
non-omnivorous form, regardless of whether it's herbivorous,
non-eating, or something stranger) */
if (Role_if(PM_MONK) || !u.uconduct.unvegetarian
|| !carnivorous(u.umonst->data))
|| !carnivorous(gy.youmonst.data))
Norep("You smell the odor of meat.");
else
Norep("You smell a delicious smell.");
@@ -2206,14 +2206,14 @@ bhito(struct obj *obj, struct obj *otmp)
if (obj_shudders(obj)) {
boolean cover = ((obj == svl.level.objects[u.ux][u.uy])
&& u.uundetected
&& hides_under(u.umonst->data));
&& hides_under(gy.youmonst.data));
if (cansee(obj->ox, obj->oy))
learn_it = TRUE;
do_osshock(obj);
/* eek - your cover might have been blown */
if (cover)
(void) hideunder(u.umonst);
(void) hideunder(&gy.youmonst);
break;
}
obj = poly_obj(obj, STRANGE_OBJECT);
@@ -2440,7 +2440,7 @@ bhitpile(
/* if hiding underneath an object and zapping up or down, the top item
is either the only thing hit (up) or is skipped (down) */
hidingunder = (zz != 0 && u.uundetected && hides_under(u.umonst->data));
hidingunder = (zz != 0 && u.uundetected && hides_under(gy.youmonst.data));
first = TRUE;
if (obj->otyp == SPE_FORCE_BOLT || obj->otyp == WAN_STRIKING) {
@@ -2629,7 +2629,7 @@ dozap(void)
struct obj *obj;
int damage, need_dir;
if (nohands(u.umonst->data)) {
if (nohands(gy.youmonst.data)) {
You("aren't able to zap anything in your current form.");
return ECMD_OK;
}
@@ -2741,7 +2741,7 @@ zapyourself(struct obj *obj, boolean ordinary)
monstseesu(M_SEEN_ELEC);
ugolemeffects(AD_ELEC, orig_dmg);
}
(void) destroy_items(u.umonst, AD_ELEC, orig_dmg);
(void) destroy_items(&gy.youmonst, AD_ELEC, orig_dmg);
(void) flashburn((long) rnd(100), TRUE);
break;
@@ -2764,8 +2764,8 @@ zapyourself(struct obj *obj, boolean ordinary)
monstunseesu(M_SEEN_FIRE);
}
burn_away_slime();
(void) burnarmor(u.umonst);
(void) destroy_items(u.umonst, AD_FIRE, orig_dmg);
(void) burnarmor(&gy.youmonst);
(void) destroy_items(&gy.youmonst, AD_FIRE, orig_dmg);
ignite_items(gi.invent);
break;
@@ -2784,7 +2784,7 @@ zapyourself(struct obj *obj, boolean ordinary)
damage = orig_dmg;
monstunseesu(M_SEEN_COLD);
}
(void) destroy_items(u.umonst, AD_COLD, orig_dmg);
(void) destroy_items(&gy.youmonst, AD_COLD, orig_dmg);
break;
case WAN_MAGIC_MISSILE:
@@ -2811,7 +2811,7 @@ zapyourself(struct obj *obj, boolean ordinary)
case WAN_CANCELLATION:
case SPE_CANCELLATION:
(void) cancel_monst(u.umonst, obj, TRUE, TRUE, TRUE);
(void) cancel_monst(&gy.youmonst, obj, TRUE, TRUE, TRUE);
break;
case SPE_DRAIN_LIFE:
@@ -2884,7 +2884,7 @@ zapyourself(struct obj *obj, boolean ordinary)
case WAN_DEATH:
case SPE_FINGER_OF_DEATH:
if (nonliving(u.umonst->data) || is_demon(u.umonst->data)) {
if (nonliving(gy.youmonst.data) || is_demon(gy.youmonst.data)) {
pline((obj->otyp == WAN_DEATH)
? "The wand shoots an apparently harmless beam at you."
: "You seem no deader than before.");
@@ -2939,16 +2939,16 @@ zapyourself(struct obj *obj, boolean ordinary)
unpunish();
}
/* invent is hit iff hero doesn't escape from a trap */
if (!u.utrap || !openholdingtrap(u.umonst, &learn_it)) {
if (!u.utrap || !openholdingtrap(&gy.youmonst, &learn_it)) {
boxlock_invent(obj);
/* trigger previously escaped trapdoor */
(void) openfallingtrap(u.umonst, TRUE, &learn_it);
(void) openfallingtrap(&gy.youmonst, TRUE, &learn_it);
}
break;
case WAN_LOCKING:
case SPE_WIZARD_LOCK:
/* similar logic to opening; invent is hit iff no trap triggered */
if (u.utrap || !closeholdingtrap(u.umonst, &learn_it)) {
if (u.utrap || !closeholdingtrap(&gy.youmonst, &learn_it)) {
boxlock_invent(obj);
}
break;
@@ -3032,7 +3032,7 @@ lightdamage(
const char *how;
int dmg = amt;
if (dmg && u.umonst->data == &mons[PM_GREMLIN]) {
if (dmg && gy.youmonst.data == &mons[PM_GREMLIN]) {
/* reduce high values (from destruction of wand with many charges) */
dmg = rnd(dmg);
if (dmg > 10)
@@ -3059,7 +3059,7 @@ lightdamage(
boolean
flashburn(long duration, boolean via_lightning)
{
if (!resists_blnd(u.umonst)) {
if (!resists_blnd(&gy.youmonst)) {
You(are_blinded_by_the_flash);
make_blinded(duration, FALSE);
if (!Blind)
@@ -3072,7 +3072,7 @@ flashburn(long duration, boolean via_lightning)
if hero is both lightning resistant and blindness resistant, or
worse, have a single sparkle where the player confuses blindness
resistance for lightning resistance */
if (!via_lightning && resists_blnd_by_arti(u.umonst)) {
if (!via_lightning && resists_blnd_by_arti(&gy.youmonst)) {
shieldeff(u.ux, u.uy);
return TRUE;
}
@@ -3153,7 +3153,7 @@ cancel_monst(struct monst *mdef, struct obj *obj, boolean youattack,
static const char
writing_vanishes[] = "Some writing vanishes from %s head!",
your[] = "your"; /* should be extern */
boolean youdefend = (mdef == u.umonst);
boolean youdefend = (mdef == &gy.youmonst);
if (youdefend ? (!youattack && Antimagic)
: resist(mdef, obj->oclass, 0, NOTELL))
@@ -3281,10 +3281,10 @@ zap_updown(struct obj *obj) /* wand or spell, nonnull */
}
/* down will release you from bear trap or web */
if (u.dz > 0 && u.utrap) {
(void) openholdingtrap(u.umonst, &disclose);
(void) openholdingtrap(&gy.youmonst, &disclose);
/* down will trigger trapdoor, hole, or [spiked-] pit */
} else if (u.dz > 0 && !u.utrap) {
(void) openfallingtrap(u.umonst, FALSE, &disclose);
(void) openfallingtrap(&gy.youmonst, FALSE, &disclose);
}
break;
case WAN_STRIKING:
@@ -3319,7 +3319,7 @@ zap_updown(struct obj *obj) /* wand or spell, nonnull */
}
newsym(x, y);
} else if (u.dz > 0 && ttmp) {
if (!striking && closeholdingtrap(u.umonst, &disclose)) {
if (!striking && closeholdingtrap(&gy.youmonst, &disclose)) {
; /* now stuck in web or bear trap */
} else if (striking && ttmp->ttyp == TRAPDOOR) {
/* striking transforms trapdoor into hole */
@@ -3394,14 +3394,14 @@ zap_updown(struct obj *obj) /* wand or spell, nonnull */
/* game flavor: if you're hiding under "something"
* a zap upward should hit that "something".
*/
if (u.uundetected && hides_under(u.umonst->data)) {
if (u.uundetected && hides_under(gy.youmonst.data)) {
int hitit = 0;
otmp = svl.level.objects[u.ux][u.uy];
if (otmp)
hitit = bhito(otmp, obj);
if (hitit) {
(void) hideunder(u.umonst);
(void) hideunder(&gy.youmonst);
disclose = TRUE;
}
}
@@ -3558,7 +3558,7 @@ hit(
struct monst *mtmp, /* target; for missile, might be hero */
const char *force) /* usually either "." or "!" via exclam() */
{
boolean verbosely = (mtmp == u.umonst
boolean verbosely = (mtmp == &gy.youmonst
|| (flags.verbose
&& (cansee(gb.bhitpos.x, gb.bhitpos.y)
|| canspotmon(mtmp) || engulfing_u(mtmp))));
@@ -3982,7 +3982,7 @@ bhit(
they will be aiming at the monster */
xyglyph = glyph_at(x, y);
if (mtmp && (((weapon == THROWN_WEAPON || weapon == KICKED_WEAPON)
&& (shade_miss(u.umonst, mtmp, obj, TRUE, TRUE)
&& (shade_miss(&gy.youmonst, mtmp, obj, TRUE, TRUE)
|| (M_AP_TYPE(mtmp) == M_AP_OBJECT
&& !glyph_is_monster(xyglyph)
&& !glyph_is_warning(xyglyph)
@@ -4201,7 +4201,7 @@ boomhit(struct obj *obj, int dx, int dy)
}
if (u_at(gb.bhitpos.x, gb.bhitpos.y)) { /* ct == 9 */
if (Fumbling || rn2(20) >= ACURR(A_DEX)) {
int dam = dmgval(obj, u.umonst);
int dam = dmgval(obj, &gy.youmonst);
/* we hit ourselves */
(void) thitu(10 + obj->spe, Maybe_Half_Phys(dam), &obj,
@@ -4211,7 +4211,7 @@ boomhit(struct obj *obj, int dx, int dy)
} else { /* we catch it */
tmp_at(DISP_END, 0);
You("skillfully catch the boomerang.");
return u.umonst;
return &gy.youmonst;
}
}
tmp_at(gb.bhitpos.x, gb.bhitpos.y);
@@ -4430,9 +4430,9 @@ zhitu(
monstunseesu(M_SEEN_FIRE);
}
burn_away_slime();
if (burnarmor(u.umonst)) { /* "body hit" */
if (burnarmor(&gy.youmonst)) { /* "body hit" */
if (!rn2(3))
(void) destroy_items(u.umonst, AD_FIRE, orig_dam);
(void) destroy_items(&gy.youmonst, AD_FIRE, orig_dam);
if (!rn2(3))
ignite_items(gi.invent);
}
@@ -4449,7 +4449,7 @@ zhitu(
monstunseesu(M_SEEN_COLD);
}
if (!rn2(3))
(void) destroy_items(u.umonst, AD_COLD, orig_dam);
(void) destroy_items(&gy.youmonst, AD_COLD, orig_dam);
break;
case ZT_SLEEP:
if (Sleep_resistance) {
@@ -4490,7 +4490,7 @@ zhitu(
(void) disintegrate_arm(uarmc);
if (uarmu)
(void) disintegrate_arm(uarmu);
} else if (nonliving(u.umonst->data) || is_demon(u.umonst->data)) {
} else if (nonliving(gy.youmonst.data) || is_demon(gy.youmonst.data)) {
shieldeff(sx, sy);
You("seem unaffected.");
break;
@@ -4520,7 +4520,7 @@ zhitu(
monstunseesu(M_SEEN_ELEC);
}
if (!rn2(3))
(void) destroy_items(u.umonst, AD_ELEC, orig_dam);
(void) destroy_items(&gy.youmonst, AD_ELEC, orig_dam);
break;
case ZT_POISON_GAS:
poisoned("blast", A_DEX, "poisoned blast", 15, FALSE);
@@ -4542,7 +4542,7 @@ zhitu(
if (u.twoweap && !rn2(3))
acid_damage(uswapwep);
if (!rn2(6))
erode_armor(u.umonst, ERODE_CORRODE);
erode_armor(&gy.youmonst, ERODE_CORRODE);
break;
}
@@ -4891,7 +4891,7 @@ dobuzz(
pline("%s disintegrates.", Monnam(mon));
pline("%s body reintegrates before your %s!",
s_suffix(Monnam(mon)),
(eyecount(u.umonst->data) == 1)
(eyecount(gy.youmonst.data) == 1)
? body_part(EYE)
: makeplural(body_part(EYE)));
pline("%s resurrects!", Monnam(mon));
@@ -5803,7 +5803,7 @@ maybe_destroy_item(
long i, cnt, quan;
int dmg, xresist, skip, dindx;
const char *mult;
boolean u_carry = (carrier == u.umonst);
boolean u_carry = (carrier == &gy.youmonst);
boolean vis = !u_carry && canseemon(carrier);
boolean chargeit = FALSE;
@@ -5912,8 +5912,8 @@ maybe_destroy_item(
}
if (u_carry) { /* effects that happen only to the player */
if (osym == POTION_CLASS && dmgtyp != AD_COLD
&& (!breathless(u.umonst->data)
|| haseyes(u.umonst->data))) {
&& (!breathless(gy.youmonst.data)
|| haseyes(gy.youmonst.data))) {
potionbreathe(obj);
}
if (obj->owornmask) { /* m_useup handles these for monster */
@@ -5977,7 +5977,7 @@ destroy_items(
boolean deferred;
} items_to_destroy[MAX_ITEMS_DESTROYED];
int elig_stacks = 0; /* number of destroyable objects found so far */
boolean u_carry = (mon == u.umonst);
boolean u_carry = (mon == &gy.youmonst);
/* this is a struct obj** because we might destroy the first item in it */
struct obj **objchn = u_carry ? &gi.invent : &mon->minvent;
int dmg_out = 0; /* damage caused by items getting destroyed */