(library version)
Library version 0.13.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Global variables
%% The following variables may be queried directly from the story, but the
%% library gets confused if you modify them directly with (now). Instead, use
%% the predicates mentioned in the comments:
%% Update with (select player $):
(global variable (current player $))
%% Update with (enter $) or (move player to $ $):
(global variable (current room $))
%% Update with (increase score by $) or (decrease score by $):
(global variable (current score $))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Relations
(relation #in) %% Note: #in is also a direction
(relation #on)
(relation #partof)
(relation #heldby)
(relation #wornby)
(relation #under)
(relation #behind)
(name #in) in
(name #on) on
(name #partof) part of
(name #heldby) held by
(name #wornby) worn by
(name #under) under
(name #behind) behind
(Name #partof) As part of
(dict #in) inside into through
(dict #on) onto atop upon
(dict #partof) (just) (fail)
(dict #heldby) (just) (fail)
(dict #wornby) (just) (fail)
(present-name #in) inside
(present-name #on) on top of
(present-name $Rel) (name $Rel)
(towards-name #in) into
(towards-name #on) onto
(towards-name $Rel) (name $Rel)
(reverse-name #in) out of
(reverse-name #on) off
(reverse-name #partof) away from
(reverse-name #heldby) away from
(reverse-name #wornby) off
(reverse-name #under) out from under
(reverse-name #behind) out from behind
(the (relation $Rel)) (name $Rel)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Directions
%% Directions are given special treatment during parsing, so there is no need
%% for (dict $) rules here. See (parse direction $ $).
#north
(direction *)
(name *) north
#south
(direction *)
(name *) south
#east
(direction *)
(name *) east
#west
(direction *)
(name *) west
#northeast
(direction *)
(name *) northeast
#northwest
(direction *)
(name *) northwest
#southwest
(direction *)
(name *) southwest
#southeast
(direction *)
(name *) southeast
#up
(direction *)
(name *) up
#down
(direction *)
(name *) down
#in %% Note: #in is also a relation
(direction *)
#out
(direction *)
(name *) out
(proper (direction $))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Common traits and per-object flags
%% Negations
@($Obj is open) ~($Obj is closed)
@($Obj is unlocked) ~($Obj is locked)
@($Obj is on) ~($Obj is off)
@($Obj is revealed) ~($Obj is hidden)
@($Obj is pristine) ~($Obj is handled)
@($Obj is unvisited) ~($Obj is visited)
@($Obj is transparent) ~($Obj is opaque)
@($Obj is in order) ~($Obj is broken)
%% Inheritance relations
(actor container $Obj) *(room $Obj)
(animate $Obj) *(female $Obj)
(animate $Obj) *(male $Obj)
(container $Obj) *(actor container $Obj)
(item $Obj) *(wearable $Obj)
(supporter $Obj) *(actor supporter $Obj)
(excluded from all $Obj) *(not here $Obj)
(excluded from all $Obj) *(room $Obj)
(actor container $Obj) *(in-seat $Obj)
(actor supporter $Obj) *(on-seat $Obj)
(seat $Obj) *(in-seat $Obj)
(seat $Obj) *(on-seat $Obj)
(openable $Obj) *(lockable $Obj)
(plural $Obj) *(pair $Obj)
%% "Edison's Lament: No switch is ever in the right position."
%% (From "The Grand List Of Console Role Playing Game Clichés")
%% Of course, you can override these defaults on an object-by-object basis:
((openable $) is closed)
((lockable $) is locked)
((switchable $) is off)
((openable $) is opaque)
%% Convenience predicate:
(reveal $Obj)
(now) ($Obj is revealed)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Rules to prevent compiler warnings
%% The following rule definitions have no effect on the behaviour of the
%% program, but they prevent warnings about undefined predicates. They have
%% zero impact on performance.
%% These are typically static traits:
(an $) (fail)
(door $) (fail)
(edible $) (fail)
(female $) (fail)
(fine where it is $) (fail)
(inherently dark $) (fail)
(intangible $) (fail)
(item $) (fail)
(lockable $) (fail)
(male $) (fail)
(not here $) (fail)
(openable $) (fail)
(out of reach $) (fail)
(pair $) (fail)
(potable $) (fail)
(proper $) (fail)
(pushable $) (fail)
(sharp $) (fail)
(singleton $) (fail)
(switchable $) (fail)
(uncountable $) (fail)
(wearable $) (fail)
(vehicle $) (fail)
(your $) (fail)
(on-seat $) (fail)
(in-seat $) (fail)
(consultable $) (fail)
%% These typically involve rule bodies with further conditions:
($ provides light) (fail)
%% These are typically dynamic (i.e. per-object flags):
($ is broken) (fail)
($ is hidden) (fail)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Rooms and doors
(name (room $)) location
(room header $Room) (Name $Room)
(look (room $R)) You are here.
%% Given a room and a direction, what room (if any) is reachable that way?
(from $Here go $Dir to room $Room)
*(from $Here go $Dir to $Target)
(if) (room $Target) (then)
($Target = $Room)
(elseif) (direction $Target) (then)
(from $Here go $Target to room $Room)
(else)
(door $Target)
~($Target blocks passage)
(from $Here through $Target to $Room)
(endif)
%% Given a room and a direction, what object, door and/or room is visible
%% that way?
(from $Room go $Dir to object $Obj)
(from $Room go $Dir to $Point)
(if) (direction $Point) (then)
*(from $Room go $Point to object $Obj)
(elseif) (door $Point) (then)
{
~($Point blocks light)
(from $Room through $Point to $Obj)
(or)
($Obj = $Point)
}
(else)
($Obj = $Point)
(endif)
(the (current room $)) this location
(name (door $)) door
($Door blocks passage)
($Door is closed)
($Door blocks light)
($Door is opaque)
($Door is closed)
@(from $Room go $Dir through $Door to $Target)
*(from $Room go $Dir to $Door)
*(from $Room through $Door to $Target)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Access rules
(light reaches ceiling (room $Ceil))
~(inherently dark $Ceil)
(light reaches ceiling $Ceil)
*($Obj provides light)
(visibility ceiling of $Obj is $Ceil)
(visibility ceiling of (room $R) is $R)
(visibility ceiling of $Obj is $Parent)
($Obj is #in $Parent)
($Parent is opaque)
($Parent is closed)
(visibility ceiling of $Obj is $Ceil)
($Obj has parent $Parent)
(visibility ceiling of $Parent is $Ceil)
(player can see)
(current player $Player)
(visibility ceiling of $Player is $Ceil)
(light reaches ceiling $Ceil)
($Obj is visible to $Actor)
(visibility ceiling of $Actor is $Ceil)
(if) (visibility ceiling of $Obj is $Ceil) (then)
{
(light reaches ceiling $Ceil)
(or)
($Obj has ancestor $Actor)
}
(else)
(room $Ceil)
(light reaches ceiling $Ceil)
{
(from $Ceil go $ to $Obj)
(or)
(from $Ceil through $Door to $Obj)
~($Door blocks light)
}
(endif)
(reachability ceiling of $O is $Ceil)
(if) ($O is $Rel $Parent) (then)
(if) ($Rel = #in) ($Parent is closed) (then)
($Parent = $Ceil)
(else)
(reachability ceiling of $Parent is $Ceil)
(endif)
(else)
($O = $Ceil)
(endif)
~($Obj is reachable by $)
(out of reach $Obj)
($Obj is reachable by $Actor)
(reachability ceiling of $Actor is $Ceil)
(reachability ceiling of $Obj is $Ceil)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Scope
%% This predicate can be extended by the game, typically using rules that check
%% certain conditions, e.g. what the current room is:
(add $ to scope) (fail)
%% These rules should be left as they are:
(rebuild scope)
(now) ~($ is in scope)
(current player $Actor)
(visibility ceiling of $Actor is $Ceil)
(if) (light reaches ceiling $Ceil) (then)
(now) ($Ceil is in scope)
(exhaust) {
*($Child is #in $Ceil)
(recursively add $Child to scope)
}
(else)
%% in the dark
(recursively add $Actor to scope)
(endif)
(current room $Room)
(now) ($Room is in scope) %% i.e. even if we're in darkness
(exhaust) {
*(from $Room go $ to $Obj)
~(direction $Obj)
(now) ($Obj is in scope)
}
(exhaust) {
*(from $Room through $Door to $Other)
~($Door blocks light)
(now) ($Other is in scope)
}
(exhaust) {
*(add $Obj to scope)
(now) ($Obj is in scope)
}
(if) (player's it refers to $Obj) ~($Obj is in scope) (then)
(now) ~(player's it refers to $)
(endif)
(if) (narrator's it refers to $Obj) ~($Obj is in scope) (then)
(now) ~(narrator's it refers to $)
(endif)
(if) (him refers to $Obj) ~($Obj is in scope) (then)
(now) ~(him refers to $)
(endif)
(if) (her refers to $Obj) ~($Obj is in scope) (then)
(now) ~(her refers to $)
(endif)
(if)
(them refers to $ObjList)
*($Obj is one of $ObjList)
~($Obj is in scope)
(then)
(now) ~(them refers to $)
(endif)
(recursively add $Obj to scope)
(now) ($Obj is in scope)
(exhaust) {
*($Sub is $Rel $Obj)
~{ ($Obj is opaque) ($Obj is closed) ($Rel = #in) }
(recursively add $Sub to scope)
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Select player, enter a room or other location, move floating objects
(select player $Player)
(clear all pronouns)
(now) (current player $Player)
(update environment around player)
(move player to $Rel $Loc)
(current player $Player)
(now) ($Player is $Rel $Loc)
(update environment around player)
(enter $Room)
(move player to #in $Room)
(narrate entering $Room)
(enter $Room by $Vehicle)
(now) ($Vehicle is #in $Room)
(now) ($Vehicle is handled)
(update environment around player)
(narrate entering $Room)
(update environment around player)
(if) (current player $Player) ($Player is in room $Room) (then)
(now) (current room $Room)
(if) ($Room is unvisited) (player can see) (then)
(now) ($Room is visited)
(endif)
(exhaust) {
*($Room attracts $Object)
(now) ($Object is #in $Room)
}
(endif)
(narrate entering (room $))
(par)
(try [look])
(narrate entering $Obj)
You get into (the $Obj).
(prevent entering $Obj)
(when $Obj won't accept actor #in)
(narrate failing to leave $ $)
There doesn't appear to be an exit in that direction.
%% Extend the following predicate to simulate objects occupying multiple rooms:
($Room attracts $Door)
*(from $Room go $ to $Door)
(door $Door)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Standard actions
%% LOOK
(understand [examine | $Words] as [look $Dir])
*(understand $Words as direction $Dir)
(understand [look | $Words] as [look $Dir])
*(understand $Words as direction $Dir)
(unlikely [look $])
(prevent [look $])
~(player can see)
You can't see in the darkness.
(perform [look $Dir])
(if)
(current player $Player)
(visibility ceiling of $Player is $Room)
(room $Room)
(from $Room go $Dir to $Target)
(then)
(if) (direction $Target) (then)
(try [look $Target])
(elseif) (door $Target) ~($Target blocks light) (then)
(from $Room through $Target to $OtherRoom)
(if) ($OtherRoom is visited) (then)
Through (the $Target) you see (a $OtherRoom).
(else)
You can't quite make out what's on the other
side of (the $Target).
(endif)
(elseif) (room $Target) ($Target is unvisited) (then)
You can't get a good view of what's in that direction.
(else)
(Name $Dir) from here (is $Target) (a $Target).
(endif)
(else)
You see nothing unexpected
(if) ($Dir = #up) (then)
above.
(elseif) ($Dir = #down) (then)
below.
(else)
in that direction.
(endif)
(endif)
%% LOOK
(understand [look | $Words] as [look $Rel $Obj])
*(split $Words by relation $Rel into [] and $MoreWords)
*(understand $MoreWords as single object $Obj)
(unlikely [look #in $Obj])
~(container $Obj)
(unlikely [look #on $Obj])
~(supporter $Obj)
%% Reachability not required, but visibility:
(refuse [look $ $Obj])
(just)
{
(when $Obj is not here)
(or) (when $Obj is out of sight)
}
(before [look #in $Obj])
($Obj is opaque)
($Obj is closed)
(first try [open $Obj])
(instead of [look #in (current room $)])
(try [look])
(instead of [look #in $Obj])
{ (room $Obj) (or) (door $Obj) }
(current room $Here)
{
(from $Here go $Dir to $Obj)
(or)
(from $Here through $Door to $Obj)
(from $Here go $Dir to $Door)
}
(direction $Dir)
(try [look $Dir])
(prevent [look #in $Obj])
~(container $Obj)
(The $Obj) can't contain things.
(prevent [look #in $Obj])
($Obj is opaque)
($Obj is closed)
(current player $Player)
~(visibility ceiling of $Player is $Obj)
(if) (openable $Obj) (then)
(The $Obj is) closed.
(else)
You can't look inside (the $Obj).
(endif)
(prevent [look #behind (room $Obj)])
Looking behind (the $Obj) doesn't make sense.
(perform [look $Rel $Obj])
(collect $C)
*($C is $Rel $Obj)
(now) ($C is revealed)
(into $List)
(if) (empty $List) (then)
(if) (#in = $Rel) (then)
(The $Obj is) empty.
(else)
(if) ($Rel is one of [#under #behind]) (then)
You find
(else)
There's
(endif)
nothing (present-name $Rel) (the $Obj).
(endif)
(else)
(Name $Rel) (the $Obj) you see (a $List). (notice $List)
(endif)
%% EXAMINE
(rewrite [x | $Words] into [examine | $Words])
(rewrite [look at | $Words] into [examine | $Words])
(rewrite [l at | $Words] into [examine | $Words])
(rewrite [watch | $Words] into [examine | $Words])
(rewrite [describe | $Words] into [examine | $Words])
(rewrite [check | $Words] into [examine | $Words])
(understand [examine | $Words] as [examine $Obj])
*(understand $Words as non-all object $Obj)
(understand [look | $Words] as [examine $Obj])
*(understand $Words as non-all object $Obj)
(understand [who am i] as [examine $Player])
(current player $Player)
~(refuse [examine $]) %% No need for reachability.
(instead of [examine (room $Obj)])
(current room $Here)
~($Here = $Obj)
(if)
(from $Here go $Dir to $Obj)
(then)
(try [look $Dir])
(elseif)
(from $Here through $Door to $Obj)
~($Door blocks light)
(from $Here go $Dir to $Door)
(then)
(try [look $Dir])
(else)
You can't get a good view of (the $Obj) from here.
(endif)
(perform [examine $Obj])
(current player $Player)
(visibility ceiling of $Player is $Obj)
(look $Obj)
(perform [examine $Obj])
(descr $Obj)
(if) (supporter $Obj) (then)
(if) (fungibility enabled) (then)
(collect $Child)
*($Child is #on $Obj)
(into $OnList)
(fungibility-enabled appearance $OnList #on $Obj)
(else)
(exhaust) {
*($Child is #on $Obj)
(par)
(appearance $Child #on $Obj)
}
(endif)
(endif)
(if) (container $Obj) ~{ ($Obj is opaque) ($Obj is closed) } (then)
(if) (fungibility enabled) (then)
(collect $Child)
*($Child is #in $Obj)
(into $InList)
(fungibility-enabled appearance $InList #in $Obj)
(else)
(exhaust) {
*($Child is #in $Obj)
(par)
(appearance $Child #in $Obj)
}
(endif)
(endif)
(par)
%% LOOK
(rewrite [l | $Words] into [look | $Words])
(understand [look])
(understand [look around] as [look])
(understand [where am i] as [look])
(describe action [look])
look around
(perform [look])
(current player $Player)
(visibility ceiling of $Player is $Ceil)
(if) (light reaches ceiling $Ceil) (then)
(location headline)
(line)
(look $Ceil)
($Player is $Rel $Loc)
(make appearances $Rel $Loc)
(par)
(else)
(bold) (darkness headline) (roman)
(line)
(narrate darkness)
(endif)
%% SEARCH
(understand [search | $Words] as [search $Obj])
*(understand $Words as non-all object $Obj)
(instead of [search (current room $R)])
(try [look])
(perform [search $O])
(if) ($O is closed) ($O is opaque) (then)
($InList = [])
(else)
(collect $C) *($C is #in $O) (reveal $C) (into $InList)
(endif)
(collect $C) *($C is #on $O) (reveal $C) (into $OnList)
(collect $C) *($C is #behind $O) (reveal $C) (into $BehindList)
(collect $C) *($C is #under $O) (reveal $C) (into $UnderList)
(if) (nonempty $InList) (then)
(if) ($InList = [$InObj]) (then)
(A $InObj) (is $InObj) in (the $O).
(else)
In (the $O) you find (a $InList).
(endif)
(notice $InList)
(endif)
(if) (nonempty $OnList) (then)
(if) ($OnList = [$OnObj]) (then)
(A $OnObj) (is $OnObj) on (the $O).
(else)
On (the $O) you find (a $OnList).
(endif)
(notice $OnList)
(endif)
(if) (nonempty $BehindList) (then)
You find (a $BehindList) behind (the $O).
(notice $BehindList)
(endif)
(if) (nonempty $UnderList) (then)
You find (a $UnderList) under (the $O).
(notice $UnderList)
(endif)
(if)
(empty $InList)
(empty $OnList)
(empty $BehindList)
(empty $UnderList)
(then)
You find nothing of interest.
(endif)
%% FEEL
(rewrite [touch | $Words] into [feel | $Words])
(rewrite [finger | $Words] into [feel | $Words])
(rewrite [rub | $Words] into [feel | $Words])
(rewrite [prod | $Words] into [feel | $Words])
(understand [feel | $Words] as [feel $Obj])
*(understand $Words as non-all object $Obj)
(perform [feel $Obj])
(feel $Obj)
%% LISTEN TO
%% LISTEN
(rewrite [hear | $Words] into [listen | $Words])
(rewrite [listen to | $Words] into [listen | $Words])
(understand [listen | $Words] as [listen to $Obj])
*(understand $Words as single object $Obj)
%% Don't require reachability:
(refuse [listen to $Obj])
(just) (when $Obj is not here)
(perform [listen to $Obj])
(if) (current player $Obj) (then)
You can hear the familiar rumble of your blood stream
and the faint whine of your nervous system.
(elseif) (animate $Obj) (then)
(The $Obj) (is $Obj) silent.
(elseif) (room $Obj) (then)
You hear nothing in particular.
(else)
You hear no particular sound coming from (the $Obj).
(endif)
(understand [listen])
(instead of [listen])
(current room $Room)
(try [listen to $Room])
%% KISS
(rewrite [hug | $Words] into [kiss | $Words])
(rewrite [embrace | $Words] into [kiss | $Words])
(rewrite [love | $Words] into [kiss | $Words])
(understand [kiss | $Words] as [kiss $Obj])
*(understand $Words as single object $Obj preferably animate)
(prevent [kiss $Obj])
(current player $Player)
{
($Obj = $Player)
(or)
($Obj is part of $Player)
}
Your feelings for yourself are primarily of a platonic nature.
(perform [kiss $Obj])
(The $Obj is) unmoved by your display of affection.
%% JUMP
(rewrite [skip | $Words] into [jump | $Words])
(rewrite [hop | $Words] into [jump | $Words])
(rewrite [bounce | $Words] into [jump | $Words])
(understand [jump])
(understand [exercise] as [jump])
(perform [jump])
You enjoy a bit of jumping on the spot.
%% DANCE
(rewrite [jive] into [dance])
(rewrite [shake] into [dance])
(rewrite [twirl] into [dance])
(rewrite [spin] into [dance])
(understand [dance])
(perform [dance])
You practise your moves.
%% WAVE
%% WAVE
(understand [wave | $Words] as [wave $Obj])
*(understand $Words as object $Obj preferably held)
(unlikely [wave $Obj])
(current player $Player)
~($Obj is #heldby $Player)
~($Obj is part of $Player)
(before [wave $Obj])
(ensure $Obj is held)
(prevent [wave $Obj])
(current player $Player)
~($Obj is part of $Player)
(when $Obj isn't directly held)
(perform [wave $Obj])
You wave (the $Obj) in the air, with no apparent consequences.
(understand [wave])
(perform [wave])
You wave your hands in the air.
%% SING
(rewrite [hum] into [sing])
(understand [sing])
(perform [sing])
You hum a few notes.
%% THROW AT
%% THROW
%% THROW
(rewrite [throw away | $Words] into [throw | $Words])
(understand [throw | $Words] as [throw $A at $B])
*(split $Words by [at on to in into onto] into $Left and $Right)
*(understand $Left as object $A preferably held)
*(understand $Right as single object $B)
(understand [throw | $Words] as [throw $Obj])
*(understand $Words as object $Obj preferably held)
(understand [throw | $Words] as [throw $Obj $Dir])
(last $Words $Last)
(parse direction [$Last] $Dir)
(reverse $Words [$ | $RevWords])
(reverse $RevWords $Left)
*(understand $Left as object $Obj preferably held)
(unlikely [throw $Obj | $])
(current player $Actor)
~($Obj has ancestor $Actor)
(perform [throw $Obj])
At what?
(asking for object in [throw $Obj at []])
(instead of [throw $Obj $Dir])
(current room $Here)
(if) (from $Here go $Dir to object $Target) (then)
(try [throw $Obj at $Target])
(else)
(try [throw $Obj])
(endif)
%% The target doesn't have to be reachable:
(refuse [throw $Obj at $Target])
(just)
{
(when $Obj is not here)
(or) (when $Target is not here)
(or) (when $Obj is out of reach)
}
(before [throw $Obj at $])
(current player $Actor)
($Obj has ancestor $Actor)
(ensure $Obj is held)
(prevent [throw $Obj at $])
~(current player $Obj)
(when $Obj isn't directly held)
(perform [throw $Obj at $Target])
Throwing (the $Obj) at (the $Target) would achieve little.
(tick) (stop)
%% THINK
(understand [think])
(perform [think])
That would be a good first step.
(line) \( Try HINT if you are desperate. \) (line)
%% SLEEP
(understand [sleep])
(understand [nap] as [sleep])
(understand [take nap] as [sleep])
(understand [take a nap] as [sleep])
(understand [fall asleep] as [sleep])
(understand [dream] as [sleep])
(perform [sleep])
You're not all that sleepy.
%% TAKE
%% TAKE FROM
(rewrite [pick up | $Words] into [take | $Words])
(rewrite [grab | $Words] into [take | $Words])
(rewrite [snatch | $Words] into [take | $Words])
(rewrite [steal | $Words] into [take | $Words])
(rewrite [acquire | $Words] into [take | $Words])
(rewrite [hold | $Words] into [take | $Words])
(rewrite [gather | $Words] into [take | $Words])
(understand [take | $Words] as [take $Obj from $Parent])
*(split $Words by [from] into $Left and $Right)
*(understand $Right as single object $Parent)
*(understand $Left as object $Obj preferably child of $Parent)
(understand [remove | $Words] as [take $Obj from $Parent])
*(split $Words by [from] into $Left and $Right)
*(understand $Right as single object $Parent)
*(understand $Left as object $Obj preferably child of $Parent)
(understand [take | $Words] as [take $Obj])
*(understand $Words as object $Obj preferably takable)
(understand [get | $Words] as [take $Obj from $Parent])
*(split $Words by [from] into $Left and $Right)
*(understand $Right as single object $Parent)
*(understand $Left as object $Obj preferably child of $Parent)
(understand [get | $Words] as [take $Obj])
*(understand $Words as object $Obj preferably takable)
(unlikely [take $Obj])
{ (current player $Actor) ($Obj is $Rel $Actor) ($Rel is one of [#heldby #wornby]) }
(or) ~(item $Obj)
(or) ($Obj has relation #partof)
(unlikely [take $Obj from $Parent])
~($Obj has ancestor $Parent)
(prevent [take $Obj from $Parent])
~($Obj has ancestor $Parent)
(if) (animate $Parent) (then)
(The $Parent) (does $Parent) not have (the $Obj).
(elseif) (container $Parent) (then)
(The $Obj) (isn't $Obj) in (the $Parent).
(elseif) (supporter $Parent) (then)
(The $Obj) (isn't $Obj) on (the $Parent).
(else)
That's not where (the $Obj) (is $Obj).
(endif)
(perform [take $Obj from $Parent])
(current player $Player)
($Obj is recursively worn by $Player)
{
($Parent = $Player)
(or)
($Parent has ancestor $Player)
}
(try [remove $Obj])
(perform [take $Obj from $])
(try [take $Obj])
(prevent [take $Obj])
(when $Obj is already held)
(or) (when $Obj is fine where it is)
(or) (when $Obj is part of something)
(or) (when $Obj can't be taken)
(narrate taking $Obj)
(current player $Actor)
You take (the $Obj)
(if) ($Obj is $Rel $Parent) ~($Actor has ancestor $Parent) (then)
(reverse-name $Rel) (the $Parent)
(endif)
.
(perform [take $Obj])
(narrate taking $Obj)
(current player $Actor)
(now) ($Obj is #heldby $Actor)
(now) ($Obj is handled)
%% REMOVE
(rewrite [doff | $Words] into [remove | $Words])
(rewrite [shed | $Words] into [remove | $Words])
(rewrite [loosen | $Words] into [remove | $Words])
(understand [take | $Words] as [remove $Obj])
*(split $Words by [off] into $Left and $Right)
{
($Left = [])
*(understand $Right as object $Obj preferably worn)
(or)
($Right = [])
*(understand $Left as object $Obj preferably worn)
}
(understand [remove | $Words] as [remove $Obj])
*(understand $Words as object $Obj preferably worn)
(understand [disrobe | $Words] as [remove $Obj])
*(understand $Words as object $Obj preferably worn)
(unlikely [remove $Obj])
(current player $Actor)
~($Obj is #wornby $Actor)
(instead of [remove $Obj])
~(wearable $Obj)
~($Obj has relation #partof)
(item $Obj)
(try [take $Obj])
(prevent [remove $Obj])
(when $Obj is part of something)
(prevent [remove $Obj])
(current player $Actor)
~($Obj is recursively worn by $Actor)
But you aren't wearing (the $Obj).
(narrate removing $Obj)
You take off (the $Obj).
(perform [remove $Obj])
(narrate removing $Obj)
(current player $Actor)
(now) ($Obj is #heldby $Actor)
(now) ($Obj is handled)
%% WEAR
(rewrite [don | $Words] into [wear | $Words])
(understand [wear | $Words] as [wear $Obj])
*(understand $Words as object $Obj preferably held)
(understand [put | $Words] as [wear $Obj])
*(split $Words by [on] into $Left and $Right)
{
($Left = [])
*(understand $Right as object $Obj preferably held)
(or)
($Right = [])
*(understand $Left as object $Obj preferably held)
}
(unlikely [wear $Obj])
~(wearable $Obj)
(unlikely [wear $Obj])
(current player $Actor)
($Obj is #wornby $Actor)
(before [wear $Obj])
(wearable $Obj)
(current player $Actor)
~($Obj is nested #wornby $Actor)
(ensure $Obj is held)
(prevent [wear $Obj])
(current player $Actor)
($Obj is recursively worn by $Actor)
You are already wearing (the $Obj).
(prevent [wear $Obj])
~(wearable $Obj)
(The $Obj) can't be worn.
(prevent [wear $Obj])
(when $Obj isn't directly held)
(narrate wearing $Obj)
You put on (the $Obj).
(perform [wear $Obj])
(narrate wearing $Obj)
(current player $Actor)
(now) ($Obj is #wornby $Actor)
(now) ($Obj is handled)
%% PUT
(rewrite [set down | $Words] into [put | $Words])
(rewrite [lay down | $Words] into [put | $Words])
(rewrite [lay | $Words] into [put | $Words])
(rewrite [put away | $Words] into [put | $Words])
(rewrite [put down | $Words] into [put | $Words])
(rewrite [drop | $Words] into [put | $Words])
(rewrite [drop down | $Words] into [put | $Words])
(rewrite [stash | $Words] into [hide | $Words])
(rewrite [stuff | $Words] into [hide | $Words])
(understand [put | $Words] as [put $Obj $Rel $Dest])
*(split $Words by relation $Rel into $Left and $Right)
*(understand $Right as single object $Dest)
*(understand $Left as object $Obj preferably held excluding $Dest)
(understand [hide | $Words] as [put $Obj $Rel $Dest])
*(split $Words by relation $Rel into $Left and $Right)
~($Rel = #on)
*(understand $Right as single object $Dest)
*(understand $Left as object $Obj preferably held excluding $Dest)
(understand [insert | $Words] as [put $Obj #in $Dest])
*(split $Words by [in inside into through] into $Left and $Right)
*(understand $Right as single object $Dest)
*(understand $Left as object $Obj preferably held excluding $Dest)
(unlikely [put $Obj $ $])
(current player $Actor)
~($Obj has ancestor $Actor)
(unlikely [put $ #on $Dest])
~(supporter $Dest)
(unlikely [put $ #in $Dest])
~(container $Dest)
(unlikely [put $Obj $ $Obj])
(unlikely [put $Obj $ $Dest])
($Dest has ancestor $Obj)
(before [put $Obj $Rel $Dest])
~($Obj is $Rel $Dest)
(ensure $Obj is held)
(before [put $ #in $Dest])
($Dest is closed)
(first try [open $Dest])
(instead of [put (current player $) #in $Dest])
(try [enter $Dest])
(instead of [put (current player $) #on $Dest])
(try [climb $Dest])
(instead of [put $Obj $Rel $Dest])
(current player $Player)
($Player is $Rel $Dest)
(try [drop $Obj])
(prevent [put $Obj $Rel $Dest])
(when $Obj is already $Rel $Dest)
(or) (when $Obj isn't directly held)
(prevent [put $Obj $Rel $Dest])
($Dest is nested $OldRel $Obj)
(The $Obj) can't be placed
(if) ~($OldRel is one of [#in #on]) (then)
(towards-name $Rel) something that's
(endif)
(present-name $OldRel) (itself $Obj).
(prevent [put $Obj $Rel $Obj])
You can't put (the $Obj) (towards-name $Rel) (itself $Obj).
(prevent [put $ $Rel $Dest])
(when $Dest won't accept $Rel)
(prevent [put $ #in $Dest])
(when $Dest is closed)
(narrate putting $Obj $Rel $Dest)
You put (the $Obj) (name $Rel) (the $Dest).
(perform [put $Obj $Rel $Dest])
(narrate putting $Obj $Rel $Dest)
(now) ($Obj is $Rel $Dest)
(now) ($Obj is handled)
%% DROP
(rewrite [let go of | $Words] into [put | $Words])
(understand [put | $Words] as [drop $Obj])
*(split $Words by [down] into $Left and [])
*(understand $Left as object $Obj preferably held)
(understand [put | $Words] as [drop $Obj])
*(understand $Words as object $Obj preferably held)
(unlikely [drop $Obj])
(current player $Actor)
~($Obj has ancestor $Actor)
(before [drop $Obj])
(current player $Actor)
($Obj has ancestor $Actor)
~($Obj has relation #partof)
(ensure $Obj is held)
(prevent [drop $Obj])
(when $Obj is part of something)
(or) (when $Obj isn't directly held)
(narrate dropping $Obj)
(current player $Actor)
($Actor is $Rel $Loc)
(The $Obj) fall(s $Obj)
(if) ($Rel = #on) (then)
onto (the $Loc).
(else)
to the ground.
(endif)
(perform [drop $Obj])
(narrate dropping $Obj)
(current player $Actor)
($Actor is $Rel $Loc)
(now) ($Obj is $Rel $Loc)
(now) ($Obj is handled)
%% INVENTORY
(understand [inventory])
(understand [i] as [inventory])
(understand [inv] as [inventory])
(understand [take inventory] as [inventory])
(understand [get inventory] as [inventory])
(describe action [inventory])
take inventory
(perform [inventory])
(current player $Actor)
(collect $C) *($C is #heldby $Actor) (into $HeldList)
(collect $C) *($C is #wornby $Actor) (into $WornList)
You have
(if) (empty $HeldList) (then)
no possessions
(else)
(a $HeldList)
(endif)
. You're
(if) (empty $WornList) (then)
not wearing anything
(else)
wearing (a $WornList)
(endif)
. (line)
%% EXITS
(understand [exits])
(understand [list exits] as [exits])
(understand [list the exits] as [exits])
(understand [map] as [exits])
(describe action [exits])
list the exits
(prevent [exits])
~(player can see)
You can't be sure of where the exits are in the darkness.
(perform [exits])
(current room $Room)
(if)
~{
*(from $Room go $Dir to $Target)
(direction $Dir)
{ (room $Target) (or) (door $Target) }
}
(then)
There are no obvious exits here.
(else)
Obvious exits are: (line)
(exhaust) {
*(from $Room go $Dir to $Target)
(direction $Dir)
(if) (door $Target) (then)
(Name $Dir)
through (a $Target)
(if) ($Target is closed) (then)
\(currently closed\)
(elseif)
(from $Room through $Target to $R)
($R is visited)
(then)
to
(if) (inherently dark $R) (then)
darkness
(else)
(the $R)
(endif)
(endif)
. (line)
(elseif) (room $Target) (then)
(Name $Dir)
(if) ($Target is visited) (then)
to
(if) (inherently dark $Target) (then)
darkness
(else)
(the $Target)
(endif)
(endif)
. (line)
(endif)
}
(endif)
%% EXIST (misspelled EXITS, just for the giggles)
(understand [exist])
(perform [exist])
So you do.
%% WAIT
(rewrite [z] into [wait])
(understand [wait])
(perform [wait])
A moment slips away.
%% GIVE TO
%% GIVE
(rewrite [offer | $Words] into [give | $Words])
(understand [give | $Words] as [give $Obj to $Dest])
*(split $Words by [to] into $Left and $Right)
*(understand $Right as single object $Dest preferably animate)
*(understand $Left as object $Obj preferably held excluding $Dest)
(understand [give | $Words] as [give $Obj to $Dest])
*(split $Words anywhere into $Left and $Right)
*(understand $Left as single object $Dest preferably animate)
*(understand $Right as object $Obj preferably held excluding $Dest)
(understand [give | $Words] as [give $Obj])
*(understand $Words as object $Obj preferably held)
(unlikely [give $Obj to $Obj])
(unlikely [give $Obj to $])
(current player $Player)
~($Obj has ancestor $Player)
(unlikely [give $ to $Dest])
~(animate $Dest)
(unlikely [give $])
(perform [give $Obj])
To whom?
(asking for object in [give $Obj to []])
(before [give $Obj to $])
(ensure $Obj is held)
(prevent [give $Obj to $])
(when $Obj isn't directly held)
(perform [give $ to $Dest])
(if) (animate $Dest) (then)
(The $Dest) (doesn't $Dest) appear to be interested.
(else)
Giving things to (the $Dest) doesn't appear to work.
(endif)
(tick) (stop)
%% SHOW TO
%% SHOW
(understand [show | $Words] as [show $Obj to $Dest])
*(split $Words by [to] into $Left and $Right)
*(understand $Right as single object $Dest preferably animate)
*(understand $Left as object $Obj preferably held excluding $Dest)
(understand [show | $Words] as [show $Obj to $Dest])
*(split $Words anywhere into $Left and $Right)
*(understand $Left as single object $Dest preferably animate)
*(understand $Right as object $Obj preferably held excluding $Dest)
(understand [show | $Words] as [show $Obj])
*(understand $Words as object $Obj preferably held)
(unlikely [show $Obj to $Obj])
(unlikely [show $Obj to $])
(item $Obj)
(current player $Actor)
~($Obj is nested #heldby $Actor)
(unlikely [show $ to $Dest])
~(animate $Dest)
(unlikely [show $])
(refuse [show $Obj to $Person])
(just)
{
(when $Obj is not here)
(or) (when $Person is not here)
(or) (when $Obj is out of reach)
}
(perform [show $Obj])
To whom?
(asking for object in [show $Obj to []])
(before [show $Obj to $])
(item $Obj)
(ensure $Obj is held)
(prevent [show $Obj to $])
(item $Obj)
(when $Obj isn't directly held)
(perform [show $ to $Dest])
(if) (animate $Dest) (then)
(The $Dest) (doesn't $Dest) appear to be interested.
(else)
Showing things to (the $Dest) has no effect.
(endif)
(tick) (stop)
%% OPEN
(rewrite [unwrap | $Words] as [open | $Words])
(rewrite [uncover | $Words] as [open | $Words])
(understand [open | $Words] as [open $Obj])
*(understand $Words as non-all object $Obj)
(unlikely [open $Obj])
~(openable $Obj) (or) ($Obj is open)
(before [open $Obj])
($Obj is closed)
($Obj is locked)
(current player $Player)
*($Key is nested #heldby $Player)
($Key unlocks $Obj)
~($Key is hidden)
(first try [unlock $Obj with $Key])
(prevent [open $Obj])
~(openable $Obj)
(The $Obj) (doesn't $Obj) open.
(prevent [open (openable $Obj)])
($Obj is open)
(The $Obj is) already open.
(prevent [open $Obj])
($Obj is locked)
(The $Obj is) locked.
(narrate opening $Obj)
You open (the $Obj)
(collect $Child)
*($Child is #in $Obj)
(reveal $Child)
(into $List)
(if) (nonempty $List) (then)
, revealing (a $List)
(notice $List)
(endif)
.
(perform [open $Obj])
(narrate opening $Obj)
(now) ($Obj is open)
%% CLOSE
(rewrite [shut | $Words] into [close | $Words])
(rewrite [cover | $Words] as [close | $Words])
(understand [close | $Words] as [close $Obj])
*(understand $Words as non-all object $Obj)
(unlikely [close $Obj])
~(openable $Obj) (or) ($Obj is closed)
(prevent [close $Obj])
~(openable $Obj)
(The $Obj) can't be closed.
(prevent [close $Obj])
($Obj is closed)
(The $Obj is) already closed.
(narrate closing $Obj)
You close (the $Obj).
(perform [close $Obj])
(narrate closing $Obj)
(now) ($Obj is closed)
%% UNLOCK WITH
%% UNLOCK
(understand [unlock | $Words] as [unlock $Obj with $Key])
*(split $Words by [with] into $Left and $Right)
*(understand $Left as non-all object $Obj)
*(understand $Right as single object $Key preferably held)
(understand [unlock | $Words] as [unlock $Obj])
*(understand $Words as non-all object $Obj)
(unlikely [unlock $Obj | $])
~(lockable $Obj) (or) ($Obj is unlocked)
(before [unlock $ with $Key])
(ensure $Key is held)
(instead of [unlock $Obj])
(current player $Player)
*($Key is nested #heldby $Player)
($Key unlocks $Obj)
~($Key is hidden)
(line) \(with (the $Key)\) (line)
(try [unlock $Obj with $Key])
(prevent [unlock $Obj | $])
~(lockable $Obj)
(The $Obj) can't be unlocked.
(prevent [unlock (lockable $Obj) | $])
($Obj is unlocked)
(The $Obj is) already unlocked.
(perform [unlock $Obj])
With what?
(asking for object in [unlock $Obj with []])
(prevent [unlock $Obj with $Key])
~($Key unlocks $Obj)
You fail to unlock (the $Obj) with (the $Key).
(narrate unlocking $Obj with $Key)
You unlock (the $Obj) with (the $Key).
(perform [unlock $Obj with $Key])
(narrate unlocking $Obj with $Key)
(now) ($Obj is unlocked)
%% LOCK WITH
%% LOCK
(understand [lock | $Words] as [lock $Obj with $Key])
*(split $Words by [with] into $Left and $Right)
*(understand $Left as non-all object $Obj)
*(understand $Right as single object $Key preferably held)
(understand [lock | $Words] as [lock $Obj])
*(understand $Words as non-all object $Obj)
(unlikely [lock $Obj | $])
~(lockable $Obj)
(or) ($Obj is locked)
(before [lock $ with $Key])
(ensure $Key is held)
(instead of [lock $Obj])
(current player $Player)
*($Key is nested #heldby $Player)
($Key unlocks $Obj)
~($Key is hidden)
(line) \(with (the $Key)\) (line)
(try [lock $Obj with $Key])
(prevent [lock $Obj | $])
~(lockable $Obj)
(The $Obj) can't be locked.
(prevent [lock (lockable $Obj) | $])
($Obj is locked)
(The $Obj is) already locked.
(perform [lock $Obj])
With what?
(asking for object in [lock $Obj with []])
(prevent [lock $Obj with $Key])
~($Key unlocks $Obj)
You fail to lock (the $Obj) with (the $Key).
(narrate locking $Obj with $Key)
You lock (the $Obj) with (the $Key).
(perform [lock $Obj with $Key])
(narrate locking $Obj with $Key)
(now) ($Obj is locked)
%% SWITCH ON
(understand [turn | $Words] as [switch on $Obj])
*(split $Words by [on] into $Left and $Right)
{
($Left = [])
*(understand $Right as non-all object $Obj)
(or)
($Right = [])
*(understand $Left as non-all object $Obj)
}
(understand [switch | $Words] as [switch on $Obj])
*(split $Words by [on] into $Left and $Right)
{
($Left = [])
*(understand $Right as non-all object $Obj)
(or)
($Right = [])
*(understand $Left as non-all object $Obj)
}
(understand [switch | $Words] as [switch on $Obj])
*(understand $Words as single object $Obj)
(switchable $Obj)
($Obj is off)
(unlikely [switch on $Obj])
~(switchable $Obj) (or) ($Obj is on)
(describe action [switch on $Obj])
switch (the full $Obj) on
(prevent [switch on $Obj])
~(switchable $Obj)
(The $Obj) can't be switched on.
(prevent [switch on $Obj])
($Obj is on)
(The $Obj) is already on.
(narrate switching on $Obj)
You switch (the $Obj) on.
(perform [switch on $Obj])
(narrate switching on $Obj)
(now) ($Obj is on)
%% SWITCH OFF
(understand [turn | $Words] as [switch off $Obj])
*(split $Words by [off] into $Left and $Right)
{
($Left = [])
*(understand $Right as non-all object $Obj)
(or)
($Right = [])
*(understand $Left as non-all object $Obj)
}
(understand [switch | $Words] as [switch off $Obj])
*(split $Words by [off] into $Left and $Right)
{
($Left = [])
*(understand $Right as non-all object $Obj)
(or)
($Right = [])
*(understand $Left as non-all object $Obj)
}
(understand [switch | $Words] as [switch off $Obj])
*(understand $Words as single object $Obj)
(switchable $Obj)
($Obj is on)
(unlikely [switch off $Obj])
~(switchable $Obj) (or) ($Obj is off)
(describe action [switch off $Obj])
switch (the full $Obj) off
(prevent [switch off $Obj])
($Obj is off)
(The $Obj) is already off.
(prevent [switch off $Obj])
~(switchable $Obj)
(The $Obj) can't be turned off.
(narrate switching off $Obj)
You switch (the $Obj) off.
(perform [switch off $Obj])
(narrate switching off $Obj)
(now) ($Obj is off)
%% SQUEEZE
(rewrite [squash | $Words] into [squeeze | $Words])
(understand [squeeze | $Words] as [squeeze $Obj])
*(understand $Words as non-all object $Obj)
(perform [squeeze $Obj])
You give (the $Obj) a bit of a squeeze.
%% FIX
(rewrite [repair | $Words] into [fix | $Words])
(rewrite [mend | $Words] into [fix | $Words])
(understand [fix | $Words] as [fix $Obj])
*(understand $Words as non-all object $Obj)
(unlikely [fix $Obj])
($Obj is in order)
(prevent [fix $Obj])
($Obj is in order)
You can't find anything wrong with (the $Obj).
(perform [fix $Obj])
You don't know how to repair (the $Obj).
(tick) (stop)
%% TASTE
(rewrite [lick | $Words] into [taste | $Words])
(rewrite [relish | $Words] into [taste | $Words])
(rewrite [savour | $Words] into [taste | $Words])
(understand [taste | $Words] as [taste $Obj])
*(understand $Words as non-all object $Obj)
(unlikely [taste $Obj])
~(edible $Obj)
~(potable $Obj)
(prevent [taste $Obj])
~(edible $Obj)
~(potable $Obj)
Don't be gross.
(perform [taste $Obj])
You savour the taste of (the $Obj).
%% FLY
(understand [fly])
(perform [fly])
You lack the ability.
%% BITE
(rewrite [chew | $Words] into [bite | $Words])
(rewrite [gnaw at | $Words] into [bite | $Words])
(rewrite [gnaw | $Words] into [bite | $Words])
(understand [bite | $Words] as [bite $Obj])
*(understand $Words as single object $Obj)
(perform [bite (animate $Obj)])
(try [attack $Obj])
(perform [bite $Obj])
(try [eat $Obj])
%% EAT
(rewrite [devour | $Words] into [eat | $Words])
(rewrite [ingest | $Words] into [eat | $Words])
(rewrite [munch | $Words] into [eat | $Words])
(rewrite [swallow | $Words] into [eat | $Words])
(understand [eat | $Words] as [eat $Obj])
*(understand $Words as non-all object $Obj)
(unlikely [eat $Obj])
~(edible $Obj)
~(potable $Obj)
(before [eat $Obj])
(item $Obj)
(ensure $Obj is held)
(instead of [eat $Obj])
~(edible $Obj)
(potable $Obj)
(try [drink $Obj])
(prevent [eat $Obj])
(current player $Player)
{
($Obj = $Player)
(or)
($Obj is part of $Player)
}
Cannibalism isn't the answer to this one.
(prevent [eat $Obj])
~(edible $Obj)
(The $Obj) (isn't $Obj) edible.
(prevent [eat $Obj])
(item $Obj)
(when $Obj isn't directly held)
(narrate eating $Obj)
You eat (the $Obj).
(perform [eat $Obj])
(narrate eating $Obj)
(now) ($Obj is nowhere)
(now) ($Obj is handled)
%% DRINK
(rewrite [sip | $Words] into [drink | $Words])
(rewrite [quaff | $Words] into [drink | $Words])
(understand [drink | $Words] as [drink $Obj])
*(understand $Words as non-all object $Obj)
(unlikely [drink $Obj])
~(potable $Obj)
(before [drink $Obj])
(item $Obj)
(ensure $Obj is held)
(prevent [drink $Obj])
~(potable $Obj)
You can't drink (the $Obj).
(prevent [drink $Obj])
(item $Obj)
(when $Obj isn't directly held)
(perform [drink $Obj])
You take a sip from (the $Obj).
%% CUT WITH
%% CUT
(rewrite [sever | $Words] into [cut | $Words])
(rewrite [slice | $Words] into [cut | $Words])
(rewrite [prune | $Words] into [cut | $Words])
(rewrite [chop | $Words] into [cut | $Words])
(rewrite [cut off | $Words] into [cut | $Words])
(rewrite [chop off | $Words] into [cut | $Words])
(understand [cut | $Words] as [cut $A with $B])
*(split $Words by [with] into $Left and $Right)
*(understand $Left as non-all object $A)
*(understand $Right as single object $B)
(understand [cut | $Words] as [cut $Obj])
*(understand $Words as non-all object $Obj)
(understand [cut | $Words] as [cut $Obj])
*(split $Words by [off] into $Left and [])
*(understand $Left as non-all object $Obj)
(unlikely [cut $ with $Obj])
~(sharp $Obj)
(perform [cut $Obj])
With what?
(asking for object in [cut $Obj with []])
(prevent [cut $ with $Obj])
~(sharp $Obj)
(The $Obj is) too blunt for that. %% Funny when Obj is the player.
(perform [cut $Obj with $])
You consider cutting
(if) ($Obj is part of $Player) (current player $Player) (then)
off
(endif)
(the $Obj), but reject the idea.
%% USE
(understand [use | $Words] as $Action)
*(understand $Words as single object $Obj)
(if)
(implicit action is $Implicit)
~(implicit action wants direction)
(then)
(recover implicit action $Implicit $Obj into $Action)
(else)
($Action = [use $Obj])
(endif)
(instead of [use (door $Door)])
(try [enter $Door])
(perform [use $])
How? Please be more specific.
(stop)
%% CONSULT ABOUT
(understand [consult | $Words] as [consult $Obj about $Topic])
*(split $Words by [about] into $Left and $Right)
*(understand $Left as single object $Obj)
*(understand $Right as topic $Topic)
(understand [look up | $Words] as [consult $Obj about $Topic])
*(split $Words by [in] into $Left and $Right)
*(understand $Right as single object $Obj)
*(understand $Left as topic $Topic)
(describe action [consult $Obj about $Topic])
consult (the full $Obj) about (describe topic $Topic)
(refuse [consult $Obj about $])
(just) {
(when $Obj is not here)
(or) (when $Obj is out of reach)
}
(prevent [consult $Obj about $])
~(consultable $Obj)
You can't look things up in (the $Obj).
(perform [consult $Obj about $Topic])
You find no information about (describe topic $Topic) in (the $Obj).
%% ASK/TELL ABOUT (redirected to TALK TO by default)
(understand [ask | $Words] as [ask $Person about $Topic])
*(split $Words by [about] into $Left and $Right)
*(understand $Left as single object $Person preferably animate)
*(understand $Right as topic $Topic)
(understand [tell | $Words] as [tell $Person about $Topic])
*(split $Words by [about] into $Left and $Right)
*(understand $Left as single object $Person preferably animate)
*(understand $Right as topic $Topic)
(describe action [ask $Person about $Topic])
ask (the full $Person) about (describe topic $Topic)
(describe action [tell $Person about $Topic])
tell (the full $Person) about (describe topic $Topic)
(understand [ask | $Words] as [ask $Obj])
*(understand $Words as single object $Obj preferably animate)
(understand [tell | $Words] as [tell $Obj])
*(understand $Words as single object $Obj preferably animate)
(describe action [ask $Person])
ask (the full $Person) something
(describe action [tell $Person])
tell (the full $Person) something
%% Don't require reachability:
(refuse [ask $Obj | $])
(just) (when $Obj is not here)
(refuse [tell $Obj about $])
(just) (when $Obj is not here)
(refuse [tell $Obj])
(just) (when $Obj is not here)
(perform [ask $Person about $])
(try [talk to $Person])
(perform [tell $Person about $])
(try [talk to $Person])
(perform [ask $Obj])
(try [talk to $Obj])
(perform [tell $Obj])
(try [talk to $Obj])
%% TALK TO
%% TALK
(rewrite [talk to | $Words] into [talk | $Words])
(rewrite [speak to | $Words] into [talk | $Words])
(rewrite [speak | $Words] into [talk | $Words])
(understand [talk | $Words] as [talk to $Obj])
*(understand $Words as single object $Obj preferably animate)
(understand [talk])
(unlikely [talk to $Obj])
~(animate $Obj)
(perform [talk])
To whom?
(asking for object in [talk to []])
%% Don't require reachability:
(refuse [talk to $Obj])
(just) (when $Obj is not here)
(perform [talk to (current player $)])
You mumble a few well-chosen words to yourself.
(perform [talk to $])
There is no reply.
%% CURSE
(understand [curse])
(understand [swear] as [curse])
(perform [curse])
You mumble a few well-chosen words to yourself.
%% SHOUT TO (redirected to TALK TO by default)
%% SHOUT (redirected to TALK by default)
(rewrite [yell | $Words] into [shout | $Words])
(rewrite [scream | $Words] into [shout | $Words])
(understand [shout to | $Words] as [shout to $Obj])
*(understand $Words as single object $Obj preferably animate)
(unlikely [shout to $Obj])
~(animate $Obj)
(refuse [shout to $Obj])
(just) (when $Obj is not here)
(perform [shout to $Obj])
(try [talk to $Obj])
(understand [shout])
(perform [shout])
To whom?
(asking for object in [shout to []])
%% PRAY
(understand [pray])
(perform [pray])
There is no answer.
%% SHRUG
(understand [shrug])
(perform [shrug])
You shrug indifferently.
%% CALL (redirected to SHOUT TO by default)
%% CALL (redirected to SHOUT by default)
%% Stories containing a phone would override these.
(rewrite [call to | $Words] into [call | $Words])
(understand [call | $Words] as [call $Obj])
*(understand $Words as single object $Obj preferably animate)
(unlikely [call $Obj])
~(animate $Obj)
(refuse [call $Obj])
(just) (when $Obj is not here)
(perform [call $Obj])
(try [shout to $Obj])
(understand [call])
(perform [call])
(try [shout])
%% GREET (redirected to TALK TO by default)
%% GREET
(rewrite [hello | $Words] into [greet | $Words])
(rewrite [hi | $Words] into [greet | $Words])
(understand [greet | $Words] as [greet $Obj])
*(understand $Words as single object $Obj preferably animate)
(unlikely [greet $Obj])
~(animate $Obj)
(refuse [greet $Obj])
(just) (when $Obj is not here)
(perform [greet $Obj])
(try [talk to $Obj])
(understand [greet])
(perform [greet])
You say hello to nobody in particular.
%% TELL TO |
(understand [tell | $Words] as [tell $Actor to | $Action])
*(split $Words by [, to] into $Left and $Right)
*(understand $Left as single object $Actor preferably animate)
(rewrite $Right into $Simplified)
*(understand $Simplified as $Action)
(understand [ask | $Words] as [tell $Actor to | $Action])
*(split $Words by [, to] into $Left and $Right)
*(understand $Left as single object $Actor preferably animate)
(rewrite $Right into $Simplified)
*(understand $Simplified as $Action)
(understand [ask | $Words] as [tell $Actor to give $Obj to $Player])
*(split $Words by [for] into $Left and $Right)
*(understand $Left as single object $Actor preferably animate)
*(understand $Right as object $Obj preferably child of $Actor)
(current player $Player)
%% The rule for "name comma action" is further down in the file.
(unlikely [tell $Addressee to | $])
~(animate $Addressee)
(describe action [tell $Actor to give $Obj to (current player $)])
ask (the full $Actor) for (the full $Obj)
(describe action [tell $Actor to | $Action])
tell (the full $Actor) to (describe action $Action)
(refuse [tell $NPC to | $])
(just) (when $NPC is not here)
(instead of [tell $NPC to greet])
(try [greet $NPC])
(perform [tell $Actor to | $])
(if) (animate $Actor) (then)
(The $Actor) refuse(s $Actor).
(else)
(The $Actor) (doesn't $Actor) take orders.
(endif)
%% SMELL
(rewrite [sniff | $Words] into [smell | $Words])
(rewrite [inhale | $Words] into [smell | $Words])
(understand [smell | $Words] as [smell $Obj])
*(understand $Words as non-all object $Obj)
(refuse [smell $Obj])
(just) (when $Obj is not here)
(perform [smell $Obj])
(The $Obj) smell(s $Obj) as expected.
(understand [smell])
(perform [smell])
You sniff at the air, perceiving nothing out of the ordinary.
%% WAKE UP
(rewrite [awake | $Words] into [wake | $Words])
(rewrite [awaken | $Words] into [wake | $Words])
(understand [wake up])
(understand [wake] as [wake up])
(understand [pinch | $Words] as [wake up])
*(understand $Words as single object $Obj)
(current player $Player)
{
($Obj = $Player)
(or)
($Obj is part of $Player)
}
(perform [wake up])
You try to will yourself to wake up, but nothing obvious happens.
%% CLIMB
(rewrite [get up on | $Words] into [climb | $Words])
(rewrite [get up onto | $Words] into [climb | $Words])
(rewrite [get onto | $Words] into [climb | $Words])
(rewrite [get on | $Words] into [climb | $Words])
(rewrite [stand on | $Words] into [climb | $Words])
(rewrite [sit on top of | $Words] into [climb | $Words])
(rewrite [sit on | $Words] into [climb | $Words])
(rewrite [lie on | $Words] into [climb | $Words])
(rewrite [lie down on | $Words] into [climb | $Words])
(rewrite [go up on | $Words] into [climb | $Words])
(rewrite [go up onto | $Words] into [climb | $Words])
(rewrite [go onto | $Words] into [climb | $Words])
(rewrite [go on | $Words] into [climb | $Words])
(rewrite [step on | $Words] into [climb | $Words])
(rewrite [step onto | $Words] into [climb | $Words])
(rewrite [climb up on | $Words] into [climb | $Words])
(rewrite [climb up onto | $Words] into [climb | $Words])
(rewrite [climb onto | $Words] into [climb | $Words])
(rewrite [climb on | $Words] into [climb | $Words])
(rewrite [jump to | $Words] into [climb | $Words])
(rewrite [mount | $Words] into [climb | $Words])
(rewrite [scale | $Words] into [climb | $Words])
(understand [climb | $Words] as [climb $Obj])
*(understand $Words as single object $Obj preferably supporter)
(unlikely [climb $Obj])
~(actor supporter $Obj)
(unlikely [climb $Obj])
(current player $Actor)
($Obj has ancestor $Actor)
(unlikely [climb $Obj])
(current player $Actor)
($Actor is nested #on $Obj)
(describe action [climb $Obj])
get onto (the full $Obj)
(instead of [climb (room $Room)])
~(actor supporter $Room)
(try [go #up])
(instead of [climb (actor container $Obj)])
~(actor supporter $Obj)
(seat $Obj)
(try [enter $Obj])
(prevent [climb $Obj])
(current player $Actor)
{
(when $Actor is already #on $Obj)
(or) (when $Obj won't accept actor #on)
}
(prevent [climb $Dest])
(current player $Actor)
($Dest is nested $OldRel $Actor)
You can't get onto something that's (present-name $OldRel) yourself.
(narrate climbing $Obj)
You get onto (the $Obj).
(perform [climb $Obj])
(narrate climbing $Obj)
(current player $Actor)
(now) ($Actor is #on $Obj)
%% ENTER
(rewrite [get in | $Words] into [enter | $Words])
(rewrite [get into | $Words] into [enter | $Words])
(rewrite [get inside | $Words] into [enter | $Words])
(rewrite [go in | $Words] into [enter | $Words])
(rewrite [go into | $Words] into [enter | $Words])
(rewrite [go inside | $Words] into [enter | $Words])
(rewrite [sit in | $Words] into [enter | $Words])
(rewrite [sit inside | $Words] into [enter | $Words])
(rewrite [lie in | $Words] into [enter | $Words])
(rewrite [enter in | $Words] into [enter | $Words])
(rewrite [enter into | $Words] into [enter | $Words])
(rewrite [climb in | $Words] into [enter | $Words])
(rewrite [climb into | $Words] into [enter | $Words])
(rewrite [climb inside | $Words] into [enter | $Words])
(rewrite [cross | $Words] into [enter | $Words])
(rewrite [jump into | $Words] into [enter | $Words])
(understand [enter | $Words] as [enter $Obj])
*(understand $Words as single object $Obj preferably container)
(understand [go | $Words] as [enter $Obj])
*(understand $Words as single object $Obj)
{ (door $Obj) (or) ~(room $Obj) (actor container $Obj) }
(unlikely [enter $Obj])
~(actor container $Obj)
~(door $Obj)
(unlikely [enter $Obj])
(current player $Actor)
($Obj has ancestor $Actor)
(unlikely [enter $Obj])
(current player $Actor)
($Actor is nested #in $Obj)
(describe action [enter $Obj])
get into (the full $Obj)
~(refuse [enter (room $)])
(instead of [enter (room $Room)])
(current room $Here)
~($Here = $Room)
(if)
(from $Here go $Dir to $Room)
(or)
(from $Here through $Door to $Room)
(from $Here go $Dir to $Door)
(then)
(direction $Dir) %% Assure the compiler that $Dir is bound.
(try [go $Dir])
(else)
(The $Room) isn't here.
(tick) (stop)
(endif)
(instead of [enter (door $Obj)])
(current room $Room)
(from $Room go $Dir to $Obj)
(direction $Dir) %% Assure the compiler that $Dir is bound.
(try [go $Dir])
(instead of [enter (wearable $Obj)])
(try [wear $Obj])
(instead of [enter (actor supporter $Obj)])
~(actor container $Obj)
(seat $Obj)
(try [climb $Obj])
(prevent [enter $Obj])
(current player $Actor)
{
(when $Actor is already #in $Obj)
(or) (prevent entering $Obj)
}
(prevent [enter $Dest])
(current player $Actor)
($Dest is nested $OldRel $Actor)
You can't get into something that's (present-name $OldRel) yourself.
(perform [enter $Obj])
(narrate entering $Obj)
(current player $Actor)
(now) ($Actor is #in $Obj)
%% SIT
(understand [sit])
(unlikely [sit])
(perform [sit])
On what?
(asking for object in [climb []])
%% STAND
(rewrite [stand up] into [stand])
(understand [stand])
(describe action [stand])
stand up
(instead of [stand])
(current player $Player)
($Player has parent $Obj)
~(room $Obj)
(try [leave $Obj])
(perform [stand])
You're already standing up.
(tick) (stop)
%% LEAVE
%% LEAVE
(rewrite [exit | $Words] into [leave | $Words])
(understand [leave | $Words] as [leave $Obj])
*(understand $Words as single object $Obj)
(understand [get out of | $Words] as [leave $Obj])
*(understand $Words as single object $Obj preferably container)
(understand [get off of | $Words] as [leave $Obj])
*(understand $Words as single object $Obj preferably supporter)
(understand [get off | $Words] as [leave $Obj])
*(understand $Words as single object $Obj preferably supporter)
(understand [jump off | $Words] as [leave $Obj])
*(understand $Words as single object $Obj preferably supporter)
(understand [leave])
(understand [get out] as [leave])
(understand [get off] as [leave])
(understand [jump off] as [leave])
(current player $Player)
($Player has relation #on)
(describe action [leave $Obj])
(current player $Player)
($Player is $Rel $Obj)
get (reverse-name $Rel) (the $Obj)
(describe action [leave])
(current player $Player)
($Player is $Rel $Obj)
~(room $Obj)
get (reverse-name $Rel) (the $Obj)
(unlikely [leave $Obj])
(current player $Actor)
~{
($Actor has ancestor $Obj)
(or)
($Obj is nested #wornby $Actor)
}
(refuse [leave (room $Room)])
~(current room $Room)
But you aren't in (the $Room).
(perform [leave])
(current player $Player)
($Player has parent $Obj)
(if) (room $Obj) (then)
(try [go #out])
(else)
(try [leave $Obj])
(endif)
(before [leave $Obj])
(current player $Actor)
($Actor has ancestor $Obj)
(recursively leave descendants of $Obj)
(instead of [leave $Obj])
(current player $Actor)
($Obj is nested #wornby $Actor)
(try [remove $Obj])
(instead of [leave (current room $)])
(try [go #out])
(prevent [leave $Obj])
(current player $Player)
~($Player has parent $Obj)
You're not
(if) (supporter $Obj) (then)
(if) (container $Obj) (then)
in or
(endif)
on top of
(else)
inside
(endif)
(the $Obj).
(narrate leaving $Obj)
You
(current player $Player)
(if) ($Player is $Rel $Obj) (then)
get (reverse-name $Rel)
(else)
leave
(endif)
(the $Obj).
(perform [leave $Obj])
(narrate leaving $Obj)
(current player $Player)
($Obj is $NewRel $NewObj)
(now) ($Player is $NewRel $NewObj)
%% GO TO
%% It is only possible to go to visited rooms and non-hidden objects in this
%% way.
(rewrite [go to | $Words] into [go | $Words])
(rewrite [approach | $Words] into [go | $Words])
(understand [go | $Words] as [go to $Room])
(filter $Words into $Filtered)
(nonempty $Filtered)
*(room $Room)
($Room is visited)
(collect words)
*(dict $Room)
(and check $Filtered)
(unlikely [go to (current room $)])
~(refuse [go to $])
(perform [go to $Room])
(current room $Here)
(if) ($Here = $Room) (then)
You are already in (the $Room).
(tick) (stop)
(elseif) (shortest path from $Here to $Room is $Path) (then)
(exhaust) {
*($Dir is one of $Path)
(line) \( attempting to go (name $Dir) \) (line)
(try [go $Dir])
(tick)
(par)
}
(inhibit next tick)
(else)
You don't know how to get to (the $Room) from here.
(tick) (stop)
(endif)
%% FIND
%% FIND takes the player to the room that currently contains the object.
%% For objects that move around autonomously, it may be a good idea to override
%% this rule, to say e.g. "you don't know where the cat might be right now".
%% Note that floating objects, including doors, will remain in the room where
%% they were last encountered. This will usually put the player on the expected
%% side of doors.
(rewrite [look for | $Words] into [find | $Words])
(understand [find | $Words] as [find $Obj])
{
(filter $Words into $Filtered)
(nonempty $Filtered)
*(room $Room)
($Room is visited)
*($Obj has ancestor $Room)
~($Obj is in scope) %% Prevent double matches due to next branch.
~($Obj is hidden)
(collect words)
*(dict $Obj)
(and check $Filtered)
(or)
%% The purpose of this branch is to support pronouns, as well
%% as not-here objects that are in scope.
*(understand $Words as single object $Obj)
~(room $Obj)
}
(unlikely [find $Obj])
($Obj is nowhere)
~(refuse [find $])
(prevent [find $Obj])
(when $Obj is already held)
(prevent [find $Obj])
($Obj is in room $Room)
(current room $Room)
(The $Obj) (is $Obj)
(if) ($Obj is $Rel $Loc) ~(room $Loc) (then)
(name $Rel) (the $Loc)
(else)
here
(endif)
.
(prevent [find $Obj])
($Obj is in room $Room)
(current room $Here)
~(shortest path from $Here to $Room is $)
You don't know how to get to (the $Obj) from here.
(perform [find $Obj])
(if) ($Obj is in room $Room) (then)
(line) \( attempting to go to (the $Room) \) (line)
(try [go to $Room])
(else)
You don't know where to find (the $Obj).
(endif)
%% Navigation by direction:
%% What the player types is eventually translated into one of:
%% [leave $Room $Dir]
%% [leave $Room $Dir by $Vehicle]
%% [leave $Room $Dir with $Obj]
%% These are generally the ones to override/extend.
%% The default rules for the aforementioned actions invoke '(prevent entering
%% $Room)' and '(narrate entering $Room)'. These predicates can of course also
%% be overridden. Thus, entering a room is not an action of its own, but is
%% an inherent part of leaving a room.
%% GO
(rewrite [go further | $Words] into [go | $Words])
(rewrite [crawl | $Words] into [go | $Words])
(rewrite [walk | $Words] into [go | $Words])
%% The rule for just typing a list of directions (without a verb) is further
%% down in the file.
(understand [go | $Words] as [go $Dir])
*(understand $Words as direction $Dir)
(understand [leave | $Words] as [go $Dir])
*(understand $Words as direction $Dir)
(understand [get | $Words] as [go $Dir])
*(understand $Words as direction $Dir)
(understand [climb | $Words] as [go $Dir])
*(understand $Words as direction $Dir)
(understand [go] as [go #out])
(understand [enter] as [go #in])
(understand [climb] as [go $Dir])
(current room $Room)
*($Dir is one of [#up #down])
(from $Room go $Dir to $)
(unlikely-complex [go $DirList])
(just)
(if) (direction $DirList) (then)
($Dir = $DirList)
(else)
%% Only consider the first direction in the list.
([+ $Dir | $] = $DirList)
(endif)
(current room $Room)
~{
(from $Room go $Dir to $Target)
{ (room $Target) (or) (door $Target) (or) (direction $Target) }
}
(before [go $Dir])
(current player $Actor)
~{ ($Dir = #down) ($Actor has relation #on) }
~{ ($Dir = #out) ($Actor has relation #in) }
~{ ($Dir = #up) ($Actor has parent $Parent) (seat $Parent) }
(recursively leave non-vehicles)
(before [go $Dir])
(current player $Actor)
~{ ($Dir = #down) ($Actor has relation #on) }
~{ ($Dir = #out) ($Actor has relation #in) }
(current room $Room)
(from $Room go $Dir to $Target)
(door $Target)
($Target is closed)
(first try [open $Target])
(instead of [go #up])
(current player $Player)
($Player has parent $Obj)
(seat $Obj)
(try [leave $Obj])
(instead of [go #down])
(current player $Actor)
($Actor is #on $Obj)
(try [leave $Obj])
(instead of [go #out])
(current player $Actor)
($Actor is #in $Obj)
~(room $Obj)
(try [leave $Obj])
(prevent [go $])
(current player $Actor)
($Actor is $Rel $Obj)
~(room $Obj)
~(vehicle $Obj)
(when $Actor is $Rel $Obj)
(perform [go $Dir])
(current player $Actor)
(current room $Room)
(if) ($Actor has parent $Room) (then)
(try [leave $Room $Dir])
(else)
($Actor has parent $Vehicle)
(try [leave $Room $Dir by $Vehicle])
(endif)
%% PUSH
(rewrite [move | $Words] into [push | $Words])
(rewrite [shove | $Words] into [push | $Words])
(rewrite [shift | $Words] into [push | $Words])
(rewrite [press | $Words] into [push | $Words])
(understand [push | $Words] as [push $Obj $Dir])
*(split $Words anywhere into $Left and $Right)
*(understand $Right as direction $Dir)
*(understand $Left as single object $Obj)
(unlikely [push $Obj $])
~(pushable $Obj)
(before [push $ $])
(recursively leave non-vehicles)
(before [push $ $Dir])
(current room $Room)
(from $Room go $Dir to $Target)
(door $Target)
($Target is closed)
(first try [open $Target])
(prevent [push $Obj $])
~(pushable $Obj)
(The $Obj) can't be pushed from place to place.
(prevent [push $ $])
(current player $Actor)
($Actor is $Rel $Obj)
~{ ($Rel = #in) (room $Obj) }
(when $Actor is $Rel $Obj)
(perform [push $Obj $Dir])
(current room $Room)
(try [leave $Room $Dir with $Obj])
%% PUSH
(understand [push | $Words] as [push $Obj])
*(understand $Words as non-all object $Obj)
(perform [push (pushable $Obj)])
In what direction?
(asking for direction in [push $Obj []])
(perform [push (room $)])
Pushing on your surroundings has no effect.
(perform [push (item $Obj)])
You give (the $Obj) a bit of a push.
(perform [push $Obj])
You apply a bit of force to (the $Obj), but (it $Obj) (doesn't $Obj) budge.
%% PULL
(rewrite [yank | $Words] into [pull | $Words])
(rewrite [drag | $Words] into [pull | $Words])
(rewrite [tug | $Words] into [pull | $Words])
(rewrite [tow | $Words] into [pull | $Words])
(rewrite [pull on | $Words] into [pull | $Words])
(understand [pull | $Words] as [pull $Obj])
*(understand $Words as non-all object $Obj)
(perform [pull $Obj])
You yank at (the $Obj), but
(if) (item $Obj) (then)
nothing noteworthy happens.
(else)
(it $Obj) won't budge.
(endif)
%% TURN
(rewrite [rotate | $Words] into [turn | $Words])
(rewrite [twist | $Words] into [turn | $Words])
(rewrite [screw | $Words] into [turn | $Words])
(rewrite [unscrew | $Words] into [turn | $Words])
(understand [turn | $Words] as [turn $Obj])
*(understand $Words as non-all object $Obj)
(prevent [turn (room $Obj)])
You can't turn (the $Obj).
(perform [turn $Obj])
Turning (the $Obj) has no apparent effect.
%% READ
(understand [read | $Words] as [read $Obj])
*(understand $Words as non-all object $Obj)
(prevent [read $])
~(player can see)
It is too dark to read.
(perform [read $Obj])
There's nothing written on (the $Obj).
%% FLUSH
%% FLUSH
(understand [flush | $Words] as [flush $Obj])
*(understand $Words as non-all object $Obj)
(perform [flush $Obj])
You don't know how to flush (the $Obj).
(tick) (stop)
(understand [flush])
(perform [flush])
Flush what?
(asking for object in [flush []])
%% SWIM IN
%% SWIM
(rewrite [bathe | $Words] into [swim | $Words])
(understand [swim in | $Words] as [swim in $Obj])
*(understand $Words as single object $Obj)
(perform [swim in $Obj])
You can't swim in (the $Obj).
(tick) (stop)
(understand [swim])
(perform [swim])
In what?
(asking for object in [swim in []])
%% CLEAN
(rewrite [brush | $Words] into [clean | $Words])
(rewrite [shine | $Words] into [clean | $Words])
(rewrite [polish | $Words] into [clean | $Words])
(rewrite [sweep | $Words] into [clean | $Words])
(rewrite [dust | $Words] into [clean | $Words])
(rewrite [wipe | $Words] into [clean | $Words])
(rewrite [scrub | $Words] into [clean | $Words])
(understand [clean | $Words] as [clean $Obj])
*(understand $Words as non-all object $Obj)
(perform [clean $Obj])
You make a half-hearted attempt at cleaning (the $Obj).
%% TIE TO
%% TIE
(rewrite [bind | $Words] into [tie | $Words])
(rewrite [attach | $Words] into [tie | $Words])
(rewrite [fasten | $Words] into [tie | $Words])
(understand [tie | $Words] as [tie $A to $B])
*(split $Words by [to on onto around] into $Left and $Right)
*(understand $Left as single object $A)
(if) ($Right = [itself]) (then)
($B = $A)
(else)
*(understand $Right as single object $B)
(endif)
(understand [tie | $Words] as [tie $Obj])
*(understand $Words as single object $Obj)
(unlikely [tie $])
(perform [tie $Obj])
To what?
(asking for object in [tie $Obj to []])
(perform [tie $A to $B])
There's no obvious way to tie (the $A) to (the $B).
(tick) (stop)
%% UNTIE FROM
%% UNTIE
(understand [untie | $Words] as [untie $A from $B])
*(split $Words by [from] into $Left and $Right)
*(understand $Left as single object $A)
(if) ($Right = [itself]) (then)
($B = $A)
(else)
*(understand $Right as single object $B)
(endif)
(unlikely [untie $Obj from $])
(unlikely [untie $Obj])
(understand [untie | $Words] as [untie $Obj])
*(understand $Words as non-all object $Obj)
(perform [untie $Obj])
(The $Obj) isn't tied to anything.
(tick) (stop)
(perform [untie $Obj from $OtherObj])
(The $Obj) isn't tied to (the $OtherObj).
(tick) (stop)
%% ATTACK WITH
%% ATTACK
(rewrite [break | $Words] into [attack | $Words])
(rewrite [smash | $Words] into [attack | $Words])
(rewrite [hit | $Words] into [attack | $Words])
(rewrite [slap | $Words] into [attack | $Words])
(rewrite [kick | $Words] into [attack | $Words])
(rewrite [fight | $Words] into [attack | $Words])
(rewrite [torture | $Words] into [attack | $Words])
(rewrite [wreck | $Words] into [attack | $Words])
(rewrite [crack | $Words] into [attack | $Words])
(rewrite [destroy | $Words] into [attack | $Words])
(rewrite [murder | $Words] into [attack | $Words])
(rewrite [kill | $Words] into [attack | $Words])
(rewrite [punch | $Words] into [attack | $Words])
(rewrite [thump | $Words] into [attack | $Words])
(understand [attack | $Words] as [attack $A with $B])
*(split $Words by [with] into $Left and $Right)
*(understand $Left as non-all object $A)
*(understand $Right as object $B preferably held)
(unlikely [attack $ with $Obj])
~(item $Obj)
(unlikely [attack $ with $Obj])
(current player $Actor)
~($Obj has ancestor $Actor)
(before [attack $ with $Obj])
(ensure $Obj is held)
(prevent [attack $ with $Obj])
(when $Obj isn't directly held)
(perform [attack $Obj with $])
(try [attack $Obj])
(understand [attack | $Words] as [attack $Obj])
*(understand $Words as single object $Obj)
(perform [attack $Obj])
You consider attacking (the $Obj), but reject the idea.
%% LEAVE
%% LEAVE BY
%% LEAVE WITH