From 438ed4f36f579a78a69815fd27a73c194df29a4b Mon Sep 17 00:00:00 2001 From: Remington Covert Date: Mon, 6 Oct 2014 12:55:28 -0700 Subject: [PATCH] nicer ux when getting flask. --- desktop/src-common/advent/actions.clj | 14 ++++++++++++++ .../advent/screens/rooms/inside_house.clj | 1 + 2 files changed, 15 insertions(+) diff --git a/desktop/src-common/advent/actions.clj b/desktop/src-common/advent/actions.clj index 781499fe..527d116b 100644 --- a/desktop/src-common/advent/actions.clj +++ b/desktop/src-common/advent/actions.clj @@ -274,6 +274,20 @@ (can-skip? [this screen entities] false))) +(defn remove-entity [entities entity] + (run-action entities + (begin [this screen entities] + (update-in entities [:room :entities] #(dissoc % entity))) + + (continue [this screen entities] entities) + + (done? [this screen entities] true) + + (terminate [this screen entities] entities) + + (can-skip? [this screen entities] + false))) + (defn transition-background [entities new-background [x y]] (run-action entities (begin [this screen entities] diff --git a/desktop/src-common/advent/screens/rooms/inside_house.clj b/desktop/src-common/advent/screens/rooms/inside_house.clj index 14e63c76..fd708c19 100644 --- a/desktop/src-common/advent/screens/rooms/inside_house.clj +++ b/desktop/src-common/advent/screens/rooms/inside_house.clj @@ -33,6 +33,7 @@ :flask (assoc (texture "inside-house/flask.png") :x 265 :y 80 :baseline 240 :script (actions/get-script entities + (actions/remove-entity entities :flask) (actions/give entities :flask) (actions/do-dialogue entities :ego "Hey you think I could have this flask?" :wizard "Sure.")))}