diff options
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/scripting.texi | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/api/scripting.texi b/doc/api/scripting.texi index ca2cfd4..299cf0f 100644 --- a/doc/api/scripting.texi +++ b/doc/api/scripting.texi @@ -221,6 +221,28 @@ transformed. @end deffn +@deffn {Scheme Procedure} action-effect-lift @var{proc} +Create an action constructor from @var{proc}, a procedure of any +number of arguments, whose first two arguments are the world being +transformed and the game object being acted upon. The actions +returned from this new procedure specify that @var{proc} should be +performed as an effect on the world, and do not change the actor +itself. + +@example +;; Theoretical procedure that spawns a new enemy next to the current +;; enemy actor. +(define (spawn-enemy world enemy type) + (add-enemy world (enemy-position enemy) (make-enemy type)) + +(define spawn-enemy* (action-effect-lift spawn-enemy)) + +;; Create a new action that spawns a goblin. +(spawn-enemy* 'goblin) +@end example + +@end deffn + @deffn {Scheme Procedure} both @var{a} @var{b} Peform action @var{a} immediately followed by action @var{b}. When the action is run, the remainder of both @var{a} and @var{b} are |