summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-31 12:18:22 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-31 12:18:22 +0000
commit8f95470bfb148b72878f19a0b1680ba76d4f5fc9 (patch)
tree3c11e972e354ad1c756e9085351003321f517d45 /crawl-ref/source/item_use.cc
parented67c1d02e81d59aba70ae139c9711cd0d2a73d9 (diff)
downloadcrawl-ref-8f95470bfb148b72878f19a0b1680ba76d4f5fc9.tar.gz
crawl-ref-8f95470bfb148b72878f19a0b1680ba76d4f5fc9.zip
ID is no longer possible on portaled projectiles. Fixes 1817777.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2704 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 552e905ab8..cb5ed26aae 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1820,7 +1820,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
case SK_SLINGS:
{
// Slings are really easy to learn because they're not
- // really all that good, and its harder to get ammo anyways.
+ // really all that good, and it's harder to get ammo anyways.
exercise(SK_SLINGS, 1 + random2avg(3, 2));
// Sling bullets are designed for slinging and easier to aim.
@@ -1986,10 +1986,12 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
* ammo of fire and weapons of frost don't work together,
* and vice versa */
- // ID check
+ // ID check. Can't ID off teleported projectiles, uh, because
+ // it's too weird. Also it messes up the messages.
if (item_ident(you.inv[you.equip[EQ_WEAPON]], ISFLAG_KNOW_PLUSES))
{
- if ( !item_ident(you.inv[throw_2], ISFLAG_KNOW_PLUSES) &&
+ if ( !teleport &&
+ !item_ident(you.inv[throw_2], ISFLAG_KNOW_PLUSES) &&
random2(100) < shoot_skill )
{
set_ident_flags( item, ISFLAG_KNOW_PLUSES );
@@ -1998,7 +2000,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
you.inv[throw_2].name(DESC_NOCAP_A).c_str());
}
}
- else if (random2(100) < shoot_skill)
+ else if (!teleport && random2(100) < shoot_skill)
{
item_def& weapon = you.inv[you.equip[EQ_WEAPON]];
set_ident_flags(weapon, ISFLAG_KNOW_PLUSES);
@@ -2140,7 +2142,8 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
exercise(SK_THROWING, 1);
// ID check
- if ( !item_ident(you.inv[throw_2], ISFLAG_KNOW_PLUSES) &&
+ if ( !teleport &&
+ !item_ident(you.inv[throw_2], ISFLAG_KNOW_PLUSES) &&
random2(100) < you.skills[SK_THROWING] )
{
set_ident_flags( item, ISFLAG_KNOW_PLUSES );