diff --git a/doc/PLAYING b/doc/PLAYING index e69de29..80b4cca 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -0,0 +1,138 @@ +====================== +|| PLAYING ATLANTIS || +====================== + +Atlantis is a platform for text-based adventure games. That means that you, +the player, interact with the computer using nothing but the keyboard and the +screen. (Well, and of course your imagination...) + +This guide aims to give you a quick run-down of what you will need to know +to play Atlantis. If you are interested in more details, such as how to create +your own worlds, you are hereby referred to the accompanying documentation. + +The current development version of Atlantis can be found at: +www.github.com/atlantis + + +THE MAIN MENU + +This is where you find yourself when you first start Atlantis. Your options are +listed underneath the game banner. At the very bottom, you see the "command +prompt" (>>>), which is the indication that the computer expects some input from +you. In a menu like this, you can choose an option by typing the relevant number +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 +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 you won't get +very far.) + +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 third option is for developers and need not concern us further. + +The fourth option displays this help text; the fifth option shows a copyright +notice and the Atlantis software license. The sixth option quits the game. + + +BASIC GAME PLAY + +When you decide to start a new game in one of the game worlds, you may be +given a choice of characters to play. (Some worlds are only intended for a +single character. In that case, you are taken straight to the game.) + +Once inside the game world, you no longer navigate using a numeric menu but with +commands. Most commands take the form , whereby is replaced +with the actual command (e.g. look) and is replaced with the object in +question (e.g. bed). + +Typing "help" (without the quotation marks) will bring up a list of the core +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! + +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 +sure that you spelt it correctly. + + +THE GAME SCREEN + +All game worlds consist of a network of distinct places. Your current location +is always displayed at the very top of the screen. Below the location's name, +you will find a more detailed description of your surroundings. It's worth +reading this carefully, as it may contain important clues! + +Underneath the place description are various lists, starting with neighbouring +places. There may also be items, NPCs (= non-playing characters) or even +monsters that you can interact with. + + +CORE COMMANDS + +Below you will find a list of the core Atlantis commands. Some places or items +may offer additional commands that are available when you are in that place +or in possession of the item. If any place/item provides commands, it is so +indicated in the game. + +look - This is the most versatile command in the game. With it, you can inspect + any item, NPC or monster (e.g. look cook). You can also bring up + information about yourself with "look me" or about your current location + with "look here". + +goto - The second most important command in Atlantis. With "goto" you can change + your location to a neighbouring place. Enter the name of the place you + wish to go to after the actual command (e.g. goto Kitchen). + +search - Some rooms contain hidden items. To find them, you first need to search + the room. When you do so, you have a 50% chance of finding a hidden + object. + +take - This command is used to pick up an item. Most items in the game can be + picked up, many are useful. + +drop - This, obviously, is the opposite to take. If you no longer require an + item, just drop it. + +talk - This command allows you to interact with NPCs. Almost all NPCs will have + something to say to you, and occasionally, it's important! Some NPCs also + offer further options, such as buying or selling items, or quests. + (Quests are tasks that you can undertake for the NPC. You prove that you + have completed the task by returning a certain, quest-specific item to + the NPC, upon which you will of course receive a reward.) + +equip - Some items can be used as weapons. If you ever find yourself in a fight + with a monster, you will want to have a weapon on you. However, just + owning a weapon isn't enough. Before you can use it, you have to equip + it with this command. + +attack - Some places contain monsters. (In Atlantis, a "monster" is any hostile + non-playing character.) While some monsters attack you first, you also + have the choice of attacking them. After all, there may be rich + treasure in store for the brave adventurer... (Make sure you have a + weapon equipped, though!) When you attack a monster, or vice versa, + the computer calculates the amount of damage you both take based on + your various strengths and weapons. Make sure that your health doesn't + drop too low! If it ever reaches 0, you're dead... (You can check up + on your current health with the "look me" command. There may be some + ways in-game of healing yourself - but you'll have to find those out + for yourself.) Each time you use the "attack" command is equivalent to + one round of fighting. Eventually, you'll kill the monster, or decide + that discretion is the better part of valour... + +clear - Sometimes, your screen can get rather cluttered up with the output of + 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/08/2017 diff --git a/doc/PLAYING b/doc/PLAYING index e69de29..80b4cca 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -0,0 +1,138 @@ +====================== +|| PLAYING ATLANTIS || +====================== + +Atlantis is a platform for text-based adventure games. That means that you, +the player, interact with the computer using nothing but the keyboard and the +screen. (Well, and of course your imagination...) + +This guide aims to give you a quick run-down of what you will need to know +to play Atlantis. If you are interested in more details, such as how to create +your own worlds, you are hereby referred to the accompanying documentation. + +The current development version of Atlantis can be found at: +www.github.com/atlantis + + +THE MAIN MENU + +This is where you find yourself when you first start Atlantis. Your options are +listed underneath the game banner. At the very bottom, you see the "command +prompt" (>>>), which is the indication that the computer expects some input from +you. In a menu like this, you can choose an option by typing the relevant number +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 +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 you won't get +very far.) + +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 third option is for developers and need not concern us further. + +The fourth option displays this help text; the fifth option shows a copyright +notice and the Atlantis software license. The sixth option quits the game. + + +BASIC GAME PLAY + +When you decide to start a new game in one of the game worlds, you may be +given a choice of characters to play. (Some worlds are only intended for a +single character. In that case, you are taken straight to the game.) + +Once inside the game world, you no longer navigate using a numeric menu but with +commands. Most commands take the form , whereby is replaced +with the actual command (e.g. look) and is replaced with the object in +question (e.g. bed). + +Typing "help" (without the quotation marks) will bring up a list of the core +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! + +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 +sure that you spelt it correctly. + + +THE GAME SCREEN + +All game worlds consist of a network of distinct places. Your current location +is always displayed at the very top of the screen. Below the location's name, +you will find a more detailed description of your surroundings. It's worth +reading this carefully, as it may contain important clues! + +Underneath the place description are various lists, starting with neighbouring +places. There may also be items, NPCs (= non-playing characters) or even +monsters that you can interact with. + + +CORE COMMANDS + +Below you will find a list of the core Atlantis commands. Some places or items +may offer additional commands that are available when you are in that place +or in possession of the item. If any place/item provides commands, it is so +indicated in the game. + +look - This is the most versatile command in the game. With it, you can inspect + any item, NPC or monster (e.g. look cook). You can also bring up + information about yourself with "look me" or about your current location + with "look here". + +goto - The second most important command in Atlantis. With "goto" you can change + your location to a neighbouring place. Enter the name of the place you + wish to go to after the actual command (e.g. goto Kitchen). + +search - Some rooms contain hidden items. To find them, you first need to search + the room. When you do so, you have a 50% chance of finding a hidden + object. + +take - This command is used to pick up an item. Most items in the game can be + picked up, many are useful. + +drop - This, obviously, is the opposite to take. If you no longer require an + item, just drop it. + +talk - This command allows you to interact with NPCs. Almost all NPCs will have + something to say to you, and occasionally, it's important! Some NPCs also + offer further options, such as buying or selling items, or quests. + (Quests are tasks that you can undertake for the NPC. You prove that you + have completed the task by returning a certain, quest-specific item to + the NPC, upon which you will of course receive a reward.) + +equip - Some items can be used as weapons. If you ever find yourself in a fight + with a monster, you will want to have a weapon on you. However, just + owning a weapon isn't enough. Before you can use it, you have to equip + it with this command. + +attack - Some places contain monsters. (In Atlantis, a "monster" is any hostile + non-playing character.) While some monsters attack you first, you also + have the choice of attacking them. After all, there may be rich + treasure in store for the brave adventurer... (Make sure you have a + weapon equipped, though!) When you attack a monster, or vice versa, + the computer calculates the amount of damage you both take based on + your various strengths and weapons. Make sure that your health doesn't + drop too low! If it ever reaches 0, you're dead... (You can check up + on your current health with the "look me" command. There may be some + ways in-game of healing yourself - but you'll have to find those out + for yourself.) Each time you use the "attack" command is equivalent to + one round of fighting. Eventually, you'll kill the monster, or decide + that discretion is the better part of valour... + +clear - Sometimes, your screen can get rather cluttered up with the output of + 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/08/2017 diff --git a/doc/TODO b/doc/TODO index f11195d..b3ddbae 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,5 +1,10 @@ ATLANTIS TODO +LISP +* only display non-nil object lists in the place description +* remove (magic) from the code + +ATL * fill in missing place descriptions * hide 4 more pots of honey * require XP minimum to finish game? diff --git a/doc/PLAYING b/doc/PLAYING index e69de29..80b4cca 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -0,0 +1,138 @@ +====================== +|| PLAYING ATLANTIS || +====================== + +Atlantis is a platform for text-based adventure games. That means that you, +the player, interact with the computer using nothing but the keyboard and the +screen. (Well, and of course your imagination...) + +This guide aims to give you a quick run-down of what you will need to know +to play Atlantis. If you are interested in more details, such as how to create +your own worlds, you are hereby referred to the accompanying documentation. + +The current development version of Atlantis can be found at: +www.github.com/atlantis + + +THE MAIN MENU + +This is where you find yourself when you first start Atlantis. Your options are +listed underneath the game banner. At the very bottom, you see the "command +prompt" (>>>), which is the indication that the computer expects some input from +you. In a menu like this, you can choose an option by typing the relevant number +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 +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 you won't get +very far.) + +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 third option is for developers and need not concern us further. + +The fourth option displays this help text; the fifth option shows a copyright +notice and the Atlantis software license. The sixth option quits the game. + + +BASIC GAME PLAY + +When you decide to start a new game in one of the game worlds, you may be +given a choice of characters to play. (Some worlds are only intended for a +single character. In that case, you are taken straight to the game.) + +Once inside the game world, you no longer navigate using a numeric menu but with +commands. Most commands take the form , whereby is replaced +with the actual command (e.g. look) and is replaced with the object in +question (e.g. bed). + +Typing "help" (without the quotation marks) will bring up a list of the core +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! + +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 +sure that you spelt it correctly. + + +THE GAME SCREEN + +All game worlds consist of a network of distinct places. Your current location +is always displayed at the very top of the screen. Below the location's name, +you will find a more detailed description of your surroundings. It's worth +reading this carefully, as it may contain important clues! + +Underneath the place description are various lists, starting with neighbouring +places. There may also be items, NPCs (= non-playing characters) or even +monsters that you can interact with. + + +CORE COMMANDS + +Below you will find a list of the core Atlantis commands. Some places or items +may offer additional commands that are available when you are in that place +or in possession of the item. If any place/item provides commands, it is so +indicated in the game. + +look - This is the most versatile command in the game. With it, you can inspect + any item, NPC or monster (e.g. look cook). You can also bring up + information about yourself with "look me" or about your current location + with "look here". + +goto - The second most important command in Atlantis. With "goto" you can change + your location to a neighbouring place. Enter the name of the place you + wish to go to after the actual command (e.g. goto Kitchen). + +search - Some rooms contain hidden items. To find them, you first need to search + the room. When you do so, you have a 50% chance of finding a hidden + object. + +take - This command is used to pick up an item. Most items in the game can be + picked up, many are useful. + +drop - This, obviously, is the opposite to take. If you no longer require an + item, just drop it. + +talk - This command allows you to interact with NPCs. Almost all NPCs will have + something to say to you, and occasionally, it's important! Some NPCs also + offer further options, such as buying or selling items, or quests. + (Quests are tasks that you can undertake for the NPC. You prove that you + have completed the task by returning a certain, quest-specific item to + the NPC, upon which you will of course receive a reward.) + +equip - Some items can be used as weapons. If you ever find yourself in a fight + with a monster, you will want to have a weapon on you. However, just + owning a weapon isn't enough. Before you can use it, you have to equip + it with this command. + +attack - Some places contain monsters. (In Atlantis, a "monster" is any hostile + non-playing character.) While some monsters attack you first, you also + have the choice of attacking them. After all, there may be rich + treasure in store for the brave adventurer... (Make sure you have a + weapon equipped, though!) When you attack a monster, or vice versa, + the computer calculates the amount of damage you both take based on + your various strengths and weapons. Make sure that your health doesn't + drop too low! If it ever reaches 0, you're dead... (You can check up + on your current health with the "look me" command. There may be some + ways in-game of healing yourself - but you'll have to find those out + for yourself.) Each time you use the "attack" command is equivalent to + one round of fighting. Eventually, you'll kill the monster, or decide + that discretion is the better part of valour... + +clear - Sometimes, your screen can get rather cluttered up with the output of + 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/08/2017 diff --git a/doc/TODO b/doc/TODO index f11195d..b3ddbae 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,5 +1,10 @@ ATLANTIS TODO +LISP +* only display non-nil object lists in the place description +* remove (magic) from the code + +ATL * fill in missing place descriptions * hide 4 more pots of honey * require XP minimum to finish game? diff --git a/lisp/atlantis.lisp b/lisp/atlantis.lisp index d2687ee..8c45b37 100644 --- a/lisp/atlantis.lisp +++ b/lisp/atlantis.lisp @@ -7,7 +7,7 @@ ;;; date: 09/05/2015 ;;; -(defconstant ATLANTIS-VERSION '(0 2 1)) +(defconstant ATLANTIS-VERSION '(0 2 2)) (load "util.lisp") (load "game-objects.lisp") @@ -21,8 +21,8 @@ ;; Game worlds must be registered in this list with a display name ;; and a path relative to ../ATL -(defvar *games* '(("Lugwey" "Lugwey/lugwey.atl") - ("Winnie the Pooh" "Pooh/pooh.atl") +(defvar *games* '(("Winnie the Pooh" "Pooh/pooh.atl") + ("Lugwey" "Lugwey/lugwey.atl") ("Development" "dev/test.atl"))) (defun print-version () @@ -31,7 +31,8 @@ (second ATLANTIS-VERSION) (third ATLANTIS-VERSION)) (format t "~&Copyright (c) 2015-2017 Daniel Vedder") - (format t "~&Licensed under the terms of the GNU GPLv3.~%")) + (format t "~&Licensed under the terms of the GNU GPLv3.") + (format t "~&www.github.com/atlantis~%")) (defun start-menu () "Show the start menu and take a choice from the user" @@ -39,7 +40,7 @@ (print-text-file "banner.txt") (format t "~&~%Welcome! What do you want to do?") (setf options '("Start a new game" "Load a game" - "Create worlds" "About" "Exit")) + "Advanced" "Help" "About" "Exit")) (case (choose-number-option options) (0 (format t "~&Which world do you want to play?") ;; let the player choose one of the game worlds @@ -63,17 +64,27 @@ (if (equalp char-name "Cancel") (start-menu) (play-game))))) + ;; choose a previously saved game (1 (format t "~&What game file do you want to load?") - (let ((game (choose-option (mapcar #'pathname-name - (directory "../saves/*"))))) - (setf game (concatenate 'string "../saves/" game ".world")) - (load-game game) - (play-game))) - (2 (world-creator)) - (3 (print-version) + (let ((game (choose-option (append (mapcar #'pathname-name + (directory "../saves/*")) + '("Back"))))) + (if (equalp game "Back") (start-menu) + (progn (setf game (concatenate 'string "../saves/" + game ".world")) + (load-game game) + (play-game))))) + (2 (world-creator)) ;;XXX Remove this from the main menu? + (3 (clear-screen) + (print-text-file "../doc/PLAYING") (read-line) (start-menu)) - (4 (format t "~&Goodbye!") + (4 (print-version) + (when (y-or-n-p "~&~%Show the license text?") + (print-text-file "../doc/COPYING") + (read-line)) + (start-menu)) + (5 (format t "~&Goodbye!") (quit)))) (defun cmd-parameter (name &optional truth-value) diff --git a/doc/PLAYING b/doc/PLAYING index e69de29..80b4cca 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -0,0 +1,138 @@ +====================== +|| PLAYING ATLANTIS || +====================== + +Atlantis is a platform for text-based adventure games. That means that you, +the player, interact with the computer using nothing but the keyboard and the +screen. (Well, and of course your imagination...) + +This guide aims to give you a quick run-down of what you will need to know +to play Atlantis. If you are interested in more details, such as how to create +your own worlds, you are hereby referred to the accompanying documentation. + +The current development version of Atlantis can be found at: +www.github.com/atlantis + + +THE MAIN MENU + +This is where you find yourself when you first start Atlantis. Your options are +listed underneath the game banner. At the very bottom, you see the "command +prompt" (>>>), which is the indication that the computer expects some input from +you. In a menu like this, you can choose an option by typing the relevant number +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 +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 you won't get +very far.) + +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 third option is for developers and need not concern us further. + +The fourth option displays this help text; the fifth option shows a copyright +notice and the Atlantis software license. The sixth option quits the game. + + +BASIC GAME PLAY + +When you decide to start a new game in one of the game worlds, you may be +given a choice of characters to play. (Some worlds are only intended for a +single character. In that case, you are taken straight to the game.) + +Once inside the game world, you no longer navigate using a numeric menu but with +commands. Most commands take the form , whereby is replaced +with the actual command (e.g. look) and is replaced with the object in +question (e.g. bed). + +Typing "help" (without the quotation marks) will bring up a list of the core +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! + +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 +sure that you spelt it correctly. + + +THE GAME SCREEN + +All game worlds consist of a network of distinct places. Your current location +is always displayed at the very top of the screen. Below the location's name, +you will find a more detailed description of your surroundings. It's worth +reading this carefully, as it may contain important clues! + +Underneath the place description are various lists, starting with neighbouring +places. There may also be items, NPCs (= non-playing characters) or even +monsters that you can interact with. + + +CORE COMMANDS + +Below you will find a list of the core Atlantis commands. Some places or items +may offer additional commands that are available when you are in that place +or in possession of the item. If any place/item provides commands, it is so +indicated in the game. + +look - This is the most versatile command in the game. With it, you can inspect + any item, NPC or monster (e.g. look cook). You can also bring up + information about yourself with "look me" or about your current location + with "look here". + +goto - The second most important command in Atlantis. With "goto" you can change + your location to a neighbouring place. Enter the name of the place you + wish to go to after the actual command (e.g. goto Kitchen). + +search - Some rooms contain hidden items. To find them, you first need to search + the room. When you do so, you have a 50% chance of finding a hidden + object. + +take - This command is used to pick up an item. Most items in the game can be + picked up, many are useful. + +drop - This, obviously, is the opposite to take. If you no longer require an + item, just drop it. + +talk - This command allows you to interact with NPCs. Almost all NPCs will have + something to say to you, and occasionally, it's important! Some NPCs also + offer further options, such as buying or selling items, or quests. + (Quests are tasks that you can undertake for the NPC. You prove that you + have completed the task by returning a certain, quest-specific item to + the NPC, upon which you will of course receive a reward.) + +equip - Some items can be used as weapons. If you ever find yourself in a fight + with a monster, you will want to have a weapon on you. However, just + owning a weapon isn't enough. Before you can use it, you have to equip + it with this command. + +attack - Some places contain monsters. (In Atlantis, a "monster" is any hostile + non-playing character.) While some monsters attack you first, you also + have the choice of attacking them. After all, there may be rich + treasure in store for the brave adventurer... (Make sure you have a + weapon equipped, though!) When you attack a monster, or vice versa, + the computer calculates the amount of damage you both take based on + your various strengths and weapons. Make sure that your health doesn't + drop too low! If it ever reaches 0, you're dead... (You can check up + on your current health with the "look me" command. There may be some + ways in-game of healing yourself - but you'll have to find those out + for yourself.) Each time you use the "attack" command is equivalent to + one round of fighting. Eventually, you'll kill the monster, or decide + that discretion is the better part of valour... + +clear - Sometimes, your screen can get rather cluttered up with the output of + 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/08/2017 diff --git a/doc/TODO b/doc/TODO index f11195d..b3ddbae 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,5 +1,10 @@ ATLANTIS TODO +LISP +* only display non-nil object lists in the place description +* remove (magic) from the code + +ATL * fill in missing place descriptions * hide 4 more pots of honey * require XP minimum to finish game? diff --git a/lisp/atlantis.lisp b/lisp/atlantis.lisp index d2687ee..8c45b37 100644 --- a/lisp/atlantis.lisp +++ b/lisp/atlantis.lisp @@ -7,7 +7,7 @@ ;;; date: 09/05/2015 ;;; -(defconstant ATLANTIS-VERSION '(0 2 1)) +(defconstant ATLANTIS-VERSION '(0 2 2)) (load "util.lisp") (load "game-objects.lisp") @@ -21,8 +21,8 @@ ;; Game worlds must be registered in this list with a display name ;; and a path relative to ../ATL -(defvar *games* '(("Lugwey" "Lugwey/lugwey.atl") - ("Winnie the Pooh" "Pooh/pooh.atl") +(defvar *games* '(("Winnie the Pooh" "Pooh/pooh.atl") + ("Lugwey" "Lugwey/lugwey.atl") ("Development" "dev/test.atl"))) (defun print-version () @@ -31,7 +31,8 @@ (second ATLANTIS-VERSION) (third ATLANTIS-VERSION)) (format t "~&Copyright (c) 2015-2017 Daniel Vedder") - (format t "~&Licensed under the terms of the GNU GPLv3.~%")) + (format t "~&Licensed under the terms of the GNU GPLv3.") + (format t "~&www.github.com/atlantis~%")) (defun start-menu () "Show the start menu and take a choice from the user" @@ -39,7 +40,7 @@ (print-text-file "banner.txt") (format t "~&~%Welcome! What do you want to do?") (setf options '("Start a new game" "Load a game" - "Create worlds" "About" "Exit")) + "Advanced" "Help" "About" "Exit")) (case (choose-number-option options) (0 (format t "~&Which world do you want to play?") ;; let the player choose one of the game worlds @@ -63,17 +64,27 @@ (if (equalp char-name "Cancel") (start-menu) (play-game))))) + ;; choose a previously saved game (1 (format t "~&What game file do you want to load?") - (let ((game (choose-option (mapcar #'pathname-name - (directory "../saves/*"))))) - (setf game (concatenate 'string "../saves/" game ".world")) - (load-game game) - (play-game))) - (2 (world-creator)) - (3 (print-version) + (let ((game (choose-option (append (mapcar #'pathname-name + (directory "../saves/*")) + '("Back"))))) + (if (equalp game "Back") (start-menu) + (progn (setf game (concatenate 'string "../saves/" + game ".world")) + (load-game game) + (play-game))))) + (2 (world-creator)) ;;XXX Remove this from the main menu? + (3 (clear-screen) + (print-text-file "../doc/PLAYING") (read-line) (start-menu)) - (4 (format t "~&Goodbye!") + (4 (print-version) + (when (y-or-n-p "~&~%Show the license text?") + (print-text-file "../doc/COPYING") + (read-line)) + (start-menu)) + (5 (format t "~&Goodbye!") (quit)))) (defun cmd-parameter (name &optional truth-value) diff --git a/lisp/player.lisp b/lisp/player.lisp index d068cb1..c56284f 100644 --- a/lisp/player.lisp +++ b/lisp/player.lisp @@ -33,7 +33,6 @@ ;; XXX Make this configurable in ATL? (defvar *level-experience* 100) - (defun add-player (player) "Add this player to the game world" (change-player-location player (player-place player)) @@ -49,6 +48,8 @@ (objectify-place-monsters location) (set-object-attribute player 'place location)) +;;TODO limit the number of carryable items? + ;; XXX This function is probably superfluous, as the player struct should only ;; store names of game objects (the actual objects are stored in *world*) (let ((list-function (make-list-function 'player NIL))) diff --git a/doc/PLAYING b/doc/PLAYING index e69de29..80b4cca 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -0,0 +1,138 @@ +====================== +|| PLAYING ATLANTIS || +====================== + +Atlantis is a platform for text-based adventure games. That means that you, +the player, interact with the computer using nothing but the keyboard and the +screen. (Well, and of course your imagination...) + +This guide aims to give you a quick run-down of what you will need to know +to play Atlantis. If you are interested in more details, such as how to create +your own worlds, you are hereby referred to the accompanying documentation. + +The current development version of Atlantis can be found at: +www.github.com/atlantis + + +THE MAIN MENU + +This is where you find yourself when you first start Atlantis. Your options are +listed underneath the game banner. At the very bottom, you see the "command +prompt" (>>>), which is the indication that the computer expects some input from +you. In a menu like this, you can choose an option by typing the relevant number +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 +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 you won't get +very far.) + +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 third option is for developers and need not concern us further. + +The fourth option displays this help text; the fifth option shows a copyright +notice and the Atlantis software license. The sixth option quits the game. + + +BASIC GAME PLAY + +When you decide to start a new game in one of the game worlds, you may be +given a choice of characters to play. (Some worlds are only intended for a +single character. In that case, you are taken straight to the game.) + +Once inside the game world, you no longer navigate using a numeric menu but with +commands. Most commands take the form , whereby is replaced +with the actual command (e.g. look) and is replaced with the object in +question (e.g. bed). + +Typing "help" (without the quotation marks) will bring up a list of the core +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! + +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 +sure that you spelt it correctly. + + +THE GAME SCREEN + +All game worlds consist of a network of distinct places. Your current location +is always displayed at the very top of the screen. Below the location's name, +you will find a more detailed description of your surroundings. It's worth +reading this carefully, as it may contain important clues! + +Underneath the place description are various lists, starting with neighbouring +places. There may also be items, NPCs (= non-playing characters) or even +monsters that you can interact with. + + +CORE COMMANDS + +Below you will find a list of the core Atlantis commands. Some places or items +may offer additional commands that are available when you are in that place +or in possession of the item. If any place/item provides commands, it is so +indicated in the game. + +look - This is the most versatile command in the game. With it, you can inspect + any item, NPC or monster (e.g. look cook). You can also bring up + information about yourself with "look me" or about your current location + with "look here". + +goto - The second most important command in Atlantis. With "goto" you can change + your location to a neighbouring place. Enter the name of the place you + wish to go to after the actual command (e.g. goto Kitchen). + +search - Some rooms contain hidden items. To find them, you first need to search + the room. When you do so, you have a 50% chance of finding a hidden + object. + +take - This command is used to pick up an item. Most items in the game can be + picked up, many are useful. + +drop - This, obviously, is the opposite to take. If you no longer require an + item, just drop it. + +talk - This command allows you to interact with NPCs. Almost all NPCs will have + something to say to you, and occasionally, it's important! Some NPCs also + offer further options, such as buying or selling items, or quests. + (Quests are tasks that you can undertake for the NPC. You prove that you + have completed the task by returning a certain, quest-specific item to + the NPC, upon which you will of course receive a reward.) + +equip - Some items can be used as weapons. If you ever find yourself in a fight + with a monster, you will want to have a weapon on you. However, just + owning a weapon isn't enough. Before you can use it, you have to equip + it with this command. + +attack - Some places contain monsters. (In Atlantis, a "monster" is any hostile + non-playing character.) While some monsters attack you first, you also + have the choice of attacking them. After all, there may be rich + treasure in store for the brave adventurer... (Make sure you have a + weapon equipped, though!) When you attack a monster, or vice versa, + the computer calculates the amount of damage you both take based on + your various strengths and weapons. Make sure that your health doesn't + drop too low! If it ever reaches 0, you're dead... (You can check up + on your current health with the "look me" command. There may be some + ways in-game of healing yourself - but you'll have to find those out + for yourself.) Each time you use the "attack" command is equivalent to + one round of fighting. Eventually, you'll kill the monster, or decide + that discretion is the better part of valour... + +clear - Sometimes, your screen can get rather cluttered up with the output of + 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/08/2017 diff --git a/doc/TODO b/doc/TODO index f11195d..b3ddbae 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,5 +1,10 @@ ATLANTIS TODO +LISP +* only display non-nil object lists in the place description +* remove (magic) from the code + +ATL * fill in missing place descriptions * hide 4 more pots of honey * require XP minimum to finish game? diff --git a/lisp/atlantis.lisp b/lisp/atlantis.lisp index d2687ee..8c45b37 100644 --- a/lisp/atlantis.lisp +++ b/lisp/atlantis.lisp @@ -7,7 +7,7 @@ ;;; date: 09/05/2015 ;;; -(defconstant ATLANTIS-VERSION '(0 2 1)) +(defconstant ATLANTIS-VERSION '(0 2 2)) (load "util.lisp") (load "game-objects.lisp") @@ -21,8 +21,8 @@ ;; Game worlds must be registered in this list with a display name ;; and a path relative to ../ATL -(defvar *games* '(("Lugwey" "Lugwey/lugwey.atl") - ("Winnie the Pooh" "Pooh/pooh.atl") +(defvar *games* '(("Winnie the Pooh" "Pooh/pooh.atl") + ("Lugwey" "Lugwey/lugwey.atl") ("Development" "dev/test.atl"))) (defun print-version () @@ -31,7 +31,8 @@ (second ATLANTIS-VERSION) (third ATLANTIS-VERSION)) (format t "~&Copyright (c) 2015-2017 Daniel Vedder") - (format t "~&Licensed under the terms of the GNU GPLv3.~%")) + (format t "~&Licensed under the terms of the GNU GPLv3.") + (format t "~&www.github.com/atlantis~%")) (defun start-menu () "Show the start menu and take a choice from the user" @@ -39,7 +40,7 @@ (print-text-file "banner.txt") (format t "~&~%Welcome! What do you want to do?") (setf options '("Start a new game" "Load a game" - "Create worlds" "About" "Exit")) + "Advanced" "Help" "About" "Exit")) (case (choose-number-option options) (0 (format t "~&Which world do you want to play?") ;; let the player choose one of the game worlds @@ -63,17 +64,27 @@ (if (equalp char-name "Cancel") (start-menu) (play-game))))) + ;; choose a previously saved game (1 (format t "~&What game file do you want to load?") - (let ((game (choose-option (mapcar #'pathname-name - (directory "../saves/*"))))) - (setf game (concatenate 'string "../saves/" game ".world")) - (load-game game) - (play-game))) - (2 (world-creator)) - (3 (print-version) + (let ((game (choose-option (append (mapcar #'pathname-name + (directory "../saves/*")) + '("Back"))))) + (if (equalp game "Back") (start-menu) + (progn (setf game (concatenate 'string "../saves/" + game ".world")) + (load-game game) + (play-game))))) + (2 (world-creator)) ;;XXX Remove this from the main menu? + (3 (clear-screen) + (print-text-file "../doc/PLAYING") (read-line) (start-menu)) - (4 (format t "~&Goodbye!") + (4 (print-version) + (when (y-or-n-p "~&~%Show the license text?") + (print-text-file "../doc/COPYING") + (read-line)) + (start-menu)) + (5 (format t "~&Goodbye!") (quit)))) (defun cmd-parameter (name &optional truth-value) diff --git a/lisp/player.lisp b/lisp/player.lisp index d068cb1..c56284f 100644 --- a/lisp/player.lisp +++ b/lisp/player.lisp @@ -33,7 +33,6 @@ ;; XXX Make this configurable in ATL? (defvar *level-experience* 100) - (defun add-player (player) "Add this player to the game world" (change-player-location player (player-place player)) @@ -49,6 +48,8 @@ (objectify-place-monsters location) (set-object-attribute player 'place location)) +;;TODO limit the number of carryable items? + ;; XXX This function is probably superfluous, as the player struct should only ;; store names of game objects (the actual objects are stored in *world*) (let ((list-function (make-list-function 'player NIL))) diff --git a/lisp/ui.lisp b/lisp/ui.lisp index 58fe698..7d1a01c 100644 --- a/lisp/ui.lisp +++ b/lisp/ui.lisp @@ -38,6 +38,7 @@ (defun describe-place (p) "Print out a complete description of place p" + ;;TODO only display non-nil lists (as with commands) (when (stringp p) (setf p (get-game-object 'place p))) (objectify-place-monsters p) (format t "~&~A" (string-upcase (place-name p))) diff --git a/doc/PLAYING b/doc/PLAYING index e69de29..80b4cca 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -0,0 +1,138 @@ +====================== +|| PLAYING ATLANTIS || +====================== + +Atlantis is a platform for text-based adventure games. That means that you, +the player, interact with the computer using nothing but the keyboard and the +screen. (Well, and of course your imagination...) + +This guide aims to give you a quick run-down of what you will need to know +to play Atlantis. If you are interested in more details, such as how to create +your own worlds, you are hereby referred to the accompanying documentation. + +The current development version of Atlantis can be found at: +www.github.com/atlantis + + +THE MAIN MENU + +This is where you find yourself when you first start Atlantis. Your options are +listed underneath the game banner. At the very bottom, you see the "command +prompt" (>>>), which is the indication that the computer expects some input from +you. In a menu like this, you can choose an option by typing the relevant number +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 +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 you won't get +very far.) + +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 third option is for developers and need not concern us further. + +The fourth option displays this help text; the fifth option shows a copyright +notice and the Atlantis software license. The sixth option quits the game. + + +BASIC GAME PLAY + +When you decide to start a new game in one of the game worlds, you may be +given a choice of characters to play. (Some worlds are only intended for a +single character. In that case, you are taken straight to the game.) + +Once inside the game world, you no longer navigate using a numeric menu but with +commands. Most commands take the form , whereby is replaced +with the actual command (e.g. look) and is replaced with the object in +question (e.g. bed). + +Typing "help" (without the quotation marks) will bring up a list of the core +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! + +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 +sure that you spelt it correctly. + + +THE GAME SCREEN + +All game worlds consist of a network of distinct places. Your current location +is always displayed at the very top of the screen. Below the location's name, +you will find a more detailed description of your surroundings. It's worth +reading this carefully, as it may contain important clues! + +Underneath the place description are various lists, starting with neighbouring +places. There may also be items, NPCs (= non-playing characters) or even +monsters that you can interact with. + + +CORE COMMANDS + +Below you will find a list of the core Atlantis commands. Some places or items +may offer additional commands that are available when you are in that place +or in possession of the item. If any place/item provides commands, it is so +indicated in the game. + +look - This is the most versatile command in the game. With it, you can inspect + any item, NPC or monster (e.g. look cook). You can also bring up + information about yourself with "look me" or about your current location + with "look here". + +goto - The second most important command in Atlantis. With "goto" you can change + your location to a neighbouring place. Enter the name of the place you + wish to go to after the actual command (e.g. goto Kitchen). + +search - Some rooms contain hidden items. To find them, you first need to search + the room. When you do so, you have a 50% chance of finding a hidden + object. + +take - This command is used to pick up an item. Most items in the game can be + picked up, many are useful. + +drop - This, obviously, is the opposite to take. If you no longer require an + item, just drop it. + +talk - This command allows you to interact with NPCs. Almost all NPCs will have + something to say to you, and occasionally, it's important! Some NPCs also + offer further options, such as buying or selling items, or quests. + (Quests are tasks that you can undertake for the NPC. You prove that you + have completed the task by returning a certain, quest-specific item to + the NPC, upon which you will of course receive a reward.) + +equip - Some items can be used as weapons. If you ever find yourself in a fight + with a monster, you will want to have a weapon on you. However, just + owning a weapon isn't enough. Before you can use it, you have to equip + it with this command. + +attack - Some places contain monsters. (In Atlantis, a "monster" is any hostile + non-playing character.) While some monsters attack you first, you also + have the choice of attacking them. After all, there may be rich + treasure in store for the brave adventurer... (Make sure you have a + weapon equipped, though!) When you attack a monster, or vice versa, + the computer calculates the amount of damage you both take based on + your various strengths and weapons. Make sure that your health doesn't + drop too low! If it ever reaches 0, you're dead... (You can check up + on your current health with the "look me" command. There may be some + ways in-game of healing yourself - but you'll have to find those out + for yourself.) Each time you use the "attack" command is equivalent to + one round of fighting. Eventually, you'll kill the monster, or decide + that discretion is the better part of valour... + +clear - Sometimes, your screen can get rather cluttered up with the output of + 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/08/2017 diff --git a/doc/TODO b/doc/TODO index f11195d..b3ddbae 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,5 +1,10 @@ ATLANTIS TODO +LISP +* only display non-nil object lists in the place description +* remove (magic) from the code + +ATL * fill in missing place descriptions * hide 4 more pots of honey * require XP minimum to finish game? diff --git a/lisp/atlantis.lisp b/lisp/atlantis.lisp index d2687ee..8c45b37 100644 --- a/lisp/atlantis.lisp +++ b/lisp/atlantis.lisp @@ -7,7 +7,7 @@ ;;; date: 09/05/2015 ;;; -(defconstant ATLANTIS-VERSION '(0 2 1)) +(defconstant ATLANTIS-VERSION '(0 2 2)) (load "util.lisp") (load "game-objects.lisp") @@ -21,8 +21,8 @@ ;; Game worlds must be registered in this list with a display name ;; and a path relative to ../ATL -(defvar *games* '(("Lugwey" "Lugwey/lugwey.atl") - ("Winnie the Pooh" "Pooh/pooh.atl") +(defvar *games* '(("Winnie the Pooh" "Pooh/pooh.atl") + ("Lugwey" "Lugwey/lugwey.atl") ("Development" "dev/test.atl"))) (defun print-version () @@ -31,7 +31,8 @@ (second ATLANTIS-VERSION) (third ATLANTIS-VERSION)) (format t "~&Copyright (c) 2015-2017 Daniel Vedder") - (format t "~&Licensed under the terms of the GNU GPLv3.~%")) + (format t "~&Licensed under the terms of the GNU GPLv3.") + (format t "~&www.github.com/atlantis~%")) (defun start-menu () "Show the start menu and take a choice from the user" @@ -39,7 +40,7 @@ (print-text-file "banner.txt") (format t "~&~%Welcome! What do you want to do?") (setf options '("Start a new game" "Load a game" - "Create worlds" "About" "Exit")) + "Advanced" "Help" "About" "Exit")) (case (choose-number-option options) (0 (format t "~&Which world do you want to play?") ;; let the player choose one of the game worlds @@ -63,17 +64,27 @@ (if (equalp char-name "Cancel") (start-menu) (play-game))))) + ;; choose a previously saved game (1 (format t "~&What game file do you want to load?") - (let ((game (choose-option (mapcar #'pathname-name - (directory "../saves/*"))))) - (setf game (concatenate 'string "../saves/" game ".world")) - (load-game game) - (play-game))) - (2 (world-creator)) - (3 (print-version) + (let ((game (choose-option (append (mapcar #'pathname-name + (directory "../saves/*")) + '("Back"))))) + (if (equalp game "Back") (start-menu) + (progn (setf game (concatenate 'string "../saves/" + game ".world")) + (load-game game) + (play-game))))) + (2 (world-creator)) ;;XXX Remove this from the main menu? + (3 (clear-screen) + (print-text-file "../doc/PLAYING") (read-line) (start-menu)) - (4 (format t "~&Goodbye!") + (4 (print-version) + (when (y-or-n-p "~&~%Show the license text?") + (print-text-file "../doc/COPYING") + (read-line)) + (start-menu)) + (5 (format t "~&Goodbye!") (quit)))) (defun cmd-parameter (name &optional truth-value) diff --git a/lisp/player.lisp b/lisp/player.lisp index d068cb1..c56284f 100644 --- a/lisp/player.lisp +++ b/lisp/player.lisp @@ -33,7 +33,6 @@ ;; XXX Make this configurable in ATL? (defvar *level-experience* 100) - (defun add-player (player) "Add this player to the game world" (change-player-location player (player-place player)) @@ -49,6 +48,8 @@ (objectify-place-monsters location) (set-object-attribute player 'place location)) +;;TODO limit the number of carryable items? + ;; XXX This function is probably superfluous, as the player struct should only ;; store names of game objects (the actual objects are stored in *world*) (let ((list-function (make-list-function 'player NIL))) diff --git a/lisp/ui.lisp b/lisp/ui.lisp index 58fe698..7d1a01c 100644 --- a/lisp/ui.lisp +++ b/lisp/ui.lisp @@ -38,6 +38,7 @@ (defun describe-place (p) "Print out a complete description of place p" + ;;TODO only display non-nil lists (as with commands) (when (stringp p) (setf p (get-game-object 'place p))) (objectify-place-monsters p) (format t "~&~A" (string-upcase (place-name p))) diff --git a/lisp/util.lisp b/lisp/util.lisp index cbf30cf..2e14d6e 100644 --- a/lisp/util.lisp +++ b/lisp/util.lisp @@ -31,6 +31,7 @@ (format t "~&~A " ,prompt) (setf ,var (read)))) +;; FIXME Remove from the code! ;; XXX Very useful for debugging, but represents a major security hole ;; when used in a network setting (defmacro magic (var) @@ -257,6 +258,7 @@ (defun clear-screen () "Clear the screen in an OS-dependent manner" ;; NOTE: only works with CLISP! (ext:shell function used) + ;; TODO Make sure we're on clisp, otherwise do nothing (cond ((member ':unix *features*) (ext:shell "clear")) ((member ':win32 *features*) (ext:shell "cls")) (t (debugging "~&clear-screen is not supported on this operating system!"))))