diff --git a/desktop/resources/cursor.png b/desktop/resources/cursor.png index 54903096..13e09844 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 c7ed629e..940e8110 100644 --- a/desktop/src-common/advent/screens/items.clj +++ b/desktop/src-common/advent/screens/items.clj @@ -87,4 +87,5 @@ :flask-water-ash {:name "Water and ashes" :value :flask-water-ash :cursor :flask-with-contents} :note-1 {:name "Note from Gandarf" :value :note-1 :cursor :note-1} :ash {:name "Ashes" :value :ash :cursor :ash :scripts {:flask-water (make-water-and-ash)}} + :sack-lunch {:name "Sack lunch" :value :sack-lunch :cursor :sack-lunch} }) diff --git a/desktop/src-common/advent/screens/rooms/outside_jail.clj b/desktop/src-common/advent/screens/rooms/outside_jail.clj index 316cdf3f..d1147ca4 100644 --- a/desktop/src-common/advent/screens/rooms/outside_jail.clj +++ b/desktop/src-common/advent/screens/rooms/outside_jail.clj @@ -14,6 +14,16 @@ (-> entities (assoc-in [:room :entities :guard] (get-in entities [:room :guard])))) +(defn search-guard [entities] + (actions/walk-to entities :ego [121 75] :face :left) + (actions/play-animation entities :ego :squat) + (if (actions/has-obtained? entities :sack-lunch) + (actions/talk entities :ego "He doesn't have anything else on him.") + (do (actions/do-dialogue entities + :ego "He has a sack lunch here." + :ego "Looks like it's pretty mangled from his spill.") + (actions/give entities :sack-lunch)))) + (defn make [screen] (let [fountain (utils/make-anim "outside-jail/fountain.png" [42 50] 0.2 (range 3)) guard-sheet (texture! (texture "inside-cafeteria/ladder-guard.png") :split 37 87) @@ -83,11 +93,12 @@ :width 10 :height 10 :talk-color (color 0.9 0.3 0.9 1.0)}} - :guard (assoc (animation->texture screen guard-stand) - :x 70 :y 55 :baseline 185 - :stand guard-stand - :talk guard-talk - :sleep guard-sleep) + :guard (rooms/make-entity :guard (assoc (animation->texture screen guard-stand) + :x 70 :y 55 :baseline 185 + :stand guard-stand + :talk guard-talk + :sleep guard-sleep + :script (actions/get-script entities (search-guard entities)))) :collision "outside-jail/collision.png" :scale-fn (utils/scaler-fn-with-baseline 40 0.001 1.3) :start-pos [145 15] diff --git a/desktop/src-common/advent/utils.clj b/desktop/src-common/advent/utils.clj index 34e8454a..638b200e 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 :mandrake :ball-n-chain :key :rope :crowbar :note-1 :ash]) +(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 :ball-n-chain :key :rope :crowbar :note-1 :ash :sack-lunch]) (defn cursor [filename which] (let [scale 2