-/* $NetBSD: hack.trap.c,v 1.6 2001/03/25 20:44:03 jsm Exp $ */
+/* $NetBSD: hack.trap.c,v 1.10 2011/08/07 06:03:45 dholland Exp $ */
/*
- * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
+ * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
+ * Amsterdam
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * - Neither the name of the Stichting Centrum voor Wiskunde en
+ * Informatica, nor the names of its contributors may be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 1982 Jay Fenlason <hack@gnu.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.trap.c,v 1.6 2001/03/25 20:44:03 jsm Exp $");
+__RCSID("$NetBSD: hack.trap.c,v 1.10 2011/08/07 06:03:45 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
" mimic"
};
+static void vtele(void);
+static void teleds(int, int);
+static int teleok(int, int);
+
struct trap *
-maketrap(x, y, typ)
- int x, y, typ;
+maketrap(int x, int y, int typ)
{
struct trap *ttmp;
}
void
-dotrap(trap)
- struct trap *trap;
+dotrap(struct trap *trap)
{
int ttype = trap->ttyp;
}
int
-mintrap(mtmp)
- struct monst *mtmp;
+mintrap(struct monst *mtmp)
{
struct trap *trap = t_at(mtmp->mx, mtmp->my);
int wasintrap = mtmp->mtrapped;
}
void
-selftouch(arg)
- const char *arg;
+selftouch(const char *arg)
{
if (uwep && uwep->otyp == DEAD_COCKATRICE) {
pline("%s touch the dead cockatrice.", arg);
}
void
-float_up()
+float_up(void)
{
if (u.utrap) {
if (u.utraptype == TT_PIT) {
}
void
-float_down()
+float_down(void)
{
struct trap *trap;
pline("You float gently to the ground.");
case TRAPDOOR:
if (!xdnstair || u.ustuck)
break;
- /* fall into next case */
+ /* FALLTHROUGH */
default:
dotrap(trap);
}
pickup(1);
}
-void
-vtele()
+static void
+vtele(void)
{
struct mkroom *croom;
for (croom = &rooms[0]; croom->hx >= 0; croom++)
}
void
-tele()
+tele(void)
{
coord cc;
int nux, nuy;
teleds(nux, nuy);
}
-void
-teleds(nux, nuy)
- int nux, nuy;
+static void
+teleds(int nux, int nuy)
{
if (Punished)
unplacebc();
read_engr_at(u.ux, u.uy);
}
-int
-teleok(x, y)
- int x, y;
+static int
+teleok(int x, int y)
{ /* might throw him into a POOL */
return (isok(x, y) && !IS_ROCK(levl[x][y].typ) && !m_at(x, y) &&
!sobj_at(ENORMOUS_ROCK, x, y) && !t_at(x, y)
}
int
-dotele()
+dotele(void)
{
if (
#ifdef WIZARD
}
void
-placebc(attach)
- int attach;
+placebc(int attach)
{
if (!uchain || !uball) {
impossible("Where are your chain and ball??");
}
void
-unplacebc()
+unplacebc(void)
{
if (!carried(uball)) {
freeobj(uball);
}
void
-level_tele()
+level_tele(void)
{
int newlevel;
if (Teleport_control) {
}
void
-drown()
+drown(void)
{
pline("You fall into a pool!");
pline("You can't swim!");