Manual:DIL Manual/manipulate
Jump to navigation
Jump to search
Contents
manipulate
Field (integer, read/write; units: all, used on objects).
u.manipulate : integer
What players can do with the unit, a bit set of MANIPULATE_* values from vme.h. In a zone file it is manipulate {MANIPULATE_TAKE, MANIPULATE_WEAR_BODY}.
MANIPULATE_TAKE: it can be picked up. Without it, get refuses (baseget.zon).MANIPULATE_WEAR_FINGER,_NECK,_BODY,_HEAD,_LEGS,_FEET,_HANDS,_ARMS,_SHIELD,_ABOUT,_WAIST,_WRIST,_EAR,_BACK,_CHEST,_ANKLE: where it can be worn.MANIPULATE_WIELD,MANIPULATE_HOLD: it can be wielded or held.MANIPULATE_ENTER: things can be put in it (put in baseget.zon refuses without it, even for a container) and characters can enter it (enter in basemove.zon).
Notes
- Test with isset(), change with set() and unset(). Several bits at once:
u.manipulate & (MANIPULATE_WIELD | MANIPULATE_HOLD). - Where an object is worn right now is equip, not this field.
- On null it fails.
Example
dilbegin integer can_take(item : unitptr);
code
{
if (item.type != UNIT_ST_OBJ)
return (FALSE);
return (isset(item.manipulate, MANIPULATE_TAKE));
}
dilend
Tells whether an object can be picked up, as get does in baseget.zon.