more detail on castle screen.

This commit is contained in:
2014-12-09 16:16:57 -08:00
parent 546bbccb3d
commit bb7dcb3628
4 changed files with 72 additions and 54 deletions

View File

@@ -29,6 +29,14 @@
((set (get-in entities [:state :inventory])) item)
((set (get-in @entities [:state :inventory])) item)))
(defn has-obtained? [entities item]
(if (map? entities)
((get-in entities [:state :obtained-items]) item)
((get-in @entities [:state :obtained-items]) item)))
(defn has-obtained-one-of? [entities items]
(seq (set/intersection (get-in entities [:state :obtained-items]) (set items))))
(defn has-one-of? [entities items]
(seq (set/intersection (set (get-in entities [:state :inventory])) (set items))))
@@ -346,6 +354,7 @@
(-> entities
(update-in [:state :inventory] #(conj % item))
(update-in [:state :obtained-items] #(conj % item))
(assoc-in [:cursor :current] ((:all-items entities) item))))
(continue [this screen entities] entities)