X-Git-Url: https://jxself.org/git/?p=mudsync.git;a=blobdiff_plain;f=mudsync%2Fcommand.scm;h=23e21dac8f85fc75645cc18620e0613dba0818d9;hp=b09873a06f416f8133c6dde8eea37dd8e37f3fdd;hb=5128272343835236d5e3410e12728cb2efe5a39f;hpb=8a2341e98f75a5df295f49c08485eb6339dda19e diff --git a/mudsync/command.scm b/mudsync/command.scm index b09873a..23e21da 100644 --- a/mudsync/command.scm +++ b/mudsync/command.scm @@ -1,3 +1,21 @@ +;;; Mudsync --- Live hackable MUD +;;; Copyright © 2016 Christopher Allan Webber +;;; +;;; This file is part of Mudsync. +;;; +;;; Mudsync is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; Mudsync is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with Mudsync. If not, see . + (define-module (mudsync command) #:use-module (mudsync parser) #:use-module (8sync systems actors) @@ -15,6 +33,7 @@ direct-command indir-command + indir-as-direct-command loose-direct-command loose-indir-command empty-command @@ -83,6 +102,18 @@ action %high-priority)) +(define* (indir-as-direct-command verbs action #:optional prepositions) + (make-command verbs + cmatch-indir-obj + (lambda* (goes-by #:key direct-obj indir-obj preposition) + (if prepositions + (and + (member direct-obj goes-by) + (member preposition prepositions)) + (member direct-obj goes-by))) + action + %high-priority)) + (define* (loose-indir-command verbs action #:optional prepositions) (make-command verbs cmatch-indir-obj