Source:NetHack 3.4.3/include/skills.h

From NetHackWiki
Jump to: navigation, search

Below is the full text to include/skills.h from NetHack 3.4.3. To link to a particular line, write [[skills.h#line123]], for example.

  1. /*	SCCS Id: @(#)skills.h	3.4	1999/10/27	*/
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */
  3. /* NetHack may be freely redistributed.  See license for details. */

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. #ifndef SKILLS_H
  2. #define SKILLS_H
  3.  
  4. /* Much of this code was taken from you.h.  It is now
  5. * in a separate file so it can be included in objects.c.
  6. */
  7.  
  8.  
  9. /* Code to denote that no skill is applicable */
  10. #define P_NONE				0
  11.  
  12. /* Weapon Skills -- Stephen White
  13. * Order matters and are used in macros.
  14. * Positive values denote hand-to-hand weapons or launchers.
  15. * Negative values denote ammunition or missiles.
  16. * Update weapon.c if you ammend any skills.
  17. * Also used for oc_subtyp.
  18. */
  19. #define P_DAGGER             1
  20. #define P_KNIFE              2
  21. #define P_AXE                3
  22. #define P_PICK_AXE           4
  23. #define P_SHORT_SWORD        5
  24. #define P_BROAD_SWORD        6
  25. #define P_LONG_SWORD         7
  26. #define P_TWO_HANDED_SWORD   8
  27. #define P_SCIMITAR           9
  28. #define P_SABER             10
  29. #define P_CLUB              11	/* Heavy-shafted bludgeon */
  30. #define P_MACE              12	
  31. #define P_MORNING_STAR      13	/* Spiked bludgeon */
  32. #define P_FLAIL             14	/* Two pieces hinged or chained together */
  33. #define P_HAMMER            15	/* Heavy head on the end */
  34. #define P_QUARTERSTAFF      16	/* Long-shafted bludgeon */
  35. #define P_POLEARMS          17
  36. #define P_SPEAR             18
  37. #define P_JAVELIN           19
  38. #define P_TRIDENT           20
  39. #define P_LANCE             21
  40. #define P_BOW               22
  41. #define P_SLING             23
  42. #define P_CROSSBOW          24
  43. #define P_DART              25
  44. #define P_SHURIKEN          26
  45. #define P_BOOMERANG         27
  46. #define P_WHIP              28
  47. #define P_UNICORN_HORN      29	/* last weapon */
  48. #define P_FIRST_WEAPON      P_DAGGER
  49. #define P_LAST_WEAPON       P_UNICORN_HORN
  50.  
  51. /* Spell Skills added by Larry Stewart-Zerba */
  52. #define P_ATTACK_SPELL      30
  53. #define P_HEALING_SPELL     31
  54. #define P_DIVINATION_SPELL  32
  55. #define P_ENCHANTMENT_SPELL 33
  56. #define P_CLERIC_SPELL      34
  57. #define P_ESCAPE_SPELL      35
  58. #define P_MATTER_SPELL      36
  59. #define P_FIRST_SPELL		P_ATTACK_SPELL
  60. #define P_LAST_SPELL		P_MATTER_SPELL
  61.  
  62. /* Other types of combat */
  63. #define P_BARE_HANDED_COMBAT	37
  64. #define P_MARTIAL_ARTS		P_BARE_HANDED_COMBAT	/* Role distinguishes */
  65. #define P_TWO_WEAPON_COMBAT	38	/* Finally implemented */
  66. #ifdef STEED
  67. #define P_RIDING		39	/* How well you control your steed */
  68. #define P_LAST_H_TO_H		P_RIDING
  69. #else
  70. #define P_LAST_H_TO_H		P_TWO_WEAPON_COMBAT
  71. #endif
  72. #define P_FIRST_H_TO_H		P_BARE_HANDED_COMBAT
  73.  
  74. #define P_NUM_SKILLS		(P_LAST_H_TO_H+1)
  75.  
  76. /* These roles qualify for a martial arts bonus */
  77. #define martial_bonus()	(Role_if(PM_SAMURAI) || Role_if(PM_MONK))
  78.  
  79.  
  80. /*
  81. * These are the standard weapon skill levels.  It is important that
  82. * the lowest "valid" skill be be 1.  The code calculates the
  83. * previous amount to practice by calling  practice_needed_to_advance()
  84. * with the current skill-1.  To work out for the UNSKILLED case,
  85. * a value of 0 needed.
  86. */
  87. #define P_ISRESTRICTED	0
  88. #define P_UNSKILLED		1
  89. #define P_BASIC			2
  90. #define P_SKILLED		3
  91. #define P_EXPERT		4
  92. #define P_MASTER		5	/* Unarmed combat/martial arts only */
  93. #define P_GRAND_MASTER	6	/* Unarmed combat/martial arts only */
  94.  
  95. #define practice_needed_to_advance(level) ((level)*(level)*20)
  96.  
  97. /* The hero's skill in various weapons. */
  98. struct skills {
  99. 	xchar skill;
  100. 	xchar max_skill;
  101. 	unsigned short advance;
  102. };
  103.  
  104. #define P_SKILL(type)		(u.weapon_skills[type].skill)
  105. #define P_MAX_SKILL(type)	(u.weapon_skills[type].max_skill)
  106. #define P_ADVANCE(type)		(u.weapon_skills[type].advance)
  107. #define P_RESTRICTED(type)	(u.weapon_skills[type].skill == P_ISRESTRICTED)
  108.  
  109. #define P_SKILL_LIMIT 60	/* Max number of skill advancements */
  110.  
  111. /* Initial skill matrix structure; used in u_init.c and weapon.c */
  112. struct def_skill {
  113. 	xchar skill;
  114. 	xchar skmax;
  115. };
  116.  
  117. #endif  /* SKILLS_H */