home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!zephyr.ens.tek.com!master!saab!billr
- From: billr@saab.CNA.TEK.COM (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v13i053: dominion - a multi-player world simulation game, Part17/28
- Message-ID: <2456@masterCNA.TEK.COM>
- Date: 11 Feb 92 18:25:34 GMT
- Sender: news@masterCNA.TEK.COM
- Lines: 1859
- Approved: billr@saab.CNA.TEK.COM
-
- Submitted-by: rosalia@dirac.physics.sunysb.edu (Mark Galassi)
- Posting-number: Volume 13, Issue 53
- Archive-name: dominion/Part17
- Environment: Unix, curses
-
-
-
- #! /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 17 (of 28)."
- # Contents: armylib.c dom_tex.ab
- # Wrapped by billr@saab on Tue Feb 11 10:14:55 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'armylib.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'armylib.c'\"
- else
- echo shar: Extracting \"'armylib.c'\" \(21209 characters\)
- sed "s/^X//" >'armylib.c' <<'END_OF_FILE'
- X /* army.c -- generic, non-visual army stuff; see also army.c */
- X
- X/*
- X * Copyright (C) 1990 Free Software Foundation, Inc.
- X * Written by the dominion project.
- X *
- X * This file is part of dominion.
- X *
- X * dominion is free software; you can redistribute it and/or
- X * modify it under the terms of the GNU General Public License as published
- X * by the Free Software Foundation; either version 1, or (at your option)
- X * any later version.
- X *
- X * This software is distributed in the hope that it will be useful,
- X * but WITHOUT ANY WARRANTY; without even the implied warranty of
- X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X * GNU General Public License for more details.
- X *
- X * You should have received a copy of the GNU General Public License
- X * along with this software; see the file COPYING. If not, write to
- X * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- X */
- X
- X#include "dominion.h"
- X#include "misc.h"
- X#include "army.h"
- X
- X#include <stdio.h>
- X
- X /* army and spirit types */
- Xextern struct army_type *army_types;
- Xextern struct spirit_type *spirit_types;
- X
- Xextern Sworld world;
- Xextern Suser user;
- Xextern int debug;
- Xextern struct army_flags army_flags[];
- X
- XSarmy *get_army();
- X
- X /* this gets a string with the army status written
- X out, and flags if the army is in a magical mode
- X */
- Xget_army_status(ap, s)
- X Sarmy *ap;
- X char s[];
- X{
- X int has_slash = 0, max_len, len ,offset, i;
- X char *pos, *pos2;
- X
- X
- X switch (ap->status) {
- X case A_ATTACK:
- X strcpy(s, "ATTACK");
- X break;
- X case A_DEFEND:
- X strcpy(s, "DEFEND");
- X break;
- X case A_OCCUPY:
- X strcpy(s, "OCCUPY");
- X break;
- X case A_PATROL:
- X strcpy(s, "PATROL");
- X break;
- X case A_INTERCEPT:
- X strcpy(s, "INTERCEPT");
- X break;
- X case A_GARRISON:
- X strcpy(s, "GARRISON");
- X break;
- X case A_AMBUSH:
- X strcpy(s, "AMBUSH");
- X break;
- X case A_TRADED:
- X strcpy(s, "TRADED");
- X break;
- X default:
- X strcpy(s, "UNKNOWN");
- X break;
- X }
- X for (i = 0; i < 32; i++)
- X {
- X has_slash = add_flag(s,ap->flags,i,has_slash);
- X }
- X max_len = 11;
- X if (ap->id < 100) max_len++;
- X if (ap->id < 10) max_len++;
- X if (ap->mvpts < 10) max_len++;
- X
- X if ((len = strlen(s)) > max_len) {
- X pos = (char *)strchr(s,'/');
- X pos2 = s + (max_len - (len - (pos - s)));
- X if (pos2 <= s) pos2 = s + 1;
- X offset = (pos - pos2);
- X while (pos2 + offset <= s + len) {
- X *pos2 = *(pos2 + offset);
- X pos2++;
- X }
- X }
- X}
- X
- Xadd_flag(s,flags,i,has_slash)
- X/*
- X This routine adds to a status line s the flag associated with
- X the i'th bit position in the flags, adding a slash if one has not
- X already been added. The flags corresponding to the bit positions
- X are in ext.c in a global array.
- X*/
- Xchar *s;
- Xint flags, i, has_slash;
- X{
- X char s2 [2];
- X
- X if (flags & (0x1 << i)) {
- X if (has_slash == 0) {
- X strcat(s,"/");
- X has_slash = 1;
- X }
- X sprintf (s2, "%c", army_flags [i].flag);
- X strcat (s, s2);
- X }
- X return has_slash;
- X}
- X
- X /* given a nation and an army id, find the army (or NULL
- X if there is no army with that id)
- X */
- XSarmy *get_army(np, id)
- X Snation *np;
- X int id;
- X{
- X Sarmy *ap = np->armies;
- X char s[100];
- X
- X if (id == -1) {
- X return NULL;
- X }
- X while ((ap != NULL) && (ap->id != id)) {
- X/* sprintf(s, "(while) ap->id=%d,id=%d", ap->id, id);
- X printf("%s", s);
- X/* statline2(s, "get_army debug"); */
- X/* getch(); */
- X
- X
- X ap = ap->next;
- X }
- X/* sprintf(s, "(out of while) ap->id=%d,id=%d", ap ? ap->id : -1, id);
- X printf("%s", s);
- X/* statline2(s, "get_army debug"); */
- X/* getch(); */
- X
- X return ap; /* should be NULL if none is found */
- X}
- X
- X /* calculate the cost to draft an army */
- Xarmy_cost(ap)
- X Sarmy *ap;
- X{
- X int index = army_type_index(ap->type);
- X
- X if (is_army(ap)) {
- X return ap->n_soldiers*army_types[index].money_draft;
- X } else {
- X return 0;
- X }
- X}
- X
- Xarmy_cost_metal(ap)
- X Sarmy *ap;
- X{
- X int index = army_type_index(ap->type);
- X if (is_army(ap)) {
- X return ap->n_soldiers*army_types[index].metal_draft;
- X } else {
- X return 0;
- X }
- X}
- X
- X /* insert the army into the nation's army list.
- X if the id parameter is -1, then this function
- X decides where to insert it.
- X */
- Xinsert_army_nation(np, ap, chosen_id)
- X Snation *np;
- X Sarmy *ap;
- X int chosen_id;
- X{
- X Sarmy *alist = np->armies, *tmp = np->armies, *prev = np->armies;
- X
- X if (alist == NULL) {
- X return -1;
- X }
- X /* if the army id given is good, and not taken, then use it */
- X if (chosen_id < 0 || get_army(np, chosen_id) != NULL) {
- X ap->id = free_army_id(np);
- X if (is_in_transport(ap)) { /* trouble!! */
- X printf("bad: this army is in transport, and I had to change its id\n");
- X }
- X } else {
- X ap->id = chosen_id;
- X }
- X#ifdef WAIT_A_WHILE
- X /* a little touch-up to the flags to account for ships
- X and other things with the inverse altitude flag
- X */
- X if (ap->flags & AF_INVERSE_ALT) {
- X if (np->race.pref_alt >= SEA_LEVEL) {
- X ap->flags &= ~AF_LAND; /* remove the land flag */
- X ap->flags |= AF_WATER; /* give it water flag */
- X } else {
- X ap->flags &= ~AF_WATER; /* remove the water flag */
- X ap->flags |= AF_LAND; /* give it the land flag */
- X }
- X }
- X#endif /* WAIT_A_WHILE */
- X if (alist->id > ap->id) { /* we must insert at the start */
- X ap->next = alist;
- X np->armies = (Sarmy *) malloc(sizeof(Sarmy));
- X *np->armies = *ap;
- X return 1;
- X }
- X while ((tmp != NULL) && (tmp->id < ap->id)) {
- X prev = tmp; /* keep the previous one */
- X tmp = tmp->next;
- X }
- X ap->next = tmp;
- X prev->next = (Sarmy *) malloc(sizeof(Sarmy));
- X *prev->next = *ap; /* copy it on */
- X return 1;
- X}
- X
- X /* remove an army from a nation list of armies (if it IS in the list!) */
- Xdelete_army_nation(np, ap)
- X Snation *np;
- X Sarmy *ap;
- X{
- X Sarmy *tmp = np->armies, *prev = np->armies, *alist = np->armies;
- X
- X if (tmp == NULL) { /* special case for emtpy list */
- X np->n_armies = 0;
- X return; /* blah, nothing to delete */
- X }
- X /* see if the army to be deleted is the head of the list */
- X if ((alist->owner == ap->owner) && (alist->id == ap->id)) {
- X /* in this special case, copy the second army to
- X the first, then free up the second.
- X */
- X tmp = alist->next; /* the next one must be saved for freeing */
- X if (alist->next != NULL) {
- X *alist = *(alist->next);
- X free(tmp);
- X } else {
- X np->armies = NULL;
- X free(alist);
- X }
- X np->n_armies--;
- X return;
- X }
- X /* get hold of the army id we are looking for */
- X while ( (tmp != NULL) &&
- X !( (tmp->owner == ap->owner) && (tmp->id == ap->id) ) ) {
- X prev = tmp; /* remember the previous element */
- X tmp = tmp->next;
- X }
- X /* now we have the same army, so we can remove it */
- X if (tmp == NULL) {
- X return; /* blah, we didn't find it */
- X }
- X prev->next = tmp->next; /* this is the crucial step: tmp is removed */
- X free(tmp); /* don't need the space */
- X np->n_armies--;
- X}
- X
- X /* remove an army from a list of armies (if it IS in the list!) */
- Xdelete_army_sector(sp, ap)
- X Ssector *sp;
- X Sarmy *ap;
- X{
- X struct armyid *tmp = sp->alist, *prev = sp->alist;
- X
- X if (!sp->alist) { /* if we have no armies here at all */
- X return;
- X }
- X /* special case it if is the first army;
- X also works if it is the ONLY army
- X */
- X if ((tmp->owner == ap->owner) && (tmp->id == ap->id)) {
- X sp->alist = sp->alist->next;
- X free(tmp);
- X return; /* done!! */
- X }
- X
- X while (tmp != NULL) {
- X if ((tmp->owner == ap->owner) && (tmp->id == ap->id)) { /* found it! */
- X prev->next = tmp->next;
- X free(tmp); /* free the space */
- X return; /* done!! */
- X }
- X prev = tmp;
- X tmp = tmp->next;
- X }
- X}
- X
- X /* take a sector and an army, and put the army in the sector's
- X army list
- X */
- Xinsert_army_sector(sp, ap)
- X Ssector *sp;
- X Sarmy *ap;
- X{
- X struct armyid *tmp;
- X
- X /* first make sure that the army is not yet in this secotr!! */
- X if (army_is_in_sector(sp, ap->owner, ap->id)) {
- X return 0;
- X }
- X if (ap->pos.x != sp->loc.x || ap->pos.y != sp->loc.y) {
- X printf("major error: ap->pos != sp->loc in insert_army_sector\r\n");
- X refresh();
- X }
- X ap->pos = sp->loc; /* make sure army's position is right */
- X if (sp->alist == NULL) { /* special case: empty list */
- X sp->alist = (struct armyid *) malloc(sizeof(struct armyid));
- X sp->alist->owner = ap->owner;
- X sp->alist->id = ap->id;
- X sp->alist->next = NULL;
- X return 1;
- X }
- X /* insert at the beginning */
- X tmp = (struct armyid *) malloc(sizeof(struct armyid));
- X tmp->owner = ap->owner;
- X tmp->id = ap->id;
- X tmp->next = sp->alist;
- X sp->alist = tmp; /* this is the new beginning */
- X return 1;
- X}
- X
- X /* generate an army, in given sector, of
- X given type, with given status. return the army.
- X do not add it to the nation's linked list at this point.
- X */
- XSarmy make_army(type, name, n_soldiers, status, owner, loc)
- X char type[], name[];
- X int n_soldiers, status, owner;
- X Pt loc;
- X{
- X Sarmy new_army;
- X Snation *np = &world.nations[owner];
- X int aindex, sindex; /* index in army/spirit type list */
- X struct army_type this_atype;
- X struct spirit_type this_stype;
- X Sspirit *spiritp = user.spirit_list; /* in case it is a spirit */
- X
- X aindex = army_type_index(type);
- X sindex = spirit_type_index(type);
- X if (aindex >= 0) { /* it is an army!! */
- X this_atype = army_types[aindex];
- X } else if (sindex >= 0) { /* it is a spirit */
- X this_stype = spirit_types[sindex];
- X while (spiritp && (strcmp(type, spiritp->type) != 0)) {
- X spiritp = spiritp->next;
- X }
- X if (spiritp == NULL) {
- X fprintf(stderr,"Error: spirit type %s not available\n",type);
- X }
- X }
- X
- X strcpy(new_army.type, type);
- X strcpy(new_army.name, name);
- X new_army.n_soldiers = n_soldiers;
- X new_army.status = status;
- X new_army.owner = owner;
- X new_army.mvratio = 100; /* 100% to start with */
- X new_army.pos = loc;
- X new_army.id = 0; /* this is set when army is inserted into list */
- X new_army.flags = 0x00L;
- X /* when drafted, new armies have only 1/4 of full move points */
- X new_army.mvpts = army_move_rate(np, &new_army)/4;
- X if (is_army(&new_army)) { /* case army */
- X new_army.sp_bonus = this_atype.bonus;
- X new_army.money_maint = this_atype.money_maint;
- X new_army.metal_maint = this_atype.metal_maint;
- X new_army.jewel_maint = this_atype.jewel_maint;
- X new_army.spell_pts_maint = this_atype.spell_pts_maint;
- X new_army.flags = this_atype.flags;
- X } else if (is_mage(&new_army)) { /* case mage */
- X new_army.sp_bonus = 0;
- X new_army.money_maint = 0;
- X new_army.metal_maint = 0;
- X new_army.jewel_maint = MAGE_JEWELS_MAINT;
- X new_army.spell_pts_maint = 0;
- X } else { /* if not, it is a spirit */
- X new_army.sp_bonus = this_stype.bonus;
- X new_army.money_maint = 0;
- X new_army.metal_maint = 0;
- X new_army.jewel_maint = 0;
- X/* new_army.spell_pts_maint = this_stype.spell_pts_draft/4; */
- X new_army.spell_pts_maint = (spiritp->cost * 1000000)/(4* this_stype.size );
- X new_army.flags |= this_stype.flags;
- X }
- X /* special handling of the INVERSE_ALT flag: if they
- X are a land race, it becomes a WATER flag; if they
- X are a water race, it becomes a LAND flag.
- X */
- X if (new_army.flags & AF_INVERSE_ALT) {
- X if (np->race.pref_alt >= SEA_LEVEL) {
- X new_army.flags |= AF_WATER;
- X } else {
- X new_army.flags |= AF_LAND;
- X }
- X }
- X new_army.next = NULL;
- X memset(&new_army.cargo, '\0', sizeof(Scargo));
- X new_army.cargo.army = -1;
- X new_army.cargo.title.x = -1;
- X new_army.cargo.title.y = -1;
- X
- X return new_army;
- X}
- X
- X /* this function tells you the basic army move rate for a nation */
- Xbasic_move_rate(np)
- X Snation *np;
- X{
- X return 4 + np->race.speed/8; /* should not be less than 4 */
- X}
- X
- X /* return 1 if given army can go into occupy mode, 0 otherwise */
- Xcan_occupy(ap)
- X Sarmy *ap;
- X{
- X if (ap->n_soldiers >= OCCUPYING_SOLDIERS && !is_in_transport(ap)) {
- X return 1;
- X } else {
- X return 0;
- X }
- X}
- X
- Xcan_patrol(ap)
- X Sarmy *ap;
- X{
- X if (ap->n_soldiers >= OCCUPYING_SOLDIERS/2) {
- X return 1;
- X } else {
- X return 0;
- X }
- X}
- X
- Xcan_intercept(ap)
- X Sarmy *ap;
- X{
- X if (ap->n_soldiers >= OCCUPYING_SOLDIERS/2) {
- X return 1;
- X } else {
- X return 0;
- X }
- X}
- X
- Xcan_garrison(ap)
- X Sarmy *ap;
- X{
- X return 1;
- X}
- X
- X /* loads army types from the army types file */
- Xload_army_types()
- X{
- X FILE *fp, *fopen();
- X char line[210];
- X int i;
- X
- X if ((fp = fopen(ARMY_TYPES_FILE, "r")) == NULL) {
- X printf("cannot open army types file. quitting.\n");
- X clean_exit();
- X exit(1);
- X }
- X
- X do {
- X fgets(line, 200, fp);
- X } while (line[0] == '#');
- X /* we should have the line with the number of army types in file */
- X sscanf(line, "%d", &user.n_army_types);
- X
- X army_types =
- X (struct army_type *)malloc(user.n_army_types*sizeof(struct army_type));
- X
- X for (i = 0; i < user.n_army_types; ) {
- X fgets(line, 100, fp);
- X line[strlen(line)-1] = '\0';
- X if (line[0] != '#') { /* ignore comments */
- X sscanf(line,
- X "%s : %1s : %f : %d : %d : %d : %d : %d : %d : %d : %d : %s",
- X army_types[i].type, &army_types[i].type_char,
- X &army_types[i].move_factor,
- X &army_types[i].bonus, &army_types[i].money_draft,
- X &army_types[i].metal_draft, &army_types[i].jewel_draft,
- X &army_types[i].money_maint,
- X &army_types[i].metal_maint, &army_types[i].jewel_maint,
- X &army_types[i].flags,
- X army_types[i].draft_places);
- X army_types [i].spell_pts_maint = 0; /* Kludge, but ALWAYS so... */
- X ++i;
- X }
- X }
- X
- X fclose(fp);
- X}
- X
- X /* returns true if this nation can draft that type of army */
- Xis_avail_army_type(up, type)
- X Suser *up;
- X char type[];
- X{
- X int i;
- X Savail_army *aa;
- X
- X /* run through the list of available armies */
- X for (aa = up->avail_armies; aa != NULL; aa = aa->next) {
- X if (strncmp(aa->type, type, NAMELEN) == 0) {
- X return 1; /* got it!!! */
- X }
- X }
- X return 0; /* we did not find that army type */
- X}
- X
- X /* returns the index in army_types, corresponding to
- X an army type, or -1 on error (if it is not an army
- X but, say, a caravan or spirit or mage).
- X */
- Xarmy_type_index(type)
- X char type[];
- X{
- X int i;
- X for (i = 0; i < user.n_army_types; ++i) {
- X if (strncmp(army_types[i].type, type, NAMELEN) == 0) {
- X return i; /* got it!! */
- X }
- X }
- X return -1; /* didn't find it */
- X}
- X
- X /* returns the index in spirit_types, corresponding to
- X an army type, or -1 on error (if it is not an army
- X but, say, a caravan or army or mage).
- X */
- Xspirit_type_index(type)
- X char type[];
- X{
- X int i;
- X for (i = 0; i < user.n_spirit_types; ++i) {
- X if (strncmp(spirit_types[i].type, type, NAMELEN) == 0) {
- X return i; /* got it!! */
- X }
- X }
- X return -1; /* did not get it */
- X}
- X
- X /* returns 1 if it is an army (not a navy), 0 otherwise */
- Xis_army(ap)
- X Sarmy *ap;
- X{
- X if (army_type_index(ap->type) >= 0) {
- X return 1;
- X }
- X return 0;
- X}
- X
- X /* returns 1 if it is a ship, 0 otherwise */
- Xis_navy(ap)
- X Sarmy *ap;
- X{
- X /* any army type beginning with "Ships" or "S_" is a navy */
- X if (ap && strncmp(ap->type, "S_", strlen("S_")) == 0) {
- X return 1;
- X }
- X if (ap && strncmp(ap->type, "Ships", strlen("Ships")) == 0) {
- X return 1;
- X }
- X return 0;
- X}
- X
- X /* returns 1 if it is an mage, 0 otherwise */
- Xis_mage(ap)
- X Sarmy *ap;
- X{
- X if (ap && (strcmp(ap->type, "Mage") == 0 || is_wizard(ap))) {
- X return 1;
- X }
- X return 0;
- X}
- X
- X /* returns 1 if it is an spirit, 0 otherwise */
- Xis_spirit(ap)
- X Sarmy *ap;
- X{
- X if (spirit_type_index(ap->type) >= 0) {
- X return 1;
- X }
- X return 0;
- X}
- X
- X /* returns the army move rate for a specific army */
- Xarmy_move_rate(np, ap)
- X Snation *np;
- X Sarmy *ap;
- X{
- X int mvpts, i;
- X
- X if (is_army(ap)) {
- X i = army_type_index(ap->type);
- X mvpts = basic_move_rate(np)*army_types[i].move_factor;
- X } else if (is_mage(ap)) {
- X mvpts = basic_move_rate(np)*MAGE_MOVE_FACTOR;
- X } else { /* must be a spirit */
- X if ((i = spirit_type_index(ap->type)) < 0) {
- X printf(
- X "army_move_rate: bad error, can't find army type <%s> for army %d.\n",
- X ap->type, ap->id);
- X printf("setting move rate to basic.\n");
- X mvpts = basic_move_rate(np);
- X } else {
- X mvpts = basic_move_rate(np)*spirit_types[i].move_factor;
- X }
- X }
- X return mvpts;
- X}
- X
- X /* check if a army "id" belonging to owner "owner" is in "sp: */
- Xarmy_is_in_sector(sp, owner, id)
- X Ssector *sp;
- X int owner, id; /* owner and id of army we are testing */
- X{
- X struct armyid *alist = sp->alist;
- X
- X while (alist != NULL) {
- X if (alist->id == id && alist->owner == owner) {
- X return 1;
- X }
- X alist = alist->next;
- X }
- X return 0;
- X}
- X
- X /* reads in the NEW_ARMY_TYPE lines from the techno_levels
- X file, and adds them to the user's list of available army
- X types if the user has enough techno skill to deserve them.
- X Some of the available army types also come from the "races"
- X file, since they are race-specific.
- X */
- Xget_avail_armies(up, skill)
- X Suser *up;
- X int skill;
- X{
- X FILE *fp, *fopen();
- X int level;
- X char type[NAMELEN], name[NAMELEN], line[EXECLEN];
- X char magfn [EXECLEN];
- X int done = 0;
- X
- X if ((fp = fopen(TECHNO_FILE, "r")) == NULL) {
- X printf("could not open technology file %s\n", TECHNO_FILE);
- X return -1;
- X }
- X
- X while (!done) {
- X if (fgets(line, EXECLEN, fp) == NULL) {
- X done = 1;
- X break;
- X }
- X if (line[0] != '#') {
- X sscanf(line, "%s%d", name, &level); /* a new tech entry */
- X if (level <= skill) {
- X do {
- X fgets(line, EXECLEN, fp);
- X if (strncmp(line+2,"NEW_ARMY_TYPE:",strlen("NEW_ARMY_TYPE:")) == 0) {
- X add_army_type(up, line+2+strlen("NEW_ARMY_TYPE:"));
- X }
- X } while (strncmp(line, "end", strlen("end")) != 0);
- X } else { /* else, we are beyond our skill */
- X done = 1;
- X break;
- X }
- X }
- X }
- X fclose(fp);
- X
- X /* Get the magic orders special armies in there too */
- X
- X sprintf (magfn, "magic/mag_%s", up->np->mag_order);
- X if ((fp = fopen (magfn, "r")) == NULL) {
- X printf ("could not open magic file %s\n", magfn);
- X return -1;
- X }
- X
- X done = 0;
- X while (!done) {
- X if (fgets (line, EXECLEN, fp) == NULL) {
- X done = 1;
- X break;
- X }
- X if (strncmp(line,"EXEC:NEW_ARMY_TYPE:",strlen("NEW_ARMY_TYPE:")) == 0) {
- X add_army_type(up, line+strlen("EXEC:NEW_ARMY_TYPE:"));
- X }
- X }
- X
- X /* get race-specific army types. for now there is
- X only one army type for each race.
- X */
- X if ((fp = fopen(RACES_FILE, "r")) == NULL) {
- X printf("could not open races file %s\n", RACES_FILE);
- X return -1;
- X }
- X done = 0;
- X while (!done) {
- X if (fgets(line, EXECLEN, fp) == NULL) {
- X done = 1;
- X break;
- X }
- X if (strncmp(line, up->np->race.name, strlen(up->np->race.name)) == 0
- X && strncmp(line+strlen(up->np->race.name), "_armies:",
- X strlen("_armies:")) == 0) {
- X /* got one!! in the next line we assume there
- X is just one army type for each race.
- X */
- X add_army_type(up, strchr(line, ':')+1);
- X }
- X }
- X fclose(fp);
- X}
- X
- X /* add an army type to the user's list */
- Xadd_army_type(up, type)
- X Suser *up;
- X char type[];
- X{
- X Savail_army *aa = up->avail_armies, *prev_aa = up->avail_armies;
- X int falready = 0;
- X if (type[strlen(type)-1] == '\n') {
- X type[strlen(type)-1] = '\0';
- X }
- X if (debug) {
- X printf("adding army type: <%s>; type return\n", type);
- X fflush(stdout);
- X getchar();
- X }
- X if (aa == NULL) { /* if list is empty... */
- X up->avail_armies = (Savail_army *)malloc(sizeof(Savail_army));
- X aa = up->avail_armies;
- X strcpy(aa->type, type);
- X aa->next = NULL;
- X return;
- X }
- X while (aa != NULL) { /* else, find end of list */
- X if (!strcmp (aa->type, type)) { /* If army type already in there... */
- X falready = 1;
- X break;
- X }
- X prev_aa = aa;
- X aa = aa->next;
- X }
- X if (!falready) {
- X prev_aa->next = (Savail_army *)malloc(sizeof(Savail_army));
- X strcpy(prev_aa->next->type, type);
- X prev_aa->next->next = NULL;
- X }
- X}
- X
- Xsect_n_armies(sp)
- X Ssector *sp;
- X{
- X int n = 0;
- X struct armyid *alist = sp->alist;
- X
- X while (alist != NULL) {
- X ++n;
- X alist = alist->next;
- X }
- X return n;
- X}
- X
- X /* returns a pointer to the first mage found in a nation */
- XSarmy *get_first_mage(np)
- X Snation *np;
- X{
- X Sarmy *tmp_ap = np->armies;
- X
- X while (tmp_ap) {
- X if (is_mage(tmp_ap)) {
- X return tmp_ap;
- X }
- X tmp_ap = tmp_ap->next;
- X }
- X return tmp_ap;
- X}
- X
- X /* returns the id of the first mage belonging
- X to a given nation, found in a given sector.
- X returns -1 if there is no mage there.
- X */
- Xfirst_sect_mage_id(np, sp)
- X Snation *np;
- X Ssector *sp;
- X{
- X struct armyid *alist = sp->alist;
- X Sarmy *ap;
- X
- X while (alist) {
- X ap = get_army(np, alist->id);
- X if (is_mage(ap)) {
- X return alist->id;
- X }
- X alist = alist->next;
- X }
- X return -1;
- X}
- X
- X /* returns the apparent army type for a disguised army */
- Xget_apparent_type(ap, type)
- X Sarmy *ap;
- X char type[];
- X{
- X char *pos;
- X
- X if (is_disguised(ap)) {
- X pos = (char *)strrchr(ap->name, '/');
- X if (pos == NULL) {
- X strcpy(type, ap->type);
- X } else {
- X strcpy(type, pos+1); /* disguised type is stored in ap->name */
- X }
- X } else {
- X strcpy(type, ap->type); /* no disguise: army is itself */
- X }
- X}
- X
- Xget_spell_pts_maint(ap)
- X Sarmy *ap;
- X{
- X
- X return (int)(((double)(ap->spell_pts_maint* ap->n_soldiers)/1000000.0)+0.49);
- X}
- END_OF_FILE
- if test 21209 -ne `wc -c <'armylib.c'`; then
- echo shar: \"'armylib.c'\" unpacked with wrong size!
- fi
- # end of 'armylib.c'
- fi
- if test -f 'dom_tex.ab' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'dom_tex.ab'\"
- else
- echo shar: Extracting \"'dom_tex.ab'\" \(36711 characters\)
- sed "s/^X//" >'dom_tex.ab' <<'END_OF_FILE'
- X\section{Armies}
- XThe \emph{army types} table lists the various types of armies, their
- Xcosts, bonuses and move rates.
- X
- XEach army or spirit has a set of \strong{army flags} that affect its
- Xbehaviour. Some are innate abilities of that army, others can be set
- Xwith magic spells. The table lists each army's innate flags. The
- Xflag abbreviations are:
- X\begin{itemize}
- X\item
- XF: Flying. Any army with this flag can fly. Move costs of sectors
- Xdon't depend on altitude, and thus are much lower. These armies also
- Xignore PATROLs and INTERCEPTs unless the patrolling army has missiles.
- X\item
- XH: Hidden. Army with this flag is magically cloaked.
- X\item
- XV: Vampire. Army with this flag will possess some of the dead
- Xon the battlefield who will join ranks with this army.
- X\item
- XT: Transport. This army is being transported as cargo.
- X\item
- X\^: Missiles. This army has weapons that are thrown, such as arrows.
- XArchers are a type of army with mssles. These units, when in PATROL
- Xor INTERCEPT status, will slow down flying units too (normally flying
- Xunits are not slowed down by PATROLs or INTERCEPTs, though they
- X\emph{do} get intercepted once they land).
- X\item
- XW: Water. An army with this flag must stay in water, or in the land
- Xsectors along a coast; even if it belongs to a land nation. Compare
- Xwith the L flag below.
- X\item
- Xf: Front-line army. Can be loaded/unloaded on/from a ship or caravan on
- Xland that does not belong to you.
- X\item
- Xk: Kamikaze. Armies with this flag will fight with very high bonus,
- Xbut will all die in any battle.
- X\item
- Xm: Machine. These armies are really machines, such as siege engines,
- Xwar carts and catapults. They help ordinary armies in combat by
- Xdestroying fortifications and adding bonus to the armies.
- X\item
- Xd: Disguised. You can disguise this army so that it will appear to be
- Xof another type to other players. For example, to disguise a
- Xpoltergeist as an areal serpent you would change the armies
- X\emph{name} so that it ends with ``/areal_serpent''.
- X\item
- Xw: Wizard. This flag means that the army can summon spirits
- Xand cast spells, like a mage.
- X\item
- Xs: Sorcerer. This flag means that the army can excercise powers
- Xof sorcery (not implemented yet).
- X\item
- Xc: Cargo. This army can transport cargo, like ships and caravans.
- X\item
- XU: Underground. This army can burrow underground, and thus is not
- Xslowed down by patrols and intercepts.
- X\item
- XL: Land. This is the exact inverse of the W flag. An army with
- Xthis flag must stay on land, or in water sectors along the coast; even
- Xif it belongs to a water nation. Notice that if you have both the
- XL and W flags, you can move that army onto \emph{any} sector on the
- Xmap.
- X\item
- XI: Inverse altitude. This flag says that the army will have either
- Xthe L or the W flag, depending on the race of the army's owner. If
- Xthe army belongs to a \emph{land} race, then it will have a W flag,
- Xand vice-versa. This flag is used mostly for things like ships,
- Xwhich travel in the ``inverse'' altitude medium.
- X\item
- X*: Race specific. These armies are available only to certain
- Xraces.
- X\end{itemize}
- X
- X\section{Army types}
- X
- XThe \emph{Army types} table below describes in detail all army types
- Xavailable for drafting.
- X
- X\begin{same}
- X\begin{table}[hbpt]
- X\caption{Army types table}
- X\begin{tabular}{ || l | l | r | r | r | r | r | r | r | r | l || }
- X\hline
- XType &char&move&bonus&draft&draft&draft&maint&maint&maint&flags \\
- X & &rate& &money&metal&jewel&money&metal&jewel& \\
- X\hline
- XCavemen &*& 0.5& -60 & 60 & 0 & 0 & 10 & 0 & 0 &\\
- XSpearmen &/& 0.8& -10 & 80 & 20 & 0 & 10 & 0 & 0 &\\
- XInfantry &i& 1.0& 0 & 100 & 30 & 0 & 10 & 0 & 0 &\\
- XCaravan &C& 1.0& 0 &1000 &1000 & 0 & 200 & 40 & 0 &c\\
- XArchers &)& 1.0& 5 & 100 & 40 & 0 & 10 & 0 & 0 &^\\
- XSwimmers &o& 1.0& -60 & 150 & 50 & 0 & 15 & 5 & 0 &Wf\\
- XWalkers & 1.0& -60 & 150 & 50 & 0 & 15 & 5 & 0 &L\\
- XPhalanx &p& 1.0& 20 & 150 & 50 & 0 & 12 & 0 & 0 &\\
- XSailors &~& 0.0& -10 & 150 & 50 & 0 & 15 & 0 & 0 &f\\
- XChariots &0& 1.5& 10 & 180 & 60 & 0 & 14 & 5 & 0 &\\
- XCanoes &u& 2.0& -80 &1000 &2000 & 0 & 200 & 100 & 0 &cI\\
- XLegion &l& 1.0& 40 & 200 & 70 & 0 & 16 & 0 & 0 &\\
- XCavalry &c& 2.0& 20 & 200 & 80 & 0 & 20 & 0 & 0 &\\
- XElite &e& 1.3& 10 & 0 & 100 & 0 & 0 & 25 & 0 &\\
- XSailboats &\}& 2.5& -50 &1500 &3000 & 0 & 300 & 150 & 0 &cI\\
- XMarines &m& 1.0& 60 & 300 & 200 & 0 & 25 & 0 & 0 &f\\
- XWar_carts &w& 1.0& 10 & 500 & 200 & 0 & 200 & 20 & 0 &m\\
- XGalleys &g& 3.5& -20 &2000 &4000 & 0 & 400 & 200 & 0 &cI\\
- XBerzerkers &b& 1.0& 50 & 30 & 0 & 0 & 5 & 0 & 0 &k\\
- XMerc &M& 1.2& 60 & 200 & 0 & 0 & 200 & 0 & 0 &\\
- XCatapults &@& 0.5& 20 & 800 & 400 & 0 & 300 & 30 & 0 &m\\
- XQuadriremes &q& 4.5& 0 &3000 &5000 & 0 & 500 & 250 & 0 &cI\\
- XScuba_divers &S& 1.2& -30 & 300 & 200 & 0 & 25 & 25 & 0 &fI\\
- XKamikaze &k& 1.5& 200 & 50 & 25 & 0 & 50 & 0 & 0 &k\\
- XWagons &W& 1.5& 0 &1500 &1500 & 0 & 300 & 60 & 0 &c\\
- XCrossbowmen &]& 1.0& 5 & 50 & 60 & 0 & 5 & 5 & 0 &^\\
- XNinja &N& 3.0& 75 &2000 & 0 &2000 & 500 & 0 & 500 &H\\
- XMage &!& 2.0& 0 & 0 & 0 &5000 & 0 & 0 &1000 &w\\
- XHunters &h& 1.5& -10 & 50 & 0 & 0 & 10 & 0 & 0 &\\
- XOrcs &O& 1.0& 0 & 60 & 30 & 0 & 10 & 0 & 0 &\\
- XHarpies &y& 1.0& 10 & 100 & 30 & 0 & 10 & 0 & 0 &F\\
- XHobbits &H& 1.0& 0 & 100 & 30 & 0 & 10 & 0 & 0 &H\\
- XOgres &G& 1.0& 50 & 100 & 30 & 0 & 10 & 0 & 0 &\\
- X\hline
- X\end{tabular}
- X\end{table}
- X\end{same}
- X
- X\section{Spirit types}
- XThe \emph{Spirit types} tables below list the spirit types available in
- Xdominion. Summoning costs (in spell points) are not listed, because
- Xthey can be different if a spirit is available to more than one magic
- Xorder. The flags for each spirit are described in the section on
- X\emph{Armies} above.
- X
- X% Made with Titus Brown's mktables
- X
- X\begin{same}
- X\begin{table}[hbpt]
- X\caption{Spirit types table (Diana)}
- X\begin{center}
- X\begin{tabular}{ || l | l | l | l | l | l || }
- X\hline
- XName & Size & Move & Bonus &Spell&Flags\\
- X & & rate & &Pts &\\
- X\hline
- Xwolf & 30 & 1.5 & 0 & 1 &\\
- Xswarm & 50 & 1.3 & 300 & 3 &Fk\\
- Xmole & 70 & 1.0 & 0 & 3 &UL\\
- Xsnake & 100 & 0.8 & 0 & 3 &\\
- Xshark & 100 & 1.5 & 10 & 3 &W\\
- Xhawk & 200 & 2.0 & 0 & 5 &F\\
- Xbear & 300 & 1.4 & 0 & 5 &\\
- Xlion & 500 & 1.5 & 0 & 6 &L\\
- Xterrasque & 2000 & 0.5 & 0 & 13 &L\\
- X\hline
- X\end{tabular}
- X\end{center}
- X\end{table}
- X\end{same}
- X\begin{same}
- X\begin{table}[hbpt]
- X\caption{Spirit types table (Necromancy)}
- X\begin{center}
- X\begin{tabular}{ || l | l | l | l | l | l || }
- X\hline
- XName & Size & Move & Bonus &Spell&Flags\\
- X & & rate & &Pts &\\
- X\hline
- Xghost_ship & 1 & 2.5 & 0 & 1 &HcI\\
- Xskeleton & 40 & 0.8 & 0 & 1 &\\
- Xwraith & 30 & 1.5 & 0 & 2 &H\\
- Xzombie & 70 & 0.8 & 0 & 3 &V\\
- Xpoltergeist & 150 & 0.1 & 0 & 3 &d\\
- Xmummy & 80 & 0.8 & 30 & 3 &U\\
- Xghost_ship & 1 & 2.5 & 0 & 5 &HcI\\
- Xlacedon & 500 & 1.0 & 0 & 7 &W\\
- Xlich & 2000 & 2.0 & -20 & 14 &w\\
- Xvampire & 1500 & 0.8 & 30 & 15 &V\\
- X\hline
- X\end{tabular}
- X\end{center}
- X\end{table}
- X\end{same}
- X\begin{same}
- X\begin{table}[hbpt]
- X\caption{Spirit types table (Yavanna)}
- X\begin{center}
- X\begin{tabular}{ || l | l | l | l | l | l || }
- X\hline
- XName & Size & Move & Bonus &Spell&Flags\\
- X & & rate & &Pts &\\
- X\hline
- Xdryad & 30 & 1.0 & 0 & 1 &\\
- Xtree_spirit & 50 & 1.5 & 0 & 2 &F\\
- Xwood_beast & 70 & 1.0 & 0 & 2 &\\
- Xmagic_trees & 150 & 1.0 & 0 & 3 &\\
- Xyellow_musk & 200 & 0.7 & 0 & 4 &V\\
- Xent & 250 & 0.8 & 0 & 4 &\\
- Xswamp_beast & 500 & 1.0 & 10 & 6 &W\\
- Xshambling_mound & 1200 & 0.8 & 10 & 10 &\\
- Xforest & 2000 & 0.7 & 0 & 14 &\\
- X\hline
- X\end{tabular}
- X\end{center}
- X\end{table}
- X\end{same}
- X\begin{same}
- X\begin{table}[hbpt]
- X\caption{Spirit types table (Demonology)}
- X\begin{center}
- X\begin{tabular}{ || l | l | l | l | l | l || }
- X\hline
- XName & Size & Move & Bonus &Spell&Flags\\
- X & & rate & &Pts &\\
- X\hline
- Ximp & 30 & 2.0 & 0 & 2 &\\
- Xlesser_demon & 70 & 1.7 & 0 & 3 &\\
- Xhellhound & 150 & 1.7 & 0 & 4 &\\
- Xtormented_soul & 300 & 1.2 & 100 & 5 &k\\
- Xdevil & 250 & 1.0 & 0 & 4 &\\
- Xmajor_demon & 500 & 2.0 & 0 & 8 &F\\
- Xbalrog & 1500 & 1.5 & 50 & 15 &\\
- Xdemon_lord & 2500 & 2.0 & 0 & 19 &w\\
- X\hline
- X\end{tabular}
- X\end{center}
- X\end{table}
- X\end{same}
- X\begin{same}
- X\begin{table}[hbpt]
- X\caption{Spirit types table (Monsters)}
- X\begin{center}
- X\begin{tabular}{ || l | l | l | l | l | l || }
- X\hline
- XName & Size & Move & Bonus &Spell&Flags\\
- X & & rate & &Pts &\\
- X\hline
- Xspider & 30 & 0.8 & 0 & 1 &\\
- Xyeti & 70 & 1.0 & 0 & 2 &L\\
- Xettin & 120 & 1.5 & 0 & 3 &\\
- Xcyclops & 150 & 0.8 & 0 & 3 &\\
- Xhydra & 250 & 1.2 & 0 & 4 &\\
- Xcrimson_death & 500 & 2.0 & 0 & 8 &F\\
- Xsea_dragon & 1000 & 1.2 & 0 & 9 &W\\
- Xgreen_dragon & 1500 & 2.0 & 0 & 11 &L\\
- Xred_dragon & 2500 & 1.5 & 0 & 17 &F\\
- Xgold_dragon & 3500 & 2.0 & 0 & 24 &Fw\\
- X\hline
- X\end{tabular}
- X\end{center}
- X\end{table}
- X\end{same}
- X\begin{same}
- X\begin{table}[hbpt]
- X\caption{Spirit types table (Neptune)}
- X\begin{center}
- X\begin{tabular}{ || l | l | l | l | l | l || }
- X\hline
- XName & Size & Move & Bonus &Spell&Flags\\
- X & & rate & &Pts &\\
- X\hline
- Xliving_ship & 4 & 2.5 & 0 & 1 &cI\\
- Xpirana & 30 & 1.2 & 0 & 1 &W\\
- Xwater_nymph & 50 & 1.2 & 0 & 2 &W\\
- Xwhale & 80 & 1.0 & 0 & 2 &W\\
- Xshark & 100 & 1.5 & 10 & 3 &W\\
- Xsea_serpent & 150 & 1.2 & 0 & 4 &WL\\
- Xcraken & 250 & 1.0 & 0 & 4 &W\\
- Xsea_giant & 500 & 0.8 & 0 & 5 &W\\
- Xwater_elemental & 2000 & 2.0 & 0 & 15 &W\\
- Xleviathan & 3000 & 0.9 & 10 & 18 &W\\
- X\hline
- X\end{tabular}
- X\end{center}
- X\end{table}
- X\end{same}
- X\begin{same}
- X\begin{table}[hbpt]
- X\caption{Spirit types table (Aule)}
- X\begin{center}
- X\begin{tabular}{ || l | l | l | l | l | l || }
- X\hline
- XName & Size & Move & Bonus &Spell&Flags\\
- X & & rate & &Pts &\\
- X\hline
- Xgargoyle & 30 & 1.0 & 0 & 2 &F\\
- Xmole & 70 & 1.0 & 0 & 3 &UL\\
- Xdust_devil & 150 & 1.0 & 0 & 4 &FL\\
- Xumber_hulk & 250 & 1.7 & 0 & 5 &UL\\
- Xstone_giant & 500 & 0.7 & 0 & 6 &\\
- Xearth_elemental & 2000 & 2.0 & 0 & 16 &U\\
- Xmountain & 3000 & 0.3 & 60 & 23 &\\
- X\hline
- X\end{tabular}
- X\end{center}
- X\end{table}
- X\end{same}
- X\begin{same}
- X\begin{table}[hbpt]
- X\caption{Spirit types table (Chess)}
- X\begin{center}
- X\begin{tabular}{ || l | l | l | l | l | l || }
- X\hline
- XName & Size & Move & Bonus &Spell&Flags\\
- X & & rate & &Pts &\\
- X\hline
- Xpawn & 30 & 0.5 & 0 & 1 &\\
- Xknight & 120 & 1.0 & 10 & 4 &H\\
- Xbishop & 150 & 2.0 & 0 & 5 &F\\
- Xrook & 250 & 3.0 & 30 & 6 &\\
- Xqueen & 500 & 4.0 & 50 & 9 &\\
- Xking & 1000 & 0.4 & 0 & 8 &\\
- Xmaster & 2000 & 1.0 & 10 & 11 &\\
- Xgrandmaster & 3000 & 1.3 & 20 & 14 &w\\
- X\hline
- X\end{tabular}
- X\end{center}
- X\end{table}
- X\end{same}
- X\begin{same}
- X\begin{table}[hbpt]
- X\caption{Spirit types table (Inferno)}
- X\begin{center}
- X\begin{tabular}{ || l | l | l | l | l | l || }
- X\hline
- XName & Size & Move & Bonus &Spell&Flags\\
- X & & rate & &Pts &\\
- X\hline
- Xefreet & 70 & 1.5 & 0 & 2 &L\\
- Xphoenix & 30 & 2.0 & 0 & 3 &FL\\
- Xfire_giant & 250 & 1.0 & 0 & 4 &L\\
- Xfire_drake & 500 & 1.5 & 0 & 6 &\\
- Xlava_beast & 1000 & 1.0 & 0 & 10 &U\\
- Xfire_elemental & 2000 & 2.0 & 0 & 15 &L\\
- Xconflagration & 3000 & 1.5 & 0 & 18 &L\\
- X\hline
- X\end{tabular}
- X\end{center}
- X\end{table}
- X\end{same}
- X\begin{same}
- X\begin{table}[hbpt]
- X\caption{Spirit types table (Avian)}
- X\begin{center}
- X\begin{tabular}{ || l | l | l | l | l | l || }
- X\hline
- XName & Size & Move & Bonus &Spell&Flags\\
- X & & rate & &Pts &\\
- X\hline
- Xflying_carpet & 1 & 1.5 & 0 & 1 &Fc\\
- Xroc & 30 & 1.5 & 0 & 1 &F\\
- Xeagle & 70 & 1.5 & 0 & 2 &F\\
- Xcloud_giant & 150 & 1.0 & 0 & 3 &F\\
- Xwyvern & 250 & 1.0 & 0 & 4 &F\\
- Xareal_serpent & 500 & 1.8 & 0 & 7 &F\\
- Xair_elemental & 2000 & 2.0 & 0 & 15 &F\\
- Xtempest & 3000 & 2.0 & 0 & 18 &F\\
- X\hline
- X\end{tabular}
- X\end{center}
- X\end{table}
- X\end{same}
- X\begin{same}
- X\begin{table}[hbpt]
- X\caption{Spirit types table (Unity)}
- X\begin{center}
- X\begin{tabular}{ || l | l | l | l | l | l || }
- X\hline
- XName & Size & Move & Bonus &Spell&Flags\\
- X & & rate & &Pts &\\
- X\hline
- Xnaga & 30 & 1.0 & 0 & 1 &\\
- Xcentaur & 70 & 2.0 & 0 & 3 &\\
- Xwerewolf & 100 & 1.5 & 0 & 4 &Vd\\
- Xminotaur & 150 & 1.0 & 0 & 3 &L\\
- Xowl_bear & 250 & 1.0 & 0 & 4 &\\
- Xgryphon & 350 & 2.0 & 0 & 7 &F\\
- Xsea_lion & 600 & 1.5 & 0 & 7 &W\\
- Xchimera & 1000 & 1.5 & 0 & 10 &F\\
- Xsphynx & 2000 & 0.8 & 0 & 17 &Fw\\
- X\hline
- X\end{tabular}
- X\end{center}
- X\end{table}
- X\end{same}
- X\begin{same}
- X\begin{table}[hbpt]
- X\caption{Spirit types table (Time)}
- X\begin{center}
- X\begin{tabular}{ || l | l | l | l | l | l || }
- X\hline
- XName & Size & Move & Bonus &Spell&Flags\\
- X & & rate & &Pts &\\
- X\hline
- Xdiplodocus & 30 & 1.3 & 0 & 1 &\\
- Xbrontosaurus & 70 & 0.7 & 0 & 2 &\\
- Xpleisiosaurus & 50 & 1.5 & 0 & 2 &W\\
- Xpterodactyl & 150 & 1.5 & 0 & 4 &F\\
- Xstegosaurus & 250 & 1.0 & 0 & 4 &\\
- Xtriceratops & 500 & 0.8 & 0 & 6 &L\\
- Xtyrannosaurus & 1500 & 1.5 & 0 & 12 &\\
- Xbrachiosaurus & 3000 & 0.5 & 0 & 18 &WL\\
- X\hline
- X\end{tabular}
- X\end{center}
- X\end{table}
- X\end{same}
- X\begin{same}
- X\begin{table}[hbpt]
- X\caption{Spirit types table (Insects)}
- X\begin{center}
- X\begin{tabular}{ || l | l | l | l | l | l || }
- X\hline
- XName & Size & Move & Bonus &Spell&Flags\\
- X & & rate & &Pts &\\
- X\hline
- Xant & 30 & 1.0 & 0 & 2 &UL\\
- Xswarm & 50 & 1.3 & 300 & 3 &Fk\\
- Xflying_carpet & 1 & 1.5 & 0 & 3 &Fc\\
- Xmoth & 150 & 1.5 & 0 & 4 &F\\
- Xbee & 250 & 1.2 & 30 & 6 &F\\
- Xgrasshopper & 350 & 1.0 & 0 & 6 &HL\\
- Xmosquito & 500 & 0.5 & 0 & 6 &FV\\
- Xinfestation & 600 & 0.0 & 50 & 6 &\\
- Xroach & 1000 & 0.8 & 20 & 10 &\\
- Xlobster & 1500 & 1.0 & 0 & 12 &W\\
- Xcreeping_doom & 2500 & 0.8 & 20 & 18 &\\
- X\hline
- X\end{tabular}
- X\end{center}
- X\end{table}
- X\end{same}
- X
- X
- X
- X\section{Army maintainance costs}
- XEach army has a maintainance cost which is given by the salaries of
- Xthe soldiers plus a fixed per-army overhead of 2000 sk.
- X
- X\section{Movement points}
- XYour armies can move only so much before they must stop and rest. How
- Xmuch they can move is expressed in the army's \strong{move points}, and
- Xthe \strong{move cost} of the sectors they must cross.
- X
- XFor example, if an army has 13 move points, and it goes through
- Xsectors with move costs of 4, 3, 2, 2 and 3, it will not have enough
- Xmove points left for the last sector (it will have 2 move points left,
- Xand that last sector has a move cost of 3).
- X
- X\section{Army statuses}
- X\begin{itemize}
- X\item
- X\emph{[i]ntercept} This army will intercept a nearby army. Intercept
- Xraises the move cost in the area, and then (over the update) the army
- Xwill move to any adjacent square where an enemy army might be located.
- XThis is quite powerful, since you don't have to defend each square;
- Xbut you should be careful because intercepts can be decoyed.
- X
- XIntercept will also move the army to intercept a flying enemy army,
- Xonce it has landed. But the increased move cost will not apply to flying
- Xenemy armies \emph{unless} the intercepting army wields missiles (for
- Xexample, archers). See the description of army flags.
- X
- X\item
- X\emph{[p]atrol} This army will patrol the area, raising the move cost
- Xfor enemy armies. If the enemy army is flying, the move cost will
- Xonly be raised if the patrolling army has missiles (for example, archers).
- X
- X\item
- X\emph{[g]garrison} This army garrisons the sector, getting an
- Xextra 10 bonus on your own land. If the sector belongs to a nation at
- XTREATY with you, then you also get bonus 10. If it is ALLIED land,
- Xyou get a bonus of 5.
- X\end{itemize}
- X
- X\comment \section{Tactics}
- X
- X\chapter{Detailed description of commands}
- X
- X\section{Options menu}
- XYou can set some options that affect the way the game appears to you.
- XFor now the only ones implemented are:
- X\begin{itemize}
- X\item
- X\emph{e[x]pert} mode. This toggles expert mode on and off. Expert mode
- Xallows an experience player to do things much more quickly by showing
- Xmost menus on the status line, instead of drawing big windows.
- X\item
- X\emph{[f]orwarding mail}. This allows a you to get mail forwarded
- Xto your account instead of reading mail inside dominion.
- X\item
- X\emph{[c]ivilian movement}. This toggles between the three available
- Xtypes of migration that your government allows: \strong{Free},
- X\strong{Restricted} and \strong{None}.
- X\item
- X\emph{[m]ail program}. This allows you to choose a mail program with
- Xwhich to read your dominion mail. Examples are ``elm'', ``mush'', ``Mail'',
- X``mailx''. If you type nothing, you will get the builtin bare-bones mail
- Xprogram.
- X\end{itemize}
- X
- X\section{Display options}
- XThe default way of viewing the screen shows the designation of your
- Xown sectors, altitude markings for unowned sectors, and nation marks
- Xfor other nations' sectors. But there are a lot of different ways of
- Xlooking at the map, and of highlighting sectors on it. The [d]isplay
- Xcommand will list all these for you.
- X
- XIf you are a land race, water sectors are usually marked as a '~', but
- Xthis can be toggled with the \emph{[W]ater toggle} option: if you
- Xchoose this mode, then land sectors will appear as a '.', and water
- Xsectors will be shown in detail.
- X
- X\section{Movement}
- XThe movement commands are shown in the diagram at the beginning of this
- Xmanual. They are quite straightforward, and only behave differently
- Xwhen you reach the edge of the screen. In this case, the screen is
- Xshifted over, so your cursor does not go off. The screen can be
- Xforcibly centered around the cursor using the [d]isplay command [C].
- X
- XYou can also jump directly to a sector with the [p] command. You will
- Xbe prompted for the coordinates. You can jump back to your capital
- Xwith the [P] command.
- X
- X\section{Reports}
- XHere is a detailed description of each report in dominion. To acess
- Xthem type [r] and then the letter of the report you want. You can
- Xswitch from one report to another by hitting the key that corresponds
- Xto the report you want. The reports you can switch to ae listed at
- Xthe bottom of the report you are looking at.
- X
- X\subsection{Information report}
- XTo access this report you type [r] followed by [i].
- X
- XThis report gives complete information about your nation. This is a
- Xdescription of each parameter printed.
- X
- X\begin{itemize}
- X\item
- XNation name: the name of your nation (wow!!).
- X\item
- XNation id: your nation id, used mostly internally.
- X\item
- XLeader: the name of your nation's leader.
- X\item
- XCapital: the location of your capital. This is always (0,0), since
- Xcoordinates are given relative to your capital, unless you are the game
- Xmaster.
- X\item
- XRace: the race you belong to.
- X\item
- XMark: your nation mark. Other nations will see this mark on their screen,
- Xand you will too if you display by nation mark.
- X\item
- XSecotors: The number of sectors owned by your nation.
- X\item
- XTreasury, Jewels, Metal, Food: Your current wealth.
- X\item
- XBirthrate: The percentage by which your population increases every thon.
- X\item
- XMortality: The percentage of people who die in your nation every thon.
- X\item
- XInteligence:
- X\item
- XMagic Apt:
- X\item
- XSpeed: Your move rate is proportional to this.
- X\item
- XInitiated to the magical order: This says what magic order you belong to.
- X\item
- XMagic Skill: How proficient you are in your use of magic.
- X\item
- XSpell points: Tells you how many you have and how many are spent for
- Xmaintenance of spirits.
- X\item
- XTechnology skill: How technologically advanced your country is.
- X\item
- XFarming skill: The higher this is the more food you produce per farmer.
- X\item
- XMining skill: This is your ability to 'harvest' jewels and metal.
- X\item
- XSpy skill: This expresses how good your intelligence service is.
- X\item
- XSecrecy: This makes you immune to espionage by other nations.
- X\item
- XCivilians: This is the number of civilans in your country.
- X\item
- XSoldiers: This is the number of soldiers in your country. This
- Xincludes spirit forces, mages, caravans, ships...
- X\item
- XArmies: This is the number of armies you have including spirit units
- Xand mages.
- X\item
- XAttack bonus, Defense bonus: If you add this percentage to the number
- Xof soldiers in the army, you get the effective force your army fights
- Xwith.
- X\item
- XMove points: This is how far your army can move each turn.
- X\end{itemize}
- X
- XFrom here you can change your password [p] or change your leader name
- X[l]. The key letter [t] allows you to change your nation to an NPC,
- Xand allows you to choose if your nation should receive update mail
- Xwhile it is being run by the computer. Also listed are the key
- Xletters for other reports you can view.
- X
- XChanging your nation to an NPC is a risky move: the computer will play
- Xa good game, but it will not honor your long-term plans.
- X
- X\subsection{Budget report}
- XTo access this report you type [r] followed by [b].
- X
- XThe budget report gives you detailed breakdown of how you are spending your
- Xmoney and your natural resources.
- X
- XWithin the budget report you can adjust what percent of your money
- Xand/or natural resources you are spending on technology, the study of
- Xmagic and reconnaisance. You also can adjust your tax rate from this
- Xmenu.
- X
- XThis screen also shows how much money you are spending on military
- Xmaintenance and other costs inccurred. The only way military
- Xmaintenance can be lowered is to disband armies. Other costs include
- Xbut are not limited to the cost of drafting an army and the cost of
- Xredesignating sectors.
- X
- XThe Metal and Jewels Breakdown, aside from listing the amounts spent
- Xon research and development, show how much of each natural resource is
- Xspent. Other metal expenses consist of but are not limited to the
- Xconstruction of citites and the drafting of armies. Other Jewels are
- Xused as a maintenance fee for mages.
- X
- XThe commands within this screen are:
- X
- X\begin{itemize}
- X\item
- X{[t]} which adjusts your tax rate
- X\item
- X{[c]} which adjusts your charity rate
- X\item
- X{[T]} which is technology resarch and development, has a
- Xsubmenu that consists of the choices metal and money.
- X\begin{itemize}
- X\item
- X {[m]} sets the amount of metal you wish to use in R\&D
- X\item
- X {[M]} sets the amount of money
- X\end{itemize}
- X\item
- X{[M]} puts you into the sub-section for Magic R\&D where
- X\begin{itemize}
- X\item
- X {[j]} changes the amount of jewels you use for Magic R\&D
- X\item
- X {[M]} adjusts the amount of money you spend for Magic R\&D
- X\end{itemize}
- X\item
- X{[S]} this invests money in your \emph{spy department}
- X\item
- X{[s]} this allows you to spend money/metal/jewels from your storage.
- XThe way you can spend it is similar to how you spend your revenue, but
- Xit is a once-only expense, and is cleared after each update.
- X\end{itemize}
- X
- X\emph{A NOTE OF CAUTION:}
- X
- XWatch how much money you are spending carefully, You might be
- Xbankrupting your nation without realizing it! You to can run your
- Xnation at a deficit\dots{} but be warned: if you have no money, you
- Xcanot draft, construct or redesignate. If someone attacks you and
- Xyou need armies quickly, you will be in trouble.
- X
- XYou might also want to keep you taxes on the low side\dots{} the
- Xhigher the taxes, the less the people produce. In fact, beyond a
- Xcertain tax rate, you will not even get much tax revenue out of your
- Xpeople because they will produce so little, and they will want to
- Xcheat on taxes.
- X
- X\subsection{Production report}
- XThe production report tells you how many people are employed and
- Xunemployed in each area of your economy. It also shows you the
- Xaverage productivity of each employee. The ``service sector''
- Xmeans all people who are not employed in productive endevours (mining
- Xand farming).
- X
- X\subsection{Nations report}
- XThe nations report, which can be seen by typing [r] followed by [n],
- Xgives you a report on all the nations.
- X
- XYou are told the size of the world and how many nations are in it. It also
- Xgives a detail of each nation that lists the nation id, nation name, nation
- Xmark, leader name, and race.
- X
- XWithin this report is also the spy option, [s]. You will then be
- Xprompted for a nation id, and then you will be presented with a screen
- Xthat allows you to bribe officials in that nation for information.
- XHere is how it works:
- X
- XYou pay a certain amount of jewels in bribes to another nation. You
- Xcan get information about their [p]opulation, [e]conomy, [m]ilitary,
- Xma[g]ic, [t]echnology and [C]apital location. You can also steal
- X[T]echnology (not yet implemented).
- X
- XThe success of your spying will depend on your spy level, your
- Xopponent's secrecy, your and your opponent's stealth, and the amount
- Xof jewels you spend in bribes. You will receive an answer which is
- Xnot exactly accurate, but gets better if you spend more, or have a
- Xbetter spy value, and so on.
- X
- X\subsection{Diplomacy report}
- XDiplomacy with other nations is extremely important. You should set a
- Xstatus with each nation you have met. This is done in the
- X\strong{diplomacy} report.
- X
- XYou cannot make a great change in diplomacy status in one turn: you
- Xcan at most jump two levels of diplomacy in one turn, like going from
- XALLIED to RECOGNIZED. The next turn you can go from RECOGNIZED to
- XUNRECOGNIZED, and the turn after that you can go do WAR. This ensures
- Xthat any nation will see the diplomatic situation deteriorate
- Xprogressively before war is declared on them.
- X
- X\section{Wizardry}
- XType [W] to enter the wizardry menu.
- X
- XThe wizardry command allows you to do \strong{initiate a mage},
- X\strong{cast a spell} and \strong{summon a spirit}. Spells are cast and
- Xspirits are summoned in a given sector, and you must have a mage in
- Xthat sector to do so.
- X
- XHit the [i] command to initiate a mage. Mages move twice as fast as
- Xnormal armies, so they can reach a battlefield quickly to do their
- Xwork.
- X
- XIf you have a mage already selected (see the [a]rmy menu), then you
- Xcan use use [c] to [c]ast a spell or [s] to [s]ummon a spirit. The
- Xspell is cast on an object (army, or sector, or whatever, according to
- Xwhich spell it is) in the same sector as the mage, and the spirit is
- Xcreated in the same sector as the mage. Spirits must be summoned in
- Xyour own land.
- X
- XMost spells will hang around until their duration is over, or until
- Xyou delete them, or until the army to which they apply does not exist
- Xany more. You can see which spells you have hanging with the [h]
- Xcommand, and that gives you the option of deleting hanging spells too.
- XSpirits last until they are killed, and behave just like armies.
- X
- X\subsection{Mages}
- XMages are necessary for casting spells and summoning spirits. They
- Xmust be initiated inside a capital, city, temple or university. They
- Xcost 5000 jewels to initiate, and 1000 jewels in maintainance each
- Xthon.
- X
- XMages are moved around as if they were an army, and have twice the
- Xnation's basic move rate.
- X
- XSome spirits have the [w]izardry flag, and they behave like mages.
- X
- X\subsection{Spells}
- XHere is a description of several spells available in dominion. Keep
- Xin mind that some spells may be available to several orders, and their
- Xcost and duration will be different for the different orders. For
- Xexample, both Neptune and Time have the water_walk spell, but for
- Xneptune it costs only 1 spell point, whereas for Time it costs 2.
- X
- XBoth the cost and the duration of the spell are indicated when you
- Xlist your available spells. The cost is in spell points.
- X
- XIf the spell is applied to a sector, then that is all you spend.
- X
- XA spell applied to an army will usually set a special flag for that
- Xarmy, and will cost a given amount per each 100 men. Army flags are
- Xdescribed in the section on armies.
- X
- XNotice that some armies and spirits come into the world with some of
- Xthese magical properties already set, so you do not need to set them
- Xwith a spell.
- X
- X\begin{itemize}
- X\item \strong{caltitude}
- XThis spell allows you to raise or lower the altitude of a sector.
- XThis means that you could plunge it into the sea, or you could place
- Xit on a mountain peak.
- X\item \strong{fertility}
- XThis spell allows you to raise or lower the soil fertility of a
- Xsector.
- X\item \strong{cmetal}
- XThis spell allows you to raise or lower the metal productivity of a
- Xsector.
- X\item \strong{cjewels}
- XThis spell allows you to raise or lower the jewel productivity of a
- Xsector.
- X\item \strong{fireburst}
- XThis spell devastates the chosen sector, redesignates it to
- X\emph{none}, sets the soil productivity to zero, and in the future
- Xshould do other nasty stuff.
- X\item \strong{inferno}
- XThis spell will kill all population in the sector, and make it
- Xcompletely impenetrable to any army for its duration. You can only
- Xcast \emph{inferno} on your own sectors. It is a very effective
- Xway to block enemy armies.
- X\item \strong{hide_sector}
- XThis spell completely hides the current sector from any other nation.
- XThe sector will just appear as a blank spot on the map.
- X\item \strong{hide_army}
- XThis spell sets the HIDDEN flag on an army, so that others cannot see
- Xthis army.
- X\comment All they will see is a highlighted spot on their display
- X\comment if they highlight by armies, but when they try to examine the sector,
- X\comment they will just see a mist and have no idea whose armies they are, nor
- X\comment how many men are in it.
- X\item \strong{fly_army}
- XThis sets the FLYING flag on an army. The army will be able to fly.
- X\item \strong{vampire_army}
- XThis sets the VAMPIRE flag on an army. This means that in battle, 1/4
- Xof the troops that die will join the ranks of this army. The army
- Xwill not be allowed to grow to more than a certain multiple of its
- Xoriginal size.
- X\item \strong{burrow_army}
- XThis sets the UNDERGROUND flag on an army. This means that the army is
- Xtraveling underground and is thus immune to intercepts.
- X\item \strong{water_walk}
- XThis sets the WATER flag on an army. The army will be able to cross
- Xwater sectors.
- X\item \strong{mag_bonus}
- XThis gives magical enhancement to an army. The army will fight with an
- Xextra 30% bonus.
- X\item \strong{merge}
- XThis spell allows you to merge civilians into spirits (up to twice the
- Xspirits' basic strength), or to take spirits and merge them into the
- Xcivilian population of a sector.
- X\item \strong{haste_army}
- XThis spell doubles the army's current move rate.
- X\end{itemize}
- X
- X\subsection{Spirits}
- XSpirits are like armies, in that they can fight, and they can occupy
- Xsectors (if they are big enough), and their status and movement is
- Xmanipulated with the [a]rmy command.
- X
- XThey are also different in many ways. To obtain them, you don't draft
- Xthem, but your mage summons them with spell points. They are not
- Xmaintained by money, but by more spell points (typically 1/3 of the
- Xspell points that were needed to summon them in the first place).
- X
- XSpirit types are described above together with army types.
- X
- X\chapter{The update}
- X
- XIt can be useful to understand exactly what happens during the update.
- XHere are the steps in the order in which the computer performs them.
- XThis list might not be complete, but it should give you an idea of how
- Xthe update works.
- X
- X\begin{enumerate}
- X
- X\item NPC diplomacy is updated
- X\item Hanging spells are loaded
- X\item All moves by all nations are incorporated, and NPC moves are made
- X\item Technology is updated
- X\item Spy is updated
- X\item Magic is updated
- X\item Revenue is calculated of money, metal, jewels and food
- X\item Civilian migration occurs
- X\item Battles are resolved
- X\item Sector capture is handled
- X\item Diplomacy is updated (nations become ``met'')
- X\item Armies are reset. Mages are disbanded if maintaince jewels are missing.
- X
- X\end{enumerate}
- X
- X\section{Migration}
- X
- XCivilian migration happens automatically. The people move according to
- Xthe laws of the country. As a leader you can set those laws with the
- X[o]ptions screen: you can set migration to be \emph{Free} (the default),
- X\emph{Restricted} or \emph{None}.
- X
- X\begin{itemize}
- X\item Free
- Xmovement. People look for the sectors that have the most
- Xavailable jobs, because that's where they will get the best pay/best
- Xjob. Some attraction is also excersized by how pleasant a sector's
- Xliving conditions are, but in general a constant ratio of employment
- Xis preserved locally.
- X\item Restricted
- Xmovement. The govevernment (you) has gotten sick of all theese
- Xcivilians wandering around so much. So civilians will not be allowed
- Xto leave their present place of residence unless they can prove they
- Xare unemployed. If so then they will move to the sectors surrounding
- Xthem, partially by number of jobs available, partially by the
- Xdesirability of the sectors available. However all sectors in range
- Xwill be put to full employement if possible. If there is nowhere to
- Xgo they will wander aimlessly in search of a place to find a job,
- Xjumping with the latest rumor of employment. However even in the best
- Xcircumstance, due to a slow bureocracy there will always be a few
- Xextra people left in the sector than can be employed.
- X\item None.
- XNo movement. The government (you again) has decreed that there will
- Xbe no civillian movement. Where they are is where you stay, and where
- Xwhere they are born is where they will die. Unless the army comes to
- Xget them in caravans/ships, they will stay put.
- X\end{itemize}
- X
- X\chapter{Authors}
- XVersion 1.02 of Dominion is the first with this name. It used to be
- Xcalled \emph{Stony Brook World} (SBW), until too many people suggested
- Xa catchier name.
- X
- XHere is a list of the people who actually wrote code for sbw/dominion
- Xthat is in the current release. The order is that in which they wrote
- Xtheir first piece of code.
- X
- XMark Galassi (rosalia@dirac.physics.sunysb.edu) User interface (in
- Xcurses), basic data structures, world generator, economy, technology,
- Xmagic, basic army work, manual and formatting of manual with
- XLaTeXinfo, miscellaneous. Currently maintains dominion.
- X
- XMichael Fischer (greendog@max.physics.sunysb.edu) Update program, trade
- Xboard, developed exec file format, miscellaneous.
- X
- XDoug Novellano (doug@max.physics.sunysb.edu) Mail and News systems.
- X
- XKeith Messing (keith@max.physics.sunysb.edu) Diplomacy system.
- X
- XAlan Saporta (gandalf@max.physics.sunysb.edu) Work on some exec routines,
- Xmany suggestions of directions for the game.
- X
- XJoanne Rosenshein (raven@max.physics.sunysb.edu) Initial draft of the
- Xmanual, many suggestions of directions for the game.
- X
- XStephen Bae (sbae@max.physics.sunysb.edu) Basic world memory allocation.
- X
- XChris Coligado (noel@max.physics.sunysb.edu) Army and battle code.
- X
- XC. Titus Brown (brown@dirac.physics.sunysb.edu) Adding nations and
- Ximprovements on the reports; revised army menu and transportation
- Xmenu. Lots of miscellaneous stuff.
- X
- XCharles Ofria (charles@max.physics.sunysb.edu) Designed the ``npcs''
- Xfile, most magic orders and many races and techno powers; coded some
- Xspells.
- X
- XThere are also some contributions from people not in Stony Brook:
- X
- XStephen Underwood (su11+@andrew.cmu.edu) Fractal terrain generator and
- Xcontributions in very many areas, including the standalone mail
- Xreader.
- X
- XPaolo Montrasio (montra@ghost.unimi.it) .dominionrc parser (for
- Xa later release), and working on design for distributed game.
- X
- XKevin Hart (hart@susan.cs.andrews.edu) NPC system.
- X
- XMany others have made very important creative suggestions to the game,
- Xthough they were not involved in the actual coding. Here are some
- Xnames that come to mind. Please send us mail if we have forgotten
- Xany. Tony Matranga, Tim Poplaski, Chris Adami, and everyone else who
- Xparticipated in the FALL SBW and SPRING DOMINION games at Stony Brook
- Xin the fall 1990 and spring 1991 semesters.
- X
- XIf you are interested in playing in any future games at Stony Brook,
- Xplease mail ``rosalia@max.physics.sunysb.edu.''
- X
- X\end{document}
- END_OF_FILE
- if test 36711 -ne `wc -c <'dom_tex.ab'`; then
- echo shar: \"'dom_tex.ab'\" unpacked with wrong size!
- fi
- # end of 'dom_tex.ab'
- fi
- echo shar: End of archive 17 \(of 28\).
- cp /dev/null ark17isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 28 archives.
- echo "Now execute ./do_cat.sh to build doc files"
- 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
-