From 79fa8defdabeb25d5edd3817b851b212e3a65ae7 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Mon, 30 Jun 2008 04:06:15 +0000 Subject: Don't count an attack as unchivalrous if the attacker can't see the defender, which includes the defender being invisble, being behind opaque clouds, and being behind a wall when hit with an area attack. Before the code was only checking invisibility, which doesn't take into account LOS blocking things like opaque clouds and walls. Don't give a duplicate message when hitting a giant spore or ball lightning. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6239 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/fight.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/fight.cc') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 6280043cdd..11102b8cd7 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -290,8 +290,9 @@ unchivalric_attack_type is_unchivalric_attack(const actor *attacker, unchivalric_attack_type unchivalric = UCAT_NO_ATTACK; // No unchivalric attacks on monsters that cannot fight (e.g. - // plants) or invisible monsters. - if (!defender->cannot_fight() && defender->visible_to(attacker)) + // plants) or monsters the attacker can't see (either due to + // invisibility or being behind opaque clouds). + if (!defender->cannot_fight() && attacker->can_see(defender)) { // Distracted (but not batty); this only applies to players. if (attacker->atype() == ACT_PLAYER && def->foe != MHITYOU @@ -2643,11 +2644,6 @@ bool melee_attack::player_check_monster_died() player_monattk_hit_effects(true); - if (def->type == MONS_GIANT_SPORE || def->type == MONS_BALL_LIGHTNING) - { - msg::stream << "You " << attack_verb << ' ' - << def->name(DESC_NOCAP_THE) << '.' << std::endl; - } monster_die(def, KILL_YOU, 0); return (true); -- cgit v1.2.3-54-g00ecf