From 8f95470bfb148b72878f19a0b1680ba76d4f5fc9 Mon Sep 17 00:00:00 2001 From: haranp Date: Wed, 31 Oct 2007 12:18:22 +0000 Subject: 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 --- crawl-ref/source/item_use.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 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 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 ); -- cgit v1.2.3-54-g00ecf