switch source tree from k&r to c99
This commit is contained in:
480
src/uhitm.c
480
src/uhitm.c
@@ -8,30 +8,28 @@
|
||||
static const char brief_feeling[] =
|
||||
"have a %s feeling for a moment, then it passes.";
|
||||
|
||||
static boolean FDECL(known_hitum, (struct monst *, struct obj *, int *,
|
||||
int, int, struct attack *, int));
|
||||
static boolean FDECL(theft_petrifies, (struct obj *));
|
||||
static void FDECL(steal_it, (struct monst *, struct attack *));
|
||||
static boolean FDECL(hitum_cleave, (struct monst *, struct attack *));
|
||||
static boolean FDECL(hitum, (struct monst *, struct attack *));
|
||||
static boolean FDECL(hmon_hitmon, (struct monst *, struct obj *, int, int));
|
||||
static int FDECL(joust, (struct monst *, struct obj *));
|
||||
static void NDECL(demonpet);
|
||||
static boolean FDECL(m_slips_free, (struct monst *, struct attack *));
|
||||
static int FDECL(explum, (struct monst *, struct attack *));
|
||||
static void FDECL(start_engulf, (struct monst *));
|
||||
static void NDECL(end_engulf);
|
||||
static int FDECL(gulpum, (struct monst *, struct attack *));
|
||||
static boolean FDECL(hmonas, (struct monst *));
|
||||
static void FDECL(nohandglow, (struct monst *));
|
||||
static boolean FDECL(shade_aware, (struct obj *));
|
||||
static boolean known_hitum(struct monst *, struct obj *, int *, int, int,
|
||||
struct attack *, int);
|
||||
static boolean theft_petrifies(struct obj *);
|
||||
static void steal_it(struct monst *, struct attack *);
|
||||
static boolean hitum_cleave(struct monst *, struct attack *);
|
||||
static boolean hitum(struct monst *, struct attack *);
|
||||
static boolean hmon_hitmon(struct monst *, struct obj *, int, int);
|
||||
static int joust(struct monst *, struct obj *);
|
||||
static void demonpet(void);
|
||||
static boolean m_slips_free(struct monst *, struct attack *);
|
||||
static int explum(struct monst *, struct attack *);
|
||||
static void start_engulf(struct monst *);
|
||||
static void end_engulf(void);
|
||||
static int gulpum(struct monst *, struct attack *);
|
||||
static boolean hmonas(struct monst *);
|
||||
static void nohandglow(struct monst *);
|
||||
static boolean shade_aware(struct obj *);
|
||||
|
||||
#define PROJECTILE(obj) ((obj) && is_ammo(obj))
|
||||
|
||||
void
|
||||
erode_armor(mdef, hurt)
|
||||
struct monst *mdef;
|
||||
int hurt;
|
||||
erode_armor(struct monst *mdef, int hurt)
|
||||
{
|
||||
struct obj *target;
|
||||
|
||||
@@ -94,9 +92,8 @@ int hurt;
|
||||
|
||||
/* FALSE means it's OK to attack */
|
||||
boolean
|
||||
attack_checks(mtmp, wep)
|
||||
register struct monst *mtmp;
|
||||
struct obj *wep; /* uwep for attack(), null for kick_monster() */
|
||||
attack_checks(struct monst *mtmp,
|
||||
struct obj *wep) /* uwep for attack(), null for kick_monster() */
|
||||
{
|
||||
int glyph;
|
||||
|
||||
@@ -231,8 +228,7 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
|
||||
* It is unchivalrous for a knight to attack the defenseless or from behind.
|
||||
*/
|
||||
void
|
||||
check_caitiff(mtmp)
|
||||
struct monst *mtmp;
|
||||
check_caitiff(struct monst *mtmp)
|
||||
{
|
||||
if (u.ualign.record <= -10)
|
||||
return;
|
||||
@@ -250,11 +246,11 @@ struct monst *mtmp;
|
||||
}
|
||||
|
||||
int
|
||||
find_roll_to_hit(mtmp, aatyp, weapon, attk_count, role_roll_penalty)
|
||||
register struct monst *mtmp;
|
||||
uchar aatyp; /* usually AT_WEAP or AT_KICK */
|
||||
struct obj *weapon; /* uwep or uswapwep or NULL */
|
||||
int *attk_count, *role_roll_penalty;
|
||||
find_roll_to_hit(struct monst *mtmp,
|
||||
uchar aatyp, /* usually AT_WEAP or AT_KICK */
|
||||
struct obj *weapon, /* uwep or uswapwep or NULL */
|
||||
int *attk_count,
|
||||
int *role_roll_penalty)
|
||||
{
|
||||
int tmp, tmp2;
|
||||
|
||||
@@ -323,8 +319,7 @@ int *attk_count, *role_roll_penalty;
|
||||
/* try to attack; return False if monster evaded;
|
||||
u.dx and u.dy must be set */
|
||||
boolean
|
||||
attack(mtmp)
|
||||
register struct monst *mtmp;
|
||||
attack(struct monst *mtmp)
|
||||
{
|
||||
register struct permonst *mdat = mtmp->data;
|
||||
|
||||
@@ -459,13 +454,10 @@ register struct monst *mtmp;
|
||||
|
||||
/* really hit target monster; returns TRUE if it still lives */
|
||||
static boolean
|
||||
known_hitum(mon, weapon, mhit, rollneeded, armorpenalty, uattk, dieroll)
|
||||
register struct monst *mon;
|
||||
struct obj *weapon;
|
||||
int *mhit;
|
||||
int rollneeded, armorpenalty; /* for monks */
|
||||
struct attack *uattk;
|
||||
int dieroll;
|
||||
known_hitum(struct monst *mon, struct obj *weapon, int *mhit, int rollneeded,
|
||||
int armorpenalty, /* for monks */
|
||||
struct attack *uattk,
|
||||
int dieroll)
|
||||
{
|
||||
boolean malive = TRUE,
|
||||
/* hmon() might destroy weapon; remember aspect for cutworm */
|
||||
@@ -519,9 +511,10 @@ int dieroll;
|
||||
/* hit the monster next to you and the monsters to the left and right of it;
|
||||
return False if the primary target is killed, True otherwise */
|
||||
static boolean
|
||||
hitum_cleave(target, uattk)
|
||||
struct monst *target; /* non-Null; forcefight at nothing doesn't cleave... */
|
||||
struct attack *uattk; /* ... but we don't enforce that here; Null works ok */
|
||||
hitum_cleave(struct monst *target, /* non-Null; forcefight at nothing doesn't
|
||||
cleave... */
|
||||
struct attack *uattk) /* ... but we don't enforce that here; Null
|
||||
works ok */
|
||||
{
|
||||
/* swings will be delivered in alternate directions; with consecutive
|
||||
attacks it will simulate normal swing and backswing; when swings
|
||||
@@ -600,9 +593,7 @@ struct attack *uattk; /* ... but we don't enforce that here; Null works ok */
|
||||
|
||||
/* hit target monster; returns TRUE if it still lives */
|
||||
static boolean
|
||||
hitum(mon, uattk)
|
||||
struct monst *mon;
|
||||
struct attack *uattk;
|
||||
hitum(struct monst *mon, struct attack *uattk)
|
||||
{
|
||||
boolean malive, wep_was_destroyed = FALSE;
|
||||
struct obj *wepbefore = uwep;
|
||||
@@ -646,11 +637,10 @@ struct attack *uattk;
|
||||
|
||||
/* general "damage monster" routine; return True if mon still alive */
|
||||
boolean
|
||||
hmon(mon, obj, thrown, dieroll)
|
||||
struct monst *mon;
|
||||
struct obj *obj;
|
||||
int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */
|
||||
int dieroll;
|
||||
hmon(struct monst *mon,
|
||||
struct obj *obj,
|
||||
int thrown, /* HMON_xxx (0 => hand-to-hand, other => ranged) */
|
||||
int dieroll)
|
||||
{
|
||||
boolean result, anger_guards;
|
||||
|
||||
@@ -666,11 +656,10 @@ int dieroll;
|
||||
|
||||
/* guts of hmon() */
|
||||
static boolean
|
||||
hmon_hitmon(mon, obj, thrown, dieroll)
|
||||
struct monst *mon;
|
||||
struct obj *obj;
|
||||
int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */
|
||||
int dieroll;
|
||||
hmon_hitmon(struct monst *mon,
|
||||
struct obj *obj,
|
||||
int thrown, /* HMON_xxx (0 => hand-to-hand, other => ranged) */
|
||||
int dieroll)
|
||||
{
|
||||
int tmp;
|
||||
struct permonst *mdat = mon->data;
|
||||
@@ -1399,8 +1388,7 @@ int dieroll;
|
||||
}
|
||||
|
||||
static boolean
|
||||
shade_aware(obj)
|
||||
struct obj *obj;
|
||||
shade_aware(struct obj *obj)
|
||||
{
|
||||
if (!obj)
|
||||
return FALSE;
|
||||
@@ -1424,10 +1412,8 @@ struct obj *obj;
|
||||
/* used for hero vs monster and monster vs monster; also handles
|
||||
monster vs hero but that won't happen because hero can't be a shade */
|
||||
boolean
|
||||
shade_miss(magr, mdef, obj, thrown, verbose)
|
||||
struct monst *magr, *mdef;
|
||||
struct obj *obj;
|
||||
boolean thrown, verbose;
|
||||
shade_miss(struct monst *magr, struct monst *mdef, struct obj *obj,
|
||||
boolean thrown, boolean verbose)
|
||||
{
|
||||
const char *what, *whose, *target;
|
||||
boolean youagr = (magr == &g.youmonst), youdef = (mdef == &g.youmonst);
|
||||
@@ -1462,9 +1448,7 @@ boolean thrown, verbose;
|
||||
/* check whether slippery clothing protects from hug or wrap attack */
|
||||
/* [currently assumes that you are the attacker] */
|
||||
static boolean
|
||||
m_slips_free(mdef, mattk)
|
||||
struct monst *mdef;
|
||||
struct attack *mattk;
|
||||
m_slips_free(struct monst *mdef, struct attack *mattk)
|
||||
{
|
||||
struct obj *obj;
|
||||
|
||||
@@ -1506,9 +1490,8 @@ struct attack *mattk;
|
||||
/* used when hitting a monster with a lance while mounted;
|
||||
1: joust hit; 0: ordinary hit; -1: joust but break lance */
|
||||
static int
|
||||
joust(mon, obj)
|
||||
struct monst *mon; /* target */
|
||||
struct obj *obj; /* weapon */
|
||||
joust(struct monst *mon, /* target */
|
||||
struct obj *obj) /* weapon */
|
||||
{
|
||||
int skill_rating, joust_dieroll;
|
||||
|
||||
@@ -1544,7 +1527,7 @@ struct obj *obj; /* weapon */
|
||||
* Pulling it out makes it work.
|
||||
*/
|
||||
static void
|
||||
demonpet()
|
||||
demonpet(void)
|
||||
{
|
||||
int i;
|
||||
struct permonst *pm;
|
||||
@@ -1559,8 +1542,7 @@ demonpet()
|
||||
}
|
||||
|
||||
static boolean
|
||||
theft_petrifies(otmp)
|
||||
struct obj *otmp;
|
||||
theft_petrifies(struct obj *otmp)
|
||||
{
|
||||
if (uarmg || otmp->otyp != CORPSE
|
||||
|| !touch_petrifies(&mons[otmp->corpsenm]) || Stone_resistance)
|
||||
@@ -1586,9 +1568,7 @@ struct obj *otmp;
|
||||
* otherwise, take one object. [Is this really the behavior we want?]
|
||||
*/
|
||||
static void
|
||||
steal_it(mdef, mattk)
|
||||
struct monst *mdef;
|
||||
struct attack *mattk;
|
||||
steal_it(struct monst *mdef, struct attack *mattk)
|
||||
{
|
||||
struct obj *otmp, *gold = 0, *ustealo, **minvent_ptr;
|
||||
long unwornmask;
|
||||
@@ -1698,11 +1678,8 @@ struct attack *mattk;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_rust(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_rust(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pd = mdef->data;
|
||||
|
||||
@@ -1756,11 +1733,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_corr(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_corr(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -1783,11 +1757,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_dcay(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_dcay(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pd = mdef->data;
|
||||
|
||||
@@ -1839,11 +1810,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_dren(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_dren(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -1877,11 +1845,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_drli(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_drli(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -1956,11 +1921,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_fire(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_fire(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pd = mdef->data;
|
||||
|
||||
@@ -2076,11 +2038,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_cold(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_cold(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -2141,11 +2100,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_elec(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_elec(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -2212,11 +2168,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_acid(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_acid(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -2259,11 +2212,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_sgld(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_sgld(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pa = magr->data;
|
||||
struct permonst *pd = mdef->data;
|
||||
@@ -2327,11 +2277,8 @@ struct mhitm_data *mhm;
|
||||
|
||||
|
||||
void
|
||||
mhitm_ad_tlpt(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_tlpt(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -2427,11 +2374,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_blnd(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_blnd(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -2474,11 +2418,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_curs(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_curs(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pa = magr->data;
|
||||
struct permonst *pd = mdef->data;
|
||||
@@ -2557,11 +2498,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_drst(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_drst(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pa = magr->data;
|
||||
|
||||
@@ -2628,11 +2566,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_drin(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_drin(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pd = mdef->data;
|
||||
|
||||
@@ -2729,11 +2664,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_stck(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_stck(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pd = mdef->data;
|
||||
|
||||
@@ -2765,11 +2697,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_wrap(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_wrap(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pd = mdef->data;
|
||||
|
||||
@@ -2841,11 +2770,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_plys(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_plys(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -2895,11 +2821,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_slee(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm UNUSED;
|
||||
mhitm_ad_slee(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm UNUSED)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -2946,11 +2869,8 @@ struct mhitm_data *mhm UNUSED;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_slim(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_slim(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pd = mdef->data;
|
||||
|
||||
@@ -3027,11 +2947,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_ench(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm UNUSED;
|
||||
mhitm_ad_ench(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm UNUSED)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -3078,11 +2995,8 @@ struct mhitm_data *mhm UNUSED;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_slow(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm UNUSED;
|
||||
mhitm_ad_slow(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm UNUSED)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -3122,11 +3036,8 @@ struct mhitm_data *mhm UNUSED;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_conf(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_conf(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -3163,11 +3074,10 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_poly(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk UNUSED; /* implied */
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_poly(struct monst *magr,
|
||||
struct attack *mattk UNUSED, /* implied */
|
||||
struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -3193,11 +3103,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_famn(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk UNUSED;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_famn(struct monst *magr, struct attack *mattk UNUSED,
|
||||
struct monst *mdef, struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -3216,11 +3123,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_pest(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk UNUSED;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_pest(struct monst *magr, struct attack *mattk UNUSED,
|
||||
struct monst *mdef, struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pa = magr->data;
|
||||
|
||||
@@ -3239,11 +3143,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_deth(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk UNUSED;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_deth(struct monst *magr, struct attack *mattk UNUSED,
|
||||
struct monst *mdef, struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pd = mdef->data;
|
||||
|
||||
@@ -3292,11 +3193,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_halu(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk UNUSED;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_halu(struct monst *magr, struct attack *mattk UNUSED,
|
||||
struct monst *mdef, struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pd = mdef->data;
|
||||
|
||||
@@ -3320,8 +3218,7 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
boolean
|
||||
do_stone_u(mtmp)
|
||||
struct monst *mtmp;
|
||||
do_stone_u(struct monst *mtmp)
|
||||
{
|
||||
if (!Stoned && !Stone_resistance
|
||||
&& !(poly_when_stoned(g.youmonst.data)
|
||||
@@ -3342,11 +3239,8 @@ struct monst *mtmp;
|
||||
}
|
||||
|
||||
void
|
||||
do_stone_mon(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk UNUSED;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
do_stone_mon(struct monst *magr, struct attack *mattk UNUSED,
|
||||
struct monst *mdef, struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pd = mdef->data;
|
||||
|
||||
@@ -3379,11 +3273,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_phys(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_phys(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pa = magr->data;
|
||||
struct permonst *pd = mdef->data;
|
||||
@@ -3563,11 +3454,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_ston(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_ston(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -3605,11 +3493,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_were(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_were(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pa = magr->data;
|
||||
|
||||
@@ -3640,11 +3525,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_heal(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_heal(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pd = mdef->data;
|
||||
|
||||
@@ -3728,11 +3610,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_stun(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_stun(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pd = mdef->data;
|
||||
|
||||
@@ -3767,11 +3646,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_legs(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_legs(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -3836,11 +3712,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_dgst(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk UNUSED;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_dgst(struct monst *magr, struct attack *mattk UNUSED,
|
||||
struct monst *mdef, struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pd = mdef->data;
|
||||
|
||||
@@ -3911,11 +3784,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_samu(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_samu(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -3935,11 +3805,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_dise(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_dise(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pa = magr->data;
|
||||
|
||||
@@ -3958,11 +3825,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_sedu(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_sedu(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
struct permonst *pa = magr->data;
|
||||
|
||||
@@ -4093,11 +3957,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_ad_ssex(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_ad_ssex(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
if (magr == &g.youmonst) {
|
||||
/* uhitm */
|
||||
@@ -4127,11 +3988,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
void
|
||||
mhitm_adtyping(magr, mattk, mdef, mhm)
|
||||
struct monst *magr;
|
||||
struct attack *mattk;
|
||||
struct monst *mdef;
|
||||
struct mhitm_data *mhm;
|
||||
mhitm_adtyping(struct monst *magr, struct attack *mattk, struct monst *mdef,
|
||||
struct mhitm_data *mhm)
|
||||
{
|
||||
switch (mattk->adtyp) {
|
||||
case AD_STUN: mhitm_ad_stun(magr, mattk, mdef, mhm); break;
|
||||
@@ -4182,10 +4040,8 @@ struct mhitm_data *mhm;
|
||||
}
|
||||
|
||||
int
|
||||
damageum(mdef, mattk, specialdmg)
|
||||
register struct monst *mdef;
|
||||
register struct attack *mattk;
|
||||
int specialdmg; /* blessed and/or silver bonus against various things */
|
||||
damageum(struct monst *mdef, struct attack *mattk,
|
||||
int specialdmg) /* blessed and/or silver bonus against various things */
|
||||
{
|
||||
int armpro;
|
||||
boolean negated;
|
||||
@@ -4229,9 +4085,7 @@ int specialdmg; /* blessed and/or silver bonus against various things */
|
||||
}
|
||||
|
||||
static int
|
||||
explum(mdef, mattk)
|
||||
register struct monst *mdef;
|
||||
register struct attack *mattk;
|
||||
explum(struct monst *mdef, struct attack *mattk)
|
||||
{
|
||||
boolean resistance; /* only for cold/fire/elec */
|
||||
register int tmp = d((int) mattk->damn, (int) mattk->damd);
|
||||
@@ -4282,8 +4136,7 @@ register struct attack *mattk;
|
||||
}
|
||||
|
||||
static void
|
||||
start_engulf(mdef)
|
||||
struct monst *mdef;
|
||||
start_engulf(struct monst *mdef)
|
||||
{
|
||||
if (!Invisible) {
|
||||
map_location(u.ux, u.uy, TRUE);
|
||||
@@ -4296,7 +4149,7 @@ struct monst *mdef;
|
||||
}
|
||||
|
||||
static void
|
||||
end_engulf()
|
||||
end_engulf(void)
|
||||
{
|
||||
if (!Invisible) {
|
||||
tmp_at(DISP_END, 0);
|
||||
@@ -4305,9 +4158,7 @@ end_engulf()
|
||||
}
|
||||
|
||||
static int
|
||||
gulpum(mdef, mattk)
|
||||
register struct monst *mdef;
|
||||
register struct attack *mattk;
|
||||
gulpum(struct monst *mdef, struct attack *mattk)
|
||||
{
|
||||
#ifdef LINT /* static char msgbuf[BUFSZ]; */
|
||||
char msgbuf[BUFSZ];
|
||||
@@ -4523,10 +4374,7 @@ register struct attack *mattk;
|
||||
}
|
||||
|
||||
void
|
||||
missum(mdef, mattk, wouldhavehit)
|
||||
register struct monst *mdef;
|
||||
register struct attack *mattk;
|
||||
boolean wouldhavehit;
|
||||
missum(struct monst *mdef, struct attack *mattk, boolean wouldhavehit)
|
||||
{
|
||||
if (wouldhavehit) /* monk is missing due to penalty for wearing suit */
|
||||
Your("armor is rather cumbersome...");
|
||||
@@ -4543,8 +4391,7 @@ boolean wouldhavehit;
|
||||
|
||||
/* attack monster as a monster; returns True if mon survives */
|
||||
static boolean
|
||||
hmonas(mon)
|
||||
register struct monst *mon;
|
||||
hmonas(struct monst *mon)
|
||||
{
|
||||
struct attack *mattk, alt_attk;
|
||||
struct obj *weapon, **originalweapon;
|
||||
@@ -4935,13 +4782,12 @@ register struct monst *mon;
|
||||
/* Special (passive) attacks on you by monsters done here.
|
||||
*/
|
||||
int
|
||||
passive(mon, weapon, mhitb, maliveb, aatyp, wep_was_destroyed)
|
||||
struct monst *mon;
|
||||
struct obj *weapon; /* uwep or uswapwep or uarmg or uarmf or Null */
|
||||
boolean mhitb;
|
||||
boolean maliveb;
|
||||
uchar aatyp;
|
||||
boolean wep_was_destroyed;
|
||||
passive(struct monst *mon,
|
||||
struct obj *weapon, /* uwep or uswapwep or uarmg or uarmf or Null */
|
||||
boolean mhitb,
|
||||
boolean maliveb,
|
||||
uchar aatyp,
|
||||
boolean wep_was_destroyed)
|
||||
{
|
||||
register struct permonst *ptr = mon->data;
|
||||
register int i, tmp;
|
||||
@@ -5174,10 +5020,9 @@ boolean wep_was_destroyed;
|
||||
* Assumes the attack was successful.
|
||||
*/
|
||||
void
|
||||
passive_obj(mon, obj, mattk)
|
||||
struct monst *mon;
|
||||
struct obj *obj; /* null means pick uwep, uswapwep or uarmg */
|
||||
struct attack *mattk; /* null means we find one internally */
|
||||
passive_obj(struct monst *mon,
|
||||
struct obj *obj, /* null means pick uwep, uswapwep or uarmg */
|
||||
struct attack *mattk) /* null means we find one internally */
|
||||
{
|
||||
struct permonst *ptr = mon->data;
|
||||
int i;
|
||||
@@ -5244,8 +5089,7 @@ struct attack *mattk; /* null means we find one internally */
|
||||
|
||||
/* Note: caller must ascertain mtmp is mimicking... */
|
||||
void
|
||||
stumble_onto_mimic(mtmp)
|
||||
struct monst *mtmp;
|
||||
stumble_onto_mimic(struct monst *mtmp)
|
||||
{
|
||||
const char *fmt = "Wait! That's %s!", *generic = "a monster", *what = 0;
|
||||
|
||||
@@ -5287,8 +5131,7 @@ struct monst *mtmp;
|
||||
}
|
||||
|
||||
static void
|
||||
nohandglow(mon)
|
||||
struct monst *mon;
|
||||
nohandglow(struct monst *mon)
|
||||
{
|
||||
char *hands = makeplural(body_part(HAND));
|
||||
|
||||
@@ -5310,9 +5153,8 @@ struct monst *mon;
|
||||
|
||||
/* returns 1 if light flash has noticeable effect on 'mtmp', 0 otherwise */
|
||||
int
|
||||
flash_hits_mon(mtmp, otmp)
|
||||
struct monst *mtmp;
|
||||
struct obj *otmp; /* source of flash */
|
||||
flash_hits_mon(struct monst *mtmp,
|
||||
struct obj *otmp) /* source of flash */
|
||||
{
|
||||
struct rm *lev;
|
||||
int tmp, amt, useeit, res = 0;
|
||||
@@ -5366,9 +5208,7 @@ struct obj *otmp; /* source of flash */
|
||||
}
|
||||
|
||||
void
|
||||
light_hits_gremlin(mon, dmg)
|
||||
struct monst *mon;
|
||||
int dmg;
|
||||
light_hits_gremlin(struct monst *mon, int dmg)
|
||||
{
|
||||
pline("%s %s!", Monnam(mon),
|
||||
(dmg > mon->mhp / 2) ? "wails in agony" : "cries out in pain");
|
||||
|
||||
Reference in New Issue
Block a user