File src/spell.c


Included Files


Preprocessor definitions

#define SPELLMENU_CAST 2

#define SPELLMENU_VIEW 1

#define KEEN 20000

#define MAX_SPELL_STUDY 3

#define incrnknow( spell )

#define spellev( spell )

#define spellname( spell )

#define spellet( spell )

#define uarmhbon 4

#define uarmgbon 6

#define uarmfbon 2


Local Variables

delay
static schar delay
Used in: learn()
  study_book()

book
static struct obj* book
Used in: book_substitution()
  learn()
  losespells()
  study_book()

explodes
static const char explodes[]
Used in: cursed_book()


Global Function age_spells()

void age_spells ( void )
Prototyped in: include/extern.h
Called by: moveloop()src/allmain.c
References Variables: spl_booksrc/decl.c

Global Function book_substitution()

void book_substitution ( struct obj* old_obj, struct obj* new_obj )
Prototyped in: include/extern.h
Called by: realloc_obj()src/do_name.c
References Variables: booksrc/spell.c

Global Function docast()

int docast ( void )
Prototyped in: include/extern.h
Calls: getspell()src/spell.c
  spelleffects()src/spell.c
Used in:  src/cmd.c

Global Function dovspell()

int dovspell ( void )
Prototyped in: include/extern.h
Calls: You()src/pline.c
  dospellmenu()src/spell.c
  sprintf()
Used in:  src/cmd.c
References Variables: spl_booksrc/decl.c

Global Function initialspell()

void initialspell ( struct obj* obj )
Prototyped in: include/extern.h
Calls: impossible()src/pline.c
  pline()src/pline.c
References Variables: obj_descrsrc/objects.c
  objectssrc/objects.c
  spl_booksrc/decl.c

Global Function losespells()

void losespells ( void )
Prototyped in: include/extern.h
Calls: exercise()src/attrib.c
  rnd()src/rnd.c
Called by: forget()src/read.c
References Variables: booksrc/spell.c
  spl_booksrc/decl.c
  usrc/decl.c

Global Function spell_skilltype()

int spell_skilltype ( int booktype )
Prototyped in: include/extern.h
Called by: cast_protection()src/spell.c
  dospellmenu()src/spell.c
  percent_success()src/spell.c
  spelleffects()src/spell.c
References Variables: objectssrc/objects.c

Global Function spelleffects()

int spelleffects ( int spell, boolean atme )
Prototyped in: include/extern.h
Calls: You()src/pline.c
  You_feel()src/pline.c
  Your()src/pline.c
  acurr()src/attrib.c
  body_part()src/polyself.c
  cast_protection()src/spell.c
  check_capacity()src/hack.c
  do_vicinity_map()src/detect.c
  exercise()src/attrib.c
  explode()src/explode.c
  freehand()src/engrave.c
  getdir()src/cmd.c
  healup()src/potion.c
  impossible()src/pline.c
  isok()src/cmd.c
  jump()src/apply.c
  losehp()src/hack.c
  make_confused()src/potion.c
  make_familiar()src/dog.c
  mksobj()src/mkobj.c
  morehungry()src/eat.c
  obfree()src/shk.c
  peffects()src/potion.c
  percent_success()src/spell.c
  pline()src/pline.c
  pline_The()src/pline.c
  rnd()src/rnd.c
  seffects()src/read.c
  self_pronoun()src/do_name.c
  spell_skilltype()src/spell.c
  throwspell()src/spell.c
  spell_damage_bonus(), use_skill(), weffects(), zapyourself()
Called by: docast()src/spell.c
  doturn()src/pray.c
References Variables: c_common_stringssrc/decl.c
  flagssrc/decl.c
  levelsrc/decl.c
  objectssrc/objects.c
  spl_booksrc/decl.c
  usrc/decl.c
  uarmhsrc/decl.c
  urolesrc/role.c
  viz_arraysrc/decl.c

Global Function study_book()

int study_book ( struct obj* spellbook )
Prototyped in: include/extern.h
Calls: You()src/pline.c
  acurr()src/attrib.c
  cursed_book()src/spell.c
  discover_object()src/o_init.c
  docall()src/do_name.c
  impossible()src/pline.c
  nomul()src/hack.c
  pline()src/pline.c
  pline_The()src/pline.c
  rn2()src/rnd.c
  rnd()src/rnd.c
  set_occupation()src/cmd.c
  useup()src/invent.c
  sprintf()
Called by: doread()src/read.c
References Functions: learn()src/spell.c
References Variables: WIN_MESSAGEsrc/decl.c
  booksrc/spell.c
  delaysrc/spell.c
  objectssrc/objects.c
  usrc/decl.c
  urolesrc/role.c
  yncharssrc/decl.c
  windowprocs

Local Function cast_protection()

static void cast_protection ( void )
Prototyped in: src/spell.c
Calls: Your()src/pline.c
  an()src/objnam.c
  find_ac()src/do_wear.c
  hcolor()src/do_name.c
  on_level()src/dungeon.c
  pline_The()src/pline.c
  spell_skilltype()src/spell.c
Called by: spelleffects()src/spell.c
References Variables: c_color_namessrc/decl.c
  dungeon_topologysrc/decl.c
  usrc/decl.c
  ublindfsrc/decl.c
  youmonstsrc/decl.c

Local Function cursed_book()

static void cursed_book ( int lev )
Prototyped in: src/spell.c
Calls: You_feel()src/pline.c
  Your()src/pline.c
  body_part()src/polyself.c
  losehp()src/hack.c
  losestr()src/attrib.c
  make_blinded()src/potion.c
  make_confused()src/potion.c
  pline()src/pline.c
  pline_The()src/pline.c
  resists_magm()src/mondata.c
  rn2()src/rnd.c
  rnd()src/rnd.c
  rndcurse()src/sit.c
  shieldeff()src/display.c
  take_gold()src/sit.c
  aggravate(), tele()
Called by: learn()src/spell.c
  study_book()src/spell.c
References Variables: explodessrc/spell.c
  objectssrc/objects.c
  usrc/decl.c
  uarmgsrc/decl.c
  ublindfsrc/decl.c
  youmonstsrc/decl.c

Local Function deadbook()

static void deadbook ( struct obj* book2 )
Prototyped in: src/spell.c
Calls: On_stairs()src/dungeon.c
  You()src/pline.c
  You_hear()src/pline.c
  Your()src/pline.c
  body_part()src/polyself.c
  discover_object()src/o_init.c
  dist2()src/hacklib.c
  invocation_pos()src/hack.c
  makemon()src/makemon.c
  mkinvokearea()src/mklev.c
  mkundead()src/mkroom.c
  pline()src/pline.c
  pline_The()src/pline.c
  rn2()src/rnd.c
  set_malign()src/makemon.c
  sgn()src/hacklib.c
  tamedog()src/dog.c
  unturn_dead()
Called by: learn()src/spell.c
References Variables: c_common_stringssrc/decl.c
  inventsrc/decl.c
  levelsrc/decl.c
  monssrc/monst.c
  movessrc/decl.c
  usrc/decl.c
  viz_arraysrc/decl.c
  youmonstsrc/decl.c

Local Function dospellmenu()

static boolean dospellmenu ( const char* prompt, int splaction, int* spell_no )
Prototyped in: src/spell.c
Calls: percent_success()src/spell.c
  spell_skilltype()src/spell.c
  spelltypemnemonic()src/spell.c
  free(), sprintf()
Called by: dovspell()src/spell.c
  getspell()src/spell.c
References Variables: obj_descrsrc/objects.c
  objectssrc/objects.c
  spl_booksrc/decl.c
  windowprocs

Local Function getspell()

static boolean getspell ( int* spell_no )
Prototyped in: src/spell.c
Calls: You()src/pline.c
  dospellmenu()src/spell.c
  spell_let_to_idx()src/spell.c
  sprintf(), strchr(), strcpy()
Called by: docast()src/spell.c
References Variables: flagssrc/decl.c
  quitcharssrc/decl.c
  spl_booksrc/decl.c
  windowprocs

Local Function isqrt()

static int isqrt ( int val )
Prototyped in: src/spell.c
Called by: percent_success()src/spell.c

Local Function learn()

static int learn ( void )
Prototyped in: src/spell.c
Calls: You()src/pline.c
  Your()src/pline.c
  check_unpaid()src/shk.c
  cursed_book()src/spell.c
  deadbook()src/spell.c
  discover_object()src/o_init.c
  exercise()src/attrib.c
  impossible()src/pline.c
  pline()src/pline.c
  sprintf()
Used in: study_book()src/spell.c
References Variables: booksrc/spell.c
  delaysrc/spell.c
  obj_descrsrc/objects.c
  objectssrc/objects.c
  spl_booksrc/decl.c

Local Function percent_success()

static int percent_success ( int spell )
Prototyped in: src/spell.c
Calls: acurr()src/attrib.c
  isqrt()src/spell.c
  spell_skilltype()src/spell.c
  weight()src/mkobj.c
Called by: dospellmenu()src/spell.c
  spelleffects()src/spell.c
References Variables: objectssrc/objects.c
  spl_booksrc/decl.c
  usrc/decl.c
  uarmsrc/decl.c
  uarmcsrc/decl.c
  uarmfsrc/decl.c
  uarmgsrc/decl.c
  uarmhsrc/decl.c
  uarmssrc/decl.c
  urolesrc/role.c

Local Function spell_let_to_idx()

static int spell_let_to_idx ( char ilet )
Prototyped in: src/spell.c
Called by: getspell()src/spell.c

Local Function spelltypemnemonic()

static const char* spelltypemnemonic ( int skill )
Prototyped in: src/spell.c
Calls: impossible()src/pline.c
Called by: dospellmenu()src/spell.c

Local Function throwspell()

static int throwspell ( void )
Prototyped in: src/spell.c
Calls: You()src/pline.c
  Your()src/pline.c
  distmin()src/hacklib.c
  exercise()src/attrib.c
  getpos()src/do_name.c
  on_level()src/dungeon.c
  pline()src/pline.c
  pline_The()src/pline.c
Called by: spelleffects()src/spell.c
References Variables: dungeon_topologysrc/decl.c
  levelsrc/decl.c
  usrc/decl.c
  viz_arraysrc/decl.c