Merge pull request #590 from DanielNoord/feature/heavenly
Number of functions related to Stats page and registration to CCRepo
This commit is contained in:
File diff suppressed because one or more lines are too long
11
package.json
11
package.json
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "cookie-monster",
|
"name": "cookiemonster-mod",
|
||||||
"version": "2.031.4",
|
"version": "2.031.4",
|
||||||
"description": "Cookie Monster is an add-on that you can load into Cookie Clicker which offers a wide range of tools and statistics to enhance the game. It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. This is a helper and everything is an option.",
|
"description": "Cookie Monster is an add-on that you can load into Cookie Clicker which offers a wide range of tools and statistics to enhance the game. It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want. This is a helper and everything is an option.",
|
||||||
"main": "CookieMonster.js",
|
"main": "CookieMonster.js",
|
||||||
@@ -40,5 +40,12 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^7.19.0",
|
"eslint": "^7.19.0",
|
||||||
"terser": "^5.6.0-beta"
|
"terser": "^5.6.0-beta"
|
||||||
}
|
},
|
||||||
|
"ccrepo": {
|
||||||
|
"icon": [
|
||||||
|
10,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"name": "Cookie Monster"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
107
src/Cache.js
107
src/Cache.js
@@ -19,6 +19,7 @@ CM.Cache.InitCache = function() {
|
|||||||
CM.Cache.CacheMissingUpgrades();
|
CM.Cache.CacheMissingUpgrades();
|
||||||
CM.Cache.CacheSeaSpec();
|
CM.Cache.CacheSeaSpec();
|
||||||
CM.Cache.InitCookiesDiff();
|
CM.Cache.InitCookiesDiff();
|
||||||
|
CM.Cache.HeavenlyChipsDiff = new CMAvgQueue(5); // Used by CM.Cache.CacheHeavenlyChipsPS()
|
||||||
CM.Cache.CacheAvgCPS();
|
CM.Cache.CacheAvgCPS();
|
||||||
CM.Cache.CacheIncome();
|
CM.Cache.CacheIncome();
|
||||||
CM.Cache.CacheBuildingsPrices();
|
CM.Cache.CacheBuildingsPrices();
|
||||||
@@ -34,18 +35,55 @@ CM.Cache.LoopCache = function() {
|
|||||||
// Update Wrinkler Bank
|
// Update Wrinkler Bank
|
||||||
CM.Cache.CacheWrinklers();
|
CM.Cache.CacheWrinklers();
|
||||||
|
|
||||||
// Calculate PP
|
|
||||||
CM.Cache.CachePP();
|
CM.Cache.CachePP();
|
||||||
|
|
||||||
// Cache average CPS
|
|
||||||
CM.Cache.CacheCurrWrinklerCPS();
|
CM.Cache.CacheCurrWrinklerCPS();
|
||||||
CM.Cache.CacheAvgCPS();
|
CM.Cache.CacheAvgCPS();
|
||||||
|
CM.Cache.CacheHeavenlyChipsPS();
|
||||||
|
|
||||||
let cookiesToNext = Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + 1) - (Game.cookiesEarned + Game.cookiesReset);
|
let cookiesToNext = Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + 1) - (Game.cookiesEarned + Game.cookiesReset);
|
||||||
CM.Cache.TimeTillNextPrestige = CM.Disp.FormatTime(cookiesToNext / CM.Cache.AvgCPS);
|
CM.Cache.TimeTillNextPrestige = CM.Disp.FormatTime(cookiesToNext / CM.Cache.AvgCPS);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/********
|
||||||
|
* Section: Helper functions */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @class
|
||||||
|
* @classdesc This is a class used to store values used to calculate average over time (mostly cps)
|
||||||
|
* @var {number} maxLength The maximum length of the value-storage
|
||||||
|
* @var {[]} queue The values stored
|
||||||
|
* @method addLatest(newValue) Appends newValue to the value storage
|
||||||
|
* @method calcAverage(timePeriod) Returns the average over the specified timeperiod
|
||||||
|
*/
|
||||||
|
class CMAvgQueue {
|
||||||
|
constructor(maxLength) {
|
||||||
|
this.maxLength = maxLength;
|
||||||
|
this.queue = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
addLatest (newValue) {
|
||||||
|
if (this.queue.push(newValue) > this.maxLength) {
|
||||||
|
this.queue.shift();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This functions returns the average of the values in the queue
|
||||||
|
* @param {number} timePeriod The period in seconds to computer average over
|
||||||
|
* @returns {number} ret The average
|
||||||
|
*/
|
||||||
|
calcAverage (timePeriod) {
|
||||||
|
if (timePeriod > this.maxLength) timePeriod = this.maxLength;
|
||||||
|
if (timePeriod > this.queue.length) timePeriod = this.queue.length;
|
||||||
|
let ret = 0;
|
||||||
|
for (let i = this.queue.length - 1; i >= 0 && i > this.queue.length - 1 - timePeriod; i--) {
|
||||||
|
ret += this.queue[i];
|
||||||
|
}
|
||||||
|
return ret / timePeriod;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/********
|
/********
|
||||||
* Section: Functions related to Dragon Auras */
|
* Section: Functions related to Dragon Auras */
|
||||||
|
|
||||||
@@ -201,7 +239,7 @@ CM.Cache.MaxChainCookieReward = function(digit, maxPayout, mult) {
|
|||||||
let chain = 1 + Math.max(0, Math.ceil(Math.log(Game.cookies) / Math.LN10) - 10);
|
let chain = 1 + Math.max(0, Math.ceil(Math.log(Game.cookies) / Math.LN10) - 10);
|
||||||
while (nextMoni < maxPayout) {
|
while (nextMoni < maxPayout) {
|
||||||
moni = Math.max(digit, Math.min(Math.floor(1 / 9 * Math.pow(10, chain) * digit * mult), maxPayout));
|
moni = Math.max(digit, Math.min(Math.floor(1 / 9 * Math.pow(10, chain) * digit * mult), maxPayout));
|
||||||
// TODO: Calculate Cookies or cps needed for next level of chain. Related to issue #580
|
// TODO: Calculate Cookies or cps needed for next level of chain. See issue #29
|
||||||
nextMoni = Math.max(digit, Math.min(Math.floor(1 / 9 * Math.pow(10, chain + 1) * digit * mult), maxPayout));
|
nextMoni = Math.max(digit, Math.min(Math.floor(1 / 9 * Math.pow(10, chain + 1) * digit * mult), maxPayout));
|
||||||
totalFromChain += moni;
|
totalFromChain += moni;
|
||||||
chain++;
|
chain++;
|
||||||
@@ -303,45 +341,38 @@ CM.Cache.CacheSeaSpec = function() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/********
|
|
||||||
* Section: Functions related to Caching CPS */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class
|
* This functions caches the heavenly chips per second in the last five seconds
|
||||||
* @classdesc This is a class used to store values used to calculate average over time (mostly cps)
|
* It is called by CM.Cache.LoopCache()
|
||||||
* @var {number} maxLength The maximum length of the value-storage
|
* @global {number} CM.Cache.HCPerSecond The Heavenly Chips per second in the last five seconds
|
||||||
* @var {[]} queue The values stored
|
|
||||||
* @method addLatest(newValue) Appends newValue to the value storage
|
|
||||||
* @method calcAverage(timePeriod) Returns the average over the specified timeperiod
|
|
||||||
*/
|
*/
|
||||||
class CMAvgQueue {
|
CM.Cache.CacheHeavenlyChipsPS = function() {
|
||||||
constructor(maxLength) {
|
let currDate = Math.floor(Date.now() / 1000);
|
||||||
this.maxLength = maxLength;
|
// Only calculate every new second
|
||||||
this.queue = [];
|
if ((Game.T / Game.fps) % 1 === 0) {
|
||||||
}
|
let chipsOwned = Game.HowMuchPrestige(Game.cookiesReset);
|
||||||
|
let ascendNowToOwn = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned));
|
||||||
|
let ascendNowToGet = ascendNowToOwn - Math.floor(chipsOwned);
|
||||||
|
|
||||||
addLatest (newValue) {
|
// Add recent gains to AvgQueue's
|
||||||
if (this.queue.push(newValue) > this.maxLength) {
|
let timeDiff = currDate - CM.Cache.lastHeavenlyCheck;
|
||||||
this.queue.shift();
|
let heavenlyChipsDiffAvg = Math.max(0, (ascendNowToGet - CM.Cache.lastHeavenlyChips)) / timeDiff;
|
||||||
|
for (let i = 0; i < timeDiff; i++) {
|
||||||
|
CM.Cache.HeavenlyChipsDiff.addLatest(heavenlyChipsDiffAvg);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
// Store current data for next loop
|
||||||
* This functions returns the average of the values in the queue
|
CM.Cache.lastHeavenlyCheck = currDate;
|
||||||
* @param {number} timePeriod The period in seconds to computer average over
|
CM.Cache.lastHeavenlyChips = ascendNowToGet;
|
||||||
* @returns {number} ret The average
|
|
||||||
*/
|
// Get average gain over period of 5 seconds
|
||||||
calcAverage (timePeriod) {
|
CM.Cache.HCPerSecond = CM.Cache.HeavenlyChipsDiff.calcAverage(5);
|
||||||
if (timePeriod > this.maxLength) timePeriod = this.maxLength;
|
|
||||||
if (timePeriod > this.queue.length) timePeriod = this.queue.length;
|
|
||||||
let ret = 0;
|
|
||||||
for (let i = this.queue.length - 1; i >= 0 && i > this.queue.length - 1 - timePeriod; i--) {
|
|
||||||
ret += this.queue[i];
|
|
||||||
}
|
|
||||||
return ret / timePeriod;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/********
|
||||||
|
* Section: Functions related to caching CPS */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This functions caches creates the CMAvgQueue used by CM.Cache.CacheAvgCPS() to calculate CPS
|
* This functions caches creates the CMAvgQueue used by CM.Cache.CacheAvgCPS() to calculate CPS
|
||||||
* Called by CM.Cache.InitCache()
|
* Called by CM.Cache.InitCache()
|
||||||
@@ -372,7 +403,7 @@ CM.Cache.CacheAvgCPS = function() {
|
|||||||
choEggTotal *= 0.05;
|
choEggTotal *= 0.05;
|
||||||
|
|
||||||
// Add recent gains to AvgQueue's
|
// Add recent gains to AvgQueue's
|
||||||
let timeDiff = currDate - CM.Cache.lastDate;
|
let timeDiff = currDate - CM.Cache.lastCPSCheck;
|
||||||
let bankDiffAvg = Math.max(0, (Game.cookies - CM.Cache.lastCookies)) / timeDiff;
|
let bankDiffAvg = Math.max(0, (Game.cookies - CM.Cache.lastCookies)) / timeDiff;
|
||||||
let wrinkDiffAvg = Math.max(0, (CM.Cache.WrinklersTotal - CM.Cache.lastWrinkCookies)) / timeDiff;
|
let wrinkDiffAvg = Math.max(0, (CM.Cache.WrinklersTotal - CM.Cache.lastWrinkCookies)) / timeDiff;
|
||||||
let wrinkFattestDiffAvg = Math.max(0, (CM.Cache.WrinklersFattest[0] - CM.Cache.lastWrinkFattestCookies)) / timeDiff;
|
let wrinkFattestDiffAvg = Math.max(0, (CM.Cache.WrinklersFattest[0] - CM.Cache.lastWrinkFattestCookies)) / timeDiff;
|
||||||
@@ -387,7 +418,7 @@ CM.Cache.CacheAvgCPS = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Store current data for next loop
|
// Store current data for next loop
|
||||||
CM.Cache.lastDate = currDate;
|
CM.Cache.lastCPSCheck = currDate;
|
||||||
CM.Cache.lastCookies = Game.cookies;
|
CM.Cache.lastCookies = Game.cookies;
|
||||||
CM.Cache.lastWrinkCookies = CM.Cache.WrinklersTotal;
|
CM.Cache.lastWrinkCookies = CM.Cache.WrinklersTotal;
|
||||||
CM.Cache.lastWrinkFattestCookies = CM.Cache.WrinklersFattest[0];
|
CM.Cache.lastWrinkFattestCookies = CM.Cache.WrinklersFattest[0];
|
||||||
@@ -654,7 +685,7 @@ CM.Cache.CacheBuildingsPP = function() {
|
|||||||
for (let i of Object.keys(CM.Cache[target])) {
|
for (let i of Object.keys(CM.Cache[target])) {
|
||||||
if (Game.cookiesPs) {
|
if (Game.cookiesPs) {
|
||||||
CM.Cache[target][i].pp = (Math.max(Game.Objects[i].bulkPrice - (Game.cookies + CM.Disp.GetWrinkConfigBank()), 0) / Game.cookiesPs) + (Game.Objects[i].bulkPrice / CM.Cache[target][i].bonus);
|
CM.Cache[target][i].pp = (Math.max(Game.Objects[i].bulkPrice - (Game.cookies + CM.Disp.GetWrinkConfigBank()), 0) / Game.cookiesPs) + (Game.Objects[i].bulkPrice / CM.Cache[target][i].bonus);
|
||||||
} else CM.CM.Cache[target][i].pp = (Game.Objects[i].bulkPrice / CM.Cache[target][i].bonus);
|
} else CM.Cache[target][i].pp = (Game.Objects[i].bulkPrice / CM.Cache[target][i].bonus);
|
||||||
if (CM.Cache.min === -1 || CM.Cache[target][i].pp < CM.Cache.min) CM.Cache.min = CM.Cache[target][i].pp;
|
if (CM.Cache.min === -1 || CM.Cache[target][i].pp < CM.Cache.min) CM.Cache.min = CM.Cache[target][i].pp;
|
||||||
if (CM.Cache.max === -1 || CM.Cache[target][i].pp > CM.Cache.max) CM.Cache.max = CM.Cache[target][i].pp;
|
if (CM.Cache.max === -1 || CM.Cache[target][i].pp > CM.Cache.max) CM.Cache.max = CM.Cache[target][i].pp;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ CM.Data.Config.TooltipWrink = {type: 'bool', group: 'Tooltip', label: ['Wrinkler
|
|||||||
CM.Data.Config.TooltipLump = {type: 'bool', group: 'Tooltip', label: ['Sugar Lump Tooltip OFF', 'Sugar Lump Tooltip ON'], desc: 'Shows the current Sugar Lump type in Sugar lump tooltip.', toggle: true};
|
CM.Data.Config.TooltipLump = {type: 'bool', group: 'Tooltip', label: ['Sugar Lump Tooltip OFF', 'Sugar Lump Tooltip ON'], desc: 'Shows the current Sugar Lump type in Sugar lump tooltip.', toggle: true};
|
||||||
CM.Data.Config.TooltipPlots = {type: 'bool', group: 'Tooltip', label: ['Garden Plots Tooltip OFF', 'Garden Plots Tooltip ON'], desc: 'Shows a tooltip for plants that have a cookie reward.', toggle: true};
|
CM.Data.Config.TooltipPlots = {type: 'bool', group: 'Tooltip', label: ['Garden Plots Tooltip OFF', 'Garden Plots Tooltip ON'], desc: 'Shows a tooltip for plants that have a cookie reward.', toggle: true};
|
||||||
CM.Data.Config.DragonAuraInfo = {type: 'bool', group: 'Tooltip', label: ['Extra Dragon Aura Info OFF', 'Extra Dragon Aura Info ON'], desc: 'Shows information about changes in CPS and costs in the dragon aura interface.', toggle: true};
|
CM.Data.Config.DragonAuraInfo = {type: 'bool', group: 'Tooltip', label: ['Extra Dragon Aura Info OFF', 'Extra Dragon Aura Info ON'], desc: 'Shows information about changes in CPS and costs in the dragon aura interface.', toggle: true};
|
||||||
CM.Data.Config.TooltipAscendButton = {type: 'bool', group: 'Tooltip', label: ['Show Time Left Ascend Tooltip OFF', 'Show Time Left Ascend Tooltip ON'], desc: 'Shows the time left in the ascend tooltip until next heavenly cookie.', toggle: true};
|
CM.Data.Config.TooltipAscendButton = {type: 'bool', group: 'Tooltip', label: ['Show Extra Info Ascend Tooltip OFF', 'Show Extra Info Ascend Tooltip ON'], desc: 'Shows additional info in the ascend tooltip', toggle: true};
|
||||||
|
|
||||||
// Statistics
|
// Statistics
|
||||||
CM.Data.Config.Stats = {type: 'bool', group: 'Statistics', label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra Cookie Monster statistics!', toggle: true};
|
CM.Data.Config.Stats = {type: 'bool', group: 'Statistics', label: ['Statistics OFF', 'Statistics ON'], desc: 'Extra Cookie Monster statistics!', toggle: true};
|
||||||
@@ -232,12 +232,14 @@ CM.Data.Config.UpStats = {type: 'bool', group: 'Statistics', label: ['Statistics
|
|||||||
CM.Data.Config.TimeFormat = {type: 'bool', group: 'Statistics', label: ['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'], desc: 'Change the time format', toggle: false};
|
CM.Data.Config.TimeFormat = {type: 'bool', group: 'Statistics', label: ['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'], desc: 'Change the time format', toggle: false};
|
||||||
CM.Data.Config.DetailedTime = {type: 'bool', group: 'Statistics', label: ['Detailed Time OFF', 'Detailed Time ON'], desc: 'Change how time is displayed in certain statistics and tooltips', toggle: true, func: function() {CM.Disp.ToggleDetailedTime();}};
|
CM.Data.Config.DetailedTime = {type: 'bool', group: 'Statistics', label: ['Detailed Time OFF', 'Detailed Time ON'], desc: 'Change how time is displayed in certain statistics and tooltips', toggle: true, func: function() {CM.Disp.ToggleDetailedTime();}};
|
||||||
CM.Data.Config.GrimoireBar = {type: 'bool', group: 'Statistics', label: ['Grimoire Magic Meter Timer OFF', 'Grimoire Magic Meter Timer ON'], desc: 'A timer on how long before the Grimoire magic meter is full', toggle: true};
|
CM.Data.Config.GrimoireBar = {type: 'bool', group: 'Statistics', label: ['Grimoire Magic Meter Timer OFF', 'Grimoire Magic Meter Timer ON'], desc: 'A timer on how long before the Grimoire magic meter is full', toggle: true};
|
||||||
|
CM.Data.Config.HeavenlyChipsTarget = {type: 'numscale', group: 'Statistics', label: 'Heavenly Chips Target: ', desc: 'Use this to set a Heavenly Chips target that will be counted towards in the "prestige" statsistics sections', min: 1, max: Infinity};
|
||||||
|
CM.Data.Config.ShowMissedGC = {type: 'bool', group: 'Statistics', label: ['Missed GC OFF', 'Missed GC ON'], desc: 'Show a stat in the statistics screen that counts how many Golden Cookies you have missed', toggle: true};
|
||||||
|
|
||||||
// Notation
|
// Notation
|
||||||
CM.Data.Config.Scale = {type: 'bool', group: 'Notation', label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Short Scale (Abbreviated)', 'Scientific Notation', 'Engineering Notation'], desc: 'Change how long numbers are handled', toggle: false, func: function() {CM.Disp.RefreshScale();}};
|
CM.Data.Config.Scale = {type: 'bool', group: 'Notation', label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', 'Short Scale (Abbreviated)', 'Scientific Notation', 'Engineering Notation'], desc: 'Change how long numbers are handled', toggle: false, func: function() {CM.Disp.RefreshScale();}};
|
||||||
CM.Data.Config.ScaleDecimals = {type: 'bool', group: 'Notation', label: ['1 decimals', '2 decimals', '3 decimals'], desc: 'Set the number of decimals used when applicable', toggle: false, func: function() {CM.Disp.RefreshScale();}};
|
CM.Data.Config.ScaleDecimals = {type: 'bool', group: 'Notation', label: ['1 decimals', '2 decimals', '3 decimals'], desc: 'Set the number of decimals used when applicable', toggle: false, func: function() {CM.Disp.RefreshScale();}};
|
||||||
CM.Data.Config.ScaleSeparator = {type: 'bool', group: 'Notation', label: ['. for decimals (Standard)', '. for thousands'], desc: 'Set the separator used for decimals and thousands', toggle: false, func: function() {CM.Disp.RefreshScale();}};
|
CM.Data.Config.ScaleSeparator = {type: 'bool', group: 'Notation', label: ['. for decimals (Standard)', '. for thousands'], desc: 'Set the separator used for decimals and thousands', toggle: false, func: function() {CM.Disp.RefreshScale();}};
|
||||||
CM.Data.Config.ScaleCutoff = {type: 'numscale', group: 'Notation', label: 'Notation Cut-off Point', desc: 'The number from which CookieMonster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations.', min: 1, max: 999999999};
|
CM.Data.Config.ScaleCutoff = {type: 'numscale', group: 'Notation', label: 'Notation Cut-off Point: ', desc: 'The number from which CookieMonster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations', min: 1, max: 999999999};
|
||||||
|
|
||||||
// Miscellaneous
|
// Miscellaneous
|
||||||
CM.Data.Config.GCTimer = {type: 'bool', group: 'Miscellaneous', label: ['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'], desc: 'A timer on the Golden Cookie when it has been spawned', toggle: true, func: function() {CM.Disp.ToggleGCTimer();}};
|
CM.Data.Config.GCTimer = {type: 'bool', group: 'Miscellaneous', label: ['Golden Cookie Timer OFF', 'Golden Cookie Timer ON'], desc: 'A timer on the Golden Cookie when it has been spawned', toggle: true, func: function() {CM.Disp.ToggleGCTimer();}};
|
||||||
@@ -321,6 +323,8 @@ CM.Data.ConfigDefault = {
|
|||||||
TimeFormat: 0,
|
TimeFormat: 0,
|
||||||
DetailedTime: 1,
|
DetailedTime: 1,
|
||||||
GrimoireBar: 1,
|
GrimoireBar: 1,
|
||||||
|
HeavenlyChipsTarget: 1,
|
||||||
|
ShowMissedGC: 1,
|
||||||
Scale: 2,
|
Scale: 2,
|
||||||
ScaleDecimals: 2,
|
ScaleDecimals: 2,
|
||||||
ScaleSeparator: 0,
|
ScaleSeparator: 0,
|
||||||
|
|||||||
19
src/Disp.js
19
src/Disp.js
@@ -2342,7 +2342,9 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
}
|
}
|
||||||
if (fortunes.length != 0) stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Fortune Upgrades Left to Buy', CM.Disp.CreateStatsMissDisp(fortunes)));
|
if (fortunes.length != 0) stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Fortune Upgrades Left to Buy', CM.Disp.CreateStatsMissDisp(fortunes)));
|
||||||
}
|
}
|
||||||
stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Missed Golden Cookies', document.createTextNode(Beautify(Game.missedGoldenClicks))));
|
if (CM.Options.ShowMissedGC) {
|
||||||
|
stats.appendChild(CM.Disp.CreateStatsListing("basic", 'Missed Golden Cookies', document.createTextNode(Beautify(Game.missedGoldenClicks))));
|
||||||
|
}
|
||||||
if (Game.prefs.autosave) {
|
if (Game.prefs.autosave) {
|
||||||
let timer = document.createElement('span');
|
let timer = document.createElement('span');
|
||||||
timer.id = 'CMStatsAutosaveTimer';
|
timer.id = 'CMStatsAutosaveTimer';
|
||||||
@@ -2367,7 +2369,7 @@ CM.Disp.AddMenuStats = function(title) {
|
|||||||
*/
|
*/
|
||||||
CM.Disp.CreateStatsHeader = function(text, config) {
|
CM.Disp.CreateStatsHeader = function(text, config) {
|
||||||
let div = document.createElement('div');
|
let div = document.createElement('div');
|
||||||
div.className = 'listing';
|
div.className = 'title';
|
||||||
div.style.padding = '5px 16px';
|
div.style.padding = '5px 16px';
|
||||||
div.style.opacity = '0.7';
|
div.style.opacity = '0.7';
|
||||||
div.style.fontSize = '17px';
|
div.style.fontSize = '17px';
|
||||||
@@ -2408,6 +2410,7 @@ CM.Disp.CreateStatsListing = function(type, name, text, placeholder) {
|
|||||||
div.appendChild(listingName);
|
div.appendChild(listingName);
|
||||||
if (type === "withTooltip") {
|
if (type === "withTooltip") {
|
||||||
div.className = 'listing';
|
div.className = 'listing';
|
||||||
|
div.appendChild(document.createTextNode(' '));
|
||||||
|
|
||||||
let tooltip = document.createElement('span');
|
let tooltip = document.createElement('span');
|
||||||
tooltip.onmouseout = function() { Game.tooltip.hide(); };
|
tooltip.onmouseout = function() { Game.tooltip.hide(); };
|
||||||
@@ -2424,7 +2427,6 @@ CM.Disp.CreateStatsListing = function(type, name, text, placeholder) {
|
|||||||
tooltip.style.verticalAlign = 'bottom';
|
tooltip.style.verticalAlign = 'bottom';
|
||||||
tooltip.textContent = '?';
|
tooltip.textContent = '?';
|
||||||
div.appendChild(tooltip);
|
div.appendChild(tooltip);
|
||||||
div.appendChild(document.createTextNode(' '));
|
|
||||||
}
|
}
|
||||||
div.appendChild(document.createTextNode(': '));
|
div.appendChild(document.createTextNode(': '));
|
||||||
div.appendChild(text);
|
div.appendChild(text);
|
||||||
@@ -2693,6 +2695,17 @@ CM.Disp.CreateStatsPrestigeSection = function() {
|
|||||||
|
|
||||||
section.appendChild(CM.Disp.CreateStatsListing("withTooltip", 'Heavenly Chips (CUR / MAX)', document.createTextNode(Beautify(Game.heavenlyChips) + ' / ' + Beautify((possiblePresMax - Game.prestige) + Game.heavenlyChips)), 'HeavenChipMaxTooltipPlaceholder'));
|
section.appendChild(CM.Disp.CreateStatsListing("withTooltip", 'Heavenly Chips (CUR / MAX)', document.createTextNode(Beautify(Game.heavenlyChips) + ' / ' + Beautify((possiblePresMax - Game.prestige) + Game.heavenlyChips)), 'HeavenChipMaxTooltipPlaceholder'));
|
||||||
|
|
||||||
|
section.appendChild(CM.Disp.CreateStatsListing("basic", 'Heavenly Chips Per Second (last 5 seconds)', document.createTextNode(Beautify(CM.Cache.HCPerSecond, 2))));
|
||||||
|
|
||||||
|
let HCTarget = Number(CM.Options.HeavenlyChipsTarget)
|
||||||
|
if (!isNaN(HCTarget)) {
|
||||||
|
let CookiesTillTarget = HCTarget - Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned))
|
||||||
|
if (CookiesTillTarget > 0) {
|
||||||
|
section.appendChild(CM.Disp.CreateStatsListing("basic", 'Heavenly Chips To Target Set In Settings (CUR)', document.createTextNode(Beautify(CookiesTillTarget))));
|
||||||
|
section.appendChild(CM.Disp.CreateStatsListing("basic", 'Time To Target (CUR, Current 5 Second Average)', document.createTextNode(CM.Disp.FormatTime(CookiesTillTarget / CM.Cache.HCPerSecond))));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let resetBonus = CM.Sim.ResetBonus(possiblePresMax);
|
let resetBonus = CM.Sim.ResetBonus(possiblePresMax);
|
||||||
let resetFrag = document.createDocumentFragment();
|
let resetFrag = document.createDocumentFragment();
|
||||||
resetFrag.appendChild(document.createTextNode(Beautify(resetBonus)));
|
resetFrag.appendChild(document.createTextNode(Beautify(resetBonus)));
|
||||||
|
|||||||
10
src/Main.js
10
src/Main.js
@@ -197,9 +197,13 @@ CM.Main.ReplaceNative = function() {
|
|||||||
|
|
||||||
// Since the Ascend Tooltip is not actually a tooltip we need to add our additional info here...
|
// Since the Ascend Tooltip is not actually a tooltip we need to add our additional info here...
|
||||||
CM.Backup.Logic = Game.Logic;
|
CM.Backup.Logic = Game.Logic;
|
||||||
eval('CM.Backup.LogicMod = ' + Game.Logic.toString()
|
CM.Backup.LogicMod = new Function(
|
||||||
.split('document.title').join('CM.Disp.Title')
|
`return ${Game.Logic.toString()
|
||||||
.split("' more cookies</b> for the next level.<br>';").join("` more cookies</b> for the next level.<br>${CM.Options.TooltipAscendButton ? `<div class='line'></div>You need ${CM.Cache.TimeTillNextPrestige} for the next level.<br>` : ``}`;"));
|
.split('document.title')
|
||||||
|
.join('CM.Disp.Title')
|
||||||
|
.split("' more cookies</b> for the next level.<br>';")
|
||||||
|
.join("` more cookies</b> for the next level.<br>${CM.Options.TooltipAscendButton ? `<div class='line'></div>It takes ${CM.Cache.TimeTillNextPrestige} to reach the next level and you are making ${Beautify(CM.Cache.HCPerSecond, 2)} chips on average in the last 5 seconds.<br>` : ``}`;")}`,
|
||||||
|
)();
|
||||||
Game.Logic = function() {
|
Game.Logic = function() {
|
||||||
CM.Backup.LogicMod();
|
CM.Backup.LogicMod();
|
||||||
// Update Title
|
// Update Title
|
||||||
|
|||||||
Reference in New Issue
Block a user