diff --git a/desktop/resources/inside-castle/background-dark.png b/desktop/resources/inside-castle/background-dark.png index 168627b9..66e27b8f 100644 Binary files a/desktop/resources/inside-castle/background-dark.png and b/desktop/resources/inside-castle/background-dark.png differ diff --git a/desktop/resources/inside-castle/background.png b/desktop/resources/inside-castle/background.png index e9622cdf..7e60d526 100644 Binary files a/desktop/resources/inside-castle/background.png and b/desktop/resources/inside-castle/background.png differ diff --git a/desktop/src-common/advent/screens/rooms/castle_gate.clj b/desktop/src-common/advent/screens/rooms/castle_gate.clj index 3675639b..b2901204 100644 --- a/desktop/src-common/advent/screens/rooms/castle_gate.clj +++ b/desktop/src-common/advent/screens/rooms/castle_gate.clj @@ -129,7 +129,16 @@ :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))}}} + :scripts {:walkie-talkies (actions/get-script entities (drop-walkie-talkie entities))}} + :window {:box [190 176 206 211] + :script (actions/get-script entities + (actions/do-dialogue entities :ego "It's a big window!")) + :scripts {:walkie-talkies (actions/get-script entities + (actions/walk-to entities :ego [285 71]) + (actions/walk-straight-to entities :ego [308 115] :face :left) + (actions/play-animation entities :ego :throw) + (actions/remove-item entities :walkie-talkies) + (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)]} diff --git a/desktop/src-common/advent/screens/rooms/cat_tree.clj b/desktop/src-common/advent/screens/rooms/cat_tree.clj index dabc25d0..3bc12c1a 100644 --- a/desktop/src-common/advent/screens/rooms/cat_tree.clj +++ b/desktop/src-common/advent/screens/rooms/cat_tree.clj @@ -231,6 +231,7 @@ (actions/do-dialogue entities :ego "These are all really strange devices.") (actions/play-animation entities :ego :squat) (actions/give entities :walkie-talkies) + (actions/talk entities :ego "Tin cans connected with string?") (actions/do-dialogue entities :ego "I wonder what all of these magic devices do.")))} :grass {:box [26 105 60 160] :script (actions/get-script entities diff --git a/desktop/src-common/advent/screens/rooms/common.clj b/desktop/src-common/advent/screens/rooms/common.clj index ea5c9265..4f6b6466 100644 --- a/desktop/src-common/advent/screens/rooms/common.clj +++ b/desktop/src-common/advent/screens/rooms/common.clj @@ -87,14 +87,4 @@ (actions/talk entities :ego "Am I right boys?" :animate? false :stop? false)) (defn listen-to-frankie [entities] - (if (get-in @entities [:room :entities :frankie]) - (do - (actions/play-animation entities :ego :reach-up :stop? false) - (Thread/sleep 1000) - (actions/play-animation entities :ego :reach-down :stop? false) - (actions/talk entities :ego "I don't hear anything in it.")) - (do - (actions/talk entities :ego "I'll just give it a listen.") - (actions/play-animation entities :ego :reach-up :stop? false) - ((rand-nth [listen-1 listen-2 listen-3]) entities) - (actions/play-animation entities :ego :reach-down)))) + ((rand-nth [listen-1 listen-2 listen-3]) entities)) diff --git a/desktop/src-common/advent/screens/rooms/inside_castle.clj b/desktop/src-common/advent/screens/rooms/inside_castle.clj index 58c13f6e..aec3a5e3 100644 --- a/desktop/src-common/advent/screens/rooms/inside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/inside_castle.clj @@ -1,6 +1,7 @@ (ns advent.screens.rooms.inside-castle (:require [advent.screens.rooms :as rooms] [advent.actions :as actions] + [advent.screens.rooms.common :as common] [advent.screens.items :as items] [advent.utils :as utils] [advent.tween :as tween] @@ -354,6 +355,16 @@ :x 22 :y 110 :baseline 95) + :walkie-talkie (assoc (texture "inside-castle/walkie-talkie.png") + :x 257 + :y 135 + :baseline 0 + :script (actions/get-script entities + (actions/talk entities :ego "Let's give it a listen.") + (actions/walk-to entities :ego [272 136] :face :left) + (actions/play-animation entities :ego :start-squat-2 :stop? false) + (common/listen-to-frankie entities) + (actions/play-animation entities :ego :end-squat))) :trophy (assoc (animation->texture screen trophy) :x 253 :y 69 :baseline 191 @@ -455,6 +466,10 @@ (if (actions/has-item? entities :sword) (update-in entities [:room :entities] #(dissoc % :sword)) entities) + (if (and (not (actions/has-item? entities :walkie-talkies)) + (actions/has-obtained? entities :walkie-talkies)) + entities + (update-in entities [:room :entities] dissoc :walkie-talkie)) (if (#{:night :sunrise} (get-in entities [:state :time])) (make-night entities) entities))) diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index a38b72b3..340e64d1 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -15,7 +15,6 @@ [advent.utils :as utils] [advent.tween :as tween] [advent.screens.rooms :as rooms] - [advent.screens.rooms.common :as common] [advent.screens.items :as items] [advent.screens.rooms.dream :as rooms.dream] [advent.screens.rooms.castle-gate :as rooms.castle-gate] @@ -161,7 +160,9 @@ (texture (aget talk-sheet 0 i)))) start-squat (animation 0.05 (for [i [0 1 2 3 4]] (texture (aget squat-sheet 0 i)))) - end-squat (animation 0.05 (for [i [4 3 2 1 0]] + start-squat-2 (animation 0.05 (for [i [0 1 2 3]] + (texture (aget squat-sheet 0 i)))) + end-squat (animation 0.05 (for [i [3 2 1 0]] (texture (aget squat-sheet 0 i)))) squat-anim (animation 0.05 (for [i [0 1 2 3 3 3 3 3 3 3 3 3 3 3 3 2 1] ] (texture (aget squat-sheet 0 i)))) @@ -213,6 +214,7 @@ :talk talk-anim :squat squat-anim :start-squat start-squat + :start-squat-2 start-squat-2 :end-squat end-squat :reach reach-anim :cat-toy cat-toy-anim @@ -253,6 +255,7 @@ :stand (utils/flip stand-anim) :talk (utils/flip talk-anim) :start-squat (utils/flip start-squat) + :start-squat-2 (utils/flip start-squat-2) :end-squat (utils/flip end-squat) :squat (utils/flip squat-anim) :reach (utils/flip reach-anim) @@ -334,7 +337,6 @@ :camera (actions/get-script entities (actions/talk entities :ego "It's some sort of magical device that captures images.")) :alarm-clock (actions/get-script entities (actions/talk entities :ego "It's a magic device that tells the time.")) :walkie-talkies (actions/get-script entities (actions/do-dialogue entities :ego "If I talk in one of these devices, I can hear it in the other one!")) - :walkie-talkie (actions/get-script entities (common/listen-to-frankie entities)) nil)) :x (first start-pos) :y (last start-pos) :id "ego"}