diff --git a/desktop/resources/cursor.png b/desktop/resources/cursor.png index dad7c8e6..b54c6204 100644 Binary files a/desktop/resources/cursor.png and b/desktop/resources/cursor.png differ diff --git a/desktop/resources/outside-castle/note.png b/desktop/resources/outside-castle/note.png index 9075e629..bb0da8cc 100644 Binary files a/desktop/resources/outside-castle/note.png and b/desktop/resources/outside-castle/note.png differ diff --git a/desktop/src-common/advent/screens/items.clj b/desktop/src-common/advent/screens/items.clj index 6c8b881c..d8912b06 100644 --- a/desktop/src-common/advent/screens/items.clj +++ b/desktop/src-common/advent/screens/items.clj @@ -123,10 +123,11 @@ :spell-component {:name "Spell component" :value :spell-component :cursor :spell-component} :money {:name "Money" :value :money :cursor :money} :watch {:name "Watch" :value :watch :cursor :watch} - :broken-watch {:name "Halved watch" :value :broken-watch :cursor :broken-watch} + :broken-clock {:name "Sliced time-keeping device" :value :broken-clock :cursor :broken-clock} :slingshot {:name "The Slinger's Shot" :value :slingshot :cursor :slingshot} - :note-2 {:name "Another note from Gandarf" :value :note-2 :cursor :note} + :note-2 {:name "Bingo card" :value :note-2 :cursor :note-2} :camera {:name "Image taking device" :value :camera :cursor :camera} :walkie-talkies {:name "Communication devices" :value :walkie-talkies :cursor :walkie-talkies} :walkie-talkie {:name "Communication device" :value :walkie-talkie :cursor :walkie-talkie} - :flashlight {:name "Lighting device" :value :flashlight :cursor :flashlight}}) + :alarm-clock {:name "Time-keeping device" :value :alarm-clock :cursor :alarm-clock} + :magic-slingshot {:name "The Slinger's Shot" :value :magic-slingshot :cursor :magic-slingshot}}) diff --git a/desktop/src-common/advent/screens/rooms/cat_tree.clj b/desktop/src-common/advent/screens/rooms/cat_tree.clj index 4681ad97..1cc34ee7 100644 --- a/desktop/src-common/advent/screens/rooms/cat_tree.clj +++ b/desktop/src-common/advent/screens/rooms/cat_tree.clj @@ -221,9 +221,9 @@ (actions/play-animation entities :ego :squat) (actions/do-dialogue entities :ego "Hey! A little lever." - :ego "I think this is Gandarf's stash of helpful stuff.") + :ego "I think this is Gandarf's secret stash of helpful stuff.") (actions/play-animation entities :ego :squat) - (actions/give entities :flashlight) + (actions/give entities :alarm-clock) (actions/do-dialogue entities :ego "What is this?") (actions/play-animation entities :ego :squat) (actions/give entities :camera) diff --git a/desktop/src-common/advent/screens/rooms/common.clj b/desktop/src-common/advent/screens/rooms/common.clj index b20b21b0..1d514df7 100644 --- a/desktop/src-common/advent/screens/rooms/common.clj +++ b/desktop/src-common/advent/screens/rooms/common.clj @@ -53,19 +53,21 @@ :ego "'And please hurry, because we're being forced into a karaoke competition.'" :ego "'I'm about at my witt's end.'" :ego "'P.S., Guard that slingshot with your life!'" - :ego "'P.P.S., If anything goes wrong, you can look for supplies behind a nearby r...'" + :ego "'P.P.S., If anything goes wrong, you can look for my secret stash of helpful stuff behind a nearby r...'" :ego "It just cuts off there.")) (defn read-note-2 [entities] (actions/do-dialogue entities - :ego "It's another note from Gandarf. It's written on the back of a bingo card. It reads:" + :ego "It's a Bingo card." + :ego "Look's like there's a note on the back." :ego "'Boy, the situation is dire. I don't have much time. Please hurry.'" :ego "'We've been forced into playing bingo for the last 3 hours.'" :ego "'You are almost done with the spell to restore magic to The Slinger's Shot.'" :ego "'You haven't lost it, right?'" :ego "'You need to add the root of all evil to the cauldron.'" :ego "'Also, you'll need to add a split second.'" - :ego "'Then, dip the Slinger's Shot in to complete the spell.'")) + :ego "'Then, dip the Slinger's Shot in to complete the spell.'" + :ego "'Don't forget about my secret stash of helpful stuff.'")) (defn listen-1 [entities] diff --git a/desktop/src-common/advent/screens/rooms/inside_castle.clj b/desktop/src-common/advent/screens/rooms/inside_castle.clj index c74b7379..dae5330e 100644 --- a/desktop/src-common/advent/screens/rooms/inside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/inside_castle.clj @@ -95,6 +95,12 @@ "Nevermind." {:run #(actions/respond entities % :game-player "See you around.")}]})) +(defn walk-to-blergh [entities] + (actions/walk-to entities :ego [85 145] :face :right) + (actions/transition-background entities :space [0 65]) + (actions/walk-straight-to entities :ego [140 55] :face :right) + (actions/play-animation entities :blergh :appear :stop? false) + (actions/transition-music entities :town-1 :fight)) (defn pull-sword [entities] (actions/play-animation entities :ego :reach) @@ -109,12 +115,10 @@ (actions/transition-music entities :pull-sword :town-1) (actions/do-dialogue entities :ego "That was weird." :ego "I have to go show my friends!") - (actions/walk-to entities :ego [85 145] :face :right) - (actions/transition-background entities :space [0 65]) - (actions/walk-straight-to entities :ego [140 55] :face :right) + + + (actions/add-entity entities :blergh (get-in @entities [:room :blergh])) - (actions/play-animation entities :blergh :appear :stop? false) - (actions/transition-music entities :town-1 :fight) (actions/do-dialogue entities :ego "Who are YOU?!?!?!" :blergh "I'm your worst nightmare." :blergh "I am Blergh, and this is now my dimension." @@ -155,16 +159,12 @@ (update-in entities [:room :entities] #(assoc % :monocle (get-in entities [:room :monocle]))) entities)) -(defn add-watch-if-necessary [entities] - (if (not (actions/has-obtained? entities :watch)) - (update-in entities [:room :entities] #(assoc % :watch (get-in entities [:room :watch]))) - entities)) + (defn make-night [entities] (-> entities (update-in [:room :entities] #(dissoc % :game-player)) - add-monocle-if-necessary - add-watch-if-necessary)) + add-monocle-if-necessary)) (defn make [screen] (let [game-player-talk-sheet (texture! (texture "inside-castle/game-player-talk.png") :split 40 44) @@ -349,21 +349,7 @@ (actions/remove-entity entities :monocle) (actions/give entities :monocle) (actions/talk entities :ego "It looks like a monocle."))})) - :watch (rooms/make-entity :watch (assoc (texture "inside-castle/watch.png") - :x 282 :y 62 :baseline 140 - :script (actions/get-script entities - - (actions/talk entities :ego "There's something on that chair.") - (actions/walk-to entities :ego [265 90] :face :right) - (actions/walk-straight-to entities :ego [303 80]) - (actions/walk-straight-to entities :ego [302 48]) - (actions/play-animation entities :ego :squat) - (actions/remove-entity entities :watch) - (actions/give entities :watch) - (actions/do-dialogue entities :ego "It's a watch." - :ego "Brian O'Brainy must have left it behind.") - (actions/walk-straight-to entities :ego [303 80]) - (actions/walk-straight-to entities :ego [265 90])))) + :collision "inside-castle/collision.png" :scale-fn (utils/scaler-fn-from-image "inside-castle/scale.png" 0.25 1.00) :apply-state (fn [entities] diff --git a/desktop/src-common/advent/screens/rooms/outside_castle.clj b/desktop/src-common/advent/screens/rooms/outside_castle.clj index 37c42216..0536a442 100644 --- a/desktop/src-common/advent/screens/rooms/outside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/outside_castle.clj @@ -123,7 +123,8 @@ (defn should-block? [entities] (and (= :night (get-in @entities [:state :time])) - (actions/has-obtained? entities :flask-2))) + (actions/has-obtained? entities :flask-2) + (not (actions/has-item? entities :magic-slingshot)))) (defn frankie-comment-on-item [entities] (cond @@ -370,6 +371,8 @@ :script (actions/get-script entities (actions/walk-to entities :ego [210 79] :face :left) (actions/play-animation entities :ego :squat) + (actions/give entities :note-2) + (actions/remove-entity entities :note) (common/read-note-2 entities)))) :collision "outside-castle/collision.png" :scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.00) diff --git a/desktop/src-common/advent/screens/rooms/outside_house.clj b/desktop/src-common/advent/screens/rooms/outside_house.clj index 4db44395..dc94d370 100644 --- a/desktop/src-common/advent/screens/rooms/outside_house.clj +++ b/desktop/src-common/advent/screens/rooms/outside_house.clj @@ -2,6 +2,8 @@ (:require [advent.screens.items :as items] [advent.screens.rooms :as rooms] [advent.screens.rooms.common :as common] + [advent.screens.rooms.outside-castle :as outside-castle] + [advent.screens.rooms.inside-castle :as inside-castle] [advent.actions :as actions] [advent.utils :as utils] [clojure.zip :as zip] @@ -11,6 +13,12 @@ [play-clj.utils :refer :all] [play-clj.g2d :refer :all])) +(defn walk-to-castle [entities] + (actions/walk-to entities :ego [0 80]) + (actions/walk-straight-to entities :ego [-20 80]) + (actions/transition-background entities :outside-castle [330 80]) + (actions/walk-straight-to entities :ego [310 80])) + (def ego-sheep-loc [132 140]) @@ -21,6 +29,53 @@ (defn is-sheep-close? [entities] (< (dist-to-sheep entities) 45)) +(defn is-ready-for-slingshot [entities] + (and (actions/has-obtained? entities :broken-clock) + (not (actions/has-item? entities :broken-clock)) + (actions/has-obtained? entities :money) + (not (actions/has-item? entities :money)))) + +(defn put-something-in-cauldron [item] + (condp = item + :money (actions/get-script entities + (actions/walk-to entities :ego [141 90] :face :right) + (actions/play-animation entities :ego :reach) + (actions/remove-item entities :money) + (actions/talk entities :ego "I guess that's what you could call 'money in the pot'.")) + :slingshot (actions/get-script entities + (if (is-ready-for-slingshot entities) + (do + (actions/walk-to entities :ego [141 90] :face :right) + (actions/talk entities :ego "Here goes!") + (actions/play-animation entities :ego :reach) + (actions/remove-item entities :slingshot) + (actions/give entities :magic-slingshot) + (actions/do-dialogue entities + :ego "It worked!" + :ego "I now have The Slinger's Shot." + :ego "And just in time, too. It's getting light.") + (walk-to-castle entities) + (outside-castle/go-through-gate entities) + (inside-castle/walk-to-blergh entities)))) + :broken-clock (actions/get-script entities + (actions/walk-to entities :ego [141 90] :face :right) + (actions/play-animation entities :ego :reach) + (actions/remove-item entities :broken-clock) + (actions/talk entities :ego "Just in the nick of time.")) + :recipe (actions/get-script entities + (actions/walk-to entities :ego [151 90] :face :right) + (actions/play-animation entities :ego :squat) + (actions/remove-item entities :recipe) + (actions/give entities :ash) + (actions/talk entities :ego "It burned up into ash.")) + :spell-component (actions/get-script entities + (actions/walk-to entities :ego [141 90] :face :right) + (actions/play-animation entities :ego :reach) + (actions/remove-item entities :spell-component) + (actions/talk entities :ego "I poured it in. Now what?")) + (actions/get-script entities + (actions/talk entities :ego "I don't want to put something in there unless I'm sure I need to.")))) + (defn wizard-dialogue [entities] (actions/do-dialogue entities :ego "Hello there [RED]Gandarf[]!" :wizard "Oh no, not you again!") (actions/present-choices entities @@ -206,10 +261,8 @@ :left-dir {:box [0 40 20 140] :script (actions/get-script entities - (actions/walk-to entities :ego [0 80]) - (actions/walk-straight-to entities :ego [-20 80]) - (actions/transition-background entities :outside-castle [330 80]) - (actions/walk-straight-to entities :ego [310 80]) + (walk-to-castle entities) + ) :cursor :left}} :layers {:day [(assoc (texture "outsidehouse/background.png") :x 0 :y 0 :baseline 0) @@ -290,17 +343,7 @@ :anim cauldron :anim-start 0 :script (actions/get-script entities (actions/talk entities :ego "That's a big cauldron!")) - :scripts {:recipe (actions/get-script entities - (actions/walk-to entities :ego [151 90] :face :right) - (actions/play-animation entities :ego :squat) - (actions/remove-item entities :recipe) - (actions/give entities :ash) - (actions/talk entities :ego "It burned up into ash.")) - :spell-component (actions/get-script entities - (actions/walk-to entities :ego [141 90] :face :right) - (actions/play-animation entities :ego :reach) - (actions/remove-item entities :spell-component) - (actions/talk entities :ego "I poured it in. Now what?"))})) + :scripts put-something-in-cauldron)) :wizard (rooms/make-entity :wizard (common/make-wizard screen {:x 190 :y 78 :baseline 162 :scale-x 1.2 :scale-y 1.2 :script (actions/get-script entities (talk-to-gandarf-outside entities))})) :note (rooms/make-entity :note (assoc (texture "outsidehouse/note.png") diff --git a/desktop/src-common/advent/screens/rooms/outside_jail.clj b/desktop/src-common/advent/screens/rooms/outside_jail.clj index 5efdbb1b..191cd611 100644 --- a/desktop/src-common/advent/screens/rooms/outside_jail.clj +++ b/desktop/src-common/advent/screens/rooms/outside_jail.clj @@ -15,11 +15,11 @@ (assoc-in entities [:room :entities :spear] (get-in entities [:room :spear])) entities)) -(defn add-watch-if-necessary [entities] - (if (and (not (actions/has-obtained? entities :broken-watch)) - (not (actions/has-item? entities :watch)) - (actions/has-obtained? entities :watch)) - (assoc-in entities [:room :entities :watch] (get-in entities [:room :watch])) +(defn add-clock-if-necessary [entities] + (if (and (not (actions/has-obtained? entities :broken-clock)) + (not (actions/has-item? entities :alarm-clock)) + (actions/has-obtained? entities :alarm-clock)) + (assoc-in entities [:room :entities :alarm-clock] (get-in entities [:room :alarm-clock])) entities)) (defn add-rope-if-necessary [entities] @@ -33,7 +33,7 @@ (-> entities (assoc-in [:room :entities :guard] (get-in entities [:room :guard])) add-spear-if-necessary - add-watch-if-necessary + add-clock-if-necessary (assoc-in [:room :entities :stash] (get-in entities [:room :stash])) add-rope-if-necessary)) @@ -131,21 +131,21 @@ :stump {:box [205 68 251 89] :script (actions/get-script entities (actions/do-dialogue entities :ego "It's a stump.")) - :scripts {:watch (actions/get-script entities + :scripts {:alarm-clock (actions/get-script entities (actions/walk-to entities :ego [189 65] :face :right) (actions/play-animation entities :ego :reach) - (actions/remove-item entities :watch) - (actions/add-entity entities :watch (get-in @entities [:room :watch]))) + (actions/remove-item entities :alarm-clock) + (actions/add-entity entities :alarm-clock (get-in @entities [:room :alarm-clock]))) :sword (actions/get-script entities - (when (get-in @entities [:room :entities :watch]) + (when (get-in @entities [:room :entities :alarm-clock]) (actions/walk-to entities :ego [129 65] :face :right) (actions/talk entities :ego "I'll take a big swing!") (actions/walk-straight-to entities :ego [189 65] :face :right :speed 3.5) (actions/play-animation entities :ego :swing) (actions/talk entities :ego "It's split right down the middle!") (actions/play-animation entities :ego :reach) - (actions/remove-entity entities :watch) - (actions/give entities :broken-watch)))}} + (actions/remove-entity entities :alarm-clock) + (actions/give entities :broken-clock)))}} :lever {:box [10 72 17 85] :script (actions/get-script entities (interact-with-lever entities)) @@ -192,13 +192,13 @@ :spear (rooms/make-entity :spear (assoc (texture "outside-jail/spear.png") :x 60 :y 65 :baseline 180 :script (actions/get-script entities (grab-spear entities)))) - :watch (rooms/make-entity :watch (assoc (texture "inside-castle/watch.png") - :x 217 :y 83 :baseline 160 - :script (actions/get-script entities - (actions/walk-to entities :ego [189 65] :face :right) - (actions/play-animation entities :ego :reach) - (actions/remove-entity entities :watch) - (actions/give entities :watch)))) + :alarm-clock (rooms/make-entity :alarm-clock (assoc (texture "outside-jail/alarm-clock.png") + :x 217 :y 83 :baseline 160 + :script (actions/get-script entities + (actions/walk-to entities :ego [189 65] :face :right) + (actions/play-animation entities :ego :reach) + (actions/remove-entity entities :alarm-clock) + (actions/give entities :alarm-clock)))) :stash (rooms/make-entity :stash (assoc (animation->texture screen open-stash) :x 197 :y 94 :baseline 146 diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index 3dda50c5..0f75b1ea 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -259,7 +259,7 @@ :note-1 (actions/get-script entities (common/read-note-1 entities)) :note-2 (actions/get-script entities (common/read-note-2 entities)) :camera (actions/get-script entities (actions/talk entities :ego "It's some sort of magical device that captures images.")) - :flashlight (actions/get-script entities (actions/talk entities :ego "It's a magic device that gives off light.")) + :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)) diff --git a/desktop/src-common/advent/utils.clj b/desktop/src-common/advent/utils.clj index 8fb3d95a..1ea92a33 100644 --- a/desktop/src-common/advent/utils.clj +++ b/desktop/src-common/advent/utils.clj @@ -14,7 +14,7 @@ (let [{:keys [x y]} (input->screen screen {:x (:input-x screen) :y (:input-y screen)})] (println (:input-x screen) (:input-y screen) "->" x y))) -(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal :kiss :sword :hourglass :mandrake :ball-n-chain :key :rope :crowbar :note-1 :ash :sack-lunch :flies :spear :monocle :feather :spell-component :money :watch :broken-watch :slingshot :camera :walkie-talkies :flashlight :walkie-talkie :flask-water :flask-water-stuff :flask-water-stuff-2]) +(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal :kiss :sword :hourglass :mandrake :ball-n-chain :key :rope :crowbar :note-1 :ash :sack-lunch :flies :spear :monocle :feather :spell-component :money :watch :broken-clock :slingshot :camera :walkie-talkies :alarm-clock :walkie-talkie :flask-water :flask-water-stuff :flask-water-stuff-2 :note-2 :magic-slingshot]) (defn cursor [filename which] (let [scale 2