diff --git a/ATL/Pooh/dialogue/intro.txt b/ATL/Pooh/dialogue/intro.txt index 1c15ab6..c13f95f 100644 --- a/ATL/Pooh/dialogue/intro.txt +++ b/ATL/Pooh/dialogue/intro.txt @@ -5,8 +5,8 @@ That sounds like a good idea. You suddenly realize you are hungry. Perhaps it would be better to have a little something before you go. -You go over to your shelf to take out a jar of honey. -You open the shelf door. +You go over to your cupboard to take out a jar of honey. +You open the cupboard door. It's empty! You pick yourself back up off the floor and tell your legs to behave. You postpone your plans to visit Christopher Robin. diff --git a/ATL/Pooh/dialogue/intro.txt b/ATL/Pooh/dialogue/intro.txt index 1c15ab6..c13f95f 100644 --- a/ATL/Pooh/dialogue/intro.txt +++ b/ATL/Pooh/dialogue/intro.txt @@ -5,8 +5,8 @@ That sounds like a good idea. You suddenly realize you are hungry. Perhaps it would be better to have a little something before you go. -You go over to your shelf to take out a jar of honey. -You open the shelf door. +You go over to your cupboard to take out a jar of honey. +You open the cupboard door. It's empty! You pick yourself back up off the floor and tell your legs to behave. You postpone your plans to visit Christopher Robin. diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index b53b634..64b7ed7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -15,8 +15,8 @@ might, you can't get any more out of it now. What a shame. Perhaps you should refill it." -define-item "Shelf" ;TODO rename cupboard - description "This is your larder, a wooden shelf with 12 compartments for your honey jars. +define-item "Cupboard" + description "This is your larder, a wooden cupboard with 12 compartments for your honey jars. All the slots are empty!" fixed @@ -93,8 +93,8 @@ define-item "Pine cone" description "Pine cones are great fun for playing with. There's nothing quite like a good pine cone battle in the woods with your friends!" + command "chuck" infinite - ;command "throw" ;TODO define-item "Berries" description "Scrumptious, fresh wild berries: blueberries, blackberries, diff --git a/ATL/Pooh/dialogue/intro.txt b/ATL/Pooh/dialogue/intro.txt index 1c15ab6..c13f95f 100644 --- a/ATL/Pooh/dialogue/intro.txt +++ b/ATL/Pooh/dialogue/intro.txt @@ -5,8 +5,8 @@ That sounds like a good idea. You suddenly realize you are hungry. Perhaps it would be better to have a little something before you go. -You go over to your shelf to take out a jar of honey. -You open the shelf door. +You go over to your cupboard to take out a jar of honey. +You open the cupboard door. It's empty! You pick yourself back up off the floor and tell your legs to behave. You postpone your plans to visit Christopher Robin. diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index b53b634..64b7ed7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -15,8 +15,8 @@ might, you can't get any more out of it now. What a shame. Perhaps you should refill it." -define-item "Shelf" ;TODO rename cupboard - description "This is your larder, a wooden shelf with 12 compartments for your honey jars. +define-item "Cupboard" + description "This is your larder, a wooden cupboard with 12 compartments for your honey jars. All the slots are empty!" fixed @@ -93,8 +93,8 @@ define-item "Pine cone" description "Pine cones are great fun for playing with. There's nothing quite like a good pine cone battle in the woods with your friends!" + command "chuck" infinite - ;command "throw" ;TODO define-item "Berries" description "Scrumptious, fresh wild berries: blueberries, blackberries, diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index bdf5cf3..af500ac 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -56,7 +56,7 @@ (defun store (player &optional arg) "Store a jar of honey in the larder." - (let ((base-descr "This is your larder, a wooden shelf with 12 compartments for your honey jars.") + (let ((base-descr "This is your larder, a wooden cupboard with 12 compartments for your honey jars.") (num-list '("one jar" "two jars" "three jars" "four jars" "five jars" "six jars" "seven jars" "eight jars" "nine jars" "ten jars" "eleven jars" "twelve jars")) @@ -68,7 +68,7 @@ (remove-object-attribute player 'item "Hunny") (incf current-jars) (save-state 'HONEY-JARS current-jars) - (setf (item-description (get-game-object 'item "Shelf")) + (setf (item-description (get-game-object 'item "Cupboard")) (concatenate 'string base-descr (string #\Newline) "It contains " (nth (1- current-jars) num-list) " of honey.")) (when (= current-jars 12) (sleep 2) @@ -127,23 +127,22 @@ (defun is-lost (player) "Return the player to where he started from" (when lost-in + (clear-screen) (format t "~&Suddenly, you are no longer sure you are walking in the right") (format t "~&direction. Perhaps you should keep more to your left. Or to") (format t "~&your right? The trees all look the same here...") (format t "~&You are walking in circles!~%~%Please press ENTER") (read-line) - (change-player-location player lost-in) - (spawn-monsters lost-in) - (clear-screen) + (goto player lost-in) (setf lost-in NIL)))) (defun misty-forest (player) "A wrapper function for lost-in-the-forest for the misty forest location" - (lost-in-the-forest player "Misty forest" 67)) + (lost-in-the-forest player "Misty forest" 40)) (defun deep-forest (player) "A wrapper function for lost-in-the-forest for the deep forest location" - (lost-in-the-forest player "Deep forest" 40)) + (lost-in-the-forest player "Deep forest" 50)) (defun climb (player &optional arg) "Climb something - currently either the bee tree or the rock at the rapids" @@ -275,6 +274,29 @@ (progn (save-state 'POOHSTICKS (1- (get-state 'POOHSTICKS))) (format t "~&You lose! Your score is now ~A." (get-state 'POOHSTICKS))))))) +(defun chuck (player &optional arg) + "Engage in a pine cone battle with Tigger" + (let ((place (get-game-object 'place (player-place player))) + (winner (random-elt '(POOH TIGGER BOTH NONE)))) + (unless (member "Tigger" (place-npc place) :test #'equalp) + (format t "~&Tigger is always up for a pine cone fight.") + (format t "~&Why don't you go and look for him?") + (return-from chuck)) + (unless (get-state 'PINECONE) (save-state 'PINECONE 0)) + (remove-object-attribute player 'item "Pine cone") + (format t "~&You grab your pine cone, take aim quickly and throw it at Tigger.") + (sleep 2) + (format t "~&Tigger ducks, laughs, and throws one back at you.") + (sleep 1) + (case winner + ('POOH (format t "~&You hit Tigger!") + (save-state 'PINECONE (1+ (get-state 'PINECONE)))) + ('TIGGER (format t "~&You miss. Tigger hits!") + (save-state 'PINECONE (1- (get-state 'PINECONE)))) + ('BOTH (format t "~&You hit! So does Tigger.")) + ('NONE (format t "~&You miss. Tigger does too."))) + (format t "~&Your score is now ~A." (get-state 'PINECONE)))) + (defun blow (player &optional arg) "Blow up a balloon." (narrate "../ATL/Pooh/dialogue/balloon.txt") @@ -414,8 +436,9 @@ (defun daniel-says (player) "Leave a message for the real me" - ;;XXX Figure out how to read the host name - (unless (y-or-n-p "~&~%Daniel has more to say to you. Do you want to hear it?") + ;;Make sure we're on my server + (unless (or (equalp (first (load-text-file "/etc/hostname")) "Helios") + (y-or-n-p "~&~%Daniel has more to say to you. Do you want to hear it?")) (return-from daniel-says)) (setf msg "~%DANIEL: Hi there! This is the 'real' Daniel speaking now... Great to see that you've diff --git a/ATL/Pooh/dialogue/intro.txt b/ATL/Pooh/dialogue/intro.txt index 1c15ab6..c13f95f 100644 --- a/ATL/Pooh/dialogue/intro.txt +++ b/ATL/Pooh/dialogue/intro.txt @@ -5,8 +5,8 @@ That sounds like a good idea. You suddenly realize you are hungry. Perhaps it would be better to have a little something before you go. -You go over to your shelf to take out a jar of honey. -You open the shelf door. +You go over to your cupboard to take out a jar of honey. +You open the cupboard door. It's empty! You pick yourself back up off the floor and tell your legs to behave. You postpone your plans to visit Christopher Robin. diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index b53b634..64b7ed7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -15,8 +15,8 @@ might, you can't get any more out of it now. What a shame. Perhaps you should refill it." -define-item "Shelf" ;TODO rename cupboard - description "This is your larder, a wooden shelf with 12 compartments for your honey jars. +define-item "Cupboard" + description "This is your larder, a wooden cupboard with 12 compartments for your honey jars. All the slots are empty!" fixed @@ -93,8 +93,8 @@ define-item "Pine cone" description "Pine cones are great fun for playing with. There's nothing quite like a good pine cone battle in the woods with your friends!" + command "chuck" infinite - ;command "throw" ;TODO define-item "Berries" description "Scrumptious, fresh wild berries: blueberries, blackberries, diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index bdf5cf3..af500ac 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -56,7 +56,7 @@ (defun store (player &optional arg) "Store a jar of honey in the larder." - (let ((base-descr "This is your larder, a wooden shelf with 12 compartments for your honey jars.") + (let ((base-descr "This is your larder, a wooden cupboard with 12 compartments for your honey jars.") (num-list '("one jar" "two jars" "three jars" "four jars" "five jars" "six jars" "seven jars" "eight jars" "nine jars" "ten jars" "eleven jars" "twelve jars")) @@ -68,7 +68,7 @@ (remove-object-attribute player 'item "Hunny") (incf current-jars) (save-state 'HONEY-JARS current-jars) - (setf (item-description (get-game-object 'item "Shelf")) + (setf (item-description (get-game-object 'item "Cupboard")) (concatenate 'string base-descr (string #\Newline) "It contains " (nth (1- current-jars) num-list) " of honey.")) (when (= current-jars 12) (sleep 2) @@ -127,23 +127,22 @@ (defun is-lost (player) "Return the player to where he started from" (when lost-in + (clear-screen) (format t "~&Suddenly, you are no longer sure you are walking in the right") (format t "~&direction. Perhaps you should keep more to your left. Or to") (format t "~&your right? The trees all look the same here...") (format t "~&You are walking in circles!~%~%Please press ENTER") (read-line) - (change-player-location player lost-in) - (spawn-monsters lost-in) - (clear-screen) + (goto player lost-in) (setf lost-in NIL)))) (defun misty-forest (player) "A wrapper function for lost-in-the-forest for the misty forest location" - (lost-in-the-forest player "Misty forest" 67)) + (lost-in-the-forest player "Misty forest" 40)) (defun deep-forest (player) "A wrapper function for lost-in-the-forest for the deep forest location" - (lost-in-the-forest player "Deep forest" 40)) + (lost-in-the-forest player "Deep forest" 50)) (defun climb (player &optional arg) "Climb something - currently either the bee tree or the rock at the rapids" @@ -275,6 +274,29 @@ (progn (save-state 'POOHSTICKS (1- (get-state 'POOHSTICKS))) (format t "~&You lose! Your score is now ~A." (get-state 'POOHSTICKS))))))) +(defun chuck (player &optional arg) + "Engage in a pine cone battle with Tigger" + (let ((place (get-game-object 'place (player-place player))) + (winner (random-elt '(POOH TIGGER BOTH NONE)))) + (unless (member "Tigger" (place-npc place) :test #'equalp) + (format t "~&Tigger is always up for a pine cone fight.") + (format t "~&Why don't you go and look for him?") + (return-from chuck)) + (unless (get-state 'PINECONE) (save-state 'PINECONE 0)) + (remove-object-attribute player 'item "Pine cone") + (format t "~&You grab your pine cone, take aim quickly and throw it at Tigger.") + (sleep 2) + (format t "~&Tigger ducks, laughs, and throws one back at you.") + (sleep 1) + (case winner + ('POOH (format t "~&You hit Tigger!") + (save-state 'PINECONE (1+ (get-state 'PINECONE)))) + ('TIGGER (format t "~&You miss. Tigger hits!") + (save-state 'PINECONE (1- (get-state 'PINECONE)))) + ('BOTH (format t "~&You hit! So does Tigger.")) + ('NONE (format t "~&You miss. Tigger does too."))) + (format t "~&Your score is now ~A." (get-state 'PINECONE)))) + (defun blow (player &optional arg) "Blow up a balloon." (narrate "../ATL/Pooh/dialogue/balloon.txt") @@ -414,8 +436,9 @@ (defun daniel-says (player) "Leave a message for the real me" - ;;XXX Figure out how to read the host name - (unless (y-or-n-p "~&~%Daniel has more to say to you. Do you want to hear it?") + ;;Make sure we're on my server + (unless (or (equalp (first (load-text-file "/etc/hostname")) "Helios") + (y-or-n-p "~&~%Daniel has more to say to you. Do you want to hear it?")) (return-from daniel-says)) (setf msg "~%DANIEL: Hi there! This is the 'real' Daniel speaking now... Great to see that you've diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 452e590..f8af0b3 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -23,4 +23,4 @@ ;TODO development - remove before release define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Owl's porch" \ No newline at end of file + place "Northern woods" \ No newline at end of file diff --git a/ATL/Pooh/dialogue/intro.txt b/ATL/Pooh/dialogue/intro.txt index 1c15ab6..c13f95f 100644 --- a/ATL/Pooh/dialogue/intro.txt +++ b/ATL/Pooh/dialogue/intro.txt @@ -5,8 +5,8 @@ That sounds like a good idea. You suddenly realize you are hungry. Perhaps it would be better to have a little something before you go. -You go over to your shelf to take out a jar of honey. -You open the shelf door. +You go over to your cupboard to take out a jar of honey. +You open the cupboard door. It's empty! You pick yourself back up off the floor and tell your legs to behave. You postpone your plans to visit Christopher Robin. diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index b53b634..64b7ed7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -15,8 +15,8 @@ might, you can't get any more out of it now. What a shame. Perhaps you should refill it." -define-item "Shelf" ;TODO rename cupboard - description "This is your larder, a wooden shelf with 12 compartments for your honey jars. +define-item "Cupboard" + description "This is your larder, a wooden cupboard with 12 compartments for your honey jars. All the slots are empty!" fixed @@ -93,8 +93,8 @@ define-item "Pine cone" description "Pine cones are great fun for playing with. There's nothing quite like a good pine cone battle in the woods with your friends!" + command "chuck" infinite - ;command "throw" ;TODO define-item "Berries" description "Scrumptious, fresh wild berries: blueberries, blackberries, diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index bdf5cf3..af500ac 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -56,7 +56,7 @@ (defun store (player &optional arg) "Store a jar of honey in the larder." - (let ((base-descr "This is your larder, a wooden shelf with 12 compartments for your honey jars.") + (let ((base-descr "This is your larder, a wooden cupboard with 12 compartments for your honey jars.") (num-list '("one jar" "two jars" "three jars" "four jars" "five jars" "six jars" "seven jars" "eight jars" "nine jars" "ten jars" "eleven jars" "twelve jars")) @@ -68,7 +68,7 @@ (remove-object-attribute player 'item "Hunny") (incf current-jars) (save-state 'HONEY-JARS current-jars) - (setf (item-description (get-game-object 'item "Shelf")) + (setf (item-description (get-game-object 'item "Cupboard")) (concatenate 'string base-descr (string #\Newline) "It contains " (nth (1- current-jars) num-list) " of honey.")) (when (= current-jars 12) (sleep 2) @@ -127,23 +127,22 @@ (defun is-lost (player) "Return the player to where he started from" (when lost-in + (clear-screen) (format t "~&Suddenly, you are no longer sure you are walking in the right") (format t "~&direction. Perhaps you should keep more to your left. Or to") (format t "~&your right? The trees all look the same here...") (format t "~&You are walking in circles!~%~%Please press ENTER") (read-line) - (change-player-location player lost-in) - (spawn-monsters lost-in) - (clear-screen) + (goto player lost-in) (setf lost-in NIL)))) (defun misty-forest (player) "A wrapper function for lost-in-the-forest for the misty forest location" - (lost-in-the-forest player "Misty forest" 67)) + (lost-in-the-forest player "Misty forest" 40)) (defun deep-forest (player) "A wrapper function for lost-in-the-forest for the deep forest location" - (lost-in-the-forest player "Deep forest" 40)) + (lost-in-the-forest player "Deep forest" 50)) (defun climb (player &optional arg) "Climb something - currently either the bee tree or the rock at the rapids" @@ -275,6 +274,29 @@ (progn (save-state 'POOHSTICKS (1- (get-state 'POOHSTICKS))) (format t "~&You lose! Your score is now ~A." (get-state 'POOHSTICKS))))))) +(defun chuck (player &optional arg) + "Engage in a pine cone battle with Tigger" + (let ((place (get-game-object 'place (player-place player))) + (winner (random-elt '(POOH TIGGER BOTH NONE)))) + (unless (member "Tigger" (place-npc place) :test #'equalp) + (format t "~&Tigger is always up for a pine cone fight.") + (format t "~&Why don't you go and look for him?") + (return-from chuck)) + (unless (get-state 'PINECONE) (save-state 'PINECONE 0)) + (remove-object-attribute player 'item "Pine cone") + (format t "~&You grab your pine cone, take aim quickly and throw it at Tigger.") + (sleep 2) + (format t "~&Tigger ducks, laughs, and throws one back at you.") + (sleep 1) + (case winner + ('POOH (format t "~&You hit Tigger!") + (save-state 'PINECONE (1+ (get-state 'PINECONE)))) + ('TIGGER (format t "~&You miss. Tigger hits!") + (save-state 'PINECONE (1- (get-state 'PINECONE)))) + ('BOTH (format t "~&You hit! So does Tigger.")) + ('NONE (format t "~&You miss. Tigger does too."))) + (format t "~&Your score is now ~A." (get-state 'PINECONE)))) + (defun blow (player &optional arg) "Blow up a balloon." (narrate "../ATL/Pooh/dialogue/balloon.txt") @@ -414,8 +436,9 @@ (defun daniel-says (player) "Leave a message for the real me" - ;;XXX Figure out how to read the host name - (unless (y-or-n-p "~&~%Daniel has more to say to you. Do you want to hear it?") + ;;Make sure we're on my server + (unless (or (equalp (first (load-text-file "/etc/hostname")) "Helios") + (y-or-n-p "~&~%Daniel has more to say to you. Do you want to hear it?")) (return-from daniel-says)) (setf msg "~%DANIEL: Hi there! This is the 'real' Daniel speaking now... Great to see that you've diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 452e590..f8af0b3 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -23,4 +23,4 @@ ;TODO development - remove before release define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Owl's porch" \ No newline at end of file + place "Northern woods" \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 31f129e..c0e2243 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -12,7 +12,7 @@ delicious honey..." neighbour "Pooh's porch" neighbour "Pooh's branch" - item "Shelf" + item "Cupboard" item "Hunny" item "Jar" item "Clock" diff --git a/ATL/Pooh/dialogue/intro.txt b/ATL/Pooh/dialogue/intro.txt index 1c15ab6..c13f95f 100644 --- a/ATL/Pooh/dialogue/intro.txt +++ b/ATL/Pooh/dialogue/intro.txt @@ -5,8 +5,8 @@ That sounds like a good idea. You suddenly realize you are hungry. Perhaps it would be better to have a little something before you go. -You go over to your shelf to take out a jar of honey. -You open the shelf door. +You go over to your cupboard to take out a jar of honey. +You open the cupboard door. It's empty! You pick yourself back up off the floor and tell your legs to behave. You postpone your plans to visit Christopher Robin. diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index b53b634..64b7ed7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -15,8 +15,8 @@ might, you can't get any more out of it now. What a shame. Perhaps you should refill it." -define-item "Shelf" ;TODO rename cupboard - description "This is your larder, a wooden shelf with 12 compartments for your honey jars. +define-item "Cupboard" + description "This is your larder, a wooden cupboard with 12 compartments for your honey jars. All the slots are empty!" fixed @@ -93,8 +93,8 @@ define-item "Pine cone" description "Pine cones are great fun for playing with. There's nothing quite like a good pine cone battle in the woods with your friends!" + command "chuck" infinite - ;command "throw" ;TODO define-item "Berries" description "Scrumptious, fresh wild berries: blueberries, blackberries, diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index bdf5cf3..af500ac 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -56,7 +56,7 @@ (defun store (player &optional arg) "Store a jar of honey in the larder." - (let ((base-descr "This is your larder, a wooden shelf with 12 compartments for your honey jars.") + (let ((base-descr "This is your larder, a wooden cupboard with 12 compartments for your honey jars.") (num-list '("one jar" "two jars" "three jars" "four jars" "five jars" "six jars" "seven jars" "eight jars" "nine jars" "ten jars" "eleven jars" "twelve jars")) @@ -68,7 +68,7 @@ (remove-object-attribute player 'item "Hunny") (incf current-jars) (save-state 'HONEY-JARS current-jars) - (setf (item-description (get-game-object 'item "Shelf")) + (setf (item-description (get-game-object 'item "Cupboard")) (concatenate 'string base-descr (string #\Newline) "It contains " (nth (1- current-jars) num-list) " of honey.")) (when (= current-jars 12) (sleep 2) @@ -127,23 +127,22 @@ (defun is-lost (player) "Return the player to where he started from" (when lost-in + (clear-screen) (format t "~&Suddenly, you are no longer sure you are walking in the right") (format t "~&direction. Perhaps you should keep more to your left. Or to") (format t "~&your right? The trees all look the same here...") (format t "~&You are walking in circles!~%~%Please press ENTER") (read-line) - (change-player-location player lost-in) - (spawn-monsters lost-in) - (clear-screen) + (goto player lost-in) (setf lost-in NIL)))) (defun misty-forest (player) "A wrapper function for lost-in-the-forest for the misty forest location" - (lost-in-the-forest player "Misty forest" 67)) + (lost-in-the-forest player "Misty forest" 40)) (defun deep-forest (player) "A wrapper function for lost-in-the-forest for the deep forest location" - (lost-in-the-forest player "Deep forest" 40)) + (lost-in-the-forest player "Deep forest" 50)) (defun climb (player &optional arg) "Climb something - currently either the bee tree or the rock at the rapids" @@ -275,6 +274,29 @@ (progn (save-state 'POOHSTICKS (1- (get-state 'POOHSTICKS))) (format t "~&You lose! Your score is now ~A." (get-state 'POOHSTICKS))))))) +(defun chuck (player &optional arg) + "Engage in a pine cone battle with Tigger" + (let ((place (get-game-object 'place (player-place player))) + (winner (random-elt '(POOH TIGGER BOTH NONE)))) + (unless (member "Tigger" (place-npc place) :test #'equalp) + (format t "~&Tigger is always up for a pine cone fight.") + (format t "~&Why don't you go and look for him?") + (return-from chuck)) + (unless (get-state 'PINECONE) (save-state 'PINECONE 0)) + (remove-object-attribute player 'item "Pine cone") + (format t "~&You grab your pine cone, take aim quickly and throw it at Tigger.") + (sleep 2) + (format t "~&Tigger ducks, laughs, and throws one back at you.") + (sleep 1) + (case winner + ('POOH (format t "~&You hit Tigger!") + (save-state 'PINECONE (1+ (get-state 'PINECONE)))) + ('TIGGER (format t "~&You miss. Tigger hits!") + (save-state 'PINECONE (1- (get-state 'PINECONE)))) + ('BOTH (format t "~&You hit! So does Tigger.")) + ('NONE (format t "~&You miss. Tigger does too."))) + (format t "~&Your score is now ~A." (get-state 'PINECONE)))) + (defun blow (player &optional arg) "Blow up a balloon." (narrate "../ATL/Pooh/dialogue/balloon.txt") @@ -414,8 +436,9 @@ (defun daniel-says (player) "Leave a message for the real me" - ;;XXX Figure out how to read the host name - (unless (y-or-n-p "~&~%Daniel has more to say to you. Do you want to hear it?") + ;;Make sure we're on my server + (unless (or (equalp (first (load-text-file "/etc/hostname")) "Helios") + (y-or-n-p "~&~%Daniel has more to say to you. Do you want to hear it?")) (return-from daniel-says)) (setf msg "~%DANIEL: Hi there! This is the 'real' Daniel speaking now... Great to see that you've diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 452e590..f8af0b3 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -23,4 +23,4 @@ ;TODO development - remove before release define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Owl's porch" \ No newline at end of file + place "Northern woods" \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 31f129e..c0e2243 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -12,7 +12,7 @@ delicious honey..." neighbour "Pooh's porch" neighbour "Pooh's branch" - item "Shelf" + item "Cupboard" item "Hunny" item "Jar" item "Clock" diff --git a/doc/PLAYING b/doc/PLAYING index 64bb789..34aaf09 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -33,10 +33,8 @@ 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. - -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. +The third option displays this help text; the fourth option shows a copyright +notice and the Atlantis software license. The fifth option quits the game. BASIC GAME PLAY @@ -111,16 +109,18 @@ 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.) + something to say to you, and occasionally, it's important! It's worth + talking to NPCs more than once, because some will have more than one + thing to say. 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. + it with this command. 'equip none' will unequip your current weapon. attack - Some places contain monsters. (In Atlantis, a "monster" is any hostile non-playing character.) While some monsters attack you first, you also @@ -142,4 +142,4 @@ Daniel Vedder -Last modified 21/10/2017 +Last modified 04/11/2017 diff --git a/ATL/Pooh/dialogue/intro.txt b/ATL/Pooh/dialogue/intro.txt index 1c15ab6..c13f95f 100644 --- a/ATL/Pooh/dialogue/intro.txt +++ b/ATL/Pooh/dialogue/intro.txt @@ -5,8 +5,8 @@ That sounds like a good idea. You suddenly realize you are hungry. Perhaps it would be better to have a little something before you go. -You go over to your shelf to take out a jar of honey. -You open the shelf door. +You go over to your cupboard to take out a jar of honey. +You open the cupboard door. It's empty! You pick yourself back up off the floor and tell your legs to behave. You postpone your plans to visit Christopher Robin. diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index b53b634..64b7ed7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -15,8 +15,8 @@ might, you can't get any more out of it now. What a shame. Perhaps you should refill it." -define-item "Shelf" ;TODO rename cupboard - description "This is your larder, a wooden shelf with 12 compartments for your honey jars. +define-item "Cupboard" + description "This is your larder, a wooden cupboard with 12 compartments for your honey jars. All the slots are empty!" fixed @@ -93,8 +93,8 @@ define-item "Pine cone" description "Pine cones are great fun for playing with. There's nothing quite like a good pine cone battle in the woods with your friends!" + command "chuck" infinite - ;command "throw" ;TODO define-item "Berries" description "Scrumptious, fresh wild berries: blueberries, blackberries, diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index bdf5cf3..af500ac 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -56,7 +56,7 @@ (defun store (player &optional arg) "Store a jar of honey in the larder." - (let ((base-descr "This is your larder, a wooden shelf with 12 compartments for your honey jars.") + (let ((base-descr "This is your larder, a wooden cupboard with 12 compartments for your honey jars.") (num-list '("one jar" "two jars" "three jars" "four jars" "five jars" "six jars" "seven jars" "eight jars" "nine jars" "ten jars" "eleven jars" "twelve jars")) @@ -68,7 +68,7 @@ (remove-object-attribute player 'item "Hunny") (incf current-jars) (save-state 'HONEY-JARS current-jars) - (setf (item-description (get-game-object 'item "Shelf")) + (setf (item-description (get-game-object 'item "Cupboard")) (concatenate 'string base-descr (string #\Newline) "It contains " (nth (1- current-jars) num-list) " of honey.")) (when (= current-jars 12) (sleep 2) @@ -127,23 +127,22 @@ (defun is-lost (player) "Return the player to where he started from" (when lost-in + (clear-screen) (format t "~&Suddenly, you are no longer sure you are walking in the right") (format t "~&direction. Perhaps you should keep more to your left. Or to") (format t "~&your right? The trees all look the same here...") (format t "~&You are walking in circles!~%~%Please press ENTER") (read-line) - (change-player-location player lost-in) - (spawn-monsters lost-in) - (clear-screen) + (goto player lost-in) (setf lost-in NIL)))) (defun misty-forest (player) "A wrapper function for lost-in-the-forest for the misty forest location" - (lost-in-the-forest player "Misty forest" 67)) + (lost-in-the-forest player "Misty forest" 40)) (defun deep-forest (player) "A wrapper function for lost-in-the-forest for the deep forest location" - (lost-in-the-forest player "Deep forest" 40)) + (lost-in-the-forest player "Deep forest" 50)) (defun climb (player &optional arg) "Climb something - currently either the bee tree or the rock at the rapids" @@ -275,6 +274,29 @@ (progn (save-state 'POOHSTICKS (1- (get-state 'POOHSTICKS))) (format t "~&You lose! Your score is now ~A." (get-state 'POOHSTICKS))))))) +(defun chuck (player &optional arg) + "Engage in a pine cone battle with Tigger" + (let ((place (get-game-object 'place (player-place player))) + (winner (random-elt '(POOH TIGGER BOTH NONE)))) + (unless (member "Tigger" (place-npc place) :test #'equalp) + (format t "~&Tigger is always up for a pine cone fight.") + (format t "~&Why don't you go and look for him?") + (return-from chuck)) + (unless (get-state 'PINECONE) (save-state 'PINECONE 0)) + (remove-object-attribute player 'item "Pine cone") + (format t "~&You grab your pine cone, take aim quickly and throw it at Tigger.") + (sleep 2) + (format t "~&Tigger ducks, laughs, and throws one back at you.") + (sleep 1) + (case winner + ('POOH (format t "~&You hit Tigger!") + (save-state 'PINECONE (1+ (get-state 'PINECONE)))) + ('TIGGER (format t "~&You miss. Tigger hits!") + (save-state 'PINECONE (1- (get-state 'PINECONE)))) + ('BOTH (format t "~&You hit! So does Tigger.")) + ('NONE (format t "~&You miss. Tigger does too."))) + (format t "~&Your score is now ~A." (get-state 'PINECONE)))) + (defun blow (player &optional arg) "Blow up a balloon." (narrate "../ATL/Pooh/dialogue/balloon.txt") @@ -414,8 +436,9 @@ (defun daniel-says (player) "Leave a message for the real me" - ;;XXX Figure out how to read the host name - (unless (y-or-n-p "~&~%Daniel has more to say to you. Do you want to hear it?") + ;;Make sure we're on my server + (unless (or (equalp (first (load-text-file "/etc/hostname")) "Helios") + (y-or-n-p "~&~%Daniel has more to say to you. Do you want to hear it?")) (return-from daniel-says)) (setf msg "~%DANIEL: Hi there! This is the 'real' Daniel speaking now... Great to see that you've diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 452e590..f8af0b3 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -23,4 +23,4 @@ ;TODO development - remove before release define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Owl's porch" \ No newline at end of file + place "Northern woods" \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 31f129e..c0e2243 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -12,7 +12,7 @@ delicious honey..." neighbour "Pooh's porch" neighbour "Pooh's branch" - item "Shelf" + item "Cupboard" item "Hunny" item "Jar" item "Clock" diff --git a/doc/PLAYING b/doc/PLAYING index 64bb789..34aaf09 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -33,10 +33,8 @@ 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. - -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. +The third option displays this help text; the fourth option shows a copyright +notice and the Atlantis software license. The fifth option quits the game. BASIC GAME PLAY @@ -111,16 +109,18 @@ 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.) + something to say to you, and occasionally, it's important! It's worth + talking to NPCs more than once, because some will have more than one + thing to say. 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. + it with this command. 'equip none' will unequip your current weapon. attack - Some places contain monsters. (In Atlantis, a "monster" is any hostile non-playing character.) While some monsters attack you first, you also @@ -142,4 +142,4 @@ Daniel Vedder -Last modified 21/10/2017 +Last modified 04/11/2017 diff --git a/doc/TODO b/doc/TODO index 42f16ce..79689f4 100644 --- a/doc/TODO +++ b/doc/TODO @@ -4,10 +4,12 @@ * update Helios guide (include bug reporting with 'archive') * update documentation * fix (string-from-list) bug +* replace 'equip' with 'hold' ATL -* fill in missing place descriptions - +* add game end sequence +* add 'throw' command for fir cones + NOTES diff --git a/ATL/Pooh/dialogue/intro.txt b/ATL/Pooh/dialogue/intro.txt index 1c15ab6..c13f95f 100644 --- a/ATL/Pooh/dialogue/intro.txt +++ b/ATL/Pooh/dialogue/intro.txt @@ -5,8 +5,8 @@ That sounds like a good idea. You suddenly realize you are hungry. Perhaps it would be better to have a little something before you go. -You go over to your shelf to take out a jar of honey. -You open the shelf door. +You go over to your cupboard to take out a jar of honey. +You open the cupboard door. It's empty! You pick yourself back up off the floor and tell your legs to behave. You postpone your plans to visit Christopher Robin. diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index b53b634..64b7ed7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -15,8 +15,8 @@ might, you can't get any more out of it now. What a shame. Perhaps you should refill it." -define-item "Shelf" ;TODO rename cupboard - description "This is your larder, a wooden shelf with 12 compartments for your honey jars. +define-item "Cupboard" + description "This is your larder, a wooden cupboard with 12 compartments for your honey jars. All the slots are empty!" fixed @@ -93,8 +93,8 @@ define-item "Pine cone" description "Pine cones are great fun for playing with. There's nothing quite like a good pine cone battle in the woods with your friends!" + command "chuck" infinite - ;command "throw" ;TODO define-item "Berries" description "Scrumptious, fresh wild berries: blueberries, blackberries, diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index bdf5cf3..af500ac 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -56,7 +56,7 @@ (defun store (player &optional arg) "Store a jar of honey in the larder." - (let ((base-descr "This is your larder, a wooden shelf with 12 compartments for your honey jars.") + (let ((base-descr "This is your larder, a wooden cupboard with 12 compartments for your honey jars.") (num-list '("one jar" "two jars" "three jars" "four jars" "five jars" "six jars" "seven jars" "eight jars" "nine jars" "ten jars" "eleven jars" "twelve jars")) @@ -68,7 +68,7 @@ (remove-object-attribute player 'item "Hunny") (incf current-jars) (save-state 'HONEY-JARS current-jars) - (setf (item-description (get-game-object 'item "Shelf")) + (setf (item-description (get-game-object 'item "Cupboard")) (concatenate 'string base-descr (string #\Newline) "It contains " (nth (1- current-jars) num-list) " of honey.")) (when (= current-jars 12) (sleep 2) @@ -127,23 +127,22 @@ (defun is-lost (player) "Return the player to where he started from" (when lost-in + (clear-screen) (format t "~&Suddenly, you are no longer sure you are walking in the right") (format t "~&direction. Perhaps you should keep more to your left. Or to") (format t "~&your right? The trees all look the same here...") (format t "~&You are walking in circles!~%~%Please press ENTER") (read-line) - (change-player-location player lost-in) - (spawn-monsters lost-in) - (clear-screen) + (goto player lost-in) (setf lost-in NIL)))) (defun misty-forest (player) "A wrapper function for lost-in-the-forest for the misty forest location" - (lost-in-the-forest player "Misty forest" 67)) + (lost-in-the-forest player "Misty forest" 40)) (defun deep-forest (player) "A wrapper function for lost-in-the-forest for the deep forest location" - (lost-in-the-forest player "Deep forest" 40)) + (lost-in-the-forest player "Deep forest" 50)) (defun climb (player &optional arg) "Climb something - currently either the bee tree or the rock at the rapids" @@ -275,6 +274,29 @@ (progn (save-state 'POOHSTICKS (1- (get-state 'POOHSTICKS))) (format t "~&You lose! Your score is now ~A." (get-state 'POOHSTICKS))))))) +(defun chuck (player &optional arg) + "Engage in a pine cone battle with Tigger" + (let ((place (get-game-object 'place (player-place player))) + (winner (random-elt '(POOH TIGGER BOTH NONE)))) + (unless (member "Tigger" (place-npc place) :test #'equalp) + (format t "~&Tigger is always up for a pine cone fight.") + (format t "~&Why don't you go and look for him?") + (return-from chuck)) + (unless (get-state 'PINECONE) (save-state 'PINECONE 0)) + (remove-object-attribute player 'item "Pine cone") + (format t "~&You grab your pine cone, take aim quickly and throw it at Tigger.") + (sleep 2) + (format t "~&Tigger ducks, laughs, and throws one back at you.") + (sleep 1) + (case winner + ('POOH (format t "~&You hit Tigger!") + (save-state 'PINECONE (1+ (get-state 'PINECONE)))) + ('TIGGER (format t "~&You miss. Tigger hits!") + (save-state 'PINECONE (1- (get-state 'PINECONE)))) + ('BOTH (format t "~&You hit! So does Tigger.")) + ('NONE (format t "~&You miss. Tigger does too."))) + (format t "~&Your score is now ~A." (get-state 'PINECONE)))) + (defun blow (player &optional arg) "Blow up a balloon." (narrate "../ATL/Pooh/dialogue/balloon.txt") @@ -414,8 +436,9 @@ (defun daniel-says (player) "Leave a message for the real me" - ;;XXX Figure out how to read the host name - (unless (y-or-n-p "~&~%Daniel has more to say to you. Do you want to hear it?") + ;;Make sure we're on my server + (unless (or (equalp (first (load-text-file "/etc/hostname")) "Helios") + (y-or-n-p "~&~%Daniel has more to say to you. Do you want to hear it?")) (return-from daniel-says)) (setf msg "~%DANIEL: Hi there! This is the 'real' Daniel speaking now... Great to see that you've diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 452e590..f8af0b3 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -23,4 +23,4 @@ ;TODO development - remove before release define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Owl's porch" \ No newline at end of file + place "Northern woods" \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 31f129e..c0e2243 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -12,7 +12,7 @@ delicious honey..." neighbour "Pooh's porch" neighbour "Pooh's branch" - item "Shelf" + item "Cupboard" item "Hunny" item "Jar" item "Clock" diff --git a/doc/PLAYING b/doc/PLAYING index 64bb789..34aaf09 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -33,10 +33,8 @@ 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. - -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. +The third option displays this help text; the fourth option shows a copyright +notice and the Atlantis software license. The fifth option quits the game. BASIC GAME PLAY @@ -111,16 +109,18 @@ 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.) + something to say to you, and occasionally, it's important! It's worth + talking to NPCs more than once, because some will have more than one + thing to say. 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. + it with this command. 'equip none' will unequip your current weapon. attack - Some places contain monsters. (In Atlantis, a "monster" is any hostile non-playing character.) While some monsters attack you first, you also @@ -142,4 +142,4 @@ Daniel Vedder -Last modified 21/10/2017 +Last modified 04/11/2017 diff --git a/doc/TODO b/doc/TODO index 42f16ce..79689f4 100644 --- a/doc/TODO +++ b/doc/TODO @@ -4,10 +4,12 @@ * update Helios guide (include bug reporting with 'archive') * update documentation * fix (string-from-list) bug +* replace 'equip' with 'hold' ATL -* fill in missing place descriptions - +* add game end sequence +* add 'throw' command for fir cones + NOTES diff --git a/lisp/ui.lisp b/lisp/ui.lisp index c224997..9dffac7 100644 --- a/lisp/ui.lisp +++ b/lisp/ui.lisp @@ -365,9 +365,11 @@ (format t "~&This item provides commands: ~A" (string-from-list (item-command item) :line-length *max-line-items*))) + (when (item-weapon item) + (format t "~&This item is a weapon.")) (unless (zerop (length (item-pickup-hook item))) - (funcall (read-from-string - (item-pickup-hook item)) player)))) + (funcall (read-from-string (item-pickup-hook item)) + player)))) (format t "~&Sorry, this item is not here!")))) (defun drop (player &optional item) @@ -393,7 +395,7 @@ (defun equip (player &optional new-weapon) "The player sets another item to be his weapon" - ;;XXX Replace this with 'hold'? (Also possible for non-weapons.) + ;;TODO Replace this with 'hold'? (Also possible for non-weapons.) (unless new-weapon (format t "~&Please specify a weapon to be equipped!") (return-from equip)) diff --git a/ATL/Pooh/dialogue/intro.txt b/ATL/Pooh/dialogue/intro.txt index 1c15ab6..c13f95f 100644 --- a/ATL/Pooh/dialogue/intro.txt +++ b/ATL/Pooh/dialogue/intro.txt @@ -5,8 +5,8 @@ That sounds like a good idea. You suddenly realize you are hungry. Perhaps it would be better to have a little something before you go. -You go over to your shelf to take out a jar of honey. -You open the shelf door. +You go over to your cupboard to take out a jar of honey. +You open the cupboard door. It's empty! You pick yourself back up off the floor and tell your legs to behave. You postpone your plans to visit Christopher Robin. diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index b53b634..64b7ed7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -15,8 +15,8 @@ might, you can't get any more out of it now. What a shame. Perhaps you should refill it." -define-item "Shelf" ;TODO rename cupboard - description "This is your larder, a wooden shelf with 12 compartments for your honey jars. +define-item "Cupboard" + description "This is your larder, a wooden cupboard with 12 compartments for your honey jars. All the slots are empty!" fixed @@ -93,8 +93,8 @@ define-item "Pine cone" description "Pine cones are great fun for playing with. There's nothing quite like a good pine cone battle in the woods with your friends!" + command "chuck" infinite - ;command "throw" ;TODO define-item "Berries" description "Scrumptious, fresh wild berries: blueberries, blackberries, diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index bdf5cf3..af500ac 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -56,7 +56,7 @@ (defun store (player &optional arg) "Store a jar of honey in the larder." - (let ((base-descr "This is your larder, a wooden shelf with 12 compartments for your honey jars.") + (let ((base-descr "This is your larder, a wooden cupboard with 12 compartments for your honey jars.") (num-list '("one jar" "two jars" "three jars" "four jars" "five jars" "six jars" "seven jars" "eight jars" "nine jars" "ten jars" "eleven jars" "twelve jars")) @@ -68,7 +68,7 @@ (remove-object-attribute player 'item "Hunny") (incf current-jars) (save-state 'HONEY-JARS current-jars) - (setf (item-description (get-game-object 'item "Shelf")) + (setf (item-description (get-game-object 'item "Cupboard")) (concatenate 'string base-descr (string #\Newline) "It contains " (nth (1- current-jars) num-list) " of honey.")) (when (= current-jars 12) (sleep 2) @@ -127,23 +127,22 @@ (defun is-lost (player) "Return the player to where he started from" (when lost-in + (clear-screen) (format t "~&Suddenly, you are no longer sure you are walking in the right") (format t "~&direction. Perhaps you should keep more to your left. Or to") (format t "~&your right? The trees all look the same here...") (format t "~&You are walking in circles!~%~%Please press ENTER") (read-line) - (change-player-location player lost-in) - (spawn-monsters lost-in) - (clear-screen) + (goto player lost-in) (setf lost-in NIL)))) (defun misty-forest (player) "A wrapper function for lost-in-the-forest for the misty forest location" - (lost-in-the-forest player "Misty forest" 67)) + (lost-in-the-forest player "Misty forest" 40)) (defun deep-forest (player) "A wrapper function for lost-in-the-forest for the deep forest location" - (lost-in-the-forest player "Deep forest" 40)) + (lost-in-the-forest player "Deep forest" 50)) (defun climb (player &optional arg) "Climb something - currently either the bee tree or the rock at the rapids" @@ -275,6 +274,29 @@ (progn (save-state 'POOHSTICKS (1- (get-state 'POOHSTICKS))) (format t "~&You lose! Your score is now ~A." (get-state 'POOHSTICKS))))))) +(defun chuck (player &optional arg) + "Engage in a pine cone battle with Tigger" + (let ((place (get-game-object 'place (player-place player))) + (winner (random-elt '(POOH TIGGER BOTH NONE)))) + (unless (member "Tigger" (place-npc place) :test #'equalp) + (format t "~&Tigger is always up for a pine cone fight.") + (format t "~&Why don't you go and look for him?") + (return-from chuck)) + (unless (get-state 'PINECONE) (save-state 'PINECONE 0)) + (remove-object-attribute player 'item "Pine cone") + (format t "~&You grab your pine cone, take aim quickly and throw it at Tigger.") + (sleep 2) + (format t "~&Tigger ducks, laughs, and throws one back at you.") + (sleep 1) + (case winner + ('POOH (format t "~&You hit Tigger!") + (save-state 'PINECONE (1+ (get-state 'PINECONE)))) + ('TIGGER (format t "~&You miss. Tigger hits!") + (save-state 'PINECONE (1- (get-state 'PINECONE)))) + ('BOTH (format t "~&You hit! So does Tigger.")) + ('NONE (format t "~&You miss. Tigger does too."))) + (format t "~&Your score is now ~A." (get-state 'PINECONE)))) + (defun blow (player &optional arg) "Blow up a balloon." (narrate "../ATL/Pooh/dialogue/balloon.txt") @@ -414,8 +436,9 @@ (defun daniel-says (player) "Leave a message for the real me" - ;;XXX Figure out how to read the host name - (unless (y-or-n-p "~&~%Daniel has more to say to you. Do you want to hear it?") + ;;Make sure we're on my server + (unless (or (equalp (first (load-text-file "/etc/hostname")) "Helios") + (y-or-n-p "~&~%Daniel has more to say to you. Do you want to hear it?")) (return-from daniel-says)) (setf msg "~%DANIEL: Hi there! This is the 'real' Daniel speaking now... Great to see that you've diff --git a/ATL/Pooh/pooh.atl b/ATL/Pooh/pooh.atl index 452e590..f8af0b3 100644 --- a/ATL/Pooh/pooh.atl +++ b/ATL/Pooh/pooh.atl @@ -23,4 +23,4 @@ ;TODO development - remove before release define-player "Christopher Robin" description "Christopher Robin is my game dev character." - place "Owl's porch" \ No newline at end of file + place "Northern woods" \ No newline at end of file diff --git a/ATL/Pooh/woods.atl b/ATL/Pooh/woods.atl index 31f129e..c0e2243 100644 --- a/ATL/Pooh/woods.atl +++ b/ATL/Pooh/woods.atl @@ -12,7 +12,7 @@ delicious honey..." neighbour "Pooh's porch" neighbour "Pooh's branch" - item "Shelf" + item "Cupboard" item "Hunny" item "Jar" item "Clock" diff --git a/doc/PLAYING b/doc/PLAYING index 64bb789..34aaf09 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -33,10 +33,8 @@ 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. - -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. +The third option displays this help text; the fourth option shows a copyright +notice and the Atlantis software license. The fifth option quits the game. BASIC GAME PLAY @@ -111,16 +109,18 @@ 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.) + something to say to you, and occasionally, it's important! It's worth + talking to NPCs more than once, because some will have more than one + thing to say. 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. + it with this command. 'equip none' will unequip your current weapon. attack - Some places contain monsters. (In Atlantis, a "monster" is any hostile non-playing character.) While some monsters attack you first, you also @@ -142,4 +142,4 @@ Daniel Vedder -Last modified 21/10/2017 +Last modified 04/11/2017 diff --git a/doc/TODO b/doc/TODO index 42f16ce..79689f4 100644 --- a/doc/TODO +++ b/doc/TODO @@ -4,10 +4,12 @@ * update Helios guide (include bug reporting with 'archive') * update documentation * fix (string-from-list) bug +* replace 'equip' with 'hold' ATL -* fill in missing place descriptions - +* add game end sequence +* add 'throw' command for fir cones + NOTES diff --git a/lisp/ui.lisp b/lisp/ui.lisp index c224997..9dffac7 100644 --- a/lisp/ui.lisp +++ b/lisp/ui.lisp @@ -365,9 +365,11 @@ (format t "~&This item provides commands: ~A" (string-from-list (item-command item) :line-length *max-line-items*))) + (when (item-weapon item) + (format t "~&This item is a weapon.")) (unless (zerop (length (item-pickup-hook item))) - (funcall (read-from-string - (item-pickup-hook item)) player)))) + (funcall (read-from-string (item-pickup-hook item)) + player)))) (format t "~&Sorry, this item is not here!")))) (defun drop (player &optional item) @@ -393,7 +395,7 @@ (defun equip (player &optional new-weapon) "The player sets another item to be his weapon" - ;;XXX Replace this with 'hold'? (Also possible for non-weapons.) + ;;TODO Replace this with 'hold'? (Also possible for non-weapons.) (unless new-weapon (format t "~&Please specify a weapon to be equipped!") (return-from equip)) diff --git a/lisp/util.lisp b/lisp/util.lisp index 2641d71..5876a76 100644 --- a/lisp/util.lisp +++ b/lisp/util.lisp @@ -216,7 +216,8 @@ (defun load-text-file (file-name) "Load a text file into a list of strings (representing the lines)" - (with-open-file (f file-name) + (with-open-file (f file-name :if-does-not-exist NIL) + (unless f (return-from load-text-file)) (do* ((line (read-line f nil nil) (read-line f nil nil)) (file-lines NIL)) ((null line) file-lines) (setf file-lines (append file-lines (list line))))))