From c952a077df68bc5174a63ffaabab555c01f0b8ac Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 14 Jan 2008 17:22:57 +0000 Subject: FR 1861017: add info on enchanting hides to enchant armour description FR 1840678: upon failed sacrifice give hint on correct item class part of FR 1857701: Give a message when a weapon of returning does NOT return (and add a message_colour line in init.txt) Also, change Zin's donation messages to reflect the piety status the player will have once the piety pool has emptied into the actual piety, and modify descriptions of the good gods (by David). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3274 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/item_use.cc | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/item_use.cc') diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 4a7237c0f2..14adf663b5 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -1686,7 +1686,8 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, int exHitBonus = 0, exDamBonus = 0; // 'extra' bonus from skill/dex/str int effSkill = 0; // effective launcher skill int dice_mult = 100; - bool returning = false; // item will return to pack + bool returning = false; // item can return to pack + bool did_return = false; // returning item actually does return to pack int slayDam = 0; if (!teleport) @@ -2122,9 +2123,11 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, if (projected == LRET_THROWN) { returning = ((get_weapon_brand(item) == SPWPN_RETURNING || - get_ammo_brand(item) == SPMSL_RETURNING) && - !teleport && - !one_chance_in(1 + skill_bump(SK_THROWING))); + get_ammo_brand(item) == SPMSL_RETURNING) && !teleport); + + if (returning && !one_chance_in(1 + skill_bump(SK_THROWING))) + did_return = true; + baseHit = 0; // missiles only use inv_plus @@ -2403,17 +2406,17 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, else { // Dropping item copy, since the launched item might be different. - fire_beam(pbolt, returning ? NULL : &item); + fire_beam(pbolt, did_return? NULL : &item); // The item can be destroyed before returning. if (returning && thrown_object_destroyed(&item, pbolt.target_x, pbolt.target_y, true)) { - returning = false; + did_return = false; } } - if ( returning ) + if ( did_return ) { // Fire beam in reverse pbolt.setup_retrace(); @@ -2428,7 +2431,13 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, set_ident_flags(you.inv[throw_2], ISFLAG_KNOW_TYPE); } else + { + if (returning) // should have returned but didn't + msg::stream << item.name(DESC_CAP_THE) + << " fails to return to your pack!" << std::endl; + dec_inv_item_quantity( throw_2, 1 ); + } // throwing and blowguns are silent if (projected == LRET_LAUNCHED && lnchType != WPN_BLOWGUN) -- cgit v1.2.3-54-g00ecf