summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-14 17:22:57 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-14 17:22:57 +0000
commitc952a077df68bc5174a63ffaabab555c01f0b8ac (patch)
treed98af75f307df9de3a56682ce3a815b04dfa1078 /crawl-ref/source/item_use.cc
parent4461e8e2b1380e7f2790fa42eccbf54fbebb4b9e (diff)
downloadcrawl-ref-c952a077df68bc5174a63ffaabab555c01f0b8ac.tar.gz
crawl-ref-c952a077df68bc5174a63ffaabab555c01f0b8ac.zip
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
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc23
1 files changed, 16 insertions, 7 deletions
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)