#include "hack.h"
Data Structures | |
struct | skill_range |
Defines | |
#define | PN_BARE_HANDED (-1) |
#define | PN_TWO_WEAPONS (-2) |
#define | PN_RIDING (-3) |
#define | PN_POLEARMS (-4) |
#define | PN_SABER (-5) |
#define | PN_HAMMER (-6) |
#define | PN_WHIP (-7) |
#define | PN_ATTACK_SPELL (-8) |
#define | PN_HEALING_SPELL (-9) |
#define | PN_DIVINATION_SPELL (-10) |
#define | PN_ENCHANTMENT_SPELL (-11) |
#define | PN_CLERIC_SPELL (-12) |
#define | PN_ESCAPE_SPELL (-13) |
#define | PN_MATTER_SPELL (-14) |
#define | P_NAME(type) |
#define | Oselect(x) if ((otmp = oselect(mtmp, x)) != 0) return(otmp); |
Functions | |
STATIC_DCL int | FDECL (enhance_skill,(boolean)) |
STATIC_DCL void | FDECL (give_may_advance_msg,(int)) |
STATIC_OVL void | give_may_advance_msg (int skill) |
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)) |
int | hitval (struct obj *otmp, struct monst *mon) |
int | dmgval (struct obj *otmp, struct monst *mon) |
STATIC_DCL struct obj * | FDECL (oselect,(struct monst *, int)) |
STATIC_OVL struct obj * | oselect (struct monst *mtmp, int x) |
struct obj * | select_rwep (struct monst *mtmp) |
struct obj * | select_hwep (struct monst *mtmp) |
void | possibly_unwield (struct monst *mon, boolean polyspot) |
int | mon_wield_item (struct monst *mon) |
int | abon () |
int | dbon () |
STATIC_OVL char * | skill_level_name (int skill, char *buf) |
STATIC_OVL int | slots_required (int skill) |
STATIC_OVL boolean | can_advance (int skill, boolean speedy) |
boolean | can_advance_something () |
STATIC_OVL boolean | could_advance (int skill) |
STATIC_OVL boolean | peaked_skill (int skill) |
STATIC_OVL void | skill_advance (int skill) |
int | enhance_weapon_skill () |
void | dump_weapon_skill () |
int | enhance_skill (boolean want_dump) |
void | unrestrict_weapon_skill (int skill) |
void | use_skill (int skill, int degree) |
void | add_weapon_skill (int n) |
void | lose_weapon_skill (int n) |
int | weapon_type (struct obj *obj) |
int | uwep_skill_type () |
int | weapon_hit_bonus (struct obj *weapon) |
int | weapon_dam_bonus (struct obj *weapon) |
void | skill_init (struct def_skill *class_skill) const |
void | setmnotwielded (struct monst *mon, struct obj *obj) |
Variables | |
STATIC_VAR NEARDATA const short | skill_names_indices [P_NUM_SKILLS] |
STATIC_VAR NEARDATA const char *const | odd_skill_names [] |
STATIC_VAR NEARDATA const char *const | barehands_or_martial [] |
static NEARDATA const char | kebabable [] |
static NEARDATA const int | rwep [] |
static NEARDATA const int | pwep [] |
static struct obj * | propellor |
static const NEARDATA short | hwep [] |
static struct skill_range | skill_ranges [] |
Referenced by select_hwep(), and select_rwep().
#define P_NAME | ( | type ) |
((skill_names_indices[type] > 0) ? \ OBJ_NAME(objects[skill_names_indices[type]]) : \ (type == P_BARE_HANDED_COMBAT) ? \ barehands_or_martial[martial_bonus()] : \ odd_skill_names[-skill_names_indices[type]])
Referenced by enhance_skill(), skill_advance(), and skill_init().
#define PN_ATTACK_SPELL (-8) |
#define PN_BARE_HANDED (-1) |
#define PN_CLERIC_SPELL (-12) |
#define PN_DIVINATION_SPELL (-10) |
#define PN_ENCHANTMENT_SPELL (-11) |
#define PN_ESCAPE_SPELL (-13) |
#define PN_HAMMER (-6) |
#define PN_HEALING_SPELL (-9) |
#define PN_MATTER_SPELL (-14) |
#define PN_POLEARMS (-4) |
#define PN_RIDING (-3) |
#define PN_SABER (-5) |
#define PN_TWO_WEAPONS (-2) |
#define PN_WHIP (-7) |
int abon | ( | ) |
References A_DEX, A_STR, ACURR, adj_lev(), mons, STR18, u, you::ulevel, you::umonnum, and Upolyd.
Referenced by dig(), and find_roll_to_hit().
void add_weapon_skill | ( | int | n ) |
References can_advance(), FALSE, give_may_advance_msg(), P_NONE, P_NUM_SKILLS, u, and you::weapon_slots.
Referenced by adjabil().
References P_ADVANCE, P_MAX_SKILL, P_RESTRICTED, P_SKILL, P_SKILL_LIMIT, practice_needed_to_advance, you::skills_advanced, slots_required(), u, you::weapon_slots, and wizard.
Referenced by add_weapon_skill(), can_advance_something(), enhance_skill(), and use_skill().
boolean can_advance_something | ( | ) |
References can_advance(), and P_NUM_SKILLS.
Referenced by maybe_tutorial().
STATIC_OVL boolean could_advance | ( | int | skill ) |
References P_ADVANCE, P_MAX_SKILL, P_RESTRICTED, P_SKILL, P_SKILL_LIMIT, practice_needed_to_advance, you::skills_advanced, and u.
Referenced by enhance_skill().
int dbon | ( | ) |
References A_STR, ACURR, STR18, and Upolyd.
Referenced by hmon_hitmon(), use_pick_axe2(), and use_whip().
References ACID_VENOM, BALL_CLASS, BARDICHE, BATTLE_AXE, bigmonst, BILL_GUISARME, BROADSWORD, CHAIN_CLASS, CREAM_PIE, CROSSBOW_BOLT, d(), monst::data, DWARVISH_MATTOCK, ELVEN_BROADSWORD, FLAIL, GEM_CLASS, greatest_erosion, GUISARME, HALBERD, hates_silver(), HEAVY_IRON_BALL, IRON_CHAIN, is_axe, is_demon, is_undead, is_weptool, is_wooden, LEATHER, LUCERN_HAMMER, MACE, mons, MORNING_STAR, objects, PARTISAN, PM_SHADE, RANSEUR, rnd(), RUNESWORD, SILVER, spec_dbon(), SPETUM, thick_skinned, TRIDENT, TSURUGI, TWO_HANDED_SWORD, VOULGE, WAR_HAMMER, and WEAPON_CLASS.
Referenced by dotrap(), drop_boulder_on_monster(), drop_boulder_on_player(), hitmu(), hmon_hitmon(), launch_obj(), m_throw(), mdamagem(), ohitmon(), scatter(), thitm(), thrwmu(), toss_up(), and use_whip().
void dump_weapon_skill | ( | ) |
References enhance_skill(), and TRUE.
Referenced by disclose().
int enhance_skill | ( | boolean | want_dump ) |
References any::a_int, any::a_void, add_menu, ATR_NONE, BUFSZ, can_advance(), could_advance(), could_twoweap, create_nhwindow, monst::data, destroy_nhwindow, dump(), dump_html(), dump_text(), dump_title(), end_menu, eos(), FALSE, iflags, mi::item, skill_range::last, MAXULEV, instance_flags::menu_headings, instance_flags::menu_tab_sep, MENU_UNSELECTED, skill_range::name, name, NHW_MENU, NO_GLYPH, P_ADVANCE, P_NAME, P_NUM_SKILLS, P_RESTRICTED, P_SKILL, P_TWO_WEAPON_COMBAT, P_UNSKILLED, peaked_skill(), PICK_NONE, PICK_ONE, plur, practice_needed_to_advance, select_menu, SIZE, skill_advance(), skill_level_name(), skill_ranges, Sprintf, start_menu, Strcpy, TRUE, u, you::ulevel, you::weapon_slots, WIN_ERR, wizard, yn, and youmonst.
Referenced by dump_weapon_skill(), and enhance_weapon_skill().
int enhance_weapon_skill | ( | ) |
STATIC_DCL char* FDECL | ( | skill_level_name | , |
(int, char *) | |||
) |
STATIC_DCL int FDECL | ( | enhance_skill | , |
(boolean) | |||
) |
STATIC_DCL void FDECL | ( | skill_advance | , |
(int) | |||
) |
STATIC_DCL boolean FDECL | ( | can_advance | , |
(int, BOOLEAN_P) | |||
) |
STATIC_DCL boolean FDECL | ( | could_advance | , |
(int) | |||
) |
STATIC_DCL void FDECL | ( | give_may_advance_msg | , |
(int) | |||
) |
STATIC_DCL boolean FDECL | ( | peaked_skill | , |
(int) | |||
) |
STATIC_DCL int FDECL | ( | slots_required | , |
(int) | |||
) |
STATIC_OVL void give_may_advance_msg | ( | int | skill ) |
References P_LAST_SPELL, P_LAST_WEAPON, and P_NONE.
Referenced by add_weapon_skill(), and use_skill().
References monst::data, index, is_demon, is_pick, is_pool(), is_spear, is_swimmer, is_undead, is_weptool, permonst::mlet, monst::mx, monst::my, objects, passes_walls, perceives, S_EEL, S_SNAKE, spec_abon(), thick_skinned, TRIDENT, and WEAPON_CLASS.
Referenced by find_roll_to_hit(), hmonas(), mattackm(), mattacku(), and omon_adj().
void lose_weapon_skill | ( | int | n ) |
References P_SKILL, P_UNSKILLED, you::skill_record, you::skills_advanced, slots_required(), u, and you::weapon_slots.
Referenced by adjabil().
int mon_wield_item | ( | struct monst * | mon ) |
References artifact_light(), AXE, BATTLE_AXE, begin_burn(), bimanual, BUFSZ, canseemon, CORPSE, doname(), DWARVISH_MATTOCK, FALSE, HAND, is_plural, m_carrying(), makeplural(), mbodypart(), mhis, mon_nam(), MON_WEP, Monnam(), NEED_AXE, NEED_HTH_WEAPON, NEED_PICK_AXE, NEED_PICK_OR_AXE, NEED_RANGED_WEAPON, NEED_WEAPON, NO_WEAPON_WANTED, otense(), obj::otyp, obj::owornmask, PICK_AXE, pline(), plur, propellor, obj::quan, s_suffix(), select_hwep(), select_rwep(), setmnotwielded(), Sprintf, Tobjnam(), W_ARMS, W_WEP, which_armor(), xname(), and zeroobj.
Referenced by dochug(), dog_invent(), dog_move(), invault(), m_move(), make_familiar(), mattackm(), mattacku(), tamedog(), and thrwmu().
References CORPSE, obj::corpsenm, EGG, mons, obj::nobj, obj::oartifact, otmp, obj::otyp, touch_artifact(), and touch_petrifies.
Referenced by select_rwep().
STATIC_OVL boolean peaked_skill | ( | int | skill ) |
References P_ADVANCE, P_MAX_SKILL, P_RESTRICTED, P_SKILL, and practice_needed_to_advance.
Referenced by enhance_skill().
References AT_WEAP, attacktype(), bypass_obj(), cansee, distant_name(), doname(), flooreffects(), MON_NOWEP, MON_WEP, Monnam(), NEED_WEAPON, newsym(), NO_WEAPON_WANTED, obj::nobj, obj_extract_self(), place_object(), pline(), setmnotwielded(), and stackobj().
Referenced by m_useup(), mattackm(), mdamagem(), new_were(), newcham(), steal_it(), and use_whip().
References CLUB, CORPSE, hates_silver(), is_giant, mons, obj::nobj, obj::oartifact, objects, oc_bimanual, obj::oclass, Oselect, otmp, obj::otyp, PM_BLACK_MARKETEER, SILVER, SIZE, strongmonst, touch_artifact(), W_ARMG, W_ARMS, and WEAPON_CLASS.
Referenced by final_level(), and mon_wield_item().
References BOULDER, BOW, couldsee, CREAM_PIE, CROSSBOW, DART, dist2(), EGG, ELVEN_BOW, GEM_CLASS, hates_silver(), likes_gems, LOADSTONE, m_carrying(), MON_WEP, NO_WEAPON_WANTED, obj::nobj, obj::oartifact, objects, oc_skill, obj::oclass, ORCISH_BOW, oselect(), Oselect, otmp, obj::otyp, P_BOW, P_CROSSBOW, P_SLING, S_KOP, SILVER, SIZE, SLING, strongmonst, throws_rocks, W_ARMS, YUMI, and zeroobj.
Referenced by dochug(), mon_wield_item(), and thrwmu().
References artifact_light(), canseemon, end_burn(), FALSE, HAND, mbodypart(), mon_nam(), otense(), pline(), s_suffix(), The(), W_WEP, and xname().
Referenced by hmon_hitmon(), m_throw(), mdamagem(), mdrop_obj(), mon_arrive(), mon_wield_item(), monstone(), possibly_unwield(), rot_corpse(), steal_it(), and use_whip().
STATIC_OVL void skill_advance | ( | int | skill ) |
References P_MAX_SKILL, P_NAME, P_SKILL, you::skill_record, you::skills_advanced, slots_required(), u, and you::weapon_slots.
Referenced by enhance_skill().
void skill_init | ( | struct def_skill * | class_skill ) | const |
References invent, obj::nobj, P_ADVANCE, P_ATTACK_SPELL, P_BARE_HANDED_COMBAT, P_BASIC, P_CLERIC_SPELL, P_ENCHANTMENT_SPELL, P_EXPERT, P_HEALING_SPELL, P_ISRESTRICTED, P_MAX_SKILL, P_NAME, P_NONE, P_NUM_SKILLS, P_RESTRICTED, P_SKILL, P_UNSKILLED, Role::petnum, PM_HEALER, PM_MONK, PM_PONY, PM_PRIEST, PM_WIZARD, practice_needed_to_advance, Role_if, urole, and weapon_type().
Referenced by u_init().
STATIC_OVL char* skill_level_name | ( | int | skill, |
char * | buf | ||
) |
References P_BASIC, P_EXPERT, P_GRAND_MASTER, P_MASTER, P_SKILL, P_SKILLED, P_UNSKILLED, and Strcpy.
Referenced by enhance_skill().
STATIC_OVL int slots_required | ( | int | skill ) |
References P_LAST_WEAPON, P_SKILL, and P_TWO_WEAPON_COMBAT.
Referenced by can_advance(), lose_weapon_skill(), and skill_advance().
void unrestrict_weapon_skill | ( | int | skill ) |
References P_ADVANCE, P_BASIC, P_MAX_SKILL, P_NUM_SKILLS, P_RESTRICTED, P_SKILL, and P_UNSKILLED.
Referenced by dosacrifice().
void use_skill | ( | int | skill, |
int | degree | ||
) |
References can_advance(), FALSE, give_may_advance_msg(), P_ADVANCE, P_NONE, and P_RESTRICTED.
Referenced by hmon_hitmon(), kickdmg(), and spelleffects().
int uwep_skill_type | ( | ) |
References P_TWO_WEAPON_COMBAT, you::twoweap, u, uwep, and weapon_type().
Referenced by hmon_hitmon(), use_grapple(), and use_pole().
int weapon_dam_bonus | ( | struct obj * | weapon ) |
References martial_bonus, max, P_BARE_HANDED_COMBAT, P_BASIC, P_EXPERT, P_ISRESTRICTED, P_LAST_WEAPON, P_NONE, P_SKILL, P_SKILLED, P_TWO_WEAPON_COMBAT, P_UNSKILLED, you::twoweap, u, uswapwep, uwep, and weapon_type().
Referenced by hmon_hitmon(), and maybe_tutorial().
int weapon_hit_bonus | ( | struct obj * | weapon ) |
References martial_bonus, max, P_BARE_HANDED_COMBAT, P_BASIC, P_EXPERT, P_ISRESTRICTED, P_LAST_WEAPON, P_NONE, P_SKILL, P_SKILLED, P_TWO_WEAPON_COMBAT, P_UNSKILLED, you::twoweap, u, uswapwep, uwep, and weapon_type().
Referenced by find_roll_to_hit(), hmonas(), and thitmonst().
int weapon_type | ( | struct obj * | obj ) |
References GEM_CLASS, objects, P_BARE_HANDED_COMBAT, P_NONE, TOOL_CLASS, and WEAPON_CLASS.
Referenced by dosacrifice(), find_roll_to_hit(), hmon_hitmon(), joust(), skill_init(), throw_obj(), throwit(), uwep_skill_type(), weapon_dam_bonus(), and weapon_hit_bonus().
STATIC_VAR NEARDATA const char* const barehands_or_martial[] |
{ "bare handed combat", "martial arts" }
const NEARDATA short hwep[] [static] |
{ CORPSE, TSURUGI, RUNESWORD, DWARVISH_MATTOCK, TWO_HANDED_SWORD, BATTLE_AXE, KATANA, UNICORN_HORN, CRYSKNIFE, TRIDENT, LONG_SWORD, ELVEN_BROADSWORD, BROADSWORD, SCIMITAR, SILVER_SABER, MORNING_STAR, ELVEN_SHORT_SWORD, DWARVISH_SHORT_SWORD, SHORT_SWORD, ORCISH_SHORT_SWORD, MACE, AXE, DWARVISH_SPEAR, SILVER_SPEAR, ELVEN_SPEAR, SPEAR, ORCISH_SPEAR, FLAIL, BULLWHIP, QUARTERSTAFF, JAVELIN, AKLYS, CLUB, PICK_AXE, WAR_HAMMER, SILVER_DAGGER, ELVEN_DAGGER, DAGGER, ORCISH_DAGGER, ATHAME, SCALPEL, KNIFE, WORM_TOOTH }
NEARDATA const char kebabable[] [static] |
{ S_XORN, S_DRAGON, S_JABBERWOCK, S_NAGA, S_GIANT, '\0' }
STATIC_VAR NEARDATA const char* const odd_skill_names[] |
{ "no skill", "bare hands", "two weapon combat", "riding", "polearms", "saber", "hammer", "whip", "attack spells", "healing spells", "divination spells", "enchantment spells", "clerical spells", "escape spells", "matter spells", }
Referenced by mon_wield_item().
NEARDATA const int pwep[] [static] |
{ HALBERD, BARDICHE, SPETUM, BILL_GUISARME, VOULGE, RANSEUR, GUISARME, GLAIVE, LUCERN_HAMMER, BEC_DE_CORBIN, FAUCHARD, PARTISAN, LANCE }
NEARDATA const int rwep[] [static] |
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, PN_HAMMER, QUARTERSTAFF, PN_POLEARMS, SPEAR, JAVELIN, TRIDENT, LANCE, BOW, SLING, CROSSBOW, DART, SHURIKEN, BOOMERANG, PN_WHIP, UNICORN_HORN, PN_ATTACK_SPELL, PN_HEALING_SPELL, PN_DIVINATION_SPELL, PN_ENCHANTMENT_SPELL, PN_CLERIC_SPELL, PN_ESCAPE_SPELL, PN_MATTER_SPELL, PN_BARE_HANDED, PN_TWO_WEAPONS, }
struct skill_range skill_ranges[] [static] |
Referenced by enhance_skill().