456 lines
16 KiB
JavaScript
456 lines
16 KiB
JavaScript
/*******
|
|
* Sim *
|
|
*******/
|
|
|
|
CM.Sim.BuildingGetPrice = function(basePrice, start, free, increase) {
|
|
/*var price=0;
|
|
for (var i = Math.max(0 , start); i < Math.max(0, start + increase); i++) {
|
|
price += basePrice * Math.pow(Game.priceIncrease, Math.max(0, i - free));
|
|
}
|
|
if (Game.Has('Season savings')) price *= 0.99;
|
|
if (Game.Has('Santa\'s dominion')) price *= 0.99;
|
|
if (Game.Has('Faberge egg')) price *= 0.99;
|
|
if (Game.Has('Divine discount')) price *= 0.99;
|
|
if (Game.hasAura('Fierce Hoarder')) price *= 0.98;
|
|
return Math.ceil(price);*/
|
|
|
|
var moni = 0;
|
|
for (var i = 0; i < increase; i++) {
|
|
var price = basePrice * Math.pow(Game.priceIncrease, Math.max(0, start - free));
|
|
if (Game.Has('Season savings')) price *= 0.99;
|
|
if (Game.Has('Santa\'s dominion')) price *= 0.99;
|
|
if (Game.Has('Faberge egg')) price *= 0.99;
|
|
if (Game.Has('Divine discount')) price *= 0.99;
|
|
if (Game.hasAura('Fierce Hoarder')) price *= 0.98;
|
|
price = Math.ceil(price);
|
|
moni+=price;
|
|
start++;
|
|
}
|
|
return moni;
|
|
}
|
|
|
|
CM.Sim.BuildingSell = function(basePrice, start, free, amount, emuAura) {
|
|
/*var price=0;
|
|
for (var i = Math.max(0, start - amount); i < Math.max(0, start); i++) {
|
|
price += basePrice * Math.pow(Game.priceIncrease, Math.max(0, i - free));
|
|
}
|
|
if (Game.Has('Season savings')) price*=0.99;
|
|
if (Game.Has('Santa\'s dominion')) price*=0.99;
|
|
if (Game.Has('Faberge egg')) price*=0.99;
|
|
if (Game.Has('Divine discount')) price*=0.99;
|
|
if (Game.hasAura('Fierce Hoarder')) price*=0.98;
|
|
if (Game.hasAura('Earth Shatterer') || emuAura) {
|
|
price *= 0.85;
|
|
}
|
|
else {
|
|
price *= 0.5;
|
|
}
|
|
return Math.ceil(price);*/
|
|
|
|
var moni=0;
|
|
for (var i = 0; i < amount; i++) {
|
|
var price = basePrice * Math.pow(Game.priceIncrease, Math.max(0, start - free));
|
|
if (Game.Has('Season savings')) price *= 0.99;
|
|
if (Game.Has('Santa\'s dominion')) price *= 0.99;
|
|
if (Game.Has('Faberge egg')) price *= 0.99;
|
|
if (Game.Has('Divine discount')) price *= 0.99;
|
|
if (Game.hasAura('Fierce Hoarder')) price *= 0.98;
|
|
price = Math.ceil(price);
|
|
var giveBack = 0.5;
|
|
if (Game.hasAura('Earth Shatterer') || emuAura) giveBack=0.85;
|
|
price = Math.floor(price * giveBack);
|
|
if (start > 0) {
|
|
moni += price;
|
|
start--;
|
|
}
|
|
}
|
|
return moni;
|
|
}
|
|
|
|
CM.Sim.Has = function(what) {
|
|
if (Game.ascensionMode == 1 && Game.Upgrades[what].pool == 'prestige') return 0;
|
|
return (CM.Sim.Upgrades[what] ? CM.Sim.Upgrades[what].bought : 0);
|
|
}
|
|
|
|
|
|
CM.Sim.Win = function(what) {
|
|
if (CM.Sim.Achievements[what]) {
|
|
if (CM.Sim.Achievements[what].won == 0) {
|
|
CM.Sim.Achievements[what].won = 1;
|
|
if (Game.Achievements[what].pool != 'shadow') CM.Sim.AchievementsOwned++;
|
|
}
|
|
}
|
|
}
|
|
|
|
eval('CM.Sim.HasAchiev = ' + Game.HasAchiev.toString().split('Game').join('CM.Sim'));
|
|
|
|
eval('CM.Sim.GetHeavenlyMultiplier = ' + Game.GetHeavenlyMultiplier.toString().split('Game').join('CM.Sim'));
|
|
|
|
CM.Sim.hasAura = function(what) {
|
|
if (Game.dragonAuras[CM.Sim.dragonAura].name == what || Game.dragonAuras[CM.Sim.dragonAura2].name == what)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
eval('CM.Sim.GetTieredCpsMult = ' + Game.GetTieredCpsMult.toString().split('Game.Has').join('CM.Sim.Has').split('me.tieredUpgrades').join('Game.Objects[me.name].tieredUpgrades').split('me.synergies').join('Game.Objects[me.name].synergies').split('syn.buildingTie1.amount').join('CM.Sim.Objects[syn.buildingTie1.name].amount').split('syn.buildingTie2.amount').join('CM.Sim.Objects[syn.buildingTie2.name].amount'));
|
|
|
|
eval('CM.Sim.getGrandmaSynergyUpgradeMultiplier = ' + Game.getGrandmaSynergyUpgradeMultiplier.toString().split('Game.Objects[\'Grandma\']').join('CM.Sim.Objects[\'Grandma\']'));
|
|
|
|
CM.Sim.InitData = function() {
|
|
// Buildings
|
|
CM.Sim.Objects = [];
|
|
for (var i in Game.Objects) {
|
|
CM.Sim.Objects[i] = {};
|
|
var me = Game.Objects[i];
|
|
var you = CM.Sim.Objects[i];
|
|
eval('you.cps = ' + me.cps.toString().split('Game.Has').join('CM.Sim.Has').split('Game.hasAura').join('CM.Sim.hasAura').split('Game.Objects').join('CM.Sim.Objects').split('Game.GetTieredCpsMult').join('CM.Sim.GetTieredCpsMult').split('Game.getGrandmaSynergyUpgradeMultiplier').join('CM.Sim.getGrandmaSynergyUpgradeMultiplier'));
|
|
// Below is needed for above eval!
|
|
you.baseCps = me.baseCps;
|
|
you.name = me.name;
|
|
}
|
|
|
|
// Upgrades
|
|
CM.Sim.Upgrades = [];
|
|
for (var i in Game.Upgrades) {
|
|
CM.Sim.Upgrades[i] = {};
|
|
}
|
|
|
|
// Achievements
|
|
CM.Sim.Achievements = [];
|
|
for (var i in Game.Achievements) {
|
|
CM.Sim.Achievements[i] = {};
|
|
}
|
|
}
|
|
|
|
CM.Sim.CopyData = function() {
|
|
// Other variables
|
|
CM.Sim.UpgradesOwned = Game.UpgradesOwned;
|
|
CM.Sim.pledges = Game.pledges;
|
|
CM.Sim.AchievementsOwned = Game.AchievementsOwned;
|
|
CM.Sim.heavenlyPower = Game.heavenlyPower;
|
|
CM.Sim.prestige = Game.prestige;
|
|
CM.Sim.dragonAura = Game.dragonAura;
|
|
CM.Sim.dragonAura2 = Game.dragonAura2;
|
|
|
|
// Buildings
|
|
for (var i in Game.Objects) {
|
|
var me = Game.Objects[i];
|
|
var you = CM.Sim.Objects[i];
|
|
you.amount = me.amount;
|
|
}
|
|
|
|
// Upgrades
|
|
for (var i in Game.Upgrades) {
|
|
var me = Game.Upgrades[i];
|
|
var you = CM.Sim.Upgrades[i];
|
|
you.bought = me.bought;
|
|
}
|
|
|
|
// Achievements
|
|
for (var i in Game.Achievements) {
|
|
var me = Game.Achievements[i];
|
|
var you = CM.Sim.Achievements[i];
|
|
you.won = me.won;
|
|
}
|
|
};
|
|
|
|
|
|
CM.Sim.CalculateGains = function() {
|
|
CM.Sim.cookiesPs = 0;
|
|
var mult = 1;
|
|
|
|
if (Game.ascensionMode != 1) mult += parseFloat(CM.Sim.prestige) * 0.01 * CM.Sim.heavenlyPower * CM.Sim.GetHeavenlyMultiplier();
|
|
|
|
var cookieMult = 0;
|
|
for (var i in CM.Sim.Upgrades) {
|
|
var me = CM.Sim.Upgrades[i];
|
|
if (me.bought > 0) {
|
|
if (Game.Upgrades[i].pool == 'cookie' && CM.Sim.Has(Game.Upgrades[i].name)) mult *= (1 + (typeof(Game.Upgrades[i].power) == 'function' ? Game.Upgrades[i].power(Game.Upgrades[i]) : Game.Upgrades[i].power) * 0.01);
|
|
}
|
|
}
|
|
|
|
mult *= (1 + 0.01 * cookieMult);
|
|
if (CM.Sim.Has('Specialized chocolate chips')) mult *= 1.01;
|
|
if (CM.Sim.Has('Designer cocoa beans')) mult *= 1.02;
|
|
if (CM.Sim.Has('Underworld ovens')) mult *= 1.03;
|
|
if (CM.Sim.Has('Exotic nuts')) mult *= 1.04;
|
|
if (CM.Sim.Has('Arcane sugar')) mult *= 1.05;
|
|
|
|
if (CM.Sim.Has('Increased merriness')) mult *= 1.15;
|
|
if (CM.Sim.Has('Improved jolliness')) mult *= 1.15;
|
|
if (CM.Sim.Has('A lump of coal')) mult *= 1.01;
|
|
if (CM.Sim.Has('An itchy sweater')) mult *= 1.01;
|
|
if (CM.Sim.Has('Santa\'s dominion')) mult *= 1.2;
|
|
|
|
if (CM.Sim.Has('Santa\'s legacy')) mult *= 1 + (Game.santaLevel + 1) * 0.03;
|
|
|
|
for (var i in CM.Sim.Objects) {
|
|
var me = CM.Sim.Objects[i];
|
|
CM.Sim.cookiesPs += me.amount * (typeof(me.cps) == 'function' ? me.cps(me) : me.cps);
|
|
}
|
|
|
|
if (CM.Sim.Has('"egg"')) CM.Sim.cookiesPs += 9; // "egg"
|
|
|
|
var milkMult=1;
|
|
if (CM.Sim.Has('Santa\'s milk and cookies')) milkMult *= 1.05;
|
|
if (CM.Sim.hasAura('Breath of Milk')) milkMult *= 1.05;
|
|
if (CM.Sim.Has('Kitten helpers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult);
|
|
if (CM.Sim.Has('Kitten workers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.125 * milkMult);
|
|
if (CM.Sim.Has('Kitten engineers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.15 * milkMult);
|
|
if (CM.Sim.Has('Kitten overseers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.175 * milkMult);
|
|
if (CM.Sim.Has('Kitten managers')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult);
|
|
if (CM.Sim.Has('Kitten accountants')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult);
|
|
if (CM.Sim.Has('Kitten specialists')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult);
|
|
if (CM.Sim.Has('Kitten experts')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.2 * milkMult);
|
|
if (CM.Sim.Has('Kitten angels')) mult *= (1 + (CM.Sim.AchievementsOwned / 25) * 0.1 * milkMult);
|
|
|
|
var eggMult = 0;
|
|
if (CM.Sim.Has('Chicken egg')) eggMult++;
|
|
if (CM.Sim.Has('Duck egg')) eggMult++;
|
|
if (CM.Sim.Has('Turkey egg')) eggMult++;
|
|
if (CM.Sim.Has('Quail egg')) eggMult++;
|
|
if (CM.Sim.Has('Robin egg')) eggMult++;
|
|
if (CM.Sim.Has('Ostrich egg')) eggMult++;
|
|
if (CM.Sim.Has('Cassowary egg')) eggMult++;
|
|
if (CM.Sim.Has('Salmon roe')) eggMult++;
|
|
if (CM.Sim.Has('Frogspawn')) eggMult++;
|
|
if (CM.Sim.Has('Shark egg')) eggMult++;
|
|
if (CM.Sim.Has('Turtle egg')) eggMult++;
|
|
if (CM.Sim.Has('Ant larva')) eggMult++;
|
|
if (CM.Sim.Has('Century egg')) {
|
|
// The boost increases a little every day, with diminishing returns up to +10% on the 100th day
|
|
var day = Math.floor((CM.Sim.Date - Game.startDate) / 1000 / 10) * 10 / 60 / 60 / 24;
|
|
day = Math.min(day,100);
|
|
eggMult += (1 - Math.pow(1 - day / 100, 3)) * 10;
|
|
}
|
|
mult *= (1 + 0.01 * eggMult);
|
|
|
|
if (CM.Sim.hasAura('Radiant Appetite')) mult *= 2;
|
|
|
|
var rawCookiesPs = CM.Sim.cookiesPs * mult;
|
|
for (var i in Game.CpsAchievements) {
|
|
if (rawCookiesPs >= Game.CpsAchievements[i].threshold) CM.Sim.Win(Game.CpsAchievements[i].name);
|
|
}
|
|
|
|
if (Game.frenzy > 0) mult *= Game.frenzyPower;
|
|
|
|
// Pointless?
|
|
name = Game.bakeryName.toLowerCase();
|
|
if (name == 'orteil') mult *= 0.99;
|
|
else if (name == 'ortiel') mult *= 0.98; //or so help me
|
|
|
|
if (CM.Sim.Has('Elder Covenant')) mult *= 0.95;
|
|
|
|
if (CM.Sim.Has('Golden switch [off]')) {
|
|
var goldenSwitchMult = 1.5;
|
|
if (CM.Sim.Has('Residual luck')) {
|
|
var upgrades = ['Get lucky', 'Lucky day', 'Serendipity', 'Heavenly luck', 'Lasting fortune', 'Decisive fate'];
|
|
for (var i in upgrades) {
|
|
if (CM.Sim.Has(upgrades[i])) goldenSwitchMult += 0.1;
|
|
}
|
|
}
|
|
mult *= goldenSwitchMult;
|
|
}
|
|
|
|
CM.Sim.cookiesPs *= mult;
|
|
};
|
|
|
|
CM.Sim.CheckOtherAchiev = function() {
|
|
var grandmas=0;
|
|
if (CM.Sim.Has('Farmer grandmas')) grandmas++;
|
|
if (CM.Sim.Has('Worker grandmas')) grandmas++;
|
|
if (CM.Sim.Has('Miner grandmas')) grandmas++;
|
|
if (CM.Sim.Has('Cosmic grandmas')) grandmas++;
|
|
if (CM.Sim.Has('Transmuted grandmas')) grandmas++;
|
|
if (CM.Sim.Has('Altered grandmas')) grandmas++;
|
|
if (CM.Sim.Has('Grandmas\' grandmas')) grandmas++;
|
|
if (CM.Sim.Has('Antigrandmas')) grandmas++;
|
|
if (CM.Sim.Has('Rainbow grandmas')) grandmas++;
|
|
if (CM.Sim.Has('Banker grandmas')) grandmas++;
|
|
if (CM.Sim.Has('Priestess grandmas')) grandmas++;
|
|
if (CM.Sim.Has('Witch grandmas')) grandmas++;
|
|
if (!CM.Sim.HasAchiev('Elder') && grandmas >= 7) CM.Sim.Win('Elder');
|
|
|
|
var buildingsOwned = 0;
|
|
var mathematician = 1;
|
|
var base10 = 1;
|
|
var minAmount = 100000;
|
|
for (var i in CM.Sim.Objects) {
|
|
buildingsOwned += CM.Sim.Objects[i].amount;
|
|
minAmount = Math.min(CM.Sim.Objects[i].amount, minAmount);
|
|
if (!CM.Sim.HasAchiev('Mathematician')) {
|
|
if (CM.Sim.Objects[i].amount < Math.min(128, Math.pow(2, (Game.ObjectsById.length - Game.Objects[i].id) - 1))) mathematician = 0;
|
|
}
|
|
if (!CM.Sim.HasAchiev('Base 10')) {
|
|
if (CM.Sim.Objects[i].amount < (Game.ObjectsById.length - Game.Objects[i].id) * 10) base10 = 0;
|
|
}
|
|
}
|
|
if (minAmount >= 1) CM.Sim.Win('One with everything');
|
|
if (mathematician == 1) CM.Sim.Win('Mathematician');
|
|
if (base10 == 1) CM.Sim.Win('Base 10');
|
|
if (minAmount >= 100) CM.Sim.Win('Centennial');
|
|
if (minAmount >= 150) CM.Sim.Win('Centennial and a half');
|
|
if (minAmount >= 200) CM.Sim.Win('Bicentennial');
|
|
if (minAmount >= 250) CM.Sim.Win('Bicentennial and a half');
|
|
|
|
if (buildingsOwned >= 100) CM.Sim.Win('Builder');
|
|
if (buildingsOwned >= 500) CM.Sim.Win('Architect');
|
|
if (buildingsOwned >= 1000) CM.Sim.Win('Engineer');
|
|
if (buildingsOwned >= 1500) CM.Sim.Win('Lord of Constructs');
|
|
|
|
if (CM.Sim.UpgradesOwned >= 20) CM.Sim.Win('Enhancer');
|
|
if (CM.Sim.UpgradesOwned >= 50) CM.Sim.Win('Augmenter');
|
|
if (CM.Sim.UpgradesOwned >= 100) CM.Sim.Win('Upgrader');
|
|
if (CM.Sim.UpgradesOwned >= 200) CM.Sim.Win('Lord of Progress');
|
|
|
|
if (buildingsOwned >= 3000 && CM.Sim.UpgradesOwned >= 300) CM.Sim.Win('Polymath');
|
|
|
|
if (CM.Sim.Objects['Cursor'].amount + CM.Sim.Objects['Grandma'].amount >= 777) CM.Sim.Win('The elder scrolls');
|
|
|
|
var hasAllHalloCook = true;
|
|
for (var i in CM.Data.HalloCookies) {
|
|
if (!CM.Sim.Has(CM.Data.HalloCookies[i])) hasAllHalloCook = false;
|
|
}
|
|
if (hasAllHalloCook) CM.Sim.Win('Spooky cookies');
|
|
|
|
var hasAllChristCook = true;
|
|
for (var i in CM.Data.ChristCookies) {
|
|
if (!CM.Sim.Has(CM.Data.ChristCookies[i])) hasAllChristCook = false;
|
|
}
|
|
if (hasAllChristCook) CM.Sim.Win('Let it snow');
|
|
}
|
|
|
|
CM.Sim.BuyBuildings = function(amount, target) {
|
|
CM.Cache[target] = [];
|
|
for (var i in Game.Objects) {
|
|
CM.Sim.CopyData();
|
|
var me = CM.Sim.Objects[i];
|
|
me.amount += amount;
|
|
|
|
if (i == 'Cursor') {
|
|
if (me.amount >= 1) CM.Sim.Win('Click');
|
|
if (me.amount >= 2) CM.Sim.Win('Double-click');
|
|
if (me.amount >= 50) CM.Sim.Win('Mouse wheel');
|
|
if (me.amount >= 100) CM.Sim.Win('Of Mice and Men');
|
|
if (me.amount >= 200) CM.Sim.Win('The Digital');
|
|
if (me.amount >= 300) CM.Sim.Win('Extreme polydactyly');
|
|
if (me.amount >= 400) CM.Sim.Win('Dr. T');
|
|
if (me.amount >= 500) CM.Sim.Win('Thumbs, phalanges, metacarpals');
|
|
}
|
|
else {
|
|
for (var j in Game.Objects[me.name].tieredAchievs) {
|
|
if (me.amount >= Game.Tiers[Game.Objects[me.name].tieredAchievs[j].tier].achievUnlock)
|
|
CM.Sim.Win(Game.Objects[me.name].tieredAchievs[j].name);
|
|
}
|
|
}
|
|
|
|
var lastAchievementsOwned = CM.Sim.AchievementsOwned;
|
|
|
|
CM.Sim.CalculateGains();
|
|
|
|
CM.Sim.CheckOtherAchiev();
|
|
|
|
if (lastAchievementsOwned != CM.Sim.AchievementsOwned) {
|
|
CM.Sim.CalculateGains();
|
|
}
|
|
|
|
CM.Cache[target][i] = {};
|
|
CM.Cache[target][i].bonus = CM.Sim.cookiesPs - Game.cookiesPs;
|
|
if (amount != 1) {
|
|
CM.Cache[target][i].price = CM.Sim.BuildingGetPrice(Game.Objects[i].basePrice, Game.Objects[i].amount, Game.Objects[i].free, amount);
|
|
}
|
|
}
|
|
}
|
|
|
|
CM.Sim.BuyUpgrades = function() {
|
|
CM.Cache.Upgrades = [];
|
|
for (var i in Game.Upgrades) {
|
|
if (Game.Upgrades[i].pool == 'toggle' || (Game.Upgrades[i].bought == 0 && Game.Upgrades[i].unlocked && Game.Upgrades[i].pool != 'prestige')) {
|
|
CM.Sim.CopyData();
|
|
var me = CM.Sim.Upgrades[i];
|
|
me.bought = 1;
|
|
if (Game.CountsAsUpgradeOwned(Game.Upgrades[i].pool)) CM.Sim.UpgradesOwned++;
|
|
|
|
if (i == 'Elder Pledge') {
|
|
CM.Sim.pledges++;
|
|
if (CM.Sim.pledges > 0) CM.Sim.Win('Elder nap');
|
|
if (CM.Sim.pledges >= 5) CM.Sim.Win('Elder slumber');
|
|
}
|
|
else if (i == 'Elder Covenant') {
|
|
CM.Sim.Win('Elder calm')
|
|
}
|
|
else if (i == 'Eternal heart biscuits') {
|
|
CM.Sim.Win('Lovely cookies');
|
|
}
|
|
else if (i == 'Heavenly key') {
|
|
CM.Sim.Win('Wholesome');
|
|
}
|
|
|
|
var lastAchievementsOwned = CM.Sim.AchievementsOwned;
|
|
|
|
CM.Sim.CalculateGains();
|
|
|
|
CM.Sim.CheckOtherAchiev();
|
|
|
|
if (lastAchievementsOwned != CM.Sim.AchievementsOwned) {
|
|
CM.Sim.CalculateGains();
|
|
}
|
|
|
|
CM.Cache.Upgrades[i] = {};
|
|
CM.Cache.Upgrades[i].bonus = CM.Sim.cookiesPs - Game.cookiesPs;
|
|
}
|
|
}
|
|
}
|
|
|
|
CM.Sim.ResetBonus = function() {
|
|
CM.Sim.CopyData();
|
|
|
|
if (Game.cookiesEarned >= 1000000) CM.Sim.Win('Sacrifice');
|
|
if (Game.cookiesEarned >= 1000000000) CM.Sim.Win('Oblivion');
|
|
if (Game.cookiesEarned >= 1000000000000) CM.Sim.Win('From scratch');
|
|
if (Game.cookiesEarned >= 1000000000000000) CM.Sim.Win('Nihilism');
|
|
if (Game.cookiesEarned >= 1000000000000000000) CM.Sim.Win('Dematerialize');
|
|
if (Game.cookiesEarned >= 1000000000000000000000) CM.Sim.Win('Nil zero zilch');
|
|
if (Game.cookiesEarned >= 1000000000000000000000000) CM.Sim.Win('Transcendence');
|
|
if (Game.cookiesEarned >= 1000000000000000000000000000) CM.Sim.Win('Obliterate');
|
|
if (Game.cookiesEarned >= 1000000000000000000000000000000) CM.Sim.Win('Negative void');
|
|
if (Game.cookiesEarned >= 1000000000000000000000000000000000) CM.Sim.Win('To crumbs, you say?');
|
|
|
|
if (CM.Sim.Upgrades['Heavenly chip secret'].bought == 0) {
|
|
CM.Sim.Upgrades['Heavenly chip secret'].bought = 1;
|
|
CM.Sim.UpgradesOwned++;
|
|
}
|
|
if (CM.Sim.Upgrades['Heavenly cookie stand'].bought == 0) {
|
|
CM.Sim.Upgrades['Heavenly cookie stand'].bought = 1;
|
|
CM.Sim.UpgradesOwned++;
|
|
}
|
|
if (CM.Sim.Upgrades['Heavenly bakery'].bought == 0) {
|
|
CM.Sim.Upgrades['Heavenly bakery'].bought = 1;
|
|
CM.Sim.UpgradesOwned++;
|
|
}
|
|
if (CM.Sim.Upgrades['Heavenly confectionery'].bought == 0) {
|
|
CM.Sim.Upgrades['Heavenly confectionery'].bought = 1;
|
|
CM.Sim.UpgradesOwned++;
|
|
}
|
|
if (CM.Sim.Upgrades['Heavenly key'].bought == 0) {
|
|
CM.Sim.Upgrades['Heavenly key'].bought = 1;
|
|
CM.Sim.UpgradesOwned++;
|
|
}
|
|
|
|
CM.Sim.prestige = Math.floor(Game.HowMuchPrestige(Game.cookiesEarned + Game.cookiesReset));
|
|
|
|
var lastAchievementsOwned = CM.Sim.AchievementsOwned;
|
|
|
|
CM.Sim.CalculateGains();
|
|
|
|
CM.Sim.CheckOtherAchiev();
|
|
|
|
if (lastAchievementsOwned != CM.Sim.AchievementsOwned) {
|
|
CM.Sim.CalculateGains();
|
|
}
|
|
|
|
return (CM.Sim.cookiesPs - Game.cookiesPs);
|
|
}
|
|
|