diff --git a/desktop/resources/cursor.png b/desktop/resources/cursor.png index 53e3b020..36366e90 100644 Binary files a/desktop/resources/cursor.png and b/desktop/resources/cursor.png differ diff --git a/desktop/src-common/advent/screens/items.clj b/desktop/src-common/advent/screens/items.clj index 1eb06a97..6be4f624 100644 --- a/desktop/src-common/advent/screens/items.clj +++ b/desktop/src-common/advent/screens/items.clj @@ -55,18 +55,26 @@ (def used-earplugs {:name "Choicest used earplugs" :value :used-earplugs :cursor :used-earplugs}) (def grass {:name "Huge grass" :value :grass :cursor :grass}) -(defn make-strength-potion [] +(defn add-slobber [] (actions/get-script entities (actions/remove-item entities :flask-1-with-cream-of-mushroom) (actions/remove-item entities :slobber) + (actions/give entities :flask-1-slobber) + (actions/talk entities :ego "I put the slobber in with the cream of mushroom."))) + +(defn make-strength-potion [] + (actions/get-script entities + (actions/remove-item entities :flask-1-slobber) + (actions/remove-item entities :mandrake) (actions/give entities :flask-1-strength) - (actions/talk entities :ego "It's the completed potion of strength!"))) + (actions/talk entities :ego "It's the completed strength potion!"))) (def items {:wool {:name "Wool" :value :wool :cursor :wool :scripts {:stick make-cat-toy}} - :mushrooms {:name "Mushrooms" :value :mushrooms :cursor :mushrooms} + :mushrooms {:name "Mushrooms" :value :mushrooms :cursor :mushrooms + :scripts {:flask-1-with-milk (actions/get-script entities (make-cream-of-mushroom entities))}} :carrot {:name "Carrot" :value :carrot :cursor :carrot} :flask-1-with-mushrooms {:name "Flask with mushrooms" :value :flask-1-with-mushrooms :cursor :flask-with-contents} :flask-1-with-milk {:name "Flask with milk" :value :flask-1-with-milk :cursor :flask-with-contents @@ -85,7 +93,7 @@ :stick {:name "Stick" :value :stick :cursor :stick :scripts {:wool make-cat-toy}} :balloon {:name "Choicest of balloons" :value :balloon :cursor :balloon} :frog-legs {:name "Frog legs" :value :frog-legs :cursor :frog-legs} - :ladder {:name "ladder" :value :ladder :cursor :ladder} + :ladder {:name "Ladder" :value :ladder :cursor :ladder} :teddy {:name "Teddy Bear" :value :teddy :cursor :teddy} :portrait {:name "Portrait" :value :portrait :cursor :portrait} :recipe {:name "Strength potion recipe" :value :recipe :cursor :recipe} @@ -93,10 +101,14 @@ :motivational-tapes {:name "Choicest motivational tapes" :value :motivational-tapes :cursor :motivational-tapes} :used-earplugs {:name "Choicest used earplugs" :value :used-earplugs :cursor :used-earplugs} :grass {:name "High protein grass" :value :grass :cursor :grass} - :slobber {:name "Bull slobber" :value :slobber :cursor :slobber :scripts {:flask-1-with-cream-of-mushroom (make-strength-potion)}} + :slobber {:name "Bull slobber" :value :slobber :cursor :slobber :scripts {:flask-1-with-cream-of-mushroom (add-slobber)}} :flask-1-with-cream-of-mushroom {:name "Flask with cream of mushrooms soup" :value :flask-1-with-cream-of-mushroom :cursor :flask-with-contents - :scripts {:slobber (make-strength-potion)}} + :scripts {:slobber (add-slobber)}} + :flask-1-slobber {:name "Cream of mushrooms soup and bull slobber" :value :flask-1-slobber :cursor :flask-with-contents + :scripts {:mandrake (make-strength-potion)}} :medal {:name "Medal of strength" :value :medal :cursor :medal} :kiss {:name "Kiss for courage" :value :kiss :cursor :kiss} :sword {:name "Sword of Blergh" :value :sword :cursor :sword} + :mandrake {:name "Mandrake root" :value :mandrake :cursor :mandrake + :scripts {:flask-1-slobber (make-strength-potion) }} }) diff --git a/desktop/src-common/advent/screens/rooms/cat_tree.clj b/desktop/src-common/advent/screens/rooms/cat_tree.clj index 3cebc013..b2e3796f 100644 --- a/desktop/src-common/advent/screens/rooms/cat_tree.clj +++ b/desktop/src-common/advent/screens/rooms/cat_tree.clj @@ -136,6 +136,13 @@ (actions/talk entities :ego "I don't really need any more grass.")))} :grandma {:box [109 33 132 98] :script (actions/get-script entities (do-grandma-dialogue entities)) + :scripts #(condp = % + :kiss + (actions/get-script entities + (do-saved-grandma-dialogue entities)) + (actions/get-script entities + (actions/walk-to entities :ego [165 45] :face :left) + (actions/do-dialogue entities :grandma "No thank you, handsome."))) }} :layers [(assoc (texture "cat-tree/background.png") :x 0 :y 0 :baseline 0) (assoc (texture "cat-tree/tree-and-rock.png") :x 0 :y 0 :baseline 161) diff --git a/desktop/src-common/advent/screens/rooms/inside_antique.clj b/desktop/src-common/advent/screens/rooms/inside_antique.clj index f9001e1e..d74ce0ae 100644 --- a/desktop/src-common/advent/screens/rooms/inside_antique.clj +++ b/desktop/src-common/advent/screens/rooms/inside_antique.clj @@ -171,10 +171,19 @@ :talk-color (color 0.2 1.0 0.2 1.0) :talk shopkeep-talk :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.")))} + :scripts #(condp = % + :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."))) + :portrait (actions/get-script entities + (if (get-in @entities [:state :allowed-to-keep-teddy?]) + (actions/talk entities :shopkeep "That's a portrait of my little Herb. " + :shopkeep "Please put it back before you leave." ) + (actions/talk entities :shopkeep "That's a portrait of my long lost son. " + :shopkeep "Please put it back before you leave."))) + (actions/get-script entities + (actions/talk entities :shopkeep "No thanks, sonny."))) ) :stand) :portrait portrait diff --git a/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj b/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj index e699f8a7..7422866c 100644 --- a/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj +++ b/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj @@ -150,7 +150,7 @@ [4 4 4 4 4 4 0 0 0 0 4 4 4 0 0 0 4 4 4 0 0 1 1 0 0 4 4 4 5 5 5 5 4 4 4 5 5 5 5 4 4 4 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6])))] (rooms/make :music :town-1 :interactions - {:right-dir {:box [300 0 320 120] + {:right-dir {:box [300 45 320 120] :script (actions/get-script entities (actions/walk-to entities :ego [319 50]) @@ -169,14 +169,23 @@ :facing :right :talk-color (color 1.0 0.2 0.3 1.0) :script (actions/get-script entities - (do-warrior-dialogue entities) - )) + (do-warrior-dialogue entities)) + :scripts (constantly (actions/get-script entities + (actions/walk-to entities :ego [150 45] :face :left) + (actions/do-dialogue entities :warriors + "We are warriors. We coveteth not earthly possessions.")))) :stand) :ladder-guard (actions/start-animation screen (assoc (animation->texture screen ladder-guard-stand) :x 202 :y 85 :baseline 155 :stand ladder-guard-stand :talk ladder-guard-talk :talk-color (color 0.2 0.6 1.0 1.0) - :script (actions/get-script entities (do-ladder-guard-dialogue entities))) + :script (actions/get-script entities (do-ladder-guard-dialogue entities)) + :scripts #(actions/get-script entities + (actions/walk-to entities :ego [170 45] :face :right) + (actions/do-dialogue entities :ladder-guard + (if (= :ladder %) + "Do not durst telleth a soul about that ladder!" + "No thank you, young sire.")))) :stand) :ladder (assoc (texture "inside-cafeteria/ladder.png") :x 250 :y 85 :baseline 155 :script (actions/get-script entities diff --git a/desktop/src-common/advent/screens/rooms/inside_castle.clj b/desktop/src-common/advent/screens/rooms/inside_castle.clj index 3fd49ca8..3aabf4ee 100644 --- a/desktop/src-common/advent/screens/rooms/inside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/inside_castle.clj @@ -128,7 +128,7 @@ game-player-stand (animation 0.15 (for [i [0 0 0 0 0 0 0 0 0 0 0 1]] (aget game-player-talk-sheet 0 i))) - game-player-flex (animation 0.075 (for [i [0 0 4 4 5 5 5 5 5 5 5 6 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 6 5 5 4 4 0 0 0 0]] + game-player-flex (animation 0.075 (for [i [0 0 4 4 5 5 5 5 5 5 5 6 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 6 5 5 5 5 5 5 5 5 5 5 4 4 0 0 0 0]] (aget game-player-talk-sheet 0 i))) trophy (utils/make-anim "inside-castle/trophy.png" [16 16] 0.1 (flatten [(repeat 50 0) 1 2 3 3 3 3 2 1]))] (rooms/make :music :town-1 @@ -152,7 +152,13 @@ (sound! (sound "door.ogg") :play) (actions/play-animation entities :ego :reach) (actions/transition-background entities :inside-antique [228 -30]) - (actions/walk-straight-to entities :ego [222 15] :face :left))} + (actions/walk-straight-to entities :ego [222 15] :face :left) + (if (get-in @entities [:state :allowed-to-keep-teddy?]) + (actions/do-dialogue entities :shopkeep "Hello there, sonny." + :shopkeep "Have you seen Herb lately?" + :ego "Erm... No, not recently." + :shopkeep "Oh. Send him my love if you do see him.") + (actions/talk entities :shopkeep "Hello there, sonny.")))} :sword {:box [0 130 39 165] :script (actions/get-script entities (if (actions/has-item? entities :sword) diff --git a/desktop/src-common/advent/screens/rooms/inside_house.clj b/desktop/src-common/advent/screens/rooms/inside_house.clj index ef2f0917..bc82818b 100644 --- a/desktop/src-common/advent/screens/rooms/inside_house.clj +++ b/desktop/src-common/advent/screens/rooms/inside_house.clj @@ -16,7 +16,7 @@ (if (actions/has-item? entities :recipe) (do (actions/play-animation entities :ego :squat) - (actions/talk entities :ego "It's empty now.")) + (actions/talk entities :ego "I already took everything interesting from there.")) (do (actions/talk entities :ego "Yes! That worked.") (actions/talk entities :ego "Let's see here...") @@ -29,8 +29,8 @@ (actions/talk entities :ego "Aha! Here it is! I found a recipe for a strength potion!") (actions/talk entities :ego "Looks like there's something else in here too...") (actions/play-animation entities :ego :squat) - (actions/give entities :frog-legs) - (actions/talk entities :ego "Eww. Frog legs.")))) + (actions/give entities :mandrake) + (actions/talk entities :ego "Weird. It's some kind of root.")))) :failure (actions/get-script entities (actions/talk entities :ego "I don't think that worked..."))) (actions/update-state entities #(assoc % :active? false))) @@ -137,7 +137,35 @@ :disappear wizard-disappear} :talk-color (color 0.95 0.3 1.0 1.0) :facing :left - :script (actions/get-script entities (do-wizard-dialogue entities))) + :script (actions/get-script entities (do-wizard-dialogue entities)) + :scripts #(condp = % + :kiss (actions/get-script entities + (actions/do-dialogue entities + :wizard "Good job boy! You saved a damsel in distress." + :wizard "You have proven yourself worthy in courage.")) + :medal (actions/get-script entities + (actions/do-dialogue entities + :wizard "So you beat Captain McHulk at arm wrestling? " + :wizard "You must have been working out!")) + :trophy (actions/get-script entities + (actions/do-dialogue entities + :wizard "My, my, you have proven your worth in wisdom!" + :wizard "One day you'll be as wise as me!")) + :recipe (actions/get-script entities + (actions/do-dialogue entities + :ego "I probably shouldn't show him that I have his stolen posessions.")) + :frog-legs (actions/get-script entities + (actions/do-dialogue entities + :ego "I probably shouldn't show him that I have his stolen posessions.")) + :mandrake (actions/get-script entities + (actions/do-dialogue entities + :ego "I probably shouldn't show him that I have his stolen posessions.")) + :flask-1 (actions/get-script entities + (actions/do-dialogue entities + :wizard "You can keep the flask.")) + (actions/get-script entities + (actions/do-dialogue entities + :wizard "No thank you.")))) :stand) :safe-lock (actions/start-animation screen (assoc (animation->texture screen safe-lock) :x 51 :y 95 :baseline 145 :stand safe-lock) @@ -156,14 +184,25 @@ (actions/give entities :flask-1) (when (get-in @entities [:room :entities :wizard]) (actions/do-dialogue entities :ego "Hey you think I could have this flask?" - :wizard "Sure."))))} + :wizard "Sure.")))) + :frog-legs (assoc (texture "inside-house/frog-legs.png") + :x 180 :y 77 :baseline 240 + :script (actions/get-script entities + (if (get-in @entities [:room :entities :wizard]) + (actions/do-dialogue entities :wizard "Hey, I need those frog legs for one of my spells!") + (do (actions/give entities :frog-legs) + (actions/remove-entity entities :frog-legs) + (actions/do-dialogue entities :ego "Eww. Frog legs.")))))} :collision "inside-house/collision.png" :scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.75) :apply-state (fn [entities] (as-> entities entities - (if (actions/has-one-of? entities [:flask-1 :flask-1-with-cream-of-mushroom :flask-1-strength :flask-1-with-mushrooms :flask-1-with-milk]) + (if (actions/has-obtained? entities :flask-1) (update-in entities [:room :entities] #(dissoc % :flask)) entities) + (if (actions/has-obtained? entities :frog-legs) + (update-in entities [:room :entities] #(dissoc % :frog-legs)) + entities) (if (get-in entities [:state :wizard-left?]) (update-in entities [:room :entities] #(dissoc % :wizard)) entities))) diff --git a/desktop/src-common/advent/utils.clj b/desktop/src-common/advent/utils.clj index b38c6ff4..057abaef 100644 --- a/desktop/src-common/advent/utils.clj +++ b/desktop/src-common/advent/utils.clj @@ -14,7 +14,7 @@ (let [{:keys [x y]} (input->screen screen {:x (:input-x screen) :y (:input-y screen)})] (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 :kiss :sword :hourglass]) +(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 :kiss :sword :hourglass :mandrake]) (defn cursor [filename which] (let [scale 2