Small naming fixes
This commit is contained in:
1 parent
1e92ff6b92
commit
d3aa2c30db
3 files changed
+41
-40
No files matched your search
+1
-1
@@ -1 +1 @@
|
||||
const CM={Backup:{},Cache:{},Config:{},ConfigData:{},Data:{},Disp:{},Footer:{},Main:{},Options:{},Sim:{},VersionMajor:"2.031",VersionMinor:"3"};CM.Cache.InitCache=function(){CM.Cache.CacheDragonAuras();CM.Cache.CacheWrinklers();CM.Cache.CacheStats();CM.Cache.RemakeGoldenAndWrathCookiesMults();CM.Cache.RemakeChain();CM.Cache.CacheMissingUpgrades();CM.Cache.RemakeSeaSpec();CM.Cache.RemakeIncome();CM.Cache.RemakeBuildingsPrices();CM.Cache.RemakePP()};CM.Cache.CacheDragonAuras=function(){CM.Cache.dragonAura=Game.dragonAura;CM.Cache.dragonAura2=Game.dragonAura2};CM.Cache.CacheWrinklers=function(){CM.Cache.WrinklersTotal=0;CM.Cache.WrinklersNormal=0;CM.Cache.WrinklersFattest=[0,null];for(let i;i<Game.wrinklers.length;i++){var sucked=Game.wrinklers[i].sucked;var toSuck=1.1;if(Game.Has("Sacrilegious corruption"))toSuck*=1.05;if(Game.wrinklers[i].type==1)toSuck*=3;sucked*=toSuck;if(Game.Has("Wrinklerspawn"))sucked*=1.05;if(CM.Sim.Objects.Temple.minigameLoaded){var godLvl=CM.Sim.hasGod("scorn");if(godLvl===1)sucked*=1.15;else if(godLvl===2)sucked*=1.1;else if(godLvl===3)sucked*=1.05}CM.Cache.WrinklersTotal+=sucked;if(Game.wrinklers[i].type===0){CM.Cache.WrinklersNormal+=sucked;if(sucked>CM.Cache.WrinklersFattest[0])CM.Cache.WrinklersFattest=[sucked,i]}}};CM.Cache.CacheStats=function(){CM.Cache.Lucky=CM.Cache.NoGoldSwitchCookiesPS*900/.15;CM.Cache.Lucky*=CM.Cache.DragonsFortuneMultAdjustment;let cpsBuffMult=CM.Sim.getCPSBuffMult();if(cpsBuffMult>0)CM.Cache.Lucky/=cpsBuffMult;else CM.Cache.Lucky=0;CM.Cache.LuckyReward=CM.Cache.GoldenCookiesMult*(CM.Cache.Lucky*.15)+13;CM.Cache.LuckyWrathReward=CM.Cache.WrathCookiesMult*(CM.Cache.Lucky*.15)+13;CM.Cache.LuckyFrenzy=CM.Cache.Lucky*7;CM.Cache.LuckyRewardFrenzy=CM.Cache.GoldenCookiesMult*(CM.Cache.LuckyFrenzy*.15)+13;CM.Cache.LuckyWrathRewardFrenzy=CM.Cache.WrathCookiesMult*(CM.Cache.LuckyFrenzy*.15)+13;CM.Cache.Conjure=CM.Cache.Lucky*2;CM.Cache.ConjureReward=CM.Cache.Conjure*.15;CM.Cache.Edifice=0;let max=0;let n=0;for(let i of Object.keys(Game.Objects)){if(Game.Objects[i].amount>max)max=Game.Objects[i].amount;if(Game.Objects[i].amount>0)n++}for(let i of Object.keys(Game.Objects)){if((Game.Objects[i].amount<max||n===1)&&Game.Objects[i].amount<400&&Game.Objects[i].price*2>CM.Cache.Edifice){CM.Cache.Edifice=Game.Objects[i].price*2;CM.Cache.EdificeBuilding=i}}};CM.Cache.RemakeGoldenAndWrathCookiesMults=function(){if(CM.Footer.isInitzializing){CM.Cache.GoldenCookiesMult=1;CM.Cache.WrathCookiesMult=1;CM.Cache.DragonsFortuneMultAdjustment=1}else{var goldenMult=1;var wrathMult=1;var mult=1;if(CM.Sim.Has("Green yeast digestives"))mult*=1.01;if(CM.Sim.Has("Dragon fang"))mult*=1.03;goldenMult*=1+CM.Sim.auraMult("Ancestral Metamorphosis")*.1;goldenMult*=CM.Sim.eff("goldenCookieGain");wrathMult*=1+CM.Sim.auraMult("Unholy Dominion")*.1;wrathMult*=CM.Sim.eff("wrathCookieGain");CM.Cache.GoldenCookiesMult=mult*goldenMult;CM.Cache.WrathCookiesMult=mult*wrathMult;CM.Cache.DragonsFortuneMultAdjustment=1;if(Game.shimmerTypes.golden.n===0){CM.Cache.DragonsFortuneMultAdjustment*=1+CM.Sim.auraMult("Dragon's Fortune")*1.23}}};CM.Cache.MaxChainMoni=function(digit,maxPayout,mult){let totalFromChain=0;let moni=0;let nextMoni=0;var chain=1+Math.max(0,Math.ceil(Math.log(Game.cookies)/Math.LN10)-10);while(nextMoni<maxPayout){moni=Math.max(digit,Math.min(Math.floor(1/9*Math.pow(10,chain)*digit*mult),maxPayout));nextMoni=Math.max(digit,Math.min(Math.floor(1/9*Math.pow(10,chain+1)*digit*mult),maxPayout));totalFromChain+=moni;chain++}return[totalFromChain,nextMoni]};CM.Cache.RemakeChain=function(){let maxPayout=CM.Cache.NoGoldSwitchCookiesPS*60*60*6*CM.Cache.DragonsFortuneMultAdjustment;let cpsBuffMult=CM.Sim.getCPSBuffMult();if(cpsBuffMult>0)maxPayout/=cpsBuffMult;else maxPayout=0;CM.Cache.ChainReward=CM.Cache.MaxChainMoni(7,maxPayout*CM.Cache.GoldenCookiesMult,CM.Cache.GoldenCookiesMult);CM.Cache.ChainRequired=CM.Cache.ChainReward[0]*2;CM.Cache.ChainRequiredNext=CM.Cache.ChainReward[1]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment;CM.Cache.ChainWrathReward=CM.Cache.MaxChainMoni(6,maxPayout*CM.Cache.WrathCookiesMult,CM.Cache.WrathCookiesMult);CM.Cache.ChainWrathRequired=CM.Cache.ChainWrathReward[0]*2;CM.Cache.ChainWrathRequiredNext=CM.Cache.ChainWrathReward[1]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment;CM.Cache.ChainFrenzyReward=CM.Cache.MaxChainMoni(7,maxPayout*7*CM.Cache.GoldenCookiesMult,CM.Cache.GoldenCookiesMult);CM.Cache.ChainFrenzyRequired=CM.Cache.ChainFrenzyReward[0]*2;CM.Cache.ChainFrenzyRequiredNext=CM.Cache.ChainFrenzyReward[1]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment;CM.Cache.ChainFrenzyWrathReward=CM.Cache.MaxChainMoni(6,maxPayout*7*CM.Cache.WrathCookiesMult,CM.Cache.WrathCookiesMult);CM.Cache.ChainFrenzyWrathRequired=CM.Cache.ChainFrenzyReward[0]*2;CM.Cache.ChainFrenzyWrathRequiredNext=CM.Cache.ChainFrenzyReward[1]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment};CM.Cache.CacheMissingUpgrades=function(){CM.Cache.MissingUpgrades="";CM.Cache.MissingUpgradesCookies="";CM.Cache.MissingUpLine truncated
|
||||
const CM={Backup:{},Cache:{},Config:{},ConfigData:{},Data:{},Disp:{},Footer:{},Main:{},Options:{},Sim:{},VersionMajor:"2.031",VersionMinor:"3"};CM.Cache.InitCache=function(){CM.Cache.CacheDragonAuras();CM.Cache.CacheWrinklers();CM.Cache.CacheStats();CM.Cache.CacheGoldenAndWrathCookiesMults();CM.Cache.CacheChain();CM.Cache.CacheMissingUpgrades();CM.Cache.CacheSeaSpec();CM.Cache.CacheAvgCPS();CM.Cache.CacheIncome();CM.Cache.CacheBuildingsPrices();CM.Cache.CachePP()};CM.Cache.CacheDragonAuras=function(){CM.Cache.dragonAura=Game.dragonAura;CM.Cache.dragonAura2=Game.dragonAura2};CM.Cache.CacheWrinklers=function(){CM.Cache.WrinklersTotal=0;CM.Cache.WrinklersNormal=0;CM.Cache.WrinklersFattest=[0,null];for(let i;i<Game.wrinklers.length;i++){var sucked=Game.wrinklers[i].sucked;var toSuck=1.1;if(Game.Has("Sacrilegious corruption"))toSuck*=1.05;if(Game.wrinklers[i].type==1)toSuck*=3;sucked*=toSuck;if(Game.Has("Wrinklerspawn"))sucked*=1.05;if(CM.Sim.Objects.Temple.minigameLoaded){var godLvl=CM.Sim.hasGod("scorn");if(godLvl===1)sucked*=1.15;else if(godLvl===2)sucked*=1.1;else if(godLvl===3)sucked*=1.05}CM.Cache.WrinklersTotal+=sucked;if(Game.wrinklers[i].type===0){CM.Cache.WrinklersNormal+=sucked;if(sucked>CM.Cache.WrinklersFattest[0])CM.Cache.WrinklersFattest=[sucked,i]}}};CM.Cache.CacheStats=function(){CM.Cache.Lucky=CM.Cache.NoGoldSwitchCookiesPS*900/.15;CM.Cache.Lucky*=CM.Cache.DragonsFortuneMultAdjustment;let cpsBuffMult=CM.Sim.getCPSBuffMult();if(cpsBuffMult>0)CM.Cache.Lucky/=cpsBuffMult;else CM.Cache.Lucky=0;CM.Cache.LuckyReward=CM.Cache.GoldenCookiesMult*(CM.Cache.Lucky*.15)+13;CM.Cache.LuckyWrathReward=CM.Cache.WrathCookiesMult*(CM.Cache.Lucky*.15)+13;CM.Cache.LuckyFrenzy=CM.Cache.Lucky*7;CM.Cache.LuckyRewardFrenzy=CM.Cache.GoldenCookiesMult*(CM.Cache.LuckyFrenzy*.15)+13;CM.Cache.LuckyWrathRewardFrenzy=CM.Cache.WrathCookiesMult*(CM.Cache.LuckyFrenzy*.15)+13;CM.Cache.Conjure=CM.Cache.Lucky*2;CM.Cache.ConjureReward=CM.Cache.Conjure*.15;CM.Cache.Edifice=0;let max=0;let n=0;for(let i of Object.keys(Game.Objects)){if(Game.Objects[i].amount>max)max=Game.Objects[i].amount;if(Game.Objects[i].amount>0)n++}for(let i of Object.keys(Game.Objects)){if((Game.Objects[i].amount<max||n===1)&&Game.Objects[i].amount<400&&Game.Objects[i].price*2>CM.Cache.Edifice){CM.Cache.Edifice=Game.Objects[i].price*2;CM.Cache.EdificeBuilding=i}}};CM.Cache.CacheGoldenAndWrathCookiesMults=function(){if(CM.Footer.isInitzializing){CM.Cache.GoldenCookiesMult=1;CM.Cache.WrathCookiesMult=1;CM.Cache.DragonsFortuneMultAdjustment=1}else{var goldenMult=1;var wrathMult=1;var mult=1;if(CM.Sim.Has("Green yeast digestives"))mult*=1.01;if(CM.Sim.Has("Dragon fang"))mult*=1.03;goldenMult*=1+CM.Sim.auraMult("Ancestral Metamorphosis")*.1;goldenMult*=CM.Sim.eff("goldenCookieGain");wrathMult*=1+CM.Sim.auraMult("Unholy Dominion")*.1;wrathMult*=CM.Sim.eff("wrathCookieGain");CM.Cache.GoldenCookiesMult=mult*goldenMult;CM.Cache.WrathCookiesMult=mult*wrathMult;CM.Cache.DragonsFortuneMultAdjustment=1;if(Game.shimmerTypes.golden.n===0){CM.Cache.DragonsFortuneMultAdjustment*=1+CM.Sim.auraMult("Dragon's Fortune")*1.23}}};CM.Cache.MaxChainMoni=function(digit,maxPayout,mult){let totalFromChain=0;let moni=0;let nextMoni=0;var chain=1+Math.max(0,Math.ceil(Math.log(Game.cookies)/Math.LN10)-10);while(nextMoni<maxPayout){moni=Math.max(digit,Math.min(Math.floor(1/9*Math.pow(10,chain)*digit*mult),maxPayout));nextMoni=Math.max(digit,Math.min(Math.floor(1/9*Math.pow(10,chain+1)*digit*mult),maxPayout));totalFromChain+=moni;chain++}return[totalFromChain,nextMoni]};CM.Cache.CacheChain=function(){let maxPayout=CM.Cache.NoGoldSwitchCookiesPS*60*60*6*CM.Cache.DragonsFortuneMultAdjustment;let cpsBuffMult=CM.Sim.getCPSBuffMult();if(cpsBuffMult>0)maxPayout/=cpsBuffMult;else maxPayout=0;CM.Cache.ChainReward=CM.Cache.MaxChainMoni(7,maxPayout*CM.Cache.GoldenCookiesMult,CM.Cache.GoldenCookiesMult);CM.Cache.ChainRequired=CM.Cache.ChainReward[0]*2;CM.Cache.ChainRequiredNext=CM.Cache.ChainReward[1]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment;CM.Cache.ChainWrathReward=CM.Cache.MaxChainMoni(6,maxPayout*CM.Cache.WrathCookiesMult,CM.Cache.WrathCookiesMult);CM.Cache.ChainWrathRequired=CM.Cache.ChainWrathReward[0]*2;CM.Cache.ChainWrathRequiredNext=CM.Cache.ChainWrathReward[1]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment;CM.Cache.ChainFrenzyReward=CM.Cache.MaxChainMoni(7,maxPayout*7*CM.Cache.GoldenCookiesMult,CM.Cache.GoldenCookiesMult);CM.Cache.ChainFrenzyRequired=CM.Cache.ChainFrenzyReward[0]*2;CM.Cache.ChainFrenzyRequiredNext=CM.Cache.ChainFrenzyReward[1]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment;CM.Cache.ChainFrenzyWrathReward=CM.Cache.MaxChainMoni(6,maxPayout*7*CM.Cache.WrathCookiesMult,CM.Cache.WrathCookiesMult);CM.Cache.ChainFrenzyWrathRequired=CM.Cache.ChainFrenzyReward[0]*2;CM.Cache.ChainFrenzyWrathRequiredNext=CM.Cache.ChainFrenzyReward[1]/60/60/6/CM.Cache.DragonsFortuneMultAdjustment};CM.Cache.CacheMissingUpgrades=function(){CM.Cache.MissingUpgrades="";CM.Cache.MissingUpgradesCookies="";CM.Line truncated
|
||||
+31
-30
@@ -15,13 +15,14 @@ CM.Cache.InitCache = function() {
|
||||
CM.Cache.CacheDragonAuras();
|
||||
CM.Cache.CacheWrinklers();
|
||||
CM.Cache.CacheStats();
|
||||
CM.Cache.RemakeGoldenAndWrathCookiesMults();
|
||||
CM.Cache.RemakeChain();
|
||||
CM.Cache.CacheGoldenAndWrathCookiesMults();
|
||||
CM.Cache.CacheChain();
|
||||
CM.Cache.CacheMissingUpgrades();
|
||||
CM.Cache.RemakeSeaSpec();
|
||||
CM.Cache.RemakeIncome();
|
||||
CM.Cache.RemakeBuildingsPrices();
|
||||
CM.Cache.RemakePP();
|
||||
CM.Cache.CacheSeaSpec();
|
||||
CM.Cache.CacheAvgCPS();
|
||||
CM.Cache.CacheIncome();
|
||||
CM.Cache.CacheBuildingsPrices();
|
||||
CM.Cache.CachePP();
|
||||
};
|
||||
|
||||
/********
|
||||
@@ -53,7 +54,7 @@ CM.Cache.CacheWrinklers = function() {
|
||||
CM.Cache.WrinklersTotal = 0;
|
||||
CM.Cache.WrinklersNormal = 0;
|
||||
CM.Cache.WrinklersFattest = [0, null];
|
||||
for (let i; i < Game.wrinklers.length; i++) {
|
||||
for (let i = 0; i < Game.wrinklers.length; i++) {
|
||||
var sucked = Game.wrinklers[i].sucked;
|
||||
var toSuck = 1.1;
|
||||
if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05;
|
||||
@@ -124,13 +125,13 @@ CM.Cache.CacheStats = function() {
|
||||
|
||||
/**
|
||||
* This functions calculates the multipliers of Golden and Wrath cookie rewards
|
||||
* It is mostly used by CM.Cache.MaxChainMoni() and CM.Cache.RemakeChain()
|
||||
* It is called by CM.Disp.CreateStatsChainSection() and CM.Cache.RemakeChain()
|
||||
* It is mostly used by CM.Cache.MaxChainMoni() and CM.Cache.CacheChain()
|
||||
* It is called by CM.Disp.CreateStatsChainSection() and CM.Cache.CacheChain()
|
||||
* @param {number} CM.Cache.GoldenCookiesMult Multiplier for golden cookies
|
||||
* @param {number} CM.Cache.WrathCookiesMult Multiplier for wrath cookies
|
||||
* @param {number} CM.Cache.DragonsFortuneMultAdjustment Multiplier for dragon fortune + active golden cookie
|
||||
*/
|
||||
CM.Cache.RemakeGoldenAndWrathCookiesMults = function() {
|
||||
CM.Cache.CacheGoldenAndWrathCookiesMults = function() {
|
||||
if (CM.Footer.isInitzializing) {
|
||||
CM.Cache.GoldenCookiesMult = 1;
|
||||
CM.Cache.WrathCookiesMult = 1;
|
||||
@@ -166,7 +167,7 @@ CM.Cache.RemakeGoldenAndWrathCookiesMults = function() {
|
||||
|
||||
/**
|
||||
* This functions calculates the max possible payout
|
||||
* It is called by CM.Disp.CreateStatsChainSection() and CM.Cache.RemakeChain()
|
||||
* It is called by CM.Disp.CreateStatsChainSection() and CM.Cache.CacheChain()
|
||||
* @param {number} digit Number of Golden Cookies in chain
|
||||
* @param {number} maxPayout Maximum payout
|
||||
* @param {number} mult Multiplier
|
||||
@@ -203,7 +204,7 @@ CM.Cache.MaxChainMoni = function(digit, maxPayout, mult) {
|
||||
* @global {number} CM.Cache.ChainFrenzyWrathRequired Cookies needed for maximum reward for wrath frenzy chain
|
||||
* @global {number} CM.Cache.ChainFrenzyWrathRequiredNext Total cookies needed for next level for wrath frenzy chain
|
||||
*/
|
||||
CM.Cache.RemakeChain = function() {
|
||||
CM.Cache.CacheChain = function() {
|
||||
let maxPayout = CM.Cache.NoGoldSwitchCookiesPS * 60 * 60 * 6 * CM.Cache.DragonsFortuneMultAdjustment;
|
||||
// Removes effect of Frenzy etc.
|
||||
let cpsBuffMult = CM.Sim.getCPSBuffMult();
|
||||
@@ -270,7 +271,7 @@ CM.Cache.CacheMissingUpgrades = function() {
|
||||
* It is called by CM.Loop() and CM.Cache.InitCache()
|
||||
* @global {number} CM.Cache.SeaSpec The reward for popping a reindeer
|
||||
*/
|
||||
CM.Cache.RemakeSeaSpec = function() {
|
||||
CM.Cache.CacheSeaSpec = function() {
|
||||
if (Game.season === 'christmas') {
|
||||
var val = Game.cookiesPs * 60;
|
||||
if (Game.hasBuff('Elder frenzy')) val *= 0.5;
|
||||
@@ -316,7 +317,7 @@ class CMAvgQueue {
|
||||
}
|
||||
|
||||
/**
|
||||
* This functions caches creates the CMAvgQueue used by CM.Cache.UpdateAvgCPS() to calculate CPS
|
||||
* This functions caches creates the CMAvgQueue used by CM.Cache.CacheAvgCPS() to calculate CPS
|
||||
* Called by CM.DelayInit()
|
||||
*/
|
||||
CM.Cache.InitCookiesDiff = function() {
|
||||
@@ -336,7 +337,7 @@ CM.Cache.InitCookiesDiff = function() {
|
||||
* @global {number} CM.Cache.AverageClicks Average cookies from clicking over time-period as defined by AvgClicksHist
|
||||
* @global {number} CM.Cache.AvgCPSChoEgg Average cookies from combination of normal CPS and average Chocolate Cookie CPS
|
||||
*/
|
||||
CM.Cache.UpdateAvgCPS = function() {
|
||||
CM.Cache.CacheAvgCPS = function() {
|
||||
var currDate = Math.floor(Date.now() / 1000);
|
||||
// Only calculate every new second
|
||||
if ((Game.T / Game.fps) % 1 === 0) {
|
||||
@@ -396,7 +397,7 @@ CM.Cache.UpdateAvgCPS = function() {
|
||||
* It is called by CM.Loop()
|
||||
* @global {number} CM.Cache.SellForChoEgg Total cookies to be gained from selling Chocolate egg
|
||||
*/
|
||||
CM.Cache.RemakeSellForChoEgg = function() {
|
||||
CM.Cache.CacheSellForChoEgg = function() {
|
||||
var sellTotal = 0;
|
||||
// Compute cookies earned by selling stock market goods
|
||||
if (Game.Objects.Bank.minigameLoaded) {
|
||||
@@ -419,7 +420,7 @@ CM.Cache.RemakeSellForChoEgg = function() {
|
||||
* @global {number} CM.Cache.CurrWrinklerCount Current number of wrinklers
|
||||
* @global {number} CM.Cache.CurrWrinklerCPSMult Current multiplier of CPS because of wrinklers (excluding their negative sucking effect)
|
||||
*/
|
||||
CM.Cache.UpdateCurrWrinklerCPS = function() {
|
||||
CM.Cache.CacheCurrWrinklerCPS = function() {
|
||||
CM.Cache.CurrWrinklerCPSMult = 0;
|
||||
let count = 0;
|
||||
for (let i in Game.wrinklers) {
|
||||
@@ -501,7 +502,7 @@ CM.Cache.CacheDragonCost = function() {
|
||||
* This functions caches the income gain of each building and upgrade and stores it in the cache
|
||||
* It is called by CM.Loop() and CM.Cache.InitCache()
|
||||
*/
|
||||
CM.Cache.RemakeIncome = function() {
|
||||
CM.Cache.CacheIncome = function() {
|
||||
// Simulate Building Buys for 1, 10 and 100 amount
|
||||
CM.Sim.BuyBuildings(1, 'Objects1');
|
||||
CM.Sim.BuyBuildings(10, 'Objects10');
|
||||
@@ -518,7 +519,7 @@ CM.Cache.RemakeIncome = function() {
|
||||
* This functions caches the price of each building and stores it in the cache
|
||||
* It is called by CM.Loop() and CM.Cache.InitCache()
|
||||
*/
|
||||
CM.Cache.RemakeBuildingsPrices = function() {
|
||||
CM.Cache.CacheBuildingsPrices = function() {
|
||||
for (let i of Object.keys(Game.Objects)) {
|
||||
CM.Cache.Objects1[i].price = CM.Sim.BuildingGetPrice(Game.Objects[i], Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 1);
|
||||
CM.Cache.Objects10[i].price = CM.Sim.BuildingGetPrice(Game.Objects[i], Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, 10);
|
||||
@@ -533,16 +534,16 @@ CM.Cache.RemakeBuildingsPrices = function() {
|
||||
* This functions caches the PP of each building and upgrade and stores it in the cache
|
||||
* It is called by CM.Loop() and CM.Cache.InitCache()
|
||||
*/
|
||||
CM.Cache.RemakePP = function() {
|
||||
CM.Cache.RemakeBuildingsPP();
|
||||
CM.Cache.RemakeUpgradePP();
|
||||
CM.Cache.CachePP = function() {
|
||||
CM.Cache.CacheBuildingsPP();
|
||||
CM.Cache.CacheUpgradePP();
|
||||
};
|
||||
|
||||
/**
|
||||
* This functions caches the PP of each building it saves all date in CM.Cache.Objects...
|
||||
* It is called by CM.Cache.RemakePP()
|
||||
* It is called by CM.Cache.CachePP()
|
||||
*/
|
||||
CM.Cache.RemakeBuildingsPP = function() {
|
||||
CM.Cache.CacheBuildingsPP = function() {
|
||||
CM.Cache.min = -1;
|
||||
CM.Cache.max = -1;
|
||||
CM.Cache.mid = -1;
|
||||
@@ -565,8 +566,8 @@ CM.Cache.RemakeBuildingsPP = function() {
|
||||
CM.Cache.Objects1[i].color = color;
|
||||
}
|
||||
// Calculate PP of bulk-buy modes
|
||||
CM.Cache.RemakeBuildingsBulkPP('Objects10');
|
||||
CM.Cache.RemakeBuildingsBulkPP('Objects100');
|
||||
CM.Cache.CacheBuildingsBulkPP('Objects10');
|
||||
CM.Cache.CacheBuildingsBulkPP('Objects100');
|
||||
}
|
||||
// Calculate PP and colors when compared to purchase of selected bulk mode
|
||||
else {
|
||||
@@ -593,9 +594,9 @@ CM.Cache.RemakeBuildingsPP = function() {
|
||||
/**
|
||||
* This functions caches the buildings of bulk-buy mode when PP is compared against optimal single-purchase building
|
||||
* It saves all date in CM.Cache.Objects...
|
||||
* It is called by CM.Cache.RemakeBuildingsPP()
|
||||
* It is called by CM.Cache.CacheBuildingsPP()
|
||||
*/
|
||||
CM.Cache.RemakeBuildingsBulkPP = function(target) {
|
||||
CM.Cache.CacheBuildingsBulkPP = function(target) {
|
||||
for (let i of Object.keys(CM.Cache[target])) {
|
||||
if (Game.cookiesPs) {
|
||||
CM.Cache[target][i].pp = (Math.max(CM.Cache[target][i].price - (Game.cookies + CM.Disp.GetWrinkConfigBank()), 0) / Game.cookiesPs) + (CM.Cache[target][i].price / CM.Cache[target][i].bonus);
|
||||
@@ -615,9 +616,9 @@ CM.Cache.RemakeBuildingsBulkPP = function(target) {
|
||||
|
||||
/**
|
||||
* This functions caches the PP of each building it saves all date in CM.Cache.Upgrades
|
||||
* It is called by CM.Cache.RemakePP()
|
||||
* It is called by CM.Cache.CachePP()
|
||||
*/
|
||||
CM.Cache.RemakeUpgradePP = function() {
|
||||
CM.Cache.CacheUpgradePP = function() {
|
||||
for (let i of Object.keys(CM.Cache.Upgrades)) {
|
||||
if (Game.cookiesPs) {
|
||||
CM.Cache.Upgrades[i].pp = (Math.max(Game.Upgrades[i].getPrice() - (Game.cookies + CM.Disp.GetWrinkConfigBank()), 0) / Game.cookiesPs) + (Game.Upgrades[i].getPrice() / CM.Cache.Upgrades[i].bonus);
|
||||
|
||||
+9
-9
@@ -145,17 +145,17 @@ CM.Loop = function() {
|
||||
if (!Game.OnAscend && Game.AscendTimer === 0) {
|
||||
// CM.Sim.DoSims is set whenever CPS has changed
|
||||
if (CM.Sim.DoSims) {
|
||||
CM.Cache.RemakeIncome();
|
||||
CM.Cache.CacheIncome();
|
||||
|
||||
CM.Sim.NoGoldSwitchCookiesPS(); // Needed first
|
||||
CM.Cache.RemakeGoldenAndWrathCookiesMults();
|
||||
CM.Cache.CacheGoldenAndWrathCookiesMults();
|
||||
CM.Cache.CacheStats();
|
||||
CM.Cache.CacheMissingUpgrades();
|
||||
CM.Cache.RemakeChain();
|
||||
CM.Cache.CacheChain();
|
||||
CM.Cache.CacheDragonCost();
|
||||
|
||||
CM.Cache.RemakeSeaSpec();
|
||||
CM.Cache.RemakeSellForChoEgg();
|
||||
CM.Cache.CacheSeaSpec();
|
||||
CM.Cache.CacheSellForChoEgg();
|
||||
|
||||
CM.Sim.DoSims = 0;
|
||||
|
||||
@@ -173,7 +173,7 @@ CM.Loop = function() {
|
||||
}
|
||||
|
||||
if (CM.Cache.DoRemakeBuildPrices) {
|
||||
CM.Cache.RemakeBuildingsPrices();
|
||||
CM.Cache.CacheBuildingsPrices();
|
||||
CM.Cache.DoRemakeBuildPrices = 0;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ CM.Loop = function() {
|
||||
CM.Cache.CacheWrinklers();
|
||||
|
||||
// Calculate PP
|
||||
CM.Cache.RemakePP();
|
||||
CM.Cache.CachePP();
|
||||
}
|
||||
|
||||
// Check all changing minigames and game-states
|
||||
@@ -193,8 +193,8 @@ CM.Loop = function() {
|
||||
CM.Main.CheckWrinklerCount();
|
||||
|
||||
// Update Average CPS (might need to move)
|
||||
CM.Cache.UpdateCurrWrinklerCPS();
|
||||
CM.Cache.UpdateAvgCPS();
|
||||
CM.Cache.CacheCurrWrinklerCPS();
|
||||
CM.Cache.CacheAvgCPS();
|
||||
};
|
||||
|
||||
CM.DelayInit = function() {
|
||||
|
||||
Reference in new issue
Block a user