state updates screens.
This commit is contained in:
@@ -64,4 +64,9 @@
|
|||||||
(actions/talk entities :ego "I guess I'm too far away.")))})
|
(actions/talk entities :ego "I guess I'm too far away.")))})
|
||||||
cat-stand)}
|
cat-stand)}
|
||||||
:collision "cat-tree/collision.png"
|
:collision "cat-tree/collision.png"
|
||||||
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.20))))
|
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.20)
|
||||||
|
:apply-state (fn [entities]
|
||||||
|
(as-> entities entities
|
||||||
|
(if (actions/has-item? entities items/certificate)
|
||||||
|
(update-in entities [:room :entities] #(dissoc % :cat))
|
||||||
|
entities))))))
|
||||||
|
|||||||
@@ -147,4 +147,9 @@
|
|||||||
:script (actions/get-script entities
|
:script (actions/get-script entities
|
||||||
(actions/talk entities :ladder-guard "Do not toucheth, young sire.")))}
|
(actions/talk entities :ladder-guard "Do not toucheth, young sire.")))}
|
||||||
:collision "inside-cafeteria/collision.png"
|
:collision "inside-cafeteria/collision.png"
|
||||||
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.50))))
|
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.50)
|
||||||
|
:apply-state (fn [entities]
|
||||||
|
(as-> entities entities
|
||||||
|
(if (actions/has-item? entities items/ladder)
|
||||||
|
(update-in entities [:room :entities] #(dissoc % :ladder))
|
||||||
|
entities))))))
|
||||||
|
|||||||
@@ -166,4 +166,9 @@
|
|||||||
:anim nil
|
:anim nil
|
||||||
:talk game-player-talk)}
|
:talk game-player-talk)}
|
||||||
:collision "inside-castle/collision.png"
|
:collision "inside-castle/collision.png"
|
||||||
:scale-fn (utils/scaler-fn-from-image "inside-castle/scale.png" 0.25 1.00))))
|
:scale-fn (utils/scaler-fn-from-image "inside-castle/scale.png" 0.25 1.00)
|
||||||
|
:apply-state (fn [entities]
|
||||||
|
(as-> entities entities
|
||||||
|
(if (actions/has-item? entities items/ladder)
|
||||||
|
(update-in entities [:room :entities] #(dissoc % :ladder))
|
||||||
|
entities))))))
|
||||||
|
|||||||
@@ -82,4 +82,9 @@
|
|||||||
(actions/do-dialogue entities :ego "Hey you think I could have this flask?"
|
(actions/do-dialogue entities :ego "Hey you think I could have this flask?"
|
||||||
:wizard "Sure.")))}
|
:wizard "Sure.")))}
|
||||||
:collision "inside-house/collision.png"
|
:collision "inside-house/collision.png"
|
||||||
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.75))))
|
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.75)
|
||||||
|
:apply-state (fn [entities]
|
||||||
|
(as-> entities entities
|
||||||
|
(if (actions/has-one-of? entities [items/flask-1 items/flask-1-with-cream-of-mushroom items/flask-1-strength items/flask-1-with-mushrooms items/flask-1-with-milk])
|
||||||
|
(update-in entities [:room :entities] #(dissoc % :flask))
|
||||||
|
entities))))))
|
||||||
|
|||||||
@@ -179,7 +179,10 @@
|
|||||||
:carrot (actions/get-script entities
|
:carrot (actions/get-script entities
|
||||||
(actions/walk-to entities :ego ego-sheep-loc :face :left)
|
(actions/walk-to entities :ego ego-sheep-loc :face :left)
|
||||||
(actions/talk entities :ego "Come on girl, get the carrot!")
|
(actions/talk entities :ego "Come on girl, get the carrot!")
|
||||||
(actions/walk-straight-to entities :sheep [95 150]))
|
(actions/walk-straight-to entities :sheep [95 150])
|
||||||
|
(actions/play-animation entities :ego :reach)
|
||||||
|
(actions/remove-item entities items/carrot)
|
||||||
|
(actions/update-state entities #(assoc % :coaxed-sheep? true)))
|
||||||
:flask-1 (actions/get-script entities
|
:flask-1 (actions/get-script entities
|
||||||
(if (is-sheep-close? @entities)
|
(if (is-sheep-close? @entities)
|
||||||
(do (actions/walk-to entities :ego ego-sheep-loc :face :left)
|
(do (actions/walk-to entities :ego ego-sheep-loc :face :left)
|
||||||
@@ -195,4 +198,9 @@
|
|||||||
:stand sheep-stand})
|
:stand sheep-stand})
|
||||||
sheep-stand)}
|
sheep-stand)}
|
||||||
:collision "outsidehouse/collision.png"
|
:collision "outsidehouse/collision.png"
|
||||||
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.00))))
|
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.00)
|
||||||
|
:apply-state (fn [entities]
|
||||||
|
(as-> entities entities
|
||||||
|
(if (get-in entities [:state :coaxed-sheep?])
|
||||||
|
(update-in entities [:room :entities :sheep] #(assoc % :x 95 :y 150 :baseline 40))
|
||||||
|
entities))))))
|
||||||
|
|||||||
@@ -226,7 +226,7 @@
|
|||||||
:inside-fangald (make-music "inside-fangald.ogg")}
|
:inside-fangald (make-music "inside-fangald.ogg")}
|
||||||
:state {:object nil
|
:state {:object nil
|
||||||
:active? true
|
:active? true
|
||||||
:inventory [items/grass]
|
:inventory [items/grass items/carrot]
|
||||||
:clues #{}
|
:clues #{}
|
||||||
:mints-eaten 0}
|
:mints-eaten 0}
|
||||||
:actions {:object nil
|
:actions {:object nil
|
||||||
|
|||||||
Reference in New Issue
Block a user