diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 5c89188..02290e4 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -49,6 +49,15 @@ " fixed +define-item "Rock" + description "A large rock sitting right in the middle of the rapids. Looks like + a great place for a picknick!" + fixed + +define-item "Stone" + description "A pretty little pebble, very colourful and worn smooth by the water." + infinite + define-item "Berries" description "Scrumptious, fresh wild berries: blueberries, blackberries, strawberries... Just don't eat too many!" diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 5c89188..02290e4 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -49,6 +49,15 @@ " fixed +define-item "Rock" + description "A large rock sitting right in the middle of the rapids. Looks like + a great place for a picknick!" + fixed + +define-item "Stone" + description "A pretty little pebble, very colourful and worn smooth by the water." + infinite + define-item "Berries" description "Scrumptious, fresh wild berries: blueberries, blackberries, strawberries... Just don't eat too many!" diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index b72be80..211d6bd 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -92,8 +92,14 @@ "A wrapper function for lost-in-the-forest for the deep forest location" (lost-in-the-forest player "Deep forest" 40)) +(defun climb (player &optional arg) + "Climb something - currently either the bee tree or the rock at the rapids" + (cond ((null arg) (format t "~&What do you want to climb?")) + ((equalp (player-place player) "Bee tree") (climb-tree player arg)) + ((equalp (player-place player) "Rapids") (climb-rock player arg)))) + (let ((climbed NIL)) - (defun climb (player &optional arg) + (defun climb-tree (player &optional arg) "Try to climb the bee tree. Warning: bees sting, and trees are tall ;-)" (let ((place (get-game-object 'place (player-place player)))) (when climbed @@ -148,7 +154,23 @@ "Make sure you've climbed down before leaving the bee tree." (when climbed (climb-down player) (read-line)))) +(let ((honey-found NIL)) + (defun climb-rock (player &optional arg) + "Climb the rock at the rapids" + (if (> 25 (random 100)) + (progn (format t "~&You slip!") + (read-line) + (goto player "Stream")) + (progn (format t "~&You clamber up on the rock.") + (unless honey-found + (format t "~&You find a pot of honey!") + (set-object-attribute (get-game-object 'place (player-place player)) + 'item "Hunny") + (setf honey-found T)))))) + + (defun nap (player &optional arg) + "Take a nap in front of Pooh's house" (format t "~&You lie down on the bench and close your eyes.") (format t "~&Slowly, you start drifting off to dream land...") (format t "~&~%Zzzzz Zzzzz Zzzzz") @@ -157,6 +179,18 @@ (format t "~&You feel better. +1 HP") (change-player-health player 1))) +(defun ring (player &optional arg) + "Ring the bell at Owl's porch" + (let ((place (get-game-object 'place (player-place player)))) + (if (member "bellrope" (list-place-objects 'item place) :test #'equalp) + (format t "~&You pull the bellrope. A loud ringing can be heard from inside.") + (format t "~&Try as you might, you cannot find a bellrope to pull. You knock instead."))) + (let ((consequences '("Nothing happens. Owl hasn't been too good of hearing lately..." + "Nobody answers. Perhaps you should ring louder?" + "You wait, but nobody comes. You can hear noises inside, though." + "Nothing happens." "Nobody answers." "No reply."))) + (format t "~&~A" (random-elt consequences)))) + ;; The golden ring is an easter egg referencing, of course, ;; The Lord of the Rings. diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 5c89188..02290e4 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -49,6 +49,15 @@ " fixed +define-item "Rock" + description "A large rock sitting right in the middle of the rapids. Looks like + a great place for a picknick!" + fixed + +define-item "Stone" + description "A pretty little pebble, very colourful and worn smooth by the water." + infinite + define-item "Berries" description "Scrumptious, fresh wild berries: blueberries, blackberries, strawberries... Just don't eat too many!" diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index b72be80..211d6bd 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -92,8 +92,14 @@ "A wrapper function for lost-in-the-forest for the deep forest location" (lost-in-the-forest player "Deep forest" 40)) +(defun climb (player &optional arg) + "Climb something - currently either the bee tree or the rock at the rapids" + (cond ((null arg) (format t "~&What do you want to climb?")) + ((equalp (player-place player) "Bee tree") (climb-tree player arg)) + ((equalp (player-place player) "Rapids") (climb-rock player arg)))) + (let ((climbed NIL)) - (defun climb (player &optional arg) + (defun climb-tree (player &optional arg) "Try to climb the bee tree. Warning: bees sting, and trees are tall ;-)" (let ((place (get-game-object 'place (player-place player)))) (when climbed @@ -148,7 +154,23 @@ "Make sure you've climbed down before leaving the bee tree." (when climbed (climb-down player) (read-line)))) +(let ((honey-found NIL)) + (defun climb-rock (player &optional arg) + "Climb the rock at the rapids" + (if (> 25 (random 100)) + (progn (format t "~&You slip!") + (read-line) + (goto player "Stream")) + (progn (format t "~&You clamber up on the rock.") + (unless honey-found + (format t "~&You find a pot of honey!") + (set-object-attribute (get-game-object 'place (player-place player)) + 'item "Hunny") + (setf honey-found T)))))) + + (defun nap (player &optional arg) + "Take a nap in front of Pooh's house" (format t "~&You lie down on the bench and close your eyes.") (format t "~&Slowly, you start drifting off to dream land...") (format t "~&~%Zzzzz Zzzzz Zzzzz") @@ -157,6 +179,18 @@ (format t "~&You feel better. +1 HP") (change-player-health player 1))) +(defun ring (player &optional arg) + "Ring the bell at Owl's porch" + (let ((place (get-game-object 'place (player-place player)))) + (if (member "bellrope" (list-place-objects 'item place) :test #'equalp) + (format t "~&You pull the bellrope. A loud ringing can be heard from inside.") + (format t "~&Try as you might, you cannot find a bellrope to pull. You knock instead."))) + (let ((consequences '("Nothing happens. Owl hasn't been too good of hearing lately..." + "Nobody answers. Perhaps you should ring louder?" + "You wait, but nobody comes. You can hear noises inside, though." + "Nothing happens." "Nobody answers." "No reply."))) + (format t "~&~A" (random-elt consequences)))) + ;; The golden ring is an easter egg referencing, of course, ;; The Lord of the Rings. diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 058781b..61cbc2f 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -16,7 +16,8 @@ define-player "Winnie the Pooh" description "A small but lovable bear of Very Little Brain." - place "Pooh's home" + ;place "Pooh's home" + place "Rapids" max-health 20 health 20 strength 1 diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 5c89188..02290e4 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -49,6 +49,15 @@ " fixed +define-item "Rock" + description "A large rock sitting right in the middle of the rapids. Looks like + a great place for a picknick!" + fixed + +define-item "Stone" + description "A pretty little pebble, very colourful and worn smooth by the water." + infinite + define-item "Berries" description "Scrumptious, fresh wild berries: blueberries, blackberries, strawberries... Just don't eat too many!" diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index b72be80..211d6bd 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -92,8 +92,14 @@ "A wrapper function for lost-in-the-forest for the deep forest location" (lost-in-the-forest player "Deep forest" 40)) +(defun climb (player &optional arg) + "Climb something - currently either the bee tree or the rock at the rapids" + (cond ((null arg) (format t "~&What do you want to climb?")) + ((equalp (player-place player) "Bee tree") (climb-tree player arg)) + ((equalp (player-place player) "Rapids") (climb-rock player arg)))) + (let ((climbed NIL)) - (defun climb (player &optional arg) + (defun climb-tree (player &optional arg) "Try to climb the bee tree. Warning: bees sting, and trees are tall ;-)" (let ((place (get-game-object 'place (player-place player)))) (when climbed @@ -148,7 +154,23 @@ "Make sure you've climbed down before leaving the bee tree." (when climbed (climb-down player) (read-line)))) +(let ((honey-found NIL)) + (defun climb-rock (player &optional arg) + "Climb the rock at the rapids" + (if (> 25 (random 100)) + (progn (format t "~&You slip!") + (read-line) + (goto player "Stream")) + (progn (format t "~&You clamber up on the rock.") + (unless honey-found + (format t "~&You find a pot of honey!") + (set-object-attribute (get-game-object 'place (player-place player)) + 'item "Hunny") + (setf honey-found T)))))) + + (defun nap (player &optional arg) + "Take a nap in front of Pooh's house" (format t "~&You lie down on the bench and close your eyes.") (format t "~&Slowly, you start drifting off to dream land...") (format t "~&~%Zzzzz Zzzzz Zzzzz") @@ -157,6 +179,18 @@ (format t "~&You feel better. +1 HP") (change-player-health player 1))) +(defun ring (player &optional arg) + "Ring the bell at Owl's porch" + (let ((place (get-game-object 'place (player-place player)))) + (if (member "bellrope" (list-place-objects 'item place) :test #'equalp) + (format t "~&You pull the bellrope. A loud ringing can be heard from inside.") + (format t "~&Try as you might, you cannot find a bellrope to pull. You knock instead."))) + (let ((consequences '("Nothing happens. Owl hasn't been too good of hearing lately..." + "Nobody answers. Perhaps you should ring louder?" + "You wait, but nobody comes. You can hear noises inside, though." + "Nothing happens." "Nobody answers." "No reply."))) + (format t "~&~A" (random-elt consequences)))) + ;; The golden ring is an easter egg referencing, of course, ;; The Lord of the Rings. diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 058781b..61cbc2f 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -16,7 +16,8 @@ define-player "Winnie the Pooh" description "A small but lovable bear of Very Little Brain." - place "Pooh's home" + ;place "Pooh's home" + place "Rapids" max-health 20 health 20 strength 1 diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 038e39a..df9196b 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -229,11 +229,16 @@ neighbour "Rabbit's house" define-place "Rapids" - description "TODO" + description "The rapids are a series of pools in the stream, connected by + small waterfalls. The stream chatters lustily as it bubbles + over the many rocks. Mind you don't fall in!" item "North Pole" + item "Rock" + item "Stone" neighbour "Northern woods" neighbour "Misty forest" neighbour "Stream" + command "climb" define-place "Stream" description "Whoops! You fell in! Brrr, this water is cold! Better get out @@ -252,6 +257,7 @@ neighbour "Owl's home" neighbour "Eastern woods" neighbour "Central woods" + command "ring" define-place "Owl's home" description "TODO" diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 5c89188..02290e4 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -49,6 +49,15 @@ " fixed +define-item "Rock" + description "A large rock sitting right in the middle of the rapids. Looks like + a great place for a picknick!" + fixed + +define-item "Stone" + description "A pretty little pebble, very colourful and worn smooth by the water." + infinite + define-item "Berries" description "Scrumptious, fresh wild berries: blueberries, blackberries, strawberries... Just don't eat too many!" diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index b72be80..211d6bd 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -92,8 +92,14 @@ "A wrapper function for lost-in-the-forest for the deep forest location" (lost-in-the-forest player "Deep forest" 40)) +(defun climb (player &optional arg) + "Climb something - currently either the bee tree or the rock at the rapids" + (cond ((null arg) (format t "~&What do you want to climb?")) + ((equalp (player-place player) "Bee tree") (climb-tree player arg)) + ((equalp (player-place player) "Rapids") (climb-rock player arg)))) + (let ((climbed NIL)) - (defun climb (player &optional arg) + (defun climb-tree (player &optional arg) "Try to climb the bee tree. Warning: bees sting, and trees are tall ;-)" (let ((place (get-game-object 'place (player-place player)))) (when climbed @@ -148,7 +154,23 @@ "Make sure you've climbed down before leaving the bee tree." (when climbed (climb-down player) (read-line)))) +(let ((honey-found NIL)) + (defun climb-rock (player &optional arg) + "Climb the rock at the rapids" + (if (> 25 (random 100)) + (progn (format t "~&You slip!") + (read-line) + (goto player "Stream")) + (progn (format t "~&You clamber up on the rock.") + (unless honey-found + (format t "~&You find a pot of honey!") + (set-object-attribute (get-game-object 'place (player-place player)) + 'item "Hunny") + (setf honey-found T)))))) + + (defun nap (player &optional arg) + "Take a nap in front of Pooh's house" (format t "~&You lie down on the bench and close your eyes.") (format t "~&Slowly, you start drifting off to dream land...") (format t "~&~%Zzzzz Zzzzz Zzzzz") @@ -157,6 +179,18 @@ (format t "~&You feel better. +1 HP") (change-player-health player 1))) +(defun ring (player &optional arg) + "Ring the bell at Owl's porch" + (let ((place (get-game-object 'place (player-place player)))) + (if (member "bellrope" (list-place-objects 'item place) :test #'equalp) + (format t "~&You pull the bellrope. A loud ringing can be heard from inside.") + (format t "~&Try as you might, you cannot find a bellrope to pull. You knock instead."))) + (let ((consequences '("Nothing happens. Owl hasn't been too good of hearing lately..." + "Nobody answers. Perhaps you should ring louder?" + "You wait, but nobody comes. You can hear noises inside, though." + "Nothing happens." "Nobody answers." "No reply."))) + (format t "~&~A" (random-elt consequences)))) + ;; The golden ring is an easter egg referencing, of course, ;; The Lord of the Rings. diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 058781b..61cbc2f 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -16,7 +16,8 @@ define-player "Winnie the Pooh" description "A small but lovable bear of Very Little Brain." - place "Pooh's home" + ;place "Pooh's home" + place "Rapids" max-health 20 health 20 strength 1 diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 038e39a..df9196b 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -229,11 +229,16 @@ neighbour "Rabbit's house" define-place "Rapids" - description "TODO" + description "The rapids are a series of pools in the stream, connected by + small waterfalls. The stream chatters lustily as it bubbles + over the many rocks. Mind you don't fall in!" item "North Pole" + item "Rock" + item "Stone" neighbour "Northern woods" neighbour "Misty forest" neighbour "Stream" + command "climb" define-place "Stream" description "Whoops! You fell in! Brrr, this water is cold! Better get out @@ -252,6 +257,7 @@ neighbour "Owl's home" neighbour "Eastern woods" neighbour "Central woods" + command "ring" define-place "Owl's home" description "TODO" diff --git a/doc/TODO b/doc/TODO index d7927b9..144f2a0 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,13 +1,12 @@ ATLANTIS TODO LISP -* only display non-nil object lists in the place description -* remove (magic) from the code +* add (expand-commands) function that guesses full commands + based on a user's abbreviated input (e.g. 'look' from 'l') ATL * fill in missing place descriptions -* hide 4 more pots of honey +* hide 3 more pots of honey * require XP minimum to finish game? * think of more quests * integrate the quests to lead the player through the game -* add 'ring' command at Owl's porch diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 5c89188..02290e4 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -49,6 +49,15 @@ " fixed +define-item "Rock" + description "A large rock sitting right in the middle of the rapids. Looks like + a great place for a picknick!" + fixed + +define-item "Stone" + description "A pretty little pebble, very colourful and worn smooth by the water." + infinite + define-item "Berries" description "Scrumptious, fresh wild berries: blueberries, blackberries, strawberries... Just don't eat too many!" diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index b72be80..211d6bd 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -92,8 +92,14 @@ "A wrapper function for lost-in-the-forest for the deep forest location" (lost-in-the-forest player "Deep forest" 40)) +(defun climb (player &optional arg) + "Climb something - currently either the bee tree or the rock at the rapids" + (cond ((null arg) (format t "~&What do you want to climb?")) + ((equalp (player-place player) "Bee tree") (climb-tree player arg)) + ((equalp (player-place player) "Rapids") (climb-rock player arg)))) + (let ((climbed NIL)) - (defun climb (player &optional arg) + (defun climb-tree (player &optional arg) "Try to climb the bee tree. Warning: bees sting, and trees are tall ;-)" (let ((place (get-game-object 'place (player-place player)))) (when climbed @@ -148,7 +154,23 @@ "Make sure you've climbed down before leaving the bee tree." (when climbed (climb-down player) (read-line)))) +(let ((honey-found NIL)) + (defun climb-rock (player &optional arg) + "Climb the rock at the rapids" + (if (> 25 (random 100)) + (progn (format t "~&You slip!") + (read-line) + (goto player "Stream")) + (progn (format t "~&You clamber up on the rock.") + (unless honey-found + (format t "~&You find a pot of honey!") + (set-object-attribute (get-game-object 'place (player-place player)) + 'item "Hunny") + (setf honey-found T)))))) + + (defun nap (player &optional arg) + "Take a nap in front of Pooh's house" (format t "~&You lie down on the bench and close your eyes.") (format t "~&Slowly, you start drifting off to dream land...") (format t "~&~%Zzzzz Zzzzz Zzzzz") @@ -157,6 +179,18 @@ (format t "~&You feel better. +1 HP") (change-player-health player 1))) +(defun ring (player &optional arg) + "Ring the bell at Owl's porch" + (let ((place (get-game-object 'place (player-place player)))) + (if (member "bellrope" (list-place-objects 'item place) :test #'equalp) + (format t "~&You pull the bellrope. A loud ringing can be heard from inside.") + (format t "~&Try as you might, you cannot find a bellrope to pull. You knock instead."))) + (let ((consequences '("Nothing happens. Owl hasn't been too good of hearing lately..." + "Nobody answers. Perhaps you should ring louder?" + "You wait, but nobody comes. You can hear noises inside, though." + "Nothing happens." "Nobody answers." "No reply."))) + (format t "~&~A" (random-elt consequences)))) + ;; The golden ring is an easter egg referencing, of course, ;; The Lord of the Rings. diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 058781b..61cbc2f 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -16,7 +16,8 @@ define-player "Winnie the Pooh" description "A small but lovable bear of Very Little Brain." - place "Pooh's home" + ;place "Pooh's home" + place "Rapids" max-health 20 health 20 strength 1 diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 038e39a..df9196b 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -229,11 +229,16 @@ neighbour "Rabbit's house" define-place "Rapids" - description "TODO" + description "The rapids are a series of pools in the stream, connected by + small waterfalls. The stream chatters lustily as it bubbles + over the many rocks. Mind you don't fall in!" item "North Pole" + item "Rock" + item "Stone" neighbour "Northern woods" neighbour "Misty forest" neighbour "Stream" + command "climb" define-place "Stream" description "Whoops! You fell in! Brrr, this water is cold! Better get out @@ -252,6 +257,7 @@ neighbour "Owl's home" neighbour "Eastern woods" neighbour "Central woods" + command "ring" define-place "Owl's home" description "TODO" diff --git a/doc/TODO b/doc/TODO index d7927b9..144f2a0 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,13 +1,12 @@ ATLANTIS TODO LISP -* only display non-nil object lists in the place description -* remove (magic) from the code +* add (expand-commands) function that guesses full commands + based on a user's abbreviated input (e.g. 'look' from 'l') ATL * fill in missing place descriptions -* hide 4 more pots of honey +* hide 3 more pots of honey * require XP minimum to finish game? * think of more quests * integrate the quests to lead the player through the game -* add 'ring' command at Owl's porch diff --git a/lisp/ui.lisp b/lisp/ui.lisp index 291f4ac..a2d0a50 100644 --- a/lisp/ui.lisp +++ b/lisp/ui.lisp @@ -30,6 +30,7 @@ (let ((place (get-game-object 'place (player-place player)))) (describe-place place) (input-string command) + (while (zerop (length command)) (input-string command)) (while (not (and (or (equalp command "quit") (equalp command "exit")) (y-or-n-p "~&Really quit?"))) diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 5c89188..02290e4 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -49,6 +49,15 @@ " fixed +define-item "Rock" + description "A large rock sitting right in the middle of the rapids. Looks like + a great place for a picknick!" + fixed + +define-item "Stone" + description "A pretty little pebble, very colourful and worn smooth by the water." + infinite + define-item "Berries" description "Scrumptious, fresh wild berries: blueberries, blackberries, strawberries... Just don't eat too many!" diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index b72be80..211d6bd 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -92,8 +92,14 @@ "A wrapper function for lost-in-the-forest for the deep forest location" (lost-in-the-forest player "Deep forest" 40)) +(defun climb (player &optional arg) + "Climb something - currently either the bee tree or the rock at the rapids" + (cond ((null arg) (format t "~&What do you want to climb?")) + ((equalp (player-place player) "Bee tree") (climb-tree player arg)) + ((equalp (player-place player) "Rapids") (climb-rock player arg)))) + (let ((climbed NIL)) - (defun climb (player &optional arg) + (defun climb-tree (player &optional arg) "Try to climb the bee tree. Warning: bees sting, and trees are tall ;-)" (let ((place (get-game-object 'place (player-place player)))) (when climbed @@ -148,7 +154,23 @@ "Make sure you've climbed down before leaving the bee tree." (when climbed (climb-down player) (read-line)))) +(let ((honey-found NIL)) + (defun climb-rock (player &optional arg) + "Climb the rock at the rapids" + (if (> 25 (random 100)) + (progn (format t "~&You slip!") + (read-line) + (goto player "Stream")) + (progn (format t "~&You clamber up on the rock.") + (unless honey-found + (format t "~&You find a pot of honey!") + (set-object-attribute (get-game-object 'place (player-place player)) + 'item "Hunny") + (setf honey-found T)))))) + + (defun nap (player &optional arg) + "Take a nap in front of Pooh's house" (format t "~&You lie down on the bench and close your eyes.") (format t "~&Slowly, you start drifting off to dream land...") (format t "~&~%Zzzzz Zzzzz Zzzzz") @@ -157,6 +179,18 @@ (format t "~&You feel better. +1 HP") (change-player-health player 1))) +(defun ring (player &optional arg) + "Ring the bell at Owl's porch" + (let ((place (get-game-object 'place (player-place player)))) + (if (member "bellrope" (list-place-objects 'item place) :test #'equalp) + (format t "~&You pull the bellrope. A loud ringing can be heard from inside.") + (format t "~&Try as you might, you cannot find a bellrope to pull. You knock instead."))) + (let ((consequences '("Nothing happens. Owl hasn't been too good of hearing lately..." + "Nobody answers. Perhaps you should ring louder?" + "You wait, but nobody comes. You can hear noises inside, though." + "Nothing happens." "Nobody answers." "No reply."))) + (format t "~&~A" (random-elt consequences)))) + ;; The golden ring is an easter egg referencing, of course, ;; The Lord of the Rings. diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 058781b..61cbc2f 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -16,7 +16,8 @@ define-player "Winnie the Pooh" description "A small but lovable bear of Very Little Brain." - place "Pooh's home" + ;place "Pooh's home" + place "Rapids" max-health 20 health 20 strength 1 diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 038e39a..df9196b 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -229,11 +229,16 @@ neighbour "Rabbit's house" define-place "Rapids" - description "TODO" + description "The rapids are a series of pools in the stream, connected by + small waterfalls. The stream chatters lustily as it bubbles + over the many rocks. Mind you don't fall in!" item "North Pole" + item "Rock" + item "Stone" neighbour "Northern woods" neighbour "Misty forest" neighbour "Stream" + command "climb" define-place "Stream" description "Whoops! You fell in! Brrr, this water is cold! Better get out @@ -252,6 +257,7 @@ neighbour "Owl's home" neighbour "Eastern woods" neighbour "Central woods" + command "ring" define-place "Owl's home" description "TODO" diff --git a/doc/TODO b/doc/TODO index d7927b9..144f2a0 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,13 +1,12 @@ ATLANTIS TODO LISP -* only display non-nil object lists in the place description -* remove (magic) from the code +* add (expand-commands) function that guesses full commands + based on a user's abbreviated input (e.g. 'look' from 'l') ATL * fill in missing place descriptions -* hide 4 more pots of honey +* hide 3 more pots of honey * require XP minimum to finish game? * think of more quests * integrate the quests to lead the player through the game -* add 'ring' command at Owl's porch diff --git a/lisp/ui.lisp b/lisp/ui.lisp index 291f4ac..a2d0a50 100644 --- a/lisp/ui.lisp +++ b/lisp/ui.lisp @@ -30,6 +30,7 @@ (let ((place (get-game-object 'place (player-place player)))) (describe-place place) (input-string command) + (while (zerop (length command)) (input-string command)) (while (not (and (or (equalp command "quit") (equalp command "exit")) (y-or-n-p "~&Really quit?"))) diff --git a/lisp/util.lisp b/lisp/util.lisp index a5584be..5f8b9ec 100644 --- a/lisp/util.lisp +++ b/lisp/util.lisp @@ -109,6 +109,7 @@ ;; FIXME If (string-from-list) produces a string with linebreaks and is ;; used in conjunction with a (format t "~A") call, (format) will insert ;; an additional newline before the returned string. WTH?! +;; -> Appears to be a CLISP bug? Doesn't appear with SCBL... (defun string-from-list (lst &key (sep " - ") line-length line-sep) "Put all elements of lst into a single string, separated by sep" (unless line-sep ;; set the line separator to newline+tab