]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - sail/dr_1.c
de-register
[bsdgames-darwin.git] / sail / dr_1.c
index bc6a6ccad03ccde49b13a03671b39e3fbd0656d4..782d8d55713d3e6c8eaad5ef23f7c2fea63b6bcd 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: dr_1.c,v 1.12 2001/01/01 21:57:37 jwise Exp $  */
+/*     $NetBSD: dr_1.c,v 1.18 2001/02/05 01:10:08 christos Exp $       */
 
 /*
  * Copyright (c) 1983, 1993
 #if 0
 static char sccsid[] = "@(#)dr_1.c     8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: dr_1.c,v 1.12 2001/01/01 21:57:37 jwise Exp $");
+__RCSID("$NetBSD: dr_1.c,v 1.18 2001/02/05 01:10:08 christos Exp $");
 #endif
 #endif /* not lint */
 
-#include "driver.h"
+#include <ctype.h>
+#include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include "extern.h"
+#include "driver.h"
+
+static int     fightitout(struct ship *, struct ship *, int);
 
 void
 unfoul(void)
@@ -133,7 +139,7 @@ boardcomp(void)
        }
 }
 
-int
+static int
 fightitout(struct ship *from, struct ship *to, int key)
 {
        struct ship *fromcap, *tocap;
@@ -185,8 +191,8 @@ fightitout(struct ship *from, struct ship *to, int key)
        }
        if (fromstrength >= strengthto * 3 || count == 4) {
                unboard(to, from, 0);
-               subtract(from, totalfrom, crewfrom, fromcap, pcfrom);
-               subtract(to, totalto, crewto, tocap, pcto);
+               subtract(from, fromcap, totalfrom, crewfrom, pcfrom);
+               subtract(to, tocap, totalto, crewto, pcto);
                makemsg(from, "boarders from %s repelled", to->shipname);
                sprintf(message, "killed in melee: %d.  %s: %d",
                        totalto, from->shipname, totalfrom);
@@ -195,8 +201,8 @@ fightitout(struct ship *from, struct ship *to, int key)
                        return 1;
        } else if (strengthto >= fromstrength * 3) {
                unboard(from, to, 0);
-               subtract(from, totalfrom, crewfrom, fromcap, pcfrom);
-               subtract(to, totalto, crewto, tocap, pcto);
+               subtract(from, fromcap, totalfrom, crewfrom, pcfrom);
+               subtract(to, tocap, totalto, crewto, pcto);
                if (key) {
                        if (fromcap != from)
                                Write(W_POINTS, fromcap,
@@ -217,12 +223,12 @@ fightitout(struct ship *from, struct ship *to, int key)
                        Write(W_POINTS, to, topoints, 0, 0, 0);
                        mento = crewto[0] ? crewto[0] : crewto[1];
                        if (mento) {
-                               subtract(to, mento, crewto, tocap, pcto);
-                               subtract(from, - mento, crewfrom, to, 0);
+                               subtract(to, tocap, mento, crewto, pcto);
+                               subtract(from, to, - mento, crewfrom, 0);
                        }
                        sprintf(message, "captured by the %s!", to->shipname);
                        Writestr(W_SIGNAL, from, message);
-                       (void) sprintf(message, "killed in melee: %d.  %s: %d",
+                       sprintf(message, "killed in melee: %d.  %s: %d",
                                totalto, from->shipname, totalfrom);
                        Writestr(W_SIGNAL, to, message);
                        mento = 0;
@@ -389,7 +395,7 @@ compcombat(void)
                        if (hit >= 0) {
                                if (load != L_GRAPE)
                                        hit = hit > 10 ? 10 : hit;
-                               table(shootat, load, hit, closest, sp, dieroll());
+                               table(sp, closest, shootat, load, hit, dieroll());
                        }
                }
        }