--- deliantra/server/include/define.h 2010/04/04 20:00:05 1.121 +++ deliantra/server/include/define.h 2010/04/11 00:34:05 1.128 @@ -98,7 +98,7 @@ #define CLOCK 9 #define VEIN 10 // deliantra: mineral/ore/whatever vein #define RANGED 11 // deliantra: other range item (skill based) -//12 +#define SKILLSCROLL 12 /* can add a skill to player's inventory -bt. */ #define ARROW 13 #define BOW 14 #define WEAPON 15 @@ -130,10 +130,10 @@ #define TELEPORTER 41 #define CREATOR 42 #define SKILL 43 /* also see SKILL_TOOL (74) below */ -//44 +#define IDENTIFY_ALTAR 44 #define EARTHWALL 45 #define GOLEM 46 -//47 +#define DEEP_SWAMP 47 #define THROWN_OBJ 48 #define BLINDNESS 49 #define GOD 50 @@ -158,7 +158,7 @@ * a monster into a peaceful being incapable of attack. */ #define GEM 60 -//61 +#define MENU 61 /* Mark Wedel (mark@pyramid.com) Shop inventories */ #define FIREWALL 62 #define ANVIL 63 #define CHECK_INV 64 /* by b.t. thomas@nomad.astro.psu.edu */ @@ -177,7 +177,7 @@ #define SHOP_FLOOR 68 #define SHOP_MAT 69 #define RING 70 -#define FLOOR 71 /* this is a floor tile -> native layer 0 */ +//#define FLOOR 71 /* this is a floor tile -> native layer 0 */ // UNUSED??? #define FLESH 72 /* animal 'body parts' -b.t. */ #define INORGANIC 73 /* metals and minerals */ #define SKILL_TOOL 74 /* Allows the use of a skill */ @@ -198,16 +198,17 @@ #define SPELLBOOK 85 //86 #define CLOAK 87 -//88 -//89 +#define MAPSCRIPT 88 /* A perl-scripted connectable */ +#define SAFE_GROUND 89 /* This is a safe ground, means that neither bombs, + potions, alchemy, or magic works here (elmex) */ #define SPINNER 90 #define GATE 91 #define BUTTON 92 #define T_HANDLE 93 #define HOLE 94 #define TRAPDOOR 95 -//96 -//97 +#define RUNE 96 +#define TRAP 97 #define SIGN 98 #define BOOTS 99 #define GLOVES 100 @@ -217,8 +218,8 @@ #define BRACERS 104 #define POISONING 105 #define SAVEBED 106 -//107 -//108 +#define DISEASE 107 +#define SYMPTOM 108 #define WAND 109 #define INSCRIBABLE 110 // inscribable things, st 0 book st 1 spell #define SCROLL 111 @@ -227,61 +228,50 @@ #define FORCE 114 #define POTION_EFFECT 115 /* a force, holding the effect of a potion */ #define EVENT_CONNECTOR 116 /* Lauwenmark: an invisible object holding a plugin event hook */ -//117 -//118 -//119 +#define ITEM_TRANSFORMER 117 /* Transforming one item with another */ +#define POWER_CRYSTAL 118 +#define CORPSE 119 //120 #define CLOSE_CON 121 /* Eneq(@csd.uu.se): Id for close_container archetype. */ #define CONTAINER 122 #define ARMOUR_IMPROVER 123 #define WEAPON_IMPROVER 124 -//125 -//126 -//127 -//128 -//129 -#define SKILLSCROLL 130 /* can add a skill to player's inventory -bt. */ -//131 -//132 -//133 -//134 -//135 -//136 -//137 -#define DEEP_SWAMP 138 -#define IDENTIFY_ALTAR 139 -//140 -//141 -//142 -//143 -//144 -//145 -//146 -//147 -//148 -//149 -#define MENU 150 /* Mark Wedel (mark@pyramid.com) Shop inventories */ -//151 -//152 -//153 -#define RUNE 154 -#define TRAP 155 -#define POWER_CRYSTAL 156 -#define CORPSE 157 -#define DISEASE 158 -#define SYMPTOM 159 -#define BUILDER 160 /* Generic item builder, see subtypes */ -#define MATERIAL 161 /* Material for building */ -//162 -#define ITEM_TRANSFORMER 163 /* Transforming one item with another */ -#define MAPSCRIPT 164 /* A perl-scripted connectable */ -#define SAFE_GROUND 165 /* This is a safe ground, means that neither bombs, - potions, alchemy, or magic works here (elmex) */ +#define BUILDER 125 /* Generic item builder, see subtypes */ +#define MATERIAL 126 /* Material for building */ -#define NUM_TYPES 166 // must be max(type) + 1 +#define NUM_TYPES 127 // must be max(type) + 1 /* END TYPE DEFINE */ +typedef std::bitset typeset; + +/* These are the items that currently can change digestion, regeneration, + * spell point recovery and mana point recovery. Seems sort of an arbitary + * list, but other items store other info into stats array. + * As a special exception, bows use stats.sp for their own purposes. + */ +static const struct digest_types : typeset +{ + digest_types () + { + set (WEAPON); + set (BOW); + set (ARMOUR); + set (HELMET); + set (SHIELD); + set (RING); + set (BOOTS); + set (GLOVES); + set (AMULET); + set (GIRDLE); + set (BRACERS); + set (CLOAK); + set (DISEASE); + set (FORCE); + set (SKILL); + } +} digest_types; + // maximum supported subtype number + 1, can be increased to 256 // currently (2007-09) in use: 50 #define NUM_SUBTYPES 64 @@ -382,11 +372,6 @@ * common/loader.C is updated. */ -/* Basic routines to do above */ -#define SET_FLAG(obj, flg) (obj)->flag [flg] = 1 -#define CLEAR_FLAG(obj, flg) (obj)->flag [flg] = 0 -#define QUERY_FLAG(obj, flg) (obj)->flag [flg] - /* the flags */ #define FLAG_ALIVE 0 /* Object can fight (or be fought) */ @@ -743,7 +728,9 @@ // Cut off point of when an object is put on the active list or not // we use 2**-n because that can be represented exactly -// also make sure that this is a float, not double, constant +// also make sure that this is a float, not double, constant. +// some areas in the server divide by this value, so +// to avoid integer overflows it should not be much lower. #define MIN_ACTIVE_SPEED (1.f / 65536.f) /* have mercy on players and guarantee a somewhat higher speed */