^X again
Add a new line for one last missing status field: gold. Also add one for proficiency with current weapon. Move a few lines from 'characteristics' to 'background' and a few more from 'characteristics' to new 'basics', leaving characteristics with the six original characteristics: Str, Con, Dec, &c.
This commit is contained in:
52
src/weapon.c
52
src/weapon.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 weapon.c $NHDT-Date: 1454660575 2016/02/05 08:22:55 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.57 $ */
|
||||
/* NetHack 3.6 weapon.c $NHDT-Date: 1541145518 2018/11/02 07:58:38 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.60 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -10,6 +10,12 @@
|
||||
*/
|
||||
#include "hack.h"
|
||||
|
||||
STATIC_DCL void FDECL(give_may_advance_msg, (int));
|
||||
STATIC_DCL boolean FDECL(could_advance, (int));
|
||||
STATIC_DCL boolean FDECL(peaked_skill, (int));
|
||||
STATIC_DCL int FDECL(slots_required, (int));
|
||||
STATIC_DCL void FDECL(skill_advance, (int));
|
||||
|
||||
/* Categories whose names don't come from OBJ_NAME(objects[type])
|
||||
*/
|
||||
#define PN_BARE_HANDED (-1) /* includes martial arts */
|
||||
@@ -27,8 +33,6 @@
|
||||
#define PN_ESCAPE_SPELL (-13)
|
||||
#define PN_MATTER_SPELL (-14)
|
||||
|
||||
STATIC_DCL void FDECL(give_may_advance_msg, (int));
|
||||
|
||||
STATIC_VAR NEARDATA const short skill_names_indices[P_NUM_SKILLS] = {
|
||||
0, DAGGER, KNIFE, AXE, PICK_AXE, SHORT_SWORD, BROADSWORD, LONG_SWORD,
|
||||
TWO_HANDED_SWORD, SCIMITAR, PN_SABER, CLUB, MACE, MORNING_STAR, FLAIL,
|
||||
@@ -51,25 +55,6 @@ STATIC_VAR NEARDATA const char *const barehands_or_martial[] = {
|
||||
"bare handed combat", "martial arts"
|
||||
};
|
||||
|
||||
STATIC_OVL void
|
||||
give_may_advance_msg(skill)
|
||||
int skill;
|
||||
{
|
||||
You_feel("more confident in your %sskills.",
|
||||
skill == P_NONE ? "" : skill <= P_LAST_WEAPON
|
||||
? "weapon "
|
||||
: skill <= P_LAST_SPELL
|
||||
? "spell casting "
|
||||
: "fighting ");
|
||||
}
|
||||
|
||||
STATIC_DCL boolean FDECL(can_advance, (int, BOOLEAN_P));
|
||||
STATIC_DCL boolean FDECL(could_advance, (int));
|
||||
STATIC_DCL boolean FDECL(peaked_skill, (int));
|
||||
STATIC_DCL int FDECL(slots_required, (int));
|
||||
STATIC_DCL char *FDECL(skill_level_name, (int, char *));
|
||||
STATIC_DCL void FDECL(skill_advance, (int));
|
||||
|
||||
#define P_NAME(type) \
|
||||
((skill_names_indices[type] > 0) \
|
||||
? OBJ_NAME(objects[skill_names_indices[type]]) \
|
||||
@@ -80,6 +65,17 @@ STATIC_DCL void FDECL(skill_advance, (int));
|
||||
static NEARDATA const char kebabable[] = { S_XORN, S_DRAGON, S_JABBERWOCK,
|
||||
S_NAGA, S_GIANT, '\0' };
|
||||
|
||||
STATIC_OVL void
|
||||
give_may_advance_msg(skill)
|
||||
int skill;
|
||||
{
|
||||
You_feel("more confident in your %sskills.",
|
||||
(skill == P_NONE) ? ""
|
||||
: (skill <= P_LAST_WEAPON) ? "weapon "
|
||||
: (skill <= P_LAST_SPELL) ? "spell casting "
|
||||
: "fighting ");
|
||||
}
|
||||
|
||||
/* weapon's skill category name for use as generalized description of weapon;
|
||||
mostly used to shorten "you drop your <weapon>" messages when slippery
|
||||
fingers or polymorph causes hero to involuntarily drop wielded weapon(s) */
|
||||
@@ -871,7 +867,7 @@ boolean verbose;
|
||||
}
|
||||
|
||||
/* copy the skill level name into the given buffer */
|
||||
STATIC_OVL char *
|
||||
char *
|
||||
skill_level_name(skill, buf)
|
||||
int skill;
|
||||
char *buf;
|
||||
@@ -906,6 +902,13 @@ char *buf;
|
||||
return buf;
|
||||
}
|
||||
|
||||
const char *
|
||||
skill_name(skill)
|
||||
int skill;
|
||||
{
|
||||
return P_NAME(skill);
|
||||
}
|
||||
|
||||
/* return the # of slots required to advance the skill */
|
||||
STATIC_OVL int
|
||||
slots_required(skill)
|
||||
@@ -932,8 +935,7 @@ int skill;
|
||||
}
|
||||
|
||||
/* return true if this skill can be advanced */
|
||||
/*ARGSUSED*/
|
||||
STATIC_OVL boolean
|
||||
boolean
|
||||
can_advance(skill, speedy)
|
||||
int skill;
|
||||
boolean speedy;
|
||||
|
||||
Reference in New Issue
Block a user