Source:NetHack 5.0.0/include/permonst.h
Jump to navigation
Jump to search
Below is the full text to permonst.h from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/include/permonst.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 permonst.h $NHDT-Date: 1725653014 2024/09/06 20:03:34 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.26 $ */ 2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3. /*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */ 4. /* NetHack may be freely redistributed. See license for details. */ 5. 6. #ifndef PERMONST_H 7. #define PERMONST_H 8. 9. enum monnums { 10. #define MONS_ENUM 11. #include "monsters.h" 12. #undef MONS_ENUM 13. NUMMONS, 14. NON_PM = -1, /* "not a monster" */ 15. LOW_PM = NON_PM + 1, /* first monster in mons */ 16. LEAVESTATUE = NON_PM - 1, /* leave statue instead of corpse; 17. * there are two lower values assigned 18. * in end.c so that (x == LEAVESTATUE) 19. * will test FALSE in bones.c: 20. * (NON_PM - 2) for no corpse 21. * (NON_PM - 3) for no corpse, no grave */ 22. HIGH_PM = NUMMONS - 1, 23. SPECIAL_PM = PM_LONG_WORM_TAIL /* [normal] < ~ < [special] */ 24. /* mons[SPECIAL_PM] through mons[NUMMONS-1], inclusive, are 25. never generated randomly and cannot be polymorphed into */ 26. }; 27. 28. /* This structure covers all attack forms. 29. * aatyp is the gross attack type (eg. claw, bite, breath, ...) 30. * adtyp is the damage type (eg. physical, fire, cold, spell, ...) 31. * damn is the number of hit dice of damage from the attack. 32. * damd is the number of sides on each die. 33. * 34. * Some attacks can do no points of damage. Additionally, some can 35. * have special effects *and* do damage as well. If damn and damd 36. * are set, they may have a special meaning. For example, if set 37. * for a blinding attack, they determine the amount of time blinded. 38. */ 39. 40. struct attack { 41. uchar aatyp; 42. uchar adtyp, damn, damd; 43. }; 44. 45. /* Max # of attacks for any given monster. 46. */ 47. 48. #define NATTK 6 49. 50. #ifndef ALIGN_H 51. #include "align.h" 52. #endif 53. #include "monattk.h" 54. #include "monflag.h" 55. 56. struct permonst { 57. const char *pmnames[NUM_MGENDERS]; 58. const enum monnums pmidx; /* mons array index aka PM_ identifier */ 59. char mlet; /* symbol */ 60. schar mlevel, /* base monster level */ 61. mmove, /* move speed */ 62. ac, /* (base) armor class */ 63. mr; /* (base) magic resistance */ 64. aligntyp maligntyp; /* basic monster alignment */ 65. unsigned short geno; /* creation/geno mask value */ 66. struct attack mattk[NATTK]; /* attacks matrix */ 67. unsigned cwt; /* weight of corpse */ 68. unsigned short cnutrit; /* its nutritional value */ 69. uchar msound; /* noise it makes (6 bits) */ 70. uchar msize; /* physical size (3 bits) */ 71. uchar mresists; /* resistances */ 72. uchar mconveys; /* conveyed by eating */ 73. unsigned long mflags1, /* boolean bitflags */ 74. mflags2; /* more boolean bitflags */ 75. unsigned short mflags3; /* yet more boolean bitflags */ 76. uchar difficulty; /* toughness (formerly from makedefs -m) */ 77. uchar mcolor; /* color to use */ 78. }; 79. 80. #define NORMAL_SPEED 12 81. 82. extern NEARDATA struct permonst mons[NUMMONS + 1]; /* the master list of 83. * monster types */ 84. 85. #endif /* PERMONST_H */