From cabb25c51768949c957bc7102488d8e6293c63bc Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Wed, 15 Jun 2016 19:50:44 -0700 Subject: [PATCH] added better warning for missing cream. --- desktop/src-common/advent/screens/items.clj | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/desktop/src-common/advent/screens/items.clj b/desktop/src-common/advent/screens/items.clj index 2fb39331..748155ed 100644 --- a/desktop/src-common/advent/screens/items.clj +++ b/desktop/src-common/advent/screens/items.clj @@ -28,7 +28,8 @@ (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 strength potion!"))) + (actions/talk entities :ego "It's the completed strength potion!") + (actions/glad entities))) (defn make-water-and-ash [entities] @@ -69,12 +70,14 @@ (actions/talk entities :ego "I'll just put a few of these in here.")) (actions/talk entities :ego "I don't know if I could get them back out.")))) -(defn not-ready [] - (actions/get-script entities - (if (actions/has-item? entities :recipe) - (actions/do-dialogue entities :ego "I don't think it's quite ready for that." - :ego "Maybe I should double-check the recipe.") - (actions/talk entities :ego "I'm not sure I could get it back out.")))) +(defn not-ready + ([] (not-ready "I don't think it's quite ready for that.")) + ([msg] + (actions/get-script entities + (if (actions/has-item? entities :recipe) + (actions/do-dialogue entities :ego msg + :ego "Maybe I should double-check the recipe.") + (actions/talk entities :ego "I'm not sure I could get it back out."))))) (declare items) (defn mix-ingredients [base] @@ -101,7 +104,7 @@ :flask-1 (add-mushrooms-to-flask)}} :carrot {:name "Carrot" :value :carrot :cursor :carrot} :flask-1-with-mushrooms {:name "Flask with Mushrooms" :value :flask-1-with-mushrooms :cursor :flask-with-contents - :scripts {:mandrake (not-ready) :slobber (not-ready)}} + :scripts {:mandrake (not-ready) :slobber (not-ready "I've got the mushrooms, but I'm missing the cream.")}} :flask-1-with-milk {:name "Flask with Milk" :value :flask-1-with-milk :cursor :flask-with-contents :scripts {:mushrooms (actions/get-script entities (make-cream-of-mushroom entities)) :slobber (not-ready)