summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.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/dungeon.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/dungeon.cc')
-rw-r--r--crawl-ref/source/dungeon.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 8e8adeff8e..9c0bf853a3 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -4801,8 +4801,17 @@ int dgn_place_monster(mons_spec &mspec,
mg.flags |= MG_PERMIT_BANDS;
const int mindex = place_monster(mg, true);
- if (mindex != -1 && mspec.items.size() > 0)
- _dgn_give_mon_spec_items(mspec, mindex, mid, monster_level);
+ if (mindex != -1)
+ {
+ monsters &mons(menv[mindex]);
+ if (!mspec.items.empty())
+ _dgn_give_mon_spec_items(mspec, mindex, mid, monster_level);
+ if (mspec.explicit_spells)
+ mons.spells = mspec.spells;
+ mons.flags |= mspec.extra_monster_flags;
+ if (mons.is_priest() && mons.god == GOD_NO_GOD)
+ mons.god = GOD_NAMELESS;
+ }
return (mindex);
}
return (-1);
@@ -8484,4 +8493,3 @@ std::string dump_vault_maps()
}
return (out);
}
-