aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Pouar <pouar@pouar.net>2020-07-18 12:54:08 -0500
committerGravatar Pouar <pouar@pouar.net>2020-07-18 12:54:08 -0500
commit1051a63dbf68f9bd4d1ea57df5136fb94753f9e1 (patch)
treeaa44f6a357a06c082706eb2257ca966ee89516ca
parentadd mutagen and antimutagen (diff)
forgot macros made with macrolet are invisible to the iterate macro
-rw-r--r--data/items/consumable.lisp20
1 files changed, 12 insertions, 8 deletions
diff --git a/data/items/consumable.lisp b/data/items/consumable.lisp
index a5f48e0..5026f86 100644
--- a/data/items/consumable.lisp
+++ b/data/items/consumable.lisp
@@ -20,14 +20,16 @@
(new (union old types :key 'type-of :test 'eq))
(difference (set-difference new old :key 'type-of :test 'eq)))
(if difference
- (progn (setf (element-type-of user) new)
- (iter (for i in difference)
+ (flet ((format-type (type)
(f:fmt t (name-of user) " gained the " (:esc
- (let* ((class (class-of i))
+ (let* ((class (class-of type))
(name (name-of class)))
(if name (:fmt (:a name))
- (:s (class-name class)))))
+ (:fmt (:s (class-name class))))))
" type" #\Newline)))
+ (setf (element-type-of user) new)
+ (iter (for i in difference)
+ (format-type i)))
(f:fmt t "It had no effect on " (name-of user) #\Newline))))
(defclass antimutagen (consumable)
((element-type :initarg :element-type :accessor element-type-of)))
@@ -37,14 +39,16 @@
(new (set-difference old types :key 'type-of :test 'eq))
(difference (set-difference old new :key 'type-of :test 'eq)))
(if difference
- (progn (setf (element-type-of user) new)
- (iter (for i in difference)
+ (flet ((format-type (type)
(f:fmt t (name-of user) " lost the " (:esc
- (let* ((class (class-of i))
+ (let* ((class (class-of type))
(name (name-of class)))
(if name (:fmt (:a name))
- (:s (class-name class)))))
+ (:fmt (:s (class-name class))))))
" type" #\Newline)))
+ (setf (element-type-of user) new)
+ (iter (for i in difference)
+ (format-type i)))
(f:fmt t "It had no effect on " (name-of user) #\Newline))))
(defclass monster-energy-drink (consumable) ()
(:default-initargs