summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.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/effects.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/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc37
1 files changed, 12 insertions, 25 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index fa5515efa4..dc0e4f3f20 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -18,6 +18,7 @@ REVISION("$Rev$");
#include "externs.h"
+#include "artefact.h"
#include "beam.h"
#include "cloud.h"
#include "decks.h"
@@ -44,7 +45,6 @@ REVISION("$Rev$");
#include "notes.h"
#include "ouch.h"
#include "player.h"
-#include "randart.h"
#include "religion.h"
#include "skills.h"
#include "skills2.h"
@@ -1646,7 +1646,7 @@ bool acquirement(object_class_type class_wanted, int agent,
{
int brand = get_weapon_brand(doodad);
if (brand == SPWPN_PAIN
- || is_fixed_artefact(doodad)
+ || is_unrandom_artefact(doodad)
&& (doodad.special == SPWPN_WRATH_OF_TROG
|| doodad.special == SPWPN_STAFF_OF_WUCAD_MU))
{
@@ -1659,7 +1659,7 @@ bool acquirement(object_class_type class_wanted, int agent,
// MT - Check: god-gifted weapons and armour shouldn't kill you.
// Except Xom.
if ((agent == GOD_TROG || agent == GOD_OKAWARU)
- && is_random_artefact(doodad))
+ && is_artefact(doodad))
{
artefact_properties_t proprt;
artefact_wpn_properties( doodad, proprt );
@@ -1758,7 +1758,6 @@ bool acquirement(object_class_type class_wanted, int agent,
}
}
else if (thing.base_type == OBJ_WEAPONS
- && !is_fixed_artefact(thing)
&& !is_unrandom_artefact(thing))
{
// HACK: Make unwieldable weapons wieldable.
@@ -1773,11 +1772,7 @@ bool acquirement(object_class_type class_wanted, int agent,
int brand = get_weapon_brand(thing);
if (brand == SPWPN_HOLY_WRATH)
{
- if (!is_random_artefact(thing))
- {
- set_item_ego_type(thing, OBJ_WEAPONS, SPWPN_VORPAL);
- }
- else
+ if (is_random_artefact(thing))
{
// Keep resetting seed until it's good.
for (; brand == SPWPN_HOLY_WRATH;
@@ -1786,6 +1781,10 @@ bool acquirement(object_class_type class_wanted, int agent,
make_item_randart(thing);
}
}
+ else
+ {
+ set_item_ego_type(thing, OBJ_WEAPONS, SPWPN_VORPAL);
+ }
}
}
break;
@@ -1833,7 +1832,7 @@ bool acquirement(object_class_type class_wanted, int agent,
// More damage, less accuracy.
thing.plus -= plusmod;
thing.plus2 += plusmod;
- if (!is_random_artefact(thing))
+ if (!is_artefact(thing))
thing.plus = std::max(static_cast<int>(thing.plus), 0);
}
else if (agent == GOD_OKAWARU)
@@ -1841,26 +1840,14 @@ bool acquirement(object_class_type class_wanted, int agent,
// More accuracy, less damage.
thing.plus += plusmod;
thing.plus2 -= plusmod;
- if (!is_random_artefact(thing))
+ if (!is_artefact(thing))
thing.plus2 = std::max(static_cast<int>(thing.plus2), 0);
}
}
if (agent > GOD_NO_GOD && agent < NUM_GODS && agent == you.religion)
- {
thing.inscription = "god gift";
- if (is_random_artefact(thing))
- {
- if (!is_unrandom_artefact(thing)
- && thing.base_type != OBJ_BOOKS)
- {
- // Give another name that takes god gift into account;
- // artefact books already do that.
- thing.props["artefact_name"].get_string() =
- artefact_name(thing, false);
- }
- }
- }
+
move_item_to_grid( &thing_created, you.pos() );
// This should never actually be NON_ITEM because of the way
@@ -3437,7 +3424,7 @@ void handle_time(long time_delta)
// Exercise stealth skill:
else if (you.burden_state == BS_UNENCUMBERED
&& !you.duration[DUR_BERSERKER]
- && you.special_wield != SPWLD_SHADOW)
+ && you.unrand_reacts != SPWLD_SHADOW)
{
// Diminishing returns for stealth training by waiting.
if ((you.equip[EQ_BODY_ARMOUR] == -1