opening the cell.
This commit is contained in:
@@ -99,13 +99,16 @@
|
|||||||
(or (get-in entity [(:facing entity) anim])
|
(or (get-in entity [(:facing entity) anim])
|
||||||
(get entity anim))))
|
(get entity anim))))
|
||||||
|
|
||||||
(defn start-animation [screen entity anim]
|
(defn start-animation
|
||||||
(let [new-anim (find-animation entity anim)]
|
([entity anim]
|
||||||
(if (and anim (not= new-anim (:anim entity)))
|
(start-animation {:total-time 0} entity anim))
|
||||||
(assoc entity
|
([screen entity anim]
|
||||||
:anim new-anim
|
(let [new-anim (find-animation entity anim)]
|
||||||
:anim-start (:total-time screen))
|
(if (and anim (not= new-anim (:anim entity)))
|
||||||
entity)))
|
(assoc entity
|
||||||
|
:anim new-anim
|
||||||
|
:anim-start (:total-time screen))
|
||||||
|
entity))))
|
||||||
|
|
||||||
(defn stop [screen entities target-id & {:keys [face]}]
|
(defn stop [screen entities target-id & {:keys [face]}]
|
||||||
(update-in entities [:room :entities target-id] (comp #(start-animation screen % :stand) (if face #(assoc % :facing face) identity))))
|
(update-in entities [:room :entities target-id] (comp #(start-animation screen % :stand) (if face #(assoc % :facing face) identity))))
|
||||||
|
|||||||
@@ -86,7 +86,8 @@
|
|||||||
(actions/play-animation entities :ego :squat)
|
(actions/play-animation entities :ego :squat)
|
||||||
(actions/do-dialogue entities
|
(actions/do-dialogue entities
|
||||||
:ego "You know, in some games, you have to try multiple times."
|
:ego "You know, in some games, you have to try multiple times."
|
||||||
:ego "I'm beginning to feel like this isn't that game.")))
|
:ego "But I have a feeling each time you click on this hay, I'm going to find nothing."
|
||||||
|
:ego "Maybe you should give it a rest.")))
|
||||||
(actions/update-state entities #(assoc % :hay-searches (inc hay-searches)))))
|
(actions/update-state entities #(assoc % :hay-searches (inc hay-searches)))))
|
||||||
|
|
||||||
(defn make [screen]
|
(defn make [screen]
|
||||||
@@ -105,7 +106,11 @@
|
|||||||
:script (actions/get-script entities
|
:script (actions/get-script entities
|
||||||
(actions/walk-to entities :ego [174 80] :face :right)
|
(actions/walk-to entities :ego [174 80] :face :right)
|
||||||
(actions/play-animation entities :ego :reach)
|
(actions/play-animation entities :ego :reach)
|
||||||
(actions/talk entities :ego "There's no helping it. It's locked."))}
|
(actions/talk entities :ego "There's no helping it. It's locked."))
|
||||||
|
:scripts {:key (actions/get-script entities
|
||||||
|
(actions/walk-to entities :ego [174 80] :face :right)
|
||||||
|
(actions/play-animation entities :ego :reach)
|
||||||
|
(actions/talk entities :ego "Yes, that's it!"))}}
|
||||||
:window {:box [98 110 118 140]
|
:window {:box [98 110 118 140]
|
||||||
:script (actions/get-script entities
|
:script (actions/get-script entities
|
||||||
(actions/walk-to entities :ego [102 88] :face :right)
|
(actions/walk-to entities :ego [102 88] :face :right)
|
||||||
@@ -152,6 +157,10 @@
|
|||||||
:scale-fn (utils/scaler-fn-with-baseline 0 0.50 1.5)
|
:scale-fn (utils/scaler-fn-with-baseline 0 0.50 1.5)
|
||||||
:start-pos [130 85]
|
:start-pos [130 85]
|
||||||
:apply-state (fn [entities]
|
:apply-state (fn [entities]
|
||||||
(if (actions/has-item? entities :ball-n-chain)
|
(as-> entities entities
|
||||||
(update-in entities [:room :entities] #(dissoc % :ball-n-chain))
|
(if (actions/has-item? entities :ball-n-chain)
|
||||||
entities)))))
|
(update-in entities [:room :entities] #(dissoc % :ball-n-chain))
|
||||||
|
entities)
|
||||||
|
(if (get-in entities [:state :warden-sleeping?])
|
||||||
|
(update-in entities [:room :entities :warden] #(actions/start-animation % :sleep))
|
||||||
|
entities))))))
|
||||||
|
|||||||
Reference in New Issue
Block a user