diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 30045a7..6ecfbaa 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -54,9 +54,10 @@ (let* ((place (get-game-object 'place (player-place player))) (neighbour (get-game-object 'place (random-elt (place-neighbour place))))) + (sleep 1) (format t "~&~%A large yellow-and-black object comes flying out of nowhere") (format t "~&and knocks you over. When you sit up again, you see Tigger") - (format t "~&grinning widely at you.") (sleep 3) + (format t "~&grinning widely at you.") (sleep 4) (format t "~&~%Tigger bounces away toward ~A." (place-name neighbour)) (remove-object-attribute place 'npc "Tigger") (set-object-attribute neighbour 'npc "Tigger"))) diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 30045a7..6ecfbaa 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -54,9 +54,10 @@ (let* ((place (get-game-object 'place (player-place player))) (neighbour (get-game-object 'place (random-elt (place-neighbour place))))) + (sleep 1) (format t "~&~%A large yellow-and-black object comes flying out of nowhere") (format t "~&and knocks you over. When you sit up again, you see Tigger") - (format t "~&grinning widely at you.") (sleep 3) + (format t "~&grinning widely at you.") (sleep 4) (format t "~&~%Tigger bounces away toward ~A." (place-name neighbour)) (remove-object-attribute place 'npc "Tigger") (set-object-attribute neighbour 'npc "Tigger"))) diff --git a/doc/TODO b/doc/TODO index 5b88324..8d6ba55 100644 --- a/doc/TODO +++ b/doc/TODO @@ -10,6 +10,7 @@ * require XP minimum to finish game? * think of more quests * integrate the quests to lead the player through the game +* remove "The World" again, games should finish at Galleon's lap NOTES diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 30045a7..6ecfbaa 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -54,9 +54,10 @@ (let* ((place (get-game-object 'place (player-place player))) (neighbour (get-game-object 'place (random-elt (place-neighbour place))))) + (sleep 1) (format t "~&~%A large yellow-and-black object comes flying out of nowhere") (format t "~&and knocks you over. When you sit up again, you see Tigger") - (format t "~&grinning widely at you.") (sleep 3) + (format t "~&grinning widely at you.") (sleep 4) (format t "~&~%Tigger bounces away toward ~A." (place-name neighbour)) (remove-object-attribute place 'npc "Tigger") (set-object-attribute neighbour 'npc "Tigger"))) diff --git a/doc/TODO b/doc/TODO index 5b88324..8d6ba55 100644 --- a/doc/TODO +++ b/doc/TODO @@ -10,6 +10,7 @@ * require XP minimum to finish game? * think of more quests * integrate the quests to lead the player through the game +* remove "The World" again, games should finish at Galleon's lap NOTES diff --git a/lisp/atlantis.lisp b/lisp/atlantis.lisp index 8c45b37..5ec86f0 100644 --- a/lisp/atlantis.lisp +++ b/lisp/atlantis.lisp @@ -7,7 +7,7 @@ ;;; date: 09/05/2015 ;;; -(defconstant ATLANTIS-VERSION '(0 2 2)) +(defconstant ATLANTIS-VERSION '(0 2 3)) (load "util.lisp") (load "game-objects.lisp") @@ -22,8 +22,7 @@ ;; Game worlds must be registered in this list with a display name ;; and a path relative to ../ATL (defvar *games* '(("Winnie the Pooh" "Pooh/pooh.atl") - ("Lugwey" "Lugwey/lugwey.atl") - ("Development" "dev/test.atl"))) + ("Lugwey" "Lugwey/lugwey.atl"))) (defun print-version () (format t "~&Atlantis ~A.~A.~A" @@ -44,13 +43,9 @@ (case (choose-number-option options) (0 (format t "~&Which world do you want to play?") ;; let the player choose one of the game worlds - (let ((world (choose-option - (append (keys *games*) '("Other" "Back"))))) - (cond ((equalp world "Back") (start-menu)) - ((equalp world "Other") - (format t "~&What world file do you want to load?") - (input-string world-file)) - (T (setf world-file (cassoc world *games*)))) + (let ((world (choose-option (append (keys *games*) '("Back"))))) + (if (equalp world "Back") (start-menu) + (setf world-file (cassoc world *games*))) (setf world-file (concatenate 'string "../ATL/" world-file)) (load-file world-file) ;; let the player choose a character @@ -76,13 +71,11 @@ (play-game))))) (2 (world-creator)) ;;XXX Remove this from the main menu? (3 (clear-screen) - (print-text-file "../doc/PLAYING") - (read-line) + (pager "../doc/PLAYING" T) (start-menu)) (4 (print-version) (when (y-or-n-p "~&~%Show the license text?") - (print-text-file "../doc/COPYING") - (read-line)) + (pager "../doc/COPYING" T)) (start-menu)) (5 (format t "~&Goodbye!") (quit)))) @@ -110,8 +103,7 @@ ((or (cmd-parameter "--help" T) (cmd-parameter "-h" T)) (print-help) (quit)) ((cmd-parameter "--license" T) - (dolist (line (load-text-file "../COPYING")) - (unless (null line) (format t "~%~A" line))) + (print-text-file "../COPYING") (quit)) ((cmd-parameter "--debugging") (setf *debugging* T))) diff --git a/ATL/Pooh/pooh-extensions.lisp b/ATL/Pooh/pooh-extensions.lisp index 30045a7..6ecfbaa 100644 --- a/ATL/Pooh/pooh-extensions.lisp +++ b/ATL/Pooh/pooh-extensions.lisp @@ -54,9 +54,10 @@ (let* ((place (get-game-object 'place (player-place player))) (neighbour (get-game-object 'place (random-elt (place-neighbour place))))) + (sleep 1) (format t "~&~%A large yellow-and-black object comes flying out of nowhere") (format t "~&and knocks you over. When you sit up again, you see Tigger") - (format t "~&grinning widely at you.") (sleep 3) + (format t "~&grinning widely at you.") (sleep 4) (format t "~&~%Tigger bounces away toward ~A." (place-name neighbour)) (remove-object-attribute place 'npc "Tigger") (set-object-attribute neighbour 'npc "Tigger"))) diff --git a/doc/TODO b/doc/TODO index 5b88324..8d6ba55 100644 --- a/doc/TODO +++ b/doc/TODO @@ -10,6 +10,7 @@ * require XP minimum to finish game? * think of more quests * integrate the quests to lead the player through the game +* remove "The World" again, games should finish at Galleon's lap NOTES diff --git a/lisp/atlantis.lisp b/lisp/atlantis.lisp index 8c45b37..5ec86f0 100644 --- a/lisp/atlantis.lisp +++ b/lisp/atlantis.lisp @@ -7,7 +7,7 @@ ;;; date: 09/05/2015 ;;; -(defconstant ATLANTIS-VERSION '(0 2 2)) +(defconstant ATLANTIS-VERSION '(0 2 3)) (load "util.lisp") (load "game-objects.lisp") @@ -22,8 +22,7 @@ ;; Game worlds must be registered in this list with a display name ;; and a path relative to ../ATL (defvar *games* '(("Winnie the Pooh" "Pooh/pooh.atl") - ("Lugwey" "Lugwey/lugwey.atl") - ("Development" "dev/test.atl"))) + ("Lugwey" "Lugwey/lugwey.atl"))) (defun print-version () (format t "~&Atlantis ~A.~A.~A" @@ -44,13 +43,9 @@ (case (choose-number-option options) (0 (format t "~&Which world do you want to play?") ;; let the player choose one of the game worlds - (let ((world (choose-option - (append (keys *games*) '("Other" "Back"))))) - (cond ((equalp world "Back") (start-menu)) - ((equalp world "Other") - (format t "~&What world file do you want to load?") - (input-string world-file)) - (T (setf world-file (cassoc world *games*)))) + (let ((world (choose-option (append (keys *games*) '("Back"))))) + (if (equalp world "Back") (start-menu) + (setf world-file (cassoc world *games*))) (setf world-file (concatenate 'string "../ATL/" world-file)) (load-file world-file) ;; let the player choose a character @@ -76,13 +71,11 @@ (play-game))))) (2 (world-creator)) ;;XXX Remove this from the main menu? (3 (clear-screen) - (print-text-file "../doc/PLAYING") - (read-line) + (pager "../doc/PLAYING" T) (start-menu)) (4 (print-version) (when (y-or-n-p "~&~%Show the license text?") - (print-text-file "../doc/COPYING") - (read-line)) + (pager "../doc/COPYING" T)) (start-menu)) (5 (format t "~&Goodbye!") (quit)))) @@ -110,8 +103,7 @@ ((or (cmd-parameter "--help" T) (cmd-parameter "-h" T)) (print-help) (quit)) ((cmd-parameter "--license" T) - (dolist (line (load-text-file "../COPYING")) - (unless (null line) (format t "~%~A" line))) + (print-text-file "../COPYING") (quit)) ((cmd-parameter "--debugging") (setf *debugging* T))) diff --git a/lisp/util.lisp b/lisp/util.lisp index 064fcfd..3864445 100644 --- a/lisp/util.lisp +++ b/lisp/util.lisp @@ -278,6 +278,17 @@ (setf text (text-input))) text)) +(defun pager (file &optional help) + "Display a text file using an external pager" + (cond ((member ':win32 *features*) (print-text-file file)) + ((member ':unix *features*) + (if (not help) (ext:shell (concatenate 'string "less " file)) + (progn + (write-to-file "Use the arrow keys to scroll and q to quit." "help.tmp") + (ext:shell (concatenate 'string "cat help.tmp " file " | less")) + (ext:shell "rm help.tmp")))) + (t (debugging "~&pager is not supported on this operating system!")))) + (defun clear-screen () "Clear the screen in an OS-dependent manner" ;; NOTE: only works with CLISP! (ext:shell function used)