From 6b3f882a81bae89affecdcba5e24df1fb51e8cf4 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Sat, 7 Nov 2009 18:41:34 -0800 Subject: monstuff.cc: Death-by-explosion message Give a different message if a monster is killed by a wand of disintegration. --- crawl-ref/source/monstuff.cc | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'crawl-ref/source/monstuff.cc') diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 9e72d7594f..24ef2ba386 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1523,6 +1523,7 @@ int monster_die(monsters *monster, killer_type killer, && mons_near(monster) && (monster->visible_to(&you) || crawl_state.arena); + const bool exploded = monster->flags & MF_EXPLODE_KILL; const bool created_friendly = testbits(monster->flags, MF_CREATED_FRIENDLY); bool anon = (killer_index == ANON_FRIENDLY_MONSTER); @@ -1544,14 +1545,17 @@ int monster_die(monsters *monster, killer_type killer, { mprf(MSGCH_MONSTER_DAMAGE, MDAM_DEAD, "%s is %s!", monster->name(DESC_CAP_THE).c_str(), - _wounded_damaged(monster->type) ? - "destroyed" : "killed"); + exploded ? "blown up" : + _wounded_damaged(monster->type) ? "destroyed" + : "killed"); } else { mprf(MSGCH_MONSTER_DAMAGE, MDAM_DEAD, "You %s %s!", - _wounded_damaged(monster->type) ? "destroy" : "kill", - monster->name(DESC_NOCAP_THE).c_str()); + exploded ? "blow up" : + _wounded_damaged(monster->type) ? "destroy" + : "kill", + monster->name(DESC_NOCAP_THE).c_str()); } if ((created_friendly || was_neutral) && gives_xp) @@ -1712,10 +1716,11 @@ int monster_die(monsters *monster, killer_type killer, case KILL_MON_MISSILE: // Monster kills by missile or beam. if (!silent) { - simple_monster_message(monster, - _wounded_damaged(monster->type) ? - " is destroyed!" : " dies!", - MSGCH_MONSTER_DAMAGE, + const char* msg = + exploded ? " is blown up!" : + _wounded_damaged(monster->type) ? " is destroyed!" + : " dies!"; + simple_monster_message(monster, msg, MSGCH_MONSTER_DAMAGE, MDAM_DEAD); } @@ -1911,10 +1916,11 @@ int monster_die(monsters *monster, killer_type killer, case KILL_MISC: if (!silent) { - simple_monster_message(monster, - _wounded_damaged(monster->type) ? - " is destroyed!" : " dies!", - MSGCH_MONSTER_DAMAGE, + const char* msg = + exploded ? " is blown up!" : + _wounded_damaged(monster->type) ? " is destroyed!" + : " dies!"; + simple_monster_message(monster, msg, MSGCH_MONSTER_DAMAGE, MDAM_DEAD); } break; -- cgit v1.2.3-54-g00ecf