-/* $NetBSD: hack.c,v 1.7 2006/11/24 19:46:58 christos Exp $ */
+/* $NetBSD: hack.c,v 1.9 2009/08/12 07:28:40 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.c,v 1.7 2006/11/24 19:46:58 christos Exp $");
+__RCSID("$NetBSD: hack.c,v 1.9 2009/08/12 07:28:40 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
+static void movobj(struct obj *, int, int);
+static int inv_cnt(void);
+
/*
* called on movement: 1. when throwing ball+chain far away 2. when
* teleporting 3. when walking out of a lit room
*/
void
-unsee()
+unsee(void)
{
int x, y;
struct rm *lev;
* hack.do.c: seeoff(1) - go up or down the stairs in hack.trap.c:seeoff(1)
* - fall through trapdoor
*/
+/* mode: */
+ /* 1 to redo @, 0 to leave them *//* 1 means
+ * misc movement, 0 means blindness */
void
-seeoff(mode)
- int mode; /* 1 to redo @, 0 to leave them *//* 1 means
- * misc movement, 0 means blindness */
+seeoff(int mode)
{
int x, y;
struct rm *lev;
}
void
-domove()
+domove(void)
{
xchar oldx, oldy;
struct monst *mtmp = NULL;
read_engr_at(u.ux, u.uy);
}
-void
-movobj(obj, ox, oy)
- struct obj *obj;
- int ox, oy;
+static void
+movobj(struct obj *obj, int ox, int oy)
{
/* Some dirty programming to get display right */
freeobj(obj);
}
int
-dopickup()
+dopickup(void)
{
if (!g_at(u.ux, u.uy) && !o_at(u.ux, u.uy)) {
pline("There is nothing here to pick up.");
/* turn around a corner if that is the only way we can proceed */
/* do not turn left or right twice */
void
-lookaround()
+lookaround(void)
{
int x, y, i, x0 = 0, y0 = 0, m0 = 0, i0 = 9;
int corrct = 0, noturn = 0;
/* something like lookaround, but we are not running */
/* react only to monsters that might hit us */
int
-monster_nearby()
+monster_nearby(void)
{
int x, y;
struct monst *mtmp;
#ifdef QUEST
int
-cansee(x, y)
- xchar x, y;
+cansee(xchar x, xchar y)
{
int dx, dy, adx, ady, sdx, sdy, dmax, d;
if (Blind)
}
int
-rroom(x, y)
- int x, y;
+rroom(int x, int y)
{
return (IS_ROOM(levl[u.ux + x][u.uy + y].typ));
}
#else
int
-cansee(x, y)
- xchar x, y;
+cansee(xchar x, xchar y)
{
if (Blind || u.uswallow)
return (0);
#endif /* QUEST */
int
-sgn(a)
- int a;
+sgn(int a)
{
return ((a > 0) ? 1 : (a == 0) ? 0 : -1);
}
#ifdef QUEST
void
-setsee()
+setsee(void)
{
int x, y;
#else
void
-setsee()
+setsee(void)
{
int x, y;
#endif /* QUEST */
void
-nomul(nval)
- int nval;
+nomul(int nval)
{
if (multi < 0)
return;
}
int
-abon()
+abon(void)
{
if (u.ustr == 3)
return (-3);
}
int
-dbon()
+dbon(void)
{
if (u.ustr < 6)
return (-1);
return (6);
}
+/* may kill you; cause may be poison or */
+/* monster like 'A' */
void
-losestr(num) /* may kill you; cause may be poison or */
- int num; /* monster like 'A' */
+losestr(int num)
{
u.ustr -= num;
while (u.ustr < 3) {
}
void
-losehp(n, knam)
- int n;
- const char *knam;
+losehp(int n, const char *knam)
{
u.uhp -= n;
if (u.uhp > u.uhpmax)
}
void
-losehp_m(n, mtmp)
- int n;
- struct monst *mtmp;
+losehp_m(int n, struct monst *mtmp)
{
u.uhp -= n;
flags.botl = 1;
}
void
-losexp()
+losexp(void)
{ /* hit by V or W */
int num;
}
int
-inv_weight()
+inv_weight(void)
{
struct obj *otmp = invent;
int wt = (u.ugold + 500) / 1000;
return (wt - carrcap);
}
-int
-inv_cnt()
+static int
+inv_cnt(void)
{
struct obj *otmp = invent;
int ct = 0;
}
long
-newuexp()
+newuexp(void)
{
return (10 * (1L << (u.ulevel - 1)));
}