File: quest.g

package info (click to toggle)
xconq 7.1.0-7
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 7,056 kB
  • ctags: 7,960
  • sloc: ansic: 88,493; perl: 2,057; sh: 1,766; makefile: 1,110; csh: 81; awk: 47; lisp: 39
file content (384 lines) | stat: -rw-r--r-- 7,022 bytes parent folder | download
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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
(game-module "quest"
  (title "Quest for XP")
  (blurb "Wilderness exploration in a fantasical world")
  (variants (world-seen false) (see-all false))
  )

(unit-type human (image-name "person") (char "@")
  (hp-max 10)
  )
;; should add other levels of human

(unit-type goblin
  (hp-max 4)
  )
(unit-type skeleton
  (hp-max 5)
  )
(unit-type orc
  (hp-max 10)
  )
(unit-type elf
  (hp-max 15)
  )
(unit-type dwarf
  (hp-max 9)
  )
(unit-type bugbear
  (hp-max 10)
  )
(unit-type troll
  (hp-max 20)
  )
(unit-type centaur
  (hp-max 20)
  )
(unit-type yeti
  (hp-max 20)
  )
(unit-type dragon
  (hp-max 40)
  )

(unit-type ant
  (hp-max 5)
  )
(unit-type beetle
  (hp-max 20)
  )
(unit-type spider
  (hp-max 20)
  )
(unit-type scorpion
  (hp-max 20)
  )

(unit-type vampire
  (hp-max 40)
  )

(unit-type sorceror
  (hp-max 40)
  )

(unit-type purple-worm
  (hp-max 40)
  )

(unit-type beholder
  (hp-max 40)
  )

(define humanoid (goblin orc elf dwarf bugbear yeti sorceror))

(define reptile (dragon))

(define bug (ant beetle spider scorpion))

(define undead (skeleton vampire))

(define other (troll centaur purple-worm beholder))

(define monster (append humanoid reptile bug undead other))

(define animate (append human monster))

(unit-type diamond-ring (image-name "ring")
  )
(unit-type treasure-chest
  )

(define objects (diamond-ring treasure-chest))

(unit-type lair
  (hp-max 20)
  )
(unit-type village
  (hp-max 20)
  )
(unit-type town (image-name "town20") (char "*")
  (hp-max 50)
  )
(unit-type castle (char "K")
  (hp-max 50)
  )
(unit-type city (image-name "city18") (char "!")
  (hp-max 100)
  )

(define places (lair village town castle city))

(material-type food
  )
(material-type water
  )
(material-type gold
  )

(include "stdterr")

(define water-t* (sea shallows))
(define land (swamp plains forest desert mountains))

(include "ng-weird")

(add human namer "generic-names")

(add places namer "generic-names")
(add lair namer "")

(add human possible-sides "human")

(add monster possible-sides "monster")

;;; Static relationships.

(table vanishes-on
  (animate water-t* true)
  (dragon water-t* false)
  (yeti t* true)
  (yeti (mountains ice) false)
  (places water-t* true)
  (places ice true)
  )

;;; Unit-unit capacities.

(add places capacity (20 20 40 40 80))

(table unit-size-as-occupant
  (u* u* 100)
  (animate places 1)
  )

;;; Unit-terrain capacities.

(add t* capacity 16)

(table unit-size-in-terrain
  (u* t* 1)
  (village t* 9)
  (town t* 12)
  (castle t* 9)
  (city t* 16)
  )

(table unit-storage-x
  (human m* (10 5 100))
  (dragon gold 1000)
  )

;;; Vision.

(add places already-seen 100)
(add lair already-seen 0)
(add village already-seen 50)
(add castle already-seen 50)

;;; Actions.

(add u* acp-per-turn 4)
(add places acp-per-turn 0)

;;; Movement.

(add places speed 0)

(table mp-to-enter-terrain
  ;; Accident prevention.
  (animate water-t* 99)
  (animate mountains 2)
  (animate ice 3)
  (animate river 0)
  (humanoid river 1)
  (animate road 0)
  (dwarf mountains 1)
  ;; Insects aren't intelligent enough to figure out how to cross water.
  (bug river 99)
  (yeti t* 99)
  (yeti (mountains ice) 0)
  ;; Dragons can go anywhere.
  (dragon t* 0)
  )

(table mp-to-leave-terrain
  ;; Forests are hard to get out of.
  (humanoid forest 1)
  ;; ...but not for elves.
  (elf forest 0)
  ;; Swamps are hard to get out of too.
  (humanoid swamp 1)
  (elf swamp 0)
  ;; Note that we make mountains harder to enter,
  ;; but exact no penalty for departure (walking
  ;; downhill is easy).
  )

(table mp-to-traverse
  (animate road 1)
  )

(table can-enter-independent
  ((human elf dwarf) places true)
  )

;;; Construction.

;;; (should have lairs make monsters)

;;; Combat.

(table acp-to-attack
  (animate places 0)
  (dragon places 2)
  )

(table hit-chance
  (u* u* 50)
  (animate places 0)
  (dragon places 100)
  (beholder u* 80)
  (purple-worm u* 80)
  (places u* 0)
  )

(table damage
  (u* u* 1)
  (animate places 0)
  (beholder u* 1d4)
  (dragon animate 1d5)
  (dragon places 1d4)
  (purple-worm animate 1d10)
  (places u* 0)
  )

;;; Backdrop.

(add u* hp-recovery 100)

(table base-production
  (animate food 1)
  (animate water 4)
  (places food 10)
  (places water 100)
  )

(table productivity
  (animate desert 0)
  (village land (0 100 50 20 20))
  (town land (0 100 50 20 20))
  (city land (0 100 50 20 20))
  )

(table base-consumption
  (animate food 1)
  (animate water 1)
  )

(table hp-per-starve
  (animate food 1.00)
  (dragon food 0.10)
  (animate water 1.00)
  (dragon water 0.10)
  )

;;; Random setup.

(add cell-t* alt-percentile-min (  0  40  44  45  45  45  90  97))
(add cell-t* alt-percentile-max ( 40  44  45  90  90  90  97 100))
(add cell-t* wet-percentile-min (  0   0  50   0  20  80   0   0))
(add cell-t* wet-percentile-max (100 100 100  20  80 100 100 100))

;;; One adventurer on a side.

(add human start-with 1)

;; A sampling of monsters.
(add monster start-with 1)
(add orc start-with 5)
(add lair start-with 3)

(set country-radius-min 8)
(set country-separation-min 15)
(set country-separation-max 20)

(table favored-terrain
  (u* t* 0)
  (u* (sea shallows) 0) 
  (u* plains 100)
  (elf forest 100)
  (dwarf plains 20)
  (dwarf mountains 100)
  (centaur forest 100)
  (scorpion desert 100)
  (yeti t* 0)
  (yeti mountains 50)
  (yeti ice 100)
  (dragon mountains 100)
  (lair plains 10)
  (lair (desert forest mountains) (20 100 100))
  )

(table independent-density
  (village (plains forest) (300 100))
  (town (plains forest) (100 50))
  (castle (plains forest mountains) (100 50 50))
  (city plains 10)
  )

(table road-chance
  (town (town city) ( 2   5))
  (castle (town city) 20)
  (city (town city) (80 100))
  )

(add (town city) road-to-edge-chance 100)

(set edge-road-density 100)

;; Nearly all towns and villages should be connected by road to
;; somewhere else.

(add village spur-chance 50)
(add village spur-range 2)

(add town spur-chance 90)
(add town spur-range 2)

(add castle spur-chance 90)
(add castle spur-range 2)

;(set synthesis-methods
;  '(make-maze-terrain make-countries make-independent-units))

(set sides-min 1)

(side 1 (name "You") (class "human"))

(side 2 (noun "Monster") (class "monster") (emblem-name "none"))

(table unit-initial-supply
  (u* food 10000)
  (u* water 10000)
  (u* gold 0)
  )

(scorekeeper (do last-side-wins))

(game-module (notes (
  "This is a sort of outdoors adventure for individual adventurers."
  )))

;;; Various pieces of equipment should be available.

;;; Have nobrains machine-run sides for countries, towns, castles, etc.
;;; (or quiescent unless player becomes outlaw?)

;;; Monsters belong to sides defined by alignment.  Sides of matching
;;; alignment friendly, etc.  No brains to side, but player could run
;;; a monster side, just for fun.
;;; Monsters can breed periodically, but limit total # somehow.

;;; Win by collecting the most treasure after <n> turns.
;;; Treasure should be hidden inside towns, carried by monsters.