diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-04 06:38:17 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-04 06:38:17 +0000 |
commit | cc0f9b2965e5298577253965c8819636985ac2db (patch) | |
tree | f586194693a2b6e0ff63411ddd6b136d137e9032 /crawl-ref/source/spl-cast.cc | |
parent | fccc5c8dd647216dc3ad7faff107a8ffc77acfb8 (diff) | |
download | crawl-ref-cc0f9b2965e5298577253965c8819636985ac2db.tar.gz crawl-ref-cc0f9b2965e5298577253965c8819636985ac2db.zip |
Savefile compatibility breakage from keeping track of which spells have been
seen.
Implemented fixed-level randart spell books, which is all randart spellbooks as
of now. All my attempts at sorting the spell list so that spells with the same
schools group together have utterly failed.
Got rid of the hackish "non-monster origin is stored in item.orig_monnum as
(-origin - 2)" logic, replaced with the slightly less hackish "-origin". Added
the two enumerations IT_SRC_START and IT_SRC_SHOP to do it. Also,
origin_is_god_gift() and origin_is_acquirement() can retrieve the god/source of
the item so that you don't have to do the negation and typecasting yourself.
Added some new spell flags:
* SPFLAG_BATTLE for non-conjuration spells which are still combat/battle
related (branding spells and single school attack spells like "Pain"),
* SPFLAG_CARD for spells which are card-type effects which don't show up in
ordinary spellbooks (Tomb of Doroklohe and (I assume) Disintigrate)
* SPFLAG_TESTING for spells which are only used for testing (Debugging Ray)
* SPFLAG_DEVEL for spells that are still under development (Crush,
Disrupt, and Detect Magic).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7742 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-cast.cc')
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 4dbd7654d1..c1ac0e90ad 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -976,17 +976,27 @@ int _setup_evaporate_cast() // Others are currently unused or unimplemented. spret_type your_spells(spell_type spell, int powc, bool allow_fail) { + const bool wiz_cast = (crawl_state.prev_cmd == CMD_WIZARD && !allow_fail); + dist spd; bolt beam; // [dshaligram] Any action that depends on the spellcasting attempt to have // succeeded must be performed after the switch(). - - if (_spell_is_uncastable(spell)) + if (!wiz_cast && _spell_is_uncastable(spell)) return (SPRET_ABORT); const unsigned int flags = get_spell_flags(spell); + ASSERT(wiz_cast || !(flags & SPFLAG_TESTING)); + if ((flags & SPFLAG_TESTING) && !wiz_cast) + { + mprf(MSGCH_ERROR, "Spell %s is a testing spell, but you didn't use " + "the &Z wizard command; please file a bug report.", + spell_title(spell)); + return (SPRET_ABORT); + } + int potion = -1; // XXX: This handles only some of the cases where spells need targeting... |