X-Git-Url: https://jxself.org/git/?p=mudsync.git;a=blobdiff_plain;f=mudsync%2Fcommand.scm;h=8672d35c70e1222116925d7a06ab5f1e065b92b1;hp=31687389cf9a17af83e2f02e318d2f28b377100b;hb=095dde9158621c8bb3d690feaa0d525a76342eb9;hpb=f1a3d508745069bceecb02cb475c0104020dce16 diff --git a/mudsync/command.scm b/mudsync/command.scm index 3168738..8672d35 100644 --- a/mudsync/command.scm +++ b/mudsync/command.scm @@ -32,9 +32,10 @@ command-priority direct-command - indir-command + prep-indir-command + prep-direct-command loose-direct-command - loose-indir-command + loose-prep-command empty-command direct-greedy-command greedy-command @@ -89,7 +90,7 @@ %default-priority)) -(define* (indir-command verbs action #:optional prepositions) +(define* (prep-indir-command verbs action #:optional prepositions) (make-command verbs cmatch-indir-obj (lambda* (goes-by #:key direct-obj indir-obj preposition) @@ -101,7 +102,19 @@ action %high-priority)) -(define* (loose-indir-command verbs action #:optional prepositions) +(define* (prep-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-prep-command verbs action #:optional prepositions) (make-command verbs cmatch-indir-obj (const #t)