summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-22 12:25:18 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-22 12:25:18 +0000
commita12d1862eb07459daf4192933af0d84f6e3e0b83 (patch)
treeba17ec516751774b8ec50623e8ce4c476f2e216c /crawl-ref
parentec5b5dfca31a3c2ec1a101e38f57f47c3952acb8 (diff)
downloadcrawl-ref-a12d1862eb07459daf4192933af0d84f6e3e0b83.tar.gz
crawl-ref-a12d1862eb07459daf4192933af0d84f6e3e0b83.zip
Oops, a monster might be hit with a mutation attack or a Polymorph Other beam
while MF_JUST_SUMMONED is still set, so handle polymorphing just-placed shifters slightly differently. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8695 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/monplace.cc8
-rw-r--r--crawl-ref/source/monstuff.cc9
2 files changed, 11 insertions, 6 deletions
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index 703c39b41a..f0abe5b778 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -20,6 +20,7 @@ REVISION("$Rev$");
#include "ghost.h"
#include "lev-pand.h"
#include "makeitem.h"
+#include "message.h"
#include "monstuff.h"
#include "mon-pick.h"
#include "mon-util.h"
@@ -1099,8 +1100,15 @@ static int _place_monster_aux(const mgen_data &mg,
// Don't leave shifters in their starting shape.
if (mg.cls == MONS_SHAPESHIFTER || mg.cls == MONS_GLOWING_SHAPESHIFTER)
+ {
+ no_messages nm;
monster_polymorph(&menv[id], RANDOM_MONSTER);
+ // It's not actually a known shapeshifter if it happened to be
+ // placed in LOS of the player.
+ menv[id].flags &= ~MF_KNOWN_MIMIC;
+ }
+
// dur should always be 1-6 for monsters that can be abjured.
const bool summoned = mg.abjuration_duration >= 1
&& mg.abjuration_duration <= 6;
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index f104bcefa6..e915034ebc 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -1909,11 +1909,8 @@ bool monster_polymorph(monsters *monster, monster_type targetc,
if (!_valid_morph(monster, targetc))
return simple_monster_message(monster, " looks momentarily different.");
- const bool just_summoned = monster->flags & MF_JUST_SUMMONED;
-
- // Messaging. If the monster was just now summoned it's being
- // polymorphed as it's being placed, so the player doesn't see it.
- bool can_see = you.can_see(monster) && !just_summoned;
+ // Messaging.
+ bool can_see = you.can_see(monster);
// If old monster is visible to the player, and is interesting,
// then note why the interesting monster went away.
@@ -2028,7 +2025,7 @@ bool monster_polymorph(monsters *monster, monster_type targetc,
if (mons_class_flag(monster->type, M_INVIS))
monster->add_ench(ENCH_INVIS);
- if (!player_messaged && !just_summoned && you.can_see(monster))
+ if (!player_messaged && you.can_see(monster))
{
mprf("%s appears out of thin air!", monster->name(DESC_CAP_A).c_str());
player_messaged = true;