diff --git a/desktop/gametodos.txt b/desktop/gametodos.txt index ecb0ef2c..98b2d487 100644 --- a/desktop/gametodos.txt +++ b/desktop/gametodos.txt @@ -33,4 +33,5 @@ +can walk to top corner in house screen -+ ladder should break + ++ ladder can be lost by doing script on ladder diff --git a/desktop/src-common/advent/screens/rooms/cat_tree.clj b/desktop/src-common/advent/screens/rooms/cat_tree.clj index 7b2463cb..b6ec5813 100644 --- a/desktop/src-common/advent/screens/rooms/cat_tree.clj +++ b/desktop/src-common/advent/screens/rooms/cat_tree.clj @@ -9,13 +9,19 @@ [play-clj.ui :refer :all] [play-clj.utils :refer :all] [play-clj.g2d :refer :all])) -(defn get-down [entities] +(defn get-down [entities & break] (actions/walk-straight-to entities :ego [151 50] :update-baseline? false :face :left) - (actions/play-animation entities :ego :reach) - (actions/remove-entity entities :blank) - (actions/remove-entity entities :ladder) - (actions/give entities :ladder)) + (if break + (do (actions/play-animation entities :ladder :destroy-ladder :stop? false) + (actions/remove-entity entities :blank) + (actions/remove-entity entities :ladder) + (actions/play-animation entities :ego :sigh)) + + (do (actions/play-animation entities :ego :reach) + (actions/remove-entity entities :blank) + (actions/remove-entity entities :ladder) + (actions/give entities :ladder)))) (defn do-saved-grandma-dialogue [entities] (actions/walk-to entities :ego [165 45] :face :left) @@ -201,7 +207,10 @@ cat-stand (animation 0.15 (for [i (flatten [(repeat 10 0) 1 1 (repeat 10 0) 2 3 4 3 0 0 2 3 4 3 (repeat 10 0) 1 1 (repeat 10 0) 5 5 6 6 7 (repeat 10 [7 8]) 6 5 0])] (aget cat-stand-sheet 0 i))) cat-walk (animation 0.2 [(texture "cat-tree/pounce.png")]) - ladder-entity (assoc (texture "inside-cafeteria/ladder.png") :x 120 :y 60 :baseline 162) + destroy-ladder (utils/make-anim "cat-tree/destroy-ladder.png" [29 38] 0.075 (range 18)) + ladder-entity (assoc (texture "inside-cafeteria/ladder.png") :x 130 :y 60 :baseline 162 + :origin-x 0 + :destroy-ladder destroy-ladder) 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-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]) @@ -304,7 +313,7 @@ (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) + (get-down entities true) (actions/walk-straight-to entities :ego [165 45] :face :left) (actions/do-dialogue entities :ego "It's no big deal." diff --git a/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj b/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj index 33dc2bf8..970db05b 100644 --- a/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj +++ b/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj @@ -122,6 +122,22 @@ {:run #(actions/respond entities %)}]} "Something else." {:choices actions/something-else}]} + (when (and (actions/has-obtained? entities :ladder)) + "About that ladder...") + {:run #(if (actions/has-item? entities :ladder?) + (actions/respond entities % + :ladder-guard "I trusteth it is safe in thy possession?" + :ego "Yes, it sure is!" + :ego "Can I borrow it a while longer?" + :ladder-guard "Yes, but do not durst tell a soul!") + (actions/respond entities % + :ladder-guard "I trusteth it is safe in thy possession?" + :ego "Ahem..." + :ego "... Yes, it sure is!" + :ladder-guard "I senseth some uncertainty in thine voice." + :ego "No uncertainty here!")) + :choices actions/previous-choices} + "Why aren't you sitting and eating?" {:run #(do (actions/respond entities % :ladder-guard "I'm on duty, young sire.") (when (not (actions/has-obtained? entities :ladder)) @@ -214,7 +230,7 @@ :scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.3) :apply-state (fn [_ entities] (as-> entities entities - (if (actions/has-item? entities :ladder) + (if (actions/has-obtained? entities :ladder) (update-in entities [:room :entities] #(dissoc % :ladder)) entities))) :start-pos [300 55]))) diff --git a/desktop/src-common/advent/screens/rooms/inside_jail.clj b/desktop/src-common/advent/screens/rooms/inside_jail.clj index d8f5a64a..01a460da 100644 --- a/desktop/src-common/advent/screens/rooms/inside_jail.clj +++ b/desktop/src-common/advent/screens/rooms/inside_jail.clj @@ -86,11 +86,11 @@ :warden "The Duke of Remington is a very stern chap." :warden "He doesn't bend the rules, even for young thieves.") :choices actions/previous-choices} - "Took, son of Luke, son of Puke gave me that ladder!" + "Took, son of Luke, son of Puke lended me that ladder!" {:run #(actions/respond entities % :warden "It wasn't his to give." :warden "In fact, he's off to the gallows come dawn." - :ego "Oh, no.") + :ego "Oh boy.") :choices actions/previous-choices} "But I was going to teach Bloodclot a lesson!" {:run #(actions/respond entities %