diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-22 09:58:12 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-22 09:58:12 +0000 |
commit | a54e6bb23df5211c2a5b59037f355c43e795fa05 (patch) | |
tree | 38b7fb13b77c101ea3eaa483a9167c19dd128927 /crawl-ref/source | |
parent | 581c0cd227e278195c880b22b5765e782e634b97 (diff) | |
download | crawl-ref-a54e6bb23df5211c2a5b59037f355c43e795fa05.tar.gz crawl-ref-a54e6bb23df5211c2a5b59037f355c43e795fa05.zip |
Overload MF_KNOWN_MIMIC to also mean "a shapeshifter the player has seen
shift", append "shaped shifter" to the end of the name of known shifters, and
give a special death message when a non-known shifter dies to let the player
know it was a shifter.
Immediately polymorph shifters as soon as they are placed (with no messages to
the player) so that if the player enters a new level with a shifter in LOS (or
if a shifter is summoned in LOS) the player will never see it as a plain/raw
shifter.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8693 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/mon-util.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/monplace.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 32 |
3 files changed, 31 insertions, 8 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 4114891a32..2e9e677186 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -2184,6 +2184,9 @@ static std::string _str_monam(const monsters& mon, description_level_type desc, } } + if ((mon.flags & MF_KNOWN_MIMIC) && mons_is_shapeshifter(&mon)) + result += " shaped shifter"; + // All done. return result; } diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index aee447406d..703c39b41a 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -1097,6 +1097,10 @@ static int _place_monster_aux(const mgen_data &mg, menv[id].flags |= MF_JUST_SUMMONED; + // Don't leave shifters in their starting shape. + if (mg.cls == MONS_SHAPESHIFTER || mg.cls == MONS_GLOWING_SHAPESHIFTER) + monster_polymorph(&menv[id], RANDOM_MONSTER); + // 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 cfba5a58c1..f104bcefa6 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1666,6 +1666,13 @@ int monster_die(monsters *monster, killer_type killer, // don't clutter up mitm[] monster->destroy_inventory(); + if (!silent && !wizard && !(monster->flags & MF_KNOWN_MIMIC) + && mons_is_shapeshifter(monster)) + { + simple_monster_message(monster, "'s shape twists and changes " + "as it dies; that was a shifter!"); + } + crawl_state.dec_mon_acting(monster); monster_cleanup(monster); @@ -1902,18 +1909,20 @@ 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; + // If old monster is visible to the player, and is interesting, // then note why the interesting monster went away. - if (player_monster_visible(monster) && mons_near(monster) - && MONST_INTERESTING(monster)) + if (can_see && MONST_INTERESTING(monster)) { take_note(Note(NOTE_POLY_MONSTER, monster->type, 0, monster->name(DESC_CAP_A, true).c_str())); } - // Messaging. - bool can_see = you.can_see(monster); - if (monster->type == MONS_OGRE && targetc == MONS_TWO_HEADED_OGRE) str_polymon = " grows a second head!"; else @@ -1937,7 +1946,8 @@ bool monster_polymorph(monsters *monster, monster_type targetc, str_polymon += "!"; } } - bool player_messaged = simple_monster_message(monster, str_polymon.c_str()); + bool player_messaged = can_see + && simple_monster_message(monster, str_polymon.c_str()); // Even if the monster transforms from one type that can behold the // player into a different type which can also behold the player, @@ -1953,7 +1963,7 @@ bool monster_polymorph(monsters *monster, monster_type targetc, unsigned long flags = monster->flags & ~(MF_INTERESTING | MF_SEEN | MF_ATT_CHANGE_ATTEMPT | MF_WAS_IN_VIEW | MF_BAND_MEMBER - | MF_HONORARY_UNDEAD); + | MF_HONORARY_UNDEAD | MF_KNOWN_MIMIC); std::string name; @@ -2018,7 +2028,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 && you.can_see(monster)) + if (!player_messaged && !just_summoned && you.can_see(monster)) { mprf("%s appears out of thin air!", monster->name(DESC_CAP_A).c_str()); player_messaged = true; @@ -2040,7 +2050,13 @@ bool monster_polymorph(monsters *monster, monster_type targetc, // If new monster is visible to player, then we've seen it. if (player_monster_visible(monster) && mons_near(monster)) + { seen_monster(monster); + // If the player saw both the begining and end results of a shifter + // changing then he/seh knows it must be a shifter. + if (can_see && shifter.ench != ENCH_NONE) + monster->flags |= MF_KNOWN_MIMIC; + } if (old_mon_caught) check_net_will_hold_monster(monster); |