diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 64b7ed7..95234f7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -93,7 +93,7 @@ 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" + command "throw" infinite define-item "Berries" diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 64b7ed7..95234f7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -93,7 +93,7 @@ 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" + command "throw" infinite define-item "Berries" diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index af500ac..8468936 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -88,6 +88,7 @@ (progn (format t "~&Ouch! That hurt! You take 2 HP fall damage.") (change-player-health player -2))) (sleep 4) + ;;FIXME Doesn't work - not neighbours (goto player "Pooh's porch")) (defun kanga-healing (player) @@ -274,6 +275,8 @@ (progn (save-state 'POOHSTICKS (1- (get-state 'POOHSTICKS))) (format t "~&You lose! Your score is now ~A." (get-state 'POOHSTICKS))))))) +(add-alias 'throw 'chuck) + (defun chuck (player &optional arg) "Engage in a pine cone battle with Tigger" (let ((place (get-game-object 'place (player-place player))) diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 64b7ed7..95234f7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -93,7 +93,7 @@ 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" + command "throw" infinite define-item "Berries" diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index af500ac..8468936 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -88,6 +88,7 @@ (progn (format t "~&Ouch! That hurt! You take 2 HP fall damage.") (change-player-health player -2))) (sleep 4) + ;;FIXME Doesn't work - not neighbours (goto player "Pooh's porch")) (defun kanga-healing (player) @@ -274,6 +275,8 @@ (progn (save-state 'POOHSTICKS (1- (get-state 'POOHSTICKS))) (format t "~&You lose! Your score is now ~A." (get-state 'POOHSTICKS))))))) +(add-alias 'throw 'chuck) + (defun chuck (player &optional arg) "Engage in a pine cone battle with Tigger" (let ((place (get-game-object 'place (player-place player))) diff --git a/doc/COMMANDS b/doc/COMMANDS index c7ef700..52de99a 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -12,7 +12,7 @@ take - Pick up an item lying around drop - Drop the item talk [to] - Talk to an NPC -seek - Same as 'look around' +search - Same as 'look around' equip - Equip this item as your weapon attack - Fight a monster diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 64b7ed7..95234f7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -93,7 +93,7 @@ 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" + command "throw" infinite define-item "Berries" diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index af500ac..8468936 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -88,6 +88,7 @@ (progn (format t "~&Ouch! That hurt! You take 2 HP fall damage.") (change-player-health player -2))) (sleep 4) + ;;FIXME Doesn't work - not neighbours (goto player "Pooh's porch")) (defun kanga-healing (player) @@ -274,6 +275,8 @@ (progn (save-state 'POOHSTICKS (1- (get-state 'POOHSTICKS))) (format t "~&You lose! Your score is now ~A." (get-state 'POOHSTICKS))))))) +(add-alias 'throw 'chuck) + (defun chuck (player &optional arg) "Engage in a pine cone battle with Tigger" (let ((place (get-game-object 'place (player-place player))) diff --git a/doc/COMMANDS b/doc/COMMANDS index c7ef700..52de99a 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -12,7 +12,7 @@ take - Pick up an item lying around drop - Drop the item talk [to] - Talk to an NPC -seek - Same as 'look around' +search - Same as 'look around' equip - Equip this item as your weapon attack - Fight a monster diff --git a/doc/HACKING b/doc/HACKING index fef0ff7..86f3e6b 100644 --- a/doc/HACKING +++ b/doc/HACKING @@ -132,6 +132,7 @@ reward-item NIL money 0 experience 0 + completed-hook "" infinite FALSE @@ -173,14 +174,20 @@ player.lisp - Deals with the player object. Most useful functions: change-player-health, add-player-experience and add-player-money -ui.lisp - Defines the in-game commands. Not interesting except as an example for - how to implement command functions. +ui.lisp - Defines the in-game commands. If you have a game command function + whose name conflicts with a CLisp inbuilt function, you can use + add-alias to get around that. (For example, the Atlantis command + 'search' is remapped to 'seek' for that reason.) Otherwise, this + module is of little interest except as an example of how to implement + command functions. util.lisp - Lots of useful utility functions. Browse at leisure. world.lisp - Administers the game world instance. Most useful function: - get-game-object, a type-agnostic getter function. + get-game-object, a type-agnostic getter function. Also useful: + save-state and get-state, which can be used to store game state + between game sessions (e.g. keeping score on an in-world minigame). Daniel Vedder -Last modified 10/10/2017 +Last modified 06/11/2017 diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 64b7ed7..95234f7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -93,7 +93,7 @@ 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" + command "throw" infinite define-item "Berries" diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index af500ac..8468936 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -88,6 +88,7 @@ (progn (format t "~&Ouch! That hurt! You take 2 HP fall damage.") (change-player-health player -2))) (sleep 4) + ;;FIXME Doesn't work - not neighbours (goto player "Pooh's porch")) (defun kanga-healing (player) @@ -274,6 +275,8 @@ (progn (save-state 'POOHSTICKS (1- (get-state 'POOHSTICKS))) (format t "~&You lose! Your score is now ~A." (get-state 'POOHSTICKS))))))) +(add-alias 'throw 'chuck) + (defun chuck (player &optional arg) "Engage in a pine cone battle with Tigger" (let ((place (get-game-object 'place (player-place player))) diff --git a/doc/COMMANDS b/doc/COMMANDS index c7ef700..52de99a 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -12,7 +12,7 @@ take - Pick up an item lying around drop - Drop the item talk [to] - Talk to an NPC -seek - Same as 'look around' +search - Same as 'look around' equip - Equip this item as your weapon attack - Fight a monster diff --git a/doc/HACKING b/doc/HACKING index fef0ff7..86f3e6b 100644 --- a/doc/HACKING +++ b/doc/HACKING @@ -132,6 +132,7 @@ reward-item NIL money 0 experience 0 + completed-hook "" infinite FALSE @@ -173,14 +174,20 @@ player.lisp - Deals with the player object. Most useful functions: change-player-health, add-player-experience and add-player-money -ui.lisp - Defines the in-game commands. Not interesting except as an example for - how to implement command functions. +ui.lisp - Defines the in-game commands. If you have a game command function + whose name conflicts with a CLisp inbuilt function, you can use + add-alias to get around that. (For example, the Atlantis command + 'search' is remapped to 'seek' for that reason.) Otherwise, this + module is of little interest except as an example of how to implement + command functions. util.lisp - Lots of useful utility functions. Browse at leisure. world.lisp - Administers the game world instance. Most useful function: - get-game-object, a type-agnostic getter function. + get-game-object, a type-agnostic getter function. Also useful: + save-state and get-state, which can be used to store game state + between game sessions (e.g. keeping score on an in-world minigame). Daniel Vedder -Last modified 10/10/2017 +Last modified 06/11/2017 diff --git a/doc/PLAYING b/doc/PLAYING index 34aaf09..3fdac43 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -98,9 +98,9 @@ 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). -seek - Some rooms contain hidden items. To find them, you first need to search - the room. When you do so, you have a 66% chance of finding a hidden - object. Don't forget to do this once in a while! +search - Some rooms contain hidden items. To find them, you first need to search + the room. When you do so, you have a 66% chance of finding a hidden + object. Don't forget to do this once in a while! take - This command is used to pick up an item. Most items in the game can be picked up, many are useful. @@ -140,6 +140,13 @@ the various commands. With "clear" you delete all text except the place description. +archive - This is intended for debugging purposes for games on my server. If + Atlantis crashes, do the following: Restart Atlantis and reload your + game. Then, *immediately* execute this command. Finally, send me a + short bug report with your player name and the command that caused + the crash. This will help me track down the problem. After that you + can continue playing. + Daniel Vedder -Last modified 04/11/2017 +Last modified 06/11/2017 diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 64b7ed7..95234f7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -93,7 +93,7 @@ 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" + command "throw" infinite define-item "Berries" diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index af500ac..8468936 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -88,6 +88,7 @@ (progn (format t "~&Ouch! That hurt! You take 2 HP fall damage.") (change-player-health player -2))) (sleep 4) + ;;FIXME Doesn't work - not neighbours (goto player "Pooh's porch")) (defun kanga-healing (player) @@ -274,6 +275,8 @@ (progn (save-state 'POOHSTICKS (1- (get-state 'POOHSTICKS))) (format t "~&You lose! Your score is now ~A." (get-state 'POOHSTICKS))))))) +(add-alias 'throw 'chuck) + (defun chuck (player &optional arg) "Engage in a pine cone battle with Tigger" (let ((place (get-game-object 'place (player-place player))) diff --git a/doc/COMMANDS b/doc/COMMANDS index c7ef700..52de99a 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -12,7 +12,7 @@ take - Pick up an item lying around drop - Drop the item talk [to] - Talk to an NPC -seek - Same as 'look around' +search - Same as 'look around' equip - Equip this item as your weapon attack - Fight a monster diff --git a/doc/HACKING b/doc/HACKING index fef0ff7..86f3e6b 100644 --- a/doc/HACKING +++ b/doc/HACKING @@ -132,6 +132,7 @@ reward-item NIL money 0 experience 0 + completed-hook "" infinite FALSE @@ -173,14 +174,20 @@ player.lisp - Deals with the player object. Most useful functions: change-player-health, add-player-experience and add-player-money -ui.lisp - Defines the in-game commands. Not interesting except as an example for - how to implement command functions. +ui.lisp - Defines the in-game commands. If you have a game command function + whose name conflicts with a CLisp inbuilt function, you can use + add-alias to get around that. (For example, the Atlantis command + 'search' is remapped to 'seek' for that reason.) Otherwise, this + module is of little interest except as an example of how to implement + command functions. util.lisp - Lots of useful utility functions. Browse at leisure. world.lisp - Administers the game world instance. Most useful function: - get-game-object, a type-agnostic getter function. + get-game-object, a type-agnostic getter function. Also useful: + save-state and get-state, which can be used to store game state + between game sessions (e.g. keeping score on an in-world minigame). Daniel Vedder -Last modified 10/10/2017 +Last modified 06/11/2017 diff --git a/doc/PLAYING b/doc/PLAYING index 34aaf09..3fdac43 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -98,9 +98,9 @@ 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). -seek - Some rooms contain hidden items. To find them, you first need to search - the room. When you do so, you have a 66% chance of finding a hidden - object. Don't forget to do this once in a while! +search - Some rooms contain hidden items. To find them, you first need to search + the room. When you do so, you have a 66% chance of finding a hidden + object. Don't forget to do this once in a while! take - This command is used to pick up an item. Most items in the game can be picked up, many are useful. @@ -140,6 +140,13 @@ the various commands. With "clear" you delete all text except the place description. +archive - This is intended for debugging purposes for games on my server. If + Atlantis crashes, do the following: Restart Atlantis and reload your + game. Then, *immediately* execute this command. Finally, send me a + short bug report with your player name and the command that caused + the crash. This will help me track down the problem. After that you + can continue playing. + Daniel Vedder -Last modified 04/11/2017 +Last modified 06/11/2017 diff --git a/doc/TODO b/doc/TODO index 79689f4..dba742a 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,16 +1,20 @@ ATLANTIS TODO LISP -* update Helios guide (include bug reporting with 'archive') -* update documentation * fix (string-from-list) bug * replace 'equip' with 'hold' +* indicate weapon strength ATL * add game end sequence -* add 'throw' command for fir cones - +* fix Daniel's interaction hook +* add more clues + +Game crashed when moving from Deep Forest -> Central woods, with message +' is not a number' + + NOTES Honey pots: diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 64b7ed7..95234f7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -93,7 +93,7 @@ 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" + command "throw" infinite define-item "Berries" diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index af500ac..8468936 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -88,6 +88,7 @@ (progn (format t "~&Ouch! That hurt! You take 2 HP fall damage.") (change-player-health player -2))) (sleep 4) + ;;FIXME Doesn't work - not neighbours (goto player "Pooh's porch")) (defun kanga-healing (player) @@ -274,6 +275,8 @@ (progn (save-state 'POOHSTICKS (1- (get-state 'POOHSTICKS))) (format t "~&You lose! Your score is now ~A." (get-state 'POOHSTICKS))))))) +(add-alias 'throw 'chuck) + (defun chuck (player &optional arg) "Engage in a pine cone battle with Tigger" (let ((place (get-game-object 'place (player-place player))) diff --git a/doc/COMMANDS b/doc/COMMANDS index c7ef700..52de99a 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -12,7 +12,7 @@ take - Pick up an item lying around drop - Drop the item talk [to] - Talk to an NPC -seek - Same as 'look around' +search - Same as 'look around' equip - Equip this item as your weapon attack - Fight a monster diff --git a/doc/HACKING b/doc/HACKING index fef0ff7..86f3e6b 100644 --- a/doc/HACKING +++ b/doc/HACKING @@ -132,6 +132,7 @@ reward-item NIL money 0 experience 0 + completed-hook "" infinite FALSE @@ -173,14 +174,20 @@ player.lisp - Deals with the player object. Most useful functions: change-player-health, add-player-experience and add-player-money -ui.lisp - Defines the in-game commands. Not interesting except as an example for - how to implement command functions. +ui.lisp - Defines the in-game commands. If you have a game command function + whose name conflicts with a CLisp inbuilt function, you can use + add-alias to get around that. (For example, the Atlantis command + 'search' is remapped to 'seek' for that reason.) Otherwise, this + module is of little interest except as an example of how to implement + command functions. util.lisp - Lots of useful utility functions. Browse at leisure. world.lisp - Administers the game world instance. Most useful function: - get-game-object, a type-agnostic getter function. + get-game-object, a type-agnostic getter function. Also useful: + save-state and get-state, which can be used to store game state + between game sessions (e.g. keeping score on an in-world minigame). Daniel Vedder -Last modified 10/10/2017 +Last modified 06/11/2017 diff --git a/doc/PLAYING b/doc/PLAYING index 34aaf09..3fdac43 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -98,9 +98,9 @@ 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). -seek - Some rooms contain hidden items. To find them, you first need to search - the room. When you do so, you have a 66% chance of finding a hidden - object. Don't forget to do this once in a while! +search - Some rooms contain hidden items. To find them, you first need to search + the room. When you do so, you have a 66% chance of finding a hidden + object. Don't forget to do this once in a while! take - This command is used to pick up an item. Most items in the game can be picked up, many are useful. @@ -140,6 +140,13 @@ the various commands. With "clear" you delete all text except the place description. +archive - This is intended for debugging purposes for games on my server. If + Atlantis crashes, do the following: Restart Atlantis and reload your + game. Then, *immediately* execute this command. Finally, send me a + short bug report with your player name and the command that caused + the crash. This will help me track down the problem. After that you + can continue playing. + Daniel Vedder -Last modified 04/11/2017 +Last modified 06/11/2017 diff --git a/doc/TODO b/doc/TODO index 79689f4..dba742a 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,16 +1,20 @@ ATLANTIS TODO LISP -* update Helios guide (include bug reporting with 'archive') -* update documentation * fix (string-from-list) bug * replace 'equip' with 'hold' +* indicate weapon strength ATL * add game end sequence -* add 'throw' command for fir cones - +* fix Daniel's interaction hook +* add more clues + +Game crashed when moving from Deep Forest -> Central woods, with message +' is not a number' + + NOTES Honey pots: diff --git a/lisp/game-objects.lisp b/lisp/game-objects.lisp index 1ab9f3a..6a03b96 100644 --- a/lisp/game-objects.lisp +++ b/lisp/game-objects.lisp @@ -61,6 +61,7 @@ (command NIL) (ability NIL)) ;TODO Remove abilities again +;;TODO Remove weapons altogether? (Fold 'damage' into 'item') (defstruct weapon (name "") (description "") diff --git a/ATL/Pooh/items.atl b/ATL/Pooh/items.atl index 64b7ed7..95234f7 100644 --- a/ATL/Pooh/items.atl +++ b/ATL/Pooh/items.atl @@ -93,7 +93,7 @@ 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" + command "throw" infinite define-item "Berries" diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index af500ac..8468936 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -88,6 +88,7 @@ (progn (format t "~&Ouch! That hurt! You take 2 HP fall damage.") (change-player-health player -2))) (sleep 4) + ;;FIXME Doesn't work - not neighbours (goto player "Pooh's porch")) (defun kanga-healing (player) @@ -274,6 +275,8 @@ (progn (save-state 'POOHSTICKS (1- (get-state 'POOHSTICKS))) (format t "~&You lose! Your score is now ~A." (get-state 'POOHSTICKS))))))) +(add-alias 'throw 'chuck) + (defun chuck (player &optional arg) "Engage in a pine cone battle with Tigger" (let ((place (get-game-object 'place (player-place player))) diff --git a/doc/COMMANDS b/doc/COMMANDS index c7ef700..52de99a 100644 --- a/doc/COMMANDS +++ b/doc/COMMANDS @@ -12,7 +12,7 @@ take - Pick up an item lying around drop - Drop the item talk [to] - Talk to an NPC -seek - Same as 'look around' +search - Same as 'look around' equip - Equip this item as your weapon attack - Fight a monster diff --git a/doc/HACKING b/doc/HACKING index fef0ff7..86f3e6b 100644 --- a/doc/HACKING +++ b/doc/HACKING @@ -132,6 +132,7 @@ reward-item NIL money 0 experience 0 + completed-hook "" infinite FALSE @@ -173,14 +174,20 @@ player.lisp - Deals with the player object. Most useful functions: change-player-health, add-player-experience and add-player-money -ui.lisp - Defines the in-game commands. Not interesting except as an example for - how to implement command functions. +ui.lisp - Defines the in-game commands. If you have a game command function + whose name conflicts with a CLisp inbuilt function, you can use + add-alias to get around that. (For example, the Atlantis command + 'search' is remapped to 'seek' for that reason.) Otherwise, this + module is of little interest except as an example of how to implement + command functions. util.lisp - Lots of useful utility functions. Browse at leisure. world.lisp - Administers the game world instance. Most useful function: - get-game-object, a type-agnostic getter function. + get-game-object, a type-agnostic getter function. Also useful: + save-state and get-state, which can be used to store game state + between game sessions (e.g. keeping score on an in-world minigame). Daniel Vedder -Last modified 10/10/2017 +Last modified 06/11/2017 diff --git a/doc/PLAYING b/doc/PLAYING index 34aaf09..3fdac43 100644 --- a/doc/PLAYING +++ b/doc/PLAYING @@ -98,9 +98,9 @@ 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). -seek - Some rooms contain hidden items. To find them, you first need to search - the room. When you do so, you have a 66% chance of finding a hidden - object. Don't forget to do this once in a while! +search - Some rooms contain hidden items. To find them, you first need to search + the room. When you do so, you have a 66% chance of finding a hidden + object. Don't forget to do this once in a while! take - This command is used to pick up an item. Most items in the game can be picked up, many are useful. @@ -140,6 +140,13 @@ the various commands. With "clear" you delete all text except the place description. +archive - This is intended for debugging purposes for games on my server. If + Atlantis crashes, do the following: Restart Atlantis and reload your + game. Then, *immediately* execute this command. Finally, send me a + short bug report with your player name and the command that caused + the crash. This will help me track down the problem. After that you + can continue playing. + Daniel Vedder -Last modified 04/11/2017 +Last modified 06/11/2017 diff --git a/doc/TODO b/doc/TODO index 79689f4..dba742a 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,16 +1,20 @@ ATLANTIS TODO LISP -* update Helios guide (include bug reporting with 'archive') -* update documentation * fix (string-from-list) bug * replace 'equip' with 'hold' +* indicate weapon strength ATL * add game end sequence -* add 'throw' command for fir cones - +* fix Daniel's interaction hook +* add more clues + +Game crashed when moving from Deep Forest -> Central woods, with message +' is not a number' + + NOTES Honey pots: diff --git a/lisp/game-objects.lisp b/lisp/game-objects.lisp index 1ab9f3a..6a03b96 100644 --- a/lisp/game-objects.lisp +++ b/lisp/game-objects.lisp @@ -61,6 +61,7 @@ (command NIL) (ability NIL)) ;TODO Remove abilities again +;;TODO Remove weapons altogether? (Fold 'damage' into 'item') (defstruct weapon (name "") (description "") diff --git a/lisp/ui.lisp b/lisp/ui.lisp index 9dffac7..6b06e1d 100644 --- a/lisp/ui.lisp +++ b/lisp/ui.lisp @@ -109,8 +109,11 @@ (when item-cmd (setf cmd-fn (read-from-string item-cmd)) (return)))) ;; If found, execute the command (if cmd-fn - (if space (funcall cmd-fn player arg) - (funcall cmd-fn player)) + (progn + (when (member cmd-fn (keys *aliases*)) + (setf cmd-fn (cassoc cmd-fn *aliases*))) + (if space (funcall cmd-fn player arg) + (funcall cmd-fn player))) (progn (format t "~&Sorry, this command is not available!") (format t "~&Type 'help' for a list of commands."))))) @@ -122,7 +125,15 @@ (defvar *commands* '(help look goto take inventory drop talk equip attack - seek clear manual archive)) + search clear manual archive)) + +;; A list of aliases (used to avoid naming conflicts with inbuilt functions) +(defvar *aliases* + '((search seek))) + +(defun add-alias (alias fn) + "Add an alias to the list" + (setf *aliases* (append *aliases* (list (list alias fn))))) ;;; Command functions have to take two arguments (a player instance and ;;; an optional(!) argument to the function).