X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/22a27dede77166c7bdf1de647d4d2b961fcd92c2..257d036dc21241f2c8202514775c399945bbd3e2:/sail/pl_3.c diff --git a/sail/pl_3.c b/sail/pl_3.c index 4be189be..81d012c2 100644 --- a/sail/pl_3.c +++ b/sail/pl_3.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl_3.c,v 1.7 1999/02/10 00:45:46 hubertf Exp $ */ +/* $NetBSD: pl_3.c,v 1.17 2003/08/07 09:37:43 agc Exp $ */ /* * Copyright (c) 1983, 1993 @@ -12,11 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -38,15 +34,17 @@ #if 0 static char sccsid[] = "@(#)pl_3.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pl_3.c,v 1.7 1999/02/10 00:45:46 hubertf Exp $"); +__RCSID("$NetBSD: pl_3.c,v 1.17 2003/08/07 09:37:43 agc Exp $"); #endif #endif /* not lint */ -#include "player.h" +#include #include +#include "extern.h" +#include "player.h" void -acceptcombat() +acceptcombat(void) { int men = 0; int target, temp; @@ -177,11 +175,11 @@ acceptcombat() if (windspeed == 6 && temp <= 3) hit--; if (hit >= 0) { - roll = die(); + roll = dieroll(); if (load == L_GRAPE) chits = hit; else { - struct Tables *t; + const struct Tables *t; if (hit > 10) hit = 10; t = &(shootat == RIGGING ? RigTable : HullTable) @@ -197,7 +195,7 @@ acceptcombat() hhits = 0; } } - table(shootat, load, hit, closest, ms, roll); + table(ms, closest, shootat, load, hit, roll); } Msg("Damage inflicted on the %s:", closest->shipname); Msg("\t%d HULL, %d GUNS, %d CREW, %d RIGGING", @@ -219,7 +217,7 @@ acceptcombat() } void -grapungrap() +grapungrap(void) { struct ship *sp; int i; @@ -232,7 +230,7 @@ grapungrap() switch (sgetch("Attempt to grapple or ungrapple $$: ", sp, 1)) { case 'g': - if (die() < 3 + if (dieroll() < 3 || ms->nationality == capship(sp)->nationality) { Write(W_GRAP, ms, sp->file->index, 0, 0, 0); Write(W_GRAP, sp, player, 0, 0, 0); @@ -245,7 +243,7 @@ grapungrap() for (i = grappled2(ms, sp); --i >= 0;) { if (ms->nationality == capship(sp)->nationality - || die() < 3) { + || dieroll() < 3) { cleangrapple(ms, sp, 0); Msg("Attempt succeeds!"); makesignal(ms, "ungrappling with $$", @@ -259,7 +257,7 @@ grapungrap() } void -unfoulplayer() +unfoulplayer(void) { struct ship *to; int i; @@ -270,7 +268,7 @@ unfoulplayer() if (sgetch("Attempt to unfoul with the $$? ", to, 1) != 'y') continue; for (i = fouled2(ms, to); --i >= 0;) { - if (die() <= 2) { + if (dieroll() <= 2) { cleanfoul(ms, to, 0); Msg("Attempt succeeds!"); makesignal(ms, "Unfouling $$", to);