summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-19 11:35:34 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-19 11:35:34 +0000
commitb0b4d7e1fbb9efed46a590a0045ad270fa409305 (patch)
tree92d454732f1a9d891aa445e3346979a65e1450f7
parent811db79a78d57a056981f56879af1dcc5e3c6eea (diff)
downloadcrawl-ref-b0b4d7e1fbb9efed46a590a0045ad270fa409305.tar.gz
crawl-ref-b0b4d7e1fbb9efed46a590a0045ad270fa409305.zip
Don't add rF+/rC- to the autoinscriptions of randart rings of fire
(and vice versa for ice), since that's already what their base type does. Should the code ever be changed to allow them to get additional levels of resistance or susceptibility, the check is only done for the base stats (+1 and -1, respectively). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4362 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/describe.cc21
-rw-r--r--crawl-ref/source/randart.cc8
2 files changed, 27 insertions, 2 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 622d9a83a7..7a1bde8feb 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -226,7 +226,7 @@ static std::vector<std::string> _randart_propnames( const item_def& item )
{ "rN", RAP_NEGATIVE_ENERGY, 1 },
{ "MR", RAP_MAGIC, 2 },
- // Positive, quantative attributes
+ // Quantitative attributes
{ "AC", RAP_AC, 0 },
{ "EV", RAP_EVASION, 0 },
{ "Str", RAP_STRENGTH, 0 },
@@ -235,7 +235,7 @@ static std::vector<std::string> _randart_propnames( const item_def& item )
{ "Acc", RAP_ACCURACY, 0 },
{ "Dam", RAP_DAMAGE, 0 },
- // Positive, qualitative attributes
+ // Qualitative attributes
{ "MP", RAP_MAGICAL_POWER, 0 },
{ "SInv", RAP_EYESIGHT, 2 },
{ "Stlth", RAP_STEALTH, 2 } // handled specially
@@ -276,6 +276,23 @@ static std::vector<std::string> _randart_propnames( const item_def& item )
if (known_proprt(propanns[i].prop))
{
const int val = proprt[propanns[i].prop];
+
+ if (item.base_type == OBJ_JEWELLERY)
+ {
+ if (item.sub_type == RING_FIRE
+ && (propanns[i].prop == RAP_FIRE && val == 1
+ || propanns[i].prop == RAP_COLD && val == -1))
+ {
+ continue;
+ }
+ if (item.sub_type == RING_ICE
+ && (propanns[i].prop == RAP_COLD && val == 1
+ || propanns[i].prop == RAP_FIRE && val == -1))
+ {
+ continue;
+ }
+ }
+
std::ostringstream work;
switch ( propanns[i].spell_out )
{
diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc
index 5e87296e72..8bd5d2f35a 100644
--- a/crawl-ref/source/randart.cc
+++ b/crawl-ref/source/randart.cc
@@ -1048,22 +1048,30 @@ void randart_wpn_properties( const item_def &item,
if (aclass == OBJ_JEWELLERY
&& (atype == RING_PROTECTION_FROM_FIRE || atype == RING_FIRE
|| atype == RING_ICE))
+ {
break; // already does this or something
+ }
if (aclass == OBJ_ARMOUR
&& (atype == ARM_DRAGON_ARMOUR || atype == ARM_ICE_DRAGON_ARMOUR
|| atype == ARM_GOLD_DRAGON_ARMOUR))
+ {
break;
+ }
proprt[RAP_FIRE] = -1;
break;
case 6: // susceptible to cold
if (aclass == OBJ_JEWELLERY
&& (atype == RING_PROTECTION_FROM_COLD || atype == RING_FIRE
|| atype == RING_ICE))
+ {
break; // already does this or something
+ }
if (aclass == OBJ_ARMOUR
&& (atype == ARM_DRAGON_ARMOUR || atype == ARM_ICE_DRAGON_ARMOUR
|| atype == ARM_GOLD_DRAGON_ARMOUR))
+ {
break;
+ }
proprt[RAP_COLD] = -1;
break;
case 7: // speed metabolism