lots of tweaks.
This commit is contained in:
@@ -796,3 +796,66 @@
|
||||
(play-animation entities :ego :love)
|
||||
(actions/update-state entities (fn [s] (assoc s :has-seen-love? true)))
|
||||
(transition-music entities nil :duration 1.0))))
|
||||
|
||||
|
||||
(defn fade-in-georgia [entities]
|
||||
(actions/run-action entities
|
||||
(begin [this screen entities]
|
||||
(particle-effect! (get-in entities [:room :entities :georgia-cloud]) :reset)
|
||||
(particle-effect! (get-in entities [:room :entities :georgia-cloud]) :start)
|
||||
(-> entities
|
||||
(assoc-in [:room :entities :georgia-face :x] (- (get-in entities [:room :entities :ego :x]) 30))
|
||||
(assoc-in [:room :entities :georgia-face :y] (+ (get-in entities [:room :entities :ego :y]) 30))
|
||||
|
||||
(assoc-in [:room :entities :georgia-cloud :x] (- (get-in entities [:room :entities :ego :x]) 30))
|
||||
(assoc-in [:room :entities :georgia-cloud :y] (+ (get-in entities [:room :entities :ego :y]) 30))
|
||||
(assoc-in [:tweens :fade-georgia]
|
||||
(tween/tween :fade-georgia screen [:room :entities :georgia-face :opacity] 0.0 1.0 1.0 :ease tween/ease-in-cubic))))
|
||||
|
||||
(continue [this screen entities]
|
||||
(assoc-in entities [:room :entities :georgia-cloud :opacity] (get-in entities [:room :entities :georgia-face :opacity])))
|
||||
|
||||
(done? [this screen entities]
|
||||
(nil? (get-in entities [:tweens :fade-georgia])))
|
||||
|
||||
(terminate [this screen entities]
|
||||
entities)
|
||||
(skip-type [this screen entities]
|
||||
:none)))
|
||||
|
||||
(defn fade-out-georgia [entities]
|
||||
(actions/run-action entities
|
||||
(begin [this screen entities]
|
||||
(particle-effect! (get-in entities [:room :entities :georgia-cloud]) :allow-completion)
|
||||
(-> entities
|
||||
(assoc-in [:tweens :fade-georgia]
|
||||
(tween/tween :fade-georgia screen [:room :entities :georgia-face :opacity] 1.0 0.0 1.0 :ease tween/ease-in-cubic))))
|
||||
|
||||
(continue [this screen entities]
|
||||
entities)
|
||||
|
||||
(done? [this screen entities]
|
||||
(nil? (get-in entities [:tweens :fade-georgia])))
|
||||
|
||||
(terminate [this screen entities]
|
||||
entities)
|
||||
(skip-type [this screen entities]
|
||||
:none)))
|
||||
|
||||
(defn georgia-say [entities msg]
|
||||
(fade-in-georgia entities)
|
||||
(actions/talk entities :georgia-face msg)
|
||||
(fade-out-georgia entities)
|
||||
(transition-music entities nil :duration 1.0))
|
||||
|
||||
(defn in-love [entities]
|
||||
(let [seen-love (get-in @entities [:state :has-seen-love?])]
|
||||
(when (or (not seen-love)
|
||||
(< (rand-int 10) 3))
|
||||
|
||||
(transition-music entities :love :duration 1.0)
|
||||
(fade-in-georgia entities)
|
||||
(play-animation entities :ego :love)
|
||||
(actions/update-state entities (fn [s] (assoc s :has-seen-love? true)))
|
||||
(fade-out-georgia entities)
|
||||
(transition-music entities nil :duration 1.0))))
|
||||
|
||||
Reference in New Issue
Block a user