diff options
Diffstat (limited to 'hack/hack.mon.c')
-rw-r--r-- | hack/hack.mon.c | 81 |
1 files changed, 28 insertions, 53 deletions
diff --git a/hack/hack.mon.c b/hack/hack.mon.c index 187382ff..8ee9b470 100644 --- a/hack/hack.mon.c +++ b/hack/hack.mon.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.mon.c,v 1.8 2008/01/28 06:55:41 dholland Exp $ */ +/* $NetBSD: hack.mon.c,v 1.9 2009/06/07 18:30:39 dholland Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: hack.mon.c,v 1.8 2008/01/28 06:55:41 dholland Exp $"); +__RCSID("$NetBSD: hack.mon.c,v 1.9 2009/06/07 18:30:39 dholland Exp $"); #endif /* not lint */ #include <stdlib.h> @@ -83,7 +83,7 @@ const char *const warnings[] = { }; void -movemon() +movemon(void) { struct monst *mtmp; int fr; @@ -173,9 +173,7 @@ next_mon: } void -justswld(mtmp, name) - struct monst *mtmp; - const char *name; +justswld(struct monst *mtmp, const char *name) { mtmp->mx = u.ux; @@ -191,10 +189,7 @@ justswld(mtmp, name) } void -youswld(mtmp, dam, die, name) - struct monst *mtmp; - int dam, die; - const char *name; +youswld(struct monst *mtmp, int dam, int die, const char *name) { if (mtmp != u.ustuck) return; @@ -212,8 +207,7 @@ youswld(mtmp, dam, die, name) } int -dochugw(mtmp) - struct monst *mtmp; +dochugw(struct monst *mtmp) { int x = mtmp->mx; int y = mtmp->my; @@ -233,8 +227,7 @@ dochugw(mtmp) /* returns 1 if monster died moving, 0 otherwise */ int -dochug(mtmp) - struct monst *mtmp; +dochug(struct monst *mtmp) { const struct permonst *mdat; int tmp = 0, nearby, scared; @@ -548,8 +541,7 @@ postmov: } void -mpickgold(mtmp) - struct monst *mtmp; +mpickgold(struct monst *mtmp) { struct gold *gold; while ((gold = g_at(mtmp->mx, mtmp->my)) != NULL) { @@ -561,8 +553,7 @@ mpickgold(mtmp) } void -mpickgems(mtmp) - struct monst *mtmp; +mpickgems(struct monst *mtmp) { struct obj *otmp; for (otmp = fobj; otmp; otmp = otmp->nobj) @@ -579,10 +570,7 @@ mpickgems(mtmp) /* return number of acceptable neighbour positions */ int -mfndpos(mon, poss, info, flag) - struct monst *mon; - coord poss[9]; - int info[9], flag; +mfndpos(struct monst *mon, coord poss[9], int info[9], int flag) { int x, y, nx, ny, cnt = 0, ntyp; struct monst *mtmp; @@ -674,15 +662,13 @@ nexttry: /* eels prefer the water, but if there is no } int -dist(x, y) - int x, y; +dist(int x, int y) { return ((x - u.ux) * (x - u.ux) + (y - u.uy) * (y - u.uy)); } void -poisoned(string, pname) - const char *string, *pname; +poisoned(const char *string, const char *pname) { int i; @@ -710,8 +696,7 @@ poisoned(string, pname) } void -mondead(mtmp) - struct monst *mtmp; +mondead(struct monst *mtmp) { relobj(mtmp, 1); unpmon(mtmp); @@ -730,8 +715,7 @@ mondead(mtmp) /* called when monster is moved to larger structure */ void -replmon(mtmp, mtmp2) - struct monst *mtmp, *mtmp2; +replmon(struct monst *mtmp, struct monst *mtmp2) { relmon(mtmp); monfree(mtmp); @@ -746,8 +730,7 @@ replmon(mtmp, mtmp2) } void -relmon(mon) - struct monst *mon; +relmon(struct monst *mon) { struct monst *mtmp; @@ -767,15 +750,14 @@ struct monst *fdmon; /* chain of dead monsters, need not to be * saved */ void -monfree(mtmp) - struct monst *mtmp; +monfree(struct monst *mtmp) { mtmp->nmon = fdmon; fdmon = mtmp; } void -dmonsfree() +dmonsfree(void) { struct monst *mtmp; while ((mtmp = fdmon) != NULL) { @@ -785,8 +767,7 @@ dmonsfree() } void -unstuck(mtmp) - struct monst *mtmp; +unstuck(struct monst *mtmp) { if (u.ustuck == mtmp) { if (u.uswallow) { @@ -801,8 +782,7 @@ unstuck(mtmp) } void -killed(mtmp) - struct monst *mtmp; +killed(struct monst *mtmp) { #ifdef lint #define NEW_SCORING @@ -940,7 +920,7 @@ kludge(const char *str, const char *arg) } void -rescham() +rescham(void) { /* force all chameleons to become normal */ struct monst *mtmp; @@ -951,11 +931,10 @@ rescham() } } -int -newcham(mtmp, mdat) /* make a chameleon look like a new monster */ +/* make a chameleon look like a new monster */ /* returns 1 if the monster actually changed */ - struct monst *mtmp; - const struct permonst *mdat; +int +newcham(struct monst *mtmp, const struct permonst *mdat) { int mhp, hpn, hpd; @@ -996,10 +975,9 @@ newcham(mtmp, mdat) /* make a chameleon look like a new monster */ return (1); } +/* Make monster mtmp next to you (if possible) */ void -mnexto(mtmp) /* Make monster mtmp next to you (if - * possible) */ - struct monst *mtmp; +mnexto(struct monst *mtmp) { coord mm; mm = enexto(u.ux, u.uy); @@ -1009,15 +987,13 @@ mnexto(mtmp) /* Make monster mtmp next to you (if } int -ishuman(mtmp) - struct monst *mtmp; +ishuman(struct monst *mtmp) { return (mtmp->data->mlet == '@'); } void -setmangry(mtmp) - struct monst *mtmp; +setmangry(struct monst *mtmp) { if (!mtmp->mpeaceful) return; @@ -1033,8 +1009,7 @@ setmangry(mtmp) * object */ int -canseemon(mtmp) - struct monst *mtmp; +canseemon(struct monst *mtmp) { return ((!mtmp->minvis || See_invisible) && (!mtmp->mhide || !o_at(mtmp->mx, mtmp->my)) |