#ifndef ITEMPROP_H
#define ITEMPROP_H
#include "externs.h"
struct bolt;
enum armour_type
{
ARM_ROBE, ARM_LEATHER_ARMOUR,
ARM_RING_MAIL,
ARM_SCALE_MAIL,
ARM_CHAIN_MAIL,
ARM_SPLINT_MAIL, ARM_BANDED_MAIL,
ARM_PLATE_MAIL,
ARM_CLOAK,
ARM_CAP,
ARM_WIZARD_HAT, ARM_HELMET,
ARM_GLOVES,
ARM_BOOTS,
ARM_BUCKLER,
ARM_SHIELD, ARM_LARGE_SHIELD,
ARM_MAX_RACIAL = ARM_LARGE_SHIELD,
ARM_CRYSTAL_PLATE_MAIL,
ARM_ANIMAL_SKIN,
ARM_TROLL_HIDE,
ARM_TROLL_LEATHER_ARMOUR,
ARM_DRAGON_HIDE,
ARM_DRAGON_ARMOUR,
ARM_ICE_DRAGON_HIDE,
ARM_ICE_DRAGON_ARMOUR,
ARM_STEAM_DRAGON_HIDE, ARM_STEAM_DRAGON_ARMOUR,
ARM_MOTTLED_DRAGON_HIDE,
ARM_MOTTLED_DRAGON_ARMOUR,
ARM_STORM_DRAGON_HIDE,
ARM_STORM_DRAGON_ARMOUR, ARM_GOLD_DRAGON_HIDE,
ARM_GOLD_DRAGON_ARMOUR,
ARM_SWAMP_DRAGON_HIDE,
ARM_SWAMP_DRAGON_ARMOUR,
ARM_CENTAUR_BARDING, ARM_NAGA_BARDING,
NUM_ARMOURS };
enum armour_property_type
{
PARM_AC, PARM_EVASION
};
enum boot_type {
TBOOT_BOOTS = 0,
TBOOT_NAGA_BARDING,
TBOOT_CENTAUR_BARDING,
NUM_BOOT_TYPES
};
const int SP_FORBID_EGO = -1;
const int SP_FORBID_BRAND = -1;
enum brand_type {
SPWPN_FORBID_BRAND = -1, SPWPN_NORMAL, SPWPN_FLAMING,
SPWPN_FREEZING,
SPWPN_HOLY_WRATH,
SPWPN_ELECTROCUTION,
SPWPN_ORC_SLAYING, SPWPN_DRAGON_SLAYING,
SPWPN_VENOM,
SPWPN_PROTECTION,
SPWPN_DRAINING,
SPWPN_SPEED, SPWPN_VORPAL,
SPWPN_FLAME, SPWPN_FROST, SPWPN_VAMPIRICISM,
SPWPN_PAIN, SPWPN_DISTORTION,
SPWPN_REACHING,
SPWPN_RETURNING, SPWPN_CHAOS,
MAX_PAN_LORD_BRANDS = SPWPN_CHAOS,
SPWPN_CONFUSE, SPWPN_PENETRATION,
SPWPN_REAPING,
SPWPN_DEBUG_RANDART = 25, NUM_SPECIAL_WEAPONS,
SPWPN_DUMMY_CRUSHING };
enum corpse_type
{
CORPSE_BODY, CORPSE_SKELETON
};
enum hands_reqd_type
{
HANDS_ONE,
HANDS_HALF,
HANDS_TWO,
HANDS_DOUBLE };
enum helmet_desc_type
{
THELM_DESC_PLAIN = 0,
THELM_DESC_WINGED,
THELM_DESC_HORNED,
THELM_DESC_CRESTED,
THELM_DESC_PLUMED,
THELM_DESC_MAX_SOFT = THELM_DESC_PLUMED,
THELM_DESC_SPIKED,
THELM_DESC_VISORED,
THELM_DESC_GOLDEN,
THELM_NUM_DESCS
};
enum jewellery_type
{
RING_FIRST_RING = 0,
RING_REGENERATION = RING_FIRST_RING, RING_PROTECTION,
RING_PROTECTION_FROM_FIRE,
RING_POISON_RESISTANCE,
RING_PROTECTION_FROM_COLD,
RING_STRENGTH, RING_SLAYING,
RING_SEE_INVISIBLE,
RING_INVISIBILITY,
RING_HUNGER,
RING_TELEPORTATION, RING_EVASION,
RING_SUSTAIN_ABILITIES,
RING_SUSTENANCE,
RING_DEXTERITY,
RING_INTELLIGENCE, RING_WIZARDRY,
RING_MAGICAL_POWER,
RING_LEVITATION,
RING_LIFE_PROTECTION,
RING_PROTECTION_FROM_MAGIC, RING_FIRE,
RING_ICE,
RING_TELEPORT_CONTROL,
NUM_RINGS,
AMU_FIRST_AMULET = 35,
AMU_RAGE = AMU_FIRST_AMULET, AMU_RESIST_SLOW,
AMU_CLARITY,
AMU_WARDING,
AMU_RESIST_CORROSION,
AMU_THE_GOURMAND, AMU_CONSERVATION,
AMU_CONTROLLED_FLIGHT,
AMU_INACCURACY,
AMU_RESIST_MUTATION,
AMU_GUARDIAN_SPIRIT,
NUM_JEWELLERY
};
enum launch_retval
{
LRET_FUMBLED = 0, LRET_LAUNCHED,
LRET_THROWN
};
enum misc_item_type
{
MISC_BOTTLED_EFREET, MISC_CRYSTAL_BALL_OF_SEEING,
MISC_AIR_ELEMENTAL_FAN,
MISC_LAMP_OF_FIRE,
MISC_STONE_OF_EARTH_ELEMENTALS,
MISC_LANTERN_OF_SHADOWS,
MISC_HORN_OF_GERYON,
MISC_BOX_OF_BEASTS,
MISC_CRYSTAL_BALL_OF_ENERGY,
MISC_EMPTY_EBONY_CASKET,
MISC_CRYSTAL_BALL_OF_FIXATION,
MISC_DISC_OF_STORMS,
MISC_DECK_OF_ESCAPE,
MISC_DECK_OF_DESTRUCTION,
MISC_DECK_OF_DUNGEONS,
MISC_DECK_OF_SUMMONING,
MISC_DECK_OF_WONDERS,
MISC_DECK_OF_PUNISHMENT,
MISC_DECK_OF_WAR,
MISC_DECK_OF_CHANGES,
MISC_DECK_OF_DEFENCE,
MISC_RUNE_OF_ZOT,
NUM_MISCELLANY };
enum missile_type
{
MI_DART, MI_NEEDLE,
MI_ARROW,
MI_BOLT,
MI_JAVELIN,
MI_MAX_RACIAL = MI_JAVELIN,
MI_STONE, MI_LARGE_ROCK,
MI_SLING_BULLET,
MI_THROWING_NET,
NUM_MISSILES, MI_NONE };
enum rune_type
{
RUNE_DIS = BRANCH_DIS,
RUNE_GEHENNA = BRANCH_GEHENNA,
RUNE_COCYTUS = BRANCH_COCYTUS,
RUNE_TARTARUS = BRANCH_TARTARUS,
RUNE_SLIME_PITS = BRANCH_SLIME_PITS,
RUNE_VAULTS = BRANCH_VAULTS,
RUNE_SNAKE_PIT = BRANCH_SNAKE_PIT,
RUNE_ELVEN_HALLS = BRANCH_ELVEN_HALLS, RUNE_TOMB = BRANCH_TOMB,
RUNE_SWAMP = BRANCH_SWAMP,
RUNE_SHOALS = BRANCH_SHOALS,
RUNE_DEMONIC = 50,
RUNE_ABYSSAL,
RUNE_MNOLEG = 60,
RUNE_LOM_LOBON,
RUNE_CEREBOV,
RUNE_GLOORX_VLOQ,
NUM_RUNE_TYPES, RUNE_NONE
};
enum scroll_type
{
SCR_IDENTIFY, SCR_TELEPORTATION,
SCR_FEAR,
SCR_NOISE,
SCR_REMOVE_CURSE,
SCR_DETECT_CURSE, SCR_SUMMONING,
SCR_ENCHANT_WEAPON_I,
SCR_ENCHANT_ARMOUR,
SCR_TORMENT,
SCR_RANDOM_USELESSNESS, SCR_CURSE_WEAPON,
SCR_CURSE_ARMOUR,
SCR_IMMOLATION,
SCR_BLINKING,
SCR_PAPER, SCR_MAGIC_MAPPING,
SCR_FOG,
SCR_ACQUIREMENT,
SCR_ENCHANT_WEAPON_II,
SCR_VORPALISE_WEAPON, SCR_RECHARGING,
SCR_ENCHANT_WEAPON_III,
SCR_HOLY_WORD,
SCR_VULNERABILITY,
SCR_SILENCE, NUM_SCROLLS
};
enum special_armour_type
{
SPARM_FORBID_EGO = -1, SPARM_NORMAL, SPARM_RUNNING,
SPARM_FIRE_RESISTANCE,
SPARM_COLD_RESISTANCE,
SPARM_POISON_RESISTANCE,
SPARM_SEE_INVISIBLE, SPARM_DARKNESS,
SPARM_STRENGTH,
SPARM_DEXTERITY,
SPARM_INTELLIGENCE,
SPARM_PONDEROUSNESS, SPARM_LEVITATION,
SPARM_MAGIC_RESISTANCE,
SPARM_PROTECTION,
SPARM_STEALTH,
SPARM_RESISTANCE, SPARM_POSITIVE_ENERGY,
SPARM_ARCHMAGI,
SPARM_PRESERVATION,
SPARM_REFLECTION,
SPARM_SPIRIT_SHIELD, NUM_SPECIAL_ARMOURS };
enum special_missile_type {
SPMSL_FORBID_BRAND = -1, SPMSL_NORMAL, SPMSL_FLAME,
SPMSL_FROST,
SPMSL_POISONED,
SPMSL_CURARE,
SPMSL_RETURNING, SPMSL_CHAOS,
SPMSL_PENETRATION,
SPMSL_REAPING,
SPMSL_DISPERSAL,
SPMSL_EXPLODING, SPMSL_STEEL,
SPMSL_SILVER,
NUM_SPECIAL_MISSILES };
enum special_ring_type {
SPRING_RANDART = 200,
SPRING_UNRANDART = 201
};
enum stave_type
{
STAFF_WIZARDRY = 0,
STAFF_POWER,
STAFF_FIRE,
STAFF_COLD,
STAFF_POISON,
STAFF_ENERGY,
STAFF_DEATH,
STAFF_CONJURATION,
STAFF_ENCHANTMENT,
STAFF_SUMMONING,
STAFF_AIR,
STAFF_EARTH,
STAFF_CHANNELING, STAFF_FIRST_ROD,
STAFF_SMITING = STAFF_FIRST_ROD,
STAFF_SPELL_SUMMONING,
STAFF_DESTRUCTION_I,
STAFF_DESTRUCTION_II,
STAFF_DESTRUCTION_III,
STAFF_DESTRUCTION_IV,
STAFF_WARDING,
STAFF_DISCOVERY,
STAFF_DEMONOLOGY,
STAFF_STRIKING,
STAFF_VENOM, NUM_STAVES };
enum weapon_type
{
WPN_CLUB, WPN_WHIP,
WPN_HAMMER,
WPN_MACE,
WPN_FLAIL,
WPN_MORNINGSTAR, WPN_SPIKED_FLAIL,
WPN_DIRE_FLAIL,
WPN_EVENINGSTAR,
WPN_GREAT_MACE,
WPN_DAGGER, WPN_QUICK_BLADE,
WPN_SHORT_SWORD,
WPN_SABRE,
WPN_FALCHION,
WPN_LONG_SWORD, WPN_SCIMITAR,
WPN_GREAT_SWORD,
WPN_HAND_AXE,
WPN_WAR_AXE,
WPN_BROAD_AXE, WPN_BATTLEAXE,
WPN_EXECUTIONERS_AXE,
WPN_SPEAR,
WPN_TRIDENT,
WPN_HALBERD, WPN_GLAIVE,
WPN_BARDICHE,
WPN_BLOWGUN,
WPN_HAND_CROSSBOW,
WPN_CROSSBOW, WPN_BOW,
WPN_LONGBOW,
WPN_MAX_RACIAL = WPN_LONGBOW,
WPN_ANKUS,
WPN_DEMON_WHIP,
WPN_GIANT_CLUB, WPN_GIANT_SPIKED_CLUB,
WPN_KNIFE,
WPN_KATANA,
WPN_DEMON_BLADE,
WPN_DOUBLE_SWORD, WPN_TRIPLE_SWORD,
WPN_DEMON_TRIDENT,
WPN_SCYTHE,
WPN_QUARTERSTAFF,
WPN_LAJATANG,
WPN_SLING,
WPN_MAX_NONBLESSED = WPN_SLING,
WPN_BLESSED_FALCHION,
WPN_BLESSED_LONG_SWORD,
WPN_BLESSED_SCIMITAR,
WPN_BLESSED_GREAT_SWORD,
WPN_BLESSED_KATANA,
WPN_BLESSED_EUDEMON_BLADE,
WPN_BLESSED_DOUBLE_SWORD,
WPN_BLESSED_TRIPLE_SWORD,
NUM_WEAPONS,
WPN_UNARMED = 500, WPN_UNKNOWN = 1000, WPN_RANDOM
};
enum weapon_description_type
{
DWPN_PLAIN = 0, DWPN_RUNED = 1, DWPN_GLOWING,
DWPN_ORCISH,
DWPN_ELVEN,
DWPN_DWARVEN };
enum weapon_property_type
{
PWPN_DAMAGE, PWPN_HIT,
PWPN_SPEED,
PWPN_ACQ_WEIGHT
};
enum vorpal_damage_type
{
DAM_BASH = 0x0000, DAM_BLUDGEON = 0x0001, DAM_SLICE = 0x0002, DAM_PIERCE = 0x0004, DAM_WHIP = 0x0008, DAM_MAX_TYPE = DAM_WHIP,
DVORP_NONE = 0x0000, DVORP_CRUSHING = 0x1000,
DVORP_SLICING = 0x2000,
DVORP_PIERCING = 0x3000,
DVORP_CHOPPING = 0x4000, DVORP_SLASHING = 0x5000, DVORP_STABBING = 0x6000,
DVORP_CLAWING = 0x7000, DVORP_TENTACLE = 0x8000,
DAMV_NON_MELEE = DVORP_NONE | DAM_BASH, DAMV_CRUSHING = DVORP_CRUSHING | DAM_BLUDGEON,
DAMV_SLICING = DVORP_SLICING | DAM_SLICE,
DAMV_PIERCING = DVORP_PIERCING | DAM_PIERCE,
DAMV_CHOPPING = DVORP_CHOPPING | DAM_SLICE,
DAMV_SLASHING = DVORP_SLASHING | DAM_WHIP,
DAMV_STABBING = DVORP_STABBING | DAM_PIERCE,
DAM_MASK = 0x0fff, DAMV_MASK = 0xf000 };
enum wand_type
{
WAND_FLAME,
WAND_FROST,
WAND_SLOWING,
WAND_HASTING,
WAND_MAGIC_DARTS,
WAND_HEALING,
WAND_PARALYSIS,
WAND_FIRE,
WAND_COLD,
WAND_CONFUSION,
WAND_INVISIBILITY,
WAND_DIGGING,
WAND_FIREBALL,
WAND_TELEPORTATION,
WAND_LIGHTNING,
WAND_POLYMORPH_OTHER,
WAND_ENSLAVEMENT,
WAND_DRAINING,
WAND_RANDOM_EFFECTS,
WAND_DISINTEGRATION,
NUM_WANDS
};
enum zap_count_type
{
ZAPCOUNT_EMPTY = -1,
ZAPCOUNT_UNKNOWN = -2,
ZAPCOUNT_RECHARGED = -3,
ZAPCOUNT_MAX_CHARGED = -4
};
void init_properties(void);
bool item_is_critical(const item_def &item);
bool item_is_mundane(const item_def &item);
bool item_cursed( const item_def &item );
bool item_known_cursed( const item_def &item );
bool item_known_uncursed( const item_def &item );
void do_curse_item( item_def &item, bool quiet = true );
void do_uncurse_item( item_def &item );
void set_item_stationary( item_def &item );
void remove_item_stationary( item_def &item );
bool item_is_stationary( const item_def &item );
bool item_ident( const item_def &item, unsigned long flags );
void set_ident_flags( item_def &item, unsigned long flags );
void unset_ident_flags( item_def &item, unsigned long flags );
bool fully_identified( const item_def &item );
unsigned long full_ident_mask( const item_def& item );
void set_equip_race( item_def &item, unsigned long flags );
void set_equip_desc( item_def &item, unsigned long flags );
unsigned long get_equip_race( const item_def &item );
unsigned long get_equip_desc( const item_def &item );
void set_helmet_desc( item_def &item, short flags );
void set_helmet_random_desc( item_def &item );
short get_helmet_desc( const item_def &item );
bool is_helmet( const item_def& item );
bool is_hard_helmet( const item_def& item );
bool set_item_ego_type( item_def &item, int item_type, int ego_type );
int get_weapon_brand( const item_def &item );
special_armour_type get_armour_ego_type( const item_def &item );
int get_ammo_brand( const item_def &item );
int armour_max_enchant( const item_def &item );
bool armour_is_hide( const item_def &item, bool inc_made = false );
bool armour_not_shiny( const item_def &item );
int armour_str_required( const item_def &arm );
equipment_type get_armour_slot( const item_def &item );
equipment_type get_armour_slot( armour_type arm );
bool jewellery_is_amulet( const item_def &item );
bool jewellery_is_amulet( int sub_type );
bool check_jewellery_size( const item_def &item, size_type size );
bool hide2armour( item_def &item );
bool base_armour_is_light( const item_def &item );
int fit_armour_size( const item_def &item, size_type size );
bool check_armour_size( const item_def &item, size_type size );
bool check_armour_shape( const item_def &item, bool quiet );
bool item_is_rechargeable(const item_def &it, bool hide_charged = false,
bool weapons = false);
int wand_charge_value(int type);
bool is_enchantable_weapon(const item_def &wpn, bool uncurse,
bool first = true);
bool is_enchantable_armour(const item_def &arm, bool uncurse,
bool unknown = false);
bool is_shield(const item_def &item);
bool is_shield_incompatible(const item_def &weapon,
const item_def *shield = NULL);
bool shield_reflects(const item_def &shield);
int weapon_rarity( int w_type );
int cmp_weapon_size( const item_def &item, size_type size );
bool check_weapon_tool_size( const item_def &item, size_type size );
int fit_weapon_wieldable_size( const item_def &item, size_type size );
bool check_weapon_wieldable_size( const item_def &item, size_type size );
int fit_item_throwable_size( const item_def &item, size_type size );
bool check_weapon_shape( const item_def &item, bool quiet, bool check_id = false );
int weapon_ev_bonus( const item_def &wpn, int skill, size_type body, int dex,
bool hide_hidden = false );
int get_inv_wielded( void );
int get_inv_hand_tool( void );
int get_inv_in_hand( void );
hands_reqd_type hands_reqd( const item_def &item, size_type size );
hands_reqd_type hands_reqd(object_class_type base_type, int sub_type,
size_type size);
bool is_double_ended( const item_def &item );
int double_wpn_awkward_speed( const item_def &item );
bool is_demonic(const item_def &item);
bool is_blessed_blade(const item_def &item);
bool is_blessed_blade_convertible(const item_def &item);
bool convert2good(item_def &item, bool allow_blessed = true);
bool convert2bad(item_def &item);
int get_vorpal_type(const item_def &item);
int get_damage_type(const item_def &item);
bool does_damage_type(const item_def &item, int dam_type);
int single_damage_type(const item_def &item);
int weapon_str_weight( const item_def &wpn );
int weapon_dex_weight( const item_def &wpn );
int weapon_impact_mass( const item_def &wpn );
int weapon_str_required( const item_def &wpn, bool half );
skill_type weapon_skill( const item_def &item );
skill_type weapon_skill( object_class_type wclass, int wtype );
skill_type range_skill( const item_def &item );
skill_type range_skill( object_class_type wclass, int wtype );
bool is_range_weapon(const item_def &item);
bool is_range_weapon_type(weapon_type wtype);
missile_type fires_ammo_type(const item_def &item);
missile_type fires_ammo_type(weapon_type wtype);
const char *ammo_name(missile_type ammo);
const char *ammo_name(const item_def &bow);
bool has_launcher(const item_def &ammo);
bool is_throwable(const actor *actor, const item_def &wpn, bool force = false);
launch_retval is_launched(const actor *actor, const item_def *launcher,
const item_def &missile);
bool item_is_rod( const item_def &item );
bool item_is_staff( const item_def &item );
int ring_has_pluses( const item_def &item );
bool ring_has_stackable_effect( const item_def &item );
bool food_is_meat(const item_def &item);
bool food_is_veg(const item_def &item);
bool is_blood_potion(const item_def &item);
int food_value(const item_def &item);
int food_turns(const item_def &item);
bool can_cut_meat(const item_def &item);
bool food_is_rotten(const item_def &item);
int corpse_freshness(const item_def &item);
bool is_fruit(const item_def & item);
bool is_tool(const item_def &item);
int property(const item_def &item, int prop_type);
bool gives_ability(const item_def &item);
bool gives_resistance(const item_def &item);
int item_mass(const item_def &item);
size_type item_size(const item_def &item);
equipment_type get_item_slot(object_class_type type, int sub_type);
equipment_type get_item_slot(const item_def& item);
bool is_colourful_item(const item_def &item);
std::string item_base_name(const item_def &item);
const char* weapon_base_name(unsigned char subtype);
#endif