1(game-module "cave" 2 (title "Cave of Wandering Death") 3 (blurb "Explore the Cave of Wandering Death. The original cave game.") 4 (picture-name "cave") 5 (variants 6 (world-seen false) 7 (see-all false) 8 (sequential false) 9 (world-size) 10 ) 11 ) 12 13(unit-type human (image-name "adventurer") (char "@") 14 (hp-max 10) (acp-per-turn 4)) 15 16(unit-type orc 17 (hp-max 10) (acp-per-turn 4) (cp 4)) 18(unit-type elf 19 (hp-max 10) (acp-per-turn 4) (cp 12)) 20(unit-type dwarf 21 (hp-max 10) (acp-per-turn 4) (cp 16)) 22 23(unit-type giant-ant (name "giant ant") (image-name "ant") 24 (hp-max 15) (acp-per-turn 3) (cp 4)) 25(unit-type giant-beetle (name "giant beetle") (image-name "beetle") 26 (hp-max 20) (acp-per-turn 4) (cp 8)) 27(unit-type giant-spider (name "giant spider") (image-name "spider") 28 (hp-max 25) (acp-per-turn 6) (cp 12)) 29 30(unit-type white-dragon (name "white dragon") (image-name "dragon") 31 (hp-max 40) (acp-per-turn 4)) 32(unit-type red-dragon (name "red dragon") 33 (hp-max 50) (acp-per-turn 8)) 34 35(unit-type imp (image-name "person") 36 (hp-max 5) (acp-per-turn 4) (cp 4)) 37(unit-type pit-demon (name "pit demon") 38 (hp-max 50) (acp-per-turn 4) (cp 40)) 39 40(unit-type beholder 41 (hp-max 50) (acp-per-turn 4) (cp 40) 42 (help "a very nasty creature")) 43 44(unit-type coins (name "pile of gold coins") (image-name "bank") (char "o")) 45(unit-type sapphire (name "huge sapphire") (char "*")) 46(unit-type emerald (name "huge emerald") (char "*")) 47(unit-type ruby (name "huge ruby") (char "*")) 48(unit-type diamond (name "huge diamond") (char "*")) 49 50(unit-type nest 51 (hp-max 50) (acp-per-turn 1)) 52(unit-type orc-hole (name "orc hole") (image-name "ruins") 53 (hp-max 50) (acp-per-turn 1)) 54(unit-type pentagram (image-name "star-2") 55 (hp-max 100) (acp-per-turn 1)) 56 57(define humanoids (orc elf dwarf)) 58 59(define insects (giant-ant giant-beetle giant-spider)) 60 61(define dragons (white-dragon red-dragon)) 62 63(define reptiles (white-dragon red-dragon)) 64 65(define demons (imp pit-demon)) 66 67(define other (beholder)) 68 69(define monsters (append humanoids insects reptiles demons other)) 70 71(define animate (append human monsters)) 72 73(define items (coins sapphire emerald ruby diamond)) 74 75(define places (nest orc-hole pentagram)) 76 77(material-type food) 78(material-type water) 79(material-type gold) 80 81(terrain-type floor (char ".")) 82(terrain-type passage (image-name "flagstone") (char ".")) 83(terrain-type rock (char "#")) 84 85(add rock thickness 10) 86 87;;; Static relationships. 88 89(add human possible-sides "human") 90 91(add monsters possible-sides "monster") 92(add places possible-sides "monster") 93 94(include "ng-weird") 95 96(add human namer "generic-names") 97(add dragons namer "generic-names") 98(add pit-demon namer "generic-names") 99(add beholder namer "generic-names") 100 101;; Unit-unit relationships. 102 103(add human capacity 100) 104(add humanoids capacity 100) 105(add dragons capacity 200) 106 107(add places capacity 8) 108 109(table unit-size-as-occupant 110 (u* u* 999) 111 (items u* 1) 112 (insects nest 1) 113 (humanoids orc-hole 1) 114 (demons pentagram 1) 115 ) 116 117;; Unit-terrain relationship. 118 119(add t* capacity (16 4 0)) 120 121(table unit-size-in-terrain 122 (animate t* 4) 123 (items t* 0) 124 ) 125 126;; Unit-material. 127 128(table unit-storage-x 129 (human m* (200 50 0)) 130 ) 131 132;;; Vision. 133 134;; (should make longer only around light sources or some such) 135 136(add u* vision-range 5) 137;; Humans are not cave dwellers by nature, don't see as well. 138(add human vision-range 4) 139 140(add items vision-range -1) 141 142(add u* can-see-behind 0) 143 144(table eye-height 145 (u* t* 5) 146 ) 147 148;;; Actions. 149 150(add items acp-per-turn 0) 151 152;;; Movement. 153 154(add places speed 0) 155 156(table mp-to-enter-terrain 157 (u* rock 99) 158 ) 159 160(table mp-to-enter-own 161 (u* items 0) 162 ) 163 164;;; Construction. 165 166(table can-create 167 (nest insects 1) 168 (orc-hole humanoids 1) 169 (pentagram demons 1) 170 ) 171 172(table can-build 173 (nest insects 1) 174 (orc-hole humanoids 1) 175 (pentagram demons 1) 176 ) 177 178(table acp-to-create 179 (nest insects 1) 180 (orc-hole humanoids 1) 181 (pentagram demons 1) 182 ) 183 184(table acp-to-build 185 (nest insects 1) 186 (orc-hole humanoids 1) 187 (pentagram demons 1) 188 ) 189 190;;; Combat. 191 192(table acp-to-attack 193 (u* u* 2) 194 ) 195 196(table acp-to-defend 197 (u* u* 1) 198 ) 199 200(table hit-chance 201 (u* u* 50) 202 (items u* 0) 203 (places u* 0) 204 ) 205 206(table damage 207 (u* u* 1d6) 208 (u* items 0) 209 (items u* 0) 210 (places u* 0) 211 ) 212 213(table acp-to-capture 214 (u* items 1) 215 ) 216 217(table capture-chance 218 (u* items 100) 219 ) 220 221(table independent-capture-chance 222 (u* items 100) 223 ) 224 225(add dragons acp-to-fire 4) 226(add beholder acp-to-fire 4) 227 228(add dragons range 6) 229(add beholder range 4) 230 231(add human cxp-max 999) 232 233(table cxp-per-combat 234 (u* u* 1) 235 (u* items 0) 236 ) 237 238(table damage-cxp-effect 239 (human u* 1000) 240 ) 241 242(table hit-cxp-effect 243 (human u* 1000) 244 ) 245 246;; Dwarves can dig. 247 248(table acp-to-add-terrain 249 (dwarf (floor passage) 1) 250 ) 251 252(table acp-to-remove-terrain 253 (dwarf rock 1) 254 ) 255 256;;; Backdrop activities. 257 258(add u* hp-recovery 1.00) 259 260(set action-notices '( 261 ((destroy u* items) (actor " smash " actee "!")) 262 ((destroy u* nest) (actor " smash " actee "!")) 263 ((destroy u* orc-hole) (actor " plug " actee "!")) 264 ((destroy u* pentagram) (actor " erase " actee "!")) 265 )) 266 267;;; Random setup. 268 269(add floor maze-room-occurrence 1) 270 271(add passage maze-passage-occurrence 1) 272 273(add t* occurrence 0) 274 275(add rock occurrence 1) 276 277(set edge-terrain rock) 278 279(set maze-passage-density 5000) 280 281;;; One adventurer on a side. 282 283(add human start-with 1) 284 285(add places start-with 1) 286(add red-dragon start-with 1) 287(add beholder start-with 1) 288 289(set country-radius-min 5) 290(set country-separation-min 20) 291(set country-separation-max 30) 292 293(table independent-density 294 (items floor 200) 295 ) 296 297(table favored-terrain 298 (u* floor 100) 299 (items passage 50) 300 (u* rock 0) 301 ) 302 303(set synthesis-methods 304 '(make-maze-terrain make-countries make-independent-units)) 305 306(set sides-min 2) 307 308(side 1 (name "You") (class "human") (emblem-name "none") 309 (self-unit 1)) 310 311(side 2 (noun "Monster") (class "monster") (emblem-name "none")) 312 313(scorekeeper (do last-side-wins)) 314 315(set meridians false) 316 317(game-module (notes ( 318 "Cave exploration, with monsters." 319 ))) 320 321(game-module (design-notes ( 322 "This is a pretty basic game. It could be much elaborated." 323 ))) 324