From d4625ccc9074637a1da7965d03c83e928d1ec4d7 Mon Sep 17 00:00:00 2001 From: David O'Toole Date: Thu, 17 Dec 2009 03:38:21 -0500 Subject: [PATCH] bugfixes --- forest/enemy.lisp | 1 + forest/forest.lisp | 6 +++--- forest/forest.org | 8 +++----- forest/forest.org_archive | 39 +++++++++++++++++++++++++++++++++++++++ forest/monastery.lisp | 28 +++++++++++++++++++++++----- forest/mountain.lisp | 4 ++-- narration.lisp | 21 +++++++++++++++++++-- widgets.lisp | 5 +++-- 8 files changed, 93 insertions(+), 19 deletions(-) create mode 100644 forest/forest.org_archive diff --git a/forest/enemy.lisp b/forest/enemy.lisp index f72b1b8..b145653 100644 --- a/forest/enemy.lisp +++ b/forest/enemy.lisp @@ -274,6 +274,7 @@ (if [adjacent-to-player world row column] (progn (percent-of-time 80 + [say self "The undead wolf bites you."] [say self "The undead wolf bites you."] [damage [get-player *world*] 4]) (setf 6 diff --git a/forest/forest.lisp b/forest/forest.lisp index 6bc2118..e7d5145 100644 --- a/forest/forest.lisp +++ b/forest/forest.lisp @@ -396,9 +396,9 @@ [set-location cell i j]))))))))) (define-method drop-ruin forest (row column height width) - ;; prevent blocking exit - (setf row (min (- row (* height 2)))) - (setf column (min (- column (* width 2)))) + ;; adjust to prevent blocking exit and blocking player at start + (setf row (max 3 (min (- row (* height 2))))) + (setf column (max 3 (min (- column (* width 2))))) (let (rectangle openings) (labels ((collect-point (&rest args) (prog1 nil (push args rectangle))) diff --git a/forest/forest.org b/forest/forest.org index 23b3d8a..a92f267 100644 --- a/forest/forest.org +++ b/forest/forest.org @@ -1,11 +1,8 @@ -** TODO [#A] using Map points player toward more obvious destination -** TODO [#A] place player in clearing so as to avoid trapping him -** TODO [#A] don't place monastery-gateway on mountain tile +** TODO Change river gatewayt tile! ** TODO [#A] don't spawn player on tree -** TODO [#A] stop spamming with multiple narrator messages (2x) ** TODO [#A] FIX numlock being on breaks shift keybinding ** TODO [#A] treasure on enemies (gold) -** TODO [#A] can't quit on final screen +** TODO [#B] record churchbell, flute, guitar ** TODO [#A] fix bubbles to stay onscreen, Lothaine etc ** TODO [#A] forest exits should be able to be in any column ** TODO [#A] lich incantation distance attackk? @@ -14,6 +11,7 @@ ** TODO [#A] you hear rushing water to the east, fix not being able to find exits. ** TODO [#B] alpha transparency ** TODO [#B] don't have enemies attack when you dead +** TODO [#C] add emote code to XE2 and cells ** TODO [#B] find in-game notes with same color scheme text as scroll ** TODO [#B] ghouls that pop out of the ground ** TODO [#B] magic missile (sparkly trails.) diff --git a/forest/forest.org_archive b/forest/forest.org_archive new file mode 100644 index 0000000..92f0bd3 --- /dev/null +++ b/forest/forest.org_archive @@ -0,0 +1,39 @@ + +Archived entries from file /home/dto/xe2/forest/forest.org +* DONE [#A] using Map points player toward more obvious destination +CLOSED: [2009-12-17 Thu 02:11] +:PROPERTIES: +:ARCHIVE_TIME: 2009-12-17 Thu 03:36 +:ARCHIVE_FILE: ~/xe2/forest/forest.org +:ARCHIVE_CATEGORY: forest +:ARCHIVE_TODO: DONE +:END: +* DONE [#A] don't place monastery-gateway on mountain tile +CLOSED: [2009-12-17 Thu 02:24] +:PROPERTIES: +:ARCHIVE_TIME: 2009-12-17 Thu 03:36 +:ARCHIVE_FILE: ~/xe2/forest/forest.org +:ARCHIVE_CATEGORY: forest +:ARCHIVE_TODO: DONE +:END: +* DONE [#A] stop spamming with multiple narrator messages (2x) +CLOSED: [2009-12-17 Thu 03:36] +:PROPERTIES: +:ARCHIVE_TIME: 2009-12-17 Thu 03:37 +:ARCHIVE_FILE: ~/xe2/forest/forest.org +:ARCHIVE_CATEGORY: forest +:ARCHIVE_TODO: DONE +:END: +* DONE [#A] fix can't quit on final screen +CLOSED: [2009-12-17 Thu 02:24] +:PROPERTIES: +:ARCHIVE_TIME: 2009-12-17 Thu 03:37 +:ARCHIVE_FILE: ~/xe2/forest/forest.org +:ARCHIVE_CATEGORY: forest +:ARCHIVE_TODO: DONE +:END: + + + + + diff --git a/forest/monastery.lisp b/forest/monastery.lisp index f65b626..8a62f4d 100644 --- a/forest/monastery.lisp +++ b/forest/monastery.lisp @@ -48,9 +48,13 @@ (running :initform t) (timeout :initform 40)) -(define-method emote lothaine (text &optional (timeout 3.0)) - (let ((balloon (clone =balloon= :text text :timeout timeout))) +(define-method emote lothaine (text &key (timeout 20) (background-color ".blue")) + (let ((balloon (clone =balloon= :text text :timeout timeout :background-color background-color)) + (other-balloon [category-at-p *world* :balloon])) + (when other-balloon + [die other-balloon]) [play-sample self "talk"] + [follow balloon self] [drop self balloon])) (define-method run lothaine () @@ -60,7 +64,7 @@ (labels ((act () (case state (0 (when (< [distance-to-player self] 15) - [emote self *greeting-text* 1.0] + [emote self *greeting-text* :timeout 1.0] (incf state) (setf timeout 20))) (1 [emote self *beckon-text*] @@ -231,6 +235,14 @@ south. You can hear the monks singing in the distance.") (tile :initform "bed") (categories :initform '(:obstacle))) +(define-prototype letter-prompt (:parent xe2:=prompt=) + (default-keybindings :initform '(("Q" (:control) "quit .")))) + +(define-prototype letter-textbox (:parent xe2:=textbox=)) + +(define-method quit letter-textbox () + (xe2:quit :shutdown)) + (defcell letter (tile :initform "letter") (categories :initform '(:item))) @@ -242,12 +254,18 @@ south. You can hear the monks singing in the distance.") [take stepper :direction :here :category :item])) (define-method use letter (user) - (let ((box (clone =textbox=))) + (let ((box (clone =letter-textbox=)) + (prompt (clone =letter-prompt=))) + [resize prompt :height 20 :width 100] + [move prompt :x 0 :y 0] + [hide prompt] + [install-keybindings prompt] [resize-to-scroll box :height 540 :width 800] [move box :x 0 :y 0] + [set-receiver prompt box] (let ((text (find-resource-object "letter-text"))) [set-buffer box text]) - (install-widgets box))) + (install-widgets prompt box))) (define-prototype quarters (:parent xe2:=world=) (height :initform 9) diff --git a/forest/mountain.lisp b/forest/mountain.lisp index b7a90c7..fda2de2 100644 --- a/forest/mountain.lisp +++ b/forest/mountain.lisp @@ -35,9 +35,9 @@ (percent-of-time 10 [drop-cell self (clone =wolf=) i (+ offset (random 4))]) (trace-row #'drop-mountain i (+ offset (random 4) 20) ))) ;; drop monastery gateway - (let ((column (+ offset (random 10))) + (let ((column (+ 1 offset (random 10))) (row (- 2))) - [drop-cell self (clone =monastery-gateway=) row column]))) + [replace-cells-at self row column (clone =monastery-gateway=)]))) (define-method drop-trees passage (&optional &key (object =tree=) distance diff --git a/narration.lisp b/narration.lisp index f5c24d8..c56558c 100644 --- a/narration.lisp +++ b/narration.lisp @@ -104,6 +104,7 @@ verbosity level.") "List of action words to use passive voice in narrating. http://en.wikipedia.org/wiki/Passive_voice" :initform nil) + (repeat-count :initform 0) (line-number :initform 0)) (define-method set-verbosity narrator (&optional (value 1)) @@ -118,8 +119,24 @@ http://en.wikipedia.org/wiki/Passive_voice" (apply #'format nil control-string args)]) (define-method say narrator (control-string &rest args) - [println self - (apply #'format nil control-string args)]) + (let* ((last-line (aref (- (fill-pointer ) 1))) + (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 ) + (vector-pop ) + (message "Repeating message ~Sx" ) + [println self (apply #'format nil (concatenate 'string + control-string + (format nil " (Repeated ~Sx)" )) + args)]) + ;; new + (progn + (message "New message ~S" (cons control-string args)) + (setf 0) + [println self (apply #'format nil control-string args)])))) + + (define-method narrate-message narrator (sender action receiver args &optional force) (unless (zerop ) diff --git a/widgets.lisp b/widgets.lisp index 88980a8..d2ab2a1 100644 --- a/widgets.lisp +++ b/widgets.lisp @@ -257,8 +257,9 @@ line." (setf (make-array 10 :adjustable t :fill-pointer 0))) (define-method delete-line formatter (&optional (num-lines 1)) - (dotimes (n num-lines) - (vector-pop ))) + (when (>= (length ) num-lines) + (dotimes (n num-lines) + (vector-pop )))) (define-method delete-all-lines formatter () [delete-line self (fill-pointer )])