#include "hack.h"
Defines | |
#define | SPELLMENU_CAST (-2) |
#define | SPELLMENU_VIEW (-1) |
#define | KEEN 20000 |
#define | MAX_SPELL_STUDY 3 |
#define | incrnknow(spell) spl_book[spell].sp_know = KEEN |
#define | spellev(spell) spl_book[spell].sp_lev |
#define | spellname(spell) OBJ_NAME(objects[spellid(spell)]) |
#define | spellet(spell) ((char)((spell < 26) ? ('a' + spell) : ('A' + spell - 26))) |
#define | uarmhbon 4 |
#define | uarmgbon 6 |
#define | uarmfbon 2 |
Functions | |
STATIC_DCL int | FDECL (spell_let_to_idx,(CHAR_P)) |
STATIC_DCL boolean | FDECL (cursed_book,(struct obj *bp)) |
STATIC_DCL boolean | FDECL (confused_book,(struct obj *)) |
STATIC_DCL void | FDECL (deadbook,(struct obj *)) |
STATIC_PTR int | NDECL (learn) |
STATIC_DCL boolean | FDECL (getspell,(int *)) |
STATIC_DCL boolean | FDECL (dospellmenu,(const char *, int, int *)) |
STATIC_DCL int | FDECL (percent_success,(int)) |
STATIC_DCL int | NDECL (throwspell) |
STATIC_DCL void | NDECL (cast_protection) |
STATIC_DCL void | FDECL (spell_backfire,(int)) |
STATIC_DCL const char * | FDECL (spelltypemnemonic,(int)) |
STATIC_DCL int | FDECL (isqrt,(int)) |
STATIC_OVL int | spell_let_to_idx (char ilet) |
STATIC_OVL boolean | cursed_book (struct obj *bp) |
STATIC_OVL boolean | confused_book (struct obj *spellbook) |
STATIC_OVL void | deadbook (struct obj *book2) |
STATIC_PTR int | learn () |
int | study_book (struct obj *spellbook) |
void | book_disappears (struct obj *obj) |
void | book_substitution (struct obj *old_obj, struct obj *new_obj) |
void | age_spells () |
STATIC_OVL boolean | getspell (int *spell_no) |
int | docast () |
STATIC_OVL const char * | spelltypemnemonic (int skill) |
int | spell_skilltype (int booktype) |
STATIC_OVL void | cast_protection () |
STATIC_OVL void | spell_backfire (int spell) |
int | spelleffects (int spell, boolean atme) |
STATIC_OVL int | throwspell () |
void | losespells () |
int | dovspell () |
STATIC_OVL boolean | dospellmenu (char *prompt, int splaction, int *spell_no) const |
void | dump_spells () |
STATIC_OVL int | isqrt (int val) |
STATIC_OVL int | percent_success (int spell) |
void | initialspell (struct obj *obj) |
Variables | |
static NEARDATA schar | delay |
static NEARDATA struct obj * | book |
static const char | explodes [] = "radiates explosive energy" |
Referenced by initialspell(), and learn().
#define KEEN 20000 |
#define MAX_SPELL_STUDY 3 |
Referenced by learn().
Referenced by dospellmenu(), dovspell(), and dump_spells().
Referenced by dospellmenu(), dump_spells(), percent_success(), spell_backfire(), and spelleffects().
#define SPELLMENU_CAST (-2) |
Referenced by getspell().
#define SPELLMENU_VIEW (-1) |
Referenced by dospellmenu(), and dovspell().
Referenced by dospellmenu(), and dump_spells().
#define uarmfbon 2 |
Referenced by percent_success().
#define uarmgbon 6 |
Referenced by percent_success().
#define uarmhbon 4 |
Referenced by percent_success().
void age_spells | ( | ) |
void book_disappears | ( | struct obj * | obj ) |
STATIC_OVL void cast_protection | ( | ) |
References an(), Blind, you::dx, you::dy, find_ac(), hcolor(), IS_STWALL, Is_waterlevel, levl, mbodypart(), min, NH_GOLDEN, P_EXPERT, P_SKILL, SPE_PROTECTION, spell_skilltype(), STOMACH, u, you::uac, you::ulevel, Underwater, you::uspellprot, you::uspmtime, you::usptime, you::ustuck, and you::uz.
Referenced by spelleffects().
References display_nhwindow, docall(), FALSE, objects, objclass::oc_uname, pline(), rn2(), SPE_BOOK_OF_THE_DEAD, TRUE, useup(), and WIN_MESSAGE.
Referenced by learn(), and study_book().
References aggravate(), Antimagic, Blind, Blinded, body_part(), FACE, FALSE, grease_protect(), HConfusion, is_corrodeable, KILLED_BY_AN, losehp(), losestr(), make_blinded(), make_confused(), MAX_ERODE, objects, pline(), Poison_resistance, rn1, rn2(), rnd(), rndcurse(), shieldeff(), take_gold(), tele(), TRUE, u, uarmg, you::ux, you::uy, and youmonst.
Referenced by learn(), and study_book().
STATIC_OVL void deadbook | ( | struct obj * | book2 ) |
References obj::age, BELL_OF_OPENING, body_part(), CANDELABRUM_OF_INVOCATION, cansee, d(), monst::data, DEADMONSTER, distu, FALSE, fmon, invent, invocation_pos(), is_undead, makeknown, makemon(), permonst::maligntyp, mkinvokearea(), mkundead(), monflee(), mons, moves, monst::mtame, monst::mx, monst::my, monst::nmon, NO_MINVENT, obj::nobj, On_stairs(), otmp, obj::otyp, pline(), PM_MASTER_LICH, PM_NALFESHNEE, rn2(), set_malign(), sgn(), something, obj::spe, SPE_BOOK_OF_THE_DEAD, SPINE, tamedog(), TRUE, align::type, u, you::ualign, you::udg_cnt, you::uevent, you::uhave, unturn_dead(), you::ux, you::uy, nhcoord::x, nhcoord::y, and youmonst.
Referenced by learn().
int docast | ( | ) |
STATIC_OVL boolean dospellmenu | ( | char * | prompt, |
int | splaction, | ||
int * | spell_no | ||
) | const |
References any::a_int, any::a_void, add_menu, ATR_BOLD, ATR_NONE, BUFSZ, create_nhwindow, destroy_nhwindow, end_menu, FALSE, iflags, mi::item, MAXSPELL, MENU_SELECTED, instance_flags::menu_tab_sep, MENU_UNSELECTED, NHW_MENU, NO_GLYPH, NO_SPELL, percent_success(), PICK_NONE, PICK_ONE, select_menu, spell_skilltype(), spellet, spellev, spellid, spellknow, SPELLMENU_VIEW, spellname, spelltypemnemonic(), Sprintf, start_menu, and TRUE.
Referenced by dovspell(), and getspell().
int dovspell | ( | ) |
References dospellmenu(), NO_SPELL, QBUFSZ, spellet, spellid, SPELLMENU_VIEW, spl_book, and Sprintf.
void dump_spells | ( | ) |
Dump the currently known spells.
References BUFSZ, dump(), dump_html(), dump_text(), dump_title(), MAXSPELL, NO_SPELL, percent_success(), spell_skilltype(), spellet, spellev, spellid, spellknow, spellname, spelltypemnemonic(), and Sprintf.
Referenced by disclose().
STATIC_DCL int FDECL | ( | isqrt | , |
(int) | |||
) |
STATIC_DCL int FDECL | ( | percent_success | , |
(int) | |||
) |
STATIC_DCL void FDECL | ( | deadbook | , |
(struct obj *) | |||
) |
STATIC_DCL void FDECL | ( | spell_backfire | , |
(int) | |||
) |
STATIC_DCL boolean FDECL | ( | getspell | , |
(int *) | |||
) |
STATIC_DCL const char* FDECL | ( | spelltypemnemonic | , |
(int) | |||
) |
STATIC_DCL int FDECL | ( | spell_let_to_idx | , |
(CHAR_P) | |||
) |
STATIC_DCL boolean FDECL | ( | dospellmenu | , |
(const char *, int, int *) | |||
) |
STATIC_OVL boolean getspell | ( | int * | spell_no ) |
References BUFSZ, dospellmenu(), FALSE, flags, index, MAXSPELL, flag::menu_style, MENU_TRADITIONAL, NO_SPELL, QBUFSZ, quitchars, spell_let_to_idx(), spellid, SPELLMENU_CAST, Sprintf, Strcpy, TRUE, and yn_function().
Referenced by docast().
void initialspell | ( | struct obj * | obj ) |
STATIC_OVL int isqrt | ( | int | val ) |
Integer square root function without using floating point.
Referenced by percent_success().
STATIC_PTR int learn | ( | ) |
References A_WIS, BUFSZ, check_unpaid(), confused_book(), Confusion, cursed_book(), deadbook(), delay, exercise(), FALSE, incrnknow, LENSES, makeknown, MAX_SPELL_STUDY, MAXSPELL, NO_SPELL, nomul(), OBJ_NAME, objects, obj::otyp, pline(), rn2(), spell::sp_id, spell::sp_lev, SPE_BLANK_PAPER, SPE_BOOK_OF_THE_DEAD, spellid, spellknow, spl_book, Sprintf, TRUE, ublindf, and useup().
Referenced by study_book().
void losespells | ( | ) |
STATIC_DCL void NDECL | ( | cast_protection | ) |
STATIC_DCL int NDECL | ( | throwspell | ) |
STATIC_PTR int NDECL | ( | learn | ) |
STATIC_OVL int percent_success | ( | int | spell ) |
Returns the success rate of the specified spell in percent.
References ACURR, HELM_OF_BRILLIANCE, if(), is_metallic, isqrt(), max, objects, obj::otyp, P_SKILL, P_UNSKILLED, ROBE, SMALL_SHIELD, SPE_CURE_BLINDNESS, SPE_CURE_SICKNESS, SPE_EXTRA_HEALING, SPE_HEALING, SPE_REMOVE_CURSE, SPE_RESTORE_ABILITY, Role::spelarmr, Role::spelbase, Role::spelheal, spell_skilltype(), spellev, spellid, Role::spelsbon, Role::spelshld, Role::spelspec, Role::spelstat, TINFOIL_HAT, u, uarm, uarmc, uarmf, uarmfbon, uarmg, uarmgbon, uarmh, uarmhbon, uarms, you::ulevel, urole, and weight().
Referenced by dospellmenu(), dump_spells(), and spelleffects().
STATIC_OVL void spell_backfire | ( | int | spell ) |
References FALSE, make_confused(), make_stunned(), rn2(), and spellev.
Referenced by spelleffects().
STATIC_OVL int spell_let_to_idx | ( | char | ilet ) |
int spell_skilltype | ( | int | booktype ) |
References objects, and oc_skill.
Referenced by cast_protection(), dospellmenu(), dump_spells(), percent_success(), pleased(), restricted_spell_discipline(), spell_hit_bonus(), and spelleffects().
int spelleffects | ( | int | spell, |
boolean | atme | ||
) |
References A_INT, A_STR, A_WIS, acurr(), ACURR, BClairvoyant, body_part(), flag::botl, BUFSZ, cansee, cast_protection(), check_capacity(), Confusion, CORNUTHAUM, do_vicinity_map(), you::dx, you::dy, you::dz, exercise(), EXPL_FIERY, EXPL_FROSTY, explode(), FALSE, flags, freehand(), getdir(), HEAD, healup(), IS_STWALL, isok(), jump(), levl, losehp(), make_familiar(), max, mksobj(), morehungry(), NO_KILLER_PREFIX, NODIR, nothing_happens, obfree(), objects, obj::otyp, P_SKILL, P_SKILLED, peffects(), percent_success(), pline(), PM_WIZARD, obj::quan, rnd(), Role_if, seffects(), Sick, Slimed, SPE_CANCELLATION, SPE_CAUSE_FEAR, SPE_CHARM_MONSTER, SPE_CLAIRVOYANCE, SPE_CONE_OF_COLD, SPE_CONFUSE_MONSTER, SPE_CREATE_FAMILIAR, SPE_CREATE_MONSTER, SPE_CURE_BLINDNESS, SPE_CURE_SICKNESS, SPE_DETECT_FOOD, SPE_DETECT_MONSTERS, SPE_DETECT_TREASURE, SPE_DETECT_UNSEEN, SPE_DIG, SPE_DRAIN_LIFE, SPE_EXTRA_HEALING, SPE_FINGER_OF_DEATH, SPE_FIREBALL, SPE_FORCE_BOLT, SPE_HASTE_SELF, SPE_HEALING, SPE_IDENTIFY, SPE_INVISIBILITY, SPE_JUMPING, SPE_KNOCK, SPE_LEVITATION, SPE_LIGHT, SPE_MAGIC_MAPPING, SPE_MAGIC_MISSILE, SPE_POLYMORPH, SPE_PROTECTION, SPE_REMOVE_CURSE, SPE_RESTORE_ABILITY, SPE_SLEEP, SPE_SLOW_MONSTER, SPE_STONE_TO_FLESH, SPE_TELEPORT_AWAY, SPE_TURN_UNDEAD, SPE_WIZARD_LOCK, spell_backfire(), spell_damage_bonus(), spell_skilltype(), spellev, spellid, spellknow, Sprintf, throwspell(), TINFOIL_HAT, TRUE, u, uarmh, you::uen, you::uhave, uhim, you::uhunger, you::ulevel, update_inventory, use_skill(), you::ux, you::uy, weffects(), nhcoord::x, nhcoord::y, and zapyourself().
Referenced by docast(), dotele(), and doturn().
STATIC_OVL const char* spelltypemnemonic | ( | int | skill ) |
References P_ATTACK_SPELL, P_CLERIC_SPELL, P_DIVINATION_SPELL, P_ENCHANTMENT_SPELL, P_ESCAPE_SPELL, P_HEALING_SPELL, and P_MATTER_SPELL.
Referenced by dospellmenu(), and dump_spells().
int study_book | ( | struct obj * | spellbook ) |
References A_INT, ACURR, confused_book(), Confusion, cursed_book(), delay, docall(), FALSE, learn(), LENSES, makeknown, nomul(), objects, objclass::oc_delay, oc_level, objclass::oc_uname, obj::otyp, pline(), PM_WIZARD, QBUFSZ, rn2(), rnd(), Role_if, set_occupation(), SPE_BLANK_PAPER, SPE_BOOK_OF_THE_DEAD, Sprintf, TRUE, u, ublindf, you::ulevel, useup(), and yn.
Referenced by doread().
STATIC_OVL int throwspell | ( | ) |
References A_WIS, cansee, distmin(), you::dx, you::dy, exercise(), FALSE, getpos(), IS_STWALL, Is_waterlevel, levl, pline(), TRUE, u, you::ux, you::uy, you::uz, nhcoord::x, and nhcoord::y.
Referenced by spelleffects().
Referenced by armoroff(), dowear(), learn(), and study_book().
const char explodes[] = "radiates explosive energy" [static] |