Sharpee
Chord / Standard Library / Wearing / wearing and taking_off

wearing and taking_off

wear (wearing) has verbs wear X, don X, equip X, put on X (the phrasal form outranks generic put). Needs the wearable trait (not_wearable otherwise). You don't have to be holding it; wearing performs an implicit take first, refusing with the take's own refusal if that fails. The conflict rules key on the trait's body part and layer: you cannot put a garment on under something already worn over it, but because every wearable defaults to the same layer, default-built garments never conflict and simply stack (the layer-default quirk). Wearing something you already wear yields already_wearing. Success sets the worn state and says worn; event worn carries bodyPart and layer in the payload.

take off (taking_off) has verbs take off X, take X off, remove X, doff X, unequip X. (Yes, bare remove X means undressing, which is why take-from-container needed its own action.) Refuses when the thing is not worn by you (not_wearing), when a higher layer is worn over it (prevents_removal), and when the garment is cursed (cant_remove), all validate-phase since ADR-229, so a refused removal never half-happens. Success clears the worn state (removed); the item stays in inventory.

A wears line on an actor starts the story dressed (load error unless the item is wearable), and worn/unworn are live state predicates: while the cloak is worn is story logic.

The author writes:

create the Vestry
  a room

  Robes and vestments hang from a row of pegs.

create the woolen tunic
  aka tunic
  wearable

  A plain tunic, scratchy but warm.

create the brocade vest
  aka vest
  wearable
  in the Vestry

  A stiff vest sewn with gold thread.

create the iron torc
  aka torc
  wearable
  in the Vestry

  A ring of black iron, hinged like a shackle.

  on taking_off it
    refuse torc-stuck
  end on

  phrase torc-stuck:
    The torc's hinge has seized; it will not open.

create the player
  starts in the Vestry
  wears the woolen tunic

The player sees:

> wear the vest
(first taking the brocade vest)

Taken.

You put on the brocade vest.

> take off the tunic
You take off the woolen tunic.

> wear the torc
(first taking the iron torc)

Taken.

You put on the iron torc.

> take off the torc
The torc's hinge has seized; it will not open.

Three seams in one scene: wears starts the player dressed in the tunic, the default layers let the vest stack straight over it and the tunic slide out from underneath (the layer-default quirk, live), and the torc's on taking_off it guard is a cursed garment in one clause.

wear (wearing-*)take off (taking_off-*)
Refusalsno_target · not_wearable · not_held · already_wearing · cant_wear_that · hands_full (worn under a higher layer)no_target · not_wearing · prevents_removal (higher layer on top) · cant_remove (cursed)
Successwornremoved (the item stays in inventory)
Eventsworn / wear_blockedremoved / take_off_blocked

Interceptors: on wearing it / on taking_off it on the garment: a cloak that reacts to being donned is one clause on the cloak.