From 9fecb788095cc5315ef5f1485e0b736563a21460 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 13 Apr 2009 20:40:39 +0000 Subject: * Add stair repelling as a bad Xom effect. * Experimentally make tension increase the odds for good effects. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9600 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/itemprop.cc | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'crawl-ref/source/itemprop.cc') diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 829b6ca1b9..21fd25c77c 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -484,6 +484,17 @@ void do_curse_item( item_def &item, bool quiet ) if (item.flags & ISFLAG_CURSED) return; + if (!quiet) + { + mprf("Your %s glows black for a moment.", + item.name(DESC_PLAIN).c_str()); + + // If we get the message, we know the item is cursed now. + item.flags |= ISFLAG_KNOW_CURSE; + } + + item.flags |= ISFLAG_CURSED; + // Xom is amused by the player's items being cursed, especially // if they're worn/equipped. if (in_inventory(item)) @@ -508,17 +519,6 @@ void do_curse_item( item_def &item, bool quiet ) } xom_is_stimulated(amusement); } - - if (!quiet) - { - mprf("Your %s glows black for a moment.", - item.name(DESC_PLAIN).c_str()); - - // If we get the message, we know the item is cursed now. - item.flags |= ISFLAG_KNOW_CURSE; - } - - item.flags |= ISFLAG_CURSED; } void do_uncurse_item( item_def &item ) @@ -1389,7 +1389,7 @@ int wand_charge_value(int type) } } -bool is_enchantable_weapon(const item_def &wpn, bool uncurse) +bool is_enchantable_weapon(const item_def &wpn, bool uncurse, bool first) { if (wpn.base_type != OBJ_WEAPONS && wpn.base_type != OBJ_MISSILES) return (false); @@ -1399,7 +1399,8 @@ bool is_enchantable_weapon(const item_def &wpn, bool uncurse) if (wpn.base_type == OBJ_WEAPONS) { if (is_artefact(wpn) - || wpn.plus >= MAX_WPN_ENCHANT && wpn.plus2 >= MAX_WPN_ENCHANT) + || first && wpn.plus >= MAX_WPN_ENCHANT + || !first && wpn.plus2 >= MAX_WPN_ENCHANT) { return (uncurse && item_cursed(wpn)); } -- cgit v1.2.3-54-g00ecf