From 52b47e9dd004853b02eee608b0e023dd2011e1d0 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sun, 8 Nov 2009 12:12:55 +1000 Subject: 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. --- crawl-ref/source/makeitem.cc | 4 ++-- crawl-ref/source/mon-data.h | 2 +- crawl-ref/source/mon-util.h | 4 ++-- 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 -- cgit v1.2.3-54-g00ecf