Replaced var with let
This commit is contained in:
File diff suppressed because one or more lines are too long
34
src/Cache.js
34
src/Cache.js
@@ -55,14 +55,14 @@ CM.Cache.CacheWrinklers = function() {
|
|||||||
CM.Cache.WrinklersNormal = 0;
|
CM.Cache.WrinklersNormal = 0;
|
||||||
CM.Cache.WrinklersFattest = [0, null];
|
CM.Cache.WrinklersFattest = [0, null];
|
||||||
for (let i = 0; i < Game.wrinklers.length; i++) {
|
for (let i = 0; i < Game.wrinklers.length; i++) {
|
||||||
var sucked = Game.wrinklers[i].sucked;
|
let sucked = Game.wrinklers[i].sucked;
|
||||||
var toSuck = 1.1;
|
let toSuck = 1.1;
|
||||||
if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05;
|
if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05;
|
||||||
if (Game.wrinklers[i].type==1) toSuck *= 3; // Shiny wrinklers
|
if (Game.wrinklers[i].type==1) toSuck *= 3; // Shiny wrinklers
|
||||||
sucked *= toSuck;
|
sucked *= toSuck;
|
||||||
if (Game.Has('Wrinklerspawn')) sucked *= 1.05;
|
if (Game.Has('Wrinklerspawn')) sucked *= 1.05;
|
||||||
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
||||||
var godLvl = Game.hasGod('scorn');
|
let godLvl = Game.hasGod('scorn');
|
||||||
if (godLvl === 1) sucked *= 1.15;
|
if (godLvl === 1) sucked *= 1.15;
|
||||||
else if (godLvl === 2) sucked *= 1.1;
|
else if (godLvl === 2) sucked *= 1.1;
|
||||||
else if (godLvl === 3) sucked *= 1.05;
|
else if (godLvl === 3) sucked *= 1.05;
|
||||||
@@ -137,9 +137,9 @@ CM.Cache.CacheGoldenAndWrathCookiesMults = function() {
|
|||||||
CM.Cache.WrathCookiesMult = 1;
|
CM.Cache.WrathCookiesMult = 1;
|
||||||
CM.Cache.DragonsFortuneMultAdjustment = 1;
|
CM.Cache.DragonsFortuneMultAdjustment = 1;
|
||||||
} else {
|
} else {
|
||||||
var goldenMult = 1;
|
let goldenMult = 1;
|
||||||
var wrathMult = 1;
|
let wrathMult = 1;
|
||||||
var mult = 1;
|
let mult = 1;
|
||||||
|
|
||||||
// Factor auras and upgrade in mults
|
// Factor auras and upgrade in mults
|
||||||
if (CM.Sim.Has('Green yeast digestives')) mult *= 1.01;
|
if (CM.Sim.Has('Green yeast digestives')) mult *= 1.01;
|
||||||
@@ -177,7 +177,7 @@ CM.Cache.MaxChainCookieReward = function(digit, maxPayout, mult) {
|
|||||||
let totalFromChain = 0;
|
let totalFromChain = 0;
|
||||||
let moni = 0;
|
let moni = 0;
|
||||||
let nextMoni = 0;
|
let nextMoni = 0;
|
||||||
var chain = 1 + Math.max(0, Math.ceil(Math.log(Game.cookies) / Math.LN10) - 10);
|
let chain = 1 + Math.max(0, Math.ceil(Math.log(Game.cookies) / Math.LN10) - 10);
|
||||||
while (nextMoni < maxPayout) {
|
while (nextMoni < maxPayout) {
|
||||||
moni = Math.max(digit, Math.min(Math.floor(1 / 9 * Math.pow(10, chain) * digit * mult), maxPayout));
|
moni = Math.max(digit, Math.min(Math.floor(1 / 9 * Math.pow(10, chain) * digit * mult), maxPayout));
|
||||||
// TODO: Calculate Cookies or cps needed for next level of chain. Related to issue #580
|
// TODO: Calculate Cookies or cps needed for next level of chain. Related to issue #580
|
||||||
@@ -241,12 +241,12 @@ CM.Cache.CacheMissingUpgrades = function() {
|
|||||||
CM.Cache.MissingUpgrades = "";
|
CM.Cache.MissingUpgrades = "";
|
||||||
CM.Cache.MissingUpgradesCookies = "";
|
CM.Cache.MissingUpgradesCookies = "";
|
||||||
CM.Cache.MissingUpgradesPrestige = "";
|
CM.Cache.MissingUpgradesPrestige = "";
|
||||||
var list = [];
|
let list = [];
|
||||||
//sort the upgrades
|
//sort the upgrades
|
||||||
for (let i of Object.keys(Game.Upgrades)) {
|
for (let i of Object.keys(Game.Upgrades)) {
|
||||||
list.push(Game.Upgrades[i]);
|
list.push(Game.Upgrades[i]);
|
||||||
}
|
}
|
||||||
var sortMap = function(a, b) {
|
let sortMap = function(a, b) {
|
||||||
if (a.order>b.order) return 1;
|
if (a.order>b.order) return 1;
|
||||||
else if (a.order<b.order) return -1;
|
else if (a.order<b.order) return -1;
|
||||||
else return 0;
|
else return 0;
|
||||||
@@ -254,10 +254,10 @@ CM.Cache.CacheMissingUpgrades = function() {
|
|||||||
list.sort(sortMap);
|
list.sort(sortMap);
|
||||||
|
|
||||||
for (let i of Object.keys(list)) {
|
for (let i of Object.keys(list)) {
|
||||||
var me = list[i];
|
let me = list[i];
|
||||||
|
|
||||||
if (me.bought === 0) {
|
if (me.bought === 0) {
|
||||||
var str = '';
|
let str = '';
|
||||||
|
|
||||||
str += CM.Disp.crateMissing(me);
|
str += CM.Disp.crateMissing(me);
|
||||||
if (me.pool === 'prestige') CM.Cache.MissingUpgradesPrestige += str;
|
if (me.pool === 'prestige') CM.Cache.MissingUpgradesPrestige += str;
|
||||||
@@ -274,7 +274,7 @@ CM.Cache.CacheMissingUpgrades = function() {
|
|||||||
*/
|
*/
|
||||||
CM.Cache.CacheSeaSpec = function() {
|
CM.Cache.CacheSeaSpec = function() {
|
||||||
if (Game.season === 'christmas') {
|
if (Game.season === 'christmas') {
|
||||||
var val = Game.cookiesPs * 60;
|
let val = Game.cookiesPs * 60;
|
||||||
if (Game.hasBuff('Elder frenzy')) val *= 0.5;
|
if (Game.hasBuff('Elder frenzy')) val *= 0.5;
|
||||||
if (Game.hasBuff('Frenzy')) val *= 0.75;
|
if (Game.hasBuff('Frenzy')) val *= 0.75;
|
||||||
CM.Cache.SeaSpec = Math.max(25, val);
|
CM.Cache.SeaSpec = Math.max(25, val);
|
||||||
@@ -313,7 +313,7 @@ class CMAvgQueue {
|
|||||||
calcAverage (timePeriod) {
|
calcAverage (timePeriod) {
|
||||||
if (timePeriod > this.maxLength) timePeriod = this.maxLength;
|
if (timePeriod > this.maxLength) timePeriod = this.maxLength;
|
||||||
if (timePeriod > this.queue.length) timePeriod = this.queue.length;
|
if (timePeriod > this.queue.length) timePeriod = this.queue.length;
|
||||||
var ret = 0;
|
let ret = 0;
|
||||||
for (let i = this.queue.length - 1; i >= 0 && i > this.queue.length - 1 - timePeriod; i--) {
|
for (let i = this.queue.length - 1; i >= 0 && i > this.queue.length - 1 - timePeriod; i--) {
|
||||||
ret += this.queue[i];
|
ret += this.queue[i];
|
||||||
}
|
}
|
||||||
@@ -430,7 +430,7 @@ CM.Cache.CacheCurrWrinklerCPS = function() {
|
|||||||
}
|
}
|
||||||
let godMult = 1;
|
let godMult = 1;
|
||||||
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
||||||
var godLvl = Game.hasGod('scorn');
|
let godLvl = Game.hasGod('scorn');
|
||||||
if (godLvl === 1) godMult *= 1.15;
|
if (godLvl === 1) godMult *= 1.15;
|
||||||
else if (godLvl === 2) godMult *= 1.1;
|
else if (godLvl === 2) godMult *= 1.1;
|
||||||
else if (godLvl === 3) godMult *= 1.05;
|
else if (godLvl === 3) godMult *= 1.05;
|
||||||
@@ -445,7 +445,7 @@ CM.Cache.CacheCurrWrinklerCPS = function() {
|
|||||||
* @returns {number} mult The multiplier
|
* @returns {number} mult The multiplier
|
||||||
*/
|
*/
|
||||||
CM.Cache.getCPSBuffMult = function() {
|
CM.Cache.getCPSBuffMult = function() {
|
||||||
var mult = 1;
|
let mult = 1;
|
||||||
for (let i of Object.keys(Game.buffs)) {
|
for (let i of Object.keys(Game.buffs)) {
|
||||||
if (typeof Game.buffs[i].multCpS != 'undefined') mult *= Game.buffs[i].multCpS;
|
if (typeof Game.buffs[i].multCpS != 'undefined') mult *= Game.buffs[i].multCpS;
|
||||||
}
|
}
|
||||||
@@ -476,8 +476,8 @@ CM.Cache.NoGoldSwitchCPS = function() {
|
|||||||
CM.Cache.CacheDragonCost = function() {
|
CM.Cache.CacheDragonCost = function() {
|
||||||
if (CM.Cache.lastDragonLevel != Game.dragonLevel || CM.Sim.DoSims) {
|
if (CM.Cache.lastDragonLevel != Game.dragonLevel || CM.Sim.DoSims) {
|
||||||
if (Game.dragonLevel < 25 && Game.dragonLevels[Game.dragonLevel].buy.toString().includes("sacrifice")) {
|
if (Game.dragonLevel < 25 && Game.dragonLevels[Game.dragonLevel].buy.toString().includes("sacrifice")) {
|
||||||
var target = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1];
|
let target = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1];
|
||||||
var amount = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/sacrifice\((.*?)\)/)[1];
|
let amount = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/sacrifice\((.*?)\)/)[1];
|
||||||
if (target != "i") {
|
if (target != "i") {
|
||||||
target = target.replaceAll("'", "");
|
target = target.replaceAll("'", "");
|
||||||
if (Game.Objects[target].amount < amount) {
|
if (Game.Objects[target].amount < amount) {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ CM.Config.LoadConfig = function(settings) {
|
|||||||
CM.Options = settings;
|
CM.Options = settings;
|
||||||
|
|
||||||
// Check values
|
// Check values
|
||||||
var mod = false;
|
let mod = false;
|
||||||
for (let i in CM.Data.ConfigDefault) {
|
for (let i in CM.Data.ConfigDefault) {
|
||||||
if (typeof CM.Options[i] === 'undefined') {
|
if (typeof CM.Options[i] === 'undefined') {
|
||||||
mod = true;
|
mod = true;
|
||||||
|
|||||||
422
src/Disp.js
422
src/Disp.js
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
CM.init = function() {
|
CM.init = function() {
|
||||||
CM.Footer.isInitzializing = true
|
CM.Footer.isInitzializing = true
|
||||||
var proceed = true;
|
let proceed = true;
|
||||||
if (Game.version != CM.VersionMajor) {
|
if (Game.version != CM.VersionMajor) {
|
||||||
proceed = confirm('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' is meant for Game version ' + CM.VersionMajor + '. Loading a different version may cause errors. Do you still want to load Cookie Monster?');
|
proceed = confirm('Cookie Monster version ' + CM.VersionMajor + '.' + CM.VersionMinor + ' is meant for Game version ' + CM.VersionMajor + '. Loading a different version may cause errors. Do you still want to load Cookie Monster?');
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,7 @@ CM.Footer.AddJscolor = function() {
|
|||||||
*/
|
*/
|
||||||
if (typeof CM.Footer.isInitzializing === 'undefined') {
|
if (typeof CM.Footer.isInitzializing === 'undefined') {
|
||||||
CM.Footer.AddJscolor();
|
CM.Footer.AddJscolor();
|
||||||
var delay = setInterval(function() {
|
let delay = setInterval(function() {
|
||||||
if (typeof jscolor !== 'undefined') {
|
if (typeof jscolor !== 'undefined') {
|
||||||
jscolor.init();
|
jscolor.init();
|
||||||
Game.registerMod('CookieMonster', CM);
|
Game.registerMod('CookieMonster', CM);
|
||||||
|
|||||||
16
src/Main.js
16
src/Main.js
@@ -33,7 +33,7 @@ CM.Main.Loop = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for aura change to recalculate buildings prices
|
// Check for aura change to recalculate buildings prices
|
||||||
var hasBuildAura = Game.auraMult('Fierce Hoarder') > 0;
|
let hasBuildAura = Game.auraMult('Fierce Hoarder') > 0;
|
||||||
if (!CM.Cache.HadBuildAura && hasBuildAura) {
|
if (!CM.Cache.HadBuildAura && hasBuildAura) {
|
||||||
CM.Cache.HadBuildAura = true;
|
CM.Cache.HadBuildAura = true;
|
||||||
CM.Cache.DoRemakeBuildPrices = 1;
|
CM.Cache.DoRemakeBuildPrices = 1;
|
||||||
@@ -227,7 +227,7 @@ CM.Main.ReplaceNativeGrimoire = function() {
|
|||||||
*/
|
*/
|
||||||
CM.Main.ReplaceNativeGrimoireLaunch = function() {
|
CM.Main.ReplaceNativeGrimoireLaunch = function() {
|
||||||
if (!CM.Main.HasReplaceNativeGrimoireLaunch && Game.Objects['Wizard tower'].minigameLoaded) {
|
if (!CM.Main.HasReplaceNativeGrimoireLaunch && Game.Objects['Wizard tower'].minigameLoaded) {
|
||||||
var minigame = Game.Objects['Wizard tower'].minigame;
|
let minigame = Game.Objects['Wizard tower'].minigame;
|
||||||
CM.Backup.GrimoireLaunch = minigame.launch;
|
CM.Backup.GrimoireLaunch = minigame.launch;
|
||||||
eval('CM.Backup.GrimoireLaunchMod = ' + minigame.launch.toString().split('=this').join('= Game.Objects[\'Wizard tower\'].minigame'));
|
eval('CM.Backup.GrimoireLaunchMod = ' + minigame.launch.toString().split('=this').join('= Game.Objects[\'Wizard tower\'].minigame'));
|
||||||
Game.Objects['Wizard tower'].minigame.launch = function() {
|
Game.Objects['Wizard tower'].minigame.launch = function() {
|
||||||
@@ -246,7 +246,7 @@ CM.Main.ReplaceNativeGrimoireLaunch = function() {
|
|||||||
*/
|
*/
|
||||||
CM.Main.ReplaceNativeGrimoireDraw = function() {
|
CM.Main.ReplaceNativeGrimoireDraw = function() {
|
||||||
if (!CM.Main.HasReplaceNativeGrimoireDraw && Game.Objects['Wizard tower'].minigameLoaded) {
|
if (!CM.Main.HasReplaceNativeGrimoireDraw && Game.Objects['Wizard tower'].minigameLoaded) {
|
||||||
var minigame = Game.Objects['Wizard tower'].minigame;
|
let minigame = Game.Objects['Wizard tower'].minigame;
|
||||||
CM.Backup.GrimoireDraw = minigame.draw;
|
CM.Backup.GrimoireDraw = minigame.draw;
|
||||||
Game.Objects['Wizard tower'].minigame.draw = function() {
|
Game.Objects['Wizard tower'].minigame.draw = function() {
|
||||||
CM.Backup.GrimoireDraw();
|
CM.Backup.GrimoireDraw();
|
||||||
@@ -292,7 +292,7 @@ CM.Main.ReplaceTooltips = function() {
|
|||||||
CM.Main.ReplaceTooltipBuild = function() {
|
CM.Main.ReplaceTooltipBuild = function() {
|
||||||
CM.Main.TooltipBuildBackup = [];
|
CM.Main.TooltipBuildBackup = [];
|
||||||
for (let i of Object.keys(Game.Objects)) {
|
for (let i of Object.keys(Game.Objects)) {
|
||||||
var me = Game.Objects[i];
|
let me = Game.Objects[i];
|
||||||
if (l('product' + me.id).onmouseover != null) {
|
if (l('product' + me.id).onmouseover != null) {
|
||||||
CM.Main.TooltipBuildBackup[i] = l('product' + me.id).onmouseover;
|
CM.Main.TooltipBuildBackup[i] = l('product' + me.id).onmouseover;
|
||||||
eval('l(\'product\' + me.id).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'b\', \'' + i + '\');}, \'store\'); Game.tooltip.wobble();}');
|
eval('l(\'product\' + me.id).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'b\', \'' + i + '\');}, \'store\'); Game.tooltip.wobble();}');
|
||||||
@@ -338,7 +338,7 @@ CM.Main.ReplaceTooltipGarden = function() {
|
|||||||
if (Game.Objects.Farm.minigameLoaded) {
|
if (Game.Objects.Farm.minigameLoaded) {
|
||||||
l('gardenTool-1').onmouseover = function() {Game.tooltip.dynamic=1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip('ha', 'HarvestAllButton');}, 'this'); Game.tooltip.wobble();};
|
l('gardenTool-1').onmouseover = function() {Game.tooltip.dynamic=1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip('ha', 'HarvestAllButton');}, 'this'); Game.tooltip.wobble();};
|
||||||
Array.from(l('gardenPlot').children).forEach((child) => {
|
Array.from(l('gardenPlot').children).forEach((child) => {
|
||||||
var coords = child.id.slice(-3,);
|
let coords = child.id.slice(-3,);
|
||||||
child.onmouseover = function() {Game.tooltip.dynamic=1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip('p', [`${coords[0]}`,`${coords[2]}`]);}, 'this'); Game.tooltip.wobble();};
|
child.onmouseover = function() {Game.tooltip.dynamic=1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip('p', [`${coords[0]}`,`${coords[2]}`]);}, 'this'); Game.tooltip.wobble();};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -458,7 +458,7 @@ CM.Main.CheckGardenTick = function() {
|
|||||||
*/
|
*/
|
||||||
CM.Main.CheckMagicMeter = function() {
|
CM.Main.CheckMagicMeter = function() {
|
||||||
if (Game.Objects['Wizard tower'].minigameLoaded && CM.Options.GrimoireBar === 1) {
|
if (Game.Objects['Wizard tower'].minigameLoaded && CM.Options.GrimoireBar === 1) {
|
||||||
var minigame = Game.Objects['Wizard tower'].minigame;
|
let minigame = Game.Objects['Wizard tower'].minigame;
|
||||||
if (minigame.magic < minigame.magicM) CM.Main.lastMagicBarFull = false;
|
if (minigame.magic < minigame.magicM) CM.Main.lastMagicBarFull = false;
|
||||||
else if (!CM.Main.lastMagicBarFull) {
|
else if (!CM.Main.lastMagicBarFull) {
|
||||||
CM.Main.lastMagicBarFull = true;
|
CM.Main.lastMagicBarFull = true;
|
||||||
@@ -475,7 +475,7 @@ CM.Main.CheckMagicMeter = function() {
|
|||||||
*/
|
*/
|
||||||
CM.Main.CheckWrinklerCount = function() {
|
CM.Main.CheckWrinklerCount = function() {
|
||||||
if (Game.elderWrath > 0) {
|
if (Game.elderWrath > 0) {
|
||||||
var CurrentWrinklers = 0;
|
let CurrentWrinklers = 0;
|
||||||
for (let i in Game.wrinklers) {
|
for (let i in Game.wrinklers) {
|
||||||
if (Game.wrinklers[i].phase === 2) CurrentWrinklers++;
|
if (Game.wrinklers[i].phase === 2) CurrentWrinklers++;
|
||||||
}
|
}
|
||||||
@@ -528,7 +528,7 @@ CM.Main.AddWrinklerAreaDetect = function() {
|
|||||||
*/
|
*/
|
||||||
CM.Main.FixMouseY = function(target) {
|
CM.Main.FixMouseY = function(target) {
|
||||||
if (CM.Options.TimerBar === 1 && CM.Options.TimerBarPos === 0) {
|
if (CM.Options.TimerBar === 1 && CM.Options.TimerBarPos === 0) {
|
||||||
var timerBarHeight = parseInt(CM.Disp.TimerBar.style.height);
|
let timerBarHeight = parseInt(CM.Disp.TimerBar.style.height);
|
||||||
Game.mouseY -= timerBarHeight;
|
Game.mouseY -= timerBarHeight;
|
||||||
target();
|
target();
|
||||||
Game.mouseY += timerBarHeight;
|
Game.mouseY += timerBarHeight;
|
||||||
|
|||||||
24
src/Sim.js
24
src/Sim.js
@@ -17,7 +17,7 @@
|
|||||||
* @returns {number} moni Total price
|
* @returns {number} moni Total price
|
||||||
*/
|
*/
|
||||||
CM.Sim.BuildingGetPrice = function(build, basePrice, start, free, increase) {
|
CM.Sim.BuildingGetPrice = function(build, basePrice, start, free, increase) {
|
||||||
var moni = 0;
|
let moni = 0;
|
||||||
for (let i = 0; i < increase; i++) {
|
for (let i = 0; i < increase; i++) {
|
||||||
let price = basePrice * Math.pow(Game.priceIncrease, Math.max(0, start - free));
|
let price = basePrice * Math.pow(Game.priceIncrease, Math.max(0, start - free));
|
||||||
price = Game.modifyBuildingPrice(build, price);
|
price = Game.modifyBuildingPrice(build, price);
|
||||||
@@ -84,14 +84,14 @@ CM.Sim.BuildingSell = function(build, basePrice, start, free, amount, noSim) {
|
|||||||
// Calculate money gains from selling buildings
|
// Calculate money gains from selling buildings
|
||||||
// If noSim is set, use Game methods to compute price instead of Sim ones.
|
// If noSim is set, use Game methods to compute price instead of Sim ones.
|
||||||
noSim = typeof noSim === "undefined" ? 0 : noSim;
|
noSim = typeof noSim === "undefined" ? 0 : noSim;
|
||||||
var moni = 0;
|
let moni = 0;
|
||||||
if (amount === -1) amount = start;
|
if (amount === -1) amount = start;
|
||||||
if (!amount) amount = Game.buyBulk;
|
if (!amount) amount = Game.buyBulk;
|
||||||
for (let i = 0; i < amount; i++) {
|
for (let i = 0; i < amount; i++) {
|
||||||
let price = basePrice * Math.pow(Game.priceIncrease, Math.max(0, start - free));
|
let price = basePrice * Math.pow(Game.priceIncrease, Math.max(0, start - free));
|
||||||
price = noSim ? Game.modifyBuildingPrice(build, price) : CM.Sim.modifyBuildingPrice(build, price);
|
price = noSim ? Game.modifyBuildingPrice(build, price) : CM.Sim.modifyBuildingPrice(build, price);
|
||||||
price = Math.ceil(price);
|
price = Math.ceil(price);
|
||||||
var giveBack = noSim ? build.getSellMultiplier() : CM.Sim.getSellMultiplier();
|
let giveBack = noSim ? build.getSellMultiplier() : CM.Sim.getSellMultiplier();
|
||||||
price = Math.floor(price * giveBack);
|
price = Math.floor(price * giveBack);
|
||||||
if (start > 0) {
|
if (start > 0) {
|
||||||
moni += price;
|
moni += price;
|
||||||
@@ -192,7 +192,7 @@ CM.Sim.hasAura = function(what) {
|
|||||||
* @returns {number} The multiplier
|
* @returns {number} The multiplier
|
||||||
*/
|
*/
|
||||||
CM.Sim.auraMult = function(what) {
|
CM.Sim.auraMult = function(what) {
|
||||||
var n = 0;
|
let n = 0;
|
||||||
if (Game.dragonAuras[CM.Sim.dragonAura].name === what || Game.dragonAuras[CM.Sim.dragonAura2].name === what)
|
if (Game.dragonAuras[CM.Sim.dragonAura].name === what || Game.dragonAuras[CM.Sim.dragonAura2].name === what)
|
||||||
n = 1;
|
n = 1;
|
||||||
if (Game.dragonAuras[CM.Sim.dragonAura].name === 'Reality Bending' || Game.dragonAuras[CM.Sim.dragonAura2].name === 'Reality Bending')
|
if (Game.dragonAuras[CM.Sim.dragonAura].name === 'Reality Bending' || Game.dragonAuras[CM.Sim.dragonAura2].name === 'Reality Bending')
|
||||||
@@ -211,8 +211,8 @@ CM.Sim.hasGod = function(what) {
|
|||||||
if (!CM.Sim.Objects.Temple.minigameLoaded) {
|
if (!CM.Sim.Objects.Temple.minigameLoaded) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var possibleGods = CM.Sim.Objects.Temple.minigame.gods;
|
let possibleGods = CM.Sim.Objects.Temple.minigame.gods;
|
||||||
var god=possibleGods[what];
|
let god=possibleGods[what];
|
||||||
for (let i=0;i<3;i++)
|
for (let i=0;i<3;i++)
|
||||||
{
|
{
|
||||||
if (CM.Sim.Objects.Temple.minigame.slot[i]==god.id) return (i+1);
|
if (CM.Sim.Objects.Temple.minigame.slot[i]==god.id) return (i+1);
|
||||||
@@ -559,7 +559,7 @@ CM.Sim.CalculateGains = function() {
|
|||||||
if (CM.Sim.Has('Ant larva')) eggMult *= 1.01;
|
if (CM.Sim.Has('Ant larva')) eggMult *= 1.01;
|
||||||
if (CM.Sim.Has('Century egg')) {
|
if (CM.Sim.Has('Century egg')) {
|
||||||
// The boost increases a little every day, with diminishing returns up to +10% on the 100th day
|
// The boost increases a little every day, with diminishing returns up to +10% on the 100th day
|
||||||
var day = Math.floor((CM.Sim.DateCentury - Game.startDate) / 1000 / 10) * 10 / 60 / 60 / 24;
|
let day = Math.floor((CM.Sim.DateCentury - Game.startDate) / 1000 / 10) * 10 / 60 / 60 / 24;
|
||||||
day = Math.min(day, 100);
|
day = Math.min(day, 100);
|
||||||
// Sets a Cache value to be displayed in the Stats page, could be moved...
|
// Sets a Cache value to be displayed in the Stats page, could be moved...
|
||||||
CM.Cache.CentEgg = 1 + (1 - Math.pow(1 - day / 100, 3)) * 0.1;
|
CM.Cache.CentEgg = 1 + (1 - Math.pow(1 - day / 100, 3)) * 0.1;
|
||||||
@@ -748,7 +748,7 @@ CM.Sim.BuyBuildingsBonusIncome = function(building, amount) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var lastAchievementsOwned = CM.Sim.AchievementsOwned;
|
let lastAchievementsOwned = CM.Sim.AchievementsOwned;
|
||||||
|
|
||||||
CM.Sim.CalculateGains();
|
CM.Sim.CalculateGains();
|
||||||
|
|
||||||
@@ -789,7 +789,7 @@ CM.Sim.BuyUpgradesBonusIncome = function(upgrade) {
|
|||||||
CM.Sim.Win('Wholesome');
|
CM.Sim.Win('Wholesome');
|
||||||
}
|
}
|
||||||
|
|
||||||
var lastAchievementsOwned = CM.Sim.AchievementsOwned;
|
let lastAchievementsOwned = CM.Sim.AchievementsOwned;
|
||||||
|
|
||||||
CM.Sim.CalculateGains();
|
CM.Sim.CalculateGains();
|
||||||
|
|
||||||
@@ -900,7 +900,7 @@ CM.Sim.CalculateChangeAura = function(aura) {
|
|||||||
CM.Sim.CopyData();
|
CM.Sim.CopyData();
|
||||||
|
|
||||||
// Check if aura being changed is first or second aura
|
// Check if aura being changed is first or second aura
|
||||||
var auraToBeChanged = l('promptContent').children[0].innerHTML.includes("secondary");
|
let auraToBeChanged = l('promptContent').children[0].innerHTML.includes("secondary");
|
||||||
if (auraToBeChanged) CM.Sim.dragonAura2 = aura;
|
if (auraToBeChanged) CM.Sim.dragonAura2 = aura;
|
||||||
else CM.Sim.dragonAura = aura;
|
else CM.Sim.dragonAura = aura;
|
||||||
|
|
||||||
@@ -909,7 +909,7 @@ CM.Sim.CalculateChangeAura = function(aura) {
|
|||||||
if (CM.Sim.dragonAura != CM.Cache.dragonAura || CM.Sim.dragonAura2 != CM.Cache.dragonAura2) {
|
if (CM.Sim.dragonAura != CM.Cache.dragonAura || CM.Sim.dragonAura2 != CM.Cache.dragonAura2) {
|
||||||
for (let i = Game.ObjectsById.length; i > -1, --i;) {
|
for (let i = Game.ObjectsById.length; i > -1, --i;) {
|
||||||
if (Game.ObjectsById[i].amount > 0) {
|
if (Game.ObjectsById[i].amount > 0) {
|
||||||
var highestBuilding = CM.Sim.Objects[Game.ObjectsById[i].name].name;
|
let highestBuilding = CM.Sim.Objects[Game.ObjectsById[i].name].name;
|
||||||
CM.Sim.Objects[highestBuilding].amount -=1;
|
CM.Sim.Objects[highestBuilding].amount -=1;
|
||||||
CM.Sim.buildingsOwned -= 1;
|
CM.Sim.buildingsOwned -= 1;
|
||||||
price = CM.Sim.Objects[highestBuilding].basePrice * Math.pow(Game.priceIncrease, Math.max(0, CM.Sim.Objects[highestBuilding].amount - 1 -CM.Sim.Objects[highestBuilding].free));
|
price = CM.Sim.Objects[highestBuilding].basePrice * Math.pow(Game.priceIncrease, Math.max(0, CM.Sim.Objects[highestBuilding].amount - 1 -CM.Sim.Objects[highestBuilding].free));
|
||||||
@@ -1029,7 +1029,7 @@ CM.Sim.SellBuildingsForChoEgg = function() {
|
|||||||
|
|
||||||
// Sacrifice highest buildings for the aura switch
|
// Sacrifice highest buildings for the aura switch
|
||||||
for (let i = 0; i < buildingsToSacrifice; ++i) {
|
for (let i = 0; i < buildingsToSacrifice; ++i) {
|
||||||
var highestBuilding = 0;
|
let highestBuilding = 0;
|
||||||
for (let j in CM.Sim.Objects) {
|
for (let j in CM.Sim.Objects) {
|
||||||
if (CM.Sim.Objects[j].amount > 0) {
|
if (CM.Sim.Objects[j].amount > 0) {
|
||||||
highestBuilding = CM.Sim.Objects[j];
|
highestBuilding = CM.Sim.Objects[j];
|
||||||
|
|||||||
Reference in New Issue
Block a user