1 /* NetHack 3.6 skills.h $NHDT-Date: 1547255911 2019/01/12 01:18:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.15 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */
3 /*-Copyright (c) Pasi Kallinen, 2017. */
4 /* NetHack may be freely redistributed. See license for details. */
9 /* Much of this code was taken from you.h. It is now
10 * in a separate file so it can be included in objects.c.
14 /* Code to denote that no skill is applicable */
17 /* Weapon Skills -- Stephen White
18 * Order matters and are used in macros.
19 * Positive values denote hand-to-hand weapons or launchers.
20 * Negative values denote ammunition or missiles.
21 * Update weapon.c if you amend any skills.
22 * Also used for oc_subtyp.
31 P_TWO_HANDED_SWORD = 8,
34 P_CLUB = 11, /* Heavy-shafted bludgeon */
36 P_MORNING_STAR = 13, /* Spiked bludgeon */
37 P_FLAIL = 14, /* Two pieces hinged or chained together */
38 P_HAMMER = 15, /* Heavy head on the end */
39 P_QUARTERSTAFF = 16, /* Long-shafted bludgeon */
40 P_POLEARMS = 17, /* attack two or three steps away */
41 P_SPEAR = 18, /* includes javelin */
44 P_BOW = 21, /* launchers */
47 P_DART = 24, /* hand-thrown missiles */
50 P_WHIP = 27, /* flexible, one-handed */
51 P_UNICORN_HORN = 28, /* last weapon, two-handed */
53 /* Spell Skills added by Larry Stewart-Zerba */
56 P_DIVINATION_SPELL = 31,
57 P_ENCHANTMENT_SPELL = 32,
62 /* Other types of combat */
63 P_BARE_HANDED_COMBAT = 36, /* actually weaponless; gloves are ok */
64 P_TWO_WEAPON_COMBAT = 37, /* pair of weapons, one in each hand */
65 P_RIDING = 38, /* How well you control your steed */
70 #define P_MARTIAL_ARTS P_BARE_HANDED_COMBAT /* Role distinguishes */
72 #define P_FIRST_WEAPON P_DAGGER
73 #define P_LAST_WEAPON P_UNICORN_HORN
75 #define P_FIRST_SPELL P_ATTACK_SPELL
76 #define P_LAST_SPELL P_MATTER_SPELL
78 #define P_LAST_H_TO_H P_RIDING
79 #define P_FIRST_H_TO_H P_BARE_HANDED_COMBAT
81 /* These roles qualify for a martial arts bonus */
82 #define martial_bonus() (Role_if(PM_SAMURAI) || Role_if(PM_MONK))
85 * These are the standard weapon skill levels. It is important that
86 * the lowest "valid" skill be be 1. The code calculates the
87 * previous amount to practice by calling practice_needed_to_advance()
88 * with the current skill-1. To work out for the UNSKILLED case,
89 * a value of 0 needed.
92 P_ISRESTRICTED = 0, /* unskilled and can't be advanced */
93 P_UNSKILLED = 1, /* unskilled so far but can be advanced */
94 /* Skill levels Basic/Advanced/Expert had long been used by
95 Heroes of Might and Magic (tm) and its sequels... */
99 /* when the skill system was adopted into nethack, levels beyond expert
100 were unnamed and just used numbers. Devteam coined them Master and
101 Grand Master. Sometime after that, Heroes of Might and Magic IV (tm)
102 was released and had two more levels which use these same names. */
103 P_MASTER = 5, /* Unarmed combat/martial arts only */
104 P_GRAND_MASTER = 6 /* ditto */
107 #define practice_needed_to_advance(level) ((level) * (level) *20)
109 /* The hero's skill in various weapons. */
113 unsigned short advance;
116 #define P_SKILL(type) (u.weapon_skills[type].skill)
117 #define P_MAX_SKILL(type) (u.weapon_skills[type].max_skill)
118 #define P_ADVANCE(type) (u.weapon_skills[type].advance)
119 #define P_RESTRICTED(type) (u.weapon_skills[type].skill == P_ISRESTRICTED)
121 #define P_SKILL_LIMIT 60 /* Max number of skill advancements */
123 /* Initial skill matrix structure; used in u_init.c and weapon.c */
129 #endif /* SKILLS_H */