diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 73e7fbf..5c89188 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -73,11 +73,17 @@ to protect the wick and a metal grip by which to carry it. It's very useful for dark places." +define-item "Bench" + description "A tree trunk was sawed in half and placed on the ground to + make this bench. It looks very comfy - just the spot for a + quick nap..." + fixed + define-item "Map" description "This is a map of the 100 Acre Wood. The woods may not be that large, but it's still easy to get lost in them. So it may be a good idea to carry this around with you..." - command "map" + command "study" define-item "Life" description " diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 73e7fbf..5c89188 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -73,11 +73,17 @@ to protect the wick and a metal grip by which to carry it. It's very useful for dark places." +define-item "Bench" + description "A tree trunk was sawed in half and placed on the ground to + make this bench. It looks very comfy - just the spot for a + quick nap..." + fixed + define-item "Map" description "This is a map of the 100 Acre Wood. The woods may not be that large, but it's still easy to get lost in them. So it may be a good idea to carry this around with you..." - command "map" + command "study" define-item "Life" description " diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 44e6bf7..2f845a1 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -146,8 +146,17 @@ (defun leave-bee-tree (player) "Make sure you've climbed down before leaving the bee tree." - (when climbed (climb-down player)) - (read-line))) + (when climbed (climb-down player) (read-line)))) + +(defun nap (player &optional arg) + (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") + (format t "~&~%You wake up again.") + (when (< (player-health player) (player-max-health player)) + (format t "~&You feel better. +1 HP") + (change-player-health player 1))) + ;; 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 73e7fbf..5c89188 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -73,11 +73,17 @@ to protect the wick and a metal grip by which to carry it. It's very useful for dark places." +define-item "Bench" + description "A tree trunk was sawed in half and placed on the ground to + make this bench. It looks very comfy - just the spot for a + quick nap..." + fixed + define-item "Map" description "This is a map of the 100 Acre Wood. The woods may not be that large, but it's still easy to get lost in them. So it may be a good idea to carry this around with you..." - command "map" + command "study" define-item "Life" description " diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 44e6bf7..2f845a1 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -146,8 +146,17 @@ (defun leave-bee-tree (player) "Make sure you've climbed down before leaving the bee tree." - (when climbed (climb-down player)) - (read-line))) + (when climbed (climb-down player) (read-line)))) + +(defun nap (player &optional arg) + (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") + (format t "~&~%You wake up again.") + (when (< (player-health player) (player-max-health player)) + (format t "~&You feel better. +1 HP") + (change-player-health player 1))) + ;; The golden ring is an easter egg referencing, of course, ;; The Lord of the Rings. diff --git a/ATL/Pooh/woodland-map.lisp b/ATL/Pooh/woodland-map.lisp index 7527d19..68a8b9b 100644 --- a/ATL/Pooh/woodland-map.lisp +++ b/ATL/Pooh/woodland-map.lisp @@ -6,8 +6,11 @@ ; author: Daniel Vedder ; date: 31/07/2017 -(defun map (player &optional arg) +(defun study (player &optional arg) "Print out the map" + (unless (member 'map (extract-elements arg)) + (format t "~&What do you want to study?") + (return-from study)) (setf map-string " ..............................[ 100 ACRE WOODS ].............................. : : diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 73e7fbf..5c89188 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -73,11 +73,17 @@ to protect the wick and a metal grip by which to carry it. It's very useful for dark places." +define-item "Bench" + description "A tree trunk was sawed in half and placed on the ground to + make this bench. It looks very comfy - just the spot for a + quick nap..." + fixed + define-item "Map" description "This is a map of the 100 Acre Wood. The woods may not be that large, but it's still easy to get lost in them. So it may be a good idea to carry this around with you..." - command "map" + command "study" define-item "Life" description " diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 44e6bf7..2f845a1 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -146,8 +146,17 @@ (defun leave-bee-tree (player) "Make sure you've climbed down before leaving the bee tree." - (when climbed (climb-down player)) - (read-line))) + (when climbed (climb-down player) (read-line)))) + +(defun nap (player &optional arg) + (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") + (format t "~&~%You wake up again.") + (when (< (player-health player) (player-max-health player)) + (format t "~&You feel better. +1 HP") + (change-player-health player 1))) + ;; The golden ring is an easter egg referencing, of course, ;; The Lord of the Rings. diff --git a/ATL/Pooh/woodland-map.lisp b/ATL/Pooh/woodland-map.lisp index 7527d19..68a8b9b 100644 --- a/ATL/Pooh/woodland-map.lisp +++ b/ATL/Pooh/woodland-map.lisp @@ -6,8 +6,11 @@ ; author: Daniel Vedder ; date: 31/07/2017 -(defun map (player &optional arg) +(defun study (player &optional arg) "Print out the map" + (unless (member 'map (extract-elements arg)) + (format t "~&What do you want to study?") + (return-from study)) (setf map-string " ..............................[ 100 ACRE WOODS ].............................. : : diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 37507c9..038e39a 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -18,21 +18,21 @@ hidden "Lamp" ;XXX development define-place "Pooh's porch" - ;FIXME change description to first person - description "You are standing in front of Pooh's home. Here he lives under - the name 'Sanders', as anyone can see by the old sign planted - beside the door. A comfy-looking bench stands in the sun, inviting - you to a well-earned rest." + description "You are standing in front of your very own home - Pooh's home. + You live here under the name 'Sanders', as anyone can see + by the old sign planted beside the door. A comfy-looking + bench stands in the sun, inviting you to a well-earned rest." item "Pooh's sign" item "Letter" + item "Bench" neighbour "Pooh's home" neighbour "Western woods" + command "nap" define-place "Pooh's branch" - ;FIXME change description to first person - description "This is a thick branch above Pooh's home. Once, on a very - blustery day, Pooh had to escape to up here. Since then, he - keeps an emergency ration of honey handy." + description "This is a thick branch above your home. Once, on a very + blustery day, you had to escape to up here - since then, + you always keep an emergency ration of honey handy." neighbour "Pooh's home" neighbour "Pooh's porch" command "jump" diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 73e7fbf..5c89188 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -73,11 +73,17 @@ to protect the wick and a metal grip by which to carry it. It's very useful for dark places." +define-item "Bench" + description "A tree trunk was sawed in half and placed on the ground to + make this bench. It looks very comfy - just the spot for a + quick nap..." + fixed + define-item "Map" description "This is a map of the 100 Acre Wood. The woods may not be that large, but it's still easy to get lost in them. So it may be a good idea to carry this around with you..." - command "map" + command "study" define-item "Life" description " diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 44e6bf7..2f845a1 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -146,8 +146,17 @@ (defun leave-bee-tree (player) "Make sure you've climbed down before leaving the bee tree." - (when climbed (climb-down player)) - (read-line))) + (when climbed (climb-down player) (read-line)))) + +(defun nap (player &optional arg) + (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") + (format t "~&~%You wake up again.") + (when (< (player-health player) (player-max-health player)) + (format t "~&You feel better. +1 HP") + (change-player-health player 1))) + ;; The golden ring is an easter egg referencing, of course, ;; The Lord of the Rings. diff --git a/ATL/Pooh/woodland-map.lisp b/ATL/Pooh/woodland-map.lisp index 7527d19..68a8b9b 100644 --- a/ATL/Pooh/woodland-map.lisp +++ b/ATL/Pooh/woodland-map.lisp @@ -6,8 +6,11 @@ ; author: Daniel Vedder ; date: 31/07/2017 -(defun map (player &optional arg) +(defun study (player &optional arg) "Print out the map" + (unless (member 'map (extract-elements arg)) + (format t "~&What do you want to study?") + (return-from study)) (setf map-string " ..............................[ 100 ACRE WOODS ].............................. : : diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 37507c9..038e39a 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -18,21 +18,21 @@ hidden "Lamp" ;XXX development define-place "Pooh's porch" - ;FIXME change description to first person - description "You are standing in front of Pooh's home. Here he lives under - the name 'Sanders', as anyone can see by the old sign planted - beside the door. A comfy-looking bench stands in the sun, inviting - you to a well-earned rest." + description "You are standing in front of your very own home - Pooh's home. + You live here under the name 'Sanders', as anyone can see + by the old sign planted beside the door. A comfy-looking + bench stands in the sun, inviting you to a well-earned rest." item "Pooh's sign" item "Letter" + item "Bench" neighbour "Pooh's home" neighbour "Western woods" + command "nap" define-place "Pooh's branch" - ;FIXME change description to first person - description "This is a thick branch above Pooh's home. Once, on a very - blustery day, Pooh had to escape to up here. Since then, he - keeps an emergency ration of honey handy." + description "This is a thick branch above your home. Once, on a very + blustery day, you had to escape to up here - since then, + you always keep an emergency ration of honey handy." neighbour "Pooh's home" neighbour "Pooh's porch" command "jump" diff --git a/lisp/atlantis.lisp b/lisp/atlantis.lisp index e18346a..d2687ee 100644 --- a/lisp/atlantis.lisp +++ b/lisp/atlantis.lisp @@ -53,13 +53,16 @@ (setf world-file (concatenate 'string "../ATL/" world-file)) (load-file world-file) ;; let the player choose a character - (let* ((chars (list-world-objects 'player)) + (let* ((chars (append (list-world-objects 'player) + (list "Cancel"))) (char-name (first chars))) - (when (< 1 (length chars)) + (when (< 2 (length chars)) (format t "~&Which character do you want to play?") (setf char-name (choose-option chars))) (set-main-player char-name) - (play-game)))) + (if (equalp char-name "Cancel") + (start-menu) + (play-game))))) (1 (format t "~&What game file do you want to load?") (let ((game (choose-option (mapcar #'pathname-name (directory "../saves/*"))))) diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 73e7fbf..5c89188 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -73,11 +73,17 @@ to protect the wick and a metal grip by which to carry it. It's very useful for dark places." +define-item "Bench" + description "A tree trunk was sawed in half and placed on the ground to + make this bench. It looks very comfy - just the spot for a + quick nap..." + fixed + define-item "Map" description "This is a map of the 100 Acre Wood. The woods may not be that large, but it's still easy to get lost in them. So it may be a good idea to carry this around with you..." - command "map" + command "study" define-item "Life" description " diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 44e6bf7..2f845a1 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -146,8 +146,17 @@ (defun leave-bee-tree (player) "Make sure you've climbed down before leaving the bee tree." - (when climbed (climb-down player)) - (read-line))) + (when climbed (climb-down player) (read-line)))) + +(defun nap (player &optional arg) + (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") + (format t "~&~%You wake up again.") + (when (< (player-health player) (player-max-health player)) + (format t "~&You feel better. +1 HP") + (change-player-health player 1))) + ;; The golden ring is an easter egg referencing, of course, ;; The Lord of the Rings. diff --git a/ATL/Pooh/woodland-map.lisp b/ATL/Pooh/woodland-map.lisp index 7527d19..68a8b9b 100644 --- a/ATL/Pooh/woodland-map.lisp +++ b/ATL/Pooh/woodland-map.lisp @@ -6,8 +6,11 @@ ; author: Daniel Vedder ; date: 31/07/2017 -(defun map (player &optional arg) +(defun study (player &optional arg) "Print out the map" + (unless (member 'map (extract-elements arg)) + (format t "~&What do you want to study?") + (return-from study)) (setf map-string " ..............................[ 100 ACRE WOODS ].............................. : : diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 37507c9..038e39a 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -18,21 +18,21 @@ hidden "Lamp" ;XXX development define-place "Pooh's porch" - ;FIXME change description to first person - description "You are standing in front of Pooh's home. Here he lives under - the name 'Sanders', as anyone can see by the old sign planted - beside the door. A comfy-looking bench stands in the sun, inviting - you to a well-earned rest." + description "You are standing in front of your very own home - Pooh's home. + You live here under the name 'Sanders', as anyone can see + by the old sign planted beside the door. A comfy-looking + bench stands in the sun, inviting you to a well-earned rest." item "Pooh's sign" item "Letter" + item "Bench" neighbour "Pooh's home" neighbour "Western woods" + command "nap" define-place "Pooh's branch" - ;FIXME change description to first person - description "This is a thick branch above Pooh's home. Once, on a very - blustery day, Pooh had to escape to up here. Since then, he - keeps an emergency ration of honey handy." + description "This is a thick branch above your home. Once, on a very + blustery day, you had to escape to up here - since then, + you always keep an emergency ration of honey handy." neighbour "Pooh's home" neighbour "Pooh's porch" command "jump" diff --git a/lisp/atlantis.lisp b/lisp/atlantis.lisp index e18346a..d2687ee 100644 --- a/lisp/atlantis.lisp +++ b/lisp/atlantis.lisp @@ -53,13 +53,16 @@ (setf world-file (concatenate 'string "../ATL/" world-file)) (load-file world-file) ;; let the player choose a character - (let* ((chars (list-world-objects 'player)) + (let* ((chars (append (list-world-objects 'player) + (list "Cancel"))) (char-name (first chars))) - (when (< 1 (length chars)) + (when (< 2 (length chars)) (format t "~&Which character do you want to play?") (setf char-name (choose-option chars))) (set-main-player char-name) - (play-game)))) + (if (equalp char-name "Cancel") + (start-menu) + (play-game))))) (1 (format t "~&What game file do you want to load?") (let ((game (choose-option (mapcar #'pathname-name (directory "../saves/*"))))) diff --git a/lisp/ui.lisp b/lisp/ui.lisp index 9e01fab..58fe698 100644 --- a/lisp/ui.lisp +++ b/lisp/ui.lisp @@ -110,7 +110,7 @@ (defvar *commands* '(help look goto take drop talk trade - equip attack searc + equip attack search save clear)) ;;; The following commands don't take any arguments except for a player @@ -118,7 +118,7 @@ (defun help (player) "Print out a list of in-game commands" (setf help-text " -Commands: +COMMANDS: help - Show this list of game commands quit/exit - Exit the game clear - Clear the screen @@ -143,7 +143,7 @@ (defun clear (player) "Clear the screen (wrapper function)" (clear-screen) - (place player)) + (describe-place (player-place player))) ;;; These next functions have to take two arguments (the argument ;;; to the function and a player instance). @@ -386,6 +386,7 @@ (defun equip (player &optional new-weapon) "The player sets another item to be his weapon" + ;;XXX Replace this with 'hold'? (Also possible for non-weapons.) (unless new-weapon (format t "~&Please specify a weapon to be equipped!") (return-from equip))