more fun animations.

This commit is contained in:
Bryce Covert
2015-08-03 20:05:44 -07:00
parent e47afef20a
commit 32acd489c2
21 changed files with 842 additions and 7 deletions

View File

@@ -30,7 +30,7 @@
"Is there anything here you will sell?"
{:run #(actions/respond entities %
:shopkeep "No."
:shopkeep "But I do have some free magical fire mints that Gandarf brewed up."
:shopkeep "But I do have some free magical lava mints that Gandarf brewed up."
:shopkeep "Careful! They're spicy.")
:choices actions/previous-choices}
"So in order to continue on my quest, I'll need to solve some puzzle here?"
@@ -210,6 +210,12 @@
:x 70
:y 86
:baseline 120)
:smoke-particle (doto (assoc (particle-effect "inside-antique/smoke-particle") :x 162 :y 108
:baseline 240)
(particle-effect! :set-position 162 108))
:fire-particle (doto (assoc (particle-effect "inside-antique/fire-particle") :x 162 :y 108
:baseline 240)
(particle-effect! :set-position 162 108))
:bowl (assoc (texture "inside-antique/bowl.png")
:x 165
:y 110
@@ -217,19 +223,32 @@
:script (actions/get-script entities
(if (= 3 (get-in @entities [:state :mints-eaten]))
(do (actions/walk-to entities :ego [159 62] :face :right)
(actions/update-state entities (fn [s] (assoc s :mints-eaten 0)))
(actions/do-dialogue entities
:ego "She's all out."
:ego "Maybe Gandarf can brew her up another batch."))
:shopkeep "That's right I'm all out."
:shopkeep "Go tell Gandarf that I need some more brewed up."
:shopkeep "Pronto!"))
(do (actions/walk-to entities :ego [159 62] :face :right)
(actions/talk entities :ego "I'll just try one of these mints.")
(actions/play-animation entities :ego :reach)
(actions/update-state entities (fn [s] (assoc s :mints-eaten (inc (s :mints-eaten)))))
(sound! (sound (str "inside-antique/fire-" (get-in @entities [:state :mints-eaten]) ".ogg")) :play (utils/current-sound-volume))
(cond
(= 2 (get-in @entities [:state :mints-eaten]))
(do (particle-effect! (get-in @entities [:room :entities :smoke-particle]) :reset)
(particle-effect! (get-in @entities [:room :entities :smoke-particle]) :start))
(= 3 (get-in @entities [:state :mints-eaten]))
(do (particle-effect! (get-in @entities [:room :entities :fire-particle]) :reset)
(particle-effect! (get-in @entities [:room :entities :fire-particle]) :start)))
(actions/play-animation entities :ego [:fire (get-in @entities [:state :mints-eaten])])
(actions/talk entities :ego "WOWZA! Those are hot.")
(when (= 3 (get-in @entities [:state :mints-eaten]))
(actions/talk entities :shopkeep "You brat! You ate the last mint.")
(actions/talk entities :shopkeep "Since you ate the last one, you have to go tell Gandarf to bring me some more."))))))
(actions/do-dialogue entities :shopkeep "Oh drat! You ate the last mint."
:shopkeep "It seems like I'm always running out."
:shopkeep "Now be a good lad and tell Gandarf that I need some more brewed up."
:shopkeep "Pronto!"))))))
:teddy teddy}
:collision "inside-antique/collision.png"
:apply-state (fn [_ entities]