games@tekred.TEK.COM (07/02/88)
Submitted by: "Stanley T. Shebs" <shebs%defun@cs.utah.edu> Comp.sources.games: Volume 4, Issue 103 Archive-name: xconq5/Part15 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 15 (of 18)." # Contents: cconq.6 config.h ginit.c lib/europe42.scn lib/future.per # lib/trooper.b unit.h util.c xconq.6 # Wrapped by billr@saab on Wed Jun 29 08:56:02 1988 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f cconq.6 -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"cconq.6\" else echo shar: Extracting \"cconq.6\" \(4476 characters\) sed "s/^X//" >cconq.6 <<'END_OF_cconq.6' X.TH CCONQ 6 Utah X.SH NAME Xcconq - curses-based strategy game X.SH SYNOPSIS X.B Xcconq X[ options ] ... X.SH DESCRIPTION X\fICconq\fP is a multi-player strategic wargame. XYour goal is to save the world from the evil empires attempting to Xtake over. You get cities, armies, airplanes, and ships with which to Xaccomplish your task. Success is achieved by the neutralization or Xdefeat of the other sides, by any means available; but you have to Xfind them first! X.PP XAlthough the game can get complicated, to start you need only Xknow about the help command '?', which is valid at any time. XYou start with only one city, which makes things even simpler. XThe city will automatically produce a military unit, which you Xwill be prompted to move around. Eventually, you will get more and Xcan attempt to take over other cities. XThe game keeps going Xuntil only one side is left in action, this player is then declared the winner. X.PP XBy default, \fIcconq\fP Xstarts up with one human and one Xmachine, playing on a randomly generated 60x30 world. XOptions are Xavailable to set the number of machine players, as well as the Xkind of map used. In addition, \fIcconq\fP has extensive and Xelaborate facilities for building maps, scenarios, and historical Xperiods for a wide variety of games. Unlike \fIxconq(6)\fP, X\fIcconq\fP allows only one human player in a game. X.SH OPTIONS X.TP 5 X.B \-A\ curses Xattaches a machine player to the screen. Ideal for those who like Xto watch. X.TP 5 X.B \-e \fInumber\fP Xsets the number of machine players not attached to displays. XNon-displayed machine players are always allied with each other. X.TP 5 X.B \-m \fIname\fP Xreads the map named \fIname\fP and starts up a game on it. X.TP 5 X.B \-M \fIwidth height\fP Xgenerates a random map of the given size. The size must be at least 5x5, Xalthough some periods will impose additional constraints on the lower bound. XIn theory, there is no upper bound (but 200x200 is huge). X.TP 5 X.B \-p \fIname\fP Xreads the historical period specified by \fIname\fP, and sets everything Xup for that period. X.TP 5 X.B \-r Xresets the list of players on the command line. It is most useful when Xplaced before other player specifications, to clear out the default Xplayer. X.TP 5 X.B \-s \fIname\fP Xreads a scenario with the name \fIname\fP. A scenario sets up a particular Xsituation; it has a fixed number of sides that can participate. X.TP 5 X.B \-v Xmake the entire world seen by all players at the outset. XThis is useful if exploration Xis deemed to be time-consuming, or if the map is already known to everybody. XSome maps have this permanently enabled. X.TP 5 X.B \-x Xallows scenarios, maps, periods, and players to be set up interactively Xvia menus. The menus should be self-explanatory. X.LP XIn addition, \fB-B\fP and \fB-D\fP are recognized; Xsee the the customization document for more details. X.SH EXAMPLES X.TP 8 X.B Xcconq XOne human on local display, one machine, 60x30 random map X.TP 8 X.B Xcconq -m crater XOne human vs one machine, on the "crater lake" map X.TP 8 X.B Xcconq -e 2 -M 35 35 XOne human, three machines, 35x35 random map X.TP 8 X.B Xcconq -e 6 -m 1987 XSeven players (6 machine, 1 human), all playing Xon a 360x122 map of the earth with present-day cities. Major! X.SH AUTHOR XStan Shebs (shebs@cs.utah.edu) X.SH FILES X\fIsave.xconq\fP saved game X.br X\fIstats.xconq\fP performance statistics for a game X.br X\fIcmds.xconq\fP listing of commands X.br X\fIparms.xconq\fP listing of units and their characteristics X.br X\fIview.xconq\fP printable version of the map display X.br X\fI/usr/games/lib/xconq/*.map\fP predefined maps X.br X\fI/usr/games/lib/xconq/*.scn\fP predefined scenarios X.br X\fI/usr/games/lib/xconq/*.per\fP predefined historical periods X.br X\fI/usr/games/lib/xconq/xconq.news\fP news about features/additions X.SH "SEE ALSO" X.br X.IR xconq(6) X.br X.IR "Liberating the World (Made Simple)" X.br X.IR "Customizing Xconq (Made Somewhat Simple)" X.SH DIAGNOSTICS X.PP XIf the map is too small for the desired number of players, \fIcconq\fP will Xcomplain about not being able to place units. X.PP XIncorrect combinations of periods, maps, and scenarios Xcan generate a host of different error messages. X.SH BUGS XSince some periods/maps/scenarios are interdependent, they must be specified Xin a particular order on the command line (period is first usually). X.PP XDoes not cope gracefully with insufficient memory. X.PP XUsing \fB-D\fP for debugging results in spectacular but useless displays. X.PP XSome annoying behaviors are actually features. END_OF_cconq.6 if test 4476 -ne `wc -c <cconq.6`; then echo shar: \"cconq.6\" unpacked with wrong size! fi # end of overwriting check fi if test -f config.h -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"config.h\" else echo shar: Extracting \"config.h\" \(5864 characters\) sed "s/^X//" >config.h <<'END_OF_config.h' X/* Copyright (c) 1987, 1988 Stanley T. Shebs, University of Utah. */ X/* This program may be used, copied, modified, and redistributed freely */ X/* for noncommercial purposes, so long as this notice remains intact. */ X X/* RCS $Header: config.h,v 1.1 88/06/21 12:29:37 shebs Exp $ */ X X/* This file has several things that can be fiddled with; generally, */ X/* the more interesting things to tweak are closer to the front of the file. */ X/* Xconq is no longer wired to X; in fact, the specific graphics interface */ X/* is unknown until link time, and does not affect compilation. */ X X/* Just a couple places where we care about machine type - but the main */ X/* program does assume argc/argv interface, which is a problem for micros. */ X X#define UNIX X X/* These are wishful thinking at the moment. */ X/* #define ATARI */ X/* #define MAC */ X X#define BSD /* Berkeley Unix and probably Ultrix too */ X/* #define HPUX */ /* HP's mishmash of features */ X/* dunno if xconq works on SysV */ X X/* May be able to use select(2) to wait on several sides at once. If not, */ X/* screen will go dead until player's turn comes around again. */ X X#ifdef BSD X#define SELECT2 X#endif X X#ifdef HPUX X#define SELECT2 X#endif X X#include <stdio.h> X#include <ctype.h> X X/* This is where predefined maps/scenarios/periods/fonts can be found. */ X X#ifndef XCONQLIB X#define XCONQLIB "/usr/games/lib/xconq" X#endif XCONQLIB X X/* The newsfile always lives in the lib directory. */ X X#define NEWSFILE "xconq.news" X X/* This file is a list of mapfiles to exhibit in menus; it will always be */ X/* in the lib directory. There are no automatic constructors for this */ X/* file, since it should contain only well-tested files added after careful */ X/* deliberation. */ X X#define MAPFILEFILE "mapfiles" X X/* The name of the savefile. It will be put in the current directory. */ X X#define SAVEFILE "save.xconq" X X/* This file gets the parameter listing for the period in use. */ X/* It will also be created in the current directory. */ X X#define PARMSFILE "parms.xconq" X X/* This file gets the game statistics when it's all over. */ X/* It will also be created in the current directory. */ X X#define STATSFILE "stats.xconq" X X/* This file gets a printout of the side's view. */ X X#define VIEWFILE "view.xconq" X X/* This file gets a list of commands as they appear in the help window. */ X X#define CMDFILE "cmds.xconq" X X/* Default random map sizes. Adjust these to taste - 60x60 is a moderate */ X/* length game, 30x30 is short, 360x120 is L-O-N-G ! */ X X#define DEFAULTWIDTH 60 X#define DEFAULTHEIGHT 30 X X/* Absolute maximum number of sides that can play. This limit can only be */ X/* extended by changing the representation of views of players from bytes */ X/* to something larger, thereby doubling (at least) space requirements. */ X X#define MAXSIDES 7 X X/* Absolute maximum number of kinds of units. (same restriction as above) */ X X#define MAXUTYPES 30 X X/* Maximum number of types of natural resources. This number can be set */ X/* higher, in fact I think the only limitation is that there won't be */ X/* enough distinct chars, but more rtypes means larger unit objects. */ X X#define MAXRTYPES 6 X X/* Maximum number of terrain types. Must be fewer than 256, but also */ X/* limited by display capabilities. */ X X#define MAXTTYPES 20 X X/* Maximum number of random side names that can be defined. */ X X#define MAXSNAMES 200 X X/* Maximum number of random unit names that can be defined. */ X X#define MAXUNAMES 1000 X X/* The maximum number of mapfiles that can be in menus. (Not a limit on the */ X/* total number of files that can exist, however.) */ X X#define MAXMAPMENU 100 X X/* The maximum number of mapfiles that can be loaded into a game (recursive */ X/* loads are not performed and not counted). */ X X#define MAXLOADED 16 X X/* Default game length in turns. */ X X#define DEFAULTTURNS 1000 X X/* Number of messages displayed at one time. No upper limit I believe, */ X/* but too many won't fit on the screen. The actual numbers of lines */ X/* displayed can be changed by the player, subject to limitations on the */ X/* screen space available. */ X X#define MAXNOTES 10 X X/* Default color of text and icons - 0 is for white on black, 1 */ X/* is for black on white. Should be set appropriately for the most */ X/* common monochrome display (color displays always do white on black). */ X/* This is also settable by the player, so the default is just for */ X/* convenience of the majority. */ X X#define BLACKONWHITE 0 X X/* When true, displays will use more graphics and less text. This can */ X/* also be toggled by players individually. */ X X#define GRAPHICAL 0 X X/* The default fonts can be altered by users, so these are just hints. */ X/* These options do not necessarily apply to non-X versions. */ X X#define TEXTFONT "9x15" X#define ICONFONT "xconq" X X/* All names, phrases, and messages must be able to fit in statically */ X/* allocated buffers of this size. */ X X#define BUFSIZE 120 X X/* If defined, a statistics file is written at the end of the game. */ X/* The numbers therein are only for serious gamers, and the files can */ X/* be embarassing clutter in your directory! */ X X#define STATISTICS X X/* Initial limit on units and cities that can be active at one time. If */ X/* growable option is enabled, will try to grow the array to hold more. */ X X#define INITMAXUNITS 1000 X/* #define GROWABLE */ X X/* When this is enabled, machine players will be able to examine humans' */ X/* units rather more closely than is possible in reverse. In particular, */ X/* a machine will know just where the human units are, as well as their */ X/* current attributes (like hit points). */ X X/* #define CHEAT */ X X/* Controls how fast certain graphics things flash by. Not a critical */ X/* value, which is a good thing since it depends on the machine speed, */ X/* graphics system, human perceptive abilities, and so forth. */ X X#define DELAY 100000 END_OF_config.h if test 5864 -ne `wc -c <config.h`; then echo shar: \"config.h\" unpacked with wrong size! fi # end of overwriting check fi if test -f ginit.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"ginit.c\" else echo shar: Extracting \"ginit.c\" \(8930 characters\) sed "s/^X//" >ginit.c <<'END_OF_ginit.c' X/* Copyright (c) 1987, 1988 Stanley T. Shebs, University of Utah. */ X/* This program may be used, copied, modified, and redistributed freely */ X/* for noncommercial purposes, so long as this notice remains intact. */ X X/* RCS $Header: ginit.c,v 1.1 88/06/21 12:30:10 shebs Exp $ */ X X/* Initialization and random routines for the display part of xconq. */ X X#include "config.h" X#include "misc.h" X#include "dir.h" X#include "period.h" X#include "side.h" X#include "unit.h" X#include "map.h" X#include "global.h" X X/* Always use four lines for the unit info display, even on small screens. */ X X#define INFOLINES 4 X Xint maxnamelen = 0; /* length of longest side name+host */ X X/* Find a unit and put it at center (or close to it) of first view. I guess */ X/* can't use put_on_screen because not enough stuff is inited yet. */ X Xinit_curxy(side) XSide *side; X{ X Unit *unit; X X for_all_units(unit) { X if (unit->side == side) { X side->cx = unit->x; side->cy = unit->y; X side->vcx = unit->x; X side->vcy = max(unit->y, side->vw2+1); X side->vcy = min(side->vcy, (world.height-1) - side->vh2); X return; X } X } X side->vcx = side->vw2; side->vcy = side->vh2; X side->cx = side->vcx; side->cy = side->vcy; X} X X/* The very first step in using X is to open up all the desired displays. */ X/* In our case, there are many displays each with many windows. If the */ X/* display opens successfully, do an initial "redraw" to set the screen up. */ X Xinit_displays() X{ X int len; X Side *side; X X for_all_sides(side) { X len = 8 + strlen(side->name) + 1; X maxnamelen = max(maxnamelen, X len + (side->host ? strlen(side->host) + 3 : 0)); X } X for_all_sides(side) { X if (side->host != NULL) { X init_display(side); X if (active_display(side)) { X init_curxy(side); X redraw(side); X } X } X } X} X X/* Open display, create all the windows we'll need, do misc setup things, */ X/* and initialize some globals to out-of-range values for recognition later. */ X Xinit_display(side) XSide *side; X{ X int i; X X if (Debug) printf("Will try to open display \"%s\" ...\n", side->host); X X if (!open_display(side)) { X fprintf(stderr, "Display \"%s\" could not be opened!\n", side->host); X exit_xconq(); X } X active_display(side); /* done for side effect */ X init_colors(side); X init_misc(side); X init_sizes(side); X create_main_window(side); X side->msg = X create_window(side, 0, 0, X side->lw, side->nh * side->fh); X side->info = X create_window(side, 0, side->nh * side->fh + side->bd, X side->lw, INFOLINES * side->fh); X side->prompt = X create_window(side, 0, (side->nh + INFOLINES) * side->fh + 2*side->bd, X side->lw, side->fh); X side->map = X create_window(side, 0, side->th, X side->vw * side->hw, X side->vh * side->hch + (side->hh - side->hch)); X side->sides = X create_window(side, side->lw + side->bd + 1, 0, X side->sw * side->fw, numsides * side->fh); X side->timemode = X create_window(side, side->lw + side->fw, side->th - 4 * side->fh, X 2 * side->margin + 8 * side->fw, 2 * side->fh); X side->clock = X create_window(side, side->lw + 13 * side->fw, side->th - 2 * side->fh, X 8 * side->fw, side->fh); X side->state = X create_window(side, side->lw + 1, side->th, X 20 * side->fw, period.numutypes*max(side->hh, side->fh)); X if (world_display(side)) { X side->world = X create_window(side, X side->lw+side->bd, side->mh-side->mm*world.height, X world.width * side->mm, world.height * side->mm); X } X create_help_window(side); X fixup_windows(side); X enable_input(side); X for (i = 0; i < MAXNOTES; ++i) strcpy(side->noticebuf[i], " "); X for (i = 0; i < MAXUTYPES; ++i) side->bvec[i] = 0; X /* Flag some values as uninitialized */ X side->vcx = side->vcy = -1; X side->lastvcx = side->lastvcy = -1; X side->lastx = side->lasty = -1; X if (Debug) printf("Successfully opened \"%s\"!\n", side->host); X} X X/* Decide/compute all the sizes of things. Our main problem here is that */ X/* the display might be smaller than we really desire, so things have to */ X/* be adjusted to fit. */ X Xinit_sizes(side) XSide *side; X{ X int alw, abh; X X alw = (3 * display_width(side)) / 4; X side->vw = min(world.width, alw / side->hw); X side->nw = min(BUFSIZE, alw / side->fw); X side->sw = maxnamelen; X abh = (2 * display_height(side)) / 3; X side->vh = min(world.height, abh / side->hch); X side->nh = max(1, min(abh/2 - 5, MAXNOTES)); X side->mm = min(5, (max(world.width, side->fw*side->sw) / world.width)); X set_sizes(side); X if (side->vw < MINWIDTH || side->vh < MINHEIGHT) { X fprintf(stderr, "Display \"%s\" is too small!\n", side->host); X exit_xconq(); X } X} X X/* This fn is a "ten-line horror"; effectively a mini tiled window manager */ X/* that keeps the subwindows from overlapping no matter what the display and */ X/* requested sizes are. Siemens eat your heart out... */ X Xset_sizes(side) XSide *side; X{ X int ulhgt, llhgt, urhgt, lrhgt; X X /* Make sure map window dimensions are OK */ X side->vw = min(world.width, side->vw); X side->vh = min(world.height, side->vh); X side->vw2 = side->vw / 2; side->vh2 = side->vh / 2; X /* Compute subregion sizes (left/right upper/lower width/height) */ X side->lw = max(side->nw * side->fw, side->hw * side->vw); X side->rw = max((world_display(side) ? world.width * side->mm : 0), X side->sw * side->fw); X urhgt = (numsides + 4) * side->fh + side->bd; X ulhgt = side->fh * (side->nh + INFOLINES + 1) + 3 * side->bd; X side->th = max(ulhgt, urhgt); X lrhgt = period.numutypes * max(side->hh, side->fh); X if (world_display(side)) lrhgt += side->mm * world.height + side->bd; X llhgt = side->hch * side->vh + (side->hh - side->hch); X side->bh = max(llhgt, lrhgt); X side->mw = side->lw + side->bd + side->rw; X side->mh = side->th + side->bd + side->bh; X /* Only vcy needs adjustment, since vcx can never be close to an edge */ X side->vcy = min(max(side->vh2, side->vcy), (world.height-1)-side->vh2); X} X X/* Acquire a set of colors. There are too many to make it feasible to */ X/* customize them via .Xdefaults, so we don't even try. If there aren't */ X/* enough colors, drop into monochrome mode. This doesn't take the window */ X/* manager into account - it may have grabbed some color space. */ X Xinit_colors(side) XSide *side; X{ X if (Debug) printf("%d colors available ...\n", display_colors(side)); X side->monochrome = (display_colors(side) == 2); X side->bonw = (side->monochrome ? BLACKONWHITE : FALSE); X set_colors(side); X} X X/* This will set up the correct set of colors at any point in the game. */ X/* Note that terrain colors get NO value if in monochrome mode. */ X/* If the colors requested are not available, it is up to the graphics */ X/* interface to supply a substitute. */ X Xset_colors(side) XSide *side; X{ X int t; X long fg, bg; X X fg = (side->bonw ? black_color(side) : white_color(side)); X bg = (side->bonw ? white_color(side) : black_color(side)); X side->bgcolor = side->owncolor = side->altcolor = side->diffcolor = bg; X side->fgcolor = side->bdcolor = side->graycolor = side->enemycolor = fg; X side->neutcolor = side->goodcolor = side->badcolor = fg; X if (!side->monochrome) { X for_all_terrain_types(t) { X side->hexcolor[t] = request_color(side, ttypes[t].color); X } X side->owncolor = request_color(side, "black"); X side->altcolor = request_color(side, "blue"); X side->diffcolor = request_color(side, "maroon"); X side->bdcolor = request_color(side, "blue"); X side->graycolor = request_color(side, "light gray"); X side->enemycolor = request_color(side, "red"); X side->neutcolor = request_color(side, "light gray"); X side->goodcolor = request_color(side, "green"); X side->badcolor = request_color(side, "red"); X } X} X X/* Move windows and change their sizes to correspond with the new sizes of */ X/* viewports, etc. */ X Xreconfigure_display(side) XSide *side; X{ X int sy, sdy; X X if (active_display(side)) { X set_sizes(side); X set_colors(side); X reset_misc(side); X sy = 0; sdy = side->nh * side->fh; X change_window(side, side->msg, 0, sy, side->lw, sdy); X sy += sdy + side->bd; sdy = INFOLINES * side->fh; X change_window(side, side->info, 0, sy, side->lw, sdy); X sy += sdy + side->bd; sdy = 1 * side->fh; X change_window(side, side->prompt, 0, sy, side->lw, sdy); X change_window(side, side->map, 0, side->th, X side->vw * side->hw, X side->vh * side->hch + (side->hh - side->hch)); X change_window(side, side->timemode, X side->lw + side->fw, side->th - 4 * side->fh, -1, -1); X change_window(side, side->sides, side->lw+1, 0, -1, -1); X if (world_display(side)) { X change_window(side, side->world, X side->lw + 1, side->mh - world.height * side->mm, X world.width * side->mm, world.height * side->mm); X } X change_window(side, side->main, -1, -1, side->mw, side->mh); X redraw(side); X } X} X END_OF_ginit.c if test 8930 -ne `wc -c <ginit.c`; then echo shar: \"ginit.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f lib/europe42.scn -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"lib/europe42.scn\" else echo shar: Extracting \"lib/europe42.scn\" \(5470 characters\) sed "s/^X//" >lib/europe42.scn <<'END_OF_lib/europe42.scn' XXconq 1 ---+++ Europe 1942; XThe Allies are really just England, Portugal, Egypt, and Russia, Xwhile the Axis is all of continental Europe (except Spain) and North Africa Xwest of Egypt. Spain and Turkey are neutral, although both are easily Xgrabbed up. There is nothing anywhere else in the world. Neither side Xhas any units to start with, but many are scheduled to come out within the Xfirst five turns. This scenario quickly gets into full-scale combat; be Xwary of battleships and bombers. Since most of the country is open, armor Xis a good choice, especially for the Allies, because many Russian cities Xare far away fromthe front. X Xshould have winning conditions relating to capital cities? X. Xearth1.map XGlobals 0 150 0 0 0 0 XSides 2 1 0 XAllies XAxis XUnits 85 2 0 X* Dublin 116,114 -1 X11 0 -1 20 0 0 0 31 0 0 -1 500 200 X* Bilbao 125,104 -1 X49 0 -1 20 0 0 0 31 0 0 -1 500 200 X* Zaragoza 128,102 -1 X54 0 -1 20 0 0 0 31 0 0 -1 500 200 X* Barcelona 131,102 -1 X55 0 -1 20 0 0 0 31 0 0 -1 500 200 X@ Istanbul 157,102 -1 X57 0 -1 40 0 0 0 31 0 0 -1 900 400 X@ Madrid 126,101 -1 X58 0 -1 40 0 0 0 31 0 0 -1 900 400 X* Valencia 129,100 -1 X61 0 -1 20 0 0 0 31 0 0 -1 500 200 X* Ankara 162,100 -1 X62 0 -1 20 0 0 0 31 0 0 -1 500 200 X* Erzurum 171,100 -1 X63 0 -1 20 0 0 0 31 0 0 -1 500 200 X* Jerevan 174,100 -1 X64 0 -1 20 0 0 0 31 0 0 -1 500 200 X/ Cordoba 125,99 -1 X66 0 -1 10 0 0 0 31 0 0 -1 200 100 X* Izmir 158,99 -1 X68 0 -1 20 0 0 0 31 0 0 -1 500 200 X* Tabriz 177,99 -1 X69 0 -1 20 0 0 0 31 0 0 -1 500 200 X* Adana 166,98 -1 X72 0 -1 20 0 0 0 31 0 0 -1 500 200 X* Aleppo 169,97 -1 X75 0 -1 20 0 0 0 31 0 0 -1 500 200 X* Casablanca 125,94 -1 X77 0 -1 20 0 0 0 31 0 0 -1 500 200 X* Fez 127,94 -1 X78 0 -1 20 0 0 0 31 0 0 -1 500 200 X* Baghdad 179,93 -1 X79 0 -1 20 0 0 0 31 0 0 -1 500 200 X* Marrakech 126,92 -1 X80 0 -1 20 0 0 0 31 0 0 -1 500 200 X@ Cairo 164,90 0 X84 10 -1 40 0 0 0 1 3 0 -1 900 400 X* Alexandria 164,92 0 X82 13 -1 20 0 0 0 2 4 0 -1 500 200 X/ Malta 148,95 0 X71 2 -1 10 0 0 0 31 0 0 -1 188 100 X@ Lisbon 122,99 0 X65 9 -1 40 0 0 0 0 1 0 -1 900 400 X* Porto 121,101 0 X53 11 -1 20 0 0 0 0 1 0 -1 500 200 X* Odessa 157,107 0 X39 10 -1 20 0 0 0 1 3 0 -1 500 200 X* Dnepropetrovsk 161,109 0 X34 8 -1 20 0 0 0 1 3 0 -1 500 200 X@ Doneck 163,109 0 X35 8 -1 40 0 0 0 1 3 0 -1 900 400 X@ Kiev 155,111 0 X27 7 -1 40 0 0 0 0 1 0 -1 900 400 X* Kharkov 161,111 0 X28 7 -1 20 0 0 0 1 3 0 -1 500 200 X* Bristol 120,112 0 X20 6 -1 20 0 0 0 6 5 0 -1 500 200 X/ Dover 124,112 0 X21 1 -1 10 0 0 0 31 0 0 -1 200 100 X@ London 123,113 0 X16 6 -1 40 0 0 0 9 50 0 -1 900 400 X@ Manchester 120,114 0 X12 5 -1 40 0 0 0 8 5 0 -1 900 400 X* Minsk 150,114 0 X15 5 -1 20 0 0 0 0 2 0 -1 500 200 X* Hull 122,115 0 X8 4 -1 20 0 0 0 3 4 0 -1 500 200 X* Volgograd 170,109 0 X36 9 -1 20 0 0 0 2 4 0 -1 500 200 X* Belfast 115,116 0 X3 2 -1 20 0 0 0 2 4 0 -1 500 200 X@ Glasgow 117,116 0 X4 3 -1 40 0 0 0 4 3 0 -1 900 400 X* Newcastle 119,116 0 X5 3 -1 20 0 0 0 1 3 0 -1 500 200 X@ Moscow 159,116 0 X7 4 -1 40 0 0 0 0 2 0 -1 900 400 X* Baku 179,101 0 X60 12 -1 20 0 0 0 3 4 0 -1 500 200 X* Riga 146,117 0 X1 1 -1 20 0 0 0 0 4 1 -1 500 200 X@ Gorky 165,117 0 X2 2 -1 40 0 0 0 3 3 0 -1 900 400 X@ Leningrad 149,120 0 X0 1 -1 40 0 0 0 5 8 0 -1 900 400 X* Oran 132,96 1 X76 32 -1 20 0 0 0 0 1 0 -1 500 200 X* Nantes 124,108 1 X37 15 -1 20 0 0 0 5 2 0 -1 500 200 X* Bordeaux 127,105 1 X44 20 -1 20 0 0 0 0 2 0 -1 500 200 X@ Algiers 135,97 1 X73 7 -1 40 0 0 0 1 1 0 -1 900 400 X* Toulouse 129,104 1 X50 25 -1 20 0 0 0 1 4 0 -1 500 200 X* Le*Havre 125,110 1 X29 11 -1 20 0 0 0 2 4 0 -1 500 200 X* Marseilles 132,104 1 X51 26 -1 20 0 0 0 5 3 0 -1 500 200 X@ Paris 128,109 1 X30 4 -1 40 0 0 0 1 2 0 -1 900 400 X* Lyon 131,106 1 X40 17 -1 20 0 0 0 1 4 0 -1 500 200 X* Brussels 128,111 1 X24 8 -1 20 0 0 0 0 2 0 -1 500 200 X* Nice 134,105 1 X45 21 -1 20 0 0 0 5 5 0 -1 500 200 X* Tunis 142,97 1 X74 31 -1 20 0 0 0 0 5 0 -1 500 200 X* Torino 134,106 1 X41 18 -1 20 0 0 0 2 1 0 -1 500 200 X@ Rotterdam 128,113 1 X17 2 -1 40 0 0 0 5 10 0 -1 900 400 X* Genoa 136,105 1 X46 22 -1 20 0 0 0 4 5 0 -1 500 200 X@ Milan 136,106 1 X42 5 -1 40 0 0 0 3 3 0 -1 900 400 X* Palermo 145,97 1 X70 30 -1 20 0 0 0 6 2 0 -1 500 200 X* Tripoli 151,91 1 X83 34 -1 20 0 0 0 1 6 0 -1 500 200 X* Dortmund 131,112 1 X22 6 -1 20 0 0 0 1 1 0 -1 500 200 X* Essen 132,112 1 X23 7 -1 20 0 0 0 2 2 0 -1 500 200 X* Stuttgart 135,109 1 X31 12 -1 20 0 0 0 1 2 0 -1 500 200 X@ Rome 142,102 1 X56 6 -1 40 0 0 0 1 3 0 -1 900 400 X* Frankfurt 134,111 1 X25 9 -1 20 0 0 0 3 2 0 -1 500 200 X@ Hamburg 132,114 1 X13 1 -1 40 0 0 0 8 5 0 -1 900 400 X* Munich 137,109 1 X32 13 -1 20 0 0 0 1 1 0 -1 500 200 X* Benghazi 154,92 1 X81 33 -1 20 0 0 0 0 5 0 -1 500 200 X* Zagreb 143,106 1 X43 19 -1 20 0 0 0 0 1 0 -1 500 200 X* Copenhagen 134,116 1 X6 1 -1 20 0 0 0 6 10 0 -1 500 200 X@ Berlin 137,113 1 X18 3 -1 40 0 0 0 9 50 0 -1 900 400 X* Prague 139,111 1 X26 10 -1 20 0 0 0 1 2 0 -1 500 200 X* Vienna 142,109 1 X33 14 -1 20 0 0 0 2 1 0 -1 500 200 X* Budapest 145,108 1 X38 16 -1 20 0 0 0 1 1 0 -1 500 200 X* Belgrade 148,105 1 X47 23 -1 20 0 0 0 3 2 0 -1 500 200 X* Athens 154,99 1 X67 29 -1 20 0 0 0 0 9 0 -1 500 200 X* Thessaloniki 153,101 1 X59 28 -1 20 0 0 0 0 10 0 -1 500 200 X* Gdansk 141,114 1 X14 4 -1 20 0 0 0 1 4 0 -1 500 200 X* Sofia 152,103 1 X52 27 -1 20 0 0 0 0 1 0 -1 500 200 X* Konigsberg 143,115 1 X9 2 -1 20 0 0 0 4 1 0 -1 500 200 X* Warsaw 145,113 1 X19 5 -1 20 0 0 0 1 1 0 -1 500 200 X* Bucharest 154,105 1 X48 24 -1 20 0 0 0 2 1 0 -1 500 200 X* Vilnius 148,115 0 X10 3 -1 20 0 0 0 0 1 0 -1 500 200 END_OF_lib/europe42.scn if test 5470 -ne `wc -c <lib/europe42.scn`; then echo shar: \"lib/europe42.scn\" unpacked with wrong size! fi # end of overwriting check fi if test -f lib/future.per -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"lib/future.per\" else echo shar: Extracting \"lib/future.per\" \(9117 characters\) sed "s/^X//" >lib/future.per <<'END_OF_lib/future.per' XXconq 0 -+---- Futuristic period from Jay Scott XPeriod 0 X X"around 2200 AD" period-name X X"h" "hovercar" "easily built, moves fast and captures cities" utype X"g" "groundcar" "slow but tough, captures cities" utype X"s" "saucer" "moves fast, easy to build, but short range" utype X"d" "destroyer" "heavy aircraft that defeats subs and saucers" utype X"c" "constructor" "builds bases anywhere" utype X"m" "mother ship" "carries aircraft and ground units" utype X"t" "transport sub" "quickly built, carries ground units" utype X"a" "attack sub" "attacks cities and carries rockets" utype X"R" "rocket" "missile that can kill most units and hit cities" utype X"/" "base" "airstrip + port but no production" utype X"*" "town" "produces but easily captured and may revolt" utype X"@" "city" "metropolis - hard to capture" utype X X"F" "fuel" "used for both movement and combat" rtype X X"." "sea" "sky blue" ttype X"," "shallows" "cyan" ttype X"=" "swamp" "dark gray" ttype X"+" "plains" "green" ttype X"%" "forest" "forest green" ttype X"~" "desert" "yellow" ttype X"^" "mountains" "sienna" ttype X"_" "ice" "white" ttype X":" "vacuum" "black" ttype X Xtrue [ swamp vacuum ] dark X Xt* t* nuked ; most terrain won't actually change Xdesert [ plains forest ] nuked Xmountains ice nuked X X[ 0 69 70 70 70 70 95 99 0 ] t* min-alt X[ 69 70 72 95 95 95 99 100 0 ] t* max-alt X[ 0 0 50 20 80 0 0 0 0 ] t* min-wet X[ 100 100 100 80 100 20 100 100 0 ] t* max-wet X Xice edge-terrain X X[ / * @ ] "cities" define X[ h g s d c m t a R ] "movers" define X X"hovcraft" h icon-name X"tank" g icon-name X"saucer" s icon-name X"delta" d icon-name X"builder" c icon-name X"mothrship" m icon-name X"sub" t icon-name X"sub" a icon-name X"rocket" R icon-name X"saucerpad" / icon-name X"town22" * icon-name X"city22" @ icon-name X X[ 1 5 25 ] cities territory X X[ 0 2 1 ] cities in-country X100 * density X@ first-unit Xh first-product X100 [ plains ] [ * @ ] favored X X[ 4 6 2 10 10 20 7 12 8 ] movers @ make X[ 4 6 2 10 10 20 7 12 8 ] movers * make X3 / c make Xtrue [ * @ ] maker X20 u* startup X50 [ d m ] startup X100 c startup X300 R startup X X10 fuel cities produce X[ 30 40 16 16 30 40 200 150 30 500 1000 2000 ] fuel u* storage X1 [ s d ] fuel consume X1 u* fuel consume ; not plausible, but helps machine players X X100 t* cities productivity X X[ 3 1 8 4 3 6 2 3 10 ] movers speed X X0 plains h moves X1 shallows h moves X0 [ plains desert ] g moves X0 t* [ s d c m ] moves X0 [ sea shallows ] [ t a ] moves X0 t* R moves X X1 fuel movers to-move X X[ 6 4 10 2 1 ] [ h g s d c ] m capacity X4 R a capacity X10 u* / capacity X100 u* [ * @ ] capacity X X0 [ t a ] visibility Xtrue cities always-seen X X[ 1 1 1 2 2 5 2 2 1 10 20 40 ] u* hp X X[ 65 60 40 50 50 50 5 5 50 99 99 99 ] u* h hit X[ 80 60 50 40 50 50 10 10 50 99 99 99 ] u* g hit X[ 50 40 70 10 70 90 10 10 99 99 99 99 ] u* s hit X[ 10 10 65 20 70 70 50 50 20 99 99 99 ] u* d hit X[ 20 20 10 5 20 10 0 0 20 0 0 0 ] u* c hit X[ 15 10 20 5 40 40 0 0 30 0 0 0 ] u* m hit X[ 0 0 0 0 0 0 0 0 0 0 0 0 ] u* t hit X[ 40 60 10 10 20 20 60 20 0 99 99 99 ] u* a hit X[ 99 99 60 80 90 90 70 70 20 99 99 99 ] u* R hit X[ 10 10 10 20 0 0 0 10 0 0 0 0 ] u* / hit X[ 30 30 30 40 0 0 0 20 0 0 0 0 ] u* / hit X[ 50 50 50 50 0 0 0 50 0 0 0 0 ] u* / hit X X1 u* u* damage X3 cities a damage X4 u* R damage X10 cities R damage X2 u* @ damage X X[ 80 70 20 ] cities h capture X[ 90 80 30 ] cities g capture X Xtrue R self-destruct X X1 fuel u* hits-with X1 fuel u* hit-by X Xtrue movers can-disband Xtrue / can-disband X Xtrue cities neutral X X-50 neutrality X Xbegin{notes} XA science fiction xconq period. XIt's weirder and wilder than the historical periods provided with the game. XLots of things happen faster, so the game is often shorter. X XThis is in the public domain. X X ----- ----- the units ----- ----- X XHovercar. A fast-moving ground unit that easily captures towns. A Xhovercar floats on an antigravity field, so it can maneuver easily Xeven in mountainous terrain or shallow water (though not deep ocean). XHovercars are invaluable in an invasion for their ability to take Xcities quickly, but they are easily destroyed by flying saucers or Xgroundcars. X XGroundcar. A slow-moving unit which travels on treads, like today's Xtanks. It can afford to carry a large shield generator, which makes Xit tough to destroy. It can negotiate forests by pushing down the Xtrees, or burning them away with its gun, but it can't move in Xmountains. Groundcars are ideal for defending your homeland from Xinvasion. If you have enough on hand, you can often bounce back even Xafter many of your towns are captured. X XSaucer. The flying saucer is a weak but fast-moving aircraft. Saucers Xare very cheap to produce; one use is to overwhelm stronger units with Xmob attacks. They can even bombard a city to rubble, unless there's Xa Defender around. Saucers are also good for recon, within their limited Xrange. X XDefender. A heavy, delta-wing aircraft that's your only safe defense Xagainst the enemy's swarms of saucers. It uses aerodynamic lift to Xsupplement its drive, allowing it to carry relatively massive Xantisubmarine equipment. But it's an easy target for ground units. X XConstructor. An automated airborn factory that can build a base from Xon-site materials in only one turn. It can build a base anywhere, even Xon water or ice. That means, for instance, that you can build bridges Xbetween islands for ground units. The constructor is the only way Xto produce the sophisticated equipment needed for a twenty-second Xcentury base (you don't know how hard it is to refuel those saucers :-). XBut it's vulnerable to attack, especially from saucers. X XMother ship. Expensive to build, but the only way to mount a major Xinvasion. A mother ship can carry lots of saucers, lots of ground Xunits, a couple Defenders and a constructor, all at once. (The constructor Xis useful for building stepping stone bases toward the enemy.) XA mass attack is sure to bring down a mother ship, so it deserves Xsaucer patrols--but you may have to forego patrols if you're trying Xfor a surprise invasion. X XTransport sub. Carries only a few ground units, but much cheaper to Xproduce than a mother ship. This is how you get your troops to another Xisland early in the game. And since, like subs in the WWII period, Xit's invisible until bumped into, it's good for sneak raids on isolated Xoutposts. A transport submarine can't attack anything by itself. X XAttack sub. Strong against transport subs, and, if they're on the coast, Xground units and cities. It stays underwater and pokes its weapons out, Xwhich makes it relatively invulnerable to counterattack. It's faster Xthan a transport sub, and good for wide-ranging exploration. And to top Xit off, it can carry several rockets to within easy range of enemy cities. XOn the other hand, all submarines have to be careful of Defenders. X XRocket. Actually a remotely guided missile, which does a lot of damage Xto its target but vaporizes itself in the process. One rocket is Xenough to take out most units--it's not quite enough by itself Xto down a mother ship. Three rockets together are sufficient to pound Xa town back to a base. Only occasionally will a rocket miss its target. XBesides stomping cities, they're useful for eliminating enemy groundcars Xand Defenders just before an invasion. Since rockets are easily Xshot down if spied in mid-flight, it's sensible to launch them from Xattack subs near their targets. [Because of the way xconq works, Xmessages about rockets don't always make sense.] X X ----- ----- strategy ----- ----- X XThe game is designed so you need to have at least a few of every Xkind of unit to do well in a full game. (You may be able to get by Xwithout transport subs if you start out on a big continent.) If Xanybody finds they can consistently do well without some kind of unit, XI want to hear how so I can fix it! X XEvery unit has at least one nemesis which can destroy it relatively Xeasily. Your goal should be to fight every battle at an advantage, Xpitting each unit against its natural prey--saucers against hovercars, Xdefenders against saucers, hovercars against defenders. X XRockets ensure that the game doesn't drag on too long. Invasion is Xrisky, but when it works the invader wins quickly. Rockets by contrast Xare a slow but steady way to nibble at the enemy production base. X XMachine players are especially easy to defeat in this period. If you're Xlucky enough to start near one, you can blitz it with hovercars and Xsaucers and win in short order. It takes longer if you're far from Xthe robot. Gaining air superiority is usually the first step. X XThe game hasn't been played by enough people for me to tell what Xstrategies are best in different circumstances. If I've done my Xjob well, the best plan will depend in detail on the opponent and Xthe situation, and you'll have to think hard. X XI'd appreciate any comments. X X Jay Scott, August 1987. X ...bpa!swatsun!scott X ...seismo!bpa!swatsun!scott Xend{notes} X Xend X END_OF_lib/future.per if test 9117 -ne `wc -c <lib/future.per`; then echo shar: \"lib/future.per\" unpacked with wrong size! fi # end of overwriting check fi if test -f lib/trooper.b -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"lib/trooper.b\" else echo shar: Extracting \"lib/trooper.b\" \(239 characters\) sed "s/^X//" >lib/trooper.b <<'END_OF_lib/trooper.b' X#define stormtrooper_width 16 X#define stormtrooper_height 16 Xstatic short stormtrooper_bits[] = { X 0x0000, 0x0030, 0x0058, 0x0478, X 0x0338, 0x01fc, 0x01fc, 0x007c, X 0x003e, 0x0036, 0x0032, 0x0030, X 0x0030, 0x0030, 0x0078, 0x0000}; END_OF_lib/trooper.b if test 239 -ne `wc -c <lib/trooper.b`; then echo shar: \"lib/trooper.b\" unpacked with wrong size! fi # end of overwriting check fi if test -f unit.h -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"unit.h\" else echo shar: Extracting \"unit.h\" \(5647 characters\) sed "s/^X//" >unit.h <<'END_OF_unit.h' X/* Copyright (c) 1987, 1988 Stanley T. Shebs, University of Utah. */ X/* This program may be used, copied, modified, and redistributed freely */ X/* for noncommercial purposes, so long as this notice remains intact. */ X X/* RCS $Header: unit.h,v 1.1 88/06/21 12:29:48 shebs Exp $ */ X X/* Definitions about units and their orders. */ X X#define NOTHING (MAXUTYPES+1) /* A number guaranteed to be a non-unit. */ X X/* Unit order types. Each type has a letter, name, short name, and some */ X/* parameter types that guide how the order will be input. */ X X#define NUMORDERTYPES 8 X X#define NONE 0 X#define AWAKE 1 X#define SENTRY 2 X#define MOVEDIR 3 X#define MOVETO 4 X#define EDGE 5 X#define FOLLOW 6 X#define PATROL 7 X X#define ORDERNAMES \ X { "None", "Awake", "Sentry", "Dir Move", "Move to", \ X "Follow Edge", "Follow Leader", "Patrol" } X X/* Types of arguments that orders can have. */ X X#define NOARG 0 X#define DIR 1 X#define POS 2 X#define LEADER 3 X#define WAYPOINTS 4 X X#define ORDERARGS \ X { NOARG, NOARG, NOARG, DIR, POS, DIR, LEADER, WAYPOINTS } X X#define ORDERARGNAMES \ X { "no args", "no args", "no args", "direction", \ X "destination", "direction", "unit", "waypoints" } X X/* Number of points possible in order parameters. If actual number not */ X/* implicit in order type, then will need a count field somewhere. */ X X#define NUMWPS 2 X X/* Bit-encoded flags that specify's units behavior when under orders. */ X X#define ENEMYWAKE 0x01 X#define NEUTRALWAKE 0x02 X#define SUPPLYWAKE 0x04 X#define ATTACKUNIT 0x08 X#define SHORTESTPATH 0x10 X X#define ALLFLAGS 0x1f X X#define NORMAL ALLFLAGS X X/* tiny hack structure */ X Xtypedef struct a_pt { X short x, y; X} Pt; X X/* Definition of an "order", which is the means by which a unit keeps */ X/* track of what it should do. Needs the encapsulation because orders */ X/* show up in both units and in collections of standing orders. */ X Xtypedef struct a_order { X short type; /* type of order (awake, random, etc) */ X short rept; /* number to repeat order */ X short flags; /* bit vector of special flags */ X union { X short dir; /* a direction */ X struct a_unit *leader; /* pointer to a leader unit */ X Pt pt[NUMWPS]; /* small array of coordinates */ X } p; /* parameters of an order */ X} Order; X X/* A standing order is actually an array with an order for each unit type. */ X/* The structure is allocated only when a standing order is given. */ X Xtypedef struct s_order { X Order *orders[MAXUTYPES]; X} StandingOrder; X X/* This structure should be small, because there may be many of them. */ X/* On the other hand, changing shorts to chars would entail fiddling with */ X/* mapfile code, so beware. */ X Xtypedef struct a_unit { X /* Level 1 detail */ X short type; /* type (army, ship, etc) */ X char *name; /* the name, if given */ X short x, y; /* position of unit on map */ X struct a_side *side; /* whose side this unit is on */ X /* Level 2 detail */ X short id; /* truly unique id number */ X short number; /* semi-unique id number */ X struct a_side *trueside; /* whose side this unit is really on */ X short hp; /* how much more damage it can take */ X short quality; /* "veteran-ness" */ X short morale; /* how happy our guys are */ X short fatigue; /* how tired they are */ X short product; /* type of unit this unit is producing */ X short schedule; /* when the unit will be done */ X short built; /* how many units of current type made so far */ X struct a_unit *transport; /* pointer to transporter if any */ X short supply[MAXRTYPES]; /* how much supply we're carrying */ X /* Level 3 detail */ X short group; /* group to which unit belongs (machine) */ X short goal; /* personal goal of unit */ X short gx, gy; /* current goal position */ X short movesleft; /* how many moves left in this turn */ X short actualmoves; /* hexes actually covered this turn */ X short lastdir; /* last direction of move */ X short awake; /* true if unit temporarily awake */ X Order orders; /* current orders being carried out */ X StandingOrder *standing; /* pointer to collection of standing orders */ X /* Never saved */ X struct a_unit *occupant; /* pointer to first unit being carried */ X struct a_unit *nexthere; /* pointer to fellow occupant */ X struct a_unit *next; /* next unit in list of all units */ X} Unit; X X/* Some convenient macros. */ X X#define for_all_units(v) for (v = unitlist; v != NULL; v = v->next) X X#define for_all_occupants(u1,u2) \ X for (u2 = u1->occupant; u2 != NULL; u2 = u2->nexthere) X X#define alive(u) ((u)->hp > 0) X X#define cripple(u) ((u)->hp < utypes[(u)->type].crippled) X X#define neutral(u) ((u)->side == NULL) X X#define producing(u) ((u)->product != NOTHING) X X#define busy(u) (producing(u) || (u)->schedule > 0) X X#define idled(u) (utypes[(u)->type].maker && !busy(u)) X X#define mobile(u) (utypes[u].speed > 0) X X#define could_occupy(u,t) (could_move(u,t)) X X/* Unit variables. */ X Xextern Unit *unitlist, *tmpunit; Xextern Unit *create_unit(), *read_basic_unit(), *random_start_unit(); Xextern Unit *find_unit(); X Xextern int numunits, orderargs[]; X Xextern char *ordernames[]; Xextern char *random_unit_name(), *unit_handle(), *short_unit_handle(); Xextern char *make_unit_name(), *order_desig(); END_OF_unit.h if test 5647 -ne `wc -c <unit.h`; then echo shar: \"unit.h\" unpacked with wrong size! fi # end of overwriting check fi if test -f util.c -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"util.c\" else echo shar: Extracting \"util.c\" \(5410 characters\) sed "s/^X//" >util.c <<'END_OF_util.c' X/* Copyright (c) 1987, 1988 Stanley T. Shebs, University of Utah. */ X/* This program may be used, copied, modified, and redistributed freely */ X/* for noncommercial purposes, so long as this notice remains intact. */ X X/* RCS $Header: util.c,v 1.1 88/06/21 12:30:46 shebs Exp $ */ X X/* Random utilities not classifiable elsewhere. Most are not xconq-specific. */ X X#include "config.h" X#include "misc.h" X#include "dir.h" X Xchar ordnum[BUFSIZE]; /* buffer for ordinal numbers */ Xchar pluralbuf[BUFSIZE]; /* buffer for plurals of words */ X Xint dirx[] = DIRX, diry[] = DIRY; /* arrays for dir-to-delta conversion */ X X/* This generates a file name in wherever xconq keeps its assorted files. */ X/* Note that for Unix machines, XCONQLIB should have a trailing slash. */ X Xmake_pathname(path, name, extn, pathbuf) Xchar *path, *name, *extn, *pathbuf; X{ X#ifdef UNIX X sprintf(pathbuf, "%s/%s%s%s", X ((path && strlen(path) > 0) ? path : "."), X name, X ((extn && strlen(extn) > 0) ? "." : ""), X ((extn && strlen(extn) > 0) ? extn : "")); X#endif UNIX X#ifdef ATARI X sprintf(pathbuf, "%s\\%s.%s", path, name, extn); X#endif ATARI X} X X/* Remove a saved game from the system. */ X Xremove_saved_game() X{ X#ifdef UNIX X unlink(SAVEFILE); X#endif UNIX X} X X/* Random number handling is important to game but terrible/nonexistent */ X/* in some systems. Do it ourselves and hope it's better... */ X Xlong randstate; /* The random state *must* be at least 32 bits. */ X X/* Seed can come from elsewhere, for repeatability. Otherwise, it comes */ X/* the current time, scaled to a point where 32-bit arithmetic won't */ X/* overflow. Pid is not so good, usually a smaller range of values. */ X Xinit_random(seed) Xint seed; X{ X if (seed >= 0) { X randstate = seed; X } else { X#ifdef UNIX X randstate = (time((long *) 0) % 100000L); X#endif UNIX X } X} X X/* Numbers lifted from Numerical Recipes, p. 198. */ X/* Arithmetic must be 32-bit. */ X Xrandom(m) Xint m; X{ X randstate = (8121 * randstate + 28411) % 134456L; X return ((m * randstate) / 134456L); X} X X/* Percentage probability, with bounds checking. */ X Xprobability(prob) Xint prob; X{ X if (prob <= 0) return FALSE; X if (prob >= 100) return TRUE; X return (random(100) < prob); X} X X/* Read a line and save it away. This routine should be used sparingly, */ X/* since the malloced space is never freed. */ X Xchar * Xread_line(fp) XFILE *fp; X{ X char tmp[BUFSIZE], *line; X X fgets(tmp, BUFSIZE-1, fp); X tmp[strlen(tmp)-1] = '\0'; X line = (char *) malloc(strlen(tmp)+2); X strcpy(line, tmp); X return line; X} X X/* Copy to new-allocated space. Again, the new space is never freed. */ X Xchar * Xcopy_string(str) Xchar *str; X{ X char *rslt; X X rslt = (char *) malloc(strlen(str)+1); X strcpy(rslt, str); X return rslt; X} X X/* Computing distance in a hexagonal system is a little peculiar, since it's */ X/* sometimes just delta x or y, and other times is the sum. Basically there */ X/* are six ways to compute distance, depending on the hextant we're in. */ X Xdistance(x1, y1, x2, y2) Xint x1, y1, x2, y2; X{ X int dx = x2 - x1, dy = y2 - y1; X X if (dx >= 0) { X if (dy >= 0) { X return (dx + dy); X } else if ((0 - dy) <= dx) { X return dx; X } else { X return (0 - dy); X } X } else { X if (dy <= 0) { X return (0 - (dx + dy)); X } else if (dy <= (0 - dx)) { X return (0 - dx); X } else { X return dy; X } X } X} X X/* Convert any vector into a direction (not necessarily the closest one). */ X/* Fail horribly on zero vectors. */ X Xfind_dir(dx, dy) Xint dx, dy; X{ X if (dx < 0) { X if (dy < 0) return SW; X if (dy == 0) return WEST; X return NW; X } else if (dx == 0) { X if (dy > 0) return NE; X if (dy == 0) abort(); X return SW; X } else { X if (dy < 0) return SE; X if (dy == 0) return EAST; X return NE; X } X} X X/* Given a number, figure out what suffix should go with it. */ X/* Note the use of static storage (to save a little mallocing) */ X Xchar * Xordinal(n) Xint n; X{ X char *suff; X X if (n % 100 == 11 || n % 100 == 12 || n % 100 == 13) { X suff = "th"; X } else { X switch (n % 10) { X case 1: suff = "st"; break; X case 2: suff = "nd"; break; X case 3: suff = "rd"; break; X default: suff = "th"; break; X } X } X sprintf(ordnum, "%d%s", n, suff); X return ordnum; X} X X/* Pluralize a word, attempting to be smart about various possibilities */ X/* that don't have a different plural form (such as "Chinese" and "Swiss"). */ X/* There should probably be a test for when to add "es" instead of "s". */ X Xchar * Xplural_form(word) Xchar *word; X{ X char endch = ' ', nextend = ' '; X X if (strlen(word) > 0) endch = word[strlen(word)-1]; X if (strlen(word) > 1) nextend = word[strlen(word)-2]; X if (endch == 'h' || endch == 's' || (endch == 'e' && nextend == 's')) { X sprintf(pluralbuf, "%s", word); X } else { X sprintf(pluralbuf, "%ss", word); X } X return pluralbuf; X} X X/* Get a *numeric* index into a string (more useful than ptr to xconq). */ X/* Return -1 on failed search. */ X Xiindex(ch, str) Xchar ch, *str; X{ X int i; X X if (str == NULL) return (-1); X for (i = 0; str[i] != '\0'; ++i) if (ch == str[i]) return i; X return (-1); X} X X/* This little routine goes at the end of all switch statements on internal */ X/* data values. We want a core dump to debug. */ X Xcase_panic(str, var) Xchar *str; Xint var; X{ X fprintf(stderr, "Panic! Unknown %s %d\n", str, var); X abort(); X} END_OF_util.c if test 5410 -ne `wc -c <util.c`; then echo shar: \"util.c\" unpacked with wrong size! fi # end of overwriting check fi if test -f xconq.6 -a "${1}" != "-c" ; then echo shar: Will not over-write existing file \"xconq.6\" else echo shar: Extracting \"xconq.6\" \(5716 characters\) sed "s/^X//" >xconq.6 <<'END_OF_xconq.6' X.TH XCONQ 6 Utah X.SH NAME Xxconq - X-based strategy game X.SH SYNOPSIS X.B Xxconq X[ options ] ... X.SH DESCRIPTION X\fIXconq\fP is a multi-player strategic wargame. XYour goal is to save the world from the evil empires attempting to Xtake over. You get cities, armies, airplanes, and ships with which to Xaccomplish your task. Success is achieved by the neutralization or Xdefeat of the other sides, by any means available. First you have to Xfind them! X.PP XAlthough the game can get complicated, to start you need only Xknow about the help command '?', which is valid at any time. XYou start with only one city, which makes things even simpler. XThe city will automatically produce a military unit, which you Xwill be prompted to move around. Eventually, you will get more and Xcan attempt to take over other cities. XThe game keeps going Xuntil only one side is left in action; Xthis player is then declared the winner. X.PP XBy default, \fIxconq\fP Xstarts up with one human (on the display in $DISPLAY) and one Xmachine, playing on a randomly generated 60x30 world. Options are Xavailable to set numbers and kinds of players, as well as the Xkind of map used. In addition, \fIxconq\fP has extensive and Xelaborate facilities for building maps, scenarios, and historical Xperiods, resulting in a wide variety of games. X.SH OPTIONS X.TP 5 X.I host:display Xadds a human player to the game and assigns to the given host and display. XPlayers get created in the same order as they appear on the command line, Xinterleaved with the players created via \fB-e\fP and \fB-A\fP. XAll of the player adding options may be used any number of times in any order. X.TP 5 X.B \-A \fIhost:display\fP Xattaches a machine player to the given display. Ideal for those who like Xto watch. X.TP 5 X.B \-e \fInumber\fP Xsets the number of machine players not attached to displays. XNon-displayed machine players are always allied with each other. X.TP 5 X.B \-m \fIname\fP Xreads the map named \fIname\fP and starts up a game on it. X.TP 5 X.B \-M \fIwidth height\fP Xgenerates a random map of the given size. The size must be at least 5x5, Xalthough some periods will impose additional constraints on the lower bound. XIn theory, there is no upper bound (but 200x200 is huge). X.TP 5 X.B \-p \fIname\fP Xreads the historical period specified by \fIname\fP, and sets everything Xup for that period. X.TP 5 X.B \-r Xresets the list of players on the command line. It is most useful when Xplaced before other player specifications, to clear out the default Xplayers. X.TP 5 X.B \-s \fIname\fP Xreads a scenario with the name \fIname\fP. A scenario sets up a particular Xsituation; it has a fixed number of sides that can participate. X.TP 5 X.B \-t \fInumber\fP Xtoggles a chess-clock-like feature that limits the total time of play for Xeach side. The amount is \fInumber\fP minutes per side. Time is only counted Xwhile actually waiting for input. X.TP 5 X.B \-v Xmake the entire world seen by all players at the outset. XThis is useful if exploration Xis deemed to be time-consuming, or if the map is already known to everybody. XSome maps already have this enabled. X.TP 5 X.B \-x Xallows scenarios, maps, periods, and players to be set up interactively Xvia menus. The menus should be self-explanatory. X.LP XIn addition, \fB-B\fP and \fB-D\fP are recognized; Xsee the customization document for more details. X.SH EXAMPLES X.TP 8 X.B Xxconq XOne human on local display, one machine, 60x30 random map X.TP 8 X.B Xxconq -m crater XOne human vs one machine, on the "crater lake" map X.TP 8 X.B Xxconq -e 0 foo:0 bar:0 XThree humans (local, foo, and bar displays), 60x30 random map X.TP 8 X.B Xxconq -e 2 -M 90 40 -A baz:0 XOne human, three machines (one on display baz:0), 90x40 random map X.TP 8 X.B Xxconq -r -e 3 -m 1987 foo:0 bar:0 -A baz:0 XSix players (4 machine, 1 on baz:0; 2 human, on foo:0 and bar:0), all playing Xon a 360x122 map of the earth with present-day cities. Major! X.SH "X DEFAULTS" X.TP 10 X.B TextFont XFont for all text. X.TP 10 X.B IconFont XFont for miscellaneous pictures. X.TP 10 X.B UnitFont XFont containing pictures of units (optional, associated with period). X.SH AUTHOR XStan Shebs (shebs@cs.utah.edu) X.SH FILES X\fIsave.xconq\fP saved game X.br X\fIstats.xconq\fP performance statistics for a game X.br X\fIcmds.xconq\fP listing of commands X.br X\fIparms.xconq\fP listing of units and their characteristics X.br X\fIview.xconq\fP printable version of the map display X.br X\fI/usr/games/lib/xconq/*.map\fP predefined maps X.br X\fI/usr/games/lib/xconq/*.scn\fP predefined scenarios X.br X\fI/usr/games/lib/xconq/*.per\fP predefined historical periods X.br X\fI/usr/games/lib/xconq/*.onx\fP X10 fonts X.br X\fI/usr/games/lib/xconq/*.bdf\fP X11 uncompiled fonts X.br X\fI/usr/games/lib/xconq/*.snf\fP X11 compiled fonts X.br X\fI/usr/games/lib/xconq/xconq.news\fP news about features/additions X.SH "SEE ALSO" X.br X.IR "Liberating the World (Made Simple)" X.br X.IR "Customizing Xconq (Made Somewhat Simple)" X.SH DIAGNOSTICS XIf a given display cannot be opened due to a missing \fIxhost(1)\fP command, X\fIxconq\fP will die, usually with a "broken pipe" error. X.PP XIf the icon fonts cannot be found or opened, text will be substituted. X.PP XIf the map is too small for the desired number of players, \fIxconq\fP will Xcomplain about not being able to place units. X.PP XThere are some panic messages which usually precede a core dump by a few Xmilliseconds. X.PP XIncorrect combinations of periods, maps, and scenarios Xcan generate a host of different error messages. X.SH BUGS XSince some periods/maps/scenarios are interdependent, they must be specified Xin a particular order on the command line (period first usually). X.PP XDoes not cope gracefully with insufficient memory. X.PP XSome annoying behaviors are actually features. END_OF_xconq.6 if test 5716 -ne `wc -c <xconq.6`; then echo shar: \"xconq.6\" unpacked with wrong size! fi # end of overwriting check fi echo shar: End of archive 15 \(of 18\). cp /dev/null ark15isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 18 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0