This issue covers changing how GameWorld dispatches actions.
Right now, given:
COMMAND pet horse
GameWorld notices that there are arguments to "pet" and tries to match "horse" to an object in scope. if it matches, that object receives the command (and other objects can also respond to the fact that the horse was pet).
In the new WITCH spec, commands can have arbitrary patterns:
(provides "rip page from $this"...
now when GameWorld sees a command with arguments, it needs to:
translate in-scope objects' command forms to regexes (ie "$this" becomes ([^ ]+))
look for objects that respond to the command at all (^rip\s)
see if the command matches the command format (`page from ([^ ]+)"
see if what is caught by the () fuzzy matches the object with the command pattern
dispatch the command if it matches
Ultimately, we want to support mentioning other things like "throw $this at $object" but that might end up in a followup issue...
This issue covers changing how
GameWorld
dispatches actions.Right now, given:
GameWorld notices that there are arguments to "pet" and tries to match "horse" to an object in scope. if it matches, that object receives the command (and other objects can also respond to the fact that the horse was pet).
In the new WITCH spec, commands can have arbitrary patterns:
now when
GameWorld
sees a command with arguments, it needs to:([^ ]+)
)^rip\s
)()
fuzzy matches the object with the command patternUltimately, we want to support mentioning other things like
"throw $this at $object"
but that might end up in a followup issue...