… | |
… | |
30 | #include "cfperl.h" |
30 | #include "cfperl.h" |
31 | #include "shstr.h" |
31 | #include "shstr.h" |
32 | |
32 | |
33 | typedef int tag_t; |
33 | typedef int tag_t; |
34 | |
34 | |
35 | #define NUM_BODY_LOCATIONS 12 |
35 | #define NUM_BODY_LOCATIONS 14 |
36 | #define BODY_ARMS 1 |
36 | #define BODY_ARMS 1 |
37 | |
37 | |
38 | /* See common/item.c */ |
38 | /* See common/item.c */ |
39 | |
39 | |
40 | typedef struct Body_Locations |
40 | typedef struct Body_Locations |
… | |
… | |
89 | |
89 | |
90 | /* However, if you're keeping a pointer of some sort, you probably |
90 | /* However, if you're keeping a pointer of some sort, you probably |
91 | * don't just want it copied, so you'll need to add to common/object.C, |
91 | * don't just want it copied, so you'll need to add to common/object.C, |
92 | * e.g. ->copy_to () |
92 | * e.g. ->copy_to () |
93 | */ |
93 | */ |
|
|
94 | |
|
|
95 | struct body_slot |
|
|
96 | { |
|
|
97 | sint8 info:4; /* body info as loaded from the file */ |
|
|
98 | sint8 used:4; /* Calculated value based on items equipped */ |
|
|
99 | }; |
94 | |
100 | |
95 | INTERFACE_CLASS (object) |
101 | INTERFACE_CLASS (object) |
96 | // these are being copied |
102 | // these are being copied |
97 | struct object_copy : attachable |
103 | struct object_copy : attachable |
98 | { |
104 | { |
… | |
… | |
158 | sint32 ACC (RW, weight_limit);/* Weight-limit of object */ |
164 | sint32 ACC (RW, weight_limit);/* Weight-limit of object */ |
159 | sint32 ACC (RW, carrying); /* How much weight this object contains */ |
165 | sint32 ACC (RW, carrying); /* How much weight this object contains */ |
160 | sint64 ACC (RW, perm_exp); /* Permanent exp */ |
166 | sint64 ACC (RW, perm_exp); /* Permanent exp */ |
161 | uint32 ACC (RW, weapontype); /* type of weapon */ |
167 | uint32 ACC (RW, weapontype); /* type of weapon */ |
162 | uint32 ACC (RW, tooltype); /* type of tool or build facility */ |
168 | uint32 ACC (RW, tooltype); /* type of tool or build facility */ |
163 | sint8 ACC (RW, body_info[NUM_BODY_LOCATIONS]); /* body info as loaded from the file */ |
169 | body_slot slot [NUM_BODY_LOCATIONS]; |
164 | sint8 ACC (RW, body_used[NUM_BODY_LOCATIONS]); /* Calculated value based on items equipped */ |
|
|
165 | faceidx ACC (RW, face); /* Face with colors */ |
170 | faceidx ACC (RW, face); /* Face with colors */ |
166 | living ACC (RO, stats); /* Str, Con, Dex, etc */ |
171 | living ACC (RO, stats); /* Str, Con, Dex, etc */ |
167 | /* See the pod/objects.pod for more info about body locations */ |
172 | /* See the pod/objects.pod for more info about body locations */ |
168 | |
173 | |
169 | /* Following mostly refers to fields only used for monsters */ |
174 | /* Following mostly refers to fields only used for monsters */ |
… | |
… | |
274 | && can_merge_slow (op1, op2); |
279 | && can_merge_slow (op1, op2); |
275 | } |
280 | } |
276 | |
281 | |
277 | MTH void set_owner (object *owner); |
282 | MTH void set_owner (object *owner); |
278 | MTH void set_speed (float speed); |
283 | MTH void set_speed (float speed); |
|
|
284 | MTH void set_weapon (object *ob); |
279 | |
285 | |
280 | MTH void open_container (object *new_container); |
286 | MTH void open_container (object *new_container); |
281 | MTH void close_container () |
287 | MTH void close_container () |
282 | { |
288 | { |
283 | open_container (0); |
289 | open_container (0); |
… | |
… | |
331 | || (flag [FLAG_ALIVE] && !flag [FLAG_GENERATOR] && type != DOOR)) |
337 | || (flag [FLAG_ALIVE] && !flag [FLAG_GENERATOR] && type != DOOR)) |
332 | && !flag [FLAG_IS_A_TEMPLATE]; } |
338 | && !flag [FLAG_IS_A_TEMPLATE]; } |
333 | MTH bool is_arrow () const { return type == ARROW |
339 | MTH bool is_arrow () const { return type == ARROW |
334 | || (type == SPELL_EFFECT |
340 | || (type == SPELL_EFFECT |
335 | && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } |
341 | && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } |
|
|
342 | MTH bool is_range () const { return type == BOW || type == ROD || type == WAND || type == HORN; } |
336 | |
343 | |
337 | MTH bool has_active_speed () const { return FABS(speed) >= MIN_ACTIVE_SPEED; } |
344 | MTH bool has_active_speed () const { return FABS(speed) >= MIN_ACTIVE_SPEED; } |
338 | |
345 | |
339 | // temporary: wether the object can be saved in a map file |
346 | // temporary: wether the object can be saved in a map file |
340 | // contr => is a player |
347 | // contr => is a player |