diff --git a/desktop/resources/ego/shoot.png b/desktop/resources/ego/shoot.png
new file mode 100644
index 00000000..ab58b799
Binary files /dev/null and b/desktop/resources/ego/shoot.png differ
diff --git a/desktop/resources/ego/shoot.pxa/0.pxi b/desktop/resources/ego/shoot.pxa/0.pxi
new file mode 100644
index 00000000..a151f6f5
Binary files /dev/null and b/desktop/resources/ego/shoot.pxa/0.pxi differ
diff --git a/desktop/resources/ego/shoot.pxa/1.pxi b/desktop/resources/ego/shoot.pxa/1.pxi
new file mode 100644
index 00000000..91bc5f43
Binary files /dev/null and b/desktop/resources/ego/shoot.pxa/1.pxi differ
diff --git a/desktop/resources/ego/shoot.pxa/2.pxi b/desktop/resources/ego/shoot.pxa/2.pxi
new file mode 100644
index 00000000..7c288ff2
Binary files /dev/null and b/desktop/resources/ego/shoot.pxa/2.pxi differ
diff --git a/desktop/resources/ego/shoot.pxa/3.pxi b/desktop/resources/ego/shoot.pxa/3.pxi
new file mode 100644
index 00000000..e49aa64b
Binary files /dev/null and b/desktop/resources/ego/shoot.pxa/3.pxi differ
diff --git a/desktop/resources/ego/shoot.pxa/4.pxi b/desktop/resources/ego/shoot.pxa/4.pxi
new file mode 100644
index 00000000..ce2db2b5
Binary files /dev/null and b/desktop/resources/ego/shoot.pxa/4.pxi differ
diff --git a/desktop/resources/ego/shoot.pxa/5.pxi b/desktop/resources/ego/shoot.pxa/5.pxi
new file mode 100644
index 00000000..8d7eace7
Binary files /dev/null and b/desktop/resources/ego/shoot.pxa/5.pxi differ
diff --git a/desktop/resources/ego/shoot.pxa/CelData.plist b/desktop/resources/ego/shoot.pxa/CelData.plist
new file mode 100644
index 00000000..245204bc
--- /dev/null
+++ b/desktop/resources/ego/shoot.pxa/CelData.plist
@@ -0,0 +1,30 @@
+
+
+
+
+
+ duration
+ 1
+
+
+ duration
+ 1
+
+
+ duration
+ 1
+
+
+ duration
+ 1
+
+
+ duration
+ 1
+
+
+ duration
+ 1
+
+
+
diff --git a/desktop/resources/inside-castle/background-sunrise.png b/desktop/resources/inside-castle/background-sunrise.png
new file mode 100644
index 00000000..58fa1a99
Binary files /dev/null and b/desktop/resources/inside-castle/background-sunrise.png differ
diff --git a/desktop/resources/inside-castle/inside-castle-sunrise.png b/desktop/resources/inside-castle/inside-castle-sunrise.png
new file mode 100644
index 00000000..67d75bc3
Binary files /dev/null and b/desktop/resources/inside-castle/inside-castle-sunrise.png differ
diff --git a/desktop/resources/outside-castle/background-sunrise.png b/desktop/resources/outside-castle/background-sunrise.png
new file mode 100644
index 00000000..8342040b
Binary files /dev/null and b/desktop/resources/outside-castle/background-sunrise.png differ
diff --git a/desktop/resources/space/blergh-flex.png b/desktop/resources/space/blergh-flex.png
index 76f18644..61cc7227 100644
Binary files a/desktop/resources/space/blergh-flex.png and b/desktop/resources/space/blergh-flex.png differ
diff --git a/desktop/resources/space/blergh-stand.png b/desktop/resources/space/blergh-stand.png
index 42ee2ea1..7761868c 100644
Binary files a/desktop/resources/space/blergh-stand.png and b/desktop/resources/space/blergh-stand.png differ
diff --git a/desktop/resources/space/blergh-swing.png b/desktop/resources/space/blergh-swing.png
index daf45cff..380439ed 100644
Binary files a/desktop/resources/space/blergh-swing.png and b/desktop/resources/space/blergh-swing.png differ
diff --git a/desktop/resources/space/blergh-talk.png b/desktop/resources/space/blergh-talk.png
index aaa90e5e..c91736a4 100644
Binary files a/desktop/resources/space/blergh-talk.png and b/desktop/resources/space/blergh-talk.png differ
diff --git a/desktop/resources/space/broken-jewel.png b/desktop/resources/space/broken-jewel.png
new file mode 100644
index 00000000..9a3df669
Binary files /dev/null and b/desktop/resources/space/broken-jewel.png differ
diff --git a/desktop/resources/space/bullet.png b/desktop/resources/space/bullet.png
new file mode 100644
index 00000000..4d185fa6
Binary files /dev/null and b/desktop/resources/space/bullet.png differ
diff --git a/desktop/resources/space/bullet.pxa/0.pxi b/desktop/resources/space/bullet.pxa/0.pxi
new file mode 100644
index 00000000..143966b7
Binary files /dev/null and b/desktop/resources/space/bullet.pxa/0.pxi differ
diff --git a/desktop/resources/space/bullet.pxa/1.pxi b/desktop/resources/space/bullet.pxa/1.pxi
new file mode 100644
index 00000000..5aafb0c3
Binary files /dev/null and b/desktop/resources/space/bullet.pxa/1.pxi differ
diff --git a/desktop/resources/space/bullet.pxa/2.pxi b/desktop/resources/space/bullet.pxa/2.pxi
new file mode 100644
index 00000000..d95b0443
Binary files /dev/null and b/desktop/resources/space/bullet.pxa/2.pxi differ
diff --git a/desktop/resources/space/bullet.pxa/3.pxi b/desktop/resources/space/bullet.pxa/3.pxi
new file mode 100644
index 00000000..e38d37a5
Binary files /dev/null and b/desktop/resources/space/bullet.pxa/3.pxi differ
diff --git a/desktop/resources/space/bullet.pxa/4.pxi b/desktop/resources/space/bullet.pxa/4.pxi
new file mode 100644
index 00000000..8e885b48
Binary files /dev/null and b/desktop/resources/space/bullet.pxa/4.pxi differ
diff --git a/desktop/resources/space/bullet.pxa/5.pxi b/desktop/resources/space/bullet.pxa/5.pxi
new file mode 100644
index 00000000..58d7748d
Binary files /dev/null and b/desktop/resources/space/bullet.pxa/5.pxi differ
diff --git a/desktop/resources/space/bullet.pxa/6.pxi b/desktop/resources/space/bullet.pxa/6.pxi
new file mode 100644
index 00000000..e222ac94
Binary files /dev/null and b/desktop/resources/space/bullet.pxa/6.pxi differ
diff --git a/desktop/resources/space/bullet.pxa/7.pxi b/desktop/resources/space/bullet.pxa/7.pxi
new file mode 100644
index 00000000..121ff0d1
Binary files /dev/null and b/desktop/resources/space/bullet.pxa/7.pxi differ
diff --git a/desktop/resources/space/bullet.pxa/CelData.plist b/desktop/resources/space/bullet.pxa/CelData.plist
new file mode 100644
index 00000000..3cc9cf5c
--- /dev/null
+++ b/desktop/resources/space/bullet.pxa/CelData.plist
@@ -0,0 +1,38 @@
+
+
+
+
+
+ duration
+ 1
+
+
+ duration
+ 1
+
+
+ duration
+ 1
+
+
+ duration
+ 1
+
+
+ duration
+ 1
+
+
+ duration
+ 1
+
+
+ duration
+ 1
+
+
+ duration
+ 1
+
+
+
diff --git a/desktop/src-common/advent/actions.clj b/desktop/src-common/advent/actions.clj
index f29e3912..402b91c5 100644
--- a/desktop/src-common/advent/actions.clj
+++ b/desktop/src-common/advent/actions.clj
@@ -516,7 +516,11 @@
(>= (get-in entities [:transition :opacity]) 1.0))
(terminate [this screen entities]
- entities)
+ (if-let [next-time (get-in entities [:state :next-time])]
+ (-> entities
+ (assoc-in [:state :time] next-time)
+ (assoc-in [:state :next-time] nil))
+ entities))
(can-skip? [this screen entities]
false))
(run-action entities
diff --git a/desktop/src-common/advent/screens/rooms/inside_castle.clj b/desktop/src-common/advent/screens/rooms/inside_castle.clj
index dae5330e..771ba0e5 100644
--- a/desktop/src-common/advent/screens/rooms/inside_castle.clj
+++ b/desktop/src-common/advent/screens/rooms/inside_castle.clj
@@ -178,7 +178,7 @@
trophy (utils/make-anim "inside-castle/trophy.png" [16 16] 0.1 (flatten [(repeat 50 0) 1 2 3 3 3 3 2 1]))
pull-sword-anim (utils/make-anim "inside-castle/pull-sword.png" [95 190] 0.10 (flatten [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 3 2 3 2 3 3 2 3 2 2 3 3 2 3 2 3 2 3 2 3 2 3 2 2 3 3 3 2 3 2 3 3 2 3 2 3 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ]))
monocle (utils/make-anim "inside-castle/monocle.png" [7 7] 0.05 (flatten [(repeat 70 0) 1 2 3 3 3 2 1]))]
- (rooms/make :music {:day :town-1 :night :night}
+ (rooms/make :music {:day :town-1 :night :night :sunrise :night}
:interactions
{:right-door {:box [286 140 306 160]
:cursor :right
@@ -249,7 +249,8 @@
:layers {:day [(assoc (texture "inside-castle/background.png") :x 0 :y 0 :baseline 0)
(assoc (texture "inside-castle/pedestal-overlay.png") :x 0 :y 0 :baseline 135)]
:night [(assoc (texture "inside-castle/background-dark.png") :x 0 :y 0 :baseline 0)
- (assoc (texture "inside-castle/pedestal-overlay-dark.png") :x 0 :y 0 :baseline 135)]}
+ (assoc (texture "inside-castle/pedestal-overlay-dark.png") :x 0 :y 0 :baseline 135)]
+ :sunrise [(assoc (texture "inside-castle/background-sunrise.png") :x 0 :y 0 :baseline 0)]}
:blackout (assoc (texture "black.png")
:x 0 :y 0
:width 320
diff --git a/desktop/src-common/advent/screens/rooms/outside_castle.clj b/desktop/src-common/advent/screens/rooms/outside_castle.clj
index 0536a442..97cc78e7 100644
--- a/desktop/src-common/advent/screens/rooms/outside_castle.clj
+++ b/desktop/src-common/advent/screens/rooms/outside_castle.clj
@@ -122,7 +122,7 @@
:else (do-initial-peddler-conversation entities)))
(defn should-block? [entities]
- (and (= :night (get-in @entities [:state :time]))
+ (and (:night (get-in @entities [:state :time]))
(actions/has-obtained? entities :flask-2)
(not (actions/has-item? entities :magic-slingshot))))
@@ -258,7 +258,7 @@
steer-stand (animation 0.2 (for [i [0 0 0 0 0 0 0 0 0 1 0 2 0 1 0 2 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 3 0 0 0 0]]
(aget steer-sheet 0 i)))
flies-stand (utils/make-anim "outside-castle/flies.png" [15 15] 0.075 [0 1 2 1])]
- (rooms/make :music {:day :town-2 :night :night}
+ (rooms/make :music {:day :town-2 :night :night :sunrise :night}
:interactions
{:right-dir {:box [300 40 320 140]
:script (actions/get-script
@@ -291,7 +291,8 @@
(actions/talk entities :ego "No one will notice one missing.")
(actions/give entities :carrot))))}}
:layers {:day [(assoc (texture "outside-castle/background.png") :x 0 :y 0 :baseline 0)]
- :night [(assoc (texture "outside-castle/background-dark.png") :x 0 :y 0 :baseline 0)]}
+ :night [(assoc (texture "outside-castle/background-dark.png") :x 0 :y 0 :baseline 0)]
+ :sunrise [(assoc (texture "outside-castle/background-sunrise.png") :x 0 :y 0 :baseline 0)]}
:entities {:peddler (actions/start-animation screen
(assoc (texture "outside-castle/peddler.png") :x 110 :y 90 :baseline 150 :anim nil
:talk peddler-talk :stand peddler-stand
@@ -378,6 +379,6 @@
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.00)
:start-pos [310 80]
:apply-state (fn [entities]
- (if (= :night (get-in entities [:state :time]))
+ (if (#{:night :sunrise} (get-in entities [:state :time]))
(make-night entities)
entities)))))
diff --git a/desktop/src-common/advent/screens/rooms/outside_house.clj b/desktop/src-common/advent/screens/rooms/outside_house.clj
index dc94d370..81414ec4 100644
--- a/desktop/src-common/advent/screens/rooms/outside_house.clj
+++ b/desktop/src-common/advent/screens/rooms/outside_house.clj
@@ -54,9 +54,16 @@
:ego "It worked!"
:ego "I now have The Slinger's Shot."
:ego "And just in time, too. It's getting light.")
+ (actions/update-state entities #(assoc % :next-time :sunrise))
(walk-to-castle entities)
(outside-castle/go-through-gate entities)
- (inside-castle/walk-to-blergh entities))))
+ (actions/update-state entities #(assoc % :next-time :day))
+ (inside-castle/walk-to-blergh entities)
+ (actions/do-dialogue entities
+ :ego "Blergh!"
+ :blergh "Oh, hello again."
+ :blergh "I thought I had taken care of you the last time I saw you."
+ :blergh "Any final words before I destroy you again?"))))
:broken-clock (actions/get-script entities
(actions/walk-to entities :ego [141 90] :face :right)
(actions/play-animation entities :ego :reach)
diff --git a/desktop/src-common/advent/screens/rooms/space.clj b/desktop/src-common/advent/screens/rooms/space.clj
index e22fc198..cb1c9a4d 100644
--- a/desktop/src-common/advent/screens/rooms/space.clj
+++ b/desktop/src-common/advent/screens/rooms/space.clj
@@ -31,7 +31,8 @@
blergh-stand-anim (animation 0.7 [blergh-flex blergh-stand])
blergh-swing (utils/make-anim "space/blergh-swing.png" [106 165] 0.1 [0 0 1 2 3 4 ])
blergh-appear (utils/make-anim "space/blergh-appear.png" [106 165] 0.05 (flatten [(range 13) 12 12 12 12 12 12 12 12 12 12 12 12 12 ]))
- blergh-grow (utils/make-anim "space/blergh-grow.png" [106 165] 0.10 [0 1 0 1 0 1 0 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 2 2 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 5 6 7 8 9 10 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11]) ]
+ blergh-grow (utils/make-anim "space/blergh-grow.png" [106 165] 0.10 [0 1 0 1 0 1 0 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 2 2 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 5 6 7 8 9 10 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11])
+ bullet (utils/make-anim "space/bullet.png" [24 24] 0.0075 [0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 3 3 3 4 4 5 5 6 5 4 7])]
(rooms/make :music :town-1
:interactions
{}
@@ -57,10 +58,34 @@
(common/go-to-jail entities)
(actions/do-dialogue entities :ego "Hey!"
- :ego "What's going on? I was just about to teach Blergh a lesson!"))}))
+ :ego "What's going on? I was just about to teach Blergh a lesson!"))
+ :magic-slingshot (actions/get-script entities
+ (actions/do-dialogue entities
+ :ego "Hey Blergh!"
+ :ego "Take this!")
+ (actions/play-animation entities :ego :shoot)
+ (actions/add-entity entities :bullet (get-in @entities [:room :bullet]))
+ (actions/walk-straight-to entities :bullet [213 166] :update-baseline? false :speed 5.0)
+ (actions/add-entity entities :broken-jewel (get-in @entities [:room :broken-jewel]))
+ (Thread/sleep 500)
+ (actions/remove-entity entities :bullet)
+ (actions/update-state entities #(assoc % :broke-jewel? true))
+ (actions/do-dialogue entities
+ :blergh "Argh! My magic lightning helmet!"
+ :blergh "No matter. I will destroy you with my bare hands!"))}))
:entities {}
+ :bullet (assoc (animation->texture screen bullet)
+ :x 130 :y 85 :baseline 241
+ :walk bullet)
+ :broken-jewel (assoc (texture "space/broken-jewel.png")
+ :x 222 :y 172 :baseline 240)
:collision "space/collision.png"
:scale-fn (constantly 1.5)
- :start-pos [43 80]
+ :start-pos [140 55]
:apply-state (fn [e]
- (assoc-in e [:room :entities :blergh] (get-in e [:room :blergh]))))))
+ (as-> e e
+ (if (get-in e [:state :broke-jewel?])
+ (assoc-in e [:room :entities :broken-jewel] (get-in e [:room :entities :broken-jewel]))
+ e)
+ (assoc-in e [:room :entities :blergh] (get-in e [:room :blergh])))
+ ))))
diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj
index 0f75b1ea..38b5d9cf 100644
--- a/desktop/src-common/advent/screens/scene.clj
+++ b/desktop/src-common/advent/screens/scene.clj
@@ -175,6 +175,7 @@
get-sick (animation 0.3 (map (partial get [(aget talk-sheet 0 0 ) (texture "ego/get-sick.png")]) [0 1 1 1 1 1 1 1 1 1 1 1]) )
spear (utils/make-anim "ego/spear.png" [18 100] 0.2 [0 1 2 3 2 3 2 3 2 3 2 1 0])
crowbar (utils/make-anim "ego/crowbar.png" [36 36] 0.1 [0 0 0 1 1 2 2 2 2 2 3 2 3 2 3 2 3 2 3 3 3 1 1 0 0 0])
+ shoot (utils/make-anim "ego/shoot.png" [24 36] 0.075 [0 0 0 1 1 2 2 2 2 2 2 2 2 3 4 5 4])
ego {:right {:walk walk-right
:stand stand-anim
@@ -196,6 +197,7 @@
:reach-down reach-down
:reach-start reach-start
:reach-stop reach-stop
+ :shoot shoot
[:fire 1] fire-1-anim
[:fire 2] fire-2-anim
[:fire 3] fire-3-anim
@@ -218,6 +220,7 @@
:reach-down (utils/flip reach-down)
:reach-start (utils/flip reach-start)
:reach-stop (utils/flip reach-stop)
+ :shoot (utils/flip shoot)
[:fire 1] (utils/flip fire-1-anim)
[:fire 2] (utils/flip fire-2-anim)
[:fire 3] (utils/flip fire-3-anim)