/* ### mkroom.c ### */
-extern void mkroom(int);
+extern void do_mkroom(int);
extern void fill_zoo(struct mkroom *);
extern struct permonst *antholemon(void);
extern boolean nexttodoor(int, int);
extern boolean attack_checks(struct monst *, struct obj *);
extern void check_caitiff(struct monst *);
extern int find_roll_to_hit(struct monst *, uchar, struct obj *, int *, int *);
-extern boolean attack(struct monst *);
+extern boolean do_attack(struct monst *);
extern boolean hmon(struct monst *, struct obj *, int, int);
extern boolean shade_miss(struct monst *, struct monst *, struct obj *,
boolean, boolean);
if (proficient < 0)
proficient = 0;
- if (u.uswallow && attack(u.ustuck)) {
+ if (u.uswallow && do_attack(u.ustuck)) {
There("is not enough room to flick your bullwhip.");
} else if (Underwater) {
if (bigmonst(mtmp->data)) {
wrapped_what = strcpy(buf, mon_nam(mtmp));
} else if (proficient) {
- if (attack(mtmp))
+ if (do_attack(mtmp))
return 1;
else
pline1(msg_snap);
else
You("flick your bullwhip towards %s.", mon_nam(mtmp));
if (proficient) {
- if (attack(mtmp))
+ if (do_attack(mtmp))
return 1;
else
pline1(msg_snap);
boolean ispick = is_pick(obj);
const char *verbing = ispick ? "digging" : "chopping";
- if (u.uswallow && attack(u.ustuck)) {
+ if (u.uswallow && do_attack(u.ustuck)) {
; /* return 1 */
} else if (Underwater) {
pline("Turbulence torpedoes your %s attempts.", verbing);
return 1;
}
lev = &levl[rx][ry];
- if (MON_AT(rx, ry) && attack(m_at(rx, ry)))
+ if (MON_AT(rx, ry) && do_attack(m_at(rx, ry)))
return 1;
dig_target = dig_typ(obj, rx, ry);
if (dig_target == DIGTYP_UNDIGGABLE) {
/* attack monster */
if (mtmp) {
/* don't stop travel when displacing pets; if the
- displace fails for some reason, attack() in uhitm.c
+ displace fails for some reason, do_attack() in uhitm.c
will stop travel rather than domove */
if (!is_safemon(mtmp) || g.context.forcefight)
nomul(0);
/* only attack if we know it's there */
/* or if we used the 'F' command to fight blindly */
- /* or if it hides_under, in which case we call attack() to print
+ /* or if it hides_under, in which case we call do_attack() to print
* the Wait! message.
* This is different from ceiling hiders, who aren't handled in
- * attack().
+ * do_attack().
*/
/* If they used a 'm' command, trying to move onto a monster
* prints the below message and wastes a turn. The exception is
* if the monster is unseen and the player doesn't remember an
- * invisible monster--then, we fall through to attack() and
+ * invisible monster--then, we fall through to do_attack() and
* attack_check(), which still wastes a turn, but prints a
* different message and makes the player remember the monster.
*/
/* try to attack; note that it might evade;
also, we don't attack tame when _safepet_ */
- else if (attack(mtmp))
+ else if (do_attack(mtmp))
return;
}
}
/*
* If safepet at destination then move the pet to the hero's
- * previous location using the same conditions as in attack().
+ * previous location using the same conditions as in do_attack().
* there are special extenuating circumstances:
* (1) if the pet dies then your god angers,
* (2) if the pet gets trapped then your god may disapprove.
overexertion(void)
{
/* this used to be part of domove() when moving to a monster's
- position, but is now called by attack() so that it doesn't
+ position, but is now called by do_attack() so that it doesn't
execute if you decline to attack a peaceful monster */
gethungry();
if ((g.moves % 3L) != 0L && near_capacity() >= HVY_ENCUMBER) {
if (m_at(fx, fy) != magr || m_at(tx, ty) != mdef)
return MM_MISS;
- /* The 1 in 7 failure below matches the chance in attack()
+ /* The 1 in 7 failure below matches the chance in do_attack()
* for pet displacement.
*/
if (!rn2(7))
* note that mkroom doesn't guarantee a room gets created, and that this
* step only sets the room's rtype - it doesn't fill it yet. */
if (wizard && nh_getenv("SHOPTYPE"))
- mkroom(SHOPBASE);
+ do_mkroom(SHOPBASE);
else if (u_depth > 1 && u_depth < depth(&medusa_level)
&& g.nroom >= room_threshold && rn2(u_depth) < 3)
- mkroom(SHOPBASE);
+ do_mkroom(SHOPBASE);
else if (u_depth > 4 && !rn2(6))
- mkroom(COURT);
+ do_mkroom(COURT);
else if (u_depth > 5 && !rn2(8)
&& !(g.mvitals[PM_LEPRECHAUN].mvflags & G_GONE))
- mkroom(LEPREHALL);
+ do_mkroom(LEPREHALL);
else if (u_depth > 6 && !rn2(7))
- mkroom(ZOO);
+ do_mkroom(ZOO);
else if (u_depth > 8 && !rn2(5))
- mkroom(TEMPLE);
+ do_mkroom(TEMPLE);
else if (u_depth > 9 && !rn2(5)
&& !(g.mvitals[PM_KILLER_BEE].mvflags & G_GONE))
- mkroom(BEEHIVE);
+ do_mkroom(BEEHIVE);
else if (u_depth > 11 && !rn2(6))
- mkroom(MORGUE);
+ do_mkroom(MORGUE);
else if (u_depth > 12 && !rn2(8) && antholemon())
- mkroom(ANTHOLE);
+ do_mkroom(ANTHOLE);
else if (u_depth > 14 && !rn2(4)
&& !(g.mvitals[PM_SOLDIER].mvflags & G_GONE))
- mkroom(BARRACKS);
+ do_mkroom(BARRACKS);
else if (u_depth > 15 && !rn2(6))
- mkroom(SWAMP);
+ do_mkroom(SWAMP);
else if (u_depth > 16 && !rn2(8)
&& !(g.mvitals[PM_COCKATRICE].mvflags & G_GONE))
- mkroom(COCKNEST);
+ do_mkroom(COCKNEST);
skip0:
/* Place multi-dungeon branch. */
/*
* Entry points:
- * mkroom() -- make and stock a room of a given type
+ * do_mkroom() -- make and stock a room of a given type
* nexttodoor() -- return TRUE if adjacent to a door
* has_dnstairs() -- return TRUE if given room has a down staircase
* has_upstairs() -- return TRUE if given room has an up staircase
/* make and stock a room of a given type */
void
-mkroom(int roomtype)
+do_mkroom(int roomtype)
{
if (roomtype >= SHOPBASE)
mkshop(); /* someday, we should be able to specify shop type */
/* FALSE means it's OK to attack */
boolean
attack_checks(struct monst *mtmp,
- struct obj *wep) /* uwep for attack(), null for kick_monster() */
+ struct obj *wep) /* uwep for do_attack(), null for kick_monster() */
{
int glyph;
/* try to attack; return False if monster evaded;
u.dx and u.dy must be set */
boolean
-attack(struct monst *mtmp)
+do_attack(struct monst *mtmp)
{
register struct permonst *mdat = mtmp->data;
&attknum, &armorpenalty);
dieroll = rnd(20);
mhit = (tmp > dieroll);
- g.bhitpos.x = tx, g.bhitpos.y = ty; /* normally set up by attack() */
+ g.bhitpos.x = tx, g.bhitpos.y = ty; /* normally set up by
+ do_attack() */
(void) known_hitum(mtmp, uwep, &mhit, tmp, armorpenalty,
uattk, dieroll);
(void) passive(mtmp, uwep, mhit, !DEADMONSTER(mtmp), AT_WEAP, !uwep);