skills.h

Go to the documentation of this file.
00001 /*      SCCS Id: @(#)skills.h   3.4     1999/10/27      */
00002 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */
00003 /* NetHack may be freely redistributed.  See license for details. */
00004 
00005 #ifndef SKILLS_H
00006 #define SKILLS_H
00007 
00008 /* Much of this code was taken from you.h.  It is now
00009  * in a separate file so it can be included in objects.c.
00010  */
00011 
00012 
00013 /* Code to denote that no skill is applicable */
00014 #define P_NONE                          0
00015 
00016 /* Weapon Skills -- Stephen White
00017  * Order matters and are used in macros.
00018  * Positive values denote hand-to-hand weapons or launchers.
00019  * Negative values denote ammunition or missiles.
00020  * Update weapon.c if you ammend any skills.
00021  * Also used for oc_subtyp.
00022  */
00023 #define P_DAGGER             1
00024 #define P_KNIFE              2
00025 #define P_AXE                3
00026 #define P_PICK_AXE           4
00027 #define P_SHORT_SWORD        5
00028 #define P_BROAD_SWORD        6
00029 #define P_LONG_SWORD         7
00030 #define P_TWO_HANDED_SWORD   8
00031 #define P_SCIMITAR           9
00032 #define P_SABER             10
00033 #define P_CLUB              11  /* Heavy-shafted bludgeon */
00034 #define P_MACE              12  
00035 #define P_MORNING_STAR      13  /* Spiked bludgeon */
00036 #define P_FLAIL             14  /* Two pieces hinged or chained together */
00037 #define P_HAMMER            15  /* Heavy head on the end */
00038 #define P_QUARTERSTAFF      16  /* Long-shafted bludgeon */
00039 #define P_POLEARMS          17
00040 #define P_SPEAR             18
00041 #define P_JAVELIN           19
00042 #define P_TRIDENT           20
00043 #define P_LANCE             21
00044 #define P_BOW               22
00045 #define P_SLING             23
00046 #define P_CROSSBOW          24
00047 #define P_DART              25
00048 #define P_SHURIKEN          26
00049 #define P_BOOMERANG         27
00050 #define P_WHIP              28
00051 #define P_UNICORN_HORN      29  /* last weapon */
00052 #define P_FIRST_WEAPON      P_DAGGER
00053 #define P_LAST_WEAPON       P_UNICORN_HORN
00054 
00055 /* Spell Skills added by Larry Stewart-Zerba */
00056 #define P_ATTACK_SPELL      30
00057 #define P_HEALING_SPELL     31
00058 #define P_DIVINATION_SPELL  32
00059 #define P_ENCHANTMENT_SPELL 33
00060 #define P_CLERIC_SPELL      34
00061 #define P_ESCAPE_SPELL      35
00062 #define P_MATTER_SPELL      36
00063 #define P_FIRST_SPELL           P_ATTACK_SPELL
00064 #define P_LAST_SPELL            P_MATTER_SPELL
00065 
00066 /* Other types of combat */
00067 #define P_BARE_HANDED_COMBAT    37
00068 #define P_MARTIAL_ARTS          P_BARE_HANDED_COMBAT    /* Role distinguishes */
00069 #define P_TWO_WEAPON_COMBAT     38      /* Finally implemented */
00070 #ifdef STEED
00071 #define P_RIDING                39      /* How well you control your steed */
00072 #define P_LAST_H_TO_H           P_RIDING
00073 #else
00074 #define P_LAST_H_TO_H           P_TWO_WEAPON_COMBAT
00075 #endif
00076 #define P_FIRST_H_TO_H          P_BARE_HANDED_COMBAT
00077 
00078 #define P_NUM_SKILLS            (P_LAST_H_TO_H+1)
00079 
00080 /* These roles qualify for a martial arts bonus */
00081 #define martial_bonus() (Role_if(PM_SAMURAI) || Role_if(PM_MONK))
00082 
00083 
00084 /*
00085  * These are the standard weapon skill levels.  It is important that
00086  * the lowest "valid" skill be be 1.  The code calculates the
00087  * previous amount to practice by calling  practice_needed_to_advance()
00088  * with the current skill-1.  To work out for the UNSKILLED case,
00089  * a value of 0 needed.
00090  */
00091 #define P_ISRESTRICTED  0
00092 #define P_UNSKILLED             1
00093 #define P_BASIC                 2
00094 #define P_SKILLED               3
00095 #define P_EXPERT                4
00096 #define P_MASTER                5       /* Unarmed combat/martial arts only */
00097 #define P_GRAND_MASTER  6       /* Unarmed combat/martial arts only */
00098 
00108 #define practice_needed_to_advance(level) ((1 << (level-1))*100)
00109 
00110 /* The hero's skill in various weapons. */
00111 struct skills {
00112         xchar skill;
00113         xchar max_skill;
00114         unsigned short advance;
00115 };
00116 
00117 #define P_SKILL(type)           (u.weapon_skills[type].skill)
00118 #define P_MAX_SKILL(type)       (u.weapon_skills[type].max_skill)
00119 #define P_ADVANCE(type)         (u.weapon_skills[type].advance)
00120 #define P_RESTRICTED(type)      (u.weapon_skills[type].skill == P_ISRESTRICTED)
00121 
00122 #define P_SKILL_LIMIT 60        /* Max number of skill advancements */
00123 
00124 /* Initial skill matrix structure; used in u_init.c and weapon.c */
00125 struct def_skill {
00126         xchar skill;
00127         xchar skmax;
00128 };
00129 
00130 #endif  /* SKILLS_H */