objects.ts
1 /** 2 * Object definitions for Dunnet 3 */ 4 5 import { ObjectDef } from '../engine/state.js'; 6 7 export const OBJECTS: ObjectDef[] = [ 8 // id 0: shovel 9 { id: 0, roomDesc: "There is a shovel here.", invDesc: "A shovel", weight: 2, points: 0, 10 examineDesc: "It is a normal shovel with a price tag attached that says $19.99." }, 11 12 // id 1: lamp 13 { id: 1, roomDesc: "There is a lamp nearby.", invDesc: "A lamp", weight: 1, points: 0, 14 examineDesc: "The lamp is hand-crafted by Geppetto." }, 15 16 // id 2: CPU card 17 { id: 2, roomDesc: "There is a CPU card here.", invDesc: "A computer board", weight: 1, points: 0, 18 examineDesc: "The CPU board has a VAX chip on it. It seems to have 2 Megabytes of RAM onboard." }, 19 20 // id 3: food 21 { id: 3, roomDesc: "There is some food here.", invDesc: "Some food", weight: 1, points: 0, 22 examineDesc: "It looks like some kind of meat. Smells pretty bad." }, 23 24 // id 4: brass key 25 { id: 4, roomDesc: "There is a shiny brass key here.", invDesc: "A brass key", weight: 1, points: 0 }, 26 27 // id 5: slip of paper 28 { id: 5, roomDesc: "There is a slip of paper here.", invDesc: "A slip of paper", weight: 0, points: 0, 29 examineDesc: "The paper says: Don't forget to type 'help' for help. Also, remember this word: 'worms'" }, 30 31 // id 6: RMS statuette 32 { id: 6, roomDesc: "There is a wax statuette of Richard Stallman here.", invDesc: "An RMS statuette", weight: 2, points: 0, 33 examineDesc: "The statuette is of the likeness of Richard Stallman, the author of the famous EMACS editor. You notice that he is not wearing any shoes." }, 34 35 // id 7: diamond 36 { id: 7, roomDesc: "There is a shimmering diamond here.", invDesc: "A diamond", weight: 2, points: 10, isTreasure: true }, 37 38 // id 8: weight 39 { id: 8, roomDesc: "There is a 10 pound weight here.", invDesc: "A weight", weight: 10, points: 0, 40 examineDesc: "You observe that the weight is heavy." }, 41 42 // id 9: life preserver 43 { id: 9, roomDesc: "There is a life preserver here.", invDesc: "A life preserver", weight: 3, points: 0, 44 examineDesc: 'It says S. S. Minnow.' }, 45 46 // id 10: emerald bracelet 47 { id: 10, roomDesc: "There is an emerald bracelet here.", invDesc: "A bracelet", weight: 1, points: 10, isTreasure: true }, 48 49 // id 11: gold bar 50 { id: 11, roomDesc: "There is a gold bar here.", invDesc: "A gold bar", weight: 1, points: 10, isTreasure: true }, 51 52 // id 12: platinum bar 53 { id: 12, roomDesc: "There is a platinum bar here.", invDesc: "A platinum bar", weight: 1, points: 10, isTreasure: true }, 54 55 // id 13: beach towel 56 { id: 13, roomDesc: "There is a beach towel on the ground here.", invDesc: "A beach towel", weight: 0, points: 0, 57 examineDesc: "It has a picture of snoopy on it." }, 58 59 // id 14: axe 60 { id: 14, roomDesc: "There is an axe here.", invDesc: "An axe", weight: 1, points: 0 }, 61 62 // id 15: silver bar 63 { id: 15, roomDesc: "There is a silver bar here.", invDesc: "A silver bar", weight: 1, points: 10, isTreasure: true }, 64 65 // id 16: bus driver's license 66 { id: 16, roomDesc: "There is a bus driver's license here.", invDesc: "A license", weight: 0, points: 0, 67 examineDesc: "It has your picture on it!" }, 68 69 // id 17: valuable coins 70 { id: 17, roomDesc: "There are some valuable coins here.", invDesc: "Some valuable coins", weight: 1, points: 10, isTreasure: true, 71 examineDesc: "They are old coins from the 19th century." }, 72 73 // id 18: jewel-encrusted egg 74 { id: 18, roomDesc: "There is a jewel-encrusted egg here.", invDesc: "A valuable egg", weight: 1, points: 10, isTreasure: true, 75 examineDesc: "It is a valuable Fabrege egg." }, 76 77 // id 19: glass jar 78 { id: 19, roomDesc: "There is a glass jar here.", invDesc: "A glass jar", weight: 1, points: 0, 79 examineDesc: "It is a plain glass jar." }, 80 81 // id 20: dinosaur bone 82 { id: 20, roomDesc: "There is a dinosaur bone here.", invDesc: "A bone", weight: 1, points: 0 }, 83 84 // id 21: nitric acid 85 { id: 21, roomDesc: "There is a packet of nitric acid here.", invDesc: "Some nitric acid", weight: 0, points: 0 }, 86 87 // id 22: glycerine 88 { id: 22, roomDesc: "There is a packet of glycerine here.", invDesc: "Some glycerine", weight: 0, points: 0 }, 89 90 // id 23: ruby 91 { id: 23, roomDesc: "There is a valuable ruby here.", invDesc: "A ruby", weight: 2, points: 10, isTreasure: true }, 92 93 // id 24: amethyst 94 { id: 24, roomDesc: "There is a valuable amethyst here.", invDesc: "An amethyst", weight: 2, points: 10, isTreasure: true }, 95 96 // id 25: Mona Lisa 97 { id: 25, roomDesc: "The Mona Lisa is here.", invDesc: "The Mona Lisa", weight: 1, points: 10, isTreasure: true }, 98 99 // id 26: $100 bill 100 { id: 26, roomDesc: "There is a 100 dollar bill here.", invDesc: "A $100 bill", weight: 0, points: 10, isTreasure: true }, 101 102 // id 27: floppy disk 103 { id: 27, roomDesc: "There is a floppy disk here.", invDesc: "A floppy disk", weight: 0, points: 0 }, 104 ]; 105 106 // Negative object IDs for permanent/scenery objects 107 export const PERMANENT_OBJECTS: Record<number, { roomDesc: string; examineDesc?: string }> = { 108 // -1: boulder 109 '-1': { 110 roomDesc: "There is a large boulder here.", 111 examineDesc: "It is just a boulder. It cannot be moved." 112 }, 113 114 // -2: tree 115 '-2': { 116 roomDesc: "There are palm trees here with coconuts.", 117 examineDesc: "They are palm trees with a bountiful supply of coconuts in them." 118 }, 119 120 // -3: bear 121 '-3': { 122 roomDesc: "There is a ferocious bear here!", 123 examineDesc: "It looks like a grizzly to me." 124 }, 125 126 // -4: bin 127 '-4': { 128 roomDesc: "There are many bins here.", 129 examineDesc: "All of the bins are empty. Looking closely you can see that there are names written at the bottom of each bin, but most of them are faded away so that you cannot read them. You can only make out three names:\n Jeffrey Collier\n Robert Toukmond\n Thomas Stock" 130 }, 131 132 // -5: computer/VAX 133 '-5': { 134 roomDesc: "There is a VAX 11/780 computer here.", 135 examineDesc: "It is just a garbled mess." 136 }, 137 138 // -7: dial 139 '-7': { 140 roomDesc: "There is a dial on the wall.", 141 examineDesc: "The dial points to a temperature scale which has long since faded away." 142 }, 143 144 // -8: button 145 '-8': { 146 roomDesc: "There is a button on the ground here.", 147 }, 148 149 // -9: chute (treasure chute) 150 '-9': { 151 roomDesc: "There is a chute here with a sign that says 'put treasures here for points'.", 152 }, 153 154 // -10: painting 155 '-10': { 156 roomDesc: "There is a painting hanging on the wall.", 157 examineDesc: "It is a velvet painting of Elvis Presley. It seems to be nailed to the wall, and you cannot move it." 158 }, 159 160 // -11: bed 161 '-11': { 162 roomDesc: "There is a queen-sized bed here.", 163 examineDesc: "It is a queen sized bed, with a very firm mattress." 164 }, 165 166 // -12: urinal 167 '-12': { 168 roomDesc: "There is a urinal on the wall.", 169 examineDesc: "The urinal is very clean compared with everything else in the cave. There isn't even any rust. Upon close examination you realize that the drain at the bottom is missing, and there is just a large hole leading down the pipes into nowhere. The hole is too small for a person to fit in. The flush handle is so clean that you can see your reflection in it." 170 }, 171 172 // -15: key box 173 '-15': { 174 roomDesc: "There is a box with a slit in it, bolted to the wall here.", 175 examineDesc: 'The box has a slit in the top of it, and on it, in sloppy handwriting, is written: \'For key upgrade, put key in here.\'' 176 }, 177 178 // -16: ethernet cable 179 '-16': { 180 roomDesc: "There is an ethernet cable here.", 181 }, 182 183 // -17: mail drop 184 '-17': { 185 roomDesc: "There is a mail drop here.", 186 examineDesc: 'It says \'express mail\' on it.' 187 }, 188 189 // -18: bus 190 '-18': { 191 roomDesc: "There is a bus here.", 192 examineDesc: "It is a 35 passenger bus with the company name 'mobytours' on it." 193 }, 194 195 // -19: gate 196 '-19': { 197 roomDesc: "There is a gate here.", 198 examineDesc: "It is a large metal gate that is too big to climb over." 199 }, 200 201 // -20: cliff 202 '-20': { 203 roomDesc: "There is a cliff here.", 204 examineDesc: "It is a HIGH cliff." 205 }, 206 207 // -21: dinosaur skeleton 208 '-21': { 209 roomDesc: "There is a huge dinosaur skeleton here.", 210 examineDesc: "Unfortunately you do not know enough about dinosaurs to tell very much about it. It is very big, though." 211 }, 212 213 // -22: fish 214 '-22': { 215 roomDesc: "There are dead fish here.", 216 examineDesc: "The fish look like they were once quite beautiful." 217 }, 218 219 // -23: tanks 220 '-23': { 221 roomDesc: "There are fish tanks here.", 222 }, 223 224 // -24: switch 225 '-24': { 226 roomDesc: "There is a switch on the wall labeled 'BL'.", 227 }, 228 229 // -25: blackboard 230 '-25': { 231 roomDesc: "There is a blackboard here.", 232 examineDesc: "On the blackboard is written, 'No children allowed downstairs.'" 233 }, 234 235 // -26: garbage disposal 236 '-26': { 237 roomDesc: "There is a garbage disposal here.", 238 }, 239 240 // -27: ladder 241 '-27': { 242 roomDesc: "There is a ladder here.", 243 examineDesc: "It is a normal ladder that is permanently attached to the hole." 244 }, 245 246 // -28: train/subway 247 '-28': { 248 roomDesc: "There is a train here.", 249 examineDesc: "It is a passenger train that is ready to go." 250 }, 251 252 // -29: PC 253 '-29': { 254 roomDesc: "There is a PC here.", 255 examineDesc: "It is a personal computer that has only one floppy disk drive." 256 }, 257 }; 258 259 // Create object name lookup map 260 export function createObjectNames(): Map<string, number> { 261 const map = new Map<string, number>(); 262 263 // Regular objects 264 const names: [string, number][] = [ 265 ['shovel', 0], 266 ['lamp', 1], 267 ['cpu', 2], ['board', 2], ['card', 2], ['chip', 2], 268 ['food', 3], 269 ['key', 4], 270 ['paper', 5], ['slip', 5], 271 ['rms', 6], ['statuette', 6], ['stallman', 6], 272 ['diamond', 7], 273 ['weight', 8], 274 ['life', 9], ['preserver', 9], 275 ['bracelet', 10], ['emerald', 10], 276 ['gold', 11], 277 ['platinum', 12], 278 ['towel', 13], ['beach', 13], 279 ['axe', 14], 280 ['silver', 15], 281 ['license', 16], 282 ['coins', 17], 283 ['egg', 18], 284 ['jar', 19], 285 ['bone', 20], 286 ['acid', 21], ['nitric', 21], 287 ['glycerine', 22], 288 ['ruby', 23], 289 ['amethyst', 24], 290 ['mona', 25], ['lis', 25], 291 ['bill', 26], ['dollar', 26], 292 ['floppy', 27], ['disk', 27], 293 294 // Permanent objects 295 ['boulder', -1], 296 ['tree', -2], ['trees', -2], ['palm', -2], ['coconut', -2], 297 ['bear', -3], 298 ['bin', -4], ['bins', -4], 299 ['cabinet', -5], ['computer', -5], ['vax', -5], ['ibm', -5], 300 ['dial', -7], 301 ['button', -8], 302 ['chute', -9], 303 ['painting', -10], 304 ['bed', -11], 305 ['urinal', -12], 306 ['box', -15], ['slit', -15], 307 ['cable', -16], ['ethernet', -16], 308 ['mail', -17], ['drop', -17], 309 ['bus', -18], 310 ['gate', -19], 311 ['cliff', -20], 312 ['skeleton', -21], ['dinosaur', -21], 313 ['fish', -22], 314 ['tanks', -23], ['tank', -23], 315 ['switch', -24], 316 ['blackboard', -25], 317 ['disposal', -26], ['garbage', -26], 318 ['ladder', -27], 319 ['subway', -28], ['train', -28], 320 ['pc', -29], ['drive', -29], 321 ]; 322 323 for (const [name, id] of names) { 324 map.set(name, id); 325 } 326 327 return map; 328 }