fixed using inventory.

This commit is contained in:
2015-04-21 17:55:16 -07:00
parent ef46799b61
commit 7b6d0f7a88
2 changed files with 9 additions and 5 deletions

View File

@@ -128,7 +128,7 @@
(actions/talk entities :ego "I don't want to put something in there unless I'm sure I need to."))))
(defn wizard-dialogue [entities]
(actions/do-dialogue entities :ego "Hello there [RED]Gandarf[]!" :wizard "Oh no, not you again!")
(actions/do-dialogue entities :ego "Hello there Gandarf!" :wizard "Oh no, not you again!")
(actions/present-choices entities
{:choices ["What do you mean, \"Not you again?\""
{:run #(actions/respond entities % :wizard "I mean, you've wrecked my life and I never want to see you again.")

View File

@@ -75,10 +75,14 @@
(println "clicked " x y)
(let [interaction (first (filter #((:mouse-in? %) entities x y)
(get-in entities [:room :interactions])))
interacting-entity (first (sort-by (comp - :baseline) (filter #(and (:mouse-in? %)
(:get-script %)
((:mouse-in? %) entities x y))
(vals (dissoc (get-in entities [:room :entities]) :ego)))))
interactable-entities (if (= (doto (get-in entities [:cursor :current]) println) :main)
(vals (dissoc (get-in entities [:room :entities]) :ego))
(vals (get-in entities [:room :entities])))
interacting-entity (first (sort-by (comp - :baseline)
(filter #(and (:mouse-in? %)
(:get-script %)
((:mouse-in? %) entities x y))
interactable-entities)))
current-action (get-in entities [:actions :current])
;; TODO - hacky way of resetting queue