Merge branch 'background_scripts'
This commit is contained in:
@@ -97,7 +97,7 @@
|
||||
(update-in entities [:tweens] dissoc :coin-y)))
|
||||
|
||||
(actions/walk-straight-to entities :coin-flip [212 90] :update-baseline? false :speed 3.0)
|
||||
(screen! dialogue/talking-screen :stop-talk :target-id :ego)
|
||||
(screen! dialogue/talking-screen :stop-talk)
|
||||
(actions/do-stop entities :ego)
|
||||
|
||||
(actions/walk-straight-to entities :coin-flip [210 105] :update-baseline? false :speed 1.0)
|
||||
|
||||
@@ -281,7 +281,7 @@
|
||||
(defn return-from-island [screen entities]
|
||||
|
||||
|
||||
(when (and (not (get-in entities [:actions :script-running?]))
|
||||
(when (and (not (get-in entities [:fg-actions :script-running?]))
|
||||
(get-in entities [:state :active?])
|
||||
(get-in entities [:room :entities :fairy-godfather :distracted?]))
|
||||
(if (> (get-in entities [:room :entities :fairy-godfather :distracted-time] 0) 15)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
(actions/update-entities entities (fn [e] (assoc-in e [:room :bloodclot-timer] 0))))}]}))
|
||||
|
||||
(defn add-second [screen entities]
|
||||
(when (and (not (get-in entities [:actions :script-running?]))
|
||||
(when (and (not (get-in entities [:fg-actions :script-running?]))
|
||||
(get-in entities [:state :active?]))
|
||||
(if (> (get-in entities [:room :bloodclot-timer] 0) 7)
|
||||
(do
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
[play-clj.g2d :refer :all]))
|
||||
|
||||
(defn brian [screen entities]
|
||||
(when (and (not (get-in entities [:actions :script-running?]))
|
||||
(when (and (not (get-in entities [:fg-actions :script-running?]))
|
||||
(not (get-in entities [:bg-actions :script-running?]))
|
||||
(get-in entities [:state :active?])
|
||||
(get-in entities [:room :entities :game-player]))
|
||||
((actions/get-script entities
|
||||
((actions/get-bg-script entities
|
||||
((rand-nth [#(actions/do-dialogue entities :game-player "2 to the power of pi."
|
||||
:game-player "No, that's not right.")
|
||||
#(actions/do-dialogue entities :game-player "Eureka!"
|
||||
@@ -114,7 +115,8 @@
|
||||
{:run #(actions/respond entities % :game-player "Fine by me.")}]})
|
||||
|
||||
(defn walk-to-player [entities]
|
||||
(actions/walk-to entities :ego [209 74] :face :right))
|
||||
(actions/walk-to entities :ego [209 74] :face :right)
|
||||
(actions/do-force-end entities :bg-actions))
|
||||
|
||||
(defn brian-pause-from-work [entities]
|
||||
(actions/play-animation entities :game-player :pause-from-work :stop? false)
|
||||
@@ -250,6 +252,7 @@
|
||||
(actions/transition-music entities nil :duration 0.15))
|
||||
|
||||
(defn pull-sword [entities]
|
||||
(actions/do-force-end entities :bg-actions)
|
||||
(actions/play-animation entities :ego :reach-start :stop? false)
|
||||
(actions/pause-camera entities)
|
||||
(actions/transition-music entities :pull-sword
|
||||
@@ -362,7 +365,7 @@
|
||||
]
|
||||
(rooms/make :music {:day :town-1 :night :night :sunrise :night}
|
||||
:name "Inside castle"
|
||||
:timers {:brian [10.0 20.0 brian]}
|
||||
:timers {:brian [10.0 2.0 brian]}
|
||||
:interactions
|
||||
{:right-door {:box [286 140 306 160]
|
||||
:cursor :right
|
||||
|
||||
@@ -334,7 +334,7 @@
|
||||
(get-in entities [:room :entities :ego :right :walk])} (get-in entities [:room :entities :ego :anim]))]
|
||||
(if is-walking?
|
||||
(let [entities (-> entities
|
||||
(update-in [:actions] #(assoc % :channel (chan) :current nil :started? false :script-running? false))
|
||||
(update-in [:fg-actions] #(assoc % :channel (chan) :current nil :started? false :script-running? false))
|
||||
(update-in [:room :entities :ego] #(actions/start-animation screen % :stand)))]
|
||||
((actions/get-script entities
|
||||
(actions/stop-walking entities :ego)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
[play-clj.g2d :refer :all]))
|
||||
|
||||
(defn taunt [screen entities]
|
||||
(when (and (not (get-in entities [:actions :script-running?]))
|
||||
(when (and (not (get-in entities [:fg-actions :script-running?]))
|
||||
(get-in entities [:state :active?])
|
||||
(not (get-in entities [:state :blergh-dead?]))
|
||||
(not (actions/has-item? entities :magic-slingshot)))
|
||||
@@ -30,7 +30,7 @@
|
||||
nil)
|
||||
|
||||
(defn shock [screen entities]
|
||||
(when (and (not (get-in entities [:actions :script-running?]))
|
||||
(when (and (not (get-in entities [:fg-actions :script-running?]))
|
||||
(get-in entities [:state :active?])
|
||||
(not (get-in entities [:state :blergh-dead?]))
|
||||
(actions/has-item? entities :magic-slingshot))
|
||||
|
||||
Reference in New Issue
Block a user