diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-27 09:58:49 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-27 09:58:49 +0000 |
commit | 7aa3305f41d2f073710d9a732bd29572b704bc49 (patch) | |
tree | 374aa17118ecb68bc4c237176506dbaf9aafb0b7 /crawl-ref/source/artefact.h | |
parent | 3cc681e30ac236f7b88adece29f194cb30138ec8 (diff) | |
download | crawl-ref-7aa3305f41d2f073710d9a732bd29572b704bc49.tar.gz crawl-ref-7aa3305f41d2f073710d9a732bd29572b704bc49.zip |
* Moved most hard-coded non-standard unrandart behaviour to art-func.h,
specifically code for equipping, unequpping, an equipped unrandart doing
something every time world_reacts() is called (special wield effects),
melee hit effects, and evoking. Left hardcoded outside of art-func.h:
* Sword of Cerebov temproarily downgrading the defender's fire
resistance.
* Staff of Olgreb boosting poison spells, as if it were a staff
of poison.
* Vampire's Tooth always getting maximal vampiric drain.
* Mace of Variablity's initial pluses being chosen at creation time.
* Since what used to be special wield effects is now handled very
differently, noisy weapons and the lantern of shadows effects
are handled with player attributes rather than SPWLD_NOISES and
SPWLD_SHADOW.
* Unrandarts can now have an elemental colour for their colour
(currently only used for the Mace of Variability).
* Unrandarts' value modification, being special, and being
evil are now handled in art-data.txt rather than being hardcoded.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10055 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/artefact.h')
-rw-r--r-- | crawl-ref/source/artefact.h | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/crawl-ref/source/artefact.h b/crawl-ref/source/artefact.h index 38ee3344d4..0844c2fc4c 100644 --- a/crawl-ref/source/artefact.h +++ b/crawl-ref/source/artefact.h @@ -12,6 +12,10 @@ #include "externs.h" +// Artefacts which make noise can use this key to use a different +// speech database key than the default. +#define ART_NOISE_KEY "art_noise_key" + // NOTE: NO_UNRANDARTS is automatically set by util/art-data.pl #define NO_UNRANDARTS 76 @@ -111,6 +115,15 @@ enum unrand_type UNRAND_LAST = UNRAND_DUMMY2 }; +enum unrand_flag_type +{ + UNRAND_FLAG_NONE = 0x00, + UNRAND_FLAG_SPECIAL = 0x01, + UNRAND_FLAG_HOLY = 0x02, + UNRAND_FLAG_EVIL = 0x04, + UNRAND_FLAG_CHAOTIC = 0x08 +}; + // The following unrandart bits were taken from $pellbinder's mon-util // code (see mon-util.h & mon-util.cc) and modified (LRH). struct unrandart_entry @@ -118,11 +131,15 @@ struct unrandart_entry const char *name; // true name of unrandart (max 31 chars) const char *unid_name; // un-id'd name of unrandart (max 31 chars) - object_class_type base_type; // class of ura - int sub_type; // type of ura - int plus; // plus of ura - int plus2; // plus2 of ura - int colour; // colour of ura + object_class_type base_type; + unsigned char sub_type; + short plus; + short plus2; + unsigned char colour; // colour of ura + + short value; + unsigned char flags; + short prpty[ART_PROPERTIES]; // special description added to 'v' command output (max 31 chars) @@ -131,6 +148,14 @@ struct unrandart_entry const char *desc_id; // special description added to 'v' command output (max 31 chars) const char *desc_end; + + void (*equip_func)(item_def* item, bool* show_msgs, bool unmeld); + void (*unequip_func)(const item_def* item, bool* show_msgs); + void (*world_reacts_func)(item_def* item); + void (*melee_effects_func)(item_def* item, actor* attacker, + actor* defender, bool mondied); + bool (*evoke_func)(item_def *item, int* pract, bool* did_work, + bool* unevokable); }; bool is_known_artefact( const item_def &item ); |