From b7fbb8da9606f9a8e1ad11ffd734827cb9baf911 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 12 Jun 2008 16:08:49 +0000 Subject: AutoID the curse status of a monster wielded cursed ranged weapon if said monster is trying to hit you with it. Don't give away what weapon a monster is carrying if it is not actually wielding it, especially not in the form of "A goblin, wielding a sling." that is shortly followed by "The goblin wields a sling." :p git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5763 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/directn.cc | 2 +- crawl-ref/source/fight.cc | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index cd5901145f..0437b72ca0 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -2062,7 +2062,7 @@ static std::string _describe_monster_weapon(const monsters *mons) name1 = weap->name(DESC_NOCAP_A, false, false, true, false, ISFLAG_KNOW_CURSE); } - if (alt && (!weap || mons_wields_two_weapons(mons))) + if (alt && mons_wields_two_weapons(mons)) { name2 = alt->name(DESC_NOCAP_A, false, false, true, false, ISFLAG_KNOW_CURSE); diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index be37c09cfb..d26d1ee36b 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -3911,6 +3911,13 @@ void melee_attack::mons_perform_attack_rounds() if (special_damage > 0) defender->hurt(attacker, special_damage); } + + item_def *weap = atk->mslot_item(MSLOT_WEAPON); + if (weap && weap->cursed() && is_range_weapon(*weap) + && !(weap->flags & ISFLAG_KNOW_CURSE)) + { + set_ident_flags( *weap, ISFLAG_KNOW_CURSE ); + } } } -- cgit v1.2.3-54-g00ecf