diff --git a/desktop/gametodos.txt b/desktop/gametodos.txt index f96a2fea..10333c9c 100644 --- a/desktop/gametodos.txt +++ b/desktop/gametodos.txt @@ -1,23 +1,14 @@ ART -+ shitty plates and knights + Update all collisions -+ can walk to top corner in house screen -+ mark the squeaky board a bit -+ outside castle trees need to be updated -+ gate z-index PROGRAMMING + fight with blergh at end isn't great + blergh taunts for first fight + ending - + you can drink the strength potion while in blood clots hand + proper save/settings file location + Save slots? + descriptions for all items when used on self. + try to have dialogue for every wrong interaction -+ Have to open curtains -+ grime on portrait -+ impersonate bubba dialogue tree + Dialogue frozen AUDIO diff --git a/desktop/resources/castle-gate/overlay.png b/desktop/resources/castle-gate/overlay.png new file mode 100644 index 00000000..640d701a Binary files /dev/null and b/desktop/resources/castle-gate/overlay.png differ diff --git a/desktop/resources/inside-antique/background.psd b/desktop/resources/inside-antique/background.psd index a2716910..0abcaeb1 100644 Binary files a/desktop/resources/inside-antique/background.psd and b/desktop/resources/inside-antique/background.psd differ diff --git a/desktop/resources/inside-antique/closed-blinds.png b/desktop/resources/inside-antique/closed-blinds.png new file mode 100644 index 00000000..af5405c7 Binary files /dev/null and b/desktop/resources/inside-antique/closed-blinds.png differ diff --git a/desktop/resources/inside-antique/darken.png b/desktop/resources/inside-antique/darken.png new file mode 100644 index 00000000..69f6f01e Binary files /dev/null and b/desktop/resources/inside-antique/darken.png differ diff --git a/desktop/resources/inside-antique/desk.png b/desktop/resources/inside-antique/desk.png index fd012de8..431bab29 100644 Binary files a/desktop/resources/inside-antique/desk.png and b/desktop/resources/inside-antique/desk.png differ diff --git a/desktop/resources/inside-antique/open-blinds.png b/desktop/resources/inside-antique/open-blinds.png new file mode 100644 index 00000000..907b6e3c Binary files /dev/null and b/desktop/resources/inside-antique/open-blinds.png differ diff --git a/desktop/resources/inside-cafeteria/background.png b/desktop/resources/inside-cafeteria/background.png index 5ca1ed6d..f9fe89bf 100644 Binary files a/desktop/resources/inside-cafeteria/background.png and b/desktop/resources/inside-cafeteria/background.png differ diff --git a/desktop/resources/inside-cafeteria/background.psd b/desktop/resources/inside-cafeteria/background.psd index 6b536220..ae3c43de 100644 Binary files a/desktop/resources/inside-cafeteria/background.psd and b/desktop/resources/inside-cafeteria/background.psd differ diff --git a/desktop/resources/inside-cafeteria/knight-a.png b/desktop/resources/inside-cafeteria/knight-a.png new file mode 100644 index 00000000..0e09d8d0 Binary files /dev/null and b/desktop/resources/inside-cafeteria/knight-a.png differ diff --git a/desktop/resources/inside-cafeteria/knighta.pxa/0.pxi b/desktop/resources/inside-cafeteria/knighta.pxa/0.pxi new file mode 100644 index 00000000..61d6e1d3 Binary files /dev/null and b/desktop/resources/inside-cafeteria/knighta.pxa/0.pxi differ diff --git a/desktop/resources/inside-cafeteria/knighta.pxa/1.pxi b/desktop/resources/inside-cafeteria/knighta.pxa/1.pxi new file mode 100644 index 00000000..22b50f78 Binary files /dev/null and b/desktop/resources/inside-cafeteria/knighta.pxa/1.pxi differ diff --git a/desktop/resources/inside-cafeteria/knighta.pxa/2.pxi b/desktop/resources/inside-cafeteria/knighta.pxa/2.pxi new file mode 100644 index 00000000..99070369 Binary files /dev/null and b/desktop/resources/inside-cafeteria/knighta.pxa/2.pxi differ diff --git a/desktop/resources/inside-cafeteria/knighta.pxa/3.pxi b/desktop/resources/inside-cafeteria/knighta.pxa/3.pxi new file mode 100644 index 00000000..6b247118 Binary files /dev/null and b/desktop/resources/inside-cafeteria/knighta.pxa/3.pxi differ diff --git a/desktop/resources/inside-cafeteria/knighta.pxa/4.pxi b/desktop/resources/inside-cafeteria/knighta.pxa/4.pxi new file mode 100644 index 00000000..48cea3b2 Binary files /dev/null and b/desktop/resources/inside-cafeteria/knighta.pxa/4.pxi differ diff --git a/desktop/resources/inside-cafeteria/knighta.pxa/5.pxi b/desktop/resources/inside-cafeteria/knighta.pxa/5.pxi new file mode 100644 index 00000000..f88405e3 Binary files /dev/null and b/desktop/resources/inside-cafeteria/knighta.pxa/5.pxi differ diff --git a/desktop/resources/inside-cafeteria/knighta.pxa/6.pxi b/desktop/resources/inside-cafeteria/knighta.pxa/6.pxi new file mode 100644 index 00000000..48a8090a Binary files /dev/null and b/desktop/resources/inside-cafeteria/knighta.pxa/6.pxi differ diff --git a/desktop/resources/inside-cafeteria/knighta.pxa/7.pxi b/desktop/resources/inside-cafeteria/knighta.pxa/7.pxi new file mode 100644 index 00000000..0d7e08e0 Binary files /dev/null and b/desktop/resources/inside-cafeteria/knighta.pxa/7.pxi differ diff --git a/desktop/resources/inside-cafeteria/knighta.pxa/8.pxi b/desktop/resources/inside-cafeteria/knighta.pxa/8.pxi new file mode 100644 index 00000000..a64d2e13 Binary files /dev/null and b/desktop/resources/inside-cafeteria/knighta.pxa/8.pxi differ diff --git a/desktop/resources/inside-cafeteria/knighta.pxa/9.pxi b/desktop/resources/inside-cafeteria/knighta.pxa/9.pxi new file mode 100644 index 00000000..1c2249d8 Binary files /dev/null and b/desktop/resources/inside-cafeteria/knighta.pxa/9.pxi differ diff --git a/desktop/resources/inside-cafeteria/knighta.pxa/CelData.plist b/desktop/resources/inside-cafeteria/knighta.pxa/CelData.plist new file mode 100644 index 00000000..222d28b8 --- /dev/null +++ b/desktop/resources/inside-cafeteria/knighta.pxa/CelData.plist @@ -0,0 +1,46 @@ + + + + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + diff --git a/desktop/resources/inside-cafeteria/knights-stand.png b/desktop/resources/inside-cafeteria/knights-stand.png index 5685c1b6..1d4f66e7 100644 Binary files a/desktop/resources/inside-cafeteria/knights-stand.png and b/desktop/resources/inside-cafeteria/knights-stand.png differ diff --git a/desktop/resources/inside-jail/background.png b/desktop/resources/inside-jail/background.png index 5c7e712a..b72d2536 100644 Binary files a/desktop/resources/inside-jail/background.png and b/desktop/resources/inside-jail/background.png differ diff --git a/desktop/resources/outside-castle/background.png b/desktop/resources/outside-castle/background.png index 507e328c..91ec0973 100644 Binary files a/desktop/resources/outside-castle/background.png and b/desktop/resources/outside-castle/background.png differ diff --git a/desktop/resources/outside-castle/background.psd b/desktop/resources/outside-castle/background.psd index 21e0d17f..7809f2f5 100644 Binary files a/desktop/resources/outside-castle/background.psd and b/desktop/resources/outside-castle/background.psd differ diff --git a/desktop/resources/outsidehouse/collision.png b/desktop/resources/outsidehouse/collision.png index bddba6ab..0a8b943b 100644 Binary files a/desktop/resources/outsidehouse/collision.png and b/desktop/resources/outsidehouse/collision.png differ diff --git a/desktop/resources/space/later.png b/desktop/resources/space/later.png index 3c501c06..c8aec133 100644 Binary files a/desktop/resources/space/later.png and b/desktop/resources/space/later.png differ diff --git a/desktop/resources/the-end.png b/desktop/resources/the-end.png index 0c749fe2..d82b2330 100644 Binary files a/desktop/resources/the-end.png and b/desktop/resources/the-end.png differ diff --git a/desktop/settings.edn b/desktop/settings.edn index c5d36dd7..e6723941 100644 --- a/desktop/settings.edn +++ b/desktop/settings.edn @@ -1 +1 @@ -{:sound-volume 69.0, :music-volume 86.0} \ No newline at end of file +{:sound-volume 67.0, :music-volume 86.0} \ No newline at end of file diff --git a/desktop/src-common/advent/screens/rooms/castle_gate.clj b/desktop/src-common/advent/screens/rooms/castle_gate.clj index e9434d8f..a5d970ee 100644 --- a/desktop/src-common/advent/screens/rooms/castle_gate.clj +++ b/desktop/src-common/advent/screens/rooms/castle_gate.clj @@ -74,10 +74,10 @@ :frankie "What?!" :frankie "Impossible!") (actions/play-animation entities :frankie :laugh) + (actions/update-state entities (fn [s] (assoc s :bubba-gone? true))) (actions/do-dialogue entities :frankie "Bubba, go check to make sure our stuff is safe." :goon-2 "You got it boss.") - (actions/walk-straight-to entities :goon-2 [0 100]) - (actions/update-state entities (fn [s] (assoc s :bubba-gone? true))))} + (actions/walk-straight-to entities :goon-2 [0 100]))} "Nevermind." {:run #(actions/respond entities % :frankie "Come back when you've got some good valuables.")}]})) @@ -102,7 +102,7 @@ :night-profile :sprite :scale-x 1.4 :scale-y 1.4 - :talk-color (color 0.6 0.2 0.6 1.0) + :talk-color common/frankie-color :talk talk :flex flex :stand stand @@ -202,7 +202,7 @@ (actions/talk entities :goon-2 "You made me lose my coin, Dipstick!" :anim :search) (actions/talk entities :ego "Umm, sorry!")) (do - (actions/do-dialogue entities :ego "Hey Bubba!" + (actions/do-dialogue entities :ego "Hi Bubba." :goon-2 "Beat it, Dipstick.")))) :scripts {:money (actions/get-script entities (actions/do-dialogue entities :ego "I don't want to give it back!")) @@ -215,12 +215,16 @@ (defn attempt-walking-through-gate [entities] (actions/walk-to entities :ego [157 83] :skip-type :end) + (actions/walk-straight-to entities :ego [100 83]) (actions/transition-background entities :inside-castle [280 145]) (actions/walk-to entities :ego [245 90] :skip-type :end)) (defn flip-coin [screen entities] (if (and (= 0 (rand-int 2)) - (not (get-in entities [:state :has-dropped-coin?]))) + (not (get-in entities [:state :has-dropped-coin?])) + (not (get-in entities [:state :bubba-gone?])) + (= (get-in entities [:room :entities :goon-2 :anim]) + (get-in entities [:room :entities :goon-2 :stand]))) (-> entities (update-in [:room :entities :coin-flip] (fn [cf] (-> (actions/start-animation screen cf :coinflip) (assoc :opacity 1.0)))) @@ -251,8 +255,6 @@ :script (actions/get-script entities (attempt-walking-through-gate entities)) :cursor :left} - :big-tree {:box [20 10 82 235] - :scripts {:walkie-talkies (actions/get-script entities (drop-walkie-talkie entities))}} :window {:box [192 157 215 215] :script (actions/get-script entities (actions/talk entities :ego "That's a big window!")) @@ -269,8 +271,10 @@ (Thread/sleep 2000) (actions/walk-straight-to entities :ego [285 71]))}}} - :layers {:day [(assoc (texture "castle-gate/background.png") :x 0 :y 0 :baseline 0)] - :night [(assoc (texture "castle-gate/background.png") :x 0 :y 0 :baseline 0)]} + :layers {:day [(assoc (texture "castle-gate/background.png") :x 0 :y 0 :baseline 0) + (assoc (texture "castle-gate/overlay.png") :x 0 :y 0 :baseline 240)] + :night [(assoc (texture "castle-gate/background.png") :x 0 :y 0 :baseline 0) + (assoc (texture "castle-gate/overlay.png") :x 0 :y 0 :baseline 240)]} :entities {:frankie (make-frankie screen) :goon-1 (make-goon-1 screen) :goon-2 (make-goon-2 screen) diff --git a/desktop/src-common/advent/screens/rooms/common.clj b/desktop/src-common/advent/screens/rooms/common.clj index 2f00cb48..f0b0c891 100644 --- a/desktop/src-common/advent/screens/rooms/common.clj +++ b/desktop/src-common/advent/screens/rooms/common.clj @@ -11,7 +11,8 @@ [play-clj.ui :refer :all] [play-clj.utils :refer :all] [play-clj.math :refer :all] - [play-clj.g2d :refer :all])) + [play-clj.g2d :refer :all]) + (:import [com.badlogic.gdx.graphics Color])) (defn go-to-jail [entities] @@ -86,16 +87,18 @@ :ego "'Also, you'll need to add a split second.'" :ego "'Then, dip the Slinger's Shot in to complete the spell.'" :ego "'Don't forget about my secret stash of helpful stuff.'")) +(def frankie-color (Color/valueOf "9907CFFF")) (defn listen-to-frankie [entities] (let [respond (fn [msg] - (actions/talk entities :ego msg :animate? false :stop? false :color (color 0.6 0.2 0.6 1.0)) + (actions/talk entities :ego msg :animate? false :stop? false :color frankie-color) (Thread/sleep 200)) talk (fn [msg] (actions/talk entities :ego msg :animate? false :stop? false) (Thread/sleep 200))] (talk "Hello?") - (respond "Who said that?!") + (respond "What the?! A walkie-talkie?") + (respond "Who's there?") (actions/present-choices entities {:choices ["It's me, Tick!" {:run #(do @@ -224,6 +227,7 @@ (-> entities (update-in [:room :entities :bloodclot] #(actions/start-animation screen % :explode)) + (update-in [:room :entities] dissoc :broken-jewel) (update-in [:room :entities] dissoc :bloodclot-head) (assoc-in [:room :entities :ego :facing] :right) (update-in [:room :entities :ego] #(actions/start-animation screen % :crawl)))) @@ -315,113 +319,112 @@ (skip-type [this screen entities] :none))) +(defn do-win [entities] + (actions/do-dialogue entities + :ego "Hey Bloodclot!" + :ego "I have this potion which will make me as strong as you!" + :bloodclot-head "What?!" + :bloodclot-head "Give it here!") + (actions/transition-background entities :space [200 45] :between (fn [s e] + (-> e + (assoc-in [:room :entities :ego :stand-override] :crawl-stand) + (update-in [:room :entities :ego] #(actions/start-animation s % :crawl-stand))) + )) + (actions/do-dialogue entities + :bloodclot-head "Yes!" + :bloodclot-head "Ultimate power is mine!" + :bloodclot-head "If I drink this entire bottle, I'll be as powerful as a god!") + (explode entities) + (actions/play-animation entities :ego :standup) + (actions/walk-straight-to entities :ego [340 55]) + (actions/run-action entities + (begin [this screen entities] + (assoc-in entities [:tweens :later] (tween/tween :later screen [:room :entities :later :opacity] 0.0 1.0 4.0 :ease tween/ease-in-cubic))) + + (continue [this screen entities] + entities) + + (done? [this screen entities] + (not (get-in entities [:tweens :later]))) + + (terminate [this screen entities] + entities) + (skip-type [this screen entities] + :none)) + (Thread/sleep 2000) + (actions/do-stop entities :ego :face :left) + (actions/transition-background entities :ending [165 49] :time 4.0) + (actions/do-dialogue entities + :duke "Ladies and gentlemen." + :duke "As the Duke of Remington, I'm pleased to inform you..." + :duke "The goblin by the name of Bloodclot has been destroyed!" + :duke "Our town is saved." + :duke "Thanks to this young boy, Tick." + :duke "It is my rightful duty as Duke of Remington to knight you." + :duke "You've proven yourself worthy." + :duke "Your sword, please.") + (actions/walk-straight-to entities :ego [150 49]) + (actions/play-animation entities :ego :reach-start :stop? false) + (actions/play-animation entities :duke :reach :stop? false) + (actions/play-animation entities :ego :reach-stop :stop? false) + (actions/talk entities :duke "Kneel." :anim :reach-talk :stop? false) + (actions/play-animation entities :ego :start-squat-2 :stop? false) + (Thread/sleep 1000) + (actions/play-animation entities :duke :knight :stop? false) + (actions/update-entity entities :duke (fn [d] (assoc d :baseline (- 240 48)))) + (actions/play-animation entities :duke :knight :stop? false) + (actions/talk entities :duke "In honor of your bravery..." :anim :reach-talk :stop? false) + (actions/talk entities :duke "I declare you Sir Tick of Remington." :anim :reach-talk) + (actions/play-animation entities :ego :end-squat :stop? true) + (Thread/sleep 500) + (actions/glad entities) + (Thread/sleep 200) + (actions/do-dialogue entities :ego "Wait...") + (Thread/sleep 400) + (actions/do-stop entities :ego :face :right) + (Thread/sleep 400) + (actions/do-stop entities :ego :face :left) + (Thread/sleep 400) + (actions/do-stop entities :ego :face :right) + (Thread/sleep 400) + (actions/do-stop entities :ego :face :left) + (Thread/sleep 400) + (actions/do-dialogue entities :ego "Where's Georgia McGorgeous?") + (actions/walk-straight-to entities :gandarf-cloud [215 100] :update-baseline? false) + (actions/do-dialogue entities :gandarf "Quickly, boy!") + (actions/do-stop entities :ego :face :right) + (actions/do-dialogue entities :ego "Gandarf?" + :gandarf "Yes, it is I!" + :ego "How did you escape?" + :gandarf "No time for that!" + :gandarf "Georgia McGorgeous has been captured!" + :ego "Captured?! By who?" + :gandarf "Bloodclot's second-in-command, Swinebreath." + :gandarf "I'm afraid that I can't save her." + :gandarf "This is a job for a knight." + :gandarf "If you are willing, Tick..." + :duke "That's 'Sir Tick'..." + :gandarf "Quite right, quite right." + :gandarf "If you are willing, Sir Tick..." + :gandarf "I can transport you to the land where her prision lies." + :gandarf "But it is far out of my sight, and I know not what you'll find." + :gandarf "Well? What say you?" + :ego "I'll do it! " + :gandarf "Very good." + :gandarf "Prepare yourself.") + (Thread/sleep 300) + (actions/talk entities :gandarf "Beamium Up!!!" :anim :talk-angry) + (particle-effect! (get-in @entities [:room :entities :magic-frog-particle]) :reset) + (particle-effect! (get-in @entities [:room :entities :magic-frog-particle]) :start) + (disappear entities) + (Thread/sleep 2000) + (fade-out entities) + (on-gl (set-screen! @(resolve 'advent.core/advent) @(resolve 'advent.screens.credits/credits))) + ) (defn win [] - - (actions/get-script entities - (actions/do-dialogue entities - :ego "Hey Bloodclot!" - :ego "I have this potion which will make me as strong as you!" - :bloodclot-head "What?!" - :bloodclot-head "Give it here!") - (actions/transition-background entities :space [200 45] :between (fn [s e] - (-> e - (assoc-in [:room :entities :ego :stand-override] :crawl-stand) - (update-in [:room :entities :ego] #(actions/start-animation s % :crawl-stand))) - )) - (actions/do-dialogue entities - :bloodclot-head "Yes!" - :bloodclot-head "Ultimate power is mine!" - :bloodclot-head "If I drink this entire bottle, I'll be as powerful as a god!") - - (explode entities) - (actions/play-animation entities :ego :standup) - (actions/walk-straight-to entities :ego [340 55]) - (actions/run-action entities - (begin [this screen entities] - (assoc-in entities [:tweens :later] (tween/tween :later screen [:room :entities :later :opacity] 0.0 1.0 4.0 :ease tween/ease-in-cubic))) - - (continue [this screen entities] - entities) - - (done? [this screen entities] - (not (get-in entities [:tweens :later]))) - - (terminate [this screen entities] - entities) - (skip-type [this screen entities] - :none)) - (Thread/sleep 2000) - (actions/do-stop entities :ego :face :left) - (actions/transition-background entities :ending [165 49] :time 4.0) - (actions/do-dialogue entities - :duke "Ladies and gentlemen." - :duke "As the Duke of Remington, I'm pleased to inform you..." - :duke "The goblin by the name of Bloodclot has been destroyed!" - :duke "Our town is saved." - :duke "Thanks to this young boy, Tick." - :duke "It is my rightful duty as Duke of Remington to knight you." - :duke "You've proven yourself worthy." - :duke "Your sword, please.") - (actions/walk-straight-to entities :ego [150 49]) - (actions/play-animation entities :ego :reach-start :stop? false) - (actions/play-animation entities :duke :reach :stop? false) - (actions/play-animation entities :ego :reach-stop :stop? false) - (actions/talk entities :duke "Kneel." :anim :reach-talk :stop? false) - (actions/play-animation entities :ego :start-squat-2 :stop? false) - (Thread/sleep 1000) - (actions/play-animation entities :duke :knight :stop? false) - (actions/update-entity entities :duke (fn [d] (assoc d :baseline (- 240 48)))) - (actions/play-animation entities :duke :knight :stop? false) - (actions/talk entities :duke "In honor of your bravery..." :anim :reach-talk :stop? false) - (actions/talk entities :duke "I declare you Sir Tick of Remington." :anim :reach-talk) - (actions/play-animation entities :ego :end-squat :stop? true) - (Thread/sleep 500) - (actions/glad entities) - (Thread/sleep 200) - (actions/do-dialogue entities :ego "Wait...") - (Thread/sleep 400) - (actions/do-stop entities :ego :face :right) - (Thread/sleep 400) - (actions/do-stop entities :ego :face :left) - (Thread/sleep 400) - (actions/do-stop entities :ego :face :right) - (Thread/sleep 400) - (actions/do-stop entities :ego :face :left) - (Thread/sleep 400) - (actions/do-dialogue entities :ego "Where's Georgia McGorgeous?") - (actions/walk-straight-to entities :gandarf-cloud [215 100] :update-baseline? false) - (actions/do-dialogue entities :gandarf "Quickly, boy!") - (actions/do-stop entities :ego :face :right) - (actions/do-dialogue entities :ego "Gandarf?" - :gandarf "Yes, it is I!" - :ego "How did you escape?" - :gandarf "No time for that!" - :gandarf "Georgia McGorgeous has been captured!" - :ego "Captured?! By who?" - :gandarf "Bloodclot's second-in-command, Swinebreath." - :gandarf "I'm afraid that I can't save her." - :gandarf "This is a job for a knight." - :gandarf "If you are willing, Tick..." - :duke "That's 'Sir Tick'..." - :gandarf "Quite right, quite right." - :gandarf "If you are willing, Sir Tick..." - :gandarf "I can transport you to the land where her prision lies." - :gandarf "But it is far out of my sight, and I know not what you'll find." - :gandarf "Well? What say you?" - :ego "I'll do it! " - :gandarf "Very good." - :gandarf "Prepare yourself.") - (Thread/sleep 300) - (actions/talk entities :gandarf "Beamium Up!!!" :anim :talk-angry) - (particle-effect! (get-in @entities [:room :entities :magic-frog-particle]) :reset) - (particle-effect! (get-in @entities [:room :entities :magic-frog-particle]) :start) - (disappear entities) - (Thread/sleep 2000) - (fade-out entities) - (on-gl (set-screen! @(resolve 'advent.core/advent) @(resolve 'advent.screens.credits/credits))) - )) + (actions/get-script entities (do-win entities))) (defn make-outside-particles [] diff --git a/desktop/src-common/advent/screens/rooms/inside_antique.clj b/desktop/src-common/advent/screens/rooms/inside_antique.clj index f6759482..534e958b 100644 --- a/desktop/src-common/advent/screens/rooms/inside_antique.clj +++ b/desktop/src-common/advent/screens/rooms/inside_antique.clj @@ -3,6 +3,7 @@ [advent.actions :as actions] [advent.screens.items :as items] [advent.utils :as utils] + [advent.tween :as tween] [clojure.zip :as zip] [play-clj.core :refer :all] [play-clj.ui :refer :all] @@ -39,17 +40,27 @@ "Something else." {:choices actions/something-else}]] (actions/present-choices entities - {:choices ["I can barely see anything!" + {:choices [(when-not (get-in @entities [:state :opened-blinds?]) + "I can barely see anything!") {:run #(actions/respond entities % :shopkeep "Sorry about that, sonny." :shopkeep "My son will be back any minute with some candles.") :choices son-choices} + (when (get-in @entities [:state :opened-blinds?]) + "I let some light in. Will you open up shop?") + {:run #(actions/respond entities % + :shopkeep "It's still too dark in here." + :shopkeep "Don't worry." + :shopkeep "My son will be back any minute with those candles.") + :choices son-choices} + "What do you have for sale here?" {:run #(actions/respond entities % :shopkeep "We're not open for business right now." :shopkeep "Can't you see the lights are out?" :shopkeep "We'll be open again when my son comes back with some candles.") - :choices ["Why don't you just open the curtains?" + :choices [(when-not (get-in @entities [:state :opened-blinds?]) + "Why don't you just open the curtains?") {:run #(actions/respond entities % :shopkeep "That window doesn't let much light in anyhow." :shopkeep "Plus, my son should be back any minute now.") @@ -58,12 +69,14 @@ {:run #(actions/respond entities % :shopkeep "No, not until my son returns.") :choices #(-> % zip/left zip/left)} - "If I get some light in here, will you open up shop?" + (if (get-in @entities [:state :opened-blinds?]) + "Since I got some light in here, will you open up shop?" + "If I get some light in here, will you open up shop?") {:run #(actions/respond entities % :shopkeep "No." :shopkeep "I need my son to help around the shop anyways." :shopkeep "And there's a lot to fix up before we're ready to open shop again.") - :choices #(-> % zip/left zip/left zip/left zip/left)} + :choices son-choices} "Something else." {:choices actions/something-else}]} "Are those lava mints on the desk?" @@ -136,6 +149,19 @@ (and (actions/has-item? entities :teddy) (not (get-in @entities [:state :allowed-to-keep-teddy?])))) +(defn choose-correct-blind-state [e] + (if (get-in e [:state :opened-blinds?]) + (-> e + (assoc-in [:room :entities :closed-blinds :opacity] 0.0) + (assoc-in [:room :entities :open-blinds :opacity] 1.0) + (assoc-in [:room :entities :darken :opacity] 0.0) + (assoc-in [:room :entities :glow :opacity] 0.25)) + (-> e + (assoc-in [:room :entities :closed-blinds :opacity] 1.0) + (assoc-in [:room :entities :open-blinds :opacity] 0.0) + (assoc-in [:room :entities :darken :opacity] 0.4) + (assoc-in [:room :entities :glow :opacity] 0.0)))) + (defn make [screen] (let [shopkeep-sheet (texture! (texture "inside-antique/shopkeep-talk.png") :split 18 21) shopkeep-stand (animation 0.1 (for [i (flatten [(repeat 30 0) 1 (repeat 50 0) 1 0 1 0 1])] @@ -191,14 +217,38 @@ (return-teddy entities)) :portrait (actions/get-script entities (return-portrait entities))}} - :window {:box [210 125 256 183] + :window {:box [195 121 256 190] :script (actions/get-script entities - (actions/talk entities :ego "It's a nice, big window.")) + + (actions/walk-to entities :ego [207 68]) + (actions/play-animation entities :ego :reach) + (actions/update-state entities (fn [s] (assoc s :opened-blinds? (not (:opened-blinds? s))))) + (actions/update-entities entities (fn [screen e] + (if (get-in e [:state :opened-blinds?]) + (-> e + (assoc-in [:room :entities :closed-blinds :opacity] 0.0) + (assoc-in [:room :entities :open-blinds :opacity] 1.0) + (assoc-in [:tweens :fade-darken-out] + (tween/tween :fade-darken-out screen [:room :entities :darken :opacity] 0.4 0.0 0.75 :ease tween/ease-out-quadratic)) + (assoc-in [:tweens :fade-glow-in] + (tween/tween :fade-glow-in screen [:room :entities :glow :opacity] 0.0 0.3 0.75 :ease tween/ease-out-quadratic))) + (-> e + (assoc-in [:room :entities :closed-blinds :opacity] 1.0) + (assoc-in [:room :entities :open-blinds :opacity] 0.0) + (assoc-in [:tweens :fade-darken-in] + (tween/tween :fade-darken-in screen [:room :entities :darken :opacity] 0.0 0.4 0.75 :ease tween/ease-out-quadratic)) + (assoc-in [:tweens :fade-glow-out] + (tween/tween :fade-glow-out screen [:room :entities :glow :opacity] 0.3 0.0 0.75 :ease tween/ease-out-quadratic))))) + :use-screen? true)) :scripts {:portrait (actions/get-script entities - (actions/walk-to entities :ego [142 49] :face :left) - (actions/play-animation entities :ego :hold-up-to-window) - (actions/talk entities :ego "The portrait says 'Herb' on the back.") - (actions/update-state entities (fn [state] (update-in state [:clues] #(conj % :name)) )))}} + (if (get-in @entities [:state :opened-blinds?]) + (do (actions/walk-to entities :ego [142 49] :face :left) + (actions/play-animation entities :ego :hold-up-to-window) + (actions/talk entities :ego "The portrait says 'Herb' on the back.") + (actions/update-state entities (fn [state] (update-in state [:clues] #(conj % :name)) ))) + (do (actions/walk-to entities :ego [142 49] :face :left) + (actions/play-animation entities :ego :hold-up-to-window) + (actions/talk entities :ego "It's just too dim."))))}} :grandfather-clock {:box [55 70 103 185] :script (actions/get-script entities (actions/do-dialogue entities :ego "Cool grandfather clock!" @@ -220,8 +270,9 @@ } :layers [(assoc (texture "inside-antique/background.png") :x 0 :y 0 :baseline 0) (assoc (texture "inside-antique/desk.png") :x 0 :y 0 :baseline 113) + (assoc (texture "inside-antique/fg.png") :x 0 :y 0 :baseline 320 :parallax 1.5) - (assoc (texture "inside-antique/glow.png") :x 0 :y 0 :baseline 240 :additive? true :opacity 0.3)] + ] :entities {:shopkeep (actions/start-animation screen (assoc (animation->texture screen shopkeep-stand) :x 148 :y 122 :baseline 112 :stand shopkeep-stand :scale-x 1.6 @@ -248,6 +299,10 @@ (actions/get-script entities (actions/talk entities :shopkeep "No thanks, sonny.")))) :stand) + :glow (assoc (texture "inside-antique/glow.png") :x 0 :y 0 :baseline 240 :additive? true :opacity 0.3) + :closed-blinds (assoc (texture "inside-antique/closed-blinds.png") :x 0 :y 0 :baseline 0 :opacity 1.0) + :open-blinds (assoc (texture "inside-antique/open-blinds.png") :x 0 :y 0 :baseline 0 :opacity 0.0) + :darken (assoc (texture "inside-antique/darken.png") :x 0 :y 0 :baseline 321 :opacity 0.4 ) :beard (assoc (animation->texture screen beard) :anim beard :anim-start 0 @@ -318,6 +373,8 @@ (if (actions/has-item? entities :portrait ) entities - (assoc-in entities [:room :entities :portrait] (get-in entities [:room :portrait]))))) + (assoc-in entities [:room :entities :portrait] (get-in entities [:room :portrait]))) + (choose-correct-blind-state entities) + )) :scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.75) :start-pos [222 3]))) diff --git a/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj b/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj index 970db05b..33940e7a 100644 --- a/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj +++ b/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj @@ -31,7 +31,19 @@ (actions/talk entities :ego "Hey guys!") (actions/talk entities :warriors "Hark! Good day, young esquire.") (actions/present-choices entities - {:choices ["Why dost thou speaketh in this manner?" + {:choices ["Can I have some of your food?" + {:run #(actions/respond entities % + :warriors "Verily I say unto you: no." + :warriors "We art filled with hunger." + :warriors "And we musteth replentish our strength." + :warriors "Get ye your own food!") + :choices actions/previous-choices} + "Shouldn't you be guarding something?" + {:run #(actions/respond entities % + :warriors "Even the mightiest of knights musteth replentish their strength." + :warriors "And geteth some R and R.") + :choices actions/previous-choices} + "Why dost thou speaketh in this manner?" {:run #(actions/respond entities % :warriors "`Tis a tradition!" :warriors "All knights speaketh in such a manner." @@ -160,7 +172,8 @@ #_#_ladder-guard-stand (animation 0.1 [(aget ladder-guard-sheet 0 0)]) ladder-guard-stand (animation 0.1 [(texture "inside-cafeteria/ladder-guard-2.png")]) ladder-guard-talk (animation 0.1 [ (texture "inside-cafeteria/ladder-guard-2.png")]) - warriors-stand (utils/make-anim "inside-cafeteria/knights-stand.png" [74 97] 0.6 (take 100 (repeatedly #(rand-int 10)))) + warriors-stand (utils/make-anim "inside-cafeteria/knights-stand.png" [49 80] 0.6 (take 100 (repeatedly #(rand-int 10)))) + knight-a-stand (utils/make-anim "inside-cafeteria/knight-a.png" [70 85] 0.2 (flatten [(repeat 3 [(repeat 7 0) (repeat 7 1) (repeat 7 0) (repeat 7 2)]) [3 4 5 6 7 8 9]])) @@ -188,8 +201,7 @@ (assoc (texture "inside-cafeteria/glow.png") :y 0 :baseline 240 :additive? true :opacity 0.3) (assoc (texture "inside-cafeteria/fg.png") :x 10 :y 0 :scale-x 1.1 :scale-y 1.0 :baseline 320 :parallax 1.5) ] - :entities { - :warriors (actions/start-animation screen (assoc (animation->texture screen warriors-stand) :x 8 :y 19 :baseline 180 + :entities {:warriors (actions/start-animation screen (assoc (animation->texture screen warriors-stand) :x 31 :y 36 :baseline 180 :left {:stand (utils/flip warriors-stand) :talk (utils/flip warriors-stand)} @@ -204,6 +216,12 @@ (actions/do-dialogue entities :warriors "We are warriors. We coveteth not earthly possessions.")))) :stand) + :knight-a (assoc (animation->texture screen knight-a-stand) + :x 0 :y 21 :baseline 181 + :anim knight-a-stand + :anim-start 0 + :talk knight-a-stand + :stand knight-a-stand) :ladder-guard (actions/start-animation screen (assoc (animation->texture screen ladder-guard-stand) :x 180 :y 70 :baseline 170 :stand ladder-guard-stand :talk ladder-guard-talk diff --git a/desktop/src-common/advent/screens/rooms/outside_castle.clj b/desktop/src-common/advent/screens/rooms/outside_castle.clj index 6345a0f9..78e6eea2 100644 --- a/desktop/src-common/advent/screens/rooms/outside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/outside_castle.clj @@ -224,6 +224,7 @@ :ego "No, not the Slinger's Shot!" :frankie "Look like we hit the jackpot tonight boys!") (frankie-comment-on-item entities) + (actions/update-state entities #(assoc % :bubba-gone? true)) (actions/do-dialogue entities :frankie "Bubba, put this stuff in the secret stash." :goon-2 "You got it boss.") @@ -238,7 +239,6 @@ (actions/remove-item entities :medal) (actions/remove-item entities :trophy) (actions/remove-item entities :slingshot) - (actions/update-state entities #(assoc % :bubba-gone? true)) (actions/walk-to entities :ego [181 79]) (actions/do-dialogue entities diff --git a/desktop/src-common/advent/screens/rooms/space.clj b/desktop/src-common/advent/screens/rooms/space.clj index f5ae8a5f..bc7293ba 100644 --- a/desktop/src-common/advent/screens/rooms/space.clj +++ b/desktop/src-common/advent/screens/rooms/space.clj @@ -292,7 +292,7 @@ :apply-state (fn [_ e] (as-> e e (if (get-in e [:state :broke-jewel?]) - (assoc-in e [:room :entities :broken-jewel] (get-in e [:room :entities :broken-jewel])) + (assoc-in e [:room :entities :broken-jewel] (get-in e [:room :broken-jewel])) e) (if (get-in e [:state :seen-bloodclot?]) (assoc-in e [:room :entities :bloodclot :opacity ] 1.0) diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index 2ffa653f..f9aa44ba 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -285,38 +285,6 @@ void main() ((:get-script default-interaction) (get-in entities [:cursor :current]) [x y])) entities)) (assoc-in entities [:cursor :down-target] nil))) -(defn drink-blergh [entities] - (actions/walk-straight-to entities :ego [205 45]) - (sound! (sound "ego/potion.ogg") :play (utils/current-sound-volume)) - (actions/play-animation entities :ego :grow :stop? false) - (actions/do-dialogue entities - :blergh "What this? A potion of strength?" - :blergh "You're still no match for me." - :blergh "Give it to me, or I'll make you regret it!") - (actions/present-choices entities {:choices ["Ok." - {:run (fn [_] - (actions/talk entities :ego "Ok." :anim :grow-talk :stop? false) - (actions/talk entities :ego "Here you go." :anim :grow-talk) - (actions/do-dialogue entities - :blergh "Yes! Now I can drink this whole thing and can become powerful enough to rule the world!" - :blergh "[#AAFFAAFF]*gulp*[]" - :blergh "What's this? What's happening?") - (actions/talk entities :ego "Uh oh." :anim :grow-talk :stop? false) - (actions/walk-straight-to entities :ego [100 45] :face :right) - (actions/play-animation entities :blergh :grow :stop? false) - (actions/do-dialogue entities :ego "'Not more than that do drink,\nOr you'll push your body to the brink.'" - :ego "Brilliant! I win!") - (actions/walk-straight-to entities :ego [800 75] :face :right) - (actions/update-state entities (fn [s] (assoc s :blergh-dead? true))))} - "No way!" - {:run (fn [_] - (actions/talk entities :ego "No way!" :anim :grow-talk) - (actions/talk entities :blergh "Then take this!") - (actions/play-animation entities :blergh :swing) - (actions/walk-straight-to entities :ego [100 45] :anim :squat :override-dir :right :speed 3.0) - (actions/do-dialogue entities :ego "Yeow!!" - :ego "Even with that potion, I'm not strong enough."))}]})) - (defn get-ego-script [cursor [x y]] (condp = (:value cursor) @@ -325,9 +293,9 @@ void main() :flask-1-strength (actions/get-script entities - (cond (and (actions/has-item? entities :magic-slingshot) - (get-in @entities [:room :blergh])) - (drink-blergh entities) + (cond (= :held + (get-in @entities [:state :last-room])) + (common/do-win entities) (get-in @entities [:room :entities :warden]) (do