diff --git a/desktop/resources/ego/grow-talk.png b/desktop/resources/ego/grow-talk.png new file mode 100644 index 00000000..0b47b6b3 Binary files /dev/null and b/desktop/resources/ego/grow-talk.png differ diff --git a/desktop/resources/ego/grow-talk.pxa/0.pxi b/desktop/resources/ego/grow-talk.pxa/0.pxi new file mode 100644 index 00000000..3257913e Binary files /dev/null and b/desktop/resources/ego/grow-talk.pxa/0.pxi differ diff --git a/desktop/resources/ego/grow-talk.pxa/1.pxi b/desktop/resources/ego/grow-talk.pxa/1.pxi new file mode 100644 index 00000000..fbb78cb3 Binary files /dev/null and b/desktop/resources/ego/grow-talk.pxa/1.pxi differ diff --git a/desktop/resources/ego/grow-talk.pxa/CelData.plist b/desktop/resources/ego/grow-talk.pxa/CelData.plist new file mode 100644 index 00000000..29c78f8b --- /dev/null +++ b/desktop/resources/ego/grow-talk.pxa/CelData.plist @@ -0,0 +1,14 @@ + + + + + + duration + 1 + + + duration + 1 + + + diff --git a/desktop/resources/space/blergh-grow.png b/desktop/resources/space/blergh-grow.png new file mode 100644 index 00000000..fdd59406 Binary files /dev/null and b/desktop/resources/space/blergh-grow.png differ diff --git a/desktop/resources/space/blergh-grow2.png b/desktop/resources/space/blergh-grow2.png new file mode 100644 index 00000000..0a423e49 Binary files /dev/null and b/desktop/resources/space/blergh-grow2.png differ diff --git a/desktop/resources/space/blergh-grow3.png b/desktop/resources/space/blergh-grow3.png new file mode 100644 index 00000000..9633288b Binary files /dev/null and b/desktop/resources/space/blergh-grow3.png differ diff --git a/desktop/resources/space/blergh-grow4.png b/desktop/resources/space/blergh-grow4.png new file mode 100644 index 00000000..6b0fa411 Binary files /dev/null and b/desktop/resources/space/blergh-grow4.png differ diff --git a/desktop/resources/space/blergh-grow5.png b/desktop/resources/space/blergh-grow5.png new file mode 100644 index 00000000..3b3ddf80 Binary files /dev/null and b/desktop/resources/space/blergh-grow5.png differ diff --git a/desktop/resources/space/blergh-grow6.png b/desktop/resources/space/blergh-grow6.png new file mode 100644 index 00000000..4915c181 Binary files /dev/null and b/desktop/resources/space/blergh-grow6.png differ diff --git a/desktop/resources/space/blergh-grow7.png b/desktop/resources/space/blergh-grow7.png new file mode 100644 index 00000000..6ffda81b Binary files /dev/null and b/desktop/resources/space/blergh-grow7.png differ diff --git a/desktop/resources/space/blergh-grow8.png b/desktop/resources/space/blergh-grow8.png new file mode 100644 index 00000000..267aedf5 Binary files /dev/null and b/desktop/resources/space/blergh-grow8.png differ diff --git a/desktop/resources/space/blergh-stand copy.png b/desktop/resources/space/blergh-stand copy.png new file mode 100644 index 00000000..a344657c Binary files /dev/null and b/desktop/resources/space/blergh-stand copy.png differ diff --git a/desktop/resources/space/blergh-stand.png b/desktop/resources/space/blergh-stand.png index 0e1fb4cf..93f05e0c 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/collision.png b/desktop/resources/space/collision.png index 42265298..c298e76e 100644 Binary files a/desktop/resources/space/collision.png and b/desktop/resources/space/collision.png differ diff --git a/desktop/resources/space/grow.pxa/0.pxi b/desktop/resources/space/grow.pxa/0.pxi new file mode 100644 index 00000000..973861f8 Binary files /dev/null and b/desktop/resources/space/grow.pxa/0.pxi differ diff --git a/desktop/resources/space/grow.pxa/1.pxi b/desktop/resources/space/grow.pxa/1.pxi new file mode 100644 index 00000000..1bccf6c0 Binary files /dev/null and b/desktop/resources/space/grow.pxa/1.pxi differ diff --git a/desktop/resources/space/grow.pxa/10.pxi b/desktop/resources/space/grow.pxa/10.pxi new file mode 100644 index 00000000..70c00071 Binary files /dev/null and b/desktop/resources/space/grow.pxa/10.pxi differ diff --git a/desktop/resources/space/grow.pxa/11.pxi b/desktop/resources/space/grow.pxa/11.pxi new file mode 100644 index 00000000..17a05ac7 Binary files /dev/null and b/desktop/resources/space/grow.pxa/11.pxi differ diff --git a/desktop/resources/space/grow.pxa/2.pxi b/desktop/resources/space/grow.pxa/2.pxi new file mode 100644 index 00000000..38784bfb Binary files /dev/null and b/desktop/resources/space/grow.pxa/2.pxi differ diff --git a/desktop/resources/space/grow.pxa/3.pxi b/desktop/resources/space/grow.pxa/3.pxi new file mode 100644 index 00000000..bf5c1934 Binary files /dev/null and b/desktop/resources/space/grow.pxa/3.pxi differ diff --git a/desktop/resources/space/grow.pxa/4.pxi b/desktop/resources/space/grow.pxa/4.pxi new file mode 100644 index 00000000..5aa589cd Binary files /dev/null and b/desktop/resources/space/grow.pxa/4.pxi differ diff --git a/desktop/resources/space/grow.pxa/5.pxi b/desktop/resources/space/grow.pxa/5.pxi new file mode 100644 index 00000000..fa6419a2 Binary files /dev/null and b/desktop/resources/space/grow.pxa/5.pxi differ diff --git a/desktop/resources/space/grow.pxa/6.pxi b/desktop/resources/space/grow.pxa/6.pxi new file mode 100644 index 00000000..14d6c9a1 Binary files /dev/null and b/desktop/resources/space/grow.pxa/6.pxi differ diff --git a/desktop/resources/space/grow.pxa/7.pxi b/desktop/resources/space/grow.pxa/7.pxi new file mode 100644 index 00000000..3c132112 Binary files /dev/null and b/desktop/resources/space/grow.pxa/7.pxi differ diff --git a/desktop/resources/space/grow.pxa/8.pxi b/desktop/resources/space/grow.pxa/8.pxi new file mode 100644 index 00000000..3a88f514 Binary files /dev/null and b/desktop/resources/space/grow.pxa/8.pxi differ diff --git a/desktop/resources/space/grow.pxa/9.pxi b/desktop/resources/space/grow.pxa/9.pxi new file mode 100644 index 00000000..a72efe68 Binary files /dev/null and b/desktop/resources/space/grow.pxa/9.pxi differ diff --git a/desktop/resources/space/grow.pxa/CelData.plist b/desktop/resources/space/grow.pxa/CelData.plist new file mode 100644 index 00000000..a0e63ed4 --- /dev/null +++ b/desktop/resources/space/grow.pxa/CelData.plist @@ -0,0 +1,54 @@ + + + + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + 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 d38fe4ae..b77f8380 100644 --- a/desktop/src-common/advent/actions.clj +++ b/desktop/src-common/advent/actions.clj @@ -241,7 +241,7 @@ (defn get-text-duration [text] (* (count (s/split text #" ")) 0.5)) -(defn talk [entities target-id text & {:keys [stop? animate?]}] +(defn talk [entities target-id text & {:keys [stop? animate? anim]}] (let [initial-time (atom nil) stop? (if (nil? stop?) true stop?) animate? (if (nil? animate?) true animate?)] @@ -267,7 +267,7 @@ :target-id target-id :scale scale) (if animate? - (update-in entities [:room :entities target-id ] #(start-animation screen % :talk)) + (update-in entities [:room :entities target-id ] #(start-animation screen % (or anim :talk))) entities))) (continue [this screen entities] entities) diff --git a/desktop/src-common/advent/screens/rooms/inside_castle.clj b/desktop/src-common/advent/screens/rooms/inside_castle.clj index fe98db25..65a76cbf 100644 --- a/desktop/src-common/advent/screens/rooms/inside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/inside_castle.clj @@ -109,7 +109,7 @@ :ego "I have to go show my friends!") (actions/walk-to entities :ego [85 145] :face :right) (actions/transition-background entities :space [0 65]) - (actions/walk-to entities :ego [150 65] :face :right) + (actions/walk-straight-to entities :ego [140 55] :face :right) (actions/add-entity entities :blergh (get-in @entities [:room :blergh])) (actions/play-animation entities :blergh :appear :stop? false) (actions/transition-music entities :town-1 :fight) diff --git a/desktop/src-common/advent/screens/rooms/space.clj b/desktop/src-common/advent/screens/rooms/space.clj index 366b8808..4231e2f1 100644 --- a/desktop/src-common/advent/screens/rooms/space.clj +++ b/desktop/src-common/advent/screens/rooms/space.clj @@ -13,7 +13,8 @@ (defn taunt [screen entities] (when (and (not (get-in entities [:actions :script-running?])) - (get-in entities [:state :active?])) + (get-in entities [:state :active?]) + (not (get-in entities [:state :blergh-dead?]))) ((actions/get-script entities (actions/do-dialogue entities :blergh (rand-nth ["Come on, little man! Try and hit me!" "What's the matter? Cold feet?" "Come here and fight me like man!" @@ -28,7 +29,8 @@ blergh-talk-anim (animation 0.3 [blergh-talk blergh-stand]) 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 10) 9 9 9 9 9 9 9 9 9 ]))] + blergh-appear (utils/make-anim "space/blergh-appear.png" [106 165] 0.05 (flatten [(range 10) 9 9 9 9 9 9 9 9 9 ])) + 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]) ] (rooms/make :music :town-1 :interactions {} @@ -39,6 +41,7 @@ :stand blergh-stand-anim :talk blergh-talk-anim :swing blergh-swing :appear blergh-appear + :grow blergh-grow :talk-color (color 0.95 0.4 0.2 1.0) :script (actions/get-script entities (actions/do-dialogue entities :blergh "Come on! Try and hit me!")) :scripts {:sword (actions/get-script entities @@ -53,4 +56,6 @@ :entities {} :collision "space/collision.png" :scale-fn (constantly 1.5) - :start-pos [43 80]))) + :start-pos [43 80] + :apply-state (fn [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 4be6e4e7..e78b5dd0 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -94,20 +94,28 @@ :blergh "You're still no match for me." :blergh "Give it to me, or I'll make you regret it!") (actions/present-choices entities {:choices ["Ok." - {:run #(do (actions/respond entities % - :ego "Here you go." - :blergh "Yes! Now I can drink this whole thing and can become powerful enough to rule the world!" - :blergh "[GREEN]*gulp*[]" - :blergh "What's this? What's happening?") - (actions/walk-straight-to entities :ego [100 45] :face :right) - (actions/do-dialogue entities :ego "TODO: explosion" - :ego "You win!"))} + {:run (fn [_] + (actions/talk entities :ego "Ok." :anim :grow-talk :stop? false) + (actions/talk entities :ego "Here you go." :anim :grow-talk) + (actions/do-dialogue entities + :blergh "Yes! Now I can drink this whole thing and can become powerful enough to rule the world!" + :blergh "[#AAFFAAFF]*gulp*[]" + :blergh "What's this? What's happening?") + (actions/talk entities :ego "Uh oh." :anim :grow-talk :stop? false) + (actions/walk-straight-to entities :ego [100 45] :face :right) + (actions/play-animation entities :blergh :grow :stop? false) + (actions/do-dialogue entities :ego "'Not more than that do drink,\nOr you'll push your body to the brink.'" + :ego "Brilliant! I win!") + (actions/walk-straight-to entities :ego [800 75] :face :right) + (actions/update-state entities (fn [s] (assoc s :blergh-dead? true))))} "No way!" - {:run #(do (actions/respond entities % :blergh "Then take this!") - (actions/play-animation entities :blergh :swing) - (actions/walk-straight-to entities :ego [100 45] :anim :squat :override-dir :right :speed 3.0) - (actions/do-dialogue entities :ego "Yeow!!" - :ego "Even with that potion, I'm not strong enough."))}]})) + {:run (fn [_] + (actions/talk entities :ego "No way!" :anim :grow-talk) + (actions/talk entities :blergh "Then take this!") + (actions/play-animation entities :blergh :swing) + (actions/walk-straight-to entities :ego [100 45] :anim :squat :override-dir :right :speed 3.0) + (actions/do-dialogue entities :ego "Yeow!!" + :ego "Even with that potion, I'm not strong enough."))}]})) (defn get-ego [screen start-pos start-scale] @@ -149,6 +157,7 @@ (texture (aget grow-sheet 0 i)))) hold-up-to-window (utils/make-anim "ego/hold-up-to-window.png" [18 36] 0.1 [0 1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 1 0 0 0 0 0 0]) swing (utils/make-anim "ego/swing.png" [36 36] 0.05 (flatten [[0 0 0 1 2 3 3 3 3 ]])) + grow-talk (utils/make-anim "ego/grow-talk.png" [18 36] 0.2 (range 2)) 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]) ) ego {:right {:walk walk-right :stand stand-anim @@ -164,6 +173,7 @@ :get-sick get-sick :hold-up-to-window hold-up-to-window :swing swing + :grow-talk grow-talk [:fire 1] fire-1-anim [:fire 2] fire-2-anim [:fire 3] fire-3-anim} @@ -180,6 +190,7 @@ :cat-toy-last-half (utils/flip cat-toy-last-half) :grow (utils/flip grow) :hold-up-to-window (utils/flip hold-up-to-window) + :grow-talk (utils/flip grow-talk) [:fire 1] (utils/flip fire-1-anim) [:fire 2] (utils/flip fire-2-anim) [:fire 3] (utils/flip fire-3-anim)}