summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemprop.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-05-24 05:16:26 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-05-24 05:16:26 +0000
commit0c023f544c759f832d5432503a8a02f9f52906be (patch)
treeb0968209f4b2ae4ce9f58edd2f26b95671b91ccb /crawl-ref/source/itemprop.cc
parentbd7b5f7cce46775dacee51b639e6278780e8dcc0 (diff)
downloadcrawl-ref-0c023f544c759f832d5432503a8a02f9f52906be.tar.gz
crawl-ref-0c023f544c759f832d5432503a8a02f9f52906be.zip
Tutorial changes:
* Note items which give abilities or resistances even if they're not equipped. * Don't give conjurers the item note about heavy armour for non-body armour, but do give a note about shields making casting harder. * Miscellaneous other improvements. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9812 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r--crawl-ref/source/itemprop.cc64
1 files changed, 3 insertions, 61 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index 6ffdafa00f..1cf82700c3 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -2411,26 +2411,10 @@ bool gives_ability(const item_def &item)
switch (item.base_type)
{
case OBJ_WEAPONS:
- {
- // unwielded weapon
- item_def *weap = you.slot_item(EQ_WEAPON);
- if (!weap || weap->slot != item.slot)
- return (false);
break;
- }
case OBJ_JEWELLERY:
- {
if (!jewellery_is_amulet(item))
{
- // unworn ring
- item_def *lring = you.slot_item(EQ_LEFT_RING);
- item_def *rring = you.slot_item(EQ_RIGHT_RING);
- if ((!lring || lring->slot != item.slot)
- && (!rring || rring->slot != item.slot))
- {
- return (false);
- }
-
if (item.sub_type == RING_TELEPORTATION
|| item.sub_type == RING_LEVITATION
|| item.sub_type == RING_INVISIBILITY)
@@ -2440,26 +2424,19 @@ bool gives_ability(const item_def &item)
}
else
{
- // unworn amulet
- item_def *amul = you.slot_item(EQ_AMULET);
- if (!amul || amul->slot != item.slot)
- return (false);
-
if (item.sub_type == AMU_RAGE)
return (true);
}
break;
- }
case OBJ_ARMOUR:
{
const equipment_type eq = get_armour_slot(item);
if (eq == EQ_NONE)
return (false);
+ const special_armour_type ego = get_armour_ego_type(item);
- // unworn armour
- item_def *arm = you.slot_item(eq);
- if (!arm || arm->slot != item.slot)
- return (false);
+ if (ego == SPARM_DARKNESS || ego == SPARM_LEVITATION)
+ return (true);
break;
}
default:
@@ -2486,26 +2463,10 @@ bool gives_resistance(const item_def &item)
switch (item.base_type)
{
case OBJ_WEAPONS:
- {
- // unwielded weapon
- item_def *weap = you.slot_item(EQ_WEAPON);
- if (!weap || weap->slot != item.slot)
- return (false);
break;
- }
case OBJ_JEWELLERY:
- {
if (!jewellery_is_amulet(item))
{
- // unworn ring
- const item_def *lring = you.slot_item(EQ_LEFT_RING);
- const item_def *rring = you.slot_item(EQ_RIGHT_RING);
- if ((!lring || lring->slot != item.slot)
- && (!rring || rring->slot != item.slot))
- {
- return (false);
- }
-
if (item.sub_type >= RING_PROTECTION_FROM_FIRE
&& item.sub_type <= RING_PROTECTION_FROM_COLD
|| item.sub_type == RING_SEE_INVISIBLE
@@ -2518,28 +2479,16 @@ bool gives_resistance(const item_def &item)
}
else
{
- // unworn amulet
- const item_def *amul = you.slot_item(EQ_AMULET);
- if (!amul || amul->slot != item.slot)
- return (false);
-
if (item.sub_type != AMU_RAGE && item.sub_type != AMU_INACCURACY)
return (true);
}
break;
- }
case OBJ_ARMOUR:
{
const equipment_type eq = get_armour_slot(item);
if (eq == EQ_NONE)
return (false);
- // unworn armour
- item_def *arm = you.slot_item(eq);
- if (!arm || arm->slot != item.slot)
- return (false);
- break;
-
const int ego = get_armour_ego_type(item);
if (ego >= SPARM_FIRE_RESISTANCE && ego <= SPARM_SEE_INVISIBLE
|| ego == SPARM_RESISTANCE || ego == SPARM_POSITIVE_ENERGY)
@@ -2548,19 +2497,12 @@ bool gives_resistance(const item_def &item)
}
}
case OBJ_STAVES:
- {
- // unwielded staff
- item_def *weap = you.slot_item(EQ_WEAPON);
- if (!weap || weap->slot != item.slot)
- return (false);
-
if (item.sub_type >= STAFF_FIRE && item.sub_type <= STAFF_POISON
|| item.sub_type == STAFF_AIR)
{
return (true);
}
return (false);
- }
default:
return (false);
}