diff --git a/desktop/resources/inside-castle/background.png b/desktop/resources/inside-castle/background.png index 54f779a2..8160b3b2 100644 Binary files a/desktop/resources/inside-castle/background.png and b/desktop/resources/inside-castle/background.png differ diff --git a/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj b/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj index f460ea46..fe444a3c 100644 --- a/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj +++ b/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj @@ -61,7 +61,8 @@ (actions/do-dialogue entities :ego "Hello." :ladder-guard "'Ello, young sire.") - (actions/present-choices entities {:choices ["Nice ladder." + (actions/present-choices entities {:choices [(when (not (actions/has-obtained? entities :ladder)) + "Nice ladder.") {:run #(actions/respond entities % :ladder-guard "Tis nice, indeed!" :ladder-guard "Belongeth to the Duke of Remington, it doth.") @@ -79,7 +80,9 @@ :choices ["Pretty pretty pretty please?" {:run #(do (actions/respond entities % :ladder-guard "Well, okay." - :ladder-guard "Do not darest telleth a soul, or the Duke will haveth my head!") + :ladder-guard "Do not darest telleth a soul, or thou wilst bring my family dishonor!" + :ladder-guard "I will shame the name of my father, Luke, and his father, Puke." + :ladder-guard "Not to mention, the duke will have my head!") (actions/walk-to entities :ego [245 75] :face :right) (actions/play-animation entities :ego :reach) (actions/remove-entity entities :ladder) @@ -95,14 +98,15 @@ "Something else." {:choices actions/something-else}]} "Why aren't you sitting and eating?" - {:run #(actions/respond entities % - :ladder-guard "I'm oneth duty, young sire." - :ladder-guard "Dost thou seeth this ladder?" - :ladder-guard "Tis my duty to guardeth it." - :ladder-guard "Why, if I didst sit and dineth with my friends, a hoodlum wouldst steal it.") + {:run #(do (actions/respond entities % :ladder-guard "I'm on duty, young sire.") + (when (not (actions/has-obtained? :ladder)) + (actions/do-dialogue entities + :ladder-guard "Dost thou seeth this ladder?" + :ladder-guard "Tis my duty to guardeth it." + :ladder-guard "Why, if I didst sit and dineth with my friends, a hoodlum wouldst steal it."))) :choices actions/previous-choices} "What's your name?" - {:run #(actions/respond entities % :ladder-guard "Tim.") + {:run #(actions/respond entities % :ladder-guard "I am Took, son of Luke, son of Puke.") :choices actions/previous-choices} "Goodbye." {:run #(actions/respond entities % "Goodbye.")}]}) diff --git a/desktop/src-common/advent/screens/rooms/inside_castle.clj b/desktop/src-common/advent/screens/rooms/inside_castle.clj index 150640e8..2a62bb88 100644 --- a/desktop/src-common/advent/screens/rooms/inside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/inside_castle.clj @@ -102,6 +102,7 @@ (defn pull-sword [entities] (actions/play-animation entities :ego :reach) (actions/give entities :sword) + (actions/remove-entity entities :sword) (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] @@ -153,15 +154,17 @@ (actions/transition-background entities :inside-antique [222 15]))} :sword {:box [0 130 39 165] :script (actions/get-script entities - (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]))] - (if (= #{} missing-items) - (pull-sword entities) - (try-to-pull-sword entities missing-items obtained-items)) - ))} + (if (actions/has-item? entities :sword) + (actions/talk entities :ego "I already have the Sword of Blergh!") + (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]))] + (if (= #{} missing-items) + (pull-sword entities) + (try-to-pull-sword entities missing-items obtained-items))))) + )} :sign {:box [125 140 165 155] :script (actions/get-script entities (actions/talk entities :ego "Ye Ol' Antique Shoppe."))} @@ -191,11 +194,18 @@ (concat p (reverse p)))) :bird-2 (utils/make-bird screen (as-> [[220 225] [195 235] [210 230] [250 225]] p (concat p (reverse p)))) + :sword (assoc (texture "inside-castle/sword.png") + :x 16 + :y 145 + :baseline 95) :trophy (assoc (animation->texture screen trophy) :x 253 :y 69 :baseline 191 :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)] @@ -251,5 +261,8 @@ (as-> entities entities (if (actions/has-item? entities :trophy) (update-in entities [:room :entities] #(dissoc % :trophy)) + entities) + (if (actions/has-item? entities :sword) + (update-in entities [:room :entities] #(dissoc % :sword)) entities))) :start-pos [245 90])))