diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 88b3bad..2673367 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -182,17 +182,27 @@ (let ((honey-found NIL)) (defun climb-rock (player &optional arg) "Climb the rock at the rapids" - (if (> 25 (random 100)) + (if (> 33 (random 100)) (progn (format t "~&You slip!") - (read-line) + (sleep 3) (goto player "Stream")) (progn (format t "~&You clamber up on the rock.") - (unless honey-found + (unless honey-found ;;FIXME fails when a saved game is loaded again (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 stream-current (player &optional arg) + "The stream sweeps the player on into the Floody place." + (when (> 75 (random 100)) + (describe-place "Stream") + (format t "~&~%You struggle to get back to the banks.") (sleep 5) + (format t "~&You fight against the rushing water, but it's stronger than you.") (sleep 2) + (format t "~&The stream pulls you along.") (sleep 3) + (format t "~&It finally deposits you in a floody place.") (sleep 2) + (goto player "Floody place") (clear-screen))) + (defun play (player &optional arg) "Let the player play a game" (let ((place (player-place player))) @@ -212,8 +222,9 @@ (60 (format t "~&You pile up sand for a big strong keep in the center.")) (80 (format t "~&You decorate the castle, adding pretty little details.")) (100 (format t "~&You stand back and admire your handiwork. What a fine castle!") - (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle"))) - (unless (= sandcastle 100) (incf sandcastle 20)))) + (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle")) + (110 (format t "~&You've already built a sandcastle here! And a fine one it is too..."))) + (unless (= sandcastle 110) (incf sandcastle 20)))) (let ((score 0)) (defun poohsticks (player) @@ -264,7 +275,8 @@ (if (member 'ring (extract-elements arg)) (progn (format t "~&You slip the golden ring on your finger.") (sleep 1) - (format t "~&You feel something ought to happen.~&Nothing does.")) + (format t "~&You feel something ought to happen.") (sleep 2) + (format t "~&Nothing does.")) (format t "~&What do you want to wear?"))) (defun ring-of-destiny (player) @@ -274,7 +286,9 @@ (defun annoying-ring (player) "The ring cannot be dropped!" (format t "~&You feel a stab of pain in your heart as you watch the ring drop.") + (sleep 1) (format t "~&On second thoughts, you pick it up again.~%~%") + (sleep 1) (take player "Golden ring")) diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 88b3bad..2673367 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -182,17 +182,27 @@ (let ((honey-found NIL)) (defun climb-rock (player &optional arg) "Climb the rock at the rapids" - (if (> 25 (random 100)) + (if (> 33 (random 100)) (progn (format t "~&You slip!") - (read-line) + (sleep 3) (goto player "Stream")) (progn (format t "~&You clamber up on the rock.") - (unless honey-found + (unless honey-found ;;FIXME fails when a saved game is loaded again (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 stream-current (player &optional arg) + "The stream sweeps the player on into the Floody place." + (when (> 75 (random 100)) + (describe-place "Stream") + (format t "~&~%You struggle to get back to the banks.") (sleep 5) + (format t "~&You fight against the rushing water, but it's stronger than you.") (sleep 2) + (format t "~&The stream pulls you along.") (sleep 3) + (format t "~&It finally deposits you in a floody place.") (sleep 2) + (goto player "Floody place") (clear-screen))) + (defun play (player &optional arg) "Let the player play a game" (let ((place (player-place player))) @@ -212,8 +222,9 @@ (60 (format t "~&You pile up sand for a big strong keep in the center.")) (80 (format t "~&You decorate the castle, adding pretty little details.")) (100 (format t "~&You stand back and admire your handiwork. What a fine castle!") - (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle"))) - (unless (= sandcastle 100) (incf sandcastle 20)))) + (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle")) + (110 (format t "~&You've already built a sandcastle here! And a fine one it is too..."))) + (unless (= sandcastle 110) (incf sandcastle 20)))) (let ((score 0)) (defun poohsticks (player) @@ -264,7 +275,8 @@ (if (member 'ring (extract-elements arg)) (progn (format t "~&You slip the golden ring on your finger.") (sleep 1) - (format t "~&You feel something ought to happen.~&Nothing does.")) + (format t "~&You feel something ought to happen.") (sleep 2) + (format t "~&Nothing does.")) (format t "~&What do you want to wear?"))) (defun ring-of-destiny (player) @@ -274,7 +286,9 @@ (defun annoying-ring (player) "The ring cannot be dropped!" (format t "~&You feel a stab of pain in your heart as you watch the ring drop.") + (sleep 1) (format t "~&On second thoughts, you pick it up again.~%~%") + (sleep 1) (take player "Golden ring")) diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 6ec8224..5300102 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -22,5 +22,4 @@ define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Piglet's porch" ;Development - ;place "Christopher Robin's house" \ No newline at end of file + place "Rapids" ;Development \ No newline at end of file diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 88b3bad..2673367 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -182,17 +182,27 @@ (let ((honey-found NIL)) (defun climb-rock (player &optional arg) "Climb the rock at the rapids" - (if (> 25 (random 100)) + (if (> 33 (random 100)) (progn (format t "~&You slip!") - (read-line) + (sleep 3) (goto player "Stream")) (progn (format t "~&You clamber up on the rock.") - (unless honey-found + (unless honey-found ;;FIXME fails when a saved game is loaded again (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 stream-current (player &optional arg) + "The stream sweeps the player on into the Floody place." + (when (> 75 (random 100)) + (describe-place "Stream") + (format t "~&~%You struggle to get back to the banks.") (sleep 5) + (format t "~&You fight against the rushing water, but it's stronger than you.") (sleep 2) + (format t "~&The stream pulls you along.") (sleep 3) + (format t "~&It finally deposits you in a floody place.") (sleep 2) + (goto player "Floody place") (clear-screen))) + (defun play (player &optional arg) "Let the player play a game" (let ((place (player-place player))) @@ -212,8 +222,9 @@ (60 (format t "~&You pile up sand for a big strong keep in the center.")) (80 (format t "~&You decorate the castle, adding pretty little details.")) (100 (format t "~&You stand back and admire your handiwork. What a fine castle!") - (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle"))) - (unless (= sandcastle 100) (incf sandcastle 20)))) + (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle")) + (110 (format t "~&You've already built a sandcastle here! And a fine one it is too..."))) + (unless (= sandcastle 110) (incf sandcastle 20)))) (let ((score 0)) (defun poohsticks (player) @@ -264,7 +275,8 @@ (if (member 'ring (extract-elements arg)) (progn (format t "~&You slip the golden ring on your finger.") (sleep 1) - (format t "~&You feel something ought to happen.~&Nothing does.")) + (format t "~&You feel something ought to happen.") (sleep 2) + (format t "~&Nothing does.")) (format t "~&What do you want to wear?"))) (defun ring-of-destiny (player) @@ -274,7 +286,9 @@ (defun annoying-ring (player) "The ring cannot be dropped!" (format t "~&You feel a stab of pain in your heart as you watch the ring drop.") + (sleep 1) (format t "~&On second thoughts, you pick it up again.~%~%") + (sleep 1) (take player "Golden ring")) diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 6ec8224..5300102 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -22,5 +22,4 @@ define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Piglet's porch" ;Development - ;place "Christopher Robin's house" \ No newline at end of file + place "Rapids" ;Development \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 4172058..e6abda4 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -273,8 +273,9 @@ description "Whoops! You fell in! Brrr, this water is cold! Better get out quickly. But that is easier said than done, the current here is pretty strong..." + neighbour "Rapids" neighbour "Floody place" - hidden "Golden ring" + entry-hook "stream-current" define-place "Christopher Robin's house" description "TODO" @@ -294,11 +295,17 @@ neighbour "Owl's porch" define-place "Floody place" - description "TODO" + description "The stream that flows through the forest disappears here, + forming a marshy area before it reappears further on. The ground + is very boggy here, take care that you don't get stuck. There + are also a lot of flies and mosquitoes buzzing around - not + a particularly comfortable place to be!" + neighbour "Stream" neighbour "Southern woods" neighbour "Eeyore's gloomy place" neighbour "Bridge" - + hidden "Golden ring" + define-place "Eeyore's gloomy place" description "TODO" npc "Eeyore" diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 88b3bad..2673367 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -182,17 +182,27 @@ (let ((honey-found NIL)) (defun climb-rock (player &optional arg) "Climb the rock at the rapids" - (if (> 25 (random 100)) + (if (> 33 (random 100)) (progn (format t "~&You slip!") - (read-line) + (sleep 3) (goto player "Stream")) (progn (format t "~&You clamber up on the rock.") - (unless honey-found + (unless honey-found ;;FIXME fails when a saved game is loaded again (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 stream-current (player &optional arg) + "The stream sweeps the player on into the Floody place." + (when (> 75 (random 100)) + (describe-place "Stream") + (format t "~&~%You struggle to get back to the banks.") (sleep 5) + (format t "~&You fight against the rushing water, but it's stronger than you.") (sleep 2) + (format t "~&The stream pulls you along.") (sleep 3) + (format t "~&It finally deposits you in a floody place.") (sleep 2) + (goto player "Floody place") (clear-screen))) + (defun play (player &optional arg) "Let the player play a game" (let ((place (player-place player))) @@ -212,8 +222,9 @@ (60 (format t "~&You pile up sand for a big strong keep in the center.")) (80 (format t "~&You decorate the castle, adding pretty little details.")) (100 (format t "~&You stand back and admire your handiwork. What a fine castle!") - (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle"))) - (unless (= sandcastle 100) (incf sandcastle 20)))) + (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle")) + (110 (format t "~&You've already built a sandcastle here! And a fine one it is too..."))) + (unless (= sandcastle 110) (incf sandcastle 20)))) (let ((score 0)) (defun poohsticks (player) @@ -264,7 +275,8 @@ (if (member 'ring (extract-elements arg)) (progn (format t "~&You slip the golden ring on your finger.") (sleep 1) - (format t "~&You feel something ought to happen.~&Nothing does.")) + (format t "~&You feel something ought to happen.") (sleep 2) + (format t "~&Nothing does.")) (format t "~&What do you want to wear?"))) (defun ring-of-destiny (player) @@ -274,7 +286,9 @@ (defun annoying-ring (player) "The ring cannot be dropped!" (format t "~&You feel a stab of pain in your heart as you watch the ring drop.") + (sleep 1) (format t "~&On second thoughts, you pick it up again.~%~%") + (sleep 1) (take player "Golden ring")) diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 6ec8224..5300102 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -22,5 +22,4 @@ define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Piglet's porch" ;Development - ;place "Christopher Robin's house" \ No newline at end of file + place "Rapids" ;Development \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 4172058..e6abda4 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -273,8 +273,9 @@ description "Whoops! You fell in! Brrr, this water is cold! Better get out quickly. But that is easier said than done, the current here is pretty strong..." + neighbour "Rapids" neighbour "Floody place" - hidden "Golden ring" + entry-hook "stream-current" define-place "Christopher Robin's house" description "TODO" @@ -294,11 +295,17 @@ neighbour "Owl's porch" define-place "Floody place" - description "TODO" + description "The stream that flows through the forest disappears here, + forming a marshy area before it reappears further on. The ground + is very boggy here, take care that you don't get stuck. There + are also a lot of flies and mosquitoes buzzing around - not + a particularly comfortable place to be!" + neighbour "Stream" neighbour "Southern woods" neighbour "Eeyore's gloomy place" neighbour "Bridge" - + hidden "Golden ring" + define-place "Eeyore's gloomy place" description "TODO" npc "Eeyore" diff --git a/doc/COMMANDS b/doc/COMMANDS index 2ab862a..8fc16ec 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -14,7 +14,6 @@ seek - Search for hidden items equip - Equip this item as your weapon attack - Fight a monster -save [] - Save the game to file Arguments in square brackets are optional, arguments in angular brackets denote place fillers. diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 88b3bad..2673367 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -182,17 +182,27 @@ (let ((honey-found NIL)) (defun climb-rock (player &optional arg) "Climb the rock at the rapids" - (if (> 25 (random 100)) + (if (> 33 (random 100)) (progn (format t "~&You slip!") - (read-line) + (sleep 3) (goto player "Stream")) (progn (format t "~&You clamber up on the rock.") - (unless honey-found + (unless honey-found ;;FIXME fails when a saved game is loaded again (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 stream-current (player &optional arg) + "The stream sweeps the player on into the Floody place." + (when (> 75 (random 100)) + (describe-place "Stream") + (format t "~&~%You struggle to get back to the banks.") (sleep 5) + (format t "~&You fight against the rushing water, but it's stronger than you.") (sleep 2) + (format t "~&The stream pulls you along.") (sleep 3) + (format t "~&It finally deposits you in a floody place.") (sleep 2) + (goto player "Floody place") (clear-screen))) + (defun play (player &optional arg) "Let the player play a game" (let ((place (player-place player))) @@ -212,8 +222,9 @@ (60 (format t "~&You pile up sand for a big strong keep in the center.")) (80 (format t "~&You decorate the castle, adding pretty little details.")) (100 (format t "~&You stand back and admire your handiwork. What a fine castle!") - (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle"))) - (unless (= sandcastle 100) (incf sandcastle 20)))) + (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle")) + (110 (format t "~&You've already built a sandcastle here! And a fine one it is too..."))) + (unless (= sandcastle 110) (incf sandcastle 20)))) (let ((score 0)) (defun poohsticks (player) @@ -264,7 +275,8 @@ (if (member 'ring (extract-elements arg)) (progn (format t "~&You slip the golden ring on your finger.") (sleep 1) - (format t "~&You feel something ought to happen.~&Nothing does.")) + (format t "~&You feel something ought to happen.") (sleep 2) + (format t "~&Nothing does.")) (format t "~&What do you want to wear?"))) (defun ring-of-destiny (player) @@ -274,7 +286,9 @@ (defun annoying-ring (player) "The ring cannot be dropped!" (format t "~&You feel a stab of pain in your heart as you watch the ring drop.") + (sleep 1) (format t "~&On second thoughts, you pick it up again.~%~%") + (sleep 1) (take player "Golden ring")) diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 6ec8224..5300102 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -22,5 +22,4 @@ define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Piglet's porch" ;Development - ;place "Christopher Robin's house" \ No newline at end of file + place "Rapids" ;Development \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 4172058..e6abda4 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -273,8 +273,9 @@ description "Whoops! You fell in! Brrr, this water is cold! Better get out quickly. But that is easier said than done, the current here is pretty strong..." + neighbour "Rapids" neighbour "Floody place" - hidden "Golden ring" + entry-hook "stream-current" define-place "Christopher Robin's house" description "TODO" @@ -294,11 +295,17 @@ neighbour "Owl's porch" define-place "Floody place" - description "TODO" + description "The stream that flows through the forest disappears here, + forming a marshy area before it reappears further on. The ground + is very boggy here, take care that you don't get stuck. There + are also a lot of flies and mosquitoes buzzing around - not + a particularly comfortable place to be!" + neighbour "Stream" neighbour "Southern woods" neighbour "Eeyore's gloomy place" neighbour "Bridge" - + hidden "Golden ring" + define-place "Eeyore's gloomy place" description "TODO" npc "Eeyore" diff --git a/doc/COMMANDS b/doc/COMMANDS index 2ab862a..8fc16ec 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -14,7 +14,6 @@ seek - Search for hidden items equip - Equip this item as your weapon attack - Fight a monster -save [] - Save the game to file Arguments in square brackets are optional, arguments in angular brackets denote place fillers. diff --git a/doc/PLAYING b/doc/PLAYING index 3ea7958..e68c5ad 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -23,14 +23,17 @@ and pressing ENTER. (Commands to the computer must always be terminated by pressing ENTER.) -The first option, "Start a new game", drops you into a submenu in which you can +## TODO Include autosave! + +The first option, "Start a new game", will first ask you for your name. (This is +needed to save the game.) It then drops you into a submenu in which you can choose which game world you want to play. As of Atlantis 0.3, only the "Winnie the Pooh" world is fully functional. (You can try the others, but they are far from complete.) -The second option, "Load a game", is for returning users who have previously -saved their game progress in one of the worlds. Again, you will be presented -with a submenu that lists all currently saved games. +The second option, "Load a saved game", is for players who have already started +a game in one of the worlds. (Your game progress is saved automatically.) Again, +you will be presented with a submenu that lists all currently saved games. The third option is for developers and need not concern us further. @@ -53,7 +56,7 @@ commands, along with a short description. This is very useful! If you want to stop playing, you can use the commands "quit" or "exit". Don't -forget to save your progress first, though! +worry, your game progress will be saved when you leave. Note that although capitalization does not matter in Atlantis, spelling does. So if you get an error message telling you that a command is not available, make @@ -136,11 +139,6 @@ the various commands. With "clear" you delete all text except the place description. -save - If you've made good progress in a game world but cannot finish the game - in one sitting, you will want to save your work. The "save" command will - ask you for a file name to save the game under, then store it for later - retrieval (via the "Load a game" option in the main menu). - Daniel Vedder -Last modified 10/10/2017 +Last modified 20/10/2017 diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 88b3bad..2673367 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -182,17 +182,27 @@ (let ((honey-found NIL)) (defun climb-rock (player &optional arg) "Climb the rock at the rapids" - (if (> 25 (random 100)) + (if (> 33 (random 100)) (progn (format t "~&You slip!") - (read-line) + (sleep 3) (goto player "Stream")) (progn (format t "~&You clamber up on the rock.") - (unless honey-found + (unless honey-found ;;FIXME fails when a saved game is loaded again (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 stream-current (player &optional arg) + "The stream sweeps the player on into the Floody place." + (when (> 75 (random 100)) + (describe-place "Stream") + (format t "~&~%You struggle to get back to the banks.") (sleep 5) + (format t "~&You fight against the rushing water, but it's stronger than you.") (sleep 2) + (format t "~&The stream pulls you along.") (sleep 3) + (format t "~&It finally deposits you in a floody place.") (sleep 2) + (goto player "Floody place") (clear-screen))) + (defun play (player &optional arg) "Let the player play a game" (let ((place (player-place player))) @@ -212,8 +222,9 @@ (60 (format t "~&You pile up sand for a big strong keep in the center.")) (80 (format t "~&You decorate the castle, adding pretty little details.")) (100 (format t "~&You stand back and admire your handiwork. What a fine castle!") - (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle"))) - (unless (= sandcastle 100) (incf sandcastle 20)))) + (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle")) + (110 (format t "~&You've already built a sandcastle here! And a fine one it is too..."))) + (unless (= sandcastle 110) (incf sandcastle 20)))) (let ((score 0)) (defun poohsticks (player) @@ -264,7 +275,8 @@ (if (member 'ring (extract-elements arg)) (progn (format t "~&You slip the golden ring on your finger.") (sleep 1) - (format t "~&You feel something ought to happen.~&Nothing does.")) + (format t "~&You feel something ought to happen.") (sleep 2) + (format t "~&Nothing does.")) (format t "~&What do you want to wear?"))) (defun ring-of-destiny (player) @@ -274,7 +286,9 @@ (defun annoying-ring (player) "The ring cannot be dropped!" (format t "~&You feel a stab of pain in your heart as you watch the ring drop.") + (sleep 1) (format t "~&On second thoughts, you pick it up again.~%~%") + (sleep 1) (take player "Golden ring")) diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 6ec8224..5300102 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -22,5 +22,4 @@ define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Piglet's porch" ;Development - ;place "Christopher Robin's house" \ No newline at end of file + place "Rapids" ;Development \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 4172058..e6abda4 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -273,8 +273,9 @@ description "Whoops! You fell in! Brrr, this water is cold! Better get out quickly. But that is easier said than done, the current here is pretty strong..." + neighbour "Rapids" neighbour "Floody place" - hidden "Golden ring" + entry-hook "stream-current" define-place "Christopher Robin's house" description "TODO" @@ -294,11 +295,17 @@ neighbour "Owl's porch" define-place "Floody place" - description "TODO" + description "The stream that flows through the forest disappears here, + forming a marshy area before it reappears further on. The ground + is very boggy here, take care that you don't get stuck. There + are also a lot of flies and mosquitoes buzzing around - not + a particularly comfortable place to be!" + neighbour "Stream" neighbour "Southern woods" neighbour "Eeyore's gloomy place" neighbour "Bridge" - + hidden "Golden ring" + define-place "Eeyore's gloomy place" description "TODO" npc "Eeyore" diff --git a/doc/COMMANDS b/doc/COMMANDS index 2ab862a..8fc16ec 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -14,7 +14,6 @@ seek - Search for hidden items equip - Equip this item as your weapon attack - Fight a monster -save [] - Save the game to file Arguments in square brackets are optional, arguments in angular brackets denote place fillers. diff --git a/doc/PLAYING b/doc/PLAYING index 3ea7958..e68c5ad 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -23,14 +23,17 @@ and pressing ENTER. (Commands to the computer must always be terminated by pressing ENTER.) -The first option, "Start a new game", drops you into a submenu in which you can +## TODO Include autosave! + +The first option, "Start a new game", will first ask you for your name. (This is +needed to save the game.) It then drops you into a submenu in which you can choose which game world you want to play. As of Atlantis 0.3, only the "Winnie the Pooh" world is fully functional. (You can try the others, but they are far from complete.) -The second option, "Load a game", is for returning users who have previously -saved their game progress in one of the worlds. Again, you will be presented -with a submenu that lists all currently saved games. +The second option, "Load a saved game", is for players who have already started +a game in one of the worlds. (Your game progress is saved automatically.) Again, +you will be presented with a submenu that lists all currently saved games. The third option is for developers and need not concern us further. @@ -53,7 +56,7 @@ commands, along with a short description. This is very useful! If you want to stop playing, you can use the commands "quit" or "exit". Don't -forget to save your progress first, though! +worry, your game progress will be saved when you leave. Note that although capitalization does not matter in Atlantis, spelling does. So if you get an error message telling you that a command is not available, make @@ -136,11 +139,6 @@ the various commands. With "clear" you delete all text except the place description. -save - If you've made good progress in a game world but cannot finish the game - in one sitting, you will want to save your work. The "save" command will - ask you for a file name to save the game under, then store it for later - retrieval (via the "Load a game" option in the main menu). - Daniel Vedder -Last modified 10/10/2017 +Last modified 20/10/2017 diff --git a/doc/TODO b/doc/TODO index 1d50250..887e41c 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,7 +1,6 @@ ATLANTIS TODO LISP -* implement autosave? * split ui.lisp into two modules (one for interaction functions) ATL diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 88b3bad..2673367 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -182,17 +182,27 @@ (let ((honey-found NIL)) (defun climb-rock (player &optional arg) "Climb the rock at the rapids" - (if (> 25 (random 100)) + (if (> 33 (random 100)) (progn (format t "~&You slip!") - (read-line) + (sleep 3) (goto player "Stream")) (progn (format t "~&You clamber up on the rock.") - (unless honey-found + (unless honey-found ;;FIXME fails when a saved game is loaded again (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 stream-current (player &optional arg) + "The stream sweeps the player on into the Floody place." + (when (> 75 (random 100)) + (describe-place "Stream") + (format t "~&~%You struggle to get back to the banks.") (sleep 5) + (format t "~&You fight against the rushing water, but it's stronger than you.") (sleep 2) + (format t "~&The stream pulls you along.") (sleep 3) + (format t "~&It finally deposits you in a floody place.") (sleep 2) + (goto player "Floody place") (clear-screen))) + (defun play (player &optional arg) "Let the player play a game" (let ((place (player-place player))) @@ -212,8 +222,9 @@ (60 (format t "~&You pile up sand for a big strong keep in the center.")) (80 (format t "~&You decorate the castle, adding pretty little details.")) (100 (format t "~&You stand back and admire your handiwork. What a fine castle!") - (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle"))) - (unless (= sandcastle 100) (incf sandcastle 20)))) + (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle")) + (110 (format t "~&You've already built a sandcastle here! And a fine one it is too..."))) + (unless (= sandcastle 110) (incf sandcastle 20)))) (let ((score 0)) (defun poohsticks (player) @@ -264,7 +275,8 @@ (if (member 'ring (extract-elements arg)) (progn (format t "~&You slip the golden ring on your finger.") (sleep 1) - (format t "~&You feel something ought to happen.~&Nothing does.")) + (format t "~&You feel something ought to happen.") (sleep 2) + (format t "~&Nothing does.")) (format t "~&What do you want to wear?"))) (defun ring-of-destiny (player) @@ -274,7 +286,9 @@ (defun annoying-ring (player) "The ring cannot be dropped!" (format t "~&You feel a stab of pain in your heart as you watch the ring drop.") + (sleep 1) (format t "~&On second thoughts, you pick it up again.~%~%") + (sleep 1) (take player "Golden ring")) diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 6ec8224..5300102 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -22,5 +22,4 @@ define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Piglet's porch" ;Development - ;place "Christopher Robin's house" \ No newline at end of file + place "Rapids" ;Development \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 4172058..e6abda4 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -273,8 +273,9 @@ description "Whoops! You fell in! Brrr, this water is cold! Better get out quickly. But that is easier said than done, the current here is pretty strong..." + neighbour "Rapids" neighbour "Floody place" - hidden "Golden ring" + entry-hook "stream-current" define-place "Christopher Robin's house" description "TODO" @@ -294,11 +295,17 @@ neighbour "Owl's porch" define-place "Floody place" - description "TODO" + description "The stream that flows through the forest disappears here, + forming a marshy area before it reappears further on. The ground + is very boggy here, take care that you don't get stuck. There + are also a lot of flies and mosquitoes buzzing around - not + a particularly comfortable place to be!" + neighbour "Stream" neighbour "Southern woods" neighbour "Eeyore's gloomy place" neighbour "Bridge" - + hidden "Golden ring" + define-place "Eeyore's gloomy place" description "TODO" npc "Eeyore" diff --git a/doc/COMMANDS b/doc/COMMANDS index 2ab862a..8fc16ec 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -14,7 +14,6 @@ seek - Search for hidden items equip - Equip this item as your weapon attack - Fight a monster -save [] - Save the game to file Arguments in square brackets are optional, arguments in angular brackets denote place fillers. diff --git a/doc/PLAYING b/doc/PLAYING index 3ea7958..e68c5ad 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -23,14 +23,17 @@ and pressing ENTER. (Commands to the computer must always be terminated by pressing ENTER.) -The first option, "Start a new game", drops you into a submenu in which you can +## TODO Include autosave! + +The first option, "Start a new game", will first ask you for your name. (This is +needed to save the game.) It then drops you into a submenu in which you can choose which game world you want to play. As of Atlantis 0.3, only the "Winnie the Pooh" world is fully functional. (You can try the others, but they are far from complete.) -The second option, "Load a game", is for returning users who have previously -saved their game progress in one of the worlds. Again, you will be presented -with a submenu that lists all currently saved games. +The second option, "Load a saved game", is for players who have already started +a game in one of the worlds. (Your game progress is saved automatically.) Again, +you will be presented with a submenu that lists all currently saved games. The third option is for developers and need not concern us further. @@ -53,7 +56,7 @@ commands, along with a short description. This is very useful! If you want to stop playing, you can use the commands "quit" or "exit". Don't -forget to save your progress first, though! +worry, your game progress will be saved when you leave. Note that although capitalization does not matter in Atlantis, spelling does. So if you get an error message telling you that a command is not available, make @@ -136,11 +139,6 @@ the various commands. With "clear" you delete all text except the place description. -save - If you've made good progress in a game world but cannot finish the game - in one sitting, you will want to save your work. The "save" command will - ask you for a file name to save the game under, then store it for later - retrieval (via the "Load a game" option in the main menu). - Daniel Vedder -Last modified 10/10/2017 +Last modified 20/10/2017 diff --git a/doc/TODO b/doc/TODO index 1d50250..887e41c 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,7 +1,6 @@ ATLANTIS TODO LISP -* implement autosave? * split ui.lisp into two modules (one for interaction functions) ATL diff --git a/doc/bugreport.txt b/doc/bugreport.txt index 934cb07..7b7f5aa 100644 --- a/doc/bugreport.txt +++ b/doc/bugreport.txt @@ -21,7 +21,7 @@ nicht korrekt. -> FIXED * Kann man gewollt vom Stream zum Floody Place, aber nicht umgekehrt? - -> Won't fix + -> FIXED * Beim Bee Tree wäre die Erwähnung von ‚climb down‘ ganz gut denke ich (auch wenn der command nicht notwendig ist). -> Won't fix diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 88b3bad..2673367 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -182,17 +182,27 @@ (let ((honey-found NIL)) (defun climb-rock (player &optional arg) "Climb the rock at the rapids" - (if (> 25 (random 100)) + (if (> 33 (random 100)) (progn (format t "~&You slip!") - (read-line) + (sleep 3) (goto player "Stream")) (progn (format t "~&You clamber up on the rock.") - (unless honey-found + (unless honey-found ;;FIXME fails when a saved game is loaded again (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 stream-current (player &optional arg) + "The stream sweeps the player on into the Floody place." + (when (> 75 (random 100)) + (describe-place "Stream") + (format t "~&~%You struggle to get back to the banks.") (sleep 5) + (format t "~&You fight against the rushing water, but it's stronger than you.") (sleep 2) + (format t "~&The stream pulls you along.") (sleep 3) + (format t "~&It finally deposits you in a floody place.") (sleep 2) + (goto player "Floody place") (clear-screen))) + (defun play (player &optional arg) "Let the player play a game" (let ((place (player-place player))) @@ -212,8 +222,9 @@ (60 (format t "~&You pile up sand for a big strong keep in the center.")) (80 (format t "~&You decorate the castle, adding pretty little details.")) (100 (format t "~&You stand back and admire your handiwork. What a fine castle!") - (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle"))) - (unless (= sandcastle 100) (incf sandcastle 20)))) + (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle")) + (110 (format t "~&You've already built a sandcastle here! And a fine one it is too..."))) + (unless (= sandcastle 110) (incf sandcastle 20)))) (let ((score 0)) (defun poohsticks (player) @@ -264,7 +275,8 @@ (if (member 'ring (extract-elements arg)) (progn (format t "~&You slip the golden ring on your finger.") (sleep 1) - (format t "~&You feel something ought to happen.~&Nothing does.")) + (format t "~&You feel something ought to happen.") (sleep 2) + (format t "~&Nothing does.")) (format t "~&What do you want to wear?"))) (defun ring-of-destiny (player) @@ -274,7 +286,9 @@ (defun annoying-ring (player) "The ring cannot be dropped!" (format t "~&You feel a stab of pain in your heart as you watch the ring drop.") + (sleep 1) (format t "~&On second thoughts, you pick it up again.~%~%") + (sleep 1) (take player "Golden ring")) diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 6ec8224..5300102 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -22,5 +22,4 @@ define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Piglet's porch" ;Development - ;place "Christopher Robin's house" \ No newline at end of file + place "Rapids" ;Development \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 4172058..e6abda4 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -273,8 +273,9 @@ description "Whoops! You fell in! Brrr, this water is cold! Better get out quickly. But that is easier said than done, the current here is pretty strong..." + neighbour "Rapids" neighbour "Floody place" - hidden "Golden ring" + entry-hook "stream-current" define-place "Christopher Robin's house" description "TODO" @@ -294,11 +295,17 @@ neighbour "Owl's porch" define-place "Floody place" - description "TODO" + description "The stream that flows through the forest disappears here, + forming a marshy area before it reappears further on. The ground + is very boggy here, take care that you don't get stuck. There + are also a lot of flies and mosquitoes buzzing around - not + a particularly comfortable place to be!" + neighbour "Stream" neighbour "Southern woods" neighbour "Eeyore's gloomy place" neighbour "Bridge" - + hidden "Golden ring" + define-place "Eeyore's gloomy place" description "TODO" npc "Eeyore" diff --git a/doc/COMMANDS b/doc/COMMANDS index 2ab862a..8fc16ec 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -14,7 +14,6 @@ seek - Search for hidden items equip - Equip this item as your weapon attack - Fight a monster -save [] - Save the game to file Arguments in square brackets are optional, arguments in angular brackets denote place fillers. diff --git a/doc/PLAYING b/doc/PLAYING index 3ea7958..e68c5ad 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -23,14 +23,17 @@ and pressing ENTER. (Commands to the computer must always be terminated by pressing ENTER.) -The first option, "Start a new game", drops you into a submenu in which you can +## TODO Include autosave! + +The first option, "Start a new game", will first ask you for your name. (This is +needed to save the game.) It then drops you into a submenu in which you can choose which game world you want to play. As of Atlantis 0.3, only the "Winnie the Pooh" world is fully functional. (You can try the others, but they are far from complete.) -The second option, "Load a game", is for returning users who have previously -saved their game progress in one of the worlds. Again, you will be presented -with a submenu that lists all currently saved games. +The second option, "Load a saved game", is for players who have already started +a game in one of the worlds. (Your game progress is saved automatically.) Again, +you will be presented with a submenu that lists all currently saved games. The third option is for developers and need not concern us further. @@ -53,7 +56,7 @@ commands, along with a short description. This is very useful! If you want to stop playing, you can use the commands "quit" or "exit". Don't -forget to save your progress first, though! +worry, your game progress will be saved when you leave. Note that although capitalization does not matter in Atlantis, spelling does. So if you get an error message telling you that a command is not available, make @@ -136,11 +139,6 @@ the various commands. With "clear" you delete all text except the place description. -save - If you've made good progress in a game world but cannot finish the game - in one sitting, you will want to save your work. The "save" command will - ask you for a file name to save the game under, then store it for later - retrieval (via the "Load a game" option in the main menu). - Daniel Vedder -Last modified 10/10/2017 +Last modified 20/10/2017 diff --git a/doc/TODO b/doc/TODO index 1d50250..887e41c 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,7 +1,6 @@ ATLANTIS TODO LISP -* implement autosave? * split ui.lisp into two modules (one for interaction functions) ATL diff --git a/doc/bugreport.txt b/doc/bugreport.txt index 934cb07..7b7f5aa 100644 --- a/doc/bugreport.txt +++ b/doc/bugreport.txt @@ -21,7 +21,7 @@ nicht korrekt. -> FIXED * Kann man gewollt vom Stream zum Floody Place, aber nicht umgekehrt? - -> Won't fix + -> FIXED * Beim Bee Tree wäre die Erwähnung von ‚climb down‘ ganz gut denke ich (auch wenn der command nicht notwendig ist). -> Won't fix diff --git a/lisp/atlantis.lisp b/lisp/atlantis.lisp index 5ec86f0..611c7eb 100644 --- a/lisp/atlantis.lisp +++ b/lisp/atlantis.lisp @@ -7,7 +7,7 @@ ;;; date: 09/05/2015 ;;; -(defconstant ATLANTIS-VERSION '(0 2 3)) +(defconstant ATLANTIS-VERSION '(0 2 4)) (load "util.lisp") (load "game-objects.lisp") @@ -38,11 +38,20 @@ (clear-screen) (print-text-file "banner.txt") (format t "~&~%Welcome! What do you want to do?") - (setf options '("Start a new game" "Load a game" + (setf options '("Start a new game" "Load a saved game" "Advanced" "Help" "About" "Exit")) (case (choose-number-option options) - (0 (format t "~&Which world do you want to play?") + (0 ;; ask the player for his/her name + (format t "~&What is your name? ") + (setf player-name (read-line)) + (if (and (member player-name + (mapcar #'pathname-name (directory "../saves/*")) + :test #'equalp) + (not (yes-or-no-p "A game by this player already exists. Replace it?"))) + (start-menu) + (setf (world-player-name *world*) player-name)) ;; let the player choose one of the game worlds + (format t "~&Which world do you want to play?") (let ((world (choose-option (append (keys *games*) '("Back"))))) (if (equalp world "Back") (start-menu) (setf world-file (cassoc world *games*))) @@ -55,7 +64,7 @@ (when (< 2 (length chars)) (format t "~&Which character do you want to play?") (setf char-name (choose-option chars))) - (set-main-player char-name) + (setf (world-main-character *world*) char-name) (if (equalp char-name "Cancel") (start-menu) (play-game))))) diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 88b3bad..2673367 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -182,17 +182,27 @@ (let ((honey-found NIL)) (defun climb-rock (player &optional arg) "Climb the rock at the rapids" - (if (> 25 (random 100)) + (if (> 33 (random 100)) (progn (format t "~&You slip!") - (read-line) + (sleep 3) (goto player "Stream")) (progn (format t "~&You clamber up on the rock.") - (unless honey-found + (unless honey-found ;;FIXME fails when a saved game is loaded again (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 stream-current (player &optional arg) + "The stream sweeps the player on into the Floody place." + (when (> 75 (random 100)) + (describe-place "Stream") + (format t "~&~%You struggle to get back to the banks.") (sleep 5) + (format t "~&You fight against the rushing water, but it's stronger than you.") (sleep 2) + (format t "~&The stream pulls you along.") (sleep 3) + (format t "~&It finally deposits you in a floody place.") (sleep 2) + (goto player "Floody place") (clear-screen))) + (defun play (player &optional arg) "Let the player play a game" (let ((place (player-place player))) @@ -212,8 +222,9 @@ (60 (format t "~&You pile up sand for a big strong keep in the center.")) (80 (format t "~&You decorate the castle, adding pretty little details.")) (100 (format t "~&You stand back and admire your handiwork. What a fine castle!") - (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle"))) - (unless (= sandcastle 100) (incf sandcastle 20)))) + (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle")) + (110 (format t "~&You've already built a sandcastle here! And a fine one it is too..."))) + (unless (= sandcastle 110) (incf sandcastle 20)))) (let ((score 0)) (defun poohsticks (player) @@ -264,7 +275,8 @@ (if (member 'ring (extract-elements arg)) (progn (format t "~&You slip the golden ring on your finger.") (sleep 1) - (format t "~&You feel something ought to happen.~&Nothing does.")) + (format t "~&You feel something ought to happen.") (sleep 2) + (format t "~&Nothing does.")) (format t "~&What do you want to wear?"))) (defun ring-of-destiny (player) @@ -274,7 +286,9 @@ (defun annoying-ring (player) "The ring cannot be dropped!" (format t "~&You feel a stab of pain in your heart as you watch the ring drop.") + (sleep 1) (format t "~&On second thoughts, you pick it up again.~%~%") + (sleep 1) (take player "Golden ring")) diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 6ec8224..5300102 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -22,5 +22,4 @@ define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Piglet's porch" ;Development - ;place "Christopher Robin's house" \ No newline at end of file + place "Rapids" ;Development \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 4172058..e6abda4 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -273,8 +273,9 @@ description "Whoops! You fell in! Brrr, this water is cold! Better get out quickly. But that is easier said than done, the current here is pretty strong..." + neighbour "Rapids" neighbour "Floody place" - hidden "Golden ring" + entry-hook "stream-current" define-place "Christopher Robin's house" description "TODO" @@ -294,11 +295,17 @@ neighbour "Owl's porch" define-place "Floody place" - description "TODO" + description "The stream that flows through the forest disappears here, + forming a marshy area before it reappears further on. The ground + is very boggy here, take care that you don't get stuck. There + are also a lot of flies and mosquitoes buzzing around - not + a particularly comfortable place to be!" + neighbour "Stream" neighbour "Southern woods" neighbour "Eeyore's gloomy place" neighbour "Bridge" - + hidden "Golden ring" + define-place "Eeyore's gloomy place" description "TODO" npc "Eeyore" diff --git a/doc/COMMANDS b/doc/COMMANDS index 2ab862a..8fc16ec 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -14,7 +14,6 @@ seek - Search for hidden items equip - Equip this item as your weapon attack - Fight a monster -save [] - Save the game to file Arguments in square brackets are optional, arguments in angular brackets denote place fillers. diff --git a/doc/PLAYING b/doc/PLAYING index 3ea7958..e68c5ad 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -23,14 +23,17 @@ and pressing ENTER. (Commands to the computer must always be terminated by pressing ENTER.) -The first option, "Start a new game", drops you into a submenu in which you can +## TODO Include autosave! + +The first option, "Start a new game", will first ask you for your name. (This is +needed to save the game.) It then drops you into a submenu in which you can choose which game world you want to play. As of Atlantis 0.3, only the "Winnie the Pooh" world is fully functional. (You can try the others, but they are far from complete.) -The second option, "Load a game", is for returning users who have previously -saved their game progress in one of the worlds. Again, you will be presented -with a submenu that lists all currently saved games. +The second option, "Load a saved game", is for players who have already started +a game in one of the worlds. (Your game progress is saved automatically.) Again, +you will be presented with a submenu that lists all currently saved games. The third option is for developers and need not concern us further. @@ -53,7 +56,7 @@ commands, along with a short description. This is very useful! If you want to stop playing, you can use the commands "quit" or "exit". Don't -forget to save your progress first, though! +worry, your game progress will be saved when you leave. Note that although capitalization does not matter in Atlantis, spelling does. So if you get an error message telling you that a command is not available, make @@ -136,11 +139,6 @@ the various commands. With "clear" you delete all text except the place description. -save - If you've made good progress in a game world but cannot finish the game - in one sitting, you will want to save your work. The "save" command will - ask you for a file name to save the game under, then store it for later - retrieval (via the "Load a game" option in the main menu). - Daniel Vedder -Last modified 10/10/2017 +Last modified 20/10/2017 diff --git a/doc/TODO b/doc/TODO index 1d50250..887e41c 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,7 +1,6 @@ ATLANTIS TODO LISP -* implement autosave? * split ui.lisp into two modules (one for interaction functions) ATL diff --git a/doc/bugreport.txt b/doc/bugreport.txt index 934cb07..7b7f5aa 100644 --- a/doc/bugreport.txt +++ b/doc/bugreport.txt @@ -21,7 +21,7 @@ nicht korrekt. -> FIXED * Kann man gewollt vom Stream zum Floody Place, aber nicht umgekehrt? - -> Won't fix + -> FIXED * Beim Bee Tree wäre die Erwähnung von ‚climb down‘ ganz gut denke ich (auch wenn der command nicht notwendig ist). -> Won't fix diff --git a/lisp/atlantis.lisp b/lisp/atlantis.lisp index 5ec86f0..611c7eb 100644 --- a/lisp/atlantis.lisp +++ b/lisp/atlantis.lisp @@ -7,7 +7,7 @@ ;;; date: 09/05/2015 ;;; -(defconstant ATLANTIS-VERSION '(0 2 3)) +(defconstant ATLANTIS-VERSION '(0 2 4)) (load "util.lisp") (load "game-objects.lisp") @@ -38,11 +38,20 @@ (clear-screen) (print-text-file "banner.txt") (format t "~&~%Welcome! What do you want to do?") - (setf options '("Start a new game" "Load a game" + (setf options '("Start a new game" "Load a saved game" "Advanced" "Help" "About" "Exit")) (case (choose-number-option options) - (0 (format t "~&Which world do you want to play?") + (0 ;; ask the player for his/her name + (format t "~&What is your name? ") + (setf player-name (read-line)) + (if (and (member player-name + (mapcar #'pathname-name (directory "../saves/*")) + :test #'equalp) + (not (yes-or-no-p "A game by this player already exists. Replace it?"))) + (start-menu) + (setf (world-player-name *world*) player-name)) ;; let the player choose one of the game worlds + (format t "~&Which world do you want to play?") (let ((world (choose-option (append (keys *games*) '("Back"))))) (if (equalp world "Back") (start-menu) (setf world-file (cassoc world *games*))) @@ -55,7 +64,7 @@ (when (< 2 (length chars)) (format t "~&Which character do you want to play?") (setf char-name (choose-option chars))) - (set-main-player char-name) + (setf (world-main-character *world*) char-name) (if (equalp char-name "Cancel") (start-menu) (play-game))))) diff --git a/lisp/player.lisp b/lisp/player.lisp index 1c51a05..9274fb4 100644 --- a/lisp/player.lisp +++ b/lisp/player.lisp @@ -39,10 +39,6 @@ (change-player-location player (player-place player)) (add-game-object player)) -(defun set-main-player (player-name) - "Set the main player for this game" - (setf (world-main-player *world*) player-name)) - (defun change-player-location (player location) "Change the player's location and do housekeeping" (setf location (to-string location)) diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 88b3bad..2673367 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -182,17 +182,27 @@ (let ((honey-found NIL)) (defun climb-rock (player &optional arg) "Climb the rock at the rapids" - (if (> 25 (random 100)) + (if (> 33 (random 100)) (progn (format t "~&You slip!") - (read-line) + (sleep 3) (goto player "Stream")) (progn (format t "~&You clamber up on the rock.") - (unless honey-found + (unless honey-found ;;FIXME fails when a saved game is loaded again (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 stream-current (player &optional arg) + "The stream sweeps the player on into the Floody place." + (when (> 75 (random 100)) + (describe-place "Stream") + (format t "~&~%You struggle to get back to the banks.") (sleep 5) + (format t "~&You fight against the rushing water, but it's stronger than you.") (sleep 2) + (format t "~&The stream pulls you along.") (sleep 3) + (format t "~&It finally deposits you in a floody place.") (sleep 2) + (goto player "Floody place") (clear-screen))) + (defun play (player &optional arg) "Let the player play a game" (let ((place (player-place player))) @@ -212,8 +222,9 @@ (60 (format t "~&You pile up sand for a big strong keep in the center.")) (80 (format t "~&You decorate the castle, adding pretty little details.")) (100 (format t "~&You stand back and admire your handiwork. What a fine castle!") - (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle"))) - (unless (= sandcastle 100) (incf sandcastle 20)))) + (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle")) + (110 (format t "~&You've already built a sandcastle here! And a fine one it is too..."))) + (unless (= sandcastle 110) (incf sandcastle 20)))) (let ((score 0)) (defun poohsticks (player) @@ -264,7 +275,8 @@ (if (member 'ring (extract-elements arg)) (progn (format t "~&You slip the golden ring on your finger.") (sleep 1) - (format t "~&You feel something ought to happen.~&Nothing does.")) + (format t "~&You feel something ought to happen.") (sleep 2) + (format t "~&Nothing does.")) (format t "~&What do you want to wear?"))) (defun ring-of-destiny (player) @@ -274,7 +286,9 @@ (defun annoying-ring (player) "The ring cannot be dropped!" (format t "~&You feel a stab of pain in your heart as you watch the ring drop.") + (sleep 1) (format t "~&On second thoughts, you pick it up again.~%~%") + (sleep 1) (take player "Golden ring")) diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 6ec8224..5300102 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -22,5 +22,4 @@ define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Piglet's porch" ;Development - ;place "Christopher Robin's house" \ No newline at end of file + place "Rapids" ;Development \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 4172058..e6abda4 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -273,8 +273,9 @@ description "Whoops! You fell in! Brrr, this water is cold! Better get out quickly. But that is easier said than done, the current here is pretty strong..." + neighbour "Rapids" neighbour "Floody place" - hidden "Golden ring" + entry-hook "stream-current" define-place "Christopher Robin's house" description "TODO" @@ -294,11 +295,17 @@ neighbour "Owl's porch" define-place "Floody place" - description "TODO" + description "The stream that flows through the forest disappears here, + forming a marshy area before it reappears further on. The ground + is very boggy here, take care that you don't get stuck. There + are also a lot of flies and mosquitoes buzzing around - not + a particularly comfortable place to be!" + neighbour "Stream" neighbour "Southern woods" neighbour "Eeyore's gloomy place" neighbour "Bridge" - + hidden "Golden ring" + define-place "Eeyore's gloomy place" description "TODO" npc "Eeyore" diff --git a/doc/COMMANDS b/doc/COMMANDS index 2ab862a..8fc16ec 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -14,7 +14,6 @@ seek - Search for hidden items equip - Equip this item as your weapon attack - Fight a monster -save [] - Save the game to file Arguments in square brackets are optional, arguments in angular brackets denote place fillers. diff --git a/doc/PLAYING b/doc/PLAYING index 3ea7958..e68c5ad 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -23,14 +23,17 @@ and pressing ENTER. (Commands to the computer must always be terminated by pressing ENTER.) -The first option, "Start a new game", drops you into a submenu in which you can +## TODO Include autosave! + +The first option, "Start a new game", will first ask you for your name. (This is +needed to save the game.) It then drops you into a submenu in which you can choose which game world you want to play. As of Atlantis 0.3, only the "Winnie the Pooh" world is fully functional. (You can try the others, but they are far from complete.) -The second option, "Load a game", is for returning users who have previously -saved their game progress in one of the worlds. Again, you will be presented -with a submenu that lists all currently saved games. +The second option, "Load a saved game", is for players who have already started +a game in one of the worlds. (Your game progress is saved automatically.) Again, +you will be presented with a submenu that lists all currently saved games. The third option is for developers and need not concern us further. @@ -53,7 +56,7 @@ commands, along with a short description. This is very useful! If you want to stop playing, you can use the commands "quit" or "exit". Don't -forget to save your progress first, though! +worry, your game progress will be saved when you leave. Note that although capitalization does not matter in Atlantis, spelling does. So if you get an error message telling you that a command is not available, make @@ -136,11 +139,6 @@ the various commands. With "clear" you delete all text except the place description. -save - If you've made good progress in a game world but cannot finish the game - in one sitting, you will want to save your work. The "save" command will - ask you for a file name to save the game under, then store it for later - retrieval (via the "Load a game" option in the main menu). - Daniel Vedder -Last modified 10/10/2017 +Last modified 20/10/2017 diff --git a/doc/TODO b/doc/TODO index 1d50250..887e41c 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,7 +1,6 @@ ATLANTIS TODO LISP -* implement autosave? * split ui.lisp into two modules (one for interaction functions) ATL diff --git a/doc/bugreport.txt b/doc/bugreport.txt index 934cb07..7b7f5aa 100644 --- a/doc/bugreport.txt +++ b/doc/bugreport.txt @@ -21,7 +21,7 @@ nicht korrekt. -> FIXED * Kann man gewollt vom Stream zum Floody Place, aber nicht umgekehrt? - -> Won't fix + -> FIXED * Beim Bee Tree wäre die Erwähnung von ‚climb down‘ ganz gut denke ich (auch wenn der command nicht notwendig ist). -> Won't fix diff --git a/lisp/atlantis.lisp b/lisp/atlantis.lisp index 5ec86f0..611c7eb 100644 --- a/lisp/atlantis.lisp +++ b/lisp/atlantis.lisp @@ -7,7 +7,7 @@ ;;; date: 09/05/2015 ;;; -(defconstant ATLANTIS-VERSION '(0 2 3)) +(defconstant ATLANTIS-VERSION '(0 2 4)) (load "util.lisp") (load "game-objects.lisp") @@ -38,11 +38,20 @@ (clear-screen) (print-text-file "banner.txt") (format t "~&~%Welcome! What do you want to do?") - (setf options '("Start a new game" "Load a game" + (setf options '("Start a new game" "Load a saved game" "Advanced" "Help" "About" "Exit")) (case (choose-number-option options) - (0 (format t "~&Which world do you want to play?") + (0 ;; ask the player for his/her name + (format t "~&What is your name? ") + (setf player-name (read-line)) + (if (and (member player-name + (mapcar #'pathname-name (directory "../saves/*")) + :test #'equalp) + (not (yes-or-no-p "A game by this player already exists. Replace it?"))) + (start-menu) + (setf (world-player-name *world*) player-name)) ;; let the player choose one of the game worlds + (format t "~&Which world do you want to play?") (let ((world (choose-option (append (keys *games*) '("Back"))))) (if (equalp world "Back") (start-menu) (setf world-file (cassoc world *games*))) @@ -55,7 +64,7 @@ (when (< 2 (length chars)) (format t "~&Which character do you want to play?") (setf char-name (choose-option chars))) - (set-main-player char-name) + (setf (world-main-character *world*) char-name) (if (equalp char-name "Cancel") (start-menu) (play-game))))) diff --git a/lisp/player.lisp b/lisp/player.lisp index 1c51a05..9274fb4 100644 --- a/lisp/player.lisp +++ b/lisp/player.lisp @@ -39,10 +39,6 @@ (change-player-location player (player-place player)) (add-game-object player)) -(defun set-main-player (player-name) - "Set the main player for this game" - (setf (world-main-player *world*) player-name)) - (defun change-player-location (player location) "Change the player's location and do housekeeping" (setf location (to-string location)) diff --git a/lisp/ui.lisp b/lisp/ui.lisp index 3a5bd38..86f6e68 100644 --- a/lisp/ui.lisp +++ b/lisp/ui.lisp @@ -21,7 +21,7 @@ (defun play-game () "The main game loop" - (let ((player (get-game-object 'player (world-main-player *world*)))) + (let ((player (get-game-object 'player (world-main-character *world*)))) ;; If the player's starting position is not specified, choose at random (when (zerop (length (player-place player))) (format t "~&Choosing a random starting location.") @@ -31,16 +31,19 @@ (clear-screen) (let ((place (get-game-object 'place (player-place player)))) (describe-place place) - (input-string command) - (while (not (and (or (equalp command "quit") - (equalp command "exit")) - (y-or-n-p "~&Really quit?"))) - (cond ((zerop (length command))) + (format t "~&>>> ") + (do ((command (read-line) (read-line))) + ((and (or (equalp command "quit") (equalp command "exit")) + (y-or-n-p "~&Really quit?")) + (save-world) + (format t "~&Goodbye!") + (quit)) + (cond ((zerop (length command)) NIL) ((not (alpha-char-p (aref command 0))) (format t "~&Invalid input.")) - (T (game-command command player))) - (input-string command)) - (format t "~&Goodbye!")))) + (T (game-command command player) + (save-world))) + (format t "~&>>> "))))) (defun describe-place (p) "Print out a complete description of place p" @@ -121,7 +124,7 @@ (defvar *commands* '(help look goto take inventory drop talk equip attack - seek save clear manual)) + seek clear manual)) ;;; Command functions have to take two arguments (a player instance and ;;; an optional(!) argument to the function). @@ -144,23 +147,6 @@ "A wrapper for 'look me'" (look player "me")) -(let ((last-save NIL)) - (defun save (player &optional game-file) - "Save a game to file (wrapper method around save-world)" - (if (and last-save (not game-file)) - (setf game-file last-save) - (progn - (when (not (or last-save game-file)) - (format t "~&What do you want to call the save file?") - (input-string game-file)) - (setf game-file (concatenate 'string "../saves/" - game-file ".world")) - (setf last-save game-file))) - (if (y-or-n-p "Save game to ~A?" game-file) - (progn (save-world game-file) - (format t "~&Game saved.")) - (setf last-save NIL)))) - (defun goto (player &optional location) "Go to the specified location" ;; Look before you leap ;-) @@ -174,7 +160,7 @@ (format t "~&This place does not border your current location!") (return-from goto)) ;; You can only enter a place if you have one of the requirements - ;; FIXME Deal with multiple possible requirements + ;; TODO Deal with multiple possible requirements (let ((req (place-requires (get-game-object 'place location)))) (unless (equalp req "") (unless (or (player-has-ability req player) diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 88b3bad..2673367 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -182,17 +182,27 @@ (let ((honey-found NIL)) (defun climb-rock (player &optional arg) "Climb the rock at the rapids" - (if (> 25 (random 100)) + (if (> 33 (random 100)) (progn (format t "~&You slip!") - (read-line) + (sleep 3) (goto player "Stream")) (progn (format t "~&You clamber up on the rock.") - (unless honey-found + (unless honey-found ;;FIXME fails when a saved game is loaded again (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 stream-current (player &optional arg) + "The stream sweeps the player on into the Floody place." + (when (> 75 (random 100)) + (describe-place "Stream") + (format t "~&~%You struggle to get back to the banks.") (sleep 5) + (format t "~&You fight against the rushing water, but it's stronger than you.") (sleep 2) + (format t "~&The stream pulls you along.") (sleep 3) + (format t "~&It finally deposits you in a floody place.") (sleep 2) + (goto player "Floody place") (clear-screen))) + (defun play (player &optional arg) "Let the player play a game" (let ((place (player-place player))) @@ -212,8 +222,9 @@ (60 (format t "~&You pile up sand for a big strong keep in the center.")) (80 (format t "~&You decorate the castle, adding pretty little details.")) (100 (format t "~&You stand back and admire your handiwork. What a fine castle!") - (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle"))) - (unless (= sandcastle 100) (incf sandcastle 20)))) + (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle")) + (110 (format t "~&You've already built a sandcastle here! And a fine one it is too..."))) + (unless (= sandcastle 110) (incf sandcastle 20)))) (let ((score 0)) (defun poohsticks (player) @@ -264,7 +275,8 @@ (if (member 'ring (extract-elements arg)) (progn (format t "~&You slip the golden ring on your finger.") (sleep 1) - (format t "~&You feel something ought to happen.~&Nothing does.")) + (format t "~&You feel something ought to happen.") (sleep 2) + (format t "~&Nothing does.")) (format t "~&What do you want to wear?"))) (defun ring-of-destiny (player) @@ -274,7 +286,9 @@ (defun annoying-ring (player) "The ring cannot be dropped!" (format t "~&You feel a stab of pain in your heart as you watch the ring drop.") + (sleep 1) (format t "~&On second thoughts, you pick it up again.~%~%") + (sleep 1) (take player "Golden ring")) diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 6ec8224..5300102 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -22,5 +22,4 @@ define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Piglet's porch" ;Development - ;place "Christopher Robin's house" \ No newline at end of file + place "Rapids" ;Development \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 4172058..e6abda4 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -273,8 +273,9 @@ description "Whoops! You fell in! Brrr, this water is cold! Better get out quickly. But that is easier said than done, the current here is pretty strong..." + neighbour "Rapids" neighbour "Floody place" - hidden "Golden ring" + entry-hook "stream-current" define-place "Christopher Robin's house" description "TODO" @@ -294,11 +295,17 @@ neighbour "Owl's porch" define-place "Floody place" - description "TODO" + description "The stream that flows through the forest disappears here, + forming a marshy area before it reappears further on. The ground + is very boggy here, take care that you don't get stuck. There + are also a lot of flies and mosquitoes buzzing around - not + a particularly comfortable place to be!" + neighbour "Stream" neighbour "Southern woods" neighbour "Eeyore's gloomy place" neighbour "Bridge" - + hidden "Golden ring" + define-place "Eeyore's gloomy place" description "TODO" npc "Eeyore" diff --git a/doc/COMMANDS b/doc/COMMANDS index 2ab862a..8fc16ec 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -14,7 +14,6 @@ seek - Search for hidden items equip - Equip this item as your weapon attack - Fight a monster -save [] - Save the game to file Arguments in square brackets are optional, arguments in angular brackets denote place fillers. diff --git a/doc/PLAYING b/doc/PLAYING index 3ea7958..e68c5ad 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -23,14 +23,17 @@ and pressing ENTER. (Commands to the computer must always be terminated by pressing ENTER.) -The first option, "Start a new game", drops you into a submenu in which you can +## TODO Include autosave! + +The first option, "Start a new game", will first ask you for your name. (This is +needed to save the game.) It then drops you into a submenu in which you can choose which game world you want to play. As of Atlantis 0.3, only the "Winnie the Pooh" world is fully functional. (You can try the others, but they are far from complete.) -The second option, "Load a game", is for returning users who have previously -saved their game progress in one of the worlds. Again, you will be presented -with a submenu that lists all currently saved games. +The second option, "Load a saved game", is for players who have already started +a game in one of the worlds. (Your game progress is saved automatically.) Again, +you will be presented with a submenu that lists all currently saved games. The third option is for developers and need not concern us further. @@ -53,7 +56,7 @@ commands, along with a short description. This is very useful! If you want to stop playing, you can use the commands "quit" or "exit". Don't -forget to save your progress first, though! +worry, your game progress will be saved when you leave. Note that although capitalization does not matter in Atlantis, spelling does. So if you get an error message telling you that a command is not available, make @@ -136,11 +139,6 @@ the various commands. With "clear" you delete all text except the place description. -save - If you've made good progress in a game world but cannot finish the game - in one sitting, you will want to save your work. The "save" command will - ask you for a file name to save the game under, then store it for later - retrieval (via the "Load a game" option in the main menu). - Daniel Vedder -Last modified 10/10/2017 +Last modified 20/10/2017 diff --git a/doc/TODO b/doc/TODO index 1d50250..887e41c 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,7 +1,6 @@ ATLANTIS TODO LISP -* implement autosave? * split ui.lisp into two modules (one for interaction functions) ATL diff --git a/doc/bugreport.txt b/doc/bugreport.txt index 934cb07..7b7f5aa 100644 --- a/doc/bugreport.txt +++ b/doc/bugreport.txt @@ -21,7 +21,7 @@ nicht korrekt. -> FIXED * Kann man gewollt vom Stream zum Floody Place, aber nicht umgekehrt? - -> Won't fix + -> FIXED * Beim Bee Tree wäre die Erwähnung von ‚climb down‘ ganz gut denke ich (auch wenn der command nicht notwendig ist). -> Won't fix diff --git a/lisp/atlantis.lisp b/lisp/atlantis.lisp index 5ec86f0..611c7eb 100644 --- a/lisp/atlantis.lisp +++ b/lisp/atlantis.lisp @@ -7,7 +7,7 @@ ;;; date: 09/05/2015 ;;; -(defconstant ATLANTIS-VERSION '(0 2 3)) +(defconstant ATLANTIS-VERSION '(0 2 4)) (load "util.lisp") (load "game-objects.lisp") @@ -38,11 +38,20 @@ (clear-screen) (print-text-file "banner.txt") (format t "~&~%Welcome! What do you want to do?") - (setf options '("Start a new game" "Load a game" + (setf options '("Start a new game" "Load a saved game" "Advanced" "Help" "About" "Exit")) (case (choose-number-option options) - (0 (format t "~&Which world do you want to play?") + (0 ;; ask the player for his/her name + (format t "~&What is your name? ") + (setf player-name (read-line)) + (if (and (member player-name + (mapcar #'pathname-name (directory "../saves/*")) + :test #'equalp) + (not (yes-or-no-p "A game by this player already exists. Replace it?"))) + (start-menu) + (setf (world-player-name *world*) player-name)) ;; let the player choose one of the game worlds + (format t "~&Which world do you want to play?") (let ((world (choose-option (append (keys *games*) '("Back"))))) (if (equalp world "Back") (start-menu) (setf world-file (cassoc world *games*))) @@ -55,7 +64,7 @@ (when (< 2 (length chars)) (format t "~&Which character do you want to play?") (setf char-name (choose-option chars))) - (set-main-player char-name) + (setf (world-main-character *world*) char-name) (if (equalp char-name "Cancel") (start-menu) (play-game))))) diff --git a/lisp/player.lisp b/lisp/player.lisp index 1c51a05..9274fb4 100644 --- a/lisp/player.lisp +++ b/lisp/player.lisp @@ -39,10 +39,6 @@ (change-player-location player (player-place player)) (add-game-object player)) -(defun set-main-player (player-name) - "Set the main player for this game" - (setf (world-main-player *world*) player-name)) - (defun change-player-location (player location) "Change the player's location and do housekeeping" (setf location (to-string location)) diff --git a/lisp/ui.lisp b/lisp/ui.lisp index 3a5bd38..86f6e68 100644 --- a/lisp/ui.lisp +++ b/lisp/ui.lisp @@ -21,7 +21,7 @@ (defun play-game () "The main game loop" - (let ((player (get-game-object 'player (world-main-player *world*)))) + (let ((player (get-game-object 'player (world-main-character *world*)))) ;; If the player's starting position is not specified, choose at random (when (zerop (length (player-place player))) (format t "~&Choosing a random starting location.") @@ -31,16 +31,19 @@ (clear-screen) (let ((place (get-game-object 'place (player-place player)))) (describe-place place) - (input-string command) - (while (not (and (or (equalp command "quit") - (equalp command "exit")) - (y-or-n-p "~&Really quit?"))) - (cond ((zerop (length command))) + (format t "~&>>> ") + (do ((command (read-line) (read-line))) + ((and (or (equalp command "quit") (equalp command "exit")) + (y-or-n-p "~&Really quit?")) + (save-world) + (format t "~&Goodbye!") + (quit)) + (cond ((zerop (length command)) NIL) ((not (alpha-char-p (aref command 0))) (format t "~&Invalid input.")) - (T (game-command command player))) - (input-string command)) - (format t "~&Goodbye!")))) + (T (game-command command player) + (save-world))) + (format t "~&>>> "))))) (defun describe-place (p) "Print out a complete description of place p" @@ -121,7 +124,7 @@ (defvar *commands* '(help look goto take inventory drop talk equip attack - seek save clear manual)) + seek clear manual)) ;;; Command functions have to take two arguments (a player instance and ;;; an optional(!) argument to the function). @@ -144,23 +147,6 @@ "A wrapper for 'look me'" (look player "me")) -(let ((last-save NIL)) - (defun save (player &optional game-file) - "Save a game to file (wrapper method around save-world)" - (if (and last-save (not game-file)) - (setf game-file last-save) - (progn - (when (not (or last-save game-file)) - (format t "~&What do you want to call the save file?") - (input-string game-file)) - (setf game-file (concatenate 'string "../saves/" - game-file ".world")) - (setf last-save game-file))) - (if (y-or-n-p "Save game to ~A?" game-file) - (progn (save-world game-file) - (format t "~&Game saved.")) - (setf last-save NIL)))) - (defun goto (player &optional location) "Go to the specified location" ;; Look before you leap ;-) @@ -174,7 +160,7 @@ (format t "~&This place does not border your current location!") (return-from goto)) ;; You can only enter a place if you have one of the requirements - ;; FIXME Deal with multiple possible requirements + ;; TODO Deal with multiple possible requirements (let ((req (place-requires (get-game-object 'place location)))) (unless (equalp req "") (unless (or (player-has-ability req player) diff --git a/lisp/util.lisp b/lisp/util.lisp index bfefb5a..a618aeb 100644 --- a/lisp/util.lisp +++ b/lisp/util.lisp @@ -292,7 +292,7 @@ (format t "$ ")))) (setf help-msg " Input your text below. When you are done, finish with a line that contains only -a single fullstop. If you make a mistake, you can still edit your text later.") +a single fullstop. If you make a mistake, you can reenter your text later.") (format t help-msg) (setf text (text-input)) (while (not (y-or-n-p "~&Save and exit?")) diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 88b3bad..2673367 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -182,17 +182,27 @@ (let ((honey-found NIL)) (defun climb-rock (player &optional arg) "Climb the rock at the rapids" - (if (> 25 (random 100)) + (if (> 33 (random 100)) (progn (format t "~&You slip!") - (read-line) + (sleep 3) (goto player "Stream")) (progn (format t "~&You clamber up on the rock.") - (unless honey-found + (unless honey-found ;;FIXME fails when a saved game is loaded again (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 stream-current (player &optional arg) + "The stream sweeps the player on into the Floody place." + (when (> 75 (random 100)) + (describe-place "Stream") + (format t "~&~%You struggle to get back to the banks.") (sleep 5) + (format t "~&You fight against the rushing water, but it's stronger than you.") (sleep 2) + (format t "~&The stream pulls you along.") (sleep 3) + (format t "~&It finally deposits you in a floody place.") (sleep 2) + (goto player "Floody place") (clear-screen))) + (defun play (player &optional arg) "Let the player play a game" (let ((place (player-place player))) @@ -212,8 +222,9 @@ (60 (format t "~&You pile up sand for a big strong keep in the center.")) (80 (format t "~&You decorate the castle, adding pretty little details.")) (100 (format t "~&You stand back and admire your handiwork. What a fine castle!") - (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle"))) - (unless (= sandcastle 100) (incf sandcastle 20)))) + (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle")) + (110 (format t "~&You've already built a sandcastle here! And a fine one it is too..."))) + (unless (= sandcastle 110) (incf sandcastle 20)))) (let ((score 0)) (defun poohsticks (player) @@ -264,7 +275,8 @@ (if (member 'ring (extract-elements arg)) (progn (format t "~&You slip the golden ring on your finger.") (sleep 1) - (format t "~&You feel something ought to happen.~&Nothing does.")) + (format t "~&You feel something ought to happen.") (sleep 2) + (format t "~&Nothing does.")) (format t "~&What do you want to wear?"))) (defun ring-of-destiny (player) @@ -274,7 +286,9 @@ (defun annoying-ring (player) "The ring cannot be dropped!" (format t "~&You feel a stab of pain in your heart as you watch the ring drop.") + (sleep 1) (format t "~&On second thoughts, you pick it up again.~%~%") + (sleep 1) (take player "Golden ring")) diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 6ec8224..5300102 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -22,5 +22,4 @@ define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Piglet's porch" ;Development - ;place "Christopher Robin's house" \ No newline at end of file + place "Rapids" ;Development \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 4172058..e6abda4 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -273,8 +273,9 @@ description "Whoops! You fell in! Brrr, this water is cold! Better get out quickly. But that is easier said than done, the current here is pretty strong..." + neighbour "Rapids" neighbour "Floody place" - hidden "Golden ring" + entry-hook "stream-current" define-place "Christopher Robin's house" description "TODO" @@ -294,11 +295,17 @@ neighbour "Owl's porch" define-place "Floody place" - description "TODO" + description "The stream that flows through the forest disappears here, + forming a marshy area before it reappears further on. The ground + is very boggy here, take care that you don't get stuck. There + are also a lot of flies and mosquitoes buzzing around - not + a particularly comfortable place to be!" + neighbour "Stream" neighbour "Southern woods" neighbour "Eeyore's gloomy place" neighbour "Bridge" - + hidden "Golden ring" + define-place "Eeyore's gloomy place" description "TODO" npc "Eeyore" diff --git a/doc/COMMANDS b/doc/COMMANDS index 2ab862a..8fc16ec 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -14,7 +14,6 @@ seek - Search for hidden items equip - Equip this item as your weapon attack - Fight a monster -save [] - Save the game to file Arguments in square brackets are optional, arguments in angular brackets denote place fillers. diff --git a/doc/PLAYING b/doc/PLAYING index 3ea7958..e68c5ad 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -23,14 +23,17 @@ and pressing ENTER. (Commands to the computer must always be terminated by pressing ENTER.) -The first option, "Start a new game", drops you into a submenu in which you can +## TODO Include autosave! + +The first option, "Start a new game", will first ask you for your name. (This is +needed to save the game.) It then drops you into a submenu in which you can choose which game world you want to play. As of Atlantis 0.3, only the "Winnie the Pooh" world is fully functional. (You can try the others, but they are far from complete.) -The second option, "Load a game", is for returning users who have previously -saved their game progress in one of the worlds. Again, you will be presented -with a submenu that lists all currently saved games. +The second option, "Load a saved game", is for players who have already started +a game in one of the worlds. (Your game progress is saved automatically.) Again, +you will be presented with a submenu that lists all currently saved games. The third option is for developers and need not concern us further. @@ -53,7 +56,7 @@ commands, along with a short description. This is very useful! If you want to stop playing, you can use the commands "quit" or "exit". Don't -forget to save your progress first, though! +worry, your game progress will be saved when you leave. Note that although capitalization does not matter in Atlantis, spelling does. So if you get an error message telling you that a command is not available, make @@ -136,11 +139,6 @@ the various commands. With "clear" you delete all text except the place description. -save - If you've made good progress in a game world but cannot finish the game - in one sitting, you will want to save your work. The "save" command will - ask you for a file name to save the game under, then store it for later - retrieval (via the "Load a game" option in the main menu). - Daniel Vedder -Last modified 10/10/2017 +Last modified 20/10/2017 diff --git a/doc/TODO b/doc/TODO index 1d50250..887e41c 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,7 +1,6 @@ ATLANTIS TODO LISP -* implement autosave? * split ui.lisp into two modules (one for interaction functions) ATL diff --git a/doc/bugreport.txt b/doc/bugreport.txt index 934cb07..7b7f5aa 100644 --- a/doc/bugreport.txt +++ b/doc/bugreport.txt @@ -21,7 +21,7 @@ nicht korrekt. -> FIXED * Kann man gewollt vom Stream zum Floody Place, aber nicht umgekehrt? - -> Won't fix + -> FIXED * Beim Bee Tree wäre die Erwähnung von ‚climb down‘ ganz gut denke ich (auch wenn der command nicht notwendig ist). -> Won't fix diff --git a/lisp/atlantis.lisp b/lisp/atlantis.lisp index 5ec86f0..611c7eb 100644 --- a/lisp/atlantis.lisp +++ b/lisp/atlantis.lisp @@ -7,7 +7,7 @@ ;;; date: 09/05/2015 ;;; -(defconstant ATLANTIS-VERSION '(0 2 3)) +(defconstant ATLANTIS-VERSION '(0 2 4)) (load "util.lisp") (load "game-objects.lisp") @@ -38,11 +38,20 @@ (clear-screen) (print-text-file "banner.txt") (format t "~&~%Welcome! What do you want to do?") - (setf options '("Start a new game" "Load a game" + (setf options '("Start a new game" "Load a saved game" "Advanced" "Help" "About" "Exit")) (case (choose-number-option options) - (0 (format t "~&Which world do you want to play?") + (0 ;; ask the player for his/her name + (format t "~&What is your name? ") + (setf player-name (read-line)) + (if (and (member player-name + (mapcar #'pathname-name (directory "../saves/*")) + :test #'equalp) + (not (yes-or-no-p "A game by this player already exists. Replace it?"))) + (start-menu) + (setf (world-player-name *world*) player-name)) ;; let the player choose one of the game worlds + (format t "~&Which world do you want to play?") (let ((world (choose-option (append (keys *games*) '("Back"))))) (if (equalp world "Back") (start-menu) (setf world-file (cassoc world *games*))) @@ -55,7 +64,7 @@ (when (< 2 (length chars)) (format t "~&Which character do you want to play?") (setf char-name (choose-option chars))) - (set-main-player char-name) + (setf (world-main-character *world*) char-name) (if (equalp char-name "Cancel") (start-menu) (play-game))))) diff --git a/lisp/player.lisp b/lisp/player.lisp index 1c51a05..9274fb4 100644 --- a/lisp/player.lisp +++ b/lisp/player.lisp @@ -39,10 +39,6 @@ (change-player-location player (player-place player)) (add-game-object player)) -(defun set-main-player (player-name) - "Set the main player for this game" - (setf (world-main-player *world*) player-name)) - (defun change-player-location (player location) "Change the player's location and do housekeeping" (setf location (to-string location)) diff --git a/lisp/ui.lisp b/lisp/ui.lisp index 3a5bd38..86f6e68 100644 --- a/lisp/ui.lisp +++ b/lisp/ui.lisp @@ -21,7 +21,7 @@ (defun play-game () "The main game loop" - (let ((player (get-game-object 'player (world-main-player *world*)))) + (let ((player (get-game-object 'player (world-main-character *world*)))) ;; If the player's starting position is not specified, choose at random (when (zerop (length (player-place player))) (format t "~&Choosing a random starting location.") @@ -31,16 +31,19 @@ (clear-screen) (let ((place (get-game-object 'place (player-place player)))) (describe-place place) - (input-string command) - (while (not (and (or (equalp command "quit") - (equalp command "exit")) - (y-or-n-p "~&Really quit?"))) - (cond ((zerop (length command))) + (format t "~&>>> ") + (do ((command (read-line) (read-line))) + ((and (or (equalp command "quit") (equalp command "exit")) + (y-or-n-p "~&Really quit?")) + (save-world) + (format t "~&Goodbye!") + (quit)) + (cond ((zerop (length command)) NIL) ((not (alpha-char-p (aref command 0))) (format t "~&Invalid input.")) - (T (game-command command player))) - (input-string command)) - (format t "~&Goodbye!")))) + (T (game-command command player) + (save-world))) + (format t "~&>>> "))))) (defun describe-place (p) "Print out a complete description of place p" @@ -121,7 +124,7 @@ (defvar *commands* '(help look goto take inventory drop talk equip attack - seek save clear manual)) + seek clear manual)) ;;; Command functions have to take two arguments (a player instance and ;;; an optional(!) argument to the function). @@ -144,23 +147,6 @@ "A wrapper for 'look me'" (look player "me")) -(let ((last-save NIL)) - (defun save (player &optional game-file) - "Save a game to file (wrapper method around save-world)" - (if (and last-save (not game-file)) - (setf game-file last-save) - (progn - (when (not (or last-save game-file)) - (format t "~&What do you want to call the save file?") - (input-string game-file)) - (setf game-file (concatenate 'string "../saves/" - game-file ".world")) - (setf last-save game-file))) - (if (y-or-n-p "Save game to ~A?" game-file) - (progn (save-world game-file) - (format t "~&Game saved.")) - (setf last-save NIL)))) - (defun goto (player &optional location) "Go to the specified location" ;; Look before you leap ;-) @@ -174,7 +160,7 @@ (format t "~&This place does not border your current location!") (return-from goto)) ;; You can only enter a place if you have one of the requirements - ;; FIXME Deal with multiple possible requirements + ;; TODO Deal with multiple possible requirements (let ((req (place-requires (get-game-object 'place location)))) (unless (equalp req "") (unless (or (player-has-ability req player) diff --git a/lisp/util.lisp b/lisp/util.lisp index bfefb5a..a618aeb 100644 --- a/lisp/util.lisp +++ b/lisp/util.lisp @@ -292,7 +292,7 @@ (format t "$ ")))) (setf help-msg " Input your text below. When you are done, finish with a line that contains only -a single fullstop. If you make a mistake, you can still edit your text later.") +a single fullstop. If you make a mistake, you can reenter your text later.") (format t help-msg) (setf text (text-input)) (while (not (y-or-n-p "~&Save and exit?")) diff --git a/lisp/world.lisp b/lisp/world.lisp index 2c91abb..53a3222 100644 --- a/lisp/world.lisp +++ b/lisp/world.lisp @@ -17,8 +17,8 @@ ;; each object created in this game (defstruct world - (name "") - (main-player "") + (player-name "") + (main-character "") (players NIL) (places NIL) (monsters NIL) @@ -51,28 +51,30 @@ "Get a list of the names of all the world objects of this type." (funcall list-function object-type *world*))) -(defun name-world (name) - "Set the name of the *world*" - ;;XXX Do we still need this? - (debugging "~&The name of the world is ~A." name) - (setf (world-name *world*) name) - NIL) - (defun load-game (game-file) "Load a saved game from disk" + ;; If only the player name was passed, expand it into a file path + (unless (search ".world" game-file) + (setf game-file (concatenate 'string "../saves/" game-file ".world"))) (with-open-file (g game-file) - (let ((version-number (read g)) - (loaded-world (read g))) - (when (!= version-number ATLANTIS-VERSION :test equal) - (format t "~&WARNING: The loaded game was saved by a ") - (format t "different version of Atlantis!")) + ;; Compare versions + (unless (equal (read g) ATLANTIS-VERSION) + (format t "~&WARNING: The loaded game was saved by a ") + (format t "different version of Atlantis!") + (format t "~&Press ENTER to continue.") + (read-line)) + ;; Read the actual world + (let ((loaded-world (read g))) (if (world-p loaded-world) (progn (setf *world* loaded-world) (dolist (lisp-file (world-extension-files *world*)) (load lisp-file))) (error "World file ~A is corrupted!" game-file))))) -(defun save-world (game-file) +(defun save-world (&optional game-file) "Save a game to file" + (unless game-file + (setf game-file (concatenate 'string "../saves/" + (world-player-name *world*) ".world"))) (with-open-file (g game-file :direction :output) (format g "~S~%~S~%" ATLANTIS-VERSION *world*))) diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 88b3bad..2673367 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -182,17 +182,27 @@ (let ((honey-found NIL)) (defun climb-rock (player &optional arg) "Climb the rock at the rapids" - (if (> 25 (random 100)) + (if (> 33 (random 100)) (progn (format t "~&You slip!") - (read-line) + (sleep 3) (goto player "Stream")) (progn (format t "~&You clamber up on the rock.") - (unless honey-found + (unless honey-found ;;FIXME fails when a saved game is loaded again (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 stream-current (player &optional arg) + "The stream sweeps the player on into the Floody place." + (when (> 75 (random 100)) + (describe-place "Stream") + (format t "~&~%You struggle to get back to the banks.") (sleep 5) + (format t "~&You fight against the rushing water, but it's stronger than you.") (sleep 2) + (format t "~&The stream pulls you along.") (sleep 3) + (format t "~&It finally deposits you in a floody place.") (sleep 2) + (goto player "Floody place") (clear-screen))) + (defun play (player &optional arg) "Let the player play a game" (let ((place (player-place player))) @@ -212,8 +222,9 @@ (60 (format t "~&You pile up sand for a big strong keep in the center.")) (80 (format t "~&You decorate the castle, adding pretty little details.")) (100 (format t "~&You stand back and admire your handiwork. What a fine castle!") - (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle"))) - (unless (= sandcastle 100) (incf sandcastle 20)))) + (set-object-attribute (get-game-object 'place "Sandy pit") 'item "Sandcastle")) + (110 (format t "~&You've already built a sandcastle here! And a fine one it is too..."))) + (unless (= sandcastle 110) (incf sandcastle 20)))) (let ((score 0)) (defun poohsticks (player) @@ -264,7 +275,8 @@ (if (member 'ring (extract-elements arg)) (progn (format t "~&You slip the golden ring on your finger.") (sleep 1) - (format t "~&You feel something ought to happen.~&Nothing does.")) + (format t "~&You feel something ought to happen.") (sleep 2) + (format t "~&Nothing does.")) (format t "~&What do you want to wear?"))) (defun ring-of-destiny (player) @@ -274,7 +286,9 @@ (defun annoying-ring (player) "The ring cannot be dropped!" (format t "~&You feel a stab of pain in your heart as you watch the ring drop.") + (sleep 1) (format t "~&On second thoughts, you pick it up again.~%~%") + (sleep 1) (take player "Golden ring")) diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 6ec8224..5300102 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -22,5 +22,4 @@ define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Piglet's porch" ;Development - ;place "Christopher Robin's house" \ No newline at end of file + place "Rapids" ;Development \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 4172058..e6abda4 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -273,8 +273,9 @@ description "Whoops! You fell in! Brrr, this water is cold! Better get out quickly. But that is easier said than done, the current here is pretty strong..." + neighbour "Rapids" neighbour "Floody place" - hidden "Golden ring" + entry-hook "stream-current" define-place "Christopher Robin's house" description "TODO" @@ -294,11 +295,17 @@ neighbour "Owl's porch" define-place "Floody place" - description "TODO" + description "The stream that flows through the forest disappears here, + forming a marshy area before it reappears further on. The ground + is very boggy here, take care that you don't get stuck. There + are also a lot of flies and mosquitoes buzzing around - not + a particularly comfortable place to be!" + neighbour "Stream" neighbour "Southern woods" neighbour "Eeyore's gloomy place" neighbour "Bridge" - + hidden "Golden ring" + define-place "Eeyore's gloomy place" description "TODO" npc "Eeyore" diff --git a/doc/COMMANDS b/doc/COMMANDS index 2ab862a..8fc16ec 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -14,7 +14,6 @@ seek - Search for hidden items equip - Equip this item as your weapon attack - Fight a monster -save [] - Save the game to file Arguments in square brackets are optional, arguments in angular brackets denote place fillers. diff --git a/doc/PLAYING b/doc/PLAYING index 3ea7958..e68c5ad 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -23,14 +23,17 @@ and pressing ENTER. (Commands to the computer must always be terminated by pressing ENTER.) -The first option, "Start a new game", drops you into a submenu in which you can +## TODO Include autosave! + +The first option, "Start a new game", will first ask you for your name. (This is +needed to save the game.) It then drops you into a submenu in which you can choose which game world you want to play. As of Atlantis 0.3, only the "Winnie the Pooh" world is fully functional. (You can try the others, but they are far from complete.) -The second option, "Load a game", is for returning users who have previously -saved their game progress in one of the worlds. Again, you will be presented -with a submenu that lists all currently saved games. +The second option, "Load a saved game", is for players who have already started +a game in one of the worlds. (Your game progress is saved automatically.) Again, +you will be presented with a submenu that lists all currently saved games. The third option is for developers and need not concern us further. @@ -53,7 +56,7 @@ commands, along with a short description. This is very useful! If you want to stop playing, you can use the commands "quit" or "exit". Don't -forget to save your progress first, though! +worry, your game progress will be saved when you leave. Note that although capitalization does not matter in Atlantis, spelling does. So if you get an error message telling you that a command is not available, make @@ -136,11 +139,6 @@ the various commands. With "clear" you delete all text except the place description. -save - If you've made good progress in a game world but cannot finish the game - in one sitting, you will want to save your work. The "save" command will - ask you for a file name to save the game under, then store it for later - retrieval (via the "Load a game" option in the main menu). - Daniel Vedder -Last modified 10/10/2017 +Last modified 20/10/2017 diff --git a/doc/TODO b/doc/TODO index 1d50250..887e41c 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,7 +1,6 @@ ATLANTIS TODO LISP -* implement autosave? * split ui.lisp into two modules (one for interaction functions) ATL diff --git a/doc/bugreport.txt b/doc/bugreport.txt index 934cb07..7b7f5aa 100644 --- a/doc/bugreport.txt +++ b/doc/bugreport.txt @@ -21,7 +21,7 @@ nicht korrekt. -> FIXED * Kann man gewollt vom Stream zum Floody Place, aber nicht umgekehrt? - -> Won't fix + -> FIXED * Beim Bee Tree wäre die Erwähnung von ‚climb down‘ ganz gut denke ich (auch wenn der command nicht notwendig ist). -> Won't fix diff --git a/lisp/atlantis.lisp b/lisp/atlantis.lisp index 5ec86f0..611c7eb 100644 --- a/lisp/atlantis.lisp +++ b/lisp/atlantis.lisp @@ -7,7 +7,7 @@ ;;; date: 09/05/2015 ;;; -(defconstant ATLANTIS-VERSION '(0 2 3)) +(defconstant ATLANTIS-VERSION '(0 2 4)) (load "util.lisp") (load "game-objects.lisp") @@ -38,11 +38,20 @@ (clear-screen) (print-text-file "banner.txt") (format t "~&~%Welcome! What do you want to do?") - (setf options '("Start a new game" "Load a game" + (setf options '("Start a new game" "Load a saved game" "Advanced" "Help" "About" "Exit")) (case (choose-number-option options) - (0 (format t "~&Which world do you want to play?") + (0 ;; ask the player for his/her name + (format t "~&What is your name? ") + (setf player-name (read-line)) + (if (and (member player-name + (mapcar #'pathname-name (directory "../saves/*")) + :test #'equalp) + (not (yes-or-no-p "A game by this player already exists. Replace it?"))) + (start-menu) + (setf (world-player-name *world*) player-name)) ;; let the player choose one of the game worlds + (format t "~&Which world do you want to play?") (let ((world (choose-option (append (keys *games*) '("Back"))))) (if (equalp world "Back") (start-menu) (setf world-file (cassoc world *games*))) @@ -55,7 +64,7 @@ (when (< 2 (length chars)) (format t "~&Which character do you want to play?") (setf char-name (choose-option chars))) - (set-main-player char-name) + (setf (world-main-character *world*) char-name) (if (equalp char-name "Cancel") (start-menu) (play-game))))) diff --git a/lisp/player.lisp b/lisp/player.lisp index 1c51a05..9274fb4 100644 --- a/lisp/player.lisp +++ b/lisp/player.lisp @@ -39,10 +39,6 @@ (change-player-location player (player-place player)) (add-game-object player)) -(defun set-main-player (player-name) - "Set the main player for this game" - (setf (world-main-player *world*) player-name)) - (defun change-player-location (player location) "Change the player's location and do housekeeping" (setf location (to-string location)) diff --git a/lisp/ui.lisp b/lisp/ui.lisp index 3a5bd38..86f6e68 100644 --- a/lisp/ui.lisp +++ b/lisp/ui.lisp @@ -21,7 +21,7 @@ (defun play-game () "The main game loop" - (let ((player (get-game-object 'player (world-main-player *world*)))) + (let ((player (get-game-object 'player (world-main-character *world*)))) ;; If the player's starting position is not specified, choose at random (when (zerop (length (player-place player))) (format t "~&Choosing a random starting location.") @@ -31,16 +31,19 @@ (clear-screen) (let ((place (get-game-object 'place (player-place player)))) (describe-place place) - (input-string command) - (while (not (and (or (equalp command "quit") - (equalp command "exit")) - (y-or-n-p "~&Really quit?"))) - (cond ((zerop (length command))) + (format t "~&>>> ") + (do ((command (read-line) (read-line))) + ((and (or (equalp command "quit") (equalp command "exit")) + (y-or-n-p "~&Really quit?")) + (save-world) + (format t "~&Goodbye!") + (quit)) + (cond ((zerop (length command)) NIL) ((not (alpha-char-p (aref command 0))) (format t "~&Invalid input.")) - (T (game-command command player))) - (input-string command)) - (format t "~&Goodbye!")))) + (T (game-command command player) + (save-world))) + (format t "~&>>> "))))) (defun describe-place (p) "Print out a complete description of place p" @@ -121,7 +124,7 @@ (defvar *commands* '(help look goto take inventory drop talk equip attack - seek save clear manual)) + seek clear manual)) ;;; Command functions have to take two arguments (a player instance and ;;; an optional(!) argument to the function). @@ -144,23 +147,6 @@ "A wrapper for 'look me'" (look player "me")) -(let ((last-save NIL)) - (defun save (player &optional game-file) - "Save a game to file (wrapper method around save-world)" - (if (and last-save (not game-file)) - (setf game-file last-save) - (progn - (when (not (or last-save game-file)) - (format t "~&What do you want to call the save file?") - (input-string game-file)) - (setf game-file (concatenate 'string "../saves/" - game-file ".world")) - (setf last-save game-file))) - (if (y-or-n-p "Save game to ~A?" game-file) - (progn (save-world game-file) - (format t "~&Game saved.")) - (setf last-save NIL)))) - (defun goto (player &optional location) "Go to the specified location" ;; Look before you leap ;-) @@ -174,7 +160,7 @@ (format t "~&This place does not border your current location!") (return-from goto)) ;; You can only enter a place if you have one of the requirements - ;; FIXME Deal with multiple possible requirements + ;; TODO Deal with multiple possible requirements (let ((req (place-requires (get-game-object 'place location)))) (unless (equalp req "") (unless (or (player-has-ability req player) diff --git a/lisp/util.lisp b/lisp/util.lisp index bfefb5a..a618aeb 100644 --- a/lisp/util.lisp +++ b/lisp/util.lisp @@ -292,7 +292,7 @@ (format t "$ ")))) (setf help-msg " Input your text below. When you are done, finish with a line that contains only -a single fullstop. If you make a mistake, you can still edit your text later.") +a single fullstop. If you make a mistake, you can reenter your text later.") (format t help-msg) (setf text (text-input)) (while (not (y-or-n-p "~&Save and exit?")) diff --git a/lisp/world.lisp b/lisp/world.lisp index 2c91abb..53a3222 100644 --- a/lisp/world.lisp +++ b/lisp/world.lisp @@ -17,8 +17,8 @@ ;; each object created in this game (defstruct world - (name "") - (main-player "") + (player-name "") + (main-character "") (players NIL) (places NIL) (monsters NIL) @@ -51,28 +51,30 @@ "Get a list of the names of all the world objects of this type." (funcall list-function object-type *world*))) -(defun name-world (name) - "Set the name of the *world*" - ;;XXX Do we still need this? - (debugging "~&The name of the world is ~A." name) - (setf (world-name *world*) name) - NIL) - (defun load-game (game-file) "Load a saved game from disk" + ;; If only the player name was passed, expand it into a file path + (unless (search ".world" game-file) + (setf game-file (concatenate 'string "../saves/" game-file ".world"))) (with-open-file (g game-file) - (let ((version-number (read g)) - (loaded-world (read g))) - (when (!= version-number ATLANTIS-VERSION :test equal) - (format t "~&WARNING: The loaded game was saved by a ") - (format t "different version of Atlantis!")) + ;; Compare versions + (unless (equal (read g) ATLANTIS-VERSION) + (format t "~&WARNING: The loaded game was saved by a ") + (format t "different version of Atlantis!") + (format t "~&Press ENTER to continue.") + (read-line)) + ;; Read the actual world + (let ((loaded-world (read g))) (if (world-p loaded-world) (progn (setf *world* loaded-world) (dolist (lisp-file (world-extension-files *world*)) (load lisp-file))) (error "World file ~A is corrupted!" game-file))))) -(defun save-world (game-file) +(defun save-world (&optional game-file) "Save a game to file" + (unless game-file + (setf game-file (concatenate 'string "../saves/" + (world-player-name *world*) ".world"))) (with-open-file (g game-file :direction :output) (format g "~S~%~S~%" ATLANTIS-VERSION *world*))) diff --git a/saves/pooh1.world b/saves/pooh1.world deleted file mode 100644 index c1a6ef3..0000000 --- a/saves/pooh1.world +++ /dev/null @@ -1,206 +0,0 @@ -(0 2 1) -#S(WORLD :NAME "100 Acre Wood" :MAIN-PLAYER "Winnie the Pooh" - :PLAYERS - (#S(PLAYER :NAME "Winnie the Pooh" :DESCRIPTION "A small but very lovable bear of very little brain." :STRENGTH 0 :DEXTERITY 0 :CONSTITUTION 0 :INTELLIGENCE 0 - :MONEY 0 :ABILITY NIL :ITEM ("Hunny" "Hunny") :WEAPON "" :ARMOUR-CLASS 0 :PLACE "Bridge" :EXPERIENCE 7 :LEVEL 0 :MAX-HEALTH 50 :HEALTH 50) - #S(PLAYER :NAME "Christopher Robin" :DESCRIPTION "Pooh's best friend." :STRENGTH 0 :DEXTERITY 0 :CONSTITUTION 0 :INTELLIGENCE 0 :MONEY 0 :ABILITY NIL :ITEM NIL - :WEAPON "" :ARMOUR-CLASS 0 :PLACE "Western woods" :EXPERIENCE 0 :LEVEL 0 :MAX-HEALTH 50 :HEALTH 50)) - :PLACES - (#S(PLACE :NAME "Pooh's home" - :DESCRIPTION - "Welcome home! This is what you call comfort: your bed, your -chair, your table. Not to forget your larder, filled with -delicious honey..." - :NEIGHBOUR ("Pooh's porch" "Pooh's branch") :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Pooh's porch" - :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." - :NEIGHBOUR ("Pooh's home" "Western woods") :ITEM ("Pooh's sign") :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Pooh's branch" - :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." - :NEIGHBOUR ("Pooh's home" "Pooh's porch") :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Western woods" - :DESCRIPTION - "This is the western part of the 100 Acre Wood. As you would -expect in a wood, it is full of trees. Here, however, there are -not quite that many - mainly young birches." - :NEIGHBOUR ("Pooh's porch" "Central woods" "Northern woods" "Southern woods" "Piglet's porch" "Six pine trees" "Kanga's house") :ITEM NIL :MONSTER NIL :NPC NIL - :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Central woods" - :DESCRIPTION - "This is the oldest part of the 100 Acre Wood. The oaks you see -around you are truly ancient, hundreds of years old. Even Owl -can't remember when they were planted. It's very peaceful here." - :NEIGHBOUR ("Northern woods" "Eastern woods" "Southern woods" "Western woods" "Owl's porch" "Deep forest" "Hill") :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL - :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Northern woods" :DESCRIPTION "TODO" - :NEIGHBOUR ("Central woods" "Eastern woods" "Western woods" "Kanga's house" "Sandy pit" "Bee tree" "Rabbit's house" "Rabbit's friends and relations" "Rapids") - :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Southern woods" :DESCRIPTION "TODO" - :NEIGHBOUR ("Central woods" "Eastern woods" "Western woods" "Piglet's porch" "Woozle hideout" "Eeyore's gloomy place" "Floody place" "Bridge") :ITEM NIL - :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Eastern woods" :DESCRIPTION "TODO" :NEIGHBOUR ("Central woods" "Northern woods" "Southern woods" "Christopher Robin's porch" "Owl's porch" "Bridge") - :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Deep forest" - :DESCRIPTION - "Thick firs and spruces grow here, shutting out the light with -their branches. Broken branches lie about on the ground and -cob webs span the spaces between the trees. Watch your steps, -you never know what you may meet in here. And don't get lost!" - :NEIGHBOUR ("Deep forest" "Central woods") :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Hill" - :DESCRIPTION - "From this hill you can see the entire 100 Acre Wood and -beyond. You can see Christopher Robin's house, Pooh's house, -the tree with the bees' nest, Owl's home, Kanga's and Roo's -home and the stream that marks the edge of the woods." - :NEIGHBOUR ("Central woods") :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Bridge" - :DESCRIPTION - "A simple wooden bridge spans the stream that marks the edge of -the 100 Acre Wood. For all practical purposes, the world ends here." - :NEIGHBOUR ("Southern woods" "Eastern woods" "Floody place") :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Piglet's porch" :DESCRIPTION "TODO" :NEIGHBOUR ("Western woods" "Southern woods" "Piglet's home") :ITEM ("Piglet's sign") :MONSTER NIL :NPC NIL - :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Piglet's home" :DESCRIPTION "TODO" :NEIGHBOUR ("Piglet's porch") :ITEM NIL :MONSTER NIL :NPC ("Piglet") :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Kanga's house" :DESCRIPTION "TODO" :NEIGHBOUR ("Northern woods" "Western woods" "Sandy pit") :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" - :FUNCTION "") - #S(PLACE :NAME "Sandy pit" :DESCRIPTION "TODO" :NEIGHBOUR ("Northern woods" "Kanga's house" "Misty forest") :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" - :FUNCTION "") - #S(PLACE :NAME "Six pine trees" :DESCRIPTION "TODO" :NEIGHBOUR ("Western woods" "Heffalump trap") :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" - :FUNCTION "") - #S(PLACE :NAME "Heffalump trap" :DESCRIPTION "TODO" :NEIGHBOUR ("Six pine trees") :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Bee tree" :DESCRIPTION "TODO" :NEIGHBOUR ("Northern woods") :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Rabbit's house" :DESCRIPTION "TODO" :NEIGHBOUR ("Northern woods" "Rabbit's friends and relations") :ITEM NIL :MONSTER NIL :NPC ("Rabbit") :SPAWNS NIL - :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Rabbit's friends and relations" :DESCRIPTION "TODO" :NEIGHBOUR ("Northern woods" "Rabbit's house") :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL - :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Rapids" :DESCRIPTION "TODO" :NEIGHBOUR ("Northern woods") :ITEM ("North Pole") :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Christopher Robin's house" :DESCRIPTION "TODO" :NEIGHBOUR ("Eastern woods") :ITEM NIL :MONSTER NIL :NPC ("Christopher Robin") :SPAWNS NIL - :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Owl's porch" :DESCRIPTION "TODO" :NEIGHBOUR ("Owl's home" "Eastern woods" "Central woods") :ITEM ("Bellrope") :MONSTER NIL :NPC NIL :SPAWNS NIL - :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Owl's home" :DESCRIPTION "TODO" :NEIGHBOUR ("Owl's porch") :ITEM NIL :MONSTER NIL :NPC ("Owl") :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Floody place" :DESCRIPTION "TODO" :NEIGHBOUR ("Southern woods" "Eeyore's gloomy place" "Bridge") :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL - :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Eeyore's gloomy place" :DESCRIPTION "TODO" :NEIGHBOUR ("Southern woods" "Floody place") :ITEM NIL :MONSTER NIL :NPC ("Eeyore") :SPAWNS NIL - :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Woozle hideout" :DESCRIPTION "TODO" :NEIGHBOUR ("Southern woods") :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" :FUNCTION "") - #S(PLACE :NAME "Misty forest" :DESCRIPTION "TODO" :NEIGHBOUR ("Sandy pit") :ITEM NIL :MONSTER NIL :NPC NIL :SPAWNS NIL :REQUIRES "" :FUNCTION "")) - :MONSTERS NIL - :NPCS - (#S(NPC :NAME "Piglet" - :DESCRIPTION - "Piglet is Pooh's best friend. He is always cheerful (except -when he's scared) and always ready for a bit of fun." - :SAYS "Oh hello Pooh, good to see you!" :SELLS NIL :QUEST "") - #S(NPC :NAME "Kanga" - :DESCRIPTION - "Kanga is Roo's mother. She is very responsible, but also -very loving and affectionate. Don't disobey her, though!" - :SAYS "Hello Pooh, have you come to play with Roo?" :SELLS NIL :QUEST "") - #S(NPC :NAME "Roo" - :DESCRIPTION - "Roo is Pooh's youngest friend. He loves a good romp, especially -with his friend Tigger." - :SAYS "Hey Pooh, Tigger and I want to play catch. Do you want to join?" :SELLS NIL :QUEST "") - #S(NPC :NAME "Tigger" - :DESCRIPTION - "Tigger is the most hyperactive animal you could imagine. His -constant bouncing can be incredibly irritating, but he -is very loyal and too friendly to really dislike." - :SAYS "Watch out, HERE I COME!!!" :SELLS NIL :QUEST "") - #S(NPC :NAME "Owl" - :DESCRIPTION - "Owl is a wise, old bird. He is ever so clever and uses many -big words - if you can understand him, it's usually worth listening." - :SAYS - "The climatic conditions appear to foreshadow a certain amount of -precipitation tonight, don't you agree?" - :SELLS NIL :QUEST "") - #S(NPC :NAME "Christopher Robin" - :DESCRIPTION - "Christopher Robin is Pooh's oldest friend. He's known him for -as long as he can remember. If you need advice or help, -Christopher Robin is sure to be of service." - :SAYS "Hey Pooh, remember that time we went on an expedition together?" :SELLS NIL :QUEST "") - #S(NPC :NAME "Eeyore" - :DESCRIPTION - "Eeyore the Donkey is always feeling blue. Somehow he got the -idea that nobody likes him. It isn't true, but hearing him -complaining all day isn't particularly cheering." - :SAYS - "I'm sure it's going to rain today. Just when I needed to go and search -for my tail. It always rains when it's most inconvenient. -Oh, hello Pooh. You haven't come to see me for a while! -Well, I suppose you had better things to do." - :SELLS NIL :QUEST "Find the tail") - #S(NPC :NAME "Rabbit" - :DESCRIPTION - "Rabbit is a Very Important Person, because he has ever so -many friends-and-relations. So many in fact, that he never -seems to have time for any of them. He is always on the move, -always busy, and not particularly fond of bears who happen -to stop by his home for teatime." - :SAYS - "Hello Pooh, how are you? Oh, would you look at the time, I really -must be getting a move on. Catch you later!" - :SELLS NIL :QUEST "")) - :ITEMS - (#S(ITEM :NAME "Hunny" :DESCRIPTION "A jar full to the brim of delicious, golden honey. Hmmmm..." :COST 0 :WEAPON NIL :FUNCTION NIL :ABILITY NIL) - #S(ITEM :NAME "Pooh's sign" - :DESCRIPTION - " -+--------------+ -| Mr SANDERS | -+--------------+ -" - :COST 0 :WEAPON NIL :FUNCTION NIL :ABILITY NIL) - #S(ITEM :NAME "Piglet's sign" - :DESCRIPTION - " -_________________ -| \\_ -| TRESPASSERS W > -|_________________< -" - :COST 0 :WEAPON NIL :FUNCTION NIL :ABILITY NIL) - #S(ITEM :NAME "North Pole" - :DESCRIPTION - " -============================= -|| || -|| NORTH POLE || -|| DISCOVERED BY POOH || -|| POOH FOUND IT || -|| || -============================= -" - :COST 0 :WEAPON NIL :FUNCTION NIL :ABILITY NIL) - #S(ITEM :NAME "Bellrope" - :DESCRIPTION - "This rope looks perfectly designed to be pulled. The designer -even tried to give it a natural flair by shaping it like a -tail. Hm, that does look very much like a tail!" - :COST 0 :WEAPON NIL :FUNCTION NIL :ABILITY NIL)) - :WEAPONS NIL - :QUESTS - (#S(QUEST :NAME "Find the tail" - :SAY-BEFORE - "If you're here already, perhaps you could help me find my tail? -I really only feel like half a donkey without it. I really don't -know where to look. Perhaps one of Rabbit's friends-and-relations -has nicked it, or the Heffalump stole it. That would be just like -them, don't you think?" - :SAY-AFTER - "Well, would you have a look, you actually found it. I suppose I -ought to give you something for your troubles, though I really -don't have much to give. But here, take this pot of honey." - :PROOF-ITEM ("Bellrope") :REWARD-ITEM ("Hunny") :MONEY 0 :EXPERIENCE 10)) - :GAME-FUNCTIONS NIL)