returnable stuff.
This commit is contained in:
@@ -92,6 +92,12 @@
|
|||||||
(actions/add-entity entities :portrait (get-in @entities [:room :portrait]))
|
(actions/add-entity entities :portrait (get-in @entities [:room :portrait]))
|
||||||
(actions/remove-item entities :portrait))
|
(actions/remove-item entities :portrait))
|
||||||
|
|
||||||
|
(defn return-teddy [entities]
|
||||||
|
(actions/walk-to entities :ego [242 49] :face :right)
|
||||||
|
(actions/play-animation entities :ego :reach)
|
||||||
|
(actions/add-entity entities :teddy (get-in @entities [:room :teddy]))
|
||||||
|
(actions/remove-item entities :teddy))
|
||||||
|
|
||||||
(defn has-to-return-teddy? [entities]
|
(defn has-to-return-teddy? [entities]
|
||||||
(and (actions/has-item? entities :teddy)
|
(and (actions/has-item? entities :teddy)
|
||||||
(not (get-in @entities [:state :allowed-to-keep-teddy?]))))
|
(not (get-in @entities [:state :allowed-to-keep-teddy?]))))
|
||||||
@@ -131,10 +137,7 @@
|
|||||||
(when (actions/has-item? entities :portrait)
|
(when (actions/has-item? entities :portrait)
|
||||||
(return-portrait entities))
|
(return-portrait entities))
|
||||||
(when (has-to-return-teddy? entities)
|
(when (has-to-return-teddy? entities)
|
||||||
(actions/walk-to entities :ego [242 49] :face :right)
|
(return-teddy teddy)))
|
||||||
(actions/play-animation entities :ego :reach)
|
|
||||||
(actions/add-entity entities :teddy teddy)
|
|
||||||
(actions/remove-item entities :teddy)))
|
|
||||||
|
|
||||||
(actions/walk-to entities :ego [235 15] :stop? false :skip-type :end)
|
(actions/walk-to entities :ego [235 15] :stop? false :skip-type :end)
|
||||||
(actions/walk-straight-to entities :ego [320 -5])
|
(actions/walk-straight-to entities :ego [320 -5])
|
||||||
@@ -144,6 +147,11 @@
|
|||||||
:script (actions/get-script entities (actions/talk entities :ego "It's the shopkeep's desk."))
|
:script (actions/get-script entities (actions/talk entities :ego "It's the shopkeep's desk."))
|
||||||
:scripts {:portrait (actions/get-script entities
|
:scripts {:portrait (actions/get-script entities
|
||||||
(return-portrait entities))}}
|
(return-portrait entities))}}
|
||||||
|
:return-teddy {:box [227 90 301 105]
|
||||||
|
:script (actions/get-script entities
|
||||||
|
(actions/talk entities :ego "It's a shelf."))
|
||||||
|
:scripts {:teddy (actions/get-script entities
|
||||||
|
(return-teddy entities))}}
|
||||||
:window {:box [210 125 256 183]
|
:window {:box [210 125 256 183]
|
||||||
:script (actions/get-script entities
|
:script (actions/get-script entities
|
||||||
(actions/talk entities :ego "It's a nice, big window."))
|
(actions/talk entities :ego "It's a nice, big window."))
|
||||||
@@ -258,6 +266,7 @@
|
|||||||
(actions/remove-entity entities :portrait)
|
(actions/remove-entity entities :portrait)
|
||||||
(actions/give 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."))))
|
(actions/talk entities :ego "It's a portrait. There's something on the back but it's too dim to read."))))
|
||||||
|
:teddy (rooms/make-entity :teddy teddy)
|
||||||
:collision "inside-antique/collision.png"
|
:collision "inside-antique/collision.png"
|
||||||
:apply-state (fn [_ entities]
|
:apply-state (fn [_ entities]
|
||||||
(as-> entities entities
|
(as-> entities entities
|
||||||
|
|||||||
Reference in New Issue
Block a user