Changed all "==" to "==="
This commit is contained in:
File diff suppressed because one or more lines are too long
86
src/Cache.js
86
src/Cache.js
@@ -57,12 +57,12 @@ CM.Cache.CacheWrinklers = function() {
|
||||
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;
|
||||
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) {
|
||||
if (Game.wrinklers[i].type === 0) {
|
||||
CM.Cache.WrinklersNormal += sucked;
|
||||
if (sucked > CM.Cache.WrinklersFattest[0]) CM.Cache.WrinklersFattest = [sucked, i];
|
||||
}
|
||||
@@ -108,7 +108,7 @@ CM.Cache.CacheStats = function() {
|
||||
if (Game.Objects[i].amount > 0) n++;
|
||||
}
|
||||
for (let i of Object.keys(Game.Objects)) {
|
||||
if ((Game.Objects[i].amount < max || n == 1) &&
|
||||
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;
|
||||
@@ -193,12 +193,12 @@ CM.Cache.CacheMissingUpgrades = function() {
|
||||
for (let i of Object.keys(list)) {
|
||||
var me = list[i];
|
||||
|
||||
if (me.bought == 0) {
|
||||
if (me.bought === 0) {
|
||||
var str = '';
|
||||
|
||||
str += CM.Disp.crateMissing(me);
|
||||
if (me.pool == 'prestige') CM.Cache.MissingUpgradesPrestige += str;
|
||||
else if (me.pool == 'cookie') CM.Cache.MissingUpgradesCookies += str;
|
||||
if (me.pool === 'prestige') CM.Cache.MissingUpgradesPrestige += str;
|
||||
else if (me.pool === 'cookie') CM.Cache.MissingUpgradesCookies += str;
|
||||
else if (me.pool != 'toggle' && me.pool != 'unused' && me.pool != 'debug') CM.Cache.MissingUpgrades += str;
|
||||
}
|
||||
}
|
||||
@@ -262,7 +262,7 @@ CM.Cache.InitCookiesDiff = function() {
|
||||
CM.Cache.UpdateAvgCPS = function() {
|
||||
var currDate = Math.floor(Date.now() / 1000);
|
||||
// Only calculate every new second
|
||||
if ((Game.T / Game.fps) % 1 == 0) {
|
||||
if ((Game.T / Game.fps) % 1 === 0) {
|
||||
var choEggTotal = Game.cookies + CM.Cache.SellForChoEgg;
|
||||
if (Game.cpsSucked > 0) {
|
||||
choEggTotal += CM.Cache.WrinklersTotal;
|
||||
@@ -300,12 +300,12 @@ CM.Cache.UpdateAvgCPS = function() {
|
||||
CM.Cache.AverageGainChoEgg = CM.Cache.ChoEggDiff.calcAverage(cpsLength);
|
||||
|
||||
CM.Cache.AvgCPS = CM.Cache.AverageGainBank;
|
||||
if (CM.Options.CalcWrink == 1) CM.Cache.AvgCPS += CM.Cache.AverageGainWrink;
|
||||
if (CM.Options.CalcWrink == 2) CM.Cache.AvgCPS += CM.Cache.AverageGainWrinkFattest;
|
||||
if (CM.Options.CalcWrink === 1) CM.Cache.AvgCPS += CM.Cache.AverageGainWrink;
|
||||
if (CM.Options.CalcWrink === 2) CM.Cache.AvgCPS += CM.Cache.AverageGainWrinkFattest;
|
||||
|
||||
var choEgg = (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg'));
|
||||
|
||||
if (choEgg || CM.Options.CalcWrink == 0) {
|
||||
if (choEgg || CM.Options.CalcWrink === 0) {
|
||||
CM.Cache.AvgCPSWithChoEgg = CM.Cache.AverageGainBank + CM.Cache.AverageGainWrink + (choEgg ? CM.Cache.AverageGainChoEgg : 0);
|
||||
}
|
||||
else CM.Cache.AvgCPSWithChoEgg = CM.Cache.AvgCPS;
|
||||
@@ -324,14 +324,14 @@ CM.Cache.UpdateCurrWrinklerCPS = function() {
|
||||
CM.Cache.CurrWrinklerCPSMult = 0;
|
||||
let count = 0;
|
||||
for (let i in Game.wrinklers) {
|
||||
if (Game.wrinklers[i].phase == 2) count++;
|
||||
if (Game.wrinklers[i].phase === 2) count++;
|
||||
}
|
||||
let godMult = 1;
|
||||
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
||||
var godLvl = CM.Sim.hasGod('scorn');
|
||||
if (godLvl == 1) godMult *= 1.15;
|
||||
else if (godLvl == 2) godMult *= 1.1;
|
||||
else if (godLvl == 3) godMult *= 1.05;
|
||||
if (godLvl === 1) godMult *= 1.15;
|
||||
else if (godLvl === 2) godMult *= 1.1;
|
||||
else if (godLvl === 3) godMult *= 1.05;
|
||||
}
|
||||
CM.Cache.CurrWrinklerCount = count;
|
||||
CM.Cache.CurrWrinklerCPSMult = count * (count * 0.05 * 1.1) * (Game.Has('Sacrilegious corruption') * 0.05 + 1) * (Game.Has('Wrinklerspawn') * 0.05 + 1) * godMult;
|
||||
@@ -428,7 +428,7 @@ CM.Cache.RemakeBuildingsPP = function() {
|
||||
CM.Cache.max = -1;
|
||||
CM.Cache.mid = -1;
|
||||
// Calculate PP and colors when compared to purchase of single optimal building
|
||||
if (CM.Options.ColorPPBulkMode == 0) {
|
||||
if (CM.Options.ColorPPBulkMode === 0) {
|
||||
for (let i of Object.keys(CM.Cache.Objects1)) {
|
||||
//CM.Cache.Objects1[i].pp = Game.Objects[i].getPrice() / CM.Cache.Objects1[i].bonus;
|
||||
if (Game.cookiesPs) {
|
||||
@@ -436,14 +436,14 @@ CM.Cache.RemakeBuildingsPP = function() {
|
||||
} else {
|
||||
CM.Cache.Objects1[i].pp = (Game.Objects[i].getPrice() / CM.Cache.Objects1[i].bonus);
|
||||
}
|
||||
if (CM.Cache.min == -1 || CM.Cache.Objects1[i].pp < CM.Cache.min) CM.Cache.min = CM.Cache.Objects1[i].pp;
|
||||
if (CM.Cache.max == -1 || CM.Cache.Objects1[i].pp > CM.Cache.max) CM.Cache.max = CM.Cache.Objects1[i].pp;
|
||||
if (CM.Cache.min === -1 || CM.Cache.Objects1[i].pp < CM.Cache.min) CM.Cache.min = CM.Cache.Objects1[i].pp;
|
||||
if (CM.Cache.max === -1 || CM.Cache.Objects1[i].pp > CM.Cache.max) CM.Cache.max = CM.Cache.Objects1[i].pp;
|
||||
}
|
||||
CM.Cache.mid = ((CM.Cache.max - CM.Cache.min) / 2) + CM.Cache.min;
|
||||
for (let i of Object.keys(CM.Cache.Objects1)) {
|
||||
let color = '';
|
||||
if (CM.Cache.Objects1[i].pp == CM.Cache.min) color = CM.Disp.colorGreen;
|
||||
else if (CM.Cache.Objects1[i].pp == CM.Cache.max) color = CM.Disp.colorRed;
|
||||
if (CM.Cache.Objects1[i].pp === CM.Cache.min) color = CM.Disp.colorGreen;
|
||||
else if (CM.Cache.Objects1[i].pp === CM.Cache.max) color = CM.Disp.colorRed;
|
||||
else if (CM.Cache.Objects1[i].pp > CM.Cache.mid) color = CM.Disp.colorOrange;
|
||||
else color = CM.Disp.colorYellow;
|
||||
CM.Cache.Objects1[i].color = color;
|
||||
@@ -456,7 +456,7 @@ CM.Cache.RemakeBuildingsPP = function() {
|
||||
}
|
||||
// Calculate PP and colors when compared to purchase of selected bulk mode
|
||||
else {
|
||||
if (Game.buyBulk == 1) {
|
||||
if (Game.buyBulk === 1) {
|
||||
for (let i of Object.keys(CM.Cache.Objects1)) {
|
||||
//CM.Cache.Objects1[i].pp = Game.Objects[i].getPrice() / CM.Cache.Objects1[i].bonus;
|
||||
if (Game.cookiesPs) {
|
||||
@@ -464,14 +464,14 @@ CM.Cache.RemakeBuildingsPP = function() {
|
||||
} else {
|
||||
CM.Cache.Objects1[i].pp = (Game.Objects[i].getPrice() / CM.Cache.Objects1[i].bonus);
|
||||
}
|
||||
if (CM.Cache.min == -1 || CM.Cache.Objects1[i].pp < CM.Cache.min) CM.Cache.min = CM.Cache.Objects1[i].pp;
|
||||
if (CM.Cache.max == -1 || CM.Cache.Objects1[i].pp > CM.Cache.max) CM.Cache.max = CM.Cache.Objects1[i].pp;
|
||||
if (CM.Cache.min === -1 || CM.Cache.Objects1[i].pp < CM.Cache.min) CM.Cache.min = CM.Cache.Objects1[i].pp;
|
||||
if (CM.Cache.max === -1 || CM.Cache.Objects1[i].pp > CM.Cache.max) CM.Cache.max = CM.Cache.Objects1[i].pp;
|
||||
}
|
||||
CM.Cache.mid = ((CM.Cache.max - CM.Cache.min) / 2) + CM.Cache.min;
|
||||
for (let i of Object.keys(CM.Cache.Objects1)) {
|
||||
let color = '';
|
||||
if (CM.Cache.Objects1[i].pp == CM.Cache.min) color = CM.Disp.colorGreen;
|
||||
else if (CM.Cache.Objects1[i].pp == CM.Cache.max) color = CM.Disp.colorRed;
|
||||
if (CM.Cache.Objects1[i].pp === CM.Cache.min) color = CM.Disp.colorGreen;
|
||||
else if (CM.Cache.Objects1[i].pp === CM.Cache.max) color = CM.Disp.colorRed;
|
||||
else if (CM.Cache.Objects1[i].pp > CM.Cache.mid) color = CM.Disp.colorOrange;
|
||||
else color = CM.Disp.colorYellow;
|
||||
CM.Cache.Objects1[i].color = color;
|
||||
@@ -479,21 +479,21 @@ CM.Cache.RemakeBuildingsPP = function() {
|
||||
CM.Cache.RemakeBuildingsOtherPP(10, 'Objects10');
|
||||
CM.Cache.RemakeBuildingsOtherPP(100, 'Objects100');
|
||||
}
|
||||
else if (Game.buyBulk == 10) {
|
||||
else if (Game.buyBulk === 10) {
|
||||
for (let i of Object.keys(CM.Cache.Objects1)) {
|
||||
if (Game.cookiesPs) {
|
||||
CM.Cache.Objects10[i].pp = (Math.max(Game.Objects[i].bulkPrice - (Game.cookies + CM.Disp.GetWrinkConfigBank()), 0) / Game.cookiesPs) + (Game.Objects[i].bulkPrice / CM.Cache.Objects10[i].bonus);
|
||||
} else {
|
||||
CM.Cache.Objects10[i].pp = (Game.Objects[i].bulkPrice / CM.Cache.Objects10[i].bonus);
|
||||
}
|
||||
if (CM.Cache.min == -1 || CM.Cache.Objects10[i].pp < CM.Cache.min) CM.Cache.min = CM.Cache.Objects10[i].pp;
|
||||
if (CM.Cache.max == -1 || CM.Cache.Objects10[i].pp > CM.Cache.max) CM.Cache.max = CM.Cache.Objects10[i].pp;
|
||||
if (CM.Cache.min === -1 || CM.Cache.Objects10[i].pp < CM.Cache.min) CM.Cache.min = CM.Cache.Objects10[i].pp;
|
||||
if (CM.Cache.max === -1 || CM.Cache.Objects10[i].pp > CM.Cache.max) CM.Cache.max = CM.Cache.Objects10[i].pp;
|
||||
}
|
||||
CM.Cache.mid = ((CM.Cache.max - CM.Cache.min) / 2) + CM.Cache.min;
|
||||
for (let i of Object.keys(CM.Cache.Objects1)) {
|
||||
let color = '';
|
||||
if (CM.Cache.Objects10[i].pp == CM.Cache.min) color = CM.Disp.colorGreen;
|
||||
else if (CM.Cache.Objects10[i].pp == CM.Cache.max) color = CM.Disp.colorRed;
|
||||
if (CM.Cache.Objects10[i].pp === CM.Cache.min) color = CM.Disp.colorGreen;
|
||||
else if (CM.Cache.Objects10[i].pp === CM.Cache.max) color = CM.Disp.colorRed;
|
||||
else if (CM.Cache.Objects10[i].pp > CM.Cache.mid) color = CM.Disp.colorOrange;
|
||||
else color = CM.Disp.colorYellow;
|
||||
CM.Cache.Objects10[i].color = color;
|
||||
@@ -501,21 +501,21 @@ CM.Cache.RemakeBuildingsPP = function() {
|
||||
CM.Cache.RemakeBuildingsOtherPP(1, 'Objects');
|
||||
CM.Cache.RemakeBuildingsOtherPP(100, 'Objects100');
|
||||
}
|
||||
else if (Game.buyBulk == 100) {
|
||||
else if (Game.buyBulk === 100) {
|
||||
for (let i of Object.keys(CM.Cache.Objects1)) {
|
||||
if (Game.cookiesPs) {
|
||||
CM.Cache.Objects100[i].pp = (Math.max(Game.Objects[i].bulkPrice - (Game.cookies + CM.Disp.GetWrinkConfigBank()), 0) / Game.cookiesPs) + (Game.Objects[i].bulkPrice / CM.Cache.Objects100[i].bonus);
|
||||
} else {
|
||||
CM.Cache.Objects100[i].pp = (Game.Objects[i].bulkPrice / CM.Cache.Objects100[i].bonus);
|
||||
}
|
||||
if (CM.Cache.min == -1 || CM.Cache.Objects100[i].pp < CM.Cache.min) CM.Cache.min = CM.Cache.Objects100[i].pp;
|
||||
if (CM.Cache.max == -1 || CM.Cache.Objects100[i].pp > CM.Cache.max) CM.Cache.max = CM.Cache.Objects100[i].pp;
|
||||
if (CM.Cache.min === -1 || CM.Cache.Objects100[i].pp < CM.Cache.min) CM.Cache.min = CM.Cache.Objects100[i].pp;
|
||||
if (CM.Cache.max === -1 || CM.Cache.Objects100[i].pp > CM.Cache.max) CM.Cache.max = CM.Cache.Objects100[i].pp;
|
||||
}
|
||||
CM.Cache.mid = ((CM.Cache.max - CM.Cache.min) / 2) + CM.Cache.min;
|
||||
for (let i of Object.keys(CM.Cache.Objects1)) {
|
||||
let color = '';
|
||||
if (CM.Cache.Objects100[i].pp == CM.Cache.min) color = CM.Disp.colorGreen;
|
||||
else if (CM.Cache.Objects100[i].pp == CM.Cache.max) color = CM.Disp.colorRed;
|
||||
if (CM.Cache.Objects100[i].pp === CM.Cache.min) color = CM.Disp.colorGreen;
|
||||
else if (CM.Cache.Objects100[i].pp === CM.Cache.max) color = CM.Disp.colorRed;
|
||||
else if (CM.Cache.Objects100[i].pp > CM.Cache.mid) color = CM.Disp.colorOrange;
|
||||
else color = CM.Disp.colorYellow;
|
||||
CM.Cache.Objects100[i].color = color;
|
||||
@@ -536,10 +536,10 @@ CM.Cache.RemakeUpgradePP = function() {
|
||||
}
|
||||
if (isNaN(CM.Cache.Upgrades[i].pp)) CM.Cache.Upgrades[i].pp = Infinity;
|
||||
let color = '';
|
||||
if (CM.Cache.Upgrades[i].pp <= 0 || CM.Cache.Upgrades[i].pp == Infinity) color = CM.Disp.colorGray;
|
||||
if (CM.Cache.Upgrades[i].pp <= 0 || CM.Cache.Upgrades[i].pp === Infinity) color = CM.Disp.colorGray;
|
||||
else if (CM.Cache.Upgrades[i].pp < CM.Cache.min) color = CM.Disp.colorBlue;
|
||||
else if (CM.Cache.Upgrades[i].pp == CM.Cache.min) color = CM.Disp.colorGreen;
|
||||
else if (CM.Cache.Upgrades[i].pp == CM.Cache.max) color = CM.Disp.colorRed;
|
||||
else if (CM.Cache.Upgrades[i].pp === CM.Cache.min) color = CM.Disp.colorGreen;
|
||||
else if (CM.Cache.Upgrades[i].pp === CM.Cache.max) color = CM.Disp.colorRed;
|
||||
else if (CM.Cache.Upgrades[i].pp > CM.Cache.max) color = CM.Disp.colorPurple;
|
||||
else if (CM.Cache.Upgrades[i].pp > CM.Cache.mid) color = CM.Disp.colorOrange;
|
||||
else color = CM.Disp.colorYellow;
|
||||
@@ -556,10 +556,10 @@ CM.Cache.RemakeBuildingsOtherPP = function(amount, target) {
|
||||
CM.Cache[target][i].pp = (CM.Cache[target][i].price / CM.Cache[target][i].bonus);
|
||||
}
|
||||
let color = '';
|
||||
if (CM.Cache[target][i].pp <= 0 || CM.Cache[target][i].pp == Infinity) color = CM.Disp.colorGray;
|
||||
if (CM.Cache[target][i].pp <= 0 || CM.Cache[target][i].pp === Infinity) color = CM.Disp.colorGray;
|
||||
else if (CM.Cache[target][i].pp < CM.Cache.min) color = CM.Disp.colorBlue;
|
||||
else if (CM.Cache[target][i].pp == CM.Cache.min) color = CM.Disp.colorGreen;
|
||||
else if (CM.Cache[target][i].pp == CM.Cache.max) color = CM.Disp.colorRed;
|
||||
else if (CM.Cache[target][i].pp === CM.Cache.min) color = CM.Disp.colorGreen;
|
||||
else if (CM.Cache[target][i].pp === CM.Cache.max) color = CM.Disp.colorRed;
|
||||
else if (CM.Cache[target][i].pp > CM.Cache.max) color = CM.Disp.colorPurple;
|
||||
else if (CM.Cache[target][i].pp > CM.Cache.mid) color = CM.Disp.colorOrange;
|
||||
else color = CM.Disp.colorYellow;
|
||||
@@ -604,7 +604,7 @@ CM.Cache.RemakeGoldenAndWrathCookiesMults = function() {
|
||||
};
|
||||
|
||||
CM.Cache.RemakeSeaSpec = function() {
|
||||
if (Game.season == 'christmas') {
|
||||
if (Game.season === 'christmas') {
|
||||
var val = Game.cookiesPs * 60;
|
||||
if (Game.hasBuff('Elder frenzy')) val *= 0.5; // very sorry
|
||||
if (Game.hasBuff('Frenzy')) val *= 0.75; // I sincerely apologize
|
||||
|
||||
@@ -40,7 +40,7 @@ CM.Config.LoadConfig = function(settings) {
|
||||
CM.Options[i] = CM.Data.ConfigDefault[i];
|
||||
}
|
||||
else if (i != 'Header' && i != 'Colors') {
|
||||
if (i.indexOf('SoundURL') == -1) {
|
||||
if (i.indexOf('SoundURL') === -1) {
|
||||
if (!(CM.Options[i] > -1 && CM.Options[i] < CM.ConfigData[i].label.length)) {
|
||||
mod = true;
|
||||
CM.Options[i] = CM.Data.ConfigDefault[i];
|
||||
@@ -53,7 +53,7 @@ CM.Config.LoadConfig = function(settings) {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (i == 'Header') {
|
||||
else if (i === 'Header') {
|
||||
for (let j in CM.Data.ConfigDefault.Header) {
|
||||
if (typeof CM.Options[i][j] === 'undefined' || !(CM.Options[i][j] > -1 && CM.Options[i][j] < 2)) {
|
||||
mod = true;
|
||||
@@ -104,7 +104,7 @@ CM.Config.RestoreDefault = function() {
|
||||
CM.Config.ToggleConfig = function(config) {
|
||||
CM.Options[config]++;
|
||||
|
||||
if (CM.Options[config] == CM.ConfigData[config].label.length) {
|
||||
if (CM.Options[config] === CM.ConfigData[config].label.length) {
|
||||
CM.Options[config] = 0;
|
||||
if (CM.ConfigData[config].toggle) l(CM.Config.ConfigPrefix + config).className = 'option off';
|
||||
}
|
||||
@@ -152,7 +152,7 @@ CM.Config.ToggleHeader = function(config) {
|
||||
* @param {number} ToggleOnOff A number indicating whether the option has been turned off (0) or on (1)
|
||||
*/
|
||||
CM.Config.CheckNotificationPermissions = function(ToggleOnOff) {
|
||||
if (ToggleOnOff == 1) {
|
||||
if (ToggleOnOff === 1) {
|
||||
// Check if browser support Promise version of Notification Permissions
|
||||
let checkNotificationPromise = function () {
|
||||
try {
|
||||
|
||||
296
src/Disp.js
296
src/Disp.js
@@ -16,9 +16,9 @@
|
||||
* @returns {number} 0 or the amount of cookies stored (CM.Cache.WrinklersTotal)
|
||||
*/
|
||||
CM.Disp.GetWrinkConfigBank = function() {
|
||||
if (CM.Options.CalcWrink == 1) {
|
||||
if (CM.Options.CalcWrink === 1) {
|
||||
return CM.Cache.WrinklersTotal;}
|
||||
else if (CM.Options.CalcWrink == 2) {
|
||||
else if (CM.Options.CalcWrink === 2) {
|
||||
return CM.Cache.WrinklersFattest[0];}
|
||||
else {
|
||||
return 0;}
|
||||
@@ -30,7 +30,7 @@ CM.Disp.GetWrinkConfigBank = function() {
|
||||
*/
|
||||
CM.Disp.PopAllNormalWrinklers = function() {
|
||||
for (let i of Object.keys(Game.wrinklers)) {
|
||||
if (Game.wrinklers[i].sucked > 0 && Game.wrinklers[i].type == 0) {
|
||||
if (Game.wrinklers[i].sucked > 0 && Game.wrinklers[i].type === 0) {
|
||||
Game.wrinklers[i].hp = 0;
|
||||
}
|
||||
}
|
||||
@@ -44,15 +44,15 @@ CM.Disp.GetCPS = function() {
|
||||
if (CM.Options.CPSMode) {
|
||||
return CM.Cache.AvgCPS;}
|
||||
else {
|
||||
if (CM.Options.CalcWrink == 0) {
|
||||
if (CM.Options.CalcWrink === 0) {
|
||||
return (Game.cookiesPs * (1 - Game.cpsSucked));
|
||||
}
|
||||
else if (CM.Options.CalcWrink == 1) {
|
||||
else if (CM.Options.CalcWrink === 1) {
|
||||
return Game.cookiesPs * (CM.Cache.CurrWrinklerCPSMult + (1 - (CM.Cache.CurrWrinklerCount * 0.05)));
|
||||
}
|
||||
else if (CM.Options.CalcWrink == 2) {
|
||||
else if (CM.Options.CalcWrink === 2) {
|
||||
// Check if fattest is shiny
|
||||
if (Game.wrinklers[CM.Cache.WrinklersFattest[1]].type == 1) {
|
||||
if (Game.wrinklers[CM.Cache.WrinklersFattest[1]].type === 1) {
|
||||
return Game.cookiesPs * ((CM.Cache.CurrWrinklerCPSMult * 3 / CM.Cache.CurrWrinklerCount) + (1 - (CM.Cache.CurrWrinklerCount * 0.05)));
|
||||
}
|
||||
else {
|
||||
@@ -130,7 +130,7 @@ CM.Disp.GetLumpColor = function(type) {
|
||||
* @returns {string} Formatted time
|
||||
*/
|
||||
CM.Disp.FormatTime = function(time, longFormat) {
|
||||
if (time == Infinity) return time;
|
||||
if (time === Infinity) return time;
|
||||
time = Math.ceil(time);
|
||||
var y = Math.floor(time / 31557600);
|
||||
var d = Math.floor(time % 31557600 / 86400);
|
||||
@@ -147,11 +147,11 @@ CM.Disp.FormatTime = function(time, longFormat) {
|
||||
str += (s < 10 ? '0' : '') + s;
|
||||
} else {
|
||||
if (time > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d';
|
||||
str += (y > 0 ? y + (longFormat ? (y == 1 ? ' year' : ' years') : 'y') + ', ': "");
|
||||
str += (d > 0 ? d + (longFormat ? (d == 1 ? ' day' : ' days') : 'd') + ', ': "");
|
||||
if (str.length > 0 || h > 0) str += h + (longFormat ? (h == 1 ? ' hour' : ' hours') : 'h') + ', ';
|
||||
if (str.length > 0 || m > 0) str += m + (longFormat ? (m == 1 ? ' minute' : ' minutes') : 'm') + ', ';
|
||||
str += s + (longFormat ? (s == 1 ? ' second' : ' seconds') : 's');
|
||||
str += (y > 0 ? y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y') + ', ': "");
|
||||
str += (d > 0 ? d + (longFormat ? (d === 1 ? ' day' : ' days') : 'd') + ', ': "");
|
||||
if (str.length > 0 || h > 0) str += h + (longFormat ? (h === 1 ? ' hour' : ' hours') : 'h') + ', ';
|
||||
if (str.length > 0 || m > 0) str += m + (longFormat ? (m === 1 ? ' minute' : ' minutes') : 'm') + ', ';
|
||||
str += s + (longFormat ? (s === 1 ? ' second' : ' seconds') : 's');
|
||||
}
|
||||
return str;
|
||||
};
|
||||
@@ -187,23 +187,23 @@ CM.Disp.GetTimeColor = function(time) {
|
||||
*/
|
||||
CM.Disp.Beautify = function(num, floats, forced) {
|
||||
var decimals = CM.Options.ScaleDecimals + 1;
|
||||
if (CM.Options.Scale == 0) {
|
||||
if (CM.Options.Scale === 0) {
|
||||
return CM.Backup.Beautify(num, floats);
|
||||
}
|
||||
else if (isFinite(num)) {
|
||||
var answer = '';
|
||||
if (num == 0) {
|
||||
if (num === 0) {
|
||||
return num.toString();
|
||||
}
|
||||
else if (0.001 < num && num < CM.Options.ScaleCutoff) {
|
||||
answer = num.toFixed(2);
|
||||
if (CM.Options.ScaleSeparator) answer = answer.toLocaleString('nl');
|
||||
for (let i = 0; i < 3; i++) {
|
||||
if (answer[answer.length - 1] == "0" || answer[answer.length - 1] == ".") answer = answer.slice(0, -1);
|
||||
if (answer[answer.length - 1] === "0" || answer[answer.length - 1] === ".") answer = answer.slice(0, -1);
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
else if (CM.Options.Scale == 4 && !forced || forced == 4) { // Scientific notation, 123456789 => 1.235E+8
|
||||
else if (CM.Options.Scale === 4 && !forced || forced === 4) { // Scientific notation, 123456789 => 1.235E+8
|
||||
answer = num.toExponential(decimals).toString().replace("e", "E");
|
||||
}
|
||||
else {
|
||||
@@ -211,28 +211,28 @@ CM.Disp.Beautify = function(num, floats, forced) {
|
||||
let AmountOfTenPowerThree = Math.floor(exponential.slice(exponential.indexOf("e") + 1) / 3);
|
||||
answer = (num / Number("1e" + (AmountOfTenPowerThree * 3))).toFixed(decimals);
|
||||
// answer is now "xxx.xx" (e.g., 123456789 would be 123.46)
|
||||
if (CM.Options.Scale == 1 && !forced || forced == 1) { // Metric scale, 123456789 => 123.457 M
|
||||
if (CM.Options.Scale === 1 && !forced || forced === 1) { // Metric scale, 123456789 => 123.457 M
|
||||
if (num >= 0.01 && num < Number("1e" + CM.Data.metric.length * 3)) {
|
||||
answer += ' ' + CM.Data.metric[AmountOfTenPowerThree];
|
||||
}
|
||||
// If number is too large or little, revert to scientific notation
|
||||
else answer = CM.Disp.Beautify(num, 0, 4);
|
||||
}
|
||||
else if (CM.Options.Scale == 2 && !forced || forced == 2) { // Short scale, 123456789 => 123.457 M
|
||||
else if (CM.Options.Scale === 2 && !forced || forced === 2) { // Short scale, 123456789 => 123.457 M
|
||||
if (num >= 0.01 && num < Number("1e" + CM.Data.shortScale.length * 3)) {
|
||||
answer += ' ' + CM.Data.shortScale[AmountOfTenPowerThree];
|
||||
}
|
||||
// If number is too large or little, revert to scientific notation
|
||||
else answer = CM.Disp.Beautify(num, 0, 4);
|
||||
}
|
||||
else if (CM.Options.Scale == 3 && !forced || forced == 3) { // Short scale, 123456789 => 123.457 M
|
||||
else if (CM.Options.Scale === 3 && !forced || forced === 3) { // Short scale, 123456789 => 123.457 M
|
||||
if (num >= 0.01 && num < Number("1e" + CM.Data.shortScaleAbbreviated.length * 3)) {
|
||||
answer += ' ' + CM.Data.shortScaleAbbreviated[AmountOfTenPowerThree];
|
||||
}
|
||||
// If number is too large or little, revert to scientific notation
|
||||
else answer = CM.Disp.Beautify(num, 0, 4);
|
||||
}
|
||||
else if (CM.Options.Scale == 5 && !forced || forced == 5) { // Engineering notation, 123456789 => 123.457E+6
|
||||
else if (CM.Options.Scale === 5 && !forced || forced === 5) { // Engineering notation, 123456789 => 123.457E+6
|
||||
answer += 'E' + AmountOfTenPowerThree * 3;
|
||||
}
|
||||
}
|
||||
@@ -243,7 +243,7 @@ CM.Disp.Beautify = function(num, floats, forced) {
|
||||
if (CM.Options.ScaleSeparator) answer = answer.replace('.', ',');
|
||||
return answer;
|
||||
}
|
||||
else if (num == Infinity) {
|
||||
else if (num === Infinity) {
|
||||
return "Infinity";
|
||||
}
|
||||
else {
|
||||
@@ -262,8 +262,8 @@ CM.Disp.Beautify = function(num, floats, forced) {
|
||||
CM.Disp.UpdateAscendState = function() {
|
||||
if (Game.OnAscend) {
|
||||
l('game').style.bottom = '0px';
|
||||
if (CM.Options.BotBar == 1) CM.Disp.BotBar.style.display = 'none';
|
||||
if (CM.Options.TimerBar == 1) CM.Disp.f.style.display = 'none';
|
||||
if (CM.Options.BotBar === 1) CM.Disp.BotBar.style.display = 'none';
|
||||
if (CM.Options.TimerBar === 1) CM.Disp.f.style.display = 'none';
|
||||
}
|
||||
else {
|
||||
CM.Disp.ToggleBotBar();
|
||||
@@ -302,8 +302,8 @@ CM.Disp.UpdateBackground = function() {
|
||||
CM.Disp.Draw = function () {
|
||||
// Draw autosave timer in stats menu, this must be done here to make it count down correctly
|
||||
if (
|
||||
(Game.prefs.autosave && Game.drawT % 10 == 0) && // with autosave ON and every 10 ticks
|
||||
(Game.onMenu == 'stats' && CM.Options.Stats) // while being on the stats menu only
|
||||
(Game.prefs.autosave && Game.drawT % 10 === 0) && // with autosave ON and every 10 ticks
|
||||
(Game.onMenu === 'stats' && CM.Options.Stats) // while being on the stats menu only
|
||||
) {
|
||||
var timer = document.getElementById('CMStatsAutosaveTimer');
|
||||
if (timer) {
|
||||
@@ -339,7 +339,7 @@ CM.Disp.Draw = function () {
|
||||
* It is called by CM.Disp.UpdateAscendState() and a change in CM.Options.BotBar
|
||||
*/
|
||||
CM.Disp.ToggleBotBar = function() {
|
||||
if (CM.Options.BotBar == 1) {
|
||||
if (CM.Options.BotBar === 1) {
|
||||
CM.Disp.BotBar.style.display = '';
|
||||
CM.Disp.UpdateBotBar();
|
||||
}
|
||||
@@ -405,7 +405,7 @@ CM.Disp.CreateBotBar = function() {
|
||||
* It is called by CM.Loop()
|
||||
*/
|
||||
CM.Disp.UpdateBotBar = function() {
|
||||
if (CM.Options.BotBar == 1 && CM.Cache.Objects1) {
|
||||
if (CM.Options.BotBar === 1 && CM.Cache.Objects1) {
|
||||
var count = 0;
|
||||
for (let i of Object.keys(CM.Cache.Objects1)) {
|
||||
let target = `Objects${Game.buyBulk}`
|
||||
@@ -416,7 +416,7 @@ CM.Disp.UpdateBotBar = function() {
|
||||
CM.Disp.BotBar.firstChild.firstChild.childNodes[2].childNodes[count].textContent = Beautify(CM.Cache[target][i].pp, 2);
|
||||
var timeColor = CM.Disp.GetTimeColor((Game.Objects[i].bulkPrice - (Game.cookies + CM.Disp.GetWrinkConfigBank())) / CM.Disp.GetCPS());
|
||||
CM.Disp.BotBar.firstChild.firstChild.childNodes[3].childNodes[count].className = CM.Disp.colorTextPre + timeColor.color;
|
||||
if (timeColor.text == "Done!" && Game.cookies < Game.Objects[i].bulkPrice) {
|
||||
if (timeColor.text === "Done!" && Game.cookies < Game.Objects[i].bulkPrice) {
|
||||
CM.Disp.BotBar.firstChild.firstChild.childNodes[3].childNodes[count].textContent = timeColor.text + " (with Wrink)";
|
||||
}
|
||||
else CM.Disp.BotBar.firstChild.firstChild.childNodes[3].childNodes[count].textContent = timeColor.text;
|
||||
@@ -532,7 +532,7 @@ CM.Disp.TimerBarCreateBar = function(id, name, bars) {
|
||||
colorBar.style.height = '10px';
|
||||
colorBar.style.verticalAlign = "text-top";
|
||||
colorBar.style.textAlign="center";
|
||||
if (bars.length - 1 == i) {
|
||||
if (bars.length - 1 === i) {
|
||||
colorBar.style.borderTopRightRadius = '10px';
|
||||
colorBar.style.borderBottomRightRadius = '10px';
|
||||
}
|
||||
@@ -558,7 +558,7 @@ CM.Disp.TimerBarCreateBar = function(id, name, bars) {
|
||||
* It is called by CM.Loop()
|
||||
*/
|
||||
CM.Disp.UpdateTimerBar = function() {
|
||||
if (CM.Options.TimerBar == 1) {
|
||||
if (CM.Options.TimerBar === 1) {
|
||||
// label width: 113, timer width: 30, div margin: 20
|
||||
var maxWidthTwoBar = CM.Disp.TimerBar.offsetWidth - 163;
|
||||
// label width: 113, div margin: 20, calculate timer width at runtime
|
||||
@@ -566,12 +566,12 @@ CM.Disp.UpdateTimerBar = function() {
|
||||
var numberOfTimers = 0;
|
||||
|
||||
// Regulates visibility of Golden Cookie timer
|
||||
if (Game.shimmerTypes.golden.spawned == 0 && !Game.Has('Golden switch [off]')) {
|
||||
if (Game.shimmerTypes.golden.spawned === 0 && !Game.Has('Golden switch [off]')) {
|
||||
CM.Disp.TimerBars.CMTimerBarGC.style.display = '';
|
||||
l('CMTimerBarGCMinBar').style.width = Math.round(Math.max(0, Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) * maxWidthTwoBar / Game.shimmerTypes.golden.maxTime) + 'px';
|
||||
if (CM.Options.TimerBarOverlay >= 1) l('CMTimerBarGCMinBar').textContent = Math.ceil((Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time)/ Game.fps);
|
||||
else l('CMTimerBarGCMinBar').textContent = "";
|
||||
if (Game.shimmerTypes.golden.minTime == Game.shimmerTypes.golden.maxTime) {
|
||||
if (Game.shimmerTypes.golden.minTime === Game.shimmerTypes.golden.maxTime) {
|
||||
l('CMTimerBarGCMinBar').style.borderTopRightRadius = '10px';
|
||||
l('CMTimerBarGCMinBar').style.borderBottomRightRadius = '10px';
|
||||
}
|
||||
@@ -588,7 +588,7 @@ CM.Disp.UpdateTimerBar = function() {
|
||||
else CM.Disp.TimerBars.CMTimerBarGC.style.display = 'none';
|
||||
|
||||
// Regulates visibility of Reindeer timer
|
||||
if (Game.season == 'christmas' && Game.shimmerTypes.reindeer.spawned == 0) {
|
||||
if (Game.season === 'christmas' && Game.shimmerTypes.reindeer.spawned === 0) {
|
||||
CM.Disp.TimerBars. CMTimerBarRen.style.display = '';
|
||||
l('CMTimerBarRenMinBar').style.width = Math.round(Math.max(0, Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time) * maxWidthTwoBar / Game.shimmerTypes.reindeer.maxTime) + 'px';
|
||||
if (CM.Options.TimerBarOverlay >= 1) l('CMTimerBarRenMinBar').textContent = Math.ceil((Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time)/ Game.fps);
|
||||
@@ -620,7 +620,7 @@ CM.Disp.UpdateTimerBar = function() {
|
||||
else classColor = CM.Disp.colorPurple;
|
||||
timer.lastChild.children[1].className = CM.Disp.colorBackPre + classColor;
|
||||
timer.lastChild.children[1].style.color = "black";
|
||||
if (CM.Options.TimerBarOverlay == 2) timer.lastChild.children[1].textContent = Math.round(100 * (Game.buffs[i].time / Game.buffs[i].maxTime)) + "%";
|
||||
if (CM.Options.TimerBarOverlay === 2) timer.lastChild.children[1].textContent = Math.round(100 * (Game.buffs[i].time / Game.buffs[i].maxTime)) + "%";
|
||||
else timer.lastChild.children[1].textContent = "";
|
||||
timer.lastChild.children[1].style.width = Math.round(Game.buffs[i].time * (maxWidthOneBar - Math.ceil(Game.buffs[i].time / Game.fps).toString().length * 8) / Game.buffs[i].maxTime) + 'px';
|
||||
timer.lastChild.children[2].textContent = Math.ceil(Game.buffs[i].time / Game.fps);
|
||||
@@ -647,7 +647,7 @@ CM.Disp.UpdateTimerBar = function() {
|
||||
* It is called by CM.Disp.UpdateAscendState() or a change in CM.Options.TimerBar
|
||||
*/
|
||||
CM.Disp.ToggleTimerBar = function() {
|
||||
if (CM.Options.TimerBar == 1) CM.Disp.TimerBar.style.display = '';
|
||||
if (CM.Options.TimerBar === 1) CM.Disp.TimerBar.style.display = '';
|
||||
else CM.Disp.TimerBar.style.display = 'none';
|
||||
CM.Disp.UpdateBotTimerBarPosition();
|
||||
};
|
||||
@@ -657,7 +657,7 @@ CM.Disp.ToggleTimerBar = function() {
|
||||
* It is called by a change in CM.Options.TimerBarPos
|
||||
*/
|
||||
CM.Disp.ToggleTimerBarPos = function() {
|
||||
if (CM.Options.TimerBarPos == 0) {
|
||||
if (CM.Options.TimerBarPos === 0) {
|
||||
CM.Disp.TimerBar.style.width = '30%';
|
||||
CM.Disp.TimerBar.style.bottom = '';
|
||||
l('game').insertBefore(CM.Disp.TimerBar, l('sectionLeft'));
|
||||
@@ -678,22 +678,22 @@ CM.Disp.ToggleTimerBarPos = function() {
|
||||
* It is called by CM.Disp.ToggleTimerBar(), CM.Disp.ToggleTimerBarPos() and CM.Disp.ToggleBotBar()
|
||||
*/
|
||||
CM.Disp.UpdateBotTimerBarPosition = function() {
|
||||
if (CM.Options.BotBar == 1 && CM.Options.TimerBar == 1 && CM.Options.TimerBarPos == 1) {
|
||||
if (CM.Options.BotBar === 1 && CM.Options.TimerBar === 1 && CM.Options.TimerBarPos === 1) {
|
||||
CM.Disp.BotBar.style.bottom = CM.Disp.TimerBar.style.height;
|
||||
l('game').style.bottom = Number(CM.Disp.TimerBar.style.height.replace("px","")) + 70 + "px";
|
||||
}
|
||||
else if (CM.Options.BotBar == 1) {
|
||||
else if (CM.Options.BotBar === 1) {
|
||||
CM.Disp.BotBar.style.bottom = '0px';
|
||||
l('game').style.bottom = '70px';
|
||||
}
|
||||
else if (CM.Options.TimerBar == 1 && CM.Options.TimerBarPos == 1) {
|
||||
else if (CM.Options.TimerBar === 1 && CM.Options.TimerBarPos === 1) {
|
||||
l('game').style.bottom = CM.Disp.TimerBar.style.height;
|
||||
}
|
||||
else { // No bars
|
||||
l('game').style.bottom = '0px';
|
||||
}
|
||||
|
||||
if (CM.Options.TimerBar == 1 && CM.Options.TimerBarPos == 0) {
|
||||
if (CM.Options.TimerBar === 1 && CM.Options.TimerBarPos === 0) {
|
||||
l('sectionLeft').style.top = CM.Disp.TimerBar.style.height;
|
||||
}
|
||||
else {
|
||||
@@ -714,8 +714,8 @@ CM.Disp.UpdateBotTimerBarPosition = function() {
|
||||
*/
|
||||
CM.Disp.UpdateBuildings = function() {
|
||||
let target = `Objects${Game.buyBulk}`
|
||||
if (Game.buyMode == 1) {
|
||||
if (CM.Options.BuildColor == 1) {
|
||||
if (Game.buyMode === 1) {
|
||||
if (CM.Options.BuildColor === 1) {
|
||||
for (let i of Object.keys(CM.Cache[target])) {
|
||||
l('productPrice' + Game.Objects[i].id).style.color = CM.Options.Colors[CM.Cache[target][i].color];
|
||||
}
|
||||
@@ -725,7 +725,7 @@ CM.Disp.UpdateBuildings = function() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Game.buyMode == -1) {
|
||||
else if (Game.buyMode === -1) {
|
||||
for (let i of Object.keys(CM.Cache.Objects1)) {
|
||||
var o = Game.Objects[i];
|
||||
l('productPrice' + o.id).style.color = '';
|
||||
@@ -744,7 +744,7 @@ CM.Disp.UpdateBuildings = function() {
|
||||
// Build array of pointers, sort by pp, use array index (+2) as the grid row number
|
||||
// (grid rows are 1-based indexing, and row 1 is the bulk buy/sell options)
|
||||
// This regulates sorting of buildings
|
||||
if (Game.buyMode == 1 && CM.Options.SortBuildings) {
|
||||
if (Game.buyMode === 1 && CM.Options.SortBuildings) {
|
||||
let arr = Object.keys(CM.Cache[target]).map(k =>
|
||||
{
|
||||
var o = CM.Cache[target][k];
|
||||
@@ -807,13 +807,13 @@ CM.Disp.UpdateUpgrades = function() {
|
||||
div.className = CM.Disp.colorBackPre + CM.Cache.Upgrades[me.name].color;
|
||||
l('upgrade' + i).appendChild(div);
|
||||
}
|
||||
if (CM.Cache.Upgrades[me.name].color == CM.Disp.colorBlue) blue++;
|
||||
else if (CM.Cache.Upgrades[me.name].color == CM.Disp.colorGreen) green++;
|
||||
else if (CM.Cache.Upgrades[me.name].color == CM.Disp.colorYellow) yellow++;
|
||||
else if (CM.Cache.Upgrades[me.name].color == CM.Disp.colorOrange) orange++;
|
||||
else if (CM.Cache.Upgrades[me.name].color == CM.Disp.colorRed) red++;
|
||||
else if (CM.Cache.Upgrades[me.name].color == CM.Disp.colorPurple) purple++;
|
||||
else if (CM.Cache.Upgrades[me.name].color == CM.Disp.colorGray) gray++;
|
||||
if (CM.Cache.Upgrades[me.name].color === CM.Disp.colorBlue) blue++;
|
||||
else if (CM.Cache.Upgrades[me.name].color === CM.Disp.colorGreen) green++;
|
||||
else if (CM.Cache.Upgrades[me.name].color === CM.Disp.colorYellow) yellow++;
|
||||
else if (CM.Cache.Upgrades[me.name].color === CM.Disp.colorOrange) orange++;
|
||||
else if (CM.Cache.Upgrades[me.name].color === CM.Disp.colorRed) red++;
|
||||
else if (CM.Cache.Upgrades[me.name].color === CM.Disp.colorPurple) purple++;
|
||||
else if (CM.Cache.Upgrades[me.name].color === CM.Disp.colorGray) gray++;
|
||||
}
|
||||
|
||||
l('CMUpgradeBarBlue').textContent = blue;
|
||||
@@ -859,11 +859,11 @@ CM.Disp.UpdateUpgrades = function() {
|
||||
* It is called by a change in CM.Options.UpBarColor
|
||||
*/
|
||||
CM.Disp.ToggleUpgradeBarAndColor = function() {
|
||||
if (CM.Options.UpBarColor == 1) { // Colours and bar on
|
||||
if (CM.Options.UpBarColor === 1) { // Colours and bar on
|
||||
CM.Disp.UpgradeBar.style.display = '';
|
||||
CM.Disp.UpdateUpgrades();
|
||||
}
|
||||
else if (CM.Options.UpBarColor == 2) {// Colours on and bar off
|
||||
else if (CM.Options.UpBarColor === 2) {// Colours on and bar off
|
||||
CM.Disp.UpgradeBar.style.display = 'none';
|
||||
CM.Disp.UpdateUpgrades();
|
||||
}
|
||||
@@ -878,7 +878,7 @@ CM.Disp.ToggleUpgradeBarAndColor = function() {
|
||||
* It is called by a change in CM.Options.UpgradeBarFixedPos
|
||||
*/
|
||||
CM.Disp.ToggleUpgradeBarFixedPos = function() {
|
||||
if (CM.Options.UpgradeBarFixedPos == 1) { // Fix to top of screen when scrolling
|
||||
if (CM.Options.UpgradeBarFixedPos === 1) { // Fix to top of screen when scrolling
|
||||
CM.Disp.UpgradeBar.style.position = 'sticky';
|
||||
CM.Disp.UpgradeBar.style.top = '0px';
|
||||
}
|
||||
@@ -987,14 +987,14 @@ CM.Disp.CreateWhiteScreen = function() {
|
||||
* This function creates a flash depending on configs. It is called by all functions
|
||||
* that check game-events and which have settings for Flashes (e.g., Golden Cookies appearing, Magic meter being full)
|
||||
* @param {number} mode Sets the intensity of the flash, used to recursively dim flash
|
||||
* All calls of function have use mode == 3
|
||||
* All calls of function have use mode === 3
|
||||
* @param {string} config The setting in CM.Options that is checked before creating the flash
|
||||
*/
|
||||
CM.Disp.Flash = function(mode, config) {
|
||||
// The arguments check makes the sound not play upon initialization of the mod
|
||||
if ((CM.Options[config] == 1 && mode == 3 && CM.Footer.isInitzializing === false) || mode == 1) {
|
||||
if ((CM.Options[config] === 1 && mode === 3 && CM.Footer.isInitzializing === false) || mode === 1) {
|
||||
CM.Disp.WhiteScreen.style.opacity = '0.5';
|
||||
if (mode == 3) {
|
||||
if (mode === 3) {
|
||||
CM.Disp.WhiteScreen.style.display = 'inline';
|
||||
setTimeout(function() {CM.Disp.Flash(2, config);}, 1000/Game.fps);
|
||||
}
|
||||
@@ -1002,11 +1002,11 @@ CM.Disp.Flash = function(mode, config) {
|
||||
setTimeout(function() {CM.Disp.Flash(0, config);}, 1000/Game.fps);
|
||||
}
|
||||
}
|
||||
else if (mode == 2) {
|
||||
else if (mode === 2) {
|
||||
CM.Disp.WhiteScreen.style.opacity = '1';
|
||||
setTimeout(function() {CM.Disp.Flash(1, config);}, 1000/Game.fps);
|
||||
}
|
||||
else if (mode == 0) CM.Disp.WhiteScreen.style.display = 'none';
|
||||
else if (mode === 0) CM.Disp.WhiteScreen.style.display = 'none';
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1018,7 +1018,7 @@ CM.Disp.Flash = function(mode, config) {
|
||||
*/
|
||||
CM.Disp.PlaySound = function(url, sndConfig, volConfig) {
|
||||
// The arguments check makes the sound not play upon initialization of the mod
|
||||
if (CM.Options[sndConfig] == 1 && CM.Footer.isInitzializing === false) {
|
||||
if (CM.Options[sndConfig] === 1 && CM.Footer.isInitzializing === false) {
|
||||
var sound = new realAudio(url);
|
||||
if (CM.Options.GeneralSound) sound.volume = (CM.Options[volConfig] / 100) * (Game.volume / 100);
|
||||
else sound.volume = (CM.Options[volConfig] / 100);
|
||||
@@ -1035,7 +1035,7 @@ CM.Disp.PlaySound = function(url, sndConfig, volConfig) {
|
||||
*/
|
||||
CM.Disp.Notification = function(notifyConfig, title, message) {
|
||||
// The arguments check makes the sound not play upon initialization of the mod
|
||||
if (CM.Options[notifyConfig] == 1 && document.visibilityState == 'hidden' && CM.Footer.isInitzializing === false) {
|
||||
if (CM.Options[notifyConfig] === 1 && document.visibilityState === 'hidden' && CM.Footer.isInitzializing === false) {
|
||||
var CookieIcon = 'https://orteil.dashnet.org/cookieclicker/favicon.ico';
|
||||
new Notification(title, {body: message, badge: CookieIcon});
|
||||
}
|
||||
@@ -1061,7 +1061,7 @@ CM.Disp.CreateFavicon = function() {
|
||||
* By relying on CM.Cache.spawnedGoldenShimmer it only changes for non-user spawned cookie
|
||||
*/
|
||||
CM.Disp.UpdateFavicon = function() {
|
||||
if (CM.Options.Favicon == 1 && CM.Main.lastGoldenCookieState > 0) {
|
||||
if (CM.Options.Favicon === 1 && CM.Main.lastGoldenCookieState > 0) {
|
||||
if (CM.Cache.spawnedGoldenShimmer.wrath) CM.Disp.Favicon.href = 'https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico';
|
||||
else CM.Disp.Favicon.href = 'https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico';
|
||||
}
|
||||
@@ -1073,10 +1073,10 @@ CM.Disp.UpdateFavicon = function() {
|
||||
* It is called on every loop by Game.Logic() which also sets CM.Cache.Title to Game.cookies
|
||||
*/
|
||||
CM.Disp.UpdateTitle = function() {
|
||||
if (Game.OnAscend || CM.Options.Title == 0) {
|
||||
if (Game.OnAscend || CM.Options.Title === 0) {
|
||||
document.title = CM.Cache.Title;
|
||||
}
|
||||
else if (CM.Options.Title == 1) {
|
||||
else if (CM.Options.Title === 1) {
|
||||
let addFC = false;
|
||||
let addSP = false;
|
||||
let titleGC;
|
||||
@@ -1097,7 +1097,7 @@ CM.Disp.UpdateTitle = function() {
|
||||
titleFC = '[F]';
|
||||
}
|
||||
|
||||
if (Game.season == 'christmas') {
|
||||
if (Game.season === 'christmas') {
|
||||
addSP = true;
|
||||
if (CM.Main.lastSeasonPopupState) titleSP = '[R ' + Math.ceil(CM.Cache.seasonPopShimmer.life / Game.fps) + ']';
|
||||
else {
|
||||
@@ -1107,12 +1107,12 @@ CM.Disp.UpdateTitle = function() {
|
||||
|
||||
// Remove previous timers and add current cookies
|
||||
let str = CM.Cache.Title;
|
||||
if (str.charAt(0) == '[') {
|
||||
if (str.charAt(0) === '[') {
|
||||
str = str.substring(str.lastIndexOf(']') + 1);
|
||||
}
|
||||
document.title = titleGC + (addFC ? titleFC : '') + (addSP ? titleSP : '') + ' ' + str;
|
||||
}
|
||||
else if (CM.Options.Title == 2) {
|
||||
else if (CM.Options.Title === 2) {
|
||||
let str = '';
|
||||
let spawn = false;
|
||||
if (CM.Cache.spawnedGoldenShimmer) {
|
||||
@@ -1124,13 +1124,13 @@ CM.Disp.UpdateTitle = function() {
|
||||
spawn = true;
|
||||
str += '[F]';
|
||||
}
|
||||
if (Game.season == 'christmas' && CM.Main.lastSeasonPopupState) {
|
||||
if (Game.season === 'christmas' && CM.Main.lastSeasonPopupState) {
|
||||
str += '[R ' + Math.ceil(CM.Cache.seasonPopShimmer.life / Game.fps) + ']';
|
||||
spawn = true;
|
||||
}
|
||||
if (spawn) str += ' - ';
|
||||
let title = 'Cookie Clicker';
|
||||
if (Game.season == 'fools') title = 'Cookie Baker';
|
||||
if (Game.season === 'fools') title = 'Cookie Baker';
|
||||
str += title;
|
||||
document.title = str;
|
||||
}
|
||||
@@ -1157,7 +1157,7 @@ CM.Disp.CreateGCTimer = function(cookie) {
|
||||
GCTimer.style.fontSize = '35px';
|
||||
GCTimer.style.cursor = 'pointer';
|
||||
GCTimer.style.display = 'block';
|
||||
if (CM.Options.GCTimer == 0) GCTimer.style.display = 'none';
|
||||
if (CM.Options.GCTimer === 0) GCTimer.style.display = 'none';
|
||||
GCTimer.style.left = cookie.l.style.left;
|
||||
GCTimer.style.top = cookie.l.style.top;
|
||||
GCTimer.onclick = function () {cookie.pop();};
|
||||
@@ -1173,7 +1173,7 @@ CM.Disp.CreateGCTimer = function(cookie) {
|
||||
* It is called by a change in CM.Options.GCTimer
|
||||
*/
|
||||
CM.Disp.ToggleGCTimer = function() {
|
||||
if (CM.Options.GCTimer == 1) {
|
||||
if (CM.Options.GCTimer === 1) {
|
||||
for (let i of Object.keys(CM.Disp.GCTimers)) {
|
||||
CM.Disp.GCTimers[i].style.display = 'block';
|
||||
CM.Disp.GCTimers[i].style.left = CM.Cache.goldenShimmersByID[i].l.style.left;
|
||||
@@ -1231,19 +1231,19 @@ CM.Disp.ReplaceTooltipUpgrade = function() {
|
||||
* @returns {string} l('tooltip').innerHTML The HTML of the l('tooltip')-object
|
||||
*/
|
||||
CM.Disp.Tooltip = function(type, name) {
|
||||
if (type == 'b') { // Buildings
|
||||
if (type === 'b') { // Buildings
|
||||
l('tooltip').innerHTML = Game.Objects[name].tooltip();
|
||||
// Adds amortization info to the list of info per building
|
||||
if (CM.Options.TooltipAmor == 1) {
|
||||
if (CM.Options.TooltipAmor === 1) {
|
||||
var buildPrice = CM.Sim.BuildingGetPrice(Game.Objects[name], Game.Objects[name].basePrice, 0, Game.Objects[name].free, Game.Objects[name].amount);
|
||||
var amortizeAmount = buildPrice - Game.Objects[name].totalCookies;
|
||||
if (amortizeAmount > 0) {
|
||||
l('tooltip').innerHTML = l('tooltip').innerHTML
|
||||
.split('so far</div>')
|
||||
.join('so far<br/>• <b>' + Beautify(amortizeAmount) + '</b> ' + (Math.floor(amortizeAmount) == 1 ? 'cookie' : 'cookies') + ' left to amortize (' + CM.Disp.GetTimeColor((buildPrice - Game.Objects[name].totalCookies) / (Game.Objects[name].storedTotalCps * Game.globalCpsMult)).text + ')</div>');
|
||||
.join('so far<br/>• <b>' + Beautify(amortizeAmount) + '</b> ' + (Math.floor(amortizeAmount) === 1 ? 'cookie' : 'cookies') + ' left to amortize (' + CM.Disp.GetTimeColor((buildPrice - Game.Objects[name].totalCookies) / (Game.Objects[name].storedTotalCps * Game.globalCpsMult)).text + ')</div>');
|
||||
}
|
||||
}
|
||||
if (Game.buyMode == -1) {
|
||||
if (Game.buyMode === -1) {
|
||||
/*
|
||||
* Fix sell price displayed in the object tooltip.
|
||||
*
|
||||
@@ -1255,17 +1255,17 @@ CM.Disp.Tooltip = function(type, name) {
|
||||
l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].bulkPrice)).join(Beautify(CM.Sim.BuildingSell(Game.Objects[name], Game.Objects[name].basePrice, Game.Objects[name].amount, Game.Objects[name].free, Game.buyBulk, 1)));
|
||||
}
|
||||
}
|
||||
else if (type == 'u') { // Upgrades
|
||||
else if (type === 'u') { // Upgrades
|
||||
if (!Game.UpgradesInStore[name]) return '';
|
||||
l('tooltip').innerHTML = Game.crateTooltip(Game.UpgradesInStore[name], 'store');
|
||||
}
|
||||
else if (type === 's') l('tooltip').innerHTML = Game.lumpTooltip(); // Sugar Lumps
|
||||
else if (type === 'g') l('tooltip').innerHTML = Game.Objects['Wizard tower'].minigame.spellTooltip(name)(); // Grimoire
|
||||
else if (type == 'p') l('tooltip').innerHTML = Game.ObjectsById[2].minigame.tileTooltip(name[0], name[1])(); // Garden plots
|
||||
else if (type == 'ha') l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)(); // Harvest all button in garden
|
||||
else if (type === 'p') l('tooltip').innerHTML = Game.ObjectsById[2].minigame.tileTooltip(name[0], name[1])(); // Garden plots
|
||||
else if (type === 'ha') l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)(); // Harvest all button in garden
|
||||
|
||||
// Adds area for extra tooltip-sections
|
||||
if ((type == 'b' && Game.buyMode == 1) || type == 'u' || type == 's' || type == 'g' || type == 'p' || type == 'ha') {
|
||||
if ((type === 'b' && Game.buyMode === 1) || type === 'u' || type === 's' || type === 'g' || type === 'p' || type === 'ha') {
|
||||
var area = document.createElement('div');
|
||||
area.id = 'CMTooltipArea';
|
||||
l('tooltip').appendChild(area);
|
||||
@@ -1344,7 +1344,7 @@ CM.Disp.TooltipCreateCalculationSection = function(tooltip) {
|
||||
time.id = 'CMTooltipTime';
|
||||
tooltip.appendChild(time);
|
||||
|
||||
if (CM.Disp.tooltipType == 'b') {
|
||||
if (CM.Disp.tooltipType === 'b') {
|
||||
tooltip.appendChild(CM.Disp.TooltipCreateHeader('Production left till next achievement'));
|
||||
tooltip.lastChild.id = 'CMTooltipProductionHeader'; // Assign a id in order to hid when no achiev's are left
|
||||
var production = document.createElement('div');
|
||||
@@ -1416,10 +1416,10 @@ CM.Disp.UpdateTooltip = function() {
|
||||
let tooltipBox = CM.Disp.TooltipCreateTooltipBox();
|
||||
l('CMTooltipArea').appendChild(tooltipBox);
|
||||
|
||||
if (CM.Disp.tooltipType == 'b') {
|
||||
if (CM.Disp.tooltipType === 'b') {
|
||||
CM.Disp.UpdateTooltipBuilding();
|
||||
}
|
||||
else if (CM.Disp.tooltipType == 'u') {
|
||||
else if (CM.Disp.tooltipType === 'u') {
|
||||
CM.Disp.UpdateTooltipUpgrade();
|
||||
}
|
||||
else if (CM.Disp.tooltipType === 's') {
|
||||
@@ -1436,7 +1436,7 @@ CM.Disp.UpdateTooltip = function() {
|
||||
}
|
||||
CM.Disp.UpdateTooltipWarnings();
|
||||
}
|
||||
else if (l('CMTooltipArea') == null) { // Remove warnings if its a basic tooltip
|
||||
else if (l('CMTooltipArea') === null) { // Remove warnings if its a basic tooltip
|
||||
if (l('CMDispTooltipWarningParent') != null) {
|
||||
l('CMDispTooltipWarningParent').remove();
|
||||
}
|
||||
@@ -1448,7 +1448,7 @@ CM.Disp.UpdateTooltip = function() {
|
||||
* It is called when Building tooltips are created or refreshed by CM.Disp.UpdateTooltip()
|
||||
*/
|
||||
CM.Disp.UpdateTooltipBuilding = function() {
|
||||
if (CM.Options.TooltipBuildUpgrade == 1 && Game.buyMode == 1) {
|
||||
if (CM.Options.TooltipBuildUpgrade === 1 && Game.buyMode === 1) {
|
||||
let tooltipBox = l('CMTooltipBorder');
|
||||
CM.Disp.TooltipCreateCalculationSection(tooltipBox);
|
||||
|
||||
@@ -1458,7 +1458,7 @@ CM.Disp.UpdateTooltipBuilding = function() {
|
||||
CM.Disp.TooltipBonusIncome = CM.Cache[target][CM.Disp.tooltipName].bonus;
|
||||
|
||||
|
||||
if (CM.Options.TooltipBuildUpgrade == 1 && Game.buyMode == 1) {
|
||||
if (CM.Options.TooltipBuildUpgrade === 1 && Game.buyMode === 1) {
|
||||
l('CMTooltipIncome').textContent = Beautify(CM.Disp.TooltipBonusIncome, 2);
|
||||
let increase = Math.round(CM.Disp.TooltipBonusIncome / Game.cookiesPs * 10000);
|
||||
if (isFinite(increase) && increase != 0) {
|
||||
@@ -1469,7 +1469,7 @@ CM.Disp.UpdateTooltipBuilding = function() {
|
||||
l('CMTooltipPP').className = CM.Disp.colorTextPre + CM.Cache[target][CM.Disp.tooltipName].color;
|
||||
var timeColor = CM.Disp.GetTimeColor((CM.Disp.TooltipPrice - (Game.cookies + CM.Disp.GetWrinkConfigBank())) / CM.Disp.GetCPS());
|
||||
l('CMTooltipTime').textContent = timeColor.text;
|
||||
if (timeColor.text == "Done!" && Game.cookies < CM.Cache[target][CM.Disp.tooltipName].price) {
|
||||
if (timeColor.text === "Done!" && Game.cookies < CM.Cache[target][CM.Disp.tooltipName].price) {
|
||||
l('CMTooltipTime').textContent = timeColor.text + " (with Wrink)";
|
||||
}
|
||||
else l('CMTooltipTime').textContent = timeColor.text;
|
||||
@@ -1506,7 +1506,7 @@ CM.Disp.UpdateTooltipUpgrade = function() {
|
||||
CM.Disp.TooltipPrice = Game.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].getPrice();
|
||||
CM.Disp.TooltipBonusMouse = CM.Cache.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].bonusMouse;
|
||||
|
||||
if (CM.Options.TooltipBuildUpgrade == 1) {
|
||||
if (CM.Options.TooltipBuildUpgrade === 1) {
|
||||
l('CMTooltipIncome').textContent = Beautify(CM.Disp.TooltipBonusIncome, 2);
|
||||
let increase = Math.round(CM.Disp.TooltipBonusIncome / Game.cookiesPs * 10000);
|
||||
if (isFinite(increase) && increase != 0) {
|
||||
@@ -1520,7 +1520,7 @@ CM.Disp.UpdateTooltipUpgrade = function() {
|
||||
l('CMTooltipCookiePerClick').previousSibling.style.display = "block";
|
||||
}
|
||||
// If only a clicking power upgrade change PP to click-based period
|
||||
if (CM.Disp.TooltipBonusIncome == 0 && CM.Disp.TooltipBonusMouse) {
|
||||
if (CM.Disp.TooltipBonusIncome === 0 && CM.Disp.TooltipBonusMouse) {
|
||||
l('CMTooltipPP').textContent = Beautify(CM.Disp.TooltipPrice / CM.Disp.TooltipBonusMouse) + ' Clicks';
|
||||
l('CMTooltipPP').style.color = "white";
|
||||
}
|
||||
@@ -1530,14 +1530,14 @@ CM.Disp.UpdateTooltipUpgrade = function() {
|
||||
}
|
||||
var timeColor = CM.Disp.GetTimeColor((CM.Disp.TooltipPrice - (Game.cookies + CM.Disp.GetWrinkConfigBank())) / CM.Disp.GetCPS());
|
||||
l('CMTooltipTime').textContent = timeColor.text;
|
||||
if (timeColor.text == "Done!" && Game.cookies < Game.UpgradesInStore[CM.Disp.tooltipName].getPrice()) {
|
||||
if (timeColor.text === "Done!" && Game.cookies < Game.UpgradesInStore[CM.Disp.tooltipName].getPrice()) {
|
||||
l('CMTooltipTime').textContent = timeColor.text + " (with Wrink)";
|
||||
}
|
||||
else l('CMTooltipTime').textContent = timeColor.text;
|
||||
l('CMTooltipTime').className = CM.Disp.colorTextPre + timeColor.color;
|
||||
|
||||
// Add extra info to Chocolate egg tooltip
|
||||
if (Game.UpgradesInStore[CM.Disp.tooltipName].name == "Chocolate egg") {
|
||||
if (Game.UpgradesInStore[CM.Disp.tooltipName].name === "Chocolate egg") {
|
||||
l('CMTooltipBorder').lastChild.style.marginBottom = '4px';
|
||||
l('CMTooltipBorder').appendChild(CM.Disp.TooltipCreateHeader('Cookies to be gained (Currently/Max)'));
|
||||
var chocolate = document.createElement('div');
|
||||
@@ -1579,7 +1579,7 @@ CM.Disp.UpdateTooltipGrimoire = function() {
|
||||
var minigame = Game.Objects['Wizard tower'].minigame;
|
||||
var spellCost = minigame.getSpellCost(minigame.spellsById[CM.Disp.tooltipName]);
|
||||
|
||||
if (CM.Options.TooltipGrim == 1 && spellCost <= minigame.magicM) {
|
||||
if (CM.Options.TooltipGrim === 1 && spellCost <= minigame.magicM) {
|
||||
let tooltipBox = l('CMTooltipBorder');
|
||||
|
||||
// Time left till enough magic for spell
|
||||
@@ -1602,8 +1602,8 @@ CM.Disp.UpdateTooltipGrimoire = function() {
|
||||
recover.className = CM.Disp.colorTextPre + recoverColor.color;
|
||||
}
|
||||
|
||||
// Extra information on cookies gained when spell is Conjure Baked Goods (Name == 0)
|
||||
if (CM.Disp.tooltipName == 0) {
|
||||
// Extra information on cookies gained when spell is Conjure Baked Goods (Name === 0)
|
||||
if (CM.Disp.tooltipName === 0) {
|
||||
tooltipBox.appendChild(CM.Disp.TooltipCreateHeader('Cookies to be gained/lost'));
|
||||
var conjure = document.createElement('div');
|
||||
conjure.id = 'CMTooltipConjure';
|
||||
@@ -1640,16 +1640,16 @@ CM.Disp.UpdateTooltipGardenPlots = function() {
|
||||
var reward = document.createElement('div');
|
||||
reward.id = 'CMTooltipPlantReward';
|
||||
l('CMTooltipBorder').appendChild(reward);
|
||||
if (plantName == "Bakeberry") {
|
||||
if (plantName === "Bakeberry") {
|
||||
l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 30);
|
||||
}
|
||||
else if (plantName == "Chocoroot" || plantName == "White chocoroot") {
|
||||
else if (plantName === "Chocoroot" || plantName === "White chocoroot") {
|
||||
l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 3);
|
||||
}
|
||||
else if (plantName == "Queenbeet") {
|
||||
else if (plantName === "Queenbeet") {
|
||||
l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 60);
|
||||
}
|
||||
else if (plantName == "Duketater") {
|
||||
else if (plantName === "Duketater") {
|
||||
l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 120);
|
||||
}
|
||||
else l('CMTooltipArea').style.display = "none";
|
||||
@@ -1679,16 +1679,16 @@ CM.Disp.UpdateTooltipHarvestAll = function() {
|
||||
let count = true;
|
||||
if (mortal && me.immortal) count = false;
|
||||
if (tile[1] < me.matureBase) count = false;
|
||||
if (count && plantName == "Bakeberry") {
|
||||
if (count && plantName === "Bakeberry") {
|
||||
totalGain += Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30);
|
||||
}
|
||||
else if (count && plantName == "Chocoroot" || plantName == "White chocoroot") {
|
||||
else if (count && plantName === "Chocoroot" || plantName === "White chocoroot") {
|
||||
totalGain += Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3);
|
||||
}
|
||||
else if (count && plantName == "Queenbeet") {
|
||||
else if (count && plantName === "Queenbeet") {
|
||||
totalGain += Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60);
|
||||
}
|
||||
else if (count && plantName == "Duketater") {
|
||||
else if (count && plantName === "Duketater") {
|
||||
totalGain += Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120);
|
||||
}
|
||||
}
|
||||
@@ -1704,63 +1704,63 @@ CM.Disp.UpdateTooltipHarvestAll = function() {
|
||||
* It is called by CM.Disp.UpdateTooltip()
|
||||
*/
|
||||
CM.Disp.UpdateTooltipWarnings = function() {
|
||||
if (CM.Disp.tooltipType == "b" || CM.Disp.tooltipType == "u") {
|
||||
if (document.getElementById("CMDispTooltipWarningParent") == null) {
|
||||
if (CM.Disp.tooltipType === "b" || CM.Disp.tooltipType === "u") {
|
||||
if (document.getElementById("CMDispTooltipWarningParent") === null) {
|
||||
let warningTooltip = CM.Disp.TooltipCreateWarningSection();
|
||||
l('tooltipAnchor').appendChild(warningTooltip);
|
||||
CM.Disp.ToggleToolWarnPos();
|
||||
}
|
||||
|
||||
if (CM.Options.ToolWarnPos == 0) CM.Disp.TooltipWarn.style.right = '0px';
|
||||
if (CM.Options.ToolWarnPos === 0) CM.Disp.TooltipWarn.style.right = '0px';
|
||||
else CM.Disp.TooltipWarn.style.top = (l('tooltip').offsetHeight) + 'px';
|
||||
|
||||
CM.Disp.TooltipWarn.style.width = (l('tooltip').offsetWidth - 6) + 'px';
|
||||
|
||||
var amount = (Game.cookies + CM.Disp.GetWrinkConfigBank()) - CM.Disp.TooltipPrice;
|
||||
var limitLucky = CM.Cache.Lucky;
|
||||
if (CM.Options.ToolWarnBon == 1) {
|
||||
if (CM.Options.ToolWarnBon === 1) {
|
||||
var bonusNoFren = CM.Disp.TooltipBonusIncome;
|
||||
bonusNoFren /= CM.Sim.getCPSBuffMult();
|
||||
limitLucky += ((bonusNoFren * 60 * 15) / 0.15);
|
||||
}
|
||||
|
||||
if (CM.Options.ToolWarnLucky == 1) {
|
||||
if (amount < limitLucky && (CM.Disp.tooltipType != 'b' || Game.buyMode == 1)) {
|
||||
if (CM.Options.ToolWarnLucky === 1) {
|
||||
if (amount < limitLucky && (CM.Disp.tooltipType != 'b' || Game.buyMode === 1)) {
|
||||
l('CMDispTooltipWarnLucky').style.display = '';
|
||||
l('CMDispTooltipWarnLuckyText').textContent = Beautify(limitLucky - amount) + ' (' + CM.Disp.FormatTime((limitLucky - amount) / (CM.Disp.GetCPS() + CM.Disp.TooltipBonusIncome)) + ')';
|
||||
} else l('CMDispTooltipWarnLucky').style.display = 'none';
|
||||
}
|
||||
else l('CMDispTooltipWarnLucky').style.display = 'none';
|
||||
|
||||
if (CM.Options.ToolWarnLuckyFrenzy == 1) {
|
||||
if (CM.Options.ToolWarnLuckyFrenzy === 1) {
|
||||
let limitLuckyFrenzy = limitLucky * 7;
|
||||
if (amount < limitLuckyFrenzy && (CM.Disp.tooltipType != 'b' || Game.buyMode == 1)) {
|
||||
if (amount < limitLuckyFrenzy && (CM.Disp.tooltipType != 'b' || Game.buyMode === 1)) {
|
||||
l('CMDispTooltipWarnLuckyFrenzy').style.display = '';
|
||||
l('CMDispTooltipWarnLuckyFrenzyText').textContent = Beautify(limitLuckyFrenzy - amount) + ' (' + CM.Disp.FormatTime((limitLuckyFrenzy - amount) / (CM.Disp.GetCPS() + CM.Disp.TooltipBonusIncome)) + ')';
|
||||
} else l('CMDispTooltipWarnLuckyFrenzy').style.display = 'none';
|
||||
}
|
||||
else l('CMDispTooltipWarnLuckyFrenzy').style.display = 'none';
|
||||
|
||||
if (CM.Options.ToolWarnConjure == 1) {
|
||||
if (CM.Options.ToolWarnConjure === 1) {
|
||||
var limitConjure = limitLucky * 2;
|
||||
if ((amount < limitConjure) && (CM.Disp.tooltipType != 'b' || Game.buyMode == 1)) {
|
||||
if ((amount < limitConjure) && (CM.Disp.tooltipType != 'b' || Game.buyMode === 1)) {
|
||||
l('CMDispTooltipWarnConjure').style.display = '';
|
||||
l('CMDispTooltipWarnConjureText').textContent = Beautify(limitConjure - amount) + ' (' + CM.Disp.FormatTime((limitConjure - amount) / (CM.Disp.GetCPS() + CM.Disp.TooltipBonusIncome)) + ')';
|
||||
} else l('CMDispTooltipWarnConjure').style.display = 'none';
|
||||
}
|
||||
else l('CMDispTooltipWarnConjure').style.display = 'none';
|
||||
|
||||
if (CM.Options.ToolWarnConjureFrenzy == 1) {
|
||||
if (CM.Options.ToolWarnConjureFrenzy === 1) {
|
||||
var limitConjureFrenzy = limitLucky * 2 * 7;
|
||||
if ((amount < limitConjureFrenzy) && (CM.Disp.tooltipType != 'b' || Game.buyMode == 1)) {
|
||||
if ((amount < limitConjureFrenzy) && (CM.Disp.tooltipType != 'b' || Game.buyMode === 1)) {
|
||||
l('CMDispTooltipWarnConjureFrenzy').style.display = '';
|
||||
l('CMDispTooltipWarnConjureFrenzyText').textContent = Beautify(limitConjureFrenzy - amount) + ' (' + CM.Disp.FormatTime((limitConjureFrenzy - amount) / (CM.Disp.GetCPS() + CM.Disp.TooltipBonusIncome)) + ')';
|
||||
} else l('CMDispTooltipWarnConjureFrenzy').style.display = 'none';
|
||||
}
|
||||
else l('CMDispTooltipWarnConjureFrenzy').style.display = 'none';
|
||||
|
||||
if (CM.Options.ToolWarnEdifice == 1) {
|
||||
if (CM.Cache.Edifice && amount < CM.Cache.Edifice && (CM.Disp.tooltipType != 'b' || Game.buyMode == 1)) {
|
||||
if (CM.Options.ToolWarnEdifice === 1) {
|
||||
if (CM.Cache.Edifice && amount < CM.Cache.Edifice && (CM.Disp.tooltipType != 'b' || Game.buyMode === 1)) {
|
||||
l('CMDispTooltipWarnEdifice').style.display = '';
|
||||
l('CMDispTooltipWarnEdificeText').textContent = Beautify(CM.Cache.Edifice - amount) + ' (' + CM.Disp.FormatTime((CM.Cache.Edifice - amount) / (CM.Disp.GetCPS() + CM.Disp.TooltipBonusIncome)) + ')';
|
||||
} else l('CMDispTooltipWarnEdifice').style.display = 'none';
|
||||
@@ -1779,15 +1779,15 @@ CM.Disp.UpdateTooltipWarnings = function() {
|
||||
* It is called by Game.tooltip.update() because of CM.ReplaceNative()
|
||||
*/
|
||||
CM.Disp.UpdateTooltipLocation = function() {
|
||||
if (Game.tooltip.origin == 'store') {
|
||||
if (Game.tooltip.origin === 'store') {
|
||||
var warnOffset = 0;
|
||||
if (CM.Options.ToolWarnLucky == 1 && CM.Options.ToolWarnPos == 1 && typeof CM.Disp.TooltipWarn != "undefined") {
|
||||
if (CM.Options.ToolWarnLucky === 1 && CM.Options.ToolWarnPos === 1 && typeof CM.Disp.TooltipWarn != "undefined") {
|
||||
warnOffset = CM.Disp.TooltipWarn.clientHeight - 4;
|
||||
}
|
||||
Game.tooltip.tta.style.top = Math.min(parseInt(Game.tooltip.tta.style.top), (l('game').clientHeight + l('topBar').clientHeight) - Game.tooltip.tt.clientHeight - warnOffset - 46) + 'px';
|
||||
}
|
||||
// Kept for future possible use if the code changes again
|
||||
/*else if (!Game.onCrate && !Game.OnAscend && CM.Options.TimerBar == 1 && CM.Options.TimerBarPos == 0) {
|
||||
/*else if (!Game.onCrate && !Game.OnAscend && CM.Options.TimerBar === 1 && CM.Options.TimerBarPos === 0) {
|
||||
Game.tooltip.tta.style.top = (parseInt(Game.tooltip.tta.style.top) + parseInt(CM.Disp.TimerBar.style.height)) + 'px';
|
||||
}*/
|
||||
};
|
||||
@@ -1799,7 +1799,7 @@ CM.Disp.UpdateTooltipLocation = function() {
|
||||
*/
|
||||
CM.Disp.ToggleToolWarnPos = function() {
|
||||
if (typeof CM.Disp.TooltipWarn != "undefined") {
|
||||
if (CM.Options.ToolWarnPos == 0) {
|
||||
if (CM.Options.ToolWarnPos === 0) {
|
||||
CM.Disp.TooltipWarn.style.top = 'auto';
|
||||
CM.Disp.TooltipWarn.style.margin = '4px -4px';
|
||||
CM.Disp.TooltipWarn.style.padding = '3px 4px';
|
||||
@@ -1818,13 +1818,13 @@ CM.Disp.ToggleToolWarnPos = function() {
|
||||
* TODO: Change this code to be the same as other tooltips. (i.d., create tooltip with type "w")
|
||||
*/
|
||||
CM.Disp.CheckWrinklerTooltip = function() {
|
||||
if (CM.Options.TooltipWrink == 1 && CM.Disp.TooltipWrinklerArea == 1) { // Latter is set by CM.Main.AddWrinklerAreaDetect
|
||||
if (CM.Options.TooltipWrink === 1 && CM.Disp.TooltipWrinklerArea === 1) { // Latter is set by CM.Main.AddWrinklerAreaDetect
|
||||
var showingTooltip = false;
|
||||
for (let i of Object.keys(Game.wrinklers)) {
|
||||
var me = Game.wrinklers[i];
|
||||
if (me.phase > 0 && me.selected) {
|
||||
showingTooltip = true;
|
||||
if (CM.Disp.TooltipWrinklerBeingShown[i] == 0 || CM.Disp.TooltipWrinklerBeingShown[i] == undefined) {
|
||||
if (CM.Disp.TooltipWrinklerBeingShown[i] === 0 || CM.Disp.TooltipWrinklerBeingShown[i] === undefined) {
|
||||
var placeholder = document.createElement('div');
|
||||
var wrinkler = document.createElement('div');
|
||||
wrinkler.style.minWidth = '120px';
|
||||
@@ -1856,18 +1856,18 @@ CM.Disp.CheckWrinklerTooltip = function() {
|
||||
* TODO: Change this code to be the same as other tooltips. Fit this into CM.Disp.UpdateTooltip()
|
||||
*/
|
||||
CM.Disp.UpdateWrinklerTooltip = function() {
|
||||
if (CM.Options.TooltipWrink == 1 && l('CMTooltipWrinkler') != null) {
|
||||
if (CM.Options.TooltipWrink === 1 && l('CMTooltipWrinkler') != null) {
|
||||
var sucked = Game.wrinklers[CM.Disp.TooltipWrinkler].sucked;
|
||||
var toSuck = 1.1;
|
||||
if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05;
|
||||
if (Game.wrinklers[CM.Disp.TooltipWrinkler].type == 1) toSuck *= 3; // Shiny wrinklers
|
||||
if (Game.wrinklers[CM.Disp.TooltipWrinkler].type === 1) toSuck *= 3; // Shiny wrinklers
|
||||
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;
|
||||
if (godLvl === 1) sucked *= 1.15;
|
||||
else if (godLvl === 2) sucked *= 1.1;
|
||||
else if (godLvl === 3) sucked *= 1.05;
|
||||
}
|
||||
l('CMTooltipWrinkler').textContent = Beautify(sucked);
|
||||
}
|
||||
@@ -1882,7 +1882,7 @@ CM.Disp.UpdateWrinklerTooltip = function() {
|
||||
* @param {number} aura The number of the aura currently selected by the mouse/user
|
||||
*/
|
||||
CM.Disp.AddAuraInfo = function(aura) {
|
||||
if (CM.Options.DragonAuraInfo == 1) {
|
||||
if (CM.Options.DragonAuraInfo === 1) {
|
||||
var [bonusCPS, priceOfChange] = CM.Sim.CalculateChangeAura(aura);
|
||||
var timeToRecover = CM.Disp.FormatTime(priceOfChange / (bonusCPS + Game.cookiesPs));
|
||||
var bonusCPSPercentage = CM.Disp.Beautify(bonusCPS / Game.cookiesPs);
|
||||
@@ -1912,7 +1912,7 @@ CM.Disp.AddDragonLevelUpTooltip = function() {
|
||||
// Check if it is the dragon popup that is on screen
|
||||
if ((l('specialPopup').className.match(/onScreen/) && l('specialPopup').children[0].style.background.match(/dragon/)) != null) {
|
||||
for (let i = 0; i < l('specialPopup').childNodes.length; i++) {
|
||||
if (l('specialPopup').childNodes[i].className == "optionBox") {
|
||||
if (l('specialPopup').childNodes[i].className === "optionBox") {
|
||||
l('specialPopup').children[i].onmouseover = function() {CM.Cache.CacheDragonCost(); Game.tooltip.dynamic = 1; Game.tooltip.draw(l('specialPopup'), `<div style="min-width:200px;text-align:center;">${CM.Cache.CostDragonUpgrade}</div>`, 'this'); Game.tooltip.wobble();};
|
||||
l('specialPopup').children[i].onmouseout = function() {Game.tooltip.shouldHide = 1;};
|
||||
}
|
||||
@@ -1935,10 +1935,10 @@ CM.Disp.AddMenu = function() {
|
||||
return div;
|
||||
};
|
||||
|
||||
if (Game.onMenu == 'prefs') {
|
||||
if (Game.onMenu === 'prefs') {
|
||||
CM.Disp.AddMenuPref(title);
|
||||
}
|
||||
else if (Game.onMenu == 'stats') {
|
||||
else if (Game.onMenu === 'stats') {
|
||||
if (CM.Options.Stats) {
|
||||
CM.Disp.AddMenuStats(title);
|
||||
}
|
||||
@@ -1950,7 +1950,7 @@ CM.Disp.AddMenu = function() {
|
||||
* It is called by CM.Loop()
|
||||
*/
|
||||
CM.Disp.RefreshMenu = function() {
|
||||
if (CM.Options.UpStats && Game.onMenu == 'stats' && (Game.drawT - 1) % (Game.fps * 5) != 0 && (Game.drawT - 1) % Game.fps == 0) Game.UpdateMenu();
|
||||
if (CM.Options.UpStats && Game.onMenu === 'stats' && (Game.drawT - 1) % (Game.fps * 5) != 0 && (Game.drawT - 1) % Game.fps === 0) Game.UpdateMenu();
|
||||
};
|
||||
|
||||
/********
|
||||
@@ -1970,7 +1970,7 @@ CM.Disp.AddMenuPref = function(title) {
|
||||
frag.appendChild(groupObject);
|
||||
if (CM.Options.Header[group]) { // 0 is show, 1 is collapsed
|
||||
// Make sub-sections of Notification section
|
||||
if (group == "Notification") {
|
||||
if (group === "Notification") {
|
||||
for (let subGroup of Object.keys(CM.ConfigGroupsNotification)) {
|
||||
let subGroupObject = CM.Disp.CreatePrefHeader(subGroup, CM.ConfigGroupsNotification[subGroup]); // (group, display-name of group)
|
||||
subGroupObject.style.fontSize = "15px";
|
||||
@@ -1978,13 +1978,13 @@ CM.Disp.AddMenuPref = function(title) {
|
||||
frag.appendChild(subGroupObject);
|
||||
if (CM.Options.Header[subGroup]) {
|
||||
for (var option in CM.ConfigData) {
|
||||
if (CM.ConfigData[option].group == subGroup) frag.appendChild(CM.Disp.CreatePrefOption(option));
|
||||
if (CM.ConfigData[option].group === subGroup) frag.appendChild(CM.Disp.CreatePrefOption(option));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let option of Object.keys(CM.ConfigData)) {
|
||||
if (CM.ConfigData[option].group == group) frag.appendChild(CM.Disp.CreatePrefOption(option));
|
||||
if (CM.ConfigData[option].group === group) frag.appendChild(CM.Disp.CreatePrefOption(option));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2040,11 +2040,11 @@ CM.Disp.CreatePrefHeader = function(config, text) {
|
||||
* @returns {object} div The option object
|
||||
*/
|
||||
CM.Disp.CreatePrefOption = function(config) {
|
||||
if (CM.ConfigData[config].type == "bool") {
|
||||
if (CM.ConfigData[config].type === "bool") {
|
||||
let div = document.createElement('div');
|
||||
div.className = 'listing';
|
||||
let a = document.createElement('a');
|
||||
if (CM.ConfigData[config].toggle && CM.Options[config] == 0) {
|
||||
if (CM.ConfigData[config].toggle && CM.Options[config] === 0) {
|
||||
a.className = 'option off';
|
||||
}
|
||||
else {
|
||||
@@ -2059,7 +2059,7 @@ CM.Disp.CreatePrefOption = function(config) {
|
||||
div.appendChild(label);
|
||||
return div;
|
||||
}
|
||||
else if (CM.ConfigData[config].type == "vol") {
|
||||
else if (CM.ConfigData[config].type === "vol") {
|
||||
let div = document.createElement('div');
|
||||
div.className = 'listing';
|
||||
var volume = document.createElement('div');
|
||||
@@ -2088,7 +2088,7 @@ CM.Disp.CreatePrefOption = function(config) {
|
||||
div.appendChild(volume);
|
||||
return div;
|
||||
}
|
||||
else if (CM.ConfigData[config].type == "url") {
|
||||
else if (CM.ConfigData[config].type === "url") {
|
||||
let div = document.createElement('div');
|
||||
div.className = 'listing';
|
||||
let span = document.createElement('span');
|
||||
@@ -2119,7 +2119,7 @@ CM.Disp.CreatePrefOption = function(config) {
|
||||
div.appendChild(label);
|
||||
return div;
|
||||
}
|
||||
else if (CM.ConfigData[config].type == "color") {
|
||||
else if (CM.ConfigData[config].type === "color") {
|
||||
let div = document.createElement('div');
|
||||
for (let i = 0; i < CM.Disp.colors.length; i++) {
|
||||
let innerDiv = document.createElement('div');
|
||||
@@ -2138,7 +2138,7 @@ CM.Disp.CreatePrefOption = function(config) {
|
||||
}
|
||||
return div;
|
||||
}
|
||||
else if (CM.ConfigData[config].type == "numscale") {
|
||||
else if (CM.ConfigData[config].type === "numscale") {
|
||||
let div = document.createElement('div');
|
||||
div.className = 'listing';
|
||||
let span = document.createElement('span');
|
||||
@@ -2171,7 +2171,7 @@ CM.Disp.CreatePrefOption = function(config) {
|
||||
* It is called by a change in CM.Options.DetailedTime
|
||||
*/
|
||||
CM.Disp.ToggleDetailedTime = function() {
|
||||
if (CM.Options.DetailedTime == 1) Game.sayTime = CM.Disp.sayTime;
|
||||
if (CM.Options.DetailedTime === 1) Game.sayTime = CM.Disp.sayTime;
|
||||
else Game.sayTime = CM.Backup.sayTime;
|
||||
};
|
||||
|
||||
@@ -2310,7 +2310,7 @@ CM.Disp.AddMenuStats = function(title) {
|
||||
var choEgg = (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg'));
|
||||
var centEgg = Game.Has('Century egg');
|
||||
|
||||
if (Game.season == 'christmas' || specDisp || choEgg || centEgg) {
|
||||
if (Game.season === 'christmas' || specDisp || choEgg || centEgg) {
|
||||
stats.appendChild(CM.Disp.CreateStatsHeader('Season Specials', 'Sea'));
|
||||
if (CM.Options.Header.Sea) {
|
||||
if (missingHalloweenCookies.length != 0) stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Halloween Cookies Left to Buy', CM.Disp.CreateStatsMissDisp(missingHalloweenCookies)));
|
||||
@@ -2320,7 +2320,7 @@ CM.Disp.AddMenuStats = function(title) {
|
||||
if (missingRareEggs.length != 0) stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rare Easter Eggs Left to Unlock', CM.Disp.CreateStatsMissDisp(missingRareEggs)));
|
||||
if (missingPlantDrops.length != 0) stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Rare Plant Drops Left to Unlock', CM.Disp.CreateStatsMissDisp(missingPlantDrops)));
|
||||
|
||||
if (Game.season == 'christmas') stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Reindeer Reward', document.createTextNode(Beautify(CM.Cache.SeaSpec))));
|
||||
if (Game.season === 'christmas') stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Reindeer Reward', document.createTextNode(Beautify(CM.Cache.SeaSpec))));
|
||||
if (choEgg) {
|
||||
stats.appendChild(CM.Disp.CreateStatsListing("withTooltip", 'Chocolate Egg Cookies', document.createTextNode(Beautify(CM.Cache.lastChoEgg)), 'ChoEggTooltipPlaceholder'));
|
||||
}
|
||||
@@ -2333,10 +2333,10 @@ CM.Disp.AddMenuStats = function(title) {
|
||||
stats.appendChild(CM.Disp.CreateStatsHeader('Miscellaneous', 'Misc'));
|
||||
if (CM.Options.Header.Misc) {
|
||||
stats.appendChild(CM.Disp.CreateStatsListing("basic",
|
||||
'Average Cookies Per Second (Past ' + (CM.Disp.cookieTimes[CM.Options.AvgCPSHist] < 60 ? (CM.Disp.cookieTimes[CM.Options.AvgCPSHist] + ' seconds') : ((CM.Disp.cookieTimes[CM.Options.AvgCPSHist] / 60) + (CM.Options.AvgCPSHist == 3 ? ' minute' : ' minutes'))) + ')',
|
||||
'Average Cookies Per Second (Past ' + (CM.Disp.cookieTimes[CM.Options.AvgCPSHist] < 60 ? (CM.Disp.cookieTimes[CM.Options.AvgCPSHist] + ' seconds') : ((CM.Disp.cookieTimes[CM.Options.AvgCPSHist] / 60) + (CM.Options.AvgCPSHist === 3 ? ' minute' : ' minutes'))) + ')',
|
||||
document.createTextNode(Beautify(CM.Cache.AvgCPS, 3))
|
||||
));
|
||||
stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Average Cookie Clicks Per Second (Past ' + CM.Disp.clickTimes[CM.Options.AvgClicksHist] + (CM.Options.AvgClicksHist == 0 ? ' second' : ' seconds') + ')', document.createTextNode(Beautify(CM.Cache.AverageClicks, 1))));
|
||||
stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Average Cookie Clicks Per Second (Past ' + CM.Disp.clickTimes[CM.Options.AvgClicksHist] + (CM.Options.AvgClicksHist === 0 ? ' second' : ' seconds') + ')', document.createTextNode(Beautify(CM.Cache.AverageClicks, 1))));
|
||||
if (Game.Has('Fortune cookies')) {
|
||||
var fortunes = [];
|
||||
for (let i of Object.keys(CM.Data.Fortunes)) {
|
||||
@@ -2410,7 +2410,7 @@ CM.Disp.CreateStatsListing = function(type, name, text, placeholder) {
|
||||
var listingName = document.createElement('b');
|
||||
listingName.textContent = name;
|
||||
div.appendChild(listingName);
|
||||
if (type == "withTooltip") {
|
||||
if (type === "withTooltip") {
|
||||
div.className = 'listing';
|
||||
|
||||
var tooltip = document.createElement('span');
|
||||
@@ -2805,7 +2805,7 @@ CM.Disp.AddMissingUpgrades = function() {
|
||||
*/
|
||||
CM.Disp.crateMissing = function(me) {
|
||||
var classes = 'crate upgrade missing';
|
||||
if (me.pool == 'prestige') classes+=' heavenly';
|
||||
if (me.pool === 'prestige') classes+=' heavenly';
|
||||
|
||||
var noFrame = 0;
|
||||
if (!Game.prefs.crates) noFrame = 1;
|
||||
|
||||
32
src/Main.js
32
src/Main.js
@@ -129,7 +129,7 @@ CM.ReplaceNativeGrimoireDraw = function() {
|
||||
CM.Backup.GrimoireDraw = minigame.draw;
|
||||
Game.Objects['Wizard tower'].minigame.draw = function() {
|
||||
CM.Backup.GrimoireDraw();
|
||||
if (CM.Options.GrimoireBar == 1 && minigame.magic < minigame.magicM) {
|
||||
if (CM.Options.GrimoireBar === 1 && minigame.magic < minigame.magicM) {
|
||||
minigame.magicBarTextL.innerHTML += ' (' + CM.Disp.FormatTime(CM.Disp.CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, minigame.magicM)) + ')';
|
||||
}
|
||||
};
|
||||
@@ -142,7 +142,7 @@ CM.Loop = function() {
|
||||
CM.Disp.lastAscendState = Game.OnAscend;
|
||||
CM.Disp.UpdateAscendState();
|
||||
}
|
||||
if (!Game.OnAscend && Game.AscendTimer == 0) {
|
||||
if (!Game.OnAscend && Game.AscendTimer === 0) {
|
||||
// CM.Sim.DoSims is set whenever CPS has changed
|
||||
if (CM.Sim.DoSims) {
|
||||
CM.Cache.RemakeIncome();
|
||||
@@ -334,7 +334,7 @@ CM.Main.FindShimmer = function() {
|
||||
CM.Cache.goldenShimmersByID = {};
|
||||
for (let i of Object.keys(Game.shimmers)) {
|
||||
CM.Cache.goldenShimmersByID[Game.shimmers[i].id] = Game.shimmers[i];
|
||||
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type == 'golden') {
|
||||
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type === 'golden') {
|
||||
CM.Cache.spawnedGoldenShimmer = Game.shimmers[i];
|
||||
CM.Main.currSpawnedGoldenCookieState += 1;
|
||||
}
|
||||
@@ -348,7 +348,7 @@ CM.Main.FindShimmer = function() {
|
||||
CM.Main.CheckGoldenCookie = function() {
|
||||
CM.Main.FindShimmer();
|
||||
for (let i of Object.keys(CM.Disp.GCTimers)) {
|
||||
if (typeof CM.Cache.goldenShimmersByID[i] == "undefined") {
|
||||
if (typeof CM.Cache.goldenShimmersByID[i] === "undefined") {
|
||||
CM.Disp.GCTimers[i].parentNode.removeChild(CM.Disp.GCTimers[i]);
|
||||
delete CM.Disp.GCTimers[i];
|
||||
}
|
||||
@@ -363,16 +363,16 @@ CM.Main.CheckGoldenCookie = function() {
|
||||
}
|
||||
|
||||
for (let i of Object.keys(Game.shimmers)) {
|
||||
if (typeof CM.Disp.GCTimers[Game.shimmers[i].id] == "undefined") {
|
||||
if (typeof CM.Disp.GCTimers[Game.shimmers[i].id] === "undefined") {
|
||||
CM.Disp.CreateGCTimer(Game.shimmers[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
CM.Disp.UpdateFavicon();
|
||||
CM.Main.lastSpawnedGoldenCookieState = CM.Main.currSpawnedGoldenCookieState;
|
||||
if (CM.Main.currSpawnedGoldenCookieState == 0) CM.Cache.spawnedGoldenShimmer = 0;
|
||||
if (CM.Main.currSpawnedGoldenCookieState === 0) CM.Cache.spawnedGoldenShimmer = 0;
|
||||
}
|
||||
else if (CM.Options.GCTimer == 1 && CM.Main.lastGoldenCookieState) {
|
||||
else if (CM.Options.GCTimer === 1 && CM.Main.lastGoldenCookieState) {
|
||||
for (let i of Object.keys(CM.Disp.GCTimers)) {
|
||||
CM.Disp.GCTimers[i].style.opacity = CM.Cache.goldenShimmersByID[i].l.style.opacity;
|
||||
CM.Disp.GCTimers[i].style.transform = CM.Cache.goldenShimmersByID[i].l.style.transform;
|
||||
@@ -389,7 +389,7 @@ CM.Main.CheckSeasonPopup = function() {
|
||||
if (CM.Main.lastSeasonPopupState != Game.shimmerTypes.reindeer.spawned) {
|
||||
CM.Main.lastSeasonPopupState = Game.shimmerTypes.reindeer.spawned;
|
||||
for (let i of Object.keys(Game.shimmers)) {
|
||||
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type == 'reindeer') {
|
||||
if (Game.shimmers[i].spawnLead && Game.shimmers[i].type === 'reindeer') {
|
||||
CM.Cache.seasonPopShimmer = Game.shimmers[i];
|
||||
break;
|
||||
}
|
||||
@@ -405,8 +405,8 @@ CM.Main.CheckSeasonPopup = function() {
|
||||
* It is called by CM.Loop
|
||||
*/
|
||||
CM.Main.CheckTickerFortune = function() {
|
||||
if (CM.Main.lastTickerFortuneState != (Game.TickerEffect && Game.TickerEffect.type == 'fortune')) {
|
||||
CM.Main.lastTickerFortuneState = (Game.TickerEffect && Game.TickerEffect.type == 'fortune');
|
||||
if (CM.Main.lastTickerFortuneState != (Game.TickerEffect && Game.TickerEffect.type === 'fortune')) {
|
||||
CM.Main.lastTickerFortuneState = (Game.TickerEffect && Game.TickerEffect.type === 'fortune');
|
||||
if (CM.Main.lastTickerFortuneState) {
|
||||
CM.Disp.Flash(3, 'FortuneFlash');
|
||||
CM.Disp.PlaySound(CM.Options.FortuneSoundURL, 'FortuneSound', 'FortuneVolume');
|
||||
@@ -434,7 +434,7 @@ CM.Main.CheckGardenTick = function() {
|
||||
* It is called by CM.Loop
|
||||
*/
|
||||
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;
|
||||
if (minigame.magic < minigame.magicM) CM.Main.lastMagicBarFull = false;
|
||||
else if (!CM.Main.lastMagicBarFull) {
|
||||
@@ -454,21 +454,21 @@ CM.Main.CheckWrinklerCount = function() {
|
||||
if (Game.elderWrath > 0) {
|
||||
var CurrentWrinklers = 0;
|
||||
for (let i in Game.wrinklers) {
|
||||
if (Game.wrinklers[i].phase == 2) CurrentWrinklers++;
|
||||
if (Game.wrinklers[i].phase === 2) CurrentWrinklers++;
|
||||
}
|
||||
if (CurrentWrinklers > CM.Main.lastWrinklerCount) {
|
||||
CM.Main.lastWrinklerCount = CurrentWrinklers;
|
||||
if (CurrentWrinklers == Game.getWrinklersMax() && CM.Options.WrinklerMaxFlash) {
|
||||
if (CurrentWrinklers === Game.getWrinklersMax() && CM.Options.WrinklerMaxFlash) {
|
||||
CM.Disp.Flash(3, 'WrinklerMaxFlash');
|
||||
} else {
|
||||
CM.Disp.Flash(3, 'WrinklerFlash');
|
||||
}
|
||||
if (CurrentWrinklers == Game.getWrinklersMax() && CM.Options.WrinklerMaxSound) {
|
||||
if (CurrentWrinklers === Game.getWrinklersMax() && CM.Options.WrinklerMaxSound) {
|
||||
CM.Disp.PlaySound(CM.Options.WrinklerMaxSoundURL, 'WrinklerMaxSound', 'WrinklerMaxVolume');
|
||||
} else {
|
||||
CM.Disp.PlaySound(CM.Options.WrinklerSoundURL, 'WrinklerSound', 'WrinklerVolume');
|
||||
}
|
||||
if (CurrentWrinklers == Game.getWrinklersMax() && CM.Options.WrinklerMaxNotification) {
|
||||
if (CurrentWrinklers === Game.getWrinklersMax() && CM.Options.WrinklerMaxNotification) {
|
||||
CM.Disp.Notification('WrinklerMaxNotification', "Maximum Wrinklers Reached", "You have reached your maximum ammount of wrinklers");
|
||||
} else {
|
||||
CM.Disp.Notification('WrinklerNotification', "A Wrinkler appeared", "A new wrinkler has appeared");
|
||||
@@ -505,7 +505,7 @@ CM.Main.AddWrinklerAreaDetect = function() {
|
||||
* before execution of their actual function
|
||||
*/
|
||||
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);
|
||||
Game.mouseY -= timerBarHeight;
|
||||
target();
|
||||
|
||||
94
src/Sim.js
94
src/Sim.js
@@ -47,7 +47,7 @@ CM.Sim.BuildingSell = function(build, basePrice, start, free, amount, noSim) {
|
||||
// If noSim is set, use Game methods to compute price instead of Sim ones.
|
||||
noSim = typeof noSim === "undefined" ? 0 : noSim;
|
||||
var moni = 0;
|
||||
if (amount == -1) amount = start;
|
||||
if (amount === -1) amount = start;
|
||||
if (!amount) amount = Game.buyBulk;
|
||||
for (let i = 0; i < amount; i++) {
|
||||
let price = basePrice * Math.pow(Game.priceIncrease, Math.max(0, start - free));
|
||||
@@ -65,14 +65,14 @@ CM.Sim.BuildingSell = function(build, basePrice, start, free, amount, noSim) {
|
||||
|
||||
CM.Sim.Has = function(what) {
|
||||
let it = CM.Sim.Upgrades[what];
|
||||
if (Game.ascensionMode == 1 && (it.pool == 'prestige' || it.tier == 'fortune')) return 0;
|
||||
if (Game.ascensionMode === 1 && (it.pool === 'prestige' || it.tier === 'fortune')) return 0;
|
||||
return (it ? it.bought : 0);
|
||||
};
|
||||
|
||||
|
||||
CM.Sim.Win = function(what) {
|
||||
if (CM.Sim.Achievements[what]) {
|
||||
if (CM.Sim.Achievements[what].won == 0) {
|
||||
if (CM.Sim.Achievements[what].won === 0) {
|
||||
CM.Sim.Achievements[what].won = 1;
|
||||
if (Game.Achievements[what].pool != 'shadow') CM.Sim.AchievementsOwned++;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ eval('CM.Sim.GetHeavenlyMultiplier = ' + Game.GetHeavenlyMultiplier.toString().s
|
||||
|
||||
// Check for Pantheon Auras
|
||||
CM.Sim.hasAura = function(what) {
|
||||
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)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
@@ -95,9 +95,9 @@ CM.Sim.hasAura = function(what) {
|
||||
// Used as CM.Sim.auraMult('Aura') * mult, i.e. CM.Sim.auraMult('Dragon God) * 0.05
|
||||
CM.Sim.auraMult = function(what) {
|
||||
var 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;
|
||||
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')
|
||||
n += 0.1;
|
||||
return n;
|
||||
};
|
||||
@@ -228,7 +228,7 @@ CM.Sim.CopyData = function() {
|
||||
for (let i of Object.keys(Game.Objects)) {
|
||||
let me = Game.Objects[i];
|
||||
let you = CM.Sim.Objects[i];
|
||||
if (you == undefined) { // New building!
|
||||
if (you === undefined) { // New building!
|
||||
you = CM.Sim.Objects[i] = CM.Sim.InitialBuildingData(i);
|
||||
CM.Disp.CreateBotBarBuildingColumn(i); // Add new building to the bottom bar
|
||||
}
|
||||
@@ -244,7 +244,7 @@ CM.Sim.CopyData = function() {
|
||||
for (let i of Object.keys(Game.Upgrades)) {
|
||||
let me = Game.Upgrades[i];
|
||||
let you = CM.Sim.Upgrades[i];
|
||||
if (you == undefined) {
|
||||
if (you === undefined) {
|
||||
you = CM.Sim.Upgrades[i] = CM.Sim.InitUpgrade(i);
|
||||
}
|
||||
you.bought = me.bought;
|
||||
@@ -254,7 +254,7 @@ CM.Sim.CopyData = function() {
|
||||
for (let i of Object.keys(Game.Achievements)) {
|
||||
let me = Game.Achievements[i];
|
||||
let you = CM.Sim.Achievements[i];
|
||||
if (you == undefined) {
|
||||
if (you === undefined) {
|
||||
you = CM.Sim.Achievements[i] = CM.Sim.InitAchievement(i);
|
||||
}
|
||||
you.won = me.won;
|
||||
@@ -295,7 +295,7 @@ CM.Sim.CalculateGains = function() {
|
||||
for (let i of Object.keys(Game.cookieUpgrades)) {
|
||||
let me = Game.cookieUpgrades[i];
|
||||
if (CM.Sim.Has(me.name)) {
|
||||
mult *= (1 + (typeof(me.power) == 'function' ? me.power(me) : me.power) * 0.01);
|
||||
mult *= (1 + (typeof(me.power) === 'function' ? me.power(me) : me.power) * 0.01);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,29 +320,29 @@ CM.Sim.CalculateGains = function() {
|
||||
var buildMult = 1;
|
||||
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
||||
let godLvl = CM.Sim.hasGod('asceticism');
|
||||
if (godLvl == 1) mult *= 1.15;
|
||||
else if (godLvl == 2) mult *= 1.1;
|
||||
else if (godLvl == 3) mult *= 1.05;
|
||||
if (godLvl === 1) mult *= 1.15;
|
||||
else if (godLvl === 2) mult *= 1.1;
|
||||
else if (godLvl === 3) mult *= 1.05;
|
||||
|
||||
godLvl = CM.Sim.hasGod('ages');
|
||||
if (godLvl == 1) mult *= 1 + 0.15 * Math.sin((CM.Sim.DateAges / 1000 / (60 * 60 * 3)) * Math.PI * 2);
|
||||
else if (godLvl == 2) mult *= 1 + 0.15 * Math.sin((CM.Sim.DateAges / 1000 / (60 * 60 * 12)) * Math.PI*2);
|
||||
else if (godLvl == 3) mult *= 1 + 0.15 * Math.sin((CM.Sim.DateAges / 1000 / (60 * 60 * 24)) * Math.PI*2);
|
||||
if (godLvl === 1) mult *= 1 + 0.15 * Math.sin((CM.Sim.DateAges / 1000 / (60 * 60 * 3)) * Math.PI * 2);
|
||||
else if (godLvl === 2) mult *= 1 + 0.15 * Math.sin((CM.Sim.DateAges / 1000 / (60 * 60 * 12)) * Math.PI*2);
|
||||
else if (godLvl === 3) mult *= 1 + 0.15 * Math.sin((CM.Sim.DateAges / 1000 / (60 * 60 * 24)) * Math.PI*2);
|
||||
|
||||
godLvl = CM.Sim.hasGod('decadence');
|
||||
if (godLvl == 1) buildMult *= 0.93;
|
||||
else if (godLvl == 2) buildMult *= 0.95;
|
||||
else if (godLvl == 3) buildMult *= 0.98;
|
||||
if (godLvl === 1) buildMult *= 0.93;
|
||||
else if (godLvl === 2) buildMult *= 0.95;
|
||||
else if (godLvl === 3) buildMult *= 0.98;
|
||||
|
||||
godLvl = CM.Sim.hasGod('industry');
|
||||
if (godLvl == 1) buildMult *= 1.1;
|
||||
else if (godLvl == 2) buildMult *= 1.06;
|
||||
else if (godLvl == 3) buildMult *= 1.03;
|
||||
if (godLvl === 1) buildMult *= 1.1;
|
||||
else if (godLvl === 2) buildMult *= 1.06;
|
||||
else if (godLvl === 3) buildMult *= 1.03;
|
||||
|
||||
godLvl = CM.Sim.hasGod('labor');
|
||||
if (godLvl == 1) buildMult *= 0.97;
|
||||
else if (godLvl == 2) buildMult *= 0.98;
|
||||
else if (godLvl == 3) buildMult *= 0.99;
|
||||
if (godLvl === 1) buildMult *= 0.97;
|
||||
else if (godLvl === 2) buildMult *= 0.98;
|
||||
else if (godLvl === 3) buildMult *= 0.99;
|
||||
}
|
||||
|
||||
if (CM.Sim.Has('Santa\'s legacy')) mult *= 1 + (Game.santaLevel + 1) * 0.03;
|
||||
@@ -354,9 +354,9 @@ CM.Sim.CalculateGains = function() {
|
||||
milkMult *= 1 + CM.Sim.auraMult('Breath of Milk') * 0.05;
|
||||
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
||||
let godLvl = CM.Sim.hasGod('mother');
|
||||
if (godLvl == 1) milkMult *= 1.1;
|
||||
else if (godLvl == 2) milkMult *= 1.05;
|
||||
else if (godLvl == 3) milkMult *= 1.03;
|
||||
if (godLvl === 1) milkMult *= 1.1;
|
||||
else if (godLvl === 2) milkMult *= 1.05;
|
||||
else if (godLvl === 3) milkMult *= 1.03;
|
||||
}
|
||||
// TODO Store minigame buffs?
|
||||
milkMult *= CM.Sim.eff('milk');
|
||||
@@ -381,9 +381,9 @@ CM.Sim.CalculateGains = function() {
|
||||
|
||||
for (let i of Object.keys(CM.Sim.Objects)) {
|
||||
let me = CM.Sim.Objects[i];
|
||||
var storedCps = (typeof(me.cps) == 'function' ? me.cps(me) : me.cps);
|
||||
var storedCps = (typeof(me.cps) === 'function' ? me.cps(me) : me.cps);
|
||||
if (Game.ascensionMode != 1) storedCps *= (1 + me.level * 0.01) * buildMult;
|
||||
if (me.name == "Grandma" && CM.Sim.Has('Milkhelp® lactose intolerance relief tablets')) storedCps *= 1 + 0.05 * milkProgress * milkMult;
|
||||
if (me.name === "Grandma" && CM.Sim.Has('Milkhelp® lactose intolerance relief tablets')) storedCps *= 1 + 0.05 * milkProgress * milkMult;
|
||||
CM.Sim.cookiesPs += me.amount * storedCps;
|
||||
}
|
||||
|
||||
@@ -432,8 +432,8 @@ CM.Sim.CalculateGains = function() {
|
||||
}
|
||||
|
||||
var name = Game.bakeryName.toLowerCase();
|
||||
if (name == 'orteil') mult *= 0.99;
|
||||
else if (name == 'ortiel') mult *= 0.98;
|
||||
if (name === 'orteil') mult *= 0.99;
|
||||
else if (name === 'ortiel') mult *= 0.98;
|
||||
|
||||
// TODO: Move CalcWink option and calculation here from CM.Disp
|
||||
|
||||
@@ -490,8 +490,8 @@ CM.Sim.CheckOtherAchiev = function() {
|
||||
}
|
||||
}
|
||||
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 (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');
|
||||
@@ -552,7 +552,7 @@ CM.Sim.BuyBuildings = function(amount, target) {
|
||||
let me = CM.Sim.Objects[i];
|
||||
me.amount += amount;
|
||||
|
||||
if (i == 'Cursor') {
|
||||
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');
|
||||
@@ -593,24 +593,24 @@ CM.Sim.BuyBuildings = function(amount, target) {
|
||||
CM.Sim.BuyUpgrades = function() {
|
||||
CM.Cache.Upgrades = [];
|
||||
for (let i of Object.keys(Game.Upgrades)) {
|
||||
if (Game.Upgrades[i].pool == 'toggle' || (Game.Upgrades[i].bought == 0 && Game.Upgrades[i].unlocked && Game.Upgrades[i].pool != 'prestige')) {
|
||||
if (Game.Upgrades[i].pool === 'toggle' || (Game.Upgrades[i].bought === 0 && Game.Upgrades[i].unlocked && Game.Upgrades[i].pool != 'prestige')) {
|
||||
CM.Sim.CopyData();
|
||||
let me = CM.Sim.Upgrades[i];
|
||||
me.bought = 1;
|
||||
if (Game.CountsAsUpgradeOwned(Game.Upgrades[i].pool)) CM.Sim.UpgradesOwned++;
|
||||
|
||||
if (i == 'Elder Pledge') {
|
||||
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') {
|
||||
else if (i === 'Elder Covenant') {
|
||||
CM.Sim.Win('Elder calm');
|
||||
}
|
||||
else if (i == 'Prism heart biscuits') {
|
||||
else if (i === 'Prism heart biscuits') {
|
||||
CM.Sim.Win('Lovely cookies');
|
||||
}
|
||||
else if (i == 'Heavenly key') {
|
||||
else if (i === 'Heavenly key') {
|
||||
CM.Sim.Win('Wholesome');
|
||||
}
|
||||
|
||||
@@ -693,7 +693,7 @@ CM.Sim.ResetBonus = function(possiblePresMax) {
|
||||
|
||||
CM.Sim.CopyData();
|
||||
|
||||
if (CM.Sim.Upgrades['Heavenly key'].bought == 0) {
|
||||
if (CM.Sim.Upgrades['Heavenly key'].bought === 0) {
|
||||
CM.Sim.Upgrades['Heavenly chip secret'].bought = 1;
|
||||
CM.Sim.Upgrades['Heavenly cookie stand'].bought = 1;
|
||||
CM.Sim.Upgrades['Heavenly bakery'].bought = 1;
|
||||
@@ -772,9 +772,9 @@ CM.Sim.modifyBuildingPrice = function(building,price) {
|
||||
price *= CM.Sim.eff('buildingCost');
|
||||
if (CM.Sim.Objects.Temple.minigameLoaded) {
|
||||
let godLvl = CM.Sim.hasGod('creation');
|
||||
if (godLvl == 1) price *= 0.93;
|
||||
else if (godLvl == 2) price *= 0.95;
|
||||
else if (godLvl == 3) price *= 0.98;
|
||||
if (godLvl === 1) price *= 0.93;
|
||||
else if (godLvl === 2) price *= 0.95;
|
||||
else if (godLvl === 3) price *= 0.98;
|
||||
}
|
||||
return price;
|
||||
};
|
||||
@@ -883,9 +883,9 @@ CM.Sim.mouseCps = function() {
|
||||
if (CM.Sim.hasGod)
|
||||
{
|
||||
var godLvl = CM.Sim.hasGod('labor');
|
||||
if (godLvl == 1) mult *= 1.15;
|
||||
else if (godLvl == 2) mult *= 1.1;
|
||||
else if (godLvl == 3) mult *= 1.05;
|
||||
if (godLvl === 1) mult *= 1.15;
|
||||
else if (godLvl === 2) mult *= 1.1;
|
||||
else if (godLvl === 3) mult *= 1.05;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user