more detail with antique shop and sword.
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
@@ -109,4 +109,5 @@
|
|||||||
:scripts {:slobber (make-strength-potion)}}
|
:scripts {:slobber (make-strength-potion)}}
|
||||||
:medal {:name "Medal of strength" :value :medal :cursor :medal}
|
:medal {:name "Medal of strength" :value :medal :cursor :medal}
|
||||||
:certificate {:name "Certificate of courage" :value :certificate :cursor :certificate}
|
:certificate {:name "Certificate of courage" :value :certificate :cursor :certificate}
|
||||||
|
:sword {:name "Sword of Blergh" :value :sword :cursor :sword}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -39,7 +39,8 @@
|
|||||||
:choices actions/previous-choices}
|
:choices actions/previous-choices}
|
||||||
"Something else"
|
"Something else"
|
||||||
{:choices actions/something-else}]}
|
{:choices actions/something-else}]}
|
||||||
(when (get-in @entities [:state :wants-toy])
|
(when (and (get-in @entities [:state :wants-toy])
|
||||||
|
(not (get-in @entities [:state :allowed-to-keep-teddy?])))
|
||||||
"Listen, I really need that teddy bear you have.")
|
"Listen, I really need that teddy bear you have.")
|
||||||
{:run #(actions/respond entities %
|
{:run #(actions/respond entities %
|
||||||
:shopkeep "Why?"
|
:shopkeep "Why?"
|
||||||
@@ -67,7 +68,8 @@
|
|||||||
:shopkeep "Yes, that's it!"
|
:shopkeep "Yes, that's it!"
|
||||||
:shopkeep "You must have really met my son!"
|
:shopkeep "You must have really met my son!"
|
||||||
:shopkeep "Of course you can keep the teddy bear.")
|
:shopkeep "Of course you can keep the teddy bear.")
|
||||||
(actions/give entities :teddy))}]}]}
|
|
||||||
|
(actions/update-state entities (fn [s] (assoc s :allowed-to-keep-teddy? true))))}]}]}
|
||||||
"How's life in the antique shop biz?"
|
"How's life in the antique shop biz?"
|
||||||
{:run #(actions/respond entities %
|
{:run #(actions/respond entities %
|
||||||
:shopkeep "Pretty lonely."
|
:shopkeep "Pretty lonely."
|
||||||
@@ -78,6 +80,10 @@
|
|||||||
"Nevermind." {:run #(actions/respond entities % :shopkeep "Feel free to look around.")}]}))
|
"Nevermind." {:run #(actions/respond entities % :shopkeep "Feel free to look around.")}]}))
|
||||||
|
|
||||||
|
|
||||||
|
(defn has-to-return-teddy? [entities]
|
||||||
|
(and (actions/has-item? entities :teddy)
|
||||||
|
(not (get-in @entities [:state :allowed-to-keep-teddy?]))))
|
||||||
|
|
||||||
(defn make [screen]
|
(defn make [screen]
|
||||||
(let [shopkeep-sheet (texture! (texture "inside-antique/shopkeep-talk.png") :split 18 21)
|
(let [shopkeep-sheet (texture! (texture "inside-antique/shopkeep-talk.png") :split 18 21)
|
||||||
shopkeep-stand (animation 0.1 (for [i (flatten [(repeat 30 0) 1 (repeat 50 0) 1 0 1 0 1])]
|
shopkeep-stand (animation 0.1 (for [i (flatten [(repeat 30 0) 1 (repeat 50 0) 1 0 1 0 1])]
|
||||||
@@ -93,19 +99,41 @@
|
|||||||
(actions/play-animation entities :ego :reach)
|
(actions/play-animation entities :ego :reach)
|
||||||
(actions/talk entities :ego "It's a portrait. There's something on the back but I can't read it.")
|
(actions/talk entities :ego "It's a portrait. There's something on the back but I can't read it.")
|
||||||
(actions/remove-entity entities :portrait)
|
(actions/remove-entity entities :portrait)
|
||||||
(actions/give entities :portrait))))]
|
(actions/give entities :portrait))))
|
||||||
|
teddy (assoc (texture "inside-antique/teddy.png")
|
||||||
|
:x 250
|
||||||
|
:y 80
|
||||||
|
:baseline 160
|
||||||
|
:script (actions/get-script entities
|
||||||
|
(actions/walk-to entities :ego [220 35] :face :right)
|
||||||
|
(actions/play-animation entities :ego :reach)
|
||||||
|
(actions/give entities :teddy)
|
||||||
|
(actions/remove-entity entities :teddy)
|
||||||
|
(when (not (get-in @entities [:state :allowed-to-keep-teddy?]))
|
||||||
|
(actions/do-dialogue entities
|
||||||
|
:ego "Aww, a cute teddy bear!"
|
||||||
|
:shopkeep "Don't get any fast ideas."
|
||||||
|
:shopkeep "That teddy bear does not leave my store."))))]
|
||||||
(rooms/make :music :inside-antique
|
(rooms/make :music :inside-antique
|
||||||
:interactions
|
:interactions
|
||||||
{:down {:box [60 0 290 25]
|
{:down {:box [60 0 290 25]
|
||||||
:cursor :down
|
:cursor :down
|
||||||
:script (actions/get-script entities
|
:script (actions/get-script entities
|
||||||
(when (actions/has-item? entities :portrait)
|
(when (or (actions/has-item? entities :portrait)
|
||||||
|
(has-to-return-teddy? entities))
|
||||||
(actions/walk-to entities :ego [222 3])
|
(actions/walk-to entities :ego [222 3])
|
||||||
(actions/talk entities :shopkeep "Excuse me sonny. Please return my belongings before you leave.")
|
(actions/talk entities :shopkeep "Excuse me sonny. Please return my belongings before you leave.")
|
||||||
(actions/walk-to entities :ego [136 80] :face :left)
|
(when (actions/has-item? entities :portrait)
|
||||||
(actions/play-animation entities :ego :reach)
|
(actions/walk-to entities :ego [136 80] :face :left)
|
||||||
(actions/add-entity entities :portrait portrait)
|
(actions/play-animation entities :ego :reach)
|
||||||
(actions/remove-item entities :portrait))
|
(actions/add-entity entities :portrait portrait)
|
||||||
|
(actions/remove-item entities :portrait))
|
||||||
|
(when (has-to-return-teddy? entities)
|
||||||
|
(actions/walk-to entities :ego [220 35] :face :right)
|
||||||
|
(actions/play-animation entities :ego :reach)
|
||||||
|
(actions/add-entity entities :teddy teddy)
|
||||||
|
(actions/remove-item entities :teddy)))
|
||||||
|
|
||||||
(actions/walk-to entities :ego [222 3])
|
(actions/walk-to entities :ego [222 3])
|
||||||
(actions/transition-background entities :inside-castle [182 90]))}
|
(actions/transition-background entities :inside-castle [182 90]))}
|
||||||
:window {:box [212 130 256 180]
|
:window {:box [212 130 256 180]
|
||||||
@@ -121,6 +149,10 @@
|
|||||||
:stand shopkeep-stand
|
:stand shopkeep-stand
|
||||||
:talk shopkeep-talk
|
:talk shopkeep-talk
|
||||||
:script (actions/get-script entities (do-antique-dialogue entities))
|
:script (actions/get-script entities (do-antique-dialogue entities))
|
||||||
|
:scripts {:teddy (actions/get-script entities
|
||||||
|
(if (get-in @entities [:state :allowed-to-keep-teddy?])
|
||||||
|
(actions/talk entities :shopkeep "Please give the teddy bear to Herb when you see him.")
|
||||||
|
(actions/talk entities :shopkeep "That belonged to my long lost son.")))}
|
||||||
)
|
)
|
||||||
:stand)
|
:stand)
|
||||||
:portrait portrait
|
:portrait portrait
|
||||||
@@ -142,7 +174,13 @@
|
|||||||
(actions/talk entities :ego "WOWZA! Those are hot.")
|
(actions/talk entities :ego "WOWZA! Those are hot.")
|
||||||
(when (= 3 (get-in @entities [:state :mints-eaten]))
|
(when (= 3 (get-in @entities [:state :mints-eaten]))
|
||||||
(actions/talk entities :shopkeep "You brat! You ate the last mint.")
|
(actions/talk entities :shopkeep "You brat! You ate the last mint.")
|
||||||
(actions/talk entities :shopkeep "Since you ate the last one, you have to go tell Gandarf to bring me some more."))))))}
|
(actions/talk entities :shopkeep "Since you ate the last one, you have to go tell Gandarf to bring me some more."))))))
|
||||||
|
:teddy teddy}
|
||||||
:collision "inside-antique/collision.png"
|
:collision "inside-antique/collision.png"
|
||||||
|
:apply-state (fn [entities]
|
||||||
|
(as-> entities entities
|
||||||
|
(if (actions/has-obtained? entities :teddy)
|
||||||
|
(update-in entities [:room :entities] #(dissoc % :teddy))
|
||||||
|
entities)))
|
||||||
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.50)
|
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.50)
|
||||||
:start-pos [222 3])))
|
:start-pos [222 3])))
|
||||||
|
|||||||
@@ -101,11 +101,10 @@
|
|||||||
|
|
||||||
(defn pull-sword [entities]
|
(defn pull-sword [entities]
|
||||||
(actions/play-animation entities :ego :reach)
|
(actions/play-animation entities :ego :reach)
|
||||||
|
(actions/give entities :sword)
|
||||||
(actions/talk entities :ego "I got it! I will become the greatest knight Remington has ever known!"))
|
(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]
|
(defn try-to-pull-sword [entities missing-items obtained-items]
|
||||||
(actions/give entities :certificate)
|
|
||||||
(actions/give entities :medal)
|
|
||||||
(let [item->proof {:trophy "wisdom" :medal "strength" :certificate "courage"}]
|
(let [item->proof {:trophy "wisdom" :medal "strength" :certificate "courage"}]
|
||||||
(actions/play-animation entities :ego :reach)
|
(actions/play-animation entities :ego :reach)
|
||||||
(actions/do-dialogue entities
|
(actions/do-dialogue entities
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
(let [{:keys [x y]} (input->screen screen {:x (:input-x screen) :y (:input-y screen)})]
|
(let [{:keys [x y]} (input->screen screen {:x (:input-x screen) :y (:input-y screen)})]
|
||||||
(println (:input-x screen) (:input-y screen) "->" x y)))
|
(println (:input-x screen) (:input-y screen) "->" x y)))
|
||||||
|
|
||||||
(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal :certificate])
|
(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal :certificate :sword])
|
||||||
|
|
||||||
(defn cursor [filename which]
|
(defn cursor [filename which]
|
||||||
(let [scale 2
|
(let [scale 2
|
||||||
|
|||||||
Reference in New Issue
Block a user