Sharpee
Chord / Standard Library / Devices / switching_on and switching_off

switching_on and switching_off

switch on (switching_on) takes the verbs turn on X, switch on X, flip on X, the bare transitives activate X, start X, power on X (ADR-230 D4), and the reversed turn X on. Only turn gets the reversed form; switch X on does not parse. All forms check the switchable trait in validation (bare turn X with no on/off is the separate per-entity turning verb). Turning on a device that is also a light-source lights it. If that banishes darkness in the player's room, the action follows with an automatic LOOK, so the newly visible room describes itself before the switch-on message lands.

switch off (switching_off) takes the verbs turn off X, switch off X, flip off X, deactivate X, stop X, power off X, and the reversed turn X off. Turning the sole light off says light_off ("… plunging the area into darkness") and leaves the player in the dark-room world.

The author writes:

create the Darkroom
  a room
  dark

  Developing trays line the counter, and finished prints hang from a
  wire overhead.

create the safelight
  aka lamp
  switchable, light-source
  in the Darkroom

  A red-globed safelight with a spring clamp.

  phrase detail while it is lit:
    Its red glow pools over the developing trays.

create the enlarger
  switchable
  scenery
  in the Darkroom

  A photographic enlarger on a steel column.

  on switching_on it
    refuse enlarger-unplugged
  end on

  phrase enlarger-unplugged:
    The enlarger's plug dangles loose behind the counter.

create the ventilation fan
  aka fan
  switchable, starts on
  scenery
  in the Darkroom

  A boxy ventilation fan set into the wall.

create the player
  starts in the Darkroom
  carries the safelight

The player sees:

> look
It's pitch dark, and you can't see a thing.

> turn the safelight on
Darkroom
Developing trays line the counter, and finished prints hang from a wire overhead.

The safelight switches on, banishing the darkness.

> examine the safelight
A red-globed safelight with a spring clamp. Its red glow pools over the developing trays.

> switch on the enlarger
The enlarger's plug dangles loose behind the counter.

> stop the fan
The ventilation fan powers down with a soft whir.

> turn off the safelight
You switch off the safelight, plunging the area into darkness.

Four seams in one scene: illumination triggers the automatic LOOK (room text first, then illuminates_darkness), the lit safelight's examine picks up its detail while it is lit sentence, the enlarger's on switching_on it guard refuses with its own phrase, and the starts on fan goes down to the bare stop synonym.

switch on (switching_on-*)switch off (switching_off-*)
Refusalsnot_switchable · already_on · no_power (declared power requirement)not_switchable · already_off
Successswitched_on · light_on · illuminates_darkness (dark room, after the automatic LOOK) · with_sound (trait's on sound) · device_hummingswitched_off · light_off (sole light out) · light_off_still_lit (other lit lights share the room) · silence_falls (a running hum stops) · device_stops
Eventsswitched_on / switch_on_blockedswitched_off / switch_off_blocked

The success key is chosen by what the device is (light, sound, flavor, or plain), and event payloads carry light, sound, power, and timer facts for story reactions. The interceptors are on switching_on it / on switching_off it on the device, as with the enlarger above.

In Chord, on/off and lit work as state predicates (while the flashlight is on, while the lantern is lit), and declaring your own on/off state pair on a switchable gets a fix-it telling you to compose the trait instead. One subtlety: is lit reads the stored flag strictly, so a light that has never been switched counts as not-lit in Chord conditions even where the platform's own default would call it lit; switch it once and the two agree.