Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

src/spell.c File Reference


Detailed Description

Handles learning from spellbooks.

Note that the spells themselves are in the DLL and in the data file.

Definition in file spell.c.

#include "crogue.h"
#include "export.h"

Go to the source code of this file.

Defines

#define SPELL_TIME   4000
 Number of turns before a spell is forgotten if not cast.

#define SPELL_INCREMENT   15
 Number of turns added for each mana spent on this spell.

#define MAX_SPELL_TIME   9000
 Maximum number of turns remaining a spell can reach from increments.


Functions

int numSpellsKnown (void)
int spellByIndex (int n)
void study_spell (int spell, int type)
void learn_spell (int spell)
void refresh_spell (int spell)
void spellbookString (int n, char *buf)
sint study_book (ushort num_spells, ushort type, va_list spells)
void init_spells (void)
void spellString (int n, char *buf)
void cast_spell (void)

Variables

const struct spelldesc ** spell_list


Define Documentation

#define MAX_SPELL_TIME   9000
 

Maximum number of turns remaining a spell can reach from increments.

Definition at line 32 of file spell.c.

Referenced by cast_spell().

#define SPELL_INCREMENT   15
 

Number of turns added for each mana spent on this spell.

Definition at line 30 of file spell.c.

Referenced by cast_spell().

#define SPELL_TIME   4000
 

Number of turns before a spell is forgotten if not cast.

Definition at line 28 of file spell.c.

Referenced by learn_spell(), refresh_spell(), and study_spell().


Function Documentation

void cast_spell void   ) 
 

Definition at line 247 of file spell.c.

References call_genericfunc(), cast_spell_rect, player::extrinsic, full_redraw(), spelldesc::function, MAX_SPELL_TIME, message(), numSpellsKnown(), world::plr, spelldesc::pp_cost, player::pps, setTabStops(), SPELL_INCREMENT, spell_menu_tabs, spellByIndex(), world::spelldescs, player::spellknowledge, spellString(), STAT_FLAG_CONFUSED, STAT_FLAGS, world::time, timepass(), UI_Menu_Pick(), and w.

Referenced by plr_move().

void init_spells void   ) 
 

Definition at line 174 of file spell.c.

References debug_malloc, world::desc, world_descriptor::numspells, world::plr, slong, player::spellknowledge, and w.

Referenced by initialize(), and restore_game().

void learn_spell int  spell  )  [static]
 

Definition at line 164 of file spell.c.

References call_genericfunc(), deref_file_ptr(), spelldesc::learn_func, message(), spelldesc::name, world::plr, slong, SPELL_TIME, world::spelldescs, player::spellknowledge, world::time, and w.

Referenced by study_spell().

int numSpellsKnown void   )  [static]
 

Definition at line 185 of file spell.c.

References world::desc, world_descriptor::numspells, world::plr, player::spellknowledge, and w.

Referenced by cast_spell(), and study_spell().

void refresh_spell int  spell  )  [static]
 

Definition at line 156 of file spell.c.

References deref_file_ptr(), message(), spelldesc::name, world::plr, slong, SPELL_TIME, world::spelldescs, player::spellknowledge, world::time, and w.

Referenced by study_spell().

void spellbookString int  n,
char *  buf
[static]
 

Definition at line 232 of file spell.c.

References deref_file_ptr(), and spell_list.

Referenced by study_book().

int spellByIndex int  n  )  [static]
 

Definition at line 196 of file spell.c.

References world::plr, player::spellknowledge, and w.

Referenced by cast_spell(), and spellString().

void spellString int  n,
char *  buf
[static]
 

Definition at line 209 of file spell.c.

References deref_file_ptr(), world::plr, spellByIndex(), world::spelldescs, player::spellknowledge, world::time, and w.

Referenced by cast_spell().

sint study_book ushort  num_spells,
ushort  type,
va_list  spells
 

Definition at line 45 of file spell.c.

References player::class, full_redraw(), learn_spell_rect, message(), world::playerclasses, world::plr, setTabStops(), sint, spell_list, spell_menu_tabs, spellbookString(), classdesc::spellcasting, world::spelldescs, SPELLTYPE_ARCANE, SPELLTYPE_DIVINE, SPELLTYPE_NECROMANCY, study_spell(), UI_Menu_Pick(), ulong, and w.

void study_spell int  spell,
int  type
[static]
 

Definition at line 89 of file spell.c.

References player::class, spelldesc::difficulty, player::extrinsic, world::interrupt, learn_spell(), player::level, message(), numSpellsKnown(), world::playerclasses, world::plr, spelldesc::pp_cost, player::pps_max, refresh_spell(), slong, SPELL_TIME, classdesc::spellcasting, world::spelldescs, player::spellknowledge, STAT_FLAG_HALLUCINATING, STAT_FLAGS, STAT_WILLPOWER, world::time, timepass(), and w.

Referenced by study_book().


Variable Documentation

const struct spelldesc** spell_list [static]
 

Definition at line 42 of file spell.c.

Referenced by spellbookString(), and study_book().


Generated on Thu May 20 13:12:13 2004 for CalcRogue by doxygen 1.3.6