Manual:DIL Manual/movement
Jump to navigation
Jump to search
Contents
movement
Field (integer, read/write; units: rooms).
room.movement : integer
The room's terrain, set with movement in the zone file: one of the SECT_ constants in vme.h, SECT_INSIDE (0) to SECT_ICE (13). It decides how much endurance moving costs (movementloss in basemove.zon), the cost of a path between terrains (vme/etc/sector.def) and whether you need to swim (SECT_WATER_SWIM) or need a boat (SECT_WATER_SAIL). Some spells in spells.zon also test it, for example for SECT_UNDER_WATER.
Notes
- On anything that is not a room, and on null, it fails.
- Stored as an unsigned 8-bit number. Keep to the
SECT_values: the server uses it as an index into its movement tables without checking it. No access level is needed to assign it.
Example
dilbegin integer needs_boat(from : unitptr, dir : integer);
var
dest : unitptr;
code
{
dest := from.exit_to[dir];
if (dest == null)
return (FALSE);
return ((from.movement == SECT_WATER_SAIL) or (dest.movement == SECT_WATER_SAIL));
}
dilend
Tells whether going through an exit means sailing, as the move check in basemove.zon does.