diff --git a/forest/forest.org b/forest/forest.org index a684053..3f44b81 100644 --- a/forest/forest.org +++ b/forest/forest.org @@ -1,8 +1,6 @@ * Essential -** Flesh out monastery level and guard house -*** TODO 4 damaged road tiles (2 interior, 2 border) -*** TODO alabaster brick look for guard house -** +** TODO more stuff to look at on sanctuary level... sheep or something + * Polish ** TODO edible fruits to find ** TODO rose found in the forest diff --git a/forest/forest.pak b/forest/forest.pak index d2fe4b8..d2dc483 100644 --- a/forest/forest.pak +++ b/forest/forest.pak @@ -63,6 +63,7 @@ (:name "lichblade" :type :image :file "lichblade.png") (:name "monastery" :type :image :file "monastery.png") (:name "monastery-gateway" :type :image :file "monastery-gateway.png") + (:name "quarters-gateway" :type :image :file "quarters-gateway.png") (:name "ascent-gateway" :type :image :file "ascent-gateway.png") (:name "water-1" :type :image :file "water-1.png") @@ -145,6 +146,7 @@ (:name "sanctuary-map" :type :image :file "sanctuary-map.png") (:name "tiny-map" :type :image :file "tiny-map.png") (:name "wall" :type :image :file "wall.png") + (:name "sheep" :type :image :file "sheep.png") (:name "splash" :type :image :file "splash.png") (:name "ruin-floor" :type :image :file "ruin-floor.png") (:name "bip" :type :sample :file "bip.wav" :properties (:volume 10)) diff --git a/forest/monastery.lisp b/forest/monastery.lisp index 1c3be8f..f65b626 100644 --- a/forest/monastery.lisp +++ b/forest/monastery.lisp @@ -39,10 +39,13 @@ (defparameter *success-text* '((("Let's move along now.")))) +(defparameter *thisway-text* '((("This way to your quarters.")))) + (defcell lothaine (tile :initform "lothaine") (state :initform 0) (categories :initform '(:obstacle :actor :npc)) + (running :initform t) (timeout :initform 40)) (define-method emote lothaine (text &optional (timeout 3.0)) @@ -51,27 +54,33 @@ [drop self balloon])) (define-method run lothaine () - (clon:with-fields (state timeout) self - [expend-default-action-points self] - (labels ((act () - (ecase state - (0 [emote self *greeting-text* 1.0] - (incf state) - (setf timeout 20)) - (1 [emote self *beckon-text*] - (setf timeout 100)) - (2 [emote self *success-text*] - (incf state) - (setf timeout 50)) - (3 [>>play *universe* :address (generate-level-address 6) :player [get-player *world*]])))) - (if (and (not (= 3 state)) - (< [distance-to-player self] 5)) - (progn (setf state 2) (act)) - (if (null timeout) - (act) - (when (minusp (decf timeout)) - (setf timeout nil) - (act))))))) + (when + (clon:with-fields (state timeout) self + [expend-default-action-points self] + (labels ((act () + (case state + (0 (when (< [distance-to-player self] 15) + [emote self *greeting-text* 1.0] + (incf state) + (setf timeout 20))) + (1 [emote self *beckon-text*] + (setf timeout 100)) + (2 [emote self *success-text*] + (incf state) + (setf timeout 29)) + (3 [emote self *thisway-text*] + [drop self (clone =quarters-gateway=)] + [move self :north] + (incf state) + (setf nil))))) + (if (and (not (= 3 state)) + (< [distance-to-player self] 5)) + (progn (setf state 2) (act)) + (if (null timeout) + (act) + (when (minusp (decf timeout)) + (setf timeout nil) + (act)))))))) ;;; Monastery approach world @@ -160,7 +169,24 @@ south. You can hear the monks singing in the distance.") (clone =flowers-2=)) i j :no-collisions t]))))))) -(define-method generate monastery (&key (height *forest-height*) +(defcell sheep + (tile :initform "sheep") + (speed :initform (make-stat :base 2)) + (categories :initform '(:obstacle :actor)) + (hit-points :initform (make-stat :base 10 :min 0)) + (direction :initform :south)) + +(define-method run sheep () + (percent-of-time 15 + (setf (random-direction))) + (percent-of-time 80 [move self ])) + +(define-method drop-sheep monastery (&optional (sheep 10)) + (dotimes (i sheep) + (multiple-value-bind (r c) [random-place self] + [drop-cell self (clone =sheep=) r c :loadout t]))) + +(define-method generate monastery (&key (height 100) (width *forest-width*) sequence-number) (setf height) @@ -169,10 +195,12 @@ south. You can hear the monks singing in the distance.") [create-default-grid self] [drop-hill self] [drop-road self] + [drop-sheep self] (let ((row (1+ (random 10)) ) (column (+ 15 (random 6)))) [drop-cell self (clone =drop-point=) row column - :exclusive t :probe t])) + :exclusive t :probe t]) + [drop-cell self (clone =lothaine=) 85 10]) (define-method begin-ambient-loop monastery () (play-music "rain" :loop t) @@ -180,6 +208,14 @@ south. You can hear the monks singing in the distance.") ;;; Your quarters +(define-prototype quarters-gateway (:parent =gateway=) + (tile :initform "quarters-gateway") + (address :initform (generate-level-address 6))) + +(define-method step quarters-gateway (stepper) + (when [is-player stepper] + [say self "The way to your quarters. Press ENTER to continue."])) + (defcell quarters-floor (tile :initform (car (one-of '("quarters-floor-1" "quarters-floor-1" "quarters-floor-2"))))) @@ -239,7 +275,7 @@ south. You can hear the monks singing in the distance.") [drop-cell self (clone =drop-point=) row column :exclusive t :probe t]))) -(define-method begin-ambient-loop monastery () +(define-method begin-ambient-loop quarters () (play-music "solace")) diff --git a/forest/quarters-gateway.png b/forest/quarters-gateway.png new file mode 100644 index 0000000..704b108 Binary files /dev/null and b/forest/quarters-gateway.png differ diff --git a/forest/quarters-wall.png b/forest/quarters-wall.png index 31686a8..2def903 100644 Binary files a/forest/quarters-wall.png and b/forest/quarters-wall.png differ diff --git a/forest/sheep.png b/forest/sheep.png new file mode 100644 index 0000000..4df90f3 Binary files /dev/null and b/forest/sheep.png differ