summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/shopping.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-25 02:29:14 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-25 02:29:14 +0000
commit2fad05374f70f21d4af3d147325581bf1047b5be (patch)
tree40a46254f044837f658e4dbabb07ce3c52b72804 /crawl-ref/source/shopping.cc
parentab0e3274d569d1cdea4010f4ed1d4b24cd3804e9 (diff)
downloadcrawl-ref-2fad05374f70f21d4af3d147325581bf1047b5be.tar.gz
crawl-ref-2fad05374f70f21d4af3d147325581bf1047b5be.zip
First part of the merger of fixed artefacts into unrandom artefacts
(further changes will be much smaller). Breaks savefile compatibility, and bumps the major savefile version up to 6. Some changes made to some tiles files, but it hasn't been tested with a tiles build. Overview of changes: * Unrand artefacts are now defined in art-data.txt and is turned into C code via util/art-data.pl. This has the dual advantage of being more readable by humans, and that if the unrand data structure changes then you can just change util/art-data.pl and regenerate the C code rather than having to change some 70 different C structs by hand. * util/art-data.pl automatically updates NO_UNRANDARTS, and also automatically generates an enumeration of all the unrands which are equal to their item.special field. * randart.cc and randart.h have been renamed to artefact.cc and artefact.h, since the files covers all types of artefacts, and the differences between randarts, unrandarts and (former) fixed arts have been minimized since the terms were introduced. Also renamed unrand.h to art-data.h * The brands and resistances of former fixed arts are now handled via artefact properties, but the rest of their special behaviours are still hardcoded. * Unrandarts are now distinguished between normal and "special", with the special ones currently just being identical to the list of the formed fixed arts. Special unrandarts are randomly generated less often than normal unrandarts, can be generated in the Abyss if they've been lost, can't be picked up by monsters, and can't be affected by Tukima's Dance. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10035 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/shopping.cc')
-rw-r--r--crawl-ref/source/shopping.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc
index 09ecd06ad0..2334052f0c 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -22,6 +22,7 @@ REVISION("$Rev$");
#endif
#include "externs.h"
+#include "artefact.h"
#include "cio.h"
#include "describe.h"
#include "food.h"
@@ -35,7 +36,6 @@ REVISION("$Rev$");
#include "notes.h"
#include "overmap.h"
#include "player.h"
-#include "randart.h"
#include "spl-book.h"
#include "stash.h"
#include "stuff.h"
@@ -264,7 +264,7 @@ static bool _in_a_shop( int shopidx )
for (unsigned int i = 0; i < stock.size(); i++)
{
item_def& item = mitm[stock[i]];
- if (Options.autoinscribe_artefacts && is_random_artefact(item))
+ if (Options.autoinscribe_artefacts && is_artefact(item))
item.inscription = artefact_auto_inscription(item);
}
@@ -517,7 +517,7 @@ static bool _purchase( int shop, int item_got, int cost, bool id )
// the price of the artefact. -- bwr
int artefact_value( const item_def &item )
{
- ASSERT( is_random_artefact( item ) );
+ ASSERT( is_artefact( item ) );
int ret = 10;
artefact_properties_t prop;
@@ -621,7 +621,7 @@ unsigned int item_value( item_def item, bool ident )
switch (item.base_type)
{
case OBJ_WEAPONS:
- if (is_fixed_artefact( item ))
+ if (is_unrandom_artefact( item ))
{
if (item_ident( item, ISFLAG_KNOW_PROPERTIES ))
{
@@ -912,7 +912,7 @@ unsigned int item_value( item_def item, bool ident )
}
}
- if (is_random_artefact(item))
+ if (is_artefact(item))
{
if (item_type_known(item))
valued += (7 * artefact_value(item));
@@ -1225,7 +1225,7 @@ unsigned int item_value( item_def item, bool ident )
}
}
- if (is_random_artefact( item ))
+ if (is_artefact( item ))
{
if (item_type_known(item))
valued += (7 * artefact_value( item ));
@@ -1592,7 +1592,7 @@ unsigned int item_value( item_def item, bool ident )
// got to do delusion!
}
- if (is_random_artefact(item))
+ if (is_artefact(item))
{
// in this branch we're guaranteed to know
// the item type!