… | |
… | |
128 | |
128 | |
129 | /* This next big block are basically used for monsters and equipment */ |
129 | /* This next big block are basically used for monsters and equipment */ |
130 | uint8 ACC (RW, type); /* PLAYER, BULLET, etc. See define.h */ |
130 | uint8 ACC (RW, type); /* PLAYER, BULLET, etc. See define.h */ |
131 | uint8 ACC (RW, subtype); /* subtype of object */ |
131 | uint8 ACC (RW, subtype); /* subtype of object */ |
132 | uint16 ACC (RW, client_type); /* Public type information. see doc/Developers/objects */ |
132 | uint16 ACC (RW, client_type); /* Public type information. see doc/Developers/objects */ |
133 | sint16 resist[NROFATTACKS]; /* Resistance adjustments for attacks */ |
133 | sint16 ACC (RW, resist[NROFATTACKS]); /* Resistance adjustments for attacks */ |
134 | uint32 ACC (RW, attacktype); /* Bitmask of attacks this object does */ |
134 | uint32 ACC (RW, attacktype); /* Bitmask of attacks this object does */ |
135 | uint32 ACC (RW, path_attuned);/* Paths the object is attuned to */ |
135 | uint32 ACC (RW, path_attuned);/* Paths the object is attuned to */ |
136 | uint32 ACC (RW, path_repelled); /* Paths the object is repelled from */ |
136 | uint32 ACC (RW, path_repelled); /* Paths the object is repelled from */ |
137 | uint32 ACC (RW, path_denied); /* Paths the object is denied access to */ |
137 | uint32 ACC (RW, path_denied); /* Paths the object is denied access to */ |
138 | uint16 ACC (RW, material); /* What materials this object consist of */ |
138 | uint16 ACC (RW, material); /* What materials this object consist of */ |
… | |
… | |
156 | sint32 ACC (RW, weight_limit);/* Weight-limit of object */ |
156 | sint32 ACC (RW, weight_limit);/* Weight-limit of object */ |
157 | sint32 ACC (RW, carrying); /* How much weight this object contains */ |
157 | sint32 ACC (RW, carrying); /* How much weight this object contains */ |
158 | sint64 ACC (RW, perm_exp); /* Permanent exp */ |
158 | sint64 ACC (RW, perm_exp); /* Permanent exp */ |
159 | uint32 ACC (RW, weapontype); /* type of weapon */ |
159 | uint32 ACC (RW, weapontype); /* type of weapon */ |
160 | uint32 ACC (RW, tooltype); /* type of tool or build facility */ |
160 | uint32 ACC (RW, tooltype); /* type of tool or build facility */ |
161 | sint8 body_info[NUM_BODY_LOCATIONS]; /* body info as loaded from the file */ |
161 | sint8 ACC (RW, body_info[NUM_BODY_LOCATIONS]); /* body info as loaded from the file */ |
162 | sint8 body_used[NUM_BODY_LOCATIONS]; /* Calculated value based on items equipped */ |
162 | sint8 ACC (RW, body_used[NUM_BODY_LOCATIONS]); /* Calculated value based on items equipped */ |
163 | living ACC (RO, stats); /* Str, Con, Dex, etc */ |
163 | living ACC (RO, stats); /* Str, Con, Dex, etc */ |
164 | /* See the doc/Developers/objects for more info about body locations */ |
164 | /* See the doc/Developers/objects for more info about body locations */ |
165 | |
165 | |
166 | /* Following mostly refers to fields only used for monsters */ |
166 | /* Following mostly refers to fields only used for monsters */ |
167 | uint32 ACC (RW, hide); /* The object is hidden, not invisible */ |
167 | uint32 ACC (RW, hide); /* The object is hidden, not invisible */ |
… | |
… | |
188 | |
188 | |
189 | /* Following are values used by any object */ |
189 | /* Following are values used by any object */ |
190 | /* this objects turns into or what this object creates */ |
190 | /* this objects turns into or what this object creates */ |
191 | treasurelist *ACC (RW, randomitems); /* Items to be generated */ |
191 | treasurelist *ACC (RW, randomitems); /* Items to be generated */ |
192 | key_value *key_values; /* Fields not explictly known by the loader. */ |
192 | key_value *key_values; /* Fields not explictly known by the loader. */ |
193 | flags_t flags; /* various flags */ |
193 | flags_t flag; /* various flags */ |
|
|
194 | #if FOR_PERL |
|
|
195 | bool ACC (RW, flag[NUM_FLAGS]); |
|
|
196 | #endif |
194 | uint16 ACC (RW, animation_id);/* An index into the animation array */ |
197 | uint16 ACC (RW, animation_id);/* An index into the animation array */ |
195 | uint8 ACC (RW, anim_speed); /* ticks between animation-frames */ |
198 | uint8 ACC (RW, anim_speed); /* ticks between animation-frames */ |
196 | uint8 ACC (RW, last_anim); /* last sequence used to draw face */ |
199 | uint8 ACC (RW, last_anim); /* last sequence used to draw face */ |
197 | sint32 ACC (RW, elevation); /* elevation of this terrain - not currently used */ |
200 | sint32 ACC (RW, elevation); /* elevation of this terrain - not currently used */ |
198 | uint8 ACC (RW, smoothlevel); /* how to smooth this square around */ |
201 | uint8 ACC (RW, smoothlevel); /* how to smooth this square around */ |
… | |
… | |
290 | bool is_weapon () const { return type == ARROW || type == BOW || type == WEAPON; } |
293 | bool is_weapon () const { return type == ARROW || type == BOW || type == WEAPON; } |
291 | bool is_armor () const { return type == ARMOUR || type == SHIELD || type == HELMET |
294 | bool is_armor () const { return type == ARMOUR || type == SHIELD || type == HELMET |
292 | || type == CLOAK || type == BOOTS || type == GLOVES |
295 | || type == CLOAK || type == BOOTS || type == GLOVES |
293 | || type == BRACERS || type == GIRDLE; } |
296 | || type == BRACERS || type == GIRDLE; } |
294 | bool is_alive () const { return (type == PLAYER |
297 | bool is_alive () const { return (type == PLAYER |
295 | || flags [FLAG_MONSTER] |
298 | || flag [FLAG_MONSTER] |
296 | || (flags [FLAG_ALIVE] && !flags [FLAG_GENERATOR] && type != DOOR)) |
299 | || (flag [FLAG_ALIVE] && !flag [FLAG_GENERATOR] && type != DOOR)) |
297 | && !flags [FLAG_IS_A_TEMPLATE]; } |
300 | && !flag [FLAG_IS_A_TEMPLATE]; } |
298 | bool is_arrow () const { return type == ARROW |
301 | bool is_arrow () const { return type == ARROW |
299 | || (type == SPELL_EFFECT |
302 | || (type == SPELL_EFFECT |
300 | && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } |
303 | && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } |
301 | |
304 | |
302 | /* This return true if object has still randomitems which |
305 | /* This return true if object has still randomitems which |
303 | * could be expanded. |
306 | * could be expanded. |
304 | */ |
307 | */ |
305 | bool has_random_items () const { return randomitems && !flags [FLAG_IS_A_TEMPLATE]; } |
308 | bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; } |
306 | |
309 | |
307 | // returns the player that has this object in his inventory, or 0 |
310 | // returns the player that has this object in his inventory, or 0 |
308 | object *in_player () const |
311 | object *in_player () const |
309 | { |
312 | { |
310 | for (object *op = env; op; op = op->env) |
313 | for (object *op = env; op; op = op->env) |