1 /* $OpenBSD: def.objects.h,v 1.5 2016/01/09 18:33:15 mestre Exp $*/ 2 /* $NetBSD: def.objects.h,v 1.3 1995/03/23 08:29:36 cgd Exp $*/ 3 4 /* 5 * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, 6 * Amsterdam 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions are 11 * met: 12 * 13 * - Redistributions of source code must retain the above copyright notice, 14 * this list of conditions and the following disclaimer. 15 * 16 * - Redistributions in binary form must reproduce the above copyright 17 * notice, this list of conditions and the following disclaimer in the 18 * documentation and/or other materials provided with the distribution. 19 * 20 * - Neither the name of the Stichting Centrum voor Wiskunde en 21 * Informatica, nor the names of its contributors may be used to endorse or 22 * promote products derived from this software without specific prior 23 * written permission. 24 * 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 26 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 27 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 28 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 29 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 30 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 31 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 */ 37 38 /* 39 * Copyright (c) 1982 Jay Fenlason <hack@gnu.org> 40 * All rights reserved. 41 * 42 * Redistribution and use in source and binary forms, with or without 43 * modification, are permitted provided that the following conditions 44 * are met: 45 * 1. Redistributions of source code must retain the above copyright 46 * notice, this list of conditions and the following disclaimer. 47 * 2. Redistributions in binary form must reproduce the above copyright 48 * notice, this list of conditions and the following disclaimer in the 49 * documentation and/or other materials provided with the distribution. 50 * 3. The name of the author may not be used to endorse or promote products 51 * derived from this software without specific prior written permission. 52 * 53 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 54 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 55 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 56 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 57 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 58 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 59 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 60 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 61 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 62 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 63 */ 64 65 /* objects have letter " % ) ( 0 _ ` [ ! ? / = * */ 66 struct objclass objects[] = { 67 68 { "strange object", NULL, NULL, 1, 0, 69 ILLOBJ_SYM, 0, 0, 0, 0, 0, 0 }, 70 { "amulet of Yendor", NULL, NULL, 1, 0, 71 AMULET_SYM, 100, 0, 2, 0, 0, 0 }, 72 73 #define FOOD(name,prob,delay,weight,nutrition) { name, NULL, NULL, 1, 1,\ 74 FOOD_SYM, prob, delay, weight, 0, 0, nutrition } 75 76 /* dog eats foods 0-4 but prefers 1 above 0,2,3,4 */ 77 /* food 4 can be read */ 78 /* food 5 improves your vision */ 79 /* food 6 makes you stronger (like Popeye) */ 80 /* foods CORPSE up to CORPSE+52 are cadavers */ 81 82 FOOD("food ration", 50, 5, 4, 800), 83 FOOD("tripe ration", 20, 1, 2, 200), 84 FOOD("pancake", 3, 1, 1, 200), 85 FOOD("dead lizard", 3, 0, 1, 40), 86 FOOD("fortune cookie", 7, 0, 1, 40), 87 FOOD("carrot", 2, 0, 1, 50), 88 FOOD("tin", 7, 0, 1, 0), 89 FOOD("orange", 1, 0, 1, 80), 90 FOOD("apple", 1, 0, 1, 50), 91 FOOD("pear", 1, 0, 1, 50), 92 FOOD("melon", 1, 0, 1, 100), 93 FOOD("banana", 1, 0, 1, 80), 94 FOOD("candy bar", 1, 0, 1, 100), 95 FOOD("egg", 1, 0, 1, 80), 96 FOOD("clove of garlic", 1, 0, 1, 40), 97 FOOD("lump of royal jelly", 0, 0, 1, 200), 98 99 FOOD("dead human", 0, 4, 40, 400), 100 FOOD("dead giant ant", 0, 1, 3, 30), 101 FOOD("dead giant bat", 0, 1, 3, 30), 102 FOOD("dead centaur", 0, 5, 50, 500), 103 FOOD("dead dragon", 0, 15, 150, 1500), 104 FOOD("dead floating eye", 0, 1, 1, 10), 105 FOOD("dead freezing sphere", 0, 1, 1, 10), 106 FOOD("dead gnome", 0, 1, 10, 100), 107 FOOD("dead hobgoblin", 0, 2, 20, 200), 108 FOOD("dead stalker", 0, 4, 40, 400), 109 FOOD("dead jackal", 0, 1, 10, 100), 110 FOOD("dead kobold", 0, 1, 10, 100), 111 FOOD("dead leprechaun", 0, 4, 40, 400), 112 FOOD("dead mimic", 0, 4, 40, 400), 113 FOOD("dead nymph", 0, 4, 40, 400), 114 FOOD("dead orc", 0, 2, 20, 200), 115 FOOD("dead purple worm", 0, 7, 70, 700), 116 FOOD("dead quasit", 0, 2, 20, 200), 117 FOOD("dead rust monster", 0, 5, 50, 500), 118 FOOD("dead snake", 0, 1, 10, 100), 119 FOOD("dead troll", 0, 4, 40, 400), 120 FOOD("dead umber hulk", 0, 5, 50, 500), 121 FOOD("dead vampire", 0, 4, 40, 400), 122 FOOD("dead wraith", 0, 1, 1, 10), 123 FOOD("dead xorn", 0, 7, 70, 700), 124 FOOD("dead yeti", 0, 7, 70, 700), 125 FOOD("dead zombie", 0, 1, 3, 30), 126 FOOD("dead acid blob", 0, 1, 3, 30), 127 FOOD("dead giant beetle", 0, 1, 1, 10), 128 FOOD("dead cockatrice", 0, 1, 3, 30), 129 FOOD("dead dog", 0, 2, 20, 200), 130 FOOD("dead ettin", 0, 1, 3, 30), 131 FOOD("dead fog cloud", 0, 1, 1, 10), 132 FOOD("dead gelatinous cube", 0, 1, 10, 100), 133 FOOD("dead homunculus", 0, 2, 20, 200), 134 FOOD("dead imp", 0, 1, 1, 10), 135 FOOD("dead jaguar", 0, 3, 30, 300), 136 FOOD("dead killer bee", 0, 1, 1, 10), 137 FOOD("dead leocrotta", 0, 5, 50, 500), 138 FOOD("dead minotaur", 0, 7, 70, 700), 139 FOOD("dead nurse", 0, 4, 40, 400), 140 FOOD("dead owlbear", 0, 7, 70, 700), 141 FOOD("dead piercer", 0, 2, 20, 200), 142 FOOD("dead quivering blob", 0, 1, 10, 100), 143 FOOD("dead giant rat", 0, 1, 3, 30), 144 FOOD("dead giant scorpion", 0, 1, 10, 100), 145 FOOD("dead tengu", 0, 3, 30, 300), 146 FOOD("dead unicorn", 0, 3, 30, 300), 147 FOOD("dead violet fungi", 0, 1, 10, 100), 148 FOOD("dead long worm", 0, 5, 50, 500), 149 /* %% wt of long worm should be proportional to its length */ 150 FOOD("dead xan", 0, 3, 30, 300), 151 FOOD("dead yellow light", 0, 1, 1, 10), 152 FOOD("dead zruty", 0, 6, 60, 600), 153 154 /* weapons ... - ROCK come several at a time */ 155 /* weapons ... - (ROCK-1) are shot using idem+(BOW-ARROW) */ 156 /* weapons AXE, SWORD, THSWORD are good for worm-cutting */ 157 /* weapons (PICK-)AXE, DAGGER, CRYSKNIFE are good for tin-opening */ 158 #define WEAPON(name,prob,wt,ldam,sdam) { name, NULL, NULL, 1, 0 /*%%*/,\ 159 WEAPON_SYM, prob, 0, wt, ldam, sdam, 0 } 160 161 WEAPON("arrow", 7, 0, 6, 6), 162 WEAPON("sling bullet", 7, 0, 4, 6), 163 WEAPON("crossbow bolt", 7, 0, 4, 6), 164 WEAPON("dart", 7, 0, 3, 2), 165 WEAPON("rock", 6, 1, 3, 3), 166 WEAPON("boomerang", 2, 3, 9, 9), 167 WEAPON("mace", 9, 3, 6, 7), 168 WEAPON("axe", 6, 3, 6, 4), 169 WEAPON("flail", 6, 3, 6, 5), 170 WEAPON("long sword", 8, 3, 8, 12), 171 WEAPON("two handed sword", 6, 4, 12, 6), 172 WEAPON("dagger", 6, 3, 4, 3), 173 WEAPON("worm tooth", 0, 4, 2, 2), 174 WEAPON("crysknife", 0, 3, 10, 10), 175 WEAPON("spear", 6, 3, 6, 8), 176 WEAPON("bow", 6, 3, 4, 6), 177 WEAPON("sling", 5, 3, 6, 6), 178 WEAPON("crossbow", 6, 3, 4, 6), 179 180 { "whistle", "whistle", NULL, 0, 0, 181 TOOL_SYM, 90, 0, 2, 0, 0, 0 }, 182 { "magic whistle", "whistle", NULL, 0, 0, 183 TOOL_SYM, 10, 0, 2, 0, 0, 0 }, 184 { "expensive camera", NULL, NULL, 1, 1, 185 TOOL_SYM, 0, 0, 3, 0, 0, 0 }, 186 { "ice box", "large box", NULL, 0, 0, 187 TOOL_SYM, 0, 0, 40, 0, 0, 0 }, 188 { "pick-axe", NULL, NULL, 1, 1, 189 TOOL_SYM, 0, 0, 5, 6, 3, 0 }, 190 { "can opener", NULL, NULL, 1, 1, 191 TOOL_SYM, 0, 0, 1, 0, 0, 0 }, 192 { "heavy iron ball", NULL, NULL, 1, 0, 193 BALL_SYM, 100, 0, 20, 0, 0, 0 }, 194 { "iron chain", NULL, NULL, 1, 0, 195 CHAIN_SYM, 100, 0, 20, 0, 0, 0 }, 196 { "enormous rock", NULL, NULL, 1, 0, 197 ROCK_SYM, 100, 0, 200 /* > MAX_CARR_CAP */, 0, 0, 0 }, 198 199 #define ARMOR(name,prob,delay,ac,can) { name, NULL, NULL, 1, 0,\ 200 ARMOR_SYM, prob, delay, 8, ac, can, 0 } 201 ARMOR("helmet", 3, 1, 9, 0), 202 ARMOR("plate mail", 5, 5, 3, 2), 203 ARMOR("splint mail", 8, 5, 4, 1), 204 ARMOR("banded mail", 10, 5, 4, 0), 205 ARMOR("chain mail", 10, 5, 5, 1), 206 ARMOR("scale mail", 10, 5, 6, 0), 207 ARMOR("ring mail", 15, 5, 7, 0), 208 /* the armors below do not rust */ 209 ARMOR("studded leather armor", 13, 3, 7, 1), 210 ARMOR("leather armor", 17, 3, 8, 0), 211 ARMOR("elven cloak", 5, 0, 9, 3), 212 ARMOR("shield", 3, 0, 9, 0), 213 ARMOR("pair of gloves", 1, 1, 9, 0), 214 215 #define POTION(name,color) { name, color, NULL, 0, 1,\ 216 POTION_SYM, 0, 0, 2, 0, 0, 0 } 217 218 POTION("restore strength", "orange"), 219 POTION("booze", "bubbly"), 220 POTION("invisibility", "glowing"), 221 POTION("fruit juice", "smoky"), 222 POTION("healing", "pink"), 223 POTION("paralysis", "puce"), 224 POTION("monster detection", "purple"), 225 POTION("object detection", "yellow"), 226 POTION("sickness", "white"), 227 POTION("confusion", "swirly"), 228 POTION("gain strength", "purple-red"), 229 POTION("speed", "ruby"), 230 POTION("blindness", "dark green"), 231 POTION("gain level", "emerald"), 232 POTION("extra healing", "sky blue"), 233 POTION("levitation", "brown"), 234 POTION(NULL, "brilliant blue"), 235 POTION(NULL, "clear"), 236 POTION(NULL, "magenta"), 237 POTION(NULL, "ebony"), 238 239 #define SCROLL(name,text,prob) { name, text, NULL, 0, 1,\ 240 SCROLL_SYM, prob, 0, 3, 0, 0, 0 } 241 SCROLL("mail", "KIRJE", 0), 242 SCROLL("enchant armor", "ZELGO MER", 6), 243 SCROLL("destroy armor", "JUYED AWK YACC", 5), 244 SCROLL("confuse monster", "NR 9", 5), 245 SCROLL("scare monster", "XIXAXA XOXAXA XUXAXA", 4), 246 SCROLL("blank paper", "READ ME", 3), 247 SCROLL("remove curse", "PRATYAVAYAH", 6), 248 SCROLL("enchant weapon", "DAIYEN FOOELS", 6), 249 SCROLL("damage weapon", "HACKEM MUCHE", 5), 250 SCROLL("create monster", "LEP GEX VEN ZEA", 5), 251 SCROLL("taming", "PRIRUTSENIE", 1), 252 SCROLL("genocide", "ELBIB YLOH",2), 253 SCROLL("light", "VERR YED HORRE", 10), 254 SCROLL("teleportation", "VENZAR BORGAVVE", 5), 255 SCROLL("gold detection", "THARR", 4), 256 SCROLL("food detection", "YUM YUM", 1), 257 SCROLL("identify", "KERNOD WEL", 18), 258 SCROLL("magic mapping", "ELAM EBOW", 5), 259 SCROLL("amnesia", "DUAM XNAHT", 3), 260 SCROLL("fire", "ANDOVA BEGARIN", 5), 261 SCROLL("punishment", "VE FORBRYDERNE", 1), 262 SCROLL(NULL, "VELOX NEB", 0), 263 SCROLL(NULL, "FOOBIE BLETCH", 0), 264 SCROLL(NULL, "TEMOV", 0), 265 SCROLL(NULL, "GARVEN DEH", 0), 266 267 #define WAND(name,metal,prob,flags) { name, metal, NULL, 0, 0,\ 268 WAND_SYM, prob, 0, 3, flags, 0, 0 } 269 270 WAND("light", "iridium", 10, NODIR), 271 WAND("secret door detection", "tin", 5, NODIR), 272 WAND("create monster", "platinum", 5, NODIR), 273 WAND("wishing", "glass", 1, NODIR), 274 WAND("striking", "zinc", 9, IMMEDIATE), 275 WAND("slow monster", "balsa", 5, IMMEDIATE), 276 WAND("speed monster", "copper", 5, IMMEDIATE), 277 WAND("undead turning", "silver", 5, IMMEDIATE), 278 WAND("polymorph", "brass", 5, IMMEDIATE), 279 WAND("cancellation", "maple", 5, IMMEDIATE), 280 WAND("teleportation", "pine", 5, IMMEDIATE), 281 WAND("make invisible", "marble", 9, IMMEDIATE), 282 WAND("digging", "iron", 5, RAY), 283 WAND("magic missile", "aluminium", 10, RAY), 284 WAND("fire", "steel", 5, RAY), 285 WAND("sleep", "curved", 5, RAY), 286 WAND("cold", "short", 5, RAY), 287 WAND("death", "long", 1, RAY), 288 WAND(NULL, "oak", 0, 0), 289 WAND(NULL, "ebony", 0, 0), 290 WAND(NULL, "runed", 0, 0), 291 292 #define RING(name,stone,spec) { name, stone, NULL, 0, 0,\ 293 RING_SYM, 0, 0, 1, spec, 0, 0 } 294 295 RING("adornment", "engagement", 0), 296 RING("teleportation", "wooden", 0), 297 RING("regeneration", "black onyx", 0), 298 RING("searching", "topaz", 0), 299 RING("see invisible", "pearl", 0), 300 RING("stealth", "sapphire", 0), 301 RING("levitation", "moonstone", 0), 302 RING("poison resistance", "agate", 0), 303 RING("aggravate monster", "tiger eye", 0), 304 RING("hunger", "shining", 0), 305 RING("fire resistance", "gold", 0), 306 RING("cold resistance", "copper", 0), 307 RING("protection from shape changers", "diamond", 0), 308 RING("conflict", "jade", 0), 309 RING("gain strength", "ruby", SPEC), 310 RING("increase damage", "silver", SPEC), 311 RING("protection", "granite", SPEC), 312 RING("warning", "wire", 0), 313 RING("teleport control", "iron", 0), 314 RING(NULL, "ivory", 0), 315 RING(NULL, "blackened", 0), 316 317 /* gems ************************************************************/ 318 #define GEM(name,color,prob,gval) { name, color, NULL, 0, 1,\ 319 GEM_SYM, prob, 0, 1, 0, 0, gval } 320 GEM("diamond", "blue", 1, 4000), 321 GEM("ruby", "red", 1, 3500), 322 GEM("sapphire", "blue", 1, 3000), 323 GEM("emerald", "green", 1, 2500), 324 GEM("turquoise", "green", 1, 2000), 325 GEM("aquamarine", "blue", 1, 1500), 326 GEM("tourmaline", "green", 1, 1000), 327 GEM("topaz", "yellow", 1, 900), 328 GEM("opal", "yellow", 1, 800), 329 GEM("garnet", "dark", 1, 700), 330 GEM("amethyst", "violet", 2, 650), 331 GEM("agate", "green", 2, 600), 332 GEM("onyx", "white", 2, 550), 333 GEM("jasper", "yellowish brown", 2, 500), 334 GEM("jade", "green", 2, 450), 335 GEM("worthless piece of blue glass", "blue", 20, 0), 336 GEM("worthless piece of red glass", "red", 20, 0), 337 GEM("worthless piece of yellow glass", "yellow", 20, 0), 338 GEM("worthless piece of green glass", "green", 20, 0), 339 { NULL, NULL, NULL, 0, 0, ILLOBJ_SYM, 0, 0, 0, 0, 0, 0 } 340 }; 341 342 char obj_symbols[] = { 343 ILLOBJ_SYM, AMULET_SYM, FOOD_SYM, WEAPON_SYM, TOOL_SYM, 344 BALL_SYM, CHAIN_SYM, ROCK_SYM, ARMOR_SYM, POTION_SYM, SCROLL_SYM, 345 WAND_SYM, RING_SYM, GEM_SYM, 0 }; 346 int bases[sizeof(obj_symbols)]; 347