summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2009-11-04 20:09:46 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2009-11-04 20:15:34 +0530
commit9ad85435681ad82c7ef07d2083e40e525e2b0f55 (patch)
tree3b16cb1129c004ad90cce5c81486373557d5f272 /crawl-ref/source/monstuff.cc
parentf7c29d55ca91d539d64de5e120a5b2c301ccb938 (diff)
downloadcrawl-ref-9ad85435681ad82c7ef07d2083e40e525e2b0f55.tar.gz
crawl-ref-9ad85435681ad82c7ef07d2083e40e525e2b0f55.zip
Allow vaults to override monster spells with spells:<xyz>
Vaults can now override monster spell sets, or give non-casting monsters spells, and mark monsters as wizard or priest types. The M_ACTUAL_SPELLS, M_SPELLCASTER and M_PRIEST monster class flags are converted into MF_* flags at monster creation/polymorph time, and only the per-monster flags are checked when determining wizard/priestliness. See caveats in level_design.txt.
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 3115ca8bb0..00181a28ba 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -1564,7 +1564,7 @@ int monster_die(monsters *monster, killer_type killer,
}
// Beogh hates priests of other gods.
- if (mons_class_flag(monster->type, M_PRIEST))
+ if (monster->is_priest())
{
did_god_conduct(DID_KILL_PRIEST,
monster->hit_dice, true, monster);
@@ -2324,8 +2324,8 @@ bool monster_polymorph(monsters *monster, monster_type targetc,
monster_spells spl = monster->spells;
const bool need_save_spells
= (!name.empty()
- && (!mons_class_flag(monster->type, M_SPELLCASTER)
- || mons_class_flag(monster->type, M_ACTUAL_SPELLS)));
+ && (!monster->can_use_spells()
+ || monster->is_actual_spellcaster()));
// deal with mons_sec
monster->type = targetc;
@@ -2345,8 +2345,7 @@ bool monster_polymorph(monsters *monster, monster_type targetc,
// swamp drake he'll breathe fumes and, if polymorphed further,
// won't remember his spells anymore.
if (need_save_spells
- && (!mons_class_flag(monster->type, M_SPELLCASTER)
- || mons_class_flag(monster->type, M_ACTUAL_SPELLS)))
+ && (!monster->can_use_spells() || monster->is_actual_spellcaster()))
{
monster->spells = spl;
}
@@ -2899,7 +2898,7 @@ monsters *choose_random_monster_on_level(int weight,
if (prefer_named && mon->is_named())
mon_weight++;
- if (prefer_priest && mons_class_flag(mon->type, M_PRIEST))
+ if (prefer_priest && mon->is_priest())
mon_weight++;
if (x_chance_in_y(mon_weight, (weight += mon_weight)))