-/* $NetBSD: throw.c,v 1.8 2007/12/27 23:53:01 dholland Exp $ */
+/* $NetBSD: throw.c,v 1.12 2011/05/23 23:01:17 joerg Exp $ */
/*
* Copyright (c) 1988, 1993
#if 0
static char sccsid[] = "@(#)throw.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: throw.c,v 1.8 2007/12/27 23:53:01 dholland Exp $");
+__RCSID("$NetBSD: throw.c,v 1.12 2011/05/23 23:01:17 joerg Exp $");
#endif
#endif /* not lint */
#include "rogue.h"
+static void flop_weapon(object *, short, short);
+static object *get_thrown_at_monster(object *, short, short *, short *);
+static boolean throw_at_monster(object *, object *);
+
void
-throw()
+throw(void)
{
short wch, d;
boolean first_miss = 1;
return;
}
if ((weapon->in_use_flags & BEING_USED) && weapon->is_cursed) {
- messagef(0, curse_message);
+ messagef(0, "%s", curse_message);
return;
}
row = rogue.row; col = rogue.col;
}
boolean
-throw_at_monster(monster, weapon)
- object *monster, *weapon;
+throw_at_monster(object *monster, object *weapon)
{
short damage, hit_chance;
short t;
weapon->quantity = t;
if (!rand_percent(hit_chance)) {
- (void) strlcat(hit_message, "misses ", HIT_MESSAGE_SIZE);
+ (void)strlcat(hit_message, "misses ", HIT_MESSAGE_SIZE);
return(0);
}
s_con_mon(monster);
- (void) strlcat(hit_message, "hit ", HIT_MESSAGE_SIZE);
- (void) mon_damage(monster, damage);
+ (void)strlcat(hit_message, "hit ", HIT_MESSAGE_SIZE);
+ (void)mon_damage(monster, damage);
return(1);
}
object *
-get_thrown_at_monster(obj, dir, row, col)
- object *obj;
- short dir;
- short *row, *col;
+get_thrown_at_monster(object *obj, short dir, short *row, short *col)
{
short orow, ocol;
short i, ch;
}
void
-flop_weapon(weapon, row, col)
- object *weapon;
- short row, col;
+flop_weapon(object *weapon, short row, short col)
{
object *new_weapon, *monster;
short i = 0;
}
void
-rand_around(i, r, c)
- short i, *r, *c;
+rand_around(short i, short *r, short *c)
{
static char pos[] = "\010\007\001\003\004\005\002\006\0";
static short row, col;