added new screen.

This commit is contained in:
2014-12-28 18:57:53 -08:00
parent 905398a3f5
commit 218afe3973
11 changed files with 68 additions and 7 deletions

View File

@@ -119,6 +119,21 @@
(get-in @entities [:state :wants-toy]) (do-wants-toy-conversation entities)
:else (do-initial-peddler-conversation entities)))
(defn should-block? [entities]
(and (= :night (get-in @entities [:state :time]))
(actions/has-obtained? entities :spell-component)
(actions/has-one-of? entities [:used-earplugs :glass-eye :motivational-tapes])))
(defn go-through-gate [entities]
(actions/walk-to entities :ego [82 180])
(if (should-block? entities)
(do (actions/transition-background entities :castle-gate [340 40])
(actions/walk-straight-to entities :ego [300 45]))
(do
(actions/transition-background entities :inside-castle [280 145])
(actions/walk-to entities :ego [245 90]))))
(defn make-night [entities]
(-> entities
(update-in [:room :entities] #(dissoc % :peddler))
@@ -152,9 +167,7 @@
:door {:box [66 180 85 195]
:script (actions/get-script
entities
(actions/walk-to entities :ego [82 180])
(actions/transition-background entities :inside-castle [280 145])
(actions/walk-to entities :ego [245 90]))
(go-through-gate entities))
:cursor :left}
:castle {:box [0 181 100 240]
:script (actions/get-script entities