home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Xconq 7.1.0 / lib / old-empire.g < prev    next >
Encoding:
Text File  |  1996-04-04  |  4.6 KB  |  245 lines  |  [TEXT/XCNQ]

  1. (game-module "old-empire"
  2.   (title "Old Empire")
  3.   (blurb "An emulation of `old Empire', a distant ancestor of Xconq.")
  4.   ;; No variants were available.
  5. )
  6.  
  7. ;;; Types.
  8.  
  9. (unit-type army (char "A") (image-name "soldiers"))
  10. (unit-type fighter (char "F") (image-name "jets"))
  11. (unit-type destroyer (char "D") (image-name "dd"))
  12. (unit-type submarine (char "S") (image-name "sub"))
  13. (unit-type troop-transport (char "T") (image-name "ap"))
  14. (unit-type cruiser (char "R") (image-name "ca"))
  15. (unit-type carrier (char "C") (image-name "cv"))
  16. (unit-type battleship (char "B") (image-name "bb"))
  17. (unit-type city (char "@") (image-name "city20"))
  18.  
  19. ;;; avgas is used only to constrain fighter range.
  20.  
  21. (material-type avgas)
  22.  
  23. (terrain-type sea (color "sky blue") (char "."))
  24. (terrain-type land (color "green") (char "+"))
  25.  
  26. (define A army)
  27. (define F fighter)
  28. (define D destroyer)
  29. (define S submarine)
  30. (define T troop-transport)
  31. (define R cruiser)
  32. (define C carrier)
  33. (define B battleship)
  34. (define @ city)
  35.  
  36. (define ship (D S T R C B))
  37.  
  38. ;;; Static relationships.
  39.  
  40. (table vanishes-on
  41.   ((A @) sea true)
  42.   (ship land true)
  43.   )
  44.  
  45. ;;; Unit-unit capacities.
  46.  
  47. (table unit-capacity-x
  48.   (T A 6)
  49.   (C F 8)
  50.   )
  51.  
  52. (add @ capacity 100)
  53.  
  54. (table unit-size-as-occupant
  55.   (A @ 50)
  56.   (F @ 1)
  57.   (ship @ 1)
  58.   ;; Cities can't occupy each other.
  59.   (@ @ 200)
  60.   )
  61.  
  62. ;;; Unit-terrain capacity is the default of 1 unit, 1 cell.
  63.  
  64. ;;; Unit-material capacities.
  65.  
  66. (table unit-storage-x
  67.   (F avgas 20)
  68.   ;; Carriers and cities have effectively infinite storage.
  69.   ((C @) avgas 9999)
  70.   )
  71.  
  72. ;;; Actions.
  73.  
  74. (add (A F) acp-per-turn (1 4))
  75. (add ship acp-per-turn 2)
  76. (add @ acp-per-turn 1)
  77.  
  78. ;;; Movement.
  79.  
  80. (add @ speed 0)
  81.  
  82. (table mp-to-enter-terrain
  83.   (army sea 10)
  84.   (ship land 10)
  85.   )
  86.  
  87. (table mp-to-enter-unit
  88.   (u* u* 1)
  89.   ; Aircraft can't sortie again until next turn.
  90.   (F u* 4)
  91.   )
  92.  
  93. (add F free-mp 4)
  94.  
  95. (table consumption-per-move
  96.   (F avgas 1)
  97.   )
  98.  
  99. ;;; Construction.
  100.  
  101. (add u* cp (5 10 20 30 25 50 60 75 1))
  102.  
  103. (table acp-to-create
  104.   (@ u* 1)
  105.   (@ @ 0)
  106.   )
  107.  
  108. (table cp-on-creation
  109.   (@ u* 1)
  110.   )
  111.  
  112. (table acp-to-build
  113.   (@ u* 1)
  114.   )
  115.  
  116. (table cp-per-build
  117.   (@ u* 1)
  118.   )
  119.  
  120. (table acp-to-toolup
  121.   (@ u* 1)
  122.   )
  123.  
  124. (table tp-to-build
  125.   (@ u* (1 2 4 6 5 10 12 15 0))
  126.   )
  127.  
  128. (table tp-max
  129.   (@ u* (1 2 4 6 5 10 12 15 0))
  130.   )
  131.  
  132. ;;; Combat.
  133.  
  134. (add u* hp-max (1 1 3 3 2 8 8 12 1))
  135.  
  136. ;; Units are generally crippled, moving at half speed,
  137. ;; at about 1/2 of hp-max, sometimes rounding up, sometimes down.
  138.  
  139. (add D speed-damage-effect ((1 50) (2 100) (3 100)))
  140. (add S speed-damage-effect ((1 50) (2 100) (3 100)))
  141. (add T speed-damage-effect ((1 50) (2 100)))
  142. (add R speed-damage-effect ((1 50) (4  50) (5 100) (8 100)))
  143. (add C speed-damage-effect ((1 50) (4  50) (5 100) (8 100)))
  144. (add B speed-damage-effect ((1 50) (6  50) (7 100) (12 100)))
  145.  
  146. (table hit-chance
  147.   (u* u* 50)
  148.   ;; Cities don't participate in combat.
  149.   (u* @ 0)
  150.   (@ u* 0)
  151.   ;; ...except vs armies.
  152.   (A @ 50)
  153.   (@ A 50)
  154.   )
  155.  
  156. (table damage
  157.   (u* u* 1)
  158.   ;; Subs hit ships harder.
  159.   (S ship 3)
  160.   ;; Armies don't damage cities.
  161.   (A @ 0)
  162.   )
  163.  
  164. (table capture-chance
  165.   (A @ 50)
  166.   )
  167.  
  168. (table hp-to-garrison
  169.   ;; Use up the capturing army.
  170.   (A @ 1)
  171.   )
  172.  
  173. ;"shoots down" F destroy-message
  174. ;"sinks" ship destroy-message
  175. ;"runs out of fuel and crashes" F starve-message
  176.  
  177. ;;; Backdrop.
  178.  
  179. (table base-consumption
  180.   (F avgas 4)
  181.   )
  182.  
  183. (table base-production
  184.   ((C @) avgas 9999)
  185.   )
  186.  
  187. (table hp-per-starve
  188.   (F avgas 1.00)
  189.   )
  190.  
  191. (table auto-repair
  192.   ;; Cities repair 1 hp of damage each turn for each ship occupant.
  193.   (city ship 1.00)
  194.   )
  195.  
  196.  
  197. ;;; Scoring.
  198.  
  199. (add u* point-value 0)
  200. (add @ point-value 1)
  201.  
  202. (scorekeeper (do last-side-wins))
  203.  
  204. ;;; Random setup.
  205.  
  206. (add t* alt-percentile-min (0 70))
  207. (add t* alt-percentile-max (70 100))
  208. (add t* wet-percentile-min 0)
  209. (add t* wet-percentile-max 100)
  210.  
  211. (set country-radius-min 3)
  212.  
  213. (set country-separation-min 15)
  214.  
  215. (add t* country-terrain-min (2 1))
  216.  
  217. (add city start-with 1)
  218. (add city independent-near-start 3)
  219.  
  220. (table favored-terrain
  221.   (city (sea land) (0 100))
  222.   )
  223.  
  224. (table independent-density
  225.   (city land 200)
  226.   )
  227.  
  228. (table unit-initial-supply
  229.   (@ avgas 9999)
  230.   )
  231.  
  232. (game-module (notes (
  233.   "Of course, this will not be exactly like old Empire - for one thing, Xconq maps"
  234.   "are composed of hexes and not squares!  However, we can reproduce the details"
  235.   "of the playing pieces fairly well."
  236.   ""
  237.   "The chief defects are that combat is always mutual, rather than"
  238.   "one-side-at-a-time hits, and that cities must have capacity for armies."
  239.   "In the latter case, this period fixes an annoying defect of the original"
  240.   "empire game!  Also, some of the messages are a little weird."
  241.   ""
  242.   "There is also an imbalance in that ships defeating armies don't run"
  243.   "aground, so they are more useful than in the original."
  244. )))
  245.