X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/e3d903728b566a12e09bf75b912da49e60b2643b..4c2fca22580ba0ae4ec901cca158c5e228494265:/sail/globals.c?ds=sidebyside diff --git a/sail/globals.c b/sail/globals.c index 26ee3026..331e6b64 100644 --- a/sail/globals.c +++ b/sail/globals.c @@ -1,4 +1,4 @@ -/* $NetBSD: globals.c,v 1.10 2001/01/04 01:56:28 jwise Exp $ */ +/* $NetBSD: globals.c,v 1.16 2010/08/06 09:14:40 dholland 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,13 +34,17 @@ #if 0 static char sccsid[] = "@(#)globals.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: globals.c,v 1.10 2001/01/04 01:56:28 jwise Exp $"); +__RCSID("$NetBSD: globals.c,v 1.16 2010/08/06 09:14:40 dholland Exp $"); #endif #endif /* not lint */ +#include +#include #include "extern.h" -struct scenario scene[] = { +static struct shipspecs specs[]; + +struct scenario scene[NSCENE] = { /* * int winddir; * int windspeed; @@ -315,7 +315,7 @@ struct scenario scene[] = { }; int nscene = sizeof scene / sizeof (struct scenario); -struct shipspecs specs[] = { +static struct shipspecs specs[] = { /* bs fs ta guns hull crew1 crew3 gunR carR rig2 rig4 pts */ /* class qual crew2 gunL carL rig1 rig3 */ /*00*/{ 4, 7, 3, 19, 5, 5, 4, 2, 2, 2, 2, 2, 0, 0, 4, 4, 4, 4, 7 }, @@ -454,7 +454,7 @@ const char AMMO[9][4] = { { -3, 2, 0, 3 }, { -3, 2, 0, 3 } }; - + const char HDT[9][10] = { { 1, 0,-1,-2,-3,-3,-4,-4,-4,-4 }, { 1, 1, 0,-1,-2,-2,-3,-3,-3,-3 }, @@ -526,6 +526,16 @@ const char *const classname[] = { "Brig" }; +const char *const shortclassname[] = { + "Rowboat", + "Ship", + "Ship", + "Frigate", + "Corvette", + "Sloop", + "Brig" +}; + const char *const directionname[] = { "dead ahead", "off the starboard bow", @@ -538,7 +548,14 @@ const char *const directionname[] = { "dead ahead" }; -const char *const qualname[] = { "dead", "mutinous", "green", "mundane", "crack", "elite" }; +const char *const qualname[] = { + "dead", + "mutinous", + "green", + "mundane", + "crack", + "elite" +}; const char loadname[] = { '-', 'G', 'C', 'R', 'D', 'E' }; @@ -548,15 +565,15 @@ const char dc[] = { 0, 0, -1, -1, -1, 0, 1, 1, 1 }; int mode; jmp_buf restart; -char randomize; /* -x, give first available ship */ -char longfmt; /* -l, print score in long format */ -char nobells; /* -b, don't ring bell before Signal */ +bool randomize; /* -x, give first available ship */ +bool longfmt; /* -l, print score in long format */ +bool nobells; /* -b, don't ring bell before Signal */ gid_t gid; gid_t egid; -struct scenario *cc; /* the current scenario */ -struct ship *ls; /* &cc->ship[cc->vessels] */ +struct scenario *cc; /* the current scenario */ +struct ship *ls; /* &cc->ship[cc->vessels] */ int winddir; int windspeed; @@ -564,4 +581,4 @@ int turn; int game; int alive; int people; -char hasdriver; +int hasdriver;