Manual:DIL Manual/opendiff
Jump to navigation
Jump to search
Contents
opendiff
Field (integer, read/write; units: all, used on containers).
u.opendiff : integer
How hard the unit's lock is to pick. The pick command in skills.zon passes it as the difficulty of the SKI_PICK_LOCK check, so higher is harder and 0 is no extra difficulty. In a zone file it follows the open flags: open {EX_OPEN_CLOSE, EX_CLOSED, EX_LOCKED} difficulty 50, where vmc accepts 0 to 250.
Notes
- A lock with
EX_PICKPROOFin openflags can't be picked whatever this is. - A room's exits have their own difficulty, exit_diff.
- Stored as an 8-bit unsigned number: values outside 0 to 255 wrap around.
- On null it fails.
Example
dilbegin harden_lock(item : unitptr, more : integer);
var
d : integer;
code
{
d := item.opendiff + more;
if (d > 250)
d := 250;
item.opendiff := d;
return;
}
dilend
Makes a lock harder to pick, keeping it within the range vmc allows.