Semicolons and easy fixes for all documents
This commit is contained in:
535
CookieMonster.js
535
CookieMonster.js
File diff suppressed because it is too large
Load Diff
@@ -16,9 +16,9 @@ CM.Config.SaveConfig = function() {
|
|||||||
CookieMonsterSave = saveString.match(/CookieMonster.*(;|$)/);
|
CookieMonsterSave = saveString.match(/CookieMonster.*(;|$)/);
|
||||||
if (CookieMonsterSave != null) {
|
if (CookieMonsterSave != null) {
|
||||||
newSaveString = saveString.replace(CookieMonsterSave[0], "CookieMonster:" + CM.save());
|
newSaveString = saveString.replace(CookieMonsterSave[0], "CookieMonster:" + CM.save());
|
||||||
localStorage.setItem('CookieClickerGame', escape(utf8_to_b64(newSaveString)+'!END!'))
|
localStorage.setItem('CookieClickerGame', escape(utf8_to_b64(newSaveString)+'!END!'));
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function loads the config of CookieMonster saved in localStorage and loads it into CM.Options
|
* This function loads the config of CookieMonster saved in localStorage and loads it into CM.Options
|
||||||
@@ -81,7 +81,7 @@ CM.Config.LoadConfig = function(settings) {
|
|||||||
else { // Default values
|
else { // Default values
|
||||||
CM.Config.RestoreDefault();
|
CM.Config.RestoreDefault();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function reloads and resaves the default config as stored in CM.Data.ConfigDefault
|
* This function reloads and resaves the default config as stored in CM.Data.ConfigDefault
|
||||||
@@ -91,7 +91,7 @@ CM.Config.RestoreDefault = function() {
|
|||||||
CM.Config.LoadConfig(CM.Data.ConfigDefault);
|
CM.Config.LoadConfig(CM.Data.ConfigDefault);
|
||||||
CM.Config.SaveConfig();
|
CM.Config.SaveConfig();
|
||||||
Game.UpdateMenu();
|
Game.UpdateMenu();
|
||||||
}
|
};
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* Section: Functions related to toggling or changing configs */
|
* Section: Functions related to toggling or changing configs */
|
||||||
@@ -116,7 +116,7 @@ CM.Config.ToggleConfig = function(config) {
|
|||||||
|
|
||||||
l(CM.ConfigPrefix + config).innerHTML = CM.ConfigData[config].label[CM.Options[config]];
|
l(CM.ConfigPrefix + config).innerHTML = CM.ConfigData[config].label[CM.Options[config]];
|
||||||
CM.Config.SaveConfig();
|
CM.Config.SaveConfig();
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function sets the value of the specified volume-option and updates the display in the options menu
|
* This function sets the value of the specified volume-option and updates the display in the options menu
|
||||||
@@ -129,7 +129,7 @@ CM.Config.ToggleConfigVolume = function(config) {
|
|||||||
CM.Options[config] = Math.round(l("slider" + config).value);
|
CM.Options[config] = Math.round(l("slider" + config).value);
|
||||||
}
|
}
|
||||||
CM.Config.SaveConfig();
|
CM.Config.SaveConfig();
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function toggles header options by incrementing them with 1 and handling changes
|
* This function toggles header options by incrementing them with 1 and handling changes
|
||||||
@@ -140,7 +140,7 @@ CM.Config.ToggleHeader = function(config) {
|
|||||||
CM.Options.Header[config]++;
|
CM.Options.Header[config]++;
|
||||||
if (CM.Options.Header[config] > 1) CM.Options.Header[config] = 0;
|
if (CM.Options.Header[config] > 1) CM.Options.Header[config] = 0;
|
||||||
CM.Config.SaveConfig();
|
CM.Config.SaveConfig();
|
||||||
}
|
};
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* Section: Functions related to notifications */
|
* Section: Functions related to notifications */
|
||||||
@@ -154,14 +154,14 @@ CM.Config.ToggleHeader = function(config) {
|
|||||||
CM.Config.CheckNotificationPermissions = function(ToggleOnOff) {
|
CM.Config.CheckNotificationPermissions = function(ToggleOnOff) {
|
||||||
if (ToggleOnOff == 1) {
|
if (ToggleOnOff == 1) {
|
||||||
// Check if browser support Promise version of Notification Permissions
|
// Check if browser support Promise version of Notification Permissions
|
||||||
function checkNotificationPromise() {
|
checkNotificationPromise = function () {
|
||||||
try {
|
try {
|
||||||
Notification.requestPermission().then();
|
Notification.requestPermission().then();
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
};
|
||||||
|
|
||||||
// Check if the browser supports notifications and which type
|
// Check if the browser supports notifications and which type
|
||||||
if (!('Notification' in window)) {
|
if (!('Notification' in window)) {
|
||||||
@@ -176,4 +176,4 @@ CM.Config.CheckNotificationPermissions = function(ToggleOnOff) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
10
src/Data.js
10
src/Data.js
@@ -33,7 +33,7 @@ CM.Data.Fortunes = [
|
|||||||
CM.Data.HalloCookies = ['Skull cookies', 'Ghost cookies', 'Bat cookies', 'Slime cookies', 'Pumpkin cookies', 'Eyeball cookies', 'Spider cookies'];
|
CM.Data.HalloCookies = ['Skull cookies', 'Ghost cookies', 'Bat cookies', 'Slime cookies', 'Pumpkin cookies', 'Eyeball cookies', 'Spider cookies'];
|
||||||
CM.Data.ChristCookies = ['Christmas tree biscuits', 'Snowflake biscuits', 'Snowman biscuits', 'Holly biscuits', 'Candy cane biscuits', 'Bell biscuits', 'Present biscuits'];
|
CM.Data.ChristCookies = ['Christmas tree biscuits', 'Snowflake biscuits', 'Snowman biscuits', 'Holly biscuits', 'Candy cane biscuits', 'Bell biscuits', 'Present biscuits'];
|
||||||
CM.Data.ValCookies = ['Pure heart biscuits', 'Ardent heart biscuits', 'Sour heart biscuits', 'Weeping heart biscuits', 'Golden heart biscuits', 'Eternal heart biscuits', 'Prism heart biscuits'];
|
CM.Data.ValCookies = ['Pure heart biscuits', 'Ardent heart biscuits', 'Sour heart biscuits', 'Weeping heart biscuits', 'Golden heart biscuits', 'Eternal heart biscuits', 'Prism heart biscuits'];
|
||||||
CM.Data.PlantDrops = ['Elderwort biscuits', 'Bakeberry cookies', 'Duketater cookies', 'Green yeast digestives', 'Wheat slims', 'Fern tea', 'Ichor syrup']
|
CM.Data.PlantDrops = ['Elderwort biscuits', 'Bakeberry cookies', 'Duketater cookies', 'Green yeast digestives', 'Wheat slims', 'Fern tea', 'Ichor syrup'];
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* Section: All possible effects plants and other items can have with an explanation */
|
* Section: All possible effects plants and other items can have with an explanation */
|
||||||
@@ -60,7 +60,7 @@ CM.Data.Effects = {
|
|||||||
wrathCookieGain: "Wrath cookie gains",
|
wrathCookieGain: "Wrath cookie gains",
|
||||||
wrinklerEat: "Wrinkler ",
|
wrinklerEat: "Wrinkler ",
|
||||||
wrinklerSpawn: "Wrinkler spawn frequency"
|
wrinklerSpawn: "Wrinkler spawn frequency"
|
||||||
}
|
};
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* Section: Data for the various scales used by CookieMonster */
|
* Section: Data for the various scales used by CookieMonster */
|
||||||
@@ -77,7 +77,7 @@ CM.Data.shortScaleAbbreviated = ['', 'K', 'M', 'B', 'T', 'Qa', 'Qi', 'Sx', 'Sp',
|
|||||||
'USp', 'DSp', 'TSp', 'QaSp', 'QiSp', 'SxSp', 'SpSp', 'OSp', 'NSp', 'Oco',
|
'USp', 'DSp', 'TSp', 'QaSp', 'QiSp', 'SxSp', 'SpSp', 'OSp', 'NSp', 'Oco',
|
||||||
'UOc', 'DOc', 'TOc', 'QaOc', 'QiOc', 'SxOc', 'SpOc', 'OOc', 'NOc', 'Noa',
|
'UOc', 'DOc', 'TOc', 'QaOc', 'QiOc', 'SxOc', 'SpOc', 'OOc', 'NOc', 'Noa',
|
||||||
'UNo', 'DNo', 'TNo', 'QaNo', 'QiNo', 'SxNo', 'SpNo', 'ONo', 'NNo', 'Ct',
|
'UNo', 'DNo', 'TNo', 'QaNo', 'QiNo', 'SxNo', 'SpNo', 'ONo', 'NNo', 'Ct',
|
||||||
'UCt']
|
'UCt'];
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* Section: Two array's containing all Config groups and their to-be displayed title */
|
* Section: Two array's containing all Config groups and their to-be displayed title */
|
||||||
@@ -90,7 +90,7 @@ CM.ConfigGroups = {
|
|||||||
Statistics: "Statistics",
|
Statistics: "Statistics",
|
||||||
Notation: "Notation",
|
Notation: "Notation",
|
||||||
Miscellaneous: "Miscellaneous"
|
Miscellaneous: "Miscellaneous"
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.ConfigGroupsNotification = {
|
CM.ConfigGroupsNotification = {
|
||||||
NotificationGC: "Golden Cookie",
|
NotificationGC: "Golden Cookie",
|
||||||
@@ -100,7 +100,7 @@ CM.ConfigGroupsNotification = {
|
|||||||
NotificationMagi: "Full Magic Bar",
|
NotificationMagi: "Full Magic Bar",
|
||||||
NotificationWrink: "Wrinkler",
|
NotificationWrink: "Wrinkler",
|
||||||
NotificationWrinkMax: "Maximum Wrinklers",
|
NotificationWrinkMax: "Maximum Wrinklers",
|
||||||
}
|
};
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* Section: An array (CM.ConfigData) containing all Config options and an array of default settings */
|
* Section: An array (CM.ConfigData) containing all Config options and an array of default settings */
|
||||||
|
|||||||
313
src/Disp.js
313
src/Disp.js
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,7 @@ CM.init = function() {
|
|||||||
CM.DelayInit();
|
CM.DelayInit();
|
||||||
Game.registerHook('draw', CM.Disp.Draw);
|
Game.registerHook('draw', CM.Disp.Draw);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This registers a save function to the CM object. Per Game code/comments:
|
* This registers a save function to the CM object. Per Game code/comments:
|
||||||
@@ -32,7 +32,7 @@ CM.save = function() {
|
|||||||
settings: CM.Options,
|
settings: CM.Options,
|
||||||
version: CM.VersionMajor + '.' + CM.VersionMinor,
|
version: CM.VersionMajor + '.' + CM.VersionMinor,
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This registers a load function to the CM object. Per Game code/comments:
|
* This registers a load function to the CM object. Per Game code/comments:
|
||||||
@@ -41,7 +41,7 @@ CM.save = function() {
|
|||||||
CM.load = function(str) {
|
CM.load = function(str) {
|
||||||
let save = JSON.parse(str);
|
let save = JSON.parse(str);
|
||||||
CM.Config.LoadConfig(save.settings);
|
CM.Config.LoadConfig(save.settings);
|
||||||
}
|
};
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* Section: Functions related to the initialization of CookieMonster */
|
* Section: Functions related to the initialization of CookieMonster */
|
||||||
@@ -56,7 +56,7 @@ CM.Footer.AddJscolor = function() {
|
|||||||
CM.Footer.Jscolor.type = 'text/javascript';
|
CM.Footer.Jscolor.type = 'text/javascript';
|
||||||
CM.Footer.Jscolor.setAttribute('src', 'https://aktanusa.github.io/CookieMonster/jscolor/jscolor.js');
|
CM.Footer.Jscolor.setAttribute('src', 'https://aktanusa.github.io/CookieMonster/jscolor/jscolor.js');
|
||||||
document.head.appendChild(CM.Footer.Jscolor);
|
document.head.appendChild(CM.Footer.Jscolor);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions starts the initizialization and register CookieMonster
|
* This functions starts the initizialization and register CookieMonster
|
||||||
@@ -72,6 +72,6 @@ if (!CM.isRunning) {
|
|||||||
clearInterval(delay);
|
clearInterval(delay);
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
CM.isRunning = 1
|
CM.isRunning = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ RunCookieMonsterHeader = function() {
|
|||||||
CM.Options = {};
|
CM.Options = {};
|
||||||
|
|
||||||
CM.Sim = {};
|
CM.Sim = {};
|
||||||
}
|
};
|
||||||
|
|
||||||
if (typeof CM == "undefined") {
|
if (typeof CM == "undefined") {
|
||||||
RunCookieMonsterHeader();
|
RunCookieMonsterHeader();
|
||||||
|
|||||||
107
src/Main.js
107
src/Main.js
@@ -11,31 +11,31 @@ CM.ReplaceNative = function() {
|
|||||||
Game.CalculateGains = function() {
|
Game.CalculateGains = function() {
|
||||||
CM.Backup.CalculateGainsMod();
|
CM.Backup.CalculateGainsMod();
|
||||||
CM.Sim.DoSims = 1;
|
CM.Sim.DoSims = 1;
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Backup.tooltip = {};
|
CM.Backup.tooltip = {};
|
||||||
CM.Backup.tooltip.draw = Game.tooltip.draw;
|
CM.Backup.tooltip.draw = Game.tooltip.draw;
|
||||||
eval('CM.Backup.tooltip.drawMod = ' + Game.tooltip.draw.toString().split('this').join('Game.tooltip'));
|
eval('CM.Backup.tooltip.drawMod = ' + Game.tooltip.draw.toString().split('this').join('Game.tooltip'));
|
||||||
Game.tooltip.draw = function(from, text, origin) {
|
Game.tooltip.draw = function(from, text, origin) {
|
||||||
CM.Backup.tooltip.drawMod(from, text, origin);
|
CM.Backup.tooltip.drawMod(from, text, origin);
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Backup.tooltip.update = Game.tooltip.update;
|
CM.Backup.tooltip.update = Game.tooltip.update;
|
||||||
eval('CM.Backup.tooltip.updateMod = ' + Game.tooltip.update.toString().split('this.').join('Game.tooltip.'));
|
eval('CM.Backup.tooltip.updateMod = ' + Game.tooltip.update.toString().split('this.').join('Game.tooltip.'));
|
||||||
Game.tooltip.update = function() {
|
Game.tooltip.update = function() {
|
||||||
CM.Backup.tooltip.updateMod();
|
CM.Backup.tooltip.updateMod();
|
||||||
CM.Disp.UpdateTooltipLocation();
|
CM.Disp.UpdateTooltipLocation();
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Backup.UpdateWrinklers = Game.UpdateWrinklers;
|
CM.Backup.UpdateWrinklers = Game.UpdateWrinklers;
|
||||||
Game.UpdateWrinklers = function() {
|
Game.UpdateWrinklers = function() {
|
||||||
CM.Main.FixMouseY(CM.Backup.UpdateWrinklers);
|
CM.Main.FixMouseY(CM.Backup.UpdateWrinklers);
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Backup.UpdateSpecial = Game.UpdateSpecial;
|
CM.Backup.UpdateSpecial = Game.UpdateSpecial;
|
||||||
Game.UpdateSpecial = function() {
|
Game.UpdateSpecial = function() {
|
||||||
CM.Main.FixMouseY(CM.Backup.UpdateSpecial);
|
CM.Main.FixMouseY(CM.Backup.UpdateSpecial);
|
||||||
}
|
};
|
||||||
|
|
||||||
// Assumes newer browsers
|
// Assumes newer browsers
|
||||||
l('bigCookie').removeEventListener('click', Game.ClickCookie, false);
|
l('bigCookie').removeEventListener('click', Game.ClickCookie, false);
|
||||||
@@ -46,7 +46,7 @@ CM.ReplaceNative = function() {
|
|||||||
CM.Backup.RebuildUpgrades();
|
CM.Backup.RebuildUpgrades();
|
||||||
CM.Disp.ReplaceTooltipUpgrade();
|
CM.Disp.ReplaceTooltipUpgrade();
|
||||||
Game.CalculateGains();
|
Game.CalculateGains();
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Backup.DescribeDragonAura = Game.DescribeDragonAura;
|
CM.Backup.DescribeDragonAura = Game.DescribeDragonAura;
|
||||||
/**
|
/**
|
||||||
@@ -57,7 +57,7 @@ CM.ReplaceNative = function() {
|
|||||||
Game.DescribeDragonAura = function(aura) {
|
Game.DescribeDragonAura = function(aura) {
|
||||||
CM.Backup.DescribeDragonAura(aura);
|
CM.Backup.DescribeDragonAura(aura);
|
||||||
CM.Disp.AddAuraInfo(aura);
|
CM.Disp.AddAuraInfo(aura);
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Backup.ToggleSpecialMenu = Game.ToggleSpecialMenu;
|
CM.Backup.ToggleSpecialMenu = Game.ToggleSpecialMenu;
|
||||||
/**
|
/**
|
||||||
@@ -66,8 +66,7 @@ CM.ReplaceNative = function() {
|
|||||||
Game.ToggleSpecialMenu = function(on) {
|
Game.ToggleSpecialMenu = function(on) {
|
||||||
CM.Backup.ToggleSpecialMenu(on);
|
CM.Backup.ToggleSpecialMenu(on);
|
||||||
CM.Disp.AddDragonLevelUpTooltip();
|
CM.Disp.AddDragonLevelUpTooltip();
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
CM.Backup.UpdateMenu = Game.UpdateMenu;
|
CM.Backup.UpdateMenu = Game.UpdateMenu;
|
||||||
Game.UpdateMenu = function() {
|
Game.UpdateMenu = function() {
|
||||||
@@ -75,19 +74,19 @@ CM.ReplaceNative = function() {
|
|||||||
CM.Backup.UpdateMenu();
|
CM.Backup.UpdateMenu();
|
||||||
CM.Disp.AddMenu();
|
CM.Disp.AddMenu();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Backup.sayTime = Game.sayTime;
|
CM.Backup.sayTime = Game.sayTime;
|
||||||
CM.Disp.sayTime = function(time, detail) {
|
CM.Disp.sayTime = function(time, detail) {
|
||||||
if (isNaN(time) || time <= 0) return CM.Backup.sayTime(time, detail);
|
if (isNaN(time) || time <= 0) return CM.Backup.sayTime(time, detail);
|
||||||
else return CM.Disp.FormatTime(time / Game.fps, 1);
|
else return CM.Disp.FormatTime(time / Game.fps, 1);
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Backup.Loop = Game.Loop;
|
CM.Backup.Loop = Game.Loop;
|
||||||
Game.Loop = function() {
|
Game.Loop = function() {
|
||||||
CM.Backup.Loop();
|
CM.Backup.Loop();
|
||||||
CM.Loop();
|
CM.Loop();
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Backup.Logic = Game.Logic;
|
CM.Backup.Logic = Game.Logic;
|
||||||
eval('CM.Backup.LogicMod = ' + Game.Logic.toString().split('document.title').join('CM.Cache.Title'));
|
eval('CM.Backup.LogicMod = ' + Game.Logic.toString().split('document.title').join('CM.Cache.Title'));
|
||||||
@@ -96,13 +95,13 @@ CM.ReplaceNative = function() {
|
|||||||
|
|
||||||
// Update Title
|
// Update Title
|
||||||
CM.Disp.UpdateTitle();
|
CM.Disp.UpdateTitle();
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.ReplaceNativeGrimoire = function() {
|
CM.ReplaceNativeGrimoire = function() {
|
||||||
CM.ReplaceNativeGrimoireLaunch();
|
CM.ReplaceNativeGrimoireLaunch();
|
||||||
CM.ReplaceNativeGrimoireDraw();
|
CM.ReplaceNativeGrimoireDraw();
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.ReplaceNativeGrimoireLaunch = function() {
|
CM.ReplaceNativeGrimoireLaunch = function() {
|
||||||
if (!CM.HasReplaceNativeGrimoireLaunch && Game.Objects['Wizard tower'].minigameLoaded) {
|
if (!CM.HasReplaceNativeGrimoireLaunch && Game.Objects['Wizard tower'].minigameLoaded) {
|
||||||
@@ -114,10 +113,10 @@ CM.ReplaceNativeGrimoireLaunch = function() {
|
|||||||
CM.Main.ReplaceTooltipGrimoire();
|
CM.Main.ReplaceTooltipGrimoire();
|
||||||
CM.HasReplaceNativeGrimoireDraw = false;
|
CM.HasReplaceNativeGrimoireDraw = false;
|
||||||
CM.ReplaceNativeGrimoireDraw();
|
CM.ReplaceNativeGrimoireDraw();
|
||||||
}
|
};
|
||||||
CM.HasReplaceNativeGrimoireLaunch = true;
|
CM.HasReplaceNativeGrimoireLaunch = true;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.ReplaceNativeGrimoireDraw = function() {
|
CM.ReplaceNativeGrimoireDraw = function() {
|
||||||
if (!CM.HasReplaceNativeGrimoireDraw && Game.Objects['Wizard tower'].minigameLoaded) {
|
if (!CM.HasReplaceNativeGrimoireDraw && Game.Objects['Wizard tower'].minigameLoaded) {
|
||||||
@@ -128,10 +127,10 @@ CM.ReplaceNativeGrimoireDraw = function() {
|
|||||||
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)) + ')';
|
minigame.magicBarTextL.innerHTML += ' (' + CM.Disp.FormatTime(CM.Disp.CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, minigame.magicM)) + ')';
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
CM.HasReplaceNativeGrimoireDraw = true;
|
CM.HasReplaceNativeGrimoireDraw = true;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Loop = function() {
|
CM.Loop = function() {
|
||||||
if (CM.Disp.lastAscendState != Game.OnAscend) {
|
if (CM.Disp.lastAscendState != Game.OnAscend) {
|
||||||
@@ -211,7 +210,7 @@ CM.Loop = function() {
|
|||||||
// Update Average CPS (might need to move)
|
// Update Average CPS (might need to move)
|
||||||
CM.Cache.UpdateCurrWrinklerCPS();
|
CM.Cache.UpdateCurrWrinklerCPS();
|
||||||
CM.Cache.UpdateAvgCPS();
|
CM.Cache.UpdateAvgCPS();
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.DelayInit = function() {
|
CM.DelayInit = function() {
|
||||||
CM.Sim.InitData();
|
CM.Sim.InitData();
|
||||||
@@ -249,7 +248,7 @@ CM.DelayInit = function() {
|
|||||||
l("upgrades").style["flex-wrap"] = "wrap";
|
l("upgrades").style["flex-wrap"] = "wrap";
|
||||||
|
|
||||||
Game.Win('Third-party');
|
Game.Win('Third-party');
|
||||||
}
|
};
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* Section: Functions related to first initizalition of CM */
|
* Section: Functions related to first initizalition of CM */
|
||||||
@@ -268,11 +267,11 @@ CM.Main.ReplaceTooltips = function() {
|
|||||||
Game.LoadMinigames = function() {
|
Game.LoadMinigames = function() {
|
||||||
CM.Backup.LoadMinigames();
|
CM.Backup.LoadMinigames();
|
||||||
CM.Main.ReplaceTooltipGarden();
|
CM.Main.ReplaceTooltipGarden();
|
||||||
CM.Main.ReplaceTooltipGrimoire()
|
CM.Main.ReplaceTooltipGrimoire();
|
||||||
CM.ReplaceNativeGrimoire();
|
CM.ReplaceNativeGrimoire();
|
||||||
}
|
};
|
||||||
Game.LoadMinigames();
|
Game.LoadMinigames();
|
||||||
}
|
};
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* Section: Functions related to replacing tooltips */
|
* Section: Functions related to replacing tooltips */
|
||||||
@@ -292,7 +291,7 @@ CM.Main.ReplaceTooltipBuild = function() {
|
|||||||
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();}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function replaces the original .onmouseover functions of the Grimoire minigame so that it calls CM.Disp.Tooltip()
|
* This function replaces the original .onmouseover functions of the Grimoire minigame so that it calls CM.Disp.Tooltip()
|
||||||
@@ -309,7 +308,7 @@ CM.Main.ReplaceTooltipGrimoire = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function replaces the original .onmouseover functions of sugar lumps so that it calls CM.Disp.Tooltip()
|
* This function replaces the original .onmouseover functions of sugar lumps so that it calls CM.Disp.Tooltip()
|
||||||
@@ -329,8 +328,8 @@ CM.Main.ReplaceTooltipLump = function() {
|
|||||||
* It is called by CM.Main.ReplaceTooltips()
|
* It is called by CM.Main.ReplaceTooltips()
|
||||||
*/
|
*/
|
||||||
CM.Main.ReplaceTooltipGarden = function() {
|
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, index) => {
|
Array.from(l('gardenPlot').children).forEach((child, index) => {
|
||||||
var coords = child.id.slice(-3,);
|
var 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();};
|
||||||
@@ -349,15 +348,15 @@ CM.Main.ReplaceTooltipGarden = function() {
|
|||||||
*/
|
*/
|
||||||
CM.Main.FindShimmer = function() {
|
CM.Main.FindShimmer = function() {
|
||||||
CM.Main.currSpawnedGoldenCookieState = 0;
|
CM.Main.currSpawnedGoldenCookieState = 0;
|
||||||
CM.Cache.goldenShimmersByID = {}
|
CM.Cache.goldenShimmersByID = {};
|
||||||
for (var i in Game.shimmers) {
|
for (var i in Game.shimmers) {
|
||||||
CM.Cache.goldenShimmersByID[Game.shimmers[i].id] = Game.shimmers[i]
|
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.Cache.spawnedGoldenShimmer = Game.shimmers[i];
|
||||||
CM.Main.currSpawnedGoldenCookieState += 1;
|
CM.Main.currSpawnedGoldenCookieState += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function checks for changes in the amount of Golden Cookies
|
* This function checks for changes in the amount of Golden Cookies
|
||||||
@@ -373,13 +372,13 @@ CM.Main.CheckGoldenCookie = function() {
|
|||||||
delete CM.Disp.GCTimers[i];
|
delete CM.Disp.GCTimers[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CM.Main.lastGoldenCookieState != Game.shimmerTypes['golden'].n) {
|
if (CM.Main.lastGoldenCookieState != Game.shimmerTypes.golden.n) {
|
||||||
CM.Main.lastGoldenCookieState = Game.shimmerTypes['golden'].n;
|
CM.Main.lastGoldenCookieState = Game.shimmerTypes.golden.n;
|
||||||
if (CM.Main.lastGoldenCookieState) {
|
if (CM.Main.lastGoldenCookieState) {
|
||||||
if (CM.Main.lastSpawnedGoldenCookieState < CM.Main.currSpawnedGoldenCookieState) {
|
if (CM.Main.lastSpawnedGoldenCookieState < CM.Main.currSpawnedGoldenCookieState) {
|
||||||
CM.Disp.Flash(3, 'GCFlash');
|
CM.Disp.Flash(3, 'GCFlash');
|
||||||
CM.Disp.PlaySound(CM.Options.GCSoundURL, 'GCSound', 'GCVolume');
|
CM.Disp.PlaySound(CM.Options.GCSoundURL, 'GCSound', 'GCVolume');
|
||||||
CM.Disp.Notification('GCNotification', "Golden Cookie Spawned", "A Golden Cookie has spawned. Click it now!")
|
CM.Disp.Notification('GCNotification', "Golden Cookie Spawned", "A Golden Cookie has spawned. Click it now!");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i in Game.shimmers) {
|
for (var i in Game.shimmers) {
|
||||||
@@ -399,15 +398,15 @@ CM.Main.CheckGoldenCookie = function() {
|
|||||||
CM.Disp.GCTimers[i].textContent = Math.ceil(CM.Cache.goldenShimmersByID[i].life / Game.fps);
|
CM.Disp.GCTimers[i].textContent = Math.ceil(CM.Cache.goldenShimmersByID[i].life / Game.fps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function checks if there is reindeer that has spawned
|
* This function checks if there is reindeer that has spawned
|
||||||
* It is called by CM.Loop
|
* It is called by CM.Loop
|
||||||
*/
|
*/
|
||||||
CM.Main.CheckSeasonPopup = function() {
|
CM.Main.CheckSeasonPopup = function() {
|
||||||
if (CM.Main.lastSeasonPopupState != Game.shimmerTypes['reindeer'].spawned) {
|
if (CM.Main.lastSeasonPopupState != Game.shimmerTypes.reindeer.spawned) {
|
||||||
CM.Main.lastSeasonPopupState = Game.shimmerTypes['reindeer'].spawned;
|
CM.Main.lastSeasonPopupState = Game.shimmerTypes.reindeer.spawned;
|
||||||
for (var i in Game.shimmers) {
|
for (var i in 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];
|
CM.Cache.seasonPopShimmer = Game.shimmers[i];
|
||||||
@@ -416,9 +415,9 @@ CM.Main.CheckSeasonPopup = function() {
|
|||||||
}
|
}
|
||||||
CM.Disp.Flash(3, 'SeaFlash');
|
CM.Disp.Flash(3, 'SeaFlash');
|
||||||
CM.Disp.PlaySound(CM.Options.SeaSoundURL, 'SeaSound', 'SeaVolume');
|
CM.Disp.PlaySound(CM.Options.SeaSoundURL, 'SeaSound', 'SeaVolume');
|
||||||
CM.Disp.Notification('SeaNotification',"Reindeer sighted!", "A Reindeer has spawned. Click it now!")
|
CM.Disp.Notification('SeaNotification',"Reindeer sighted!", "A Reindeer has spawned. Click it now!");
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function checks if there is a fortune cookie on the ticker
|
* This function checks if there is a fortune cookie on the ticker
|
||||||
@@ -430,24 +429,24 @@ CM.Main.CheckTickerFortune = function() {
|
|||||||
if (CM.Main.lastTickerFortuneState) {
|
if (CM.Main.lastTickerFortuneState) {
|
||||||
CM.Disp.Flash(3, 'FortuneFlash');
|
CM.Disp.Flash(3, 'FortuneFlash');
|
||||||
CM.Disp.PlaySound(CM.Options.FortuneSoundURL, 'FortuneSound', 'FortuneVolume');
|
CM.Disp.PlaySound(CM.Options.FortuneSoundURL, 'FortuneSound', 'FortuneVolume');
|
||||||
CM.Disp.Notification('FortuneNotification', "Fortune Cookie found", "A Fortune Cookie has appeared on the Ticker.")
|
CM.Disp.Notification('FortuneNotification', "Fortune Cookie found", "A Fortune Cookie has appeared on the Ticker.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function checks if a garden tick has happened
|
* This function checks if a garden tick has happened
|
||||||
* It is called by CM.Loop
|
* It is called by CM.Loop
|
||||||
*/
|
*/
|
||||||
CM.Main.CheckGardenTick = function() {
|
CM.Main.CheckGardenTick = function() {
|
||||||
if (Game.Objects['Farm'].minigameLoaded && CM.Main.lastGardenNextStep != Game.Objects['Farm'].minigame.nextStep) {
|
if (Game.Objects.Farm.minigameLoaded && CM.Main.lastGardenNextStep != Game.Objects.Farm.minigame.nextStep) {
|
||||||
if (CM.Main.lastGardenNextStep != 0 && CM.Main.lastGardenNextStep < Date.now()) {
|
if (CM.Main.lastGardenNextStep != 0 && CM.Main.lastGardenNextStep < Date.now()) {
|
||||||
CM.Disp.Flash(3, 'GardFlash');
|
CM.Disp.Flash(3, 'GardFlash');
|
||||||
CM.Disp.PlaySound(CM.Options.GardSoundURL, 'GardSound', 'GardVolume');
|
CM.Disp.PlaySound(CM.Options.GardSoundURL, 'GardSound', 'GardVolume');
|
||||||
}
|
}
|
||||||
CM.Main.lastGardenNextStep = Game.Objects['Farm'].minigame.nextStep;
|
CM.Main.lastGardenNextStep = Game.Objects.Farm.minigame.nextStep;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function checks if the magic meter is full
|
* This function checks if the magic meter is full
|
||||||
@@ -461,10 +460,10 @@ CM.Main.CheckMagicMeter = function() {
|
|||||||
CM.Main.lastMagicBarFull = true;
|
CM.Main.lastMagicBarFull = true;
|
||||||
CM.Disp.Flash(3, 'MagicFlash');
|
CM.Disp.Flash(3, 'MagicFlash');
|
||||||
CM.Disp.PlaySound(CM.Options.MagicSoundURL, 'MagicSound', 'MagicVolume');
|
CM.Disp.PlaySound(CM.Options.MagicSoundURL, 'MagicSound', 'MagicVolume');
|
||||||
CM.Disp.Notification('MagicNotification', "Magic Meter full", "Your Magic Meter is full. Cast a spell!")
|
CM.Disp.Notification('MagicNotification', "Magic Meter full", "Your Magic Meter is full. Cast a spell!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function checks if any new Wrinklers have popped up
|
* This function checks if any new Wrinklers have popped up
|
||||||
@@ -477,7 +476,7 @@ CM.Main.CheckWrinklerCount = function() {
|
|||||||
if (Game.wrinklers[i].phase == 2) CurrentWrinklers++;
|
if (Game.wrinklers[i].phase == 2) CurrentWrinklers++;
|
||||||
}
|
}
|
||||||
if (CurrentWrinklers > CM.Main.lastWrinklerCount) {
|
if (CurrentWrinklers > CM.Main.lastWrinklerCount) {
|
||||||
CM.Main.lastWrinklerCount = CurrentWrinklers
|
CM.Main.lastWrinklerCount = CurrentWrinklers;
|
||||||
if (CurrentWrinklers == Game.getWrinklersMax() && CM.Options.WrinklerMaxFlash) {
|
if (CurrentWrinklers == Game.getWrinklersMax() && CM.Options.WrinklerMaxFlash) {
|
||||||
CM.Disp.Flash(3, 'WrinklerMaxFlash');
|
CM.Disp.Flash(3, 'WrinklerMaxFlash');
|
||||||
} else {
|
} else {
|
||||||
@@ -489,15 +488,15 @@ CM.Main.CheckWrinklerCount = function() {
|
|||||||
CM.Disp.PlaySound(CM.Options.WrinklerSoundURL, 'WrinklerSound', 'WrinklerVolume');
|
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")
|
CM.Disp.Notification('WrinklerMaxNotification', "Maximum Wrinklers Reached", "You have reached your maximum ammount of wrinklers");
|
||||||
} else {
|
} else {
|
||||||
CM.Disp.Notification('WrinklerNotification', "A Wrinkler appeared", "A new wrinkler has appeared")
|
CM.Disp.Notification('WrinklerNotification', "A Wrinkler appeared", "A new wrinkler has appeared");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
CM.Main.lastWrinklerCount = CurrentWrinklers
|
CM.Main.lastWrinklerCount = CurrentWrinklers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates .onmouseover/out events that determine if the mouse is hovering-over a Wrinkler
|
* This function creates .onmouseover/out events that determine if the mouse is hovering-over a Wrinkler
|
||||||
@@ -514,7 +513,7 @@ CM.Main.AddWrinklerAreaDetect = function() {
|
|||||||
CM.Disp.TooltipWrinklerBeingShown[i] = 0;
|
CM.Disp.TooltipWrinklerBeingShown[i] = 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* Section: Functions related to the mouse */
|
* Section: Functions related to the mouse */
|
||||||
@@ -534,14 +533,14 @@ CM.Main.FixMouseY = function(target) {
|
|||||||
else {
|
else {
|
||||||
target();
|
target();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.HasReplaceNativeGrimoireLaunch = false;
|
CM.HasReplaceNativeGrimoireLaunch = false;
|
||||||
CM.HasReplaceNativeGrimoireDraw = false;
|
CM.HasReplaceNativeGrimoireDraw = false;
|
||||||
|
|
||||||
CM.Main.lastGoldenCookieState = 0;
|
CM.Main.lastGoldenCookieState = 0;
|
||||||
CM.Main.lastSpawnedGoldenCookieState = 0;
|
CM.Main.lastSpawnedGoldenCookieState = 0;
|
||||||
CM.Main.currSpawnedGoldenCookieState
|
CM.Main.currSpawnedGoldenCookieState;
|
||||||
CM.Main.lastTickerFortuneState = 0;
|
CM.Main.lastTickerFortuneState = 0;
|
||||||
CM.Main.lastSeasonPopupState = 0;
|
CM.Main.lastSeasonPopupState = 0;
|
||||||
CM.Main.lastGardenNextStep = 0;
|
CM.Main.lastGardenNextStep = 0;
|
||||||
|
|||||||
73
src/Sim.js
73
src/Sim.js
@@ -23,7 +23,7 @@ CM.Sim.BuildingGetPrice = function(build, basePrice, start, free, increase) {
|
|||||||
start++;
|
start++;
|
||||||
}
|
}
|
||||||
return moni;
|
return moni;
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Sim.BuildingSell = function(build, basePrice, start, free, amount, noSim) {
|
CM.Sim.BuildingSell = function(build, basePrice, start, free, amount, noSim) {
|
||||||
/*var price=0;
|
/*var price=0;
|
||||||
@@ -61,13 +61,13 @@ CM.Sim.BuildingSell = function(build, basePrice, start, free, amount, noSim) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return moni;
|
return moni;
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Sim.Has = function(what) {
|
CM.Sim.Has = function(what) {
|
||||||
var it = CM.Sim.Upgrades[what];
|
var 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);
|
return (it ? it.bought : 0);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
CM.Sim.Win = function(what) {
|
CM.Sim.Win = function(what) {
|
||||||
@@ -77,7 +77,7 @@ CM.Sim.Win = function(what) {
|
|||||||
if (Game.Achievements[what].pool != 'shadow') CM.Sim.AchievementsOwned++;
|
if (Game.Achievements[what].pool != 'shadow') CM.Sim.AchievementsOwned++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
eval('CM.Sim.HasAchiev = ' + Game.HasAchiev.toString().split('Game').join('CM.Sim'));
|
eval('CM.Sim.HasAchiev = ' + Game.HasAchiev.toString().split('Game').join('CM.Sim'));
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ CM.Sim.hasAura = function(what) {
|
|||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
};
|
||||||
|
|
||||||
// Check if multiplier auras are present
|
// Check if multiplier auras are present
|
||||||
// Used as CM.Sim.auraMult('Aura') * mult, i.e. CM.Sim.auraMult('Dragon God) * 0.05
|
// Used as CM.Sim.auraMult('Aura') * mult, i.e. CM.Sim.auraMult('Dragon God) * 0.05
|
||||||
@@ -100,20 +100,20 @@ CM.Sim.auraMult = function(what) {
|
|||||||
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;
|
n += 0.1;
|
||||||
return n;
|
return n;
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Sim.hasGod=function(what) {
|
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
|
var possibleGods = CM.Sim.Objects.Temple.minigame.gods;
|
||||||
var god=possibleGods[what];
|
var god=possibleGods[what];
|
||||||
for (var i=0;i<3;i++)
|
for (var 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);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Sim.eff = function(name) {
|
CM.Sim.eff = function(name) {
|
||||||
if (typeof CM.Sim.effs[name]==='undefined') {
|
if (typeof CM.Sim.effs[name]==='undefined') {
|
||||||
@@ -123,7 +123,7 @@ CM.Sim.eff = function(name) {
|
|||||||
else {
|
else {
|
||||||
return CM.Sim.effs[name];
|
return CM.Sim.effs[name];
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
eval('CM.Sim.GetTieredCpsMult = ' + Game.GetTieredCpsMult.toString()
|
eval('CM.Sim.GetTieredCpsMult = ' + Game.GetTieredCpsMult.toString()
|
||||||
.split('Game.Has').join('CM.Sim.Has')
|
.split('Game.Has').join('CM.Sim.Has')
|
||||||
@@ -143,7 +143,7 @@ CM.Sim.getCPSBuffMult = function() {
|
|||||||
if (typeof Game.buffs[i].multCpS != 'undefined') mult *= Game.buffs[i].multCpS;
|
if (typeof Game.buffs[i].multCpS != 'undefined') mult *= Game.buffs[i].multCpS;
|
||||||
}
|
}
|
||||||
return mult;
|
return mult;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs an object with the static properties of a building,
|
* Constructs an object with the static properties of a building,
|
||||||
@@ -168,7 +168,7 @@ CM.Sim.InitialBuildingData = function(buildingName) {
|
|||||||
you.baseCps = me.baseCps;
|
you.baseCps = me.baseCps;
|
||||||
you.name = me.name;
|
you.name = me.name;
|
||||||
return you;
|
return you;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Similar to the previous function, but for upgrades.
|
* Similar to the previous function, but for upgrades.
|
||||||
@@ -181,7 +181,7 @@ CM.Sim.InitUpgrade = function(upgradeName) {
|
|||||||
you.pool = me.pool;
|
you.pool = me.pool;
|
||||||
you.name = me.name;
|
you.name = me.name;
|
||||||
return you;
|
return you;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Similar to the previous function, but for achievements.
|
* Similar to the previous function, but for achievements.
|
||||||
@@ -190,7 +190,7 @@ CM.Sim.InitUpgrade = function(upgradeName) {
|
|||||||
*/
|
*/
|
||||||
CM.Sim.InitAchievement = function(achievementName) {
|
CM.Sim.InitAchievement = function(achievementName) {
|
||||||
return {};
|
return {};
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Sim.InitData = function() {
|
CM.Sim.InitData = function() {
|
||||||
// Buildings
|
// Buildings
|
||||||
@@ -210,8 +210,8 @@ CM.Sim.InitData = function() {
|
|||||||
for (var i in Game.Achievements) {
|
for (var i in Game.Achievements) {
|
||||||
CM.Sim.Achievements[i] = CM.Sim.InitAchievement(i);
|
CM.Sim.Achievements[i] = CM.Sim.InitAchievement(i);
|
||||||
}
|
}
|
||||||
CM.Sim.CopyData
|
CM.Sim.CopyData;
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Sim.CopyData = function() {
|
CM.Sim.CopyData = function() {
|
||||||
// Other variables
|
// Other variables
|
||||||
@@ -424,7 +424,7 @@ CM.Sim.CalculateGains = function() {
|
|||||||
|
|
||||||
CM.Sim.cookiesPsRaw = rawCookiesPs;
|
CM.Sim.cookiesPsRaw = rawCookiesPs;
|
||||||
|
|
||||||
var n = Game.shimmerTypes['golden'].n;
|
var n = Game.shimmerTypes.golden.n;
|
||||||
var auraMult = CM.Sim.auraMult('Dragon\'s Fortune');
|
var auraMult = CM.Sim.auraMult('Dragon\'s Fortune');
|
||||||
for (var i = 0; i < n; i++){
|
for (var i = 0; i < n; i++){
|
||||||
mult *= 1 + auraMult * 1.23;
|
mult *= 1 + auraMult * 1.23;
|
||||||
@@ -520,7 +520,7 @@ CM.Sim.CheckOtherAchiev = function() {
|
|||||||
if (buildingsOwned >= 4000 && CM.Sim.UpgradesOwned >= 300) CM.Sim.Win('Polymath');
|
if (buildingsOwned >= 4000 && CM.Sim.UpgradesOwned >= 300) CM.Sim.Win('Polymath');
|
||||||
if (buildingsOwned >= 8000 && CM.Sim.UpgradesOwned >= 400) CM.Sim.Win('Renaissance baker');
|
if (buildingsOwned >= 8000 && CM.Sim.UpgradesOwned >= 400) CM.Sim.Win('Renaissance baker');
|
||||||
|
|
||||||
if (CM.Sim.Objects['Cursor'].amount + CM.Sim.Objects['Grandma'].amount >= 777) CM.Sim.Win('The elder scrolls');
|
if (CM.Sim.Objects.Cursor.amount + CM.Sim.Objects.Grandma.amount >= 777) CM.Sim.Win('The elder scrolls');
|
||||||
|
|
||||||
var hasAllHalloCook = true;
|
var hasAllHalloCook = true;
|
||||||
for (var i in CM.Data.HalloCookies) {
|
for (var i in CM.Data.HalloCookies) {
|
||||||
@@ -535,14 +535,14 @@ CM.Sim.CheckOtherAchiev = function() {
|
|||||||
if (hasAllChristCook) CM.Sim.Win('Let it snow');
|
if (hasAllChristCook) CM.Sim.Win('Let it snow');
|
||||||
|
|
||||||
if (CM.Sim.Has('Fortune cookies')) {
|
if (CM.Sim.Has('Fortune cookies')) {
|
||||||
var list = Game.Tiers['fortune'].upgrades;
|
var list = Game.Tiers.fortune.upgrades;
|
||||||
var fortunes = 0;
|
var fortunes = 0;
|
||||||
for (var i in list) {
|
for (var i in list) {
|
||||||
if (CM.Sim.Has(list[i].name)) fortunes++;
|
if (CM.Sim.Has(list[i].name)) fortunes++;
|
||||||
}
|
}
|
||||||
if (fortunes >= list.length) CM.Sim.Win('O Fortuna');
|
if (fortunes >= list.length) CM.Sim.Win('O Fortuna');
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Sim.BuyBuildings = function(amount, target) {
|
CM.Sim.BuyBuildings = function(amount, target) {
|
||||||
CM.Cache[target] = [];
|
CM.Cache[target] = [];
|
||||||
@@ -587,7 +587,7 @@ CM.Sim.BuyBuildings = function(amount, target) {
|
|||||||
CM.Cache.DoRemakeBuildPrices = 1;
|
CM.Cache.DoRemakeBuildPrices = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Sim.BuyUpgrades = function() {
|
CM.Sim.BuyUpgrades = function() {
|
||||||
CM.Cache.Upgrades = [];
|
CM.Cache.Upgrades = [];
|
||||||
@@ -604,7 +604,7 @@ CM.Sim.BuyUpgrades = function() {
|
|||||||
if (CM.Sim.pledges >= 5) CM.Sim.Win('Elder slumber');
|
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')
|
CM.Sim.Win('Elder calm');
|
||||||
}
|
}
|
||||||
else if (i == 'Prism heart biscuits') {
|
else if (i == 'Prism heart biscuits') {
|
||||||
CM.Sim.Win('Lovely cookies');
|
CM.Sim.Win('Lovely cookies');
|
||||||
@@ -630,7 +630,7 @@ CM.Sim.BuyUpgrades = function() {
|
|||||||
if (diffMouseCPS) CM.Cache.Upgrades[i].bonusMouse = diffMouseCPS;
|
if (diffMouseCPS) CM.Cache.Upgrades[i].bonusMouse = diffMouseCPS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions calculates the cps and cost of changing a Dragon Aura
|
* This functions calculates the cps and cost of changing a Dragon Aura
|
||||||
@@ -642,7 +642,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")
|
var 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;
|
||||||
|
|
||||||
@@ -653,7 +653,7 @@ CM.Sim.CalculateChangeAura = function(aura) {
|
|||||||
var highestBuilding = CM.Sim.Objects[Game.ObjectsById[i].name].name;
|
var 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;
|
||||||
break
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// This calculates price of highest building
|
// This calculates price of highest building
|
||||||
@@ -669,8 +669,8 @@ CM.Sim.CalculateChangeAura = function(aura) {
|
|||||||
if (lastAchievementsOwned != CM.Sim.AchievementsOwned) {
|
if (lastAchievementsOwned != CM.Sim.AchievementsOwned) {
|
||||||
CM.Sim.CalculateGains();
|
CM.Sim.CalculateGains();
|
||||||
}
|
}
|
||||||
return [CM.Sim.cookiesPs - Game.cookiesPs, price]
|
return [CM.Sim.cookiesPs - Game.cookiesPs, price];
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Sim.NoGoldSwitchCookiesPS = function() {
|
CM.Sim.NoGoldSwitchCookiesPS = function() {
|
||||||
if (Game.Has('Golden switch [off]')) {
|
if (Game.Has('Golden switch [off]')) {
|
||||||
@@ -680,7 +680,7 @@ CM.Sim.NoGoldSwitchCookiesPS = function() {
|
|||||||
CM.Cache.NoGoldSwitchCookiesPS = CM.Sim.cookiesPs;
|
CM.Cache.NoGoldSwitchCookiesPS = CM.Sim.cookiesPs;
|
||||||
}
|
}
|
||||||
else CM.Cache.NoGoldSwitchCookiesPS = Game.cookiesPs;
|
else CM.Cache.NoGoldSwitchCookiesPS = Game.cookiesPs;
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Sim.ResetBonus = function(possiblePresMax) {
|
CM.Sim.ResetBonus = function(possiblePresMax) {
|
||||||
var lastAchievementsOwned = -1;
|
var lastAchievementsOwned = -1;
|
||||||
@@ -740,19 +740,19 @@ CM.Sim.ResetBonus = function(possiblePresMax) {
|
|||||||
CM.Sim.CalculateGains();
|
CM.Sim.CalculateGains();
|
||||||
}
|
}
|
||||||
|
|
||||||
var ResetCPS = CM.Sim.cookiesPs - curCPS
|
var ResetCPS = CM.Sim.cookiesPs - curCPS;
|
||||||
|
|
||||||
// Reset Pretige level after calculation
|
// Reset Pretige level after calculation
|
||||||
CM.Sim.prestige = Game.prestige;
|
CM.Sim.prestige = Game.prestige;
|
||||||
|
|
||||||
return (ResetCPS);
|
return (ResetCPS);
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Sim.getSellMultiplier = function() {
|
CM.Sim.getSellMultiplier = function() {
|
||||||
var giveBack = 0.25;
|
var giveBack = 0.25;
|
||||||
giveBack *= 1 + CM.Sim.auraMult('Earth Shatterer');
|
giveBack *= 1 + CM.Sim.auraMult('Earth Shatterer');
|
||||||
return giveBack;
|
return giveBack;
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Sim.modifyBuildingPrice = function(building,price) {
|
CM.Sim.modifyBuildingPrice = function(building,price) {
|
||||||
if (CM.Sim.Has('Season savings')) price *= 0.99;
|
if (CM.Sim.Has('Season savings')) price *= 0.99;
|
||||||
@@ -774,7 +774,7 @@ CM.Sim.modifyBuildingPrice = function(building,price) {
|
|||||||
else if (godLvl == 3) price *= 0.98;
|
else if (godLvl == 3) price *= 0.98;
|
||||||
}
|
}
|
||||||
return price;
|
return price;
|
||||||
}
|
};
|
||||||
|
|
||||||
CM.Sim.SellBuildingsForChoEgg = function() {
|
CM.Sim.SellBuildingsForChoEgg = function() {
|
||||||
var sellTotal = 0;
|
var sellTotal = 0;
|
||||||
@@ -820,7 +820,7 @@ CM.Sim.SellBuildingsForChoEgg = function() {
|
|||||||
// CM.Cache.DoRemakeBuildPrices = 1;
|
// CM.Cache.DoRemakeBuildPrices = 1;
|
||||||
|
|
||||||
return sellTotal;
|
return sellTotal;
|
||||||
}
|
};
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* Section: Functions used to calculate clicking power */
|
* Section: Functions used to calculate clicking power */
|
||||||
@@ -843,7 +843,7 @@ CM.Sim.mouseCps = function() {
|
|||||||
if (CM.Sim.Has('Nonillion fingers')) add *= 20;
|
if (CM.Sim.Has('Nonillion fingers')) add *= 20;
|
||||||
var num=0;
|
var num=0;
|
||||||
for (var i in CM.Sim.Objects) {num+=CM.Sim.Objects[i].amount;}
|
for (var i in CM.Sim.Objects) {num+=CM.Sim.Objects[i].amount;}
|
||||||
num -= CM.Sim.Objects['Cursor'].amount;
|
num -= CM.Sim.Objects.Cursor.amount;
|
||||||
add = add * num;
|
add = add * num;
|
||||||
|
|
||||||
// Use CM.Sim.cookiesPs as function is always called after CM.Sim.CalculateGains()
|
// Use CM.Sim.cookiesPs as function is always called after CM.Sim.CalculateGains()
|
||||||
@@ -872,7 +872,7 @@ CM.Sim.mouseCps = function() {
|
|||||||
|
|
||||||
if (CM.Sim.Has('Aura gloves'))
|
if (CM.Sim.Has('Aura gloves'))
|
||||||
{
|
{
|
||||||
mult *= 1 + 0.05 * Math.min(Game.Objects['Cursor'].level, CM.Sim.Has('Luminous gloves') ? 20 : 10);
|
mult *= 1 + 0.05 * Math.min(Game.Objects.Cursor.level, CM.Sim.Has('Luminous gloves') ? 20 : 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
mult *= CM.Sim.eff('click');
|
mult *= CM.Sim.eff('click');
|
||||||
@@ -902,4 +902,5 @@ CM.Sim.mouseCps = function() {
|
|||||||
if (Game.hasBuff('Cursed finger')) out = Game.buffs['Cursed finger'].power;
|
if (Game.hasBuff('Cursed finger')) out = Game.buffs['Cursed finger'].power;
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user