diff options
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/dungeon.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/mgen_data.h | 10 | ||||
-rw-r--r-- | crawl-ref/source/mon-place.cc | 3 |
3 files changed, 17 insertions, 3 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 7640048c11..8c91a76616 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -4967,6 +4967,9 @@ int dgn_place_monster(mons_spec &mspec, if (m_band) mg.flags |= MG_PERMIT_BANDS; + // Store any extra flags here. + mg.extra_flags |= mspec.extra_monster_flags; + const int mindex = place_monster(mg, true); if (mindex != -1) { @@ -4975,7 +4978,9 @@ int dgn_place_monster(mons_spec &mspec, _dgn_give_mon_spec_items(mspec, mindex, mid, monster_level); if (mspec.explicit_spells) mons.spells = mspec.spells; - mons.flags |= mspec.extra_monster_flags; + // These are applied earlier to prevent issues with renamed monsters + // and "<monster> comes into view" (see delay.cc:_monster_warning). + //mons.flags |= mspec.extra_monster_flags; if (mons.is_priest() && mons.god == GOD_NO_GOD) mons.god = GOD_NAMELESS; } diff --git a/crawl-ref/source/mgen_data.h b/crawl-ref/source/mgen_data.h index 2719b71b94..360ebf3f54 100644 --- a/crawl-ref/source/mgen_data.h +++ b/crawl-ref/source/mgen_data.h @@ -90,6 +90,10 @@ struct mgen_data int hd; int hp; + // These flags will be appended to the monster's flags after placement. + // These flags are MF_XXX, rather than MG_XXX flags. + unsigned long extra_flags; + // XXX: Rather hackish. std::string mname; @@ -113,6 +117,7 @@ struct mgen_data proximity_type prox = PROX_ANYWHERE, level_area_type ltype = you.level_type, int mhd = 0, int mhp = 0, + unsigned long mflags = 0, std::string monname = "", std::string nas = "") @@ -120,7 +125,8 @@ struct mgen_data abjuration_duration(abj), summon_type(st), pos(p), foe(mfoe), flags(monflags), god(which_god), number(monnumber), colour(moncolour), power(monpower), proximity(prox), level_type(ltype), map_mask(0), - hd(mhd), hp(mhp), mname(monname), non_actor_summoner(nas) + hd(mhd), hp(mhp), extra_flags(mflags), mname(monname), + non_actor_summoner(nas) { ASSERT(summon_type == 0 || (abj >= 1 && abj <= 6) || mt == MONS_BALL_LIGHTNING); @@ -157,7 +163,7 @@ struct mgen_data return mgen_data(mt, BEH_HOSTILE, 0, abj, st, p, alert ? MHITYOU : MHITNOT, monflags, god, base, 0, BLACK, you.your_level, - PROX_ANYWHERE, you.level_type, 0, 0, "", summoner); + PROX_ANYWHERE, you.level_type, 0, 0, 0, "", summoner); } }; diff --git a/crawl-ref/source/mon-place.cc b/crawl-ref/source/mon-place.cc index c3f487b319..59dafc75bc 100644 --- a/crawl-ref/source/mon-place.cc +++ b/crawl-ref/source/mon-place.cc @@ -1188,6 +1188,9 @@ static int _place_monster_aux(const mgen_data &mg, mon->hit_points = mg.hp; } + // Store the extra flags here. + mon->flags |= mg.extra_flags; + // The return of Boris is now handled in monster_die(). Not setting // this for Boris here allows for multiple Borises in the dungeon at // the same time. - bwr |