summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/describe.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-20 12:12:19 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-20 12:12:19 +0000
commit30a70203bafbec37e9720b511d51d5a4144d9fa9 (patch)
tree83e30012568ae6de7f0a6da400bfec6fc35ed4ca /crawl-ref/source/describe.cc
parent1326ea6a6d343513430861c1ef9a04bfd61dd6a4 (diff)
downloadcrawl-ref-30a70203bafbec37e9720b511d51d5a4144d9fa9.tar.gz
crawl-ref-30a70203bafbec37e9720b511d51d5a4144d9fa9.zip
Change recursing to work similarly as was suggested by {bdr} - Brent?
The curses property now may take any range of numbers, rather than plain 0 or 1. If its value is different from 0, the randart is created cursed. For positive values, it may additionally recurse itself with 1/value probability. In this case, add a description line ("It may recurse itself.") and an auto-inscription ("Curse", comes last). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4406 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r--crawl-ref/source/describe.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index caa1e8e3cf..6c48fc1cee 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -238,7 +238,8 @@ static std::vector<std::string> _randart_propnames( const item_def& item )
// Qualitative attributes
{ "MP", RAP_MAGICAL_POWER, 0 },
{ "SInv", RAP_EYESIGHT, 2 },
- { "Stlth", RAP_STEALTH, 2 } // handled specially
+ { "Stlth", RAP_STEALTH, 2 }, // handled specially
+ { "Curse", RAP_CURSED, 2 },
};
// For randart jewellery, note the base jewellery type if it's not
@@ -307,6 +308,9 @@ static std::vector<std::string> _randart_propnames( const item_def& item )
break;
}
case 2: // e.g. rPois or SInv
+ if (propanns[i].prop == RAP_CURSED && val < 1)
+ continue;
+
work << propanns[i].name;
// these need special handling, so we don't give anything away
@@ -398,13 +402,21 @@ static std::string _randart_descrip( const item_def &item )
{ RAP_CAUSE_TELEPORTATION, "It causes teleportation.", false},
{ RAP_PREVENT_TELEPORTATION, "It prevents most forms of teleportation.",
false},
- { RAP_ANGRY, "It makes you angry.", false}
+ { RAP_ANGRY, "It makes you angry.", false},
+ { RAP_CURSED, "It may recurse itself.", false}
};
for ( unsigned i = 0; i < ARRAYSZ(propdescs); ++i )
{
if ( known_proprt(propdescs[i].property))
{
+ // Only randarts with RAP_CURSED > 0 may recurse themselves.
+ if (propdescs[i].property == RAP_CURSED
+ && proprt[propdescs[i].property] < 1)
+ {
+ continue;
+ }
+
std::string sdesc = propdescs[i].desc;
// FIXME Not the nicest hack.