summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-08-20 09:57:59 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-08-20 09:57:59 +0000
commite30f59c25855ee942926f0719ef7648b9b97ed31 (patch)
tree85aa6597295185243208c4464cfd6fcca70ac94a
parent63862a28821718fa1faa2ecb7ff2b0312de2a040 (diff)
downloadcrawl-ref-e30f59c25855ee942926f0719ef7648b9b97ed31.tar.gz
crawl-ref-e30f59c25855ee942926f0719ef7648b9b97ed31.zip
r76@ODIN: dshaligram | 2006-08-20 15:28:51 +051800
Fixed brokenness stemming from incomplete merge of ARM_CAP. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup@27 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/itemprop.cc29
1 files changed, 24 insertions, 5 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index 44a7a19310..0a48f6c00f 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -586,8 +586,10 @@ void set_helmet_type( item_def &item, short type )
// make sure we have the right sub_type (to get properties correctly)
if (type == THELM_HELMET || type == THELM_HELM)
item.sub_type = ARM_HELMET;
- else
- item.sub_type = ARM_CAP;
+
+ // [dshaligram] FIXME: This is for when we import caps
+ // else
+ // item.sub_type = ARM_CAP;
item.plus2 &= ~THELM_TYPE_MASK;
item.plus2 |= type;
@@ -599,13 +601,23 @@ void set_helmet_desc( item_def &item, short type )
ASSERT( item.base_type == OBJ_ARMOUR
&& get_armour_slot( item ) == EQ_HELMET );
- if (item.sub_type == ARM_CAP && type > THELM_DESC_PLUMED)
+ const int helmtype = get_helmet_type(item);
+ if ((helmtype == THELM_CAP || helmtype == THELM_WIZARD_HAT)
+ && type > THELM_DESC_PLUMED)
type = THELM_DESC_PLAIN;
item.plus2 &= ~THELM_DESC_MASK;
item.plus2 |= type;
}
+bool is_hard_helmet(const item_def &item)
+{
+ return (item.base_type == OBJ_ARMOUR
+ && item.sub_type == ARM_HELMET
+ && (get_helmet_type(item) == THELM_HELM
+ || get_helmet_type(item) == THELM_HELMET));
+}
+
void set_helmet_random_desc( item_def &item )
{
ASSERT( item.base_type == OBJ_ARMOUR
@@ -613,7 +625,7 @@ void set_helmet_random_desc( item_def &item )
item.plus2 &= ~THELM_DESC_MASK;
- if (item.sub_type == ARM_HELMET)
+ if (is_hard_helmet(item))
item.plus2 |= (random2(8) << 8);
else
item.plus2 |= (random2(5) << 8);
@@ -816,6 +828,11 @@ bool armour_not_shiny( const item_def &item )
case ARM_TROLL_LEATHER_ARMOUR:
return (true);
+ case ARM_HELMET:
+ {
+ const int helmtype = get_helmet_type(item);
+ return (helmtype == THELM_CAP || helmtype == THELM_WIZARD_HAT);
+ }
default:
break;
}
@@ -984,7 +1001,9 @@ bool check_armour_shape( const item_def &item, bool quiet )
break;
case EQ_HELMET:
- if (item.sub_type == ARM_CAP)
+ if (item.sub_type == ARM_CAP
+ || get_helmet_type(item) == THELM_CAP
+ || get_helmet_type(item) == THELM_WIZARD_HAT)
break;
if (you.species == SP_KENKU)