diff --git a/CookieMonster.js b/CookieMonster.js index e4c1031..fc68285 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -554,6 +554,13 @@ for (var i = 0; i < 101; i++) { CM.ConfigData.GCSoundURL = {label: 'Golden Cookie Sound URL:', desc: 'URL of the sound to be played when a Golden Cookie spawns'}; CM.ConfigData.GCTimer = {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.ConfigData.Favicon = {label: ['Favicon OFF', 'Favicon ON'], desc: 'Update favicon with Golden/Wrath Cookie', toggle: true, func: function() {CM.Disp.UpdateFavicon();}}; +CM.ConfigData.FortuneFlash = {label: ['Fortune Cookie Flash OFF', 'Fortune Cookie Flash ON'], desc: 'Flash screen on Fortune Cookie', toggle: true}; +CM.ConfigData.FortuneSound = {label: ['Fortune Cookie Sound OFF', 'Fortune Cookie Sound ON'], desc: 'Play a sound on Fortune Cookie', toggle: true}; +CM.ConfigData.FortuneVolume = {label: [], desc: 'Volume of the Fortune Cookie sound'}; +for (var i = 0; i < 101; i++) { + CM.ConfigData.FortuneVolume.label[i] = i + '%'; +} +CM.ConfigData.FortuneSoundURL = {label: 'Fortune Cookie Sound URL:', desc: 'URL of the sound to be played when the Ticker has a Fortune Cookie'}; CM.ConfigData.SeaFlash = {label: ['Season Special Flash OFF', 'Season Special Flash ON'], desc: 'Flash screen on Season Popup', toggle: true}; CM.ConfigData.SeaSound = {label: ['Season Special Sound OFF', 'Season Special Sound ON'], desc: 'Play a sound on Season Popup', toggle: true}; CM.ConfigData.SeaVolume = {label: [], desc: 'Volume of the Season Special sound'}; @@ -586,6 +593,30 @@ CM.ConfigData.Scale = {label: ['Game\'s Setting Scale', 'Metric', 'Short Scale', * Data * ********/ +CM.Data.Fortunes = [ + 'Fortune #001', + 'Fortune #002', + 'Fortune #003', + 'Fortune #004', + 'Fortune #005', + 'Fortune #006', + 'Fortune #007', + 'Fortune #008', + 'Fortune #009', + 'Fortune #010', + 'Fortune #011', + 'Fortune #012', + 'Fortune #013', + 'Fortune #014', + 'Fortune #015', + 'Fortune #016', + 'Fortune #017', + 'Fortune #100', + 'Fortune #101', + 'Fortune #102', + 'Fortune #103', + 'Fortune #104' +]; 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.ValCookies = ['Pure heart biscuits', 'Ardent heart biscuits', 'Sour heart biscuits', 'Weeping heart biscuits', 'Golden heart biscuits', 'Eternal heart biscuits']; @@ -1461,6 +1492,15 @@ CM.Disp.CheckGoldenCookie = function() { } } +CM.Disp.CheckTickerFortune = function() { + if (CM.Disp.lastTickerFortuneState != (Game.TickerEffect && Game.TickerEffect.type == 'fortune')) { + CM.Disp.lastTickerFortuneState = (Game.TickerEffect && Game.TickerEffect.type == 'fortune'); + if (CM.Disp.lastTickerFortuneState) { + CM.Disp.Flash(3, 'FortuneFlash'); + CM.Disp.PlaySound(CM.Config.FortuneSoundURL, 'FortuneSound', 'FortuneVolume'); + } + } +} CM.Disp.CheckSeasonPopup = function() { if (CM.Disp.lastSeasonPopupState != Game.shimmerTypes['reindeer'].spawned) { @@ -1495,9 +1535,11 @@ CM.Disp.UpdateTitle = function() { document.title = CM.Cache.Title; } else if (CM.Config.Title == 1) { + var addFC = false; var addSP = false; var titleGC; + var titleFC; var titleSP; if (CM.Disp.lastGoldenCookieState) { if (CM.Disp.goldenShimmer.wrath) { @@ -1513,6 +1555,10 @@ CM.Disp.UpdateTitle = function() { else { titleGC = '[GS]' } + if (CM.Disp.lastTickerFortuneState) { + addFC = true; + titleFC = '[F]'; + } if (Game.season == 'christmas') { addSP = true; if (CM.Disp.lastSeasonPopupState) { @@ -1528,7 +1574,7 @@ CM.Disp.UpdateTitle = function() { str = str.substring(str.lastIndexOf(']') + 1); } - document.title = titleGC + (addSP ? titleSP : '') + ' ' + str; + document.title = titleGC + (addFC ? titleFC : '') + (addSP ? titleSP : '') + ' ' + str; } else if (CM.Config.Title == 2) { var str = ''; @@ -1542,6 +1588,10 @@ CM.Disp.UpdateTitle = function() { str += '[G ' + Math.ceil(CM.Disp.goldenShimmer.life / Game.fps) + ']'; } } + if (CM.Disp.lastTickerFortuneState) { + spawn = true; + str += '[F]'; + } if (Game.season == 'christmas' && CM.Disp.lastSeasonPopupState) { str += '[R ' + Math.ceil(CM.Disp.seasonPopShimmer.life / Game.fps) + ']'; spawn = true; @@ -1704,6 +1754,10 @@ CM.Disp.AddMenuPref = function(title) { frag.appendChild(url('GCSoundURL')); frag.appendChild(listing('GCTimer')); frag.appendChild(listing('Favicon')); + frag.appendChild(listing('FortuneFlash')); + frag.appendChild(listing('FortuneSound')); + frag.appendChild(vol('FortuneVolume')); + frag.appendChild(url('FortuneSoundURL')); frag.appendChild(listing('SeaFlash')); frag.appendChild(listing('SeaSound')); frag.appendChild(vol('SeaVolume')); @@ -1810,6 +1864,45 @@ CM.Disp.AddMenuStats = function(title) { frag.appendChild(span); return frag; } + + var createMissDisp = function(theMissDisp) { + var frag = document.createDocumentFragment(); + frag.appendChild(document.createTextNode(theMissDisp.length + ' ')); + var span = document.createElement('span'); + span.onmouseout = function() { Game.tooltip.hide(); }; + var placeholder = document.createElement('div'); + var missing = document.createElement('div'); + missing.style.minWidth = '140px'; + missing.style.marginBottom = '4px'; + var title = document.createElement('div'); + title.className = 'name'; + title.style.marginBottom = '4px'; + title.style.textAlign = 'center'; + title.textContent = 'Missing'; + missing.appendChild(title); + for (var i in theMissDisp) { + var div = document.createElement('div'); + div.style.textAlign = 'center'; + div.appendChild(document.createTextNode(theMissDisp[i])); + missing.appendChild(div); + } + placeholder.appendChild(missing); + span.onmouseover = function() {Game.tooltip.draw(this, escape(placeholder.innerHTML));}; + span.style.cursor = 'default'; + span.style.display = 'inline-block'; + span.style.height = '10px'; + span.style.width = '10px'; + span.style.borderRadius = '5px'; + span.style.textAlign = 'center'; + span.style.backgroundColor = '#C0C0C0'; + span.style.color = 'black'; + span.style.fontSize = '9px'; + span.style.verticalAlign = 'bottom'; + span.textContent = '?'; + frag.appendChild(span); + return frag; + } + stats.appendChild(header('Lucky Cookies', 'Lucky')); if (CM.Config.StatsPref.Lucky) { @@ -2037,48 +2130,11 @@ CM.Disp.AddMenuStats = function(title) { stats.appendChild(header('Season Specials', 'Sea')); if (CM.Config.StatsPref.Sea) { if (specDisp) { - var createSpecDisp = function(theSpecDisp) { - var frag = document.createDocumentFragment(); - frag.appendChild(document.createTextNode(theSpecDisp.length + ' ')); - var span = document.createElement('span'); - span.onmouseout = function() { Game.tooltip.hide(); }; - var placeholder = document.createElement('div'); - var missing = document.createElement('div'); - missing.style.minWidth = '140px'; - missing.style.marginBottom = '4px'; - var title = document.createElement('div'); - title.className = 'name'; - title.style.marginBottom = '4px'; - title.style.textAlign = 'center'; - title.textContent = 'Missing'; - missing.appendChild(title); - for (var i in theSpecDisp) { - var div = document.createElement('div'); - div.style.textAlign = 'center'; - div.appendChild(document.createTextNode(theSpecDisp[i])); - missing.appendChild(div); - } - placeholder.appendChild(missing); - span.onmouseover = function() {Game.tooltip.draw(this, escape(placeholder.innerHTML));}; - span.style.cursor = 'default'; - span.style.display = 'inline-block'; - span.style.height = '10px'; - span.style.width = '10px'; - span.style.borderRadius = '5px'; - span.style.textAlign = 'center'; - span.style.backgroundColor = '#C0C0C0'; - span.style.color = 'black'; - span.style.fontSize = '9px'; - span.style.verticalAlign = 'bottom'; - span.textContent = '?'; - frag.appendChild(span); - return frag; - } - if (halloCook.length != 0) stats.appendChild(listing('Halloween Cookies Left to Buy', createSpecDisp(halloCook))); - if (christCook.length != 0) stats.appendChild(listing('Christmas Cookies Left to Buy', createSpecDisp(christCook))); - if (valCook.length != 0) stats.appendChild(listing('Valentine Cookies Left to Buy', createSpecDisp(valCook))); - if (normEggs.length != 0) stats.appendChild(listing('Normal Easter Eggs Left to Unlock', createSpecDisp(normEggs))); - if (rareEggs.length != 0) stats.appendChild(listing('Rare Easter Eggs Left to Unlock', createSpecDisp(rareEggs))); + if (halloCook.length != 0) stats.appendChild(listing('Halloween Cookies Left to Buy', createMissDisp(halloCook))); + if (christCook.length != 0) stats.appendChild(listing('Christmas Cookies Left to Buy', createMissDisp(christCook))); + if (valCook.length != 0) stats.appendChild(listing('Valentine Cookies Left to Buy', createMissDisp(valCook))); + if (normEggs.length != 0) stats.appendChild(listing('Normal Easter Eggs Left to Unlock', createMissDisp(normEggs))); + if (rareEggs.length != 0) stats.appendChild(listing('Rare Easter Eggs Left to Unlock', createMissDisp(rareEggs))); } if (Game.season == 'christmas') stats.appendChild(listing('Reindeer Reward', document.createTextNode(Beautify(CM.Cache.SeaSpec)))); @@ -2098,6 +2154,15 @@ CM.Disp.AddMenuStats = function(title) { document.createTextNode(Beautify(CM.Cache.AvgCPS, 3)) )); stats.appendChild(listing('Average Cookie Clicks Per Second (Past ' + CM.Disp.clickTimes[CM.Config.AvgClicksHist] + (CM.Config.AvgClicksHist == 0 ? ' second' : ' seconds') + ')', document.createTextNode(Beautify(CM.Cache.AvgClicks, 1)))); + if (Game.Has('Fortune cookies')) { + var fortunes = []; + for (var i in CM.Data.Fortunes) { + if (!Game.Has(CM.Data.Fortunes[i])) { + fortunes.push(CM.Data.Fortunes[i]); + } + } + if (fortunes.length != 0) stats.appendChild(listing('Fortune Upgrades Left to Buy', createMissDisp(fortunes))); + } stats.appendChild(listing('Missed Golden Cookies', document.createTextNode(Beautify(Game.missedGoldenClicks)))); } @@ -2623,6 +2688,7 @@ CM.Disp.colorBrown = 'Brown'; CM.Disp.colors = [CM.Disp.colorBlue, CM.Disp.colorGreen, CM.Disp.colorYellow, CM.Disp.colorOrange, CM.Disp.colorRed, CM.Disp.colorPurple, CM.Disp.colorGray, CM.Disp.colorPink, CM.Disp.colorBrown]; CM.Disp.buffColors = {'Frenzy': CM.Disp.colorYellow, 'Dragon Harvest': CM.Disp.colorBrown, 'Elder frenzy': CM.Disp.colorGreen, 'Clot': CM.Disp.colorRed, 'Click frenzy': CM.Disp.colorBlue, 'Dragonflight': CM.Disp.colorPink}; CM.Disp.lastGoldenCookieState = 0; +CM.Disp.lastTickerFortuneState = 0; CM.Disp.lastSeasonPopupState = 0; CM.Disp.lastGardenNextStep = 0; CM.Disp.goldenShimmer; @@ -2839,6 +2905,9 @@ CM.Loop = function() { // Check Golden Cookies CM.Disp.CheckGoldenCookie(); + // Check Fortune Cookies + CM.Disp.CheckTickerFortune(); + // Check Season Popup CM.Disp.CheckSeasonPopup(); @@ -2919,6 +2988,10 @@ CM.ConfigDefault = { GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3', GCTimer: 1, Favicon: 1, + FortuneFlash: 1, + FortuneSound: 1, + FortuneVolume: 100, + FortuneSoundURL: 'https://freesound.org/data/previews/174/174027_3242494-lq.mp3', SeaFlash: 1, SeaSound: 1, SeaVolume: 100, @@ -2946,7 +3019,7 @@ CM.ConfigDefault = { CM.ConfigPrefix = 'CMConfig'; CM.VersionMajor = '2.021'; -CM.VersionMinor = '1'; +CM.VersionMinor = '2'; /******* * Sim * diff --git a/src/Config.js b/src/Config.js index 63c6b18..1598ebf 100644 --- a/src/Config.js +++ b/src/Config.js @@ -148,6 +148,13 @@ for (var i = 0; i < 101; i++) { CM.ConfigData.GCSoundURL = {label: 'Golden Cookie Sound URL:', desc: 'URL of the sound to be played when a Golden Cookie spawns'}; CM.ConfigData.GCTimer = {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.ConfigData.Favicon = {label: ['Favicon OFF', 'Favicon ON'], desc: 'Update favicon with Golden/Wrath Cookie', toggle: true, func: function() {CM.Disp.UpdateFavicon();}}; +CM.ConfigData.FortuneFlash = {label: ['Fortune Cookie Flash OFF', 'Fortune Cookie Flash ON'], desc: 'Flash screen on Fortune Cookie', toggle: true}; +CM.ConfigData.FortuneSound = {label: ['Fortune Cookie Sound OFF', 'Fortune Cookie Sound ON'], desc: 'Play a sound on Fortune Cookie', toggle: true}; +CM.ConfigData.FortuneVolume = {label: [], desc: 'Volume of the Fortune Cookie sound'}; +for (var i = 0; i < 101; i++) { + CM.ConfigData.FortuneVolume.label[i] = i + '%'; +} +CM.ConfigData.FortuneSoundURL = {label: 'Fortune Cookie Sound URL:', desc: 'URL of the sound to be played when the Ticker has a Fortune Cookie'}; CM.ConfigData.SeaFlash = {label: ['Season Special Flash OFF', 'Season Special Flash ON'], desc: 'Flash screen on Season Popup', toggle: true}; CM.ConfigData.SeaSound = {label: ['Season Special Sound OFF', 'Season Special Sound ON'], desc: 'Play a sound on Season Popup', toggle: true}; CM.ConfigData.SeaVolume = {label: [], desc: 'Volume of the Season Special sound'}; diff --git a/src/Data.js b/src/Data.js index 84571d8..4202c89 100644 --- a/src/Data.js +++ b/src/Data.js @@ -2,6 +2,30 @@ * Data * ********/ +CM.Data.Fortunes = [ + 'Fortune #001', + 'Fortune #002', + 'Fortune #003', + 'Fortune #004', + 'Fortune #005', + 'Fortune #006', + 'Fortune #007', + 'Fortune #008', + 'Fortune #009', + 'Fortune #010', + 'Fortune #011', + 'Fortune #012', + 'Fortune #013', + 'Fortune #014', + 'Fortune #015', + 'Fortune #016', + 'Fortune #017', + 'Fortune #100', + 'Fortune #101', + 'Fortune #102', + 'Fortune #103', + 'Fortune #104' +]; 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.ValCookies = ['Pure heart biscuits', 'Ardent heart biscuits', 'Sour heart biscuits', 'Weeping heart biscuits', 'Golden heart biscuits', 'Eternal heart biscuits']; diff --git a/src/Disp.js b/src/Disp.js index f5b4e35..fcb1d2d 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -869,6 +869,15 @@ CM.Disp.CheckGoldenCookie = function() { } } +CM.Disp.CheckTickerFortune = function() { + if (CM.Disp.lastTickerFortuneState != (Game.TickerEffect && Game.TickerEffect.type == 'fortune')) { + CM.Disp.lastTickerFortuneState = (Game.TickerEffect && Game.TickerEffect.type == 'fortune'); + if (CM.Disp.lastTickerFortuneState) { + CM.Disp.Flash(3, 'FortuneFlash'); + CM.Disp.PlaySound(CM.Config.FortuneSoundURL, 'FortuneSound', 'FortuneVolume'); + } + } +} CM.Disp.CheckSeasonPopup = function() { if (CM.Disp.lastSeasonPopupState != Game.shimmerTypes['reindeer'].spawned) { @@ -903,9 +912,11 @@ CM.Disp.UpdateTitle = function() { document.title = CM.Cache.Title; } else if (CM.Config.Title == 1) { + var addFC = false; var addSP = false; var titleGC; + var titleFC; var titleSP; if (CM.Disp.lastGoldenCookieState) { if (CM.Disp.goldenShimmer.wrath) { @@ -921,6 +932,10 @@ CM.Disp.UpdateTitle = function() { else { titleGC = '[GS]' } + if (CM.Disp.lastTickerFortuneState) { + addFC = true; + titleFC = '[F]'; + } if (Game.season == 'christmas') { addSP = true; if (CM.Disp.lastSeasonPopupState) { @@ -936,7 +951,7 @@ CM.Disp.UpdateTitle = function() { str = str.substring(str.lastIndexOf(']') + 1); } - document.title = titleGC + (addSP ? titleSP : '') + ' ' + str; + document.title = titleGC + (addFC ? titleFC : '') + (addSP ? titleSP : '') + ' ' + str; } else if (CM.Config.Title == 2) { var str = ''; @@ -950,6 +965,10 @@ CM.Disp.UpdateTitle = function() { str += '[G ' + Math.ceil(CM.Disp.goldenShimmer.life / Game.fps) + ']'; } } + if (CM.Disp.lastTickerFortuneState) { + spawn = true; + str += '[F]'; + } if (Game.season == 'christmas' && CM.Disp.lastSeasonPopupState) { str += '[R ' + Math.ceil(CM.Disp.seasonPopShimmer.life / Game.fps) + ']'; spawn = true; @@ -1112,6 +1131,10 @@ CM.Disp.AddMenuPref = function(title) { frag.appendChild(url('GCSoundURL')); frag.appendChild(listing('GCTimer')); frag.appendChild(listing('Favicon')); + frag.appendChild(listing('FortuneFlash')); + frag.appendChild(listing('FortuneSound')); + frag.appendChild(vol('FortuneVolume')); + frag.appendChild(url('FortuneSoundURL')); frag.appendChild(listing('SeaFlash')); frag.appendChild(listing('SeaSound')); frag.appendChild(vol('SeaVolume')); @@ -1218,6 +1241,45 @@ CM.Disp.AddMenuStats = function(title) { frag.appendChild(span); return frag; } + + var createMissDisp = function(theMissDisp) { + var frag = document.createDocumentFragment(); + frag.appendChild(document.createTextNode(theMissDisp.length + ' ')); + var span = document.createElement('span'); + span.onmouseout = function() { Game.tooltip.hide(); }; + var placeholder = document.createElement('div'); + var missing = document.createElement('div'); + missing.style.minWidth = '140px'; + missing.style.marginBottom = '4px'; + var title = document.createElement('div'); + title.className = 'name'; + title.style.marginBottom = '4px'; + title.style.textAlign = 'center'; + title.textContent = 'Missing'; + missing.appendChild(title); + for (var i in theMissDisp) { + var div = document.createElement('div'); + div.style.textAlign = 'center'; + div.appendChild(document.createTextNode(theMissDisp[i])); + missing.appendChild(div); + } + placeholder.appendChild(missing); + span.onmouseover = function() {Game.tooltip.draw(this, escape(placeholder.innerHTML));}; + span.style.cursor = 'default'; + span.style.display = 'inline-block'; + span.style.height = '10px'; + span.style.width = '10px'; + span.style.borderRadius = '5px'; + span.style.textAlign = 'center'; + span.style.backgroundColor = '#C0C0C0'; + span.style.color = 'black'; + span.style.fontSize = '9px'; + span.style.verticalAlign = 'bottom'; + span.textContent = '?'; + frag.appendChild(span); + return frag; + } + stats.appendChild(header('Lucky Cookies', 'Lucky')); if (CM.Config.StatsPref.Lucky) { @@ -1445,48 +1507,11 @@ CM.Disp.AddMenuStats = function(title) { stats.appendChild(header('Season Specials', 'Sea')); if (CM.Config.StatsPref.Sea) { if (specDisp) { - var createSpecDisp = function(theSpecDisp) { - var frag = document.createDocumentFragment(); - frag.appendChild(document.createTextNode(theSpecDisp.length + ' ')); - var span = document.createElement('span'); - span.onmouseout = function() { Game.tooltip.hide(); }; - var placeholder = document.createElement('div'); - var missing = document.createElement('div'); - missing.style.minWidth = '140px'; - missing.style.marginBottom = '4px'; - var title = document.createElement('div'); - title.className = 'name'; - title.style.marginBottom = '4px'; - title.style.textAlign = 'center'; - title.textContent = 'Missing'; - missing.appendChild(title); - for (var i in theSpecDisp) { - var div = document.createElement('div'); - div.style.textAlign = 'center'; - div.appendChild(document.createTextNode(theSpecDisp[i])); - missing.appendChild(div); - } - placeholder.appendChild(missing); - span.onmouseover = function() {Game.tooltip.draw(this, escape(placeholder.innerHTML));}; - span.style.cursor = 'default'; - span.style.display = 'inline-block'; - span.style.height = '10px'; - span.style.width = '10px'; - span.style.borderRadius = '5px'; - span.style.textAlign = 'center'; - span.style.backgroundColor = '#C0C0C0'; - span.style.color = 'black'; - span.style.fontSize = '9px'; - span.style.verticalAlign = 'bottom'; - span.textContent = '?'; - frag.appendChild(span); - return frag; - } - if (halloCook.length != 0) stats.appendChild(listing('Halloween Cookies Left to Buy', createSpecDisp(halloCook))); - if (christCook.length != 0) stats.appendChild(listing('Christmas Cookies Left to Buy', createSpecDisp(christCook))); - if (valCook.length != 0) stats.appendChild(listing('Valentine Cookies Left to Buy', createSpecDisp(valCook))); - if (normEggs.length != 0) stats.appendChild(listing('Normal Easter Eggs Left to Unlock', createSpecDisp(normEggs))); - if (rareEggs.length != 0) stats.appendChild(listing('Rare Easter Eggs Left to Unlock', createSpecDisp(rareEggs))); + if (halloCook.length != 0) stats.appendChild(listing('Halloween Cookies Left to Buy', createMissDisp(halloCook))); + if (christCook.length != 0) stats.appendChild(listing('Christmas Cookies Left to Buy', createMissDisp(christCook))); + if (valCook.length != 0) stats.appendChild(listing('Valentine Cookies Left to Buy', createMissDisp(valCook))); + if (normEggs.length != 0) stats.appendChild(listing('Normal Easter Eggs Left to Unlock', createMissDisp(normEggs))); + if (rareEggs.length != 0) stats.appendChild(listing('Rare Easter Eggs Left to Unlock', createMissDisp(rareEggs))); } if (Game.season == 'christmas') stats.appendChild(listing('Reindeer Reward', document.createTextNode(Beautify(CM.Cache.SeaSpec)))); @@ -1506,6 +1531,15 @@ CM.Disp.AddMenuStats = function(title) { document.createTextNode(Beautify(CM.Cache.AvgCPS, 3)) )); stats.appendChild(listing('Average Cookie Clicks Per Second (Past ' + CM.Disp.clickTimes[CM.Config.AvgClicksHist] + (CM.Config.AvgClicksHist == 0 ? ' second' : ' seconds') + ')', document.createTextNode(Beautify(CM.Cache.AvgClicks, 1)))); + if (Game.Has('Fortune cookies')) { + var fortunes = []; + for (var i in CM.Data.Fortunes) { + if (!Game.Has(CM.Data.Fortunes[i])) { + fortunes.push(CM.Data.Fortunes[i]); + } + } + if (fortunes.length != 0) stats.appendChild(listing('Fortune Upgrades Left to Buy', createMissDisp(fortunes))); + } stats.appendChild(listing('Missed Golden Cookies', document.createTextNode(Beautify(Game.missedGoldenClicks)))); } @@ -2031,6 +2065,7 @@ CM.Disp.colorBrown = 'Brown'; CM.Disp.colors = [CM.Disp.colorBlue, CM.Disp.colorGreen, CM.Disp.colorYellow, CM.Disp.colorOrange, CM.Disp.colorRed, CM.Disp.colorPurple, CM.Disp.colorGray, CM.Disp.colorPink, CM.Disp.colorBrown]; CM.Disp.buffColors = {'Frenzy': CM.Disp.colorYellow, 'Dragon Harvest': CM.Disp.colorBrown, 'Elder frenzy': CM.Disp.colorGreen, 'Clot': CM.Disp.colorRed, 'Click frenzy': CM.Disp.colorBlue, 'Dragonflight': CM.Disp.colorPink}; CM.Disp.lastGoldenCookieState = 0; +CM.Disp.lastTickerFortuneState = 0; CM.Disp.lastSeasonPopupState = 0; CM.Disp.lastGardenNextStep = 0; CM.Disp.goldenShimmer; diff --git a/src/Main.js b/src/Main.js index 5ca6c15..b5a582e 100644 --- a/src/Main.js +++ b/src/Main.js @@ -186,6 +186,9 @@ CM.Loop = function() { // Check Golden Cookies CM.Disp.CheckGoldenCookie(); + // Check Fortune Cookies + CM.Disp.CheckTickerFortune(); + // Check Season Popup CM.Disp.CheckSeasonPopup(); @@ -266,6 +269,10 @@ CM.ConfigDefault = { GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3', GCTimer: 1, Favicon: 1, + FortuneFlash: 1, + FortuneSound: 1, + FortuneVolume: 100, + FortuneSoundURL: 'https://freesound.org/data/previews/174/174027_3242494-lq.mp3', SeaFlash: 1, SeaSound: 1, SeaVolume: 100, @@ -293,5 +300,5 @@ CM.ConfigDefault = { CM.ConfigPrefix = 'CMConfig'; CM.VersionMajor = '2.021'; -CM.VersionMinor = '1'; +CM.VersionMinor = '2';