diff options
Diffstat (limited to 'src/spells4.cc')
-rw-r--r-- | src/spells4.cc | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/spells4.cc b/src/spells4.cc index 97c3d523..ab79788c 100644 --- a/src/spells4.cc +++ b/src/spells4.cc @@ -12,9 +12,9 @@ #include "spells5.hpp" #include "spells6.hpp" #include "util.hpp" -#include "util.h" #include "variable.hpp" #include "z-rand.hpp" +#include "z-term.hpp" #include <algorithm> #include <array> @@ -53,13 +53,13 @@ s32b SCHOOL_VARDA; s32b SCHOOL_WATER; s32b SCHOOL_YAVANNA; -static bool_ uses_piety_to_cast(int s) +static bool uses_piety_to_cast(int s) { return spell_type_uses_piety_to_cast(spell_at(s)); } /** Describe what type of energy the spell uses for casting */ -cptr get_power_name(s32b s) +const char *get_power_name(s32b s) { return uses_piety_to_cast(s) ? "piety" : "mana"; } @@ -147,7 +147,7 @@ int spell_x(int sval, int spell_idx, int i) } } -bool_ school_book_contains_spell(int sval, s32b spell_idx) +bool school_book_contains_spell(int sval, s32b spell_idx) { random_book_setup(sval, spell_idx); school_book *school_book = school_books_at(sval); @@ -224,9 +224,7 @@ void init_school_books() push_spell(TOME_NATURE, GROWTREE); /* Create the book of Knowledge */ - push_spell(TOME_KNOWLEDGE, STARIDENTIFY); push_spell(TOME_KNOWLEDGE, VISION); - push_spell(TOME_KNOWLEDGE, IDENTIFY); push_spell(TOME_KNOWLEDGE, REVEALWAYS); push_spell(TOME_KNOWLEDGE, SENSEHIDDEN); push_spell(TOME_KNOWLEDGE, SENSEMONSTERS); @@ -258,7 +256,6 @@ void init_school_books() /* Create the book of eru */ push_spell(TOME_ERU, ERU_PROT); - push_spell(TOME_ERU, ERU_UNDERSTAND); push_spell(TOME_ERU, ERU_LISTEN); push_spell(TOME_ERU, ERU_SEE); @@ -416,13 +413,13 @@ static std::string spell_school_name(spell_type *spell) return buf.str(); } -int print_spell(cptr label_, byte color, int y, s32b s) +int print_spell(const char *label_, byte color, int y, s32b s) { s32b level; - bool_ na; + bool na; spell_type *spell = spell_at(s); - cptr spell_info = spell_type_info(spell); - cptr label = (label_ == NULL) ? "" : label_; + auto spell_info = spell_type_info(spell); + const char *label = (label_ == NULL) ? "" : label_; char level_str[8] = "n/a"; char buf[128]; @@ -442,15 +439,15 @@ int print_spell(cptr label_, byte color, int y, s32b s) level_str, get_mana(s), (int) spell_chance_book(s), - spell_info); + spell_info.c_str()); c_prt(color, buf, y, 0); return y + 1; } -void lua_cast_school_spell(s32b s, bool_ no_cost) +void lua_cast_school_spell(s32b s, bool no_cost) { - bool_ use = FALSE; + bool use = false; spell_type *spell = spell_at(s); /* No magic? */ @@ -507,7 +504,7 @@ void lua_cast_school_spell(s32b s, bool_ no_cost) } else { - use = TRUE; + use = true; /* failures are dangerous; we'll flush the input buffer so it isn't missed. */ @@ -522,7 +519,7 @@ void lua_cast_school_spell(s32b s, bool_ no_cost) } /* Use the mana/piety */ - if (use == TRUE) + if (use == true) { /* Reduce mana */ adjust_power(s, -get_mana(s)); |