aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Pouar <pouar@pouar.net>2020-07-15 14:30:10 -0500
committerGravatar Pouar <pouar@pouar.net>2020-07-15 14:30:10 -0500
commit22e305ac6e502a907f7c66512c2f4d303a7daca0 (patch)
treea0dc3f8fd13264e96610be35a43c1d9308a119fc
parentdecided to return something more descriptive here (diff)
make sure the package prefix is printed in print-object
-rw-r--r--core/classes.lisp41
-rw-r--r--data/epilog/pyramid.lisp18
2 files changed, 33 insertions, 26 deletions
diff --git a/core/classes.lisp b/core/classes.lisp
index 19ba55a..071e267 100644
--- a/core/classes.lisp
+++ b/core/classes.lisp
@@ -28,8 +28,9 @@
(defmethod print-object ((o element-type) s)
(let ((class (slot-value (class-of o) 'name)))
(if class
- (print-unreadable-object (o s :type t :identity t)
- (write class :stream s))
+ (let ((*package* (find-package :keyword)))
+ (print-unreadable-object (o s :type t :identity t)
+ (write class :stream s)))
(call-next-method))))
(defgeneric coerce-element-type (element)
(:method ((element-type (eql nil)))
@@ -532,8 +533,9 @@
(defclass ally-last-minute-potty-training (ally potty-trained-team-member) ())
(defclass ally-feral (ally potty-trained-team-member) ())
(defmethod print-object ((obj ally) stream)
- (print-unreadable-object (obj stream :type t :identity t)
- (print-slot obj 'name stream)))
+ (let ((*package* (find-package :keyword)))
+ (print-unreadable-object (obj stream :type t :identity t)
+ (print-slot obj 'name stream))))
(defclass playable-ally (ally) ())
(defmethod initialize-instance :after
((c base-character) &rest initargs &key &allow-other-keys)
@@ -766,10 +768,11 @@
:documentation "list containing what npcs team member might show up when you enter an area. Each entry looks like this @code{(:chance chance :npc npc)} If @var{RANDOM} is specified, then the probability of the enemy being spawn is @var{CHANCE} out of 1 where @var{CHANCE} is a number between 0 and 1"))
(:documentation "A zone on the map"))
(defmethod print-object ((obj zone) stream)
- (print-unreadable-object (obj stream :type t :identity t)
- (print-slot obj 'position stream)
- (write-string " " stream)
- (print-slot obj 'name stream)))
+ (let ((*package* (find-package :keyword)))
+ (print-unreadable-object (obj stream :type t :identity t)
+ (print-slot obj 'position stream)
+ (write-string " " stream)
+ (print-slot obj 'name stream))))
(defclass prop (yadfa-class)
((description
:initarg :description
@@ -809,8 +812,9 @@
:documentation "Plist of actions who's lambda-list is @code{(prop &key &allow-other-keys)} that the player sees as actions they can perform with the prop, @var{PROP} is the instance that this slot belongs to"))
(:documentation "Tangible objects in the AREA that the player can interact with"))
(defmethod print-object ((obj prop) stream)
- (print-unreadable-object (obj stream :type t :identity t)
- (print-slot obj 'name stream)))
+ (let ((*package* (find-package :keyword)))
+ (print-unreadable-object (obj stream :type t :identity t)
+ (print-slot obj 'name stream))))
(defclass consumable (item)
()
(:documentation "Doesn't actually cause items to be consumable, but is there to make filtering easier"))
@@ -1149,14 +1153,15 @@
(attack (player-of *game*) character a))
t))))
(defmethod print-object ((obj enemy) stream)
- (print-unreadable-object (obj stream :type t :identity t)
- (cond ((not (slot-boundp obj 'male))
- (print-slot obj 'male stream))
- ((slot-value obj 'male)
- (write "Male" :stream stream))
- (t (write "Female" :stream stream)))
- (write-string " " stream)
- (print-slot obj 'species stream)))
+ (let ((*package* (find-package :keyword)))
+ (print-unreadable-object (obj stream :type t :identity t)
+ (cond ((not (slot-boundp obj 'male))
+ (print-slot obj 'male stream))
+ ((slot-value obj 'male)
+ (write "Male" :stream stream))
+ (t (write "Female" :stream stream)))
+ (write-string " " stream)
+ (print-slot obj 'species stream))))
(defclass bladder-enemy (enemy bladder-character) ()
(:documentation "Class for an enemy with a bladder fill rate. This enemy may @{wet,mess@} @{him,her@}self in battle."))
(defclass bowels-enemy (enemy bowels-character) ()
diff --git a/data/epilog/pyramid.lisp b/data/epilog/pyramid.lisp
index ca43088..e5cb41a 100644
--- a/data/epilog/pyramid.lisp
+++ b/data/epilog/pyramid.lisp
@@ -64,15 +64,17 @@
:initarg :name
:accessor name-of)))
(defmethod print-object ((object object) stream)
- (print-unreadable-object (object stream :type t)
- (if (slot-boundp object 'name)
- (write (slot-value object 'name) :stream stream)
- (write-string "#<unbound>" stream))))
+ (let ((*package* (find-package :keyword)))
+ (print-unreadable-object (object stream :type t)
+ (if (slot-boundp object 'name)
+ (write (slot-value object 'name) :stream stream)
+ (write-string "#<unbound>" stream)))))
(defmethod print-object ((object puzzle) stream)
- (print-unreadable-object (object stream :type t)
- (if (slot-boundp object 'name)
- (write (slot-value object 'name) :stream stream)
- (write-string "#<unbound>" stream))))
+ (let ((*package* (find-package :keyword)))
+ (print-unreadable-object (object stream :type t)
+ (if (slot-boundp object 'name)
+ (write (slot-value object 'name) :stream stream)
+ (write-string "#<unbound>" stream)))))
(serapeum:eval-always (c:define-presentation-type object (&optional place)))
(cc:define-conditional-application-frame game-frame
()