diff --git a/desktop/gametodos.txt b/desktop/gametodos.txt index 9a74a7d1..265363b3 100644 --- a/desktop/gametodos.txt +++ b/desktop/gametodos.txt @@ -17,5 +17,4 @@ + wrong timing for potions + secret lever + shopkeep sigh -+ underground candle + bent bars outside diff --git a/desktop/resources/inside-jail/candle b/desktop/resources/inside-jail/candle new file mode 100644 index 00000000..1815c9ca --- /dev/null +++ b/desktop/resources/inside-jail/candle @@ -0,0 +1,218 @@ +Untitled +- Delay - +active: false +- Duration - +lowMin: 10000.0 +lowMax: 10000.0 +- Count - +min: 0 +max: 1000 +- Emission - +lowMin: 0.0 +lowMax: 0.0 +highMin: 3.0 +highMax: 3.0 +relative: false +scalingCount: 7 +scaling0: 0.97959185 +scaling1: 0.0 +scaling2: 0.97959185 +scaling3: 0.0 +scaling4: 1.0 +scaling5: 0.0 +scaling6: 0.0 +timelineCount: 7 +timeline0: 0.0 +timeline1: 0.13013698 +timeline2: 0.32876712 +timeline3: 0.45890412 +timeline4: 0.63013697 +timeline5: 0.74657536 +timeline6: 0.93835616 +- Life - +lowMin: 0.0 +lowMax: 0.0 +highMin: 20000.0 +highMax: 20000.0 +relative: false +scalingCount: 1 +scaling0: 1.0 +timelineCount: 1 +timeline0: 0.0 +- Life Offset - +active: true +lowMin: 0.0 +lowMax: 0.0 +highMin: 0.0 +highMax: 0.0 +relative: false +scalingCount: 1 +scaling0: 1.0 +timelineCount: 1 +timeline0: 0.0 +- X Offset - +active: true +lowMin: -2.0 +lowMax: 2.0 +highMin: 0.0 +highMax: 0.0 +relative: false +scalingCount: 1 +scaling0: 1.0 +timelineCount: 1 +timeline0: 0.0 +- Y Offset - +active: true +lowMin: -2.0 +lowMax: 2.0 +highMin: 0.0 +highMax: 0.0 +relative: false +scalingCount: 1 +scaling0: 1.0 +timelineCount: 1 +timeline0: 0.0 +- Spawn Shape - +shape: point +- Spawn Width - +lowMin: 0.0 +lowMax: 0.0 +highMin: 0.0 +highMax: 0.0 +relative: false +scalingCount: 1 +scaling0: 1.0 +timelineCount: 1 +timeline0: 0.0 +- Spawn Height - +lowMin: 0.0 +lowMax: 0.0 +highMin: 0.0 +highMax: 0.0 +relative: false +scalingCount: 1 +scaling0: 1.0 +timelineCount: 1 +timeline0: 0.0 +- Scale - +lowMin: 1.0 +lowMax: 1.0 +highMin: 3.0 +highMax: 8.0 +relative: false +scalingCount: 2 +scaling0: 0.0 +scaling1: 1.0 +timelineCount: 2 +timeline0: 0.0 +timeline1: 1.0 +- Velocity - +active: true +lowMin: 7.0 +lowMax: 7.0 +highMin: 3.0 +highMax: 3.0 +relative: false +scalingCount: 2 +scaling0: 0.0 +scaling1: 1.0 +timelineCount: 2 +timeline0: 0.0 +timeline1: 1.0 +- Angle - +active: true +lowMin: 180.0 +lowMax: 170.0 +highMin: -120.0 +highMax: -100.0 +relative: true +scalingCount: 10 +scaling0: 0.0 +scaling1: 0.0 +scaling2: 1.0 +scaling3: 0.08163265 +scaling4: 0.8979592 +scaling5: 0.1632653 +scaling6: 0.75510204 +scaling7: 0.24489796 +scaling8: 0.6938776 +scaling9: 0.4489796 +timelineCount: 10 +timeline0: 0.0 +timeline1: 0.001 +timeline2: 0.14383562 +timeline3: 0.30136988 +timeline4: 0.42465752 +timeline5: 0.55479455 +timeline6: 0.65068495 +timeline7: 0.7328767 +timeline8: 0.84931505 +timeline9: 1.0 +- Rotation - +active: true +lowMin: 0.0 +lowMax: 0.0 +highMin: 180.0 +highMax: -180.0 +relative: false +scalingCount: 2 +scaling0: 0.06122449 +scaling1: 1.0 +timelineCount: 2 +timeline0: 0.0 +timeline1: 1.0 +- Wind - +active: true +lowMin: 0.0 +lowMax: 0.0 +highMin: 3.0 +highMax: 2.0 +relative: false +scalingCount: 6 +scaling0: 0.0 +scaling1: 0.5510204 +scaling2: 0.2244898 +scaling3: 0.14285715 +scaling4: 0.46938777 +scaling5: 0.2857143 +timelineCount: 6 +timeline0: 0.0 +timeline1: 0.14383562 +timeline2: 0.34246576 +timeline3: 0.45890412 +timeline4: 0.70547944 +timeline5: 0.9589041 +- Gravity - +active: false +- Tint - +colorsCount: 3 +colors0: 0.8156863 +colors1: 0.8117647 +colors2: 0.7372549 +timelineCount: 1 +timeline0: 0.0 +- Transparency - +lowMin: 0.0 +lowMax: 0.0 +highMin: 1.0 +highMax: 1.0 +relative: false +scalingCount: 4 +scaling0: 0.0 +scaling1: 0.14035088 +scaling2: 0.0877193 +scaling3: 0.0 +timelineCount: 4 +timeline0: 0.0 +timeline1: 0.23972602 +timeline2: 0.65753424 +timeline3: 1.0 +- Options - +attached: false +continuous: true +aligned: false +additive: true +behind: false +premultipliedAlpha: false +- Image Path - +/Users/bryce/dev/playground/advent/desktop/resources/ego/dot.png diff --git a/desktop/resources/inside-jail/candle.png b/desktop/resources/inside-jail/candle.png new file mode 100644 index 00000000..1a1409ab Binary files /dev/null and b/desktop/resources/inside-jail/candle.png differ diff --git a/desktop/resources/inside-jail/candle.pxa/0.pxi b/desktop/resources/inside-jail/candle.pxa/0.pxi new file mode 100644 index 00000000..126559ef Binary files /dev/null and b/desktop/resources/inside-jail/candle.pxa/0.pxi differ diff --git a/desktop/resources/inside-jail/candle.pxa/1.pxi b/desktop/resources/inside-jail/candle.pxa/1.pxi new file mode 100644 index 00000000..7b470dc0 Binary files /dev/null and b/desktop/resources/inside-jail/candle.pxa/1.pxi differ diff --git a/desktop/resources/inside-jail/candle.pxa/2.pxi b/desktop/resources/inside-jail/candle.pxa/2.pxi new file mode 100644 index 00000000..126559ef Binary files /dev/null and b/desktop/resources/inside-jail/candle.pxa/2.pxi differ diff --git a/desktop/resources/inside-jail/candle.pxa/3.pxi b/desktop/resources/inside-jail/candle.pxa/3.pxi new file mode 100644 index 00000000..8335eb1a Binary files /dev/null and b/desktop/resources/inside-jail/candle.pxa/3.pxi differ diff --git a/desktop/resources/inside-jail/candle.pxa/CelData.plist b/desktop/resources/inside-jail/candle.pxa/CelData.plist new file mode 100644 index 00000000..f0b74d60 --- /dev/null +++ b/desktop/resources/inside-jail/candle.pxa/CelData.plist @@ -0,0 +1,22 @@ + + + + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + diff --git a/desktop/resources/inside-jail/dot.png b/desktop/resources/inside-jail/dot.png new file mode 100644 index 00000000..8802f8e0 Binary files /dev/null and b/desktop/resources/inside-jail/dot.png differ diff --git a/desktop/src-common/advent/screens/rooms/inside_house.clj b/desktop/src-common/advent/screens/rooms/inside_house.clj index d8e5a5f5..8e01918d 100644 --- a/desktop/src-common/advent/screens/rooms/inside_house.clj +++ b/desktop/src-common/advent/screens/rooms/inside_house.clj @@ -204,12 +204,8 @@ :collision "inside-house/collision.png" :scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.75) :apply-state (fn [_ entities] - (particle-effect! (get-in entities [:room :entities :candle-smoke] ) :reset) - (particle-effect! (get-in entities [:room :entities :candle-smoke] ) :start) - - (particle-effect! (get-in entities [:room :entities :candle-smoke] ) :update 10.0) - (dotimes [_ 160] - (particle-effect! (get-in entities [:room :entities :candle-smoke] ) :update 0.2)) + (utils/fast-forward-particle (get-in entities [:room :entities :candle-smoke])) + (as-> entities entities (if (actions/has-obtained? entities :flask-1) diff --git a/desktop/src-common/advent/screens/rooms/inside_jail.clj b/desktop/src-common/advent/screens/rooms/inside_jail.clj index 1a0889c8..da118d8a 100644 --- a/desktop/src-common/advent/screens/rooms/inside_jail.clj +++ b/desktop/src-common/advent/screens/rooms/inside_jail.clj @@ -190,7 +190,10 @@ warden-fall-asleep (animation 0.1 (for [i (flatten [(repeat 5 0) 2 2 (repeat 10 0) 2 2 2 2 2 2 2 (repeat 10 0) 2 2 2])] (aget warden-sheet 0 i))) warden-sleep (animation 0.5 (for [i (flatten [ 3 3 2 2 2])] - (aget warden-sheet 0 i)))] + (aget warden-sheet 0 i))) + candle (utils/make-anim "inside-jail/candle.png" [20 25] 0.1 (range 4)) + candle-aura (utils/make-anim (texture "inside-house/candle-aura.png") [27 27] 0.2 [0 1 2 3 2 1] ) + ] (rooms/make :music :inside-antique :interactions { :lock {:box [178 102 184 124] @@ -313,6 +316,18 @@ :moveable-bars (assoc (texture "inside-jail/moveable-bars.png") :night-profile :none :x 132 :y 77 :baseline 163) + :candle (assoc (animation->texture screen candle) + :x 207 :y 118 :baseline 2 + :anim candle + :anim-start 0 + :night-profile :none) + :candle-aura (assoc (animation->texture screen candle-aura) :x 215 :y 130 :baseline 2 + :additive? true :origin-x 13 :origin-y 13 :opacity 0.5 :anim candle-aura :anim-start 0 :night-profile :none + :script (actions/get-script entities (actions/talk entities :ego "Just a candle.")) + :scripts {:default (actions/get-script entities (actions/talk entities :ego "I might catch the place on fire."))}) + :candle-smoke (doto (assoc (particle-effect "inside-jail/candle") :x 215 :y 130 + :baseline 200) + (particle-effect! :set-position 215 130)) :crowbar (assoc (texture "inside-jail/crowbar.png") :x 304 :y 65 :baseline 175 :night-profile :none @@ -332,6 +347,7 @@ :scale-fn (utils/scaler-fn-with-baseline 0 0.50 1.5) :start-pos [130 85] :apply-state (fn [_ entities] + (utils/fast-forward-particle (get-in entities [:room :entities :candle-smoke])) (as-> entities entities (if (actions/has-obtained? entities :ball-n-chain) (update-in entities [:room :entities] #(dissoc % :ball-n-chain)) diff --git a/desktop/src-common/advent/utils.clj b/desktop/src-common/advent/utils.clj index 20c776f1..598ea935 100644 --- a/desktop/src-common/advent/utils.clj +++ b/desktop/src-common/advent/utils.clj @@ -253,3 +253,11 @@ 175.0))) (* (or scale 1.0)) (clamp-volume))) + +(defn fast-forward-particle [p] + (particle-effect! p :reset) + (particle-effect! p :start) + + (particle-effect! p :update 10.0) + (dotimes [_ 160] + (particle-effect! p :update 0.2)))