def.objects.h 13 KB

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