aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Pouar <pouar@pouar.net>2020-10-09 22:00:53 -0500
committerGravatar Pouar <pouar@pouar.net>2020-10-10 11:33:21 -0500
commit08f57cc9828829eac35f836f5302e40e9df59073 (patch)
treefa304670b5f0ee5dacb7b319f5fd03c5a3ec794c
parentmore declares (diff)
Make use of hooks from Serapeum
since it has gotten more extensible
-rw-r--r--core/libexec/functions.lisp1
-rw-r--r--core/libexec/hooks.lisp4
-rw-r--r--packages.lisp2
-rw-r--r--yadfa.asd1
4 files changed, 7 insertions, 1 deletions
diff --git a/core/libexec/functions.lisp b/core/libexec/functions.lisp
index a7f2998..5393b5c 100644
--- a/core/libexec/functions.lisp
+++ b/core/libexec/functions.lisp
@@ -664,6 +664,7 @@
(process-potty i)
(run-equip-effects i))
(print-enter-text (position-of (player-of *game*)) old-position direction)
+ (s:run-hook (sc:find-hook 'yadfa-world:move) direction old-position)
(cond ((continue-battle-of (get-zone (position-of (player-of *game*))))
(set-new-battle (getf (continue-battle-of (get-zone (position-of (player-of *game*)))) :enemies)
:team-npcs (getf (continue-battle-of (get-zone (position-of (player-of *game*)))) :team-npcs)
diff --git a/core/libexec/hooks.lisp b/core/libexec/hooks.lisp
new file mode 100644
index 0000000..d36cce5
--- /dev/null
+++ b/core/libexec/hooks.lisp
@@ -0,0 +1,4 @@
+;;;; -*- mode: Common-Lisp; sly-buffer-package: "yadfa"; coding: utf-8-unix; -*-
+(in-package :yadfa)
+(sc:define-hook-type move-command (function (symbol list) (values &rest t)))
+(sc:define-hook 'hook-move-command 'yadfa-world:move)
diff --git a/packages.lisp b/packages.lisp
index 57389db..aad0588 100644
--- a/packages.lisp
+++ b/packages.lisp
@@ -334,7 +334,7 @@
#:fainted-of
#:persistentp)
(:documentation "Yet Another Diaperfur Adventure")
- (:local-nicknames (:s :serapeum) (:a :alexandria) (:u :ugly-tiny-infix-macro) (:g :global-vars)
+ (:local-nicknames (:s :serapeum) (:a :alexandria) (:u :ugly-tiny-infix-macro) (:g :global-vars) (:sc :serapeum/contrib/hooks)
(:c :clim) (:ce :clim-extensions) (:cc :conditional-commands) (:ms :marshal) (:f :fmt)))
(uiop:define-package :yadfa-bin
(:export #:lst
diff --git a/yadfa.asd b/yadfa.asd
index b9c520d..346560b 100644
--- a/yadfa.asd
+++ b/yadfa.asd
@@ -27,6 +27,7 @@
(:file "methods" :depends-on ("classes" "generic-functions" "macros" "declares" "functions" "conditions"))
(:file "generic-functions" :depends-on ("classes" "macros" "declares" "functions"))
(:file "classes" :depends-on ("init" "declares"))
+ (:file "hooks")
(:file "game" :depends-on ("classes" "init" "declares"))
(:file "mcclim" :depends-on ("init" "declares" "functions" "generic-functions" "macros"))
(:file "structs" :depends-on ("init" "declares"))