summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mapdef.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/mapdef.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/mapdef.cc')
-rw-r--r--crawl-ref/source/mapdef.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc
index 1149313c68..ae428099e8 100644
--- a/crawl-ref/source/mapdef.cc
+++ b/crawl-ref/source/mapdef.cc
@@ -16,6 +16,7 @@ REVISION("$Rev$");
#include <cstdlib>
#include <algorithm>
+#include "artefact.h"
#include "branch.h"
#include "describe.h"
#include "directn.h"
@@ -33,7 +34,6 @@ REVISION("$Rev$");
#include "monplace.h"
#include "mon-util.h"
#include "place.h"
-#include "randart.h"
#include "stuff.h"
#include "tags.h"
@@ -2843,7 +2843,7 @@ item_spec item_list::parse_single_spec(std::string s)
return (result);
}
- std::string fixed_str = strip_tag_prefix(s, "fixed:");
+ std::string unrand_str = strip_tag_prefix(s, "unrand:");
if (strip_tag(s, "good_item"))
result.level = MAKE_GOOD_ITEM;
@@ -2949,14 +2949,15 @@ item_spec item_list::parse_single_spec(std::string s)
if (!error.empty())
return (result);
- if (!fixed_str.empty())
+ if (!unrand_str.empty())
{
- result.ego = get_fixedart_num(fixed_str.c_str());
+ result.ego = get_unrandart_num(unrand_str.c_str());
if (result.ego == SPWPN_NORMAL)
{
- error = make_stringf("Unknown fixed art: %s", fixed_str.c_str());
+ error = make_stringf("Unknown unrand art: %s", unrand_str.c_str());
return result;
}
+ result.ego = -result.ego;
return result;
}