From 9726d95a0608ad76afe662a811896fc38d45a324 Mon Sep 17 00:00:00 2001 From: Remington Covert Date: Thu, 9 Apr 2015 18:20:09 -0700 Subject: [PATCH] added pit/broom/shovel. --- .../src-common/advent/screens/rooms/dream.clj | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/desktop/src-common/advent/screens/rooms/dream.clj b/desktop/src-common/advent/screens/rooms/dream.clj index ef443353..84c180f4 100644 --- a/desktop/src-common/advent/screens/rooms/dream.clj +++ b/desktop/src-common/advent/screens/rooms/dream.clj @@ -197,7 +197,22 @@ (let [fairy-godfather-anim (utils/make-anim "dream/fairy-godfather.png" [63 77] 0.15 [0 1 2 3 2 1 0 1 4 3 2 1]) fairy-godfather-talk-anim (utils/make-anim "dream/fairy-godfather.png" [63 77] 0.15 [5 6 7 8 7 6])] (rooms/make :music :town-1 - :interactions {} + :interactions {:pit {:box [54 0 219 36] + :script (actions/get-script entities + (actions/walk-to entities :ego [154 41]) + (actions/talk entities :ego "Wow! That's a long way down.")) + :scripts {:shovel (actions/get-script entities + (actions/walk-to entities :ego [154 41]) + (actions/talk entities :ego "I guess I'm doomed to be a grave-digger.") + (actions/play-animation entities :ego :sigh) + (actions/play-animation entities :ego :reach) + (actions/talk entities :ego "Wait a second! If I become a grave-digger, I'll never win Georgia McGorgeous' heart!")) + :broom (actions/get-script entities + (actions/walk-to entities :ego [154 41]) + (actions/talk entities :ego "I guess I'm doomed to be a janitor.") + (actions/play-animation entities :ego :sigh) + (actions/play-animation entities :ego :reach) + (actions/talk entities :ego "Wait a second! If I become a janitor, I'll never win Georgia McGorgeous' heart!"))}}} :layers [(assoc (texture "dream/clouds1.png") :x -10 :y 0 :baseline -1 :parallax 0.2 :scale-x 1.1 :scale-y 1.1) (assoc (texture "dream/island.png") :x 180 :y 180 :baseline 0 :parallax 0.3 :scale-x 1.1 :scale-y 1.1) (assoc (texture "dream/cliff.png") :x 50 :y 133 :baseline 1 :parallax 0.6 :scale-x 1.2 :scale-y 1.2) @@ -289,7 +304,14 @@ :collision "dream/collision.png" :scale-fn (utils/scaler-fn-from-image "dream/scale.png" 0.1 1.3) :apply-state (fn [entities] - (if (get-in entities [:state :seen-intro?]) - (set-opacity entities 1.0 1.0) - (set-opacity entities 0.0 0.0))) + (as-> entities entities + (if (get-in entities [:state :seen-intro?]) + (set-opacity entities 1.0 1.0) + (set-opacity entities 0.0 0.0)) + (if (actions/has-item? entities :broom) + (update-in entities [:room :entities] dissoc :broom) + entities) + (if (actions/has-item? entities :shovel) + (update-in entities [:room :entities] dissoc :shovel) + entities))) :start-pos [140 55])))