Manual:DIL Manual/unequip()
Jump to navigation
Jump to search
unequip()
Procedure. Takes off an object a character is wearing.
unequip(u : unitptr)
The object stays in the character's inventory but is no longer worn: its light stops counting for the wearer and its transfer affects come off the wearer. Like addequip() it is silent: no messages, and it isn't the remove command.
Parameters
| Name | Type | Meaning |
|---|---|---|
| u | unitptr | The worn object. |
Notes
- Nothing happens when
uis null, isn't an object, or isn't worn. Sounequip(equipment(ch, WEAR_WIELD))is safe when nothing is wielded. - To take the object away from the character as well, link() it somewhere after unequipping it.
Example
dilbegin disarm(victim : unitptr);
var
wpn : unitptr;
code
{
wpn := equipment(victim, WEAR_WIELD);
if (wpn == null)
return;
unequip(wpn);
link(wpn, victim.outside);
act("$1n knocks $2n out of $3n's hands.", A_ALWAYS, self, wpn, victim, TO_ROOM);
act("$1n knocks $2n out of your hands.", A_ALWAYS, self, wpn, victim, TO_VICT);
}
dilend
Takes the wielded weapon from a character and drops it on the floor.