]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - phantasia/fight.c
mention hex numbers
[bsdgames-darwin.git] / phantasia / fight.c
index d001dabe09f211846f7972ee1253c0e2351b00d3..0a1ab064dc5f03af6967f298469bdfe3563ed018 100644 (file)
@@ -1,13 +1,33 @@
-/*     $NetBSD: fight.c,v 1.11 2009/05/25 23:08:45 dholland Exp $      */
+/*     $NetBSD: fight.c,v 1.14 2019/02/03 03:19:25 mrg 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(int particular)
 {
@@ -152,7 +172,7 @@ encounter(int particular)
        clrtobot();
 }
 
-int
+static int
 pickmonster(void)
 {
        if (Player.p_specialtype == SC_VALAR)
@@ -192,7 +212,7 @@ pickmonster(void)
                                                return ((int) ROLL(14.0, 25.0));
 }
 
-void
+static void
 playerhits(void)
 {
        double  inflict;        /* damage inflicted */
@@ -335,7 +355,7 @@ playerhits(void)
 
 }
 
-void
+static void
 monsthits(void)
 {
        double  inflict;        /* damage inflicted */
@@ -585,7 +605,7 @@ SPECIALHIT:
        }
 }
 
-void
+static void
 cancelmonster(void)
 {
        Curmonster.m_energy = 0.0;
@@ -594,7 +614,7 @@ cancelmonster(void)
        Curmonster.m_flock = 0.0;
 }
 
-void
+static void
 hitmonster(double inflict)
 {
        mvprintw(Lines++, 0, "You hit %s %.0f times!", Enemyname, inflict);
@@ -621,7 +641,7 @@ hitmonster(double inflict)
        }
 }
 
-void
+static void
 throwspell(void)
 {
        double  inflict;        /* damage inflicted */
@@ -831,7 +851,7 @@ throwspell(void)
                }
 }
 
-void
+static void
 callmonster(int which)
 {
        struct monster Othermonster;    /* to find a name for mimics */
@@ -908,7 +928,7 @@ callmonster(int which)
        Curmonster.m_melee = Curmonster.m_skirmish = 0.0;
 }
 
-void
+static void
 awardtreasure(void)
 {
        int     whichtreasure;  /* calculated treasure to grant */
@@ -1296,6 +1316,7 @@ awardtreasure(void)
                                        /* fall through to treasure type 9 if
                                         * no treasure from above */
 
+                                       /* FALLTHROUGH */
                                case 9: /* treasure type 9 */
                                        switch (whichtreasure) {
                                        case 1:
@@ -1306,8 +1327,8 @@ awardtreasure(void)
                                                        ++Player.p_crowns;
                                                        break;
                                                }
-                                               /* fall through otherwise */
 
+                                               /* FALLTHROUGH */
                                        case 2:
                                                addstr("You've been blessed!\n");
                                                Player.p_blessing = TRUE;
@@ -1332,7 +1353,7 @@ awardtreasure(void)
        }
 }
 
-void
+static void
 cursedtreasure(void)
 {
        if (Player.p_charms > 0) {
@@ -1349,7 +1370,7 @@ cursedtreasure(void)
                }
 }
 
-void
+static void
 scramblestats(void)
 {
        double  dbuf[6];        /* to put statistic in */