-/* $NetBSD: hit.c,v 1.9 2008/01/14 00:23:51 dholland Exp $ */
+/* $NetBSD: hit.c,v 1.10 2008/01/14 03:50:01 dholland Exp $ */
/*
* Copyright (c) 1988, 1993
#if 0
static char sccsid[] = "@(#)hit.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: hit.c,v 1.9 2008/01/14 00:23:51 dholland Exp $");
+__RCSID("$NetBSD: hit.c,v 1.10 2008/01/14 03:50:01 dholland Exp $");
#endif
#endif /* not lint */
#include "rogue.h"
-object *fight_monster = 0;
+static int damage_for_strength(void);
+static int get_w_damage(const object *);
+static int to_hit(const object *);
+
+static object *fight_monster = NULL;
char hit_message[HIT_MESSAGE_SIZE] = "";
void
-mon_hit(monster)
- object *monster;
+mon_hit(object *monster)
{
short damage, hit_chance;
const char *mn;
}
void
-rogue_hit(monster, force_hit)
- object *monster;
- boolean force_hit;
+rogue_hit(object *monster, boolean force_hit)
{
short damage, hit_chance;
}
void
-rogue_damage(d, monster, other)
- short d;
- object *monster;
- short other;
+rogue_damage(short d, object *monster, short other)
{
if (d >= rogue.hp_current) {
rogue.hp_current = 0;
}
int
-get_damage(ds, r)
- const char *ds;
- boolean r;
+get_damage(const char *ds, boolean r)
{
int i = 0, j, n, d, total = 0;
return(total);
}
-int
-get_w_damage(obj)
- const object *obj;
+static int
+get_w_damage(const object *obj)
{
char new_damage[32];
int tmp_to_hit, tmp_damage;
}
int
-get_number(s)
- const char *s;
+get_number(const char *s)
{
int i = 0;
int total = 0;
}
long
-lget_number(s)
- const char *s;
+lget_number(const char *s)
{
short i = 0;
long total = 0;
return(total);
}
-int
-to_hit(obj)
- const object *obj;
+static int
+to_hit(const object *obj)
{
if (!obj) {
return(1);
return(get_number(obj->damage) + obj->hit_enchant);
}
-int
-damage_for_strength()
+static int
+damage_for_strength(void)
{
short strength;
}
int
-mon_damage(monster, damage)
- object *monster;
- short damage;
+mon_damage(object *monster, short damage)
{
const char *mn;
short row, col;
row = monster->row;
col = monster->col;
dungeon[row][col] &= ~MONSTER;
- mvaddch(row, col, (int)get_dungeon_char(row, col));
+ mvaddch(row, col, get_dungeon_char(row, col));
fight_monster = 0;
cough_up(monster);
}
void
-fight(to_the_death)
- boolean to_the_death;
+fight(boolean to_the_death)
{
short ch, c, d;
short row, col;
}
void
-get_dir_rc(dir, row, col, allow_off_screen)
- short dir;
- short *row, *col;
- short allow_off_screen;
+get_dir_rc(short dir, short *row, short *col, short allow_off_screen)
{
switch(dir) {
case LEFT:
}
int
-get_hit_chance(weapon)
- const object *weapon;
+get_hit_chance(const object *weapon)
{
short hit_chance;
}
int
-get_weapon_damage(weapon)
- const object *weapon;
+get_weapon_damage(const object *weapon)
{
short damage;
}
void
-s_con_mon(monster)
- object *monster;
+s_con_mon(object *monster)
{
if (con_mon) {
monster->m_flags |= CONFUSED;