From 424e8df93c811b13b09429a8d7884960c9919029 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Sun, 22 Nov 2015 16:02:20 -0800 Subject: [PATCH] steam achievements --- desktop/achievement-ideas.txt | 2 +- .../advent/screens/rooms/behind_house.clj | 2 +- .../advent/screens/rooms/castle_gate.clj | 17 +++-------------- .../advent/screens/rooms/cat_tree.clj | 4 +++- .../src-common/advent/screens/rooms/common.clj | 2 ++ .../src-common/advent/screens/rooms/dream.clj | 4 ++-- .../advent/screens/rooms/inside_cafeteria.clj | 4 +++- .../advent/screens/rooms/inside_castle.clj | 2 ++ 8 files changed, 17 insertions(+), 20 deletions(-) diff --git a/desktop/achievement-ideas.txt b/desktop/achievement-ideas.txt index d5da1bfc..babaceb7 100644 --- a/desktop/achievement-ideas.txt +++ b/desktop/achievement-ideas.txt @@ -1,10 +1,10 @@ ++ Escaped dream + Spied + Safe and sound? + Took all wool + something about shepherd + Worthy in wisdom + Worthy in courage - + + Worthy in might + Escaped jail + Returned monacle diff --git a/desktop/src-common/advent/screens/rooms/behind_house.clj b/desktop/src-common/advent/screens/rooms/behind_house.clj index a48e17a4..94b44e0c 100644 --- a/desktop/src-common/advent/screens/rooms/behind_house.clj +++ b/desktop/src-common/advent/screens/rooms/behind_house.clj @@ -89,7 +89,7 @@ (actions/talk entities :ego "So that's the code to his safe..." :animate? false :stop? false) (actions/play-animation entities :ego :end-squat) (actions/talk entities :ego "A lot of good it'll do me to know his password while he's still there.") - (steam/set-achievement "MASTER_SLEUTH") + (steam/set-achievement "SAFE_AND_SOUND") ) :else diff --git a/desktop/src-common/advent/screens/rooms/castle_gate.clj b/desktop/src-common/advent/screens/rooms/castle_gate.clj index 6e123f40..3d59e6e3 100644 --- a/desktop/src-common/advent/screens/rooms/castle_gate.clj +++ b/desktop/src-common/advent/screens/rooms/castle_gate.clj @@ -5,6 +5,7 @@ [advent.screens.rooms.common :as common] [advent.utils :as utils] [advent.screens.dialogue :as dialogue] + [advent.steam :as steam] [advent.tween :as tween] [clojure.zip :as zip] @@ -19,19 +20,6 @@ (defn make-night [entities] entities) - - - - - - - - - - - - - (defn make-coin-flip [screen] (let [coin-flip (utils/make-anim "castle-gate/coinflip.png" [10 10] 0.05 (range 5))] (assoc (animation->texture screen coin-flip) @@ -174,7 +162,8 @@ :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))))) + (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/cat_tree.clj b/desktop/src-common/advent/screens/rooms/cat_tree.clj index 923083ac..bd28dc98 100644 --- a/desktop/src-common/advent/screens/rooms/cat_tree.clj +++ b/desktop/src-common/advent/screens/rooms/cat_tree.clj @@ -5,6 +5,7 @@ [advent.screens.items :as items] [advent.screens.rooms.common :as common] [advent.utils :as utils] + [advent.steam :as steam] [clojure.zip :as zip] [play-clj.core :refer :all] [play-clj.ui :refer :all] @@ -356,7 +357,8 @@ :ego "What's this?") (actions/give entities :kiss) (actions/do-dialogue entities :ego "A kiss for an inventory item?" - :ego "Sounds like the game designer was running out of good ideas.")) + :ego "Sounds like the game designer was running out of good ideas.") + (steam/set-achievement "KITTY_KISS")) (actions/talk entities :ego "I guess I'm too far away."))) :default (actions/get-script entities (actions/talk entities :ego "Kitty seems disinterested in it."))}) cat-stand) diff --git a/desktop/src-common/advent/screens/rooms/common.clj b/desktop/src-common/advent/screens/rooms/common.clj index b02d91f8..d1868fcd 100644 --- a/desktop/src-common/advent/screens/rooms/common.clj +++ b/desktop/src-common/advent/screens/rooms/common.clj @@ -3,6 +3,7 @@ [advent.screens.rooms :as rooms] [advent.actions :as actions] [advent.screens.items :as items] + [advent.steam :as steam] [advent.utils :as utils] [advent.pathfind] [advent.tween :as tween] @@ -467,6 +468,7 @@ (actions/do-dialogue entities :ego "Hey!" :ego "I won!") + (steam/set-achievement "BLOODCLOT") (actions/glad entities) (actions/walk-straight-to entities :ego [340 55]) (actions/run-action entities diff --git a/desktop/src-common/advent/screens/rooms/dream.clj b/desktop/src-common/advent/screens/rooms/dream.clj index 99098573..a901d898 100644 --- a/desktop/src-common/advent/screens/rooms/dream.clj +++ b/desktop/src-common/advent/screens/rooms/dream.clj @@ -8,6 +8,7 @@ [advent.tween :as tween] [advent.utils :as utils] [advent.saves :as saves] + [advent.steam :as steam] [clojure.zip :as zip] [clojure.set :as set] [clojure.string :as str] @@ -279,8 +280,6 @@ :none))) (defn return-from-island [screen entities] - - (when (and (not (get-in entities [:fg-actions :script-running?])) (get-in entities [:state :active?]) (get-in entities [:room :entities :fairy-godfather :distracted?])) @@ -425,6 +424,7 @@ (actions/resume-camera entities) (actions/walk-straight-to entities :ego [79 145] :stop? false) (actions/walk-to entities :ego [159 74]) + (steam/set-achievement "DESTINY") (actions/do-dialogue entities :ego "Man! What a dream!" :ego "If I only really could be a knight." diff --git a/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj b/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj index fa47b8b3..49018c7d 100644 --- a/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj +++ b/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj @@ -3,6 +3,7 @@ [advent.screens.rooms :as rooms] [advent.screens.items :as items] [advent.actions :as actions] + [advent.steam :as steam] [advent.utils :as utils] [clojure.zip :as zip] [play-clj.core :refer :all] @@ -80,7 +81,8 @@ :warriors "Congratulations, young master. Thou art worthy in might." :warriors "Take thy servant's medal of strength.") (actions/give entities :medal) - (actions/glad entities)) + (actions/glad entities) + (steam/set-achievement "WISE_GUY")) (do (play-battle entities :lose) (actions/do-dialogue entities diff --git a/desktop/src-common/advent/screens/rooms/inside_castle.clj b/desktop/src-common/advent/screens/rooms/inside_castle.clj index f2330d57..6211567d 100644 --- a/desktop/src-common/advent/screens/rooms/inside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/inside_castle.clj @@ -5,6 +5,7 @@ [advent.screens.rooms.common :as common] [advent.screens.items :as items] [advent.utils :as utils] + [advent.steam :as steam] [advent.tween :as tween] [clojure.zip :as zip] [clojure.set :as set] @@ -589,6 +590,7 @@ (actions/remove-entity entities :trophy) (actions/glad entities) (actions/talk entities :ego "Thanks!") + (steam/set-achievement "WISE_GUY") ) (actions/do-dialogue entities :ego "What about this?" :game-player "No, that's not the solution. Keep looking.")) (brian-get-to-work entities))