-/* $NetBSD: hack.zap.c,v 1.7 2004/01/27 20:30:29 jsm Exp $ */
+/* $NetBSD: hack.zap.c,v 1.9 2009/08/12 07:28:41 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.zap.c,v 1.7 2004/01/27 20:30:29 jsm Exp $");
+__RCSID("$NetBSD: hack.zap.c,v 1.9 2009/08/12 07:28:41 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-const char *const fl[] = {
+static const char *const fl[] = {
"magic missile",
"bolt of fire",
"sleep ray",
"death ray"
};
+static void bhitm(struct monst *, struct obj *);
+static int bhito(struct obj *, struct obj *);
+static char dirlet(int, int);
+static int zhit(struct monst *, int);
+static int revive(struct obj *);
+static void rloco(struct obj *);
+static void burn_scrolls(void);
+
/* Routines for IMMEDIATE wands. */
/* bhitm: monster mtmp was hit by the effect of wand otmp */
-void
-bhitm(mtmp, otmp)
- struct monst *mtmp;
- struct obj *otmp;
+static void
+bhitm(struct monst *mtmp, struct obj *otmp)
{
wakeup(mtmp);
switch (otmp->otyp) {
}
}
-int
-bhito(obj, otmp) /* object obj was hit by the effect of wand
- * otmp */
- struct obj *obj, *otmp; /* returns TRUE if sth was done */
+/*
+ * object obj was hit by the effect of wand otmp
+ * returns TRUE if sth was done
+ */
+static int
+bhito(struct obj *obj, struct obj *otmp)
{
int res = TRUE;
}
int
-dozap()
+dozap(void)
{
struct obj *obj;
xchar zx, zy;
}
const char *
-exclam(force)
- int force;
+exclam(int force)
{
/* force == 0 occurs e.g. with sleep ray */
/*
}
void
-hit(str, mtmp, force)
- const char *str;
- struct monst *mtmp;
- const char *force; /* usually either "." or "!" */
+hit(const char *str, struct monst *mtmp, const char *force)
{
+ /* force is usually either "." or "!" */
+
if (!cansee(mtmp->mx, mtmp->my))
pline("The %s hits it.", str);
else
}
void
-miss(str, mtmp)
- const char *str;
- struct monst *mtmp;
+miss(const char *str, struct monst *mtmp)
{
if (!cansee(mtmp->mx, mtmp->my))
pline("The %s misses it.", str);
/* check !u.uswallow before calling bhit() */
struct monst *
-bhit(ddx, ddy, range, sym, fhitm, fhito, obj)
- int ddx, ddy, range; /* direction and range */
- char sym; /* symbol displayed on path */
- /* fns called when mon/obj hit */
- void (*fhitm)(struct monst *, struct obj *);
- int (*fhito)(struct obj *, struct obj *);
- struct obj *obj; /* 2nd arg to fhitm/fhito */
+bhit(int ddx, int ddy, int range, /* direction and range */
+ int sym, /* symbol displayed on path */
+ /* fns called when mon/obj hit */
+ void (*fhitm)(struct monst *, struct obj *),
+ int (*fhito)(struct obj *, struct obj *),
+ struct obj *obj) /* 2nd arg to fhitm/fhito */
{
struct monst *mtmp;
struct obj *otmp;
return (0);
}
-char
-dirlet(dx, dy)
- int dx, dy;
+static char
+dirlet(int dx, int dy)
{
return
(dx == dy) ? '\\' : (dx && dy) ? '/' : dx ? '-' : '|';
/* type == -1,-2,-3: bolts sent out by wizard */
/* called with dx = dy = 0 with vertical bolts */
void
-buzz(type, sx, sy, dx, dy)
- int type;
- xchar sx, sy;
- int dx, dy;
+buzz(int type, xchar sx, xchar sy, int dx, int dy)
{
int abstype = abs(type);
const char *fltxt = (type == -1) ? "blaze of fire" : fl[abstype];
Tmp_at(-1, -1);
}
-int
-zhit(mon, type) /* returns damage to mon */
- struct monst *mon;
- int type;
+static int
+zhit(struct monst *mon, int type) /* returns damage to mon */
{
int tmp = 0;
#define CORPSE_I_TO_C(otyp) (char) ((otyp >= DEAD_ACID_BLOB)\
? 'a' + (otyp - DEAD_ACID_BLOB)\
: '@' + (otyp - DEAD_HUMAN))
-int
-revive(obj)
- struct obj *obj;
+static int
+revive(struct obj *obj)
{
struct monst *mtmp = NULL;
return (!!mtmp); /* TRUE if some monster created */
}
-void
-rloco(obj)
- struct obj *obj;
+static void
+rloco(struct obj *obj)
{
int tx, ty, otx, oty;
newsym(otx, oty);
}
+/* fractured by pick-axe or wand of striking */
+/* no texts here! */
void
-fracture_rock(obj) /* fractured by pick-axe or wand of striking */
- struct obj *obj; /* no texts here! */
+fracture_rock(struct obj *obj)
{
/* unpobj(obj); */
obj->otyp = ROCK;
prl(obj->ox, obj->oy);
}
-void
-burn_scrolls()
+static void
+burn_scrolls(void)
{
struct obj *obj, *obj2;
int cnt = 0;