diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-21 17:30:19 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-21 17:30:19 +0000 |
commit | db6775f6fcf45e64dd1ed27568532a27f2acf11d (patch) | |
tree | 3a11b47d739854ff2d1e493ff8a960e5350f0fa9 | |
parent | d6e0b68b50226f511107801bb2c11f6b358fbbc7 (diff) | |
download | crawl-ref-db6775f6fcf45e64dd1ed27568532a27f2acf11d.tar.gz crawl-ref-db6775f6fcf45e64dd1ed27568532a27f2acf11d.zip |
2088461: identify Holy Wrath brand on failed wield.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6965 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/effects.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/food.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/item_use.cc | 20 | ||||
-rw-r--r-- | crawl-ref/source/item_use.h | 2 |
4 files changed, 19 insertions, 7 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index b81cd7a77a..522c6f0742 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -1458,7 +1458,7 @@ bool acquirement(object_class_type class_wanted, int agent, if (thing_created == NON_ITEM) continue; - const item_def &doodad(mitm[thing_created]); + item_def &doodad(mitm[thing_created]); if (doodad.base_type == OBJ_WEAPONS && !can_wield(&doodad, false, true) || doodad.base_type == OBJ_ARMOUR diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 85339ceab0..f5c0823b2d 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -204,7 +204,7 @@ static int _find_butchering_implement(int &butcher_tool) // Look for a butchering implement in your pack. for (int i = 0; i < ENDOFPACK; ++i) { - const item_def& tool(you.inv[i]); + item_def& tool(you.inv[i]); if (is_valid_item( tool ) && tool.base_type == OBJ_WEAPONS && can_cut_meat( tool ) diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 7451d7e9fe..31c539c448 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -74,7 +74,7 @@ static bool _fire_validate_item(int selected, std::string& err); // Rather messy - we've gathered all the can't-wield logic from wield_weapon() // here. -bool can_wield(const item_def *weapon, bool say_reason, +bool can_wield(item_def *weapon, bool say_reason, bool ignore_temporary_disability) { #define SAY(x) if (say_reason) { x; } else @@ -155,7 +155,18 @@ bool can_wield(const item_def *weapon, bool say_reason, if ((you.is_undead || you.species == SP_DEMONSPAWN) && (weap_brand == SPWPN_HOLY_WRATH || is_blessed_blade(*weapon))) { - SAY(mpr("This weapon will not allow you to wield it.")); + if (say_reason) + { + mpr("This weapon is holy and will not allow you to wield it."); + // If it's a standard weapon, you know its ego now. + if (!is_artefact(*weapon) && !is_blessed_blade(*weapon) + && !item_type_known(*weapon)) + { + set_ident_flags(*weapon, ISFLAG_KNOW_TYPE); + if (in_inventory(*weapon)) + mpr(weapon->name(DESC_INVENTORY_EQUIP).c_str()); + } + } return (false); } @@ -526,7 +537,7 @@ void wield_effects(int item_wield_2, bool showMsgs) // Only used for Singing Sword introducing itself // (could be extended to other talking weapons...) - const char *old_desc = item.name(DESC_CAP_THE).c_str(); + const std::string old_desc = item.name(DESC_CAP_THE); if (!was_known) { @@ -638,7 +649,8 @@ void wield_effects(int item_wield_2, bool showMsgs) if (!was_known) { mprf(MSGCH_TALK, "%s says, " - "\"Hi! I'm the Singing Sword!\"", old_desc); + "\"Hi! I'm the Singing Sword!\"", + old_desc.c_str()); } else mpr("The Singing Sword hums in delight!", MSGCH_TALK); diff --git a/crawl-ref/source/item_use.h b/crawl-ref/source/item_use.h index f97d3fcc21..2ddbad1423 100644 --- a/crawl-ref/source/item_use.h +++ b/crawl-ref/source/item_use.h @@ -123,7 +123,7 @@ struct item_def; /* *********************************************************************** * called from: food * *********************************************************************** */ -bool can_wield(const item_def *weapon, bool say_why = false, +bool can_wield(item_def *weapon, bool say_why = false, bool ignore_temporary_disability = false); // last updated 12may2000 {dlb} |