returnable stuff.

This commit is contained in:
Bryce Covert
2015-08-19 06:46:49 -07:00
parent 274e22ef18
commit c7a9114823

View File

@@ -92,6 +92,12 @@
(actions/add-entity entities :portrait (get-in @entities [:room :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]
(and (actions/has-item? entities :teddy)
(not (get-in @entities [:state :allowed-to-keep-teddy?]))))
@@ -131,10 +137,7 @@
(when (actions/has-item? entities :portrait)
(return-portrait entities))
(when (has-to-return-teddy? entities)
(actions/walk-to entities :ego [242 49] :face :right)
(actions/play-animation entities :ego :reach)
(actions/add-entity entities :teddy teddy)
(actions/remove-item entities :teddy)))
(return-teddy teddy)))
(actions/walk-to entities :ego [235 15] :stop? false :skip-type :end)
(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."))
:scripts {:portrait (actions/get-script 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]
:script (actions/get-script entities
(actions/talk entities :ego "It's a nice, big window."))
@@ -258,6 +266,7 @@
(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."))))
:teddy (rooms/make-entity :teddy teddy)
:collision "inside-antique/collision.png"
:apply-state (fn [_ entities]
(as-> entities entities