File: cave.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 (254 lines) | stat: -rw-r--r-- 4,784 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
(game-module "cave"
  (title "Cave")
  (blurb "Explore the Cave of Wandering Death")
)

(terrain-type floor (char "."))
(terrain-type passage (image-name "flagstone") (char "."))
(terrain-type rock (char "#"))

(add rock thickness 10)

(unit-type human (image-name "adventurer") (char "@")
  (hp-max 10) (acp-per-turn 4))

(unit-type orc
  (hp-max 10) (acp-per-turn 4) (cp 4))
(unit-type elf
  (hp-max 10) (acp-per-turn 4) (cp 12))
(unit-type dwarf
  (hp-max 10) (acp-per-turn 4) (cp 16))

(unit-type giant-ant (image-name "ant")
  (hp-max 15) (acp-per-turn 4) (cp 4))
(unit-type giant-beetle (image-name "beetle")
  (hp-max 20) (acp-per-turn 4) (cp 8))
(unit-type giant-spider (image-name "spider")
  (hp-max 25) (acp-per-turn 4) (cp 12))

(unit-type white-dragon (image-name "dragon")
  (hp-max 40) (acp-per-turn 4))
(unit-type red-dragon (image-name "red-dragon")
  (hp-max 50) (acp-per-turn 4))

(unit-type imp (image-name "person")
  (hp-max 5) (acp-per-turn 4) (cp 4))
(unit-type pit-demon
  (hp-max 50) (acp-per-turn 4) (cp 40))

(unit-type sapphire (name "huge sapphire") (char "*"))
(unit-type emerald (name "huge emerald") (char "*"))
(unit-type ruby (name "huge ruby") (char "*"))
(unit-type diamond (name "huge diamond") (char "*"))

(unit-type nest
  (hp-max 50) (acp-per-turn 1))
(unit-type orc-hole (image-name "ruins")
  (hp-max 50) (acp-per-turn 1))
(unit-type pentagram (image-name "star-2")
  (hp-max 100) (acp-per-turn 1))

(define humanoids (orc elf dwarf))

(define insects (giant-ant giant-beetle giant-spider))

(define dragons (white-dragon red-dragon))

(define reptiles (white-dragon red-dragon))

(define demons (imp pit-demon))

(define monsters (append humanoids insects reptiles demons))

(define animate (append human monsters))

(define items (sapphire emerald ruby diamond))

(define places (nest orc-hole pentagram))

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

;;; Static relationships.

(include "ng-weird")

(add human namer "generic-names")

(add human possible-sides "human")

(add monsters possible-sides "monster")
(add places possible-sides "monster")

(table unit-storage-x
  (human m* (200 50 0))
  )

(add human capacity 100)
(add humanoids capacity 100)
(add dragons capacity 200)

(add places capacity 8)

(table unit-size-as-occupant
  (u* u* 999)
  (items u* 1)
  (insects nest 1)
  (humanoids orc-hole 1)
  (demons pentagram 1)
  )

(add t* capacity (16 4 0))

(table unit-size-in-terrain
  (animate t* 4)
  (items t* 0)
  )

;;; Vision.

;; (should make longer only around light sources or some such)

(add u* vision-range 5)
;; Humans are not cave dwellers by nature, don't see as well.
(add human vision-range 4)

(add items vision-range -1)

(add u* vision-bend 0)

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

;;; Actions.

(add items acp-per-turn 0)

;;; Movement.

(add places speed 0)

(table mp-to-enter-terrain
  (u* rock 99)
  )

(table mp-to-enter-own
  (u* items 0)
  )

;;; Construction.

(table acp-to-create
  (nest insects 1)
  (orc-hole humanoids 1)
  (pentagram demons 1)
  )

(table acp-to-build
  (nest insects 1)
  (orc-hole humanoids 1)
  (pentagram demons 1)
  )

;;; Combat.

(table hit-chance
  (u* u* 50)
  (items u* 0)
  (places u* 0)
  )

(table damage
  (u* u* 1d6)
  (u* items 0)
  (items u* 0)
  (places u* 0)
  )

(table acp-to-capture
  (u* items 1)
  )

(table capture-chance
  (u* items 100)
  )

(table independent-capture-chance
  (u* items 100)
  )

;; Dwarves can dig.

(table acp-to-add-terrain
  (dwarf (floor passage) 1)
  )

(table acp-to-remove-terrain
  (dwarf rock 1)
  )

;;; Backdrop activities.

(add u* hp-recovery 100)

(set action-notices '(
  ((destroy u* items) (actor " smash " actee "!"))
  ((destroy u* orc-hole) (actor " plug " actee "!"))
  ((destroy u* pentagram) (actor " erase " actee "!"))
  ))

;;; Random setup.

(add floor maze-room-occurrence 1)

(add passage maze-passage-occurrence 1)

(add t* occurrence 0)

(add rock occurrence 1)

(set edge-terrain rock)

(set maze-passage-density 5000)

;;; One adventurer on a side.

(add human start-with 1)

(add places start-with 1)
(add dragons start-with 1)

(set country-radius-min 5)
(set country-separation-min 20)
(set country-separation-max 30)

(table independent-density
  (items floor 500)
  )

(table favored-terrain
  (u* floor 100)
  (u* rock 0)
  )

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

(set sides-min 2)

(side 1 (name "You") (class "human") (emblem-name "none")
  (self-unit 1))

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

(scorekeeper (do last-side-wins))

(game-module (notes (
  "Cave exploration, with monsters."
  )))

(game-module (design-notes (
  "This is a pretty basic game.  It could be much elaborated."
  )))