File: space.g

package info (click to toggle)
xconq 7.2.2-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 8,296 kB
  • ctags: 9,199
  • sloc: ansic: 107,849; sh: 2,108; perl: 2,057; makefile: 1,177; sed: 161; csh: 50; awk: 49; lisp: 39
file content (316 lines) | stat: -rw-r--r-- 7,223 bytes parent folder | download | duplicates (2)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
(game-module "space"
  (title "Space Empires")
  (variants (world-size (120 60 9999)))
  )

;;; Unit types.

(unit-type army (image-name "soldiers")
  (help "military force, equipped with in-system ships"))
(unit-type engineers (image-name "builder")
  (help "construction team, equipped with in-system ships"))

;; Starships.

(unit-type transport (image-name "space-transport")
  (help ""))
(unit-type fighter (image-name "space-fighter")
  (help ""))
(unit-type cruiser (image-name "space-cruiser")
  (help ""))

(define starships (transport fighter cruiser))

(unit-type starbase (image-name "mothership")
  (help "staging and refueling post in deep space"))
(unit-type shipyard (image-name "facility")
  (help "where starships get built"))

(define places (starbase shipyard))

(unit-type small-planet (image-name "moon")
  (help ""))
(unit-type earthlike-planet (image-name "planet")
  (help ""))
(unit-type gas-giant
  (help "large planet with no surface, can only orbit"))
(unit-type ringed-gas-giant
  (help "large planet with rings but no surface, can only orbit"))
(unit-type asteroid-belt
  (help "a region of small planetoids, rich in metal"))
  
(define solid-planets (small-planet earthlike-planet asteroid-belt))

(define planets (small-planet earthlike-planet gas-giant ringed-gas-giant asteroid-belt))
 
(unit-type yellow-star
  (description-format (name))
  (help "normal mainstream star"))
(unit-type red-giant
  (description-format (name))
  (help "large reddish star, can have planets"))
(unit-type black-hole
  (help "large reddish star"))

(define stellar (yellow-star red-giant black-hole))

;;; Material types.

(material-type fuel
  (help "mixture of gases, powers everything"))
(material-type metal
  (help "used to build everything"))

;;; Terrain types.

(imf "off-black" ((1 1) 5000 5000 5000))
(imf "gray-black" ((1 1) 10000 10000 10000))

(terrain-type deep-space (image-name "space")
  (help "interstellar space"))
(terrain-type nebula
  (help "area of gas, masks area behind"))
(terrain-type star-system (image-name "gray-black")
  (help "area around a star"))

;;; Static relationships.

;;; Unit-unit.

(table unit-size-as-occupant
  (u* u* 99)
  ((army engineers) transport 1)
  ((army engineers) planets 1)
  (starships places 1)
  (starships planets 1)
  (places planets 1)
  )

(add transport capacity 4)
(add places capacity 16)
(add planets capacity 32)
(add earthlike-planet capacity 64)

;;; Unit-terrain.

(table unit-size-in-terrain
  (engineers t* 0)
  ;; Any number of starships can share the same space.
  (starships t* 0)
  (planets t* 1)
  ;; Near-stellar regions are offlimits.
  (stellar t* 1)
  )

;;; Unit-material.

(table unit-storage-x
  ((army engineers) fuel 100)
  (starships fuel (200 18 400))
  (places fuel 500)
  (planets fuel (200 500 5000 5000 200))
  )

;;; Vision.

(set terrain-seen true)

;; Stars are always obvious.

(add stellar see-always true)

(add u* vision-bend 0)

(add u* vision-range 5)
(add transport vision-range 3)
(add cruiser vision-range 7)
(add planets vision-range 10)

(add nebula thickness 100)

(table eye-height
  (u* t* 5)
  )

;;; Actions.

(add army acp-per-turn 1)
(add engineers acp-per-turn 1)
(add places acp-per-turn 1)
(add solid-planets acp-per-turn 1)

(add starships acp-per-turn (3 9 6))

;;; Movement.

(add places speed 0)
(add starbase speed 1)
(add planets speed 0)

(table mp-to-enter-terrain
  ;; Armies and engineers have in-system ships only; they can
  ;; survive if set adrift in deep space, but won't go anywhere.
  ((army engineers) deep-space 99)
  )

;(table mp-to-leave-unit
;  ;; Starbases and shipyards don't have the engines to leave orbit?
;  (places planets 99)
;  )

;;; Construction.

(add (army engineers) cp (5 10))
(add starships cp (10 5 20))

(table acp-to-create
  (engineers places 1)
  (shipyard starships 1)
  (solid-planets (army engineers) 1)
  (asteroid-belt starships 1)
  )

(table acp-to-build
  (engineers places 1)
  (shipyard starships 1)
  (solid-planets (army engineers) 1)
  (asteroid-belt starships 1)
  )

;;; Combat.

(add (army engineers) hp-max (9 3))
(add starships hp-max (4 1 8))
(add planets hp-max 100)

(table hit-chance
  (u* u* 0)
  (army (army engineers) 50)
  (engineers (army engineers) 50)
  (army planets 100)
  (cruiser starships 50)
  )

(table damage
  (u* u* 0)
  (army planets 1)
  (cruiser starships 1)
  )

(table capture-chance
  (army planets 20)
  (army stellar 50)
  (army black-hole 0)
  (cruiser starships 20)
  )

(table independent-capture-chance
  (army planets 100)
  (army stellar 100)
  (army black-hole 0)
  )

;; (should have protection by occupying armies)

;;; Backdrop.

(table base-consumption
  ((army engineers) fuel 1)
  (starships fuel 1)
  )

(table hp-per-starve
  ((army engineers) fuel 1.00)
  ;; Starships have a very short grace period.
  (starships fuel 0.50)
  )

;;; Random setup.

(add t* alt-percentile-min (  0   0  97))
(add t* alt-percentile-max ( 97  97 100))
(add t* wet-percentile-min (  0  94   0))
(add t* wet-percentile-max ( 94 100 100))

(set alt-blob-size 7)
(set alt-blob-height 1000)
(set alt-blob-density 100)
(set alt-smoothing 1)

(set country-radius-min 4)
(set country-separation-min 30)
(set country-separation-max 32)

(add shipyard start-with 2)
(add small-planet start-with 2)
(add earthlike-planet start-with 1)
(add gas-giant start-with 1)
(add asteroid-belt start-with 1)
(add yellow-star start-with 1)

(table favored-terrain
  (u* t* 0)
  (engineers star-system 100)
  (shipyard star-system 100)
  (planets star-system 100)
  (stellar star-system 100)
  ;; Black holes could actually have planets, but they would be
  ;; unusable, so ignore them.
  (black-hole star-system 0)
  (black-hole (deep-space nebula) 100)
  )

(table independent-density
  (planets star-system (1000 500 1000 200 500))
  (yellow-star star-system 1000)
  (red-giant star-system 200)
  (black-hole (deep-space nebula) 10)
  )

(table unit-initial-supply
  ;; All pre-existing units are fully fueled.
  (u* fuel 10000)
  )

(scorekeeper (do last-side-wins))

(add stellar namer "star-names")

(namer star-names (grammar root 30
  (root (or name 20 (letter " " constellation)))
  (name (or
    "Achernar" "Adhara" "Aldebaran" "Algol" "Altair" "Antares" "Arcturus"
	"Betelgeuse"
	"Canopus" "Castor" "Capella"
	"Deneb"
	"Hadar"
	"Mimosa" "Miraz"
	"Polaris" "Pollux" "Procyon"
	"Regulus" "Rigel"
	"Sirius" "Spica"
	"Vega"
    ))
  (letter (or "Alpha" "Beta" "Gamma" "Delta" "Epsilon" "Zeta" "Eta" "Theta"
              "Iota" "Kappa" "Lambda"))
  (constellation (or ; Note that these are in the genitive form
    "Andromedae" "Antliae" "Apodis" "Aquarii" "Aquilae" "Arae" "Arietis" "Aurigae"
    "Bootis"
    "Caeli" "Cameleopardalis" "Cancri" "Capricorni" "Centauri" "Cephei"
    "Ceti" "Corvi" "Crucis" "Cygni"
	"Delphini" "Doradus" "Draconis"
	"Eridani"
	"Fornacis"
	"Geminorum"
	"Herculis" "Hydrae"
	"Indi"
	"Lacertae" "Leonis" "Librae" "Lupi" "Lyncis" "Lyrae"
	"Monocerotis" "Muscae"
	"Ophiuchi" "Orionis"
	"Pavonis" "Pegasi" "Phoenicis" "Piscium" "Pyxidis"
	"Reticuli"
	"Sagittae" "Sagitarii" "Scorpii"
	"Tauri" "Tucana"
    "Ursa Major" "Ursa Minor"
    "Velorum" "Virginis" "Volantis" "Vulpecula"
    ))
  ))