diff options
author | 2020-07-22 10:20:19 -0500 | |
---|---|---|
committer | 2020-07-22 10:20:19 -0500 | |
commit | 9023f3e5610cdbbed2a4f90fd01302de15662d8c (patch) | |
tree | d75db78e82cf435a1b0af26a027e8576ae39ca00 | |
parent | ensure the old keys are replaced instead of duplicated (diff) |
use destructuring-bind
-rw-r--r-- | core/classes.lisp | 54 | ||||
-rw-r--r-- | data/enemies/fursuiters.lisp | 14 | ||||
-rw-r--r-- | data/enemies/navy.lisp | 65 | ||||
-rw-r--r-- | data/enemies/pirates.lisp | 44 | ||||
-rw-r--r-- | data/enemies/rpgmaker.lisp | 81 | ||||
-rw-r--r-- | data/map/silver-cape.lisp | 2 | ||||
-rw-r--r-- | data/team-members/allies.lisp | 19 | ||||
-rw-r--r-- | data/team-members/catchables.lisp | 19 |
8 files changed, 142 insertions, 156 deletions
diff --git a/core/classes.lisp b/core/classes.lisp index 7132f75..8b80329 100644 --- a/core/classes.lisp +++ b/core/classes.lisp @@ -549,31 +549,22 @@ (defclass playable-ally (ally) ()) (defmethod initialize-instance :after ((c base-character) &rest initargs &key &allow-other-keys) - (declare (ignorable initargs)) - (iter (for (a b) on initargs) - (cond ((eq a :base-health) - (setf (getf (base-stats-of c) :health) - b)) - ((eq a :base-attack) - (setf (getf (base-stats-of c) :attack) - b)) - ((eq a :base-defence) - (setf (getf (base-stats-of c) :defence) - b)) - ((eq a :base-speed) - (setf (getf (base-stats-of c) :speed) - b)) - ((eq a :base-energy) - (setf (getf (base-stats-of c) :energy) - b)))) - (unless (iter (for (a b) on initargs) - (when (eq a :health) - (leave t))) - (setf (health-of c) (calculate-stat c :health))) - (unless (iter (for (a b) on initargs) - (when (eq a :energy) (leave t))) - (setf (energy-of c) (calculate-stat c :energy))) - (setf (exp-of c) (calculate-level-to-exp (level-of c)))) + (destructuring-bind (&key (health nil healthp) (energy nil energyp) + (base-health nil base-health-p) (base-attack nil base-attack-p) + (base-defense nil base-defense-p) (base-speed nil base-speed-p) (base-energy nil base-energy-p)&allow-other-keys) + initargs + (declare (ignore health energy) + (ignorable base-health base-attack base-defense base-speed)) + (cond (base-health-p (setf (getf (base-stats-of c) :health) base-health)) + (base-attack-p (setf (getf (base-stats-of c) :attack) base-attack)) + (base-defense-p (setf (getf (base-stats-of c) :defence) base-defense)) + (base-speed-p (setf (getf (base-stats-of c) :speed) base-speed)) + (base-energy-p (setf (getf (base-stats-of c) :energy) base-energy))) + (unless healthp + (setf (health-of c) (calculate-stat c :health))) + (unless energyp + (setf (energy-of c) (calculate-stat c :energy))) + (setf (exp-of c) (calculate-level-to-exp (level-of c))))) (defclass player (potty-trained-team-member pantsable-character) ((position :initarg :position @@ -609,10 +600,11 @@ :skin '(:fur))) (defmethod initialize-instance :after ((c player) &rest initargs) - (declare (ignorable initargs)) - (unless (iter (for (a b) on initargs) - (when (eq a :warp-on-death-point) (leave t))) - (setf (warp-on-death-point-of c) (position-of c)))) + (destructuring-bind (&key (warp-on-death-point nil warp) &allow-other-keys) + initargs + (declare (ignore warp-on-death-point)) + (unless warp + (setf (warp-on-death-point-of c) (position-of c))))) (defclass zone (yadfa-class) ((description :initarg :description @@ -1016,13 +1008,13 @@ (setf (bulge-text-of new) (cdr (slot-value old 'onesie-bulge-text)))) (defmethod initialize-instance :after ((c onesie/opened) &rest initargs &key &allow-other-keys) - (declare (ignorable initargs)) + (declare (ignore initargs)) (setf (thickness-capacity-of c) (cdr (onesie-thickness-capacity-of c))) (setf (thickness-capacity-threshold-of c) (cdr (onesie-thickness-capacity-threshold-of c))) (setf (bulge-text-of c) (cdr (onesie-bulge-text-of c)))) (defmethod initialize-instance :after ((c onesie/closed) &rest initargs &key &allow-other-keys) - (declare (ignorable initargs)) + (declare (ignore initargs)) (setf (thickness-capacity-of c) (car (onesie-thickness-capacity-of c))) (setf (thickness-capacity-threshold-of c) (car (onesie-thickness-capacity-threshold-of c))) (setf (waterproofp c) (onesie-waterproof-p c)) diff --git a/data/enemies/fursuiters.lisp b/data/enemies/fursuiters.lisp index 6900c29..d4d804d 100644 --- a/data/enemies/fursuiters.lisp +++ b/data/enemies/fursuiters.lisp @@ -45,17 +45,15 @@ (mess :messer character))))) (defmethod initialize-instance :after ((c padded-fursuiter-servant) &rest args &key &allow-other-keys) - (let ((potty-keys (iter (for (a b) on args) - (when (member a '(:watersport-limit :mudsport-limit)) - (collect a))))) - (cond ((member '(:watersport-limit :mudsport-limit) potty-keys - :test (lambda (o ei) - (member ei o))) + (destructuring-bind (&key (watersport-limit nil watersportp) (mudsport-limit nil mudsportp) &allow-other-keys) + args + (declare (ignore watersport-limit mudsport-limit)) + (cond ((and watersportp mudsportp) (let ((limits (a:random-elt (list (cons (bladder/need-to-potty-limit-of c) (bowels/need-to-potty-limit-of c)) '(nil))))) (setf (watersport-limit-of c) (car limits) (mudsport-limit-of c) (cdr limits)))) - ((member :watersport-limit potty-keys) + (watersportp (setf (mudsport-limit-of c) (a:random-elt (list (bowels/need-to-potty-limit-of c) nil)))) - ((member :mudsport-limit potty-keys) + (mudsportp (setf (watersport-limit-of c) (a:random-elt (list (bladder/need-to-potty-limit-of c) nil))))))) (defclass fursuiter-servant (potty-enemy) () (:default-initargs diff --git a/data/enemies/navy.lisp b/data/enemies/navy.lisp index 6e987f1..53eaca2 100644 --- a/data/enemies/navy.lisp +++ b/data/enemies/navy.lisp @@ -76,22 +76,20 @@ (mess :messer character))))) (defmethod initialize-instance :after ((c navy-officer) &rest args &key &allow-other-keys) - (unless (iter (for (a b) on args) - (when (eq a :wear) - (leave t))) - (push (make-instance 'yadfa-items:navy-pullups) (wear-of c)) - (when (and (not (malep c)) (= (random 5) 0)) - (push (make-instance 'yadfa-items:navy-skirt) (wear-of c))) - (unless (malep c) - (push (make-instance 'yadfa-items:bra) (wear-of c))) - (push (make-instance 'yadfa-items:navy-shirt) (wear-of c))) - (unless (iter (for (a b) on args) - (when (eq a :watersport-limit) - (leave t))) - (setf (watersport-limit-of c) (- (bladder/maximum-limit-of c) (bladder/potty-desperate-limit-of c)))) - (unless (iter (for (a b) on args) - (when (eq a :mudsport-limit) (leave t))) - (setf (mudsport-limit-of c) (- (bowels/maximum-limit-of c) (bowels/potty-desperate-limit-of c))))) + (destructuring-bind (&key (watersport-limit nil watersportp) (mudsport-limit nil mudsportp) (wear nil wearp) &allow-other-keys) + args + (declare (ignore watersport-limit mudsport-limit wear)) + (unless wearp + (push (make-instance 'yadfa-items:navy-pullups) (wear-of c)) + (when (and (not (malep c)) (= (random 5) 0)) + (push (make-instance 'yadfa-items:navy-skirt) (wear-of c))) + (unless (malep c) + (push (make-instance 'yadfa-items:bra) (wear-of c))) + (push (make-instance 'yadfa-items:navy-shirt) (wear-of c))) + (unless watersportp + (setf (watersport-limit-of c) (- (bladder/maximum-limit-of c) (bladder/potty-desperate-limit-of c)))) + (unless mudsportp + (setf (mudsport-limit-of c) (- (bowels/maximum-limit-of c) (bowels/potty-desperate-limit-of c)))))) (defclass navy-officer* (navy-officer) () (:default-initargs :description "A variant of the Navy Officer. This variant still wears the standard pullups, but supplements them with stuffers to avoid changing the pullups out and is a bit less likely to try and hold it" @@ -103,21 +101,20 @@ (collect (make-instance 'yadfa-items:cloth-incontinence-pad)))))) (defmethod initialize-instance :after ((c navy-officer*) &rest args &key &allow-other-keys) - (unless (iter (for (a b) on args) - (when (eq a :wear) - (leave t))) - (push (make-instance 'yadfa-items:cloth-incontinence-pad) (wear-of c)) - (push (make-instance 'yadfa-items:navy-pullups) (wear-of c)) - (when (and (not (malep c)) (= (random 5) 0)) - (push (make-instance 'yadfa-items:navy-skirt) (wear-of c))) - (unless (malep c) - (push (make-instance 'yadfa-items:bra) (wear-of c))) - (push (make-instance 'yadfa-items:navy-shirt) (wear-of c))) - (unless (iter (for (a b) on args) - (when (eq a :watersport-limit) - (leave t))) - (setf (watersport-limit-of c) (- (bladder/maximum-limit-of c) (a:random-elt (list (bladder/potty-dance-limit-of c) (bladder/need-to-potty-limit-of c)))))) - (unless (iter (for (a b) on args) - (when (eq a :mudsport-limit) - (leave t))) - (setf (mudsport-limit-of c) (- (bowels/maximum-limit-of c) (a:random-elt (list (bowels/potty-dance-limit-of c) (bowels/need-to-potty-limit-of c))))))) + (destructuring-bind (&key (watersport-limit nil watersportp) (mudsport-limit nil mudsportp) (wear nil wearp) &allow-other-keys) + args + (declare (ignore watersport-limit mudsport-limit wear)) + (unless wearp + (push (make-instance 'yadfa-items:cloth-incontinence-pad) (wear-of c)) + (push (make-instance 'yadfa-items:navy-pullups) (wear-of c)) + (when (and (not (malep c)) (= (random 5) 0)) + (push (make-instance 'yadfa-items:navy-skirt) (wear-of c))) + (unless (malep c) + (push (make-instance 'yadfa-items:bra) (wear-of c))) + (push (make-instance 'yadfa-items:navy-shirt) (wear-of c))) + (unless watersportp + (setf (watersport-limit-of c) (- (bladder/maximum-limit-of c) + (a:random-elt (list (bladder/potty-dance-limit-of c) (bladder/need-to-potty-limit-of c)))))) + (unless mudsportp + (setf (mudsport-limit-of c) (- (bowels/maximum-limit-of c) + (a:random-elt (list (bowels/potty-dance-limit-of c) (bowels/need-to-potty-limit-of c)))))))) diff --git a/data/enemies/pirates.lisp b/data/enemies/pirates.lisp index 38889c5..85de5f9 100644 --- a/data/enemies/pirates.lisp +++ b/data/enemies/pirates.lisp @@ -13,17 +13,18 @@ :mudsport-limit 400 :inventory (iter (for i from 0 to (random 20)) (collect (make-instance 'yadfa-items:diaper))))) (defmethod initialize-instance :after ((c diaper-pirate) &rest args &key &allow-other-keys) - (unless (iter (for (a b) on args) - (when (eq a :wear) - (leave t))) - (setf (wear-of c) nil) - (push (make-instance 'yadfa-items:diaper) (wear-of c)) - (unless (malep c) - (push (make-instance 'yadfa-items:bra) (wear-of c))) - (push (make-instance (if (and (not (malep c)) (= (random 2) 0)) - 'yadfa-items:pirate-dress - 'yadfa-items:pirate-shirt)) - (wear-of c)))) + (destructuring-bind (&key (wear nil wearp) &allow-other-keys) + args + (declare (ignore wear)) + (unless wearp + (setf (wear-of c) nil) + (push (make-instance 'yadfa-items:diaper) (wear-of c)) + (unless (malep c) + (push (make-instance 'yadfa-items:bra) (wear-of c))) + (push (make-instance (if (and (not (malep c)) (= (random 2) 0)) + 'yadfa-items:pirate-dress + 'yadfa-items:pirate-shirt)) + (wear-of c))))) (defclass thickly-diaper-pirate (diaper-pirate) () (:default-initargs :description "A variant of the Diaper Pirate that wears 3 layers of padding. A stuffer, a normal diaper, and a super thick diaper." @@ -34,13 +35,14 @@ (iter (for i from 0 to (random 20)) (collect (make-instance 'yadfa-items:thick-rubber-diaper)))))) (defmethod initialize-instance :after ((c thickly-diaper-pirate) &rest args &key &allow-other-keys) - (unless (iter (for (a b) on args) - (when (eq a :wear) - (leave t))) - (setf (wear-of c) nil) - (a:appendf (wear-of c) - (iter (for i in '(yadfa-items:thick-rubber-diaper yadfa-items:cloth-diaper yadfa-items:incontinence-pad)) - (collect (make-instance i)))) - (unless (malep c) - (push (make-instance 'yadfa-items:bra) (wear-of c))) - (push (make-instance 'yadfa-items:pirate-shirt) (wear-of c)))) + (destructuring-bind (&key (wear nil wearp) &allow-other-keys) + args + (declare (ignore wear)) + (unless wearp + (setf (wear-of c) nil) + (a:appendf (wear-of c) + (iter (for i in '(yadfa-items:thick-rubber-diaper yadfa-items:cloth-diaper yadfa-items:incontinence-pad)) + (collect (make-instance i)))) + (unless (malep c) + (push (make-instance 'yadfa-items:bra) (wear-of c))) + (push (make-instance 'yadfa-items:pirate-shirt) (wear-of c))))) diff --git a/data/enemies/rpgmaker.lisp b/data/enemies/rpgmaker.lisp index 23965db..2916c47 100644 --- a/data/enemies/rpgmaker.lisp +++ b/data/enemies/rpgmaker.lisp @@ -14,15 +14,16 @@ (setf (get 'diapered-kobold 'change-class-target) 'yadfa-allies:diapered-kobold) (defmethod initialize-instance :after ((c diapered-kobold) &rest args &key &allow-other-keys) - (unless (iter (for (a b) on args) - (when (eq a :wear) - (leave t))) - (push (let ((a (make-instance 'yadfa-items:thick-cloth-diaper))) - (setf (sogginess-of a) (random (sogginess-capacity-of a))) - (setf (messiness-of a) (random (messiness-capacity-of a))) - a) - (wear-of c)) - (push (make-instance (if (malep c) 'yadfa-items:shendyt 'yadfa-items:kalasiris)) (wear-of c)))) + (destructuring-bind (&key (wear nil wearp) &allow-other-keys) + args + (declare (ignore wear)) + (unless wearp + (push (let ((a (make-instance 'yadfa-items:thick-cloth-diaper))) + (setf (sogginess-of a) (random (sogginess-capacity-of a))) + (setf (messiness-of a) (random (messiness-capacity-of a))) + a) + (wear-of c)) + (push (make-instance (if (malep c) 'yadfa-items:shendyt 'yadfa-items:kalasiris)) (wear-of c))))) (defclass diapered-skunk (potty-enemy skunk-boop-mixin) () (:default-initargs :name "Diapered Skunk" @@ -40,23 +41,22 @@ :moves (list (make-instance 'yadfa-moves:spray) (make-instance 'yadfa-moves:face-sit)))) (defmethod initialize-instance :after ((c diapered-skunk) &rest args &key &allow-other-keys) - (unless (iter (for (a b) on args) - (when (eq a :wear) - (leave t))) - (push (let ((a (make-instance 'yadfa-items:high-capacity-diaper))) - (setf (sogginess-of a) (+ (bladder/potty-desperate-limit-of c) (random (+ (bladder/maximum-limit-of c) (- (bladder/maximum-limit-of c) (bladder/potty-desperate-limit-of c)))))) - (setf (messiness-of a) (+ (bowels/potty-desperate-limit-of c) (random (- (bowels/maximum-limit-of c) (bowels/potty-desperate-limit-of c))))) - a) - (wear-of c)) - (push (make-instance (if (malep c) 'yadfa-items:tshirt 'yadfa-items:bikini-top)) (wear-of c)) - (push (make-instance 'yadfa-items:black-leather-jacket) (wear-of c)) - (unless (iter (for (a b) on args) - (when (eq a :watersport-limit) - (leave t))) + (destructuring-bind (&key (watersport-limit nil watersportp) (mudsport-limit nil mudsportp) + (wear nil wearp) + &allow-other-keys) + args + (declare (ignore watersport-limit mudsport-limit wear)) + (unless wearp + (push (let ((a (make-instance 'yadfa-items:high-capacity-diaper))) + (setf (sogginess-of a) (+ (bladder/potty-desperate-limit-of c) (random (+ (bladder/maximum-limit-of c) (- (bladder/maximum-limit-of c) (bladder/potty-desperate-limit-of c)))))) + (setf (messiness-of a) (+ (bowels/potty-desperate-limit-of c) (random (- (bowels/maximum-limit-of c) (bowels/potty-desperate-limit-of c))))) + a) + (wear-of c)) + (push (make-instance (if (malep c) 'yadfa-items:tshirt 'yadfa-items:bikini-top)) (wear-of c)) + (push (make-instance 'yadfa-items:black-leather-jacket) (wear-of c))) + (unless watersportp (setf (watersport-limit-of c) (- (bladder/maximum-limit-of c) (bladder/potty-desperate-limit-of c)))) - (unless (iter (for (a b) on args) - (when (eq a :mudsport-limit) - (leave t))) + (unless mudsportp (setf (mudsport-limit-of c) (- (bowels/maximum-limit-of c) (bowels/potty-desperate-limit-of c)))))) (defmethod process-battle-accident ((character diapered-skunk) attack (item item) reload (selected-target base-character)) (declare (ignore attack item reload selected-target)) @@ -113,25 +113,22 @@ :moves (list (make-instance 'yadfa-moves:spray) (make-instance 'yadfa-moves:face-sit)))) (defmethod initialize-instance :after ((c diapered-skunk*) &rest args &key &allow-other-keys) - (unless (iter (for (a b) on args) - (when (eq a :wear) - (leave t))) - (push (let ((a (make-instance 'yadfa-items:high-capacity-diaper))) - (setf (sogginess-of a) (sogginess-capacity-of a)) - (setf (messiness-of a) (messiness-capacity-of a)) - a) - (wear-of c)) - (unless (iter (for (a b) on args) - (when (eq a :watersport-limit) - (leave t))) + (destructuring-bind (&key (watersport-limit nil watersportp) (mudsport-limit nil mudsportp) + (wear nil wearp) (description nil descriptionp) + &allow-other-keys) + args + (declare (ignore watersport-limit mudsport-limit wear description)) + (unless wearp + (push (let ((a (make-instance 'yadfa-items:high-capacity-diaper))) + (setf (sogginess-of a) (sogginess-capacity-of a)) + (setf (messiness-of a) (messiness-capacity-of a)) + a) + (wear-of c))) + (unless watersportp (setf (watersport-limit-of c) (- (bladder/maximum-limit-of c) (bladder/potty-desperate-limit-of c)))) - (unless (iter (for (a b) on args) - (when (eq a :mudsport-limit) - (leave t))) + (unless mudsportp (setf (mudsport-limit-of c) (- (bowels/maximum-limit-of c) (bowels/potty-desperate-limit-of c)))) - (unless (iter (for (a b) on args) - (when (eq a :description) - (leave t))) + (unless descriptionp (let* ((male (malep c)) (hisher (if male "his" "her"))) (setf (description-of c) (format nil "If you thought the other skunk was stinky, that's nothing compared to this one. Apparently this skunk never changes ~a pamps at all and just continues to flood, mess, and spray ~a current one. ~a doesn't wear anything else because it just gets covered in too much of ~a own stinky juices." hisher hisher (if male "He" "She") hisher)))))) diff --git a/data/map/silver-cape.lisp b/data/map/silver-cape.lisp index 732de69..04f0c96 100644 --- a/data/map/silver-cape.lisp +++ b/data/map/silver-cape.lisp @@ -210,7 +210,7 @@ (format t "You toss your ~a into the bin and pretend you're saving the planet~%" (name-of i))) - (alexandria:removef (inventory-of (player-of *game*)) items + (alexandria:deletef (inventory-of (player-of *game*)) items :test (lambda (o e) (member e o)))))))))))) (ensure-zone (6 11 0 silver-cape) diff --git a/data/team-members/allies.lisp b/data/team-members/allies.lisp index a9556a3..ae086e5 100644 --- a/data/team-members/allies.lisp +++ b/data/team-members/allies.lisp @@ -20,16 +20,15 @@ :level 5)) (defmethod initialize-instance :after ((c slynk) &rest args &key &allow-other-keys) - (unless (iter (for (a b) on args) - (when (eq a :bladder/contents) - (leave t))) - (setf (bladder/contents-of c) - (random (coerce (+ (bladder/potty-desperate-limit-of c) (/ (- (bladder/potty-desperate-limit-of c) (bladder/potty-dance-limit-of c)))) 'long-float)))) - (unless (iter (for (a b) on args) - (when (eq a :bowels/contents) - (leave t))) - (setf (bowels/contents-of c) - (random (coerce (+ (bowels/potty-desperate-limit-of c) (/ (- (bowels/potty-desperate-limit-of c) (bowels/potty-dance-limit-of c)))) 'long-float))))) + (destructuring-bind (&key (bladder/contents nil bladderp) (bowels/contents nil bowelsp) &allow-other-keys) + args + (declare (ignore bladder/contents bowels/contents)) + (unless bladderp + (setf (bladder/contents-of c) + (random (coerce (+ (bladder/potty-desperate-limit-of c) (/ (- (bladder/potty-desperate-limit-of c) (bladder/potty-dance-limit-of c)))) 'long-float)))) + (unless bowelsp + (setf (bowels/contents-of c) + (random (coerce (+ (bowels/potty-desperate-limit-of c) (/ (- (bowels/potty-desperate-limit-of c) (bowels/potty-dance-limit-of c)))) 'long-float)))))) (defclass chris (playable-ally ally-rebel-potty-training) () (:default-initargs :name "Chris" diff --git a/data/team-members/catchables.lisp b/data/team-members/catchables.lisp index 9da051c..c408f8c 100644 --- a/data/team-members/catchables.lisp +++ b/data/team-members/catchables.lisp @@ -24,15 +24,16 @@ (make-instance 'yadfa-moves:mudsport)))) (defmethod initialize-instance :after ((c diapered-kobold) &rest args &key &allow-other-keys) - (unless (iter (for (a b) on args) - (when (eq a :wear) - (leave t))) - (push (let ((a (make-instance 'yadfa-items:thick-cloth-diaper))) - (setf (sogginess-of a) (random (sogginess-capacity-of a))) - (setf (messiness-of a) (random (messiness-capacity-of a))) - a) - (wear-of c)) - (push (make-instance (if (malep c) 'yadfa-items:shendyt 'yadfa-items:kalasiris)) (wear-of c)))) + (destructuring-bind (&key (wear nil wearp) &allow-other-keys) + args + (declare (ignore wear)) + (unless wearp + (push (let ((a (make-instance 'yadfa-items:thick-cloth-diaper))) + (setf (sogginess-of a) (random (sogginess-capacity-of a))) + (setf (messiness-of a) (random (messiness-capacity-of a))) + a) + (wear-of c)) + (push (make-instance (if (malep c) 'yadfa-items:shendyt 'yadfa-items:kalasiris)) (wear-of c))))) (defclass diapered-raccoon-bandit (adopted-enemy ally-last-minute-potty-training pantsable-character) () (:default-initargs :name "Diapered Raccoon Bandit" |