From 0c5617d500b721bdb4a99e09a14cc0b3ee482d70 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Tue, 28 Jun 2016 08:49:46 -0700 Subject: [PATCH] tweaked logic for bubba leaving. can't leave if you've got the slingshot. --- .../advent/screens/rooms/castle_gate.clj | 31 ++++++++++++------- .../advent/screens/rooms/common.clj | 3 +- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/desktop/src-common/advent/screens/rooms/castle_gate.clj b/desktop/src-common/advent/screens/rooms/castle_gate.clj index 04556010..e5a5dc63 100644 --- a/desktop/src-common/advent/screens/rooms/castle_gate.clj +++ b/desktop/src-common/advent/screens/rooms/castle_gate.clj @@ -156,20 +156,29 @@ :ego "Vote 'Yea' by signing below to pardon him of his crime." :ego "And vote 'Nay' to exact due justice.\"" :ego "Let's see..." - :ego "It looks like it's perfect tie! 34 to 34!"))) + :ego "It looks like it's perfect tie! 34 to 34!")) + (actions/update-state entities #(assoc % :has-read-voting-sheet? true))) (defn sign-note [entities] (actions/walk-to entities :ego [126 65] :face :left) - (if (get-in @entities [:state :has-voted?]) - (actions/do-dialogue entities :ego "Looks like I've already voted.") - (do - (actions/do-dialogue entities - :ego "It'd be a shame to have Took punished on my account!" - :ego "I'll vote to give him a pardon.") - (actions/play-animation entities :ego :reach) - (actions/do-dialogue entities :ego "There, now the vote is 35 to 34!") - (actions/update-state entities #(assoc % :has-voted? true)) - (steam/set-achievement "PARDON")))) + (cond + (not (get-in @entities [:state :has-read-voting-sheet?])) + (do + (actions/do-dialogue entities :ego "Let me read it first.") + (look-at-note entities) + (recur entities)) + + (get-in @entities [:state :has-voted?]) + (actions/do-dialogue entities :ego "Looks like I've already voted.") + :else + (do + (actions/do-dialogue entities + :ego "It'd be a shame to have Took punished on my account!" + :ego "I'll vote to give him a pardon.") + (actions/play-animation entities :ego :reach) + (actions/do-dialogue entities :ego "There, now the vote is 35 to 34!") + (actions/update-state entities #(assoc % :has-voted? true)) + (steam/set-achievement "PARDON")))) (defn make-note [] {:box [97 102 111 132] diff --git a/desktop/src-common/advent/screens/rooms/common.clj b/desktop/src-common/advent/screens/rooms/common.clj index 7c5e3f40..908c6e06 100644 --- a/desktop/src-common/advent/screens/rooms/common.clj +++ b/desktop/src-common/advent/screens/rooms/common.clj @@ -277,7 +277,8 @@ (actions/do-dialogue entities :frankie "That's only for people in the 'Super secret cool club'!")) :choices actions/previous-choices} - (when-not (get-in @entities [:state :bubba-gone?]) + (when (and (not (get-in @entities [:state :bubba-gone?])) + (not (actions/has-item? entities :slingshot))) "I found your secret stash!") {:run #(do (actions/respond entities % :frankie "What?!"