diff --git a/desktop/src-common/advent/screens/rooms/inside_antique.clj b/desktop/src-common/advent/screens/rooms/inside_antique.clj index 21a5fc92..6eb5169d 100644 --- a/desktop/src-common/advent/screens/rooms/inside_antique.clj +++ b/desktop/src-common/advent/screens/rooms/inside_antique.clj @@ -161,6 +161,13 @@ (actions/add-entity entities :portrait (get-in @entities [:room :portrait])) (actions/remove-item entities :portrait)) +(defn get-portrait [entities] + (actions/walk-to entities :ego [140 58] :face :left) + (actions/play-animation entities :ego :reach) + (actions/remove-entity entities :portrait) + (actions/give entities :portrait) + (actions/talk entities :ego "It's a portrait. There's something on the back but it's too dim to read.")) + (defn return-teddy [entities] (actions/walk-to entities :ego [242 49] :face :right) (actions/play-animation entities :ego :reach) @@ -231,9 +238,17 @@ (actions/walk-straight-to entities :ego [320 -5]) (actions/transition-background entities :inside-castle [182 90]) (actions/walk-to entities :ego [187 75]))} - :return-portrait {:mouse-in? (fn [_ x y] - (or ((zone/box 103 70 206 116) x y) - ((zone/box 103 116 135 135) x y))) + :return-portrait-2 {:box [103 116 131 131] + :script (actions/get-script entities (if (actions/has-item? entities :portrait) + (actions/talk entities :ego "The shopkeep's portrait used to sit there.") + (get-portrait entities) + + )) + :scripts {:portrait (actions/get-script entities + (return-portrait entities)) + :teddy (actions/get-script entities + (return-teddy entities))}} + :return-portrait {:box [103 70 206 116] :script (actions/get-script entities (actions/talk entities :ego "It's the shopkeep's desk.")) :scripts {:portrait (actions/get-script entities (return-portrait entities)) @@ -393,11 +408,7 @@ :y 114 :baseline 120 :script (actions/get-script entities - (actions/walk-to entities :ego [140 58] :face :left) - (actions/play-animation entities :ego :reach) - (actions/remove-entity entities :portrait) - (actions/give entities :portrait) - (actions/talk entities :ego "It's a portrait. There's something on the back but it's too dim to read.")))) + (get-portrait entities)))) :teddy (rooms/make-entity :teddy teddy) :collision "inside-antique/collision.png" :apply-state (fn [_ entities]