added new screen.
This commit is contained in:
@@ -1 +1 @@
|
||||
{:active? true, :convinced-wizard? true, :time :night, :opened-bars? true, :inventory (:key :recipe :crowbar :rope :ladder :grass :medal :kiss :trophy :flask-1-strength :sword), :wizard-left? false, :dropped-ball? true, :hay-searches 4, :clues #{}, :warden-sleeping? true, :current-riddle :wool, :warden-fast-asleep? true, :last-room :outside-house, :wants-toy true, :bent-bars? true, :chest-contents [], :mints-eaten 0, :object nil, :obtained-items #{:key :rope :kiss :medal :sword :flask-1 :grass :ladder :trophy :crowbar :ball-n-chain}}
|
||||
{:active? true, :convinced-wizard? true, :time :night, :opened-bars? true, :inventory (:key :glass-eye :recipe :crowbar :rope :ladder :grass :medal :kiss :trophy :flask-1-strength :sword), :wizard-left? false, :dropped-ball? true, :hay-searches 4, :clues #{}, :warden-sleeping? true, :current-riddle :wool, :warden-fast-asleep? true, :last-room :outside-house, :wants-toy true, :bent-bars? true, :chest-contents [], :mints-eaten 0, :object nil, :obtained-items #{:key :rope :kiss :medal :sword :flask-1 :grass :ladder :trophy :crowbar :ball-n-chain}}
|
||||
|
||||
@@ -1 +1 @@
|
||||
{:active? true, :convinced-wizard? true, :inventory [] :chest-contents [:ladder :recipe :grass :medal :kiss :trophy :flask-1-strength :sword ], :wizard-left? false, :clues #{}, :current-riddle :wool, :last-room :inside-jail, :wants-toy true, :mints-eaten 0, :object nil, :obtained-items #{:kiss :medal :sword :flask-1 :grass :ladder :trophy} :time :night}
|
||||
{:active? true, :convinced-wizard? true, :inventory [] :chest-contents [:ladder :glass-eye :recipe :grass :medal :kiss :trophy :flask-1-strength :sword ], :wizard-left? false, :clues #{}, :current-riddle :wool, :last-room :inside-jail, :wants-toy true, :mints-eaten 0, :object nil, :obtained-items #{:kiss :medal :sword :flask-1 :grass :ladder :trophy} :time :night}
|
||||
|
||||
@@ -1 +1 @@
|
||||
{:active? true, :convinced-wizard? true, :inventory [:ladder :recipe :grass :medal :kiss :trophy :flask-1-strength], :wizard-left? false, :clues #{}, :current-riddle :wool, :last-room :inside-castle, :wants-toy true, :mints-eaten 0, :object nil, :obtained-items #{:kiss :medal :flask-1 :grass :ladder :trophy} :time :day}
|
||||
{:active? true, :convinced-wizard? true, :inventory [:ladder :glass-eye :recipe :grass :medal :kiss :trophy :flask-1-strength], :wizard-left? false, :clues #{}, :current-riddle :wool, :last-room :inside-castle, :wants-toy true, :mints-eaten 0, :object nil, :obtained-items #{:kiss :medal :flask-1 :grass :ladder :trophy} :time :day}
|
||||
|
||||
BIN
desktop/resources/castle-gate/background.png
Normal file
BIN
desktop/resources/castle-gate/background.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 47 KiB |
BIN
desktop/resources/castle-gate/castle-door.psd
Normal file
BIN
desktop/resources/castle-gate/castle-door.psd
Normal file
Binary file not shown.
BIN
desktop/resources/castle-gate/collision.png
Normal file
BIN
desktop/resources/castle-gate/collision.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
Binary file not shown.
@@ -41,7 +41,9 @@
|
||||
(every? (partial has-obtained? entities) items))
|
||||
|
||||
(defn has-one-of? [entities items]
|
||||
(seq (set/intersection (set (get-in entities [:state :inventory])) (set items))))
|
||||
(if (map? entities)
|
||||
(seq (set/intersection (set (get-in entities [:state :inventory])) (set items)))
|
||||
(seq (set/intersection (set (get-in @entities [:state :inventory])) (set items)))))
|
||||
|
||||
(defmacro run-action [entities & forms]
|
||||
`(let [c# (chan)]
|
||||
|
||||
44
desktop/src-common/advent/screens/rooms/castle_gate.clj
Normal file
44
desktop/src-common/advent/screens/rooms/castle_gate.clj
Normal file
@@ -0,0 +1,44 @@
|
||||
(ns advent.screens.rooms.castle-gate
|
||||
(:require [advent.screens.rooms :as rooms]
|
||||
[advent.actions :as actions]
|
||||
[advent.screens.items :as items]
|
||||
[advent.utils :as utils]
|
||||
[clojure.zip :as zip]
|
||||
[play-clj.core :refer :all]
|
||||
[play-clj.ui :refer :all]
|
||||
[play-clj.utils :refer :all]
|
||||
[play-clj.g2d :refer :all]))
|
||||
|
||||
|
||||
(defn make-night [entities]
|
||||
entities)
|
||||
|
||||
|
||||
(defn make [screen]
|
||||
(rooms/make :music {:day :town-2 :night :night}
|
||||
:interactions {:right-dir {:box [300 40 320 83]
|
||||
:script (actions/get-script entities
|
||||
(actions/walk-to entities :ego [301 46] :face :right)
|
||||
(actions/walk-straight-to entities :ego [340 40])
|
||||
(actions/transition-background entities :outside-castle [82 180])
|
||||
(actions/walk-to entities :ego [129 148]))
|
||||
:cursor :right}
|
||||
:left-dir {:box [105 93 169 212]
|
||||
:script (actions/get-script entities
|
||||
(actions/walk-straight-to entities :ego [157 83])
|
||||
(actions/transition-background entities :inside-castle [280 145])
|
||||
(actions/walk-to entities :ego [245 90]))
|
||||
:cursor :left}}
|
||||
|
||||
:layers {:day [(assoc (texture "castle-gate/background.png") :x 0 :y 0 :baseline 0)]
|
||||
:night [(assoc (texture "castle-gate/background.png") :x 0 :y 0 :baseline 0)]}
|
||||
:entities {}
|
||||
|
||||
:collision "castle-gate/collision.png"
|
||||
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.30)
|
||||
:apply-state (fn [entities]
|
||||
(as-> entities entities
|
||||
(if (= :night (get-in entities [:state :time]))
|
||||
(make-night entities)
|
||||
entities)))
|
||||
:start-pos [300 45]))
|
||||
@@ -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
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
[advent.screens.rooms :as rooms]
|
||||
[advent.screens.rooms.common :as common]
|
||||
[advent.screens.items :as items]
|
||||
[advent.screens.rooms.castle-gate :as rooms.castle-gate]
|
||||
[advent.screens.rooms.outside-house :as rooms.outside-house]
|
||||
[advent.screens.rooms.inside-house :as rooms.inside-house]
|
||||
[advent.screens.rooms.inside-castle :as rooms.inside-castle]
|
||||
@@ -328,6 +329,7 @@
|
||||
:inside-cafeteria (rooms.inside-cafeteria/make screen)
|
||||
:inside-antique (rooms.inside-antique/make screen)
|
||||
:inside-jail (rooms.inside-jail/make screen)
|
||||
:castle-gate (rooms.castle-gate/make screen)
|
||||
:outside-jail (rooms.outside-jail/make screen)
|
||||
:outside-castle (rooms.outside-castle/make screen)}
|
||||
entities {:rooms rooms
|
||||
|
||||
Reference in New Issue
Block a user