summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-11-08 12:12:55 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-11-08 12:14:23 +1000
commit52b47e9dd004853b02eee608b0e023dd2011e1d0 (patch)
tree98a37c16c6edab22a9155825242ee10fd3f98f9f
parent9d183aa841a13505fa057184c70f96406024e52d (diff)
downloadcrawl-ref-52b47e9dd004853b02eee608b0e023dd2011e1d0.tar.gz
crawl-ref-52b47e9dd004853b02eee608b0e023dd2011e1d0.zip
Change hard-coded _give_wand exceptions to class flags.
New class flags: M_NO_WAND. Do not give this unique a wand. Currently applied to Gastronok, removing the hard-coded exception. M_NO_HT_WAND: don't give a high-tier wand to this monster, even if their HD is 5 or higher.
-rw-r--r--crawl-ref/source/makeitem.cc4
-rw-r--r--crawl-ref/source/mon-data.h2
-rw-r--r--crawl-ref/source/mon-util.h4
3 files changed, 5 insertions, 5 deletions
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc
index 3567d9a90c..37fd3086e6 100644
--- a/crawl-ref/source/makeitem.cc
+++ b/crawl-ref/source/makeitem.cc
@@ -3324,7 +3324,7 @@ static void _give_scroll(monsters *mon, int level)
static void _give_wand(monsters *mon, int level)
{
- if (mons_is_unique(mon->type) && mon->type != MONS_GASTRONOK
+ if (mons_is_unique(mon->type) && !mons_class_flag(mon->type, M_NO_WAND)
&& (one_chance_in(5) || mon->type == MONS_MAURICE && one_chance_in(3)))
{
const int idx = items(0, OBJ_WANDS, OBJ_RANDOM, true, level, 0);
@@ -3335,7 +3335,7 @@ static void _give_wand(monsters *mon, int level)
item_def& wand = mitm[idx];
// Don't give top-tier wands before 5 HD.
- if (mon->hit_dice < 5)
+ if (mon->hit_dice < 5 || mons_class_flag(mon->type, M_NO_HT_WAND))
{
// Technically these wands will be undercharged, but it
// doesn't really matter.
diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h
index 80983c2fb2..eea677371c 100644
--- a/crawl-ref/source/mon-data.h
+++ b/crawl-ref/source/mon-data.h
@@ -4247,7 +4247,7 @@ static monsterentry mondata[] = {
{
MONS_GASTRONOK, 'j', LIGHTRED, "Gastronok",
M_NO_SKELETON | M_UNIQUE | M_SPELLCASTER | M_ACTUAL_SPELLS | M_SEE_INVIS
- | M_SPEAKS,
+ | M_SPEAKS | M_NO_WAND,
MR_RES_FIRE | MR_RES_COLD,
700, 10, MONS_GIANT_SLUG, MONS_GIANT_SLUG, MH_NATURAL, -4,
{ {AT_BITE, AF_PLAIN, 15}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index 6e1728fcfe..578d3adddc 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -113,8 +113,8 @@ enum mons_class_flags
M_PRIEST = (1<< 2), // monster is a priest,
M_FIGHTER = (1<< 3), // monster is skilled fighter
- M_UNUSED_1 = (1<< 4),
- M_UNUSED_2 = (1<< 5),
+ M_NO_WAND = (1<< 4), // do not give (unique) a wand
+ M_NO_HT_WAND = (1<< 5), // do not give a high tier wand
M_INVIS = (1<< 6), // is created invis
M_SEE_INVIS = (1<< 7), // can see invis