From b2a0f789b94558ed467b25ac5355eaf8b6558077 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sat, 31 May 2008 23:33:49 +0000 Subject: Fix 1962147: Move the comments on the food you eat at the end of DELAY_EAT. Fix 1971216: Kills by confused undead use LIVING_KILLED_BY_SERVANT instead because the message ("collateral kill") fits better and, though it's basically a hack, the distinction does fit somehow. Fix 1914948: Tweak message when you resist a spell cast by an invisible monster. Fix 1946608: Print "Nothing appears to happen." if reading ?EWI when unarmed. I guess that's it, plus probably some more cleanup. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5378 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'crawl-ref/source/beam.cc') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 89a926a2d2..5d7b327212 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -2455,7 +2455,7 @@ bool mass_enchantment( enchant_type wh_enchant, int pow, int origin, } } - // extra check for fear (monster needs to reevaluate behaviour) + // Extra check for fear (monster needs to reevaluate behaviour). if (wh_enchant == ENCH_FEAR) behaviour_event( monster, ME_SCARE, origin ); } @@ -2467,13 +2467,10 @@ bool mass_enchantment( enchant_type wh_enchant, int pow, int origin, return (msg_generated); } // end mass_enchantment() -/* - Monster has probably failed save, now it gets enchanted somehow. - - returns MON_RESIST if monster is unaffected due to magic resist. - returns MON_UNAFFECTED if monster is immune to enchantment - returns MON_AFFECTED in all other cases (already enchanted, etc) - */ +// Monster has probably failed save, now it gets enchanted somehow. +// * Returns MON_RESIST if monster is unaffected due to magic resist. +// * Returns MON_UNAFFECTED if monster is immune to enchantment. +// * Returns MON_AFFECTED in all other cases (already enchanted, etc). int mons_ench_f2(monsters *monster, bolt &pbolt) { switch (pbolt.flavour) /* put in magic resistance */ @@ -3688,7 +3685,18 @@ static int _affect_player( bolt &beam, item_def *item ) || !beam.aimed_at_feet) && you_resist_magic( beam.ench_power )) { - canned_msg(MSG_YOU_RESIST); + bool need_msg = true; + if (beam.beam_source != -1) + { + monsters *mon = &menv[beam.beam_source]; + if (!player_monster_visible(mon)) + { + mpr("Something tries to affect you, but you resist."); + need_msg = false; + } + } + if (need_msg) + canned_msg(MSG_YOU_RESIST); // You *could* have gotten a free teleportation in the Abyss, // but no, you resisted. -- cgit v1.2.3-54-g00ecf