home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume13 / dominion / part17 < prev    next >
Encoding:
Internet Message Format  |  1992-02-10  |  60.6 KB

  1. Path: uunet!zephyr.ens.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v13i053:  dominion - a multi-player world simulation game, Part17/28
  5. Message-ID: <2456@masterCNA.TEK.COM>
  6. Date: 11 Feb 92 18:25:34 GMT
  7. Sender: news@masterCNA.TEK.COM
  8. Lines: 1859
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: rosalia@dirac.physics.sunysb.edu (Mark Galassi)
  12. Posting-number: Volume 13, Issue 53
  13. Archive-name: dominion/Part17
  14. Environment: Unix, curses
  15.  
  16.  
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 17 (of 28)."
  25. # Contents:  armylib.c dom_tex.ab
  26. # Wrapped by billr@saab on Tue Feb 11 10:14:55 1992
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'armylib.c' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'armylib.c'\"
  30. else
  31. echo shar: Extracting \"'armylib.c'\" \(21209 characters\)
  32. sed "s/^X//" >'armylib.c' <<'END_OF_FILE'
  33. X  /* army.c -- generic, non-visual army stuff;  see also army.c */
  34. X
  35. X/*
  36. X * Copyright (C) 1990 Free Software Foundation, Inc.
  37. X * Written by the dominion project.
  38. X *
  39. X * This file is part of dominion.
  40. X *
  41. X * dominion is free software; you can redistribute it and/or
  42. X * modify it under the terms of the GNU General Public License as published
  43. X * by the Free Software Foundation; either version 1, or (at your option)
  44. X * any later version.
  45. X *
  46. X * This software is distributed in the hope that it will be useful,
  47. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  48. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  49. X * GNU General Public License for more details.
  50. X *
  51. X * You should have received a copy of the GNU General Public License
  52. X * along with this software; see the file COPYING.  If not, write to
  53. X * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  54. X */
  55. X
  56. X#include "dominion.h"
  57. X#include "misc.h"
  58. X#include "army.h"
  59. X
  60. X#include <stdio.h>
  61. X
  62. X  /* army and spirit types */
  63. Xextern struct army_type *army_types;
  64. Xextern struct spirit_type *spirit_types;
  65. X
  66. Xextern Sworld world;
  67. Xextern Suser user;
  68. Xextern int debug;
  69. Xextern struct army_flags army_flags[];
  70. X
  71. XSarmy *get_army();
  72. X
  73. X  /* this gets a string with the army status written
  74. X     out, and flags if the army is in a magical mode
  75. X   */
  76. Xget_army_status(ap, s)
  77. X     Sarmy *ap;
  78. X     char s[];
  79. X{
  80. X  int has_slash = 0, max_len, len ,offset, i;
  81. X  char *pos, *pos2;
  82. X
  83. X
  84. X  switch (ap->status) {
  85. X  case A_ATTACK:
  86. X    strcpy(s, "ATTACK");
  87. X    break;
  88. X  case A_DEFEND:
  89. X    strcpy(s, "DEFEND");
  90. X    break;
  91. X  case A_OCCUPY:
  92. X    strcpy(s, "OCCUPY");
  93. X    break;
  94. X  case A_PATROL:
  95. X    strcpy(s, "PATROL");
  96. X    break;
  97. X  case A_INTERCEPT:
  98. X    strcpy(s, "INTERCEPT");
  99. X    break;
  100. X  case A_GARRISON:
  101. X    strcpy(s, "GARRISON");
  102. X    break;
  103. X  case A_AMBUSH:
  104. X    strcpy(s, "AMBUSH");
  105. X    break;
  106. X  case A_TRADED:
  107. X    strcpy(s, "TRADED");
  108. X    break;
  109. X  default:
  110. X    strcpy(s, "UNKNOWN");
  111. X    break;
  112. X  }
  113. X  for (i = 0; i < 32; i++)
  114. X  {
  115. X    has_slash = add_flag(s,ap->flags,i,has_slash);
  116. X  }
  117. X  max_len = 11;
  118. X  if (ap->id < 100) max_len++;
  119. X  if (ap->id < 10) max_len++;
  120. X  if (ap->mvpts < 10) max_len++;
  121. X
  122. X  if ((len = strlen(s)) > max_len) { 
  123. X    pos = (char *)strchr(s,'/');
  124. X    pos2 = s + (max_len - (len - (pos - s)));
  125. X    if (pos2 <= s) pos2 = s + 1;
  126. X    offset = (pos - pos2);
  127. X    while (pos2 + offset <= s + len) {
  128. X      *pos2 = *(pos2 + offset);
  129. X      pos2++;
  130. X    }
  131. X  }
  132. X}
  133. X
  134. Xadd_flag(s,flags,i,has_slash)
  135. X/*
  136. X   This routine adds to a status line s the flag associated with
  137. X   the i'th bit position in the flags, adding a slash if one has not
  138. X   already been added.  The flags corresponding to the bit positions
  139. X   are in ext.c in a global array.
  140. X*/
  141. Xchar *s;
  142. Xint flags, i, has_slash;
  143. X{
  144. X  char s2 [2];
  145. X  
  146. X  if (flags & (0x1 << i)) {
  147. X    if (has_slash == 0) {
  148. X      strcat(s,"/");
  149. X      has_slash = 1;
  150. X    }
  151. X    sprintf (s2, "%c", army_flags [i].flag);
  152. X    strcat (s, s2);
  153. X  }
  154. X  return has_slash;
  155. X}
  156. X
  157. X  /* given a nation and an army id, find the army (or NULL
  158. X     if there is no army with that id)
  159. X   */
  160. XSarmy *get_army(np, id)
  161. X     Snation *np;
  162. X     int id;
  163. X{
  164. X  Sarmy *ap = np->armies;
  165. X  char s[100];
  166. X
  167. X  if (id == -1) {
  168. X    return NULL;
  169. X  }
  170. X  while ((ap != NULL) && (ap->id != id)) {
  171. X/*    sprintf(s, "(while) ap->id=%d,id=%d", ap->id, id);
  172. X    printf("%s", s);
  173. X/*     statline2(s, "get_army debug"); */
  174. X/*    getch(); */
  175. X
  176. X
  177. X    ap = ap->next;
  178. X  }
  179. X/*  sprintf(s, "(out of while) ap->id=%d,id=%d", ap ? ap->id : -1, id);
  180. X  printf("%s", s);
  181. X/*  statline2(s, "get_army debug"); */
  182. X/*  getch(); */
  183. X
  184. X  return ap;            /* should be NULL if none is found */
  185. X}
  186. X
  187. X  /* calculate the cost to draft an army */
  188. Xarmy_cost(ap)
  189. X     Sarmy *ap;
  190. X{
  191. X  int index = army_type_index(ap->type);
  192. X
  193. X  if (is_army(ap)) {
  194. X    return ap->n_soldiers*army_types[index].money_draft;
  195. X  } else {
  196. X    return 0;
  197. X  }
  198. X}
  199. X
  200. Xarmy_cost_metal(ap)
  201. X     Sarmy *ap;
  202. X{
  203. X  int index = army_type_index(ap->type);
  204. X  if (is_army(ap)) {
  205. X    return ap->n_soldiers*army_types[index].metal_draft;
  206. X  } else {
  207. X    return 0;
  208. X  }
  209. X}
  210. X
  211. X  /* insert the army into the nation's army list.
  212. X     if the id parameter is -1, then this function
  213. X     decides where to insert it.
  214. X   */
  215. Xinsert_army_nation(np, ap, chosen_id)
  216. X     Snation *np;
  217. X     Sarmy *ap;
  218. X     int chosen_id;
  219. X{
  220. X  Sarmy *alist = np->armies, *tmp = np->armies, *prev = np->armies;
  221. X
  222. X  if (alist == NULL) {
  223. X    return -1;
  224. X  }
  225. X    /* if the army id given is good, and not taken, then use it */
  226. X  if (chosen_id < 0 || get_army(np, chosen_id) != NULL) {
  227. X    ap->id = free_army_id(np);
  228. X    if (is_in_transport(ap)) {    /* trouble!! */
  229. X      printf("bad: this army is in transport, and I had to change its id\n");
  230. X    }
  231. X  } else {
  232. X    ap->id = chosen_id;
  233. X  }
  234. X#ifdef WAIT_A_WHILE
  235. X  /* a little touch-up to the flags to account for ships
  236. X     and other things with the inverse altitude flag
  237. X   */
  238. X  if (ap->flags & AF_INVERSE_ALT) {
  239. X    if (np->race.pref_alt >= SEA_LEVEL) {
  240. X      ap->flags &= ~AF_LAND;    /* remove the land flag */
  241. X      ap->flags |= AF_WATER;    /* give it water flag */
  242. X    } else {
  243. X      ap->flags &= ~AF_WATER;    /* remove the water flag */
  244. X      ap->flags |= AF_LAND;    /* give it the land flag */
  245. X    }
  246. X  }
  247. X#endif /* WAIT_A_WHILE */
  248. X  if (alist->id > ap->id) {        /* we must insert at the start */
  249. X    ap->next = alist;
  250. X    np->armies = (Sarmy *) malloc(sizeof(Sarmy));
  251. X    *np->armies = *ap;
  252. X    return 1;
  253. X  }
  254. X  while ((tmp != NULL) && (tmp->id < ap->id)) {
  255. X    prev = tmp;            /* keep the previous one */
  256. X    tmp = tmp->next;
  257. X  }
  258. X  ap->next = tmp;
  259. X  prev->next = (Sarmy *) malloc(sizeof(Sarmy));
  260. X  *prev->next = *ap;        /* copy it on */
  261. X  return 1;
  262. X}
  263. X
  264. X  /* remove an army from a nation list of armies (if it IS in the list!) */
  265. Xdelete_army_nation(np, ap)
  266. X     Snation *np;
  267. X     Sarmy *ap;
  268. X{
  269. X  Sarmy *tmp = np->armies, *prev = np->armies, *alist = np->armies;
  270. X
  271. X  if (tmp == NULL) {        /* special case for emtpy list */
  272. X    np->n_armies = 0;
  273. X    return;            /* blah, nothing to delete */
  274. X  }
  275. X    /* see if the army to be deleted is the head of the list */
  276. X  if ((alist->owner == ap->owner) && (alist->id == ap->id)) {
  277. X      /* in this special case, copy the second army to
  278. X     the first, then free up the second.
  279. X       */
  280. X    tmp = alist->next;        /* the next one must be saved for freeing */
  281. X    if (alist->next != NULL) {
  282. X      *alist = *(alist->next);
  283. X      free(tmp);
  284. X    } else {
  285. X      np->armies = NULL;
  286. X      free(alist);
  287. X    }
  288. X    np->n_armies--;
  289. X    return;
  290. X  }
  291. X    /* get hold of the army id we are looking for */
  292. X  while ( (tmp != NULL) &&
  293. X     !( (tmp->owner == ap->owner) && (tmp->id == ap->id) ) ) {
  294. X    prev = tmp;            /* remember the previous element */
  295. X    tmp = tmp->next;
  296. X  }
  297. X    /* now we have the same army, so we can remove it */
  298. X  if (tmp == NULL) {
  299. X    return;            /* blah, we didn't find it */
  300. X  }
  301. X  prev->next = tmp->next;    /* this is the crucial step:  tmp is removed */
  302. X  free(tmp);            /* don't need the space */
  303. X  np->n_armies--;
  304. X}
  305. X
  306. X  /* remove an army from a list of armies (if it IS in the list!) */
  307. Xdelete_army_sector(sp, ap)
  308. X     Ssector *sp;
  309. X     Sarmy *ap;
  310. X{
  311. X  struct armyid *tmp = sp->alist, *prev = sp->alist;
  312. X
  313. X  if (!sp->alist) {        /* if we have no armies here at all */
  314. X    return;
  315. X  }
  316. X  /* special case it if is the first army;
  317. X     also works if it is the ONLY army
  318. X   */
  319. X  if ((tmp->owner == ap->owner) && (tmp->id == ap->id)) {
  320. X    sp->alist = sp->alist->next;
  321. X    free(tmp);
  322. X    return;            /* done!! */
  323. X  }
  324. X
  325. X  while (tmp != NULL) {
  326. X    if ((tmp->owner == ap->owner) && (tmp->id == ap->id)) { /* found it! */
  327. X      prev->next = tmp->next;
  328. X      free(tmp);        /* free the space */
  329. X      return;            /* done!! */
  330. X    }
  331. X    prev = tmp;
  332. X    tmp = tmp->next;
  333. X  }
  334. X}
  335. X
  336. X  /* take a sector and an army, and put the army in the sector's
  337. X     army list
  338. X   */
  339. Xinsert_army_sector(sp, ap)
  340. X     Ssector *sp;
  341. X     Sarmy *ap;
  342. X{
  343. X  struct armyid *tmp;
  344. X
  345. X  /* first make sure that the army is not yet in this secotr!! */
  346. X  if (army_is_in_sector(sp, ap->owner, ap->id)) {
  347. X    return 0;
  348. X  }
  349. X  if (ap->pos.x != sp->loc.x || ap->pos.y != sp->loc.y) {
  350. X    printf("major error:  ap->pos != sp->loc in insert_army_sector\r\n");
  351. X    refresh();
  352. X  }
  353. X  ap->pos = sp->loc;        /* make sure army's position is right */
  354. X  if (sp->alist == NULL) {    /* special case: empty list */
  355. X    sp->alist = (struct armyid *) malloc(sizeof(struct armyid));
  356. X    sp->alist->owner = ap->owner;
  357. X    sp->alist->id = ap->id;
  358. X    sp->alist->next = NULL;
  359. X    return 1;
  360. X  }
  361. X    /* insert at the beginning */
  362. X  tmp = (struct armyid *) malloc(sizeof(struct armyid));
  363. X  tmp->owner = ap->owner;
  364. X  tmp->id = ap->id;
  365. X  tmp->next = sp->alist;
  366. X  sp->alist = tmp;        /* this is the new beginning */
  367. X  return 1;
  368. X}
  369. X
  370. X  /* generate an army, in given sector, of
  371. X     given type, with given status.  return the army.
  372. X     do not add it to the nation's linked list at this point.
  373. X   */
  374. XSarmy make_army(type, name, n_soldiers, status, owner, loc)
  375. X     char type[], name[];
  376. X     int n_soldiers, status, owner;
  377. X     Pt loc;
  378. X{
  379. X  Sarmy new_army;
  380. X  Snation *np = &world.nations[owner];
  381. X  int aindex, sindex;        /* index in army/spirit type list */
  382. X  struct army_type this_atype;
  383. X  struct spirit_type this_stype;
  384. X  Sspirit *spiritp = user.spirit_list; /* in case it is a spirit */
  385. X
  386. X  aindex = army_type_index(type);
  387. X  sindex = spirit_type_index(type);
  388. X  if (aindex >= 0) {        /* it is an army!! */
  389. X    this_atype = army_types[aindex];
  390. X  } else if (sindex >= 0) {    /* it is a spirit */
  391. X    this_stype = spirit_types[sindex];
  392. X    while (spiritp && (strcmp(type, spiritp->type) != 0)) {
  393. X      spiritp = spiritp->next;
  394. X    }
  395. X    if (spiritp == NULL)  {
  396. X      fprintf(stderr,"Error: spirit type %s not available\n",type);
  397. X    }
  398. X  }
  399. X
  400. X  strcpy(new_army.type, type);
  401. X  strcpy(new_army.name, name);
  402. X  new_army.n_soldiers = n_soldiers;
  403. X  new_army.status = status;
  404. X  new_army.owner = owner;
  405. X  new_army.mvratio = 100;    /* 100% to start with */
  406. X  new_army.pos = loc;
  407. X  new_army.id = 0;       /* this is set when army is inserted into list */
  408. X  new_army.flags = 0x00L;
  409. X    /* when drafted, new armies have only 1/4 of full move points */
  410. X  new_army.mvpts = army_move_rate(np, &new_army)/4;
  411. X  if (is_army(&new_army)) {    /* case army */
  412. X    new_army.sp_bonus = this_atype.bonus;
  413. X    new_army.money_maint = this_atype.money_maint;
  414. X    new_army.metal_maint = this_atype.metal_maint;
  415. X    new_army.jewel_maint = this_atype.jewel_maint;
  416. X    new_army.spell_pts_maint = this_atype.spell_pts_maint;
  417. X    new_army.flags = this_atype.flags;
  418. X  } else if (is_mage(&new_army)) { /* case mage */
  419. X    new_army.sp_bonus = 0;
  420. X    new_army.money_maint = 0;
  421. X    new_army.metal_maint = 0;
  422. X    new_army.jewel_maint = MAGE_JEWELS_MAINT;
  423. X    new_army.spell_pts_maint = 0;
  424. X  } else {            /* if not, it is a spirit */
  425. X    new_army.sp_bonus = this_stype.bonus;
  426. X    new_army.money_maint = 0;
  427. X    new_army.metal_maint = 0;
  428. X    new_army.jewel_maint = 0;
  429. X/*    new_army.spell_pts_maint = this_stype.spell_pts_draft/4; */
  430. X    new_army.spell_pts_maint = (spiritp->cost * 1000000)/(4* this_stype.size );
  431. X    new_army.flags |= this_stype.flags;
  432. X  }
  433. X    /* special handling of the INVERSE_ALT flag:  if they
  434. X       are a land race, it becomes a WATER flag;  if they
  435. X       are a water race, it becomes a LAND flag.
  436. X     */
  437. X  if (new_army.flags & AF_INVERSE_ALT) {
  438. X    if (np->race.pref_alt >= SEA_LEVEL) {
  439. X      new_army.flags |= AF_WATER;
  440. X    } else {
  441. X      new_army.flags |= AF_LAND;
  442. X    }
  443. X  }
  444. X  new_army.next = NULL;
  445. X  memset(&new_army.cargo, '\0', sizeof(Scargo));
  446. X  new_army.cargo.army = -1;
  447. X  new_army.cargo.title.x = -1;
  448. X  new_army.cargo.title.y = -1;
  449. X
  450. X  return new_army;
  451. X}
  452. X
  453. X  /* this function tells you the basic army move rate for a nation */
  454. Xbasic_move_rate(np)
  455. X     Snation *np;
  456. X{
  457. X  return 4 + np->race.speed/8;    /* should not be less than 4 */
  458. X}
  459. X
  460. X  /* return 1 if given army can go into occupy mode, 0 otherwise */
  461. Xcan_occupy(ap)
  462. X     Sarmy *ap;
  463. X{
  464. X  if (ap->n_soldiers >= OCCUPYING_SOLDIERS && !is_in_transport(ap)) {
  465. X    return 1;
  466. X  } else {
  467. X    return 0;
  468. X  }
  469. X}
  470. X
  471. Xcan_patrol(ap)
  472. X     Sarmy *ap;
  473. X{
  474. X  if (ap->n_soldiers >= OCCUPYING_SOLDIERS/2) {
  475. X    return 1;
  476. X  } else {
  477. X    return 0;
  478. X  }
  479. X}
  480. X
  481. Xcan_intercept(ap)
  482. X     Sarmy *ap;
  483. X{
  484. X  if (ap->n_soldiers >= OCCUPYING_SOLDIERS/2) {
  485. X    return 1;
  486. X  } else {
  487. X    return 0;
  488. X  }
  489. X}
  490. X
  491. Xcan_garrison(ap)
  492. X     Sarmy *ap;
  493. X{
  494. X  return 1;
  495. X}
  496. X
  497. X  /* loads army types from the army types file */
  498. Xload_army_types()
  499. X{
  500. X  FILE *fp, *fopen();
  501. X  char line[210];
  502. X  int i;
  503. X
  504. X  if ((fp = fopen(ARMY_TYPES_FILE, "r")) == NULL) {
  505. X    printf("cannot open army types file.  quitting.\n");
  506. X    clean_exit();
  507. X    exit(1);
  508. X  }
  509. X
  510. X  do {
  511. X    fgets(line, 200, fp);
  512. X  } while (line[0] == '#');
  513. X    /* we should have the line with the number of army types in file */
  514. X  sscanf(line, "%d", &user.n_army_types);
  515. X
  516. X  army_types =
  517. X    (struct army_type *)malloc(user.n_army_types*sizeof(struct army_type));
  518. X
  519. X  for (i = 0; i < user.n_army_types; ) {
  520. X    fgets(line, 100, fp);
  521. X    line[strlen(line)-1] = '\0';
  522. X    if (line[0] != '#') {        /* ignore comments */
  523. X      sscanf(line,
  524. X          "%s : %1s : %f : %d : %d : %d : %d : %d : %d : %d : %d : %s",
  525. X         army_types[i].type, &army_types[i].type_char,
  526. X         &army_types[i].move_factor,
  527. X         &army_types[i].bonus, &army_types[i].money_draft,
  528. X         &army_types[i].metal_draft, &army_types[i].jewel_draft,
  529. X         &army_types[i].money_maint,
  530. X         &army_types[i].metal_maint, &army_types[i].jewel_maint,
  531. X         &army_types[i].flags,
  532. X         army_types[i].draft_places);
  533. X      army_types [i].spell_pts_maint = 0; /* Kludge, but ALWAYS so... */
  534. X      ++i;
  535. X    }
  536. X  }
  537. X
  538. X  fclose(fp);
  539. X}
  540. X
  541. X  /* returns true if this nation can draft that type of army */
  542. Xis_avail_army_type(up, type)
  543. X     Suser *up;
  544. X     char type[];
  545. X{
  546. X  int i;
  547. X  Savail_army *aa;
  548. X
  549. X    /* run through the list of available armies */
  550. X  for (aa = up->avail_armies; aa != NULL; aa = aa->next) {
  551. X    if (strncmp(aa->type, type, NAMELEN) == 0) {
  552. X      return 1;            /* got it!!! */
  553. X    }
  554. X  }
  555. X  return 0;            /* we did not find that army type */
  556. X}
  557. X
  558. X  /* returns the index in army_types, corresponding to
  559. X     an army type, or -1 on error (if it is not an army
  560. X     but, say, a caravan or spirit or mage).
  561. X   */
  562. Xarmy_type_index(type)
  563. X     char type[];
  564. X{
  565. X  int i;
  566. X  for (i = 0; i < user.n_army_types; ++i) {
  567. X    if (strncmp(army_types[i].type, type, NAMELEN) == 0) {
  568. X      return i;            /* got it!! */
  569. X    }
  570. X  }
  571. X  return -1;            /* didn't find it */
  572. X}
  573. X
  574. X  /* returns the index in spirit_types, corresponding to
  575. X     an army type, or -1 on error (if it is not an army
  576. X     but, say, a caravan or army or mage).
  577. X   */
  578. Xspirit_type_index(type)
  579. X     char type[];
  580. X{
  581. X  int i;
  582. X  for (i = 0; i < user.n_spirit_types; ++i) {
  583. X    if (strncmp(spirit_types[i].type, type, NAMELEN) == 0) {
  584. X      return i;            /* got it!! */
  585. X    }
  586. X  }
  587. X  return -1;            /* did not get it */
  588. X}
  589. X
  590. X  /* returns 1 if it is an army (not a navy), 0 otherwise */
  591. Xis_army(ap)
  592. X     Sarmy *ap;
  593. X{
  594. X  if (army_type_index(ap->type) >= 0) {
  595. X    return 1;
  596. X  }
  597. X  return 0;
  598. X}
  599. X
  600. X  /* returns 1 if it is a ship, 0 otherwise */
  601. Xis_navy(ap)
  602. X     Sarmy *ap;
  603. X{
  604. X    /* any army type beginning with "Ships" or "S_" is a navy */
  605. X  if (ap && strncmp(ap->type, "S_", strlen("S_")) == 0) {
  606. X    return 1;
  607. X  }
  608. X  if (ap && strncmp(ap->type, "Ships", strlen("Ships")) == 0) {
  609. X    return 1;
  610. X  }
  611. X  return 0;
  612. X}
  613. X
  614. X  /* returns 1 if it is an mage, 0 otherwise */
  615. Xis_mage(ap)
  616. X     Sarmy *ap;
  617. X{
  618. X  if (ap && (strcmp(ap->type, "Mage") == 0 || is_wizard(ap))) {
  619. X    return 1;
  620. X  }
  621. X  return 0;
  622. X}
  623. X
  624. X  /* returns 1 if it is an spirit, 0 otherwise */
  625. Xis_spirit(ap)
  626. X     Sarmy *ap;
  627. X{
  628. X  if (spirit_type_index(ap->type) >= 0) {
  629. X    return 1;
  630. X  }
  631. X  return 0;
  632. X}
  633. X
  634. X  /* returns the army move rate for a specific army */
  635. Xarmy_move_rate(np, ap)
  636. X     Snation *np;
  637. X     Sarmy *ap;
  638. X{
  639. X  int mvpts, i;
  640. X
  641. X  if (is_army(ap)) {
  642. X    i = army_type_index(ap->type);
  643. X    mvpts = basic_move_rate(np)*army_types[i].move_factor;
  644. X  } else if (is_mage(ap)) {
  645. X    mvpts = basic_move_rate(np)*MAGE_MOVE_FACTOR;
  646. X  } else {            /* must be a spirit */
  647. X    if ((i = spirit_type_index(ap->type)) < 0) {
  648. X      printf(
  649. X    "army_move_rate:  bad error, can't find army type <%s> for army %d.\n",
  650. X         ap->type, ap->id);
  651. X      printf("setting move rate to basic.\n");
  652. X      mvpts = basic_move_rate(np);
  653. X    } else {
  654. X      mvpts = basic_move_rate(np)*spirit_types[i].move_factor;
  655. X    }
  656. X  }
  657. X  return mvpts;
  658. X}
  659. X
  660. X  /* check if a army "id" belonging to owner "owner" is in "sp: */
  661. Xarmy_is_in_sector(sp, owner, id)
  662. X     Ssector *sp;
  663. X     int owner, id;        /* owner and id of army we are testing */
  664. X{
  665. X  struct armyid *alist = sp->alist;
  666. X
  667. X  while (alist != NULL) {
  668. X    if (alist->id == id && alist->owner == owner) {
  669. X      return 1;
  670. X    }
  671. X    alist = alist->next;
  672. X  }
  673. X  return 0;
  674. X}
  675. X
  676. X  /* reads in the NEW_ARMY_TYPE lines from the techno_levels
  677. X     file, and adds them to the user's list of available army
  678. X     types if the user has enough techno skill to deserve them.
  679. X     Some of the available army types also come from the "races"
  680. X     file, since they are race-specific.
  681. X   */
  682. Xget_avail_armies(up, skill)
  683. X     Suser *up;
  684. X     int skill;
  685. X{
  686. X  FILE *fp, *fopen();
  687. X  int level;
  688. X  char type[NAMELEN], name[NAMELEN], line[EXECLEN];
  689. X  char magfn [EXECLEN];
  690. X  int done = 0;
  691. X
  692. X  if ((fp = fopen(TECHNO_FILE, "r")) == NULL) {
  693. X    printf("could not open technology file %s\n", TECHNO_FILE);
  694. X    return -1;
  695. X  }
  696. X
  697. X  while (!done) {
  698. X    if (fgets(line, EXECLEN, fp) == NULL) {
  699. X      done = 1;
  700. X      break;
  701. X    }
  702. X    if (line[0] != '#') {
  703. X      sscanf(line, "%s%d", name, &level); /* a new tech entry */
  704. X      if (level <= skill) {
  705. X    do {
  706. X      fgets(line, EXECLEN, fp);
  707. X      if (strncmp(line+2,"NEW_ARMY_TYPE:",strlen("NEW_ARMY_TYPE:")) == 0) {
  708. X        add_army_type(up, line+2+strlen("NEW_ARMY_TYPE:"));
  709. X      }
  710. X    } while (strncmp(line, "end", strlen("end")) != 0);
  711. X      } else {            /* else, we are beyond our skill */
  712. X    done = 1;
  713. X    break;
  714. X      }
  715. X    }
  716. X  }
  717. X  fclose(fp);
  718. X
  719. X  /* Get the magic orders special armies in there too */
  720. X
  721. X  sprintf (magfn, "magic/mag_%s", up->np->mag_order);
  722. X  if ((fp = fopen (magfn, "r")) == NULL) {
  723. X    printf ("could not open magic file %s\n", magfn);
  724. X    return -1;
  725. X  }
  726. X
  727. X  done = 0;
  728. X  while (!done) {
  729. X    if (fgets (line, EXECLEN, fp) == NULL) {
  730. X      done = 1;
  731. X      break;
  732. X    }
  733. X    if (strncmp(line,"EXEC:NEW_ARMY_TYPE:",strlen("NEW_ARMY_TYPE:")) == 0) {
  734. X      add_army_type(up, line+strlen("EXEC:NEW_ARMY_TYPE:"));
  735. X    }
  736. X  }
  737. X
  738. X    /* get race-specific army types. for now there is
  739. X       only one army type for each race.
  740. X     */
  741. X  if ((fp = fopen(RACES_FILE, "r")) == NULL) {
  742. X    printf("could not open races file %s\n", RACES_FILE);
  743. X    return -1;
  744. X  }
  745. X  done = 0;
  746. X  while (!done) {
  747. X    if (fgets(line, EXECLEN, fp) == NULL) {
  748. X      done = 1;
  749. X      break;
  750. X    }
  751. X    if (strncmp(line, up->np->race.name, strlen(up->np->race.name)) == 0
  752. X    && strncmp(line+strlen(up->np->race.name), "_armies:",
  753. X           strlen("_armies:")) == 0) {
  754. X      /* got one!!  in the next line we assume there
  755. X     is just one army type for each race.
  756. X       */
  757. X      add_army_type(up, strchr(line, ':')+1);
  758. X    }
  759. X  }
  760. X  fclose(fp);
  761. X}
  762. X
  763. X  /* add an army type to the user's list */
  764. Xadd_army_type(up, type)
  765. X     Suser *up;
  766. X     char type[];
  767. X{
  768. X  Savail_army *aa = up->avail_armies, *prev_aa = up->avail_armies;
  769. X  int falready = 0;
  770. X  if (type[strlen(type)-1] == '\n') {
  771. X    type[strlen(type)-1] = '\0';
  772. X  }
  773. X  if (debug) {
  774. X    printf("adding army type: <%s>; type return\n", type);
  775. X    fflush(stdout);
  776. X    getchar();
  777. X  }
  778. X  if (aa == NULL) {        /* if list is empty... */
  779. X    up->avail_armies = (Savail_army *)malloc(sizeof(Savail_army));
  780. X    aa = up->avail_armies;
  781. X    strcpy(aa->type, type);
  782. X    aa->next = NULL;
  783. X    return;
  784. X  }
  785. X  while (aa != NULL) {        /* else, find end of list */
  786. X    if (!strcmp (aa->type, type)) { /* If army type already in there... */
  787. X      falready = 1;
  788. X      break;
  789. X    }
  790. X    prev_aa = aa;
  791. X    aa = aa->next;
  792. X  }
  793. X  if (!falready) {
  794. X    prev_aa->next = (Savail_army *)malloc(sizeof(Savail_army));
  795. X    strcpy(prev_aa->next->type, type);
  796. X    prev_aa->next->next = NULL;
  797. X  }
  798. X}
  799. X
  800. Xsect_n_armies(sp)
  801. X     Ssector *sp;
  802. X{
  803. X  int n = 0;
  804. X  struct armyid *alist = sp->alist;
  805. X
  806. X  while (alist != NULL) {
  807. X    ++n;
  808. X    alist = alist->next;
  809. X  }
  810. X  return n;
  811. X}
  812. X
  813. X  /* returns a pointer to the first mage found in a nation */
  814. XSarmy *get_first_mage(np)
  815. X     Snation *np;
  816. X{
  817. X  Sarmy *tmp_ap = np->armies;
  818. X
  819. X  while (tmp_ap) {
  820. X    if (is_mage(tmp_ap)) {
  821. X      return tmp_ap;
  822. X    }
  823. X    tmp_ap = tmp_ap->next;
  824. X  }
  825. X  return tmp_ap;
  826. X}
  827. X
  828. X  /* returns the id of the first mage belonging
  829. X     to a given nation, found in a given sector.
  830. X     returns -1 if there is no mage there.
  831. X   */
  832. Xfirst_sect_mage_id(np, sp)
  833. X     Snation *np;
  834. X     Ssector *sp;
  835. X{
  836. X  struct armyid *alist = sp->alist;
  837. X  Sarmy *ap;
  838. X
  839. X  while (alist) {
  840. X    ap = get_army(np, alist->id);
  841. X    if (is_mage(ap)) {
  842. X      return alist->id;
  843. X    }
  844. X    alist = alist->next;
  845. X  }
  846. X  return -1;
  847. X}
  848. X
  849. X  /* returns the apparent army type for a disguised army */
  850. Xget_apparent_type(ap, type)
  851. X     Sarmy *ap;
  852. X     char type[];
  853. X{
  854. X  char *pos;
  855. X
  856. X  if (is_disguised(ap)) {
  857. X    pos = (char *)strrchr(ap->name, '/');
  858. X    if (pos == NULL) {
  859. X      strcpy(type, ap->type);
  860. X    } else {
  861. X      strcpy(type, pos+1);    /* disguised type is stored in ap->name */
  862. X    }
  863. X  } else {
  864. X    strcpy(type, ap->type);    /* no disguise: army is itself */
  865. X  }
  866. X}
  867. X
  868. Xget_spell_pts_maint(ap)
  869. X  Sarmy *ap;
  870. X{
  871. X
  872. X  return (int)(((double)(ap->spell_pts_maint* ap->n_soldiers)/1000000.0)+0.49);
  873. X}
  874. END_OF_FILE
  875. if test 21209 -ne `wc -c <'armylib.c'`; then
  876.     echo shar: \"'armylib.c'\" unpacked with wrong size!
  877. fi
  878. # end of 'armylib.c'
  879. fi
  880. if test -f 'dom_tex.ab' -a "${1}" != "-c" ; then 
  881.   echo shar: Will not clobber existing file \"'dom_tex.ab'\"
  882. else
  883. echo shar: Extracting \"'dom_tex.ab'\" \(36711 characters\)
  884. sed "s/^X//" >'dom_tex.ab' <<'END_OF_FILE'
  885. X\section{Armies}
  886. XThe \emph{army types} table lists the various types of armies, their
  887. Xcosts, bonuses and move rates.
  888. X
  889. XEach army or spirit has a set of \strong{army flags} that affect its
  890. Xbehaviour.  Some are innate abilities of that army, others can be set
  891. Xwith magic spells.  The table lists each army's innate flags.  The
  892. Xflag abbreviations are:
  893. X\begin{itemize}
  894. X\item
  895. XF: Flying.  Any army with this flag can fly.  Move costs of sectors
  896. Xdon't depend on altitude, and thus are much lower.  These armies also
  897. Xignore PATROLs and INTERCEPTs unless the patrolling army has missiles.
  898. X\item
  899. XH:  Hidden.  Army with this flag is magically cloaked.
  900. X\item
  901. XV:  Vampire.  Army with this flag will possess some of the dead
  902. Xon the battlefield who will join ranks with this army.
  903. X\item
  904. XT:  Transport.  This army is being transported as cargo.
  905. X\item
  906. X\^:  Missiles.  This army has weapons that are thrown, such as arrows.
  907. XArchers are a type of army with mssles.  These units, when in PATROL
  908. Xor INTERCEPT status, will slow down flying units too (normally flying
  909. Xunits are not slowed down by PATROLs or INTERCEPTs, though they
  910. X\emph{do} get intercepted once they land).
  911. X\item
  912. XW:  Water.  An army with this flag must stay in water, or in the land
  913. Xsectors along a coast; even if it belongs to a land nation.  Compare
  914. Xwith the L flag below.
  915. X\item
  916. Xf: Front-line army.  Can be loaded/unloaded on/from a ship or caravan on
  917. Xland that does not belong to you.
  918. X\item
  919. Xk:  Kamikaze.  Armies with this flag will fight with very high bonus,
  920. Xbut will all die in any battle.
  921. X\item
  922. Xm:  Machine.  These armies are really machines, such as siege engines,
  923. Xwar carts and catapults.  They help ordinary armies in combat by
  924. Xdestroying fortifications and adding bonus to the armies.
  925. X\item
  926. Xd: Disguised.  You can disguise this army so that it will appear to be
  927. Xof another type to other players.  For example, to disguise a
  928. Xpoltergeist as an areal serpent you would change the armies
  929. X\emph{name} so that it ends with ``/areal_serpent''.
  930. X\item
  931. Xw:  Wizard.  This flag means that the army can summon spirits
  932. Xand cast spells, like a mage.
  933. X\item
  934. Xs:  Sorcerer.  This flag means that the army can excercise powers
  935. Xof sorcery (not implemented yet).
  936. X\item
  937. Xc:  Cargo.  This army can transport cargo, like ships and caravans.
  938. X\item
  939. XU:  Underground.  This army can burrow underground, and thus is not
  940. Xslowed down by patrols and intercepts.
  941. X\item
  942. XL:  Land.  This is the exact inverse of the W flag.  An army with
  943. Xthis flag must stay on land, or in water sectors along the coast; even
  944. Xif it belongs to a water nation.  Notice that if you have both the
  945. XL and W flags, you can move that army onto \emph{any} sector on the
  946. Xmap.
  947. X\item
  948. XI:  Inverse altitude.  This flag says that the army will have either
  949. Xthe L or the W flag, depending on the race of the army's owner.  If
  950. Xthe army belongs to a \emph{land} race, then it will have a W flag,
  951. Xand vice-versa.  This flag is used mostly for things like ships,
  952. Xwhich travel in the ``inverse'' altitude medium.
  953. X\item
  954. X*: Race specific.  These armies are available only to certain
  955. Xraces.
  956. X\end{itemize}
  957. X
  958. X\section{Army types}
  959. X
  960. XThe \emph{Army types} table below describes in detail all army types
  961. Xavailable for drafting.
  962. X
  963. X\begin{same}
  964. X\begin{table}[hbpt]
  965. X\caption{Army types table}
  966. X\begin{tabular}{ || l | l | r | r | r | r | r | r | r | r | l || }
  967. X\hline
  968. XType      &char&move&bonus&draft&draft&draft&maint&maint&maint&flags \\
  969. X          &    &rate&     &money&metal&jewel&money&metal&jewel&      \\
  970. X\hline
  971. XCavemen      &*& 0.5& -60 &  60 &   0 &   0 &  10 &   0 &   0 &\\
  972. XSpearmen     &/& 0.8& -10 &  80 &  20 &   0 &  10 &   0 &   0 &\\
  973. XInfantry     &i& 1.0&   0 & 100 &  30 &   0 &  10 &   0 &   0 &\\
  974. XCaravan      &C& 1.0&   0 &1000 &1000 &   0 & 200 &  40 &   0 &c\\
  975. XArchers      &)& 1.0&   5 & 100 &  40 &   0 &  10 &   0 &   0 &^\\
  976. XSwimmers     &o& 1.0& -60 & 150 &  50 &   0 &  15 &   5 &   0 &Wf\\
  977. XWalkers      &#& 1.0& -60 & 150 &  50 &   0 &  15 &   5 &   0 &L\\
  978. XPhalanx      &p& 1.0&  20 & 150 &  50 &   0 &  12 &   0 &   0 &\\
  979. XSailors      &~& 0.0& -10 & 150 &  50 &   0 &  15 &   0 &   0 &f\\
  980. XChariots     &0& 1.5&  10 & 180 &  60 &   0 &  14 &   5 &   0 &\\
  981. XCanoes       &u& 2.0& -80 &1000 &2000 &   0 & 200 & 100 &   0 &cI\\
  982. XLegion       &l& 1.0&  40 & 200 &  70 &   0 &  16 &   0 &   0 &\\
  983. XCavalry      &c& 2.0&  20 & 200 &  80 &   0 &  20 &   0 &   0 &\\
  984. XElite        &e& 1.3&  10 &   0 & 100 &   0 &   0 &  25 &   0 &\\
  985. XSailboats    &\}& 2.5& -50 &1500 &3000 &   0 & 300 & 150 &   0 &cI\\
  986. XMarines      &m& 1.0&  60 & 300 & 200 &   0 &  25 &   0 &   0 &f\\
  987. XWar_carts    &w& 1.0&  10 & 500 & 200 &   0 & 200 &  20 &   0 &m\\
  988. XGalleys      &g& 3.5& -20 &2000 &4000 &   0 & 400 & 200 &   0 &cI\\
  989. XBerzerkers   &b& 1.0&  50 &  30 &   0 &   0 &   5 &   0 &   0 &k\\
  990. XMerc         &M& 1.2&  60 & 200 &   0 &   0 & 200 &   0 &   0 &\\
  991. XCatapults    &@& 0.5&  20 & 800 & 400 &   0 & 300 &  30 &   0 &m\\
  992. XQuadriremes  &q& 4.5&   0 &3000 &5000 &   0 & 500 & 250 &   0 &cI\\
  993. XScuba_divers &S& 1.2& -30 & 300 & 200 &   0 &  25 &  25 &   0 &fI\\
  994. XKamikaze     &k& 1.5& 200 &  50 &  25 &   0 &  50 &   0 &   0 &k\\
  995. XWagons       &W& 1.5&   0 &1500 &1500 &   0 & 300 &  60 &   0 &c\\
  996. XCrossbowmen  &]& 1.0&   5 &  50 &  60 &   0 &   5 &   5 &   0 &^\\
  997. XNinja        &N& 3.0&  75 &2000 &   0 &2000 & 500 &   0 & 500 &H\\
  998. XMage         &!& 2.0&   0 &   0 &   0 &5000 &   0 &   0 &1000 &w\\
  999. XHunters      &h& 1.5& -10 &  50 &   0 &   0 &  10 &   0 &   0 &\\
  1000. XOrcs         &O& 1.0&   0 &  60 &  30 &   0 &  10 &   0 &   0 &\\
  1001. XHarpies      &y& 1.0&  10 & 100 &  30 &   0 &  10 &   0 &   0 &F\\
  1002. XHobbits      &H& 1.0&   0 & 100 &  30 &   0 &  10 &   0 &   0 &H\\
  1003. XOgres        &G& 1.0&  50 & 100 &  30 &   0 &  10 &   0 &   0 &\\
  1004. X\hline
  1005. X\end{tabular}
  1006. X\end{table}
  1007. X\end{same}
  1008. X
  1009. X\section{Spirit types}
  1010. XThe \emph{Spirit types} tables below list the spirit types available in
  1011. Xdominion.  Summoning costs (in spell points) are not listed, because
  1012. Xthey can be different if a spirit is available to more than one magic
  1013. Xorder.  The flags for each spirit are described in the section on
  1014. X\emph{Armies} above.
  1015. X
  1016. X% Made with Titus Brown's mktables
  1017. X
  1018. X\begin{same}
  1019. X\begin{table}[hbpt]
  1020. X\caption{Spirit types table (Diana)}
  1021. X\begin{center}
  1022. X\begin{tabular}{ || l | l | l | l | l | l || }
  1023. X\hline
  1024. XName            & Size & Move & Bonus &Spell&Flags\\
  1025. X                &      & rate &       &Pts  &\\
  1026. X\hline
  1027. Xwolf            &   30 & 1.5 &   0 &  1 &\\
  1028. Xswarm           &   50 & 1.3 & 300 &  3 &Fk\\
  1029. Xmole            &   70 & 1.0 &   0 &  3 &UL\\
  1030. Xsnake           &  100 & 0.8 &   0 &  3 &\\
  1031. Xshark           &  100 & 1.5 &  10 &  3 &W\\
  1032. Xhawk            &  200 & 2.0 &   0 &  5 &F\\
  1033. Xbear            &  300 & 1.4 &   0 &  5 &\\
  1034. Xlion            &  500 & 1.5 &   0 &  6 &L\\
  1035. Xterrasque       & 2000 & 0.5 &   0 & 13 &L\\
  1036. X\hline
  1037. X\end{tabular}
  1038. X\end{center}
  1039. X\end{table}
  1040. X\end{same}
  1041. X\begin{same}
  1042. X\begin{table}[hbpt]
  1043. X\caption{Spirit types table (Necromancy)}
  1044. X\begin{center}
  1045. X\begin{tabular}{ || l | l | l | l | l | l || }
  1046. X\hline
  1047. XName            & Size & Move & Bonus &Spell&Flags\\
  1048. X                &      & rate &       &Pts  &\\
  1049. X\hline
  1050. Xghost_ship      &    1 & 2.5 &   0 &  1 &HcI\\
  1051. Xskeleton        &   40 & 0.8 &   0 &  1 &\\
  1052. Xwraith          &   30 & 1.5 &   0 &  2 &H\\
  1053. Xzombie          &   70 & 0.8 &   0 &  3 &V\\
  1054. Xpoltergeist     &  150 & 0.1 &   0 &  3 &d\\
  1055. Xmummy           &   80 & 0.8 &  30 &  3 &U\\
  1056. Xghost_ship      &    1 & 2.5 &   0 &  5 &HcI\\
  1057. Xlacedon         &  500 & 1.0 &   0 &  7 &W\\
  1058. Xlich            & 2000 & 2.0 & -20 & 14 &w\\
  1059. Xvampire         & 1500 & 0.8 &  30 & 15 &V\\
  1060. X\hline
  1061. X\end{tabular}
  1062. X\end{center}
  1063. X\end{table}
  1064. X\end{same}
  1065. X\begin{same}
  1066. X\begin{table}[hbpt]
  1067. X\caption{Spirit types table (Yavanna)}
  1068. X\begin{center}
  1069. X\begin{tabular}{ || l | l | l | l | l | l || }
  1070. X\hline
  1071. XName            & Size & Move & Bonus &Spell&Flags\\
  1072. X                &      & rate &       &Pts  &\\
  1073. X\hline
  1074. Xdryad           &   30 & 1.0 &   0 &  1 &\\
  1075. Xtree_spirit     &   50 & 1.5 &   0 &  2 &F\\
  1076. Xwood_beast      &   70 & 1.0 &   0 &  2 &\\
  1077. Xmagic_trees     &  150 & 1.0 &   0 &  3 &\\
  1078. Xyellow_musk     &  200 & 0.7 &   0 &  4 &V\\
  1079. Xent             &  250 & 0.8 &   0 &  4 &\\
  1080. Xswamp_beast     &  500 & 1.0 &  10 &  6 &W\\
  1081. Xshambling_mound & 1200 & 0.8 &  10 & 10 &\\
  1082. Xforest          & 2000 & 0.7 &   0 & 14 &\\
  1083. X\hline
  1084. X\end{tabular}
  1085. X\end{center}
  1086. X\end{table}
  1087. X\end{same}
  1088. X\begin{same}
  1089. X\begin{table}[hbpt]
  1090. X\caption{Spirit types table (Demonology)}
  1091. X\begin{center}
  1092. X\begin{tabular}{ || l | l | l | l | l | l || }
  1093. X\hline
  1094. XName            & Size & Move & Bonus &Spell&Flags\\
  1095. X                &      & rate &       &Pts  &\\
  1096. X\hline
  1097. Ximp             &   30 & 2.0 &   0 &  2 &\\
  1098. Xlesser_demon    &   70 & 1.7 &   0 &  3 &\\
  1099. Xhellhound       &  150 & 1.7 &   0 &  4 &\\
  1100. Xtormented_soul  &  300 & 1.2 & 100 &  5 &k\\
  1101. Xdevil           &  250 & 1.0 &   0 &  4 &\\
  1102. Xmajor_demon     &  500 & 2.0 &   0 &  8 &F\\
  1103. Xbalrog          & 1500 & 1.5 &  50 & 15 &\\
  1104. Xdemon_lord      & 2500 & 2.0 &   0 & 19 &w\\
  1105. X\hline
  1106. X\end{tabular}
  1107. X\end{center}
  1108. X\end{table}
  1109. X\end{same}
  1110. X\begin{same}
  1111. X\begin{table}[hbpt]
  1112. X\caption{Spirit types table (Monsters)}
  1113. X\begin{center}
  1114. X\begin{tabular}{ || l | l | l | l | l | l || }
  1115. X\hline
  1116. XName            & Size & Move & Bonus &Spell&Flags\\
  1117. X                &      & rate &       &Pts  &\\
  1118. X\hline
  1119. Xspider          &   30 & 0.8 &   0 &  1 &\\
  1120. Xyeti            &   70 & 1.0 &   0 &  2 &L\\
  1121. Xettin           &  120 & 1.5 &   0 &  3 &\\
  1122. Xcyclops         &  150 & 0.8 &   0 &  3 &\\
  1123. Xhydra           &  250 & 1.2 &   0 &  4 &\\
  1124. Xcrimson_death   &  500 & 2.0 &   0 &  8 &F\\
  1125. Xsea_dragon      & 1000 & 1.2 &   0 &  9 &W\\
  1126. Xgreen_dragon    & 1500 & 2.0 &   0 & 11 &L\\
  1127. Xred_dragon      & 2500 & 1.5 &   0 & 17 &F\\
  1128. Xgold_dragon     & 3500 & 2.0 &   0 & 24 &Fw\\
  1129. X\hline
  1130. X\end{tabular}
  1131. X\end{center}
  1132. X\end{table}
  1133. X\end{same}
  1134. X\begin{same}
  1135. X\begin{table}[hbpt]
  1136. X\caption{Spirit types table (Neptune)}
  1137. X\begin{center}
  1138. X\begin{tabular}{ || l | l | l | l | l | l || }
  1139. X\hline
  1140. XName            & Size & Move & Bonus &Spell&Flags\\
  1141. X                &      & rate &       &Pts  &\\
  1142. X\hline
  1143. Xliving_ship     &    4 & 2.5 &   0 &  1 &cI\\
  1144. Xpirana          &   30 & 1.2 &   0 &  1 &W\\
  1145. Xwater_nymph     &   50 & 1.2 &   0 &  2 &W\\
  1146. Xwhale           &   80 & 1.0 &   0 &  2 &W\\
  1147. Xshark           &  100 & 1.5 &  10 &  3 &W\\
  1148. Xsea_serpent     &  150 & 1.2 &   0 &  4 &WL\\
  1149. Xcraken          &  250 & 1.0 &   0 &  4 &W\\
  1150. Xsea_giant       &  500 & 0.8 &   0 &  5 &W\\
  1151. Xwater_elemental & 2000 & 2.0 &   0 & 15 &W\\
  1152. Xleviathan       & 3000 & 0.9 &  10 & 18 &W\\
  1153. X\hline
  1154. X\end{tabular}
  1155. X\end{center}
  1156. X\end{table}
  1157. X\end{same}
  1158. X\begin{same}
  1159. X\begin{table}[hbpt]
  1160. X\caption{Spirit types table (Aule)}
  1161. X\begin{center}
  1162. X\begin{tabular}{ || l | l | l | l | l | l || }
  1163. X\hline
  1164. XName            & Size & Move & Bonus &Spell&Flags\\
  1165. X                &      & rate &       &Pts  &\\
  1166. X\hline
  1167. Xgargoyle        &   30 & 1.0 &   0 &  2 &F\\
  1168. Xmole            &   70 & 1.0 &   0 &  3 &UL\\
  1169. Xdust_devil      &  150 & 1.0 &   0 &  4 &FL\\
  1170. Xumber_hulk      &  250 & 1.7 &   0 &  5 &UL\\
  1171. Xstone_giant     &  500 & 0.7 &   0 &  6 &\\
  1172. Xearth_elemental & 2000 & 2.0 &   0 & 16 &U\\
  1173. Xmountain        & 3000 & 0.3 &  60 & 23 &\\
  1174. X\hline
  1175. X\end{tabular}
  1176. X\end{center}
  1177. X\end{table}
  1178. X\end{same}
  1179. X\begin{same}
  1180. X\begin{table}[hbpt]
  1181. X\caption{Spirit types table (Chess)}
  1182. X\begin{center}
  1183. X\begin{tabular}{ || l | l | l | l | l | l || }
  1184. X\hline
  1185. XName            & Size & Move & Bonus &Spell&Flags\\
  1186. X                &      & rate &       &Pts  &\\
  1187. X\hline
  1188. Xpawn            &   30 & 0.5 &   0 &  1 &\\
  1189. Xknight          &  120 & 1.0 &  10 &  4 &H\\
  1190. Xbishop          &  150 & 2.0 &   0 &  5 &F\\
  1191. Xrook            &  250 & 3.0 &  30 &  6 &\\
  1192. Xqueen           &  500 & 4.0 &  50 &  9 &\\
  1193. Xking            & 1000 & 0.4 &   0 &  8 &\\
  1194. Xmaster          & 2000 & 1.0 &  10 & 11 &\\
  1195. Xgrandmaster     & 3000 & 1.3 &  20 & 14 &w\\
  1196. X\hline
  1197. X\end{tabular}
  1198. X\end{center}
  1199. X\end{table}
  1200. X\end{same}
  1201. X\begin{same}
  1202. X\begin{table}[hbpt]
  1203. X\caption{Spirit types table (Inferno)}
  1204. X\begin{center}
  1205. X\begin{tabular}{ || l | l | l | l | l | l || }
  1206. X\hline
  1207. XName            & Size & Move & Bonus &Spell&Flags\\
  1208. X                &      & rate &       &Pts  &\\
  1209. X\hline
  1210. Xefreet          &   70 & 1.5 &   0 &  2 &L\\
  1211. Xphoenix         &   30 & 2.0 &   0 &  3 &FL\\
  1212. Xfire_giant      &  250 & 1.0 &   0 &  4 &L\\
  1213. Xfire_drake      &  500 & 1.5 &   0 &  6 &\\
  1214. Xlava_beast      & 1000 & 1.0 &   0 & 10 &U\\
  1215. Xfire_elemental  & 2000 & 2.0 &   0 & 15 &L\\
  1216. Xconflagration   & 3000 & 1.5 &   0 & 18 &L\\
  1217. X\hline
  1218. X\end{tabular}
  1219. X\end{center}
  1220. X\end{table}
  1221. X\end{same}
  1222. X\begin{same}
  1223. X\begin{table}[hbpt]
  1224. X\caption{Spirit types table (Avian)}
  1225. X\begin{center}
  1226. X\begin{tabular}{ || l | l | l | l | l | l || }
  1227. X\hline
  1228. XName            & Size & Move & Bonus &Spell&Flags\\
  1229. X                &      & rate &       &Pts  &\\
  1230. X\hline
  1231. Xflying_carpet   &    1 & 1.5 &   0 &  1 &Fc\\
  1232. Xroc             &   30 & 1.5 &   0 &  1 &F\\
  1233. Xeagle           &   70 & 1.5 &   0 &  2 &F\\
  1234. Xcloud_giant     &  150 & 1.0 &   0 &  3 &F\\
  1235. Xwyvern          &  250 & 1.0 &   0 &  4 &F\\
  1236. Xareal_serpent   &  500 & 1.8 &   0 &  7 &F\\
  1237. Xair_elemental   & 2000 & 2.0 &   0 & 15 &F\\
  1238. Xtempest         & 3000 & 2.0 &   0 & 18 &F\\
  1239. X\hline
  1240. X\end{tabular}
  1241. X\end{center}
  1242. X\end{table}
  1243. X\end{same}
  1244. X\begin{same}
  1245. X\begin{table}[hbpt]
  1246. X\caption{Spirit types table (Unity)}
  1247. X\begin{center}
  1248. X\begin{tabular}{ || l | l | l | l | l | l || }
  1249. X\hline
  1250. XName            & Size & Move & Bonus &Spell&Flags\\
  1251. X                &      & rate &       &Pts  &\\
  1252. X\hline
  1253. Xnaga            &   30 & 1.0 &   0 &  1 &\\
  1254. Xcentaur         &   70 & 2.0 &   0 &  3 &\\
  1255. Xwerewolf        &  100 & 1.5 &   0 &  4 &Vd\\
  1256. Xminotaur        &  150 & 1.0 &   0 &  3 &L\\
  1257. Xowl_bear        &  250 & 1.0 &   0 &  4 &\\
  1258. Xgryphon         &  350 & 2.0 &   0 &  7 &F\\
  1259. Xsea_lion        &  600 & 1.5 &   0 &  7 &W\\
  1260. Xchimera         & 1000 & 1.5 &   0 & 10 &F\\
  1261. Xsphynx          & 2000 & 0.8 &   0 & 17 &Fw\\
  1262. X\hline
  1263. X\end{tabular}
  1264. X\end{center}
  1265. X\end{table}
  1266. X\end{same}
  1267. X\begin{same}
  1268. X\begin{table}[hbpt]
  1269. X\caption{Spirit types table (Time)}
  1270. X\begin{center}
  1271. X\begin{tabular}{ || l | l | l | l | l | l || }
  1272. X\hline
  1273. XName            & Size & Move & Bonus &Spell&Flags\\
  1274. X                &      & rate &       &Pts  &\\
  1275. X\hline
  1276. Xdiplodocus      &   30 & 1.3 &   0 &  1 &\\
  1277. Xbrontosaurus    &   70 & 0.7 &   0 &  2 &\\
  1278. Xpleisiosaurus   &   50 & 1.5 &   0 &  2 &W\\
  1279. Xpterodactyl     &  150 & 1.5 &   0 &  4 &F\\
  1280. Xstegosaurus     &  250 & 1.0 &   0 &  4 &\\
  1281. Xtriceratops     &  500 & 0.8 &   0 &  6 &L\\
  1282. Xtyrannosaurus   & 1500 & 1.5 &   0 & 12 &\\
  1283. Xbrachiosaurus   & 3000 & 0.5 &   0 & 18 &WL\\
  1284. X\hline
  1285. X\end{tabular}
  1286. X\end{center}
  1287. X\end{table}
  1288. X\end{same}
  1289. X\begin{same}
  1290. X\begin{table}[hbpt]
  1291. X\caption{Spirit types table (Insects)}
  1292. X\begin{center}
  1293. X\begin{tabular}{ || l | l | l | l | l | l || }
  1294. X\hline
  1295. XName            & Size & Move & Bonus &Spell&Flags\\
  1296. X                &      & rate &       &Pts  &\\
  1297. X\hline
  1298. Xant             &   30 & 1.0 &   0 &  2 &UL\\
  1299. Xswarm           &   50 & 1.3 & 300 &  3 &Fk\\
  1300. Xflying_carpet   &    1 & 1.5 &   0 &  3 &Fc\\
  1301. Xmoth            &  150 & 1.5 &   0 &  4 &F\\
  1302. Xbee             &  250 & 1.2 &  30 &  6 &F\\
  1303. Xgrasshopper     &  350 & 1.0 &   0 &  6 &HL\\
  1304. Xmosquito        &  500 & 0.5 &   0 &  6 &FV\\
  1305. Xinfestation     &  600 & 0.0 &  50 &  6 &\\
  1306. Xroach           & 1000 & 0.8 &  20 & 10 &\\
  1307. Xlobster         & 1500 & 1.0 &   0 & 12 &W\\
  1308. Xcreeping_doom   & 2500 & 0.8 &  20 & 18 &\\
  1309. X\hline
  1310. X\end{tabular}
  1311. X\end{center}
  1312. X\end{table}
  1313. X\end{same}
  1314. X
  1315. X
  1316. X
  1317. X\section{Army maintainance costs}
  1318. XEach army has a maintainance cost which is given by the salaries of
  1319. Xthe soldiers plus a fixed per-army overhead of 2000 sk.
  1320. X
  1321. X\section{Movement points}
  1322. XYour armies can move only so much before they must stop and rest.  How
  1323. Xmuch they can move is expressed in the army's \strong{move points}, and
  1324. Xthe \strong{move cost} of the sectors they must cross.
  1325. X
  1326. XFor example, if an army has 13 move points, and it goes through
  1327. Xsectors with move costs of 4, 3, 2, 2 and 3, it will not have enough
  1328. Xmove points left for the last sector (it will have 2 move points left,
  1329. Xand that last sector has a move cost of 3).
  1330. X
  1331. X\section{Army statuses}
  1332. X\begin{itemize}
  1333. X\item
  1334. X\emph{[i]ntercept} This army will intercept a nearby army.  Intercept
  1335. Xraises the move cost in the area, and then (over the update) the army
  1336. Xwill move to any adjacent square where an enemy army might be located.
  1337. XThis is quite powerful, since you don't have to defend each square;
  1338. Xbut you should be careful because intercepts can be decoyed.
  1339. X
  1340. XIntercept will also move the army to intercept a flying enemy army,
  1341. Xonce it has landed.  But the increased move cost will not apply to flying
  1342. Xenemy armies \emph{unless} the intercepting army wields missiles (for
  1343. Xexample, archers).  See the description of army flags.
  1344. X
  1345. X\item
  1346. X\emph{[p]atrol} This army will patrol the area, raising the move cost
  1347. Xfor enemy armies.  If the enemy army is flying, the move cost will
  1348. Xonly be raised if the patrolling army has missiles (for example, archers).
  1349. X
  1350. X\item
  1351. X\emph{[g]garrison} This army garrisons the sector, getting an
  1352. Xextra 10 bonus on your own land.  If the sector belongs to a nation at
  1353. XTREATY with you, then you also get bonus 10.  If it is ALLIED land,
  1354. Xyou get a bonus of 5.
  1355. X\end{itemize}
  1356. X
  1357. X\comment \section{Tactics}
  1358. X
  1359. X\chapter{Detailed description of commands}
  1360. X
  1361. X\section{Options menu}
  1362. XYou can set some options that affect the way the game appears to you.
  1363. XFor now the only ones implemented are:
  1364. X\begin{itemize}
  1365. X\item
  1366. X\emph{e[x]pert} mode.  This toggles expert mode on and off.  Expert mode
  1367. Xallows an experience player to do things much more quickly by showing
  1368. Xmost menus on the status line, instead of drawing big windows.
  1369. X\item
  1370. X\emph{[f]orwarding mail}.  This allows a you to get mail forwarded
  1371. Xto your account instead of reading mail inside dominion.
  1372. X\item
  1373. X\emph{[c]ivilian movement}.  This toggles between the three available
  1374. Xtypes of migration that your government allows: \strong{Free},
  1375. X\strong{Restricted} and \strong{None}.
  1376. X\item
  1377. X\emph{[m]ail program}.  This allows you to choose a mail program with
  1378. Xwhich to read your dominion mail.  Examples are ``elm'', ``mush'', ``Mail'',
  1379. X``mailx''.  If you type nothing, you will get the builtin bare-bones mail
  1380. Xprogram.
  1381. X\end{itemize}
  1382. X
  1383. X\section{Display options}
  1384. XThe default way of viewing the screen shows the designation of your
  1385. Xown sectors, altitude markings for unowned sectors, and nation marks
  1386. Xfor other nations' sectors.  But there are a lot of different ways of
  1387. Xlooking at the map, and of highlighting sectors on it.  The [d]isplay
  1388. Xcommand will list all these for you.
  1389. X
  1390. XIf you are a land race, water sectors are usually marked as a '~', but
  1391. Xthis can be toggled with the \emph{[W]ater toggle} option: if you
  1392. Xchoose this mode, then land sectors will appear as a '.', and water
  1393. Xsectors will be shown in detail.
  1394. X
  1395. X\section{Movement}
  1396. XThe movement commands are shown in the diagram at the beginning of this
  1397. Xmanual.  They are quite straightforward, and only behave differently
  1398. Xwhen you reach the edge of the screen.  In this case, the screen is
  1399. Xshifted over, so your cursor does not go off.  The screen can be
  1400. Xforcibly centered around the cursor using the [d]isplay command [C].
  1401. X
  1402. XYou can also jump directly to a sector with the [p] command.  You will
  1403. Xbe prompted for the coordinates.  You can jump back to your capital
  1404. Xwith the [P] command.
  1405. X
  1406. X\section{Reports}
  1407. XHere is a detailed description of each report in dominion. To acess
  1408. Xthem type [r] and then the letter of the report you want.  You can
  1409. Xswitch from one report to another by hitting the key that corresponds
  1410. Xto the report you want.  The reports you can switch to ae listed at
  1411. Xthe bottom of the report you are looking at.
  1412. X
  1413. X\subsection{Information report}
  1414. XTo access this report you type [r] followed by [i].
  1415. X
  1416. XThis report gives complete information about your nation.  This is a
  1417. Xdescription of each parameter printed.
  1418. X
  1419. X\begin{itemize}
  1420. X\item
  1421. XNation name: the name of your nation (wow!!).
  1422. X\item
  1423. XNation id: your nation id, used mostly internally.
  1424. X\item
  1425. XLeader: the name of your nation's leader.  
  1426. X\item
  1427. XCapital: the location of your capital.  This is always (0,0), since
  1428. Xcoordinates are given relative to your capital, unless you are the game
  1429. Xmaster.
  1430. X\item
  1431. XRace: the race you belong to.
  1432. X\item
  1433. XMark: your nation mark.  Other nations will see this mark on their screen,
  1434. Xand you will too if you display by nation mark.
  1435. X\item
  1436. XSecotors: The number of sectors owned by your nation.
  1437. X\item
  1438. XTreasury, Jewels, Metal, Food: Your current wealth.
  1439. X\item
  1440. XBirthrate: The percentage by which your population increases every thon.
  1441. X\item
  1442. XMortality: The percentage of people who die in your nation every thon.
  1443. X\item
  1444. XInteligence:
  1445. X\item
  1446. XMagic Apt:
  1447. X\item
  1448. XSpeed: Your move rate is proportional to this.
  1449. X\item
  1450. XInitiated to the magical order:  This says what magic order you belong to.
  1451. X\item 
  1452. XMagic Skill: How proficient you are in your use of magic.
  1453. X\item
  1454. XSpell points: Tells you how many you have and how many are spent for 
  1455. Xmaintenance of spirits.
  1456. X\item
  1457. XTechnology skill: How technologically advanced your country is.
  1458. X\item
  1459. XFarming skill:  The higher this is the more food you produce per farmer.
  1460. X\item
  1461. XMining skill: This is your ability to 'harvest' jewels and metal.
  1462. X\item
  1463. XSpy skill: This expresses how good your intelligence service is.
  1464. X\item
  1465. XSecrecy: This makes you immune to espionage by other nations.
  1466. X\item
  1467. XCivilians: This is the number of civilans in your country.
  1468. X\item
  1469. XSoldiers: This is the number of soldiers in your country.  This
  1470. Xincludes spirit forces, mages, caravans, ships...
  1471. X\item
  1472. XArmies: This is the number of armies you have including spirit units
  1473. Xand mages.
  1474. X\item
  1475. XAttack bonus, Defense bonus: If you add this percentage to the number
  1476. Xof soldiers in the army, you get the effective force your army fights
  1477. Xwith.
  1478. X\item
  1479. XMove points:  This is how far your army can move each turn.  
  1480. X\end{itemize}
  1481. X
  1482. XFrom here you can change your password [p] or change your leader name
  1483. X[l].  The key letter [t] allows you to change your nation to an NPC,
  1484. Xand allows you to choose if your nation should receive update mail
  1485. Xwhile it is being run by the computer.  Also listed are the key
  1486. Xletters for other reports you can view.
  1487. X
  1488. XChanging your nation to an NPC is a risky move: the computer will play
  1489. Xa good game, but it will not honor your long-term plans.
  1490. X
  1491. X\subsection{Budget report}
  1492. XTo access this report you type [r] followed by [b].  
  1493. X
  1494. XThe budget report gives you detailed breakdown of how you are spending your 
  1495. Xmoney and your natural resources.  
  1496. X
  1497. XWithin the budget report you can adjust what percent of your money
  1498. Xand/or natural resources you are spending on technology, the study of
  1499. Xmagic and reconnaisance. You also can adjust your tax rate from this
  1500. Xmenu.
  1501. X
  1502. XThis screen also shows how much money you are spending on military
  1503. Xmaintenance and other costs inccurred. The only way military
  1504. Xmaintenance can be lowered is to disband armies. Other costs include
  1505. Xbut are not limited to the cost of drafting an army and the cost of
  1506. Xredesignating sectors.
  1507. X
  1508. XThe Metal and Jewels Breakdown, aside from listing the amounts spent
  1509. Xon research and development, show how much of each natural resource is
  1510. Xspent.  Other metal expenses consist of but are not limited to the
  1511. Xconstruction of citites and the drafting of armies. Other Jewels are
  1512. Xused as a maintenance fee for mages.
  1513. X
  1514. XThe commands within this screen are:
  1515. X
  1516. X\begin{itemize}
  1517. X\item
  1518. X{[t]} which adjusts your tax rate
  1519. X\item
  1520. X{[c]} which adjusts your charity rate
  1521. X\item
  1522. X{[T]} which is technology resarch and development, has a
  1523. Xsubmenu that consists of the choices metal and money.
  1524. X\begin{itemize}
  1525. X\item
  1526. X   {[m]} sets the amount of metal you wish to use in R\&D 
  1527. X\item
  1528. X   {[M]} sets the amount of money
  1529. X\end{itemize}
  1530. X\item
  1531. X{[M]} puts you into the sub-section for Magic R\&D where
  1532. X\begin{itemize}
  1533. X\item
  1534. X   {[j]} changes the amount of jewels you use for Magic R\&D
  1535. X\item
  1536. X   {[M]} adjusts the amount of money you spend for Magic R\&D
  1537. X\end{itemize}
  1538. X\item
  1539. X{[S]} this invests money in your \emph{spy department}
  1540. X\item
  1541. X{[s]} this allows you to spend money/metal/jewels from your storage.
  1542. XThe way you can spend it is similar to how you spend your revenue, but
  1543. Xit is a once-only expense, and is cleared after each update.
  1544. X\end{itemize}
  1545. X
  1546. X\emph{A NOTE OF CAUTION:}
  1547. X
  1548. XWatch how much money you are spending carefully, You might be
  1549. Xbankrupting your nation without realizing it!  You to can run your
  1550. Xnation at a deficit\dots{} but be warned:  if you have no money, you
  1551. Xcanot draft, construct or redesignate.  If someone attacks you and
  1552. Xyou need armies quickly, you will be in trouble.
  1553. X
  1554. XYou might also want to keep you taxes on the low side\dots{} the
  1555. Xhigher the taxes, the less the people produce.  In fact, beyond a
  1556. Xcertain tax rate, you will not even get much tax revenue out of your
  1557. Xpeople because they will produce so little, and they will want to
  1558. Xcheat on taxes.
  1559. X
  1560. X\subsection{Production report}
  1561. XThe production report tells you how many people are employed and
  1562. Xunemployed in each area of your economy.  It also shows you the
  1563. Xaverage productivity of each employee.  The ``service sector''
  1564. Xmeans all people who are not employed in productive endevours (mining
  1565. Xand farming).
  1566. X
  1567. X\subsection{Nations report}
  1568. XThe nations report, which can be seen by typing [r] followed by [n],
  1569. Xgives you a report on all the nations.
  1570. X
  1571. XYou are told the size of the world and how many nations are in it. It also 
  1572. Xgives a detail of each nation that lists the nation id, nation name, nation 
  1573. Xmark, leader name, and race.
  1574. X
  1575. XWithin this report is also the spy option, [s].  You will then be
  1576. Xprompted for a nation id, and then you will be presented with a screen
  1577. Xthat allows you to bribe officials in that nation for information.
  1578. XHere is how it works:
  1579. X
  1580. XYou pay a certain amount of jewels in bribes to another nation.  You
  1581. Xcan get information about their [p]opulation, [e]conomy, [m]ilitary,
  1582. Xma[g]ic, [t]echnology and [C]apital location.  You can also steal
  1583. X[T]echnology (not yet implemented).
  1584. X
  1585. XThe success of your spying will depend on your spy level, your
  1586. Xopponent's secrecy, your and your opponent's stealth, and the amount
  1587. Xof jewels you spend in bribes.  You will receive an answer which is
  1588. Xnot exactly accurate, but gets better if you spend more, or have a
  1589. Xbetter spy value, and so on.
  1590. X
  1591. X\subsection{Diplomacy report}
  1592. XDiplomacy with other nations is extremely important.  You should set a
  1593. Xstatus with each nation you have met.  This is done in the
  1594. X\strong{diplomacy} report.
  1595. X
  1596. XYou cannot make a great change in diplomacy status in one turn: you
  1597. Xcan at most jump two levels of diplomacy in one turn, like going from
  1598. XALLIED to RECOGNIZED.  The next turn you can go from RECOGNIZED to
  1599. XUNRECOGNIZED, and the turn after that you can go do WAR.  This ensures
  1600. Xthat any nation will see the diplomatic situation deteriorate
  1601. Xprogressively before war is declared on them.
  1602. X
  1603. X\section{Wizardry}
  1604. XType [W] to enter the wizardry menu.
  1605. X
  1606. XThe wizardry command allows you to do \strong{initiate a mage},
  1607. X\strong{cast a spell} and \strong{summon a spirit}.  Spells are cast and
  1608. Xspirits are summoned in a given sector, and you must have a mage in
  1609. Xthat sector to do so.
  1610. X
  1611. XHit the [i] command to initiate a mage.  Mages move twice as fast as
  1612. Xnormal armies, so they can reach a battlefield quickly to do their
  1613. Xwork.
  1614. X
  1615. XIf you have a mage already selected (see the [a]rmy menu), then you
  1616. Xcan use use [c] to [c]ast a spell or [s] to [s]ummon a spirit.  The
  1617. Xspell is cast on an object (army, or sector, or whatever, according to
  1618. Xwhich spell it is) in the same sector as the mage, and the spirit is
  1619. Xcreated in the same sector as the mage.  Spirits must be summoned in
  1620. Xyour own land.
  1621. X
  1622. XMost spells will hang around until their duration is over, or until
  1623. Xyou delete them, or until the army to which they apply does not exist
  1624. Xany more.  You can see which spells you have hanging with the [h]
  1625. Xcommand, and that gives you the option of deleting hanging spells too.
  1626. XSpirits last until they are killed, and behave just like armies.
  1627. X
  1628. X\subsection{Mages}
  1629. XMages are necessary for casting spells and summoning spirits.  They
  1630. Xmust be initiated inside a capital, city, temple or university.  They
  1631. Xcost 5000 jewels to initiate, and 1000 jewels in maintainance each
  1632. Xthon.
  1633. X
  1634. XMages are moved around as if they were an army, and have twice the
  1635. Xnation's basic move rate.
  1636. X
  1637. XSome spirits have the [w]izardry flag, and they behave like mages.
  1638. X
  1639. X\subsection{Spells}
  1640. XHere is a description of several spells available in dominion.  Keep
  1641. Xin mind that some spells may be available to several orders, and their
  1642. Xcost and duration will be different for the different orders.  For
  1643. Xexample, both Neptune and Time have the water_walk spell, but for
  1644. Xneptune it costs only 1 spell point, whereas for Time it costs 2.
  1645. X
  1646. XBoth the cost and the duration of the spell are indicated when you
  1647. Xlist your available spells.  The cost is in spell points.
  1648. X
  1649. XIf the spell is applied to a sector, then that is all you spend.
  1650. X
  1651. XA spell applied to an army will usually set a special flag for that
  1652. Xarmy, and will cost a given amount per each 100 men.  Army flags are
  1653. Xdescribed in the section on armies.
  1654. X
  1655. XNotice that some armies and spirits come into the world with some of
  1656. Xthese magical properties already set, so you do not need to set them
  1657. Xwith a spell.
  1658. X
  1659. X\begin{itemize}
  1660. X\item \strong{caltitude}
  1661. XThis spell allows you to raise or lower the altitude of a sector.
  1662. XThis means that you could plunge it into the sea, or you could place
  1663. Xit on a mountain peak.
  1664. X\item \strong{fertility}
  1665. XThis spell allows you to raise or lower the soil fertility of a
  1666. Xsector.
  1667. X\item \strong{cmetal}
  1668. XThis spell allows you to raise or lower the metal productivity of a
  1669. Xsector.
  1670. X\item \strong{cjewels}
  1671. XThis spell allows you to raise or lower the jewel productivity of a
  1672. Xsector.
  1673. X\item \strong{fireburst}
  1674. XThis spell devastates the chosen sector, redesignates it to
  1675. X\emph{none}, sets the soil productivity to zero, and in the future
  1676. Xshould do other nasty stuff.
  1677. X\item \strong{inferno}
  1678. XThis spell will kill all population in the sector, and make it
  1679. Xcompletely impenetrable to any army for its duration.  You can only
  1680. Xcast \emph{inferno} on your own sectors.  It is a very effective
  1681. Xway to block enemy armies.
  1682. X\item \strong{hide_sector}
  1683. XThis spell completely hides the current sector from any other nation.
  1684. XThe sector will just appear as a blank spot on the map.
  1685. X\item \strong{hide_army}
  1686. XThis spell sets the HIDDEN flag on an army, so that others cannot see
  1687. Xthis army.
  1688. X\comment  All they will see is a highlighted spot on their display
  1689. X\comment if they highlight by armies, but when they try to examine the sector,
  1690. X\comment they will just see a mist and have no idea whose armies they are, nor
  1691. X\comment how many men are in it.
  1692. X\item \strong{fly_army}
  1693. XThis sets the FLYING flag on an army.  The army will be able to fly.
  1694. X\item \strong{vampire_army}
  1695. XThis sets the VAMPIRE flag on an army.  This means that in battle, 1/4
  1696. Xof the troops that die will join the ranks of this army.  The army
  1697. Xwill not be allowed to grow to more than a certain multiple of its
  1698. Xoriginal size.
  1699. X\item \strong{burrow_army}
  1700. XThis sets the UNDERGROUND flag on an army.  This means that the army is 
  1701. Xtraveling underground and is thus immune to intercepts.
  1702. X\item \strong{water_walk}
  1703. XThis sets the WATER flag on an army.  The army will be able to cross
  1704. Xwater sectors.
  1705. X\item \strong{mag_bonus}
  1706. XThis gives magical enhancement to an army.  The army will fight with an
  1707. Xextra 30% bonus.
  1708. X\item \strong{merge}
  1709. XThis spell allows you to merge civilians into spirits (up to twice the
  1710. Xspirits' basic strength), or to take spirits and merge them into the
  1711. Xcivilian population of a sector.
  1712. X\item \strong{haste_army}
  1713. XThis spell doubles the army's current move rate.
  1714. X\end{itemize}
  1715. X
  1716. X\subsection{Spirits}
  1717. XSpirits are like armies, in that they can fight, and they can occupy
  1718. Xsectors (if they are big enough), and their status and movement is
  1719. Xmanipulated with the [a]rmy command.
  1720. X
  1721. XThey are also different in many ways.  To obtain them, you don't draft
  1722. Xthem, but your mage summons them with spell points.  They are not
  1723. Xmaintained by money, but by more spell points (typically 1/3 of the
  1724. Xspell points that were needed to summon them in the first place).
  1725. X
  1726. XSpirit types are described above together with army types.
  1727. X
  1728. X\chapter{The update}
  1729. X
  1730. XIt can be useful to understand exactly what happens during the update.
  1731. XHere are the steps in the order in which the computer performs them.
  1732. XThis list might not be complete, but it should give you an idea of how
  1733. Xthe update works.
  1734. X
  1735. X\begin{enumerate}
  1736. X
  1737. X\item NPC diplomacy is updated
  1738. X\item Hanging spells are loaded
  1739. X\item All moves by all nations are incorporated, and NPC moves are made
  1740. X\item Technology is updated
  1741. X\item Spy is updated
  1742. X\item Magic is updated
  1743. X\item Revenue is calculated of money, metal, jewels and food
  1744. X\item Civilian migration occurs
  1745. X\item Battles are resolved
  1746. X\item Sector capture is handled
  1747. X\item Diplomacy is updated (nations become ``met'')
  1748. X\item Armies are reset.  Mages are disbanded if maintaince jewels are missing.
  1749. X
  1750. X\end{enumerate}
  1751. X
  1752. X\section{Migration}
  1753. X
  1754. XCivilian migration happens automatically.  The people move according to
  1755. Xthe laws of the country.  As a leader you can set those laws with the
  1756. X[o]ptions screen:  you can set migration to be \emph{Free} (the default),
  1757. X\emph{Restricted} or \emph{None}.
  1758. X
  1759. X\begin{itemize}
  1760. X\item Free
  1761. Xmovement.  People look for the sectors that have the most
  1762. Xavailable jobs, because that's where they will get the best pay/best
  1763. Xjob.  Some attraction is also excersized by how pleasant a sector's
  1764. Xliving conditions are, but in general a constant ratio of employment
  1765. Xis preserved locally.
  1766. X\item Restricted
  1767. Xmovement.  The govevernment (you) has gotten sick of all theese
  1768. Xcivilians wandering around so much.  So civilians will not be allowed
  1769. Xto leave their present place of residence unless they can prove they
  1770. Xare unemployed.  If so then they will move to the sectors surrounding
  1771. Xthem, partially by number of jobs available, partially by the
  1772. Xdesirability of the sectors available.  However all sectors in range
  1773. Xwill be put to full employement if possible.  If there is nowhere to
  1774. Xgo they will wander aimlessly in search of a place to find a job,
  1775. Xjumping with the latest rumor of employment.  However even in the best
  1776. Xcircumstance, due to a slow bureocracy there will always be a few
  1777. Xextra people left in the sector than can be employed.
  1778. X\item None.
  1779. XNo movement.  The government (you again) has decreed that there will
  1780. Xbe no civillian movement.  Where they are is where you stay, and where
  1781. Xwhere they are born is where they will die.  Unless the army comes to
  1782. Xget them in caravans/ships, they will stay put.
  1783. X\end{itemize}
  1784. X
  1785. X\chapter{Authors}
  1786. XVersion 1.02 of Dominion is the first with this name.  It used to be
  1787. Xcalled \emph{Stony Brook World} (SBW), until too many people suggested
  1788. Xa catchier name.
  1789. X
  1790. XHere is a list of the people who actually wrote code for sbw/dominion
  1791. Xthat is in the current release.  The order is that in which they wrote
  1792. Xtheir first piece of code.
  1793. X
  1794. XMark Galassi (rosalia@dirac.physics.sunysb.edu) User interface (in
  1795. Xcurses), basic data structures, world generator, economy, technology,
  1796. Xmagic, basic army work, manual and formatting of manual with
  1797. XLaTeXinfo, miscellaneous.  Currently maintains dominion.
  1798. X
  1799. XMichael Fischer (greendog@max.physics.sunysb.edu) Update program, trade
  1800. Xboard, developed exec file format, miscellaneous.
  1801. X
  1802. XDoug Novellano (doug@max.physics.sunysb.edu) Mail and News systems.
  1803. X
  1804. XKeith Messing (keith@max.physics.sunysb.edu) Diplomacy system.
  1805. X
  1806. XAlan Saporta (gandalf@max.physics.sunysb.edu) Work on some exec routines,
  1807. Xmany suggestions of directions for the game.
  1808. X
  1809. XJoanne Rosenshein (raven@max.physics.sunysb.edu) Initial draft of the
  1810. Xmanual, many suggestions of directions for the game.
  1811. X
  1812. XStephen Bae (sbae@max.physics.sunysb.edu) Basic world memory allocation.
  1813. X
  1814. XChris Coligado (noel@max.physics.sunysb.edu) Army and battle code.
  1815. X
  1816. XC. Titus Brown (brown@dirac.physics.sunysb.edu) Adding nations and
  1817. Ximprovements on the reports; revised army menu and transportation
  1818. Xmenu.  Lots of miscellaneous stuff.
  1819. X
  1820. XCharles Ofria (charles@max.physics.sunysb.edu) Designed the ``npcs''
  1821. Xfile, most magic orders and many races and techno powers; coded some
  1822. Xspells.
  1823. X
  1824. XThere are also some contributions from people not in Stony Brook:
  1825. X
  1826. XStephen Underwood (su11+@andrew.cmu.edu) Fractal terrain generator and
  1827. Xcontributions in very many areas, including the standalone mail
  1828. Xreader.
  1829. X
  1830. XPaolo Montrasio (montra@ghost.unimi.it) .dominionrc parser (for
  1831. Xa later release), and working on design for distributed game.
  1832. X
  1833. XKevin Hart (hart@susan.cs.andrews.edu) NPC system.
  1834. X
  1835. XMany others have made very important creative suggestions to the game,
  1836. Xthough they were not involved in the actual coding.  Here are some
  1837. Xnames that come to mind.  Please send us mail if we have forgotten
  1838. Xany.  Tony Matranga, Tim Poplaski, Chris Adami, and everyone else who
  1839. Xparticipated in the FALL SBW and SPRING DOMINION games at Stony Brook
  1840. Xin the fall 1990 and spring 1991 semesters.
  1841. X
  1842. XIf you are interested in playing in any future games at Stony Brook,
  1843. Xplease mail ``rosalia@max.physics.sunysb.edu.''
  1844. X
  1845. X\end{document}
  1846. END_OF_FILE
  1847. if test 36711 -ne `wc -c <'dom_tex.ab'`; then
  1848.     echo shar: \"'dom_tex.ab'\" unpacked with wrong size!
  1849. fi
  1850. # end of 'dom_tex.ab'
  1851. fi
  1852. echo shar: End of archive 17 \(of 28\).
  1853. cp /dev/null ark17isdone
  1854. MISSING=""
  1855. 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
  1856.     if test ! -f ark${I}isdone ; then
  1857.     MISSING="${MISSING} ${I}"
  1858.     fi
  1859. done
  1860. if test "${MISSING}" = "" ; then
  1861.     echo You have unpacked all 28 archives.
  1862.     echo "Now execute ./do_cat.sh to build doc files"
  1863.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1864. else
  1865.     echo You still need to unpack the following archives:
  1866.     echo "        " ${MISSING}
  1867. fi
  1868. ##  End of shell archive.
  1869. exit 0
  1870.