Source:NetHack 5.0.0/include/artilist.h
Jump to navigation
Jump to search
Below is the full text to artilist.h from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/include/artilist.h#line12]], for example.
The NetHack General Public License applies to screenshots, source code and other content from NetHack.
This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.
1. /* NetHack 5.0 artilist.h $NHDT-Date: 1710957374 2024/03/20 17:56:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.30 $ */ 2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3. /*-Copyright (c) Robert Patrick Rankin, 2017. */ 4. /* NetHack may be freely redistributed. See license for details. */ 5. 6. #if defined(MAKEDEFS_C) || defined (MDLIB_C) 7. /* in makedefs.c, all we care about is the list of names */ 8. 9. #define A(nam, typ, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, \ 10. gs, gv, cost, clr, bn) nam 11. 12. static const char *const artifact_names[] = { 13. 14. #elif defined(ARTI_ENUM) 15. #define A(nam, typ, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, \ 16. gs, gv, cost, clr, bn) \ 17. ART_##bn 18. 19. #elif defined(DUMP_ARTI_ENUM) 20. #define A(nam, typ, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, \ 21. gs, gv, cost, clr, bn) \ 22. { ART_##bn, "ART_" #bn } 23. #else 24. /* in artifact.c, set up the actual artifact list structure; 25. color field is for an artifact when it glows, not for the item itself */ 26. 27. #define A(nam, typ, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, \ 28. gs, gv, cost, clr, bn) \ 29. { \ 30. typ, nam, s1, s2, mt, atk, dfn, cry, inv, al, cl, rac, \ 31. gs, gv, cost, clr \ 32. } 33. 34. /* clang-format off */ 35. #define NO_ATTK {0,0,0,0} /* no attack */ 36. #define NO_DFNS {0,0,0,0} /* no defense */ 37. #define NO_CARY {0,0,0,0} /* no carry effects */ 38. #define DFNS(c) {0,c,0,0} 39. #define CARY(c) {0,c,0,0} 40. #define PHYS(a,b) {0,AD_PHYS,a,b} /* physical */ 41. #define DRLI(a,b) {0,AD_DRLI,a,b} /* life drain */ 42. #define COLD(a,b) {0,AD_COLD,a,b} 43. #define FIRE(a,b) {0,AD_FIRE,a,b} 44. #define ELEC(a,b) {0,AD_ELEC,a,b} /* electrical shock */ 45. #define STUN(a,b) {0,AD_STUN,a,b} /* magical attack */ 46. #define POIS(a,b) {0,AD_DRST,a,b} /* poison */ 47. /* clang-format on */ 48. 49. static NEARDATA struct artifact artilist[] = { 50. #endif /* MAKEDEFS_C || MDLIB_C */ 51. 52. /* Artifact cost rationale: 53. * 1. The more useful the artifact, the better its cost. 54. * 2. Quest artifacts are highly valued. 55. * 3. Chaotic artifacts are inflated due to scarcity (and balance). 56. * 57. * Artifact gen_spe rationale: 58. * 1. If the artifact is useful against most enemies, +0. 59. * 2. If the artifact is useful against only a few enemies, usually +2. 60. * This gives the artifact use to early-game characters who receive 61. * it as a gift or find it on the ground. 62. * 3. Role gift gen_spe is chosen to balance against the role's 63. * default starting weapon (it should be better, but need not be 64. * much better). 65. * 4. This can be modified as required for special cases. 66. * (In some cases, like Excalibur, the value is irrelevant.) 67. * 5. Nonweapon spe may have a special meaning, so gen_spe for 68. * nonweapons must always be 0. 69. * 70. * Artifact gift_value is chosen so that "endgame-quality" artifacts are 71. * not gifted in the early game (so that characters don't grind on an 72. * altar early-game until they have their endgame weapon, then use it to 73. * carry them through the game). Those artifacts have values ranging from 74. * around 8 to 10, based on how good the artifact is. Less powerful 75. * artifacts have values in the 1 to 5 range. Values in between are used 76. * for conditionally good artifacts. (Note that the value of a gift is 77. * normally 1 higher than the difficulty of the monster.) 78. */ 79. 80. /* dummy element #0, so that all interesting indices are non-zero */ 81. A("", STRANGE_OBJECT, 0, 0, 0, NO_ATTK, NO_DFNS, NO_CARY, 0, A_NONE, 82. NON_PM, NON_PM, 83. 0, 0, 0L, NO_COLOR, NONARTIFACT), 84. 85. A("Excalibur", LONG_SWORD, (SPFX_NOGEN | SPFX_RESTR | SPFX_SEEK 86. | SPFX_DEFN | SPFX_INTEL | SPFX_SEARCH), 87. 0, 0, PHYS(5, 10), DRLI(0, 0), NO_CARY, 0, A_LAWFUL, PM_KNIGHT, NON_PM, 88. 0, 10, 4000L, NO_COLOR, EXCALIBUR), 89. /* 90. * Stormbringer only has a 2 because it can drain a level, 91. * providing 8 more. 92. */ 93. A("Stormbringer", RUNESWORD, 94. (SPFX_RESTR | SPFX_ATTK | SPFX_DEFN | SPFX_INTEL | SPFX_DRLI), 0, 0, 95. DRLI(5, 2), DRLI(0, 0), NO_CARY, 0, A_CHAOTIC, NON_PM, NON_PM, 96. 0, 9, 8000L, NO_COLOR, STORMBRINGER), 97. /* 98. * Mjollnir can be thrown when wielded if hero has 25 Strength 99. * (usually via gauntlets of power but possible with rings of 100. * gain strength). If the thrower is a Valkyrie, Mjollnir will 101. * usually (99%) return and then usually (separate 99%) be caught 102. * and automatically be re-wielded. When returning Mjollnir is 103. * not caught, there is a 50:50 chance of hitting hero for damage 104. * and its lightning shock might destroy some wands and/or rings. 105. * 106. * Monsters don't throw Mjollnir regardless of strength (not even 107. * fake-player valkyries). 108. */ 109. A("Mjollnir", WAR_HAMMER, /* Mjo:llnir */ 110. (SPFX_RESTR | SPFX_ATTK), 0, 0, ELEC(5, 24), NO_DFNS, NO_CARY, 0, 111. A_NEUTRAL, PM_VALKYRIE, NON_PM, 112. 0, 8, 4000L, NO_COLOR, MJOLLNIR), 113. 114. A("Cleaver", BATTLE_AXE, SPFX_RESTR, 0, 0, PHYS(3, 6), NO_DFNS, NO_CARY, 115. 0, A_NEUTRAL, PM_BARBARIAN, NON_PM, 116. 0, 8, 1500L, NO_COLOR, CLEAVER), 117. 118. /* 119. * Grimtooth glows in warning when elves are present, but its 120. * damage bonus applies to all targets rather than just elves 121. * (handled as special case in spec_dbon()). 122. */ 123. A("Grimtooth", ORCISH_DAGGER, (SPFX_RESTR | SPFX_WARN | SPFX_DFLAG2), 124. 0, M2_ELF, PHYS(2, 6), POIS(0,0), 125. NO_CARY, FLING_POISON, A_CHAOTIC, NON_PM, PM_ORC, 126. 0, 5, 1200L, CLR_RED, GRIMTOOTH), 127. /* 128. * Orcrist and Sting have same alignment as elves. 129. * 130. * The combination of SPFX_WARN+SPFX_DFLAG2+M2_value will trigger 131. * EWarn_of_mon for all monsters that have the M2_value flag. 132. * Sting and Orcrist will warn of M2_ORC monsters. 133. */ 134. A("Orcrist", ELVEN_BROADSWORD, (SPFX_WARN | SPFX_DFLAG2), 0, M2_ORC, 135. PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ELF, 136. 3, 4, 2000L, CLR_BRIGHT_BLUE, ORCRIST), /* actually light blue */ 137. 138. A("Sting", ELVEN_DAGGER, (SPFX_WARN | SPFX_DFLAG2), 0, M2_ORC, 139. PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_CHAOTIC, NON_PM, PM_ELF, 140. 3, 1, 800L, CLR_BRIGHT_BLUE, STING), 141. /* 142. * Magicbane is a bit different! Its magic fanfare 143. * unbalances victims in addition to doing some damage. 144. */ 145. A("Magicbane", ATHAME, (SPFX_RESTR | SPFX_ATTK | SPFX_DEFN), 0, 0, 146. STUN(3, 4), DFNS(AD_MAGM), NO_CARY, 0, A_NEUTRAL, PM_WIZARD, NON_PM, 147. 0, 7, 3500L, NO_COLOR, MAGICBANE), 148. 149. A("Frost Brand", LONG_SWORD, (SPFX_RESTR | SPFX_ATTK | SPFX_DEFN), 0, 0, 150. COLD(5, 0), COLD(0, 0), NO_CARY, SNOWSTORM, A_NONE, NON_PM, NON_PM, 151. 0, 9, 3000L, NO_COLOR, FROST_BRAND), 152. 153. A("Fire Brand", LONG_SWORD, (SPFX_RESTR | SPFX_ATTK | SPFX_DEFN), 0, 0, 154. FIRE(5, 0), FIRE(0, 0), NO_CARY, FIRESTORM, A_NONE, NON_PM, NON_PM, 155. 0, 5, 3000L, NO_COLOR, FIRE_BRAND), 156. 157. A("Dragonbane", BROADSWORD, 158. (SPFX_RESTR | SPFX_DCLAS | SPFX_REFLECT), 0, S_DRAGON, 159. PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 160. 2, 5, 500L, NO_COLOR, DRAGONBANE), 161. 162. A("Demonbane", SILVER_MACE, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_DEMON, 163. PHYS(5, 0), NO_DFNS, NO_CARY, BANISH, A_LAWFUL, PM_CLERIC, NON_PM, 164. 1, 3, 2500L, NO_COLOR, DEMONBANE), 165. 166. A("Werebane", SILVER_SABER, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_WERE, 167. PHYS(5, 0), DFNS(AD_WERE), NO_CARY, 0, A_NONE, NON_PM, NON_PM, 168. 1, 4, 1500L, NO_COLOR, WEREBANE), 169. 170. A("Grayswandir", SILVER_SABER, (SPFX_RESTR | SPFX_HALRES), 0, 0, 171. PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_LAWFUL, NON_PM, NON_PM, 172. 0, 10, 8000L, NO_COLOR, GRAYSWANDIR), 173. 174. A("Giantslayer", LONG_SWORD, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_GIANT, 175. PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NEUTRAL, NON_PM, NON_PM, 176. 2, 4, 200L, NO_COLOR, GIANTSLAYER), 177. 178. A("Ogresmasher", WAR_HAMMER, (SPFX_RESTR | SPFX_DCLAS), 0, S_OGRE, 179. PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 180. 2, 1, 200L, NO_COLOR, OGRESMASHER), 181. 182. A("Trollsbane", MORNING_STAR, (SPFX_RESTR | SPFX_DCLAS | SPFX_REGEN), 0, 183. S_TROLL, PHYS(5, 0), NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 184. 2, 1, 200L, NO_COLOR, TROLLSBANE), 185. 186. /* 187. * Two problems: 1) doesn't let trolls regenerate heads, 188. * 2) doesn't give unusual message for 2-headed monsters (but 189. * allowing those at all causes more problems than worth the effort). 190. */ 191. A("Vorpal Blade", LONG_SWORD, (SPFX_RESTR | SPFX_BEHEAD), 0, 0, 192. PHYS(5, 1), NO_DFNS, NO_CARY, 0, A_NEUTRAL, NON_PM, NON_PM, 193. 1, 5, 4000L, NO_COLOR, VORPAL_BLADE), 194. 195. /* 196. * Ah, never shall I forget the cry, 197. * or the shriek that shrieked he, 198. * As I gnashed my teeth, and from my sheath 199. * I drew my Snickersnee! 200. * --Ko-Ko, Lord high executioner of Titipu 201. * (From Sir W.S. Gilbert's "The Mikado") 202. */ 203. A("Snickersnee", KATANA, SPFX_RESTR, 0, 0, PHYS(0, 8), NO_DFNS, NO_CARY, 204. 0, A_LAWFUL, PM_SAMURAI, NON_PM, 205. 0, 8, 1200L, NO_COLOR, SNICKERSNEE), 206. 207. /* Sunsword emits light when wielded (handled in the core rather than 208. via artifact fields), but that light has no particular color */ 209. A("Sunsword", LONG_SWORD, (SPFX_RESTR | SPFX_DFLAG2), 0, M2_UNDEAD, 210. PHYS(5, 0), DFNS(AD_BLND), NO_CARY, BLINDING_RAY, A_LAWFUL, NON_PM, 211. NON_PM, 212. 0, 6, 1500L, NO_COLOR, SUNSWORD), 213. 214. /* 215. * The artifacts for the quest dungeon, all self-willed. 216. * gen_spe should be 0; gift_value irrelevant and set to 12. 217. */ 218. 219. A("The Orb of Detection", CRYSTAL_BALL, 220. (SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL), (SPFX_ESP | SPFX_HSPDAM), 0, 221. NO_ATTK, NO_DFNS, CARY(AD_MAGM), INVIS, A_LAWFUL, PM_ARCHEOLOGIST, 222. NON_PM, 223. 0, 12, 2500L, NO_COLOR, ORB_OF_DETECTION), 224. 225. A("The Heart of Ahriman", LUCKSTONE, 226. (SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL), SPFX_STLTH, 0, 227. /* this stone does double damage if used as a projectile weapon */ 228. PHYS(5, 0), NO_DFNS, NO_CARY, LEVITATION, A_NEUTRAL, PM_BARBARIAN, 229. NON_PM, 230. 0, 12, 2500L, NO_COLOR, HEART_OF_AHRIMAN), 231. 232. A("The Sceptre of Might", MACE, 233. (SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_DALIGN), 0, 0, PHYS(5, 0), 234. DFNS(AD_MAGM), NO_CARY, CONFLICT, A_LAWFUL, PM_CAVE_DWELLER, NON_PM, 235. 0, 12, 2500L, NO_COLOR, SCEPTRE_OF_MIGHT), 236. 237. #if 0 /* OBSOLETE -- from 3.1.0 to 3.2.x, this was quest artifact for the 238. * Elf role; in 3.3.0 elf became a race available to several roles 239. * and the Elf role along with its quest was eliminated; it's a bit 240. * overpowered to be an ordinary artifact so leave it excluded */ 241. A("The Palantir of Westernesse", CRYSTAL_BALL, 242. (SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL), 243. (SPFX_ESP | SPFX_REGEN | SPFX_HSPDAM), 0, 244. NO_ATTK, NO_DFNS, NO_CARY, TAMING, A_CHAOTIC, NON_PM, PM_ELF, 245. 0, 12, 8000L, NO_COLOR, PALANTIR_OF_WESTERNESSE), 246. #endif 247. 248. A("The Staff of Aesculapius", QUARTERSTAFF, 249. (SPFX_NOGEN | SPFX_RESTR | SPFX_ATTK | SPFX_INTEL | SPFX_DRLI 250. | SPFX_REGEN), 251. 0, 0, DRLI(0, 0), DRLI(0, 0), NO_CARY, HEALING, A_NEUTRAL, PM_HEALER, 252. NON_PM, 253. 0, 12, 5000L, NO_COLOR, STAFF_OF_AESCULAPIUS), 254. 255. A("The Magic Mirror of Merlin", MIRROR, 256. (SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_SPEAK), SPFX_ESP, 0, 257. NO_ATTK, NO_DFNS, CARY(AD_MAGM), 0, A_LAWFUL, PM_KNIGHT, NON_PM, 258. 0, 12, 1500L, NO_COLOR, MAGIC_MIRROR_OF_MERLIN), 259. 260. A("The Eyes of the Overworld", LENSES, 261. (SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_XRAY), 0, 0, NO_ATTK, 262. DFNS(AD_MAGM), NO_CARY, ENLIGHTENING, A_NEUTRAL, PM_MONK, NON_PM, 263. 0, 12, 2500L, NO_COLOR, EYES_OF_THE_OVERWORLD), 264. 265. A("The Mitre of Holiness", HELM_OF_BRILLIANCE, 266. (SPFX_NOGEN | SPFX_RESTR | SPFX_DFLAG2 | SPFX_INTEL | SPFX_PROTECT), 0, 267. M2_UNDEAD, NO_ATTK, NO_DFNS, CARY(AD_FIRE), ENERGY_BOOST, A_LAWFUL, 268. PM_CLERIC, NON_PM, 269. 0, 12, 2000L, NO_COLOR, MITRE_OF_HOLINESS), 270. 271. A("The Longbow of Diana", BOW, 272. (SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_REFLECT), SPFX_ESP, 0, 273. PHYS(5, 0), NO_DFNS, NO_CARY, CREATE_AMMO, A_CHAOTIC, PM_RANGER, NON_PM, 274. 0, 12, 4000L, NO_COLOR, LONGBOW_OF_DIANA), 275. 276. /* MKoT has an additional carry property if the Key is not cursed (for 277. rogues) or blessed (for non-rogues): #untrap of doors and chests 278. will always find any traps and disarming those will always succeed */ 279. A("The Master Key of Thievery", SKELETON_KEY, 280. (SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_SPEAK), 281. (SPFX_WARN | SPFX_TCTRL | SPFX_HPHDAM), 0, NO_ATTK, NO_DFNS, NO_CARY, 282. UNTRAP, A_CHAOTIC, PM_ROGUE, NON_PM, 283. 0, 12, 3500L, NO_COLOR, MASTER_KEY_OF_THIEVERY), 284. 285. A("The Tsurugi of Muramasa", TSURUGI, 286. (SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_BEHEAD | SPFX_LUCK 287. | SPFX_PROTECT), 288. 0, 0, PHYS(0, 8), NO_DFNS, NO_CARY, 0, A_LAWFUL, PM_SAMURAI, NON_PM, 289. 0, 12, 4500L, NO_COLOR, TSURUGI_OF_MURAMASA), 290. 291. A("The Platinum Yendorian Express Card", CREDIT_CARD, 292. (SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_DEFN), 293. (SPFX_ESP | SPFX_HSPDAM), 0, NO_ATTK, NO_DFNS, CARY(AD_MAGM), 294. CHARGE_OBJ, A_NEUTRAL, PM_TOURIST, NON_PM, 295. 0, 12, 7000L, NO_COLOR, YENDORIAN_EXPRESS_CARD), 296. 297. A("The Orb of Fate", CRYSTAL_BALL, 298. (SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL | SPFX_LUCK), 299. (SPFX_WARN | SPFX_HSPDAM | SPFX_HPHDAM), 0, NO_ATTK, NO_DFNS, NO_CARY, 300. LEV_TELE, A_NEUTRAL, PM_VALKYRIE, NON_PM, 301. 0, 12, 3500L, NO_COLOR, ORB_OF_FATE), 302. 303. A("The Eye of the Aethiopica", AMULET_OF_ESP, 304. (SPFX_NOGEN | SPFX_RESTR | SPFX_INTEL), (SPFX_EREGEN | SPFX_HSPDAM), 0, 305. NO_ATTK, DFNS(AD_MAGM), NO_CARY, CREATE_PORTAL, A_NEUTRAL, PM_WIZARD, 306. NON_PM, 307. 0, 12, 4000L, NO_COLOR, EYE_OF_THE_AETHIOPICA), 308. 309. #if !defined(ARTI_ENUM) && !defined(DUMP_ARTI_ENUM) 310. /* 311. * terminator; otyp must be zero 312. */ 313. A(0, 0, 0, 0, 0, NO_ATTK, NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 314. 0, 0, 0L, NO_COLOR, TERMINATOR) 315. 316. }; /* artilist[] (or artifact_names[]) */ 317. #endif 318. 319. #undef A 320. 321. #ifdef NO_ATTK 322. #undef NO_ATTK 323. #undef NO_DFNS 324. #undef DFNS 325. #undef PHYS 326. #undef DRLI 327. #undef COLD 328. #undef FIRE 329. #undef ELEC 330. #undef STUN 331. #endif 332. 333. /*artilist.h*/