Skip to content

Commit

Permalink
fixed repetition message collecting code
Browse files Browse the repository at this point in the history
  • Loading branch information
David O'Toole committed Dec 17, 2009
1 parent e3006fc commit 7b53ca8
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion forest/forest.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@
(2 =ascent-gateway=)
(3 =passage-gateway=))))
(row (+ (- height 10) (random 10))) ;; 20 FIXME
(column (random 10)))
(column (+ 2 (random (- *forest-width* 4)))))
(setf <gateway-row> row <gateway-column> column)
[replace-cells-at *world* row column gateway]
[set-location gateway row column])
Expand Down
1 change: 0 additions & 1 deletion forest/forest.org
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
** TODO [#A] FIX numlock being on breaks shift keybinding
** TODO [#A] treasure on enemies (gold)
** TODO [#C] joypad support
** TODO [#B] record churchbell, flute, guitar
** TODO [#A] sheet music in-game
** TODO [#A] fix bubbles to stay onscreen, Lothaine etc
** TODO [#A] forest exits should be able to be in any column
Expand Down
8 changes: 8 additions & 0 deletions forest/forest.org_archive
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ CLOSED: [2009-12-17 Thu 02:24]
:ARCHIVE_CATEGORY: forest
:ARCHIVE_TODO: TODO
:END:
* DONE [#B] record churchbell, flute, guitar
:PROPERTIES:
:ARCHIVE_TIME: 2009-12-17 Thu 05:49
:ARCHIVE_FILE: ~/xe2/forest/forest.org
:ARCHIVE_CATEGORY: forest
:ARCHIVE_TODO: TODO
:END:




Expand Down
3 changes: 3 additions & 0 deletions forest/forest.pak
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
(:name "growl-1" :type :sample :file "growl-1.wav" :properties (:volume 30))
(:name "growl-2" :type :sample :file "growl-2.wav" :properties (:volume 30))
(:name "howl" :type :sample :file "howl.wav" :properties (:volume 20))
(:name "chimes" :type :sample :file "chimes.wav" :properties (:volume 20))
(:name "path" :type :sample :file "path.wav" :properties (:volume 20))
(:name "flutism" :type :sample :file "flutism.wav" :properties (:volume 13))
(:name "bark" :type :sample :file "bark.wav" :properties (:volume 30))
(:name "yelp" :type :sample :file "yelp.wav" :properties (:volume 30))

Expand Down
2 changes: 1 addition & 1 deletion forest/startup.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
(setf *pager* (clone =pager=))
[auto-position *pager*]
(xe2:install-widgets splash-prompt splash)
[add-page *pager* :map prompt viewport narrator status quickhelp]
[add-page *pager* :play prompt viewport narrator status quickhelp]
[add-page *pager* :help help-prompt help]))


Expand Down
8 changes: 5 additions & 3 deletions narration.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ verbosity level.")
http://en.wikipedia.org/wiki/Passive_voice"
:initform nil)
(repeat-count :initform 0)
(last-line :initform nil)
(line-number :initform 0))

(define-method set-verbosity narrator (&optional (value 1))
Expand All @@ -119,8 +120,8 @@ http://en.wikipedia.org/wiki/Passive_voice"
(apply #'format nil control-string args)])

(define-method say narrator (control-string &rest args)
(let* ((last-line (aref <lines> (- (fill-pointer <lines>) 1)))
(this-line (list (list (apply #'format nil control-string args)))))
(let ((last-line <last-line>)
(this-line (list (list (apply #'format nil control-string args)))))
(if (equal last-line this-line)
;; it's a repeat. make new line with Nx repeat
(progn (incf <repeat-count>)
Expand All @@ -134,7 +135,8 @@ http://en.wikipedia.org/wiki/Passive_voice"
(progn
(message "New message ~S" (cons control-string args))
(setf <repeat-count> 0)
[println self (apply #'format nil control-string args)]))))
[println self (apply #'format nil control-string args)]))
(setf <last-line> (list (list (apply #'format nil control-string args))))))



Expand Down

0 comments on commit 7b53ca8

Please sign in to comment.