Fix mis-uses of the 'player symbol
This commit is contained in:
parent
06e875b271
commit
b38d4ca436
|
@ -13,9 +13,12 @@
|
||||||
;;;; You should have received a copy of the GNU General Public License
|
;;;; You should have received a copy of the GNU General Public License
|
||||||
;;;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
;;;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
;;;; FLORA-SEARCH-AURORA.OVERWORLD
|
;;;; FLORA-SEARCH-AURORA.DIALOGUE
|
||||||
;;;; All game-functions and data relating to the “overworld” (that is,
|
;;;; The dialogue-scripting part of the game. This handles all dialogue!
|
||||||
;;;; the primary gameplay, the RPG-ish-ish bits).
|
|
||||||
|
(defpackage :flora-search-aurora
|
||||||
|
(:nicknames :fsa :✿)
|
||||||
|
(:export :player))
|
||||||
|
|
||||||
(defpackage :flora-search-aurora.dialogue
|
(defpackage :flora-search-aurora.dialogue
|
||||||
(:nicknames :fsa.dia :dialogue :💬)
|
(:nicknames :fsa.dia :dialogue :💬)
|
||||||
|
@ -298,7 +301,7 @@ The data returned is a list of the box’es top-left coordinate, max-column,
|
||||||
and max-row; for use with RENDER-STRING. Like so:
|
and max-row; for use with RENDER-STRING. Like so:
|
||||||
((:x X :y Y) MAX-COLUMN MAX-ROW)"
|
((:x X :y Y) MAX-COLUMN MAX-ROW)"
|
||||||
(let* ((speaker-id (dialogue-speaker dialogue))
|
(let* ((speaker-id (dialogue-speaker dialogue))
|
||||||
(playerp (eq speaker-id 'player))
|
(playerp (eq speaker-id '✿:player))
|
||||||
(leftp (not (🌍:getf-entity-data map speaker-id :facing-right)))
|
(leftp (not (🌍:getf-entity-data map speaker-id :facing-right)))
|
||||||
(text (getf dialogue :text))
|
(text (getf dialogue :text))
|
||||||
(coords (🌍:world-coords->screen-coords (🌍:getf-entity-data map speaker-id :coords))))
|
(coords (🌍:world-coords->screen-coords (🌍:getf-entity-data map speaker-id :coords))))
|
||||||
|
|
|
@ -17,6 +17,11 @@
|
||||||
;;;; All game-functions and data relating to the “overworld” (that is,
|
;;;; All game-functions and data relating to the “overworld” (that is,
|
||||||
;;;; the primary gameplay, the RPG-ish-ish bits).
|
;;;; the primary gameplay, the RPG-ish-ish bits).
|
||||||
|
|
||||||
|
(defpackage :flora-search-aurora
|
||||||
|
(:nicknames :fsa :✿)
|
||||||
|
(:export :player))
|
||||||
|
|
||||||
|
|
||||||
(defpackage :flora-search-aurora.overworld
|
(defpackage :flora-search-aurora.overworld
|
||||||
(:nicknames :fsa.o :overworld :🌍)
|
(:nicknames :fsa.o :overworld :🌍)
|
||||||
(:use :cl
|
(:use :cl
|
||||||
|
@ -28,8 +33,8 @@
|
||||||
#:aget-item #:getf-act #:getf-know
|
#:aget-item #:getf-act #:getf-know
|
||||||
#:move-entity-to #:move-entity
|
#:move-entity-to #:move-entity
|
||||||
#:plist->map
|
#:plist->map
|
||||||
:left :right
|
:left :right))
|
||||||
:player))
|
|
||||||
|
|
||||||
(in-package :flora-search-aurora.overworld)
|
(in-package :flora-search-aurora.overworld)
|
||||||
|
|
||||||
|
@ -168,8 +173,8 @@ Used primarily in moving between different maps in an overworld state."
|
||||||
;; Copy specific bits of player data from map-a’s :ENTITIES.
|
;; Copy specific bits of player data from map-a’s :ENTITIES.
|
||||||
(mapcar
|
(mapcar
|
||||||
(lambda (player-key)
|
(lambda (player-key)
|
||||||
(setf (getf-entity-data map-b 'player player-key)
|
(setf (getf-entity-data map-b '✿:player player-key)
|
||||||
(getf-entity-data map-a 'player player-key)))
|
(getf-entity-data map-a '✿:player player-key)))
|
||||||
'(:face :normal-face :talking-face))
|
'(:face :normal-face :talking-face))
|
||||||
map-b)
|
map-b)
|
||||||
|
|
||||||
|
@ -217,7 +222,7 @@ Returns parameters to be used in the next invocation of OVERWORLD-STATE."
|
||||||
(case (getf input :semantic)
|
(case (getf input :semantic)
|
||||||
;; Interacting with nearby characters/entities
|
;; Interacting with nearby characters/entities
|
||||||
('⌨:🆗
|
('⌨:🆗
|
||||||
(let* ((player (getf-entity map 'player))
|
(let* ((player (getf-entity map '✿:player))
|
||||||
(interactee (car (entities-near-entity player (gethash :entities map))))
|
(interactee (car (entities-near-entity player (gethash :entities map))))
|
||||||
(interactee-id (car interactee))
|
(interactee-id (car interactee))
|
||||||
(interaction (getf (cdr interactee) :interact)))
|
(interaction (getf (cdr interactee) :interact)))
|
||||||
|
@ -241,8 +246,8 @@ Returns parameters to be used in the next invocation of OVERWORLD-STATE."
|
||||||
|
|
||||||
|
|
||||||
(defun move-player (map &key (Δx 0) (Δy 0))
|
(defun move-player (map &key (Δx 0) (Δy 0))
|
||||||
(move-entity map 'player :Δx Δx :Δy Δy)
|
(move-entity map '✿:player :Δx Δx :Δy Δy)
|
||||||
(let* ((coords (getf-entity-data map 'player :coords))
|
(let* ((coords (getf-entity-data map '✿:player :coords))
|
||||||
(trigger (trigger-at-coords map (list :x (getf coords :x) :y (getf coords :y)))))
|
(trigger (trigger-at-coords map (list :x (getf coords :x) :y (getf coords :y)))))
|
||||||
(if (and trigger (getf trigger :function))
|
(if (and trigger (getf trigger :function))
|
||||||
(apply (string->symbol (getf trigger :function))
|
(apply (string->symbol (getf trigger :function))
|
||||||
|
@ -288,7 +293,7 @@ Returns parameters to be used in the next invocation of OVERWORLD-STATE."
|
||||||
(defun overworld-state-draw (matrix map)
|
(defun overworld-state-draw (matrix map)
|
||||||
"Draw the overworld map to the given matrix.
|
"Draw the overworld map to the given matrix.
|
||||||
A core part of OVERWORLD-STATE."
|
A core part of OVERWORLD-STATE."
|
||||||
(let* ((chunk (world-coords-chunk (getf-entity-data map 'player :coords))))
|
(let* ((chunk (world-coords-chunk (getf-entity-data map '✿:player :coords))))
|
||||||
(matrix-write-tiles matrix (gethash :tiles map) chunk)
|
(matrix-write-tiles matrix (gethash :tiles map) chunk)
|
||||||
(matrix-write-entities matrix map chunk)
|
(matrix-write-entities matrix map chunk)
|
||||||
(when (gethash :seconds map)
|
(when (gethash :seconds map)
|
||||||
|
|
Ŝarĝante…
Reference in New Issue