-/* $NetBSD: fight.c,v 1.9 2004/04/07 17:46:47 ross Exp $ */
+/* $NetBSD: fight.c,v 1.13 2009/08/31 08:27:16 dholland Exp $ */
/*
* fight.c Phantasia monster fighting routines
*/
-#include "include.h"
+#include <math.h>
+#include <setjmp.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "macros.h"
+#include "phantdefs.h"
+#include "phantstruct.h"
+#include "phantglobs.h"
+
+#undef bool
#include <curses.h>
+static void awardtreasure(void);
+static void callmonster(int);
+static void cancelmonster(void);
+static void cursedtreasure(void);
+static void hitmonster(double);
+static void monsthits(void);
+static int pickmonster(void);
+static void playerhits(void);
+static void scramblestats(void);
+static void throwspell(void);
+
void
-encounter(particular)
- int particular;
+encounter(int particular)
{
volatile bool firsthit = Player.p_blessing; /* set if player gets
* the first hit */
clrtobot();
}
-int
-pickmonster()
+static int
+pickmonster(void)
{
if (Player.p_specialtype == SC_VALAR)
/* even chance of any monster */
return ((int) ROLL(14.0, 25.0));
}
-void
-playerhits()
+static void
+playerhits(void)
{
double inflict; /* damage inflicted */
int ch; /* input */
}
-void
-monsthits()
+static void
+monsthits(void)
{
double inflict; /* damage inflicted */
int ch; /* input */
}
}
-void
-cancelmonster()
+static void
+cancelmonster(void)
{
Curmonster.m_energy = 0.0;
Curmonster.m_experience = 0.0;
Curmonster.m_flock = 0.0;
}
-void
-hitmonster(inflict)
- double inflict;
+static void
+hitmonster(double inflict)
{
mvprintw(Lines++, 0, "You hit %s %.0f times!", Enemyname, inflict);
Curmonster.m_energy -= inflict;
}
}
-void
-throwspell()
+static void
+throwspell(void)
{
double inflict; /* damage inflicted */
double dtemp; /* for dtemporary calculations */
}
}
-void
-callmonster(which)
- int which;
+static void
+callmonster(int which)
{
struct monster Othermonster; /* to find a name for mimics */
Curmonster.m_melee = Curmonster.m_skirmish = 0.0;
}
-void
-awardtreasure()
+static void
+awardtreasure(void)
{
int whichtreasure; /* calculated treasure to grant */
int temp; /* temporary */
}
}
-void
-cursedtreasure()
+static void
+cursedtreasure(void)
{
if (Player.p_charms > 0) {
addstr("But your charm saved you!\n");
}
}
-void
-scramblestats()
+static void
+scramblestats(void)
{
double dbuf[6]; /* to put statistic in */
double dtemp1, dtemp2; /* for swapping values */