Sharpee
Chord / Behavior / The statements

The statements

Eleven statements do the story's work. The pumpkin below uses most of them:

  on the player measuring
    set the pumpkin's tally to 3
    phrase tape-reading with girth = the pumpkin's tally
    emit pumpkin-measured
  end on

  on the player picking
    change the pumpkin to picked
    award picked-the-champion, once
    move the pumpkin to the Compost Corner when the pumpkin is picked
    phrase picked-note
    win harvest-glory when the pumpkin's tally is 3
  end on
  • phrase <key> speaks the named text. Dotted keys (zoo.pa.closing-3) are legal. with <name> = <value> passes a value the phrase can format.

    A phrase used in only one place does not need a separate definition: indent prose directly under the phrase line and the text is declared and spoken in one gesture. (A deeper line is read as a statement, not prose, only when it opens with a lowercase statement keyword; prose sentences start capitalized, so the two do not collide.)

    after the player entering
      phrase apiary-hum
        The hum reaches you before the gate has even closed.
    end after
    
  • emit <word> raises a story event other clauses and the platform can observe.

  • set <thing> to <value> writes a trait data field, like the pumpkin's tally.

  • change <name> to <state> moves an owner along its declared states; change the story to <state> moves the story.

  • move <name> to <place> relocates an entity. It puts — nothing is seen to happen, nothing can refuse it, though the destination's entering clauses and the mover's when … moves clauses do react to the arrival. To make a character do something, name them and the action instead. A place is a room, an enterable, or a region with a landing; it can also be another entity's room — move the guards to Jack's location, move the hat to its location — since a possessive location always means the containing room. Two more destinations stand alone: move the guards here (the player's location) and move the monkey offstage (no location at all — the monkey keeps its states and timers and comes back with a later move). And move the player to a random adjacent room draws one room a traversable exit away from the mover, at the moment it runs, on the mover's own seeded stream: blocked exits and locked doors do not count, and with no candidate nothing moves. The spelling is exact — no randomly, and only as a move destination.

  • <character> <verb> [<object>] [<preposition> <object>] — the acting statement — has that character perform one action now, through the same pipeline as a typed command: the guards take the sword, Teisha gives the sword to the player, the monkey goes east. The action can refuse (an on the guards taking clause, a locked door), the player sees it in third person when they are in the room, and after the guards taking fires just as it would for a typed command. move the monkey offstage puts the monkey somewhere; the monkey gives the necklace to the player does something. The actor is a character, never the player, and the statement is legal in after and when bodies, on every turn, and topic rows — not inside an on intercept, which is where an action is being decided, not done.

    create the guards
      a person, plural
      in the Yard
    
      Guards.
    
    create the sword
      in the Yard
    
      A sword.
    
    create the Yard
      a room
      after the player entering
        the guards take the sword
      end after
    
      A yard.
    
  • remove <name> takes an entity out of play, permanently: there is no to, nothing to get back, and removing the player is a load error (analysis.remove-player).

  • award <name> grants an owner-scoped score; the explicit , once is available but dedupe already makes awards idempotent.

  • win [<phrase>] and lose [<phrase>] end the story, optionally speaking a named phrase on the way out.

  • kill the player [<phrase-key>] runs the platform's death machinery, not the same thing as lose.

  on the player emptying
    remove the champion slug
    phrase trap-emptied
    lose when the champion pumpkin is picked
  end on