Flexibly edit entity data in dialogue

… including way better ^_^ dialogue :D
face! \o/ editing!
This commit is contained in:
Jaidyn Ann 2023-06-24 19:49:18 -05:00
parent 1a44f2bcac
commit 90223f4a4c
2 changed files with 58 additions and 29 deletions

View File

@ -52,9 +52,21 @@ If not, have some tea on me: Im paying. =w="
dialogue-tree))
(defun face (speaker face)
(defun face (speaker face &optional (talking-face nil))
(if talking-face
(list
(list :speaker speaker :face face)))
(list :speaker speaker
:face face
:set :normal-face
:to face)
(list :speaker speaker
:set :talking-face
:to talking-face))
(list
(list :speaker speaker
:face face
:set :normal-face
:to face))))
(defun say (speaker &rest keys)
@ -62,7 +74,7 @@ If not, have some tea on me: Im paying. =w="
(list :speaker speaker :progress 0
:face (or (getf keys :face) 'talking-face)
:text (:getf-lang keys))
(car (face speaker 'normal-face))))
(list :speaker speaker :face 'normal-face)))
(defun mumble (speaker &rest keys)
@ -119,6 +131,18 @@ talking-face or the face given by the DIALOGUE."
(setf (🌍:getf-entity-data map speaker :face) new-face))))
(defun update-entity-data (map dialogue)
"Given a plist of DIALOGUE, update an arbitrary bit of data in the speaker's
data, using :SET and :TO of the DIALOGUE."
(let* ((speaker (intern (string-upcase (getf dialogue :speaker))))
(key (getf dialogue :set))
(data (getf dialogue :to)))
(when (and key data)
(format *error-output* "[~A] ~A → ~A???~%" dialogue key data)
(setf (🌍:getf-entity-data map speaker key) data)
(format *error-output* "~A!!!!~%" (🌍:getf-entity-data map speaker :normal-face)))))
(defun progress-line-delivery (dialogue)
"Progress the delivery of a line (plist) of DIALOGUE. That is, increment the
said character-count :PROGRESS, which dictates the portion of the message that
@ -162,6 +186,7 @@ coordinates listed in the DIALOGUEs :COORDS property. … If applicable, ofc.
Progress through the lines of dialogue when the user hits ENTER, etc.
Returns the state for use with STATE-LOOP, pay attention!"
(update-speaking-face map (car dialogue-list))
(update-entity-data map (car dialogue-list))
(progress-line-delivery (car dialogue-list))
;; Progress to the next line of dialogue as appropriate.
(let* ((dialogue (car dialogue-list))

View File

@ -63,31 +63,30 @@
(💬:mumble sasha :en "...")
(💬:say "player" :eo "Kielas apud la mar'?"
:en "How's the view?")
(💬:face "player" "<.<")
(💬:face "player" "<.<" "<o<")
(💬:say sasha :eo "Kielas apud la ruinoj de via viv'?"
:en "How's your trainwreck of a life?")
(💬:face "player" '💬:normal-face)))
:en "How's your trainwreck of a life?")))
(1
(start-dialogue
(mumble "player" :en "...")
(face "player" "<w<")
(say sasha :eo "Kial vi restas? Ĉu tiom solecas ke nur ideas ĝeni min?"
:en "Why are you still here? Are you so lonely you've only got me to bother?")
(face "player" ":w:" ":u:")
(mumble "player" :eo "(Ŝi parolas pri si mem, ĉu ne?)"
:en "(She's projecting, isn't she?)"
:face ":w:")))
:en "(She's projecting, isn't she?)")))
(2
(start-dialogue
(face "player" ":w:" ":o:")
(say "player" :eo "Nu... Vi staris tie ĉi senmove dum la pastintaj tri tagoj..."
:en "So... You've stood around here for three days already, you've hardly moved..."
:face ":o:")
(face "player" ":w:")
:en "So... You've stood around here for three days already, you've hardly moved...")
(say sasha :eo "Pŝ! Do?! Mi simple havas multajn pripensindaĵojn! Mi tiom multe okupiĝas!"
:en "Pff! So what?! My mind's just busy! I've got a lot going on right now!"
:face "vov")
(say sasha :eo "Ne ŝajnigu vin supera al mi, dum vi mem senespere sencelas!!"
:en "Don't act all haughty when you're such an aimless loser yourself!!"
:face ">o<")
(face "player" "=w=" "=u=")
(mumble "player" :eo "Eee.. pardonu."
:en "Well... sorry.")))
(3
@ -146,7 +145,7 @@
(:eo "Lasu panjon instrui vin *hik* boooone"
:en "Let momma show you a good *hic* timeee")
(:eo "kaj mi diris RIKAŜIKA! DIN-DON!"
:en "and then I said BAZINGA! CA-CHOW!"))))
:en "and I said BAZINGA! CA-CHOW!"))))
(start-dialogue
(apply #'say (append '("boozy-lady")
(nth (random (length messages)) messages))))))
@ -185,16 +184,18 @@
:face "xDD")
(say gambler :en "Hahahaha! Hahahahaha!"
:face "x'D")
(face gambler ">V<")
(face 'player "^^'")
(face gambler ">V<" ">O<")
(say gambler :eo "Tiom amuze! Bona ŝerco!"
:en "Shit that's funny!"
:face ">V<")
(face 'player "^^\"")
(say gambler :eo "Mi tute ruinigis mian vivon! MDR!"
:en "I totally fucked my life! LMAO!"
:face ">V<")
(say gambler :en "HAHAHAHAHAHAHAHAHAHAAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAAHAHAHAHAHAHAHAHAHAHAHAHA"
:face ">O<")
(face gambler "=w=")
(face 'player "o-o" "ouo")
(say gambler :en "HAHAHAHAHAHAHAHAHAHAAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAAHAHAHAHAHAHAHAHAHAHAHAHA")
(face gambler "=w=" "=w=")
(mumble gambler :en "...")
(mumble gambler :eo "Fek'."
:en "Fuck.")))
@ -217,7 +218,8 @@
(say gambler :eo "... danke al kiu mia filino povas edukiĝi bone."
:en "... thanks to which my daughter can receive a good education.")
(say gambler :eo "Kial mi vetis la monprunton tie ĉi?! Fek!!"
:en "Why'd I bet the payment here?! FUCK!!")))
:en "Why'd I bet the payment here?! FUCK!!"
:face ">O<")))
(2
(start-dialogue
(say gambler :eo "Nu, ĉio enordas! Ni simple perdos la domon, jen ĉio."
@ -234,12 +236,14 @@
:en "No life!")))
(3
(start-dialogue
(say gambler :eo "Mi cedu al la mallumo! Tro malfruas al mi!"
:en "I'm giving into the void! It's too late for me!")
(say gambler :eo "Mi memmortigu, ĉu ne, kara amiko? Ĉu neeee?"
(say gambler :eo "Mi cedu al la vakuo. Tre komfortas ĉe la fundo, kamarado."
:en "I'm giving into the void. It's quite peaceful down here, pal.")
(say gambler :eo "Mi lasu min falu entute, ĉu ne, kara amiko? Ĉu neee?"
:en "I should let go, right, pal? Righttt?")
(say 'player :eo "Ja ne! Je la dioj! Sinjoro, restas al vi fuĝvojo, sendube!"
:en "Of course not! Jesus! Guy, there's still hope for you, somewhere!")
(face 'player ";w;" ";o;")
(say 'player :eo "Ne tro senesperu -- sinjoro, restas al vi fuĝvojo, sendube!"
:en "Guy, there's still hope for you, somewhere!")
(face gambler "=v=" "=v=")
(say gambler :eo "Mi ideas IAN fuĝvojon..."
:en "Five feet under, maybe..."))))))