Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun component-combine (func dests) "Basic combine moves with a free slot to indicate the combining function. Helper function."
- (loop for dest in dests append (mapcar func dest)))
- (defun combine (&rest dests)
- (component-combine #'identity dests)) ; For consistency, this function uses the rather silly identity function.
- (defun capture (&rest dests)
- (component-combine #'(lambda (p) (append p (list :capture t))) dests))
- (defun move (&rest dests)
- (component-combine #'(lambda (p) (append p (list :move t))) dests))
- (defun igui (&rest dests)
- (component-combine #'(lambda (p) (append p (list :igui t))) dests))
- (defun lame (&rest dests) ; use (then '(:complete t)) (NYI) for finer control over lame moves.
- (component-combine #'(lambda (p) (append p (list :lame t))) dests))
- (defun jump (optlist &rest dests) ; Jumping makes sense only on range moves, or when exactly one of the options are false.
- ; Single destinations are jumps by default.
- (destructuring-bind (&key (jump-friendly-p t) (jump-enemy-p t)) optlist
- ; The destructuring-bind above catches settings that are not included with the attribute
- (component-combine #'(lambda (p) (append p (list :jump (list :jump-friendly-p jump-friendly-p
- :jump-enemy-p jump-enemy-p)))) dests)))
- (defun cannon (optlist &rest dests)
- (destructuring-bind (&key (steps-before :any)
- (jump-enemy-p T)
- (jump-friendly-p T)
- (capture-screen-p nil)
- (screen-count 1)
- (steps-after :any)) optlist
- (component-combine #'(lambda (p) (append p (list :cannon (list :steps-before steps-before
- :jump-enemy-p jump-enemy-p
- :jump-friendly-p jump-friendly-p
- :capture-screen-p capture-screen-p
- :screen-count screen-count
- :steps-after steps-after)))) dests)))
Advertisement
Add Comment
Please, Sign In to add comment