#ifndef RANDART_H
#define RANDART_H
#include "externs.h"
class bolt;
#define NO_UNRANDARTS 77
#define ART_PROPERTIES ARTP_NUM_PROPERTIES
#define RANDART_SEED_MASK 0x00ffffff
#define KNOWN_PROPS_KEY "artefact_known_props"
#define ARTEFACT_PROPS_KEY "artefact_props"
#define ARTEFACT_NAME_KEY "artefact_name"
#define ARTEFACT_APPEAR_KEY "artefact_appearance"
enum unrand_special_type
{
UNRANDSPEC_EITHER,
UNRANDSPEC_NORMAL,
UNRANDSPEC_SPECIAL
};
enum unrand_type
{
UNRAND_START = 180,
UNRAND_DUMMY1 = UNRAND_START,
UNRAND_SINGING_SWORD, UNRAND_TROG, UNRAND_VARIABILITY, UNRAND_PRUNE, UNRAND_POWER, UNRAND_OLGREB, UNRAND_WUCAD_MU, UNRAND_VAMPIRES_TOOTH, UNRAND_CURSES, UNRAND_TORMENT, UNRAND_ZONGULDROK, UNRAND_CEREBOV, UNRAND_DISPATER, UNRAND_ASMODEUS, UNRAND_BLOODBANE, UNRAND_FLAMING_DEATH, UNRAND_BRILLIANCE, UNRAND_LEECH, UNRAND_CHILLY_DEATH, UNRAND_MORG, UNRAND_FINISHER, UNRAND_PUNK, UNRAND_KRISHNA, UNRAND_SKULLCRUSHER, UNRAND_GUARD, UNRAND_JIHAD, UNRAND_HELLFIRE, UNRAND_DOOM_KNIGHT, UNRAND_EOS, UNRAND_BOTONO, UNRAND_OCTOPUS_KING, UNRAND_ARGA, UNRAND_ELEMENTAL_STAFF, UNRAND_SNIPER, UNRAND_PIERCER, UNRAND_BLOWGUN_ASSASSIN, UNRAND_WYRMBANE, UNRAND_SPRIGGANS_KNIFE, UNRAND_PLUTONIUM_SWORD, UNRAND_UNDEADHUNTER, UNRAND_SERPENT_SCOURGE, UNRAND_ACCURACY, UNRAND_CRYSTAL_SPEAR, UNRAND_IGNORANCE, UNRAND_AUGMENTATION, UNRAND_THIEF, UNRAND_BULLSEYE, UNRAND_DYROVEPREVA, UNRAND_BEAR_SPIRIT, UNRAND_MISFORTUNE, UNRAND_FLASH, UNRAND_BOOTS_ASSASSIN, UNRAND_LEAR, UNRAND_ZHOR, UNRAND_SALAMANDER, UNRAND_WAR, UNRAND_RESISTANCE, UNRAND_FOLLY, UNRAND_MAXWELL, UNRAND_DRAGONMASK, UNRAND_NIGHT, UNRAND_DRAGON_KING, UNRAND_ALCHEMIST, UNRAND_FENCERS_GLOVES, UNRAND_STARLIGHT, UNRAND_RATSKIN_CLOAK, UNRAND_AIR, UNRAND_SHADOWS, UNRAND_CEKUGOB, UNRAND_FOUR_WINDS, UNRAND_BLOODLUST, UNRAND_SHAOLIN, UNRAND_ROBUSTNESS, UNRAND_MAGE, UNRAND_SHIELDING, UNRAND_DUMMY2, 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
};
enum setup_missile_type
{
SM_CONTINUE,
SM_FINISHED,
SM_CANCEL
};
struct unrandart_entry
{
const char *name; const char *unid_name;
object_class_type base_type;
unsigned char sub_type;
short plus;
short plus2;
unsigned char colour;
short value;
unsigned char flags;
short prpty[ART_PROPERTIES];
const char *desc;
const char *desc_id;
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);
union
{
void (*melee_effects)(item_def* item, actor* attacker,
actor* defender, bool mondied);
setup_missile_type (*launch)(item_def* item, bolt* beam,
std::string* ammo_name, bool* returning);
} fight_func;
bool (*evoke_func)(item_def *item, int* pract, bool* did_work,
bool* unevokable);
};
bool is_known_artefact( const item_def &item );
bool is_artefact( const item_def &item );
bool is_random_artefact( const item_def &item );
bool is_unrandom_artefact( const item_def &item );
bool is_special_unrandom_artefact( const item_def &item );
unique_item_status_type get_unique_item_status(const item_def& item);
unique_item_status_type get_unique_item_status(int unrand_index);
void set_unique_item_status(const item_def& item,
unique_item_status_type status );
void set_unique_item_status(int unrand_index,
unique_item_status_type status );
std::string get_artefact_name( const item_def &item );
void set_artefact_name( item_def &item, const std::string &name );
void set_artefact_appearance( item_def &item, const std::string &appear );
std::string artefact_name( const item_def &item, bool appearance = false );
const char *unrandart_descrip( int which_descrip, const item_def &item );
int find_okay_unrandart(unsigned char aclass, unsigned char atype = OBJ_RANDOM,
unrand_special_type specialness = UNRANDSPEC_EITHER,
bool in_abyss = false);
typedef FixedVector< int, ART_PROPERTIES > artefact_properties_t;
typedef FixedVector< bool, ART_PROPERTIES > artefact_known_props_t;
void artefact_desc_properties( const item_def &item,
artefact_properties_t &proprt,
artefact_known_props_t &known,
bool force_fake_props = false);
void artefact_wpn_properties( const item_def &item,
artefact_properties_t &proprt,
artefact_known_props_t &known );
void artefact_wpn_properties( const item_def &item,
artefact_properties_t &proprt );
int artefact_wpn_property( const item_def &item, artefact_prop_type prop,
bool &known );
int artefact_wpn_property( const item_def &item, artefact_prop_type prop );
int artefact_known_wpn_property( const item_def &item,
artefact_prop_type prop );
void artefact_wpn_learn_prop( item_def &item, artefact_prop_type prop );
bool artefact_wpn_known_prop( const item_def &item, artefact_prop_type prop );
bool make_item_randart( item_def &item );
bool make_item_unrandart( item_def &item, int unrand_index );
bool randart_is_bad( const item_def &item );
bool randart_is_bad( const item_def &item, artefact_properties_t &proprt );
int find_unrandart_index(const item_def& artefact);
unrandart_entry* get_unrand_entry(int unrand_index);
unrand_special_type get_unrand_specialness(int unrand_index);
unrand_special_type get_unrand_specialness(const item_def &item);
void artefact_set_properties( item_def &item,
artefact_properties_t &proprt );
void artefact_set_property( item_def &item,
artefact_prop_type prop,
int val );
int get_unrandart_num( const char *name );
#endif