more grandma refinement.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
[play-clj.utils :refer :all]
|
||||
[play-clj.g2d :refer :all]))
|
||||
(defn get-down [entities]
|
||||
(actions/talk entities :ego "I'll get down.")
|
||||
|
||||
(actions/walk-straight-to entities :ego [151 50] :update-baseline? false :face :left)
|
||||
(actions/play-animation entities :ego :reach)
|
||||
(actions/remove-entity entities :blank)
|
||||
@@ -23,9 +23,10 @@
|
||||
cat-walk (animation 0.2 [(texture "cat-tree/pounce.png")])
|
||||
ladder-entity (assoc (texture "inside-cafeteria/ladder.png") :x 120 :y 60 :baseline 162)
|
||||
grandma-stand (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1])
|
||||
grandma-cat-stand (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [6 6 6 6 6 6 6 6 6 6 6 6 6 6 7])
|
||||
grandma-squat (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [3 4 5 4 3])
|
||||
grandma-talk (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [0 2 0 2 0 2 0 2 0 2 0 1 0 2 0 0])]
|
||||
grandma-squat-1 (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [3 4 5 5 5 5 5])
|
||||
grandma-squat-2 (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [5 5 4 3])
|
||||
grandma-talk (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [0 2 0 2 0 2 0 2 0 2 0 1 0 2 0 0])
|
||||
grandma-kiss (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [0 8 9 10 9 10 9 10 9 8 0])]
|
||||
(rooms/make :music :town-2
|
||||
:interactions
|
||||
{:down-dir {:box [150 0 270 20]
|
||||
@@ -46,6 +47,7 @@
|
||||
{:object nil :x 0 :y 0 :width 320 :height 240 :baseline 240
|
||||
:script (actions/get-script entities
|
||||
(when (get-in @entities [:room :entities :ladder])
|
||||
(actions/talk entities :ego "I'll get down.")
|
||||
(get-down entities)))}))
|
||||
)}}
|
||||
:grass {:box [26 105 60 160]
|
||||
@@ -72,20 +74,27 @@
|
||||
(if (get-in @entities [:room :entities :ladder])
|
||||
(do (actions/talk entities :ego "I think he's going for it!")
|
||||
(actions/play-animation entities :ego :cat-toy-first-half :stop? false)
|
||||
(sound! (sound "cat-tree/cat.ogg") :play)
|
||||
(actions/walk-straight-to entities :cat [138 40] :update-baseline? false :speed 3)
|
||||
(actions/play-animation entities :ego :cat-toy-last-half)
|
||||
(swap! entities #(assoc-in % [:room :entities :grandma :stand]
|
||||
(get-in % [:room :entities :grandma :cat-stand])))
|
||||
(actions/play-animation entities :grandma :squat)
|
||||
(actions/play-animation entities :grandma :squat-1 :stop? false)
|
||||
(actions/remove-entity entities :cat)
|
||||
(actions/play-animation entities :grandma :squat-2)
|
||||
(actions/do-dialogue entities :grandma "Thank you for rescuing my furry friend, young man!")
|
||||
(get-down entities)
|
||||
(actions/walk-straight-to entities :ego [165 45] :face :left)
|
||||
(actions/do-dialogue entities
|
||||
:grandma "Thank you for rescuing my furry friend, young man!"
|
||||
:ego "It's nothing."
|
||||
:grandma "You are so brave!"
|
||||
:grandma "Here's a certificate of bravery!")
|
||||
(actions/talk entities :ego "TODO: get award from little old lady in this room")
|
||||
(actions/give entities :certificate))
|
||||
:ego "It's no big deal."
|
||||
:grandma "You won't go unrewarded!"
|
||||
:grandma "Come here young man.")
|
||||
(actions/walk-straight-to entities :ego [133 35])
|
||||
(actions/talk entities :grandma "For your impressive display of courage and bravery, I give you this. ")
|
||||
(sound! (sound "cat-tree/kiss.ogg") :play)
|
||||
(actions/play-animation entities :grandma :kiss)
|
||||
(actions/give entities :kiss)
|
||||
(actions/play-animation entities :ego :get-sick :stop? false)
|
||||
(actions/walk-straight-to entities :ego [165 45])
|
||||
(actions/talk entities :ego "Ugh! Gross!"))
|
||||
(actions/talk entities :ego "I guess I'm too far away.")))})
|
||||
cat-stand)
|
||||
:grandma (assoc (animation->texture screen grandma-stand)
|
||||
@@ -93,9 +102,10 @@
|
||||
:anim grandma-stand
|
||||
:anim-start 0
|
||||
:talk grandma-talk
|
||||
:cat-stand grandma-cat-stand
|
||||
:kiss grandma-kiss
|
||||
:stand grandma-stand
|
||||
:squat grandma-squat
|
||||
:squat-1 grandma-squat-1
|
||||
:squat-2 grandma-squat-2
|
||||
:origin-x 12
|
||||
:origin-y 0
|
||||
:scale-x 1.45
|
||||
@@ -104,7 +114,7 @@
|
||||
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.20)
|
||||
:apply-state (fn [entities]
|
||||
(as-> entities entities
|
||||
(if (actions/has-item? entities :certificate)
|
||||
(if (actions/has-item? entities :kiss)
|
||||
(update-in entities [:room :entities] #(dissoc % :cat))
|
||||
entities)))
|
||||
:start-pos [203 1])))
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
(actions/talk entities :ego "I got it! I will become the greatest knight Remington has ever known!"))
|
||||
|
||||
(defn try-to-pull-sword [entities missing-items obtained-items]
|
||||
(let [item->proof {:trophy "wisdom" :medal "strength" :certificate "courage"}]
|
||||
(let [item->proof {:trophy "wisdom" :medal "strength" :kiss "courage"}]
|
||||
(actions/play-animation entities :ego :reach)
|
||||
(actions/do-dialogue entities
|
||||
:ego "I can't pull it out!"
|
||||
@@ -159,8 +159,8 @@
|
||||
(do (actions/talk entities :ego "That's the coolest sword I've ever seen!!")
|
||||
(actions/walk-to entities :ego [37 134] :face :left)
|
||||
(actions/talk entities :ego "If I pull it out I can become a great knight!")
|
||||
(let [missing-items (set/difference #{:trophy :medal :certificate} (get-in @entities [:state :obtained-items]))
|
||||
obtained-items (set/intersection #{:trophy :medal :certificate} (get-in @entities [:state :obtained-items]))]
|
||||
(let [missing-items (set/difference #{:trophy :medal :kiss} (get-in @entities [:state :obtained-items]))
|
||||
obtained-items (set/intersection #{:trophy :medal :kiss} (get-in @entities [:state :obtained-items]))]
|
||||
(if (= #{} missing-items)
|
||||
(pull-sword entities)
|
||||
(try-to-pull-sword entities missing-items obtained-items)))))
|
||||
@@ -203,9 +203,6 @@
|
||||
:anim trophy
|
||||
:anim-start 0
|
||||
:script (actions/get-script entities
|
||||
(actions/give entities :trophy)
|
||||
(actions/give entities :certificate)
|
||||
(actions/give entities :medal)
|
||||
(walk-to-player entities)
|
||||
(if (= nil (get-in @entities [:state :current-riddle]))
|
||||
(let [{:keys [run choices]} (nice-trophy-dialogue entities)]
|
||||
|
||||
Reference in New Issue
Block a user