File src/weapon.c


Included Files


Preprocessor definitions

#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 )


Type struct skill_range

struct skill_range
struct skill_range 
   { 
     short first; 
     short last; 
     const char* name; 
   } 

Local Variables

skill_names_indices
static const short skill_names_indices[(39+1)]
Used in: enhance_weapon_skill()
  skill_advance()
  skill_init()

odd_skill_names
static const char* odd_skill_names[]
Used in: enhance_weapon_skill()
  skill_advance()
  skill_init()

barehands_or_martial
static const char* barehands_or_martial[]
Used in: enhance_weapon_skill()
  skill_advance()
  skill_init()

kebabable
static const char kebabable[]
Used in: hitval()

rwep
static const int rwep[]
Used in: select_rwep()

pwep
static const int pwep[]
Used in: select_rwep()

propellor
static struct obj* propellor
Used in: mon_wield_item()
  select_rwep()

hwep
static short hwep[]
Used in: select_hwep()

skill_ranges
static struct skill_range skill_ranges[]
Used in: enhance_weapon_skill()


Global Function abon()

int abon ( void )
Prototyped in: include/extern.h
Calls: acurr()src/attrib.c
  adj_lev()src/makemon.c
Called by: dig()src/dig.c
  find_roll_to_hit()src/uhitm.c
References Variables: monssrc/monst.c
  usrc/decl.c

Global Function add_weapon_skill()

void add_weapon_skill ( int n )
Prototyped in: include/extern.h
Calls: can_advance()src/weapon.c
  give_may_advance_msg()src/weapon.c
Called by: adjabil()src/attrib.c
References Variables: usrc/decl.c

Global Function dbon()

int dbon ( void )
Prototyped in: include/extern.h
Calls: acurr()src/attrib.c
Called by: hmon_hitmon()src/uhitm.c
  use_pick_axe()src/dig.c
  use_whip()src/apply.c
References Variables: usrc/decl.c

Global Function dmgval()

int dmgval ( struct obj* otmp, struct monst* mon )
Prototyped in: include/extern.h
Calls: d()src/rnd.c
  hates_silver()src/mondata.c
  rnd()src/rnd.c
  spec_dbon()src/artifact.c
Called by: dotrap()src/trap.c
  hitmu()src/mhitu.c
  hmon_hitmon()src/uhitm.c
  launch_obj()src/trap.c
  m_throw()src/mthrowu.c
  mdamagem()src/mhitm.c
  ohitmon()src/mthrowu.c
  scatter()src/explode.c
  seffects()src/read.c
  thitm()src/trap.c
  thrwmu()src/mthrowu.c
  toss_up()src/dothrow.c
  use_offensive()src/muse.c
References Variables: monssrc/monst.c
  objectssrc/objects.c
  usrc/decl.c
  uwepsrc/decl.c

Global Function enhance_weapon_skill()

int enhance_weapon_skill ( void )
Prototyped in: include/extern.h
Calls: You_feel()src/pline.c
  can_advance()src/weapon.c
  eos()src/hacklib.c
  skill_advance()src/weapon.c
  skill_level_name()src/weapon.c
  free(), sprintf(), strcpy(), strlen()
Used in:  src/cmd.c
References Variables: barehands_or_martialsrc/weapon.c
  flagssrc/decl.c
  obj_descrsrc/objects.c
  objectssrc/objects.c
  odd_skill_namessrc/weapon.c
  skill_names_indicessrc/weapon.c
  skill_rangessrc/weapon.c
  usrc/decl.c
  urolesrc/role.c
  yncharssrc/decl.c
  windowprocs

Global Function hitval()

int hitval ( struct obj* otmp, struct monst* mon )
Prototyped in: include/extern.h
Calls: is_pool()src/dbridge.c
  spec_abon()src/artifact.c
  strchr()
Called by: find_roll_to_hit()src/uhitm.c
  hmonas()src/uhitm.c
  mattackm()src/mhitm.c
  mattacku()src/mhitu.c
  omon_adj()src/dothrow.c
References Variables: kebabablesrc/weapon.c
  objectssrc/objects.c

Global Function lose_weapon_skill()

void lose_weapon_skill ( int n )
Prototyped in: include/extern.h
Calls: panic()src/end.c
  slots_required()src/weapon.c
Called by: adjabil()src/attrib.c
References Variables: usrc/decl.c

Global Function mon_wield_item()

int mon_wield_item ( struct monst* mon )
Prototyped in: include/extern.h
Calls: Monnam()src/do_name.c
  The()src/objnam.c
  doname()src/objnam.c
  impossible()src/pline.c
  m_carrying()src/mthrowu.c
  makeplural()src/objnam.c
  mbodypart()src/polyself.c
  mon_nam()src/do_name.c
  pline()src/pline.c
  pronoun_gender()src/mondata.c
  s_suffix()src/hacklib.c
  select_hwep()src/weapon.c
  select_rwep()src/weapon.c
  xname()src/objnam.c
  sprintf(), worm_known()
Called by: dochug()src/monmove.c
  dog_invent()src/dogmove.c
  dog_move()src/dogmove.c
  invault()src/vault.c
  m_move()src/monmove.c
  make_familiar()src/dog.c
  mattackm()src/mhitm.c
  mattacku()src/mhitu.c
  tamedog()src/dog.c
  thrwmu()src/mthrowu.c
References Variables: hissrc/decl.c
  objectssrc/objects.c
  propellorsrc/weapon.c
  usrc/decl.c
  ublindfsrc/decl.c
  viz_arraysrc/decl.c
  youmonstsrc/decl.c
  zeroobjsrc/decl.c

Global Function possibly_unwield()

void possibly_unwield ( struct monst* mon )
Prototyped in: include/extern.h
Calls: Monnam()src/do_name.c
  attacktype()src/mondata.c
  distant_name()src/objnam.c
  newsym()src/display.c
  obj_extract_self()src/mkobj.c
  place_object()src/mkobj.c
  pline()src/pline.c
  stackobj()src/invent.c
Called by: m_useup()src/mthrowu.c
  mattackm()src/mhitm.c
  mattacku()src/mhitu.c
  mdamagem()src/mhitm.c
  newcham()src/mon.c
  steal_it()src/uhitm.c
  use_whip()src/apply.c
References Functions: doname()src/objnam.c
References Variables: viz_arraysrc/decl.c

Global Function select_hwep()

struct obj* select_hwep ( struct monst* mtmp )
Prototyped in: include/extern.h
Calls: hates_silver()src/mondata.c
  oselect()src/weapon.c
  touch_artifact()src/artifact.c
Called by: final_level()src/do.c
  mon_wield_item()src/weapon.c
References Variables: hwepsrc/weapon.c
  objectssrc/objects.c

Global Function select_rwep()

struct obj* select_rwep ( struct monst* mtmp )
Prototyped in: include/extern.h
Calls: dist2()src/hacklib.c
  hates_silver()src/mondata.c
  m_carrying()src/mthrowu.c
  oselect()src/weapon.c
Called by: mon_wield_item()src/weapon.c
  thrwmu()src/mthrowu.c
References Variables: objectssrc/objects.c
  propellorsrc/weapon.c
  pwepsrc/weapon.c
  rwepsrc/weapon.c
  viz_arraysrc/decl.c
  zeroobjsrc/decl.c

Global Function skill_init()

void skill_init ( struct def_skill* class_skill )
Prototyped in: include/extern.h
Calls: impossible()src/pline.c
  weapon_type()src/weapon.c
Called by: u_init()src/u_init.c
References Variables: barehands_or_martialsrc/weapon.c
  inventsrc/decl.c
  obj_descrsrc/objects.c
  objectssrc/objects.c
  odd_skill_namessrc/weapon.c
  skill_names_indicessrc/weapon.c
  usrc/decl.c
  urolesrc/role.c

Global Function unrestrict_weapon_skill()

void unrestrict_weapon_skill ( int skill )
Prototyped in: include/extern.h
Called by: dosacrifice()src/pray.c
  pleased()src/pray.c
References Variables: usrc/decl.c

Global Function use_skill()

void use_skill ( int skill, int degree )
Prototyped in: include/extern.h
Calls: can_advance()src/weapon.c
  give_may_advance_msg()src/weapon.c
Called by: exercise_steed()src/steed.c
  hmon_hitmon()src/uhitm.c
  kickdmg()src/dokick.c
  spelleffects()src/spell.c
References Variables: usrc/decl.c

Global Function uwep_skill_type()

int uwep_skill_type ( void )
Prototyped in: include/extern.h
Calls: weapon_type()src/weapon.c
Called by: hmon_hitmon()src/uhitm.c
  use_grapple()src/apply.c
  use_pole()src/apply.c
References Variables: usrc/decl.c
  uwepsrc/decl.c

Global Function weapon_dam_bonus()

int weapon_dam_bonus ( struct obj* weapon )
Prototyped in: include/extern.h
Calls: impossible()src/pline.c
  weapon_type()src/weapon.c
Called by: hmon_hitmon()src/uhitm.c
References Variables: usrc/decl.c
  urolesrc/role.c

Global Function weapon_hit_bonus()

int weapon_hit_bonus ( struct obj* weapon )
Prototyped in: include/extern.h
Calls: impossible()src/pline.c
  weapon_type()src/weapon.c
Called by: find_roll_to_hit()src/uhitm.c
  hmonas()src/uhitm.c
  thitmonst()src/dothrow.c
References Variables: usrc/decl.c
  urolesrc/role.c

Global Function weapon_type()

int weapon_type ( struct obj* obj )
Prototyped in: include/extern.h
Called by: dosacrifice()src/pray.c
  hmon_hitmon()src/uhitm.c
  pleased()src/pray.c
  skill_init()src/weapon.c
  throw_obj()src/dothrow.c
  uwep_skill_type()src/weapon.c
  weapon_dam_bonus()src/weapon.c
  weapon_hit_bonus()src/weapon.c
References Variables: objectssrc/objects.c

Local Function can_advance()

static boolean can_advance ( int skill, boolean speedy )
Prototyped in: src/weapon.c
Calls: slots_required()src/weapon.c
Called by: add_weapon_skill()src/weapon.c
  enhance_weapon_skill()src/weapon.c
  use_skill()src/weapon.c
References Variables: flagssrc/decl.c
  usrc/decl.c

Local Function give_may_advance_msg()

static void give_may_advance_msg ( int skill )
Calls: You_feel()src/pline.c
Called by: add_weapon_skill()src/weapon.c
  use_skill()src/weapon.c

Local Function oselect()

static struct obj* oselect ( struct monst* mtmp, int x )
Prototyped in: src/weapon.c
Calls: touch_artifact()src/artifact.c
Called by: select_hwep()src/weapon.c
  select_rwep()src/weapon.c
References Variables: monssrc/monst.c

Local Function skill_advance()

static void skill_advance ( int skill )
Prototyped in: src/weapon.c
Calls: You()src/pline.c
  slots_required()src/weapon.c
Called by: enhance_weapon_skill()src/weapon.c
References Variables: barehands_or_martialsrc/weapon.c
  obj_descrsrc/objects.c
  objectssrc/objects.c
  odd_skill_namessrc/weapon.c
  skill_names_indicessrc/weapon.c
  usrc/decl.c
  urolesrc/role.c

Local Function skill_level_name()

static char* skill_level_name ( int skill, char* buf )
Prototyped in: src/weapon.c
Calls: strcpy()
Called by: enhance_weapon_skill()src/weapon.c
References Variables: usrc/decl.c

Local Function slots_required()

static int slots_required ( int skill )
Prototyped in: src/weapon.c
Called by: can_advance()src/weapon.c
  lose_weapon_skill()src/weapon.c
  skill_advance()src/weapon.c
References Variables: usrc/decl.c