From 07d21bfc1d166dd4050482afdb53dbe63f320d2c Mon Sep 17 00:00:00 2001 From: Nicholas Laux Date: Tue, 8 Apr 2014 14:00:45 -0400 Subject: [PATCH 001/180] Merge changes from branch master --- fc_bookmarklet_loader.js | 2 +- fc_userscript_loader.user.js | 2 +- frozen_cookies.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fc_bookmarklet_loader.js b/fc_bookmarklet_loader.js index fef7a7dc..6286ee38 100644 --- a/fc_bookmarklet_loader.js +++ b/fc_bookmarklet_loader.js @@ -3,7 +3,7 @@ javascript:( var js = document.createElement('script'); js.setAttribute('type', 'text/javascript'); js.setAttribute('id', 'frozenCookieScript'); - js.setAttribute('src', 'https://raw.github.com/Icehawk78/FrozenCookies/master/frozen_cookies.js'); + js.setAttribute('src', 'http://icehawk78.github.io/FrozenCookies/frozen_cookies.js'); document.head.appendChild(js); }() ); diff --git a/fc_userscript_loader.user.js b/fc_userscript_loader.user.js index db0af88d..e5a395d9 100644 --- a/fc_userscript_loader.user.js +++ b/fc_userscript_loader.user.js @@ -17,7 +17,7 @@ function LoadFrozenCookies() { var js = document.createElement('script'); js.setAttribute('type', 'text/javascript'); js.setAttribute('id', 'frozenCookieScript'); - js.setAttribute('src', 'https://raw.github.com/Icehawk78/FrozenCookies/master/frozen_cookies.js'); + js.setAttribute('src', 'http://icehawk78.github.io/FrozenCookies/frozen_cookies.js'); document.head.appendChild(js); } // It's not the best way but Chrome doesn't work with addEventListener... :( diff --git a/frozen_cookies.js b/frozen_cookies.js index 3e32b04a..d27598de 100644 --- a/frozen_cookies.js +++ b/frozen_cookies.js @@ -2,10 +2,10 @@ var scriptElement = document.getElementById( 'frozenCookieScript' ), baseUrl = scriptElement !== null ? scriptElement.getAttribute('src').replace(/\/frozen_cookies\.js$/, '') : - 'https://raw.github.com/Icehawk78/FrozenCookies/master', + 'http://icehawk78.github.io/FrozenCookies/', FrozenCookies = { 'baseUrl': baseUrl, - 'branch' : 'M', + 'branch' : 'G', 'version': 1.12 }; From 47146c767e4d2163f33db2f6324a105ee9679daa Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 8 Apr 2014 19:43:28 -0400 Subject: [PATCH 002/180] Fix for checking the price discount value of Santa upgrades --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index c73a0032..7e7abdc7 100644 --- a/fc_main.js +++ b/fc_main.js @@ -655,7 +655,7 @@ function checkPrices(discount) { var nextRec = FrozenCookies.caches.recommendationList.filter(function(i){return i.id != Game.Upgrades['Season savings'].id && i.id != Game.Upgrades['Toy workshop']})[0]; var nextPrereq = (nextRec.type == 'upgrade') ? unfinishedUpgradePrereqs(nextRec.purchase) : null; nextRec = nextPrereq == null ? nextRec : FrozenCookies.caches.recommendationList.filter(function(a){return nextPrereq.some(function(b){return b.id == a.id && b.type == a.type})})[0]; - value = (nextRec.cost / totalDiscount(nextRec.type == 'building')) - nextRec.cost; + value = nextRec.cost == null ? 0 : (nextRec.cost / totalDiscount(nextRec.type == 'building')) - nextRec.cost; } return value; } From 6d4baf22382fa179525b1e2617b2251723ff0029 Mon Sep 17 00:00:00 2001 From: Nicholas Laux Date: Wed, 9 Apr 2014 13:35:39 -0400 Subject: [PATCH 003/180] Initial fix for new version --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 7e7abdc7..fc874867 100644 --- a/fc_main.js +++ b/fc_main.js @@ -76,7 +76,7 @@ function setOverrides() { Game.oldBackground = Game.DrawBackground; Game.DrawBackground = function() {Game.oldBackground(); updateTimers();} // Remove the following when turning on tooltop code - Game.RebuildStore(); +// Game.RebuildStore(); Game.RebuildUpgrades(); beautifyUpgradesAndAchievements(); // Replace Game.Popup references with event logging From ee7ecd65a1477a36665ded1db1627d1dc1ea240b Mon Sep 17 00:00:00 2001 From: Nicholas Laux Date: Wed, 9 Apr 2014 14:51:07 -0400 Subject: [PATCH 004/180] Award anti-vanilla achievement on load --- fc_main.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/fc_main.js b/fc_main.js index fc874867..82b7c784 100644 --- a/fc_main.js +++ b/fc_main.js @@ -82,15 +82,11 @@ function setOverrides() { // Replace Game.Popup references with event logging eval("Game.goldenCookie.click = " + Game.goldenCookie.click.toString().replace(/Game\.Popup\((.+)\)\;/g, 'logEvent("GC", $1, true);')); eval("Game.UpdateWrinklers = " + Game.UpdateWrinklers.toString().replace(/Game\.Popup\((.+)\)\;/g, 'logEvent("Wrinkler", $1, true);')); -/* - eval("Game.Draw = " + Game.Draw.toString() - .replace(/if \(Game.cookies>=me.price\) l\('product'\+me.id\).className='product enabled'; else l\('product'\+me.id\).className='product disabled';/, '(Game.cookies >= me.price) ? $("#product"+me.id).addClass("enabled").removeClass("disabled") : $("#product"+me.id).addClass("disabled").removeClass("enabled");') - .replace(/if \(Game.cookies>=me.basePrice\) l\('upgrade'\+i\).className='crate upgrade enabled'; else l\('upgrade'\+i\).className='crate upgrade disabled';/, '(Game.cookies >= me.basePrice) ? $("#upgrade"+me.id).addClass("enabled").removeClass("disabled") : $("#upgrade"+me.id).addClass("disabled").removeClass("enabled");')); - Game.RebuildStore=function(recalculate) {rebuildStore(recalculate);} - Game.RebuildUpgrades=function(recalculate) {rebuildUpgrades(recalculate);} - Game.RebuildStore(true); - Game.RebuildUpgrades(true); -*/ + + // Give free achievements! + if(!Game.HasAchiev('Third-party')) { + Game.Win('Third-party'); + } } function preferenceParse(setting, defaultVal) { From 2faac03b189fcc8e53390f99fda38d2795fc9920 Mon Sep 17 00:00:00 2001 From: Nicholas Laux Date: Wed, 9 Apr 2014 16:15:27 -0400 Subject: [PATCH 005/180] Add new upgrade prereqs --- cc_upgrade_prerequisites.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cc_upgrade_prerequisites.js b/cc_upgrade_prerequisites.js index 81e692a5..35a28c12 100644 --- a/cc_upgrade_prerequisites.js +++ b/cc_upgrade_prerequisites.js @@ -86,66 +86,78 @@ var upgradeJson = [ {'id':43,'buildings':[160,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, {'id':82,'buildings':[200,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, {'id':109,'buildings':[240,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':188,'buildings':[280,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':189,'buildings':[320,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, {'id':7,'buildings':[0,1,0,0,0,0,0,0,0,0,0],'upgrades':[]}, {'id':8,'buildings':[0,1,0,0,0,0,0,0,0,0,0],'upgrades':[]}, {'id':9,'buildings':[0,10,0,0,0,0,0,0,0,0,0],'upgrades':[]}, {'id':44,'buildings':[0,50,0,0,0,0,0,0,0,0,0],'upgrades':[]}, {'id':110,'buildings':[0,100,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':192,'buildings':[0,200,0,0,0,0,0,0,0,0,0],'upgrades':[]}, {'id':10,'buildings':[0,0,1,0,0,0,0,0,0,0,0],'upgrades':[]}, {'id':11,'buildings':[0,0,1,0,0,0,0,0,0,0,0],'upgrades':[]}, {'id':12,'buildings':[0,0,10,0,0,0,0,0,0,0,0],'upgrades':[]}, {'id':45,'buildings':[0,0,50,0,0,0,0,0,0,0,0],'upgrades':[]}, {'id':111,'buildings':[0,0,100,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':193,'buildings':[0,0,200,0,0,0,0,0,0,0,0],'upgrades':[]}, {'id':13,'buildings':[0,0,0,1,0,0,0,0,0,0,0],'upgrades':[]}, {'id':14,'buildings':[0,0,0,1,0,0,0,0,0,0,0],'upgrades':[]}, {'id':15,'buildings':[0,0,0,10,0,0,0,0,0,0,0],'upgrades':[]}, {'id':46,'buildings':[0,0,0,50,0,0,0,0,0,0,0],'upgrades':[]}, {'id':112,'buildings':[0,0,0,100,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':194,'buildings':[0,0,0,200,0,0,0,0,0,0,0],'upgrades':[]}, {'id':16,'buildings':[0,0,0,0,1,0,0,0,0,0,0],'upgrades':[]}, {'id':17,'buildings':[0,0,0,0,1,0,0,0,0,0,0],'upgrades':[]}, {'id':18,'buildings':[0,0,0,0,10,0,0,0,0,0,0],'upgrades':[]}, {'id':47,'buildings':[0,0,0,0,50,0,0,0,0,0,0],'upgrades':[]}, {'id':113,'buildings':[0,0,0,0,100,0,0,0,0,0,0],'upgrades':[]}, + {'id':195,'buildings':[0,0,0,0,200,0,0,0,0,0,0],'upgrades':[]}, {'id':19,'buildings':[0,0,0,0,0,1,0,0,0,0,0],'upgrades':[]}, {'id':20,'buildings':[0,0,0,0,0,1,0,0,0,0,0],'upgrades':[]}, {'id':21,'buildings':[0,0,0,0,0,10,0,0,0,0,0],'upgrades':[]}, {'id':48,'buildings':[0,0,0,0,0,50,0,0,0,0,0],'upgrades':[]}, {'id':114,'buildings':[0,0,0,0,0,100,0,0,0,0,0],'upgrades':[]}, + {'id':196,'buildings':[0,0,0,0,0,200,0,0,0,0,0],'upgrades':[]}, {'id':22,'buildings':[0,0,0,0,0,0,1,0,0,0,0],'upgrades':[]}, {'id':23,'buildings':[0,0,0,0,0,0,1,0,0,0,0],'upgrades':[]}, {'id':24,'buildings':[0,0,0,0,0,0,10,0,0,0,0],'upgrades':[]}, {'id':49,'buildings':[0,0,0,0,0,0,50,0,0,0,0],'upgrades':[]}, {'id':115,'buildings':[0,0,0,0,0,0,100,0,0,0,0],'upgrades':[]}, + {'id':197,'buildings':[0,0,0,0,0,0,200,0,0,0,0],'upgrades':[]}, {'id':25,'buildings':[0,0,0,0,0,0,0,1,0,0,0],'upgrades':[]}, {'id':26,'buildings':[0,0,0,0,0,0,0,1,0,0,0],'upgrades':[]}, {'id':27,'buildings':[0,0,0,0,0,0,0,10,0,0,0],'upgrades':[]}, {'id':50,'buildings':[0,0,0,0,0,0,0,50,0,0,0],'upgrades':[]}, {'id':116,'buildings':[0,0,0,0,0,0,0,100,0,0,0],'upgrades':[]}, + {'id':198,'buildings':[0,0,0,0,0,0,0,200,0,0,0],'upgrades':[]}, {'id':28,'buildings':[0,0,0,0,0,0,0,0,1,0,0],'upgrades':[]}, {'id':29,'buildings':[0,0,0,0,0,0,0,0,1,0,0],'upgrades':[]}, {'id':30,'buildings':[0,0,0,0,0,0,0,0,10,0,0],'upgrades':[]}, {'id':51,'buildings':[0,0,0,0,0,0,0,0,50,0,0],'upgrades':[]}, {'id':117,'buildings':[0,0,0,0,0,0,0,0,100,0,0],'upgrades':[]}, + {'id':199,'buildings':[0,0,0,0,0,0,0,0,200,0,0],'upgrades':[]}, {'id':99,'buildings':[0,0,0,0,0,0,0,0,0,1,0],'upgrades':[]}, {'id':100,'buildings':[0,0,0,0,0,0,0,0,0,1,0],'upgrades':[]}, {'id':101,'buildings':[0,0,0,0,0,0,0,0,0,10,0],'upgrades':[]}, {'id':102,'buildings':[0,0,0,0,0,0,0,0,0,50,0],'upgrades':[]}, {'id':118,'buildings':[0,0,0,0,0,0,0,0,0,100,0],'upgrades':[]}, + {'id':200,'buildings':[0,0,0,0,0,0,0,0,0,200,0],'upgrades':[]}, {'id':175,'buildings':[0,0,0,0,0,0,0,0,0,0,1],'upgrades':[]}, {'id':176,'buildings':[0,0,0,0,0,0,0,0,0,0,1],'upgrades':[]}, {'id':177,'buildings':[0,0,0,0,0,0,0,0,0,0,10],'upgrades':[]}, {'id':178,'buildings':[0,0,0,0,0,0,0,0,0,0,50],'upgrades':[]}, {'id':179,'buildings':[0,0,0,0,0,0,0,0,0,0,100],'upgrades':[]}, + {'id':201,'buildings':[0,0,0,0,0,0,0,0,0,0,200],'upgrades':[]}, {'id':57,'buildings':[0,1,15,0,0,0,0,0,0,0,0],'upgrades':[]}, {'id':58,'buildings':[0,1,0,15,0,0,0,0,0,0,0],'upgrades':[]}, From 9f0c45e6cca269505c2cbf714189be79fb1c6f07 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 9 Apr 2014 22:49:09 -0400 Subject: [PATCH 006/180] Fix breaking --- fc_main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fc_main.js b/fc_main.js index 82b7c784..66cfbec8 100644 --- a/fc_main.js +++ b/fc_main.js @@ -76,7 +76,7 @@ function setOverrides() { Game.oldBackground = Game.DrawBackground; Game.DrawBackground = function() {Game.oldBackground(); updateTimers();} // Remove the following when turning on tooltop code -// Game.RebuildStore(); + Game.RefreshStore(); Game.RebuildUpgrades(); beautifyUpgradesAndAchievements(); // Replace Game.Popup references with event logging @@ -352,7 +352,7 @@ function cyclePreference(preferenceName) { FrozenCookies[preferenceName] = newValue; updateLocalStorage(); FrozenCookies.recalculateCaches = true; - Game.RebuildStore(); + Game.RefreshStore(); Game.RebuildUpgrades(); FCStart(); } @@ -650,7 +650,7 @@ function checkPrices(discount) { if (discount > 0 && FrozenCookies.caches.recommendationList.length > 0) { var nextRec = FrozenCookies.caches.recommendationList.filter(function(i){return i.id != Game.Upgrades['Season savings'].id && i.id != Game.Upgrades['Toy workshop']})[0]; var nextPrereq = (nextRec.type == 'upgrade') ? unfinishedUpgradePrereqs(nextRec.purchase) : null; - nextRec = nextPrereq == null ? nextRec : FrozenCookies.caches.recommendationList.filter(function(a){return nextPrereq.some(function(b){return b.id == a.id && b.type == a.type})})[0]; + nextRec = nextPrereq == null ? nextRec : FrozenCookies.caches.recommendationList.filter(function(a){return nextPrereq.some(function(b){return b.id == a.id && b.type == a.type && a.price != null})})[0]; value = nextRec.cost == null ? 0 : (nextRec.cost / totalDiscount(nextRec.type == 'building')) - nextRec.cost; } return value; From 51446343713b54a5e731a2499772d01c6683efce Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 9 Apr 2014 22:50:40 -0400 Subject: [PATCH 007/180] Update fc_main.js --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 66cfbec8..29034ac5 100644 --- a/fc_main.js +++ b/fc_main.js @@ -650,7 +650,7 @@ function checkPrices(discount) { if (discount > 0 && FrozenCookies.caches.recommendationList.length > 0) { var nextRec = FrozenCookies.caches.recommendationList.filter(function(i){return i.id != Game.Upgrades['Season savings'].id && i.id != Game.Upgrades['Toy workshop']})[0]; var nextPrereq = (nextRec.type == 'upgrade') ? unfinishedUpgradePrereqs(nextRec.purchase) : null; - nextRec = nextPrereq == null ? nextRec : FrozenCookies.caches.recommendationList.filter(function(a){return nextPrereq.some(function(b){return b.id == a.id && b.type == a.type && a.price != null})})[0]; + nextRec = nextPrereq == null ? nextRec : FrozenCookies.caches.recommendationList.filter(function(a){return nextPrereq.some(function(b){return b.id == a.id && b.type == a.type && b.price != null})})[0]; value = nextRec.cost == null ? 0 : (nextRec.cost / totalDiscount(nextRec.type == 'building')) - nextRec.cost; } return value; From 20ec4dabdf0d9cd9963e699bd1e201d617c54ec2 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 9 Apr 2014 22:54:02 -0400 Subject: [PATCH 008/180] Santa fix --- fc_main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fc_main.js b/fc_main.js index 29034ac5..ccb6c4f6 100644 --- a/fc_main.js +++ b/fc_main.js @@ -649,8 +649,8 @@ function checkPrices(discount) { var value = 0; if (discount > 0 && FrozenCookies.caches.recommendationList.length > 0) { var nextRec = FrozenCookies.caches.recommendationList.filter(function(i){return i.id != Game.Upgrades['Season savings'].id && i.id != Game.Upgrades['Toy workshop']})[0]; - var nextPrereq = (nextRec.type == 'upgrade') ? unfinishedUpgradePrereqs(nextRec.purchase) : null; - nextRec = nextPrereq == null ? nextRec : FrozenCookies.caches.recommendationList.filter(function(a){return nextPrereq.some(function(b){return b.id == a.id && b.type == a.type && b.price != null})})[0]; + var nextPrereq = (nextRec.type == 'upgrade') ? unfinishedUpgradePrereqs(nextRec.purchase).filter(function(u){return u.cost != null;}) : null; + nextRec = (nextPrereq == null || nextPrereq.length == 0) ? nextRec : FrozenCookies.caches.recommendationList.filter(function(a){return nextPrereq.some(function(b){return b.id == a.id && b.type == a.type && b.price != null})})[0]; value = nextRec.cost == null ? 0 : (nextRec.cost / totalDiscount(nextRec.type == 'building')) - nextRec.cost; } return value; From 60693342234f27acba62a8420d3c90a47c4933bc Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 9 Apr 2014 22:56:09 -0400 Subject: [PATCH 009/180] Update fc_main.js --- fc_main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fc_main.js b/fc_main.js index ccb6c4f6..81d31af8 100644 --- a/fc_main.js +++ b/fc_main.js @@ -649,8 +649,8 @@ function checkPrices(discount) { var value = 0; if (discount > 0 && FrozenCookies.caches.recommendationList.length > 0) { var nextRec = FrozenCookies.caches.recommendationList.filter(function(i){return i.id != Game.Upgrades['Season savings'].id && i.id != Game.Upgrades['Toy workshop']})[0]; - var nextPrereq = (nextRec.type == 'upgrade') ? unfinishedUpgradePrereqs(nextRec.purchase).filter(function(u){return u.cost != null;}) : null; - nextRec = (nextPrereq == null || nextPrereq.length == 0) ? nextRec : FrozenCookies.caches.recommendationList.filter(function(a){return nextPrereq.some(function(b){return b.id == a.id && b.type == a.type && b.price != null})})[0]; + var nextPrereq = (nextRec.type == 'upgrade') ? unfinishedUpgradePrereqs(nextRec.purchase) : null; + nextRec = (nextPrereq == null || nextPrereq.filter(function(u){return u.cost != null;}).length == 0) ? nextRec : FrozenCookies.caches.recommendationList.filter(function(a){return nextPrereq.some(function(b){return b.id == a.id && b.type == a.type})})[0]; value = nextRec.cost == null ? 0 : (nextRec.cost / totalDiscount(nextRec.type == 'building')) - nextRec.cost; } return value; From 729ba856a45abf7891defd95c5630e34a69c138c Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sat, 12 Apr 2014 15:43:33 -0400 Subject: [PATCH 010/180] Fix final form error --- fc_main.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fc_main.js b/fc_main.js index 81d31af8..65bb8c5e 100644 --- a/fc_main.js +++ b/fc_main.js @@ -82,7 +82,7 @@ function setOverrides() { // Replace Game.Popup references with event logging eval("Game.goldenCookie.click = " + Game.goldenCookie.click.toString().replace(/Game\.Popup\((.+)\)\;/g, 'logEvent("GC", $1, true);')); eval("Game.UpdateWrinklers = " + Game.UpdateWrinklers.toString().replace(/Game\.Popup\((.+)\)\;/g, 'logEvent("Wrinkler", $1, true);')); - + // Give free achievements! if(!Game.HasAchiev('Third-party')) { Game.Win('Third-party'); @@ -645,17 +645,16 @@ function haveAll(holiday) { return _.every(holidayCookies[holiday], function(id) {return Game.UpgradesById[id].unlocked;}); } -function checkPrices(discount) { +function checkPrices(currentUpgrade) { var value = 0; - if (discount > 0 && FrozenCookies.caches.recommendationList.length > 0) { - var nextRec = FrozenCookies.caches.recommendationList.filter(function(i){return i.id != Game.Upgrades['Season savings'].id && i.id != Game.Upgrades['Toy workshop']})[0]; + if (FrozenCookies.caches.recommendationList.length > 0) { + var nextRec = FrozenCookies.caches.recommendationList.filter(function(i){return i.id != currentUpgrade.id;})[0]; var nextPrereq = (nextRec.type == 'upgrade') ? unfinishedUpgradePrereqs(nextRec.purchase) : null; nextRec = (nextPrereq == null || nextPrereq.filter(function(u){return u.cost != null;}).length == 0) ? nextRec : FrozenCookies.caches.recommendationList.filter(function(a){return nextPrereq.some(function(b){return b.id == a.id && b.type == a.type})})[0]; value = nextRec.cost == null ? 0 : (nextRec.cost / totalDiscount(nextRec.type == 'building')) - nextRec.cost; } return value; } - // Use this for changes to future efficiency calcs function purchaseEfficiency(price, deltaCps, baseDeltaCps, currentCps) { var efficiency = Number.POSITIVE_INFINITY; @@ -765,7 +764,7 @@ function upgradeStats(recalculate) { var reverseFunctions = upgradeToggle(current); var baseCpsNew = baseCps(); var cpsNew = effectiveCps(currentBank); // baseCpsNew + gcPs(cookieValue(currentBank)) + baseClickingCps(FrozenCookies.autoClick * FrozenCookies.cookieClickSpeed); - var priceReduction = checkPrices(discounts - (totalDiscount() + totalDiscount(true))); + var priceReduction = discounts == (totalDiscount() + totalDiscount(true)) ? 0 : checkPrices(current); upgradeToggle(current, existingAchievements, reverseFunctions); Game.elderWrath = existingWrath; var deltaCps = cpsNew - cpsOrig; From 48e11f3bbc1634e643b6f16fada5c6e725a13bf9 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Fri, 18 Apr 2014 13:05:37 -0400 Subject: [PATCH 011/180] Bigger numbers, merge from branch/master --- fc_main.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fc_main.js b/fc_main.js index 65bb8c5e..c4a7873b 100644 --- a/fc_main.js +++ b/fc_main.js @@ -151,7 +151,10 @@ var numberFormatters = [ ' quadrillion', ' quintillion', ' sextillion', - ' septillion' + ' septillion', + ' octillion', + ' nonillion', + ' decillion' ]), formatEveryThirdPower([ @@ -162,7 +165,10 @@ var numberFormatters = [ ' Qa', ' Qi', ' Sx', - ' Sp' + ' Sp', + ' Oc', + ' No', + ' De' ]), formatEveryThirdPower([ From d6e1bb8d8f7961d84165390e90c6b12c0b72c602 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 21 Apr 2014 21:37:11 -0400 Subject: [PATCH 012/180] Update fcReset to pop wrinklers and clear stats --- fc_main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fc_main.js b/fc_main.js index c4a7873b..121af01c 100644 --- a/fc_main.js +++ b/fc_main.js @@ -231,6 +231,7 @@ function timeDisplay(seconds) { } function fcReset(bypass) { + Game.CollectWrinklers(); Game.oldReset(bypass); FrozenCookies.nonFrenzyTime = 0; FrozenCookies.frenzyTime = 0; @@ -241,6 +242,7 @@ function fcReset(bypass) { FrozenCookies.maxHCPercent = 0; FrozenCookies.prevLastHCTime = Date.now(); FrozenCookies.lastCps = 0; + FrozenCookies.trackedStats = []; updateLocalStorage(); recommendationList(true); } From 0eb27140980ce27a5c6d4aed12d7509a22ed7e3e Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 21 Apr 2014 21:56:04 -0400 Subject: [PATCH 013/180] Make FC aware of wrinkler cookies as well. --- fc_main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fc_main.js b/fc_main.js index 121af01c..24f7a3c8 100644 --- a/fc_main.js +++ b/fc_main.js @@ -237,7 +237,7 @@ function fcReset(bypass) { FrozenCookies.frenzyTime = 0; FrozenCookies.last_gc_state = (Game.frenzy > 0); FrozenCookies.last_gc_time = Date.now(); - FrozenCookies.lastHCAmount = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset); + FrozenCookies.lastHCAmount = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + w.sucked * 1.1;}, 0)); FrozenCookies.lastHCTime = Date.now(); FrozenCookies.maxHCPercent = 0; FrozenCookies.prevLastHCTime = Date.now(); @@ -1331,7 +1331,7 @@ function shouldPopWrinklers() { var futureWrinklers = living.length - (current.ids.length + 1); if (current.total < nextRecNeeded && effectiveCps(delay, Game.elderWrath, futureWrinklers) + nextRecCps > effectiveCps()) { current.ids.push(w.id); - current.total += w.sucked; + current.total += w.sucked * 1.1; } return current; }, {total:0, ids:[]}); @@ -1369,7 +1369,7 @@ function autoFrenzyClick() { function autoCookie() { if (!FrozenCookies.processing) { FrozenCookies.processing = true; - var currentHCAmount = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset); + var currentHCAmount = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + w.sucked * 1.1;}, 0)); if (FrozenCookies.lastHCAmount < currentHCAmount) { var changeAmount = currentHCAmount - FrozenCookies.lastHCAmount; FrozenCookies.lastHCAmount = currentHCAmount; From eda213516d0220a7286c30ce32e6f1e7f424ac0d Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 22 Apr 2014 12:46:45 -0400 Subject: [PATCH 014/180] Wrinkler HC in graphs --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 24f7a3c8..061d6a88 100644 --- a/fc_main.js +++ b/fc_main.js @@ -1112,7 +1112,7 @@ function saveStats(fromGraph) { time: Date.now() - Game.startDate, baseCps: baseCps(), effectiveCps: effectiveCps(), - hc: Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset) + hc: Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + w.sucked * 1.1},0)) }); if ($('#statGraphContainer').length > 0 && !$('#statGraphContainer').is(':hidden') && !fromGraph) { viewStatGraphs(); From 26c034924e245cead7d8a2951b9376e7209c7f7e Mon Sep 17 00:00:00 2001 From: Nicholas Date: Fri, 25 Apr 2014 15:06:01 -0400 Subject: [PATCH 015/180] Add wrinkler info window and condense keydown listeners --- fc_main.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/fc_main.js b/fc_main.js index 061d6a88..5f25e289 100644 --- a/fc_main.js +++ b/fc_main.js @@ -296,27 +296,25 @@ function getBuildingSpread () { return Game.ObjectsById.map(function(a){return a.amount;}).join('/') } -// Press 'b' to pop up a copyable window with building spread. -document.addEventListener('keydown', function(event) { - if(event.keyCode == 66) { - copyToClipboard(getBuildingSpread()); - } -}); - // Press 'a' to toggle autobuy. +// Press 'b' to pop up a copyable window with building spread. +// Press 'c' to toggle auto-GC +// Press 'w' to display a wrinkler-info window document.addEventListener('keydown', function(event) { if(event.keyCode == 65) { Game.Toggle('autoBuy','autobuyButton','Autobuy OFF','Autobuy ON'); toggleFrozen('autoBuy'); } -}); - -// Press 'c' to toggle auto-GC -document.addEventListener('keydown', function(event) { + if(event.keyCode == 66) { + copyToClipboard(getBuildingSpread()); + } if(event.keyCode == 67) { Game.Toggle('autoGC','autogcButton','Autoclick GC OFF','Autoclick GC ON'); toggleFrozen('autoGC'); } + if(event.keyCode == 87) { + Game.Notify('Wrinkler Info', 'Popping all wrinklers will give you ' + Beautify(Game.wrinklers.reduce(function(s,w){return s + w.sucked * 1.1},0)) + ' cookies. ', [19,8],7); + } }); function writeFCButton(setting) { From d93fdb2f9b4b10747f503a616a4f3598ac8661c6 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Fri, 25 Apr 2014 15:30:04 -0400 Subject: [PATCH 016/180] Frenzy/Blood Frenzy should be more accurate in payouts --- fc_main.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fc_main.js b/fc_main.js index 5f25e289..7ecf7984 100644 --- a/fc_main.js +++ b/fc_main.js @@ -455,7 +455,6 @@ function cookieValue(bankAmount, wrathValue, wrinklerCount) { var clickCps = baseClickingCps(FrozenCookies.autoClick * FrozenCookies.cookieClickSpeed); var frenzyCps = FrozenCookies.autoFrenzy ? baseClickingCps(FrozenCookies.autoFrenzy * FrozenCookies.frenzyClickSpeed) : clickCps; var luckyMod = Game.Has('Get lucky') ? 2 : 1; - var clickFrenzyMod = (Game.clickFrenzy > 0) ? 777 : 1 wrathValue = wrathValue != null ? wrathValue : Game.elderWrath; wrinklerCount = wrinklerCount != null ? wrinklerCount : (wrathValue ? 10 : 0); var wrinkler = wrinklerMod(wrinklerCount); @@ -464,9 +463,9 @@ function cookieValue(bankAmount, wrathValue, wrinklerCount) { // Clot value -= cookieInfo.clot.odds[wrathValue] * (cps + clickCps) * luckyMod * wrinkler * 66 * 0.5; // Frenzy - value += cookieInfo.frenzy.odds[wrathValue] * (cps + clickCps) * luckyMod * wrinkler * 77 * 7; + value += cookieInfo.frenzy.odds[wrathValue] * (cps + clickCps) * luckyMod * wrinkler * 77 * 6; // Blood - value += cookieInfo.blood.odds[wrathValue] * (cps + clickCps) * luckyMod * wrinkler * 666 * 6; + value += cookieInfo.blood.odds[wrathValue] * (cps + clickCps) * luckyMod * wrinkler * 6 * 665; // Chain value += cookieInfo.chain.odds[wrathValue] * calculateChainValue(bankAmount, cps, (7 - (wrathValue / 3))); // Ruin From 113757f7dcbf1886a15876786a9b3171fb9331f7 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 28 Apr 2014 08:34:47 -0400 Subject: [PATCH 017/180] Remove wrinkler saving, add toggleable wrinkler valuation --- fc_main.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fc_main.js b/fc_main.js index 7ecf7984..9ccdb5eb 100644 --- a/fc_main.js +++ b/fc_main.js @@ -69,9 +69,9 @@ function setOverrides() { Game.oldLoadSave = Game.LoadSave; Game.Reset = fcReset; Game.WriteSave = fcWriteSave; - if (FrozenCookies.saveWrinklers && localStorage.wrinklers) { - Game.wrinklers = JSON.parse(localStorage.wrinklers); - } +// if (FrozenCookies.saveWrinklers && localStorage.wrinklers) { +// Game.wrinklers = JSON.parse(localStorage.wrinklers); +// } Game.Win = fcWin; Game.oldBackground = Game.DrawBackground; Game.DrawBackground = function() {Game.oldBackground(); updateTimers();} @@ -248,9 +248,9 @@ function fcReset(bypass) { } function fcWriteSave(exporting) { - if (FrozenCookies.saveWrinklers && Game.wrinklers) { - localStorage.wrinklers = JSON.stringify(Game.wrinklers); - } +// if (FrozenCookies.saveWrinklers && Game.wrinklers) { +// localStorage.wrinklers = JSON.stringify(Game.wrinklers); +// } return Game.oldWriteSave(exporting); } @@ -1311,7 +1311,7 @@ function liveWrinklers() { } function wrinklerMod(num) { - return 1 + num * (0.055 * num - 0.05); + return FrozenCookies.includeWrinklers ? 1 + num * (0.055 * num - 0.05) : 1; } function shouldPopWrinklers() { @@ -1468,9 +1468,9 @@ function FCStart() { FrozenCookies.statBot = 0; } - if (!FrozenCookies.saveWrinklers && localStorage.wrinklers) { - delete localStorage.wrinklers; - } +// if (!FrozenCookies.saveWrinklers && localStorage.wrinklers) { +// delete localStorage.wrinklers; +// } // Remove until timing issues are fixed // if (FrozenCookies.goldenCookieBot) { From aa679f564276f06929f8bc9b9529e53a85124dc3 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 28 Apr 2014 08:36:23 -0400 Subject: [PATCH 018/180] Remove wrinkler saving, add toggleable wrinkler valuation --- cc_upgrade_prerequisites.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cc_upgrade_prerequisites.js b/cc_upgrade_prerequisites.js index 35a28c12..94146430 100644 --- a/cc_upgrade_prerequisites.js +++ b/cc_upgrade_prerequisites.js @@ -47,10 +47,10 @@ FrozenCookies.preferenceValues = { 'default':0, 'extras':'Set Time Travel Amount' },*/ - 'saveWrinklers':{ - 'hint':'Store wrinkler information in FC upon game save, and restore wrinklers upon game load. (This is essentially only for crash prevention.)', - 'display':['Wrinkler Saving OFF','Wrinkler Saving ON'], - 'default':0 + 'includeWrinklers':{ + 'hint':'Include wrinklers in efficiency calculations.', + 'display':['Wrinkler Valuation OFF','Wrinkler Valuation ON'], + 'default':1 }, 'simulatedGCPercent':{ 'hint':'What percentage of Golden Cookies should be assumed as "clicked" for GC efficiency calculations (100% recommended)', From f2aa7725b2f715c1a4d6fd21e82c96353195f05e Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 28 Apr 2014 10:47:18 -0400 Subject: [PATCH 019/180] Fix huge wrinkler bug --- fc_main.js | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/fc_main.js b/fc_main.js index 9ccdb5eb..876c2762 100644 --- a/fc_main.js +++ b/fc_main.js @@ -461,11 +461,11 @@ function cookieValue(bankAmount, wrathValue, wrinklerCount) { var value = 0; // Clot - value -= cookieInfo.clot.odds[wrathValue] * (cps + clickCps) * luckyMod * wrinkler * 66 * 0.5; + value -= cookieInfo.clot.odds[wrathValue] * (wrinkler * cps + clickCps) * luckyMod * 66 * 0.5; // Frenzy - value += cookieInfo.frenzy.odds[wrathValue] * (cps + clickCps) * luckyMod * wrinkler * 77 * 6; + value += cookieInfo.frenzy.odds[wrathValue] * (wrinkler * cps + clickCps) * luckyMod * 77 * 6; // Blood - value += cookieInfo.blood.odds[wrathValue] * (cps + clickCps) * luckyMod * wrinkler * 6 * 665; + value += cookieInfo.blood.odds[wrathValue] * (wrinkler * cps + clickCps) * luckyMod * 6 * 665; // Chain value += cookieInfo.chain.odds[wrathValue] * calculateChainValue(bankAmount, cps, (7 - (wrathValue / 3))); // Ruin @@ -491,6 +491,48 @@ function cookieValue(bankAmount, wrathValue, wrinklerCount) { return value; } +function cookieStats(bankAmount, wrathValue, wrinklerCount) { + var cps = baseCps(); + var clickCps = baseClickingCps(FrozenCookies.autoClick * FrozenCookies.cookieClickSpeed); + var frenzyCps = FrozenCookies.autoFrenzy ? baseClickingCps(FrozenCookies.autoFrenzy * FrozenCookies.frenzyClickSpeed) : clickCps; + var luckyMod = Game.Has('Get lucky') ? 2 : 1; + var clickFrenzyMod = (Game.clickFrenzy > 0) ? 777 : 1 + wrathValue = wrathValue != null ? wrathValue : Game.elderWrath; + wrinklerCount = wrinklerCount != null ? wrinklerCount : (wrathValue ? 10 : 0); + var wrinkler = wrinklerMod(wrinklerCount); + + var result = {}; + // Clot + result.clot = -1 * cookieInfo.clot.odds[wrathValue] * (wrinkler * cps + clickCps) * luckyMod * 66 * 0.5; + // Frenzy + result.frenzy = cookieInfo.frenzy.odds[wrathValue] * (wrinkler * cps + clickCps) * luckyMod * 77 * 7; + // Blood + result.blood = cookieInfo.blood.odds[wrathValue] * (wrinkler * cps + clickCps) * luckyMod * 666 * 6; + // Chain + result.chain = cookieInfo.chain.odds[wrathValue] * calculateChainValue(bankAmount, cps, (7 - (wrathValue / 3))); + // Ruin + result.ruin = -1 * cookieInfo.ruin.odds[wrathValue] * (Math.min(bankAmount * 0.05, cps * 60 * 10) + 13); + // Frenzy + Ruin + result.frenzyRuin = -1 * cookieInfo.frenzyRuin.odds[wrathValue] * (Math.min(bankAmount * 0.05, cps * 60 * 10 * 7) + 13); + // Clot + Ruin + result.clotRuin = -1 * cookieInfo.clotRuin.odds[wrathValue] * (Math.min(bankAmount * 0.05, cps * 60 * 10 * 0.5) + 13); + // Lucky + result.lucky = cookieInfo.lucky.odds[wrathValue] * (Math.min(bankAmount * 0.1, cps * 60 * 20) + 13); + // Frenzy + Lucky + result.frenzyLucky = cookieInfo.frenzyLucky.odds[wrathValue] * (Math.min(bankAmount * 0.1, cps * 60 * 20 * 7) + 13); + // Clot + Lucky + result.clotLucky = cookieInfo.clotLucky.odds[wrathValue] * (Math.min(bankAmount * 0.1, cps * 60 * 20 * 0.5) + 13); + // Click + result.click = cookieInfo.click.odds[wrathValue] * frenzyCps * luckyMod * 13 * 777; + // Frenzy + Click + result.frenzyClick = cookieInfo.frenzyClick.odds[wrathValue] * frenzyCps * luckyMod * 13 * 777 * 7; + // Clot + Click + result.clotClick = cookieInfo.clotClick.odds[wrathValue] * frenzyCps * luckyMod * 13 * 777 * 0.5; + // Blah + result.blah = 0; + return result; +} + function reindeerValue(wrathValue) { var value = 0; if (Game.season == 'christmas') { From fb0ff5a6b1f1e0683b813d051c6222d01253d274 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 28 Apr 2014 10:51:24 -0400 Subject: [PATCH 020/180] Version Tick --- frozen_cookies.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen_cookies.js b/frozen_cookies.js index d27598de..d9361987 100644 --- a/frozen_cookies.js +++ b/frozen_cookies.js @@ -6,7 +6,7 @@ var scriptElement = document.getElementById( 'frozenCookieScript' ), FrozenCookies = { 'baseUrl': baseUrl, 'branch' : 'G', - 'version': 1.12 + 'version': 1.2 }; // Load external libraries From 8eb6d6608e5251403825e5eebaa73f7b58b9e999 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 30 Apr 2014 10:50:19 -0400 Subject: [PATCH 021/180] Remove precalculated golden/reindeer probability lists --- cc_upgrade_prerequisites.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/cc_upgrade_prerequisites.js b/cc_upgrade_prerequisites.js index 94146430..9b939076 100644 --- a/cc_upgrade_prerequisites.js +++ b/cc_upgrade_prerequisites.js @@ -282,14 +282,22 @@ var cookieInfo = { 'blah': {'odds':[0,0,0,0], isOverlap:false} }; +function generateProbabilities(upgradeLevel, minBase, maxMult) { + var cumProb = []; + var remainingProbability = 1; + var upgradeDiv = upgradeLevel ? 2 * upgradeLevel : 1; + var minTime = minBase / upgradeDiv; + var maxTime = maxMult * minTime; + var spanTime = maxTime - minTime; + for (var i=0; i Date: Wed, 30 Apr 2014 12:34:47 -0400 Subject: [PATCH 022/180] Frenzy/Clot probabilities don't include chain effects --- fc_main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fc_main.js b/fc_main.js index 876c2762..80c6da3d 100644 --- a/fc_main.js +++ b/fc_main.js @@ -437,12 +437,12 @@ function effectiveCps(delay, wrathValue, wrinklerCount) { function frenzyProbability(wrathValue) { wrathValue = wrathValue != null ? wrathValue : Game.elderWrath; - return cookieInfo.frenzy.odds[wrathValue] + cookieInfo.frenzyRuin.odds[wrathValue] + cookieInfo.frenzyLucky.odds[wrathValue] + cookieInfo.frenzyClick.odds[wrathValue]; + return cookieInfo.frenzy.odds[wrathValue];// + cookieInfo.frenzyRuin.odds[wrathValue] + cookieInfo.frenzyLucky.odds[wrathValue] + cookieInfo.frenzyClick.odds[wrathValue]; } function clotProbability(wrathValue) { wrathValue = wrathValue != null ? wrathValue : Game.elderWrath; - return cookieInfo.clot.odds[wrathValue] + cookieInfo.clotRuin.odds[wrathValue] + cookieInfo.clotLucky.odds[wrathValue] + cookieInfo.clotClick.odds[wrathValue]; + return cookieInfo.clot.odds[wrathValue];// + cookieInfo.clotRuin.odds[wrathValue] + cookieInfo.clotLucky.odds[wrathValue] + cookieInfo.clotClick.odds[wrathValue]; } function bloodProbability(wrathValue) { From a9f3cc889ad212ff1f57891a8891e5c65b3667f7 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Thu, 1 May 2014 09:30:09 -0400 Subject: [PATCH 023/180] Allow seasons to change as soon as you have all related cookies --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 80c6da3d..8b52c4c3 100644 --- a/fc_main.js +++ b/fc_main.js @@ -831,7 +831,7 @@ function isUnavailable(upgrade, upgradeBlacklist) { result = result || (upgradeBlacklist === true); result = result || _.contains(upgradeBlacklist, upgrade.id); result = result || (needed && _.find(needed, function(a){return a.type == "wrinklers"}) != null); - result = result || (upgrade.season && (Game.seasonT > Game.fps * 60 * 60 * 23)); + result = result || (upgrade.season && !haveAll(Game.season)); return result; } From 56aeb071008e66530d3eac41803e114bca215c61 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 12 May 2014 10:34:01 -0400 Subject: [PATCH 024/180] Create test.json --- test.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 test.json diff --git a/test.json b/test.json new file mode 100644 index 00000000..24937095 --- /dev/null +++ b/test.json @@ -0,0 +1,3 @@ +{ + test: 't1' +} From 73898316b2ab053d4224026ea39d61d9a8e1e5ad Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sat, 17 May 2014 20:02:55 -0400 Subject: [PATCH 025/180] Initial Easter Fix - not complete --- fc_main.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fc_main.js b/fc_main.js index 8b52c4c3..8403ffa9 100644 --- a/fc_main.js +++ b/fc_main.js @@ -1059,27 +1059,32 @@ function buyFunctionToggle(upgrade) { } var ignoreFunctions = [ + /Game\.Earn\('.*\)/, /Game\.Lock\('.*'\)/, /Game\.Unlock\(.*\)/, /Game\.Objects\['.*'\]\.drawFunction\(\)/, + /Game\.Objects\['.*'\]\.redraw\(\)/, /Game\.SetResearch\('.*'\)/, /Game\.Upgrades\['.*'\]\.basePrice=.*/, /Game\.CollectWrinklers\(\)/, /Game\.RefreshBuildings\(\)/, + /Game\.storeToRefresh=1/, /Game\.upgradesToRebuild=1/, /Game\.Popup\(.*\)/, - /var drop=choose\(Game\.santaDrops\)/, + /Game\.Notify\(.*\)/, + /var\s+.+\s*=.+/, /Game\.computeSeasonPrices\(\)/, /Game\.seasonPopup\.reset\(\)/, /\S/ ]; var buyFunctions = upgrade.buyFunction.toString() - .replace(/\n/g, '') + .replace(/[\n\r\s]+/g, ' ') .replace(/function\s*\(\)\s*{(.+)\s*}/, "$1") .replace(/for\s*\(.+\)\s*\{.+\}/,'') .replace(/if\s*\(this\.season\)\s*Game\.season=this\.season\;/,('Game.season="' + upgrade.season + '";')) .replace(/if\s*\(.+\)\s*[^{}]*?\;/,'') .replace(/if\s*\(.+\)\s*\{.+\}/,'') + .replace(/else\s+\(.+\)\s*\;/,'') .replace(/\+\+/,'+=1') .replace(/\-\-/,'-=1') .split(';') From bae5e6b219c61b930642f46628eda126d0522aed Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sun, 18 May 2014 14:03:43 -0400 Subject: [PATCH 026/180] Century Egg fix? Maybe? --- fc_main.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fc_main.js b/fc_main.js index 8403ffa9..1b385ae1 100644 --- a/fc_main.js +++ b/fc_main.js @@ -80,8 +80,9 @@ function setOverrides() { Game.RebuildUpgrades(); beautifyUpgradesAndAchievements(); // Replace Game.Popup references with event logging - eval("Game.goldenCookie.click = " + Game.goldenCookie.click.toString().replace(/Game\.Popup\((.+)\)\;/g, 'logEvent("GC", $1, true);')); - eval("Game.UpdateWrinklers = " + Game.UpdateWrinklers.toString().replace(/Game\.Popup\((.+)\)\;/g, 'logEvent("Wrinkler", $1, true);')); + eval('Game.goldenCookie.click = ' + Game.goldenCookie.click.toString().replace(/Game\.Popup\((.+)\)\;/g, 'logEvent("GC", $1, true);')); + eval('Game.UpdateWrinklers = ' + Game.UpdateWrinklers.toString().replace(/Game\.Popup\((.+)\)\;/g, 'logEvent("Wrinkler", $1, true);')); + eval('FrozenCookies.safeGainsCalc = ' + Game.CalculateGains.toString().replace(/eggMult\+=\(1.+/, 'eggMult++; // CENTURY EGGS SUCK')); // Give free achievements! if(!Game.HasAchiev('Third-party')) { @@ -1231,10 +1232,11 @@ function updateCaches() { targetBank = bestBank(recommendation.efficiency); currentCookieCPS = gcPs(cookieValue(currentBank.cost)); currentUpgradeCount = Game.UpgradesInStore.length; + FrozenCookies.safeGainsCalc(); - if (FrozenCookies.lastCPS != Game.cookiesPs) { + if (FrozenCookies.lastCPS != FrozenCookies.calculatedCps) { FrozenCookies.recalculateCaches = true; - FrozenCookies.lastCPS = Game.cookiesPs; + FrozenCookies.lastCPS = FrozenCookies.calculatedCps; } if (FrozenCookies.currentBank.cost != currentBank.cost) { From 57eb4e489c9a46d543a5f8eef375b08db37cf820 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sun, 18 May 2014 14:08:12 -0400 Subject: [PATCH 027/180] Update fc_main.js --- fc_main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/fc_main.js b/fc_main.js index 1b385ae1..1fdb584e 100644 --- a/fc_main.js +++ b/fc_main.js @@ -1236,6 +1236,7 @@ function updateCaches() { if (FrozenCookies.lastCPS != FrozenCookies.calculatedCps) { FrozenCookies.recalculateCaches = true; + console.log('FC.cps: ' + FrozenCookies.calculatedCps); FrozenCookies.lastCPS = FrozenCookies.calculatedCps; } From cfbd5e49271482d29456141a50fbcbfdecf4d598 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sun, 18 May 2014 17:55:25 -0400 Subject: [PATCH 028/180] Update fc_main.js --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 1fdb584e..098d3dff 100644 --- a/fc_main.js +++ b/fc_main.js @@ -82,7 +82,7 @@ function setOverrides() { // Replace Game.Popup references with event logging eval('Game.goldenCookie.click = ' + Game.goldenCookie.click.toString().replace(/Game\.Popup\((.+)\)\;/g, 'logEvent("GC", $1, true);')); eval('Game.UpdateWrinklers = ' + Game.UpdateWrinklers.toString().replace(/Game\.Popup\((.+)\)\;/g, 'logEvent("Wrinkler", $1, true);')); - eval('FrozenCookies.safeGainsCalc = ' + Game.CalculateGains.toString().replace(/eggMult\+=\(1.+/, 'eggMult++; // CENTURY EGGS SUCK')); + eval('FrozenCookies.safeGainsCalc = ' + Game.CalculateGains.toString().replace(/eggMult\+=\(1.+/, 'eggMult++; // CENTURY EGGS SUCK').replace(/Game\.cookiesPs/g, 'FrozenCookies.calculatedCPS').replace(/Game\.globalCpsMult/g, 'mult')); // Give free achievements! if(!Game.HasAchiev('Third-party')) { From a4c9974f40edb43b182eccf61f09aa9d2d46498d Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sun, 18 May 2014 17:56:48 -0400 Subject: [PATCH 029/180] Update fc_main.js --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 098d3dff..0442eeb8 100644 --- a/fc_main.js +++ b/fc_main.js @@ -82,7 +82,7 @@ function setOverrides() { // Replace Game.Popup references with event logging eval('Game.goldenCookie.click = ' + Game.goldenCookie.click.toString().replace(/Game\.Popup\((.+)\)\;/g, 'logEvent("GC", $1, true);')); eval('Game.UpdateWrinklers = ' + Game.UpdateWrinklers.toString().replace(/Game\.Popup\((.+)\)\;/g, 'logEvent("Wrinkler", $1, true);')); - eval('FrozenCookies.safeGainsCalc = ' + Game.CalculateGains.toString().replace(/eggMult\+=\(1.+/, 'eggMult++; // CENTURY EGGS SUCK').replace(/Game\.cookiesPs/g, 'FrozenCookies.calculatedCPS').replace(/Game\.globalCpsMult/g, 'mult')); + eval('FrozenCookies.safeGainsCalc = ' + Game.CalculateGains.toString().replace(/eggMult\+=\(1.+/, 'eggMult++; // CENTURY EGGS SUCK').replace(/Game\.cookiesPs/g, 'FrozenCookies.calculatedCps').replace(/Game\.globalCpsMult/g, 'mult')); // Give free achievements! if(!Game.HasAchiev('Third-party')) { From 7e07e8d7624ccd6c37798f6e2b708698339c5443 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sun, 18 May 2014 17:58:53 -0400 Subject: [PATCH 030/180] Update fc_main.js --- fc_main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 0442eeb8..805f96ac 100644 --- a/fc_main.js +++ b/fc_main.js @@ -1225,6 +1225,7 @@ function viewStatGraphs() { function updateCaches() { var recommendation, currentBank, targetBank, currentCookieCPS, currentUpgradeCount; + var recalcCount = 0; do { recommendation = nextPurchase(FrozenCookies.recalculateCaches); FrozenCookies.recalculateCaches = false; @@ -1259,7 +1260,8 @@ function updateCaches() { FrozenCookies.recalculateCaches = true; FrozenCookies.lastUpgradeCount = currentUpgradeCount; } - } while (FrozenCookies.recalculateCaches); + recalcCount += 1; + } while (FrozenCookies.recalculateCaches && recalcCount < 10); } function doTimeTravel() { From fc681d4d02ae26687de69ed5e1df8778777c2310 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sun, 18 May 2014 18:11:50 -0400 Subject: [PATCH 031/180] Redraw every 10 purchases for funsies --- fc_main.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fc_main.js b/fc_main.js index 805f96ac..af375e51 100644 --- a/fc_main.js +++ b/fc_main.js @@ -16,6 +16,9 @@ function setOverrides() { // Becomes 0 almost immediately after user input, so default to 0 FrozenCookies.timeTravelAmount = 0; + // Force redraw every 10 purchases + FrozenCookies.autobuyCount = 0; + // Get historical data FrozenCookies.non_gc_time = Number(localStorage.getItem('nonFrenzyTime')); FrozenCookies.gc_time = Number(localStorage.getItem('frenzyTime')); @@ -1462,6 +1465,7 @@ function autoCookie() { disabledPopups = false; // console.log(purchase.name + ': ' + Beautify(recommendation.efficiency) + ',' + Beautify(recommendation.delta_cps)); recommendation.purchase.buy(); + FrozenCookies.autobuyCount += 1; if (FrozenCookies.trackStats == 5 && recommendation.type == 'upgrade') { saveStats(); } else if (FrozenCookies.trackStats == 6) { @@ -1469,6 +1473,10 @@ function autoCookie() { } logEvent('Store', 'Autobought ' + recommendation.purchase.name + ' for ' + Beautify(recommendation.cost) + ', resulting in ' + Beautify(recommendation.delta_cps) + ' CPS.'); disabledPopups = true; + if (FrozenCookies.autobuyCount >= 10) { + Game.Draw(); + FrozenCookies.autobuyCount = 0; + } FrozenCookies.recalculateCaches = true; FrozenCookies.processing = false; return FrozenCookies.frequency ? autoCookie() : null; From 66cefac32a2f9ab6c5cd11e2d9b796136668df32 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sun, 18 May 2014 18:12:18 -0400 Subject: [PATCH 032/180] Update fc_main.js --- fc_main.js | 1 - 1 file changed, 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index af375e51..689dbfe3 100644 --- a/fc_main.js +++ b/fc_main.js @@ -1240,7 +1240,6 @@ function updateCaches() { if (FrozenCookies.lastCPS != FrozenCookies.calculatedCps) { FrozenCookies.recalculateCaches = true; - console.log('FC.cps: ' + FrozenCookies.calculatedCps); FrozenCookies.lastCPS = FrozenCookies.calculatedCps; } From cbb075ba018ad4ad5d3260e33d6e778211cb23be Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sun, 18 May 2014 23:45:32 -0400 Subject: [PATCH 033/180] Add 'e' for export save popup --- fc_main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fc_main.js b/fc_main.js index 689dbfe3..3adcf5df 100644 --- a/fc_main.js +++ b/fc_main.js @@ -316,6 +316,9 @@ document.addEventListener('keydown', function(event) { Game.Toggle('autoGC','autogcButton','Autoclick GC OFF','Autoclick GC ON'); toggleFrozen('autoGC'); } + if(event.keyCode == 69) { + copyToClipboard(Game.WriteSave(true)); + } if(event.keyCode == 87) { Game.Notify('Wrinkler Info', 'Popping all wrinklers will give you ' + Beautify(Game.wrinklers.reduce(function(s,w){return s + w.sucked * 1.1},0)) + ' cookies. ', [19,8],7); } From b0b91666891efa58feaad808ad1cb6b0aff56dd0 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 19 May 2014 00:01:15 -0400 Subject: [PATCH 034/180] Add easter to holiday cookies --- cc_upgrade_prerequisites.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cc_upgrade_prerequisites.js b/cc_upgrade_prerequisites.js index 9b939076..23dc5872 100644 --- a/cc_upgrade_prerequisites.js +++ b/cc_upgrade_prerequisites.js @@ -262,7 +262,8 @@ var christmasCookies = [143,144,145,146,147,148,149]; var holidayCookies = { halloween: [134,135,136,137,138,139,140], christmas: [143,144,145,146,147,148,149], - valentines: [169,170,171,172,173,174] + valentines: [169,170,171,172,173,174], + easter: [210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229] } var cookieInfo = { From 1e89dc52bc065a123e1f39b163e8c04546a21c06 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 19 May 2014 08:51:59 -0400 Subject: [PATCH 035/180] Protect keyboard shortcuts from activating during prompts --- fc_main.js | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/fc_main.js b/fc_main.js index 3adcf5df..cbbcd655 100644 --- a/fc_main.js +++ b/fc_main.js @@ -293,7 +293,9 @@ function nextHC(tg) { } function copyToClipboard (text) { + Game.promptOn = 1; window.prompt ("Copy to clipboard: Ctrl+C, Enter", text); + Game.promptOn = 0; } function getBuildingSpread () { @@ -305,22 +307,24 @@ function getBuildingSpread () { // Press 'c' to toggle auto-GC // Press 'w' to display a wrinkler-info window document.addEventListener('keydown', function(event) { - if(event.keyCode == 65) { - Game.Toggle('autoBuy','autobuyButton','Autobuy OFF','Autobuy ON'); - toggleFrozen('autoBuy'); - } - if(event.keyCode == 66) { - copyToClipboard(getBuildingSpread()); - } - if(event.keyCode == 67) { - Game.Toggle('autoGC','autogcButton','Autoclick GC OFF','Autoclick GC ON'); - toggleFrozen('autoGC'); - } - if(event.keyCode == 69) { - copyToClipboard(Game.WriteSave(true)); - } - if(event.keyCode == 87) { - Game.Notify('Wrinkler Info', 'Popping all wrinklers will give you ' + Beautify(Game.wrinklers.reduce(function(s,w){return s + w.sucked * 1.1},0)) + ' cookies. ', [19,8],7); + if (!Game.promptOn) { + if(event.keyCode == 65) { + Game.Toggle('autoBuy','autobuyButton','Autobuy OFF','Autobuy ON'); + toggleFrozen('autoBuy'); + } + if(event.keyCode == 66) { + copyToClipboard(getBuildingSpread()); + } + if(event.keyCode == 67) { + Game.Toggle('autoGC','autogcButton','Autoclick GC OFF','Autoclick GC ON'); + toggleFrozen('autoGC'); + } + if(event.keyCode == 69) { + copyToClipboard(Game.WriteSave(true)); + } + if(event.keyCode == 87) { + Game.Notify('Wrinkler Info', 'Popping all wrinklers will give you ' + Beautify(Game.wrinklers.reduce(function(s,w){return s + w.sucked * 1.1},0)) + ' cookies. ', [19,8],7); + } } }); From e9a90f740e059d5b4095a9118315779af928866c Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 19 May 2014 20:07:24 -0400 Subject: [PATCH 036/180] Add wrinklerspawn to calculations --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index cbbcd655..84b09cac 100644 --- a/fc_main.js +++ b/fc_main.js @@ -1372,7 +1372,7 @@ function liveWrinklers() { } function wrinklerMod(num) { - return FrozenCookies.includeWrinklers ? 1 + num * (0.055 * num - 0.05) : 1; + return FrozenCookies.includeWrinklers ? 1.1 * num * num * 0.05 * (Game.Has('Wrinklerspawn') ? 1.05 : 1) + (1 - 0.05 * num) : 1; } function shouldPopWrinklers() { From 390cc863c88e6ad0509bc93f5f90a278eea1f2c7 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 09:17:15 -0400 Subject: [PATCH 037/180] Change 'Season' blacklist to 'Pledging Only' --- cc_upgrade_prerequisites.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cc_upgrade_prerequisites.js b/cc_upgrade_prerequisites.js index 23dc5872..afe3b8a5 100644 --- a/cc_upgrade_prerequisites.js +++ b/cc_upgrade_prerequisites.js @@ -38,7 +38,7 @@ FrozenCookies.preferenceValues = { }, 'blacklist':{ 'hint':'Blacklist purchases from the efficiency calculations', - 'display':['No Blacklist', 'Speedrun Blacklist', 'Hardcore Blacklist', 'Grandmapocalypse Mode', 'Manual Seasons'], + 'display':['No Blacklist', 'Speedrun Blacklist', 'Hardcore Blacklist', 'Grandmapocalypse Mode', 'Pledging Only'], 'default':0 }, /* 'timeTravelMethod':{ From 9329805211d1cad8c24e99ef4ba091fecc08ffc4 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 09:20:19 -0400 Subject: [PATCH 038/180] Change 'Season' blacklist to 'No Buildings' --- cc_upgrade_prerequisites.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cc_upgrade_prerequisites.js b/cc_upgrade_prerequisites.js index afe3b8a5..e2025e71 100644 --- a/cc_upgrade_prerequisites.js +++ b/cc_upgrade_prerequisites.js @@ -38,7 +38,7 @@ FrozenCookies.preferenceValues = { }, 'blacklist':{ 'hint':'Blacklist purchases from the efficiency calculations', - 'display':['No Blacklist', 'Speedrun Blacklist', 'Hardcore Blacklist', 'Grandmapocalypse Mode', 'Pledging Only'], + 'display':['No Blacklist', 'Speedrun Blacklist', 'Hardcore Blacklist', 'Grandmapocalypse Mode', 'No Buildings'], 'default':0 }, /* 'timeTravelMethod':{ @@ -252,8 +252,8 @@ var blacklist = [ 'buildings': [] }, { - 'upgrades': [181, 182, 183, 184], - 'buildings': [] + 'upgrades': [], + 'buildings': true } ]; From f6f07e622333919413947dfff5fa9a53c2613f19 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 09:21:45 -0400 Subject: [PATCH 039/180] Remove Grandmapocalypse ending state, since nobody uses it for that anymore --- fc_main.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/fc_main.js b/fc_main.js index 84b09cac..92c56282 100644 --- a/fc_main.js +++ b/fc_main.js @@ -395,9 +395,6 @@ function autoBlacklistOff() { case 2: FrozenCookies.blacklist = (Game.cookiesEarned >= 1000000000) ? 0 : 2; break; - case 3: - FrozenCookies.blacklist = haveAll('halloween') ? 0 : 3; - break; } } From 3c7b42068d10b2c9b3458ba81f740f5cfbcc2830 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 09:36:45 -0400 Subject: [PATCH 040/180] Fix for building blacklist --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 92c56282..a50d1c3d 100644 --- a/fc_main.js +++ b/fc_main.js @@ -795,7 +795,7 @@ function buildingStats(recalculate) { var baseDeltaCps = baseCpsNew - baseCpsOrig; var efficiency = purchaseEfficiency(current.getPrice(), deltaCps, baseDeltaCps, cpsOrig) return {'id' : current.id, 'efficiency' : efficiency, 'base_delta_cps' : baseDeltaCps, 'delta_cps' : deltaCps, 'cost' : current.getPrice(), 'purchase' : current, 'type' : 'building'}; - }); + }).filter(function(a){return a;}); } return FrozenCookies.caches.buildings; } From 7cc07cecd3e87cde6eed67b22fd5b9329d4b22af Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 09:50:30 -0400 Subject: [PATCH 041/180] Add extra sorting to the recommendation list --- fc_main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index a50d1c3d..47662729 100644 --- a/fc_main.js +++ b/fc_main.js @@ -721,7 +721,13 @@ function purchaseEfficiency(price, deltaCps, baseDeltaCps, currentCps) { function recommendationList(recalculate) { if (recalculate) { - FrozenCookies.caches.recommendationList = addScores(upgradeStats(recalculate).concat(buildingStats(recalculate)).concat(santaStats()).sort(function(a,b){return (a.efficiency - b.efficiency)})); + FrozenCookies.caches.recommendationList = addScores( + upgradeStats(recalculate) + .concat(buildingStats(recalculate)) + .concat(santaStats()) + .sort(function(a,b){ + return a.efficiency != b.efficiency ? b.efficiency - a.efficiency : (a.delta_cps != b.delta_cps ? b.delta_cps - a.delta_cps : a.cost - b.cost); + })); } return FrozenCookies.caches.recommendationList; // return upgradeStats(recalculate).concat(buildingStats(recalculate)).sort(function(a,b){return (a.efficiency - b.efficiency)}); From b4fa1d938740f8b5e08f3463bc59494cca8be021 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 10:05:13 -0400 Subject: [PATCH 042/180] Efficiency should sort smallest to largest, and don't buy Infinite efficiency purchases --- fc_main.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/fc_main.js b/fc_main.js index 47662729..f907130a 100644 --- a/fc_main.js +++ b/fc_main.js @@ -726,7 +726,7 @@ function recommendationList(recalculate) { .concat(buildingStats(recalculate)) .concat(santaStats()) .sort(function(a,b){ - return a.efficiency != b.efficiency ? b.efficiency - a.efficiency : (a.delta_cps != b.delta_cps ? b.delta_cps - a.delta_cps : a.cost - b.cost); + return a.efficiency != b.efficiency ? a.efficiency - b.efficiency : (a.delta_cps != b.delta_cps ? b.delta_cps - a.delta_cps : a.cost - b.cost); })); } return FrozenCookies.caches.recommendationList; @@ -1466,7 +1466,7 @@ function autoCookie() { } } - if (FrozenCookies.autoBuy && (Game.cookies >= delay + recommendation.cost) && (nextChainedPurchase().delta_cps >= 0)) { + if (FrozenCookies.autoBuy && (Game.cookies >= delay + recommendation.cost) && (isFinite(nextChainedPurchase().efficiency))) { // if (FrozenCookies.autoBuy && (Game.cookies >= delay + recommendation.cost)) { recommendation.time = Date.now() - Game.startDate; // full_history.push(recommendation); // Probably leaky, maybe laggy? @@ -1504,15 +1504,21 @@ function autoCookie() { if (((Game.frenzy > 0 && Game.frenzyPower > 1) || Game.clickFrenzy > 0) != FrozenCookies.last_gc_state) { if (FrozenCookies.last_gc_state) { logEvent('GC', 'Frenzy ended, cookie production back to normal.'); - logEvent('HC', 'Frenzy won ' + FrozenCookies.hcs_during_frenzy + ' heavenly chips'); - FrozenCookies.hcs_during_frenzy = 0; + if (FrozenCookies.hc_gain) { + logEvent('HC', 'Frenzy won ' + FrozenCookies.hc_gain + ' heavenly chips'); + } FrozenCookies.gc_time += Date.now() - FrozenCookies.last_gc_time; } else { + logEvent('GC', (Game.clickFrenzy ? 'Clicking ' : '') + 'Frenzy x' + Game.frenzyPower + if (FrozenCookies.hc_gain) { + logEvent('HC', 'Frenzy won ' + FrozenCookies.hc_gain + ' heavenly chips'); + } FrozenCookies.non_gc_time += Date.now() - FrozenCookies.last_gc_time; } updateLocalStorage(); FrozenCookies.last_gc_state = ((Game.frenzy > 0 && Game.frenzyPower > 1) || Game.clickFrenzy > 0); FrozenCookies.last_gc_time = Date.now(); + FrozenCookies.hc_gain = 0; } FrozenCookies.processing = false; if (FrozenCookies.frequency) { From c1b6c43e17af3ba2b23caa2af3a6253e83ed0873 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 10:09:35 -0400 Subject: [PATCH 043/180] Update fc_main.js --- fc_main.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fc_main.js b/fc_main.js index f907130a..a7e5180a 100644 --- a/fc_main.js +++ b/fc_main.js @@ -1504,15 +1504,15 @@ function autoCookie() { if (((Game.frenzy > 0 && Game.frenzyPower > 1) || Game.clickFrenzy > 0) != FrozenCookies.last_gc_state) { if (FrozenCookies.last_gc_state) { logEvent('GC', 'Frenzy ended, cookie production back to normal.'); - if (FrozenCookies.hc_gain) { - logEvent('HC', 'Frenzy won ' + FrozenCookies.hc_gain + ' heavenly chips'); + if (FrozenCookies.hcs_during_frenzy) { + logEvent('HC', 'Frenzy won ' + FrozenCookies.hcs_during_frenzy + ' heavenly chips'); } FrozenCookies.gc_time += Date.now() - FrozenCookies.last_gc_time; } else { - logEvent('GC', (Game.clickFrenzy ? 'Clicking ' : '') + 'Frenzy x' + Game.frenzyPower - if (FrozenCookies.hc_gain) { - logEvent('HC', 'Frenzy won ' + FrozenCookies.hc_gain + ' heavenly chips'); - } + logEvent('GC', (Game.clickFrenzy ? 'Clicking ' : '') + 'Frenzy x' + (Game.frenzy ? Game.frenzyPower : 1) * (Game.clickFrenzy ? 777 : 1)); + //if (FrozenCookies.hc_gain) { + // logEvent('HC', 'Frenzy won ' + FrozenCookies.hc_gain + ' heavenly chips'); + //} FrozenCookies.non_gc_time += Date.now() - FrozenCookies.last_gc_time; } updateLocalStorage(); From 023012428570a8dca8371ffa8c9a9dd0e07dc843 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 10:35:25 -0400 Subject: [PATCH 044/180] Change frenzy and HC gain console logging --- fc_main.js | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/fc_main.js b/fc_main.js index a7e5180a..1e4f3344 100644 --- a/fc_main.js +++ b/fc_main.js @@ -1440,12 +1440,7 @@ function autoCookie() { if ((Game.prestige['Heavenly chips'] < (currentHCAmount - changeAmount)) && currHCPercent > FrozenCookies.maxHCPercent) { FrozenCookies.maxHCPercent = currHCPercent; } - var maxStr = (FrozenCookies.maxHCPercent === currHCPercent) ? ' (!)' : ''; - if (Game.frenzy === 0 && Game.clickFrenzy === 0) { - logEvent('HC', 'Gained ' + changeAmount + ' Heavenly Chips in ' + timeDisplay((FrozenCookies.lastHCTime - FrozenCookies.prevLastHCTime)/1000) + '.' + maxStr + ' Overall average: ' + currHCPercent + ' HC/hr.'); - } else { - FrozenCookies.hcs_during_frenzy += changeAmount; - } + FrozenCookies.hc_gain += changeAmount; updateLocalStorage(); } updateCaches(); @@ -1501,24 +1496,27 @@ function autoCookie() { if (FrozenCookies.autoBlacklistOff) { autoBlacklistOff(); } - if (((Game.frenzy > 0 && Game.frenzyPower > 1) || Game.clickFrenzy > 0) != FrozenCookies.last_gc_state) { - if (FrozenCookies.last_gc_state) { - logEvent('GC', 'Frenzy ended, cookie production back to normal.'); - if (FrozenCookies.hcs_during_frenzy) { - logEvent('HC', 'Frenzy won ' + FrozenCookies.hcs_during_frenzy + ' heavenly chips'); + var currentFrenzy = (Game.frenzy ? Game.frenzyPower : 1) * (Game.clickFrenzy ? 777 : 1); + if (currentFrenzy != FrozenCookies.last_gc_state) { + if (FrozenCookies.last_gc_state && !currentFrenzy) { + logEvent('GC', 'Frenzy ended, cookie production x1'); + if (FrozenCookies.hc_gain) { + logEvent('HC', 'Won ' + FrozenCookies.hcs_during_frenzy + ' heavenly chips during Frenzy. Overall average: ' + currHCPercent + ' HC/hr.'); + FrozenCookies.hc_gain = 0; } - FrozenCookies.gc_time += Date.now() - FrozenCookies.last_gc_time; } else { - logEvent('GC', (Game.clickFrenzy ? 'Clicking ' : '') + 'Frenzy x' + (Game.frenzy ? Game.frenzyPower : 1) * (Game.clickFrenzy ? 777 : 1)); - //if (FrozenCookies.hc_gain) { - // logEvent('HC', 'Frenzy won ' + FrozenCookies.hc_gain + ' heavenly chips'); - //} - FrozenCookies.non_gc_time += Date.now() - FrozenCookies.last_gc_time; + if (FrozenCookies.last_gc_state) { + logEvent('GC', 'Previous Frenzy x' + FrozenCookies.last_gc_state + 'interrupted.') + } else if (FrozenCookies.hc_gain) { + logEvent('HC', 'Won ' + FrozenCookies.hc_gain + ' heavenly chips outside of Frenzy. Overall average: ' + currHCPercent + ' HC/hr.'); + FrozenCookies.hc_gain = 0; + } + logEvent('GC', 'Starting ' + (Game.clickFrenzy ? 'Clicking ' : '') + 'Frenzy x' + currentFrenzy); } - updateLocalStorage(); - FrozenCookies.last_gc_state = ((Game.frenzy > 0 && Game.frenzyPower > 1) || Game.clickFrenzy > 0); + FrozenCookies.frenzyTimes[FrozenCookies.last_gc_state] += Date.now() - FrozenCookies.last_gc_time; + FrozenCookies.last_gc_state = currentFrenzy; FrozenCookies.last_gc_time = Date.now(); - FrozenCookies.hc_gain = 0; + updateLocalStorage(); } FrozenCookies.processing = false; if (FrozenCookies.frequency) { From b9206e498fb36ceeccc7e9df82717e517dfad9c1 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 10:43:04 -0400 Subject: [PATCH 045/180] Change frenzy and HC gain console logging --- fc_main.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/fc_main.js b/fc_main.js index 1e4f3344..95d65aa3 100644 --- a/fc_main.js +++ b/fc_main.js @@ -20,8 +20,9 @@ function setOverrides() { FrozenCookies.autobuyCount = 0; // Get historical data - FrozenCookies.non_gc_time = Number(localStorage.getItem('nonFrenzyTime')); - FrozenCookies.gc_time = Number(localStorage.getItem('frenzyTime')); + FrozenCookies.frenzyTimes = JSON.parse(localStorage.getItem('frenzyTimes')) || {}; +// FrozenCookies.non_gc_time = Number(localStorage.getItem('nonFrenzyTime')); +// FrozenCookies.gc_time = Number(localStorage.getItem('frenzyTime')); FrozenCookies.lastHCAmount = Number(localStorage.getItem('lastHCAmount')); FrozenCookies.lastHCTime = Number(localStorage.getItem('lastHCTime')); FrozenCookies.prevLastHCTime = Number(localStorage.getItem('prevLastHCTime')); @@ -265,8 +266,9 @@ function updateLocalStorage() { localStorage.frenzyClickSpeed = FrozenCookies.frenzyClickSpeed; localStorage.cookieClickSpeed = FrozenCookies.cookieClickSpeed; - localStorage.nonFrenzyTime = FrozenCookies.non_gc_time; - localStorage.frenzyTime = FrozenCookies.gc_time; + localStorage.frenzyTimes = JSON.stringify(FrozenCookies.frenzyTimes); +// localStorage.nonFrenzyTime = FrozenCookies.non_gc_time; +// localStorage.frenzyTime = FrozenCookies.gc_time; localStorage.lastHCAmount = FrozenCookies.lastHCAmount; localStorage.maxHCPercent = FrozenCookies.maxHCPercent; localStorage.lastHCTime = FrozenCookies.lastHCTime; @@ -1498,14 +1500,14 @@ function autoCookie() { } var currentFrenzy = (Game.frenzy ? Game.frenzyPower : 1) * (Game.clickFrenzy ? 777 : 1); if (currentFrenzy != FrozenCookies.last_gc_state) { - if (FrozenCookies.last_gc_state && !currentFrenzy) { + if (FrozenCookies.last_gc_state != 1 && currentFrenzy == 1) { logEvent('GC', 'Frenzy ended, cookie production x1'); if (FrozenCookies.hc_gain) { logEvent('HC', 'Won ' + FrozenCookies.hcs_during_frenzy + ' heavenly chips during Frenzy. Overall average: ' + currHCPercent + ' HC/hr.'); FrozenCookies.hc_gain = 0; } } else { - if (FrozenCookies.last_gc_state) { + if (FrozenCookies.last_gc_state != 1) { logEvent('GC', 'Previous Frenzy x' + FrozenCookies.last_gc_state + 'interrupted.') } else if (FrozenCookies.hc_gain) { logEvent('HC', 'Won ' + FrozenCookies.hc_gain + ' heavenly chips outside of Frenzy. Overall average: ' + currHCPercent + ' HC/hr.'); @@ -1513,6 +1515,9 @@ function autoCookie() { } logEvent('GC', 'Starting ' + (Game.clickFrenzy ? 'Clicking ' : '') + 'Frenzy x' + currentFrenzy); } + if (FrozenCookies.frenzyTimes[FrozenCookies.last_gc_state] == null) { + FrozenCookies.frenzyTimes[FrozenCookies.last_gc_state] = 0; + } FrozenCookies.frenzyTimes[FrozenCookies.last_gc_state] += Date.now() - FrozenCookies.last_gc_time; FrozenCookies.last_gc_state = currentFrenzy; FrozenCookies.last_gc_time = Date.now(); From b45f87d23d22710207f322a8d32ce81104e66331 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 10:49:44 -0400 Subject: [PATCH 046/180] Update fc_main.js --- fc_main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/fc_main.js b/fc_main.js index 95d65aa3..e59e20d9 100644 --- a/fc_main.js +++ b/fc_main.js @@ -29,6 +29,7 @@ function setOverrides() { FrozenCookies.maxHCPercent = Number(localStorage.getItem('maxHCPercent')); // Set default values for calculations + FrozenCookies.hc_gain = 0; FrozenCookies.last_gc_state = (Game.frenzy > 0); FrozenCookies.last_gc_time = Date.now(); FrozenCookies.lastCPS = Game.cookiesPs; From 5da520194ef8c2a4953bea1ef4e2edfda271b90e Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 11:00:10 -0400 Subject: [PATCH 047/180] HC logging --- fc_main.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fc_main.js b/fc_main.js index e59e20d9..f01f8c4e 100644 --- a/fc_main.js +++ b/fc_main.js @@ -30,6 +30,7 @@ function setOverrides() { // Set default values for calculations FrozenCookies.hc_gain = 0; + FrozenCookies.hc_gain_time = Date.now(); FrozenCookies.last_gc_state = (Game.frenzy > 0); FrozenCookies.last_gc_time = Date.now(); FrozenCookies.lastCPS = Game.cookiesPs; @@ -1504,14 +1505,17 @@ function autoCookie() { if (FrozenCookies.last_gc_state != 1 && currentFrenzy == 1) { logEvent('GC', 'Frenzy ended, cookie production x1'); if (FrozenCookies.hc_gain) { - logEvent('HC', 'Won ' + FrozenCookies.hcs_during_frenzy + ' heavenly chips during Frenzy. Overall average: ' + currHCPercent + ' HC/hr.'); + + logEvent('HC', 'Won ' + FrozenCookies.hc_gain + ' heavenly chips during Frenzy. Rate: ' + (FrozenCookies.hc_gain * 1000) / (Date.now() - hc_gain_time) + ' HC/s.'); + FrozenCookies.hc_gain_time = Date.now(); FrozenCookies.hc_gain = 0; } } else { if (FrozenCookies.last_gc_state != 1) { logEvent('GC', 'Previous Frenzy x' + FrozenCookies.last_gc_state + 'interrupted.') } else if (FrozenCookies.hc_gain) { - logEvent('HC', 'Won ' + FrozenCookies.hc_gain + ' heavenly chips outside of Frenzy. Overall average: ' + currHCPercent + ' HC/hr.'); + logEvent('HC', 'Won ' + FrozenCookies.hc_gain + ' heavenly chips outside of Frenzy. Rate: ' + (FrozenCookies.hc_gain * 1000) / (Date.now() - hc_gain_time) + ' HC/s.'); + FrozenCookies.hc_gain_time = Date.now(); FrozenCookies.hc_gain = 0; } logEvent('GC', 'Starting ' + (Game.clickFrenzy ? 'Clicking ' : '') + 'Frenzy x' + currentFrenzy); From f9c2123d0650cc6cd89c8ca2348cae4fc12b0cd9 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 11:04:41 -0400 Subject: [PATCH 048/180] Update fc_main.js --- fc_main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fc_main.js b/fc_main.js index f01f8c4e..809bd1cc 100644 --- a/fc_main.js +++ b/fc_main.js @@ -1506,7 +1506,7 @@ function autoCookie() { logEvent('GC', 'Frenzy ended, cookie production x1'); if (FrozenCookies.hc_gain) { - logEvent('HC', 'Won ' + FrozenCookies.hc_gain + ' heavenly chips during Frenzy. Rate: ' + (FrozenCookies.hc_gain * 1000) / (Date.now() - hc_gain_time) + ' HC/s.'); + logEvent('HC', 'Won ' + FrozenCookies.hc_gain + ' heavenly chips during Frenzy. Rate: ' + (FrozenCookies.hc_gain * 1000) / (Date.now() - FrozenCookies.hc_gain_time) + ' HC/s.'); FrozenCookies.hc_gain_time = Date.now(); FrozenCookies.hc_gain = 0; } @@ -1514,7 +1514,7 @@ function autoCookie() { if (FrozenCookies.last_gc_state != 1) { logEvent('GC', 'Previous Frenzy x' + FrozenCookies.last_gc_state + 'interrupted.') } else if (FrozenCookies.hc_gain) { - logEvent('HC', 'Won ' + FrozenCookies.hc_gain + ' heavenly chips outside of Frenzy. Rate: ' + (FrozenCookies.hc_gain * 1000) / (Date.now() - hc_gain_time) + ' HC/s.'); + logEvent('HC', 'Won ' + FrozenCookies.hc_gain + ' heavenly chips outside of Frenzy. Rate: ' + (FrozenCookies.hc_gain * 1000) / (Date.now() - FrozenCookies.hc_gain_time) + ' HC/s.'); FrozenCookies.hc_gain_time = Date.now(); FrozenCookies.hc_gain = 0; } From adae71b50abafa9469f4e585f35b88c39527db2a Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 11:19:12 -0400 Subject: [PATCH 049/180] Display more detailed rate info --- fc_button.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fc_button.js b/fc_button.js index 5e2b4ae1..dfe88990 100644 --- a/fc_button.js +++ b/fc_button.js @@ -383,8 +383,9 @@ function FCMenu() { subsection.append($('
').addClass('listing').html('Golden Cookie Clicks: ' + Beautify(Game.goldenClicks))); subsection.append($('
').addClass('listing').html('Missed Golden Cookie Clicks: ' + Beautify(Game.missedGoldenClicks))); subsection.append($('
').addClass('listing').html('Last Golden Cookie Effect: ' + Game.goldenCookie.last)); - subsection.append($('
').addClass('listing').html('Total Recorded Frenzy Time: ' + timeDisplay(FrozenCookies.gc_time/1000))); - subsection.append($('
').addClass('listing').html('Total Recorded Non-Frenzy Time: ' + timeDisplay(FrozenCookies.non_gc_time/1000))); + $.each(FrozenCookies.frenzyTimes, function(time, rate) { + subsection.append($('
').addClass('listing').html('Total Recorded Time at x' + rate + ': ' + timeDisplay(time/1000))); + }); menu.append(subsection); subsection = $('
').addClass('subsection'); subsection.append($('
').addClass('title').html('Heavenly Chips Information')); From 8b2a49dd1f7fa0916c92b7a11ecf8cd9aee63938 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 11:20:59 -0400 Subject: [PATCH 050/180] Update fc_button.js --- fc_button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_button.js b/fc_button.js index dfe88990..6a13c653 100644 --- a/fc_button.js +++ b/fc_button.js @@ -383,7 +383,7 @@ function FCMenu() { subsection.append($('
').addClass('listing').html('Golden Cookie Clicks: ' + Beautify(Game.goldenClicks))); subsection.append($('
').addClass('listing').html('Missed Golden Cookie Clicks: ' + Beautify(Game.missedGoldenClicks))); subsection.append($('
').addClass('listing').html('Last Golden Cookie Effect: ' + Game.goldenCookie.last)); - $.each(FrozenCookies.frenzyTimes, function(time, rate) { + $.each(FrozenCookies.frenzyTimes, function(rate, time) { subsection.append($('
').addClass('listing').html('Total Recorded Time at x' + rate + ': ' + timeDisplay(time/1000))); }); menu.append(subsection); From eae2844db59d8c153456a181ab97112630b43ba2 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 11:24:30 -0400 Subject: [PATCH 051/180] Default to valid gc state --- fc_main.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fc_main.js b/fc_main.js index 809bd1cc..4ce669f8 100644 --- a/fc_main.js +++ b/fc_main.js @@ -31,7 +31,7 @@ function setOverrides() { // Set default values for calculations FrozenCookies.hc_gain = 0; FrozenCookies.hc_gain_time = Date.now(); - FrozenCookies.last_gc_state = (Game.frenzy > 0); + FrozenCookies.last_gc_state = (Game.frenzy ? Game.frenzyPower : 1) * (Game.clickFrenzy ? 777 : 1); FrozenCookies.last_gc_time = Date.now(); FrozenCookies.lastCPS = Game.cookiesPs; FrozenCookies.lastCookieCPS = 0; @@ -240,9 +240,8 @@ function timeDisplay(seconds) { function fcReset(bypass) { Game.CollectWrinklers(); Game.oldReset(bypass); - FrozenCookies.nonFrenzyTime = 0; - FrozenCookies.frenzyTime = 0; - FrozenCookies.last_gc_state = (Game.frenzy > 0); + FrozenCookies.frenzyTimes = {}; + FrozenCookies.last_gc_state = (Game.frenzy ? Game.frenzyPower : 1) * (Game.clickFrenzy ? 777 : 1); FrozenCookies.last_gc_time = Date.now(); FrozenCookies.lastHCAmount = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + w.sucked * 1.1;}, 0)); FrozenCookies.lastHCTime = Date.now(); From 90b27522c224308c7b70863bb2ed04b4166fa8d0 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 12:34:51 -0400 Subject: [PATCH 052/180] Pop wrinklers if in Easter and don't have all eggs, add 'pastemode' --- fc_main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 4ce669f8..4ce8c080 100644 --- a/fc_main.js +++ b/fc_main.js @@ -239,6 +239,10 @@ function timeDisplay(seconds) { function fcReset(bypass) { Game.CollectWrinklers(); + if (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')) { + Game.ObjectsById.forEach(function(b){b.sell(b.amount);}); + Game.Upgrades['Chocolate egg'].buy(); + } Game.oldReset(bypass); FrozenCookies.frenzyTimes = {}; FrozenCookies.last_gc_state = (Game.frenzy ? Game.frenzyPower : 1) * (Game.clickFrenzy ? 777 : 1); @@ -732,6 +736,9 @@ function recommendationList(recalculate) { return a.efficiency != b.efficiency ? a.efficiency - b.efficiency : (a.delta_cps != b.delta_cps ? b.delta_cps - a.delta_cps : a.cost - b.cost); })); } + if (FrozenCookies.pastemode) { + FrozenCookies.caches.recommendationList.reverse(); + } return FrozenCookies.caches.recommendationList; // return upgradeStats(recalculate).concat(buildingStats(recalculate)).sort(function(a,b){return (a.efficiency - b.efficiency)}); } @@ -1385,7 +1392,7 @@ function shouldPopWrinklers() { var toPop = []; var living = liveWrinklers(); if (living.length > 0) { - if (Game.season == 'halloween' && !haveAll('halloween')) { + if ((Game.season == 'halloween' || Game.season == 'easter') && !haveAll(Game.season)) { toPop = living.map(function(w) {return w.id}); } else { var delay = delayAmount(); From 4849531aafc4f003686c3282e631d7971da2b168 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 12:36:28 -0400 Subject: [PATCH 053/180] Add pastemode because it's silly --- cc_upgrade_prerequisites.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cc_upgrade_prerequisites.js b/cc_upgrade_prerequisites.js index e2025e71..f882b002 100644 --- a/cc_upgrade_prerequisites.js +++ b/cc_upgrade_prerequisites.js @@ -47,10 +47,10 @@ FrozenCookies.preferenceValues = { 'default':0, 'extras':'Set Time Travel Amount' },*/ - 'includeWrinklers':{ - 'hint':'Include wrinklers in efficiency calculations.', - 'display':['Wrinkler Valuation OFF','Wrinkler Valuation ON'], - 'default':1 + 'pastemode':{ + 'hint':'Always autobuy the least efficient purchase. This is a stupid idea, you should never turn this on.', + 'display':['Pastemode OFF','Pastemode ON'], + 'default':0 }, 'simulatedGCPercent':{ 'hint':'What percentage of Golden Cookies should be assumed as "clicked" for GC efficiency calculations (100% recommended)', From bbbc75fc1a96c980b3a0d1a8f858d08465e47ca3 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 12:37:45 -0400 Subject: [PATCH 054/180] Remove 'includeWrinklers' option --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 4ce8c080..a57189e8 100644 --- a/fc_main.js +++ b/fc_main.js @@ -1385,7 +1385,7 @@ function liveWrinklers() { } function wrinklerMod(num) { - return FrozenCookies.includeWrinklers ? 1.1 * num * num * 0.05 * (Game.Has('Wrinklerspawn') ? 1.05 : 1) + (1 - 0.05 * num) : 1; + return 1.1 * num * num * 0.05 * (Game.Has('Wrinklerspawn') ? 1.05 : 1) + (1 - 0.05 * num); } function shouldPopWrinklers() { From feba410737db3a3859573027ac64a6ab56b6ebea Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 13:00:15 -0400 Subject: [PATCH 055/180] Allow pastemode to buy even worse things --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index a57189e8..bd81760a 100644 --- a/fc_main.js +++ b/fc_main.js @@ -1471,7 +1471,7 @@ function autoCookie() { } } - if (FrozenCookies.autoBuy && (Game.cookies >= delay + recommendation.cost) && (isFinite(nextChainedPurchase().efficiency))) { + if (FrozenCookies.autoBuy && (Game.cookies >= delay + recommendation.cost) && (FrozenCookies.pastemode || isFinite(nextChainedPurchase().efficiency))) { // if (FrozenCookies.autoBuy && (Game.cookies >= delay + recommendation.cost)) { recommendation.time = Date.now() - Game.startDate; // full_history.push(recommendation); // Probably leaky, maybe laggy? From d5c4697c1541332a1d2d450f2a3428f69fd786db Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 13:05:59 -0400 Subject: [PATCH 056/180] Pastemode should only reverse when recalculating the cache --- fc_main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fc_main.js b/fc_main.js index bd81760a..3dc0a652 100644 --- a/fc_main.js +++ b/fc_main.js @@ -735,9 +735,9 @@ function recommendationList(recalculate) { .sort(function(a,b){ return a.efficiency != b.efficiency ? a.efficiency - b.efficiency : (a.delta_cps != b.delta_cps ? b.delta_cps - a.delta_cps : a.cost - b.cost); })); - } - if (FrozenCookies.pastemode) { - FrozenCookies.caches.recommendationList.reverse(); + if (FrozenCookies.pastemode) { + FrozenCookies.caches.recommendationList.reverse(); + } } return FrozenCookies.caches.recommendationList; // return upgradeStats(recalculate).concat(buildingStats(recalculate)).sort(function(a,b){return (a.efficiency - b.efficiency)}); From 41fd54fa5939b7d48bb69e95733a4aa2c83923bf Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 13:24:39 -0400 Subject: [PATCH 057/180] Cumulative Building Cost is using wrong discount --- fc_main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 3dc0a652..54f7e1ed 100644 --- a/fc_main.js +++ b/fc_main.js @@ -881,11 +881,12 @@ function totalDiscount(building) { if (Game.Has('Season savings') && building) price *= 0.99; if (Game.Has('Toy workshop') && !building) price *= 0.95; if (Game.Has('Santa\'s dominion')) price *= (building ? 0.99 : 0.98); + if (Game.Has('Faberge egg')) price *= 0.99 return price; } function cumulativeBuildingCost(basePrice, startingNumber, endingNumber) { - return basePrice * totalDiscount() * (Math.pow(Game.priceIncrease, endingNumber) - Math.pow(Game.priceIncrease, startingNumber)) / (Game.priceIncrease - 1); + return basePrice * totalDiscount(true) * (Math.pow(Game.priceIncrease, endingNumber) - Math.pow(Game.priceIncrease, startingNumber)) / (Game.priceIncrease - 1); } function cumulativeSantaCost(amount) { From fab2429974197d7332bd34ac7083d640f4ac8751 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 13:25:48 -0400 Subject: [PATCH 058/180] ; --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 54f7e1ed..b91bd037 100644 --- a/fc_main.js +++ b/fc_main.js @@ -881,7 +881,7 @@ function totalDiscount(building) { if (Game.Has('Season savings') && building) price *= 0.99; if (Game.Has('Toy workshop') && !building) price *= 0.95; if (Game.Has('Santa\'s dominion')) price *= (building ? 0.99 : 0.98); - if (Game.Has('Faberge egg')) price *= 0.99 + if (Game.Has('Faberge egg')) price *= 0.99; return price; } From 2e8d9580394a16dc82d37c90bba0ccc652b6b9c3 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 13:48:48 -0400 Subject: [PATCH 059/180] Alter how GC probabilities are stored/calculated --- cc_upgrade_prerequisites.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cc_upgrade_prerequisites.js b/cc_upgrade_prerequisites.js index f882b002..e2bf1bfd 100644 --- a/cc_upgrade_prerequisites.js +++ b/cc_upgrade_prerequisites.js @@ -283,11 +283,10 @@ var cookieInfo = { 'blah': {'odds':[0,0,0,0], isOverlap:false} }; -function generateProbabilities(upgradeLevel, minBase, maxMult) { +function generateProbabilities(upgradeMult, minBase, maxMult) { var cumProb = []; var remainingProbability = 1; - var upgradeDiv = upgradeLevel ? 2 * upgradeLevel : 1; - var minTime = minBase / upgradeDiv; + var minTime = minBase * upgradeMult; var maxTime = maxMult * minTime; var spanTime = maxTime - minTime; for (var i=0; i Date: Tue, 20 May 2014 13:48:52 -0400 Subject: [PATCH 060/180] Alter how GC probabilities are stored/calculated --- fc_main.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fc_main.js b/fc_main.js index b91bd037..f4acabe8 100644 --- a/fc_main.js +++ b/fc_main.js @@ -410,13 +410,14 @@ function getProbabilityList(listType) { } function getProbabilityModifiers(listType) { + var result; switch (listType) { case "golden": - return Game.Has('Lucky day') + Game.Has('Serendipity'); + result = Game.Has('Lucky day') * 0.5 + Game.Has('Serendipity') * 0.5 + Game.Has('Golden goose egg') * 0.95; case "reindeer": - return Game.Has('Reindeer baking grounds'); + result = Game.Has('Reindeer baking grounds') * 0.5; } - return 0; + return result ? result : 1; } function cumulativeProbability(listType, start, stop) { From f8fa80c9afe14239d917c2103ff6505a7e4de76c Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 13:50:05 -0400 Subject: [PATCH 061/180] Update cc_upgrade_prerequisites.js --- cc_upgrade_prerequisites.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cc_upgrade_prerequisites.js b/cc_upgrade_prerequisites.js index e2bf1bfd..87b53af2 100644 --- a/cc_upgrade_prerequisites.js +++ b/cc_upgrade_prerequisites.js @@ -298,7 +298,7 @@ function generateProbabilities(upgradeMult, minBase, maxMult) { } var cumulativeProbabilityList = { - golden : [1, 0.5, 0.475, 0.25, 0.2375].reduce(function(r,x) { + golden : [1, 0.95, 0.5, 0.475, 0.25, 0.2375].reduce(function(r,x) { r[x] = generateProbabilities(x, 5 * 60 * Game.fps, 3); return r; }, {}), From 1c068bd3ba170e870d63b745120b76a8fdda4fdd Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 14:37:46 -0400 Subject: [PATCH 062/180] Update fc_main.js --- fc_main.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/fc_main.js b/fc_main.js index f4acabe8..aa79abaf 100644 --- a/fc_main.js +++ b/fc_main.js @@ -1,4 +1,18 @@ function setOverrides() { + // Add polyfills: + + (function (global) { + var global_isFinite = global.isFinite; + Object.defineProperty(Number, 'isFinite', { + value: function isFinite(value) { + return typeof value === 'number' && global_isFinite(value); + }, + configurable: true, + enumerable: false, + writable: true + }); + })(this); + // Set all cycleable preferences _.keys(FrozenCookies.preferenceValues).forEach(function(preference) { FrozenCookies[preference] = preferenceParse(preference, FrozenCookies.preferenceValues[preference].default); @@ -414,8 +428,10 @@ function getProbabilityModifiers(listType) { switch (listType) { case "golden": result = Game.Has('Lucky day') * 0.5 + Game.Has('Serendipity') * 0.5 + Game.Has('Golden goose egg') * 0.95; + break; case "reindeer": result = Game.Has('Reindeer baking grounds') * 0.5; + break; } return result ? result : 1; } From 28ad4426075ef4e757cf59d5542cebab188a1516 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 14:46:57 -0400 Subject: [PATCH 063/180] Move polyfill --- fc_main.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/fc_main.js b/fc_main.js index aa79abaf..7ecabe89 100644 --- a/fc_main.js +++ b/fc_main.js @@ -1,17 +1,18 @@ -function setOverrides() { - // Add polyfills: +// Add polyfills: - (function (global) { - var global_isFinite = global.isFinite; - Object.defineProperty(Number, 'isFinite', { - value: function isFinite(value) { - return typeof value === 'number' && global_isFinite(value); - }, - configurable: true, - enumerable: false, - writable: true - }); - })(this); +(function (global) { + var global_isFinite = global.isFinite; + Object.defineProperty(Number, 'isFinite', { + value: function isFinite(value) { + return typeof value === 'number' && global_isFinite(value); + }, + configurable: true, + enumerable: false, + writable: true + }); +})(this); + +function setOverrides() { // Set all cycleable preferences _.keys(FrozenCookies.preferenceValues).forEach(function(preference) { From ed32d27e461b2f37582058c92837240fcefc92f3 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 14:59:01 -0400 Subject: [PATCH 064/180] Update fc_main.js --- fc_main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fc_main.js b/fc_main.js index 7ecabe89..75b49d49 100644 --- a/fc_main.js +++ b/fc_main.js @@ -428,13 +428,13 @@ function getProbabilityModifiers(listType) { var result; switch (listType) { case "golden": - result = Game.Has('Lucky day') * 0.5 + Game.Has('Serendipity') * 0.5 + Game.Has('Golden goose egg') * 0.95; + result = (Game.Has('Lucky day') ? 0.5 : 1) * (Game.Has('Serendipity') ? 0.5 : 1) + (Game.Has('Golden goose egg') ? 0.95 : 1); break; case "reindeer": - result = Game.Has('Reindeer baking grounds') * 0.5; + result = Game.Has('Reindeer baking grounds') ? 0.5 : 1; break; } - return result ? result : 1; + return result; } function cumulativeProbability(listType, start, stop) { From ef403631e04de8ee75fa43e769cac3d5c24dd889 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 15:00:18 -0400 Subject: [PATCH 065/180] Update fc_main.js --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 75b49d49..c76e7d7e 100644 --- a/fc_main.js +++ b/fc_main.js @@ -428,7 +428,7 @@ function getProbabilityModifiers(listType) { var result; switch (listType) { case "golden": - result = (Game.Has('Lucky day') ? 0.5 : 1) * (Game.Has('Serendipity') ? 0.5 : 1) + (Game.Has('Golden goose egg') ? 0.95 : 1); + result = (Game.Has('Lucky day') ? 0.5 : 1) * (Game.Has('Serendipity') ? 0.5 : 1) * (Game.Has('Golden goose egg') ? 0.95 : 1); break; case "reindeer": result = Game.Has('Reindeer baking grounds') ? 0.5 : 1; From 468e58ea79320bb381a5ab874c514fdf603423b7 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 16:05:31 -0400 Subject: [PATCH 066/180] Update wrinkler calcs everywhere --- fc_main.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fc_main.js b/fc_main.js index c76e7d7e..66d0c764 100644 --- a/fc_main.js +++ b/fc_main.js @@ -262,7 +262,7 @@ function fcReset(bypass) { FrozenCookies.frenzyTimes = {}; FrozenCookies.last_gc_state = (Game.frenzy ? Game.frenzyPower : 1) * (Game.clickFrenzy ? 777 : 1); FrozenCookies.last_gc_time = Date.now(); - FrozenCookies.lastHCAmount = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + w.sucked * 1.1;}, 0)); + FrozenCookies.lastHCAmount = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0)); FrozenCookies.lastHCTime = Date.now(); FrozenCookies.maxHCPercent = 0; FrozenCookies.prevLastHCTime = Date.now(); @@ -345,7 +345,7 @@ document.addEventListener('keydown', function(event) { copyToClipboard(Game.WriteSave(true)); } if(event.keyCode == 87) { - Game.Notify('Wrinkler Info', 'Popping all wrinklers will give you ' + Beautify(Game.wrinklers.reduce(function(s,w){return s + w.sucked * 1.1},0)) + ' cookies. ', [19,8],7); + Game.Notify('Wrinkler Info', 'Popping all wrinklers will give you ' + Beautify(Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);},0)) + ' cookies. ', [19,8],7); } } }); @@ -1199,7 +1199,7 @@ function saveStats(fromGraph) { time: Date.now() - Game.startDate, baseCps: baseCps(), effectiveCps: effectiveCps(), - hc: Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + w.sucked * 1.1},0)) + hc: Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);},0)) }); if ($('#statGraphContainer').length > 0 && !$('#statGraphContainer').is(':hidden') && !fromGraph) { viewStatGraphs(); @@ -1407,6 +1407,10 @@ function wrinklerMod(num) { return 1.1 * num * num * 0.05 * (Game.Has('Wrinklerspawn') ? 1.05 : 1) + (1 - 0.05 * num); } +function popValue(sucked) { + return sucked * 1.1 * (Game.Has('Wrinklerspawn') ? 1.05 : 1); +} + function shouldPopWrinklers() { var toPop = []; var living = liveWrinklers(); @@ -1421,7 +1425,7 @@ function shouldPopWrinklers() { var futureWrinklers = living.length - (current.ids.length + 1); if (current.total < nextRecNeeded && effectiveCps(delay, Game.elderWrath, futureWrinklers) + nextRecCps > effectiveCps()) { current.ids.push(w.id); - current.total += w.sucked * 1.1; + current.total += popValue(w.sucked); } return current; }, {total:0, ids:[]}); @@ -1459,7 +1463,7 @@ function autoFrenzyClick() { function autoCookie() { if (!FrozenCookies.processing) { FrozenCookies.processing = true; - var currentHCAmount = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + w.sucked * 1.1;}, 0)); + var currentHCAmount = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0)); if (FrozenCookies.lastHCAmount < currentHCAmount) { var changeAmount = currentHCAmount - FrozenCookies.lastHCAmount; FrozenCookies.lastHCAmount = currentHCAmount; From 3b8d09919dc3975f4baad4121a388c8d59642bbe Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 20 May 2014 16:18:33 -0400 Subject: [PATCH 067/180] Version Tick --- frozen_cookies.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen_cookies.js b/frozen_cookies.js index d9361987..b2fdc649 100644 --- a/frozen_cookies.js +++ b/frozen_cookies.js @@ -6,7 +6,7 @@ var scriptElement = document.getElementById( 'frozenCookieScript' ), FrozenCookies = { 'baseUrl': baseUrl, 'branch' : 'G', - 'version': 1.2 + 'version': 1.3 }; // Load external libraries From c0d439c740dc62be0847533308f93c9883e06a91 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Thu, 22 May 2014 08:52:05 -0400 Subject: [PATCH 068/180] Add 'defaultPurchase' for completely empty recommendation lists --- fc_main.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/fc_main.js b/fc_main.js index 66d0c764..8e882c16 100644 --- a/fc_main.js +++ b/fc_main.js @@ -800,6 +800,9 @@ function nextPurchase(recalculate) { break; } } + if (recList.length == 0) { + return defaultPurchase(); + } } return FrozenCookies.caches.nextPurchase; // return purchase; @@ -894,6 +897,22 @@ function santaStats() { } : []; } +function defaultPurchase() { + return { + id: 0, + efficiency: Infinity, + delta_cps: 0, + cost: Infinity, + type: 'other', + purchase: { + id: 0, + name: 'No valid purchases!', + buy: function(){}, + getCost: function() {return Infinity;} + } + } +} + function totalDiscount(building) { var price = 1; if (Game.Has('Season savings') && building) price *= 0.99; From 47b45044cf1403447bfad965f78b1af87fb2119f Mon Sep 17 00:00:00 2001 From: Nicholas Date: Thu, 22 May 2014 10:17:01 -0400 Subject: [PATCH 069/180] Add default purchases that do nothing if recommendation list is empty(ish) --- fc_main.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fc_main.js b/fc_main.js index 8e882c16..f6737d0b 100644 --- a/fc_main.js +++ b/fc_main.js @@ -786,8 +786,9 @@ function nextPurchase(recalculate) { if (recalculate) { var recList = recommendationList(recalculate); var purchase = null; + var target = null; for (var i = 0; i < recList.length; i++) { - var target = recList[i]; + target = recList[i]; if (target.type == 'upgrade' && unfinishedUpgradePrereqs(Game.UpgradesById[target.id])) { var prereqList = unfinishedUpgradePrereqs(Game.UpgradesById[target.id]); purchase = recList.filter(function(a){return prereqList.some(function(b){return b.id == a.id && b.type == a.type})})[0]; @@ -800,8 +801,9 @@ function nextPurchase(recalculate) { break; } } - if (recList.length == 0) { - return defaultPurchase(); + if (purchase == null) { + FrozenCookies.caches.nextPurchase = defaultPurchase(); + FrozenCookies.caches.nextChainedPurchase = defaultPurchase(); } } return FrozenCookies.caches.nextPurchase; From f57f75e58969952b0055ca10f17c7979e3d30458 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Thu, 22 May 2014 10:19:01 -0400 Subject: [PATCH 070/180] Update fc_main.js --- fc_main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/fc_main.js b/fc_main.js index f6737d0b..ea8e9844 100644 --- a/fc_main.js +++ b/fc_main.js @@ -904,6 +904,7 @@ function defaultPurchase() { id: 0, efficiency: Infinity, delta_cps: 0, + base_delta_cps: 0, cost: Infinity, type: 'other', purchase: { From a329b3fdbbefe0796bf3e165fb62f23849845a00 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Thu, 22 May 2014 11:59:56 -0400 Subject: [PATCH 071/180] Add infobox to FC Reset code --- fc_main.js | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/fc_main.js b/fc_main.js index ea8e9844..209a62a7 100644 --- a/fc_main.js +++ b/fc_main.js @@ -253,23 +253,31 @@ function timeDisplay(seconds) { } function fcReset(bypass) { - Game.CollectWrinklers(); - if (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')) { - Game.ObjectsById.forEach(function(b){b.sell(b.amount);}); - Game.Upgrades['Chocolate egg'].buy(); + if (bypass) { + Game.CollectWrinklers(); + if (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')) { + Game.ObjectsById.forEach(function(b){b.sell(b.amount);}); + Game.Upgrades['Chocolate egg'].buy(); + } + Game.oldReset(bypass); + FrozenCookies.frenzyTimes = {}; + FrozenCookies.last_gc_state = (Game.frenzy ? Game.frenzyPower : 1) * (Game.clickFrenzy ? 777 : 1); + FrozenCookies.last_gc_time = Date.now(); + FrozenCookies.lastHCAmount = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0)); + FrozenCookies.lastHCTime = Date.now(); + FrozenCookies.maxHCPercent = 0; + FrozenCookies.prevLastHCTime = Date.now(); + FrozenCookies.lastCps = 0; + FrozenCookies.trackedStats = []; + updateLocalStorage(); + recommendationList(true); + } else { + Game.Prompt( + '

Reset

Do you want to reset?
' + + 'This will pop all wrinklers, sell all buildings, and buy the Chocolate Egg if possible, before removing all progress and granting Heavenly Chips. ' + + 'You will gain a total of ' + Game.HowMuchPrestige((Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0)) * (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? 1.05 : 1)) + 'Heavenly Chips if you reset now.
', + [['Yes!','Game.Reset(1);Game.ClosePrompt();'],'No']); } - Game.oldReset(bypass); - FrozenCookies.frenzyTimes = {}; - FrozenCookies.last_gc_state = (Game.frenzy ? Game.frenzyPower : 1) * (Game.clickFrenzy ? 777 : 1); - FrozenCookies.last_gc_time = Date.now(); - FrozenCookies.lastHCAmount = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0)); - FrozenCookies.lastHCTime = Date.now(); - FrozenCookies.maxHCPercent = 0; - FrozenCookies.prevLastHCTime = Date.now(); - FrozenCookies.lastCps = 0; - FrozenCookies.trackedStats = []; - updateLocalStorage(); - recommendationList(true); } function fcWriteSave(exporting) { From ef4be8890a9894103c7e5530c5190540a8929740 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Thu, 22 May 2014 12:02:58 -0400 Subject: [PATCH 072/180] Prettify reset prompt --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 209a62a7..0de88bb3 100644 --- a/fc_main.js +++ b/fc_main.js @@ -275,7 +275,7 @@ function fcReset(bypass) { Game.Prompt( '

Reset

Do you want to reset?
' + 'This will pop all wrinklers, sell all buildings, and buy the Chocolate Egg if possible, before removing all progress and granting Heavenly Chips. ' + - 'You will gain a total of ' + Game.HowMuchPrestige((Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0)) * (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? 1.05 : 1)) + 'Heavenly Chips if you reset now.
', + '
You will gain a total of ' + Beautify(Game.HowMuchPrestige((Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0)) * (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? 1.05 : 1))) + ' Heavenly Chips if you reset now.
', [['Yes!','Game.Reset(1);Game.ClosePrompt();'],'No']); } } From cd8e0233558924f507e958170f4edf67c7398b75 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Thu, 22 May 2014 12:05:49 -0400 Subject: [PATCH 073/180] Also make it a real number, that'd be great. --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 0de88bb3..53904167 100644 --- a/fc_main.js +++ b/fc_main.js @@ -275,7 +275,7 @@ function fcReset(bypass) { Game.Prompt( '

Reset

Do you want to reset?
' + 'This will pop all wrinklers, sell all buildings, and buy the Chocolate Egg if possible, before removing all progress and granting Heavenly Chips. ' + - '
You will gain a total of ' + Beautify(Game.HowMuchPrestige((Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0)) * (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? 1.05 : 1))) + ' Heavenly Chips if you reset now.
', + '
You will gain a total of ' + Beautify(Game.HowMuchPrestige(Game.cookiesReset) - Game.HowMuchPrestige((Game.cookiesEarned + Game.cookiesReset + (Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0) + Game.ObjectsById.reduce(function(s,b){return s + cumulativeBuildingCost(b.basePrice, 1, b.amount + 1) / 2})) * (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? 1.05 : 1))) + ' Heavenly Chips if you reset now.
', [['Yes!','Game.Reset(1);Game.ClosePrompt();'],'No']); } } From c06674337e3766dd8ce75911b84b52909c9f8b00 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Thu, 22 May 2014 12:09:02 -0400 Subject: [PATCH 074/180] Update fc_main.js --- fc_main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 53904167..03fc9798 100644 --- a/fc_main.js +++ b/fc_main.js @@ -275,7 +275,14 @@ function fcReset(bypass) { Game.Prompt( '

Reset

Do you want to reset?
' + 'This will pop all wrinklers, sell all buildings, and buy the Chocolate Egg if possible, before removing all progress and granting Heavenly Chips. ' + - '
You will gain a total of ' + Beautify(Game.HowMuchPrestige(Game.cookiesReset) - Game.HowMuchPrestige((Game.cookiesEarned + Game.cookiesReset + (Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0) + Game.ObjectsById.reduce(function(s,b){return s + cumulativeBuildingCost(b.basePrice, 1, b.amount + 1) / 2})) * (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? 1.05 : 1))) + ' Heavenly Chips if you reset now.
', + '
You will gain a total of ' + + Beautify( + Game.HowMuchPrestige(Game.cookiesReset) - + Game.HowMuchPrestige( + (Game.cookiesEarned + Game.cookiesReset + + (Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0) + Game.ObjectsById.reduce(function(s,b){return s + cumulativeBuildingCost(b.basePrice, 1, b.amount + 1) / 2})) * (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? 1.05 : 1) + ) + )) + ' Heavenly Chips if you reset now.
', [['Yes!','Game.Reset(1);Game.ClosePrompt();'],'No']); } } From 3dc34ed04ccb5785a9f272b57f3732174f132e8c Mon Sep 17 00:00:00 2001 From: Nicholas Date: Thu, 22 May 2014 12:11:39 -0400 Subject: [PATCH 075/180] Update fc_main.js --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index 03fc9798..4396d509 100644 --- a/fc_main.js +++ b/fc_main.js @@ -280,7 +280,7 @@ function fcReset(bypass) { Game.HowMuchPrestige(Game.cookiesReset) - Game.HowMuchPrestige( (Game.cookiesEarned + Game.cookiesReset + - (Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0) + Game.ObjectsById.reduce(function(s,b){return s + cumulativeBuildingCost(b.basePrice, 1, b.amount + 1) / 2})) * (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? 1.05 : 1) + (Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0) + Game.ObjectsById.reduce(function(s,b){return s + cumulativeBuildingCost(b.basePrice, 1, b.amount + 1) / 2},0)) * (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? 1.05 : 1) ) )) + ' Heavenly Chips if you reset now.
', [['Yes!','Game.Reset(1);Game.ClosePrompt();'],'No']); From 9ac26b870c23f58704a15fa8aaadb0314075f895 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Thu, 22 May 2014 12:12:57 -0400 Subject: [PATCH 076/180] Update fc_main.js --- fc_main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fc_main.js b/fc_main.js index 4396d509..14f91dc6 100644 --- a/fc_main.js +++ b/fc_main.js @@ -277,12 +277,12 @@ function fcReset(bypass) { 'This will pop all wrinklers, sell all buildings, and buy the Chocolate Egg if possible, before removing all progress and granting Heavenly Chips. ' + '
You will gain a total of ' + Beautify( - Game.HowMuchPrestige(Game.cookiesReset) - Game.HowMuchPrestige( (Game.cookiesEarned + Game.cookiesReset + (Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0) + Game.ObjectsById.reduce(function(s,b){return s + cumulativeBuildingCost(b.basePrice, 1, b.amount + 1) / 2},0)) * (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? 1.05 : 1) ) - )) + ' Heavenly Chips if you reset now.
', + ) - + Game.HowMuchPrestige(Game.cookiesReset)) + ' Heavenly Chips if you reset now.
', [['Yes!','Game.Reset(1);Game.ClosePrompt();'],'No']); } } From c61eb539e156e1abb94894796ba202f3ef364003 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 27 May 2014 14:37:41 -0400 Subject: [PATCH 077/180] Add some new info --- fc_button.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fc_button.js b/fc_button.js index 6a13c653..d86fc084 100644 --- a/fc_button.js +++ b/fc_button.js @@ -339,7 +339,8 @@ function FCMenu() { chainRecommendation = nextChainedPurchase(), isChained = !(recommendation.id == chainRecommendation.id && recommendation.type == chainRecommendation.type), bankLevel = bestBank(chainRecommendation.efficiency), - actualCps = Game.cookiesPs + Game.mouseCps() * FrozenCookies.cookieClickSpeed; + actualCps = Game.cookiesPs + Game.mouseCps() * FrozenCookies.cookieClickSpeed, + chocolateRecoup = chainRecommendation.type == 'upgrade' ? Infinity : chainRecommendation.cost * 0.425 * 0.05 / chainRecommendation.delta_cps; subsection.append($('
').addClass('listing').html('Next Purchase: ' + recommendation.purchase.name)); if (isChained) { @@ -350,6 +351,9 @@ function FCMenu() { if (isChained) { subsection.append($('
').addClass('listing').html('Time till Chain completion: ' + timeDisplay(divCps(Math.max(0,(chainRecommendation.cost + bankLevel.cost - Game.cookies)), actualCps)))); } + if (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')) { + subsection.append($('
').addClass('listing').html('Time to Recoup Chocolate: ' + timeDisplay(chocolateRecoup))); + } subsection.append($('
').addClass('listing').html('Cost: ' + Beautify(recommendation.cost))); subsection.append($('
').addClass('listing').html('Golden Cookie Bank: ' + Beautify(bankLevel.cost))); subsection.append($('
').addClass('listing').html('Base Δ CPS: ' + Beautify(recommendation.base_delta_cps))); @@ -459,6 +463,9 @@ function FCMenu() { buildTable.append($('Lucky Bankn/a' + Beautify(bankLucky.efficiency) + '' + Beautify(Math.max(0,bankLucky.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLucky.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Lucky Frenzy Bankn/a' + Beautify(bankLuckyFrenzy.efficiency) + '' + Beautify(Math.max(0,bankLuckyFrenzy.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLuckyFrenzy.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Chain Bankn/a' + Beautify(bankChain.efficiency) + '' + Beautify(Math.max(0,bankChain.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankChain.cost) - cookieValue(Game.cookies))) + '')); + $.each({'Pledging/Appeased' : 0, 'One Mind/Awoken' : 1, 'Displease' : 2, 'Full Wrath/Angered' : 3}, function(k,v) { + buildTable.append($('' + k + 'n/a' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + 'n/a' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); + }); subsection.append($('
').addClass('listing').append(buildTable)); menu.append(subsection); }; From dd474cad2e03f8f664ae6ee752bf3fc846cb0a47 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 27 May 2014 14:48:07 -0400 Subject: [PATCH 078/180] Make Choc Recoup include (effective) time to buy --- fc_button.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fc_button.js b/fc_button.js index d86fc084..8d0290fc 100644 --- a/fc_button.js +++ b/fc_button.js @@ -340,7 +340,7 @@ function FCMenu() { isChained = !(recommendation.id == chainRecommendation.id && recommendation.type == chainRecommendation.type), bankLevel = bestBank(chainRecommendation.efficiency), actualCps = Game.cookiesPs + Game.mouseCps() * FrozenCookies.cookieClickSpeed, - chocolateRecoup = chainRecommendation.type == 'upgrade' ? Infinity : chainRecommendation.cost * 0.425 * 0.05 / chainRecommendation.delta_cps; + chocolateRecoup = recommendation.type == 'upgrade' ? Infinity : recommendation.cost * 0.425 * 0.05 / recommendation.delta_cps; subsection.append($('
').addClass('listing').html('Next Purchase: ' + recommendation.purchase.name)); if (isChained) { @@ -352,7 +352,7 @@ function FCMenu() { subsection.append($('
').addClass('listing').html('Time till Chain completion: ' + timeDisplay(divCps(Math.max(0,(chainRecommendation.cost + bankLevel.cost - Game.cookies)), actualCps)))); } if (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')) { - subsection.append($('
').addClass('listing').html('Time to Recoup Chocolate: ' + timeDisplay(chocolateRecoup))); + subsection.append($('
').addClass('listing').html('Time to Recoup Chocolate: ' + timeDisplay(divCps(recommendation.cost + bankLevel.cost - Game.cookies, effectiveCps()) + chocolateRecoup))); } subsection.append($('
').addClass('listing').html('Cost: ' + Beautify(recommendation.cost))); subsection.append($('
').addClass('listing').html('Golden Cookie Bank: ' + Beautify(bankLevel.cost))); From c8e0a60c1174fe8a05678a373c8c1035fcaeb175 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Tue, 27 May 2014 14:52:47 -0400 Subject: [PATCH 079/180] Typo --- fc_button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_button.js b/fc_button.js index 8d0290fc..17b36ac8 100644 --- a/fc_button.js +++ b/fc_button.js @@ -463,7 +463,7 @@ function FCMenu() { buildTable.append($('Lucky Bankn/a' + Beautify(bankLucky.efficiency) + '' + Beautify(Math.max(0,bankLucky.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLucky.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Lucky Frenzy Bankn/a' + Beautify(bankLuckyFrenzy.efficiency) + '' + Beautify(Math.max(0,bankLuckyFrenzy.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLuckyFrenzy.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Chain Bankn/a' + Beautify(bankChain.efficiency) + '' + Beautify(Math.max(0,bankChain.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankChain.cost) - cookieValue(Game.cookies))) + '')); - $.each({'Pledging/Appeased' : 0, 'One Mind/Awoken' : 1, 'Displease' : 2, 'Full Wrath/Angered' : 3}, function(k,v) { + $.each({'Pledging/Appeased' : 0, 'One Mind/Awoken' : 1, 'Displeased' : 2, 'Full Wrath/Angered' : 3}, function(k,v) { buildTable.append($('' + k + 'n/a' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + 'n/a' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); }); subsection.append($('
').addClass('listing').append(buildTable)); From 0e4f073943cc4ca35d1bb672aca1b6192c080883 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 09:25:03 -0400 Subject: [PATCH 080/180] Add chocolateValue() --- fc_main.js | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/fc_main.js b/fc_main.js index 14f91dc6..3ea678b2 100644 --- a/fc_main.js +++ b/fc_main.js @@ -256,7 +256,7 @@ function fcReset(bypass) { if (bypass) { Game.CollectWrinklers(); if (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')) { - Game.ObjectsById.forEach(function(b){b.sell(b.amount);}); + Game.ObjectsById.forEach(function(b){b.sell(-1);}); Game.Upgrades['Chocolate egg'].buy(); } Game.oldReset(bypass); @@ -272,17 +272,15 @@ function fcReset(bypass) { updateLocalStorage(); recommendationList(true); } else { + var totalHC = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + wrinklerValue() + chocolateValue()); Game.Prompt( '

Reset

Do you want to reset?
' + 'This will pop all wrinklers, sell all buildings, and buy the Chocolate Egg if possible, before removing all progress and granting Heavenly Chips. ' + - '
You will gain a total of ' + + '
You will gain ' + Beautify( - Game.HowMuchPrestige( - (Game.cookiesEarned + Game.cookiesReset + - (Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0) + Game.ObjectsById.reduce(function(s,b){return s + cumulativeBuildingCost(b.basePrice, 1, b.amount + 1) / 2},0)) * (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? 1.05 : 1) - ) - ) - - Game.HowMuchPrestige(Game.cookiesReset)) + ' Heavenly Chips if you reset now.
', + totalHC - + Game.HowMuchPrestige(Game.cookiesReset)) + ' Heavenly Chips, for a total of ' + + Beautify(totalHC) + ' Heavenly Chips if you reset now.
', [['Yes!','Game.Reset(1);Game.ClosePrompt();'],'No']); } } @@ -606,6 +604,19 @@ function calculateChainValue(bankAmount, cps, digit) { return 125 * Math.pow(9,(n-3)) * digit; } +function chocolateValue(bankAmount) { + var value = 0; + if (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')) { + bankAmount = (bankAmount != null && bankAmount !== 0) ? bankAmount : Game.cookies; + value = 0.05 * (wrinklerValue() + bankAmount + Game.ObjectsById.reduce(function(s,b){return s + cumulativeBuildingCost(b.basePrice, 1, b.amount + 1) / 2},0)); + } + return value; +} + +function wrinklerValue() { + return Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0); +} + /* Old way, less efficient function calculateChainValue(bankAmount, cps) { var payoutTotal = 0; From 380fa79a77b41819942cabeced39dbe95eb43a07 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 09:27:35 -0400 Subject: [PATCH 081/180] Include wrinklers/chocolate in HC values --- fc_button.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fc_button.js b/fc_button.js index 17b36ac8..54c383ea 100644 --- a/fc_button.js +++ b/fc_button.js @@ -340,7 +340,7 @@ function FCMenu() { isChained = !(recommendation.id == chainRecommendation.id && recommendation.type == chainRecommendation.type), bankLevel = bestBank(chainRecommendation.efficiency), actualCps = Game.cookiesPs + Game.mouseCps() * FrozenCookies.cookieClickSpeed, - chocolateRecoup = recommendation.type == 'upgrade' ? Infinity : recommendation.cost * 0.425 * 0.05 / recommendation.delta_cps; + chocolateRecoup = (recommendation.type == 'upgrade' ? recommendation.cost : recommendation.cost * 0.425 * 0.05) / recommendation.delta_cps; subsection.append($('
').addClass('listing').html('Next Purchase: ' + recommendation.purchase.name)); if (isChained) { @@ -394,7 +394,7 @@ function FCMenu() { subsection = $('
').addClass('subsection'); subsection.append($('
').addClass('title').html('Heavenly Chips Information')); currHC = Game.prestige['Heavenly chips']; - resetHC = Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned); + resetHC = Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned + wrinklerValue() + chocolateValue()); subsection.append($('
').addClass('listing').html('HC Now: ' + Beautify(Game.prestige['Heavenly chips']))); subsection.append($('
').addClass('listing').html('HC After Reset: ' + Beautify(resetHC))); subsection.append($('
').addClass('listing').html('Cookies to next HC: ' + Beautify(nextHC(true)))); From 7b4e18eb56c8ab9e7fa1916daea7ddf5db6659da Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 09:33:24 -0400 Subject: [PATCH 082/180] Add new keyboard shortcuts (Reset, Manual Save) --- fc_main.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fc_main.js b/fc_main.js index 3ea678b2..628678d7 100644 --- a/fc_main.js +++ b/fc_main.js @@ -357,6 +357,12 @@ document.addEventListener('keydown', function(event) { if(event.keyCode == 69) { copyToClipboard(Game.WriteSave(true)); } + if (event.keyCode == 82) { + Game.Reset(); + } + if (event.keyCode == 83) { + Game.WriteSave(); + } if(event.keyCode == 87) { Game.Notify('Wrinkler Info', 'Popping all wrinklers will give you ' + Beautify(Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);},0)) + ' cookies. ', [19,8],7); } From dedbc4339552ce4ecb85bae143ff84a5a7d0e1c5 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 10:41:25 -0400 Subject: [PATCH 083/180] Update fc_button.js --- fc_button.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/fc_button.js b/fc_button.js index 54c383ea..f60897ad 100644 --- a/fc_button.js +++ b/fc_button.js @@ -366,6 +366,9 @@ function FCMenu() { subsection.append($('
').addClass('listing').html('Golden Cookie Efficiency: ' + Beautify(bankLevel.efficiency))); } menu.append(subsection); + + // Golden Cookies + subsection = $('
').addClass('subsection'); subsection.append($('
').addClass('title').html('Golden Cookie Information')); currentCookies = Math.min(Game.cookies, FrozenCookies.targetBank.cost); @@ -383,6 +386,8 @@ function FCMenu() { } subsection.append($('
').addClass('listing').html('Max Lucky Cookie Value: ' + Beautify(maxLuckyValue()))); subsection.append($('
').addClass('listing').html('Cookie Bank Required for Max Lucky: ' + Beautify(maxLuckyValue() * 10))); + subsection.append($('
').addClass('listing').html('Max Chain Cookie Value: ' + Beautify(calculateChainValue(chainBank(), Game.cookiesPs, (7 - (Game.elderWrath / 3)))))); + subsection.append($('
').addClass('listing').html('Cookie Bank Required for Max Chain: ' + Beautify(chainBank()))); subsection.append($('
').addClass('listing').html('Estimated Cookie CPS: ' + Beautify(gcPs(cookieValue(currentCookies))))); subsection.append($('
').addClass('listing').html('Golden Cookie Clicks: ' + Beautify(Game.goldenClicks))); subsection.append($('
').addClass('listing').html('Missed Golden Cookie Clicks: ' + Beautify(Game.missedGoldenClicks))); @@ -391,6 +396,9 @@ function FCMenu() { subsection.append($('
').addClass('listing').html('Total Recorded Time at x' + rate + ': ' + timeDisplay(time/1000))); }); menu.append(subsection); + + // Heavenly Chips + subsection = $('
').addClass('subsection'); subsection.append($('
').addClass('title').html('Heavenly Chips Information')); currHC = Game.prestige['Heavenly chips']; @@ -413,6 +421,8 @@ function FCMenu() { } } menu.append(subsection); + + // Other Information subsection = $('
').addClass('subsection'); subsection.append($('
').addClass('title').html('Other Information')); cps = baseCps() + baseClickingCps(FrozenCookies.cookieClickSpeed * FrozenCookies.autoClick); @@ -422,8 +432,15 @@ function FCMenu() { subsection.append($('
').addClass('listing').html('Base CPS' + clickStr + baseChosen + ': ' + Beautify(cps))); subsection.append($('
').addClass('listing').html('Frenzy CPS' + clickStr + frenzyChosen + ': ' + Beautify(cps * 7))); subsection.append($('
').addClass('listing').html('Estimated Effective CPS: ' + Beautify(effectiveCps()))); - subsection.append($('
').addClass('listing').html('Game Started: ' + Game.sayTime((Date.now()-Game.startDate)/1000*Game.fps))); + if (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')) { + subsection.append($('
').addClass('listing').html('Chocolate Egg Value: ' + Beautify(chocolateValue()))); + } + if (liveWrinkers().length > 0) { + subsection.append($('
').addClass('listing').html('Wrinkler Value: ' + Beautify(wrinklerValue()))); + } menu.append(subsection); + + if (FrozenCookies.preferenceValues) { subsection = $('
').addClass('subsection'); subsection.append($('
').addClass('title').html('Frozen Cookie Controls')); @@ -460,9 +477,11 @@ function FCMenu() { bankLucky = {'cost': luckyBank(), 'efficiency': cookieEfficiency(Game.cookies, luckyBank())}; bankLuckyFrenzy = {'cost': luckyFrenzyBank(), 'efficiency': cookieEfficiency(Game.cookies, luckyFrenzyBank())}; bankChain = {'cost': chainBank(), 'efficiency': cookieEfficiency(Game.cookies, chainBank())}; + buildTable.append($('').append($('').css({'rowspan': 5, 'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'))); buildTable.append($('Lucky Bankn/a' + Beautify(bankLucky.efficiency) + '' + Beautify(Math.max(0,bankLucky.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLucky.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Lucky Frenzy Bankn/a' + Beautify(bankLuckyFrenzy.efficiency) + '' + Beautify(Math.max(0,bankLuckyFrenzy.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLuckyFrenzy.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Chain Bankn/a' + Beautify(bankChain.efficiency) + '' + Beautify(Math.max(0,bankChain.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankChain.cost) - cookieValue(Game.cookies))) + '')); + buildTable.append($('').append($('').css({'rowspan': 5, 'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'))); $.each({'Pledging/Appeased' : 0, 'One Mind/Awoken' : 1, 'Displeased' : 2, 'Full Wrath/Angered' : 3}, function(k,v) { buildTable.append($('' + k + 'n/a' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + 'n/a' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); }); From c448b90c296b8754166f673a410ea8143d3551cf Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 10:42:04 -0400 Subject: [PATCH 084/180] Update fc_button.js --- fc_button.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fc_button.js b/fc_button.js index f60897ad..b5deb227 100644 --- a/fc_button.js +++ b/fc_button.js @@ -477,11 +477,11 @@ function FCMenu() { bankLucky = {'cost': luckyBank(), 'efficiency': cookieEfficiency(Game.cookies, luckyBank())}; bankLuckyFrenzy = {'cost': luckyFrenzyBank(), 'efficiency': cookieEfficiency(Game.cookies, luckyFrenzyBank())}; bankChain = {'cost': chainBank(), 'efficiency': cookieEfficiency(Game.cookies, chainBank())}; - buildTable.append($('').append($('').css({'rowspan': 5, 'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'))); + buildTable.append($('').append($('').css({'rowspan': 5, 'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'}))); buildTable.append($('Lucky Bankn/a' + Beautify(bankLucky.efficiency) + '' + Beautify(Math.max(0,bankLucky.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLucky.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Lucky Frenzy Bankn/a' + Beautify(bankLuckyFrenzy.efficiency) + '' + Beautify(Math.max(0,bankLuckyFrenzy.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLuckyFrenzy.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Chain Bankn/a' + Beautify(bankChain.efficiency) + '' + Beautify(Math.max(0,bankChain.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankChain.cost) - cookieValue(Game.cookies))) + '')); - buildTable.append($('').append($('').css({'rowspan': 5, 'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'))); + buildTable.append($('').append($('').css({'rowspan': 5, 'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'}))); $.each({'Pledging/Appeased' : 0, 'One Mind/Awoken' : 1, 'Displeased' : 2, 'Full Wrath/Angered' : 3}, function(k,v) { buildTable.append($('' + k + 'n/a' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + 'n/a' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); }); From bca667d4a6dca35ea29d54a106b1e9cd9e202248 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 10:43:31 -0400 Subject: [PATCH 085/180] Update fc_button.js --- fc_button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_button.js b/fc_button.js index b5deb227..0174fba6 100644 --- a/fc_button.js +++ b/fc_button.js @@ -435,7 +435,7 @@ function FCMenu() { if (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')) { subsection.append($('
').addClass('listing').html('Chocolate Egg Value: ' + Beautify(chocolateValue()))); } - if (liveWrinkers().length > 0) { + if (liveWrinklers().length > 0) { subsection.append($('
').addClass('listing').html('Wrinkler Value: ' + Beautify(wrinklerValue()))); } menu.append(subsection); From 3900e43a9949b9cdc757832fed9fb8464c381e08 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 10:44:41 -0400 Subject: [PATCH 086/180] Update fc_button.js --- fc_button.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fc_button.js b/fc_button.js index 0174fba6..557e5f45 100644 --- a/fc_button.js +++ b/fc_button.js @@ -477,11 +477,11 @@ function FCMenu() { bankLucky = {'cost': luckyBank(), 'efficiency': cookieEfficiency(Game.cookies, luckyBank())}; bankLuckyFrenzy = {'cost': luckyFrenzyBank(), 'efficiency': cookieEfficiency(Game.cookies, luckyFrenzyBank())}; bankChain = {'cost': chainBank(), 'efficiency': cookieEfficiency(Game.cookies, chainBank())}; - buildTable.append($('').append($('').css({'rowspan': 5, 'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'}))); + buildTable.append($('').append($('').css({'colspan': 5, 'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'}))); buildTable.append($('Lucky Bankn/a' + Beautify(bankLucky.efficiency) + '' + Beautify(Math.max(0,bankLucky.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLucky.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Lucky Frenzy Bankn/a' + Beautify(bankLuckyFrenzy.efficiency) + '' + Beautify(Math.max(0,bankLuckyFrenzy.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLuckyFrenzy.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Chain Bankn/a' + Beautify(bankChain.efficiency) + '' + Beautify(Math.max(0,bankChain.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankChain.cost) - cookieValue(Game.cookies))) + '')); - buildTable.append($('').append($('').css({'rowspan': 5, 'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'}))); + buildTable.append($('').append($('').css({'colspan': 5, 'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'}))); $.each({'Pledging/Appeased' : 0, 'One Mind/Awoken' : 1, 'Displeased' : 2, 'Full Wrath/Angered' : 3}, function(k,v) { buildTable.append($('' + k + 'n/a' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + 'n/a' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); }); From 2f4aad34205d0cf23517e5f443508eb4d606b209 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 10:45:19 -0400 Subject: [PATCH 087/180] Update fc_button.js --- fc_button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_button.js b/fc_button.js index 557e5f45..136b89c6 100644 --- a/fc_button.js +++ b/fc_button.js @@ -481,7 +481,7 @@ function FCMenu() { buildTable.append($('Lucky Bankn/a' + Beautify(bankLucky.efficiency) + '' + Beautify(Math.max(0,bankLucky.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLucky.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Lucky Frenzy Bankn/a' + Beautify(bankLuckyFrenzy.efficiency) + '' + Beautify(Math.max(0,bankLuckyFrenzy.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLuckyFrenzy.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Chain Bankn/a' + Beautify(bankChain.efficiency) + '' + Beautify(Math.max(0,bankChain.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankChain.cost) - cookieValue(Game.cookies))) + '')); - buildTable.append($('').append($('').css({'colspan': 5, 'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'}))); + buildTable.append($('').css({'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'})); $.each({'Pledging/Appeased' : 0, 'One Mind/Awoken' : 1, 'Displeased' : 2, 'Full Wrath/Angered' : 3}, function(k,v) { buildTable.append($('' + k + 'n/a' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + 'n/a' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); }); From 8178b0873f16ebe64121376f368d19ede125a7ca Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 10:46:15 -0400 Subject: [PATCH 088/180] Update fc_button.js --- fc_button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_button.js b/fc_button.js index 136b89c6..44877ef4 100644 --- a/fc_button.js +++ b/fc_button.js @@ -481,7 +481,7 @@ function FCMenu() { buildTable.append($('Lucky Bankn/a' + Beautify(bankLucky.efficiency) + '' + Beautify(Math.max(0,bankLucky.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLucky.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Lucky Frenzy Bankn/a' + Beautify(bankLuckyFrenzy.efficiency) + '' + Beautify(Math.max(0,bankLuckyFrenzy.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLuckyFrenzy.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Chain Bankn/a' + Beautify(bankChain.efficiency) + '' + Beautify(Math.max(0,bankChain.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankChain.cost) - cookieValue(Game.cookies))) + '')); - buildTable.append($('').css({'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'})); + buildTable.append($(' ').css({'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'})); $.each({'Pledging/Appeased' : 0, 'One Mind/Awoken' : 1, 'Displeased' : 2, 'Full Wrath/Angered' : 3}, function(k,v) { buildTable.append($('' + k + 'n/a' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + 'n/a' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); }); From 15e7aa2a504d4a2de815b8d31c3afb142a101014 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 10:46:47 -0400 Subject: [PATCH 089/180] Update fc_button.js --- fc_button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_button.js b/fc_button.js index 44877ef4..39f40820 100644 --- a/fc_button.js +++ b/fc_button.js @@ -481,7 +481,7 @@ function FCMenu() { buildTable.append($('Lucky Bankn/a' + Beautify(bankLucky.efficiency) + '' + Beautify(Math.max(0,bankLucky.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLucky.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Lucky Frenzy Bankn/a' + Beautify(bankLuckyFrenzy.efficiency) + '' + Beautify(Math.max(0,bankLuckyFrenzy.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLuckyFrenzy.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Chain Bankn/a' + Beautify(bankChain.efficiency) + '' + Beautify(Math.max(0,bankChain.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankChain.cost) - cookieValue(Game.cookies))) + '')); - buildTable.append($(' ').css({'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'})); + buildTable.append($(' ').css({'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'})); $.each({'Pledging/Appeased' : 0, 'One Mind/Awoken' : 1, 'Displeased' : 2, 'Full Wrath/Angered' : 3}, function(k,v) { buildTable.append($('' + k + 'n/a' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + 'n/a' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); }); From 86a19d09ef5996007399a90f44f6bd9e122587ab Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 10:48:10 -0400 Subject: [PATCH 090/180] Update fc_button.js --- fc_button.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fc_button.js b/fc_button.js index 39f40820..f92167ae 100644 --- a/fc_button.js +++ b/fc_button.js @@ -477,11 +477,11 @@ function FCMenu() { bankLucky = {'cost': luckyBank(), 'efficiency': cookieEfficiency(Game.cookies, luckyBank())}; bankLuckyFrenzy = {'cost': luckyFrenzyBank(), 'efficiency': cookieEfficiency(Game.cookies, luckyFrenzyBank())}; bankChain = {'cost': chainBank(), 'efficiency': cookieEfficiency(Game.cookies, chainBank())}; - buildTable.append($('').append($('').css({'colspan': 5, 'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'}))); + buildTable.append($('').append($('').attr('colspan', 5).css({'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'}))); buildTable.append($('Lucky Bankn/a' + Beautify(bankLucky.efficiency) + '' + Beautify(Math.max(0,bankLucky.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLucky.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Lucky Frenzy Bankn/a' + Beautify(bankLuckyFrenzy.efficiency) + '' + Beautify(Math.max(0,bankLuckyFrenzy.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLuckyFrenzy.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Chain Bankn/a' + Beautify(bankChain.efficiency) + '' + Beautify(Math.max(0,bankChain.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankChain.cost) - cookieValue(Game.cookies))) + '')); - buildTable.append($(' ').css({'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'})); + buildTable.append($(' ').css('border-top' : '2px dashed')); $.each({'Pledging/Appeased' : 0, 'One Mind/Awoken' : 1, 'Displeased' : 2, 'Full Wrath/Angered' : 3}, function(k,v) { buildTable.append($('' + k + 'n/a' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + 'n/a' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); }); From 0d9803b7d3eb38ba44d53cb52a416b941dcc1bab Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 10:48:39 -0400 Subject: [PATCH 091/180] Update fc_button.js --- fc_button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_button.js b/fc_button.js index f92167ae..7b138031 100644 --- a/fc_button.js +++ b/fc_button.js @@ -481,7 +481,7 @@ function FCMenu() { buildTable.append($('Lucky Bankn/a' + Beautify(bankLucky.efficiency) + '' + Beautify(Math.max(0,bankLucky.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLucky.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Lucky Frenzy Bankn/a' + Beautify(bankLuckyFrenzy.efficiency) + '' + Beautify(Math.max(0,bankLuckyFrenzy.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLuckyFrenzy.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Chain Bankn/a' + Beautify(bankChain.efficiency) + '' + Beautify(Math.max(0,bankChain.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankChain.cost) - cookieValue(Game.cookies))) + '')); - buildTable.append($(' ').css('border-top' : '2px dashed')); + buildTable.append($(' ').css('border-top', '2px dashed')); $.each({'Pledging/Appeased' : 0, 'One Mind/Awoken' : 1, 'Displeased' : 2, 'Full Wrath/Angered' : 3}, function(k,v) { buildTable.append($('' + k + 'n/a' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + 'n/a' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); }); From b2fdd5187860c57f34bedf042e6e0b87d1eb96a4 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 10:49:31 -0400 Subject: [PATCH 092/180] Update fc_button.js --- fc_button.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fc_button.js b/fc_button.js index 7b138031..2db467f5 100644 --- a/fc_button.js +++ b/fc_button.js @@ -477,10 +477,12 @@ function FCMenu() { bankLucky = {'cost': luckyBank(), 'efficiency': cookieEfficiency(Game.cookies, luckyBank())}; bankLuckyFrenzy = {'cost': luckyFrenzyBank(), 'efficiency': cookieEfficiency(Game.cookies, luckyFrenzyBank())}; bankChain = {'cost': chainBank(), 'efficiency': cookieEfficiency(Game.cookies, chainBank())}; - buildTable.append($('').append($('').attr('colspan', 5).css({'border-bottom-style' : 'dashed', 'border-bottom-width' : '2px'}))); + buildTable.append($(' ')); + buildTable.append($(' ').css('border-top', '2px dashed')); buildTable.append($('Lucky Bankn/a' + Beautify(bankLucky.efficiency) + '' + Beautify(Math.max(0,bankLucky.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLucky.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Lucky Frenzy Bankn/a' + Beautify(bankLuckyFrenzy.efficiency) + '' + Beautify(Math.max(0,bankLuckyFrenzy.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLuckyFrenzy.cost) - cookieValue(Game.cookies))) + '')); buildTable.append($('Chain Bankn/a' + Beautify(bankChain.efficiency) + '' + Beautify(Math.max(0,bankChain.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankChain.cost) - cookieValue(Game.cookies))) + '')); + buildTable.append($(' ')); buildTable.append($(' ').css('border-top', '2px dashed')); $.each({'Pledging/Appeased' : 0, 'One Mind/Awoken' : 1, 'Displeased' : 2, 'Full Wrath/Angered' : 3}, function(k,v) { buildTable.append($('' + k + 'n/a' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + 'n/a' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); From 0823d7700512eb49799cfbb9526524ae249df3e7 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 11:18:52 -0400 Subject: [PATCH 093/180] Update bank drawing and add markers for current --- fc_button.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/fc_button.js b/fc_button.js index 2db467f5..4cc00eb3 100644 --- a/fc_button.js +++ b/fc_button.js @@ -474,18 +474,21 @@ function FCMenu() { chainStr = (item.unlocked === 0) ? ' (C)' : ''; buildTable.append($('' + item.name + chainStr + '' + (Math.floor(rec.efficiencyScore * 10000) / 100).toString() + '%' + Beautify(rec.efficiency) + '' + Beautify(rec.cost) + '' + Beautify(rec.delta_cps) + '')); }); - bankLucky = {'cost': luckyBank(), 'efficiency': cookieEfficiency(Game.cookies, luckyBank())}; - bankLuckyFrenzy = {'cost': luckyFrenzyBank(), 'efficiency': cookieEfficiency(Game.cookies, luckyFrenzyBank())}; - bankChain = {'cost': chainBank(), 'efficiency': cookieEfficiency(Game.cookies, chainBank())}; + // Table Dividers buildTable.append($(' ')); buildTable.append($(' ').css('border-top', '2px dashed')); - buildTable.append($('Lucky Bankn/a' + Beautify(bankLucky.efficiency) + '' + Beautify(Math.max(0,bankLucky.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLucky.cost) - cookieValue(Game.cookies))) + '')); - buildTable.append($('Lucky Frenzy Bankn/a' + Beautify(bankLuckyFrenzy.efficiency) + '' + Beautify(Math.max(0,bankLuckyFrenzy.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankLuckyFrenzy.cost) - cookieValue(Game.cookies))) + '')); - buildTable.append($('Chain Bankn/a' + Beautify(bankChain.efficiency) + '' + Beautify(Math.max(0,bankChain.cost - Game.cookies)) + '' + Beautify(gcPs(cookieValue(bankChain.cost) - cookieValue(Game.cookies))) + '')); + + banks = [{name: 'Lucky Bank', cost: luckyBank(), efficiency: cookieEfficiency(Game.cookies, luckyBank())}, + {name: 'Lucky Frenzy Bank', cost: luckyFrenzyBank(), efficiency: cookieEfficiency(Game.cookies, luckyFrenzyBank())}, + {name: 'Chain Bank', cost: chainBank(), efficiency: cookieEfficiency(Game.cookies, chainBank())}]; + + banks.forEach(function(bank) { + buildTable.append($('' + bank.name + (bank.efficiency === 0 ? ' (*)' : '') + '' + Beautify(bank.efficiency) + '' + Beautify(Math.max(0, bank.cost - Game.cookies)) + '')); + }); buildTable.append($(' ')); buildTable.append($(' ').css('border-top', '2px dashed')); $.each({'Pledging/Appeased' : 0, 'One Mind/Awoken' : 1, 'Displeased' : 2, 'Full Wrath/Angered' : 3}, function(k,v) { - buildTable.append($('' + k + 'n/a' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + 'n/a' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); + buildTable.append($('' + k + (Game.elderWrath === v ? ' (*)' : '') + 'n/a' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + 'n/a' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); }); subsection.append($('
').addClass('listing').append(buildTable)); menu.append(subsection); From 447d3401ede40e362bcb803c808d887f63998276 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 11:24:38 -0400 Subject: [PATCH 094/180] Update fc_button.js --- fc_button.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fc_button.js b/fc_button.js index 4cc00eb3..6ae90dea 100644 --- a/fc_button.js +++ b/fc_button.js @@ -483,12 +483,13 @@ function FCMenu() { {name: 'Chain Bank', cost: chainBank(), efficiency: cookieEfficiency(Game.cookies, chainBank())}]; banks.forEach(function(bank) { - buildTable.append($('' + bank.name + (bank.efficiency === 0 ? ' (*)' : '') + '' + Beautify(bank.efficiency) + '' + Beautify(Math.max(0, bank.cost - Game.cookies)) + '')); + var deltaCps = effectiveCps(bank.cost) - effectiveCps(); + buildTable.append($('' + bank.name + (bank.deltaCps === 0 ? ' (*)' : '') + '' + Beautify(bank.efficiency) + '' + Beautify(Math.max(0, bank.cost - Game.cookies)) + '' + Beautify(deltaCps) + '')); }); buildTable.append($(' ')); buildTable.append($(' ').css('border-top', '2px dashed')); $.each({'Pledging/Appeased' : 0, 'One Mind/Awoken' : 1, 'Displeased' : 2, 'Full Wrath/Angered' : 3}, function(k,v) { - buildTable.append($('' + k + (Game.elderWrath === v ? ' (*)' : '') + 'n/a' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + 'n/a' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); + buildTable.append($('' + k + (Game.elderWrath === v ? ' (*)' : '') + '' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + '' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); }); subsection.append($('
').addClass('listing').append(buildTable)); menu.append(subsection); From 5e1c8d3261c198f4c668093dfb12dd91b1dce1ef Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 12:11:09 -0400 Subject: [PATCH 095/180] Fix Chocolate Recoup to be more accurate --- fc_button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_button.js b/fc_button.js index 6ae90dea..81ac8499 100644 --- a/fc_button.js +++ b/fc_button.js @@ -340,7 +340,7 @@ function FCMenu() { isChained = !(recommendation.id == chainRecommendation.id && recommendation.type == chainRecommendation.type), bankLevel = bestBank(chainRecommendation.efficiency), actualCps = Game.cookiesPs + Game.mouseCps() * FrozenCookies.cookieClickSpeed, - chocolateRecoup = (recommendation.type == 'upgrade' ? recommendation.cost : recommendation.cost * 0.425 * 0.05) / recommendation.delta_cps; + chocolateRecoup = recommendation.type == 'upgrade' ? recommendation.cost / (recommendation.delta_cps * 21) : (recommendation.cost * 17) / (recommendation.delta_cps * 480); subsection.append($('
').addClass('listing').html('Next Purchase: ' + recommendation.purchase.name)); if (isChained) { From 036667a54bb0551a5f77f3eb3ae8703eb0b5fb33 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 12:20:26 -0400 Subject: [PATCH 096/180] Simplify Chocolate Recoup, Change Separator Color --- fc_button.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fc_button.js b/fc_button.js index 81ac8499..d6ecd0b3 100644 --- a/fc_button.js +++ b/fc_button.js @@ -340,7 +340,7 @@ function FCMenu() { isChained = !(recommendation.id == chainRecommendation.id && recommendation.type == chainRecommendation.type), bankLevel = bestBank(chainRecommendation.efficiency), actualCps = Game.cookiesPs + Game.mouseCps() * FrozenCookies.cookieClickSpeed, - chocolateRecoup = recommendation.type == 'upgrade' ? recommendation.cost / (recommendation.delta_cps * 21) : (recommendation.cost * 17) / (recommendation.delta_cps * 480); + chocolateRecoup = (recommendation.type == 'upgrade' ? recommendation.cost : recommendation.cost * 0.425) / (recommendation.delta_cps * 21); subsection.append($('
').addClass('listing').html('Next Purchase: ' + recommendation.purchase.name)); if (isChained) { @@ -476,7 +476,7 @@ function FCMenu() { }); // Table Dividers buildTable.append($(' ')); - buildTable.append($(' ').css('border-top', '2px dashed')); + buildTable.append($(' ').css('border-top', '2px dashed #999')); banks = [{name: 'Lucky Bank', cost: luckyBank(), efficiency: cookieEfficiency(Game.cookies, luckyBank())}, {name: 'Lucky Frenzy Bank', cost: luckyFrenzyBank(), efficiency: cookieEfficiency(Game.cookies, luckyFrenzyBank())}, @@ -487,7 +487,7 @@ function FCMenu() { buildTable.append($('' + bank.name + (bank.deltaCps === 0 ? ' (*)' : '') + '' + Beautify(bank.efficiency) + '' + Beautify(Math.max(0, bank.cost - Game.cookies)) + '' + Beautify(deltaCps) + '')); }); buildTable.append($(' ')); - buildTable.append($(' ').css('border-top', '2px dashed')); + buildTable.append($(' ').css('border-top', '2px dashed #999')); $.each({'Pledging/Appeased' : 0, 'One Mind/Awoken' : 1, 'Displeased' : 2, 'Full Wrath/Angered' : 3}, function(k,v) { buildTable.append($('' + k + (Game.elderWrath === v ? ' (*)' : '') + '' + Beautify(effectiveCps(Game.cookies, v) / baseCps()) + '' + Beautify(effectiveCps(Game.cookies, v) - effectiveCps()) + '')); }); From 436ec0d8a7e2f4023def3063d5264e8ae777755f Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 13:17:46 -0400 Subject: [PATCH 097/180] Add helper methods for behind the scenes --- fc_main.js | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/fc_main.js b/fc_main.js index 628678d7..d4d4b639 100644 --- a/fc_main.js +++ b/fc_main.js @@ -623,22 +623,20 @@ function wrinklerValue() { return Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0); } -/* Old way, less efficient -function calculateChainValue(bankAmount, cps) { - var payoutTotal = 0; - var payoutNext = '6'; - var step = 1; - var remainingProbability = 1; - while (payoutNext < bankAmount * 0.25 || payoutNext <= cps * 60 * 60 * 6) { - step += 1; - payoutTotal += remainingProbability * 0.1 * payoutNext; - remainingProbability -= remainingProbability * 0.1 - payoutNext += '6'; - } - payoutTotal += remainingProbability * payoutNext.substr(0,payoutNext.length-1); - return payoutTotal; +function canAfford(building, amount) { + var cost = cumulativeBuildingCost(building.basePrice, building.amount, amount); + var availableCookies = Game.cookies + wrinklerValue() + Game.ObjectsById.reduce(function(s,b) {return s + (b.name == building.name ? 0 : cumulativeBuildingCost(b.basePrice, 1, b.amount + 1) / 2);}, 0); + availableCookies *= Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? 1.05 : 1; + return Math.max(0, cost - availableCookies); +} + +function earnedRemaining(total) { + return Math.max(0, total - (Game.cookiesEarned + wrinklerValue() + chocolateValue())); +} + +function estimatedTimeRemaining(cookies) { + return timeDisplay(cookies / effectiveCps()); } -*/ function luckyBank() { return baseCps() * 60 * 20 * 10; From 40b2136d68eae89f7a77589d56e737fe755c740d Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 28 May 2014 13:20:01 -0400 Subject: [PATCH 098/180] Rename Method --- fc_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fc_main.js b/fc_main.js index d4d4b639..1505e0d1 100644 --- a/fc_main.js +++ b/fc_main.js @@ -623,7 +623,7 @@ function wrinklerValue() { return Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0); } -function canAfford(building, amount) { +function buildingRemaining(building, amount) { var cost = cumulativeBuildingCost(building.basePrice, building.amount, amount); var availableCookies = Game.cookies + wrinklerValue() + Game.ObjectsById.reduce(function(s,b) {return s + (b.name == building.name ? 0 : cumulativeBuildingCost(b.basePrice, 1, b.amount + 1) / 2);}, 0); availableCookies *= Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? 1.05 : 1; From 831788c131c76ba87c15aaf1687161a1b4f78d43 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Fri, 6 Jun 2014 11:32:04 -0400 Subject: [PATCH 099/180] Attempt to fix autobuy delay forever and ever --- fc_main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fc_main.js b/fc_main.js index 1505e0d1..db2fa857 100644 --- a/fc_main.js +++ b/fc_main.js @@ -1546,6 +1546,8 @@ function autoCookie() { } } + var itemBought = false; + if (FrozenCookies.autoBuy && (Game.cookies >= delay + recommendation.cost) && (FrozenCookies.pastemode || isFinite(nextChainedPurchase().efficiency))) { // if (FrozenCookies.autoBuy && (Game.cookies >= delay + recommendation.cost)) { recommendation.time = Date.now() - Game.startDate; @@ -1568,7 +1570,7 @@ function autoCookie() { } FrozenCookies.recalculateCaches = true; FrozenCookies.processing = false; - return FrozenCookies.frequency ? autoCookie() : null; + itemBought = true; } // This apparently *has* to stay here, or else fast purchases will multi-click it. @@ -1611,7 +1613,7 @@ function autoCookie() { } FrozenCookies.processing = false; if (FrozenCookies.frequency) { - FrozenCookies.cookieBot = setTimeout(autoCookie, FrozenCookies.frequency); + FrozenCookies.cookieBot = setTimeout(autoCookie, itemBought ? 0 : FrozenCookies.frequency); } } } From 47997ba19e7320477eadc84244c0173709a42659 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Fri, 6 Jun 2014 11:36:17 -0400 Subject: [PATCH 100/180] Version tick --- frozen_cookies.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen_cookies.js b/frozen_cookies.js index b2fdc649..c46c13e7 100644 --- a/frozen_cookies.js +++ b/frozen_cookies.js @@ -6,7 +6,7 @@ var scriptElement = document.getElementById( 'frozenCookieScript' ), FrozenCookies = { 'baseUrl': baseUrl, 'branch' : 'G', - 'version': 1.3 + 'version': 1.4 }; // Load external libraries From ef13c25636cb76d03dd3a2a8578d2d33ade28b7f Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 11 Jun 2014 08:11:26 -0400 Subject: [PATCH 101/180] Comments --- fc_main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fc_main.js b/fc_main.js index db2fa857..4ae4ea9b 100644 --- a/fc_main.js +++ b/fc_main.js @@ -340,6 +340,9 @@ function getBuildingSpread () { // Press 'a' to toggle autobuy. // Press 'b' to pop up a copyable window with building spread. // Press 'c' to toggle auto-GC +// Press 'e' to pop up a copyable window with your export string +// Press 'r' to pop up the reset window +// Press 's' to do a manual save // Press 'w' to display a wrinkler-info window document.addEventListener('keydown', function(event) { if (!Game.promptOn) { From 6b9de03681254d1dcf009047bda4066c2da18ad6 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 23 Dec 2015 15:28:03 -0500 Subject: [PATCH 102/180] Add v1.9 branching folders/files --- 1.9/fc_main.js | 1708 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1708 insertions(+) create mode 100644 1.9/fc_main.js diff --git a/1.9/fc_main.js b/1.9/fc_main.js new file mode 100644 index 00000000..a2fe87ce --- /dev/null +++ b/1.9/fc_main.js @@ -0,0 +1,1708 @@ +// Add polyfills: + +(function (global) { + var global_isFinite = global.isFinite; + Object.defineProperty(Number, 'isFinite', { + value: function isFinite(value) { + return typeof value === 'number' && global_isFinite(value); + }, + configurable: true, + enumerable: false, + writable: true + }); +})(this); + +function setOverrides() { + + // Set all cycleable preferences + _.keys(FrozenCookies.preferenceValues).forEach(function(preference) { + FrozenCookies[preference] = preferenceParse(preference, FrozenCookies.preferenceValues[preference].default); + }); + + logEvent("Load", "Initial Load of Frozen Cookies v " + FrozenCookies.branch + "." + FrozenCookies.version + ". (You should only ever see this once.)"); + + FrozenCookies.frequency = 100; + FrozenCookies.efficiencyWeight = 1.0; + + // Separate because these are user-input values + FrozenCookies.cookieClickSpeed = preferenceParse('cookieClickSpeed',0); + FrozenCookies.frenzyClickSpeed = preferenceParse('frenzyClickSpeed',0); + + // Becomes 0 almost immediately after user input, so default to 0 + FrozenCookies.timeTravelAmount = 0; + + // Force redraw every 10 purchases + FrozenCookies.autobuyCount = 0; + + // Get historical data + FrozenCookies.frenzyTimes = JSON.parse(localStorage.getItem('frenzyTimes')) || {}; +// FrozenCookies.non_gc_time = Number(localStorage.getItem('nonFrenzyTime')); +// FrozenCookies.gc_time = Number(localStorage.getItem('frenzyTime')); + FrozenCookies.lastHCAmount = Number(localStorage.getItem('lastHCAmount')); + FrozenCookies.lastHCTime = Number(localStorage.getItem('lastHCTime')); + FrozenCookies.prevLastHCTime = Number(localStorage.getItem('prevLastHCTime')); + FrozenCookies.maxHCPercent = Number(localStorage.getItem('maxHCPercent')); + + // Set default values for calculations + FrozenCookies.hc_gain = 0; + FrozenCookies.hc_gain_time = Date.now(); + FrozenCookies.last_gc_state = (Game.frenzy ? Game.frenzyPower : 1) * (Game.clickFrenzy ? 777 : 1); + FrozenCookies.last_gc_time = Date.now(); + FrozenCookies.lastCPS = Game.cookiesPs; + FrozenCookies.lastCookieCPS = 0; + FrozenCookies.lastUpgradeCount = 0; + FrozenCookies.currentBank = {'cost': 0, 'efficiency' : 0}; + FrozenCookies.targetBank = {'cost': 0, 'efficiency' : 0}; + FrozenCookies.disabledPopups = true; + FrozenCookies.trackedStats = []; + FrozenCookies.lastGraphDraw = 0; + + // Allow autoCookie to run + FrozenCookies.processing = false; + FrozenCookies.priceReductionTest = false; + + FrozenCookies.cookieBot = 0; + FrozenCookies.autoclickBot = 0; + FrozenCookies.autoFrenzyBot = 0; + FrozenCookies.frenzyClickBot = 0; + + // Smart tracking details + FrozenCookies.smartTrackingBot = 0; + FrozenCookies.minDelay = 1000 * 10; // 10s minimum reporting between purchases with "smart tracking" on + FrozenCookies.delayPurchaseCount = 0; + + // Caching + FrozenCookies.recalculateCaches = true; + FrozenCookies.caches = {}; + FrozenCookies.caches.nextPurchase = {}; + FrozenCookies.caches.recommendationList = []; + FrozenCookies.caches.buildings = []; + FrozenCookies.caches.upgrades = []; + + if (!blacklist[FrozenCookies.blacklist]) { + FrozenCookies.blacklist = 'none'; + } + Beautify = fcBeautify; + Game.sayTime = function(time,detail) {return timeDisplay(time/Game.fps);} + Game.oldReset = Game.Reset; + Game.oldWriteSave = Game.WriteSave; + Game.oldLoadSave = Game.LoadSave; + Game.Reset = fcReset; + Game.WriteSave = fcWriteSave; +// if (FrozenCookies.saveWrinklers && localStorage.wrinklers) { +// Game.wrinklers = JSON.parse(localStorage.wrinklers); +// } + Game.Win = fcWin; + Game.oldBackground = Game.DrawBackground; + Game.DrawBackground = function() {Game.oldBackground(); updateTimers();} + nextPurchase(true); + // Remove the following when turning on tooltop code + Game.RefreshStore(); + Game.RebuildUpgrades(); + beautifyUpgradesAndAchievements(); + // Replace Game.Popup references with event logging + FrozenCookies.calculatedCpsByType = {}; + eval('Game.goldenCookie.click = ' + Game.goldenCookie.click.toString().replace(/Game\.Popup\((.+)\)\;/g, 'logEvent("GC", $1, true);')); + eval('Game.UpdateWrinklers = ' + Game.UpdateWrinklers.toString().replace(/Game\.Popup\((.+)\)\;/g, 'logEvent("Wrinkler", $1, true);')); + eval('FrozenCookies.safeGainsCalc = ' + Game.CalculateGains.toString().replace(/eggMult\+=\(1.+/, 'eggMult++; // CENTURY EGGS SUCK').replace(/Game\.cookiesPs/g, 'FrozenCookies.calculatedCps').replace(/Game\.globalCpsMult/g, 'mult').replace(/Game\.milkProgress/g, 'FrozenCookies.milkProgress')); + + // Give free achievements! + if(!Game.HasAchiev('Third-party')) { + Game.Win('Third-party'); + } +} + +function preferenceParse(setting, defaultVal) { + var value = localStorage.getItem(setting); + if (typeof(value) == 'undefined' || value == null || isNaN(Number(value))) { + value = defaultVal; + localStorage.setItem(setting, value); + } + return Number(value); +} + +// var full_history = []; // This may be a super leaky thing + +function formatEveryThirdPower(notations) { + return function (value) { + var base = 0, + notationValue = ''; + if (value >= 1000000 && Number.isFinite(value)) { + value /= 1000; + while(Math.round(value) >= 1000){ + value /= 1000; + base++; + } + if (base >= notations.length) { + return 'A very large amount'; + } else { + notationValue = notations[base]; + } + } + return ( Math.round(value * 1000) / 1000.0 ) + notationValue; + }; +} + +function scientificNotation(value) { + if (value === 0 || !Number.isFinite(value) || (Math.abs(value) > 1 && Math.abs(value) < 100)) { + return rawFormatter(value); + } + var sign = value > 0 ? '' : '-'; + value = Math.abs(value); + var exp = Math.floor(Math.log(value)/Math.LN10); + var num = Math.round((value/Math.pow(10, exp)) * 100) / 100; + var output = num.toString(); + if (num === Math.round(num)) { + output += '.00'; + } else if (num * 10 === Math.round(num * 10)) { + output += '0'; + } + return sign + output + '*10^' + exp; +} + +function rawFormatter(value) { + return Math.round(value * 1000) / 1000; +} + +var numberFormatters = [ + rawFormatter, + formatEveryThirdPower([ + '', + ' million', + ' billion', + ' trillion', + ' quadrillion', + ' quintillion', + ' sextillion', + ' septillion', + ' octillion', + ' nonillion', + ' decillion', + ' undecillion', + ' duodecillion', + ' tredecillion', + ' quattuordecillion', + ' quindecillion', + ' sedecillion', + ' septendecillion', + ' octodecillion', + ' novemdecillion', + ' vigintillion', + ' unvigintillion', + ' duovigintillion', + ' trevigintillion', + ' quattuorvigintillion', + ' quinvigintillion', + ' sevigintillion', + ' septenvigintillion', + ' octovigintillion', + ' novemvigintillion' + ]), + + formatEveryThirdPower([ + '', + ' M', + ' B', + ' T', + ' Qa', + ' Qi', + ' Sx', + ' Sp', + ' Oc', + ' No', + ' Dc', + ' UDc', + ' DDc', + ' TDc', + ' QaDc', + ' QiDc', + ' SeDc', + ' SpDc', + ' ODc', + ' NDc', + ' Vi', + ' UVi', + ' DVi', + ' TVi', + ' QaVi', + ' QiVi', + ' SeVi', + ' SpVi', + ' OVi', + ' NVi' + ]), + + formatEveryThirdPower([ + '', + ' M', + ' G', + ' T', + ' P', + ' E', + ' Z', + ' Y' + ]), + scientificNotation +]; + +function fcBeautify (value) { + var negative = (value < 0); + value = Math.abs(value); + var formatter = numberFormatters[FrozenCookies.numberDisplay]; + var output = formatter(value).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); + return negative ? '-' + output : output; +} + +// Runs numbers in upgrades and achievements through our beautify function +function beautifyUpgradesAndAchievements() { + function beautifyFn(str) { + return Beautify(parseInt(str.replace(/,/, ''), 10)); + } + + var numre = /\d\d?\d?(?:,\d\d\d)*/; + Game.AchievementsById.forEach(function (ach) { + ach.desc = ach.desc.replace(numre, beautifyFn); + }); + + // These might not have any numbers in them, but just in case... + Game.UpgradesById.forEach(function (upg) { + upg.desc = upg.desc.replace(numre, beautifyFn); + }); +} + +function timeDisplay(seconds) { + if (seconds === '---' || seconds === 0) { + return 'Done!'; + } else if (seconds == Number.POSITIVE_INFINITY) { + return 'Never!' + } + seconds = Math.floor(seconds); + var days, hours, minutes; + days = Math.floor(seconds / (24 * 60 * 60)); + days = (days > 0) ? Beautify(days) + 'd ' : ''; + seconds %= (24 * 60 * 60); + hours = Math.floor(seconds / (60 * 60)); + hours = (hours > 0) ? hours + 'h ' : ''; + seconds %= (60 * 60); + minutes = Math.floor(seconds / 60); + minutes = (minutes > 0) ? minutes + 'm ' : ''; + seconds %= 60; + seconds = (seconds > 0) ? seconds + 's' : ''; + return (days + hours + minutes + seconds).trim(); +} + +function fcReset() { + Game.CollectWrinklers(); + if (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')) { + Game.ObjectsById.forEach(function(b){b.sell(-1);}); + Game.Upgrades['Chocolate egg'].buy(); + } + Game.oldReset(); + FrozenCookies.frenzyTimes = {}; + FrozenCookies.last_gc_state = (Game.frenzy ? Game.frenzyPower : 1) * (Game.clickFrenzy ? 777 : 1); + FrozenCookies.last_gc_time = Date.now(); + FrozenCookies.lastHCAmount = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0)); + FrozenCookies.lastHCTime = Date.now(); + FrozenCookies.maxHCPercent = 0; + FrozenCookies.prevLastHCTime = Date.now(); + FrozenCookies.lastCps = 0; + FrozenCookies.trackedStats = []; + updateLocalStorage(); + recommendationList(true); +} + +function fcWriteSave(exporting) { +// if (FrozenCookies.saveWrinklers && Game.wrinklers) { +// localStorage.wrinklers = JSON.stringify(Game.wrinklers); +// } + return Game.oldWriteSave(exporting); +} + +function updateLocalStorage() { + _.keys(FrozenCookies.preferenceValues).forEach(function(preference) { + localStorage[preference] = FrozenCookies[preference]; + }); + + localStorage.frenzyClickSpeed = FrozenCookies.frenzyClickSpeed; + localStorage.cookieClickSpeed = FrozenCookies.cookieClickSpeed; + localStorage.frenzyTimes = JSON.stringify(FrozenCookies.frenzyTimes); +// localStorage.nonFrenzyTime = FrozenCookies.non_gc_time; +// localStorage.frenzyTime = FrozenCookies.gc_time; + localStorage.lastHCAmount = FrozenCookies.lastHCAmount; + localStorage.maxHCPercent = FrozenCookies.maxHCPercent; + localStorage.lastHCTime = FrozenCookies.lastHCTime; + localStorage.prevLastHCTime = FrozenCookies.prevLastHCTime; +} + +function divCps(value, cps) { + var result = 0; + if (value) { + if (cps) { + result = value / cps; + } else { + result = Number.POSITIVE_INFINITY; + } + } + return result; +} + +function nextHC(tg) { + var ascendNowToOwn = Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0)); + var toGo = Game.HowManyCookiesReset(ascendNowToOwn + 1) - (Game.cookiesEarned + Game.cookiesReset); + return tg ? toGo : timeDisplay(divCps(toGo, Game.cookiesPs)); +} + +function copyToClipboard (text) { + Game.promptOn = 1; + window.prompt ("Copy to clipboard: Ctrl+C, Enter", text); + Game.promptOn = 0; +} + +function getBuildingSpread () { + return Game.ObjectsById.map(function(a){return a.amount;}).join('/') +} + +// Press 'a' to toggle autobuy. +// Press 'b' to pop up a copyable window with building spread. +// Press 'c' to toggle auto-GC +// Press 'e' to pop up a copyable window with your export string +// Press 'r' to pop up the reset window +// Press 's' to do a manual save +// Press 'w' to display a wrinkler-info window +document.addEventListener('keydown', function(event) { + if (!Game.promptOn) { + if(event.keyCode == 65) { + Game.Toggle('autoBuy','autobuyButton','Autobuy OFF','Autobuy ON'); + toggleFrozen('autoBuy'); + } + if(event.keyCode == 66) { + copyToClipboard(getBuildingSpread()); + } + if(event.keyCode == 67) { + Game.Toggle('autoGC','autogcButton','Autoclick GC OFF','Autoclick GC ON'); + toggleFrozen('autoGC'); + } + if(event.keyCode == 69) { + copyToClipboard(Game.WriteSave(true)); + } + if (event.keyCode == 82) { + Game.Reset(); + } + if (event.keyCode == 83) { + Game.WriteSave(); + } + if(event.keyCode == 87) { + Game.Notify('Wrinkler Info', 'Popping all wrinklers will give you ' + Beautify(Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);},0)) + ' cookies. ', [19,8],7); + } + } +}); + +function writeFCButton(setting) { + var current = FrozenCookies[setting]; +} + +function getSpeed(current) { + var newSpeed = prompt('How many times per second do you want to click? (Current maximum is 250 clicks per second)',current); + if (typeof(newSpeed) == 'undefined' || newSpeed == null || isNaN(Number(newSpeed)) || Number(newSpeed) < 0 || Number(newSpeed) > 250) { + newSpeed = current; + } + return Number(newSpeed); +} + +function updateSpeed(base) { + var newSpeed = getSpeed(FrozenCookies[base]); + if (newSpeed != FrozenCookies[base]) { + FrozenCookies[base] = newSpeed; + updateLocalStorage(); + FCStart(); + } +} + +function updateTimeTravelAmount() { + var newAmount = prompt("Warning: Time travel is highly unstable, and large values are highly likely to either cause long delays or crash the game. Be careful!\nHow much do you want to time travel by? This will happen instantly."); + if (typeof(newAmount) === 'undefined' || newAmount === null || isNaN(Number(newAmount)) || Number(newAmount) < 0) { + newAmount = 0; + } + FrozenCookies.timeTravelAmount = newAmount; +} + +function cyclePreference(preferenceName) { + var preference = FrozenCookies.preferenceValues[preferenceName]; + if (preference) { + var display = preference.display; + var current = FrozenCookies[preferenceName]; + var preferenceButton = $('#' + preferenceName + 'Button'); + if (display && display.length > 0 && preferenceButton && preferenceButton.length > 0) { + var newValue = (current + 1) % display.length; + preferenceButton[0].innerText = display[newValue]; + FrozenCookies[preferenceName] = newValue; + updateLocalStorage(); + FrozenCookies.recalculateCaches = true; + Game.RefreshStore(); + Game.RebuildUpgrades(); + FCStart(); + } + } +} + +function toggleFrozen(setting) { + if (!Number(localStorage.getItem(setting))) { + localStorage.setItem(setting,1); + FrozenCookies[setting] = 1; + } else { + localStorage.setItem(setting,0); + FrozenCookies[setting] = 0; + } + FCStart(); +} + +function autoBlacklistOff() { + switch (FrozenCookies.blacklist) { + case 1: + FrozenCookies.blacklist = (Game.cookiesEarned >= 1000000) ? 0 : 1; + break; + case 2: + FrozenCookies.blacklist = (Game.cookiesEarned >= 1000000000) ? 0 : 2; + break; + case 3: + FrozenCookies.blacklist = haveAll('halloween') ? 0 : 3; + break; + } +} + +function getProbabilityList(listType) { + return cumulativeProbabilityList[listType][getProbabilityModifiers(listType)]; +} + +function getProbabilityModifiers(listType) { + var result; + switch (listType) { + case "golden": + result = (Game.Has('Lucky day') ? 0.5 : 1) * (Game.Has('Serendipity') ? 0.5 : 1) * (Game.Has('Golden goose egg') ? 0.95 : 1); + break; + case "reindeer": + result = Game.Has('Reindeer baking grounds') ? 0.5 : 1; + break; + } + return result; +} + +function cumulativeProbability(listType, start, stop) { + return 1 - ((1 - getProbabilityList(listType)[stop]) / (1 - getProbabilityList(listType)[start])); +} + +function probabilitySpan(listType, start, endProbability) { + var startProbability = getProbabilityList(listType)[start]; + return _.sortedIndex(getProbabilityList(listType), (startProbability + endProbability - startProbability * endProbability)); +} + +function baseCps() { + var frenzyMod = (Game.frenzy > 0) ? Game.frenzyPower : 1; + return Game.cookiesPs / frenzyMod; +} + +function baseClickingCps(clickSpeed) { + var clickFrenzyMod = (Game.clickFrenzy > 0) ? 777 : 1; + var frenzyMod = (Game.frenzy > 0) ? Game.frenzyPower : 1; + var cpc = Game.mouseCps() / (clickFrenzyMod * frenzyMod); + return clickSpeed * cpc; +} + +function effectiveCps(delay, wrathValue, wrinklerCount) { + wrathValue = wrathValue != null ? wrathValue : Game.elderWrath; + wrinklerCount = wrinklerCount != null ? wrinklerCount : (wrathValue ? 10 : 0); + var wrinkler = wrinklerMod(wrinklerCount); + if (delay == null) { + delay = delayAmount(); + } + return baseCps() * wrinkler + gcPs(cookieValue(delay, wrathValue, wrinklerCount)) + baseClickingCps(FrozenCookies.cookieClickSpeed * FrozenCookies.autoClick) + reindeerCps(wrathValue); +} + +function frenzyProbability(wrathValue) { + wrathValue = wrathValue != null ? wrathValue : Game.elderWrath; + return cookieInfo.frenzy.odds[wrathValue];// + cookieInfo.frenzyRuin.odds[wrathValue] + cookieInfo.frenzyLucky.odds[wrathValue] + cookieInfo.frenzyClick.odds[wrathValue]; +} + +function clotProbability(wrathValue) { + wrathValue = wrathValue != null ? wrathValue : Game.elderWrath; + return cookieInfo.clot.odds[wrathValue];// + cookieInfo.clotRuin.odds[wrathValue] + cookieInfo.clotLucky.odds[wrathValue] + cookieInfo.clotClick.odds[wrathValue]; +} + +function bloodProbability(wrathValue) { + wrathValue = wrathValue != null ? wrathValue : Game.elderWrath; + return cookieInfo.blood.odds[wrathValue]; +} + +function cookieValue(bankAmount, wrathValue, wrinklerCount) { + var cps = baseCps(); + var clickCps = baseClickingCps(FrozenCookies.autoClick * FrozenCookies.cookieClickSpeed); + var frenzyCps = FrozenCookies.autoFrenzy ? baseClickingCps(FrozenCookies.autoFrenzy * FrozenCookies.frenzyClickSpeed) : clickCps; + var luckyMod = Game.Has('Get lucky') ? 2 : 1; + wrathValue = wrathValue != null ? wrathValue : Game.elderWrath; + wrinklerCount = wrinklerCount != null ? wrinklerCount : (wrathValue ? 10 : 0); + var wrinkler = wrinklerMod(wrinklerCount); + + var value = 0; + // Clot + value -= cookieInfo.clot.odds[wrathValue] * (wrinkler * cps + clickCps) * luckyMod * 66 * 0.5; + // Frenzy + value += cookieInfo.frenzy.odds[wrathValue] * (wrinkler * cps + clickCps) * luckyMod * 77 * 6; + // Blood + value += cookieInfo.blood.odds[wrathValue] * (wrinkler * cps + clickCps) * luckyMod * 6 * 665; + // Chain + value += cookieInfo.chain.odds[wrathValue] * calculateChainValue(bankAmount, cps, (7 - (wrathValue / 3))); + // Ruin + value -= cookieInfo.ruin.odds[wrathValue] * (Math.min(bankAmount * 0.05, cps * 60 * 10) + 13); + // Frenzy + Ruin + value -= cookieInfo.frenzyRuin.odds[wrathValue] * (Math.min(bankAmount * 0.05, cps * 60 * 10 * 7) + 13); + // Clot + Ruin + value -= cookieInfo.clotRuin.odds[wrathValue] * (Math.min(bankAmount * 0.05, cps * 60 * 10 * 0.5) + 13); + // Lucky + value += cookieInfo.lucky.odds[wrathValue] * (Math.min(bankAmount * 0.1, cps * 60 * 20) + 13); + // Frenzy + Lucky + value += cookieInfo.frenzyLucky.odds[wrathValue] * (Math.min(bankAmount * 0.1, cps * 60 * 20 * 7) + 13); + // Clot + Lucky + value += cookieInfo.clotLucky.odds[wrathValue] * (Math.min(bankAmount * 0.1, cps * 60 * 20 * 0.5) + 13); + // Click + value += cookieInfo.click.odds[wrathValue] * frenzyCps * luckyMod * 13 * 777; + // Frenzy + Click + value += cookieInfo.frenzyClick.odds[wrathValue] * frenzyCps * luckyMod * 13 * 777 * 7; + // Clot + Click + value += cookieInfo.clotClick.odds[wrathValue] * frenzyCps * luckyMod * 13 * 777 * 0.5; + // Blah + value += 0; + return value; +} + +function cookieStats(bankAmount, wrathValue, wrinklerCount) { + var cps = baseCps(); + var clickCps = baseClickingCps(FrozenCookies.autoClick * FrozenCookies.cookieClickSpeed); + var frenzyCps = FrozenCookies.autoFrenzy ? baseClickingCps(FrozenCookies.autoFrenzy * FrozenCookies.frenzyClickSpeed) : clickCps; + var luckyMod = Game.Has('Get lucky') ? 2 : 1; + var clickFrenzyMod = (Game.clickFrenzy > 0) ? 777 : 1 + wrathValue = wrathValue != null ? wrathValue : Game.elderWrath; + wrinklerCount = wrinklerCount != null ? wrinklerCount : (wrathValue ? 10 : 0); + var wrinkler = wrinklerMod(wrinklerCount); + + var result = {}; + // Clot + result.clot = -1 * cookieInfo.clot.odds[wrathValue] * (wrinkler * cps + clickCps) * luckyMod * 66 * 0.5; + // Frenzy + result.frenzy = cookieInfo.frenzy.odds[wrathValue] * (wrinkler * cps + clickCps) * luckyMod * 77 * 7; + // Blood + result.blood = cookieInfo.blood.odds[wrathValue] * (wrinkler * cps + clickCps) * luckyMod * 666 * 6; + // Chain + result.chain = cookieInfo.chain.odds[wrathValue] * calculateChainValue(bankAmount, cps, (7 - (wrathValue / 3))); + // Ruin + result.ruin = -1 * cookieInfo.ruin.odds[wrathValue] * (Math.min(bankAmount * 0.05, cps * 60 * 10) + 13); + // Frenzy + Ruin + result.frenzyRuin = -1 * cookieInfo.frenzyRuin.odds[wrathValue] * (Math.min(bankAmount * 0.05, cps * 60 * 10 * 7) + 13); + // Clot + Ruin + result.clotRuin = -1 * cookieInfo.clotRuin.odds[wrathValue] * (Math.min(bankAmount * 0.05, cps * 60 * 10 * 0.5) + 13); + // Lucky + result.lucky = cookieInfo.lucky.odds[wrathValue] * (Math.min(bankAmount * 0.1, cps * 60 * 20) + 13); + // Frenzy + Lucky + result.frenzyLucky = cookieInfo.frenzyLucky.odds[wrathValue] * (Math.min(bankAmount * 0.1, cps * 60 * 20 * 7) + 13); + // Clot + Lucky + result.clotLucky = cookieInfo.clotLucky.odds[wrathValue] * (Math.min(bankAmount * 0.1, cps * 60 * 20 * 0.5) + 13); + // Click + result.click = cookieInfo.click.odds[wrathValue] * frenzyCps * luckyMod * 13 * 777; + // Frenzy + Click + result.frenzyClick = cookieInfo.frenzyClick.odds[wrathValue] * frenzyCps * luckyMod * 13 * 777 * 7; + // Clot + Click + result.clotClick = cookieInfo.clotClick.odds[wrathValue] * frenzyCps * luckyMod * 13 * 777 * 0.5; + // Blah + result.blah = 0; + return result; +} + +function reindeerValue(wrathValue) { + var value = 0; + if (Game.season == 'christmas') { + var remaining = 1 - (frenzyProbability(wrathValue) + clotProbability(wrathValue) + bloodProbability(wrathValue)); + var outputMod = Game.Has('Ho ho ho-flavored frosting') ? 2 : 1; + + value += Math.max(25, baseCps() * outputMod * 60 * 7) * frenzyProbability(wrathValue); + value += Math.max(25, baseCps() * outputMod * 60 * 0.5) * clotProbability(wrathValue); + value += Math.max(25, baseCps() * outputMod * 60 * 666) * bloodProbability(wrathValue); + value += Math.max(25, baseCps() * outputMod * 60) * remaining; + } + return value; +} + +function reindeerCps(wrathValue) { + var averageTime = probabilitySpan('reindeer', 0, 0.5) / Game.fps; + return reindeerValue(wrathValue) / averageTime * FrozenCookies.simulatedGCPercent; +} + +function calculateChainValue(bankAmount, cps, digit) { + x = Math.min(bankAmount, (cps * 60 * 60 * 6 * 4)); + n = Math.floor(Math.log((9*x)/(4*digit))/Math.LN10); + return 125 * Math.pow(9,(n-3)) * digit; +} + +function chocolateValue(bankAmount) { + var value = 0; + if (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg')) { + bankAmount = (bankAmount != null && bankAmount !== 0) ? bankAmount : Game.cookies; + value = 0.05 * (wrinklerValue() + bankAmount + Game.ObjectsById.reduce(function(s,b){return s + cumulativeBuildingCost(b.basePrice, 1, b.amount + 1) / 2},0)); + } + return value; +} + +function wrinklerValue() { + return Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0); +} + +function buildingRemaining(building, amount) { + var cost = cumulativeBuildingCost(building.basePrice, building.amount, amount); + var availableCookies = Game.cookies + wrinklerValue() + Game.ObjectsById.reduce(function(s,b) {return s + (b.name == building.name ? 0 : cumulativeBuildingCost(b.basePrice, 1, b.amount + 1) / 2);}, 0); + availableCookies *= Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? 1.05 : 1; + return Math.max(0, cost - availableCookies); +} + +function earnedRemaining(total) { + return Math.max(0, total - (Game.cookiesEarned + wrinklerValue() + chocolateValue())); +} + +function estimatedTimeRemaining(cookies) { + return timeDisplay(cookies / effectiveCps()); +} + +function luckyBank() { + return baseCps() * 60 * 20 * 10; +} + +function luckyFrenzyBank() { + return baseCps() * 60 * 20 * 7 * 10; +} + +function chainBank() { +// More exact + var digit = 7 - Math.floor(Game.elderWrath / 3); + return 4 * Math.floor(digit / 9 * Math.pow(10, Math.floor(Math.log(194400*baseCps()/digit)/Math.LN10 ))); +// return baseCps() * 60 * 60 * 6 * 4; +} + +function cookieEfficiency(startingPoint, bankAmount) { + var results = Number.MAX_VALUE; + var currentValue = cookieValue(startingPoint); + var bankValue = cookieValue(bankAmount); + var bankCps = gcPs(bankValue); + if (bankCps > 0) { + if (bankAmount <= startingPoint) { + results = 0; + } else { + var cost = Math.max(0,(bankAmount - startingPoint)); + var deltaCps = gcPs(bankValue - currentValue); + results = divCps(cost, deltaCps); + } + } else if (bankAmount <= startingPoint) { + results = 0; + } + return results; +} + +function bestBank(minEfficiency) { + var results = {}; + var bankLevels = [0, luckyBank(), luckyFrenzyBank(), chainBank()].sort(function(a,b){return b-a;}).map(function(bank){ + return {'cost': bank, 'efficiency': cookieEfficiency(Game.cookies, bank)}; + }).filter(function(bank){ + return (bank.efficiency <= minEfficiency) ? bank : null; + }); + return bankLevels[0]; +} + +function weightedCookieValue(useCurrent) { + var cps = baseCps(); + var lucky_mod = Game.Has('Get lucky'); + var base_wrath = lucky_mod ? 401.835 * cps : 396.51 * cps; +// base_wrath += 192125500000; + var base_golden = lucky_mod ? 2804.76 * cps : 814.38 * cps; + if (Game.cookiesEarned >= 100000) { + var remainingProbability = 1; + var startingValue = '6666'; + var rollingEstimate = 0; + for (var i = 5; i < Math.min(Math.floor(Game.cookies).toString().length,12); i++) { + startingValue += '6'; + rollingEstimate += 0.1 * remainingProbability * startingValue; + remainingProbability -= remainingProbability * 0.1; + } + rollingEstimate += remainingProbability * startingValue; +// base_golden += 10655700000; + base_golden += rollingEstimate * 0.0033; + base_wrath += rollingEstimate * 0.0595; + } + if (useCurrent && Game.cookies < maxLuckyValue() * 10) { + if (lucky_mod) { + base_golden -= ((1200 * cps) - Math.min(1200 * cps, Game.cookies * 0.1)) * 0.49 * 0.5 + (maxLuckyValue() - (Game.cookies * 0.1)) * 0.49 * 0.5; + } else { + base_golden -= (maxLuckyValue() - (Game.cookies * 0.1)) * 0.49; + base_wrath -= (maxLuckyValue() - (Game.cookies * 0.1)) * 0.29; + } + } + return Game.elderWrath / 3.0 * base_wrath + (3 - Game.elderWrath) / 3.0 * base_golden; +} + +function maxLuckyValue() { + var gcMod = Game.Has('Get lucky') ? 8400 : 1200; + return baseCps() * gcMod; +} + +function maxCookieTime() { + return Game.goldenCookie.maxTime +} + +function gcPs(gcValue) { + var averageGCTime = probabilitySpan('golden', 0, 0.5) / Game.fps; + gcValue /= averageGCTime; + gcValue *= FrozenCookies.simulatedGCPercent; + return gcValue; +} + +function gcEfficiency() { + if (gcPs(weightedCookieValue()) <= 0) { + return Number.MAX_VALUE; + } + var cost = Math.max(0,(maxLuckyValue() * 10 - Game.cookies)); + var deltaCps = gcPs(weightedCookieValue() - weightedCookieValue(true)); + return divCps(cost, deltaCps); +} + +function delayAmount() { + return bestBank(nextChainedPurchase().efficiency).cost; +/* + if (nextChainedPurchase().efficiency > gcEfficiency() || (Game.frenzy && Game.Has('Get lucky'))) { + return maxLuckyValue() * 10; + } else if (weightedCookieValue() > weightedCookieValue(true)) { + return Math.min(maxLuckyValue() * 10, Math.max(0,(nextChainedPurchase().efficiency - (gcEfficiency() * baseCps())) / gcEfficiency())); + } else { + return 0; + } +*/ +} + +function haveAll(holiday) { + return _.every(holidayCookies[holiday], function(id) {return Game.UpgradesById[id].unlocked;}); +} + +function checkPrices(currentUpgrade) { + var value = 0; + if (FrozenCookies.caches.recommendationList.length > 0) { + var nextRec = FrozenCookies.caches.recommendationList.filter(function(i){return i.id != currentUpgrade.id;})[0]; + var nextPrereq = (nextRec.type == 'upgrade') ? unfinishedUpgradePrereqs(nextRec.purchase) : null; + nextRec = (nextPrereq == null || nextPrereq.filter(function(u){return u.cost != null;}).length == 0) ? nextRec : FrozenCookies.caches.recommendationList.filter(function(a){return nextPrereq.some(function(b){return b.id == a.id && b.type == a.type})})[0]; + value = nextRec.cost == null ? 0 : (nextRec.cost / totalDiscount(nextRec.type == 'building')) - nextRec.cost; + } + return value; +} +// Use this for changes to future efficiency calcs +function purchaseEfficiency(price, deltaCps, baseDeltaCps, currentCps) { + var efficiency = Number.POSITIVE_INFINITY; + if (deltaCps > 0) { + efficiency = FrozenCookies.efficiencyWeight * divCps(price, currentCps) + divCps(price, deltaCps); + } + return efficiency; +} + +function recommendationList(recalculate) { + if (recalculate) { + FrozenCookies.caches.recommendationList = addScores( + upgradeStats(recalculate) + .concat(buildingStats(recalculate)) + .concat(santaStats()) + .sort(function(a,b){ + return a.efficiency != b.efficiency ? a.efficiency - b.efficiency : (a.delta_cps != b.delta_cps ? b.delta_cps - a.delta_cps : a.cost - b.cost); + })); + if (FrozenCookies.pastemode) { + FrozenCookies.caches.recommendationList.reverse(); + } + } + return FrozenCookies.caches.recommendationList; +// return upgradeStats(recalculate).concat(buildingStats(recalculate)).sort(function(a,b){return (a.efficiency - b.efficiency)}); +} + +function addScores(recommendations) { + var filteredList = recommendations.filter(function(a){return a.efficiency < Number.POSITIVE_INFINITY && a.efficiency > Number.NEGATIVE_INFINITY;}) + if (filteredList.length > 0) { + var minValue = Math.log(recommendations[0].efficiency); + var maxValue = Math.log(recommendations[filteredList.length - 1].efficiency); + var spread = maxValue - minValue; + recommendations.forEach(function(purchaseRec, index){ + if (purchaseRec.efficiency < Number.POSITIVE_INFINITY && purchaseRec.efficiency > Number.NEGATIVE_INFINITY) { + var purchaseValue = Math.log(purchaseRec.efficiency); + var purchaseSpread = purchaseValue - minValue; + recommendations[index].efficiencyScore = 1 - (purchaseSpread / spread); + } else { + recommendations[index].efficiencyScore = 0; + } + }); + } else { + recommendations.forEach(function(purchaseRec,index){recommendations[index].efficiencyScore = 0;}); + } + return recommendations; +} + +function nextPurchase(recalculate) { + if (recalculate) { + var recList = recommendationList(recalculate); + var purchase = null; + var target = null; + for (var i = 0; i < recList.length; i++) { + target = recList[i]; + if (target.type == 'upgrade' && unfinishedUpgradePrereqs(Game.UpgradesById[target.id])) { + var prereqList = unfinishedUpgradePrereqs(Game.UpgradesById[target.id]); + purchase = recList.filter(function(a){return prereqList.some(function(b){return b.id == a.id && b.type == a.type})})[0]; + } else { + purchase = target; + } + if (purchase) { + FrozenCookies.caches.nextPurchase = purchase; + FrozenCookies.caches.nextChainedPurchase = target; + break; + } + } + if (purchase == null) { + FrozenCookies.caches.nextPurchase = defaultPurchase(); + FrozenCookies.caches.nextChainedPurchase = defaultPurchase(); + } + } + return FrozenCookies.caches.nextPurchase; +// return purchase; +} + +function nextChainedPurchase(recalculate) { + nextPurchase(recalculate); + return FrozenCookies.caches.nextChainedPurchase; +} + +function buildingStats(recalculate) { + if (recalculate) { + var buildingBlacklist = blacklist[FrozenCookies.blacklist].buildings; + var currentBank = bestBank(0).cost; + FrozenCookies.caches.buildings = Game.ObjectsById.map(function (current, index) { + if (buildingBlacklist === true || _.contains(buildingBlacklist, current.id)) { + return null; + } + var baseCpsOrig = baseCps(); + var cpsOrig = effectiveCps(Math.min(Game.cookies, currentBank)); // baseCpsOrig + gcPs(cookieValue(Math.min(Game.cookies, currentBank))) + baseClickingCps(FrozenCookies.autoClick * FrozenCookies.cookieClickSpeed); + var existingAchievements = Game.AchievementsById.map(function(item,i){return item.won}); + buildingToggle(current); + var baseCpsNew = baseCps(); + var cpsNew = effectiveCps(currentBank); // baseCpsNew + gcPs(cookieValue(currentBank)) + baseClickingCps(FrozenCookies.autoClick * FrozenCookies.cookieClickSpeed); + buildingToggle(current, existingAchievements); + var deltaCps = cpsNew - cpsOrig; + var baseDeltaCps = baseCpsNew - baseCpsOrig; + var efficiency = purchaseEfficiency(current.getPrice(), deltaCps, baseDeltaCps, cpsOrig) + return {'id' : current.id, 'efficiency' : efficiency, 'base_delta_cps' : baseDeltaCps, 'delta_cps' : deltaCps, 'cost' : current.getPrice(), 'purchase' : current, 'type' : 'building'}; + }).filter(function(a){return a;}); + } + return FrozenCookies.caches.buildings; +} + +function upgradeStats(recalculate) { + if (recalculate) { + var upgradeBlacklist = blacklist[FrozenCookies.blacklist].upgrades; + var currentBank = bestBank(0).cost; + FrozenCookies.caches.upgrades = Game.UpgradesById.map(function (current) { + if (!current.bought) { + var needed = unfinishedUpgradePrereqs(current); + if (isUnavailable(current, upgradeBlacklist)) { + return null; + } + var cost = upgradePrereqCost(current); + var baseCpsOrig = baseCps(); + var cpsOrig = effectiveCps(Math.min(Game.cookies, currentBank)); // baseCpsOrig + gcPs(cookieValue(Math.min(Game.cookies, currentBank))) + baseClickingCps(FrozenCookies.autoClick * FrozenCookies.cookieClickSpeed); + var existingAchievements = Game.AchievementsById.map(function(item){return item.won}); + var existingWrath = Game.elderWrath; + var discounts = totalDiscount() + totalDiscount(true); + var reverseFunctions = upgradeToggle(current); + var baseCpsNew = baseCps(); + var cpsNew = effectiveCps(currentBank); // baseCpsNew + gcPs(cookieValue(currentBank)) + baseClickingCps(FrozenCookies.autoClick * FrozenCookies.cookieClickSpeed); + var priceReduction = discounts == (totalDiscount() + totalDiscount(true)) ? 0 : checkPrices(current); + upgradeToggle(current, existingAchievements, reverseFunctions); + Game.elderWrath = existingWrath; + var deltaCps = cpsNew - cpsOrig; + var baseDeltaCps = baseCpsNew - baseCpsOrig; + var efficiency = (priceReduction > cost) ? 1 : purchaseEfficiency(cost, deltaCps, baseDeltaCps, cpsOrig) + return {'id' : current.id, 'efficiency' : efficiency, 'base_delta_cps' : baseDeltaCps, 'delta_cps' : deltaCps, 'cost' : cost, 'purchase' : current, 'type' : 'upgrade'}; + } + }).filter(function(a){return a;}); + } + return FrozenCookies.caches.upgrades; +} + +function isUnavailable(upgrade, upgradeBlacklist) { + var result = false; + var needed = unfinishedUpgradePrereqs(upgrade); + result = result || !upgrade.unlocked && !needed; + result = result || (upgradeBlacklist === true); + result = result || _.contains(upgradeBlacklist, upgrade.id); + result = result || (needed && _.find(needed, function(a){return a.type == "wrinklers"}) != null); + result = result || (upgrade.season && !haveAll(Game.season)); + return result; +} + +function santaStats() { + return Game.Has('A festive hat') && (Game.santaLevel + 1 < Game.santaLevels.length) ? { + id: 0, + efficiency: Infinity, + base_delta_cps: 0, + delta_cps: 0, + cost: cumulativeSantaCost(1), + type: 'santa', + purchase: { + id: 0, + name: 'Santa Stage Upgrade (' + Game.santaLevels[(Game.santaLevel + 1) % Game.santaLevels.length] + ')', + buy: buySanta, + getCost: function() {return cumulativeSantaCost(1);} + } + } : []; +} + +function defaultPurchase() { + return { + id: 0, + efficiency: Infinity, + delta_cps: 0, + base_delta_cps: 0, + cost: Infinity, + type: 'other', + purchase: { + id: 0, + name: 'No valid purchases!', + buy: function(){}, + getCost: function() {return Infinity;} + } + } +} + +function totalDiscount(building) { + var price = 1; + if (Game.Has('Season savings') && building) price *= 0.99; + if (Game.Has('Toy workshop') && !building) price *= 0.95; + if (Game.Has('Santa\'s dominion')) price *= (building ? 0.99 : 0.98); + if (Game.Has('Faberge egg')) price *= 0.99; + return price; +} + +function cumulativeBuildingCost(basePrice, startingNumber, endingNumber) { + return basePrice * totalDiscount(true) * (Math.pow(Game.priceIncrease, endingNumber) - Math.pow(Game.priceIncrease, startingNumber)) / (Game.priceIncrease - 1); +} + +function cumulativeSantaCost(amount) { + var total = 0; + if (!amount) { + + } else if (Game.santaLevel + amount < Game.santaLevels.length) { + for (var i=Game.santaLevel + 1; i <= Game.santaLevel + amount; i++) { + total += Math.pow(i, i); + } + } else if (amount < Game.santaLevels.length) { + for (var i=Game.santaLevel + 1; i <= amount; i++) { + total += Math.pow(i, i); + } + } else { + total = Infinity; + } + return total; +} + +function cumulativeSantaCost(amount) { + var total = 0; + if (!amount) { + + } else if (Game.santaLevel + amount < Game.santaLevels.length) { + for (var i=Game.santaLevel + 1; i <= Game.santaLevel + amount; i++) { + total += Math.pow(i, i); + } + } else if (amount < Game.santaLevels.length) { + for (var i=Game.santaLevel + 1; i <= amount; i++) { + total += Math.pow(i, i); + } + } else { + total = Infinity; + } + return total; +} + +function upgradePrereqCost(upgrade, full) { + var cost = upgrade.getPrice(); + if (upgrade.unlocked) { + return cost; + } + var prereqs = _.find(upgradeJson, function(a) {return a.id == upgrade.id;}); + if (prereqs) { + cost += prereqs.buildings.reduce(function(sum,item,index) { + var building = Game.ObjectsById[index]; + if (item && full) { + sum += cumulativeBuildingCost(building.basePrice, 0, item); + } else if (item && building.amount < item) { + sum += cumulativeBuildingCost(building.basePrice, building.amount, item); + } + return sum; + },0); + cost += prereqs.upgrades.reduce(function(sum,item) { + var reqUpgrade = Game.UpgradesById[item]; + if (!upgrade.bought || full) { + sum += upgradePrereqCost(reqUpgrade, full); + } + return sum; + }, 0); + cost += cumulativeSantaCost(prereqs.santa); + } + return cost; +} + +function unfinishedUpgradePrereqs(upgrade) { + if (upgrade.unlocked) { + return null; + } + var needed = []; + var prereqs = _.find(upgradeJson, function(a) {return a.id == upgrade.id;}); + if (prereqs) { + prereqs.buildings.forEach(function(a, b) { + if (a && Game.ObjectsById[b].amount < a) { + needed.push({'type' : 'building', 'id' : b}); + } + }); + prereqs.upgrades.forEach(function(a) { + if (!Game.UpgradesById[a].bought) { + var recursiveUpgrade = Game.UpgradesById[a]; + var recursivePrereqs = unfinishedUpgradePrereqs(recursiveUpgrade); + if (recursiveUpgrade.unlocked) { + needed.push({'type' : 'upgrade', 'id' : a}); + } else if (!recursivePrereqs) { + // Research is being done. + } else { + recursivePrereqs.forEach(function(a) { + if (!needed.some(function(b){return b.id == a.id && b.type == a.type;})) { + needed.push(a); + } + }); + } + } + }); + if (prereqs.santa) { + needed.push({type:'santa', id: 0}); + } + if (prereqs.wrinklers && Game.elderWrath == 0) { + needed.push({type:'wrinklers', id:0}); + } + } + return needed.length ? needed : null; +} + +function upgradeToggle(upgrade, achievements, reverseFunctions) { + if (!achievements) { + reverseFunctions = {}; + if (!upgrade.unlocked) { + var prereqs = _.find(upgradeJson, function(a) {return a.id == upgrade.id;}); + if (prereqs) { + reverseFunctions.prereqBuildings = []; + prereqs.buildings.forEach(function(a,b) { + var building = Game.ObjectsById[b]; + if (a && building.amount < a) { + var difference = a - building.amount; + reverseFunctions.prereqBuildings.push({id: b, amount: difference}); + building.amount += difference; + building.bought += difference; + Game.BuildingsOwned += difference; + } + }); + reverseFunctions.prereqUpgrades = []; + if (prereqs.upgrades.length > 0) { + prereqs.upgrades.forEach(function(id) { + var upgrade = Game.UpgradesById[id]; + if (!upgrade.bought) { + reverseFunctions.prereqUpgrades.push({id: id, reverseFunctions: upgradeToggle(upgrade)}); + } + }); + } + } + } + upgrade.bought = 1; + Game.UpgradesOwned += 1; + reverseFunctions.current = buyFunctionToggle(upgrade); + } else { + if (reverseFunctions.prereqBuildings) { + reverseFunctions.prereqBuildings.forEach(function(b) { + var building = Game.ObjectsById[b.id]; + building.amount -= b.amount; + building.bought -= b.amount; + Game.BuildingsOwned -= b.amount; + }); + } + if (reverseFunctions.prereqUpgrades) { + reverseFunctions.prereqUpgrades.forEach(function(u) { + var upgrade = Game.UpgradesById[u.id]; + upgradeToggle(upgrade, [], u.reverseFunctions); + }); + } + upgrade.bought = 0; + Game.UpgradesOwned -= 1; + buyFunctionToggle(reverseFunctions.current); + Game.AchievementsOwned = 0; + achievements.forEach(function(won, index){ + var achievement = Game.AchievementsById[index]; + achievement.won = won; + if (won && achievement.pool == 'normal') { + Game.AchievementsOwned += 1; + } + }); + } + Game.recalculateGains = 1; + Game.CalculateGains(); + return reverseFunctions; +} + +function buildingToggle(building, achievements) { + if (!achievements) { + building.amount += 1; + building.bought += 1; + Game.BuildingsOwned += 1; + } else { + building.amount -= 1; + building.bought -= 1; + Game.BuildingsOwned -= 1; + Game.AchievementsOwned = 0; + achievements.forEach(function(won, index){ + var achievement = Game.AchievementsById[index]; + achievement.won = won; + if (won && achievement.pool == 'normal') { + Game.AchievementsOwned += 1; + } + }); + } + Game.recalculateGains = 1; + Game.CalculateGains(); +} + +function buyFunctionToggle(upgrade) { + if (upgrade && !upgrade.length) { + if (!upgrade.buyFunction) { + return null; + } + + var ignoreFunctions = [ + /Game\.Earn\('.*\)/, + /Game\.Lock\('.*'\)/, + /Game\.Unlock\(.*\)/, + /Game\.Objects\['.*'\]\.drawFunction\(\)/, + /Game\.Objects\['.*'\]\.redraw\(\)/, + /Game\.SetResearch\('.*'\)/, + /Game\.Upgrades\['.*'\]\.basePrice=.*/, + /Game\.CollectWrinklers\(\)/, + /Game\.RefreshBuildings\(\)/, + /Game\.storeToRefresh=1/, + /Game\.upgradesToRebuild=1/, + /Game\.Popup\(.*\)/, + /Game\.Notify\(.*\)/, + /var\s+.+\s*=.+/, + /Game\.computeSeasonPrices\(\)/, + /Game\.seasonPopup\.reset\(\)/, + /\S/ + ]; + var buyFunctions = upgrade.buyFunction.toString() + .replace(/[\n\r\s]+/g, ' ') + .replace(/function\s*\(\)\s*{(.+)\s*}/, "$1") + .replace(/for\s*\(.+\)\s*\{.+\}/,'') + .replace(/if\s*\(this\.season\)\s*Game\.season=this\.season\;/,('Game.season="' + upgrade.season + '";')) + .replace(/if\s*\(.+\)\s*[^{}]*?\;/,'') + .replace(/if\s*\(.+\)\s*\{.+\}/,'') + .replace(/else\s+\(.+\)\s*\;/,'') + .replace(/\+\+/,'+=1') + .replace(/\-\-/,'-=1') + .split(';') + .map(function(a){return a.trim();}) + .filter(function(a){ + ignoreFunctions.forEach(function(b){a = a.replace(b,'')}); + return a != ''; + }); + + if (buyFunctions.length == 0) { + return null; + } + + var reversedFunctions = buyFunctions.map(function(a){ + var reversed = ''; + var achievementMatch = /Game\.Win\('(.*)'\)/.exec(a); + if (a.split('+=').length > 1) { + reversed = a.split('+=').join('-='); + } else if (a.split('-=').length > 1) { + reversed = a.split('-=').join('+='); + } else if (achievementMatch && Game.Achievements[achievementMatch[1]].won == 0) { + reversed = 'Game.Achievements[\'' + achievementMatch[1] + '\'].won=0'; + } else if (a.split('=').length > 1) { + var expression = a.split('='); + var isString = expression[1].indexOf("'") > -1 || expression[1].indexOf('"') > -1; + reversed = expression[0] + '=' + (isString ? "'" : '') + eval(expression[0]) + (isString ? "'" : ''); + } + return reversed; + }); + buyFunctions.forEach(function(f) {eval(f);}); + return reversedFunctions; + } else if (upgrade && upgrade.length) { + upgrade.forEach(function(f) {eval(f);}); + } + return null; +} + +function buySanta() { +// if (Game.LeftBackground) { +// Game.mouseX = 48; +// Game.mouseY = Game.LeftBackground.canvas.height-48-24; +// Game.Click = 1; +// Game.UpdateSpecial(); +// Game.Click = 0; +// } + // This might be fixed now? + Game.specialTab = 'santa'; + Game.UpgradeSanta(); + Game.ToggleSpecialMenu(); +} + +function statSpeed() { + var speed = 0; + switch (FrozenCookies.trackStats) { + case 1: // 60s + speed = 1000 * 60; + break; + case 2: // 30m + speed = 1000 * 60 * 30; + break; + case 3: // 1h + speed = 1000 * 60 * 60; + break; + case 4: // 24h + speed = 1000 * 60 * 60 * 24; + break; + } + return speed; +} + +function saveStats(fromGraph) { + FrozenCookies.trackedStats.push({ + time: Date.now() - Game.startDate, + baseCps: baseCps(), + effectiveCps: effectiveCps(), + hc: Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);},0)) + }); + if ($('#statGraphContainer').length > 0 && !$('#statGraphContainer').is(':hidden') && !fromGraph) { + viewStatGraphs(); + } +} + +function viewStatGraphs() { + saveStats(true); + var containerDiv = $('#statGraphContainer').length ? + $('#statGraphContainer') : + $('
').attr('id', 'statGraphContainer') + .html($('
') + .attr('id', 'statGraphs')) + .appendTo('body') + .dialog({ + modal:true, + title: 'Frozen Cookies Tracked Stats', + width:$(window).width() * 0.8, + height:$(window).height() * 0.8 + }); + if (containerDiv.is(':hidden')) { + containerDiv.dialog(); + } + if (FrozenCookies.trackedStats.length > 0 && (Date.now() - FrozenCookies.lastGraphDraw) > 1000) { + FrozenCookies.lastGraphDraw = Date.now(); + $('#statGraphs').empty(); + var graphs = $.jqplot('statGraphs', transpose(FrozenCookies.trackedStats.map(function(s) {return [[s.time / 1000, s.baseCps], [s.time / 1000, s.effectiveCps], [s.time / 1000, s.hc]]})), // + { + legend: {show: true}, + height: containerDiv.height() - 50, + axes: { + xaxis: { + tickRenderer: $.jqplot.CanvasAxisTickRenderer, + tickOptions: { + angle: -30, + fontSize: '10pt', + showGridline: false, + formatter: function(ah,ai) {return timeDisplay(ai);} + } + }, + yaxis: { + padMin: 0, + renderer: $.jqplot.LogAxisRenderer, + tickDistribution: 'even', + tickOptions: { + formatter: function(ah,ai) {return Beautify(ai);} + } + }, + y2axis: { + padMin: 0, + tickOptions: { + showGridline: false, + formatter: function(ah,ai) {return Beautify(ai);} + } + } + }, + highlighter: { + show: true, + sizeAdjust: 15 + }, + series: [{label: 'Base CPS'},{label:'Effective CPS'},{label:'Earned HC', yaxis: 'y2axis'}] + }); + } +} + +function updateCaches() { + var recommendation, currentBank, targetBank, currentCookieCPS, currentUpgradeCount; + var recalcCount = 0; + do { + recommendation = nextPurchase(FrozenCookies.recalculateCaches); + FrozenCookies.recalculateCaches = false; + currentBank = bestBank(0); + targetBank = bestBank(recommendation.efficiency); + currentCookieCPS = gcPs(cookieValue(currentBank.cost)); + currentUpgradeCount = Game.UpgradesInStore.length; + FrozenCookies.safeGainsCalc(); + + if (FrozenCookies.lastCPS != FrozenCookies.calculatedCps) { + FrozenCookies.recalculateCaches = true; + FrozenCookies.lastCPS = FrozenCookies.calculatedCps; + } + + if (FrozenCookies.currentBank.cost != currentBank.cost) { + FrozenCookies.recalculateCaches = true; + FrozenCookies.currentBank = currentBank; + } + + if (FrozenCookies.targetBank.cost != targetBank.cost) { + FrozenCookies.recalculateCaches = true; + FrozenCookies.targetBank = targetBank; + } + + if (FrozenCookies.lastCookieCPS != currentCookieCPS) { + FrozenCookies.recalculateCaches = true; + FrozenCookies.lastCookieCPS = currentCookieCPS; + } + + if (FrozenCookies.lastUpgradeCount != currentUpgradeCount) { + FrozenCookies.recalculateCaches = true; + FrozenCookies.lastUpgradeCount = currentUpgradeCount; + } + recalcCount += 1; + } while (FrozenCookies.recalculateCaches && recalcCount < 10); +} + +function doTimeTravel() { +// 'Time Travel DISABLED','Purchases by Estimated Effective CPS','Purchases by Simulated Real Time','Heavenly Chips by Estimated Effective CPS','Heavenly Chips by Simulated Real Time' + if (FrozenCookies.timeTravelMethod) { + // Estimated Effective CPS + if (timeTravelMethod % 2 === 1) { + var fullCps = effectiveCps(); + if (fullCps) { + var neededCookies = 0; + if (timeTravelMethod === 1) { + + } else if (timeTravelMethod === 3) { + + } + } + } else { + + } + } else { + FrozenCookies.timeTravelAmount = 0; + } +/* + var fullCps = effectiveCps(); + if (fullCps > 0) { + var neededCookies = Math.max(0, recommendation.cost + delayAmount() - Game.cookies); + var time = neededCookies / fullCps; + Game.Earn(neededCookies); + Game.startDate -= time * 1000; + Game.fullDate -= time * 1000; + FrozenCookies.timeTravelPurchases -= 1; + logEvent('Time travel', 'Travelled ' + timeDisplay(time) + ' into the future.'); + } +*/ +} + +function fcWin(what) { + if (typeof what==='string') { + if (Game.Achievements[what]) { + if (Game.Achievements[what].won==0) { + Game.Achievements[what].won=1; + if (!FrozenCookies.disabledPopups) { + logEvent('Achievement', 'Achievement unlocked :
'+Game.Achievements[what].name+'
', true); + } + if (Game.Achievements[what].hide!=3) { + Game.AchievementsOwned++; + } + Game.recalculateGains=1; + } + } + } else { + for (var i in what) {Game.Win(what[i]);} + } +} + +function logEvent(event, text, popup) { + var time = '[' + timeDisplay((Date.now() - Game.startDate)/1000) + ']'; + var output = time + ' ' + event + ': ' + text; + if (FrozenCookies.logging) { + console.log(output); + } + if (popup) { + Game.Popup(text); + } +} + +function inRect(x,y,rect) { + // Duplicate of internally defined method, + // only needed because I'm modifying the scope of Game.UpdateWrinklers and it can't see this anymore. + var dx = x+Math.sin(-rect.r)*(-(rect.h/2-rect.o)),dy=y+Math.cos(-rect.r)*(-(rect.h/2-rect.o)); + var h1 = Math.sqrt(dx*dx + dy*dy); + var currA = Math.atan2(dy,dx); + var newA = currA - rect.r; + var x2 = Math.cos(newA) * h1; + var y2 = Math.sin(newA) * h1; + return (x2 > -0.5 * rect.w && x2 < 0.5 * rect.w && y2 > -0.5 * rect.h && y2 < 0.5 * rect.h); +} + +function transpose(a) { + return Object.keys(a[0]).map(function (c) { return a.map(function (r) { return r[c]; }); }); +} + +function smartTrackingStats(delay) { + saveStats(); + if (FrozenCookies.trackStats == 6) { + delay /= (FrozenCookies.delayPurchaseCount == 0) ? (1/1.5) : (delay > FrozenCookies.minDelay ? 2 : 1); + FrozenCookies.smartTrackingBot = setTimeout(function(){smartTrackingStats(delay);}, delay); + FrozenCookies.delayPurchaseCount = 0; + } +} + +// Unused +function shouldClickGC() { + return Game.goldenCookie.life > 0 && FrozenCookies.autoGC; +} + +function liveWrinklers() { + return _.select(Game.wrinklers, function(w) {return w.sucked > 0.5 && w.phase > 0}).sort(function(w1, w2) {return w1.sucked < w2.sucked}); +} + +function wrinklerMod(num) { + return 1.1 * num * num * 0.05 * (Game.Has('Wrinklerspawn') ? 1.05 : 1) + (1 - 0.05 * num); +} + +function popValue(sucked) { + return sucked * 1.1 * (Game.Has('Wrinklerspawn') ? 1.05 : 1); +} + +function shouldPopWrinklers() { + var toPop = []; + var living = liveWrinklers(); + if (living.length > 0) { + if ((Game.season == 'halloween' || Game.season == 'easter') && !haveAll(Game.season)) { + toPop = living.map(function(w) {return w.id}); + } else { + var delay = delayAmount(); + var nextRecNeeded = nextPurchase().cost + delay - Game.cookies; + var nextRecCps = nextPurchase().delta_cps; + var wrinklersNeeded = Game.wrinklers.sort(function(w1, w2) {return w1.sucked < w2.sucked}).reduce(function(current, w) { + var futureWrinklers = living.length - (current.ids.length + 1); + if (current.total < nextRecNeeded && effectiveCps(delay, Game.elderWrath, futureWrinklers) + nextRecCps > effectiveCps()) { + current.ids.push(w.id); + current.total += popValue(w.sucked); + } + return current; + }, {total:0, ids:[]}); + toPop = (wrinklersNeeded.total > nextRecNeeded) ? wrinklersNeeded.ids : toPop; + } + } + return toPop; +} + +// Unused +function autoGoldenCookie() { + if (!FrozenCookies.processing && Game.goldenCookie.life && !Game.OnAscend && !Game.AscendTimer) { + FrozenCookies.processing = true; + Game.goldenCookie.click(); + FrozenCookies.processing = false; + } +} + +function autoFrenzyClick() { + if (Game.clickFrenzy > 0 && !FrozenCookies.autoFrenzyBot) { + if (FrozenCookies.autoclickBot) { + clearInterval(FrozenCookies.autoclickBot); + FrozenCookies.autoclickBot = 0; + } + FrozenCookies.autoFrenzyBot = setInterval(function(){Game.ClickCookie();}, 1000 / FrozenCookies.frenzyClickSpeed); + } else if (Game.clickFrenzy == 0 && FrozenCookies.autoFrenzyBot) { + clearInterval(FrozenCookies.autoFrenzyBot); + FrozenCookies.autoFrenzyBot = 0; + if (FrozenCookies.autoClick && FrozenCookies.cookieClickSpeed) { + FrozenCookies.autoclickBot = setInterval(function(){Game.ClickCookie();}, 1000 / FrozenCookies.cookieClickSpeed); + } + } +} + +function autoCookie() { + if (!FrozenCookies.processing && !Game.OnAscend && !Game.AscendTimer) { + FrozenCookies.processing = true; + var currentHCAmount = Math.floor(Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset + Game.wrinklers.reduce(function(s,w){return s + popValue(w.sucked);}, 0))); + if (FrozenCookies.lastHCAmount < currentHCAmount) { + var changeAmount = currentHCAmount - FrozenCookies.lastHCAmount; + FrozenCookies.lastHCAmount = currentHCAmount; + FrozenCookies.prevLastHCTime = FrozenCookies.lastHCTime; + FrozenCookies.lastHCTime = Date.now(); + var currHCPercent = (60 * 60 * (FrozenCookies.lastHCAmount - Game.HowMuchPrestige(Game.cookiesReset))/((FrozenCookies.lastHCTime - Game.startDate)/1000)); + if ((Game.HowMuchPrestige(Game.cookiesReset) < (currentHCAmount - changeAmount)) && currHCPercent > FrozenCookies.maxHCPercent) { + FrozenCookies.maxHCPercent = currHCPercent; + } + FrozenCookies.hc_gain += changeAmount; + updateLocalStorage(); + } + updateCaches(); + var recommendation = nextPurchase(); + var delay = delayAmount(); + if (FrozenCookies.timeTravelAmount) { + doTimeTravel(); + } + if (FrozenCookies.autoWrinkler) { + var popCount = 0; + var popList = shouldPopWrinklers(); + _.filter(Game.wrinklers, function(w) {return _.contains(popList, w.id)}).forEach(function(w) { + w.hp = 0; + popCount += 1; + }); + if (popCount > 0) { + logEvent('Wrinkler', 'Popped ' + popCount + ' wrinklers.'); + } + } + var itemBought = false; + + if (FrozenCookies.autoBuy && (Game.cookies >= delay + recommendation.cost) && (FrozenCookies.pastemode || isFinite(nextChainedPurchase().efficiency))) { +// if (FrozenCookies.autoBuy && (Game.cookies >= delay + recommendation.cost)) { + recommendation.time = Date.now() - Game.startDate; +// full_history.push(recommendation); // Probably leaky, maybe laggy? + recommendation.purchase.clickFunction = null; + disabledPopups = false; +// console.log(purchase.name + ': ' + Beautify(recommendation.efficiency) + ',' + Beautify(recommendation.delta_cps)); + recommendation.purchase.buy(); + FrozenCookies.autobuyCount += 1; + if (FrozenCookies.trackStats == 5 && recommendation.type == 'upgrade') { + saveStats(); + } else if (FrozenCookies.trackStats == 6) { + FrozenCookies.delayPurchaseCount += 1; + } + logEvent('Store', 'Autobought ' + recommendation.purchase.name + ' for ' + Beautify(recommendation.cost) + ', resulting in ' + Beautify(recommendation.delta_cps) + ' CPS.'); + disabledPopups = true; + if (FrozenCookies.autobuyCount >= 10) { + Game.Draw(); + FrozenCookies.autobuyCount = 0; + } + FrozenCookies.recalculateCaches = true; + FrozenCookies.processing = false; + itemBought = true; + } + + // This apparently *has* to stay here, or else fast purchases will multi-click it. + if (Game.goldenCookie.life && FrozenCookies.autoGC) { + Game.goldenCookie.click(); + } + if (Game.seasonPopup.life > 0 && FrozenCookies.autoReindeer) { + Game.seasonPopup.click(); + } + if (FrozenCookies.autoBlacklistOff) { + autoBlacklistOff(); + } + var currentFrenzy = (Game.frenzy ? Game.frenzyPower : 1) * (Game.clickFrenzy ? 777 : 1); + if (currentFrenzy != FrozenCookies.last_gc_state) { + if (FrozenCookies.last_gc_state != 1 && currentFrenzy == 1) { + logEvent('GC', 'Frenzy ended, cookie production x1'); + if (FrozenCookies.hc_gain) { + + logEvent('HC', 'Won ' + FrozenCookies.hc_gain + ' heavenly chips during Frenzy. Rate: ' + (FrozenCookies.hc_gain * 1000) / (Date.now() - FrozenCookies.hc_gain_time) + ' HC/s.'); + FrozenCookies.hc_gain_time = Date.now(); + FrozenCookies.hc_gain = 0; + } + } else { + if (FrozenCookies.last_gc_state != 1) { + logEvent('GC', 'Previous Frenzy x' + FrozenCookies.last_gc_state + 'interrupted.') + } else if (FrozenCookies.hc_gain) { + logEvent('HC', 'Won ' + FrozenCookies.hc_gain + ' heavenly chips outside of Frenzy. Rate: ' + (FrozenCookies.hc_gain * 1000) / (Date.now() - FrozenCookies.hc_gain_time) + ' HC/s.'); + FrozenCookies.hc_gain_time = Date.now(); + FrozenCookies.hc_gain = 0; + } + logEvent('GC', 'Starting ' + (Game.clickFrenzy ? 'Clicking ' : '') + 'Frenzy x' + currentFrenzy); + } + if (FrozenCookies.frenzyTimes[FrozenCookies.last_gc_state] == null) { + FrozenCookies.frenzyTimes[FrozenCookies.last_gc_state] = 0; + } + FrozenCookies.frenzyTimes[FrozenCookies.last_gc_state] += Date.now() - FrozenCookies.last_gc_time; + FrozenCookies.last_gc_state = currentFrenzy; + FrozenCookies.last_gc_time = Date.now(); + updateLocalStorage(); + } + FrozenCookies.processing = false; + if (FrozenCookies.frequency) { + FrozenCookies.cookieBot = setTimeout(autoCookie, itemBought ? 0 : FrozenCookies.frequency); + } + } else if (!FrozenCookies.processing && FrozenCookies.frequency) { + FrozenCookies.cookieBot = setTimeout(autoCookie, FrozenCookies.frequency); + } +} + +function FCStart() { + // To allow polling frequency to change, clear intervals before setting new ones. + + if (FrozenCookies.cookieBot) { + clearInterval(FrozenCookies.cookieBot); + FrozenCookies.cookieBot = 0; + } + if (FrozenCookies.autoclickBot) { + clearInterval(FrozenCookies.autoclickBot); + FrozenCookies.autoclickBot = 0; + } + if (FrozenCookies.statBot) { + clearInterval(FrozenCookies.statBot); + FrozenCookies.statBot = 0; + } + +// if (!FrozenCookies.saveWrinklers && localStorage.wrinklers) { +// delete localStorage.wrinklers; +// } + +// Remove until timing issues are fixed +// if (FrozenCookies.goldenCookieBot) { +// clearInterval(FrozenCookies.goldenCookieBot); +// FrozenCookies.goldenCookieBot = 0; +// } + + // Now create new intervals with their specified frequencies. + + if (FrozenCookies.frequency) { + FrozenCookies.cookieBot = setTimeout(autoCookie, FrozenCookies.frequency); + } + +// if (FrozenCookies.autoGC) { +// FrozenCookies.goldenCookieBot = setInterval(autoGoldenCookie, FrozenCookies.frequency); +// } + + if (FrozenCookies.autoClick && FrozenCookies.cookieClickSpeed) { + FrozenCookies.autoclickBot = setInterval(function() {if (!Game.OnAscend && !Game.AscendTimer) {Game.ClickCookie()}}, 1000 / FrozenCookies.cookieClickSpeed); + } + + if (FrozenCookies.autoFrenzy && FrozenCookies.frenzyClickSpeed) { + FrozenCookies.frenzyClickBot = setInterval(autoFrenzyClick, FrozenCookies.frequency); + } + + if (statSpeed(FrozenCookies.trackStats) > 0) { + FrozenCookies.statBot = setInterval(saveStats, statSpeed(FrozenCookies.trackStats)); + } else if (FrozenCookies.trackStats == 6 && !FrozenCookies.smartTrackingBot) { + FrozenCookies.smartTrackingBot = setTimeout(function() {smartTrackingStats(FrozenCookies.minDelay * 8)}, FrozenCookies.minDelay); + } + + FCMenu(); +} From 542a7a0bf3ffb28eacb3ffc66226acfd42198372 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Wed, 23 Dec 2015 15:28:50 -0500 Subject: [PATCH 103/180] Create cc_upgrade_prerequisites.js --- 1.9/cc_upgrade_prerequisites.js | 344 ++++++++++++++++++++++++++++++++ 1 file changed, 344 insertions(+) create mode 100644 1.9/cc_upgrade_prerequisites.js diff --git a/1.9/cc_upgrade_prerequisites.js b/1.9/cc_upgrade_prerequisites.js new file mode 100644 index 00000000..a2909111 --- /dev/null +++ b/1.9/cc_upgrade_prerequisites.js @@ -0,0 +1,344 @@ +FrozenCookies.preferenceValues = { + 'autoBuy':{ + 'hint':'Automatically buy the most efficient building when you\'ve met its cost', + 'display':["Autobuy OFF","Autobuy ON"], + 'default':0 + }, + 'autoGC':{ + 'hint':'Automatically click Golden Cookies when they appear', + 'display':["Autoclick GC OFF", "Autoclick GC ON"], + 'default':0 + }, + 'autoWrinkler':{ + 'hint':'Automatically pop wrinklers efficiently (as fast as possible before you have all halloween cookies, then wait until a purchase)', + 'display':['Autopop Wrinklers OFF', 'Autopop Wrinklers ON'], + 'default':0 + }, + 'autoReindeer':{ + 'hint':'Automatically click reindeer', + 'display':['Autoclick Reindeer OFF', 'Autoclick Reindeer ON'], + 'default':0 + }, + 'autoClick':{ + 'hint':'Click the large cookie.', + 'display':['Autoclick OFF', 'Autoclick ON'], + 'default':0, + 'extras':'${cookieClickSpeed} clicks/sec' + }, + 'autoFrenzy':{ + 'hint':'Click the large cookie during Clicking Frenzies.', + 'display':['Autofrenzy OFF', 'Autofrenzy ON'], + 'default':0, + 'extras':'${frenzyClickSpeed} clicks/sec' + }, + 'autoBlacklistOff':{ + 'hint':'Automatically turns off a blacklist once the goal for that blacklist is achieved', + 'display':['Auto Blacklist OFF', 'Auto Blacklist ON'], + 'default':0 + }, + 'blacklist':{ + 'hint':'Blacklist purchases from the efficiency calculations', + 'display':['No Blacklist', 'Speedrun Blacklist', 'Hardcore Blacklist', 'Grandmapocalypse Mode', 'No Buildings'], + 'default':0 + }, +/* 'timeTravelMethod':{ + 'hint':'Time travel is unstable. This determines how time travel works. If you\'re unsure, don\'t touch this.', + 'display':['Time Travel DISABLED'],//,'Purchases by Estimated Effective CPS','Purchases by Simulated Real Time','Heavenly Chips by Estimated Effective CPS','Heavenly Chips by Simulated Real Time'], + 'default':0, + 'extras':'Set Time Travel Amount' + },*/ + 'pastemode':{ + 'hint':'Always autobuy the least efficient purchase. This is a stupid idea, you should never turn this on.', + 'display':['Pastemode OFF','Pastemode ON'], + 'default':0 + }, + 'simulatedGCPercent':{ + 'hint':'What percentage of Golden Cookies should be assumed as "clicked" for GC efficiency calculations (100% recommended)', + 'display':["0%","100%"], + 'default':1 + }, + 'logging':{ + 'hint':'Display detailed logs in the javascript console.', + 'display':['Logging OFF', 'Logging ON'], + 'default':1 + }, + 'trackStats':{ + 'hint':'Track your CPS/HC earned over time during a single session to enable graphing. This may end up being *extremely* memory-intensive.', + 'display':['Tracking OFF', 'Every 60s', 'Every 30m', 'Every 1h', 'Every 24h', 'On upgrades', 'Smart Timing'], + 'default':0, + 'extras':'View Stat Graphs' + }, + 'numberDisplay':{ + 'hint':'Change how numbers are shortened', + 'display':["Raw Numbers","Full Word (million, billion)","Initials (M, B)","SI Units (M, G, T)", "Scientific Notation (x10¹²)"], + 'default':1 + } +}; + +// Unused, for now: +function buildUpgradeList() { + return _.compact(_.flatten(Game.ObjectsById.map(function(b){return b.buyFunction.toString().match(/if\s?\(this\.amount>=(\d+)\)\s?Game\.Unlock\((.+?)\);/g).map(function(matched){ + var res = /if\s?\(this\.amount>=(\d+)\)\s?Game\.Unlock\((.+?)\);/.exec(matched); + var template = [0,0,0,0,0,0,0,0,0,0,0,0,0,0]; + template[b.id] += eval(res[1]); + + return Game.Upgrades[eval(res[2])] ? {id: Game.Upgrades[eval(res[2])].id, buildings: template, upgrades: []} : eval(res[2]).map(function(u){return {id: Game.Upgrades[u].id, buildings: template, upgrades: []}}); + })}))); +} + +var upgradeJson = [ + {'id':0,'buildings':[1,0,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':1,'buildings':[1,0,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':2,'buildings':[10,0,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':3,'buildings':[20,0,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':4,'buildings':[40,0,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':5,'buildings':[80,0,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':6,'buildings':[120,0,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':43,'buildings':[160,0,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':82,'buildings':[200,0,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':109,'buildings':[240,0,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':188,'buildings':[280,0,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':189,'buildings':[320,0,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + + {'id':7,'buildings':[0,1,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':8,'buildings':[0,1,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':9,'buildings':[0,10,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':44,'buildings':[0,50,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':110,'buildings':[0,100,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':192,'buildings':[0,200,0,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + + {'id':10,'buildings':[0,0,1,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':11,'buildings':[0,0,1,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':12,'buildings':[0,0,10,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':45,'buildings':[0,0,50,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':111,'buildings':[0,0,100,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':193,'buildings':[0,0,200,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + + {'id':16,'buildings':[0,0,0,1,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':17,'buildings':[0,0,0,1,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':18,'buildings':[0,0,0,10,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':47,'buildings':[0,0,0,50,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':113,'buildings':[0,0,0,100,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':195,'buildings':[0,0,0,200,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + + {'id':13,'buildings':[0,0,0,0,1,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':14,'buildings':[0,0,0,0,1,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':15,'buildings':[0,0,0,0,10,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':46,'buildings':[0,0,0,0,50,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':112,'buildings':[0,0,0,0,100,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':194,'buildings':[0,0,0,0,200,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + + {'id':232,'buildings':[0,0,0,0,0,1,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':233,'buildings':[0,0,0,0,0,1,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':234,'buildings':[0,0,0,0,0,10,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':235,'buildings':[0,0,0,0,0,50,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':236,'buildings':[0,0,0,0,0,100,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':237,'buildings':[0,0,0,0,0,200,0,0,0,0,0,0,0,0],'upgrades':[]}, + + {'id':238,'buildings':[0,0,0,0,0,0,1,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':239,'buildings':[0,0,0,0,0,0,1,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':240,'buildings':[0,0,0,0,0,0,10,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':241,'buildings':[0,0,0,0,0,0,50,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':242,'buildings':[0,0,0,0,0,0,100,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':243,'buildings':[0,0,0,0,0,0,200,0,0,0,0,0,0,0],'upgrades':[]}, + + {'id':244,'buildings':[0,0,0,0,0,0,0,1,0,0,0,0,0,0],'upgrades':[]}, + {'id':245,'buildings':[0,0,0,0,0,0,0,1,0,0,0,0,0,0],'upgrades':[]}, + {'id':246,'buildings':[0,0,0,0,0,0,0,10,0,0,0,0,0,0],'upgrades':[]}, + {'id':247,'buildings':[0,0,0,0,0,0,0,50,0,0,0,0,0,0],'upgrades':[]}, + {'id':248,'buildings':[0,0,0,0,0,0,0,100,0,0,0,0,0,0],'upgrades':[]}, + {'id':249,'buildings':[0,0,0,0,0,0,0,200,0,0,0,0,0,0],'upgrades':[]}, + + {'id':19,'buildings':[0,0,0,0,0,0,0,0,1,0,0,0,0,0],'upgrades':[]}, + {'id':20,'buildings':[0,0,0,0,0,0,0,0,1,0,0,0,0,0],'upgrades':[]}, + {'id':21,'buildings':[0,0,0,0,0,0,0,0,10,0,0,0,0,0],'upgrades':[]}, + {'id':48,'buildings':[0,0,0,0,0,0,0,0,50,0,0,0,0,0],'upgrades':[]}, + {'id':114,'buildings':[0,0,0,0,0,0,0,0,100,0,0,0,0,0],'upgrades':[]}, + {'id':196,'buildings':[0,0,0,0,0,0,0,0,200,0,0,0,0,0],'upgrades':[]}, + + {'id':22,'buildings':[0,0,0,0,0,0,0,0,0,1,0,0,0,0],'upgrades':[]}, + {'id':23,'buildings':[0,0,0,0,0,0,0,0,0,1,0,0,0,0],'upgrades':[]}, + {'id':24,'buildings':[0,0,0,0,0,0,0,0,0,10,0,0,0,0],'upgrades':[]}, + {'id':49,'buildings':[0,0,0,0,0,0,0,0,0,50,0,0,0,0],'upgrades':[]}, + {'id':115,'buildings':[0,0,0,0,0,0,0,0,0,100,0,0,0,0],'upgrades':[]}, + {'id':197,'buildings':[0,0,0,0,0,0,0,0,0,200,0,0,0,0],'upgrades':[]}, + + {'id':25,'buildings':[0,0,0,0,0,0,0,0,0,0,1,0,0,0],'upgrades':[]}, + {'id':26,'buildings':[0,0,0,0,0,0,0,0,0,0,1,0,0,0],'upgrades':[]}, + {'id':27,'buildings':[0,0,0,0,0,0,0,0,0,0,10,0,0,0],'upgrades':[]}, + {'id':50,'buildings':[0,0,0,0,0,0,0,0,0,0,50,0,0,0],'upgrades':[]}, + {'id':116,'buildings':[0,0,0,0,0,0,0,0,0,0,100,0,0,0],'upgrades':[]}, + {'id':198,'buildings':[0,0,0,0,0,0,0,0,0,0,200,0,0,0],'upgrades':[]}, + + {'id':28,'buildings':[0,0,0,0,0,0,0,0,0,0,0,1,0,0],'upgrades':[]}, + {'id':29,'buildings':[0,0,0,0,0,0,0,0,0,0,0,1,0,0],'upgrades':[]}, + {'id':30,'buildings':[0,0,0,0,0,0,0,0,0,0,0,10,0,0],'upgrades':[]}, + {'id':51,'buildings':[0,0,0,0,0,0,0,0,0,0,0,50,0,0],'upgrades':[]}, + {'id':117,'buildings':[0,0,0,0,0,0,0,0,0,0,0,100,0,0],'upgrades':[]}, + {'id':199,'buildings':[0,0,0,0,0,0,0,0,0,0,0,200,0,0],'upgrades':[]}, + + {'id':99,'buildings':[0,0,0,0,0,0,0,0,0,0,0,0,1,0],'upgrades':[]}, + {'id':100,'buildings':[0,0,0,0,0,0,0,0,0,0,0,0,1,0],'upgrades':[]}, + {'id':101,'buildings':[0,0,0,0,0,0,0,0,0,0,0,0,10,0],'upgrades':[]}, + {'id':102,'buildings':[0,0,0,0,0,0,0,0,0,0,0,0,50,0],'upgrades':[]}, + {'id':118,'buildings':[0,0,0,0,0,0,0,0,0,0,0,0,100,0],'upgrades':[]}, + {'id':200,'buildings':[0,0,0,0,0,0,0,0,0,0,0,0,200,0],'upgrades':[]}, + + {'id':175,'buildings':[0,0,0,0,0,0,0,0,0,0,0,0,0,1],'upgrades':[]}, + {'id':176,'buildings':[0,0,0,0,0,0,0,0,0,0,0,0,0,1],'upgrades':[]}, + {'id':177,'buildings':[0,0,0,0,0,0,0,0,0,0,0,0,0,10],'upgrades':[]}, + {'id':178,'buildings':[0,0,0,0,0,0,0,0,0,0,0,0,0,50],'upgrades':[]}, + {'id':179,'buildings':[0,0,0,0,0,0,0,0,0,0,0,0,0,100],'upgrades':[]}, + {'id':201,'buildings':[0,0,0,0,0,0,0,0,0,0,0,0,0,200],'upgrades':[]}, + + {'id':57,'buildings':[0,1,15,0,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':58,'buildings':[0,1,0,15,0,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':59,'buildings':[0,1,0,0,15,0,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':60,'buildings':[0,1,0,0,0,15,0,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':61,'buildings':[0,1,0,0,0,0,15,0,0,0,0,0,0,0],'upgrades':[]}, + {'id':62,'buildings':[0,1,0,0,0,0,0,15,0,0,0,0,0,0],'upgrades':[]}, + {'id':63,'buildings':[0,1,0,0,0,0,0,0,15,0,0,0,0,0],'upgrades':[]}, + {'id':103,'buildings':[0,1,0,0,0,0,0,0,0,15,0,0,0,0],'upgrades':[]}, + {'id':180,'buildings':[0,1,0,0,0,0,0,0,0,0,15,0,0,0],'upgrades':[]}, + {'id':250,'buildings':[0,1,0,0,0,0,0,0,0,0,0,15,0,0],'upgrades':[]}, + {'id':251,'buildings':[0,1,0,0,0,0,0,0,0,0,0,0,15,0],'upgrades':[]}, + {'id':252,'buildings':[0,1,0,0,0,0,0,0,0,0,0,0,0,15],'upgrades':[]}, + + {'id':64,'buildings':[0,6,0,0,0,0,0,0,0,0,0],'upgrades':[57,58,59,60,61,62,63]}, + {'id':65,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[64]}, + {'id':66,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[65]}, + {'id':67,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[66]}, + {'id':68,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[67]}, + {'id':69,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[68]}, + {'id':70,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[69]}, + {'id':71,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[70]}, + {'id':72,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[71]}, + {'id':73,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[72]}, + {'id':74,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[73]}, + {'id':75,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[73]}, + {'id':84,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[73]}, + {'id':85,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[73]}, + + {'id':130,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[129]}, + {'id':131,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[130]}, + {'id':132,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[131]}, + {'id':133,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[132]}, + + {'id':152,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[182]}, + {'id':153,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[152],'santa':1}, + {'id':154,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[152],'santa':1}, + {'id':155,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[152],'santa':1}, + {'id':156,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[152],'santa':1}, + {'id':157,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[152],'santa':1}, + {'id':158,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[152],'santa':1}, + {'id':159,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[152],'santa':1}, + {'id':160,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[152],'santa':1}, + {'id':161,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[152],'santa':1}, + {'id':162,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[152],'santa':1}, + {'id':163,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[152],'santa':1}, + {'id':164,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[152],'santa':1}, + {'id':165,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[152],'santa':1}, + {'id':166,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[152],'santa':1}, + {'id':168,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[152],'santa':14}, + + {'id':182,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[181]}, + {'id':183,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[181]}, + {'id':184,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[181]}, + + {'id':134,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[69,183], 'wrinklers':1}, + {'id':135,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[69,183], 'wrinklers':1}, + {'id':136,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[69,183], 'wrinklers':1}, + {'id':137,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[69,183], 'wrinklers':1}, + {'id':138,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[69,183], 'wrinklers':1}, + {'id':139,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[69,183], 'wrinklers':1}, + {'id':140,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[69,183], 'wrinklers':1}, + + {'id':143,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[182]}, + {'id':144,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[182]}, + {'id':145,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[182]}, + {'id':146,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[182]}, + {'id':147,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[182]}, + {'id':148,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[182]}, + {'id':149,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[182]}, + + {'id':169,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[184]}, + {'id':170,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[169,184]}, + {'id':171,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[170,184]}, + {'id':172,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[171,184]}, + {'id':173,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[172,184]}, + {'id':174,'buildings':[0,0,0,0,0,0,0,0,0,0,0],'upgrades':[173,184]} +]; + +var blacklist = [ + { + 'upgrades': [], + 'buildings': [] + }, + { + 'upgrades': [129,130,131,132,133], + 'buildings': [] + }, + { + 'upgrades': true, + 'buildings': [] + }, + { + 'upgrades': [71, 72, 73, 74, 84, 85], + 'buildings': [] + }, + { + 'upgrades': [], + 'buildings': true + } +]; + +var halloweenCookies = [134,135,136,137,138,139,140]; +var christmasCookies = [143,144,145,146,147,148,149]; +var holidayCookies = { + halloween: [134,135,136,137,138,139,140], + christmas: [143,144,145,146,147,148,149], + valentines: [169,170,171,172,173,174], + easter: [210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229] +} + +var cookieInfo = { + 'clot': {'odds':[0,0.10386789477947,0.19565417350258,0.279830557040944], isOverlap:false}, + 'frenzy': {'odds':[0.475438636303817,0.330397784579005,0.17665214624519,0], isOverlap:false}, + 'blood': {'odds':[0,0.021118483342717,0.042826537084539,0.065166067095688], isOverlap:false}, + 'chain': {'odds':[0.004445863757111,0.025152456647178,0.046465712706818,0.068600124409242], isOverlap:false}, + 'ruin': {'odds':[0,0.059020277260868,0.111661484235184,0.171880882712373], isOverlap:false}, + 'frenzyRuin': {'odds':[0,0.031491314174174,0.033674609798233,0], isOverlap:true}, + 'clotRuin': {'odds':[0,0.013356303344429,0.050318079469162,0.107949674328571], isOverlap:true}, + 'lucky': {'odds':[0.070071731013916,0.113288563286977,0.146693408687535,0.171634249195106], isOverlap:false}, + 'frenzyLucky': {'odds':[0.405366905290347,0.219293086015375,0.083880131161928,0], isOverlap:true}, + 'clotLucky': {'odds':[0,0.046715208884435,0.081736878830784,0.107949674328571], isOverlap:true}, + 'click': {'odds':[0.022561043069409,0.020309670016808,0.019242724580528,0.019177860550822], isOverlap:false}, + 'frenzyClick': {'odds':[0.022115820565423,0.012720131151967,0.005384749977878,0], isOverlap:true}, + 'clotClick': {'odds':[0,0.001307530606642,0.005809363719639,0.007810910338684], isOverlap:true}, + 'blah': {'odds':[0,0,0,0], isOverlap:false} +}; + +function generateProbabilities(upgradeMult, minBase, maxMult) { + var cumProb = []; + var remainingProbability = 1; + var minTime = minBase * upgradeMult; + var maxTime = maxMult * minTime; + var spanTime = maxTime - minTime; + for (var i=0; i Date: Wed, 23 Dec 2015 15:29:11 -0500 Subject: [PATCH 104/180] Create fc_button.js --- 1.9/fc_button.js | 498 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 498 insertions(+) create mode 100644 1.9/fc_button.js diff --git a/1.9/fc_button.js b/1.9/fc_button.js new file mode 100644 index 00000000..79f6b49a --- /dev/null +++ b/1.9/fc_button.js @@ -0,0 +1,498 @@ +$('#logButton').before( + $('
').addClass('button') + .html('Frozen
Cookies') + .click(function(){ + Game.ShowMenu('fc_menu'); + }) +); + +$('#logButton').hide(); + +$('