From e5306e63d51667d7050c95e51a754d9cfe683ebe Mon Sep 17 00:00:00 2001 From: Robert Chen Date: Thu, 28 Nov 2013 21:23:00 -0800 Subject: [PATCH] Door close, price tweaks --- js/main.js | 8 ++++---- js/stories.js | 5 +++-- js/ui.js | 11 ++++++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/js/main.js b/js/main.js index a4b67f8..a312255 100644 --- a/js/main.js +++ b/js/main.js @@ -230,10 +230,10 @@ function GameState(){ "res/screens/KitchenScreen/StuffingSpecialKitchen.png","res/screens/KitchenScreen/StuffingSpecialKitchenGlow.png", "Once rated as the most handsome man in the universe. Scott and his patented special stuffing will set you on the path to food heaven" ), - "Organic Turkey" : new MarketItem( this, "Organic Turkey", 180,360, randomWeight[0]*2.00, "res/items/Turkey5.png", "res/items/Turkey5Glow.png",null,null, "All natural. No hormones. No antibiotics. Free Range. Lead Free", parseFloat(randomWeight[0]) ), - "Free Range Turkey": new MarketItem( this, "Free Range Turkey", 540,320, randomWeight[1]*1.25, "res/items/Turkey4.png", "res/items/Turkey4Glow.png",null,null, "Our turkeys have wide open spaces to roam and are fed with only the highest quality feed.", parseFloat(randomWeight[1]) ), - "Sunny Farms Turkey" : new MarketItem( this, "Sunny Farms Turkey", 265,415, randomWeight[2]*0.85, "res/items/Turkey3.png", "res/items/Turkey3Glow.png",null,null, "100% Turkey product from Sunny Farms Heavy Industries, Ltd.", parseFloat(randomWeight[2]) ), - "Pastured Turkey": new MarketItem( this, "Pastured Turkey", 474,357, randomWeight[3]*1.75, "res/items/Turkey2.png", "res/items/Turkey2Glow.png",null,null, "Grassy fields and natural ingredients allow our turkeys to have a better life, and taste great.", parseFloat(randomWeight[3]) ), + "Organic Turkey" : new MarketItem( this, "Organic Turkey", 180,360, randomWeight[0]*1.6, "res/items/Turkey5.png", "res/items/Turkey5Glow.png",null,null, "All natural. No hormones. No antibiotics. Free Range. Lead Free", parseFloat(randomWeight[0]) ), + "Free Range Turkey": new MarketItem( this, "Free Range Turkey", 540,320, randomWeight[1]*1.20, "res/items/Turkey4.png", "res/items/Turkey4Glow.png",null,null, "Our turkeys have wide open spaces to roam and are fed with only the highest quality feed.", parseFloat(randomWeight[1]) ), + "Sunny Farms Turkey" : new MarketItem( this, "Sunny Farms Turkey", 265,415, randomWeight[2]*0.80, "res/items/Turkey3.png", "res/items/Turkey3Glow.png",null,null, "100% Turkey product from Sunny Farms Heavy Industries, Ltd.", parseFloat(randomWeight[2]) ), + "Pastured Turkey": new MarketItem( this, "Pastured Turkey", 474,357, randomWeight[3]*1.4, "res/items/Turkey2.png", "res/items/Turkey2Glow.png",null,null, "Grassy fields and natural ingredients allow our turkeys to have a better life, and taste great.", parseFloat(randomWeight[3]) ), "General Turkey": new MarketItem( this, "General Turkey", 378,426, randomWeight[4]*1.00, "res/items/Turkey1.png", "res/items/Turkey1Glow.png",null,null, "100% General Satisfaction Guaranteed", parseFloat(randomWeight[4]) ) }; diff --git a/js/stories.js b/js/stories.js index b5f7f0c..1c52473 100644 --- a/js/stories.js +++ b/js/stories.js @@ -4,8 +4,9 @@ var messages = { "CannotBuyTurkey" : ["Me: I've barely have time for ONE turkey, let alone TWO!"], "NoMoney" : ["Me: I can't afford this!"], "BuyTurkeyFirst" : ["Me: I should buy a turkey first!"], - "BrokenLight" : ["Me: The oven light appears to be broken..."], - "EmptyOven" : ["Me: The oven is already preheated..."] + "BrokenLight" : ["Me: Hmm... the oven light appears to be broken..."], + "EmptyOven" : ["Me: Ah, the oven is already preheated..."], + "OpenDoor" :["Me: Hmm... I should probably try opening the oven door to measure the turkey's temperature"] } var story = { diff --git a/js/ui.js b/js/ui.js index 0e489d1..19b5234 100644 --- a/js/ui.js +++ b/js/ui.js @@ -274,9 +274,14 @@ function OvenUI( stage, gameState ){ // Show core temperature this.showTempDialog = function(){ - state = ovenModel.getTurkeyState(); - gameState.pubsub.publish( "ShowDialog", {seq:"custom", autoAdvance:false, customText:"Hmm.. the core temperature of the turkey is " + UtilityFunctions.C2F(state.core.temp).toFixed(2) + " F" } ); - gameState.pubsub.publish( "AddRecord", "Core temperature measured: " + UtilityFunctions.C2F(state.core.temp).toFixed(2) + " F" ); + if( that.ovenDoor == OVEN_CLOSED ){ + gameState.pubsub.publish("ShowDialog", {seq:"OpenDoor", autoAdvance:true}); + } + else{ + state = ovenModel.getTurkeyState(); + gameState.pubsub.publish( "ShowDialog", {seq:"custom", autoAdvance:false, customText:"Hmm.. the core temperature of the turkey is " + UtilityFunctions.C2F(state.core.temp).toFixed(2) + " F" } ); + gameState.pubsub.publish( "AddRecord", "Core temperature measured: " + UtilityFunctions.C2F(state.core.temp).toFixed(2) + " F" ); + } } new CookbookUI( stage, gameState );