diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index cf74562..2d611ee 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -12,7 +12,7 @@ jobs: run: npx eslint src - name: Run Mocha tests run: npx mocha - - name: Check if CookieMonster.js is built correctly + - name: Check if CookieMonster.js is built correctly run: | npx webpack -o ./tmp --env production if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 tmp/CookieMonster.js); then diff --git a/.mocharc.json b/.mocharc.json index 8140681..91cead1 100644 --- a/.mocharc.json +++ b/.mocharc.json @@ -1,5 +1,5 @@ { - "recursive": true, - "require": ["esm", "ts-node/register"], - "reporter": "min" -} \ No newline at end of file + "recursive": true, + "require": ["esm", "ts-node/register"], + "reporter": "min" +} diff --git a/CookieMonster.user.js b/CookieMonster.user.js index a75d648..6734c35 100644 --- a/CookieMonster.user.js +++ b/CookieMonster.user.js @@ -4,16 +4,10 @@ // ==/UserScript== const readyCheck = setInterval(() => { - const Game = unsafeWindow.Game; + const Game = unsafeWindow.Game; - if ( - typeof Game !== "undefined" && - typeof Game.ready !== "undefined" && - Game.ready - ) { - Game.LoadMod( - "https://aktanusa.github.io/CookieMonster/CookieMonster.js" - ); - clearInterval(readyCheck); - } + if (typeof Game !== 'undefined' && typeof Game.ready !== 'undefined' && Game.ready) { + Game.LoadMod('https://aktanusa.github.io/CookieMonster/CookieMonster.js'); + clearInterval(readyCheck); + } }, 1000); diff --git a/dist/CookieMonster.js b/dist/CookieMonster.js index f3d9547..a19241d 100644 --- a/dist/CookieMonster.js +++ b/dist/CookieMonster.js @@ -1,2 +1,8254 @@ /*! For license information please see CookieMonster.js.LICENSE.txt */ -(()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,i,a=((i={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",i.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?i.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),a=new RegExp("(^|\\s)("+i.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r-1},isButtonEmpty:function(e){switch(i.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={},o=arguments[2];return t[a=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={};var n=arguments[1];for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(i.dataProp))return!0;for(var t=1;t=3&&(n=l[0].match(s))&&(i=l[1].match(s))&&(a=l[2].match(s)))return o.format="rgb",o.rgba=[parseFloat(n[1])||0,parseFloat(i[1])||0,parseFloat(a[1])||0,null],l.length>=4&&(r=l[3].match(s))&&(o.format="rgba",o.rgba[3]=parseFloat(r[1])||0),o}return!1},parsePaletteValue:function(e){var t=[];"string"==typeof e?e.replace(/#[0-9A-F]{3}([0-9A-F]{3})?|rgba?\(([^)]*)\)/gi,(function(e){t.push(e)})):Array.isArray(e)&&(t=e);for(var o=[],n=0;ns[n]&&-t[n]+e[n]+l[n]/2>s[n]/2&&e[n]+l[n]-d[n]>=0?e[n]+l[n]-d[n]:e[n],-t[a]+e[a]+l[a]+d[a]-p+p*r>s[a]?-t[a]+e[a]+l[a]/2>s[a]/2&&e[a]+l[a]-p-p*r>=0?e[a]+l[a]-p-p*r:e[a]+l[a]-p+p*r:e[a]+l[a]-p+p*r>=0?e[a]+l[a]-p+p*r:e[a]+l[a]-p-p*r];else var u=[e[n],e[a]+l[a]-p+p*r];var m=u[n],h=u[a],g=o.fixed?"fixed":"absolute",f=(u[0]+d[0]>e[0]||u[0]0?Math.ceil(l/o):0,i=Math.max(1,Math.floor((t-(o-1)*e.paletteSpacing)/o)),a=e.paletteHeight?Math.min(e.paletteHeight,i):i),n&&(r=n*a+(n-1)*e.paletteSpacing),{cols:o,rows:n,cellW:i,cellH:a,width:t,height:r}},getControlPadding:function(e){return Math.max(e.padding/2,2*e.pointerBorderWidth+e.pointerThickness-e.controlBorderWidth)},getPadYChannel:function(e){switch(e.mode.charAt(1).toLowerCase()){case"v":return"v"}return"s"},getSliderChannel:function(e){if(e.mode.length>2)switch(e.mode.charAt(2).toLowerCase()){case"s":return"s";case"v":return"v"}return null},triggerCallback:function(e,t){if(e[t]){var o=null;if("string"==typeof e[t])try{o=new Function(e[t])}catch(e){console.error(e)}else o=e[t];o&&o.call(e)}},triggerGlobal:function(e){for(var t=i.getInstances(),o=0;o0)for(var c=0;c=2&&"string"==typeof arguments[0]){try{if(!a(arguments[0],arguments[1]))return!1}catch(e){return console.warn(e),!1}return this.redraw(),this.exposeColor(),!0}if(1===arguments.length&&"object"==typeof arguments[0]){var e=arguments[0],t=!0;for(var o in e)if(e.hasOwnProperty(o))try{a(o,e[o])||(t=!1)}catch(e){console.warn(e),t=!1}return this.redraw(),this.exposeColor(),t}throw new Error("Invalid arguments")},this.channel=function(e,t){if("string"!=typeof e)throw new Error("Invalid value for channel name: "+e);if(void 0===t)return this.channels.hasOwnProperty(e.toLowerCase())?this.channels[e.toLowerCase()]:(console.warn("Getting unknown channel: "+e),!1);var o=!1;switch(e.toLowerCase()){case"r":o=this.fromRGBA(t,null,null,null);break;case"g":o=this.fromRGBA(null,t,null,null);break;case"b":o=this.fromRGBA(null,null,t,null);break;case"h":o=this.fromHSVA(t,null,null,null);break;case"s":o=this.fromHSVA(null,t,null,null);break;case"v":o=this.fromHSVA(null,null,t,null);break;case"a":o=this.fromHSVA(null,null,null,t);break;default:return console.warn("Setting unknown channel: "+e),!1}return!!o&&(this.redraw(),!0)},this.trigger=function(e){for(var t=i.strList(e),o=0;o127.5},this.hide=function(){p()&&(i.removeClass(n.targetElement,i.pub.activeClassName),i.picker.wrap.parentNode.removeChild(i.picker.wrap),delete i.picker.owner)},this.show=function(){l()},this.redraw=function(){p()&&l()},this.getFormat=function(){return this._currentFormat},this._setFormat=function(e){this._currentFormat=e.toLowerCase()},this.hasAlphaChannel=function(){return"auto"===this.alphaChannel?"any"===this.format.toLowerCase()||i.isAlphaFormat(this.getFormat())||void 0!==this.alpha||void 0!==this.alphaElement:this.alphaChannel},this.processValueInput=function(e){this.fromString(e)||this.exposeColor()},this.processAlphaInput=function(e){this.fromHSVA(null,null,null,parseFloat(e))||this.exposeColor()},this.exposeColor=function(e){var t=this.toString(),o=this.getFormat();if(i.setDataAttr(this.targetElement,"current-color",t),e&i.flags.leaveValue||!this.valueElement||("hex"!==o&&"hexa"!==o||(this.uppercase||(t=t.toLowerCase()),this.hash||(t=t.replace(/^#/,""))),this.setValueElementValue(t)),!(e&i.flags.leaveAlpha)&&this.alphaElement){var n=Math.round(100*this.channels.a)/100;this.setAlphaElementValue(n)}e&i.flags.leavePreview||!this.previewElement||((i.isTextInput(this.previewElement)||i.isButton(this.previewElement)&&!i.isButtonEmpty(this.previewElement))&&this.previewPosition,this.setPreviewElementBg(this.toRGBAString())),p()&&(s(),c(),d())},this.setPreviewElementBg=function(e){if(this.previewElement){var t=null,o=null;(i.isTextInput(this.previewElement)||i.isButton(this.previewElement)&&!i.isButtonEmpty(this.previewElement))&&(t=this.previewPosition,o=this.previewSize);var n=[];if(e){n.push({image:i.genColorPreviewGradient(e,t,o?o-i.pub.previewSeparator.length:null),position:"left top",size:"auto",repeat:t?"repeat-y":"repeat",origin:"padding-box"});var a=i.genColorPreviewCanvas("rgba(0,0,0,0)",t?{left:"right",right:"left"}[t]:null,o,!0);n.push({image:"url('"+a.canvas.toDataURL()+"')",position:(t||"left")+" top",size:a.width+"px "+a.height+"px",repeat:t?"repeat-y":"repeat",origin:"padding-box"})}else n.push({image:"none",position:"left top",size:"auto",repeat:"no-repeat",origin:"padding-box"});for(var r={image:[],position:[],size:[],repeat:[],origin:[]},l=0;l=0;h-=1){var g=m[h];if(g)if(i.pub.presets.hasOwnProperty(g)){for(var u in i.pub.presets[g])if(i.pub.presets[g].hasOwnProperty(u))try{a(u,i.pub.presets[g][u])}catch(e){console.warn(e)}}else console.warn("Unknown preset: %s",g)}var f=["preset"];for(var u in o)if(o.hasOwnProperty(u)&&-1===f.indexOf(u))try{a(u,o[u])}catch(e){console.warn(e)}if(void 0===this.container?this.container=e.document.body:this.container=i.node(this.container),!this.container)throw new Error("Cannot instantiate color picker without a container element");if(this.targetElement=i.node(t),!this.targetElement){if("string"==typeof t&&/^[a-zA-Z][\w:.-]*$/.test(t))throw new Error("If '"+t+"' is supposed to be an ID, please use '#"+t+"' or any valid CSS selector.");throw new Error("Cannot instantiate color picker without a target element")}if(this.targetElement.jscolor&&this.targetElement.jscolor instanceof i.pub)throw new Error("Color picker already installed on this element");if(this.targetElement.jscolor=this,i.addClass(this.targetElement,i.pub.className),i.instances.push(this),i.isButton(this.targetElement)&&("button"!==this.targetElement.type.toLowerCase()&&(this.targetElement.type="button"),i.isButtonEmpty(this.targetElement))){i.removeChildren(this.targetElement),this.targetElement.appendChild(e.document.createTextNode(" "));var C=i.getCompStyle(this.targetElement);(parseFloat(C["min-width"])||0)-1){var G=i.parseColorString(b);this._currentFormat=G?G.format:"hex"}else this._currentFormat=this.format.toLowerCase();this.processValueInput(b),void 0!==k&&this.processAlphaInput(k)}}).pub.className="jscolor",i.pub.activeClassName="jscolor-active",i.pub.looseJSON=!0,i.pub.presets={},i.pub.presets.default={},i.pub.presets.light={backgroundColor:"rgba(255,255,255,1)",controlBorderColor:"rgba(187,187,187,1)",buttonColor:"rgba(0,0,0,1)"},i.pub.presets.dark={backgroundColor:"rgba(51,51,51,1)",controlBorderColor:"rgba(153,153,153,1)",buttonColor:"rgba(240,240,240,1)"},i.pub.presets.small={width:101,height:101,padding:10,sliderSize:14,paletteCols:8},i.pub.presets.medium={width:181,height:101,padding:12,sliderSize:16,paletteCols:10},i.pub.presets.large={width:271,height:151,padding:12,sliderSize:24,paletteCols:15},i.pub.presets.thin={borderWidth:1,controlBorderWidth:1,pointerBorderWidth:1},i.pub.presets.thick={borderWidth:2,controlBorderWidth:2,pointerBorderWidth:2},i.pub.sliderInnerSpace=3,i.pub.chessboardSize=8,i.pub.chessboardColor1="#666666",i.pub.chessboardColor2="#999999",i.pub.previewSeparator=["rgba(255,255,255,.65)","rgba(128,128,128,.65)"],i.pub.init=function(){if(!i.initialized)for(e.document.addEventListener("mousedown",i.onDocumentMouseDown,!1),e.document.addEventListener("keyup",i.onDocumentKeyUp,!1),e.addEventListener("resize",i.onWindowResize,!1),e.addEventListener("scroll",i.onWindowScroll,!1),i.pub.install(),i.initialized=!0;i.readyQueue.length;)i.readyQueue.shift()()},i.pub.install=function(e){var t=!0;try{i.installBySelector("[data-jscolor]",e)}catch(e){t=!1,console.warn(e)}if(i.pub.lookupClass)try{i.installBySelector("input."+i.pub.lookupClass+", button."+i.pub.lookupClass,e)}catch(e){}return t},i.pub.ready=function(e){return"function"!=typeof e?(console.warn("Passed value is not a function"),!1):(i.initialized?e():i.readyQueue.push(e),!0)},i.pub.trigger=function(e){var t=function(){i.triggerGlobal(e)};i.initialized?t():i.pub.ready(t)},i.pub.hide=function(){i.picker&&i.picker.owner&&i.picker.owner.hide()},i.pub.chessboard=function(e){return e||(e="rgba(0,0,0,0)"),i.genColorPreviewCanvas(e).canvas.toDataURL()},i.pub.background=function(e){var t=[];t.push(i.genColorPreviewGradient(e));var o=i.genColorPreviewCanvas();return t.push(["url('"+o.canvas.toDataURL()+"')","left top","repeat"].join(" ")),t.join(", ")},i.pub.options={},i.pub.lookupClass="jscolor",i.pub.installByClassName=function(){return console.error('jscolor.installByClassName() is DEPRECATED. Use data-jscolor="" attribute instead of a class name.'+i.docsRef),!1},i.register(),i.pub);return void 0===e.jscolor&&(e.jscolor=e.JSColor=a),a}))}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,o),a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";let e={};function t(){e.WrinklerButtons&&Game.elderWrath?(l("PopAllNormalWrinklerButton").style.display="",l("PopFattestWrinklerButton").style.display=""):(l("PopAllNormalWrinklerButton").style.display="none",l("PopFattestWrinklerButton").style.display="none")}const n=["","","M","G","T","P","E","Z","Y"],i=["","","M","B","Tr","Quadr","Quint","Sext","Sept","Oct","Non","Dec","Undec","Duodec","Tredec","Quattuordec","Quindec","Sexdec","Septendec","Octodec","Novemdec","Vigint","Unvigint","Duovigint","Trevigint","Quattuorvigint"],a=["","K","M","B","T","Qa","Qi","Sx","Sp","Oc","No","De","UDe","DDe","TDe","QaDe","QiDe","SxDe","SpDe","ODe","NDe","Vi","UVi","DVi","TVi","QaVi","QiVi","SxVi","SpVi","OVi","NVi","Tr","UTr","DTr","TTr","QaTr","QiTr","SxTr","SpTr","OTr","NTr","Qaa","UQa","DQa","TQa","QaQa","QiQa","SxQa","SpQa","OQa","NQa","Qia","UQi","DQi","TQi","QaQi","QiQi","SxQi","SpQi","OQi","NQi","Sxa","USx","DSx","TSx","QaSx","QiSx","SxSx","SpSx","OSx","NSx","Spa","USp","DSp","TSp","QaSp","QiSp","SxSp","SpSp","OSp","NSp","Oco","UOc","DOc","TOc","QaOc","QiOc","SxOc","SpOc","OOc","NOc","Noa","UNo","DNo","TNo","QaNo","QiNo","SxNo","SpNo","ONo","NNo","Ct","UCt"];let r,s,c,d,p,u,m,h,g,f,C,y,b,k,G,v,w=[],x=[],T=[],M={},S=Date.now(),B=Date.now();function P(t,o,r){const l=e.ScaleDecimals+1;if(t===1/0)return"Infinity";if(void 0===t)return"0";if(0===e.Scale)return M.Beautify(t,o);if(Number.isFinite(t)){if(t<0)return`-${P(Math.abs(t))}`;let s="";if(0===t)return t.toString();if(t>.001&&t=.01&&t=.01&&t=.01&&t0&&(c+=o,s-=1)}return c}const St="CMText",Bt="CMBack",Pt="Blue",Et="Green",Nt="Yellow",Ot="Orange",Ft="Red",Lt="Purple",Wt="Gray",At="Pink",jt="Brown",Dt=[Wt,Pt,Et,Nt,Ot,Ft,Lt,At,jt],Ht=[["GoldCookTooltipPlaceholder","Calculated with Golden Switch off","200px"],["GoldCookDragonsFortuneTooltipPlaceholder","Calculated with Golden Switch off and at least one golden cookie on-screen","240px"],["PrestMaxTooltipPlaceholder","The MAX prestige is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg","320px"],["NextPrestTooltipPlaceholder","Calculated with cookies gained from wrinklers and Chocolate egg","200px"],["HeavenChipMaxTooltipPlaceholder","The MAX heavenly chips is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg","330px"],["ResetTooltipPlaceholder","The bonus income you would get from new prestige levels unlocked at 100% of its potential and from ascension achievements if you have the same buildings/upgrades after reset","370px"],["ChoEggTooltipPlaceholder","The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and then buying Chocolate egg","300px"],["ChainNextLevelPlaceholder","Cheated cookies might break this formula","250px"],["FavouriteSettingPlaceholder","Click to set this setting as favourite and show it in 'favourite' settings at the top of the Cookie Monster Settings","250px"]],Ut={};let $t,Rt=0,It=-1,zt=[],Vt=function(){},_t=1,Qt=1,Xt=1;const qt=[10,15,30,60,300,600,900,1800],Yt=[1,5,10,15,30],Kt={Frenzy:Nt,"Dragon Harvest":jt,"Elder frenzy":Et,Clot:Ft,"Click frenzy":Pt,Dragonflight:At};let Jt,Zt,eo,to,oo,no,io,ao={},ro="",lo=[];function so(){let t=Game.buyBulk;if(1===Game.buyMode?Qt=t:t=Qt,1===t?t=We:10===t?t=Ae:100===t&&(t=je),1===Game.buyMode?1===e.BuildColour?Object.keys(t).forEach((o=>{l(`productPrice${Game.Objects[o].id}`).style.color=e[`Colour${t[o].color}`]})):Object.keys(Game.Objects).forEach((e=>{l(`productPrice${Game.Objects[e].id}`).style.removeProperty("color")})):-1===Game.buyMode&&Object.keys(We).forEach((e=>{const t=Game.Objects[e];l(`productPrice${t.id}`).style.color="",l(`productPrice${t.id}`).innerHTML=P(Mt(t,t.basePrice,t.amount,t.free,Game.buyBulk,1))})),1===Game.buyMode&&e.SortBuildings){let o;1===e.SortBuildings?(o=Object.keys(We).map((e=>{const t=We[e];return t.name=e,t.id=Game.Objects[e].id,t})),o.sort(((e,t)=>Dt.indexOf(e.color)>Dt.indexOf(t.color)?1:Dt.indexOf(e.color){const o=t[e];return o.name=e,o.id=Game.Objects[e].id,o})),o.sort(((e,t)=>Dt.indexOf(e.color)>Dt.indexOf(t.color)?1:Dt.indexOf(e.color){const t=We[e];return t.name=e,t.id=Game.Objects[e].id,t}));e.sort(((e,t)=>e.id-t.id));for(let t=0;t{e.UpgradesNeverCollapse||"products"===t.id?t.style.height="auto":"vaultUpgrades"===t.id?(t.style.height="",t.style.minHeight="0px"):"upgrades"===t.id?(t.style.height="",t.className.includes("hasMenu")?t.style.minHeight="82px":t.style.minHeight="60px"):(t.style.height="",t.style.minHeight="60px")}))}function po(){if(e.UpBarColour>0){let e=0,t=0,o=0,n=0,i=0,a=0,r=0;Object.keys(Game.UpgradesInStore).forEach((s=>{const c=Game.UpgradesInStore[s];let d=!1;for(let e=0;eDt.indexOf(e.color)>Dt.indexOf(t.color)?1:Dt.indexOf(e.color)e.price-t.price));const o=function(e,t){return e.findIndex((e=>e.name===t.name))};for(let e=0;e315576e4)return"XX:XX:XX:XX:XX";c+=(i<10?"0":"")+i+":",c+=(a<10?"0":"")+a+":",c+=(r<10?"0":"")+r+":",c+=(l<10?"0":"")+l+":",c+=(s<10?"0":"")+s}else{if(n>7776e5)return o?"Over 9000 days!":">9000d";c+=i>0?i+(o?1===i?" year":" years":"y")+", ":"",(c.length>0||a>0)&&(c+=a+(o?1===a?" day":" days":"d")+", "),(c.length>0||r>0)&&(c+=r+(o?1===r?" hour":" hours":"h")+", "),(c.length>0||l>0)&&(c+=l+(o?1===l?" minute":" minutes":"m")+", "),c+=s+(o?1===s?" second":" seconds":"s")}return c}function mo(t){let o,n;return t<=0?(n=e.TimeFormat?"00:00:00:00:00":"Done!",o=Et):(n=uo(t),o=t>300?Ft:t>60?Ot:Nt),{text:n,color:o}}function ho(){return e.CPSMode?_:0===e.CalcWrink?Game.cookiesPs*(1-Game.cpsSucked):1===e.CalcWrink?Game.cookiesPs*(Re+(1-.05*Ie)):null!==$e[1]&&2===e.CalcWrink&&1===Game.wrinklers[$e[1]].type?Game.cookiesPs*(3*Re/Ie+(1-.05*Ie)):Game.cookiesPs*(Re/Ie+(1-.05*Ie))}function go(){return 1===e.CalcWrink?He:2===e.CalcWrink?$e[0]:0}function fo(e,t,o){const n=document.createElement("div");n.id=e,n.style.height="12px",n.style.margin="0px 10px",n.style.position="relative";const i=document.createElement("div");i.style.width="100%",i.style.height="10px",i.style.margin="auto",i.style.position="absolute",i.style.left="0px",i.style.top="0px",i.style.right="0px",i.style.bottom="0px";const a=document.createElement("span");a.style.display="inline-block",a.style.textAlign="right",a.style.fontSize="10px",a.style.width="108px",a.style.marginRight="5px",a.style.verticalAlign="text-top",a.textContent=t,i.appendChild(a);for(let e=0;e{let n,i=Game.buyBulk;1===Game.buyMode?_t=i:i=_t,1===i&&(i=We),10===i&&(i=Ae),100===i&&(i=je),t+=1,l("CMBotBar").firstChild.firstChild.childNodes[0].childNodes[t].childNodes[1].textContent=Game.Objects[o].amount,l("CMBotBar").firstChild.firstChild.childNodes[1].childNodes[t].textContent=P(i[o].bonus,2),l("CMBotBar").firstChild.firstChild.childNodes[2].childNodes[t].className=St+i[o].color,n=e.PPDisplayTime?uo(Math.round(i[o].pp)):P(Math.round(i[o].pp),2),l("CMBotBar").firstChild.firstChild.childNodes[2].childNodes[t].textContent=n;const a=mo((Game.Objects[o].bulkPrice-(Game.cookies+go()))/ho());l("CMBotBar").firstChild.firstChild.childNodes[3].childNodes[t].className=St+a.color,"Done!"===a.text&&Game.cookies{!Game.Tiers[e.tieredUpgrades[o].tier].special&&wt(e.tieredUpgrades[o].name)&&(t*=2)})),Object.keys(e.synergies).forEach((o=>{if(wt(e.synergies[o].name)){const n=e.synergies[o];n.buildingTie1.name===e.name?t*=1+.05*n.buildingTie2.amount:n.buildingTie2.name===e.name&&(t*=1+.001*n.buildingTie1.amount)}})),e.fortune&&wt(e.fortune.name)&&(t*=1.07),e.grandma&&wt(e.grandma.name)&&(t*=1+.01*Ct.Grandma.amount*(1/(e.id-1))),"object"==typeof e.tieredUpgrades.misfortune&&1===e.vanilla&&wt(e.tieredUpgrades.misfortune.name))switch(Game.elderWrath){default:t*=1;break;case 1:t*=1.02;break;case 2:t*=1.04;break;case 3:t*=1.06}return t}function To(e){const t=Game.Objects[e],o={};return"Cursor"===t.name?o.cps=function(e){let t=0;wt("Thousand fingers")&&(t+=.1),wt("Million fingers")&&(t*=5),wt("Billion fingers")&&(t*=10),wt("Trillion fingers")&&(t*=20),wt("Quadrillion fingers")&&(t*=20),wt("Quintillion fingers")&&(t*=20),wt("Sextillion fingers")&&(t*=20),wt("Septillion fingers")&&(t*=20),wt("Octillion fingers")&&(t*=20),wt("Nonillion fingers")&&(t*=20);let o=1,n=0;return Object.keys(Ct).forEach((e=>{"Cursor"!==Ct[e].name&&(n+=Ct[e].amount)})),t*=n,o*=xo(e),o*=Game.magicCpS("Cursor"),o*=vt("cursorCps"),Game.ComputeCps(.1,wt("Reinforced index finger")+wt("Carpal tunnel prevention cream")+wt("Ambidextrous"),t)*o}:"Grandma"===t.name?o.cps=function(e){let o=1;if(Object.keys(Game.GrandmaSynergies).forEach((e=>{wt(Game.GrandmaSynergies[e])&&(o*=2)})),wt("Bingo center/Research facility")&&(o*=4),wt("Ritual rolling pins")&&(o*=2),wt("Naughty list")&&(o*=2),wt("Elderwort biscuits")&&(o*=1.02),o*=vt("grandmaCps"),wt("Cat ladies"))for(let e=0;e{"Grandma"!==Ct[e].name&&(i+=Ct[e].amount)})),o*=1+.01*kt("Elder Battalion")*i,o*=Game.magicCpS(t.name),(t.baseCps+n)*o}:o.cps=function(e){let t=1;return t*=xo(e),t*=Game.magicCpS(e.name),e.baseCPS*t},o.baseCps=t.baseCps,o.name=t.name,o.tieredUpgrades=t.tieredUpgrades,o.synergies=t.synergies,o.fortune=t.fortune,o.grandma=t.grandma,o.baseCPS=t.baseCps,o.id=t.id,o.vanilla=t.vanilla,o}function Mo(e){const t=Game.Upgrades[e],o={};return o.power=t.power,"function"==typeof o.power&&("Sugar crystal cookies"===t.name?o.power=function(){let e=5;return Object.keys(Ct).forEach((t=>{Ct[t].level>=10&&(e+=1)})),e}:o.power=function(){let e=2;if(wt("Starlove")&&(e=3),Game.hasGod){const t=xt("seasons");1===t?e*=1.3:2===t?e*=1.2:3===t&&(e*=1.1)}return e}),o.pool=t.pool,o.name=t.name,o}function So(){J=Game.UpgradesOwned,Z=Game.pledges,ee=Game.AchievementsOwned,te=Game.heavenlyPower,oe=Game.prestige,Object.keys(Game.Objects).forEach((e=>{const t=Game.Objects[e];let o=Ct[e];void 0===o&&(Ct[e]=To(e),o=Ct[e],Co(e)),o.amount=t.amount,o.level=t.level,o.totalCookies=t.totalCookies,o.basePrice=t.basePrice,o.free=t.free,t.minigameLoaded&&("Temple"===t.name&&(ae=t.minigame.slot[0],re=t.minigame.slot[1],le=t.minigame.slot[2]),o.minigameLoaded=t.minigameLoaded,o.minigame=t.minigame),Ct[e]=o})),Object.keys(Game.Upgrades).forEach((e=>{const t=Game.Upgrades[e];let o=yt[e];void 0===o&&(yt[e]=Mo(e),o=yt[e]),o.bought=t.bought,yt[e]=o})),Object.keys(Game.Achievements).forEach((e=>{const t=Game.Achievements[e];let o=bt[e];void 0===o&&(bt[e]=wo(e),o=bt[e]),o.won=t.won,bt[e]=o})),vo(),ne=me,ie=he}function Bo(e){const t=document.createElement("div");return t.style.fontWeight="bold",t.id=`${e}Title`,t.className="CMTextBlue",t.textContent=e,t}function Po(e){e.appendChild(Bo("Bonus Income"));const t=document.createElement("div");t.style.marginBottom="4px",t.style.color="white",t.id="CMTooltipIncome",e.appendChild(t),e.appendChild(Bo("Bonus Cookies per Click")),e.lastChild.style.display="none";const o=document.createElement("div");o.style.marginBottom="4px",o.style.color="white",o.style.display="none",o.id="CMTooltipCookiePerClick",e.appendChild(o),e.appendChild(Bo("Payback Period"));const n=document.createElement("div");n.style.marginBottom="4px",n.id="CMTooltipPP",e.appendChild(n),e.appendChild(Bo("Time Left"));const i=document.createElement("div");if(i.id="CMTooltipTime",e.appendChild(i),"b"===eo){e.appendChild(Bo("Production left till next achievement")),e.lastChild.id="CMTooltipProductionLeftHeader";const t=document.createElement("div");t.id="CMTooltipProductionLeft",e.appendChild(t)}if("b"===eo){e.appendChild(Bo("Buildings (price / PP) left till next achievement")),e.lastChild.id="CMTooltipNextAchievementHeader";const t=document.createElement("div");t.id="CMTooltipNextAchievement",e.appendChild(t)}}function Eo(t,o){let n="";return n=t.pp<=0||t.pp===1/0?Wt:t.pp0&&(n=Ft),n}function No(){let e=1;return Object.keys(Game.buffs).forEach((t=>{void 0!==Game.buffs[t].multCpS&&(e*=Game.buffs[t].multCpS)})),e}function Oo(e){bt[e]&&0===bt[e].won&&(bt[e].won=1,"shadow"!==Game.Achievements[e].pool&&(ee+=1))}function Fo(){de=0;let e=1;const t={};Object.keys(Game.Objects).forEach((e=>{if(Game.Objects[e].minigameLoaded&&Game.Objects[e].minigame.effs){const o=Game.Objects[e].minigame.effs;Object.keys(o).forEach((e=>{t[e]?t[e]*=o[e]:t[e]=o[e]}))}})),ce=t,1!==Game.ascensionMode&&(e+=.01*parseFloat(oe)*te*function(){let e=0;if(wt("Heavenly chip secret")&&(e+=.05),wt("Heavenly cookie stand")&&(e+=.2),wt("Heavenly bakery")&&(e+=.25),wt("Heavenly confectionery")&&(e+=.25),wt("Heavenly key")&&(e+=.25),e*=1+.05*kt("Dragon God"),wt("Lucky digit")&&(e*=1.01),wt("Lucky number")&&(e*=1.01),wt("Lucky payout")&&(e*=1.01),Game.hasGod){const t=xt("creation");1===t?e*=.7:2===t?e*=.8:3===t&&(e*=.9)}return e}()),e*=vt("cps"),wt("Heralds")&&1!==Game.ascensionMode&&(e*=1+.01*Game.heralds),Object.keys(Game.cookieUpgrades).forEach((t=>{const o=Game.cookieUpgrades[t];wt(o.name)&&("function"==typeof o.power?e*=1+.01*yt[o.name].power(yt[o.name]):e*=1+.01*o.power)})),wt("Specialized chocolate chips")&&(e*=1.01),wt("Designer cocoa beans")&&(e*=1.02),wt("Underworld ovens")&&(e*=1.03),wt("Exotic nuts")&&(e*=1.04),wt("Arcane sugar")&&(e*=1.05),wt("Increased merriness")&&(e*=1.15),wt("Improved jolliness")&&(e*=1.15),wt("A lump of coal")&&(e*=1.01),wt("An itchy sweater")&&(e*=1.01),wt("Santa's dominion")&&(e*=1.2),wt("Fortune #100")&&(e*=1.01),wt("Fortune #101")&&(e*=1.07),wt("Dragon scale")&&(e*=1.03);let o=1;if(xt){let t=xt("asceticism");1===t?e*=1.15:2===t?e*=1.1:3===t&&(e*=1.05),t=xt("ages"),1===t?e*=1+.15*Math.sin(S/1e3/10800*Math.PI*2):2===t?e*=1+.15*Math.sin(S/1e3/43200*Math.PI*2):3===t&&(e*=1+.15*Math.sin(S/1e3/86400*Math.PI*2)),t=xt("decadence"),1===t?o*=.93:2===t?o*=.95:3===t&&(o*=.98),t=xt("industry"),1===t?o*=1.1:2===t?o*=1.06:3===t&&(o*=1.03),t=xt("labor"),1===t?o*=.97:2===t?o*=.98:3===t&&(o*=.99)}wt("Santa's legacy")&&(e*=1+.03*(Game.santaLevel+1));const n=ee/25;let i=1;if(wt("Santa's milk and cookies")&&(i*=1.05),i*=1+.05*kt("Breath of Milk"),xt){const e=xt("mother");1===e?i*=1.1:2===e?i*=1.05:3===e&&(i*=1.03)}i*=vt("milk");let a=1;wt("Kitten helpers")&&(a*=1+.1*n*i),wt("Kitten workers")&&(a*=1+.125*n*i),wt("Kitten engineers")&&(a*=1+.15*n*i),wt("Kitten overseers")&&(a*=1+.175*n*i),wt("Kitten managers")&&(a*=1+.2*n*i),wt("Kitten accountants")&&(a*=1+.2*n*i),wt("Kitten specialists")&&(a*=1+.2*n*i),wt("Kitten experts")&&(a*=1+.2*n*i),wt("Kitten consultants")&&(a*=1+.2*n*i),wt("Kitten assistants to the regional manager")&&(a*=1+.175*n*i),wt("Kitten marketeers")&&(a*=1+.15*n*i),wt("Kitten analysts")&&(a*=1+.125*n*i),wt("Kitten executives")&&(a*=1+.115*n*i),wt("Kitten angels")&&(a*=1+.1*n*i),wt("Fortune #103")&&(a*=1+.05*n*i),Object.keys(Ct).forEach((e=>{const t=Ct[e];let a=t.cps(t);1!==Game.ascensionMode&&(a*=(1+.01*t.level)*o),"Grandma"===t.name&&wt("Milkhelp® lactose intolerance relief tablets")&&(a*=1+.05*n*i),de+=t.amount*a})),wt('"egg"')&&(de+=9),e*=a;let r=1;if(wt("Chicken egg")&&(r*=1.01),wt("Duck egg")&&(r*=1.01),wt("Turkey egg")&&(r*=1.01),wt("Quail egg")&&(r*=1.01),wt("Robin egg")&&(r*=1.01),wt("Ostrich egg")&&(r*=1.01),wt("Cassowary egg")&&(r*=1.01),wt("Salmon roe")&&(r*=1.01),wt("Frogspawn")&&(r*=1.01),wt("Shark egg")&&(r*=1.01),wt("Turtle egg")&&(r*=1.01),wt("Ant larva")&&(r*=1.01),wt("Century egg")){let e=10*Math.floor((B-Game.startDate)/1e3/10)/60/60/24;e=Math.min(e,100),Oe=1+.1*(1-(1-e/100)**3),r*=Oe}e*=r,wt("Sugar baking")&&(e*=1+.01*Math.min(100,Game.lumps)),e*=1+kt("Radiant Appetite");const l=de*e;Object.keys(Game.CpsAchievements).forEach((e=>{l>=Game.CpsAchievements[e].threshold&&Oo(Game.CpsAchievements[e].name)})),pe=l;const{n:s}=Game.shimmerTypes.golden,c=kt("Dragon's Fortune");for(let t=0;t{wt(e[o])&&(t+=.1)}))}e*=t}if(wt("Shimmering veil [off]")){let t=.5;wt("Reinforced membrane")&&(t+=.1),e*=1+t}wt("Magic shenanigans")&&(e*=1e3),wt("Occult obstruction")&&(e*=0),de=Game.runModHookOnValue("cps",de),e*=No(),de*=e}const Lo=["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 #018","Fortune #100","Fortune #101","Fortune #102","Fortune #103","Fortune #104"],Wo=["Skull cookies","Ghost cookies","Bat cookies","Slime cookies","Pumpkin cookies","Eyeball cookies","Spider cookies"],Ao=["Christmas tree biscuits","Snowflake biscuits","Snowman biscuits","Holly biscuits","Candy cane biscuits","Bell biscuits","Present biscuits"],jo=["Pure heart biscuits","Ardent heart biscuits","Sour heart biscuits","Weeping heart biscuits","Golden heart biscuits","Eternal heart biscuits","Prism heart biscuits"],Do=["Elderwort biscuits","Bakeberry cookies","Duketater cookies","Green yeast digestives","Wheat slims","Fern tea","Ichor syrup"];function Ho(e){return bt[e]?bt[e].won:0}function Uo(){let e=0;Object.keys(Game.GrandmaSynergies).forEach((t=>{wt(Game.GrandmaSynergies[t])&&(e+=1)})),!Ho("Elder")&&e>=7&&Oo("Elder"),!Ho("Veteran")&&e>=14&&Oo("Veteran");let t=0,o=1,n=1,i=1e5;Object.keys(Ct).forEach((e=>{t+=Ct[e].amount,i=Math.min(Ct[e].amount,i),Ho("Mathematician")||Ct[e].amount=1&&Oo("One with everything"),1===o&&Oo("Mathematician"),1===n&&Oo("Base 10"),i>=100&&Oo("Centennial"),i>=150&&Oo("Centennial and a half"),i>=200&&Oo("Bicentennial"),i>=250&&Oo("Bicentennial and a half"),i>=300&&Oo("Tricentennial"),i>=350&&Oo("Tricentennial and a half"),i>=400&&Oo("Quadricentennial"),i>=450&&Oo("Quadricentennial and a half"),i>=500&&Oo("Quincentennial"),i>=550&&Oo("Quincentennial and a half"),i>=600&&Oo("Sexcentennial"),t>=100&&Oo("Builder"),t>=500&&Oo("Architect"),t>=1e3&&Oo("Engineer"),t>=2e3&&Oo("Lord of Constructs"),t>=4e3&&Oo("Grand design"),t>=8e3&&Oo("Ecumenopolis"),J>=20&&Oo("Enhancer"),J>=50&&Oo("Augmenter"),J>=100&&Oo("Upgrader"),J>=200&&Oo("Lord of Progress"),J>=300&&Oo("The full picture"),J>=400&&Oo("When there's nothing left to add"),t>=4e3&&J>=300&&Oo("Polymath"),t>=8e3&&J>=400&&Oo("Renaissance baker"),Ct.Cursor.amount+Ct.Grandma.amount>=777&&Oo("The elder scrolls");let a=!0;Object.keys(Wo).forEach((e=>{wt(Wo[e])||(a=!1)})),a&&Oo("Spooky cookies");let r=!0;if(Object.keys(Ao).forEach((e=>{wt(Ao[e])||(r=!1)})),r&&Oo("Let it snow"),wt("Fortune cookies")){const e=Game.Tiers.fortune.upgrades;let t=0;Object.keys(e).forEach((o=>{wt(e[o].name)&&(t+=1)})),t>=e.length&&Oo("O Fortuna")}}function $o(e,t){So(),Ct[e].amount+=t;const o=Ct[e];"Cursor"===e?(o.amount>=1&&Oo("Click"),o.amount>=2&&Oo("Double-click"),o.amount>=50&&Oo("Mouse wheel"),o.amount>=100&&Oo("Of Mice and Men"),o.amount>=200&&Oo("The Digital"),o.amount>=300&&Oo("Extreme polydactyly"),o.amount>=400&&Oo("Dr. T"),o.amount>=500&&Oo("Thumbs, phalanges, metacarpals"),o.amount>=600&&Oo("With her finger and her thumb"),o.amount>=700&&Oo("Gotta hand it to you"),o.amount>=800&&Oo("The devil's workshop")):Object.keys(Game.Objects[o.name].tieredAchievs).forEach((e=>{o.amount>=Game.Tiers[Game.Objects[o.name].tieredAchievs[e].tier].achievUnlock&&Oo(Game.Objects[o.name].tieredAchievs[e].name)}));const n=ee;return Fo(),Uo(),n!==ee&&Fo(),de-Game.cookiesPs}function Ro(e,t,o){let n=e,i=0;for(;nt.plantsById[t.plot[to[1]][to[0]][0]-1].mature,o=t.plantsById[t.plot[to[1]][to[0]][0]-1].name;l("CMTooltipBorder").appendChild(Bo("Reward (Current / Maximum)"));const n=document.createElement("div");n.id="CMTooltipPlantReward",l("CMTooltipBorder").appendChild(n),"Bakeberry"===o?l("CMTooltipPlantReward").textContent=`${e?P(Math.min(.03*Game.cookies,60*Game.cookiesPs*30)):"0"} / ${P(60*Game.cookiesPs*30)}`:"Chocoroot"===o||"White chocoroot"===o?l("CMTooltipPlantReward").textContent=`${e?P(Math.min(.03*Game.cookies,60*Game.cookiesPs*3)):"0"} / ${P(60*Game.cookiesPs*3)}`:"Queenbeet"===o?l("CMTooltipPlantReward").textContent=`${e?P(Math.min(.04*Game.cookies,60*Game.cookiesPs*60)):"0"} / ${P(60*Game.cookiesPs*60)}`:"Duketater"===o?l("CMTooltipPlantReward").textContent=`${e?P(Math.min(.08*Game.cookies,60*Game.cookiesPs*120)):"0"} / ${P(60*Game.cookiesPs*120)}`:l("CMTooltipArea").style.display="none"}else l("CMTooltipArea").style.display="none"}():"ha"===eo?function(){const{minigame:t}=Game.Objects.Farm;if(e.TooltipLump){l("CMTooltipBorder").appendChild(Bo("Cookies gained from harvesting:"));let e=0,o=0;Game.keys[16]&&Game.keys[17]&&(o=1);for(let n=0;n<6;n++)for(let i=0;i<6;i++)if(t.plot[n][i][0]>=1){const a=t.plot[n][i],r=t.plantsById[a[0]-1],l=r.name;let s=!0;o&&r.immortal&&(s=!1),a[1]0&&t=1?l("CMTimerBarGCMinBar").textContent=Math.ceil((Game.shimmerTypes.golden.minTime-Game.shimmerTypes.golden.time)/Game.fps):l("CMTimerBarGCMinBar").textContent="",Game.shimmerTypes.golden.minTime===Game.shimmerTypes.golden.maxTime?(l("CMTimerBarGCMinBar").style.borderTopRightRadius="10px",l("CMTimerBarGCMinBar").style.borderBottomRightRadius="10px"):(l("CMTimerBarGCMinBar").style.borderTopRightRadius="",l("CMTimerBarGCMinBar").style.borderBottomRightRadius=""),l("CMTimerBarGCBar").style.width=`${Math.round(Math.min(Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.minTime,Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)*t/Game.shimmerTypes.golden.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarGCBar").textContent=Math.ceil(Math.min(Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.minTime,Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps):l("CMTimerBarGCBar").textContent="",l("CMTimerBarGCTime").textContent=Math.ceil((Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps),n+=1),"christmas"===Game.season&&0===Game.shimmerTypes.reindeer.spawned?(l("CMTimerBarRen").style.display="",l("CMTimerBarRenMinBar").style.width=`${Math.round(Math.max(0,Game.shimmerTypes.reindeer.minTime-Game.shimmerTypes.reindeer.time)*t/Game.shimmerTypes.reindeer.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarRenMinBar").textContent=Math.ceil((Game.shimmerTypes.reindeer.minTime-Game.shimmerTypes.reindeer.time)/Game.fps):l("CMTimerBarRenMinBar").textContent="",l("CMTimerBarRenBar").style.width=`${Math.round(Math.min(Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.minTime,Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)*t/Game.shimmerTypes.reindeer.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarRenBar").textContent=Math.ceil(Math.min(Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.minTime,Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps):l("CMTimerBarRenBar").textContent="",l("CMTimerBarRenTime").textContent=Math.ceil((Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps),n+=1):l("CMTimerBarRen").style.display="none";const i={};l("CMTimerBarBuffTimers").innerHTML="",Object.keys(Game.buffs).forEach((t=>{if(Game.buffs[t]){const a=fo(Game.buffs[t].name,Game.buffs[t].name,[{id:`${Game.buffs[t].name}Bar`}]);a.style.display="";let r="";r=void 0!==Kt[Game.buffs[t].name]?Kt[Game.buffs[t].name]:Lt,a.lastChild.children[1].className=Bt+r,a.lastChild.children[1].style.color="black",2===e.TimerBarOverlay?a.lastChild.children[1].textContent=`${Math.round(Game.buffs[t].time/Game.buffs[t].maxTime*100)}%`:a.lastChild.children[1].textContent="",a.lastChild.children[1].style.width=`${Math.round(Game.buffs[t].time*(o-8*Math.ceil(Game.buffs[t].time/Game.fps).toString().length)/Game.buffs[t].maxTime)}px`,a.lastChild.children[2].textContent=Math.ceil(Game.buffs[t].time/Game.fps),n+=1,i[Game.buffs[t].name]=a}})),Object.keys(i).forEach((e=>{l("CMTimerBarBuffTimers").appendChild(i[e])})),0!==n&&(l("CMTimerBar").style.height=12*n+2+"px"),io!==n&&(io=n,ko())}}(),yo(),zo(),function(){if(1===e.TooltipWrink&&1===Rt){let e=!1;Object.keys(Game.wrinklers).forEach((t=>{const o=Game.wrinklers[t];if(o.phase>0&&o.selected){if(e=!0,0===zt[t]||void 0===zt[t]){const e=document.createElement("div"),o=document.createElement("div");o.style.minWidth="120px",o.style.marginBottom="4px";const n=document.createElement("div");n.style.textAlign="center",n.id="CMTooltipWrinkler",o.appendChild(n),e.appendChild(o),Game.tooltip.draw(this,escape(e.innerHTML)),It=t,zt[t]=1}}else zt[t]=0})),e||Game.tooltip.hide()}}(),function(){if(1===e.TooltipWrink&&null!==l("CMTooltipWrinkler")){let{sucked:e}=Game.wrinklers[It],t=1.1;if(Game.Has("Sacrilegious corruption")&&(t*=1.05),1===Game.wrinklers[It].type&&(t*=3),e*=t,Game.Has("Wrinklerspawn")&&(e*=1.05),Ct.Temple.minigameLoaded){const t=Game.hasGod("scorn");1===t?e*=1.15:2===t?e*=1.1:3===t&&(e*=1.05)}l("CMTooltipWrinkler").textContent=P(e)}}(),e.UpStats&&"stats"===Game.onMenu&&(Game.drawT-1)%(5*Game.fps)!=0&&(Game.drawT-1)%Game.fps==0&&Game.UpdateMenu(),t(),e.Scale){let e=l("cookies").innerHTML.replace(/.*(?=
)/i,P(Game.cookies));Game.prefs.monospace&&(e=`${e}`),l("cookies").innerHTML=e}}function _o(){E.addLatest(Game.computedMouseCps)}class Qo{constructor(e){this.maxLength=e,this.queue=[]}addLatest(e){this.queue.push(e)>this.maxLength&&this.queue.shift()}calcAverage(e){let t=e;t>this.maxLength&&(t=this.maxLength),t>this.queue.length&&(t=this.queue.length);let o=0;for(let e=this.queue.length-1;e>=0&&e>this.queue.length-1-t;e--)o+=this.queue[e];return 0===o?0:o/t}calcSum(e){let t=e;return t>this.maxLength&&(t=this.maxLength),t>this.queue.length&&(t=this.queue.length),0===t?0:this.queue.slice(-t).reduce(((e,t)=>e+t),0)}}function Xo(){const t=Math.floor(Date.now()/1e3);if(Game.T/Game.fps%1==0){let o=Game.cookies+gt;Game.cpsSucked>0&&(o+=He),lt=Math.max(Game.cookiesEarned,o),o*=.05;const n=t-j,i=Math.max(0,Game.cookies-D)/n,a=Math.max(0,He-H)/n,r=Math.max(0,$e[0]-U)/n,l=Math.max(0,o-Le)/n,s=(Game.cookieClicks-$)/n;for(let e=0;e{if(e.PPRigidelMode&&1===o)t[n].color=Wt;else{t[n].color=Eo(t[n],Game.Objects[n].getSumPrice(o));for(let o=0;o{const i=Game.Objects[n].getSumPrice(o);Game.cookiesPs?t[n].pp=Math.max(i-(Game.cookies+go()),0)/Game.cookiesPs+i/t[n].bonus:t[n].pp=i/t[n].bonus,e.PPRigidelMode&&1===o||mt.push([t[n].pp,o])}))}function Ko(){!function(){ut=1/0,mt=[],void 0===e.PPExcludeTop&&(e.PPExcludeTop=0),Yo(We,1),Yo(Ae,10),Yo(je,100),mt.sort(((e,t)=>e[0]-t[0]));let t=0;if(e.PPOnlyConsiderBuyable)for(;mt[t][1]>Game.cookies&&(t+=1,mt.length!==t+1););ut=mt[e.PPExcludeTop][t],qo(We,1),qo(Ae,10),qo(je,100)}(),Object.keys(ze).forEach((e=>{Game.cookiesPs?ze[e].pp=Math.max(Game.Upgrades[e].getPrice()-(Game.cookies+go()),0)/Game.cookiesPs+Game.Upgrades[e].getPrice()/ze[e].bonus:ze[e].pp=Game.Upgrades[e].getPrice()/ze[e].bonus,Number.isNaN(ze[e].pp)&&(ze[e].pp=1/0),ze[e].color=Eo(ze[e],Game.Upgrades[e].getPrice())}))}function Jo(e,t,o,n,i){let a=o,r=0;for(let o=0;o{t[o]={},t[o].bonus=$o(o,e),1!==e&&(q=1)})),t}function en(){Object.keys(Game.Objects).forEach((e=>{We[e].price=Jo(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,1),Ae[e].price=Jo(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,10),je[e].price=Jo(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,100),De[e].price=Jo(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,De[e].AmountNeeded)}))}function tn(){We=Zo(1),Ae=Zo(10),je=Zo(100),ze=[],Object.keys(Game.Upgrades).forEach((t=>{const o=function(e){if("toggle"===Game.Upgrades[e].pool||0===Game.Upgrades[e].bought&&Game.Upgrades[e].unlocked&&"prestige"!==Game.Upgrades[e].pool){So(),"Shimmering veil [on]"===yt[e].name?yt["Shimmering veil [off]"].bought=0:"Golden switch [on]"===yt[e].name?yt["Golden switch [off]"].bought=0:yt[e].bought=(yt[e].bought+1)%2,Game.CountsAsUpgradeOwned(Game.Upgrades[e].pool)&&(J+=1),"Elder Pledge"===e?(Z+=1,Z>0&&Oo("Elder nap"),Z>=5&&Oo("Elder slumber")):"Elder Covenant"===e?Oo("Elder calm"):"Prism heart biscuits"===e?Oo("Lovely cookies"):"Heavenly key"===e&&Oo("Wholesome");const t=ee;Fo(),Uo(),t!==ee&&Fo();const o=function(){let e=0;wt("Thousand fingers")&&(e+=.1),wt("Million fingers")&&(e*=5),wt("Billion fingers")&&(e*=10),wt("Trillion fingers")&&(e*=20),wt("Quadrillion fingers")&&(e*=20),wt("Quintillion fingers")&&(e*=20),wt("Sextillion fingers")&&(e*=20),wt("Septillion fingers")&&(e*=20),wt("Octillion fingers")&&(e*=20),wt("Nonillion fingers")&&(e*=20);let t=0;Object.keys(Ct).forEach((e=>{t+=Ct[e].amount})),t-=Ct.Cursor.amount,e*=t,wt("Plastic mouse")&&(e+=.01*de),wt("Iron mouse")&&(e+=.01*de),wt("Titanium mouse")&&(e+=.01*de),wt("Adamantium mouse")&&(e+=.01*de),wt("Unobtainium mouse")&&(e+=.01*de),wt("Eludium mouse")&&(e+=.01*de),wt("Wishalloy mouse")&&(e+=.01*de),wt("Fantasteel mouse")&&(e+=.01*de),wt("Nevercrack mouse")&&(e+=.01*de),wt("Armythril mouse")&&(e+=.01*de),wt("Technobsidian mouse")&&(e+=.01*de),wt("Plasmarble mouse")&&(e+=.01*de),wt("Miraculite mouse")&&(e+=.01*de),wt("Fortune #104")&&(e+=.01*de);let o=1;if(wt("Santa's helpers")&&(o*=1.1),wt("Cookie egg")&&(o*=1.1),wt("Halo gloves")&&(o*=1.1),wt("Dragon claw")&&(o*=1.03),wt("Aura gloves")&&(o*=1+.05*Math.min(Game.Objects.Cursor.level,wt("Luminous gloves")?20:10)),o*=vt("click"),Ct.Temple.minigameLoaded&&xt){const e=xt("labor");1===e?o*=1.15:2===e?o*=1.1:3===e&&(o*=1.05)}Object.keys(Game.buffs).forEach((e=>{void 0!==Game.buffs[e].multClick&&(o*=Game.buffs[e].multClick)})),o*=1+.05*kt("Dragon Cursor");let n=o*Game.ComputeCps(1,wt("Reinforced index finger")+wt("Carpal tunnel prevention cream")+wt("Ambidextrous"),e);return n=Game.runModHookOnValue("cookiesPerClick",n),Game.hasBuff("Cursed finger")&&(n=Game.buffs["Cursed finger"].power),n}()-Game.computedMouseCps;return o?[de-Game.cookiesPs,o]:[de-Game.cookiesPs]}return[]}(t);"Elder Pledge"===t?(ze[t]={bonus:Game.cookiesPs-R},1===e.CalcWrink?ze[t].bonus-=I:2===e.CalcWrink&&(ze[t].bonus-=z),Number.isFinite(ze[t].bonus)||(ze[t].bonus=0)):(ze[t]={},o[0]&&(ze[t].bonus=o[0]),o[1]&&(ze[t].bonusMouse=o[1]))}))}function on(e,t,o){let n=0,i=0,a=0,r=0,l=1+Math.max(0,Math.ceil(Math.log(Game.cookies)/Math.LN10)-10);for(;a0?e/=t:e=0,Ke=on(7,e,Pe),qe=2*Ke[1]/Pe,Ye=Ke[2]/60/60/6/Be,et=on(6,e,Ee),Je=2*et[1]/Ee,Ze=et[2]/60/60/6/Be,nt=on(7,7*e,Pe),tt=2*nt[1]/Pe,ot=nt[2]/60/60/6/Be,rt=on(6,7*e,Ee),it=2*rt[1]/Ee,at=rt[2]/60/60/6/Be}function an(){const e=Math.floor(Date.now()/1e3);if(Game.T/Game.fps%1==0){const t=Game.HowMuchPrestige(Game.cookiesReset),o=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))-Math.floor(t),n=e-Q,i=Math.max(0,o-X)/n;for(let e=0;e{e.push(Game.Upgrades[t])})),e.sort((function(e,t){return e.order>t.order?1:e.order{const o=e[t];if(0===o.bought){let e="";e+=function(e){let t="crate upgrade missing";"prestige"===e.pool&&(t+=" heavenly");let o=0;Game.prefs.crates||(o=1),o&&(t+=" noFrame");let{icon:n}=e;e.iconFunction&&(n=e.iconFunction());const i=`function() {return Game.crateTooltip(Game.UpgradesById[${e.id}], 'stats');}`;return`
\n\t
`}(o),"prestige"===o.pool?Qe+=e:"cookie"===o.pool?Xe+=e:"toggle"!==o.pool&&"unused"!==o.pool&&"debug"!==o.pool&&(_e+=e)}}))}function ln(){if("christmas"===Game.season){let e=60*Game.cookiesPs;Game.hasBuff("Elder frenzy")&&(e*=.5),Game.hasBuff("Frenzy")&&(e*=.75),Fe=Math.max(25,e),Game.Has("Ho ho ho-flavored frosting")&&(Fe*=2)}}function sn(){Ce=900*Se/.15,Ce*=Be;const e=No();e>0?Ce/=e:Ce=0,ye=Pe*(.15*Ce)+13,be=Ee*(.15*Ce)+13,ke=7*Ce,Ge=Pe*(.15*ke)+13,ve=Ee*(.15*ke)+13,we=2*Ce,xe=.15*we,Te=0;let t=0,o=0;Object.keys(Game.Objects).forEach((e=>{Game.Objects[e].amount>t&&(t=Game.Objects[e].amount),Game.Objects[e].amount>0&&(o+=1)})),Object.keys(Game.Objects).forEach((e=>{(Game.Objects[e].amountTe&&(Te=2*Game.Objects[e].price,Me=e)}))}function cn(){let e=1,t=1,o=1;wt("Green yeast digestives")&&(o*=1.01),wt("Dragon fang")&&(o*=1.03),e*=1+.1*Game.auraMult("Ancestral Metamorphosis"),e*=Game.eff("goldenCookieGain"),t*=1+.1*Game.auraMult("Unholy Dominion"),t*=Game.eff("wrathCookieGain"),Pe=o*e,Ee=o*t,Be=1,0===Game.shimmerTypes.golden.n&&(Be*=1+1.23*Game.auraMult("Dragon's Fortune"))}function dn(){const e={};Object.keys(Game.Objects).forEach((t=>{if(0!==Object.keys(De).length&&De[t].TotalNeeded>Game.Objects[t].amount)e[t]={AmountNeeded:De[t].TotalNeeded-Game.Objects[t].amount,TotalNeeded:De[t].TotalNeeded};else{const o=function(e){const t=Game.AchievementsOwned;for(let o=0;o<101;o++)if($o(e,o),ee>t)return o;return 101}(t);e[t]={AmountNeeded:o,TotalNeeded:Game.Objects[t].amount+o}}})),De=e}function pn(){He=0,Ue=0,$e=[0,null];for(let e=0;e$e[0]&&($e=[t,e]))}}function un(){vo(),pn(),sn(),cn(),nn(),rn(),ln(),N=new Qo(qt[qt.length-1]),O=new Qo(qt[qt.length-1]),F=new Qo(qt[qt.length-1]),L=new Qo(qt[qt.length-1]),W=new Qo(Yt[Yt.length-1]),A=new Qo(5),E=new Qo(20*Yt[Yt.length-1]),an(),dn(),Xo(),tn(),en(),Ko()}const mn={CPSMode:1,AvgCPSHist:3,AvgClicksHist:0,CalcWrink:0,Scale:2,ScaleDecimals:2,ScaleSeparator:0,ScaleCutoff:999999,TimeFormat:0,DetailedTime:1,PPDisplayTime:0,BuildColour:1,PPOnlyConsiderBuyable:0,PPExcludeTop:0,PPRigidelMode:0,PPSecondsLowerLimit:0,ColourBlue:"#4bb8f0",ColourGreen:"#00ff00",ColourYellow:"#ffff00",ColourOrange:"#ff7f00",ColourRed:"#ff0000",ColourPurple:"#ff00ff",ColourGray:"#b3b3b3",ColourPink:"#ff1493",ColourBrown:"#8b4513",BotBar:1,TimerBar:1,TimerBarPos:0,TimerBarOverlay:2,UpBarColour:1,UpgradeBarFixedPos:1,SortBuildings:0,SortUpgrades:0,UpgradesNeverCollapse:0,DragonAuraInfo:1,GrimoireBar:1,GCTimer:1,Favicon:1,WrinklerButtons:1,HideSectionsButtons:0,TooltipBuildUpgrade:1,TooltipAmor:0,ToolWarnLucky:1,ToolWarnLuckyFrenzy:1,ToolWarnConjure:1,ToolWarnConjureFrenzy:1,ToolWarnEdifice:1,ToolWarnUser:0,ToolWarnBon:1,ToolWarnPos:1,TooltipGrim:1,TooltipWrink:1,TooltipLump:1,TooltipPlots:1,TooltipPantheon:1,TooltipAscendButton:1,Stats:1,MissingUpgrades:1,MissingAchievements:0,UpStats:1,HeavenlyChipsTarget:1,ShowMissedGC:1,Title:1,GeneralSound:1,GCNotification:0,GCFlash:1,ColourGCFlash:"#ffffff",GCSound:1,GCVolume:100,GCSoundURL:"https://freesound.org/data/previews/66/66717_931655-lq.mp3",FortuneNotification:0,FortuneFlash:1,ColourFortuneFlash:"#ffffff",FortuneSound:1,FortuneVolume:100,FortuneSoundURL:"https://freesound.org/data/previews/174/174027_3242494-lq.mp3",SeaNotification:0,SeaFlash:1,ColourSeaFlash:"#ffffff",SeaSound:1,SeaVolume:100,SeaSoundURL:"https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3",GardFlash:1,ColourGardFlash:"#ffffff",GardSound:1,GardVolume:100,GardSoundURL:"https://freesound.org/data/previews/103/103046_861714-lq.mp3",MagicNotification:0,MagicFlash:1,ColourMagicFlash:"#ffffff",MagicSound:1,MagicVolume:100,MagicSoundURL:"https://freesound.org/data/previews/221/221683_1015240-lq.mp3",WrinklerNotification:0,WrinklerFlash:1,ColourWrinklerFlash:"#ffffff",WrinklerSound:1,WrinklerVolume:100,WrinklerSoundURL:"https://freesound.org/data/previews/124/124186_8043-lq.mp3",WrinklerMaxNotification:0,WrinklerMaxFlash:1,ColourWrinklerMaxFlash:"#ffffff",WrinklerMaxSound:1,WrinklerMaxVolume:100,WrinklerMaxSoundURL:"https://freesound.org/data/previews/152/152743_15663-lq.mp3",BulkBuyBlock:0,FavouriteSettings:1,Header:{Favourite:1,Calculation:1,Notation:1,Colours:1,BarsDisplay:1,Tooltip:1,Statistics:1,Notification:1,NotificationGeneral:1,NotificationGC:1,NotificationFC:1,NotificationSea:1,NotificationGard:1,NotificationMagi:1,NotificationWrink:1,NotificationWrinkMax:1,Miscellaneous:1,Lucky:1,Chain:1,Spells:1,Garden:1,Prestige:1,Wrink:1,Sea:1,Misc:1,InfoTab:1}},hn=function(e){if(1===e){const e=function(){try{Notification.requestPermission().then()}catch(e){return!1}return!0};"Notification"in window?e()?Notification.requestPermission().then():Notification.requestPermission():console.log("This browser does not support notifications.")}};function gn(){1===e.BotBar?(l("CMBotBar").style.display="",yo()):l("CMBotBar").style.display="none",ko()}function fn(){BeautifyAll(),Game.RefreshStore(),Game.RebuildUpgrades(),yo(),so(),po()}function Cn(){1===e.Favicon&&y>0?ct.wrath?l("CMFavicon").href="https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico":l("CMFavicon").href="https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico":l("CMFavicon").href="https://orteil.dashnet.org/cookieclicker/favicon.ico"}class yn{constructor(e,t){this.type=e,this.group=t}}class bn extends yn{constructor(e,t,o){super(e,t),this.desc=o}}class kn extends yn{constructor(e,t,o,n,i,a){super(e,t),this.label=o,this.desc=n,this.min=i,this.max=a}}class Gn extends yn{constructor(e,t,o,n,i,a){super(e,t),this.label=o,this.desc=n,this.toggle=i,void 0!==a&&(this.func=a)}}class vn extends yn{constructor(e,t,o,n){super(e,t),this.label=o,this.desc=n;for(let e=0;e<101;e++)this.label[e]=`${e}%`}}const wn={CPSMode:new Gn("bool","Calculation",["Current cookies per second","Average cookies per second"],"Calculate times using current cookies per second or average cookies per second",!1),AvgCPSHist:new Gn("bool","Calculation",["Average CPS in past 10s","Average CPS in past 15s","Average CPS in past 30s","Average CPS in past 1m","Average CPS in past 5m","Average CPS in past 10m","Average CPS in past 15m","Average CPS in past 30m"],"How much time average Cookies Per Second should consider",!1),AvgClicksHist:new Gn("bool","Calculation",["Average clicks in past 1s","Average clicks in past 5s","Average clicks in past 10s","Average clicks in past 15s","Average clicks in past 30s"],"How much time average Cookie Clicks should consider",!1),CalcWrink:new Gn("bool","Calculation",["Calculate with wrinklers OFF","Calculate with wrinklers ON","Calculate with single fattest wrinkler ON"],"Calculate times and average Cookies Per Second with (only the single non-shiny fattest) wrinklers",!0,(()=>{se=!0})),Scale:new Gn("bool","Notation",["Game's setting scale","Metric","Short scale","Short scale (Abbreviated)","Scientific notation","Engineering notation"],"Change how long numbers are formatted",!1,(()=>{fn()})),ScaleDecimals:new Gn("bool","Notation",["1 decimals","2 decimals","3 decimals"],'Set the number of decimals used when applicable. This only works with Cookie Monster scales and not with "Game\'s Setting Scale"',!1,(()=>{fn()})),ScaleSeparator:new Gn("bool","Notation",[". for decimals (standard)",". for thousands"],"Set the separator used for decimals and thousands",!1,(()=>{fn()})),ScaleCutoff:new kn("numscale","Notation","Notation cut-off point: ","The number from which Cookie Monster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations",1,999999999),TimeFormat:new Gn("bool","Notation",["Time XXd, XXh, XXm, XXs","Time XX:XX:XX:XX:XX"],"Change the time format",!1),DetailedTime:new Gn("bool","Notation",["Detailed time OFF","Detailed time ON"],"Change how time is displayed in certain statistics and tooltips",!0,(()=>{1===e.DetailedTime?Game.sayTime=Vt:Game.sayTime=M.sayTime})),PPDisplayTime:new Gn("bool","Notation",["PP as value (standard)","PP as time unit"],"Display PP as calculated value or as approximate time unit. Note that PP does not translate directly into a time unit and this is therefore only an approximation.",!1),BuildColour:new Gn("bool","Colours",["Building colours OFF","Building colours ON"],"Colour code buildings",!0,(()=>{so()})),PPOnlyConsiderBuyable:new Gn("bool","Colours",["Don't ignore non-buyable","Ignore non-buyable"],"Makes Cookie Monster label buildings and upgrades you can't buy right now red, useful in those situations where you just want to spend your full bank 'most optimally'",!0),PPExcludeTop:new Gn("bool","Colours",["Don't ignore any","Ignore 1st best","Ignore 1st and 2nd best","Ignore 1st, 2nd and 3rd best"],"Makes Cookie Monster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values",!0),PPRigidelMode:new Gn("bool","Colours",["Rigidel mode OFF","Rigidel mode ON"],'Makes Cookie Monster ignore all "buy 1" options when colouring PP in order to stay at a total building count ending in 10 for pantheon god Rigidel',!0),PPSecondsLowerLimit:new kn("numscale","Colours","Lower limit for PP (in seconds): ",'If a building or upgrade costs less than the specified seconds of CPS it will also be considered optimal and label it as such ("PP is less than xx seconds of CPS"); setting to 0 ignores this option',0,1/0),ColourBlue:new bn("colour","Colours","Standard colour is blue. Used to show upgrades better than best PP building, for Click Frenzy bar, and for various labels"),ColourGreen:new bn("colour","Colours","Standard colour is green. Used to show best PP building, for Blood Frenzy bar, and for various labels"),ColourYellow:new bn("colour","Colours","Standard colour is yellow. Used to show buildings within the top 10 of PP, for Frenzy bar, and for various labels"),ColourOrange:new bn("colour","Colours","Standard colour is orange. Used to show buildings within the top 20 of PP, for Next Reindeer bar, and for various labels"),ColourRed:new bn("colour","Colours","Standard colour is Red. Used to show buildings within the top 30 of PP, for Clot bar, and for various labels"),ColourPurple:new bn("colour","Colours","Standard colour is purple. Used to show buildings outside of the top 30 of PP, for Next Cookie bar, and for various labels"),ColourGray:new bn("colour","Colours","Standard colour is gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar"),ColourPink:new bn("colour","Colours","Standard colour is pink. Used for Dragonflight bar"),ColourBrown:new bn("colour","Colours","Standard colour is brown. Used for Dragon Harvest bar"),BotBar:new Gn("bool","BarsDisplay",["Bottom bar OFF","Bottom bar ON"],"Building information",!0,(()=>{gn()})),TimerBar:new Gn("bool","BarsDisplay",["Timer bar OFF","Timer bar ON"],"Bar with timers for golden cookie, season popup, Frenzy (Normal, Clot, Elder), Click Frenzy",!0,(()=>{Go()})),TimerBarPos:new Gn("bool","BarsDisplay",["Timer bar position (top left)","Timer bar position (bottom)"],"Placement of the timer bar",!1,(()=>{0===e.TimerBarPos?(l("CMTimerBar").style.width="30%",l("CMTimerBar").style.bottom="",l("game").insertBefore(l("CMTimerBar"),l("sectionLeft"))):(l("CMTimerBar").style.width="100%",l("CMTimerBar").style.bottom="0px",l("wrapper").appendChild(l("CMTimerBar"))),ko()})),TimerBarOverlay:new Gn("bool","BarsDisplay",["Timer bar overlay OFF","Timer bar overlay only seconds","Timer bar overlay full"],"Overlay on timers displaying seconds and/or percentage left",!0),UpBarColour:new Gn("bool","BarsDisplay",["Upgrade colours/bar OFF","Upgrade colours with bar ON","Upgrade colours without bar ON"],"Colour code upgrades and optionally add a counter bar",!1,(()=>{1===e.UpBarColor?(l("CMUpgradeBar").style.display="",po()):2===e.UpBarColor?(l("CMUpgradeBar").style.display="none",po()):(l("CMUpgradeBar").style.display="none",Game.RebuildUpgrades())})),UpgradeBarFixedPos:new Gn("bool","BarsDisplay",["Upgrade bar fixed position OFF","Upgrade bar fixed position ON"],"Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling",!0,(()=>{1===e.UpgradeBarFixedPos?(l("CMUpgradeBar").style.position="sticky",l("CMUpgradeBar").style.top="0px"):l("CMUpgradeBar").style.position=""})),SortBuildings:new Gn("bool","BarsDisplay",["Sort buildings: default","Sort buildings: PP of x1 purchase","Sort buildings: PP of selected bulk mode"],"Sort the display of buildings in either default order or by PP",!1,(()=>{so()})),SortUpgrades:new Gn("bool","BarsDisplay",["Sort upgrades: default","Sort upgrades: PP"],"Sort the display of upgrades in either default order or by PP",!1,(()=>{po()})),UpgradesNeverCollapse:new Gn("bool","BarsDisplay",["Upgrades always expanded OFF","Upgrades always expanded ON"],"Toggle to make the upgrades sections always expanded to the size needed to display all upgrades",!0,(()=>{co()})),DragonAuraInfo:new Gn("bool","BarsDisplay",["Extra dragon aura info OFF","Extra dragon aura info ON"],"Shows information about changes in CPS and costs in the dragon aura interface.",!0),GrimoireBar:new Gn("bool","BarsDisplay",["Grimoire magic meter timer OFF","Grimoire magic meter timer ON"],"A timer on how long before the Grimoire magic meter is full",!0),GCTimer:new Gn("bool","BarsDisplay",["Golden cookie timer OFF","Golden cookie timer ON"],"A timer on the golden cookie when it has been spawned",!0,(()=>{1===e.GCTimer?Object.keys(ao).forEach((e=>{ao[e].style.display="block",ao[e].style.left=ht[e].l.style.left,ao[e].style.top=ht[e].l.style.top})):Object.keys(ao).forEach((e=>ao[e].style.display="none"))})),Favicon:new Gn("bool","BarsDisplay",["Favicon OFF","Favicon ON"],"Update favicon with golden/wrath cookie",!0,(()=>{Cn()})),WrinklerButtons:new Gn("bool","BarsDisplay",["Extra wrinkler buttons OFF","Extra wrinkler buttons ON"],"Show buttons for popping wrinklers at bottom of cookie section",!0,(()=>{t()})),HideSectionsButtons:new Gn("bool","BarsDisplay",["Hide buildings/upgrades button OFF","Hide buildings/upgrades button ON"],"Show buttons for hiding and showing the buildings and upgrades sections in the right column",!0,(()=>{e.HideSectionsButtons?l("CMSectionHidButtons").style.display="":l("CMSectionHidButtons").style.display="none"})),TooltipBuildUpgrade:new Gn("bool","Tooltip",["Building/upgrade tooltip information OFF","Building/upgrade tooltip information ON"],"Extra information in building/upgrade tooltips",!0),TooltipAmor:new Gn("bool","Tooltip",["Buildings tooltip amortization information OFF","Buildings tooltip amortization information ON"],"Add amortization information to buildings tooltip",!0),ToolWarnLucky:new Gn("bool","Tooltip",["Tooltip lucky warning OFF","Tooltip lucky warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards',!0),ToolWarnLuckyFrenzy:new Gn("bool","Tooltip",["Tooltip lucky frenzy warning OFF","Tooltip lucky frenzy warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards',!0),ToolWarnConjure:new Gn("bool","Tooltip",["Tooltip conjure warning OFF","Tooltip conjure warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards',!0),ToolWarnConjureFrenzy:new Gn("bool","Tooltip",["Tooltip conjure frenzy warning OFF","Tooltip conjure frenzy warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards with Frenzy active',!0),ToolWarnEdifice:new Gn("bool","Tooltip",["Tooltip edifice warning OFF","Tooltip edifice warning ON"],'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building',!0),ToolWarnUser:new kn("numscale","Tooltip","Tooltip warning at x times CPS: ","Use this to show a customized warning if buying it will put the bank under the amount equal to value times cps; setting to 0 disables the function altogether",0,1/0),ToolWarnBon:new Gn("bool","Tooltip",["Calculate tooltip warning with bonus CPS OFF","Calculate tooltip warning with bonus CPS ON"],"Calculate the warning with or without the bonus CPS you get from buying",!0),ToolWarnPos:new Gn("bool","Tooltip",["Tooltip warning position (left)","Tooltip warning position (bottom)"],"Placement of the warning boxes",!1,(()=>{Io()})),TooltipGrim:new Gn("bool","Tooltip",["Grimoire tooltip information OFF","Grimoire tooltip information ON"],"Extra information in tooltip for grimoire",!0),TooltipWrink:new Gn("bool","Tooltip",["Wrinkler tooltip OFF","Wrinkler tooltip ON"],"Shows the amount of cookies a wrinkler will give when popping it",!0),TooltipLump:new Gn("bool","Tooltip",["Sugar lump tooltip OFF","Sugar lump tooltip ON"],"Shows the current Sugar Lump type in Sugar lump tooltip.",!0),TooltipPlots:new Gn("bool","Tooltip",["Garden plots tooltip OFF","Garden plots tooltip ON"],"Shows a tooltip for plants that have a cookie reward.",!0),TooltipPantheon:new Gn("bool","Tooltip",["Pantheon tooltip OFF","Pantheon tooltip ON"],"Shows additional info in the pantheon tooltip",!0),TooltipAscendButton:new Gn("bool","Tooltip",["Show Extra Info Ascend Tooltip OFF","Show Extra Info Ascend Tooltip ON"],"Shows additional info in the ascend tooltip",!0),Stats:new Gn("bool","Statistics",["Statistics OFF","Statistics ON"],"Extra Cookie Monster statistics!",!0),MissingUpgrades:new Gn("bool","Statistics",["Missing upgrades OFF","Missing upgrades ON"],"Shows missing upgrades in statistics menu",!0),MissingAchievements:new Gn("bool","Statistics",["Missing Achievements OFF","Missing Normal Achievements ON"],"Shows missing normal achievements in statistics menu.",!0),UpStats:new Gn("bool","Statistics",["Statistics update rate (default)","Statistics update rate (1s)"],"Default rate is once every 5 seconds",!1),HeavenlyChipsTarget:new kn("numscale","Statistics","Heavenly chips target: ",'Use this to set a heavenly chips target that will be counted towards in the "prestige" statsistics sections',1,1/0),ShowMissedGC:new Gn("bool","Statistics",["Missed GC OFF","Missed GC ON"],"Show a stat in the statistics screen that counts how many golden cookies you have missed",!0),Title:new Gn("bool","NotificationGeneral",["Title OFF","Title ON","Title pinned tab highlight"],'Update title with colden cookie/season popup timers; pinned tab highlight only changes the title when a golden cookie/season popup spawns; "!" means that golden cookie/reindeer can spawn',!0),GeneralSound:new Gn("bool","NotificationGeneral",["Consider game volume setting OFF","Consider game volume setting ON"],'Turning this toggle to "off" makes Cookie Monster no longer consider the volume setting of the base game, allowing mod notifications to play with base game volume turned down',!0),GCNotification:new Gn("bool","NotificationGC",["Notification OFF","Notification ON"],"Create a notification when golden cookie spawns",!0,(()=>{hn(e.GCNotification)})),GCFlash:new Gn("bool","NotificationGC",["Flash OFF","Flash ON"],"Flash screen on golden cookie",!0),ColourGCFlash:new bn("colour","NotificationGC","The colour of the GC flash, standard colour is white"),GCSound:new Gn("bool","NotificationGC",["Sound OFF","Sound ON"],"Play a sound on golden cookie",!0),GCVolume:new vn("vol","NotificationGC",[],"Volume"),GCSoundURL:new Gn("url","NotificationGC","Sound URL:","URL of the sound to be played when a golden cookie spawns"),FortuneNotification:new Gn("bool","NotificationFC",["Notification OFF","Notification ON"],"Create a notification when fortune cookie is on the ticker",!0,(()=>{hn(e.FortuneNotification)})),FortuneFlash:new Gn("bool","NotificationFC",["Flash OFF","Flash ON"],"Flash screen on fortune cookie spawn",!0),ColourFortuneFlash:new bn("colour","NotificationFC","The colour of the fortune flash, standard colour is white"),FortuneSound:new Gn("bool","NotificationFC",["Sound OFF","Sound ON"],"Play a sound on fortune cookie spawn",!0),FortuneVolume:new vn("vol","NotificationFC",[],"Volume"),FortuneSoundURL:new Gn("url","NotificationFC","Sound URL:","URL of the sound to be played when the ticker has a fortune cookie"),SeaNotification:new Gn("bool","NotificationSea",["Notification OFF","Notification ON"],"Create a notification on season popup",!0,(()=>{hn(e.SeaNotification)})),SeaFlash:new Gn("bool","NotificationSea",["Flash OFF","Flash ON"],"Flash screen on season popup",!0),ColourSeaFlash:new bn("colour","NotificationSea","The colour of the season popup flash, standard colour is white"),SeaSound:new Gn("bool","NotificationSea",["Sound OFF","Sound ON"],"Play a sound on season popup",!0),SeaVolume:new vn("vol","NotificationSea",[],"Volume"),SeaSoundURL:new Gn("url","NotificationSea","Sound URL:","URL of the sound to be played when on season popup spawns"),GardFlash:new Gn("bool","NotificationGard",["Garden Tick Flash OFF","Flash ON"],"Flash screen on garden tick",!0),ColourGardFlash:new bn("colour","NotificationGard","The colour of the garden flash, standard colour is white"),GardSound:new Gn("bool","NotificationGard",["Sound OFF","Sound ON"],"Play a sound on garden tick",!0),GardVolume:new vn("vol","NotificationGard",[],"Volume"),GardSoundURL:new Gn("url","NotificationGard","Garden Tick Sound URL:","URL of the sound to be played when the garden ticks"),MagicNotification:new Gn("bool","NotificationMagi",["Notification OFF","Notification ON"],"Create a notification when magic reaches maximum",!0,(()=>{hn(e.MagicNotification)})),MagicFlash:new Gn("bool","NotificationMagi",["Flash OFF","Flash ON"],"Flash screen when magic reaches maximum",!0),ColourMagicFlash:new bn("colour","NotificationMagi","The colour of the magic flash, standard colour is white"),MagicSound:new Gn("bool","NotificationMagi",["Sound OFF","Sound ON"],"Play a sound when magic reaches maximum",!0),MagicVolume:new vn("vol","NotificationMagi",[],"Volume"),MagicSoundURL:new Gn("url","NotificationMagi","Sound URL:","URL of the sound to be played when magic reaches maxium"),WrinklerNotification:new Gn("bool","NotificationWrink",["Notification OFF","Notification ON"],"Create a notification when a wrinkler appears",!0,(()=>{hn(e.WrinklerNotification)})),WrinklerFlash:new Gn("bool","NotificationWrink",["Flash OFF","Flash ON"],"Flash screen when a wrinkler appears",!0),ColourWrinklerFlash:new bn("colour","NotificationWrink","The colour of the wrinkler flash, standard colour is white"),WrinklerSound:new Gn("bool","NotificationWrink",["Sound OFF","Sound ON"],"Play a sound when a wrinkler appears",!0),WrinklerVolume:new vn("vol","NotificationWrink",[],"Volume"),WrinklerSoundURL:new Gn("url","NotificationWrink","Sound URL:","URL of the sound to be played when a wrinkler appears"),WrinklerMaxNotification:new Gn("bool","NotificationWrinkMax",["Notification OFF","Notification ON"],"Create a notification when the maximum amount of wrinklers has appeared",!0,(()=>{hn(e.WrinklerMaxNotification)})),WrinklerMaxFlash:new Gn("bool","NotificationWrinkMax",["Flash OFF","Flash ON"],"Flash screen when the maximum amount of Wrinklers has appeared",!0),ColourWrinklerMaxFlash:new bn("colour","NotificationWrinkMax","The colour of the maximum wrinkler flash, standard colour is white"),WrinklerMaxSound:new Gn("bool","NotificationWrinkMax",["Sound OFF","Sound ON"],"Play a sound when the maximum amount of wrinklers has appeared",!0),WrinklerMaxVolume:new vn("vol","NotificationWrinkMax",[],"Volume"),WrinklerMaxSoundURL:new Gn("url","NotificationWrinkMax","Sound URL:","URL of the sound to be played when the maximum amount of wrinklers has appeared"),BulkBuyBlock:new Gn("bool","Miscellaneous",["Block bulk buying OFF","Block bulk buying ON"],"Block clicking bulk buying when you can't buy all. This prevents buying 7 of a building when you are in buy-10 or buy-100 mode.",!0),FavouriteSettings:new Gn("bool","Miscellaneous",["Favourite settings section OFF","Favourite settings section ON","Favourite settings section ON (Locked)"],"Show stars before each setting which allows selecting it for a 'favourites' section at the top of the Cookie Monster settings. Setting this to Locked removes the stars but shows the 'favourites' section",!0,(()=>{Game.UpdateMenu()}))};function xn(){return JSON.stringify({favouriteSettings:lo,settings:e,version:"2.031.7"})}function Tn(){if(ge!==Game.dragonLevel||se){if(Game.dragonLevel<25&&Game.dragonLevels[Game.dragonLevel].buy.toString().includes("sacrifice")){let e=Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1];const t=Game.dragonLevels[Game.dragonLevel].buy.toString().match(/sacrifice\((.*?)\)/)[1];if("i"!==e)if(e=e.replaceAll("'",""),Game.Objects[e].amount{if(e=n,Game.Objects[e].amount{Ct[e]=To(e)})),yt=[],Object.keys(Game.Upgrades).forEach((e=>{yt[e]=Mo(e)})),bt=[],Object.keys(Game.Achievements).forEach((e=>{bt[e]=wo(e)})),So()}let Bn=!1;function Pn(t,o,n){(1===e[o]||n)&&3===t&&!1===Bn||1===t?(l("CMFlashScreen").style.backgroundColor=e[`Colour${o}`],l("CMFlashScreen").style.opacity="0.5",3===t?(l("CMFlashScreen").style.display="inline",setTimeout((()=>{Pn(2,o,!0)}),1e3/Game.fps)):setTimeout((()=>{Pn(0,o,!0)}),1e3/Game.fps)):2===t?(l("CMFlashScreen").style.opacity="1",setTimeout((()=>{Pn(1,o,!0)}),1e3/Game.fps)):0===t&&(l("CMFlashScreen").style.display="none")}function En(t,o,n,i){if((1===e[o]||i)&&!1===Bn){const o=new Audio(t);e.GeneralSound?o.volume=e[n]/100*(Game.volume/100):o.volume=e[n]/100,o.play()}}function Nn(t,o,n){1===e[t]&&"hidden"===document.visibilityState&&!1===Bn&&new Notification(o,{body:n,badge:"https://orteil.dashnet.org/cookieclicker/favicon.ico"})}function On(){if(no!==Game.OnAscend&&(no=Game.OnAscend,Game.OnAscend?(l("game").style.bottom="0px",1===e.BotBar&&(l("CMBotBar").style.display="none"),1===e.TimerBar&&(l("CMTimerBar").style.display="none")):(gn(),Go()),bo()),!Game.OnAscend&&0===Game.AscendTimer){r!==Object.keys(Game.mods).length&&(Sn(),un(),r=Object.keys(Game.mods).length),se&&(dn(),tn(),Game.Has("Golden switch [off]")?(So(),yt["Golden switch [off]"].bought=0,Fo(),Se=de):Se=Game.cookiesPs,cn(),sn(),rn(),nn(),Tn(),function(){for(let e=0;e<11;e+=1)for(let t=0;t<3;t+=1)ft[e][t]=Mn(e,t)}(),ln(),function(){let e=0;if(Game.Objects.Bank.minigameLoaded){const t=Game.Objects.Bank.minigame.goods;let o=0;Object.keys(t).forEach((e=>{const n=t[e];o+=n.stock*n.val})),e+=o*Game.cookiesPsRawHighest}e+=function(){let e=0;So();let t=2;5!==ne&&18!==ne||(t-=1),5!==ie&&18!==ie||(t-=1),ne=5,ie=18;for(let e=0;e{Ct[t].amount>0&&(e=t)})),Ct[e].amount-=1,K-=1}return Object.keys(Ct).forEach((t=>{const o=Ct[t];e+=Mt(Game.Objects[o.name],Game.Objects[t].basePrice,o.amount,Game.Objects[t].free,o.amount)})),e}(),gt=e}(),se=0);const t=Game.auraMult("Fierce Hoarder")>0;!Y&&t?(Y=!0,q=1):Y&&!t&&(Y=!1,q=1),q&&(en(),q=0),function(){pn(),Ko(),function(){Re=0;let e=0;Object.keys(Game.wrinklers).forEach((t=>{2===Game.wrinklers[t].phase&&(e+=1)}));let t=1;if(Ct.Temple.minigameLoaded){const e=Game.hasGod("scorn");1===e?t*=1.15:2===e?t*=1.1:3===e&&(t*=1.05)}Ie=e,Re=e*(.05*e*1.1)*(.05*Game.Has("Sacrilegious corruption")+1)*(.05*Game.Has("Wrinklerspawn")+1)*t}(),Xo(),an();const e=Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset);pt=uo(e/ho())}(),f!==(Game.TickerEffect&&"fortune"===Game.TickerEffect.type)&&(f=Game.TickerEffect&&"fortune"===Game.TickerEffect.type,f&&(Pn(3,"FortuneFlash",!1),En(e.FortuneSoundURL,"FortuneSound","FortuneVolume",!1),Nn("FortuneNotification","Fortune Cookie found","A Fortune Cookie has appeared on the Ticker."))),g!==Game.shimmerTypes.reindeer.spawned&&(g=Game.shimmerTypes.reindeer.spawned,Object.keys(Game.shimmers).forEach((e=>{Game.shimmers[e].spawnLead&&"reindeer"===Game.shimmers[e].type&&(dt=Game.shimmers[e])})),Pn(3,"SeaFlash",!1),En(e.SeaSoundURL,"SeaSound","SeaVolume",!1),Nn("SeaNotification","Reindeer sighted!","A Reindeer has spawned. Click it now!")),Game.Objects.Farm.minigameLoaded&&C!==Game.Objects.Farm.minigame.nextStep&&(0!==C&&C0){let t=0;Object.keys(Game.wrinklers).forEach((e=>{2===Game.wrinklers[e].phase&&(t+=1)})),t>v?(v=t,t===Game.getWrinklersMax()&&e.WrinklerMaxFlash?Pn(3,"WrinklerMaxFlash",!1):Pn(3,"WrinklerFlash",!1),t===Game.getWrinklersMax()&&e.WrinklerMaxSound?En(e.WrinklerMaxSoundURL,"WrinklerMaxSound","WrinklerMaxVolume",!1):En(e.WrinklerSoundURL,"WrinklerSound","WrinklerVolume",!1),t===Game.getWrinklersMax()&&e.WrinklerMaxNotification?Nn("WrinklerMaxNotification","Maximum Wrinklers Reached","You have reached your maximum ammount of wrinklers"):Nn("WrinklerNotification","A Wrinkler appeared","A new wrinkler has appeared")):v=t}}()}G=0,ht={},Object.keys(Game.shimmers).forEach((e=>{ht[Game.shimmers[e].id]=Game.shimmers[e],Game.shimmers[e].spawnLead&&"golden"===Game.shimmers[e].type&&(ct=Game.shimmers[e],G+=1)})),Object.keys(ao).forEach((e=>{void 0===ht[e]&&(ao[e].parentNode.removeChild(ao[e]),delete ao[e])})),y!==Game.shimmerTypes.golden.n?(y=Game.shimmerTypes.golden.n,y&&(b{void 0===ao[Game.shimmers[t].id]&&function(t){const o=document.createElement("div");o.id=`GCTimer${t.id}`,o.style.width="96px",o.style.height="96px",o.style.position="absolute",o.style.zIndex="10000000001",o.style.textAlign="center",o.style.lineHeight="96px",o.style.fontFamily='"Kavoon", Georgia, serif',o.style.fontSize="35px",o.style.cursor="pointer",o.style.display="block",0===e.GCTimer&&(o.style.display="none"),o.style.left=t.l.style.left,o.style.top=t.l.style.top,o.onclick=function(){t.pop()},o.onmouseover=function(){t.l.style.filter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))",t.l.style.webkitFilter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))"},o.onmouseout=function(){t.l.style.filter="",t.l.style.webkitFilter=""},ao[t.id]=o,l("shimmers").appendChild(o)}(Game.shimmers[t])}))),Cn(),b=G,0===G&&(ct=0)):1===e.GCTimer&&y&&Object.keys(ao).forEach((e=>{ao[e].style.opacity=ht[e].l.style.opacity,ao[e].style.transform=ht[e].l.style.transform,ao[e].textContent=Math.ceil(ht[e].life/Game.fps)}))}function Fn(){let t="";for(let o=0;o{void 0===e[t]?(o=!0,e[t]=mn[t]):"Header"===t&&Object.keys(mn.Header).forEach((n=>{void 0!==e[t][n]&&e[t][n]>-1&&e[t][n]<2||(o=!0,e[t][n]=mn[t][n])}))})),o&&Ln(),On(),Object.keys(mn).forEach((e=>{"Header"!==e&&void 0!==wn[e].func&&wn[e].func()}))}else Wn(mn);Game.UpdateMenu(),Fn()}function An(){Object.keys(Game.wrinklers).forEach((e=>{Game.wrinklers[e].sucked>0&&0===Game.wrinklers[e].type&&(Game.wrinklers[e].hp=0)}))}function jn(t,o){if("b"===t){if(l("tooltip").innerHTML=Game.Objects[o].tooltip(),1===e.TooltipAmor){const e=Jo(Game.Objects[o],Game.Objects[o].basePrice,0,Game.Objects[o].free,Game.Objects[o].amount),t=e-Game.Objects[o].totalCookies;t>0&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split("so far").join(`so far
${P(t)} ${1===Math.floor(t)?"cookie":"cookies"} left to amortize (${mo((e-Game.Objects[o].totalCookies)/(Game.Objects[o].storedTotalCps*Game.globalCpsMult)).text})`))}-1===Game.buyMode&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split(P(Game.Objects[o].bulkPrice)).join(P((Game.Objects[o],Game.Objects[o].basePrice,Game.Objects[o].amount,Game.Objects[o].free,Game.buyBulk,1))))}else if("u"===t){if(!Game.UpgradesInStore[o])return"";l("tooltip").innerHTML=Game.crateTooltip(Game.UpgradesInStore[o],"store")}else"s"===t?l("tooltip").innerHTML=Game.lumpTooltip():"g"===t?l("tooltip").innerHTML=Game.Objects["Wizard tower"].minigame.spellTooltip(o)():"p"===t?l("tooltip").innerHTML=Game.ObjectsById[2].minigame.tileTooltip(o[0],o[1])():"ha"===t?l("tooltip").innerHTML=Game.ObjectsById[2].minigame.toolTooltip(1)():"wb"===t?l("tooltip").innerHTML="":"pag"===t?l("tooltip").innerHTML=Game.Objects.Temple.minigame.godTooltip(o)():"pas"===t&&(l("tooltip").innerHTML=Game.Objects.Temple.minigame.slotTooltip(o[0])());if("b"===t&&1===Game.buyMode||"u"===t||"s"===t||"g"===t||"p"===t&&!Game.keys[16]||"ha"===t||"wb"===t||"pag"===t||"pas"===t&&-1!==o[1]){const e=document.createElement("div");e.id="CMTooltipArea",l("tooltip").appendChild(e)}return eo=t,to=o,zo(),l("tooltip").innerHTML}function Dn(){Game.Objects["Wizard tower"].minigameLoaded&&Object.keys(Game.Objects["Wizard tower"].minigame.spellsById).forEach((e=>{null!==l(`grimoireSpell${e}`).onmouseover&&(x[e]=l(`grimoireSpell${e}`).onmouseover,l(`grimoireSpell${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(()=>jn("g",`${e}`)),"this"),Game.tooltip.wobble()})}))}function Hn(){if(!m&&Game.Objects["Wizard tower"].minigameLoaded){const{minigame:t}=Game.Objects["Wizard tower"];p=t.draw,Game.Objects["Wizard tower"].minigame.draw=function(){p(),1===e.GrimoireBar&&t.magic1&&(e.Header[t]=0),Ln()}function _n(t,o){const n=document.createElement("div");n.className="title",n.style.padding="0px 16px",n.style.opacity="0.7",n.style.fontSize="17px",n.style.fontFamily='"Kavoon", Georgia, serif',n.appendChild(document.createTextNode(`${t} `));const i=document.createElement("span");return i.style.cursor="pointer",i.style.display="inline-block",i.style.height="14px",i.style.width="14px",i.style.borderRadius="7px",i.style.textAlign="center",i.style.backgroundColor="#C0C0C0",i.style.color="black",i.style.fontSize="13px",i.style.verticalAlign="middle",i.textContent=e.Header[o]?"-":"+",i.onclick=function(){Vn(o),Game.UpdateMenu()},n.appendChild(i),n}function Qn(e,t,o,n){const i=document.createElement("div");i.className="listing";const a=document.createElement("b");if(a.textContent=t,i.appendChild(a),"withTooltip"===e){i.className="listing",i.appendChild(document.createTextNode(" "));const e=document.createElement("span");e.onmouseout=function(){Game.tooltip.hide()},e.onmouseover=function(){Game.tooltip.draw(this,escape(Ut[n].innerHTML))},e.style.cursor="default",e.style.display="inline-block",e.style.height="10px",e.style.width="10px",e.style.borderRadius="5px",e.style.textAlign="center",e.style.backgroundColor="#C0C0C0",e.style.color="black",e.style.fontSize="9px",e.style.verticalAlign="bottom",e.textContent="?",i.appendChild(e)}return i.appendChild(document.createTextNode(": ")),i.appendChild(o),i}function Xn(e){const t=document.createDocumentFragment();t.appendChild(document.createTextNode(`${e.length} `));const o=document.createElement("span");o.onmouseout=function(){Game.tooltip.hide()};const n=document.createElement("div"),i=document.createElement("div");i.style.minWidth="140px",i.style.marginBottom="4px";const a=document.createElement("div");return a.className="name",a.style.marginBottom="4px",a.style.textAlign="center",a.textContent="Missing",i.appendChild(a),Object.keys(e).forEach((t=>{const o=document.createElement("div");o.style.textAlign="center",o.appendChild(document.createTextNode(e[t])),i.appendChild(o)})),n.appendChild(i),o.onmouseover=function(){Game.tooltip.draw(this,escape(n.innerHTML))},o.style.cursor="default",o.style.display="inline-block",o.style.height="10px",o.style.width="10px",o.style.borderRadius="5px",o.style.textAlign="center",o.style.backgroundColor="#C0C0C0",o.style.color="black",o.style.fontSize="9px",o.style.verticalAlign="bottom",o.textContent="?",t.appendChild(o),t}function qn(t){const o=document.createElement("div");if(o.className="subsection",o.appendChild(t),o.appendChild(_n("Lucky Cookies","Lucky")),e.Header.Lucky&&o.appendChild(function(){const e=Game.auraMult("Dragon's Fortune")?"GoldCookDragonsFortuneTooltipPlaceholder":"GoldCookTooltipPlaceholder",t=document.createElement("div");t.className="CMStatsLuckySection";const o=Game.cookies+go(){Game.HasUnlocked(Do[e])||c.push(Do[e])})),0!==c.length&&e.appendChild(Qn("basic","Rare plant drops left to unlock",Xn(c))),e}())),o.appendChild(_n("Prestige","Prestige")),e.Header.Prestige&&o.appendChild(function(){const t=document.createElement("div");t.className="CMStatsPrestigeSection";const o=Math.floor(Game.HowMuchPrestige(lt+Game.cookiesReset+He+(Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg")?Le:0)));t.appendChild(Qn("withTooltip","Prestige level (cur / max)",document.createTextNode(`${P(Game.prestige)} / ${P(o)}`),"PrestMaxTooltipPlaceholder"));const n=Math.max(0,Game.HowManyCookiesReset(o+1)-(lt+Game.cookiesReset+He+(Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg")&&Le?Le:0))),i=document.createDocumentFragment();i.appendChild(document.createTextNode(P(n)));const a=document.createElement("small");a.textContent=` (${uo(n/st,1)})`,i.appendChild(a),t.appendChild(Qn("withTooltip","Cookies to next level",i,"NextPrestTooltipPlaceholder")),t.appendChild(Qn("withTooltip","Heavenly chips (cur / max)",document.createTextNode(`${P(Game.heavenlyChips)} / ${P(o-Game.prestige+Game.heavenlyChips)}`),"HeavenChipMaxTooltipPlaceholder")),t.appendChild(Qn("basic","Heavenly chips per second (last 5 seconds)",document.createTextNode(P(Ne,2))));const r=Number(e.HeavenlyChipsTarget);if(!Number.isNaN(r)){const e=r-Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned));e>0&&(t.appendChild(Qn("basic","Heavenly chips to target set in settings (cur)",document.createTextNode(P(e)))),t.appendChild(Qn("basic","Time till target (cur, current 5 second average)",document.createTextNode(uo(e/Ne)))))}const l=function(e){let t=Game.cookiesPs;So(),0===yt["Heavenly key"].bought&&(yt["Heavenly chip secret"].bought=1,yt["Heavenly cookie stand"].bought=1,yt["Heavenly bakery"].bought=1,yt["Heavenly confectionery"].bought=1,yt["Heavenly key"].bought=1,Fo(),t=de,So()),lt>=1e6&&Oo("Sacrifice"),lt>=1e9&&Oo("Oblivion"),lt>=1e12&&Oo("From scratch"),lt>=1e15&&Oo("Nihilism"),lt>=1e18&&Oo("Dematerialize"),lt>=1e21&&Oo("Nil zero zilch"),lt>=1e24&&Oo("Transcendence"),lt>=1e27&&Oo("Obliterate"),lt>=1e30&&Oo("Negative void"),lt>=1e33&&Oo("To crumbs, you say?"),lt>=1e36&&Oo("You get nothing"),lt>=1e39&&Oo("Humble rebeginnings"),lt>=1e42&&Oo("The end of the world"),lt>=1e45&&Oo("Oh, you're back"),lt>=1e48&&Oo("Lazarus"),lt>=1e51&&Oo("Smurf account"),lt>=1e54&&Oo("If at first you don't succeed"),yt["Heavenly chip secret"].bought=1,yt["Heavenly cookie stand"].bought=1,yt["Heavenly bakery"].bought=1,yt["Heavenly confectionery"].bought=1,yt["Heavenly key"].bought=1,oe=e;const o=ee;Fo(),Uo(),o!==ee&&Fo();const n=de-t;return oe=Game.prestige,n}(o),s=document.createDocumentFragment();s.appendChild(document.createTextNode(P(l)));const c=Math.round(l/Game.cookiesPs*1e4);if(Number.isFinite(c)&&0!==c){const e=document.createElement("small");e.textContent=` (${c/100}% of income)`,s.appendChild(e)}t.appendChild(Qn("withTooltip","Reset bonus income",s,"ResetTooltipPlaceholder"));const d=Math.floor(Game.HowMuchPrestige(Game.cookiesReset)),p=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned)),u=p-d;if(!Game.Has("Lucky digit")){let e=7-p%10;e<0&&(e+=10);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(Qn("basic",'Next "Lucky Digit" (total / reset)',i))}if(!Game.Has("Lucky number")){let e=777-p%1e3;e<0&&(e+=1e3);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(Qn("basic",'Next "Lucky Number" (total / reset)',i))}if(!Game.Has("Lucky payout")){let e=777777-p%1e6;e<0&&(e+=1e6);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(Qn("basic",'Next "Lucky Payout" (total / reset)',i))}return t}()),Game.cpsSucked>0&&(o.appendChild(_n("Wrinklers","Wrink")),e.Header.Wrink)){const e=document.createDocumentFragment();e.appendChild(document.createTextNode(`${P(He)} / ${P(Ue)} `));const t=document.createElement("a");t.textContent="Pop All Normal",t.className="option",t.onclick=function(){An()},e.appendChild(t),o.appendChild(Qn("basic","Rewards of Popping (All/Normal)",e));const n=document.createDocumentFragment();n.appendChild(document.createTextNode(`${P($e[0])} `));const i=document.createElement("a");i.textContent="Pop Single Fattest",i.className="option",i.onclick=function(){null!==$e[1]&&(Game.wrinklers[$e[1]].hp=0)},n.appendChild(i),o.appendChild(Qn("basic",`Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ${null!==$e[1]?$e[1]:"None"})`,n))}if(o.appendChild(function(){const t=document.createElement("div");t.className="CMStatsSeasonSection";let o=!1;const n=[];Object.keys(Wo).forEach((e=>{Game.Has(Wo[e])||(n.push(Wo[e]),o=!0)}));const i=[];Object.keys(Ao).forEach((e=>{Game.Has(Ao[e])||(i.push(Ao[e]),o=!0)}));const a=[];Object.keys(jo).forEach((e=>{Game.Has(jo[e])||(a.push(jo[e]),o=!0)}));const r=[];Object.keys(Game.eggDrops).forEach((e=>{Game.HasUnlocked(Game.eggDrops[e])||(r.push(Game.eggDrops[e]),o=!0)}));const l=[];Object.keys(Game.rareEggDrops).forEach((e=>{Game.HasUnlocked(Game.rareEggDrops[e])||(l.push(Game.rareEggDrops[e]),o=!0)}));const s=Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg"),c=Game.Has("Century egg");if(("christmas"===Game.season||o||s||c)&&(t.appendChild(_n("Season Specials","Sea")),e.Header.Sea)){if(0!==n.length){t.appendChild(Qn("basic","Halloween cookies left to buy",Xn(n)));let e=.95;if(Game.HasAchiev("Spooky cookies")&&(e=.8),Game.Has("Starterror")&&(e*=.9),e*=1/Game.dropRateMult(),Game.hasGod){const t=Game.hasGod("seasons");1===t?e*=.9:2===t?e*=.95:3===t&&(e*=.97)}const o=n.length/7;t.appendChild(Qn("basic","Chance of receiving a cookie from wrinkler/shiny wrinkler",document.createTextNode(`${P((1-e)*o*100)}% / ${P((1-.9*e)*o*100)}%`)))}if(0!==i.length){t.appendChild(Qn("basic","Christmas cookies left to buy",Xn(i)));let e=.8;if(Game.HasAchiev("Let it snow")&&(e=.6),e*=1/Game.dropRateMult(),Game.Has("Starsnow")&&(e*=.95),Game.hasGod){const t=Game.hasGod("seasons");1===t?e*=.9:2===t?e*=.95:3===t&&(e*=.97)}const o=i.length/7;t.appendChild(Qn("basic","Chance of receiving a cookie from reindeer",document.createTextNode(`${P((1-e)*o*100)}%`)))}0!==a.length&&t.appendChild(Qn("basic","Valentine cookies left to buy",Xn(a)));const e=function(e){let t=e*(1/Game.dropRateMult());if(Game.HasAchiev("Hide & seek champion")&&(t*=.7),Game.Has("Omelette")&&(t*=.9),Game.Has("Starspawn")&&(t*=.9),Game.hasGod){const e=Game.hasGod("seasons");1===e?t*=.9:2===e?t*=.95:3===e&&(t*=.97)}const o=1-t,n=Game.eggDrops.length-r.length,i=Game.rareEggDrops.length-l.length,a=.9*o*(1-n/Game.eggDrops.length),s=.1*o*(1-i/Game.rareEggDrops.length),c=.9*o*(n/Game.eggDrops.length)+.1*o*(i/Game.rareEggDrops.length);return[a+.9*c*(1-n/Game.eggDrops.length),s+.1*c*(1-i/Game.rareEggDrops.length)]};0!==r.length&&(t.appendChild(Qn("basic","Normal easter eggs left to unlock",Xn(r))),t.appendChild(Qn("basic","Chance of receiving an egg from wrinkler/golden cookie",document.createTextNode(`${P(100*e(.98)[0])}% / ${P(100*e(.9)[0])}%`)))),0!==l.length&&(t.appendChild(Qn("basic","Rare easter eggs left to unlock",Xn(l))),t.appendChild(Qn("basic","Chance of receiving a rare egg from wrinkler/golden cookie",document.createTextNode(`${P(100*e(.98)[1])}% / ${P(100*e(.9)[1])}%`)))),"christmas"===Game.season&&t.appendChild(Qn("basic","Reindeer reward",document.createTextNode(P(Fe)))),s&&t.appendChild(Qn("withTooltip","Chocolate egg cookies",document.createTextNode(P(Le)),"ChoEggTooltipPlaceholder")),c&&t.appendChild(Qn("basic","Century egg multiplier",document.createTextNode(Math.round(1e4*(Oe-1))/100+"%")))}return t}()),o.appendChild(_n("Miscellaneous","Misc")),e.Header.Misc){if(o.appendChild(Qn("basic",`Average cookies per second (past ${qt[e.AvgCPSHist]<60?`${qt[e.AvgCPSHist]} seconds`:qt[e.AvgCPSHist]/60+(3===e.AvgCPSHist?" minute":" minutes")})`,document.createTextNode(P(ho(),3)))),o.appendChild(Qn("basic",`Average cookie clicks per second (past ${Yt[e.AvgClicksHist]}${0===e.AvgClicksHist?" second":" seconds"})`,document.createTextNode(P(Ve,1)))),o.appendChild(Qn("basic",`Cookies from clicking (past ${Yt[e.AvgClicksHist]}${0===e.AvgClicksHist?" second":" seconds"})`,document.createTextNode(P(E.calcSum(Ve*Yt[e.AvgClicksHist]))))),Game.Has("Fortune cookies")){const e=[];Object.keys(Lo).forEach((t=>{Game.Has(Lo[t])||e.push(Lo[t])})),0!==e.length&&o.appendChild(Qn("basic","Fortune Upgrades Left to Buy",Xn(e)))}if(e.ShowMissedGC&&o.appendChild(Qn("basic","Missed golden cookies",document.createTextNode(P(Game.missedGoldenClicks)))),Game.prefs.autosave){const e=document.createElement("span");e.id="CMStatsAutosaveTimer",e.innerText=Game.sayTime(60*Game.fps-(Game.OnAscend?0:Game.T%(60*Game.fps)),4),o.appendChild(Qn("basic","Time till autosave",e))}}l("menu").insertBefore(o,l("menu").childNodes[2]),e.MissingUpgrades&&l("menu").childNodes.forEach((e=>{if(e.children[0])if("Prestige"===e.children[0].innerHTML&&Qe){const t=Qe.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesPrestigeTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing Prestige upgrades: ${t}/${Game.PrestigeUpgrades.length} (${Math.floor(t/Game.PrestigeUpgrades.length*100)}%)`,o.appendChild(n),e.appendChild(o);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Qe,e.appendChild(i)}else if("Upgrades"===e.children[0].innerHTML){if(_e){const t=_e.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing normal upgrades: ${t}/${Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length} (${Math.floor(t/(Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length)*100)}%)`,o.appendChild(n),e.insertBefore(o,e.childNodes[3]);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=_e,e.insertBefore(i,document.getElementById("CMMissingUpgradesTitle").nextSibling)}if(Xe){const t=Xe.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesCookiesTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing Cookie upgrades: ${t}/${Game.UpgradesByPool.cookie.length} (${Math.floor(t/Game.UpgradesByPool.cookie.length*100)}%)`,o.appendChild(n),e.appendChild(o);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Xe,e.appendChild(i)}}})),e.MissingAchievements&&function(){let t;Object.values(document.querySelectorAll("div.title")).forEach((e=>{e.textContent.includes("Achievements")&&(t=e.parentElement.querySelectorAll("div.listing.crateBox")[0])})),e.MissingAchievements&&Object.values(t.children).forEach((e=>{if(!e.className.includes("enabled")){const t=e.onclick.toString().split(/\[(.*)\]/gi)[1],{icon:o}=Game.AchievementsById[t];e.style.backgroundPosition=`${48*-o[0]}px ${48*-o[1]}px`,e.onmouseover=function(){Game.mouseDown||(Game.setOnCrate(this),Game.tooltip.dynamic=1,Game.tooltip.draw(this,(()=>function(e){const t=[];"shadow"===e.pool?t.push("Shadow Achievement","#9700cf"):t.push("Achievement",0),t.push("Locked",0);let o=0;(Game.Has("Neuromancy")||Game.sesame&&"debug"===e.pool)&&(o=1),o&&0===e.won?t.push("Click to win!","#00c462"):o&&e.won>0&&t.push("Click to lose!","#00c462");let{icon:n}=e;e.iconFunction&&(n=e.iconFunction());let{desc:i}=e;e.descFunc&&(i=e.descFunc("stats"));let a="";for(let e=0;e[${t[e]}]`);return a=a.substring(1),`
\n
\n
${e.name}
\n ${a}
${i}
\n ${Game.sesame?`
Id : ${e.id} | Order : ${Math.floor(e.order)}${e.tier?` | Tier : ${e.tier}`:""}
`:""}`}(Game.AchievementsById[t])),"top"),Game.tooltip.wobble())}}}))}()}const Yn={Favourite:"Favourite Settings",Calculation:"Calculation",Notation:"Notation",Colours:"Colours and colour coding",BarsDisplay:"Infobars and visual settings",Tooltip:"Tooltips",Statistics:"Statistics",Notification:"Notifications",Miscellaneous:"Miscellaneous"},Kn={NotificationGeneral:"General Notifications",NotificationGC:"Golden Cookie",NotificationFC:"Fortune Cookie",NotificationSea:"Season Special",NotificationGard:"Garden Tick",NotificationMagi:"Full Magic Bar",NotificationWrink:"Wrinkler",NotificationWrinkMax:"Maximum Wrinklers"};function Jn(t,o){const n=document.createElement("div");n.className="title",n.style.opacity="0.7",n.style.fontSize="17px",n.appendChild(document.createTextNode(`${o} `));const i=document.createElement("span");return i.style.cursor="pointer",i.style.display="inline-block",i.style.height="14px",i.style.width="14px",i.style.borderRadius="7px",i.style.textAlign="center",i.style.backgroundColor="#C0C0C0",i.style.color="black",i.style.fontSize="13px",i.style.verticalAlign="middle",i.textContent=e.Header[t]?"-":"+",i.onclick=function(){Vn(t),Game.UpdateMenu()},n.appendChild(i),n}function Zn(t){const o=document.createElement("div");if(o.className="listing",1===e.FavouriteSettings&&o.appendChild(function(e){const t=document.createElement("a");return lo.includes(e)?(t.innerText="★",t.style.color="yellow"):t.innerText="☆",t.className="option",t.onclick=function(){!function(e){lo.includes(e)?lo=lo.filter((t=>t!==e)):lo.push(e)}(e),Ln(),Game.UpdateMenu()},t.onmouseover=function(){Game.tooltip.draw(this,escape(Ut.FavouriteSettingPlaceholder.innerHTML))},t.onmouseout=function(){Game.tooltip.hide()},t.appendChild(document.createTextNode(" ")),t}(t)),"bool"===wn[t].type){const n=document.createElement("a");wn[t].toggle&&0===e[t]?n.className="option off":n.className="option",n.id=In+t,n.onclick=function(){!function(t){e[t]+=1,e[t]===wn[t].label.length?(e[t]=0,wn[t].toggle&&(l(In+t).className="option off")):l(In+t).className="option",void 0!==wn[t].func&&wn[t].func(),Ln()}(t),Game.UpdateMenu()},n.textContent=wn[t].label[e[t]],o.appendChild(n);const i=document.createElement("label");return i.textContent=wn[t].desc,i.style.lineHeight="1.6",o.appendChild(i),o}if("vol"===wn[t].type){const n=document.createElement("div");n.className="sliderBox";const i=document.createElement("div");i.style.float="left",i.innerHTML=wn[t].desc,n.appendChild(i);const a=document.createElement("div");a.id=`slider${t}right`,a.style.float="right",a.innerHTML=`${e[t]}%`,n.appendChild(a);const r=document.createElement("input");r.className="slider",r.id=`slider${t}`,r.style.clear="both",r.type="range",r.min="0",r.max="100",r.step="1",r.value=e[t],r.oninput=function(){zn(t),Game.UpdateMenu()},r.onchange=function(){zn(t),Game.UpdateMenu()},n.appendChild(r),o.appendChild(n);const l=document.createElement("a");return l.className="option",l.onclick=function(){En(e[t.replace("Volume","SoundURL")],t.replace("Volume","Sound"),t,!0)},l.textContent="Test sound",o.appendChild(l),o}if("url"===wn[t].type){const n=document.createElement("span");n.className="option",n.textContent=`${wn[t].label} `,n.style.lineHeight="1.6",o.appendChild(n);const i=document.createElement("input");i.id=In+t,i.className="option",i.type="text",i.readOnly=!0,i.setAttribute("value",e[t]),i.style.width="300px",o.appendChild(i),o.appendChild(document.createTextNode(" "));const a=document.createElement("input");a.id=`${In+t}Prompt`,a.className="option",a.type="text",a.setAttribute("value",e[t]);const r=document.createElement("a");r.className="option",r.onclick=function(){!function(e,t){Game.promptWrapL.className="framed";const o=e;Game.promptL.innerHTML=`${o}
`,Object.keys(t).forEach((e=>{const o=document.createElement("a");o.id=`promptOption${e}`,o.className="option",o.onclick=function(){PlaySound("snd/tick.mp3"),t[e][1]()},o.textContent=t[e][0],Game.promptL.children[1].appendChild(o)})),Game.promptAnchorL.style.display="block",Game.darkenL.style.display="block",Game.promptL.focus(),Game.promptOn=1,Game.UpdatePrompt()}(a.outerHTML,[["Save",function(){e[t]=l(`CMConfig${t}Prompt`).value,Ln(),Game.ClosePrompt(),Game.UpdateMenu()}],["Cancel",function(){Game.ClosePrompt()}]])},r.textContent="Edit",o.appendChild(r);const s=document.createElement("label");return s.textContent=wn[t].desc,s.style.lineHeight="1.6",o.appendChild(s),o}if("colour"===wn[t].type){const n=document.createElement("span");n.className="option";const i=document.createElement("input");i.id=t,i.style.width="65px",i.setAttribute("value",e[t]),n.appendChild(i),new $n(i,{hash:!0,position:"right",onInput:function(){e[this.targetElement.id]=this.toHEXString(),Fn(),Ln(),Game.UpdateMenu()}});const a=document.createElement("label");if(a.textContent=wn[t].desc,a.style.lineHeight="1.6",n.appendChild(a),t.includes("Flash")){const e=document.createElement("a");e.className="option",e.onclick=function(){Pn(3,t.replace("Colour",""),!0)},e.textContent="Test flash",n.appendChild(e)}return o.appendChild(n),Rn().init(),o}if("numscale"===wn[t].type){const n=document.createElement("span");n.className="option",n.textContent=`${wn[t].label} `,n.style.lineHeight="1.6",o.appendChild(n);const i=document.createElement("input");i.id=In+t,i.className="option",i.type="number",i.value=e[t],i.min=wn[t].min,i.max=wn[t].max,i.oninput=function(){e[t]=this.value,Ln(),fn(),Game.UpdateMenu()},o.appendChild(i),o.appendChild(document.createTextNode(" "));const a=document.createElement("label");return a.textContent=wn[t].desc,a.style.lineHeight="1.6",o.appendChild(a),o}return o}function ei(t){if(1===e.TimerBar&&0===e.TimerBarPos){const e=parseInt(l("CMTimerBar").style.height,10);Game.mouseY-=e,t(),Game.mouseY+=e}else t()}function ti(){M.Beautify=Beautify,Beautify=P,M.CalculateGains=Game.CalculateGains,Game.CalculateGains=function(){M.CalculateGains(),se=1,S=Date.now(),B=Date.now()},M.tooltip={},M.tooltip.draw=Game.tooltip.draw,M.tooltip.drawMod=new Function(`return ${Game.tooltip.draw.toString().split("this").join("Game.tooltip")}`)(),Game.tooltip.draw=function(e,t,o){M.tooltip.drawMod(e,t,o)},M.tooltip.update=Game.tooltip.update,M.tooltip.updateMod=new Function(`return ${Game.tooltip.update.toString().split("this.").join("Game.tooltip.")}`)(),Game.tooltip.update=function(){M.tooltip.updateMod(),function(){if("store"===Game.tooltip.origin){let t=0;1===e.ToolWarnLucky&&1===e.ToolWarnPos&&null!==l("CMDispTooltipWarningParent")&&(t=l("CMDispTooltipWarningParent").clientHeight-4),Game.tooltip.tta.style.top=`${Math.min(parseInt(Game.tooltip.tta.style.top,10),l("game").clientHeight+l("topBar").clientHeight-Game.tooltip.tt.clientHeight-t-46)}px`}}()},M.UpdateWrinklers=Game.UpdateWrinklers,Game.UpdateWrinklers=function(){ei(M.UpdateWrinklers)},M.UpdateSpecial=Game.UpdateSpecial,Game.UpdateSpecial=function(){ei(M.UpdateSpecial)},l("bigCookie").removeEventListener("click",Game.ClickCookie,!1),l("bigCookie").addEventListener("click",(()=>{ei(Game.ClickCookie)}),!1),M.RebuildUpgrades=Game.RebuildUpgrades,Game.RebuildUpgrades=function(){M.RebuildUpgrades(),T=[],Object.keys(Game.UpgradesInStore).forEach((e=>{null!==l(`upgrade${e}`).onmouseover&&(T[e]=l(`upgrade${e}`).onmouseover,l(`upgrade${e}`).onmouseover=function(){Game.mouseDown||(Game.setOnCrate(this),Game.tooltip.dynamic=1,Game.tooltip.draw(this,(()=>jn("u",`${e}`)),"store"),Game.tooltip.wobble())})})),Game.CalculateGains()},M.ClickProduct=Game.ClickProduct,Game.ClickProduct=function(t){(!e.BulkBuyBlock||Game.ObjectsById[t].bulkPrice-1;--e)if(Game.ObjectsById[e].amount>0){const o=Ct[Game.ObjectsById[e].name].name;Ct[o].amount-=1,K-=1,t=Ct[o].basePrice*Game.priceIncrease**Math.max(0,Ct[o].amount-1-Ct[o].free),t=Game.modifyBuildingPrice(Ct[o],t),t=Math.ceil(t);break}const o=ee;return Fo(),Uo(),o!==ee&&Fo(),[de-Game.cookiesPs,t]}(t),n=uo(o/(e+Game.cookiesPs));let i;i=0===Game.cookiesPs?P(1/0):P(e/Game.cookiesPs*100),l("dragonAuraInfo").style.minHeight="60px",l("dragonAuraInfo").style.margin="8px",l("dragonAuraInfo").appendChild(document.createElement("div")).className="line";const a=document.createElement("div");a.style.minWidth="200px",a.style.textAlign="center",a.textContent=`Picking this aura will change CPS by ${P(e)} (${i}% of current CPS).`,l("dragonAuraInfo").appendChild(a);const r=document.createElement("div");r.style.minWidth="200px",r.style.textAlign="center",r.textContent=`It will take ${n} to recover the cost.`,l("dragonAuraInfo").appendChild(r)}}(t)},M.ToggleSpecialMenu=Game.ToggleSpecialMenu,Game.ToggleSpecialMenu=function(e){M.ToggleSpecialMenu(e),function(){if(null!==(l("specialPopup").className.match(/onScreen/)&&l("specialPopup").children[0].style.background.match(/dragon/)))for(let e=0;e${fe}`,"this"),Game.tooltip.wobble()},l("specialPopup").children[e].onmouseout=function(){Game.tooltip.shouldHide=1})}()},M.UpdateMenu=Game.UpdateMenu,Game.UpdateMenu=function(){void 0!==Rn().picker&&void 0!==Rn().picker.owner||(M.UpdateMenu(),function(){const t=document.createElement("div");t.className="title","prefs"===Game.onMenu?(t.textContent="Cookie Monster Settings",function(t){const o=document.createDocumentFragment();o.appendChild(t),Object.keys(Yn).forEach((t=>{if("Favourite"===t){if(0!==lo.length&&e.FavouriteSettings>0&&(o.appendChild(Jn(t,Yn[t])),e.Header[t]))for(let e=0;e{const n=Jn(t,Kn[t]);n.style.fontSize="15px",n.style.opacity="0.5",o.appendChild(n),e.Header[t]&&Object.keys(wn).forEach((e=>{wn[e].group===t&&o.appendChild(Zn(e))}))})):Object.keys(wn).forEach((e=>{wn[e].group===t&&o.appendChild(Zn(e))})))}));const n=document.createElement("div");n.className="listing";const i=document.createElement("a");i.className="option",i.onclick=function(){Wn(mn)},i.textContent="Restore Default",n.appendChild(i),o.appendChild(n),l("menu").childNodes[2].insertBefore(o,l("menu").childNodes[2].childNodes[l("menu").childNodes[2].childNodes.length-1])}(t)):"stats"===Game.onMenu?e.Stats&&(t.textContent="Cookie Monster Statistics",qn(t)):"log"===Game.onMenu&&(t.textContent="Cookie Monster ",function(t){const o=document.createElement("div");o.className="subsection";const n=document.createElement("span");if(n.style.cursor="pointer",n.style.display="inline-block",n.style.height="14px",n.style.width="14px",n.style.borderRadius="7px",n.style.textAlign="center",n.style.backgroundColor="#C0C0C0",n.style.color="black",n.style.fontSize="13px",n.style.verticalAlign="middle",n.textContent=e.Header.InfoTab?"-":"+",n.onclick=function(){Vn("InfoTab"),Game.UpdateMenu()},t.appendChild(n),o.appendChild(t),e.Header.InfoTab){const e=document.createElement("div");e.innerHTML='
\n Cookie Monster\n offers a wide range of tools and statistics to enhance your game experience.\n 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.
\n Progess on new updates and all previous release notes can be found on the GitHub page linked above!
\n Please also report any bugs you may find over there!
\n
\n ',o.appendChild(e);const t=document.createElement("div");t.innerHTML="
\nThese are the release notes for the latest update (v 2.031.7).
\n
\nThis update implements the following functions:
\n- Updated the ordering and description of all settings of Cookie Monster
\n- Colours of Flash notifications can now be set by the user
\n- You can now select a number of settings to be your 'favourite'. They will be displayed at the top of all other settings in a new section. This functionality is toggleable and you can find it in the miscellaneous section
\n- The statistics page now shows cookies earned by clicking for a selected time period
\n- The statistics page can now show missing normal achievements, this can be toggled in the settings
\n
\nThis update fixes the following bugs:
\n- Fixed some typo's
\n- No longer show the wrinkler pop buttons when wrinklers can't spawn
\n- Fixed incorrect calculation of plant maturity for relevant tooltips
\n- Fixed edit prompts not working in settings
\n- Fixed red and purple being switched around for PP colour coding
\n- Fixed incorrect notation of numbers in Dragon tooltip and interface
\n- Fixed incorrect calculation of changing Dragon aura cost
\n- Fixed incorrect calculation of changing Pantheon gods effect
\n- Fixed fluctuating PP values when god Cyclius was selected
\n- Fixed black flickering when Golden Cookies or buffs start
\n
\n",o.appendChild(t)}const i=l("menu").children[1];i.insertBefore(o,i.children[1])}(t))}())},M.sayTime=Game.sayTime,Vt=function(e,t){return Number.isNaN(e)||e<=0?M.sayTime(e,t):uo(e/Game.fps,1)},M.Logic=Game.Logic,Game.Logic=function(){M.Logic();let t="Cookie Clicker";"fools"===Game.season&&(t="Cookie Baker"),ro=`${Game.OnAscend?"Ascending! ":""}${P(Game.cookies)} ${1===Game.cookies?"cookie":"cookies"} - ${t}`,function(){if(Game.OnAscend||0===e.Title)document.title=ro;else if(1===e.Title){let e,t,o,n=!1,i=!1;e=ct?ct.wrath?`[W${Math.ceil(ct.life/Game.fps)}]`:`[G${Math.ceil(ct.life/Game.fps)}]`:Game.Has("Golden switch [off]")?"[GS]":`[${Number(l("CMTimerBarGCMinBar").textContent)<0?"!":""}${Math.ceil((Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps)}]`,f&&(n=!0,t="[F]"),"christmas"===Game.season&&(i=!0,o=g?`[R${Math.ceil(dt.life/Game.fps)}]`:`[${Number(l("CMTimerBarRenMinBar").textContent)<0?"!":""}${Math.ceil((Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps)}]`);let a=ro;"["===a.charAt(0)&&(a=a.substring(a.lastIndexOf("]")+1)),document.title=`${e+(n?t:"")+(i?o:"")} ${a}`}else if(2===e.Title){let e="",t=!1;ct&&(t=!0,ct.wrath?e+=`[W${Math.ceil(ct.life/Game.fps)}]`:e+=`[G${Math.ceil(ct.life/Game.fps)}]`),f&&(t=!0,e+="[F]"),"christmas"===Game.season&&g&&(e+=`[R${Math.ceil(dt.life/Game.fps)}]`,t=!0),t&&(e+=" - ");let o="Cookie Clicker";"fools"===Game.season&&(o="Cookie Baker"),e+=o,document.title=e}}(),function(){const t=Math.max(0,Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset)),o=Game.sayTime((Date.now()-Game.startDate)/1e3*Game.fps,-1);let n="";n+=`You've been on this run for ${""===o?"not very long":o}.
`,n+='
',Game.prestige>0&&(n+=`Your prestige level is currently ${P(Game.prestige)}.
(CpS +${P(Game.prestige)}%)`,n+='
'),n+=X<1?"Ascending now would grant you no prestige.":X<2?"Ascending now would grant you
1 prestige level (+1% CpS)
and 1 heavenly chip to spend.":`Ascending now would grant you
${P(X)} prestige levels (+${P(X)}% CpS)
and ${P(X)} heavenly chips to spend.`,n+='
',n+=`You need ${P(t)} more cookies for the next level.
`,n+=e.TooltipAscendButton?`
It takes ${pt} to reach the next level and you were making ${P(Ne,2)} chips on average in the last 5 seconds.
`:"",l("ascendTooltip").innerHTML=n}()}}function oi(){Sn(),sn(),un(),r=Object.keys(Game.mods).length,ue=document.createElement("style"),ue.type="text/css",ue.id="CMCSS",document.head.appendChild(ue),function(){const e=document.createElement("div");e.id="CMBotBar",e.style.height="69px",e.style.width="100%",e.style.position="absolute",e.style.display="none",e.style.backgroundColor="#262224",e.style.backgroundImage="linear-gradient(to bottom, #4d4548, #000000)",e.style.borderTop="1px solid black",e.style.overflow="auto",e.style.textShadow="-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black";const t=e.appendChild(document.createElement("table"));t.style.width="100%",t.style.textAlign="center",t.style.whiteSpace="nowrap";const o=t.appendChild(document.createElement("tbody")),n=function(e,t){const o=document.createElement("td");return o.style.textAlign="right",o.className=St+t,o.textContent=e,o},i=o.appendChild(document.createElement("tr"));i.style.fontWeight="bold",i.appendChild(n("CM 2.031.7",Nt)),o.appendChild(document.createElement("tr")).appendChild(n("Bonus Income",Pt)),o.appendChild(document.createElement("tr")).appendChild(n("Payback Period",Pt)),o.appendChild(document.createElement("tr")).appendChild(n("Time Left",Pt)),l("wrapper").appendChild(e),Object.keys(Game.Objects).forEach((e=>{Co(e)}))}(),function(){const e=document.createElement("div");e.id="CMTimerBar",e.style.position="absolute",e.style.display="none",e.style.height="0px",e.style.fontSize="10px",e.style.fontWeight="bold",e.style.backgroundColor="black";const t=fo("CMTimerBarGC","Next Cookie",[{id:"CMTimerBarGCMinBar",color:Wt},{id:"CMTimerBarGCBar",color:Lt}]);e.appendChild(t);const o=fo("CMTimerBarRen","Next Reindeer",[{id:"CMTimerBarRenMinBar",color:Wt},{id:"CMTimerBarRenBar",color:Ot}]);e.appendChild(o);const n=document.createElement("div");n.id="CMTimerBarBuffTimers",e.appendChild(n),l("wrapper").appendChild(e)}(),function(){const e=document.createElement("div");e.id="CMUpgradeBar",e.style.width="100%",e.style.backgroundColor="black",e.style.textAlign="center",e.style.fontWeight="bold",e.style.display="none",e.style.zIndex="21",e.onmouseout=function(){Game.tooltip.hide()};const t=document.createElement("div");t.appendChild(function(){const e=document.createElement("div");e.style.minWidth="330px",e.style.marginBottom="4px";const t=document.createElement("div");t.className="name",t.style.marginBottom="4px",t.textContent="Legend",e.appendChild(t);const o=function(e,t){const o=document.createElement("div");o.style.verticalAlign="middle";const n=document.createElement("span");return n.className=Bt+e,n.style.display="inline-block",n.style.height="10px",n.style.width="10px",n.style.marginRight="4px",o.appendChild(n),o.appendChild(document.createTextNode(t)),o};return e.appendChild(o(Pt,"Better than the best PP of a building option")),e.appendChild(o(Et,"Same as the best PP building option")),e.appendChild(o(Nt,"Within the top 10 of PP for buildings")),e.appendChild(o(Ot,"Within the top 20 of PP for buildings")),e.appendChild(o(Ft,"Within the top 30 of PP for buildings")),e.appendChild(o(Lt,"Outside of the top 30 of PP for buildings")),e.appendChild(o(Wt,"Negative or infinity PP")),e}()),e.onmouseover=function(){Game.tooltip.draw(this,escape(t.innerHTML),"store")};const o=function(e,t){const o=document.createElement("span");return o.id=e,o.className=St+t,o.style.width="14.28571428571429%",o.style.display="inline-block",o.textContent="0",o};e.appendChild(o("CMUpgradeBarBlue",Pt)),e.appendChild(o("CMUpgradeBarGreen",Et)),e.appendChild(o("CMUpgradeBarYellow",Nt)),e.appendChild(o("CMUpgradeBarOrange",Ot)),e.appendChild(o("CMUpgradeBarRed",Ft)),e.appendChild(o("CMUpgradeBarPurple",Lt)),e.appendChild(o("CMUpgradeBarGray",Wt)),l("upgrades").parentNode.insertBefore(e,l("upgrades").parentNode.childNodes[3])}(),function(){const e=document.createElement("div");e.id="CMFlashScreen",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="white",e.style.display="none",e.style.zIndex="9999999999",e.style.position="absolute",l("wrapper").appendChild(e)}(),function(){const e=document.createElement("div");e.id="CMSectionHidButtons",e.style.textAlign="center";const t=document.createElement("a");t.className="option",t.onclick=function(){"flex"===l("upgrades").style.display?(l("upgrades").style.display="none",l("toggleUpgrades").style.display="none",l("techUpgrades").style.display="none",l("vaultUpgrades").style.display="none"):(l("upgrades").style.display="flex",0!==l("toggleUpgrades").children.length&&(l("toggleUpgrades").style.display="block"),0!==l("techUpgrades").children.length&&(l("techUpgrades").style.display="block"),0!==l("vaultUpgrades").children.length&&(l("vaultUpgrades").style.display="block"))},t.textContent="Hide/Show Upgrades",e.appendChild(t);const o=document.createElement("a");o.className="option",o.onclick=function(){"grid"===l("products").style.display?l("products").style.display="none":l("products").style.display="grid"},o.textContent="Hide/Show Buildings",e.appendChild(o),l("store").insertBefore(e,l("store").childNodes[2])}(),function(){const e=document.createElement("link");e.id="CMFavicon",e.rel="shortcut icon",e.href="https://orteil.dashnet.org/cookieclicker/favicon.ico",document.getElementsByTagName("head")[0].appendChild(e)}(),Object.keys(Ht).forEach((e=>{!function(e,t,o){const n=document.createElement("div");n.id=e;const i=document.createElement("div");i.style.minWidth=o,i.style.marginBottom="4px";const a=document.createElement("div");a.style.textAlign="left",a.textContent=t,i.appendChild(a),n.appendChild(i),Ut[e]=n}(Ht[e][0],Ht[e][1],Ht[e][2])})),function(){const e=document.createElement("a");e.id="PopAllNormalWrinklerButton",e.textContent="Pop All Normal",e.className="option",e.onclick=function(){An()},e.onmouseout=function(){Game.tooltip.shouldHide=1},e.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(()=>jn("wb","PopAll")),"this"),Game.tooltip.wobble()},l("sectionLeftExtra").children[0].append(e);const t=document.createElement("a");t.id="PopFattestWrinklerButton",t.textContent="Pop Single Fattest",t.className="option",t.onclick=function(){null!==$e[1]&&(Game.wrinklers[$e[1]].hp=0)},t.onmouseout=function(){Game.tooltip.shouldHide=1},t.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(()=>jn("wb","PopFattest")),"this"),Game.tooltip.wobble()},l("sectionLeftExtra").children[0].append(t)}(),l("products").style.display="grid",l("storeBulk").style.gridRow="1/1",l("upgrades").style.display="flex",l("upgrades").style["flex-wrap"]="wrap",Object.keys(Game.Objects).forEach((e=>{const t=Game.Objects[e];null!==l(`product${t.id}`).onmouseover&&(w[e]=l(`product${t.id}`).onmouseover,l(`product${t.id}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(()=>jn("b",`${e}`)),"store"),Game.tooltip.wobble()})})),Game.canLumps()&&(s=l("lumps").onmouseover,l("lumps").onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(()=>jn("s","Lump")),"this"),Game.tooltip.wobble()}),h=Game.LoadMinigames,Game.LoadMinigames=function(){h(),Game.Objects.Farm.minigameLoaded&&(l("gardenTool-1").onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(()=>jn("ha","HarvestAllButton")),"this"),Game.tooltip.wobble()},Array.from(l("gardenPlot").children).forEach((e=>{const t=e.id.slice(-3);e.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(()=>jn("p",[`${t[0]}`,`${t[2]}`])),"this"),Game.tooltip.wobble()}}))),Dn(),function(){if(Game.Objects.Temple.minigameLoaded){for(let e=0;e<11;e+=1)l(`templeGod${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(()=>jn("pag",e)),"this"),Game.tooltip.wobble()};for(let e=0;e<3;e+=1)l(`templeSlot${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(()=>jn("pas",[e,Game.Objects.Temple.minigame.slot[e]])),"this"),Game.tooltip.wobble()}}}(),Un()},Game.LoadMinigames(),l("backgroundLeftCanvas").onmouseover=function(){Rt=1},l("backgroundLeftCanvas").onmouseout=function(){Rt=0,Game.tooltip.hide(),Object.keys(Game.wrinklers).forEach((e=>{zt[e]=0}))},ti(),Un(),Game.CalculateGains(),Wn(),$t=Game.OnAscend,Game.prefs.popups?Game.Popup("Cookie Monster version 2.031.7 loaded!"):Game.Notify("Cookie Monster version 2.031.7 loaded!","","",1,1),Game.Win("Third-party")}const ni={init:function(){Bn=!0;let e=!0;Game.version!==Number("2.031")&&(e=confirm("Cookie Monster version 2.031.7 is meant for Game version 2.031. Loading a different version may cause errors. Do you still want to load Cookie Monster?")),e&&(oi(),Game.registerHook("click",_o),Game.registerHook("draw",Vo),Game.registerHook("logic",On),Bn=!1)},load:function(e){const t=JSON.parse(e);Sn(),void 0!==t.favouriteSettings&&(lo=t.favouriteSettings),Wn(t.settings),"2.031.7"!==t.version&&(Game.prefs.popups?Game.Popup("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!"):Game.Notify("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!","","",0,1))},save:xn};Game.registerMod("CookieMonster",ni)})()})(); +(() => { + var e = { + 877: function (e) { + !(function (t, o) { + 'use strict'; + 'object' != typeof e.exports + ? o(t) + : (e.exports = t.document + ? o(t) + : function (e) { + if (!e.document) throw new Error('jscolor needs a window with document'); + return o(e); + }); + })('undefined' != typeof window ? window : this, function (e) { + 'use strict'; + var t, + o, + n, + i, + a = + (((i = { + initialized: !1, + instances: [], + readyQueue: [], + register: function () { + void 0 !== e && + e.document && + e.document.addEventListener('DOMContentLoaded', i.pub.init, !1); + }, + installBySelector: function (t, o) { + if (!(o = o ? i.node(o) : e.document)) throw new Error('Missing root node'); + for ( + var n = o.querySelectorAll(t), + a = new RegExp( + '(^|\\s)(' + i.pub.lookupClass + ')(\\s*(\\{[^}]*\\})|\\s|$)', + 'i', + ), + r = 0; + r < n.length; + r += 1 + ) { + var l, s; + if ( + !(n[r].jscolor && n[r].jscolor instanceof i.pub) && + (void 0 === n[r].type || + 'color' != n[r].type.toLowerCase() || + !i.isColorAttrSupported) && + (null !== (l = i.getDataAttr(n[r], 'jscolor')) || + (n[r].className && (s = n[r].className.match(a)))) + ) { + var c = n[r], + d = ''; + null !== l + ? (d = l) + : s && + (console.warn( + 'Installation using class name is DEPRECATED. Use data-jscolor="" attribute instead.' + + i.docsRef, + ), + s[4] && (d = s[4])); + var p = null; + if (d.trim()) + try { + p = i.parseOptionsStr(d); + } catch (e) { + console.warn(e + '\n' + d); + } + try { + new i.pub(c, p); + } catch (e) { + console.warn(e); + } + } + } + }, + parseOptionsStr: function (e) { + var t = null; + try { + t = JSON.parse(e); + } catch (o) { + if (!i.pub.looseJSON) + throw new Error('Could not parse jscolor options as JSON: ' + o); + try { + t = new Function( + 'var opts = (' + e + '); return typeof opts === "object" ? opts : {};', + )(); + } catch (e) { + throw new Error('Could not evaluate jscolor options: ' + e); + } + } + return t; + }, + getInstances: function () { + for (var e = [], t = 0; t < i.instances.length; t += 1) + i.instances[t] && i.instances[t].targetElement && e.push(i.instances[t]); + return e; + }, + createEl: function (t) { + var o = e.document.createElement(t); + return i.setData(o, 'gui', !0), o; + }, + node: function (t) { + if (!t) return null; + if ('string' == typeof t) { + var o = t, + n = null; + try { + n = e.document.querySelector(o); + } catch (e) { + return console.warn(e), null; + } + return n || console.warn('No element matches the selector: %s', o), n; + } + return i.isNode(t) + ? t + : (console.warn('Invalid node of type %s: %s', typeof t, t), null); + }, + isNode: function (e) { + return 'object' == typeof Node + ? e instanceof Node + : e && + 'object' == typeof e && + 'number' == typeof e.nodeType && + 'string' == typeof e.nodeName; + }, + nodeName: function (e) { + return !(!e || !e.nodeName) && e.nodeName.toLowerCase(); + }, + removeChildren: function (e) { + for (; e.firstChild; ) e.removeChild(e.firstChild); + }, + isTextInput: function (e) { + return e && 'input' === i.nodeName(e) && 'text' === e.type.toLowerCase(); + }, + isButton: function (e) { + if (!e) return !1; + var t = i.nodeName(e); + return ( + 'button' === t || + ('input' === t && + ['button', 'submit', 'reset'].indexOf(e.type.toLowerCase()) > -1) + ); + }, + isButtonEmpty: function (e) { + switch (i.nodeName(e)) { + case 'input': + return !e.value || '' === e.value.trim(); + case 'button': + return '' === e.textContent.trim(); + } + return null; + }, + isPassiveEventSupported: (function () { + var t = !1; + try { + var o = Object.defineProperty({}, 'passive', { + get: function () { + t = !0; + }, + }); + e.addEventListener('testPassive', null, o), + e.removeEventListener('testPassive', null, o); + } catch (e) {} + return t; + })(), + isColorAttrSupported: + ((n = e.document.createElement('input')), + !( + !n.setAttribute || + (n.setAttribute('type', 'color'), 'color' != n.type.toLowerCase()) + )), + dataProp: '_data_jscolor', + setData: function () { + var e = arguments[0]; + if (3 === arguments.length) { + var t = e.hasOwnProperty(i.dataProp) ? e[i.dataProp] : (e[i.dataProp] = {}), + o = arguments[2]; + return (t[(a = arguments[1])] = o), !0; + } + if (2 === arguments.length && 'object' == typeof arguments[1]) { + t = e.hasOwnProperty(i.dataProp) ? e[i.dataProp] : (e[i.dataProp] = {}); + var n = arguments[1]; + for (var a in n) n.hasOwnProperty(a) && (t[a] = n[a]); + return !0; + } + throw new Error('Invalid arguments'); + }, + removeData: function () { + var e = arguments[0]; + if (!e.hasOwnProperty(i.dataProp)) return !0; + for (var t = 1; t < arguments.length; t += 1) { + var o = arguments[t]; + delete e[i.dataProp][o]; + } + return !0; + }, + getData: function (e, t, o) { + if (!e.hasOwnProperty(i.dataProp)) { + if (void 0 === o) return; + e[i.dataProp] = {}; + } + var n = e[i.dataProp]; + return n.hasOwnProperty(t) || void 0 === o || (n[t] = o), n[t]; + }, + getDataAttr: function (e, t) { + var o = 'data-' + t; + return e.getAttribute(o); + }, + setDataAttr: function (e, t, o) { + var n = 'data-' + t; + e.setAttribute(n, o); + }, + _attachedGroupEvents: {}, + attachGroupEvent: function (e, t, o, n) { + i._attachedGroupEvents.hasOwnProperty(e) || (i._attachedGroupEvents[e] = []), + i._attachedGroupEvents[e].push([t, o, n]), + t.addEventListener(o, n, !1); + }, + detachGroupEvents: function (e) { + if (i._attachedGroupEvents.hasOwnProperty(e)) { + for (var t = 0; t < i._attachedGroupEvents[e].length; t += 1) { + var o = i._attachedGroupEvents[e][t]; + o[0].removeEventListener(o[1], o[2], !1); + } + delete i._attachedGroupEvents[e]; + } + }, + preventDefault: function (e) { + e.preventDefault && e.preventDefault(), (e.returnValue = !1); + }, + captureTarget: function (e) { + e.setCapture && ((i._capturedTarget = e), i._capturedTarget.setCapture()); + }, + releaseTarget: function () { + i._capturedTarget && + (i._capturedTarget.releaseCapture(), (i._capturedTarget = null)); + }, + triggerEvent: function (t, o, n, a) { + if (t) { + var r = null; + return ( + 'function' == typeof Event + ? (r = new Event(o, { bubbles: n, cancelable: a })) + : (r = e.document.createEvent('Event')).initEvent(o, n, a), + !!r && (i.setData(r, 'internal', !0), t.dispatchEvent(r), !0) + ); + } + }, + triggerInputEvent: function (e, t, o, n) { + e && i.isTextInput(e) && i.triggerEvent(e, t, o, n); + }, + eventKey: function (e) { + var t = { 9: 'Tab', 13: 'Enter', 27: 'Escape' }; + return 'string' == typeof e.code + ? e.code + : void 0 !== e.keyCode && t.hasOwnProperty(e.keyCode) + ? t[e.keyCode] + : null; + }, + strList: function (e) { + return e ? e.replace(/^\s+|\s+$/g, '').split(/\s+/) : []; + }, + hasClass: function (e, t) { + return ( + !!t && + (void 0 !== e.classList + ? e.classList.contains(t) + : -1 != (' ' + e.className.replace(/\s+/g, ' ') + ' ').indexOf(' ' + t + ' ')) + ); + }, + addClass: function (e, t) { + var o = i.strList(t); + if (void 0 === e.classList) + for (n = 0; n < o.length; n += 1) + i.hasClass(e, o[n]) || (e.className += (e.className ? ' ' : '') + o[n]); + else for (var n = 0; n < o.length; n += 1) e.classList.add(o[n]); + }, + removeClass: function (e, t) { + var o = i.strList(t); + if (void 0 === e.classList) + for (a = 0; a < o.length; a += 1) { + var n = new RegExp( + '^\\s*' + o[a] + '\\s*|\\s*' + o[a] + '\\s*$|\\s+' + o[a] + '(\\s+)', + 'g', + ); + e.className = e.className.replace(n, '$1'); + } + else for (var a = 0; a < o.length; a += 1) e.classList.remove(o[a]); + }, + getCompStyle: function (t) { + return (e.getComputedStyle ? e.getComputedStyle(t) : t.currentStyle) || {}; + }, + setStyle: function (e, t, o, n) { + var a = o ? 'important' : '', + r = null; + for (var l in t) + if (t.hasOwnProperty(l)) { + var s = null; + null === t[l] + ? (r || (r = i.getData(e, 'origStyle')), + r && r.hasOwnProperty(l) && (s = r[l])) + : (n && + (r || (r = i.getData(e, 'origStyle', {})), + r.hasOwnProperty(l) || (r[l] = e.style[l])), + (s = t[l])), + null !== s && e.style.setProperty(l, s, a); + } + }, + hexColor: function (e, t, o) { + return ( + '#' + + ( + ('0' + Math.round(e).toString(16)).substr(-2) + + ('0' + Math.round(t).toString(16)).substr(-2) + + ('0' + Math.round(o).toString(16)).substr(-2) + ).toUpperCase() + ); + }, + hexaColor: function (e, t, o, n) { + return ( + '#' + + ( + ('0' + Math.round(e).toString(16)).substr(-2) + + ('0' + Math.round(t).toString(16)).substr(-2) + + ('0' + Math.round(o).toString(16)).substr(-2) + + ('0' + Math.round(255 * n).toString(16)).substr(-2) + ).toUpperCase() + ); + }, + rgbColor: function (e, t, o) { + return 'rgb(' + Math.round(e) + ',' + Math.round(t) + ',' + Math.round(o) + ')'; + }, + rgbaColor: function (e, t, o, n) { + return ( + 'rgba(' + + Math.round(e) + + ',' + + Math.round(t) + + ',' + + Math.round(o) + + ',' + + Math.round(100 * (null == n ? 1 : n)) / 100 + + ')' + ); + }, + linearGradient: + ((o = (function () { + for ( + var t = 'linear-gradient', + o = ['', '-webkit-', '-moz-', '-o-', '-ms-'], + n = e.document.createElement('div'), + i = 0; + i < o.length; + i += 1 + ) { + var a = o[i] + t, + r = a + '(to right, rgba(0,0,0,0), rgba(0,0,0,0))'; + if (((n.style.background = r), n.style.background)) return a; + } + return t; + })()), + function () { + return o + '(' + Array.prototype.join.call(arguments, ', ') + ')'; + }), + setBorderRadius: function (e, t) { + i.setStyle(e, { 'border-radius': t || '0' }); + }, + setBoxShadow: function (e, t) { + i.setStyle(e, { 'box-shadow': t || 'none' }); + }, + getElementPos: function (e, t) { + var o = 0, + n = 0, + a = e.getBoundingClientRect(); + if (((o = a.left), (n = a.top), !t)) { + var r = i.getViewPos(); + (o += r[0]), (n += r[1]); + } + return [o, n]; + }, + getElementSize: function (e) { + return [e.offsetWidth, e.offsetHeight]; + }, + getAbsPointerPos: function (e) { + var t = 0, + o = 0; + return ( + void 0 !== e.changedTouches && e.changedTouches.length + ? ((t = e.changedTouches[0].clientX), (o = e.changedTouches[0].clientY)) + : 'number' == typeof e.clientX && ((t = e.clientX), (o = e.clientY)), + { x: t, y: o } + ); + }, + getRelPointerPos: function (e) { + var t = (e.target || e.srcElement).getBoundingClientRect(), + o = 0, + n = 0; + return ( + void 0 !== e.changedTouches && e.changedTouches.length + ? ((o = e.changedTouches[0].clientX), (n = e.changedTouches[0].clientY)) + : 'number' == typeof e.clientX && ((o = e.clientX), (n = e.clientY)), + { x: o - t.left, y: n - t.top } + ); + }, + getViewPos: function () { + var t = e.document.documentElement; + return [ + (e.pageXOffset || t.scrollLeft) - (t.clientLeft || 0), + (e.pageYOffset || t.scrollTop) - (t.clientTop || 0), + ]; + }, + getViewSize: function () { + var t = e.document.documentElement; + return [e.innerWidth || t.clientWidth, e.innerHeight || t.clientHeight]; + }, + RGB_HSV: function (e, t, o) { + (e /= 255), (t /= 255), (o /= 255); + var n = Math.min(Math.min(e, t), o), + i = Math.max(Math.max(e, t), o), + a = i - n; + if (0 === a) return [null, 0, 100 * i]; + var r = e === n ? 3 + (o - t) / a : t === n ? 5 + (e - o) / a : 1 + (t - e) / a; + return [60 * (6 === r ? 0 : r), (a / i) * 100, 100 * i]; + }, + HSV_RGB: function (e, t, o) { + var n = (o / 100) * 255; + if (null === e) return [n, n, n]; + (e /= 60), (t /= 100); + var i = Math.floor(e), + a = n * (1 - t), + r = n * (1 - t * (i % 2 ? e - i : 1 - (e - i))); + switch (i) { + case 6: + case 0: + return [n, r, a]; + case 1: + return [r, n, a]; + case 2: + return [a, n, r]; + case 3: + return [a, r, n]; + case 4: + return [r, a, n]; + case 5: + return [n, a, r]; + } + }, + parseColorString: function (e) { + var t, + o = { rgba: null, format: null }; + if ((t = e.match(/^\W*([0-9A-F]{3,8})\W*$/i))) { + if (8 === t[1].length) + (o.format = 'hexa'), + (o.rgba = [ + parseInt(t[1].substr(0, 2), 16), + parseInt(t[1].substr(2, 2), 16), + parseInt(t[1].substr(4, 2), 16), + parseInt(t[1].substr(6, 2), 16) / 255, + ]); + else if (6 === t[1].length) + (o.format = 'hex'), + (o.rgba = [ + parseInt(t[1].substr(0, 2), 16), + parseInt(t[1].substr(2, 2), 16), + parseInt(t[1].substr(4, 2), 16), + null, + ]); + else { + if (3 !== t[1].length) return !1; + (o.format = 'hex'), + (o.rgba = [ + parseInt(t[1].charAt(0) + t[1].charAt(0), 16), + parseInt(t[1].charAt(1) + t[1].charAt(1), 16), + parseInt(t[1].charAt(2) + t[1].charAt(2), 16), + null, + ]); + } + return o; + } + if ((t = e.match(/^\W*rgba?\(([^)]*)\)\W*$/i))) { + var n, + i, + a, + r, + l = t[1].split(','), + s = /^\s*(\d+|\d*\.\d+|\d+\.\d*)\s*$/; + if ( + l.length >= 3 && + (n = l[0].match(s)) && + (i = l[1].match(s)) && + (a = l[2].match(s)) + ) + return ( + (o.format = 'rgb'), + (o.rgba = [ + parseFloat(n[1]) || 0, + parseFloat(i[1]) || 0, + parseFloat(a[1]) || 0, + null, + ]), + l.length >= 4 && + (r = l[3].match(s)) && + ((o.format = 'rgba'), (o.rgba[3] = parseFloat(r[1]) || 0)), + o + ); + } + return !1; + }, + parsePaletteValue: function (e) { + var t = []; + 'string' == typeof e + ? e.replace(/#[0-9A-F]{3}([0-9A-F]{3})?|rgba?\(([^)]*)\)/gi, function (e) { + t.push(e); + }) + : Array.isArray(e) && (t = e); + for (var o = [], n = 0; n < t.length; n++) { + var a = i.parseColorString(t[n]); + a && o.push(a); + } + return o; + }, + containsTranparentColor: function (e) { + for (var t = 0; t < e.length; t++) { + var o = e[t].rgba[3]; + if (null !== o && o < 1) return !0; + } + return !1; + }, + isAlphaFormat: function (e) { + switch (e.toLowerCase()) { + case 'hexa': + case 'rgba': + return !0; + } + return !1; + }, + scaleCanvasForHighDPR: function (t) { + var o = e.devicePixelRatio || 1; + (t.width *= o), (t.height *= o), t.getContext('2d').scale(o, o); + }, + genColorPreviewCanvas: function (e, t, o, n) { + var a = Math.round(i.pub.previewSeparator.length), + r = i.pub.chessboardSize, + l = i.pub.chessboardColor1, + s = i.pub.chessboardColor2, + c = o || 2 * r, + d = 2 * r, + p = i.createEl('canvas'), + u = p.getContext('2d'); + (p.width = c), + (p.height = d), + n && i.scaleCanvasForHighDPR(p), + (u.fillStyle = l), + u.fillRect(0, 0, c, d), + (u.fillStyle = s); + for (var m = 0; m < c; m += 2 * r) + u.fillRect(m, 0, r, r), u.fillRect(m + r, r, r, r); + e && ((u.fillStyle = e), u.fillRect(0, 0, c, d)); + var h = null; + switch (t) { + case 'left': + (h = 0), u.clearRect(0, 0, a / 2, d); + break; + case 'right': + (h = c - a), u.clearRect(c - a / 2, 0, a / 2, d); + } + if (null !== h) { + u.lineWidth = 1; + for (var g = 0; g < i.pub.previewSeparator.length; g += 1) + u.beginPath(), + (u.strokeStyle = i.pub.previewSeparator[g]), + u.moveTo(0.5 + h + g, 0), + u.lineTo(0.5 + h + g, d), + u.stroke(); + } + return { canvas: p, width: c, height: d }; + }, + genColorPreviewGradient: function (e, t, o) { + var n; + return ( + (n = + t && o + ? [ + 'to ' + { left: 'right', right: 'left' }[t], + e + ' 0%', + e + ' ' + o + 'px', + 'rgba(0,0,0,0) ' + (o + 1) + 'px', + 'rgba(0,0,0,0) 100%', + ] + : ['to right', e + ' 0%', e + ' 100%']), + i.linearGradient.apply(this, n) + ); + }, + redrawPosition: function () { + if (i.picker && i.picker.owner) { + var e, + t, + o = i.picker.owner; + o.fixed + ? ((e = i.getElementPos(o.targetElement, !0)), (t = [0, 0])) + : ((e = i.getElementPos(o.targetElement)), (t = i.getViewPos())); + var n, + a, + r, + l = i.getElementSize(o.targetElement), + s = i.getViewSize(), + c = i.getPickerDims(o), + d = [c.borderW, c.borderH]; + switch (o.position.toLowerCase()) { + case 'left': + (n = 1), (a = 0), (r = -1); + break; + case 'right': + (n = 1), (a = 0), (r = 1); + break; + case 'top': + (n = 0), (a = 1), (r = -1); + break; + default: + (n = 0), (a = 1), (r = 1); + } + var p = (l[a] + d[a]) / 2; + if (o.smartPosition) + u = [ + -t[n] + e[n] + d[n] > s[n] && + -t[n] + e[n] + l[n] / 2 > s[n] / 2 && + e[n] + l[n] - d[n] >= 0 + ? e[n] + l[n] - d[n] + : e[n], + -t[a] + e[a] + l[a] + d[a] - p + p * r > s[a] + ? -t[a] + e[a] + l[a] / 2 > s[a] / 2 && e[a] + l[a] - p - p * r >= 0 + ? e[a] + l[a] - p - p * r + : e[a] + l[a] - p + p * r + : e[a] + l[a] - p + p * r >= 0 + ? e[a] + l[a] - p + p * r + : e[a] + l[a] - p - p * r, + ]; + else var u = [e[n], e[a] + l[a] - p + p * r]; + var m = u[n], + h = u[a], + g = o.fixed ? 'fixed' : 'absolute', + f = (u[0] + d[0] > e[0] || u[0] < e[0] + l[0]) && u[1] + d[1] < e[1] + l[1]; + i._drawPosition(o, m, h, g, f); + } + }, + _drawPosition: function (e, t, o, n, a) { + var r = a ? 0 : e.shadowBlur; + (i.picker.wrap.style.position = n), + (i.picker.wrap.style.left = t + 'px'), + (i.picker.wrap.style.top = o + 'px'), + i.setBoxShadow( + i.picker.boxS, + e.shadow ? new i.BoxShadow(0, r, e.shadowBlur, 0, e.shadowColor) : null, + ); + }, + getPickerDims: function (e) { + var t = 2 * e.controlBorderWidth + e.width, + o = 2 * e.controlBorderWidth + e.height, + n = 2 * e.controlBorderWidth + 2 * i.getControlPadding(e) + e.sliderSize; + i.getSliderChannel(e) && (t += n), e.hasAlphaChannel() && (t += n); + var a = i.getPaletteDims(e, t); + a.height && (o += a.height + e.padding), + e.closeButton && (o += 2 * e.controlBorderWidth + e.padding + e.buttonHeight); + var r = t + 2 * e.padding, + l = o + 2 * e.padding; + return { + contentW: t, + contentH: o, + paddedW: r, + paddedH: l, + borderW: r + 2 * e.borderWidth, + borderH: l + 2 * e.borderWidth, + palette: a, + }; + }, + getPaletteDims: function (e, t) { + var o = 0, + n = 0, + i = 0, + a = 0, + r = 0, + l = e._palette ? e._palette.length : 0; + return ( + l && + ((n = (o = e.paletteCols) > 0 ? Math.ceil(l / o) : 0), + (i = Math.max(1, Math.floor((t - (o - 1) * e.paletteSpacing) / o))), + (a = e.paletteHeight ? Math.min(e.paletteHeight, i) : i)), + n && (r = n * a + (n - 1) * e.paletteSpacing), + { cols: o, rows: n, cellW: i, cellH: a, width: t, height: r } + ); + }, + getControlPadding: function (e) { + return Math.max( + e.padding / 2, + 2 * e.pointerBorderWidth + e.pointerThickness - e.controlBorderWidth, + ); + }, + getPadYChannel: function (e) { + switch (e.mode.charAt(1).toLowerCase()) { + case 'v': + return 'v'; + } + return 's'; + }, + getSliderChannel: function (e) { + if (e.mode.length > 2) + switch (e.mode.charAt(2).toLowerCase()) { + case 's': + return 's'; + case 'v': + return 'v'; + } + return null; + }, + triggerCallback: function (e, t) { + if (e[t]) { + var o = null; + if ('string' == typeof e[t]) + try { + o = new Function(e[t]); + } catch (e) { + console.error(e); + } + else o = e[t]; + o && o.call(e); + } + }, + triggerGlobal: function (e) { + for (var t = i.getInstances(), o = 0; o < t.length; o += 1) t[o].trigger(e); + }, + _pointerMoveEvent: { mouse: 'mousemove', touch: 'touchmove' }, + _pointerEndEvent: { mouse: 'mouseup', touch: 'touchend' }, + _pointerOrigin: null, + _capturedTarget: null, + onDocumentKeyUp: function (e) { + -1 !== ['Tab', 'Escape'].indexOf(i.eventKey(e)) && + i.picker && + i.picker.owner && + i.picker.owner.tryHide(); + }, + onWindowResize: function (e) { + i.redrawPosition(); + }, + onWindowScroll: function (e) { + i.redrawPosition(); + }, + onParentScroll: function (e) { + i.picker && i.picker.owner && i.picker.owner.tryHide(); + }, + onDocumentMouseDown: function (e) { + var t = e.target || e.srcElement; + t.jscolor && t.jscolor instanceof i.pub + ? t.jscolor.showOnClick && !t.disabled && t.jscolor.show() + : i.getData(t, 'gui') + ? i.getData(t, 'control') && + i.onControlPointerStart(e, t, i.getData(t, 'control'), 'mouse') + : i.picker && i.picker.owner && i.picker.owner.tryHide(); + }, + onPickerTouchStart: function (e) { + var t = e.target || e.srcElement; + i.getData(t, 'control') && + i.onControlPointerStart(e, t, i.getData(t, 'control'), 'touch'); + }, + onControlPointerStart: function (t, o, n, a) { + var r = i.getData(o, 'instance'); + i.preventDefault(t), i.captureTarget(o); + var l = function (e, r) { + i.attachGroupEvent( + 'drag', + e, + i._pointerMoveEvent[a], + i.onDocumentPointerMove(t, o, n, a, r), + ), + i.attachGroupEvent( + 'drag', + e, + i._pointerEndEvent[a], + i.onDocumentPointerEnd(t, o, n, a), + ); + }; + if ((l(e.document, [0, 0]), e.parent && e.frameElement)) { + var s = e.frameElement.getBoundingClientRect(), + c = [-s.left, -s.top]; + l(e.parent.window.document, c); + } + var d = i.getAbsPointerPos(t), + p = i.getRelPointerPos(t); + switch (((i._pointerOrigin = { x: d.x - p.x, y: d.y - p.y }), n)) { + case 'pad': + 'v' === i.getSliderChannel(r) && + 0 === r.channels.v && + r.fromHSVA(null, null, 100, null), + i.setPad(r, t, 0, 0); + break; + case 'sld': + i.setSld(r, t, 0); + break; + case 'asld': + i.setASld(r, t, 0); + } + r.trigger('input'); + }, + onDocumentPointerMove: function (e, t, o, n, a) { + return function (e) { + var n = i.getData(t, 'instance'); + switch (o) { + case 'pad': + i.setPad(n, e, a[0], a[1]); + break; + case 'sld': + i.setSld(n, e, a[1]); + break; + case 'asld': + i.setASld(n, e, a[1]); + } + n.trigger('input'); + }; + }, + onDocumentPointerEnd: function (e, t, o, n) { + return function (e) { + var o = i.getData(t, 'instance'); + i.detachGroupEvents('drag'), + i.releaseTarget(), + o.trigger('input'), + o.trigger('change'); + }; + }, + onPaletteSampleClick: function (e) { + var t = e.currentTarget, + o = i.getData(t, 'instance'), + n = i.getData(t, 'color'); + 'any' === o.format.toLowerCase() && + (o._setFormat(n.format), i.isAlphaFormat(o.getFormat()) || (n.rgba[3] = 1)), + null === n.rgba[3] && + (!0 === o.paletteSetsAlpha || + ('auto' === o.paletteSetsAlpha && o._paletteHasTransparency)) && + (n.rgba[3] = 1), + o.fromRGBA.apply(o, n.rgba), + o.trigger('input'), + o.trigger('change'), + o.hideOnPaletteClick && o.hide(); + }, + setPad: function (e, t, o, n) { + var a = i.getAbsPointerPos(t), + r = o + a.x - i._pointerOrigin.x - e.padding - e.controlBorderWidth, + l = n + a.y - i._pointerOrigin.y - e.padding - e.controlBorderWidth, + s = r * (360 / (e.width - 1)), + c = 100 - l * (100 / (e.height - 1)); + switch (i.getPadYChannel(e)) { + case 's': + e.fromHSVA(s, c, null, null); + break; + case 'v': + e.fromHSVA(s, null, c, null); + } + }, + setSld: function (e, t, o) { + var n = + 100 - + (o + + i.getAbsPointerPos(t).y - + i._pointerOrigin.y - + e.padding - + e.controlBorderWidth) * + (100 / (e.height - 1)); + switch (i.getSliderChannel(e)) { + case 's': + e.fromHSVA(null, n, null, null); + break; + case 'v': + e.fromHSVA(null, null, n, null); + } + }, + setASld: function (e, t, o) { + var n = + 1 - + (o + + i.getAbsPointerPos(t).y - + i._pointerOrigin.y - + e.padding - + e.controlBorderWidth) * + (1 / (e.height - 1)); + if (n < 1) { + var a = e.getFormat(); + 'any' !== e.format.toLowerCase() || + i.isAlphaFormat(a) || + e._setFormat('hex' === a ? 'hexa' : 'rgba'); + } + e.fromHSVA(null, null, null, n); + }, + createPadCanvas: function () { + var e = { elm: null, draw: null }, + t = i.createEl('canvas'), + o = t.getContext('2d'); + return ( + (e.elm = t), + (e.draw = function (e, n, i) { + (t.width = e), (t.height = n), o.clearRect(0, 0, t.width, t.height); + var a = o.createLinearGradient(0, 0, t.width, 0); + a.addColorStop(0, '#F00'), + a.addColorStop(1 / 6, '#FF0'), + a.addColorStop(2 / 6, '#0F0'), + a.addColorStop(0.5, '#0FF'), + a.addColorStop(4 / 6, '#00F'), + a.addColorStop(5 / 6, '#F0F'), + a.addColorStop(1, '#F00'), + (o.fillStyle = a), + o.fillRect(0, 0, t.width, t.height); + var r = o.createLinearGradient(0, 0, 0, t.height); + switch (i.toLowerCase()) { + case 's': + r.addColorStop(0, 'rgba(255,255,255,0)'), + r.addColorStop(1, 'rgba(255,255,255,1)'); + break; + case 'v': + r.addColorStop(0, 'rgba(0,0,0,0)'), r.addColorStop(1, 'rgba(0,0,0,1)'); + } + (o.fillStyle = r), o.fillRect(0, 0, t.width, t.height); + }), + e + ); + }, + createSliderGradient: function () { + var e = { elm: null, draw: null }, + t = i.createEl('canvas'), + o = t.getContext('2d'); + return ( + (e.elm = t), + (e.draw = function (e, n, i, a) { + (t.width = e), (t.height = n), o.clearRect(0, 0, t.width, t.height); + var r = o.createLinearGradient(0, 0, 0, t.height); + r.addColorStop(0, i), + r.addColorStop(1, a), + (o.fillStyle = r), + o.fillRect(0, 0, t.width, t.height); + }), + e + ); + }, + createASliderGradient: function () { + var e = { elm: null, draw: null }, + t = i.createEl('canvas'), + o = t.getContext('2d'); + return ( + (e.elm = t), + (e.draw = function (e, n, a) { + (t.width = e), (t.height = n), o.clearRect(0, 0, t.width, t.height); + var r = t.width / 2, + l = i.pub.chessboardColor1, + s = i.pub.chessboardColor2; + if (((o.fillStyle = l), o.fillRect(0, 0, t.width, t.height), r > 0)) + for (var c = 0; c < t.height; c += 2 * r) + (o.fillStyle = s), o.fillRect(0, c, r, r), o.fillRect(r, c + r, r, r); + var d = o.createLinearGradient(0, 0, 0, t.height); + d.addColorStop(0, a), + d.addColorStop(1, 'rgba(0,0,0,0)'), + (o.fillStyle = d), + o.fillRect(0, 0, t.width, t.height); + }), + e + ); + }, + BoxShadow: + ((t = function (e, t, o, n, i, a) { + (this.hShadow = e), + (this.vShadow = t), + (this.blur = o), + (this.spread = n), + (this.color = i), + (this.inset = !!a); + }), + (t.prototype.toString = function () { + var e = [ + Math.round(this.hShadow) + 'px', + Math.round(this.vShadow) + 'px', + Math.round(this.blur) + 'px', + Math.round(this.spread) + 'px', + this.color, + ]; + return this.inset && e.push('inset'), e.join(' '); + }), + t), + flags: { leaveValue: 1, leaveAlpha: 2, leavePreview: 4 }, + enumOpts: { + format: ['auto', 'any', 'hex', 'hexa', 'rgb', 'rgba'], + previewPosition: ['left', 'right'], + mode: ['hsv', 'hvs', 'hs', 'hv'], + position: ['left', 'right', 'top', 'bottom'], + alphaChannel: ['auto', !0, !1], + paletteSetsAlpha: ['auto', !0, !1], + }, + deprecatedOpts: { + styleElement: 'previewElement', + onFineChange: 'onInput', + overwriteImportant: 'forceStyle', + closable: 'closeButton', + insetWidth: 'controlBorderWidth', + insetColor: 'controlBorderColor', + refine: null, + }, + docsRef: ' See https://jscolor.com/docs/', + pub: function (t, o) { + var n = this; + function a(e, t) { + if ('string' != typeof e) + throw new Error('Invalid value for option name: ' + e); + if ( + i.enumOpts.hasOwnProperty(e) && + ('string' == typeof t && (t = t.toLowerCase()), + -1 === i.enumOpts[e].indexOf(t)) + ) + throw new Error("Option '" + e + "' has invalid value: " + t); + if (i.deprecatedOpts.hasOwnProperty(e)) { + var o = e, + a = i.deprecatedOpts[e]; + if (!a) throw new Error("Option '" + e + "' is DEPRECATED"); + console.warn( + "Option '%s' is DEPRECATED, using '%s' instead." + i.docsRef, + o, + a, + ), + (e = a); + } + var r = 'set__' + e; + if ('function' == typeof n[r]) return n[r](t), !0; + if (e in n) return (n[e] = t), !0; + throw new Error('Unrecognized configuration option: ' + e); + } + function r(e) { + if ('string' != typeof e) + throw new Error('Invalid value for option name: ' + e); + if (i.deprecatedOpts.hasOwnProperty(e)) { + var t = e, + o = i.deprecatedOpts[e]; + if (!o) throw new Error("Option '" + e + "' is DEPRECATED"); + console.warn( + "Option '%s' is DEPRECATED, using '%s' instead." + i.docsRef, + t, + o, + ), + (e = o); + } + var a = 'get__' + e; + if ('function' == typeof n[a]) return n[a](value); + if (e in n) return n[e]; + throw new Error('Unrecognized configuration option: ' + e); + } + function l() { + n._processParentElementsInDOM(), + i.picker || + ((i.picker = { + owner: null, + wrap: i.createEl('div'), + box: i.createEl('div'), + boxS: i.createEl('div'), + boxB: i.createEl('div'), + pad: i.createEl('div'), + padB: i.createEl('div'), + padM: i.createEl('div'), + padCanvas: i.createPadCanvas(), + cross: i.createEl('div'), + crossBY: i.createEl('div'), + crossBX: i.createEl('div'), + crossLY: i.createEl('div'), + crossLX: i.createEl('div'), + sld: i.createEl('div'), + sldB: i.createEl('div'), + sldM: i.createEl('div'), + sldGrad: i.createSliderGradient(), + sldPtrS: i.createEl('div'), + sldPtrIB: i.createEl('div'), + sldPtrMB: i.createEl('div'), + sldPtrOB: i.createEl('div'), + asld: i.createEl('div'), + asldB: i.createEl('div'), + asldM: i.createEl('div'), + asldGrad: i.createASliderGradient(), + asldPtrS: i.createEl('div'), + asldPtrIB: i.createEl('div'), + asldPtrMB: i.createEl('div'), + asldPtrOB: i.createEl('div'), + pal: i.createEl('div'), + btn: i.createEl('div'), + btnT: i.createEl('span'), + }), + i.picker.pad.appendChild(i.picker.padCanvas.elm), + i.picker.padB.appendChild(i.picker.pad), + i.picker.cross.appendChild(i.picker.crossBY), + i.picker.cross.appendChild(i.picker.crossBX), + i.picker.cross.appendChild(i.picker.crossLY), + i.picker.cross.appendChild(i.picker.crossLX), + i.picker.padB.appendChild(i.picker.cross), + i.picker.box.appendChild(i.picker.padB), + i.picker.box.appendChild(i.picker.padM), + i.picker.sld.appendChild(i.picker.sldGrad.elm), + i.picker.sldB.appendChild(i.picker.sld), + i.picker.sldB.appendChild(i.picker.sldPtrOB), + i.picker.sldPtrOB.appendChild(i.picker.sldPtrMB), + i.picker.sldPtrMB.appendChild(i.picker.sldPtrIB), + i.picker.sldPtrIB.appendChild(i.picker.sldPtrS), + i.picker.box.appendChild(i.picker.sldB), + i.picker.box.appendChild(i.picker.sldM), + i.picker.asld.appendChild(i.picker.asldGrad.elm), + i.picker.asldB.appendChild(i.picker.asld), + i.picker.asldB.appendChild(i.picker.asldPtrOB), + i.picker.asldPtrOB.appendChild(i.picker.asldPtrMB), + i.picker.asldPtrMB.appendChild(i.picker.asldPtrIB), + i.picker.asldPtrIB.appendChild(i.picker.asldPtrS), + i.picker.box.appendChild(i.picker.asldB), + i.picker.box.appendChild(i.picker.asldM), + i.picker.box.appendChild(i.picker.pal), + i.picker.btn.appendChild(i.picker.btnT), + i.picker.box.appendChild(i.picker.btn), + i.picker.boxB.appendChild(i.picker.box), + i.picker.wrap.appendChild(i.picker.boxS), + i.picker.wrap.appendChild(i.picker.boxB), + i.picker.wrap.addEventListener( + 'touchstart', + i.onPickerTouchStart, + !!i.isPassiveEventSupported && { passive: !1 }, + )); + var t, + o, + a = i.picker, + r = !!i.getSliderChannel(n), + l = n.hasAlphaChannel(), + p = i.getPickerDims(n), + u = 2 * n.pointerBorderWidth + n.pointerThickness + 2 * n.crossSize, + m = i.getControlPadding(n), + h = Math.min(n.borderRadius, Math.round(n.padding * Math.PI)); + (a.wrap.className = 'jscolor-picker-wrap'), + (a.wrap.style.clear = 'both'), + (a.wrap.style.width = p.borderW + 'px'), + (a.wrap.style.height = p.borderH + 'px'), + (a.wrap.style.zIndex = n.zIndex), + (a.box.className = 'jscolor-picker'), + (a.box.style.width = p.paddedW + 'px'), + (a.box.style.height = p.paddedH + 'px'), + (a.box.style.position = 'relative'), + (a.boxS.className = 'jscolor-picker-shadow'), + (a.boxS.style.position = 'absolute'), + (a.boxS.style.left = '0'), + (a.boxS.style.top = '0'), + (a.boxS.style.width = '100%'), + (a.boxS.style.height = '100%'), + i.setBorderRadius(a.boxS, h + 'px'), + (a.boxB.className = 'jscolor-picker-border'), + (a.boxB.style.position = 'relative'), + (a.boxB.style.border = n.borderWidth + 'px solid'), + (a.boxB.style.borderColor = n.borderColor), + (a.boxB.style.background = n.backgroundColor), + i.setBorderRadius(a.boxB, h + 'px'), + (a.padM.style.background = 'rgba(255,0,0,.2)'), + (a.sldM.style.background = 'rgba(0,255,0,.2)'), + (a.asldM.style.background = 'rgba(0,0,255,.2)'), + (a.padM.style.opacity = a.sldM.style.opacity = a.asldM.style.opacity = '0'), + (a.pad.style.position = 'relative'), + (a.pad.style.width = n.width + 'px'), + (a.pad.style.height = n.height + 'px'), + a.padCanvas.draw(n.width, n.height, i.getPadYChannel(n)), + (a.padB.style.position = 'absolute'), + (a.padB.style.left = n.padding + 'px'), + (a.padB.style.top = n.padding + 'px'), + (a.padB.style.border = n.controlBorderWidth + 'px solid'), + (a.padB.style.borderColor = n.controlBorderColor), + (a.padM.style.position = 'absolute'), + (a.padM.style.left = '0px'), + (a.padM.style.top = '0px'), + (a.padM.style.width = + n.padding + 2 * n.controlBorderWidth + n.width + m + 'px'), + (a.padM.style.height = + 2 * n.controlBorderWidth + 2 * n.padding + n.height + 'px'), + (a.padM.style.cursor = 'crosshair'), + i.setData(a.padM, { instance: n, control: 'pad' }), + (a.cross.style.position = 'absolute'), + (a.cross.style.left = a.cross.style.top = '0'), + (a.cross.style.width = a.cross.style.height = u + 'px'), + (a.crossBY.style.position = a.crossBX.style.position = 'absolute'), + (a.crossBY.style.background = a.crossBX.style.background = + n.pointerBorderColor), + (a.crossBY.style.width = a.crossBX.style.height = + 2 * n.pointerBorderWidth + n.pointerThickness + 'px'), + (a.crossBY.style.height = a.crossBX.style.width = u + 'px'), + (a.crossBY.style.left = a.crossBX.style.top = + Math.floor(u / 2) - + Math.floor(n.pointerThickness / 2) - + n.pointerBorderWidth + + 'px'), + (a.crossBY.style.top = a.crossBX.style.left = '0'), + (a.crossLY.style.position = a.crossLX.style.position = 'absolute'), + (a.crossLY.style.background = a.crossLX.style.background = n.pointerColor), + (a.crossLY.style.height = a.crossLX.style.width = + u - 2 * n.pointerBorderWidth + 'px'), + (a.crossLY.style.width = a.crossLX.style.height = n.pointerThickness + 'px'), + (a.crossLY.style.left = a.crossLX.style.top = + Math.floor(u / 2) - Math.floor(n.pointerThickness / 2) + 'px'), + (a.crossLY.style.top = a.crossLX.style.left = n.pointerBorderWidth + 'px'), + (a.sld.style.overflow = 'hidden'), + (a.sld.style.width = n.sliderSize + 'px'), + (a.sld.style.height = n.height + 'px'), + a.sldGrad.draw(n.sliderSize, n.height, '#000', '#000'), + (a.sldB.style.display = r ? 'block' : 'none'), + (a.sldB.style.position = 'absolute'), + (a.sldB.style.left = + n.padding + n.width + 2 * n.controlBorderWidth + 2 * m + 'px'), + (a.sldB.style.top = n.padding + 'px'), + (a.sldB.style.border = n.controlBorderWidth + 'px solid'), + (a.sldB.style.borderColor = n.controlBorderColor), + (a.sldM.style.display = r ? 'block' : 'none'), + (a.sldM.style.position = 'absolute'), + (a.sldM.style.left = + n.padding + n.width + 2 * n.controlBorderWidth + m + 'px'), + (a.sldM.style.top = '0px'), + (a.sldM.style.width = + n.sliderSize + + 2 * m + + 2 * n.controlBorderWidth + + (l ? 0 : Math.max(0, n.padding - m)) + + 'px'), + (a.sldM.style.height = + 2 * n.controlBorderWidth + 2 * n.padding + n.height + 'px'), + (a.sldM.style.cursor = 'default'), + i.setData(a.sldM, { instance: n, control: 'sld' }), + (a.sldPtrIB.style.border = a.sldPtrOB.style.border = + n.pointerBorderWidth + 'px solid ' + n.pointerBorderColor), + (a.sldPtrOB.style.position = 'absolute'), + (a.sldPtrOB.style.left = + -(2 * n.pointerBorderWidth + n.pointerThickness) + 'px'), + (a.sldPtrOB.style.top = '0'), + (a.sldPtrMB.style.border = n.pointerThickness + 'px solid ' + n.pointerColor), + (a.sldPtrS.style.width = n.sliderSize + 'px'), + (a.sldPtrS.style.height = i.pub.sliderInnerSpace + 'px'), + (a.asld.style.overflow = 'hidden'), + (a.asld.style.width = n.sliderSize + 'px'), + (a.asld.style.height = n.height + 'px'), + a.asldGrad.draw(n.sliderSize, n.height, '#000'), + (a.asldB.style.display = l ? 'block' : 'none'), + (a.asldB.style.position = 'absolute'), + (a.asldB.style.left = + n.padding + + n.width + + 2 * n.controlBorderWidth + + m + + (r ? n.sliderSize + 3 * m + 2 * n.controlBorderWidth : 0) + + 'px'), + (a.asldB.style.top = n.padding + 'px'), + (a.asldB.style.border = n.controlBorderWidth + 'px solid'), + (a.asldB.style.borderColor = n.controlBorderColor), + (a.asldM.style.display = l ? 'block' : 'none'), + (a.asldM.style.position = 'absolute'), + (a.asldM.style.left = + n.padding + + n.width + + 2 * n.controlBorderWidth + + m + + (r ? n.sliderSize + 2 * m + 2 * n.controlBorderWidth : 0) + + 'px'), + (a.asldM.style.top = '0px'), + (a.asldM.style.width = + n.sliderSize + + 2 * m + + 2 * n.controlBorderWidth + + Math.max(0, n.padding - m) + + 'px'), + (a.asldM.style.height = + 2 * n.controlBorderWidth + 2 * n.padding + n.height + 'px'), + (a.asldM.style.cursor = 'default'), + i.setData(a.asldM, { instance: n, control: 'asld' }), + (a.asldPtrIB.style.border = a.asldPtrOB.style.border = + n.pointerBorderWidth + 'px solid ' + n.pointerBorderColor), + (a.asldPtrOB.style.position = 'absolute'), + (a.asldPtrOB.style.left = + -(2 * n.pointerBorderWidth + n.pointerThickness) + 'px'), + (a.asldPtrOB.style.top = '0'), + (a.asldPtrMB.style.border = + n.pointerThickness + 'px solid ' + n.pointerColor), + (a.asldPtrS.style.width = n.sliderSize + 'px'), + (a.asldPtrS.style.height = i.pub.sliderInnerSpace + 'px'), + (a.pal.className = 'jscolor-palette'), + (a.pal.style.display = p.palette.rows ? 'block' : 'none'), + (a.pal.style.position = 'absolute'), + (a.pal.style.left = n.padding + 'px'), + (a.pal.style.top = + 2 * n.controlBorderWidth + 2 * n.padding + n.height + 'px'), + (a.pal.innerHTML = ''); + for ( + var g = i.genColorPreviewCanvas('rgba(0,0,0,0)'), f = 0, C = 0; + C < p.palette.rows; + C++ + ) + for (var y = 0; y < p.palette.cols && f < n._palette.length; y++, f++) { + var b = n._palette[f], + k = i.rgbaColor.apply(null, b.rgba), + G = i.createEl('div'); + (G.style.width = p.palette.cellW - 2 * n.controlBorderWidth + 'px'), + (G.style.height = p.palette.cellH - 2 * n.controlBorderWidth + 'px'), + (G.style.backgroundColor = k); + var v = i.createEl('div'); + (v.className = 'jscolor-palette-sample'), + (v.style.display = 'block'), + (v.style.position = 'absolute'), + (v.style.left = + (p.palette.cols <= 1 + ? 0 + : Math.round( + y * ((p.contentW - p.palette.cellW) / (p.palette.cols - 1)) * 10, + ) / 10) + 'px'), + (v.style.top = C * (p.palette.cellH + n.paletteSpacing) + 'px'), + (v.style.border = n.controlBorderWidth + 'px solid'), + (v.style.borderColor = n.controlBorderColor), + (v.style.cursor = 'pointer'), + null !== b.rgba[3] && + b.rgba[3] < 1 && + ((v.style.backgroundImage = "url('" + g.canvas.toDataURL() + "')"), + (v.style.backgroundRepeat = 'repeat'), + (v.style.backgroundPosition = 'center center')), + i.setData(v, { instance: n, control: 'palette-sample', color: b }), + v.addEventListener('click', i.onPaletteSampleClick, !1), + v.appendChild(G), + a.pal.appendChild(v); + } + (a.btn.className = 'jscolor-btn-close'), + (a.btn.style.display = n.closeButton ? 'block' : 'none'), + (a.btn.style.position = 'absolute'), + (a.btn.style.left = n.padding + 'px'), + (a.btn.style.bottom = n.padding + 'px'), + (a.btn.style.padding = '0 15px'), + (a.btn.style.maxWidth = p.contentW - 2 * n.controlBorderWidth - 30 + 'px'), + (a.btn.style.overflow = 'hidden'), + (a.btn.style.height = n.buttonHeight + 'px'), + (a.btn.style.whiteSpace = 'nowrap'), + (a.btn.style.border = n.controlBorderWidth + 'px solid'), + (o = + (t = n.controlBorderColor.split(/\s+/)).length < 2 + ? t[0] + : t[1] + ' ' + t[0] + ' ' + t[0] + ' ' + t[1]), + (a.btn.style.borderColor = o), + (a.btn.style.color = n.buttonColor), + (a.btn.style.font = '12px sans-serif'), + (a.btn.style.textAlign = 'center'), + (a.btn.style.cursor = 'pointer'), + (a.btn.onmousedown = function () { + n.hide(); + }), + (a.btnT.style.lineHeight = n.buttonHeight + 'px'), + (a.btnT.innerHTML = ''), + a.btnT.appendChild(e.document.createTextNode(n.closeText)), + s(), + c(), + d(), + i.picker.owner && + i.picker.owner !== n && + i.removeClass(i.picker.owner.targetElement, i.pub.activeClassName), + (i.picker.owner = n), + n.container === e.document.body + ? i.redrawPosition() + : i._drawPosition(n, 0, 0, 'relative', !1), + a.wrap.parentNode !== n.container && n.container.appendChild(a.wrap), + i.addClass(n.targetElement, i.pub.activeClassName); + } + function s() { + var e = i.getPadYChannel(n), + t = Math.round((n.channels.h / 360) * (n.width - 1)), + o = Math.round((1 - n.channels[e] / 100) * (n.height - 1)), + a = 2 * n.pointerBorderWidth + n.pointerThickness + 2 * n.crossSize, + r = -Math.floor(a / 2); + switch ( + ((i.picker.cross.style.left = t + r + 'px'), + (i.picker.cross.style.top = o + r + 'px'), + i.getSliderChannel(n)) + ) { + case 's': + var l = i.HSV_RGB(n.channels.h, 100, n.channels.v), + s = i.HSV_RGB(n.channels.h, 0, n.channels.v), + c = + 'rgb(' + + Math.round(l[0]) + + ',' + + Math.round(l[1]) + + ',' + + Math.round(l[2]) + + ')', + d = + 'rgb(' + + Math.round(s[0]) + + ',' + + Math.round(s[1]) + + ',' + + Math.round(s[2]) + + ')'; + i.picker.sldGrad.draw(n.sliderSize, n.height, c, d); + break; + case 'v': + var p = i.HSV_RGB(n.channels.h, n.channels.s, 100); + (c = + 'rgb(' + + Math.round(p[0]) + + ',' + + Math.round(p[1]) + + ',' + + Math.round(p[2]) + + ')'), + (d = '#000'), + i.picker.sldGrad.draw(n.sliderSize, n.height, c, d); + } + i.picker.asldGrad.draw(n.sliderSize, n.height, n.toHEXString()); + } + function c() { + var e = i.getSliderChannel(n); + if (e) { + var t = Math.round((1 - n.channels[e] / 100) * (n.height - 1)); + i.picker.sldPtrOB.style.top = + t - + (2 * n.pointerBorderWidth + n.pointerThickness) - + Math.floor(i.pub.sliderInnerSpace / 2) + + 'px'; + } + i.picker.asldGrad.draw(n.sliderSize, n.height, n.toHEXString()); + } + function d() { + var e = Math.round((1 - n.channels.a) * (n.height - 1)); + i.picker.asldPtrOB.style.top = + e - + (2 * n.pointerBorderWidth + n.pointerThickness) - + Math.floor(i.pub.sliderInnerSpace / 2) + + 'px'; + } + function p() { + return i.picker && i.picker.owner === n; + } + if ( + (o || (o = {}), + (this.channels = { r: 255, g: 255, b: 255, h: 0, s: 0, v: 100, a: 1 }), + (this.format = 'auto'), + (this.value = void 0), + (this.alpha = void 0), + (this.onChange = void 0), + (this.onInput = void 0), + (this.valueElement = void 0), + (this.alphaElement = void 0), + (this.previewElement = void 0), + (this.previewPosition = 'left'), + (this.previewSize = 32), + (this.previewPadding = 8), + (this.required = !0), + (this.hash = !0), + (this.uppercase = !0), + (this.forceStyle = !0), + (this.width = 181), + (this.height = 101), + (this.mode = 'HSV'), + (this.alphaChannel = 'auto'), + (this.position = 'bottom'), + (this.smartPosition = !0), + (this.showOnClick = !0), + (this.hideOnLeave = !0), + (this.palette = []), + (this.paletteCols = 10), + (this.paletteSetsAlpha = 'auto'), + (this.paletteHeight = 16), + (this.paletteSpacing = 4), + (this.hideOnPaletteClick = !1), + (this.sliderSize = 16), + (this.crossSize = 8), + (this.closeButton = !1), + (this.closeText = 'Close'), + (this.buttonColor = 'rgba(0,0,0,1)'), + (this.buttonHeight = 18), + (this.padding = 12), + (this.backgroundColor = 'rgba(255,255,255,1)'), + (this.borderWidth = 1), + (this.borderColor = 'rgba(187,187,187,1)'), + (this.borderRadius = 8), + (this.controlBorderWidth = 1), + (this.controlBorderColor = 'rgba(187,187,187,1)'), + (this.shadow = !0), + (this.shadowBlur = 15), + (this.shadowColor = 'rgba(0,0,0,0.2)'), + (this.pointerColor = 'rgba(76,76,76,1)'), + (this.pointerBorderWidth = 1), + (this.pointerBorderColor = 'rgba(255,255,255,1)'), + (this.pointerThickness = 2), + (this.zIndex = 5e3), + (this.container = void 0), + (this.minS = 0), + (this.maxS = 100), + (this.minV = 0), + (this.maxV = 100), + (this.minA = 0), + (this.maxA = 1), + (this.option = function () { + if (!arguments.length) throw new Error('No option specified'); + if (1 === arguments.length && 'string' == typeof arguments[0]) { + try { + return r(arguments[0]); + } catch (e) { + console.warn(e); + } + return !1; + } + if (arguments.length >= 2 && 'string' == typeof arguments[0]) { + try { + if (!a(arguments[0], arguments[1])) return !1; + } catch (e) { + return console.warn(e), !1; + } + return this.redraw(), this.exposeColor(), !0; + } + if (1 === arguments.length && 'object' == typeof arguments[0]) { + var e = arguments[0], + t = !0; + for (var o in e) + if (e.hasOwnProperty(o)) + try { + a(o, e[o]) || (t = !1); + } catch (e) { + console.warn(e), (t = !1); + } + return this.redraw(), this.exposeColor(), t; + } + throw new Error('Invalid arguments'); + }), + (this.channel = function (e, t) { + if ('string' != typeof e) + throw new Error('Invalid value for channel name: ' + e); + if (void 0 === t) + return this.channels.hasOwnProperty(e.toLowerCase()) + ? this.channels[e.toLowerCase()] + : (console.warn('Getting unknown channel: ' + e), !1); + var o = !1; + switch (e.toLowerCase()) { + case 'r': + o = this.fromRGBA(t, null, null, null); + break; + case 'g': + o = this.fromRGBA(null, t, null, null); + break; + case 'b': + o = this.fromRGBA(null, null, t, null); + break; + case 'h': + o = this.fromHSVA(t, null, null, null); + break; + case 's': + o = this.fromHSVA(null, t, null, null); + break; + case 'v': + o = this.fromHSVA(null, null, t, null); + break; + case 'a': + o = this.fromHSVA(null, null, null, t); + break; + default: + return console.warn('Setting unknown channel: ' + e), !1; + } + return !!o && (this.redraw(), !0); + }), + (this.trigger = function (e) { + for (var t = i.strList(e), o = 0; o < t.length; o += 1) { + var n = t[o].toLowerCase(), + a = null; + switch (n) { + case 'input': + a = 'onInput'; + break; + case 'change': + a = 'onChange'; + } + a && i.triggerCallback(this, a), + i.triggerInputEvent(this.valueElement, n, !0, !0); + } + }), + (this.fromHSVA = function (e, t, o, n, a) { + if ( + (void 0 === e && (e = null), + void 0 === t && (t = null), + void 0 === o && (o = null), + void 0 === n && (n = null), + null !== e) + ) { + if (isNaN(e)) return !1; + this.channels.h = Math.max(0, Math.min(360, e)); + } + if (null !== t) { + if (isNaN(t)) return !1; + this.channels.s = Math.max(0, Math.min(100, this.maxS, t), this.minS); + } + if (null !== o) { + if (isNaN(o)) return !1; + this.channels.v = Math.max(0, Math.min(100, this.maxV, o), this.minV); + } + if (null !== n) { + if (isNaN(n)) return !1; + this.channels.a = this.hasAlphaChannel() + ? Math.max(0, Math.min(1, this.maxA, n), this.minA) + : 1; + } + var r = i.HSV_RGB(this.channels.h, this.channels.s, this.channels.v); + return ( + (this.channels.r = r[0]), + (this.channels.g = r[1]), + (this.channels.b = r[2]), + this.exposeColor(a), + !0 + ); + }), + (this.fromRGBA = function (e, t, o, n, a) { + if ( + (void 0 === e && (e = null), + void 0 === t && (t = null), + void 0 === o && (o = null), + void 0 === n && (n = null), + null !== e) + ) { + if (isNaN(e)) return !1; + e = Math.max(0, Math.min(255, e)); + } + if (null !== t) { + if (isNaN(t)) return !1; + t = Math.max(0, Math.min(255, t)); + } + if (null !== o) { + if (isNaN(o)) return !1; + o = Math.max(0, Math.min(255, o)); + } + if (null !== n) { + if (isNaN(n)) return !1; + this.channels.a = this.hasAlphaChannel() + ? Math.max(0, Math.min(1, this.maxA, n), this.minA) + : 1; + } + var r = i.RGB_HSV( + null === e ? this.channels.r : e, + null === t ? this.channels.g : t, + null === o ? this.channels.b : o, + ); + null !== r[0] && (this.channels.h = Math.max(0, Math.min(360, r[0]))), + 0 !== r[2] && + (this.channels.s = Math.max( + 0, + this.minS, + Math.min(100, this.maxS, r[1]), + )), + (this.channels.v = Math.max(0, this.minV, Math.min(100, this.maxV, r[2]))); + var l = i.HSV_RGB(this.channels.h, this.channels.s, this.channels.v); + return ( + (this.channels.r = l[0]), + (this.channels.g = l[1]), + (this.channels.b = l[2]), + this.exposeColor(a), + !0 + ); + }), + (this.fromHSV = function (e, t, o, n) { + return ( + console.warn( + 'fromHSV() method is DEPRECATED. Using fromHSVA() instead.' + i.docsRef, + ), + this.fromHSVA(e, t, o, null, n) + ); + }), + (this.fromRGB = function (e, t, o, n) { + return ( + console.warn( + 'fromRGB() method is DEPRECATED. Using fromRGBA() instead.' + i.docsRef, + ), + this.fromRGBA(e, t, o, null, n) + ); + }), + (this.fromString = function (e, t) { + if (!this.required && '' === e.trim()) + return this.setPreviewElementBg(null), this.setValueElementValue(''), !0; + var o = i.parseColorString(e); + return ( + !!o && + ('any' === this.format.toLowerCase() && + (this._setFormat(o.format), + i.isAlphaFormat(this.getFormat()) || (o.rgba[3] = 1)), + this.fromRGBA(o.rgba[0], o.rgba[1], o.rgba[2], o.rgba[3], t), + !0) + ); + }), + (this.toString = function (e) { + switch ((void 0 === e && (e = this.getFormat()), e.toLowerCase())) { + case 'hex': + return this.toHEXString(); + case 'hexa': + return this.toHEXAString(); + case 'rgb': + return this.toRGBString(); + case 'rgba': + return this.toRGBAString(); + } + return !1; + }), + (this.toHEXString = function () { + return i.hexColor(this.channels.r, this.channels.g, this.channels.b); + }), + (this.toHEXAString = function () { + return i.hexaColor( + this.channels.r, + this.channels.g, + this.channels.b, + this.channels.a, + ); + }), + (this.toRGBString = function () { + return i.rgbColor(this.channels.r, this.channels.g, this.channels.b); + }), + (this.toRGBAString = function () { + return i.rgbaColor( + this.channels.r, + this.channels.g, + this.channels.b, + this.channels.a, + ); + }), + (this.toGrayscale = function () { + return ( + 0.213 * this.channels.r + 0.715 * this.channels.g + 0.072 * this.channels.b + ); + }), + (this.toCanvas = function () { + return i.genColorPreviewCanvas(this.toRGBAString()).canvas; + }), + (this.toDataURL = function () { + return this.toCanvas().toDataURL(); + }), + (this.toBackground = function () { + return i.pub.background(this.toRGBAString()); + }), + (this.isLight = function () { + return this.toGrayscale() > 127.5; + }), + (this.hide = function () { + p() && + (i.removeClass(n.targetElement, i.pub.activeClassName), + i.picker.wrap.parentNode.removeChild(i.picker.wrap), + delete i.picker.owner); + }), + (this.show = function () { + l(); + }), + (this.redraw = function () { + p() && l(); + }), + (this.getFormat = function () { + return this._currentFormat; + }), + (this._setFormat = function (e) { + this._currentFormat = e.toLowerCase(); + }), + (this.hasAlphaChannel = function () { + return 'auto' === this.alphaChannel + ? 'any' === this.format.toLowerCase() || + i.isAlphaFormat(this.getFormat()) || + void 0 !== this.alpha || + void 0 !== this.alphaElement + : this.alphaChannel; + }), + (this.processValueInput = function (e) { + this.fromString(e) || this.exposeColor(); + }), + (this.processAlphaInput = function (e) { + this.fromHSVA(null, null, null, parseFloat(e)) || this.exposeColor(); + }), + (this.exposeColor = function (e) { + var t = this.toString(), + o = this.getFormat(); + if ( + (i.setDataAttr(this.targetElement, 'current-color', t), + e & i.flags.leaveValue || + !this.valueElement || + (('hex' !== o && 'hexa' !== o) || + (this.uppercase || (t = t.toLowerCase()), + this.hash || (t = t.replace(/^#/, ''))), + this.setValueElementValue(t)), + !(e & i.flags.leaveAlpha) && this.alphaElement) + ) { + var n = Math.round(100 * this.channels.a) / 100; + this.setAlphaElementValue(n); + } + e & i.flags.leavePreview || + !this.previewElement || + ((i.isTextInput(this.previewElement) || + (i.isButton(this.previewElement) && + !i.isButtonEmpty(this.previewElement))) && + this.previewPosition, + this.setPreviewElementBg(this.toRGBAString())), + p() && (s(), c(), d()); + }), + (this.setPreviewElementBg = function (e) { + if (this.previewElement) { + var t = null, + o = null; + (i.isTextInput(this.previewElement) || + (i.isButton(this.previewElement) && + !i.isButtonEmpty(this.previewElement))) && + ((t = this.previewPosition), (o = this.previewSize)); + var n = []; + if (e) { + n.push({ + image: i.genColorPreviewGradient( + e, + t, + o ? o - i.pub.previewSeparator.length : null, + ), + position: 'left top', + size: 'auto', + repeat: t ? 'repeat-y' : 'repeat', + origin: 'padding-box', + }); + var a = i.genColorPreviewCanvas( + 'rgba(0,0,0,0)', + t ? { left: 'right', right: 'left' }[t] : null, + o, + !0, + ); + n.push({ + image: "url('" + a.canvas.toDataURL() + "')", + position: (t || 'left') + ' top', + size: a.width + 'px ' + a.height + 'px', + repeat: t ? 'repeat-y' : 'repeat', + origin: 'padding-box', + }); + } else + n.push({ + image: 'none', + position: 'left top', + size: 'auto', + repeat: 'no-repeat', + origin: 'padding-box', + }); + for ( + var r = { image: [], position: [], size: [], repeat: [], origin: [] }, + l = 0; + l < n.length; + l += 1 + ) + r.image.push(n[l].image), + r.position.push(n[l].position), + r.size.push(n[l].size), + r.repeat.push(n[l].repeat), + r.origin.push(n[l].origin); + var s = { + 'background-image': r.image.join(', '), + 'background-position': r.position.join(', '), + 'background-size': r.size.join(', '), + 'background-repeat': r.repeat.join(', '), + 'background-origin': r.origin.join(', '), + }; + i.setStyle(this.previewElement, s, this.forceStyle); + var c = { left: null, right: null }; + t && (c[t] = this.previewSize + this.previewPadding + 'px'), + (s = { 'padding-left': c.left, 'padding-right': c.right }), + i.setStyle(this.previewElement, s, this.forceStyle, !0); + } + }), + (this.setValueElementValue = function (e) { + this.valueElement && + ('input' === i.nodeName(this.valueElement) + ? (this.valueElement.value = e) + : (this.valueElement.innerHTML = e)); + }), + (this.setAlphaElementValue = function (e) { + this.alphaElement && + ('input' === i.nodeName(this.alphaElement) + ? (this.alphaElement.value = e) + : (this.alphaElement.innerHTML = e)); + }), + (this._processParentElementsInDOM = function () { + if (!this._parentElementsProcessed) { + this._parentElementsProcessed = !0; + var e = this.targetElement; + do { + var t = i.getCompStyle(e); + t.position && 'fixed' === t.position.toLowerCase() && (this.fixed = !0), + e !== this.targetElement && + (i.getData(e, 'hasScrollListener') || + (e.addEventListener('scroll', i.onParentScroll, !1), + i.setData(e, 'hasScrollListener', !0))); + } while ((e = e.parentNode) && 'body' !== i.nodeName(e)); + } + }), + (this.tryHide = function () { + this.hideOnLeave && this.hide(); + }), + (this.set__palette = function (e) { + (this.palette = e), + (this._palette = i.parsePaletteValue(e)), + (this._paletteHasTransparency = i.containsTranparentColor(this._palette)); + }), + i.pub.options) + ) + for (var u in i.pub.options) + if (i.pub.options.hasOwnProperty(u)) + try { + a(u, i.pub.options[u]); + } catch (e) { + console.warn(e); + } + var m = []; + o.preset && + ('string' == typeof o.preset + ? (m = o.preset.split(/\s+/)) + : Array.isArray(o.preset) + ? (m = o.preset.slice()) + : console.warn('Unrecognized preset value')), + -1 === m.indexOf('default') && m.push('default'); + for (var h = m.length - 1; h >= 0; h -= 1) { + var g = m[h]; + if (g) + if (i.pub.presets.hasOwnProperty(g)) { + for (var u in i.pub.presets[g]) + if (i.pub.presets[g].hasOwnProperty(u)) + try { + a(u, i.pub.presets[g][u]); + } catch (e) { + console.warn(e); + } + } else console.warn('Unknown preset: %s', g); + } + var f = ['preset']; + for (var u in o) + if (o.hasOwnProperty(u) && -1 === f.indexOf(u)) + try { + a(u, o[u]); + } catch (e) { + console.warn(e); + } + if ( + (void 0 === this.container + ? (this.container = e.document.body) + : (this.container = i.node(this.container)), + !this.container) + ) + throw new Error('Cannot instantiate color picker without a container element'); + if (((this.targetElement = i.node(t)), !this.targetElement)) { + if ('string' == typeof t && /^[a-zA-Z][\w:.-]*$/.test(t)) + throw new Error( + "If '" + + t + + "' is supposed to be an ID, please use '#" + + t + + "' or any valid CSS selector.", + ); + throw new Error('Cannot instantiate color picker without a target element'); + } + if (this.targetElement.jscolor && this.targetElement.jscolor instanceof i.pub) + throw new Error('Color picker already installed on this element'); + if ( + ((this.targetElement.jscolor = this), + i.addClass(this.targetElement, i.pub.className), + i.instances.push(this), + i.isButton(this.targetElement) && + ('button' !== this.targetElement.type.toLowerCase() && + (this.targetElement.type = 'button'), + i.isButtonEmpty(this.targetElement))) + ) { + i.removeChildren(this.targetElement), + this.targetElement.appendChild(e.document.createTextNode(' ')); + var C = i.getCompStyle(this.targetElement); + (parseFloat(C['min-width']) || 0) < this.previewSize && + i.setStyle( + this.targetElement, + { 'min-width': this.previewSize + 'px' }, + this.forceStyle, + ); + } + if ( + (void 0 === this.valueElement + ? i.isTextInput(this.targetElement) && + (this.valueElement = this.targetElement) + : null === this.valueElement || + (this.valueElement = i.node(this.valueElement)), + this.alphaElement && (this.alphaElement = i.node(this.alphaElement)), + void 0 === this.previewElement + ? (this.previewElement = this.targetElement) + : null === this.previewElement || + (this.previewElement = i.node(this.previewElement)), + this.valueElement && i.isTextInput(this.valueElement)) + ) { + var y = { onInput: this.valueElement.oninput }; + (this.valueElement.oninput = null), + this.valueElement.addEventListener( + 'keydown', + function (e) { + 'Enter' === i.eventKey(e) && + (n.valueElement && n.processValueInput(n.valueElement.value), + n.tryHide()); + }, + !1, + ), + this.valueElement.addEventListener( + 'change', + function (e) { + if (!i.getData(e, 'internal')) { + var t = n.valueElement.value; + n.processValueInput(n.valueElement.value), + i.triggerCallback(n, 'onChange'), + n.valueElement.value !== t && + i.triggerInputEvent(n.valueElement, 'change', !0, !0); + } + }, + !1, + ), + this.valueElement.addEventListener( + 'input', + function (e) { + i.getData(e, 'internal') || + (n.valueElement && + n.fromString(n.valueElement.value, i.flags.leaveValue), + i.triggerCallback(n, 'onInput')); + }, + !1, + ), + y.onInput && this.valueElement.addEventListener('input', y.onInput, !1), + this.valueElement.setAttribute('autocomplete', 'off'), + this.valueElement.setAttribute('autocorrect', 'off'), + this.valueElement.setAttribute('autocapitalize', 'off'), + this.valueElement.setAttribute('spellcheck', !1); + } + this.alphaElement && + i.isTextInput(this.alphaElement) && + (this.alphaElement.addEventListener( + 'keydown', + function (e) { + 'Enter' === i.eventKey(e) && + (n.alphaElement && n.processAlphaInput(n.alphaElement.value), + n.tryHide()); + }, + !1, + ), + this.alphaElement.addEventListener( + 'change', + function (e) { + if (!i.getData(e, 'internal')) { + var t = n.alphaElement.value; + n.processAlphaInput(n.alphaElement.value), + i.triggerCallback(n, 'onChange'), + i.triggerInputEvent(n.valueElement, 'change', !0, !0), + n.alphaElement.value !== t && + i.triggerInputEvent(n.alphaElement, 'change', !0, !0); + } + }, + !1, + ), + this.alphaElement.addEventListener( + 'input', + function (e) { + i.getData(e, 'internal') || + (n.alphaElement && + n.fromHSVA( + null, + null, + null, + parseFloat(n.alphaElement.value), + i.flags.leaveAlpha, + ), + i.triggerCallback(n, 'onInput'), + i.triggerInputEvent(n.valueElement, 'input', !0, !0)); + }, + !1, + ), + this.alphaElement.setAttribute('autocomplete', 'off'), + this.alphaElement.setAttribute('autocorrect', 'off'), + this.alphaElement.setAttribute('autocapitalize', 'off'), + this.alphaElement.setAttribute('spellcheck', !1)); + var b = 'FFFFFF'; + void 0 !== this.value + ? (b = this.value) + : this.valueElement && + void 0 !== this.valueElement.value && + (b = this.valueElement.value); + var k = void 0; + if ( + (void 0 !== this.alpha + ? (k = '' + this.alpha) + : this.alphaElement && + void 0 !== this.alphaElement.value && + (k = this.alphaElement.value), + (this._currentFormat = null), + ['auto', 'any'].indexOf(this.format.toLowerCase()) > -1) + ) { + var G = i.parseColorString(b); + this._currentFormat = G ? G.format : 'hex'; + } else this._currentFormat = this.format.toLowerCase(); + this.processValueInput(b), void 0 !== k && this.processAlphaInput(k); + }, + }).pub.className = 'jscolor'), + (i.pub.activeClassName = 'jscolor-active'), + (i.pub.looseJSON = !0), + (i.pub.presets = {}), + (i.pub.presets.default = {}), + (i.pub.presets.light = { + backgroundColor: 'rgba(255,255,255,1)', + controlBorderColor: 'rgba(187,187,187,1)', + buttonColor: 'rgba(0,0,0,1)', + }), + (i.pub.presets.dark = { + backgroundColor: 'rgba(51,51,51,1)', + controlBorderColor: 'rgba(153,153,153,1)', + buttonColor: 'rgba(240,240,240,1)', + }), + (i.pub.presets.small = { + width: 101, + height: 101, + padding: 10, + sliderSize: 14, + paletteCols: 8, + }), + (i.pub.presets.medium = { + width: 181, + height: 101, + padding: 12, + sliderSize: 16, + paletteCols: 10, + }), + (i.pub.presets.large = { + width: 271, + height: 151, + padding: 12, + sliderSize: 24, + paletteCols: 15, + }), + (i.pub.presets.thin = { + borderWidth: 1, + controlBorderWidth: 1, + pointerBorderWidth: 1, + }), + (i.pub.presets.thick = { + borderWidth: 2, + controlBorderWidth: 2, + pointerBorderWidth: 2, + }), + (i.pub.sliderInnerSpace = 3), + (i.pub.chessboardSize = 8), + (i.pub.chessboardColor1 = '#666666'), + (i.pub.chessboardColor2 = '#999999'), + (i.pub.previewSeparator = ['rgba(255,255,255,.65)', 'rgba(128,128,128,.65)']), + (i.pub.init = function () { + if (!i.initialized) + for ( + e.document.addEventListener('mousedown', i.onDocumentMouseDown, !1), + e.document.addEventListener('keyup', i.onDocumentKeyUp, !1), + e.addEventListener('resize', i.onWindowResize, !1), + e.addEventListener('scroll', i.onWindowScroll, !1), + i.pub.install(), + i.initialized = !0; + i.readyQueue.length; + + ) + i.readyQueue.shift()(); + }), + (i.pub.install = function (e) { + var t = !0; + try { + i.installBySelector('[data-jscolor]', e); + } catch (e) { + (t = !1), console.warn(e); + } + if (i.pub.lookupClass) + try { + i.installBySelector( + 'input.' + i.pub.lookupClass + ', button.' + i.pub.lookupClass, + e, + ); + } catch (e) {} + return t; + }), + (i.pub.ready = function (e) { + return 'function' != typeof e + ? (console.warn('Passed value is not a function'), !1) + : (i.initialized ? e() : i.readyQueue.push(e), !0); + }), + (i.pub.trigger = function (e) { + var t = function () { + i.triggerGlobal(e); + }; + i.initialized ? t() : i.pub.ready(t); + }), + (i.pub.hide = function () { + i.picker && i.picker.owner && i.picker.owner.hide(); + }), + (i.pub.chessboard = function (e) { + return e || (e = 'rgba(0,0,0,0)'), i.genColorPreviewCanvas(e).canvas.toDataURL(); + }), + (i.pub.background = function (e) { + var t = []; + t.push(i.genColorPreviewGradient(e)); + var o = i.genColorPreviewCanvas(); + return ( + t.push(["url('" + o.canvas.toDataURL() + "')", 'left top', 'repeat'].join(' ')), + t.join(', ') + ); + }), + (i.pub.options = {}), + (i.pub.lookupClass = 'jscolor'), + (i.pub.installByClassName = function () { + return ( + console.error( + 'jscolor.installByClassName() is DEPRECATED. Use data-jscolor="" attribute instead of a class name.' + + i.docsRef, + ), + !1 + ); + }), + i.register(), + i.pub); + return void 0 === e.jscolor && (e.jscolor = e.JSColor = a), a; + }); + }, + }, + t = {}; + function o(n) { + var i = t[n]; + if (void 0 !== i) return i.exports; + var a = (t[n] = { exports: {} }); + return e[n].call(a.exports, a, a.exports, o), a.exports; + } + (o.n = (e) => { + var t = e && e.__esModule ? () => e.default : () => e; + return o.d(t, { a: t }), t; + }), + (o.d = (e, t) => { + for (var n in t) + o.o(t, n) && !o.o(e, n) && Object.defineProperty(e, n, { enumerable: !0, get: t[n] }); + }), + (o.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)), + (() => { + 'use strict'; + let e = {}; + function t() { + e.WrinklerButtons && Game.elderWrath + ? ((l('PopAllNormalWrinklerButton').style.display = ''), + (l('PopFattestWrinklerButton').style.display = '')) + : ((l('PopAllNormalWrinklerButton').style.display = 'none'), + (l('PopFattestWrinklerButton').style.display = 'none')); + } + const n = ['', '', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'], + i = [ + '', + '', + 'M', + 'B', + 'Tr', + 'Quadr', + 'Quint', + 'Sext', + 'Sept', + 'Oct', + 'Non', + 'Dec', + 'Undec', + 'Duodec', + 'Tredec', + 'Quattuordec', + 'Quindec', + 'Sexdec', + 'Septendec', + 'Octodec', + 'Novemdec', + 'Vigint', + 'Unvigint', + 'Duovigint', + 'Trevigint', + 'Quattuorvigint', + ], + a = [ + '', + 'K', + 'M', + 'B', + 'T', + 'Qa', + 'Qi', + 'Sx', + 'Sp', + 'Oc', + 'No', + 'De', + 'UDe', + 'DDe', + 'TDe', + 'QaDe', + 'QiDe', + 'SxDe', + 'SpDe', + 'ODe', + 'NDe', + 'Vi', + 'UVi', + 'DVi', + 'TVi', + 'QaVi', + 'QiVi', + 'SxVi', + 'SpVi', + 'OVi', + 'NVi', + 'Tr', + 'UTr', + 'DTr', + 'TTr', + 'QaTr', + 'QiTr', + 'SxTr', + 'SpTr', + 'OTr', + 'NTr', + 'Qaa', + 'UQa', + 'DQa', + 'TQa', + 'QaQa', + 'QiQa', + 'SxQa', + 'SpQa', + 'OQa', + 'NQa', + 'Qia', + 'UQi', + 'DQi', + 'TQi', + 'QaQi', + 'QiQi', + 'SxQi', + 'SpQi', + 'OQi', + 'NQi', + 'Sxa', + 'USx', + 'DSx', + 'TSx', + 'QaSx', + 'QiSx', + 'SxSx', + 'SpSx', + 'OSx', + 'NSx', + 'Spa', + 'USp', + 'DSp', + 'TSp', + 'QaSp', + 'QiSp', + 'SxSp', + 'SpSp', + 'OSp', + 'NSp', + 'Oco', + 'UOc', + 'DOc', + 'TOc', + 'QaOc', + 'QiOc', + 'SxOc', + 'SpOc', + 'OOc', + 'NOc', + 'Noa', + 'UNo', + 'DNo', + 'TNo', + 'QaNo', + 'QiNo', + 'SxNo', + 'SpNo', + 'ONo', + 'NNo', + 'Ct', + 'UCt', + ]; + let r, + s, + c, + d, + p, + u, + m, + h, + g, + f, + C, + y, + b, + k, + G, + v, + w = [], + x = [], + T = [], + M = {}, + S = Date.now(), + B = Date.now(); + function P(t, o, r) { + const l = e.ScaleDecimals + 1; + if (t === 1 / 0) return 'Infinity'; + if (void 0 === t) return '0'; + if (0 === e.Scale) return M.Beautify(t, o); + if (Number.isFinite(t)) { + if (t < 0) return `-${P(Math.abs(t))}`; + let s = ''; + if (0 === t) return t.toString(); + if (t > 0.001 && t < e.ScaleCutoff) + return (s = e.ScaleSeparator ? t.toLocaleString('nl') : t.toLocaleString('en')), s; + if ((4 === e.Scale && !r) || 4 === r) s = t.toExponential(l).toString().replace('e', 'E'); + else { + const o = t.toExponential().toString(), + c = Math.floor(o.slice(o.indexOf('e') + 1) / 3); + (s = (t / Number('1e' + 3 * c)).toFixed(l)), + (1 === e.Scale && !r) || 1 === r + ? t >= 0.01 && t < Number('1e' + 3 * n.length) + ? (s += ` ${n[c]}`) + : (s = P(t, 0, 4)) + : (2 === e.Scale && !r) || 2 === r + ? t >= 0.01 && t < Number('1e' + 3 * i.length) + ? (s += ` ${i[c]}`) + : (s = P(t, 0, 4)) + : (3 === e.Scale && !r) || 3 === r + ? t >= 0.01 && t < Number('1e' + 3 * a.length) + ? (s += ` ${a[c]}`) + : (s = P(t, 0, 4)) + : ((5 === e.Scale && !r) || 5 === r) && (s += 'E' + 3 * c); + } + return ( + '' === s && + (console.log(`Could not beautify number with Cookie Monster Beautify: ${t}`), + (s = M.Beautify(t, o))), + e.ScaleSeparator && (s = s.replace('.', ',')), + s + ); + } + return ( + console.log(`Could not beautify number with Cookie Monster Beautify: ${t}`), + M.Beautify(t, o) + ); + } + let E, + N, + O, + F, + L, + W, + A, + j, + D, + H, + U, + $, + R, + I, + z, + V, + _, + Q, + X, + q, + Y, + K, + J, + Z, + ee, + te, + oe, + ne, + ie, + ae, + re, + le, + se, + ce, + de, + pe, + ue, + me = 0, + he = 0, + ge = 0, + fe = 0, + Ce = 0, + ye = 0, + be = 0, + ke = 0, + Ge = 0, + ve = 0, + we = 0, + xe = 0, + Te = 0, + Me = 0, + Se = 0, + Be = 1, + Pe = 1, + Ee = 1, + Ne = 0, + Oe = 0, + Fe = 0, + Le = 0, + We = {}, + Ae = {}, + je = {}, + De = {}, + He = 0, + Ue = 0, + $e = [0, null], + Re = 0, + Ie = 0, + ze = {}, + Ve = {}, + _e = {}, + Qe = {}, + Xe = {}, + qe = 0, + Ye = 0, + Ke = [], + Je = 0, + Ze = 0, + et = [], + tt = 0, + ot = 0, + nt = [], + it = 0, + at = 0, + rt = [], + lt = 0, + st = 0, + ct = {}, + dt = {}, + pt = 0, + ut = 0, + mt = [], + ht = {}, + gt = 0, + ft = { + 0: [0, 0, 0], + 1: [0, 0, 0], + 2: [0, 0, 0], + 3: [0, 0, 0], + 4: [0, 0, 0], + 5: [0, 0, 0], + 6: [0, 0, 0], + 7: [0, 0, 0], + 8: [0, 0, 0], + 9: [0, 0, 0], + 10: [0, 0, 0], + }, + Ct = [], + yt = [], + bt = []; + function kt(e) { + let t = 0; + return ( + (Game.dragonAuras[ne].name !== e && Game.dragonAuras[ie].name !== e) || (t = 1), + ('Reality Bending' !== Game.dragonAuras[ne].name && + 'Reality Bending' !== Game.dragonAuras[ie].name) || + (t += 0.1), + t + ); + } + function Gt() { + let e = 0.25; + return (e *= 1 + kt('Earth Shatterer')), e; + } + function vt(e, t) { + return void 0 === ce[e] ? (void 0 === t ? 1 : t) : ce[e]; + } + function wt(e) { + const t = yt[e]; + return (1 !== Game.ascensionMode || ('prestige' !== t.pool && 'fortune' !== t.tier)) && t + ? t.bought + : 0; + } + function xt(e) { + if (Game.hasGod) { + void 0 === Ct.Temple.minigame && (Ct.Temple.minigame = Game.Objects.Temple.minigame); + const t = Ct.Temple.minigame.gods[e]; + if (ae === t.id) return 1; + if (re === t.id) return 2; + if (le === t.id) return 3; + } + return !1; + } + function Tt(e, t) { + let o = t; + if ( + (wt('Season savings') && (o *= 0.99), + wt("Santa's dominion") && (o *= 0.99), + wt('Faberge egg') && (o *= 0.99), + wt('Divine discount') && (o *= 0.99), + wt('Fortune #100') && (o *= 0.99), + (o *= 1 - 0.02 * kt('Fierce Hoarder')), + Game.hasBuff('Everything must go') && (o *= 0.95), + Game.hasBuff('Crafty pixies') && (o *= 0.98), + Game.hasBuff('Nasty goblins') && (o *= 1.02), + e.fortune && wt(e.fortune.name) && (o *= 0.93), + (o *= vt('buildingCost')), + Ct.Temple.minigameLoaded) + ) { + const e = xt('creation'); + 1 === e ? (o *= 0.93) : 2 === e ? (o *= 0.95) : 3 === e && (o *= 0.98); + } + return o; + } + function Mt(e, t, o, n, i, a) { + const r = void 0 === a ? 0 : a; + let l = i, + s = o, + c = 0; + -1 === i && (l = s), i || (l = Game.buyBulk); + for (let o = 0; o < l; o++) { + let o = t * Game.priceIncrease ** Math.max(0, s - n); + (o = r ? Game.modifyBuildingPrice(e, o) : Tt(e, o)), (o = Math.ceil(o)); + const i = r ? e.getSellMultiplier() : Gt(); + (o = Math.floor(o * i)), s > 0 && ((c += o), (s -= 1)); + } + return c; + } + const St = 'CMText', + Bt = 'CMBack', + Pt = 'Blue', + Et = 'Green', + Nt = 'Yellow', + Ot = 'Orange', + Ft = 'Red', + Lt = 'Purple', + Wt = 'Gray', + At = 'Pink', + jt = 'Brown', + Dt = [Wt, Pt, Et, Nt, Ot, Ft, Lt, At, jt], + Ht = [ + ['GoldCookTooltipPlaceholder', 'Calculated with Golden Switch off', '200px'], + [ + 'GoldCookDragonsFortuneTooltipPlaceholder', + 'Calculated with Golden Switch off and at least one golden cookie on-screen', + '240px', + ], + [ + 'PrestMaxTooltipPlaceholder', + 'The MAX prestige is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg', + '320px', + ], + [ + 'NextPrestTooltipPlaceholder', + 'Calculated with cookies gained from wrinklers and Chocolate egg', + '200px', + ], + [ + 'HeavenChipMaxTooltipPlaceholder', + 'The MAX heavenly chips is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg', + '330px', + ], + [ + 'ResetTooltipPlaceholder', + 'The bonus income you would get from new prestige levels unlocked at 100% of its potential and from ascension achievements if you have the same buildings/upgrades after reset', + '370px', + ], + [ + 'ChoEggTooltipPlaceholder', + 'The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and then buying Chocolate egg', + '300px', + ], + ['ChainNextLevelPlaceholder', 'Cheated cookies might break this formula', '250px'], + [ + 'FavouriteSettingPlaceholder', + "Click to set this setting as favourite and show it in 'favourite' settings at the top of the Cookie Monster Settings", + '250px', + ], + ], + Ut = {}; + let $t, + Rt = 0, + It = -1, + zt = [], + Vt = function () {}, + _t = 1, + Qt = 1, + Xt = 1; + const qt = [10, 15, 30, 60, 300, 600, 900, 1800], + Yt = [1, 5, 10, 15, 30], + Kt = { + Frenzy: Nt, + 'Dragon Harvest': jt, + 'Elder frenzy': Et, + Clot: Ft, + 'Click frenzy': Pt, + Dragonflight: At, + }; + let Jt, + Zt, + eo, + to, + oo, + no, + io, + ao = {}, + ro = '', + lo = []; + function so() { + let t = Game.buyBulk; + if ( + (1 === Game.buyMode ? (Qt = t) : (t = Qt), + 1 === t ? (t = We) : 10 === t ? (t = Ae) : 100 === t && (t = je), + 1 === Game.buyMode + ? 1 === e.BuildColour + ? Object.keys(t).forEach((o) => { + l(`productPrice${Game.Objects[o].id}`).style.color = e[`Colour${t[o].color}`]; + }) + : Object.keys(Game.Objects).forEach((e) => { + l(`productPrice${Game.Objects[e].id}`).style.removeProperty('color'); + }) + : -1 === Game.buyMode && + Object.keys(We).forEach((e) => { + const t = Game.Objects[e]; + (l(`productPrice${t.id}`).style.color = ''), + (l(`productPrice${t.id}`).innerHTML = P( + Mt(t, t.basePrice, t.amount, t.free, Game.buyBulk, 1), + )); + }), + 1 === Game.buyMode && e.SortBuildings) + ) { + let o; + 1 === e.SortBuildings + ? ((o = Object.keys(We).map((e) => { + const t = We[e]; + return (t.name = e), (t.id = Game.Objects[e].id), t; + })), + o.sort((e, t) => + Dt.indexOf(e.color) > Dt.indexOf(t.color) + ? 1 + : Dt.indexOf(e.color) < Dt.indexOf(t.color) || e.pp < t.pp + ? -1 + : 0, + )) + : 2 === e.SortBuildings && + ((o = Object.keys(t).map((e) => { + const o = t[e]; + return (o.name = e), (o.id = Game.Objects[e].id), o; + })), + o.sort((e, t) => + Dt.indexOf(e.color) > Dt.indexOf(t.color) + ? 1 + : Dt.indexOf(e.color) < Dt.indexOf(t.color) || e.pp < t.pp + ? -1 + : 0, + )); + for (let e = 0; e < o.length; e++) + Game.Objects[o[e].name].l.style.gridRow = `${e + 2}/${e + 2}`; + } else { + const e = Object.keys(We).map((e) => { + const t = We[e]; + return (t.name = e), (t.id = Game.Objects[e].id), t; + }); + e.sort((e, t) => e.id - t.id); + for (let t = 0; t < e.length; t++) + Game.Objects[e[t].name].l.style.gridRow = `${t + 2}/${t + 2}`; + } + } + function co() { + Object.values(document.getElementsByClassName('storeSection')).forEach((t) => { + e.UpgradesNeverCollapse || 'products' === t.id + ? (t.style.height = 'auto') + : 'vaultUpgrades' === t.id + ? ((t.style.height = ''), (t.style.minHeight = '0px')) + : 'upgrades' === t.id + ? ((t.style.height = ''), + t.className.includes('hasMenu') + ? (t.style.minHeight = '82px') + : (t.style.minHeight = '60px')) + : ((t.style.height = ''), (t.style.minHeight = '60px')); + }); + } + function po() { + if (e.UpBarColour > 0) { + let e = 0, + t = 0, + o = 0, + n = 0, + i = 0, + a = 0, + r = 0; + Object.keys(Game.UpgradesInStore).forEach((s) => { + const c = Game.UpgradesInStore[s]; + let d = !1; + for (let e = 0; e < l(`upgrade${s}`).childNodes.length; e += 1) + if (-1 !== l(`upgrade${s}`).childNodes[e].className.indexOf(Bt)) { + (l(`upgrade${s}`).childNodes[e].className = Bt + ze[c.name].color), (d = !0); + break; + } + if (!d) { + const e = document.createElement('div'); + (e.style.width = '10px'), + (e.style.height = '10px'), + (e.className = Bt + ze[c.name].color), + l(`upgrade${s}`).appendChild(e); + } + ze[c.name].color === Pt + ? (e += 1) + : ze[c.name].color === Et + ? (t += 1) + : ze[c.name].color === Nt + ? (o += 1) + : ze[c.name].color === Ot + ? (n += 1) + : ze[c.name].color === Ft + ? (i += 1) + : ze[c.name].color === Lt + ? (a += 1) + : ze[c.name].color === Wt && (r += 1); + }), + (l('CMUpgradeBarBlue').textContent = e), + (l('CMUpgradeBarGreen').textContent = t), + (l('CMUpgradeBarYellow').textContent = o), + (l('CMUpgradeBarOrange').textContent = n), + (l('CMUpgradeBarRed').textContent = i), + (l('CMUpgradeBarPurple').textContent = a), + (l('CMUpgradeBarGray').textContent = r); + } + const t = []; + for (let e = 0; e < Game.UpgradesInStore.length; e += 1) { + const o = {}; + (o.name = Game.UpgradesInStore[e].name), + (o.price = Game.UpgradesInStore[e].basePrice), + (o.pp = ze[o.name].pp), + t.push(o); + } + e.SortUpgrades + ? t.sort((e, t) => + Dt.indexOf(e.color) > Dt.indexOf(t.color) + ? 1 + : Dt.indexOf(e.color) < Dt.indexOf(t.color) || e.pp < t.pp + ? -1 + : 0, + ) + : t.sort((e, t) => e.price - t.price); + const o = function (e, t) { + return e.findIndex((e) => e.name === t.name); + }; + for (let e = 0; e < Game.UpgradesInStore.length; e += 1) + l(`upgrade${e}`).style.order = o(t, Game.UpgradesInStore[e]) + 1; + } + function uo(t, o) { + let n = t; + if (t === 1 / 0) return t; + if (t < 0) return 'Negative time period'; + n = Math.ceil(t); + const i = Math.floor(n / 31536e3), + a = Math.floor((n % 31536e3) / 86400), + r = Math.floor(((n % 31536e3) % 86400) / 3600), + l = Math.floor((((n % 31536e3) % 86400) % 3600) / 60), + s = Math.floor((((n % 31536e3) % 86400) % 3600) % 60); + let c = ''; + if (e.TimeFormat) { + if (n > 315576e4) return 'XX:XX:XX:XX:XX'; + (c += (i < 10 ? '0' : '') + i + ':'), + (c += (a < 10 ? '0' : '') + a + ':'), + (c += (r < 10 ? '0' : '') + r + ':'), + (c += (l < 10 ? '0' : '') + l + ':'), + (c += (s < 10 ? '0' : '') + s); + } else { + if (n > 7776e5) return o ? 'Over 9000 days!' : '>9000d'; + (c += i > 0 ? i + (o ? (1 === i ? ' year' : ' years') : 'y') + ', ' : ''), + (c.length > 0 || a > 0) && (c += a + (o ? (1 === a ? ' day' : ' days') : 'd') + ', '), + (c.length > 0 || r > 0) && (c += r + (o ? (1 === r ? ' hour' : ' hours') : 'h') + ', '), + (c.length > 0 || l > 0) && + (c += l + (o ? (1 === l ? ' minute' : ' minutes') : 'm') + ', '), + (c += s + (o ? (1 === s ? ' second' : ' seconds') : 's')); + } + return c; + } + function mo(t) { + let o, n; + return ( + t <= 0 + ? ((n = e.TimeFormat ? '00:00:00:00:00' : 'Done!'), (o = Et)) + : ((n = uo(t)), (o = t > 300 ? Ft : t > 60 ? Ot : Nt)), + { text: n, color: o } + ); + } + function ho() { + return e.CPSMode + ? _ + : 0 === e.CalcWrink + ? Game.cookiesPs * (1 - Game.cpsSucked) + : 1 === e.CalcWrink + ? Game.cookiesPs * (Re + (1 - 0.05 * Ie)) + : null !== $e[1] && 2 === e.CalcWrink && 1 === Game.wrinklers[$e[1]].type + ? Game.cookiesPs * ((3 * Re) / Ie + (1 - 0.05 * Ie)) + : Game.cookiesPs * (Re / Ie + (1 - 0.05 * Ie)); + } + function go() { + return 1 === e.CalcWrink ? He : 2 === e.CalcWrink ? $e[0] : 0; + } + function fo(e, t, o) { + const n = document.createElement('div'); + (n.id = e), + (n.style.height = '12px'), + (n.style.margin = '0px 10px'), + (n.style.position = 'relative'); + const i = document.createElement('div'); + (i.style.width = '100%'), + (i.style.height = '10px'), + (i.style.margin = 'auto'), + (i.style.position = 'absolute'), + (i.style.left = '0px'), + (i.style.top = '0px'), + (i.style.right = '0px'), + (i.style.bottom = '0px'); + const a = document.createElement('span'); + (a.style.display = 'inline-block'), + (a.style.textAlign = 'right'), + (a.style.fontSize = '10px'), + (a.style.width = '108px'), + (a.style.marginRight = '5px'), + (a.style.verticalAlign = 'text-top'), + (a.textContent = t), + i.appendChild(a); + for (let e = 0; e < o.length; e++) { + const t = document.createElement('span'); + (t.id = o[e].id), + (t.style.display = 'inline-block'), + (t.style.height = '10px'), + (t.style.verticalAlign = 'text-top'), + (t.style.textAlign = 'center'), + o.length - 1 === e && + ((t.style.borderTopRightRadius = '10px'), (t.style.borderBottomRightRadius = '10px')), + void 0 !== o[e].color && (t.className = Bt + o[e].color), + i.appendChild(t); + } + const r = document.createElement('span'); + return ( + (r.id = `${e}Time`), + (r.style.marginLeft = '5px'), + (r.style.verticalAlign = 'text-top'), + i.appendChild(r), + n.appendChild(i), + n + ); + } + function Co(e) { + if (null !== l('CMBotBar')) { + const t = l('CMBotBar').firstChild.firstChild.childNodes[0], + o = l('CMBotBar').firstChild.firstChild.childNodes[1], + n = l('CMBotBar').firstChild.firstChild.childNodes[2], + i = l('CMBotBar').firstChild.firstChild.childNodes[3], + a = e, + r = t.appendChild(document.createElement('td')); + r.appendChild( + document.createTextNode( + `${-1 !== a.indexOf(' ') ? a.substring(0, a.indexOf(' ')) : a} (`, + ), + ), + (r.appendChild(document.createElement('span')).className = 'CMTextBlue'), + r.appendChild(document.createTextNode(')')), + (t.lastChild.style.paddingLeft = '8px'), + o.appendChild(document.createElement('td')), + (o.lastChild.style.paddingLeft = '8px'), + n.appendChild(document.createElement('td')), + (n.lastChild.style.paddingLeft = '8px'), + i.appendChild(document.createElement('td')), + (i.lastChild.style.paddingLeft = '2px'); + } + } + function yo() { + if (1 === e.BotBar && We && 1 === Game.buyMode) { + let t = 0; + Object.keys(We).forEach((o) => { + let n, + i = Game.buyBulk; + 1 === Game.buyMode ? (_t = i) : (i = _t), + 1 === i && (i = We), + 10 === i && (i = Ae), + 100 === i && (i = je), + (t += 1), + (l('CMBotBar').firstChild.firstChild.childNodes[0].childNodes[ + t + ].childNodes[1].textContent = Game.Objects[o].amount), + (l('CMBotBar').firstChild.firstChild.childNodes[1].childNodes[t].textContent = P( + i[o].bonus, + 2, + )), + (l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[t].className = + St + i[o].color), + (n = e.PPDisplayTime ? uo(Math.round(i[o].pp)) : P(Math.round(i[o].pp), 2)), + (l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[t].textContent = n); + const a = mo((Game.Objects[o].bulkPrice - (Game.cookies + go())) / ho()); + (l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[t].className = + St + a.color), + 'Done!' === a.text && Game.cookies < Game.Objects[o].bulkPrice + ? (l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[ + t + ].textContent = `${a.text} (with Wrink)`) + : (l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[t].textContent = + a.text); + }); + } + } + function bo() { + (Game.Background.canvas.width = Game.Background.canvas.parentNode.offsetWidth), + (Game.Background.canvas.height = Game.Background.canvas.parentNode.offsetHeight), + (Game.LeftBackground.canvas.width = Game.LeftBackground.canvas.parentNode.offsetWidth), + (Game.LeftBackground.canvas.height = Game.LeftBackground.canvas.parentNode.offsetHeight), + Game.DrawBackground(); + } + function ko() { + 1 === e.BotBar && 1 === e.TimerBar && 1 === e.TimerBarPos + ? ((l('CMBotBar').style.bottom = l('CMTimerBar').style.height), + (l('game').style.bottom = `${ + Number(l('CMTimerBar').style.height.replace('px', '')) + 70 + }px`)) + : 1 === e.BotBar + ? ((l('CMBotBar').style.bottom = '0px'), (l('game').style.bottom = '70px')) + : 1 === e.TimerBar && 1 === e.TimerBarPos + ? (l('game').style.bottom = l('CMTimerBar').style.height) + : (l('game').style.bottom = '0px'), + 1 === e.TimerBar && 0 === e.TimerBarPos + ? (l('sectionLeft').style.top = l('CMTimerBar').style.height) + : (l('sectionLeft').style.top = ''), + bo(); + } + function Go() { + 1 === e.TimerBar + ? (l('CMTimerBar').style.display = '') + : (l('CMTimerBar').style.display = 'none'), + ko(); + } + function vo() { + (me = Game.dragonAura), (he = Game.dragonAura2); + } + function wo(e) { + const t = Game.Achievements[e], + o = {}; + return (o.name = t.name), o; + } + function xo(e) { + let t = 1; + if ( + (Object.keys(e.tieredUpgrades).forEach((o) => { + !Game.Tiers[e.tieredUpgrades[o].tier].special && + wt(e.tieredUpgrades[o].name) && + (t *= 2); + }), + Object.keys(e.synergies).forEach((o) => { + if (wt(e.synergies[o].name)) { + const n = e.synergies[o]; + n.buildingTie1.name === e.name + ? (t *= 1 + 0.05 * n.buildingTie2.amount) + : n.buildingTie2.name === e.name && (t *= 1 + 0.001 * n.buildingTie1.amount); + } + }), + e.fortune && wt(e.fortune.name) && (t *= 1.07), + e.grandma && wt(e.grandma.name) && (t *= 1 + 0.01 * Ct.Grandma.amount * (1 / (e.id - 1))), + 'object' == typeof e.tieredUpgrades.misfortune && + 1 === e.vanilla && + wt(e.tieredUpgrades.misfortune.name)) + ) + switch (Game.elderWrath) { + default: + t *= 1; + break; + case 1: + t *= 1.02; + break; + case 2: + t *= 1.04; + break; + case 3: + t *= 1.06; + } + return t; + } + function To(e) { + const t = Game.Objects[e], + o = {}; + return ( + 'Cursor' === t.name + ? (o.cps = function (e) { + let t = 0; + wt('Thousand fingers') && (t += 0.1), + wt('Million fingers') && (t *= 5), + wt('Billion fingers') && (t *= 10), + wt('Trillion fingers') && (t *= 20), + wt('Quadrillion fingers') && (t *= 20), + wt('Quintillion fingers') && (t *= 20), + wt('Sextillion fingers') && (t *= 20), + wt('Septillion fingers') && (t *= 20), + wt('Octillion fingers') && (t *= 20), + wt('Nonillion fingers') && (t *= 20); + let o = 1, + n = 0; + return ( + Object.keys(Ct).forEach((e) => { + 'Cursor' !== Ct[e].name && (n += Ct[e].amount); + }), + (t *= n), + (o *= xo(e)), + (o *= Game.magicCpS('Cursor')), + (o *= vt('cursorCps')), + Game.ComputeCps( + 0.1, + wt('Reinforced index finger') + + wt('Carpal tunnel prevention cream') + + wt('Ambidextrous'), + t, + ) * o + ); + }) + : 'Grandma' === t.name + ? (o.cps = function (e) { + let o = 1; + if ( + (Object.keys(Game.GrandmaSynergies).forEach((e) => { + wt(Game.GrandmaSynergies[e]) && (o *= 2); + }), + wt('Bingo center/Research facility') && (o *= 4), + wt('Ritual rolling pins') && (o *= 2), + wt('Naughty list') && (o *= 2), + wt('Elderwort biscuits') && (o *= 1.02), + (o *= vt('grandmaCps')), + wt('Cat ladies')) + ) + for (let e = 0; e < Game.UpgradesByPool.kitten.length; e++) + wt(Game.UpgradesByPool.kitten[e].name) && (o *= 1.29); + o *= xo(e); + let n = 0; + wt('One mind') && (n += 0.02 * Ct.Grandma.amount), + wt('Communal brainsweep') && (n += 0.02 * Ct.Grandma.amount), + wt('Elder Pact') && (n += 0.05 * Ct.Portal.amount); + let i = 0; + return ( + Object.keys(Ct).forEach((e) => { + 'Grandma' !== Ct[e].name && (i += Ct[e].amount); + }), + (o *= 1 + 0.01 * kt('Elder Battalion') * i), + (o *= Game.magicCpS(t.name)), + (t.baseCps + n) * o + ); + }) + : (o.cps = function (e) { + let t = 1; + return (t *= xo(e)), (t *= Game.magicCpS(e.name)), e.baseCPS * t; + }), + (o.baseCps = t.baseCps), + (o.name = t.name), + (o.tieredUpgrades = t.tieredUpgrades), + (o.synergies = t.synergies), + (o.fortune = t.fortune), + (o.grandma = t.grandma), + (o.baseCPS = t.baseCps), + (o.id = t.id), + (o.vanilla = t.vanilla), + o + ); + } + function Mo(e) { + const t = Game.Upgrades[e], + o = {}; + return ( + (o.power = t.power), + 'function' == typeof o.power && + ('Sugar crystal cookies' === t.name + ? (o.power = function () { + let e = 5; + return ( + Object.keys(Ct).forEach((t) => { + Ct[t].level >= 10 && (e += 1); + }), + e + ); + }) + : (o.power = function () { + let e = 2; + if ((wt('Starlove') && (e = 3), Game.hasGod)) { + const t = xt('seasons'); + 1 === t ? (e *= 1.3) : 2 === t ? (e *= 1.2) : 3 === t && (e *= 1.1); + } + return e; + })), + (o.pool = t.pool), + (o.name = t.name), + o + ); + } + function So() { + (J = Game.UpgradesOwned), + (Z = Game.pledges), + (ee = Game.AchievementsOwned), + (te = Game.heavenlyPower), + (oe = Game.prestige), + Object.keys(Game.Objects).forEach((e) => { + const t = Game.Objects[e]; + let o = Ct[e]; + void 0 === o && ((Ct[e] = To(e)), (o = Ct[e]), Co(e)), + (o.amount = t.amount), + (o.level = t.level), + (o.totalCookies = t.totalCookies), + (o.basePrice = t.basePrice), + (o.free = t.free), + t.minigameLoaded && + ('Temple' === t.name && + ((ae = t.minigame.slot[0]), (re = t.minigame.slot[1]), (le = t.minigame.slot[2])), + (o.minigameLoaded = t.minigameLoaded), + (o.minigame = t.minigame)), + (Ct[e] = o); + }), + Object.keys(Game.Upgrades).forEach((e) => { + const t = Game.Upgrades[e]; + let o = yt[e]; + void 0 === o && ((yt[e] = Mo(e)), (o = yt[e])), (o.bought = t.bought), (yt[e] = o); + }), + Object.keys(Game.Achievements).forEach((e) => { + const t = Game.Achievements[e]; + let o = bt[e]; + void 0 === o && ((bt[e] = wo(e)), (o = bt[e])), (o.won = t.won), (bt[e] = o); + }), + vo(), + (ne = me), + (ie = he); + } + function Bo(e) { + const t = document.createElement('div'); + return ( + (t.style.fontWeight = 'bold'), + (t.id = `${e}Title`), + (t.className = 'CMTextBlue'), + (t.textContent = e), + t + ); + } + function Po(e) { + e.appendChild(Bo('Bonus Income')); + const t = document.createElement('div'); + (t.style.marginBottom = '4px'), + (t.style.color = 'white'), + (t.id = 'CMTooltipIncome'), + e.appendChild(t), + e.appendChild(Bo('Bonus Cookies per Click')), + (e.lastChild.style.display = 'none'); + const o = document.createElement('div'); + (o.style.marginBottom = '4px'), + (o.style.color = 'white'), + (o.style.display = 'none'), + (o.id = 'CMTooltipCookiePerClick'), + e.appendChild(o), + e.appendChild(Bo('Payback Period')); + const n = document.createElement('div'); + (n.style.marginBottom = '4px'), + (n.id = 'CMTooltipPP'), + e.appendChild(n), + e.appendChild(Bo('Time Left')); + const i = document.createElement('div'); + if (((i.id = 'CMTooltipTime'), e.appendChild(i), 'b' === eo)) { + e.appendChild(Bo('Production left till next achievement')), + (e.lastChild.id = 'CMTooltipProductionLeftHeader'); + const t = document.createElement('div'); + (t.id = 'CMTooltipProductionLeft'), e.appendChild(t); + } + if ('b' === eo) { + e.appendChild(Bo('Buildings (price / PP) left till next achievement')), + (e.lastChild.id = 'CMTooltipNextAchievementHeader'); + const t = document.createElement('div'); + (t.id = 'CMTooltipNextAchievement'), e.appendChild(t); + } + } + function Eo(t, o) { + let n = ''; + return ( + (n = + t.pp <= 0 || t.pp === 1 / 0 + ? Wt + : t.pp < ut + ? Pt + : t.pp === ut + ? Et + : t.pp < mt[10][0] + ? Nt + : t.pp < mt[20][0] + ? Ot + : t.pp < mt[30][0] + ? Ft + : Lt), + 0 !== Number(e.PPSecondsLowerLimit) && + o / ho() < Number(e.PPSecondsLowerLimit) && + (n = Pt), + e.PPOnlyConsiderBuyable && o - Game.cookies > 0 && (n = Ft), + n + ); + } + function No() { + let e = 1; + return ( + Object.keys(Game.buffs).forEach((t) => { + void 0 !== Game.buffs[t].multCpS && (e *= Game.buffs[t].multCpS); + }), + e + ); + } + function Oo(e) { + bt[e] && + 0 === bt[e].won && + ((bt[e].won = 1), 'shadow' !== Game.Achievements[e].pool && (ee += 1)); + } + function Fo() { + de = 0; + let e = 1; + const t = {}; + Object.keys(Game.Objects).forEach((e) => { + if (Game.Objects[e].minigameLoaded && Game.Objects[e].minigame.effs) { + const o = Game.Objects[e].minigame.effs; + Object.keys(o).forEach((e) => { + t[e] ? (t[e] *= o[e]) : (t[e] = o[e]); + }); + } + }), + (ce = t), + 1 !== Game.ascensionMode && + (e += + 0.01 * + parseFloat(oe) * + te * + (function () { + let e = 0; + if ( + (wt('Heavenly chip secret') && (e += 0.05), + wt('Heavenly cookie stand') && (e += 0.2), + wt('Heavenly bakery') && (e += 0.25), + wt('Heavenly confectionery') && (e += 0.25), + wt('Heavenly key') && (e += 0.25), + (e *= 1 + 0.05 * kt('Dragon God')), + wt('Lucky digit') && (e *= 1.01), + wt('Lucky number') && (e *= 1.01), + wt('Lucky payout') && (e *= 1.01), + Game.hasGod) + ) { + const t = xt('creation'); + 1 === t ? (e *= 0.7) : 2 === t ? (e *= 0.8) : 3 === t && (e *= 0.9); + } + return e; + })()), + (e *= vt('cps')), + wt('Heralds') && 1 !== Game.ascensionMode && (e *= 1 + 0.01 * Game.heralds), + Object.keys(Game.cookieUpgrades).forEach((t) => { + const o = Game.cookieUpgrades[t]; + wt(o.name) && + ('function' == typeof o.power + ? (e *= 1 + 0.01 * yt[o.name].power(yt[o.name])) + : (e *= 1 + 0.01 * o.power)); + }), + wt('Specialized chocolate chips') && (e *= 1.01), + wt('Designer cocoa beans') && (e *= 1.02), + wt('Underworld ovens') && (e *= 1.03), + wt('Exotic nuts') && (e *= 1.04), + wt('Arcane sugar') && (e *= 1.05), + wt('Increased merriness') && (e *= 1.15), + wt('Improved jolliness') && (e *= 1.15), + wt('A lump of coal') && (e *= 1.01), + wt('An itchy sweater') && (e *= 1.01), + wt("Santa's dominion") && (e *= 1.2), + wt('Fortune #100') && (e *= 1.01), + wt('Fortune #101') && (e *= 1.07), + wt('Dragon scale') && (e *= 1.03); + let o = 1; + if (xt) { + let t = xt('asceticism'); + 1 === t ? (e *= 1.15) : 2 === t ? (e *= 1.1) : 3 === t && (e *= 1.05), + (t = xt('ages')), + 1 === t + ? (e *= 1 + 0.15 * Math.sin((S / 1e3 / 10800) * Math.PI * 2)) + : 2 === t + ? (e *= 1 + 0.15 * Math.sin((S / 1e3 / 43200) * Math.PI * 2)) + : 3 === t && (e *= 1 + 0.15 * Math.sin((S / 1e3 / 86400) * Math.PI * 2)), + (t = xt('decadence')), + 1 === t ? (o *= 0.93) : 2 === t ? (o *= 0.95) : 3 === t && (o *= 0.98), + (t = xt('industry')), + 1 === t ? (o *= 1.1) : 2 === t ? (o *= 1.06) : 3 === t && (o *= 1.03), + (t = xt('labor')), + 1 === t ? (o *= 0.97) : 2 === t ? (o *= 0.98) : 3 === t && (o *= 0.99); + } + wt("Santa's legacy") && (e *= 1 + 0.03 * (Game.santaLevel + 1)); + const n = ee / 25; + let i = 1; + if ( + (wt("Santa's milk and cookies") && (i *= 1.05), + (i *= 1 + 0.05 * kt('Breath of Milk')), + xt) + ) { + const e = xt('mother'); + 1 === e ? (i *= 1.1) : 2 === e ? (i *= 1.05) : 3 === e && (i *= 1.03); + } + i *= vt('milk'); + let a = 1; + wt('Kitten helpers') && (a *= 1 + 0.1 * n * i), + wt('Kitten workers') && (a *= 1 + 0.125 * n * i), + wt('Kitten engineers') && (a *= 1 + 0.15 * n * i), + wt('Kitten overseers') && (a *= 1 + 0.175 * n * i), + wt('Kitten managers') && (a *= 1 + 0.2 * n * i), + wt('Kitten accountants') && (a *= 1 + 0.2 * n * i), + wt('Kitten specialists') && (a *= 1 + 0.2 * n * i), + wt('Kitten experts') && (a *= 1 + 0.2 * n * i), + wt('Kitten consultants') && (a *= 1 + 0.2 * n * i), + wt('Kitten assistants to the regional manager') && (a *= 1 + 0.175 * n * i), + wt('Kitten marketeers') && (a *= 1 + 0.15 * n * i), + wt('Kitten analysts') && (a *= 1 + 0.125 * n * i), + wt('Kitten executives') && (a *= 1 + 0.115 * n * i), + wt('Kitten angels') && (a *= 1 + 0.1 * n * i), + wt('Fortune #103') && (a *= 1 + 0.05 * n * i), + Object.keys(Ct).forEach((e) => { + const t = Ct[e]; + let a = t.cps(t); + 1 !== Game.ascensionMode && (a *= (1 + 0.01 * t.level) * o), + 'Grandma' === t.name && + wt('Milkhelp® lactose intolerance relief tablets') && + (a *= 1 + 0.05 * n * i), + (de += t.amount * a); + }), + wt('"egg"') && (de += 9), + (e *= a); + let r = 1; + if ( + (wt('Chicken egg') && (r *= 1.01), + wt('Duck egg') && (r *= 1.01), + wt('Turkey egg') && (r *= 1.01), + wt('Quail egg') && (r *= 1.01), + wt('Robin egg') && (r *= 1.01), + wt('Ostrich egg') && (r *= 1.01), + wt('Cassowary egg') && (r *= 1.01), + wt('Salmon roe') && (r *= 1.01), + wt('Frogspawn') && (r *= 1.01), + wt('Shark egg') && (r *= 1.01), + wt('Turtle egg') && (r *= 1.01), + wt('Ant larva') && (r *= 1.01), + wt('Century egg')) + ) { + let e = (10 * Math.floor((B - Game.startDate) / 1e3 / 10)) / 60 / 60 / 24; + (e = Math.min(e, 100)), (Oe = 1 + 0.1 * (1 - (1 - e / 100) ** 3)), (r *= Oe); + } + (e *= r), + wt('Sugar baking') && (e *= 1 + 0.01 * Math.min(100, Game.lumps)), + (e *= 1 + kt('Radiant Appetite')); + const l = de * e; + Object.keys(Game.CpsAchievements).forEach((e) => { + l >= Game.CpsAchievements[e].threshold && Oo(Game.CpsAchievements[e].name); + }), + (pe = l); + const { n: s } = Game.shimmerTypes.golden, + c = kt("Dragon's Fortune"); + for (let t = 0; t < s; t++) e *= 1 + 1.23 * c; + const d = Game.bakeryName.toLowerCase(); + if ( + ('orteil' === d ? (e *= 0.99) : 'ortiel' === d && (e *= 0.98), + wt('Elder Covenant') && (e *= 0.95), + wt('Golden switch [off]')) + ) { + let t = 1.5; + if (wt('Residual luck')) { + const e = Game.goldenCookieUpgrades; + Object.keys(e).forEach((o) => { + wt(e[o]) && (t += 0.1); + }); + } + e *= t; + } + if (wt('Shimmering veil [off]')) { + let t = 0.5; + wt('Reinforced membrane') && (t += 0.1), (e *= 1 + t); + } + wt('Magic shenanigans') && (e *= 1e3), + wt('Occult obstruction') && (e *= 0), + (de = Game.runModHookOnValue('cps', de)), + (e *= No()), + (de *= e); + } + const Lo = [ + '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 #018', + 'Fortune #100', + 'Fortune #101', + 'Fortune #102', + 'Fortune #103', + 'Fortune #104', + ], + Wo = [ + 'Skull cookies', + 'Ghost cookies', + 'Bat cookies', + 'Slime cookies', + 'Pumpkin cookies', + 'Eyeball cookies', + 'Spider cookies', + ], + Ao = [ + 'Christmas tree biscuits', + 'Snowflake biscuits', + 'Snowman biscuits', + 'Holly biscuits', + 'Candy cane biscuits', + 'Bell biscuits', + 'Present biscuits', + ], + jo = [ + 'Pure heart biscuits', + 'Ardent heart biscuits', + 'Sour heart biscuits', + 'Weeping heart biscuits', + 'Golden heart biscuits', + 'Eternal heart biscuits', + 'Prism heart biscuits', + ], + Do = [ + 'Elderwort biscuits', + 'Bakeberry cookies', + 'Duketater cookies', + 'Green yeast digestives', + 'Wheat slims', + 'Fern tea', + 'Ichor syrup', + ]; + function Ho(e) { + return bt[e] ? bt[e].won : 0; + } + function Uo() { + let e = 0; + Object.keys(Game.GrandmaSynergies).forEach((t) => { + wt(Game.GrandmaSynergies[t]) && (e += 1); + }), + !Ho('Elder') && e >= 7 && Oo('Elder'), + !Ho('Veteran') && e >= 14 && Oo('Veteran'); + let t = 0, + o = 1, + n = 1, + i = 1e5; + Object.keys(Ct).forEach((e) => { + (t += Ct[e].amount), + (i = Math.min(Ct[e].amount, i)), + Ho('Mathematician') || + (Ct[e].amount < + Math.min(128, 2 ** (Game.ObjectsById.length - Game.Objects[e].id - 1)) && + (o = 0)), + Ho('Base 10') || + (Ct[e].amount < 10 * (Game.ObjectsById.length - Game.Objects[e].id) && (n = 0)); + }), + i >= 1 && Oo('One with everything'), + 1 === o && Oo('Mathematician'), + 1 === n && Oo('Base 10'), + i >= 100 && Oo('Centennial'), + i >= 150 && Oo('Centennial and a half'), + i >= 200 && Oo('Bicentennial'), + i >= 250 && Oo('Bicentennial and a half'), + i >= 300 && Oo('Tricentennial'), + i >= 350 && Oo('Tricentennial and a half'), + i >= 400 && Oo('Quadricentennial'), + i >= 450 && Oo('Quadricentennial and a half'), + i >= 500 && Oo('Quincentennial'), + i >= 550 && Oo('Quincentennial and a half'), + i >= 600 && Oo('Sexcentennial'), + t >= 100 && Oo('Builder'), + t >= 500 && Oo('Architect'), + t >= 1e3 && Oo('Engineer'), + t >= 2e3 && Oo('Lord of Constructs'), + t >= 4e3 && Oo('Grand design'), + t >= 8e3 && Oo('Ecumenopolis'), + J >= 20 && Oo('Enhancer'), + J >= 50 && Oo('Augmenter'), + J >= 100 && Oo('Upgrader'), + J >= 200 && Oo('Lord of Progress'), + J >= 300 && Oo('The full picture'), + J >= 400 && Oo("When there's nothing left to add"), + t >= 4e3 && J >= 300 && Oo('Polymath'), + t >= 8e3 && J >= 400 && Oo('Renaissance baker'), + Ct.Cursor.amount + Ct.Grandma.amount >= 777 && Oo('The elder scrolls'); + let a = !0; + Object.keys(Wo).forEach((e) => { + wt(Wo[e]) || (a = !1); + }), + a && Oo('Spooky cookies'); + let r = !0; + if ( + (Object.keys(Ao).forEach((e) => { + wt(Ao[e]) || (r = !1); + }), + r && Oo('Let it snow'), + wt('Fortune cookies')) + ) { + const e = Game.Tiers.fortune.upgrades; + let t = 0; + Object.keys(e).forEach((o) => { + wt(e[o].name) && (t += 1); + }), + t >= e.length && Oo('O Fortuna'); + } + } + function $o(e, t) { + So(), (Ct[e].amount += t); + const o = Ct[e]; + 'Cursor' === e + ? (o.amount >= 1 && Oo('Click'), + o.amount >= 2 && Oo('Double-click'), + o.amount >= 50 && Oo('Mouse wheel'), + o.amount >= 100 && Oo('Of Mice and Men'), + o.amount >= 200 && Oo('The Digital'), + o.amount >= 300 && Oo('Extreme polydactyly'), + o.amount >= 400 && Oo('Dr. T'), + o.amount >= 500 && Oo('Thumbs, phalanges, metacarpals'), + o.amount >= 600 && Oo('With her finger and her thumb'), + o.amount >= 700 && Oo('Gotta hand it to you'), + o.amount >= 800 && Oo("The devil's workshop")) + : Object.keys(Game.Objects[o.name].tieredAchievs).forEach((e) => { + o.amount >= Game.Tiers[Game.Objects[o.name].tieredAchievs[e].tier].achievUnlock && + Oo(Game.Objects[o.name].tieredAchievs[e].name); + }); + const n = ee; + return Fo(), Uo(), n !== ee && Fo(), de - Game.cookiesPs; + } + function Ro(e, t, o) { + let n = e, + i = 0; + for (; n < o; ) (n += 0.002 * Math.max(0.002, (n / Math.max(t, 100)) ** 0.5)), (i += 1); + return i / Game.fps; + } + function Io() { + null !== l('CMDispTooltipWarningParent') && + (0 === e.ToolWarnPos + ? ((l('CMDispTooltipWarningParent').style.top = 'auto'), + (l('CMDispTooltipWarningParent').style.margin = '4px -4px'), + (l('CMDispTooltipWarningParent').style.padding = '3px 4px')) + : ((l('CMDispTooltipWarningParent').style.right = 'auto'), + (l('CMDispTooltipWarningParent').style.margin = '4px'), + (l('CMDispTooltipWarningParent').style.padding = '4px 3px'))); + } + function zo() { + if ((So(), 'none' !== l('tooltipAnchor').style.display && l('CMTooltipArea'))) { + l('CMTooltipArea').innerHTML = ''; + const t = (function () { + l('tooltip').firstChild.style.paddingBottom = '4px'; + const e = document.createElement('div'); + return ( + (e.style.border = '1px solid'), + (e.style.padding = '4px'), + (e.style.margin = '0px -4px'), + (e.id = 'CMTooltipBorder'), + (e.className = 'CMTextGray'), + e + ); + })(); + l('CMTooltipArea').appendChild(t), + 'b' === eo + ? (function () { + if (1 === e.TooltipBuildUpgrade && 1 === Game.buyMode) { + let t; + if ( + (Po(l('CMTooltipBorder')), + 1 === Game.buyMode ? (Xt = t) : (t = Xt), + 1 === Game.buyBulk + ? (t = We) + : 10 === Game.buyBulk + ? (t = Ae) + : 100 === Game.buyBulk && (t = je), + (Jt = Game.Objects[to].bulkPrice), + (Zt = t[to].bonus), + 1 === e.TooltipBuildUpgrade && 1 === Game.buyMode) + ) { + l('CMTooltipIncome').textContent = P(Zt, 2); + const o = Math.round((Zt / Game.cookiesPs) * 1e4); + Number.isFinite(o) && 0 !== o + ? (l('CMTooltipIncome').textContent += ` (${o / 100}% of income)`) + : (l('CMTooltipIncome').textContent += ` (<0${ + e.ScaleSeparator ? ',' : '.' + }01% of income)`), + (l('CMTooltipBorder').className = St + t[to].color), + e.PPDisplayTime + ? (l('CMTooltipPP').textContent = uo(t[to].pp)) + : (l('CMTooltipPP').textContent = P(t[to].pp, 2)), + (l('CMTooltipPP').className = St + t[to].color); + const n = mo((Jt - (Game.cookies + go())) / ho()); + (l('CMTooltipTime').textContent = n.text), + 'Done!' === n.text && Game.cookies < t[to].price + ? (l('CMTooltipTime').textContent = `${n.text} (with Wrink)`) + : (l('CMTooltipTime').textContent = n.text), + (l('CMTooltipTime').className = St + n.color); + } + (l('CMTooltipProductionLeftHeader').style.display = 'none'), + (l('CMTooltipTime').style.marginBottom = '0px'); + for (const e of Object.keys(Game.Objects[to].productionAchievs)) + if (!Game.HasAchiev(Game.Objects[to].productionAchievs[e].achiev.name)) { + const t = Game.Objects[to].productionAchievs[e]; + (l('CMTooltipTime').style.marginBottom = '4px'), + (l('CMTooltipProductionLeftHeader').style.display = ''), + (l('CMTooltipProductionLeft').className = `ProdAchievement${to}`), + (l('CMTooltipProductionLeft').textContent = P( + t.pow - Ct[to].totalCookies, + 15, + )), + (l('CMTooltipProductionLeft').style.color = 'white'); + break; + } + const o = De[to]; + if (o.AmountNeeded < 101) { + let t; + (l('CMTooltipProductionLeft').style.marginBottom = '4px'), + (l('CMTooltipNextAchievementHeader').style.display = ''), + (t = Game.cookiesPs + ? Math.max(o.price - (Game.cookies + go()), 0) / Game.cookiesPs + + o.price / $o(to, o.AmountNeeded) + : o.price / $o(to, o.AmountNeeded)), + (l('CMTooltipNextAchievement').textContent = `${P(o.AmountNeeded)} / ${P( + o.price, + )} / `), + (l('CMTooltipNextAchievement').style.color = 'white'); + const n = document.createElement('span'); + e.PPDisplayTime ? (n.textContent = uo(t)) : (n.textContent = P(t)), + (n.className = St + Eo({ pp: t }, o.price)), + l('CMTooltipNextAchievement').appendChild(n); + } else + (l('CMTooltipNextAchievementHeader').style.display = 'none'), + (l('CMTooltipProductionLeft').style.marginBottom = '0px'); + } else l('CMTooltipArea').style.display = 'none'; + })() + : 'u' === eo + ? (function () { + if ( + (Po(l('CMTooltipBorder')), + (Zt = ze[Game.UpgradesInStore[to].name].bonus), + (Jt = Game.Upgrades[Game.UpgradesInStore[to].name].getPrice()), + (oo = ze[Game.UpgradesInStore[to].name].bonusMouse), + 1 === e.TooltipBuildUpgrade) + ) { + l('CMTooltipIncome').textContent = P(Zt, 2); + const t = Math.round((Zt / Game.cookiesPs) * 1e4); + '0' !== l('CMTooltipIncome').textContent || ('b' !== eo && 'u' !== eo) + ? (Number.isFinite(t) && 0 !== t + ? (l('CMTooltipIncome').textContent += ` (${t / 100}% of income)`) + : (l('CMTooltipIncome').textContent += ` (<0${ + e.ScaleSeparator ? ',' : '.' + }01% of income)`), + (l('CMTooltipBorder').className = + St + ze[Game.UpgradesInStore[to].name].color), + oo && + ((l('CMTooltipCookiePerClick').textContent = P(oo)), + (l('CMTooltipCookiePerClick').style.display = 'block'), + (l('CMTooltipCookiePerClick').previousSibling.style.display = 'block')), + 0 === Zt && oo + ? ((l('CMTooltipPP').textContent = `${P(Jt / oo)} Clicks`), + (l('CMTooltipPP').style.color = 'white')) + : (e.PPDisplayTime + ? (l('CMTooltipPP').textContent = uo( + ze[Game.UpgradesInStore[to].name].pp, + )) + : (l('CMTooltipPP').textContent = P( + ze[Game.UpgradesInStore[to].name].pp, + 2, + )), + (l('CMTooltipPP').className = + St + ze[Game.UpgradesInStore[to].name].color))) + : ((l('Bonus IncomeTitle').style.display = 'none'), + (l('CMTooltipIncome').style.display = 'none'), + (l('Payback PeriodTitle').style.display = 'none'), + (l('CMTooltipPP').style.display = 'none')); + const o = mo((Jt - (Game.cookies + go())) / ho()); + if ( + ((l('CMTooltipTime').textContent = o.text), + 'Done!' === o.text && Game.cookies < Game.UpgradesInStore[to].getPrice() + ? (l('CMTooltipTime').textContent = `${o.text} (with Wrink)`) + : (l('CMTooltipTime').textContent = o.text), + (l('CMTooltipTime').className = St + o.color), + 'Chocolate egg' === Game.UpgradesInStore[to].name) + ) { + (l('CMTooltipBorder').lastChild.style.marginBottom = '4px'), + l('CMTooltipBorder').appendChild( + Bo('Cookies to be gained (Currently/Max)'), + ); + const e = document.createElement('div'); + (e.style.color = 'white'), + (e.textContent = `${P(0.05 * Game.cookies)} / ${P(Le)}`), + l('CMTooltipBorder').appendChild(e); + } + } else l('CMTooltipArea').style.display = 'none'; + })() + : 's' === eo + ? (function () { + if (1 === e.TooltipLump) { + const e = l('CMTooltipBorder'); + e.appendChild(Bo('Current Sugar Lump')); + const o = document.createElement('div'); + (o.id = 'CMTooltipTime'), e.appendChild(o); + const n = + 0 === (t = Game.lumpCurrentType) + ? { text: 'Normal', color: Wt } + : 1 === t + ? { text: 'Bifurcated', color: Et } + : 2 === t + ? { text: 'Golden', color: Nt } + : 3 === t + ? { text: 'Meaty', color: Ot } + : 4 === t + ? { text: 'Caramelized', color: Lt } + : { text: 'Unknown Sugar Lump', color: Ft }; + (o.textContent = n.text), (o.className = St + n.color); + } else l('CMTooltipArea').style.display = 'none'; + var t; + })() + : 'g' === eo + ? (function () { + const { minigame: t } = Game.Objects['Wizard tower'], + o = t.getSpellCost(t.spellsById[to]); + if (1 === e.TooltipGrim && o <= t.magicM) { + const e = l('CMTooltipBorder'); + e.appendChild(Bo('Time Left')); + const n = document.createElement('div'); + (n.id = 'CMTooltipTime'), e.appendChild(n); + const i = mo(Ro(t.magic, t.magicM, o)); + if (((n.textContent = i.text), (n.className = St + i.color), o <= t.magic)) { + e.appendChild(Bo('Recover Time')); + const n = document.createElement('div'); + (n.id = 'CMTooltipRecover'), e.appendChild(n); + const i = mo(Ro(Math.max(0, t.magic - o), t.magicM, t.magic)); + (n.textContent = i.text), (n.className = St + i.color); + } + if ('0' === to) { + e.appendChild(Bo('Cookies to be gained/lost')); + const t = document.createElement('div'); + (t.id = 'x'), e.appendChild(t); + const o = document.createElement('span'); + (o.style.color = '#33FF00'), + (o.textContent = P( + Math.min(0.15 * (Game.cookies + go()), 60 * Se * 30), + 2, + )), + t.appendChild(o); + const n = document.createElement('span'); + (n.textContent = ' / '), t.appendChild(n); + const i = document.createElement('span'); + (i.style.color = 'red'), + (i.textContent = P(60 * Se * 15, 2)), + t.appendChild(i); + } + l('CMTooltipArea').appendChild(e); + } else l('CMTooltipArea').style.display = 'none'; + })() + : 'p' === eo + ? (function () { + const { minigame: t } = Game.Objects.Farm; + if (e.TooltipPlots && 0 !== t.plot[to[1]][to[0]][0]) { + const e = + t.plot[to[1]][to[0]][1] > t.plantsById[t.plot[to[1]][to[0]][0] - 1].mature, + o = t.plantsById[t.plot[to[1]][to[0]][0] - 1].name; + l('CMTooltipBorder').appendChild(Bo('Reward (Current / Maximum)')); + const n = document.createElement('div'); + (n.id = 'CMTooltipPlantReward'), + l('CMTooltipBorder').appendChild(n), + 'Bakeberry' === o + ? (l('CMTooltipPlantReward').textContent = `${ + e ? P(Math.min(0.03 * Game.cookies, 60 * Game.cookiesPs * 30)) : '0' + } / ${P(60 * Game.cookiesPs * 30)}`) + : 'Chocoroot' === o || 'White chocoroot' === o + ? (l('CMTooltipPlantReward').textContent = `${ + e ? P(Math.min(0.03 * Game.cookies, 60 * Game.cookiesPs * 3)) : '0' + } / ${P(60 * Game.cookiesPs * 3)}`) + : 'Queenbeet' === o + ? (l('CMTooltipPlantReward').textContent = `${ + e ? P(Math.min(0.04 * Game.cookies, 60 * Game.cookiesPs * 60)) : '0' + } / ${P(60 * Game.cookiesPs * 60)}`) + : 'Duketater' === o + ? (l('CMTooltipPlantReward').textContent = `${ + e ? P(Math.min(0.08 * Game.cookies, 60 * Game.cookiesPs * 120)) : '0' + } / ${P(60 * Game.cookiesPs * 120)}`) + : (l('CMTooltipArea').style.display = 'none'); + } else l('CMTooltipArea').style.display = 'none'; + })() + : 'ha' === eo + ? (function () { + const { minigame: t } = Game.Objects.Farm; + if (e.TooltipLump) { + l('CMTooltipBorder').appendChild(Bo('Cookies gained from harvesting:')); + let e = 0, + o = 0; + Game.keys[16] && Game.keys[17] && (o = 1); + for (let n = 0; n < 6; n++) + for (let i = 0; i < 6; i++) + if (t.plot[n][i][0] >= 1) { + const a = t.plot[n][i], + r = t.plantsById[a[0] - 1], + l = r.name; + let s = !0; + o && r.immortal && (s = !1), + a[1] < r.matureBase && (s = !1), + s && 'Bakeberry' === l + ? (e += Math.min(0.03 * Game.cookies, 60 * Game.cookiesPs * 30)) + : (s && 'Chocoroot' === l) || 'White chocoroot' === l + ? (e += Math.min(0.03 * Game.cookies, 60 * Game.cookiesPs * 3)) + : s && 'Queenbeet' === l + ? (e += Math.min(0.04 * Game.cookies, 60 * Game.cookiesPs * 60)) + : s && + 'Duketater' === l && + (e += Math.min(0.08 * Game.cookies, 60 * Game.cookiesPs * 120)); + } + l('CMTooltipBorder').appendChild(document.createTextNode(P(e))); + } else l('CMTooltipArea').style.display = 'none'; + })() + : 'wb' === eo + ? (function () { + (l('tooltip').innerHTML = ''), l('tooltip').appendChild(Bo('Reward:')); + const e = document.createElement('div'); + (e.id = 'CMWrinklerReward'), + 'PopAll' === to + ? (e.textContent = P(He)) + : 'PopFattest' === to && (e.textContent = P($e[0])), + l('tooltip').appendChild(e); + })() + : ('pag' === eo || ('pas' === eo && -1 !== to[1])) && + (function () { + if (1 === e.TooltipPantheon) { + const t = l('CMTooltipBorder'); + let o; + (o = 'pas' === eo ? to[1] : to), t.appendChild(Bo('Effect in position 1:')); + const n = document.createElement('div'); + if (((n.id = 'CMPantheonTooltipPosition1'), 0 !== ft[o][0])) { + n.textContent = P(ft[o][0]); + const t = Math.round((ft[o][0] / Game.cookiesPs) * 1e4); + Number.isFinite(t) && 0 !== t + ? (n.textContent += ` (${t / 100}% of income)`) + : (n.textContent += ` (<0${e.ScaleSeparator ? ',' : '.'}01% of income)`); + } else n.textContent = 'No effect to CPS'; + t.appendChild(n), t.appendChild(Bo('Effect in position 2:')); + const i = document.createElement('div'); + if (((i.id = 'CMPantheonTooltipPosition2'), 0 !== ft[o][1])) { + i.textContent = P(ft[o][1]); + const t = Math.round((ft[o][1] / Game.cookiesPs) * 1e4); + Number.isFinite(t) && 0 !== t + ? (i.textContent += ` (${t / 100}% of income)`) + : (i.textContent += ` (<0${e.ScaleSeparator ? ',' : '.'}01% of income)`); + } else i.textContent = 'No effect to CPS'; + t.appendChild(i), t.appendChild(Bo('Effect in position 3:')); + const a = document.createElement('div'); + if (((a.id = 'CMPantheonTooltipPosition2'), 0 !== ft[o][2])) { + a.textContent = P(ft[o][2]); + const t = Math.round((ft[o][2] / Game.cookiesPs) * 1e4); + Number.isFinite(t) && 0 !== t + ? (a.textContent += ` (${t / 100}% of income)`) + : (a.textContent += ` (<0${e.ScaleSeparator ? ',' : '.'}01% of income)`); + } else a.textContent = 'No effect to CPS'; + t.appendChild(a), l('CMTooltipArea').appendChild(t); + } else l('CMTooltipArea').style.display = 'none'; + })(), + (function () { + if ('b' === eo || 'u' === eo) { + null === document.getElementById('CMDispTooltipWarningParent') && + (l('tooltipAnchor').appendChild( + (function () { + const t = document.createElement('div'); + (t.style.position = 'absolute'), + (t.style.display = 'block'), + (t.style.left = 'auto'), + (t.style.bottom = 'auto'), + (t.id = 'CMDispTooltipWarningParent'); + const o = function (e, t, o, n, i) { + const a = document.createElement('div'); + (a.id = e), + (a.style.display = 'none'), + (a.style.transition = 'opacity 0.1s ease-out'), + (a.className = 'CMBorder' + t), + (a.style.padding = '2px'), + (a.style.background = '#000 url(img/darkNoise.png)'); + const r = document.createElement('div'); + a.appendChild(r); + const l = document.createElement('span'); + (l.className = St + t), + (l.style.fontWeight = 'bold'), + (l.textContent = o), + r.appendChild(l), + r.appendChild(document.createTextNode(n)); + const s = document.createElement('div'); + a.appendChild(s); + const c = document.createElement('span'); + return ( + (c.id = i), + s.appendChild(document.createTextNode('Deficit: ')), + s.appendChild(c), + a + ); + }; + return ( + t.appendChild( + o( + 'CMDispTooltipWarnLucky', + Ft, + 'Warning: ', + 'Purchase of this item will put you under the number of Cookies required for "Lucky!"', + 'CMDispTooltipWarnLuckyText', + ), + ), + (t.firstChild.style.marginBottom = '4px'), + t.appendChild( + o( + 'CMDispTooltipWarnLuckyFrenzy', + Nt, + 'Warning: ', + 'Purchase of this item will put you under the number of Cookies required for "Lucky!" (Frenzy)', + 'CMDispTooltipWarnLuckyFrenzyText', + ), + ), + (t.lastChild.style.marginBottom = '4px'), + t.appendChild( + o( + 'CMDispTooltipWarnConjure', + Lt, + 'Warning: ', + 'Purchase of this item will put you under the number of Cookies required for "Conjure Baked Goods"', + 'CMDispTooltipWarnConjureText', + ), + ), + (t.lastChild.style.marginBottom = '4px'), + t.appendChild( + o( + 'CMDispTooltipWarnConjureFrenzy', + Lt, + 'Warning: ', + 'Purchase of this item will put you under the number of Cookies required for "Conjure Baked Goods" (Frenzy)', + 'CMDispTooltipWarnConjureFrenzyText', + ), + ), + (t.lastChild.style.marginBottom = '4px'), + t.appendChild( + o( + 'CMDispTooltipWarnEdifice', + Lt, + 'Warning: ', + 'Purchase of this item will put you under the number of Cookies needed for "Spontaneous Edifice" to possibly give you your most expensive building"', + 'CMDispTooltipWarnEdificeText', + ), + ), + (t.lastChild.style.marginBottom = '4px'), + t.appendChild( + o( + 'CMDispTooltipWarnUser', + Ft, + 'Warning: ', + `Purchase of this item will put you under the number of Cookies equal to ${e.ToolWarnUser} seconds of CPS`, + 'CMDispTooltipWarnUserText', + ), + ), + t + ); + })(), + ), + Io()), + 0 === e.ToolWarnPos + ? (l('CMDispTooltipWarningParent').style.right = '0px') + : (l('CMDispTooltipWarningParent').style.top = `${ + l('tooltip').offsetHeight + }px`), + (l('CMDispTooltipWarningParent').style.width = + l('tooltip').offsetWidth - 6 + 'px'); + const t = Game.cookies + go() - Jt, + o = e.ToolWarnBon ? Zt : 0; + let n = Ce; + if (1 === e.ToolWarnBon) { + let e = Zt; + (e /= No()), (n += (60 * e * 15) / 0.15); + } + if ( + (1 === e.ToolWarnLucky && t < n && ('b' !== eo || 1 === Game.buyMode) + ? ((l('CMDispTooltipWarnLucky').style.display = ''), + (l('CMDispTooltipWarnLuckyText').textContent = `${P(n - t)} (${uo( + (n - t) / (ho() + o), + )})`)) + : (l('CMDispTooltipWarnLucky').style.display = 'none'), + 1 === e.ToolWarnLuckyFrenzy) + ) { + const e = 7 * n; + t < e && ('b' !== eo || 1 === Game.buyMode) + ? ((l('CMDispTooltipWarnLuckyFrenzy').style.display = ''), + (l('CMDispTooltipWarnLuckyFrenzyText').textContent = `${P(e - t)} (${uo( + (e - t) / (ho() + o), + )})`)) + : (l('CMDispTooltipWarnLuckyFrenzy').style.display = 'none'); + } else l('CMDispTooltipWarnLuckyFrenzy').style.display = 'none'; + if (1 === e.ToolWarnConjure) { + const e = 2 * n; + t < e && ('b' !== eo || 1 === Game.buyMode) + ? ((l('CMDispTooltipWarnConjure').style.display = ''), + (l('CMDispTooltipWarnConjureText').textContent = `${P(e - t)} (${uo( + (e - t) / (ho() + o), + )})`)) + : (l('CMDispTooltipWarnConjure').style.display = 'none'); + } else l('CMDispTooltipWarnConjure').style.display = 'none'; + if (1 === e.ToolWarnConjureFrenzy) { + const e = 2 * n * 7; + t < e && ('b' !== eo || 1 === Game.buyMode) + ? ((l('CMDispTooltipWarnConjureFrenzy').style.display = ''), + (l('CMDispTooltipWarnConjureFrenzyText').textContent = `${P(e - t)} (${uo( + (e - t) / (ho() + o), + )})`)) + : (l('CMDispTooltipWarnConjureFrenzy').style.display = 'none'); + } else l('CMDispTooltipWarnConjureFrenzy').style.display = 'none'; + 1 === e.ToolWarnEdifice && + Game.Objects['Wizard tower'].minigameLoaded && + Te && + t < Te && + ('b' !== eo || 1 === Game.buyMode) + ? ((l('CMDispTooltipWarnEdifice').style.display = ''), + (l('CMDispTooltipWarnEdificeText').textContent = `${P(Te - t)} (${uo( + (Te - t) / (ho() + o), + )})`)) + : (l('CMDispTooltipWarnEdifice').style.display = 'none'), + e.ToolWarnUser > 0 && + t < e.ToolWarnUser * ho() && + ('b' !== eo || 1 === Game.buyMode) + ? ((l('CMDispTooltipWarnUser').style.display = ''), + (l( + 'CMDispTooltipWarnUser', + ).children[0].textContent = `Purchase of this item will put you under the number of Cookies equal to ${e.ToolWarnUser} seconds of CPS`), + (l('CMDispTooltipWarnUserText').textContent = `${P( + e.ToolWarnUser * ho() - t, + )} (${uo((e.ToolWarnUser * ho() - t) / (ho() + o))})`)) + : (l('CMDispTooltipWarnUser').style.display = 'none'); + } else + null !== l('CMDispTooltipWarningParent') && + l('CMDispTooltipWarningParent').remove(); + })(); + } else + null === l('CMTooltipArea') && + null !== l('CMDispTooltipWarningParent') && + l('CMDispTooltipWarningParent').remove(); + } + function Vo() { + if (Game.prefs.autosave && Game.drawT % 10 == 0 && 'stats' === Game.onMenu && e.Stats) { + const e = document.getElementById('CMStatsAutosaveTimer'); + e && (e.innerText = Game.sayTime(60 * Game.fps - (Game.T % (60 * Game.fps)), 4)); + } + if ( + (so(), + po(), + co(), + (function () { + if (1 === e.TimerBar) { + const t = l('CMTimerBar').offsetWidth - 163, + o = l('CMTimerBar').offsetWidth - 133; + let n = 0; + 0 !== Game.shimmerTypes.golden.spawned || Game.Has('Golden switch [off]') + ? (l('CMTimerBarGC').style.display = 'none') + : ((l('CMTimerBarGC').style.display = ''), + (l('CMTimerBarGCMinBar').style.width = `${Math.round( + (Math.max(0, Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) * + t) / + Game.shimmerTypes.golden.maxTime, + )}px`), + e.TimerBarOverlay >= 1 + ? (l('CMTimerBarGCMinBar').textContent = Math.ceil( + (Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) / + Game.fps, + )) + : (l('CMTimerBarGCMinBar').textContent = ''), + Game.shimmerTypes.golden.minTime === Game.shimmerTypes.golden.maxTime + ? ((l('CMTimerBarGCMinBar').style.borderTopRightRadius = '10px'), + (l('CMTimerBarGCMinBar').style.borderBottomRightRadius = '10px')) + : ((l('CMTimerBarGCMinBar').style.borderTopRightRadius = ''), + (l('CMTimerBarGCMinBar').style.borderBottomRightRadius = '')), + (l('CMTimerBarGCBar').style.width = `${Math.round( + (Math.min( + Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.minTime, + Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time, + ) * + t) / + Game.shimmerTypes.golden.maxTime, + )}px`), + e.TimerBarOverlay >= 1 + ? (l('CMTimerBarGCBar').textContent = Math.ceil( + Math.min( + Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.minTime, + Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time, + ) / Game.fps, + )) + : (l('CMTimerBarGCBar').textContent = ''), + (l('CMTimerBarGCTime').textContent = Math.ceil( + (Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps, + )), + (n += 1)), + 'christmas' === Game.season && 0 === Game.shimmerTypes.reindeer.spawned + ? ((l('CMTimerBarRen').style.display = ''), + (l('CMTimerBarRenMinBar').style.width = `${Math.round( + (Math.max( + 0, + Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time, + ) * + t) / + Game.shimmerTypes.reindeer.maxTime, + )}px`), + e.TimerBarOverlay >= 1 + ? (l('CMTimerBarRenMinBar').textContent = Math.ceil( + (Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time) / + Game.fps, + )) + : (l('CMTimerBarRenMinBar').textContent = ''), + (l('CMTimerBarRenBar').style.width = `${Math.round( + (Math.min( + Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime, + Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time, + ) * + t) / + Game.shimmerTypes.reindeer.maxTime, + )}px`), + e.TimerBarOverlay >= 1 + ? (l('CMTimerBarRenBar').textContent = Math.ceil( + Math.min( + Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime, + Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time, + ) / Game.fps, + )) + : (l('CMTimerBarRenBar').textContent = ''), + (l('CMTimerBarRenTime').textContent = Math.ceil( + (Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / + Game.fps, + )), + (n += 1)) + : (l('CMTimerBarRen').style.display = 'none'); + const i = {}; + (l('CMTimerBarBuffTimers').innerHTML = ''), + Object.keys(Game.buffs).forEach((t) => { + if (Game.buffs[t]) { + const a = fo(Game.buffs[t].name, Game.buffs[t].name, [ + { id: `${Game.buffs[t].name}Bar` }, + ]); + a.style.display = ''; + let r = ''; + (r = void 0 !== Kt[Game.buffs[t].name] ? Kt[Game.buffs[t].name] : Lt), + (a.lastChild.children[1].className = Bt + r), + (a.lastChild.children[1].style.color = 'black'), + 2 === e.TimerBarOverlay + ? (a.lastChild.children[1].textContent = `${Math.round( + (Game.buffs[t].time / Game.buffs[t].maxTime) * 100, + )}%`) + : (a.lastChild.children[1].textContent = ''), + (a.lastChild.children[1].style.width = `${Math.round( + (Game.buffs[t].time * + (o - 8 * Math.ceil(Game.buffs[t].time / Game.fps).toString().length)) / + Game.buffs[t].maxTime, + )}px`), + (a.lastChild.children[2].textContent = Math.ceil( + Game.buffs[t].time / Game.fps, + )), + (n += 1), + (i[Game.buffs[t].name] = a); + } + }), + Object.keys(i).forEach((e) => { + l('CMTimerBarBuffTimers').appendChild(i[e]); + }), + 0 !== n && (l('CMTimerBar').style.height = 12 * n + 2 + 'px'), + io !== n && ((io = n), ko()); + } + })(), + yo(), + zo(), + (function () { + if (1 === e.TooltipWrink && 1 === Rt) { + let e = !1; + Object.keys(Game.wrinklers).forEach((t) => { + const o = Game.wrinklers[t]; + if (o.phase > 0 && o.selected) { + if (((e = !0), 0 === zt[t] || void 0 === zt[t])) { + const e = document.createElement('div'), + o = document.createElement('div'); + (o.style.minWidth = '120px'), (o.style.marginBottom = '4px'); + const n = document.createElement('div'); + (n.style.textAlign = 'center'), + (n.id = 'CMTooltipWrinkler'), + o.appendChild(n), + e.appendChild(o), + Game.tooltip.draw(this, escape(e.innerHTML)), + (It = t), + (zt[t] = 1); + } + } else zt[t] = 0; + }), + e || Game.tooltip.hide(); + } + })(), + (function () { + if (1 === e.TooltipWrink && null !== l('CMTooltipWrinkler')) { + let { sucked: e } = Game.wrinklers[It], + t = 1.1; + if ( + (Game.Has('Sacrilegious corruption') && (t *= 1.05), + 1 === Game.wrinklers[It].type && (t *= 3), + (e *= t), + Game.Has('Wrinklerspawn') && (e *= 1.05), + Ct.Temple.minigameLoaded) + ) { + const t = Game.hasGod('scorn'); + 1 === t ? (e *= 1.15) : 2 === t ? (e *= 1.1) : 3 === t && (e *= 1.05); + } + l('CMTooltipWrinkler').textContent = P(e); + } + })(), + e.UpStats && + 'stats' === Game.onMenu && + (Game.drawT - 1) % (5 * Game.fps) != 0 && + (Game.drawT - 1) % Game.fps == 0 && + Game.UpdateMenu(), + t(), + e.Scale) + ) { + let e = l('cookies').innerHTML.replace(/.*(?=
)/i, P(Game.cookies)); + Game.prefs.monospace && (e = `${e}`), + (l('cookies').innerHTML = e); + } + } + function _o() { + E.addLatest(Game.computedMouseCps); + } + class Qo { + constructor(e) { + (this.maxLength = e), (this.queue = []); + } + addLatest(e) { + this.queue.push(e) > this.maxLength && this.queue.shift(); + } + calcAverage(e) { + let t = e; + t > this.maxLength && (t = this.maxLength), + t > this.queue.length && (t = this.queue.length); + let o = 0; + for (let e = this.queue.length - 1; e >= 0 && e > this.queue.length - 1 - t; e--) + o += this.queue[e]; + return 0 === o ? 0 : o / t; + } + calcSum(e) { + let t = e; + return ( + t > this.maxLength && (t = this.maxLength), + t > this.queue.length && (t = this.queue.length), + 0 === t ? 0 : this.queue.slice(-t).reduce((e, t) => e + t, 0) + ); + } + } + function Xo() { + const t = Math.floor(Date.now() / 1e3); + if ((Game.T / Game.fps) % 1 == 0) { + let o = Game.cookies + gt; + Game.cpsSucked > 0 && (o += He), (lt = Math.max(Game.cookiesEarned, o)), (o *= 0.05); + const n = t - j, + i = Math.max(0, Game.cookies - D) / n, + a = Math.max(0, He - H) / n, + r = Math.max(0, $e[0] - U) / n, + l = Math.max(0, o - Le) / n, + s = (Game.cookieClicks - $) / n; + for (let e = 0; e < n; e++) + N.addLatest(i), O.addLatest(a), F.addLatest(r), L.addLatest(l), W.addLatest(s); + (j = t), (D = Game.cookies), (H = He), (U = $e[0]), (Le = o), ($ = Game.cookieClicks); + const c = qt[e.AvgCPSHist]; + (R = N.calcAverage(c)), + (I = O.calcAverage(c)), + (z = F.calcAverage(c)), + (V = L.calcAverage(c)), + (_ = R), + 1 === e.CalcWrink && (_ += I), + 2 === e.CalcWrink && (_ += z); + const d = Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg'); + (st = d || 0 === e.CalcWrink ? R + I + (d ? V : 0) : _), + (Ve = W.calcAverage(Yt[e.AvgClicksHist])); + } + } + function qo(t, o) { + Object.keys(t).forEach((n) => { + if (e.PPRigidelMode && 1 === o) t[n].color = Wt; + else { + t[n].color = Eo(t[n], Game.Objects[n].getSumPrice(o)); + for (let o = 0; o < e.PPExcludeTop; o++) t[n].pp === mt[o][0] && (t[n].color = Wt); + } + }); + } + function Yo(t, o) { + Object.keys(t).forEach((n) => { + const i = Game.Objects[n].getSumPrice(o); + Game.cookiesPs + ? (t[n].pp = Math.max(i - (Game.cookies + go()), 0) / Game.cookiesPs + i / t[n].bonus) + : (t[n].pp = i / t[n].bonus), + (e.PPRigidelMode && 1 === o) || mt.push([t[n].pp, o]); + }); + } + function Ko() { + !(function () { + (ut = 1 / 0), + (mt = []), + void 0 === e.PPExcludeTop && (e.PPExcludeTop = 0), + Yo(We, 1), + Yo(Ae, 10), + Yo(je, 100), + mt.sort((e, t) => e[0] - t[0]); + let t = 0; + if (e.PPOnlyConsiderBuyable) + for (; mt[t][1] > Game.cookies && ((t += 1), mt.length !== t + 1); ); + (ut = mt[e.PPExcludeTop][t]), qo(We, 1), qo(Ae, 10), qo(je, 100); + })(), + Object.keys(ze).forEach((e) => { + Game.cookiesPs + ? (ze[e].pp = + Math.max(Game.Upgrades[e].getPrice() - (Game.cookies + go()), 0) / + Game.cookiesPs + + Game.Upgrades[e].getPrice() / ze[e].bonus) + : (ze[e].pp = Game.Upgrades[e].getPrice() / ze[e].bonus), + Number.isNaN(ze[e].pp) && (ze[e].pp = 1 / 0), + (ze[e].color = Eo(ze[e], Game.Upgrades[e].getPrice())); + }); + } + function Jo(e, t, o, n, i) { + let a = o, + r = 0; + for (let o = 0; o < i; o += 1) { + let o = t * Game.priceIncrease ** Math.max(0, a - n); + (o = Game.modifyBuildingPrice(e, o)), (o = Math.ceil(o)), (r += o), (a += 1); + } + return r; + } + function Zo(e) { + const t = {}; + return ( + Object.keys(Game.Objects).forEach((o) => { + (t[o] = {}), (t[o].bonus = $o(o, e)), 1 !== e && (q = 1); + }), + t + ); + } + function en() { + Object.keys(Game.Objects).forEach((e) => { + (We[e].price = Jo( + Game.Objects[e], + Game.Objects[e].basePrice, + Game.Objects[e].amount, + Game.Objects[e].free, + 1, + )), + (Ae[e].price = Jo( + Game.Objects[e], + Game.Objects[e].basePrice, + Game.Objects[e].amount, + Game.Objects[e].free, + 10, + )), + (je[e].price = Jo( + Game.Objects[e], + Game.Objects[e].basePrice, + Game.Objects[e].amount, + Game.Objects[e].free, + 100, + )), + (De[e].price = Jo( + Game.Objects[e], + Game.Objects[e].basePrice, + Game.Objects[e].amount, + Game.Objects[e].free, + De[e].AmountNeeded, + )); + }); + } + function tn() { + (We = Zo(1)), + (Ae = Zo(10)), + (je = Zo(100)), + (ze = []), + Object.keys(Game.Upgrades).forEach((t) => { + const o = (function (e) { + if ( + 'toggle' === Game.Upgrades[e].pool || + (0 === Game.Upgrades[e].bought && + Game.Upgrades[e].unlocked && + 'prestige' !== Game.Upgrades[e].pool) + ) { + So(), + 'Shimmering veil [on]' === yt[e].name + ? (yt['Shimmering veil [off]'].bought = 0) + : 'Golden switch [on]' === yt[e].name + ? (yt['Golden switch [off]'].bought = 0) + : (yt[e].bought = (yt[e].bought + 1) % 2), + Game.CountsAsUpgradeOwned(Game.Upgrades[e].pool) && (J += 1), + 'Elder Pledge' === e + ? ((Z += 1), Z > 0 && Oo('Elder nap'), Z >= 5 && Oo('Elder slumber')) + : 'Elder Covenant' === e + ? Oo('Elder calm') + : 'Prism heart biscuits' === e + ? Oo('Lovely cookies') + : 'Heavenly key' === e && Oo('Wholesome'); + const t = ee; + Fo(), Uo(), t !== ee && Fo(); + const o = + (function () { + let e = 0; + wt('Thousand fingers') && (e += 0.1), + wt('Million fingers') && (e *= 5), + wt('Billion fingers') && (e *= 10), + wt('Trillion fingers') && (e *= 20), + wt('Quadrillion fingers') && (e *= 20), + wt('Quintillion fingers') && (e *= 20), + wt('Sextillion fingers') && (e *= 20), + wt('Septillion fingers') && (e *= 20), + wt('Octillion fingers') && (e *= 20), + wt('Nonillion fingers') && (e *= 20); + let t = 0; + Object.keys(Ct).forEach((e) => { + t += Ct[e].amount; + }), + (t -= Ct.Cursor.amount), + (e *= t), + wt('Plastic mouse') && (e += 0.01 * de), + wt('Iron mouse') && (e += 0.01 * de), + wt('Titanium mouse') && (e += 0.01 * de), + wt('Adamantium mouse') && (e += 0.01 * de), + wt('Unobtainium mouse') && (e += 0.01 * de), + wt('Eludium mouse') && (e += 0.01 * de), + wt('Wishalloy mouse') && (e += 0.01 * de), + wt('Fantasteel mouse') && (e += 0.01 * de), + wt('Nevercrack mouse') && (e += 0.01 * de), + wt('Armythril mouse') && (e += 0.01 * de), + wt('Technobsidian mouse') && (e += 0.01 * de), + wt('Plasmarble mouse') && (e += 0.01 * de), + wt('Miraculite mouse') && (e += 0.01 * de), + wt('Fortune #104') && (e += 0.01 * de); + let o = 1; + if ( + (wt("Santa's helpers") && (o *= 1.1), + wt('Cookie egg') && (o *= 1.1), + wt('Halo gloves') && (o *= 1.1), + wt('Dragon claw') && (o *= 1.03), + wt('Aura gloves') && + (o *= + 1 + + 0.05 * + Math.min(Game.Objects.Cursor.level, wt('Luminous gloves') ? 20 : 10)), + (o *= vt('click')), + Ct.Temple.minigameLoaded && xt) + ) { + const e = xt('labor'); + 1 === e ? (o *= 1.15) : 2 === e ? (o *= 1.1) : 3 === e && (o *= 1.05); + } + Object.keys(Game.buffs).forEach((e) => { + void 0 !== Game.buffs[e].multClick && (o *= Game.buffs[e].multClick); + }), + (o *= 1 + 0.05 * kt('Dragon Cursor')); + let n = + o * + Game.ComputeCps( + 1, + wt('Reinforced index finger') + + wt('Carpal tunnel prevention cream') + + wt('Ambidextrous'), + e, + ); + return ( + (n = Game.runModHookOnValue('cookiesPerClick', n)), + Game.hasBuff('Cursed finger') && (n = Game.buffs['Cursed finger'].power), + n + ); + })() - Game.computedMouseCps; + return o ? [de - Game.cookiesPs, o] : [de - Game.cookiesPs]; + } + return []; + })(t); + 'Elder Pledge' === t + ? ((ze[t] = { bonus: Game.cookiesPs - R }), + 1 === e.CalcWrink ? (ze[t].bonus -= I) : 2 === e.CalcWrink && (ze[t].bonus -= z), + Number.isFinite(ze[t].bonus) || (ze[t].bonus = 0)) + : ((ze[t] = {}), o[0] && (ze[t].bonus = o[0]), o[1] && (ze[t].bonusMouse = o[1])); + }); + } + function on(e, t, o) { + let n = 0, + i = 0, + a = 0, + r = 0, + l = 1 + Math.max(0, Math.ceil(Math.log(Game.cookies) / Math.LN10) - 10); + for (; a < t * o; ) + (i = Math.max(e, Math.min(Math.floor((1 / 9) * 10 ** l * e * o), t * o))), + (a = Math.max(e, Math.min(Math.floor((1 / 9) * 10 ** (l + 1) * e * o), t * o))), + (r = Math.floor((1 / 9) * 10 ** (l + 1) * e * o)), + (n += i), + (l += 1); + return [n, i, r]; + } + function nn() { + let e = 60 * Se * 60 * 6 * Be; + const t = No(); + t > 0 ? (e /= t) : (e = 0), + (Ke = on(7, e, Pe)), + (qe = (2 * Ke[1]) / Pe), + (Ye = Ke[2] / 60 / 60 / 6 / Be), + (et = on(6, e, Ee)), + (Je = (2 * et[1]) / Ee), + (Ze = et[2] / 60 / 60 / 6 / Be), + (nt = on(7, 7 * e, Pe)), + (tt = (2 * nt[1]) / Pe), + (ot = nt[2] / 60 / 60 / 6 / Be), + (rt = on(6, 7 * e, Ee)), + (it = (2 * rt[1]) / Ee), + (at = rt[2] / 60 / 60 / 6 / Be); + } + function an() { + const e = Math.floor(Date.now() / 1e3); + if ((Game.T / Game.fps) % 1 == 0) { + const t = Game.HowMuchPrestige(Game.cookiesReset), + o = + Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) - + Math.floor(t), + n = e - Q, + i = Math.max(0, o - X) / n; + for (let e = 0; e < n; e++) A.addLatest(i); + (Q = e), (X = o), (Ne = A.calcAverage(5)); + } + } + function rn() { + (_e = ''), (Xe = ''), (Qe = ''); + const e = []; + Object.keys(Game.Upgrades).forEach((t) => { + e.push(Game.Upgrades[t]); + }), + e.sort(function (e, t) { + return e.order > t.order ? 1 : e.order < t.order ? -1 : 0; + }), + Object.keys(e).forEach((t) => { + const o = e[t]; + if (0 === o.bought) { + let e = ''; + (e += (function (e) { + let t = 'crate upgrade missing'; + 'prestige' === e.pool && (t += ' heavenly'); + let o = 0; + Game.prefs.crates || (o = 1), o && (t += ' noFrame'); + let { icon: n } = e; + e.iconFunction && (n = e.iconFunction()); + const i = `function() {return Game.crateTooltip(Game.UpgradesById[${e.id}], 'stats');}`; + return `
\n\t
`; + })(o)), + 'prestige' === o.pool + ? (Qe += e) + : 'cookie' === o.pool + ? (Xe += e) + : 'toggle' !== o.pool && 'unused' !== o.pool && 'debug' !== o.pool && (_e += e); + } + }); + } + function ln() { + if ('christmas' === Game.season) { + let e = 60 * Game.cookiesPs; + Game.hasBuff('Elder frenzy') && (e *= 0.5), + Game.hasBuff('Frenzy') && (e *= 0.75), + (Fe = Math.max(25, e)), + Game.Has('Ho ho ho-flavored frosting') && (Fe *= 2); + } + } + function sn() { + (Ce = (900 * Se) / 0.15), (Ce *= Be); + const e = No(); + e > 0 ? (Ce /= e) : (Ce = 0), + (ye = Pe * (0.15 * Ce) + 13), + (be = Ee * (0.15 * Ce) + 13), + (ke = 7 * Ce), + (Ge = Pe * (0.15 * ke) + 13), + (ve = Ee * (0.15 * ke) + 13), + (we = 2 * Ce), + (xe = 0.15 * we), + (Te = 0); + let t = 0, + o = 0; + Object.keys(Game.Objects).forEach((e) => { + Game.Objects[e].amount > t && (t = Game.Objects[e].amount), + Game.Objects[e].amount > 0 && (o += 1); + }), + Object.keys(Game.Objects).forEach((e) => { + (Game.Objects[e].amount < t || 1 === o) && + Game.Objects[e].amount < 400 && + 2 * Game.Objects[e].price > Te && + ((Te = 2 * Game.Objects[e].price), (Me = e)); + }); + } + function cn() { + let e = 1, + t = 1, + o = 1; + wt('Green yeast digestives') && (o *= 1.01), + wt('Dragon fang') && (o *= 1.03), + (e *= 1 + 0.1 * Game.auraMult('Ancestral Metamorphosis')), + (e *= Game.eff('goldenCookieGain')), + (t *= 1 + 0.1 * Game.auraMult('Unholy Dominion')), + (t *= Game.eff('wrathCookieGain')), + (Pe = o * e), + (Ee = o * t), + (Be = 1), + 0 === Game.shimmerTypes.golden.n && (Be *= 1 + 1.23 * Game.auraMult("Dragon's Fortune")); + } + function dn() { + const e = {}; + Object.keys(Game.Objects).forEach((t) => { + if (0 !== Object.keys(De).length && De[t].TotalNeeded > Game.Objects[t].amount) + e[t] = { + AmountNeeded: De[t].TotalNeeded - Game.Objects[t].amount, + TotalNeeded: De[t].TotalNeeded, + }; + else { + const o = (function (e) { + const t = Game.AchievementsOwned; + for (let o = 0; o < 101; o++) if (($o(e, o), ee > t)) return o; + return 101; + })(t); + e[t] = { AmountNeeded: o, TotalNeeded: Game.Objects[t].amount + o }; + } + }), + (De = e); + } + function pn() { + (He = 0), (Ue = 0), ($e = [0, null]); + for (let e = 0; e < Game.wrinklers.length; e++) { + let { sucked: t } = Game.wrinklers[e], + o = 1.1; + if ( + (Game.Has('Sacrilegious corruption') && (o *= 1.05), + 1 === Game.wrinklers[e].type && (o *= 3), + (t *= o), + Game.Has('Wrinklerspawn') && (t *= 1.05), + Ct.Temple.minigameLoaded) + ) { + const e = Game.hasGod('scorn'); + 1 === e ? (t *= 1.15) : 2 === e ? (t *= 1.1) : 3 === e && (t *= 1.05); + } + (He += t), 0 === Game.wrinklers[e].type && ((Ue += t), t > $e[0] && ($e = [t, e])); + } + } + function un() { + vo(), + pn(), + sn(), + cn(), + nn(), + rn(), + ln(), + (N = new Qo(qt[qt.length - 1])), + (O = new Qo(qt[qt.length - 1])), + (F = new Qo(qt[qt.length - 1])), + (L = new Qo(qt[qt.length - 1])), + (W = new Qo(Yt[Yt.length - 1])), + (A = new Qo(5)), + (E = new Qo(20 * Yt[Yt.length - 1])), + an(), + dn(), + Xo(), + tn(), + en(), + Ko(); + } + const mn = { + CPSMode: 1, + AvgCPSHist: 3, + AvgClicksHist: 0, + CalcWrink: 0, + Scale: 2, + ScaleDecimals: 2, + ScaleSeparator: 0, + ScaleCutoff: 999999, + TimeFormat: 0, + DetailedTime: 1, + PPDisplayTime: 0, + BuildColour: 1, + PPOnlyConsiderBuyable: 0, + PPExcludeTop: 0, + PPRigidelMode: 0, + PPSecondsLowerLimit: 0, + ColourBlue: '#4bb8f0', + ColourGreen: '#00ff00', + ColourYellow: '#ffff00', + ColourOrange: '#ff7f00', + ColourRed: '#ff0000', + ColourPurple: '#ff00ff', + ColourGray: '#b3b3b3', + ColourPink: '#ff1493', + ColourBrown: '#8b4513', + BotBar: 1, + TimerBar: 1, + TimerBarPos: 0, + TimerBarOverlay: 2, + UpBarColour: 1, + UpgradeBarFixedPos: 1, + SortBuildings: 0, + SortUpgrades: 0, + UpgradesNeverCollapse: 0, + DragonAuraInfo: 1, + GrimoireBar: 1, + GCTimer: 1, + Favicon: 1, + WrinklerButtons: 1, + HideSectionsButtons: 0, + TooltipBuildUpgrade: 1, + TooltipAmor: 0, + ToolWarnLucky: 1, + ToolWarnLuckyFrenzy: 1, + ToolWarnConjure: 1, + ToolWarnConjureFrenzy: 1, + ToolWarnEdifice: 1, + ToolWarnUser: 0, + ToolWarnBon: 1, + ToolWarnPos: 1, + TooltipGrim: 1, + TooltipWrink: 1, + TooltipLump: 1, + TooltipPlots: 1, + TooltipPantheon: 1, + TooltipAscendButton: 1, + Stats: 1, + MissingUpgrades: 1, + MissingAchievements: 0, + UpStats: 1, + HeavenlyChipsTarget: 1, + ShowMissedGC: 1, + Title: 1, + GeneralSound: 1, + GCNotification: 0, + GCFlash: 1, + ColourGCFlash: '#ffffff', + GCSound: 1, + GCVolume: 100, + GCSoundURL: 'https://freesound.org/data/previews/66/66717_931655-lq.mp3', + FortuneNotification: 0, + FortuneFlash: 1, + ColourFortuneFlash: '#ffffff', + FortuneSound: 1, + FortuneVolume: 100, + FortuneSoundURL: 'https://freesound.org/data/previews/174/174027_3242494-lq.mp3', + SeaNotification: 0, + SeaFlash: 1, + ColourSeaFlash: '#ffffff', + SeaSound: 1, + SeaVolume: 100, + SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', + GardFlash: 1, + ColourGardFlash: '#ffffff', + GardSound: 1, + GardVolume: 100, + GardSoundURL: 'https://freesound.org/data/previews/103/103046_861714-lq.mp3', + MagicNotification: 0, + MagicFlash: 1, + ColourMagicFlash: '#ffffff', + MagicSound: 1, + MagicVolume: 100, + MagicSoundURL: 'https://freesound.org/data/previews/221/221683_1015240-lq.mp3', + WrinklerNotification: 0, + WrinklerFlash: 1, + ColourWrinklerFlash: '#ffffff', + WrinklerSound: 1, + WrinklerVolume: 100, + WrinklerSoundURL: 'https://freesound.org/data/previews/124/124186_8043-lq.mp3', + WrinklerMaxNotification: 0, + WrinklerMaxFlash: 1, + ColourWrinklerMaxFlash: '#ffffff', + WrinklerMaxSound: 1, + WrinklerMaxVolume: 100, + WrinklerMaxSoundURL: 'https://freesound.org/data/previews/152/152743_15663-lq.mp3', + BulkBuyBlock: 0, + FavouriteSettings: 1, + Header: { + Favourite: 1, + Calculation: 1, + Notation: 1, + Colours: 1, + BarsDisplay: 1, + Tooltip: 1, + Statistics: 1, + Notification: 1, + NotificationGeneral: 1, + NotificationGC: 1, + NotificationFC: 1, + NotificationSea: 1, + NotificationGard: 1, + NotificationMagi: 1, + NotificationWrink: 1, + NotificationWrinkMax: 1, + Miscellaneous: 1, + Lucky: 1, + Chain: 1, + Spells: 1, + Garden: 1, + Prestige: 1, + Wrink: 1, + Sea: 1, + Misc: 1, + InfoTab: 1, + }, + }, + hn = function (e) { + if (1 === e) { + const e = function () { + try { + Notification.requestPermission().then(); + } catch (e) { + return !1; + } + return !0; + }; + 'Notification' in window + ? e() + ? Notification.requestPermission().then() + : Notification.requestPermission() + : console.log('This browser does not support notifications.'); + } + }; + function gn() { + 1 === e.BotBar + ? ((l('CMBotBar').style.display = ''), yo()) + : (l('CMBotBar').style.display = 'none'), + ko(); + } + function fn() { + BeautifyAll(), Game.RefreshStore(), Game.RebuildUpgrades(), yo(), so(), po(); + } + function Cn() { + 1 === e.Favicon && y > 0 + ? ct.wrath + ? (l('CMFavicon').href = + 'https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico') + : (l('CMFavicon').href = + 'https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico') + : (l('CMFavicon').href = 'https://orteil.dashnet.org/cookieclicker/favicon.ico'); + } + class yn { + constructor(e, t) { + (this.type = e), (this.group = t); + } + } + class bn extends yn { + constructor(e, t, o) { + super(e, t), (this.desc = o); + } + } + class kn extends yn { + constructor(e, t, o, n, i, a) { + super(e, t), (this.label = o), (this.desc = n), (this.min = i), (this.max = a); + } + } + class Gn extends yn { + constructor(e, t, o, n, i, a) { + super(e, t), + (this.label = o), + (this.desc = n), + (this.toggle = i), + void 0 !== a && (this.func = a); + } + } + class vn extends yn { + constructor(e, t, o, n) { + super(e, t), (this.label = o), (this.desc = n); + for (let e = 0; e < 101; e++) this.label[e] = `${e}%`; + } + } + const wn = { + CPSMode: new Gn( + 'bool', + 'Calculation', + ['Current cookies per second', 'Average cookies per second'], + 'Calculate times using current cookies per second or average cookies per second', + !1, + ), + AvgCPSHist: new Gn( + 'bool', + 'Calculation', + [ + 'Average CPS in past 10s', + 'Average CPS in past 15s', + 'Average CPS in past 30s', + 'Average CPS in past 1m', + 'Average CPS in past 5m', + 'Average CPS in past 10m', + 'Average CPS in past 15m', + 'Average CPS in past 30m', + ], + 'How much time average Cookies Per Second should consider', + !1, + ), + AvgClicksHist: new Gn( + 'bool', + 'Calculation', + [ + 'Average clicks in past 1s', + 'Average clicks in past 5s', + 'Average clicks in past 10s', + 'Average clicks in past 15s', + 'Average clicks in past 30s', + ], + 'How much time average Cookie Clicks should consider', + !1, + ), + CalcWrink: new Gn( + 'bool', + 'Calculation', + [ + 'Calculate with wrinklers OFF', + 'Calculate with wrinklers ON', + 'Calculate with single fattest wrinkler ON', + ], + 'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) wrinklers', + !0, + () => { + se = !0; + }, + ), + Scale: new Gn( + 'bool', + 'Notation', + [ + "Game's setting scale", + 'Metric', + 'Short scale', + 'Short scale (Abbreviated)', + 'Scientific notation', + 'Engineering notation', + ], + 'Change how long numbers are formatted', + !1, + () => { + fn(); + }, + ), + ScaleDecimals: new Gn( + 'bool', + 'Notation', + ['1 decimals', '2 decimals', '3 decimals'], + 'Set the number of decimals used when applicable. This only works with Cookie Monster scales and not with "Game\'s Setting Scale"', + !1, + () => { + fn(); + }, + ), + ScaleSeparator: new Gn( + 'bool', + 'Notation', + ['. for decimals (standard)', '. for thousands'], + 'Set the separator used for decimals and thousands', + !1, + () => { + fn(); + }, + ), + ScaleCutoff: new kn( + 'numscale', + 'Notation', + 'Notation cut-off point: ', + 'The number from which Cookie Monster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations', + 1, + 999999999, + ), + TimeFormat: new Gn( + 'bool', + 'Notation', + ['Time XXd, XXh, XXm, XXs', 'Time XX:XX:XX:XX:XX'], + 'Change the time format', + !1, + ), + DetailedTime: new Gn( + 'bool', + 'Notation', + ['Detailed time OFF', 'Detailed time ON'], + 'Change how time is displayed in certain statistics and tooltips', + !0, + () => { + 1 === e.DetailedTime ? (Game.sayTime = Vt) : (Game.sayTime = M.sayTime); + }, + ), + PPDisplayTime: new Gn( + 'bool', + 'Notation', + ['PP as value (standard)', 'PP as time unit'], + 'Display PP as calculated value or as approximate time unit. Note that PP does not translate directly into a time unit and this is therefore only an approximation.', + !1, + ), + BuildColour: new Gn( + 'bool', + 'Colours', + ['Building colours OFF', 'Building colours ON'], + 'Colour code buildings', + !0, + () => { + so(); + }, + ), + PPOnlyConsiderBuyable: new Gn( + 'bool', + 'Colours', + ["Don't ignore non-buyable", 'Ignore non-buyable'], + "Makes Cookie Monster label buildings and upgrades you can't buy right now red, useful in those situations where you just want to spend your full bank 'most optimally'", + !0, + ), + PPExcludeTop: new Gn( + 'bool', + 'Colours', + [ + "Don't ignore any", + 'Ignore 1st best', + 'Ignore 1st and 2nd best', + 'Ignore 1st, 2nd and 3rd best', + ], + 'Makes Cookie Monster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values', + !0, + ), + PPRigidelMode: new Gn( + 'bool', + 'Colours', + ['Rigidel mode OFF', 'Rigidel mode ON'], + 'Makes Cookie Monster ignore all "buy 1" options when colouring PP in order to stay at a total building count ending in 10 for pantheon god Rigidel', + !0, + ), + PPSecondsLowerLimit: new kn( + 'numscale', + 'Colours', + 'Lower limit for PP (in seconds): ', + 'If a building or upgrade costs less than the specified seconds of CPS it will also be considered optimal and label it as such ("PP is less than xx seconds of CPS"); setting to 0 ignores this option', + 0, + 1 / 0, + ), + ColourBlue: new bn( + 'colour', + 'Colours', + 'Standard colour is blue. Used to show upgrades better than best PP building, for Click Frenzy bar, and for various labels', + ), + ColourGreen: new bn( + 'colour', + 'Colours', + 'Standard colour is green. Used to show best PP building, for Blood Frenzy bar, and for various labels', + ), + ColourYellow: new bn( + 'colour', + 'Colours', + 'Standard colour is yellow. Used to show buildings within the top 10 of PP, for Frenzy bar, and for various labels', + ), + ColourOrange: new bn( + 'colour', + 'Colours', + 'Standard colour is orange. Used to show buildings within the top 20 of PP, for Next Reindeer bar, and for various labels', + ), + ColourRed: new bn( + 'colour', + 'Colours', + 'Standard colour is Red. Used to show buildings within the top 30 of PP, for Clot bar, and for various labels', + ), + ColourPurple: new bn( + 'colour', + 'Colours', + 'Standard colour is purple. Used to show buildings outside of the top 30 of PP, for Next Cookie bar, and for various labels', + ), + ColourGray: new bn( + 'colour', + 'Colours', + 'Standard colour is gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar', + ), + ColourPink: new bn( + 'colour', + 'Colours', + 'Standard colour is pink. Used for Dragonflight bar', + ), + ColourBrown: new bn( + 'colour', + 'Colours', + 'Standard colour is brown. Used for Dragon Harvest bar', + ), + BotBar: new Gn( + 'bool', + 'BarsDisplay', + ['Bottom bar OFF', 'Bottom bar ON'], + 'Building information', + !0, + () => { + gn(); + }, + ), + TimerBar: new Gn( + 'bool', + 'BarsDisplay', + ['Timer bar OFF', 'Timer bar ON'], + 'Bar with timers for golden cookie, season popup, Frenzy (Normal, Clot, Elder), Click Frenzy', + !0, + () => { + Go(); + }, + ), + TimerBarPos: new Gn( + 'bool', + 'BarsDisplay', + ['Timer bar position (top left)', 'Timer bar position (bottom)'], + 'Placement of the timer bar', + !1, + () => { + 0 === e.TimerBarPos + ? ((l('CMTimerBar').style.width = '30%'), + (l('CMTimerBar').style.bottom = ''), + l('game').insertBefore(l('CMTimerBar'), l('sectionLeft'))) + : ((l('CMTimerBar').style.width = '100%'), + (l('CMTimerBar').style.bottom = '0px'), + l('wrapper').appendChild(l('CMTimerBar'))), + ko(); + }, + ), + TimerBarOverlay: new Gn( + 'bool', + 'BarsDisplay', + ['Timer bar overlay OFF', 'Timer bar overlay only seconds', 'Timer bar overlay full'], + 'Overlay on timers displaying seconds and/or percentage left', + !0, + ), + UpBarColour: new Gn( + 'bool', + 'BarsDisplay', + [ + 'Upgrade colours/bar OFF', + 'Upgrade colours with bar ON', + 'Upgrade colours without bar ON', + ], + 'Colour code upgrades and optionally add a counter bar', + !1, + () => { + 1 === e.UpBarColor + ? ((l('CMUpgradeBar').style.display = ''), po()) + : 2 === e.UpBarColor + ? ((l('CMUpgradeBar').style.display = 'none'), po()) + : ((l('CMUpgradeBar').style.display = 'none'), Game.RebuildUpgrades()); + }, + ), + UpgradeBarFixedPos: new Gn( + 'bool', + 'BarsDisplay', + ['Upgrade bar fixed position OFF', 'Upgrade bar fixed position ON'], + 'Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling', + !0, + () => { + 1 === e.UpgradeBarFixedPos + ? ((l('CMUpgradeBar').style.position = 'sticky'), + (l('CMUpgradeBar').style.top = '0px')) + : (l('CMUpgradeBar').style.position = ''); + }, + ), + SortBuildings: new Gn( + 'bool', + 'BarsDisplay', + [ + 'Sort buildings: default', + 'Sort buildings: PP of x1 purchase', + 'Sort buildings: PP of selected bulk mode', + ], + 'Sort the display of buildings in either default order or by PP', + !1, + () => { + so(); + }, + ), + SortUpgrades: new Gn( + 'bool', + 'BarsDisplay', + ['Sort upgrades: default', 'Sort upgrades: PP'], + 'Sort the display of upgrades in either default order or by PP', + !1, + () => { + po(); + }, + ), + UpgradesNeverCollapse: new Gn( + 'bool', + 'BarsDisplay', + ['Upgrades always expanded OFF', 'Upgrades always expanded ON'], + 'Toggle to make the upgrades sections always expanded to the size needed to display all upgrades', + !0, + () => { + co(); + }, + ), + DragonAuraInfo: new Gn( + 'bool', + 'BarsDisplay', + ['Extra dragon aura info OFF', 'Extra dragon aura info ON'], + 'Shows information about changes in CPS and costs in the dragon aura interface.', + !0, + ), + GrimoireBar: new Gn( + 'bool', + 'BarsDisplay', + ['Grimoire magic meter timer OFF', 'Grimoire magic meter timer ON'], + 'A timer on how long before the Grimoire magic meter is full', + !0, + ), + GCTimer: new Gn( + 'bool', + 'BarsDisplay', + ['Golden cookie timer OFF', 'Golden cookie timer ON'], + 'A timer on the golden cookie when it has been spawned', + !0, + () => { + 1 === e.GCTimer + ? Object.keys(ao).forEach((e) => { + (ao[e].style.display = 'block'), + (ao[e].style.left = ht[e].l.style.left), + (ao[e].style.top = ht[e].l.style.top); + }) + : Object.keys(ao).forEach((e) => (ao[e].style.display = 'none')); + }, + ), + Favicon: new Gn( + 'bool', + 'BarsDisplay', + ['Favicon OFF', 'Favicon ON'], + 'Update favicon with golden/wrath cookie', + !0, + () => { + Cn(); + }, + ), + WrinklerButtons: new Gn( + 'bool', + 'BarsDisplay', + ['Extra wrinkler buttons OFF', 'Extra wrinkler buttons ON'], + 'Show buttons for popping wrinklers at bottom of cookie section', + !0, + () => { + t(); + }, + ), + HideSectionsButtons: new Gn( + 'bool', + 'BarsDisplay', + ['Hide buildings/upgrades button OFF', 'Hide buildings/upgrades button ON'], + 'Show buttons for hiding and showing the buildings and upgrades sections in the right column', + !0, + () => { + e.HideSectionsButtons + ? (l('CMSectionHidButtons').style.display = '') + : (l('CMSectionHidButtons').style.display = 'none'); + }, + ), + TooltipBuildUpgrade: new Gn( + 'bool', + 'Tooltip', + ['Building/upgrade tooltip information OFF', 'Building/upgrade tooltip information ON'], + 'Extra information in building/upgrade tooltips', + !0, + ), + TooltipAmor: new Gn( + 'bool', + 'Tooltip', + [ + 'Buildings tooltip amortization information OFF', + 'Buildings tooltip amortization information ON', + ], + 'Add amortization information to buildings tooltip', + !0, + ), + ToolWarnLucky: new Gn( + 'bool', + 'Tooltip', + ['Tooltip lucky warning OFF', 'Tooltip lucky warning ON'], + 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards', + !0, + ), + ToolWarnLuckyFrenzy: new Gn( + 'bool', + 'Tooltip', + ['Tooltip lucky frenzy warning OFF', 'Tooltip lucky frenzy warning ON'], + 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards', + !0, + ), + ToolWarnConjure: new Gn( + 'bool', + 'Tooltip', + ['Tooltip conjure warning OFF', 'Tooltip conjure warning ON'], + 'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards', + !0, + ), + ToolWarnConjureFrenzy: new Gn( + 'bool', + 'Tooltip', + ['Tooltip conjure frenzy warning OFF', 'Tooltip conjure frenzy warning ON'], + 'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards with Frenzy active', + !0, + ), + ToolWarnEdifice: new Gn( + 'bool', + 'Tooltip', + ['Tooltip edifice warning OFF', 'Tooltip edifice warning ON'], + 'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building', + !0, + ), + ToolWarnUser: new kn( + 'numscale', + 'Tooltip', + 'Tooltip warning at x times CPS: ', + 'Use this to show a customized warning if buying it will put the bank under the amount equal to value times cps; setting to 0 disables the function altogether', + 0, + 1 / 0, + ), + ToolWarnBon: new Gn( + 'bool', + 'Tooltip', + [ + 'Calculate tooltip warning with bonus CPS OFF', + 'Calculate tooltip warning with bonus CPS ON', + ], + 'Calculate the warning with or without the bonus CPS you get from buying', + !0, + ), + ToolWarnPos: new Gn( + 'bool', + 'Tooltip', + ['Tooltip warning position (left)', 'Tooltip warning position (bottom)'], + 'Placement of the warning boxes', + !1, + () => { + Io(); + }, + ), + TooltipGrim: new Gn( + 'bool', + 'Tooltip', + ['Grimoire tooltip information OFF', 'Grimoire tooltip information ON'], + 'Extra information in tooltip for grimoire', + !0, + ), + TooltipWrink: new Gn( + 'bool', + 'Tooltip', + ['Wrinkler tooltip OFF', 'Wrinkler tooltip ON'], + 'Shows the amount of cookies a wrinkler will give when popping it', + !0, + ), + TooltipLump: new Gn( + 'bool', + 'Tooltip', + ['Sugar lump tooltip OFF', 'Sugar lump tooltip ON'], + 'Shows the current Sugar Lump type in Sugar lump tooltip.', + !0, + ), + TooltipPlots: new Gn( + 'bool', + 'Tooltip', + ['Garden plots tooltip OFF', 'Garden plots tooltip ON'], + 'Shows a tooltip for plants that have a cookie reward.', + !0, + ), + TooltipPantheon: new Gn( + 'bool', + 'Tooltip', + ['Pantheon tooltip OFF', 'Pantheon tooltip ON'], + 'Shows additional info in the pantheon tooltip', + !0, + ), + TooltipAscendButton: new Gn( + 'bool', + 'Tooltip', + ['Show Extra Info Ascend Tooltip OFF', 'Show Extra Info Ascend Tooltip ON'], + 'Shows additional info in the ascend tooltip', + !0, + ), + Stats: new Gn( + 'bool', + 'Statistics', + ['Statistics OFF', 'Statistics ON'], + 'Extra Cookie Monster statistics!', + !0, + ), + MissingUpgrades: new Gn( + 'bool', + 'Statistics', + ['Missing upgrades OFF', 'Missing upgrades ON'], + 'Shows missing upgrades in statistics menu', + !0, + ), + MissingAchievements: new Gn( + 'bool', + 'Statistics', + ['Missing Achievements OFF', 'Missing Normal Achievements ON'], + 'Shows missing normal achievements in statistics menu.', + !0, + ), + UpStats: new Gn( + 'bool', + 'Statistics', + ['Statistics update rate (default)', 'Statistics update rate (1s)'], + 'Default rate is once every 5 seconds', + !1, + ), + HeavenlyChipsTarget: new kn( + 'numscale', + 'Statistics', + 'Heavenly chips target: ', + 'Use this to set a heavenly chips target that will be counted towards in the "prestige" statsistics sections', + 1, + 1 / 0, + ), + ShowMissedGC: new Gn( + 'bool', + 'Statistics', + ['Missed GC OFF', 'Missed GC ON'], + 'Show a stat in the statistics screen that counts how many golden cookies you have missed', + !0, + ), + Title: new Gn( + 'bool', + 'NotificationGeneral', + ['Title OFF', 'Title ON', 'Title pinned tab highlight'], + 'Update title with colden cookie/season popup timers; pinned tab highlight only changes the title when a golden cookie/season popup spawns; "!" means that golden cookie/reindeer can spawn', + !0, + ), + GeneralSound: new Gn( + 'bool', + 'NotificationGeneral', + ['Consider game volume setting OFF', 'Consider game volume setting ON'], + 'Turning this toggle to "off" makes Cookie Monster no longer consider the volume setting of the base game, allowing mod notifications to play with base game volume turned down', + !0, + ), + GCNotification: new Gn( + 'bool', + 'NotificationGC', + ['Notification OFF', 'Notification ON'], + 'Create a notification when golden cookie spawns', + !0, + () => { + hn(e.GCNotification); + }, + ), + GCFlash: new Gn( + 'bool', + 'NotificationGC', + ['Flash OFF', 'Flash ON'], + 'Flash screen on golden cookie', + !0, + ), + ColourGCFlash: new bn( + 'colour', + 'NotificationGC', + 'The colour of the GC flash, standard colour is white', + ), + GCSound: new Gn( + 'bool', + 'NotificationGC', + ['Sound OFF', 'Sound ON'], + 'Play a sound on golden cookie', + !0, + ), + GCVolume: new vn('vol', 'NotificationGC', [], 'Volume'), + GCSoundURL: new Gn( + 'url', + 'NotificationGC', + 'Sound URL:', + 'URL of the sound to be played when a golden cookie spawns', + ), + FortuneNotification: new Gn( + 'bool', + 'NotificationFC', + ['Notification OFF', 'Notification ON'], + 'Create a notification when fortune cookie is on the ticker', + !0, + () => { + hn(e.FortuneNotification); + }, + ), + FortuneFlash: new Gn( + 'bool', + 'NotificationFC', + ['Flash OFF', 'Flash ON'], + 'Flash screen on fortune cookie spawn', + !0, + ), + ColourFortuneFlash: new bn( + 'colour', + 'NotificationFC', + 'The colour of the fortune flash, standard colour is white', + ), + FortuneSound: new Gn( + 'bool', + 'NotificationFC', + ['Sound OFF', 'Sound ON'], + 'Play a sound on fortune cookie spawn', + !0, + ), + FortuneVolume: new vn('vol', 'NotificationFC', [], 'Volume'), + FortuneSoundURL: new Gn( + 'url', + 'NotificationFC', + 'Sound URL:', + 'URL of the sound to be played when the ticker has a fortune cookie', + ), + SeaNotification: new Gn( + 'bool', + 'NotificationSea', + ['Notification OFF', 'Notification ON'], + 'Create a notification on season popup', + !0, + () => { + hn(e.SeaNotification); + }, + ), + SeaFlash: new Gn( + 'bool', + 'NotificationSea', + ['Flash OFF', 'Flash ON'], + 'Flash screen on season popup', + !0, + ), + ColourSeaFlash: new bn( + 'colour', + 'NotificationSea', + 'The colour of the season popup flash, standard colour is white', + ), + SeaSound: new Gn( + 'bool', + 'NotificationSea', + ['Sound OFF', 'Sound ON'], + 'Play a sound on season popup', + !0, + ), + SeaVolume: new vn('vol', 'NotificationSea', [], 'Volume'), + SeaSoundURL: new Gn( + 'url', + 'NotificationSea', + 'Sound URL:', + 'URL of the sound to be played when on season popup spawns', + ), + GardFlash: new Gn( + 'bool', + 'NotificationGard', + ['Garden Tick Flash OFF', 'Flash ON'], + 'Flash screen on garden tick', + !0, + ), + ColourGardFlash: new bn( + 'colour', + 'NotificationGard', + 'The colour of the garden flash, standard colour is white', + ), + GardSound: new Gn( + 'bool', + 'NotificationGard', + ['Sound OFF', 'Sound ON'], + 'Play a sound on garden tick', + !0, + ), + GardVolume: new vn('vol', 'NotificationGard', [], 'Volume'), + GardSoundURL: new Gn( + 'url', + 'NotificationGard', + 'Garden Tick Sound URL:', + 'URL of the sound to be played when the garden ticks', + ), + MagicNotification: new Gn( + 'bool', + 'NotificationMagi', + ['Notification OFF', 'Notification ON'], + 'Create a notification when magic reaches maximum', + !0, + () => { + hn(e.MagicNotification); + }, + ), + MagicFlash: new Gn( + 'bool', + 'NotificationMagi', + ['Flash OFF', 'Flash ON'], + 'Flash screen when magic reaches maximum', + !0, + ), + ColourMagicFlash: new bn( + 'colour', + 'NotificationMagi', + 'The colour of the magic flash, standard colour is white', + ), + MagicSound: new Gn( + 'bool', + 'NotificationMagi', + ['Sound OFF', 'Sound ON'], + 'Play a sound when magic reaches maximum', + !0, + ), + MagicVolume: new vn('vol', 'NotificationMagi', [], 'Volume'), + MagicSoundURL: new Gn( + 'url', + 'NotificationMagi', + 'Sound URL:', + 'URL of the sound to be played when magic reaches maxium', + ), + WrinklerNotification: new Gn( + 'bool', + 'NotificationWrink', + ['Notification OFF', 'Notification ON'], + 'Create a notification when a wrinkler appears', + !0, + () => { + hn(e.WrinklerNotification); + }, + ), + WrinklerFlash: new Gn( + 'bool', + 'NotificationWrink', + ['Flash OFF', 'Flash ON'], + 'Flash screen when a wrinkler appears', + !0, + ), + ColourWrinklerFlash: new bn( + 'colour', + 'NotificationWrink', + 'The colour of the wrinkler flash, standard colour is white', + ), + WrinklerSound: new Gn( + 'bool', + 'NotificationWrink', + ['Sound OFF', 'Sound ON'], + 'Play a sound when a wrinkler appears', + !0, + ), + WrinklerVolume: new vn('vol', 'NotificationWrink', [], 'Volume'), + WrinklerSoundURL: new Gn( + 'url', + 'NotificationWrink', + 'Sound URL:', + 'URL of the sound to be played when a wrinkler appears', + ), + WrinklerMaxNotification: new Gn( + 'bool', + 'NotificationWrinkMax', + ['Notification OFF', 'Notification ON'], + 'Create a notification when the maximum amount of wrinklers has appeared', + !0, + () => { + hn(e.WrinklerMaxNotification); + }, + ), + WrinklerMaxFlash: new Gn( + 'bool', + 'NotificationWrinkMax', + ['Flash OFF', 'Flash ON'], + 'Flash screen when the maximum amount of Wrinklers has appeared', + !0, + ), + ColourWrinklerMaxFlash: new bn( + 'colour', + 'NotificationWrinkMax', + 'The colour of the maximum wrinkler flash, standard colour is white', + ), + WrinklerMaxSound: new Gn( + 'bool', + 'NotificationWrinkMax', + ['Sound OFF', 'Sound ON'], + 'Play a sound when the maximum amount of wrinklers has appeared', + !0, + ), + WrinklerMaxVolume: new vn('vol', 'NotificationWrinkMax', [], 'Volume'), + WrinklerMaxSoundURL: new Gn( + 'url', + 'NotificationWrinkMax', + 'Sound URL:', + 'URL of the sound to be played when the maximum amount of wrinklers has appeared', + ), + BulkBuyBlock: new Gn( + 'bool', + 'Miscellaneous', + ['Block bulk buying OFF', 'Block bulk buying ON'], + "Block clicking bulk buying when you can't buy all. This prevents buying 7 of a building when you are in buy-10 or buy-100 mode.", + !0, + ), + FavouriteSettings: new Gn( + 'bool', + 'Miscellaneous', + [ + 'Favourite settings section OFF', + 'Favourite settings section ON', + 'Favourite settings section ON (Locked)', + ], + "Show stars before each setting which allows selecting it for a 'favourites' section at the top of the Cookie Monster settings. Setting this to Locked removes the stars but shows the 'favourites' section", + !0, + () => { + Game.UpdateMenu(); + }, + ), + }; + function xn() { + return JSON.stringify({ favouriteSettings: lo, settings: e, version: '2.031.7' }); + } + function Tn() { + if (ge !== Game.dragonLevel || se) { + if ( + Game.dragonLevel < 25 && + Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice') + ) { + let e = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1]; + const t = Game.dragonLevels[Game.dragonLevel].buy + .toString() + .match(/sacrifice\((.*?)\)/)[1]; + if ('i' !== e) + if (((e = e.replaceAll("'", '')), Game.Objects[e].amount < t)) + fe = 'Not enough buildings to sell'; + else { + let o = 0; + So(); + for (let n = 0; n < t; n++) { + let t = + Ct[e].basePrice * + Game.priceIncrease ** Math.max(0, Ct[e].amount - 1 - Ct[e].free); + (t = Game.modifyBuildingPrice(Ct[e], t)), + (t = Math.ceil(t)), + (o += t), + (Ct[e].amount -= 1); + } + fe = `Cost to rebuy: ${P(o)}`; + } + else { + let o = 0; + So(), + Object.keys(Game.Objects).forEach((n) => { + if (((e = n), Game.Objects[e].amount < t)) fe = 'Not enough buildings to sell'; + else { + for (let n = 0; n < t; n++) { + let t = + Ct[e].basePrice * + Game.priceIncrease ** Math.max(0, Ct[e].amount - 1 - Ct[e].free); + (t = Game.modifyBuildingPrice(Ct[e], t)), + (t = Math.ceil(t)), + (o += t), + (Ct[e].amount -= 1); + } + fe = `Cost to rebuy: ${P(o)}`; + } + }); + } + } + ge = Game.dragonLevel; + } + } + function Mn(e, t) { + if (!Game.Objects.Temple.minigameLoaded) return 0; + So(); + const { minigame: o } = Game.Objects.Temple, + n = o.godsById[e].slot; + '0' === n ? (ae = o.slot[t]) : '1' === n ? (re = o.slot[t]) : '2' === n && (le = o.slot[t]), + 0 === t ? (ae = e) : 1 === t ? (re = e) : 2 === t && (le = e); + const i = ee; + return Fo(), Uo(), i !== ee && Fo(), de - Game.cookiesPs; + } + function Sn() { + (Ct = []), + Object.keys(Game.Objects).forEach((e) => { + Ct[e] = To(e); + }), + (yt = []), + Object.keys(Game.Upgrades).forEach((e) => { + yt[e] = Mo(e); + }), + (bt = []), + Object.keys(Game.Achievements).forEach((e) => { + bt[e] = wo(e); + }), + So(); + } + let Bn = !1; + function Pn(t, o, n) { + ((1 === e[o] || n) && 3 === t && !1 === Bn) || 1 === t + ? ((l('CMFlashScreen').style.backgroundColor = e[`Colour${o}`]), + (l('CMFlashScreen').style.opacity = '0.5'), + 3 === t + ? ((l('CMFlashScreen').style.display = 'inline'), + setTimeout(() => { + Pn(2, o, !0); + }, 1e3 / Game.fps)) + : setTimeout(() => { + Pn(0, o, !0); + }, 1e3 / Game.fps)) + : 2 === t + ? ((l('CMFlashScreen').style.opacity = '1'), + setTimeout(() => { + Pn(1, o, !0); + }, 1e3 / Game.fps)) + : 0 === t && (l('CMFlashScreen').style.display = 'none'); + } + function En(t, o, n, i) { + if ((1 === e[o] || i) && !1 === Bn) { + const o = new Audio(t); + e.GeneralSound + ? (o.volume = (e[n] / 100) * (Game.volume / 100)) + : (o.volume = e[n] / 100), + o.play(); + } + } + function Nn(t, o, n) { + 1 === e[t] && + 'hidden' === document.visibilityState && + !1 === Bn && + new Notification(o, { + body: n, + badge: 'https://orteil.dashnet.org/cookieclicker/favicon.ico', + }); + } + function On() { + if ( + (no !== Game.OnAscend && + ((no = Game.OnAscend), + Game.OnAscend + ? ((l('game').style.bottom = '0px'), + 1 === e.BotBar && (l('CMBotBar').style.display = 'none'), + 1 === e.TimerBar && (l('CMTimerBar').style.display = 'none')) + : (gn(), Go()), + bo()), + !Game.OnAscend && 0 === Game.AscendTimer) + ) { + r !== Object.keys(Game.mods).length && (Sn(), un(), (r = Object.keys(Game.mods).length)), + se && + (dn(), + tn(), + Game.Has('Golden switch [off]') + ? (So(), (yt['Golden switch [off]'].bought = 0), Fo(), (Se = de)) + : (Se = Game.cookiesPs), + cn(), + sn(), + rn(), + nn(), + Tn(), + (function () { + for (let e = 0; e < 11; e += 1) for (let t = 0; t < 3; t += 1) ft[e][t] = Mn(e, t); + })(), + ln(), + (function () { + let e = 0; + if (Game.Objects.Bank.minigameLoaded) { + const t = Game.Objects.Bank.minigame.goods; + let o = 0; + Object.keys(t).forEach((e) => { + const n = t[e]; + o += n.stock * n.val; + }), + (e += o * Game.cookiesPsRawHighest); + } + (e += (function () { + let e = 0; + So(); + let t = 2; + (5 !== ne && 18 !== ne) || (t -= 1), + (5 !== ie && 18 !== ie) || (t -= 1), + (ne = 5), + (ie = 18); + for (let e = 0; e < t; ++e) { + let e = 'Cursor'; + Object.keys(Ct).forEach((t) => { + Ct[t].amount > 0 && (e = t); + }), + (Ct[e].amount -= 1), + (K -= 1); + } + return ( + Object.keys(Ct).forEach((t) => { + const o = Ct[t]; + e += Mt( + Game.Objects[o.name], + Game.Objects[t].basePrice, + o.amount, + Game.Objects[t].free, + o.amount, + ); + }), + e + ); + })()), + (gt = e); + })(), + (se = 0)); + const t = Game.auraMult('Fierce Hoarder') > 0; + !Y && t ? ((Y = !0), (q = 1)) : Y && !t && ((Y = !1), (q = 1)), + q && (en(), (q = 0)), + (function () { + pn(), + Ko(), + (function () { + Re = 0; + let e = 0; + Object.keys(Game.wrinklers).forEach((t) => { + 2 === Game.wrinklers[t].phase && (e += 1); + }); + let t = 1; + if (Ct.Temple.minigameLoaded) { + const e = Game.hasGod('scorn'); + 1 === e ? (t *= 1.15) : 2 === e ? (t *= 1.1) : 3 === e && (t *= 1.05); + } + (Ie = e), + (Re = + e * + (0.05 * e * 1.1) * + (0.05 * Game.Has('Sacrilegious corruption') + 1) * + (0.05 * Game.Has('Wrinklerspawn') + 1) * + t); + })(), + Xo(), + an(); + const e = + Game.HowManyCookiesReset( + Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + 1, + ) - + (Game.cookiesEarned + Game.cookiesReset); + pt = uo(e / ho()); + })(), + f !== (Game.TickerEffect && 'fortune' === Game.TickerEffect.type) && + ((f = Game.TickerEffect && 'fortune' === Game.TickerEffect.type), + f && + (Pn(3, 'FortuneFlash', !1), + En(e.FortuneSoundURL, 'FortuneSound', 'FortuneVolume', !1), + Nn( + 'FortuneNotification', + 'Fortune Cookie found', + 'A Fortune Cookie has appeared on the Ticker.', + ))), + g !== Game.shimmerTypes.reindeer.spawned && + ((g = Game.shimmerTypes.reindeer.spawned), + Object.keys(Game.shimmers).forEach((e) => { + Game.shimmers[e].spawnLead && + 'reindeer' === Game.shimmers[e].type && + (dt = Game.shimmers[e]); + }), + Pn(3, 'SeaFlash', !1), + En(e.SeaSoundURL, 'SeaSound', 'SeaVolume', !1), + Nn('SeaNotification', 'Reindeer sighted!', 'A Reindeer has spawned. Click it now!')), + Game.Objects.Farm.minigameLoaded && + C !== Game.Objects.Farm.minigame.nextStep && + (0 !== C && + C < Date.now() && + (Pn(3, 'GardFlash', !1), En(e.GardSoundURL, 'GardSound', 'GardVolume', !1)), + (C = Game.Objects.Farm.minigame.nextStep)), + (function () { + if (Game.Objects['Wizard tower'].minigameLoaded && 1 === e.GrimoireBar) { + const { minigame: t } = Game.Objects['Wizard tower']; + t.magic < t.magicM + ? (k = !1) + : k || + ((k = !0), + Pn(3, 'MagicFlash', !1), + En(e.MagicSoundURL, 'MagicSound', 'MagicVolume', !1), + Nn( + 'MagicNotification', + 'Magic Meter full', + 'Your Magic Meter is full. Cast a spell!', + )); + } + })(), + (function () { + if (Game.elderWrath > 0) { + let t = 0; + Object.keys(Game.wrinklers).forEach((e) => { + 2 === Game.wrinklers[e].phase && (t += 1); + }), + t > v + ? ((v = t), + t === Game.getWrinklersMax() && e.WrinklerMaxFlash + ? Pn(3, 'WrinklerMaxFlash', !1) + : Pn(3, 'WrinklerFlash', !1), + t === Game.getWrinklersMax() && e.WrinklerMaxSound + ? En(e.WrinklerMaxSoundURL, 'WrinklerMaxSound', 'WrinklerMaxVolume', !1) + : En(e.WrinklerSoundURL, 'WrinklerSound', 'WrinklerVolume', !1), + t === Game.getWrinklersMax() && e.WrinklerMaxNotification + ? Nn( + 'WrinklerMaxNotification', + 'Maximum Wrinklers Reached', + 'You have reached your maximum ammount of wrinklers', + ) + : Nn( + 'WrinklerNotification', + 'A Wrinkler appeared', + 'A new wrinkler has appeared', + )) + : (v = t); + } + })(); + } + (G = 0), + (ht = {}), + Object.keys(Game.shimmers).forEach((e) => { + (ht[Game.shimmers[e].id] = Game.shimmers[e]), + Game.shimmers[e].spawnLead && + 'golden' === Game.shimmers[e].type && + ((ct = Game.shimmers[e]), (G += 1)); + }), + Object.keys(ao).forEach((e) => { + void 0 === ht[e] && (ao[e].parentNode.removeChild(ao[e]), delete ao[e]); + }), + y !== Game.shimmerTypes.golden.n + ? ((y = Game.shimmerTypes.golden.n), + y && + (b < G && + (Pn(3, 'GCFlash', !1), + En(e.GCSoundURL, 'GCSound', 'GCVolume', !1), + Nn( + 'GCNotification', + 'Golden Cookie Spawned', + 'A Golden Cookie has spawned. Click it now!', + )), + Object.keys(Game.shimmers).forEach((t) => { + void 0 === ao[Game.shimmers[t].id] && + (function (t) { + const o = document.createElement('div'); + (o.id = `GCTimer${t.id}`), + (o.style.width = '96px'), + (o.style.height = '96px'), + (o.style.position = 'absolute'), + (o.style.zIndex = '10000000001'), + (o.style.textAlign = 'center'), + (o.style.lineHeight = '96px'), + (o.style.fontFamily = '"Kavoon", Georgia, serif'), + (o.style.fontSize = '35px'), + (o.style.cursor = 'pointer'), + (o.style.display = 'block'), + 0 === e.GCTimer && (o.style.display = 'none'), + (o.style.left = t.l.style.left), + (o.style.top = t.l.style.top), + (o.onclick = function () { + t.pop(); + }), + (o.onmouseover = function () { + (t.l.style.filter = + 'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))'), + (t.l.style.webkitFilter = + 'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))'); + }), + (o.onmouseout = function () { + (t.l.style.filter = ''), (t.l.style.webkitFilter = ''); + }), + (ao[t.id] = o), + l('shimmers').appendChild(o); + })(Game.shimmers[t]); + })), + Cn(), + (b = G), + 0 === G && (ct = 0)) + : 1 === e.GCTimer && + y && + Object.keys(ao).forEach((e) => { + (ao[e].style.opacity = ht[e].l.style.opacity), + (ao[e].style.transform = ht[e].l.style.transform), + (ao[e].textContent = Math.ceil(ht[e].life / Game.fps)); + }); + } + function Fn() { + let t = ''; + for (let o = 0; o < Dt.length; o++) + t += `.CMText${Dt[o]} { color: ${e[`Colour${Dt[o]}`]}; }\n`; + for (let o = 0; o < Dt.length; o++) + t += `.CMBack${Dt[o]} { background-color: ${e[`Colour${Dt[o]}`]}; }\n`; + for (let o = 0; o < Dt.length; o++) + t += `.CMBorder${Dt[o]} { border: 1px solid ${e[`Colour${Dt[o]}`]}; }\n`; + (l('CMCSS').textContent = t), so(); + } + function Ln() { + const e = b64_to_utf8( + unescape(localStorage.getItem('CookieClickerGame')).split('!END!')[0], + ), + t = e.match(/CookieMonster.*(;|$)/); + if (null !== t) { + const o = e.replace(t[0], `CookieMonster:${xn()}`); + localStorage.setItem('CookieClickerGame', escape(`${utf8_to_b64(o)}!END!`)); + } + } + function Wn(t) { + if ((void 0 !== localStorage.CMConfig && delete localStorage.CMConfig, void 0 !== t)) { + (e = t), void 0 !== e.Colors && delete e.Colors, void 0 !== e.Colours && delete e.Colours; + let o = !1; + Object.keys(mn).forEach((t) => { + void 0 === e[t] + ? ((o = !0), (e[t] = mn[t])) + : 'Header' === t && + Object.keys(mn.Header).forEach((n) => { + (void 0 !== e[t][n] && e[t][n] > -1 && e[t][n] < 2) || + ((o = !0), (e[t][n] = mn[t][n])); + }); + }), + o && Ln(), + On(), + Object.keys(mn).forEach((e) => { + 'Header' !== e && void 0 !== wn[e].func && wn[e].func(); + }); + } else Wn(mn); + Game.UpdateMenu(), Fn(); + } + function An() { + Object.keys(Game.wrinklers).forEach((e) => { + Game.wrinklers[e].sucked > 0 && + 0 === Game.wrinklers[e].type && + (Game.wrinklers[e].hp = 0); + }); + } + function jn(t, o) { + if ('b' === t) { + if (((l('tooltip').innerHTML = Game.Objects[o].tooltip()), 1 === e.TooltipAmor)) { + const e = Jo( + Game.Objects[o], + Game.Objects[o].basePrice, + 0, + Game.Objects[o].free, + Game.Objects[o].amount, + ), + t = e - Game.Objects[o].totalCookies; + t > 0 && + (l('tooltip').innerHTML = l('tooltip') + .innerHTML.split('so far') + .join( + `so far
${P(t)} ${ + 1 === Math.floor(t) ? 'cookie' : 'cookies' + } left to amortize (${ + mo( + (e - Game.Objects[o].totalCookies) / + (Game.Objects[o].storedTotalCps * Game.globalCpsMult), + ).text + })`, + )); + } + -1 === Game.buyMode && + (l('tooltip').innerHTML = l('tooltip') + .innerHTML.split(P(Game.Objects[o].bulkPrice)) + .join( + P( + (Game.Objects[o], + Game.Objects[o].basePrice, + Game.Objects[o].amount, + Game.Objects[o].free, + Game.buyBulk, + 1), + ), + )); + } else if ('u' === t) { + if (!Game.UpgradesInStore[o]) return ''; + l('tooltip').innerHTML = Game.crateTooltip(Game.UpgradesInStore[o], 'store'); + } else + 's' === t + ? (l('tooltip').innerHTML = Game.lumpTooltip()) + : 'g' === t + ? (l('tooltip').innerHTML = Game.Objects['Wizard tower'].minigame.spellTooltip(o)()) + : 'p' === t + ? (l('tooltip').innerHTML = Game.ObjectsById[2].minigame.tileTooltip(o[0], o[1])()) + : 'ha' === t + ? (l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)()) + : 'wb' === t + ? (l('tooltip').innerHTML = '') + : 'pag' === t + ? (l('tooltip').innerHTML = Game.Objects.Temple.minigame.godTooltip(o)()) + : 'pas' === t && + (l('tooltip').innerHTML = Game.Objects.Temple.minigame.slotTooltip(o[0])()); + if ( + ('b' === t && 1 === Game.buyMode) || + 'u' === t || + 's' === t || + 'g' === t || + ('p' === t && !Game.keys[16]) || + 'ha' === t || + 'wb' === t || + 'pag' === t || + ('pas' === t && -1 !== o[1]) + ) { + const e = document.createElement('div'); + (e.id = 'CMTooltipArea'), l('tooltip').appendChild(e); + } + return (eo = t), (to = o), zo(), l('tooltip').innerHTML; + } + function Dn() { + Game.Objects['Wizard tower'].minigameLoaded && + Object.keys(Game.Objects['Wizard tower'].minigame.spellsById).forEach((e) => { + null !== l(`grimoireSpell${e}`).onmouseover && + ((x[e] = l(`grimoireSpell${e}`).onmouseover), + (l(`grimoireSpell${e}`).onmouseover = function () { + (Game.tooltip.dynamic = 1), + Game.tooltip.draw(this, () => jn('g', `${e}`), 'this'), + Game.tooltip.wobble(); + })); + }); + } + function Hn() { + if (!m && Game.Objects['Wizard tower'].minigameLoaded) { + const { minigame: t } = Game.Objects['Wizard tower']; + (p = t.draw), + (Game.Objects['Wizard tower'].minigame.draw = function () { + p(), + 1 === e.GrimoireBar && + t.magic < t.magicM && + (t.magicBarTextL.innerHTML += ` (${uo(Ro(t.magic, t.magicM, t.magicM))})`); + }), + (m = !0); + } + } + function Un() { + !(function () { + if (!u && Game.Objects['Wizard tower'].minigameLoaded) { + const { minigame: e } = Game.Objects['Wizard tower']; + (c = e.launch), + (d = new Function( + `return ${e.launch + .toString() + .split('=this') + .join("= Game.Objects['Wizard tower'].minigame")}`, + )), + (Game.Objects['Wizard tower'].minigame.launch = function () { + d(), Dn(), (m = !1), Hn(), (u = !0); + }); + } + })(), + Hn(); + } + var $n = o(877), + Rn = o.n($n); + const In = 'CMConfig'; + function zn(t) { + null !== l(`slider${t}`) && + ((l(`slider${t}right`).innerHTML = `${l(`slider${t}`).value}%`), + (e[t] = Math.round(l(`slider${t}`).value))), + Ln(); + } + function Vn(t) { + (e.Header[t] += 1), e.Header[t] > 1 && (e.Header[t] = 0), Ln(); + } + function _n(t, o) { + const n = document.createElement('div'); + (n.className = 'title'), + (n.style.padding = '0px 16px'), + (n.style.opacity = '0.7'), + (n.style.fontSize = '17px'), + (n.style.fontFamily = '"Kavoon", Georgia, serif'), + n.appendChild(document.createTextNode(`${t} `)); + const i = document.createElement('span'); + return ( + (i.style.cursor = 'pointer'), + (i.style.display = 'inline-block'), + (i.style.height = '14px'), + (i.style.width = '14px'), + (i.style.borderRadius = '7px'), + (i.style.textAlign = 'center'), + (i.style.backgroundColor = '#C0C0C0'), + (i.style.color = 'black'), + (i.style.fontSize = '13px'), + (i.style.verticalAlign = 'middle'), + (i.textContent = e.Header[o] ? '-' : '+'), + (i.onclick = function () { + Vn(o), Game.UpdateMenu(); + }), + n.appendChild(i), + n + ); + } + function Qn(e, t, o, n) { + const i = document.createElement('div'); + i.className = 'listing'; + const a = document.createElement('b'); + if (((a.textContent = t), i.appendChild(a), 'withTooltip' === e)) { + (i.className = 'listing'), i.appendChild(document.createTextNode(' ')); + const e = document.createElement('span'); + (e.onmouseout = function () { + Game.tooltip.hide(); + }), + (e.onmouseover = function () { + Game.tooltip.draw(this, escape(Ut[n].innerHTML)); + }), + (e.style.cursor = 'default'), + (e.style.display = 'inline-block'), + (e.style.height = '10px'), + (e.style.width = '10px'), + (e.style.borderRadius = '5px'), + (e.style.textAlign = 'center'), + (e.style.backgroundColor = '#C0C0C0'), + (e.style.color = 'black'), + (e.style.fontSize = '9px'), + (e.style.verticalAlign = 'bottom'), + (e.textContent = '?'), + i.appendChild(e); + } + return i.appendChild(document.createTextNode(': ')), i.appendChild(o), i; + } + function Xn(e) { + const t = document.createDocumentFragment(); + t.appendChild(document.createTextNode(`${e.length} `)); + const o = document.createElement('span'); + o.onmouseout = function () { + Game.tooltip.hide(); + }; + const n = document.createElement('div'), + i = document.createElement('div'); + (i.style.minWidth = '140px'), (i.style.marginBottom = '4px'); + const a = document.createElement('div'); + return ( + (a.className = 'name'), + (a.style.marginBottom = '4px'), + (a.style.textAlign = 'center'), + (a.textContent = 'Missing'), + i.appendChild(a), + Object.keys(e).forEach((t) => { + const o = document.createElement('div'); + (o.style.textAlign = 'center'), + o.appendChild(document.createTextNode(e[t])), + i.appendChild(o); + }), + n.appendChild(i), + (o.onmouseover = function () { + Game.tooltip.draw(this, escape(n.innerHTML)); + }), + (o.style.cursor = 'default'), + (o.style.display = 'inline-block'), + (o.style.height = '10px'), + (o.style.width = '10px'), + (o.style.borderRadius = '5px'), + (o.style.textAlign = 'center'), + (o.style.backgroundColor = '#C0C0C0'), + (o.style.color = 'black'), + (o.style.fontSize = '9px'), + (o.style.verticalAlign = 'bottom'), + (o.textContent = '?'), + t.appendChild(o), + t + ); + } + function qn(t) { + const o = document.createElement('div'); + if ( + ((o.className = 'subsection'), + o.appendChild(t), + o.appendChild(_n('Lucky Cookies', 'Lucky')), + e.Header.Lucky && + o.appendChild( + (function () { + const e = Game.auraMult("Dragon's Fortune") + ? 'GoldCookDragonsFortuneTooltipPlaceholder' + : 'GoldCookTooltipPlaceholder', + t = document.createElement('div'); + t.className = 'CMStatsLuckySection'; + const o = Game.cookies + go() < Ce ? Ft : Et, + n = Game.cookies + go() < Ce ? uo((Ce - (Game.cookies + go())) / ho()) : '', + i = document.createDocumentFragment(), + a = document.createElement('span'); + if ( + ((a.style.fontWeight = 'bold'), + (a.className = St + o), + (a.textContent = P(Ce)), + i.appendChild(a), + '' !== n) + ) { + const e = document.createElement('small'); + (e.textContent = ` (${n})`), i.appendChild(e); + } + t.appendChild(Qn('withTooltip', '"Lucky!" cookies required', i, e)); + const r = Game.cookies + go() < ke ? Ft : Et, + l = Game.cookies + go() < ke ? uo((ke - (Game.cookies + go())) / ho()) : '', + s = document.createDocumentFragment(), + c = document.createElement('span'); + if ( + ((c.style.fontWeight = 'bold'), + (c.className = St + r), + (c.textContent = P(ke)), + s.appendChild(c), + '' !== l) + ) { + const e = document.createElement('small'); + (e.textContent = ` (${l})`), s.appendChild(e); + } + t.appendChild(Qn('withTooltip', '"Lucky!" cookies required (frenzy)', s, e)); + const d = ye !== be, + p = document.createElement('span'); + (p.style.fontWeight = 'bold'), + (p.className = St + ye), + (p.textContent = P(ye) + (d ? ` / ${P(be)}` : '')), + t.appendChild( + Qn( + 'withTooltip', + '"Lucky!" reward (max)' + (d ? ' (golden / wrath)' : ''), + p, + e, + ), + ); + const u = document.createElement('span'); + (u.style.fontWeight = 'bold'), + (u.className = St + u), + (u.textContent = P(Ge) + (d ? ` / ${P(ve)}` : '')), + t.appendChild( + Qn( + 'withTooltip', + '"Lucky!" reward (max) (frenzy)' + (d ? ' (golden / wrath)' : ''), + u, + e, + ), + ); + const m = Math.min(0.15 * (Game.cookies + go()), Se * Be * 60 * 15) + 13, + h = document.createElement('span'); + return ( + (h.style.fontWeight = 'bold'), + (h.className = St + h), + (h.textContent = P(Pe * m) + (d ? ` / ${P(Ee * m)}` : '')), + t.appendChild( + Qn( + 'withTooltip', + '"Lucky!" reward (cur)' + (d ? ' (golden / wrath)' : ''), + h, + e, + ), + ), + t + ); + })(), + ), + o.appendChild(_n('Chain Cookies', 'Chain')), + e.Header.Chain && + o.appendChild( + (function () { + const e = Game.auraMult("Dragon's Fortune") + ? 'GoldCookDragonsFortuneTooltipPlaceholder' + : 'GoldCookTooltipPlaceholder', + t = document.createElement('div'); + t.className = 'CMStatsChainSection'; + const o = Game.cookies + go() < qe ? Ft : Et, + n = Game.cookies + go() < qe ? uo((qe - (Game.cookies + go())) / ho()) : '', + i = document.createDocumentFragment(), + a = document.createElement('span'); + if ( + ((a.style.fontWeight = 'bold'), + (a.className = St + o), + (a.textContent = P(qe)), + i.appendChild(a), + '' !== n) + ) { + const e = document.createElement('small'); + (e.textContent = ` (${n})`), i.appendChild(e); + } + t.appendChild(Qn('withTooltip', '"Chain" cookies required', i, e)); + const r = Game.cookies + go() < Je ? Ft : Et, + l = Game.cookies + go() < Je ? uo((Je - (Game.cookies + go())) / ho()) : '', + s = document.createDocumentFragment(), + c = document.createElement('span'); + if ( + ((c.style.fontWeight = 'bold'), + (c.className = St + r), + (c.textContent = P(Je)), + s.appendChild(c), + '' !== l) + ) { + const e = document.createElement('small'); + (e.textContent = ` (${l})`), s.appendChild(e); + } + t.appendChild(Qn('withTooltip', '"Chain" cookies required (Wrath)', s, e)); + const d = Game.cookies + go() < tt ? Ft : Et, + p = Game.cookies + go() < tt ? uo((tt - (Game.cookies + go())) / ho()) : '', + u = document.createDocumentFragment(), + m = document.createElement('span'); + if ( + ((m.style.fontWeight = 'bold'), + (m.className = St + d), + (m.textContent = P(tt)), + u.appendChild(m), + '' !== p) + ) { + const e = document.createElement('small'); + (e.textContent = ` (${p})`), u.appendChild(e); + } + t.appendChild(Qn('withTooltip', '"Chain" cookies required (Frenzy)', u, e)); + const h = Game.cookies + go() < it ? Ft : Et, + g = Game.cookies + go() < it ? uo((it - (Game.cookies + go())) / ho()) : '', + f = document.createDocumentFragment(), + C = document.createElement('span'); + if ( + ((C.style.fontWeight = 'bold'), + (C.className = St + h), + (C.textContent = P(it)), + f.appendChild(C), + '' !== g) + ) { + const e = document.createElement('small'); + (e.textContent = ` (${g})`), f.appendChild(e); + } + t.appendChild(Qn('withTooltip', '"Chain" cookies required (frenzy) (Wrath)', f, e)), + t.appendChild( + Qn( + 'withTooltip', + '"Chain" reward (max) (golden / wrath)', + document.createTextNode(`${P(Ke[0])} / ${P(et[0])}`), + e, + ), + ), + t.appendChild( + Qn( + 'withTooltip', + '"Chain" reward (max) (frenzy) (golden / wrath)', + document.createTextNode(`${P(nt[0])} / ${P(nt[0])}`), + e, + ), + ); + const y = Math.min(60 * Game.cookiesPs * 60 * 6 * Be, 0.5 * Game.cookies), + b = on(7, y, Pe)[0], + k = on(6, y, Ee)[0]; + return ( + t.appendChild( + Qn( + 'withTooltip', + '"Chain" reward (cur) (golden / wrath)', + document.createTextNode(`${P(b)} / ${P(k)}`), + e, + ), + ), + t.appendChild( + Qn( + 'withTooltip', + 'CPS needed for next level (g / w)', + document.createTextNode(`${P(Ye)} / ${P(Ze)}`), + 'ChainNextLevelPlaceholder', + ), + ), + t.appendChild( + Qn( + 'withTooltip', + 'CPS needed for next level (frenzy) (g / w)', + document.createTextNode(`${P(ot)} / ${P(at)}`), + 'ChainNextLevelPlaceholder', + ), + ), + t + ); + })(), + ), + Game.Objects['Wizard tower'].minigameLoaded && + (o.appendChild(_n('Spells', 'Spells')), + e.Header.Spells && + o.appendChild( + (function () { + const e = document.createElement('div'); + e.className = 'CMStatsSpellsSection'; + const t = Game.cookies + go() < we ? Ft : Et, + o = Game.cookies + go() < we ? uo((we - (Game.cookies + go())) / ho()) : '', + n = document.createDocumentFragment(), + i = document.createElement('span'); + if ( + ((i.style.fontWeight = 'bold'), + (i.className = St + t), + (i.textContent = P(we)), + n.appendChild(i), + '' !== o) + ) { + const e = document.createElement('small'); + (e.textContent = ` (${o})`), n.appendChild(e); + } + e.appendChild( + Qn( + 'withTooltip', + '"Conjure Baked Goods" cookies required', + n, + 'GoldCookTooltipPlaceholder', + ), + ), + e.appendChild( + Qn( + 'withTooltip', + '"Conjure Baked Goods" reward (max)', + document.createTextNode(P(xe)), + 'GoldCookTooltipPlaceholder', + ), + ); + const a = Game.cookies + go() < 7 * we ? Ft : Et, + r = Math.min(0.15 * (Game.cookies + go()), 60 * Se * 30), + l = + Game.cookies + go() < 7 * we + ? uo((7 * we - (Game.cookies + go())) / ho()) + : '', + s = document.createDocumentFragment(), + c = document.createElement('span'); + if ( + ((c.style.fontWeight = 'bold'), + (c.className = St + a), + (c.textContent = P(7 * we)), + s.appendChild(c), + '' !== l) + ) { + const e = document.createElement('small'); + (e.textContent = ` (${l})`), s.appendChild(e); + } + return ( + e.appendChild( + Qn( + 'withTooltip', + '"Conjure Baked Goods" cookies required (frenzy)', + s, + 'GoldCookTooltipPlaceholder', + ), + ), + e.appendChild( + Qn( + 'withTooltip', + '"Conjure Baked Goods" reward (max) (frenzy)', + document.createTextNode(P(7 * xe)), + 'GoldCookTooltipPlaceholder', + ), + ), + e.appendChild( + Qn( + 'withTooltip', + '"Conjure Baked Goods" reward (cur)', + document.createTextNode(P(r)), + 'GoldCookTooltipPlaceholder', + ), + ), + Te && + e.appendChild( + Qn( + 'withTooltip', + '"Spontaneous Edifice" cookies required (most expensive building)', + document.createTextNode(`${P(Te)} (${Me})`), + 'GoldCookTooltipPlaceholder', + ), + ), + e + ); + })(), + )), + Game.Objects.Farm.minigameLoaded && + (o.appendChild(_n('Garden', 'Garden')), + e.Header.Garden && + o.appendChild( + (function () { + const e = document.createElement('div'); + e.className = 'CMStatsGardenSection'; + const t = Game.cookies < 60 * Game.cookiesPs * 10 * 100 ? Ft : Et, + o = document.createElement('span'); + (o.style.fontWeight = 'bold'), + (o.className = St + t), + (o.textContent = P(60 * Game.cookiesPs * 10 * 100)), + e.appendChild(Qn('basic', 'Cookies required for max reward of Bakeberry: ', o)); + const n = Game.cookies < 60 * Game.cookiesPs * 100 ? Ft : Et, + i = document.createElement('span'); + (i.style.fontWeight = 'bold'), + (i.className = St + n), + (i.textContent = P(60 * Game.cookiesPs * 100)), + e.appendChild(Qn('basic', 'Cookies required for max reward of Chocoroot: ', i)); + const a = Game.cookies < 60 * Game.cookiesPs * 60 * 25 ? Ft : Et, + r = document.createElement('span'); + (r.style.fontWeight = 'bold'), + (r.className = St + a), + (r.textContent = P(60 * Game.cookiesPs * 60 * 25)), + e.appendChild(Qn('basic', 'Cookies required for max reward of Queenbeet: ', r)); + const l = Game.cookies < 60 * Game.cookiesPs * 15 * 100 ? Ft : Et, + s = document.createElement('span'); + (s.style.fontWeight = 'bold'), + (s.className = St + l), + (s.textContent = P(60 * Game.cookiesPs * 15 * 100)), + e.appendChild(Qn('basic', 'Cookies required for max reward of Duketater: ', s)); + const c = []; + return ( + Object.keys(Do).forEach((e) => { + Game.HasUnlocked(Do[e]) || c.push(Do[e]); + }), + 0 !== c.length && + e.appendChild(Qn('basic', 'Rare plant drops left to unlock', Xn(c))), + e + ); + })(), + )), + o.appendChild(_n('Prestige', 'Prestige')), + e.Header.Prestige && + o.appendChild( + (function () { + const t = document.createElement('div'); + t.className = 'CMStatsPrestigeSection'; + const o = Math.floor( + Game.HowMuchPrestige( + lt + + Game.cookiesReset + + He + + (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? Le : 0), + ), + ); + t.appendChild( + Qn( + 'withTooltip', + 'Prestige level (cur / max)', + document.createTextNode(`${P(Game.prestige)} / ${P(o)}`), + 'PrestMaxTooltipPlaceholder', + ), + ); + const n = Math.max( + 0, + Game.HowManyCookiesReset(o + 1) - + (lt + + Game.cookiesReset + + He + + (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') && Le + ? Le + : 0)), + ), + i = document.createDocumentFragment(); + i.appendChild(document.createTextNode(P(n))); + const a = document.createElement('small'); + (a.textContent = ` (${uo(n / st, 1)})`), + i.appendChild(a), + t.appendChild( + Qn('withTooltip', 'Cookies to next level', i, 'NextPrestTooltipPlaceholder'), + ), + t.appendChild( + Qn( + 'withTooltip', + 'Heavenly chips (cur / max)', + document.createTextNode( + `${P(Game.heavenlyChips)} / ${P(o - Game.prestige + Game.heavenlyChips)}`, + ), + 'HeavenChipMaxTooltipPlaceholder', + ), + ), + t.appendChild( + Qn( + 'basic', + 'Heavenly chips per second (last 5 seconds)', + document.createTextNode(P(Ne, 2)), + ), + ); + const r = Number(e.HeavenlyChipsTarget); + if (!Number.isNaN(r)) { + const e = + r - Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)); + e > 0 && + (t.appendChild( + Qn( + 'basic', + 'Heavenly chips to target set in settings (cur)', + document.createTextNode(P(e)), + ), + ), + t.appendChild( + Qn( + 'basic', + 'Time till target (cur, current 5 second average)', + document.createTextNode(uo(e / Ne)), + ), + )); + } + const l = (function (e) { + let t = Game.cookiesPs; + So(), + 0 === yt['Heavenly key'].bought && + ((yt['Heavenly chip secret'].bought = 1), + (yt['Heavenly cookie stand'].bought = 1), + (yt['Heavenly bakery'].bought = 1), + (yt['Heavenly confectionery'].bought = 1), + (yt['Heavenly key'].bought = 1), + Fo(), + (t = de), + So()), + lt >= 1e6 && Oo('Sacrifice'), + lt >= 1e9 && Oo('Oblivion'), + lt >= 1e12 && Oo('From scratch'), + lt >= 1e15 && Oo('Nihilism'), + lt >= 1e18 && Oo('Dematerialize'), + lt >= 1e21 && Oo('Nil zero zilch'), + lt >= 1e24 && Oo('Transcendence'), + lt >= 1e27 && Oo('Obliterate'), + lt >= 1e30 && Oo('Negative void'), + lt >= 1e33 && Oo('To crumbs, you say?'), + lt >= 1e36 && Oo('You get nothing'), + lt >= 1e39 && Oo('Humble rebeginnings'), + lt >= 1e42 && Oo('The end of the world'), + lt >= 1e45 && Oo("Oh, you're back"), + lt >= 1e48 && Oo('Lazarus'), + lt >= 1e51 && Oo('Smurf account'), + lt >= 1e54 && Oo("If at first you don't succeed"), + (yt['Heavenly chip secret'].bought = 1), + (yt['Heavenly cookie stand'].bought = 1), + (yt['Heavenly bakery'].bought = 1), + (yt['Heavenly confectionery'].bought = 1), + (yt['Heavenly key'].bought = 1), + (oe = e); + const o = ee; + Fo(), Uo(), o !== ee && Fo(); + const n = de - t; + return (oe = Game.prestige), n; + })(o), + s = document.createDocumentFragment(); + s.appendChild(document.createTextNode(P(l))); + const c = Math.round((l / Game.cookiesPs) * 1e4); + if (Number.isFinite(c) && 0 !== c) { + const e = document.createElement('small'); + (e.textContent = ` (${c / 100}% of income)`), s.appendChild(e); + } + t.appendChild( + Qn('withTooltip', 'Reset bonus income', s, 'ResetTooltipPlaceholder'), + ); + const d = Math.floor(Game.HowMuchPrestige(Game.cookiesReset)), + p = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)), + u = p - d; + if (!Game.Has('Lucky digit')) { + let e = 7 - (p % 10); + e < 0 && (e += 10); + const o = u + e, + n = p + e, + i = document.createDocumentFragment(); + i.appendChild( + document.createTextNode( + `${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`, + ), + ), + t.appendChild(Qn('basic', 'Next "Lucky Digit" (total / reset)', i)); + } + if (!Game.Has('Lucky number')) { + let e = 777 - (p % 1e3); + e < 0 && (e += 1e3); + const o = u + e, + n = p + e, + i = document.createDocumentFragment(); + i.appendChild( + document.createTextNode( + `${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`, + ), + ), + t.appendChild(Qn('basic', 'Next "Lucky Number" (total / reset)', i)); + } + if (!Game.Has('Lucky payout')) { + let e = 777777 - (p % 1e6); + e < 0 && (e += 1e6); + const o = u + e, + n = p + e, + i = document.createDocumentFragment(); + i.appendChild( + document.createTextNode( + `${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`, + ), + ), + t.appendChild(Qn('basic', 'Next "Lucky Payout" (total / reset)', i)); + } + return t; + })(), + ), + Game.cpsSucked > 0 && (o.appendChild(_n('Wrinklers', 'Wrink')), e.Header.Wrink)) + ) { + const e = document.createDocumentFragment(); + e.appendChild(document.createTextNode(`${P(He)} / ${P(Ue)} `)); + const t = document.createElement('a'); + (t.textContent = 'Pop All Normal'), + (t.className = 'option'), + (t.onclick = function () { + An(); + }), + e.appendChild(t), + o.appendChild(Qn('basic', 'Rewards of Popping (All/Normal)', e)); + const n = document.createDocumentFragment(); + n.appendChild(document.createTextNode(`${P($e[0])} `)); + const i = document.createElement('a'); + (i.textContent = 'Pop Single Fattest'), + (i.className = 'option'), + (i.onclick = function () { + null !== $e[1] && (Game.wrinklers[$e[1]].hp = 0); + }), + n.appendChild(i), + o.appendChild( + Qn( + 'basic', + `Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ${ + null !== $e[1] ? $e[1] : 'None' + })`, + n, + ), + ); + } + if ( + (o.appendChild( + (function () { + const t = document.createElement('div'); + t.className = 'CMStatsSeasonSection'; + let o = !1; + const n = []; + Object.keys(Wo).forEach((e) => { + Game.Has(Wo[e]) || (n.push(Wo[e]), (o = !0)); + }); + const i = []; + Object.keys(Ao).forEach((e) => { + Game.Has(Ao[e]) || (i.push(Ao[e]), (o = !0)); + }); + const a = []; + Object.keys(jo).forEach((e) => { + Game.Has(jo[e]) || (a.push(jo[e]), (o = !0)); + }); + const r = []; + Object.keys(Game.eggDrops).forEach((e) => { + Game.HasUnlocked(Game.eggDrops[e]) || (r.push(Game.eggDrops[e]), (o = !0)); + }); + const l = []; + Object.keys(Game.rareEggDrops).forEach((e) => { + Game.HasUnlocked(Game.rareEggDrops[e]) || (l.push(Game.rareEggDrops[e]), (o = !0)); + }); + const s = Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg'), + c = Game.Has('Century egg'); + if ( + ('christmas' === Game.season || o || s || c) && + (t.appendChild(_n('Season Specials', 'Sea')), e.Header.Sea) + ) { + if (0 !== n.length) { + t.appendChild(Qn('basic', 'Halloween cookies left to buy', Xn(n))); + let e = 0.95; + if ( + (Game.HasAchiev('Spooky cookies') && (e = 0.8), + Game.Has('Starterror') && (e *= 0.9), + (e *= 1 / Game.dropRateMult()), + Game.hasGod) + ) { + const t = Game.hasGod('seasons'); + 1 === t ? (e *= 0.9) : 2 === t ? (e *= 0.95) : 3 === t && (e *= 0.97); + } + const o = n.length / 7; + t.appendChild( + Qn( + 'basic', + 'Chance of receiving a cookie from wrinkler/shiny wrinkler', + document.createTextNode( + `${P((1 - e) * o * 100)}% / ${P((1 - 0.9 * e) * o * 100)}%`, + ), + ), + ); + } + if (0 !== i.length) { + t.appendChild(Qn('basic', 'Christmas cookies left to buy', Xn(i))); + let e = 0.8; + if ( + (Game.HasAchiev('Let it snow') && (e = 0.6), + (e *= 1 / Game.dropRateMult()), + Game.Has('Starsnow') && (e *= 0.95), + Game.hasGod) + ) { + const t = Game.hasGod('seasons'); + 1 === t ? (e *= 0.9) : 2 === t ? (e *= 0.95) : 3 === t && (e *= 0.97); + } + const o = i.length / 7; + t.appendChild( + Qn( + 'basic', + 'Chance of receiving a cookie from reindeer', + document.createTextNode(`${P((1 - e) * o * 100)}%`), + ), + ); + } + 0 !== a.length && + t.appendChild(Qn('basic', 'Valentine cookies left to buy', Xn(a))); + const e = function (e) { + let t = e * (1 / Game.dropRateMult()); + if ( + (Game.HasAchiev('Hide & seek champion') && (t *= 0.7), + Game.Has('Omelette') && (t *= 0.9), + Game.Has('Starspawn') && (t *= 0.9), + Game.hasGod) + ) { + const e = Game.hasGod('seasons'); + 1 === e ? (t *= 0.9) : 2 === e ? (t *= 0.95) : 3 === e && (t *= 0.97); + } + const o = 1 - t, + n = Game.eggDrops.length - r.length, + i = Game.rareEggDrops.length - l.length, + a = 0.9 * o * (1 - n / Game.eggDrops.length), + s = 0.1 * o * (1 - i / Game.rareEggDrops.length), + c = + 0.9 * o * (n / Game.eggDrops.length) + + 0.1 * o * (i / Game.rareEggDrops.length); + return [ + a + 0.9 * c * (1 - n / Game.eggDrops.length), + s + 0.1 * c * (1 - i / Game.rareEggDrops.length), + ]; + }; + 0 !== r.length && + (t.appendChild(Qn('basic', 'Normal easter eggs left to unlock', Xn(r))), + t.appendChild( + Qn( + 'basic', + 'Chance of receiving an egg from wrinkler/golden cookie', + document.createTextNode(`${P(100 * e(0.98)[0])}% / ${P(100 * e(0.9)[0])}%`), + ), + )), + 0 !== l.length && + (t.appendChild(Qn('basic', 'Rare easter eggs left to unlock', Xn(l))), + t.appendChild( + Qn( + 'basic', + 'Chance of receiving a rare egg from wrinkler/golden cookie', + document.createTextNode(`${P(100 * e(0.98)[1])}% / ${P(100 * e(0.9)[1])}%`), + ), + )), + 'christmas' === Game.season && + t.appendChild(Qn('basic', 'Reindeer reward', document.createTextNode(P(Fe)))), + s && + t.appendChild( + Qn( + 'withTooltip', + 'Chocolate egg cookies', + document.createTextNode(P(Le)), + 'ChoEggTooltipPlaceholder', + ), + ), + c && + t.appendChild( + Qn( + 'basic', + 'Century egg multiplier', + document.createTextNode(Math.round(1e4 * (Oe - 1)) / 100 + '%'), + ), + ); + } + return t; + })(), + ), + o.appendChild(_n('Miscellaneous', 'Misc')), + e.Header.Misc) + ) { + if ( + (o.appendChild( + Qn( + 'basic', + `Average cookies per second (past ${ + qt[e.AvgCPSHist] < 60 + ? `${qt[e.AvgCPSHist]} seconds` + : qt[e.AvgCPSHist] / 60 + (3 === e.AvgCPSHist ? ' minute' : ' minutes') + })`, + document.createTextNode(P(ho(), 3)), + ), + ), + o.appendChild( + Qn( + 'basic', + `Average cookie clicks per second (past ${Yt[e.AvgClicksHist]}${ + 0 === e.AvgClicksHist ? ' second' : ' seconds' + })`, + document.createTextNode(P(Ve, 1)), + ), + ), + o.appendChild( + Qn( + 'basic', + `Cookies from clicking (past ${Yt[e.AvgClicksHist]}${ + 0 === e.AvgClicksHist ? ' second' : ' seconds' + })`, + document.createTextNode(P(E.calcSum(Ve * Yt[e.AvgClicksHist]))), + ), + ), + Game.Has('Fortune cookies')) + ) { + const e = []; + Object.keys(Lo).forEach((t) => { + Game.Has(Lo[t]) || e.push(Lo[t]); + }), + 0 !== e.length && o.appendChild(Qn('basic', 'Fortune Upgrades Left to Buy', Xn(e))); + } + if ( + (e.ShowMissedGC && + o.appendChild( + Qn( + 'basic', + 'Missed golden cookies', + document.createTextNode(P(Game.missedGoldenClicks)), + ), + ), + Game.prefs.autosave) + ) { + const e = document.createElement('span'); + (e.id = 'CMStatsAutosaveTimer'), + (e.innerText = Game.sayTime( + 60 * Game.fps - (Game.OnAscend ? 0 : Game.T % (60 * Game.fps)), + 4, + )), + o.appendChild(Qn('basic', 'Time till autosave', e)); + } + } + l('menu').insertBefore(o, l('menu').childNodes[2]), + e.MissingUpgrades && + l('menu').childNodes.forEach((e) => { + if (e.children[0]) + if ('Prestige' === e.children[0].innerHTML && Qe) { + const t = Qe.match(new RegExp('div', 'g') || 0).length / 2, + o = document.createElement('div'); + (o.id = 'CMMissingUpgradesPrestigeTitle'), (o.className = 'listing'); + const n = document.createElement('div'); + (n.innerHTML = `Missing Prestige upgrades: ${t}/${ + Game.PrestigeUpgrades.length + } (${Math.floor((t / Game.PrestigeUpgrades.length) * 100)}%)`), + o.appendChild(n), + e.appendChild(o); + const i = document.createElement('div'); + (i.className = 'listing crateBox'), (i.innerHTML = Qe), e.appendChild(i); + } else if ('Upgrades' === e.children[0].innerHTML) { + if (_e) { + const t = _e.match(new RegExp('div', 'g') || 0).length / 2, + o = document.createElement('div'); + (o.id = 'CMMissingUpgradesTitle'), (o.className = 'listing'); + const n = document.createElement('div'); + (n.innerHTML = `Missing normal upgrades: ${t}/${ + Game.UpgradesByPool[''].length + Game.UpgradesByPool.tech.length + } (${Math.floor( + (t / (Game.UpgradesByPool[''].length + Game.UpgradesByPool.tech.length)) * + 100, + )}%)`), + o.appendChild(n), + e.insertBefore(o, e.childNodes[3]); + const i = document.createElement('div'); + (i.className = 'listing crateBox'), + (i.innerHTML = _e), + e.insertBefore( + i, + document.getElementById('CMMissingUpgradesTitle').nextSibling, + ); + } + if (Xe) { + const t = Xe.match(new RegExp('div', 'g') || 0).length / 2, + o = document.createElement('div'); + (o.id = 'CMMissingUpgradesCookiesTitle'), (o.className = 'listing'); + const n = document.createElement('div'); + (n.innerHTML = `Missing Cookie upgrades: ${t}/${ + Game.UpgradesByPool.cookie.length + } (${Math.floor((t / Game.UpgradesByPool.cookie.length) * 100)}%)`), + o.appendChild(n), + e.appendChild(o); + const i = document.createElement('div'); + (i.className = 'listing crateBox'), (i.innerHTML = Xe), e.appendChild(i); + } + } + }), + e.MissingAchievements && + (function () { + let t; + Object.values(document.querySelectorAll('div.title')).forEach((e) => { + e.textContent.includes('Achievements') && + (t = e.parentElement.querySelectorAll('div.listing.crateBox')[0]); + }), + e.MissingAchievements && + Object.values(t.children).forEach((e) => { + if (!e.className.includes('enabled')) { + const t = e.onclick.toString().split(/\[(.*)\]/gi)[1], + { icon: o } = Game.AchievementsById[t]; + (e.style.backgroundPosition = `${48 * -o[0]}px ${48 * -o[1]}px`), + (e.onmouseover = function () { + Game.mouseDown || + (Game.setOnCrate(this), + (Game.tooltip.dynamic = 1), + Game.tooltip.draw( + this, + () => + (function (e) { + const t = []; + 'shadow' === e.pool + ? t.push('Shadow Achievement', '#9700cf') + : t.push('Achievement', 0), + t.push('Locked', 0); + let o = 0; + (Game.Has('Neuromancy') || (Game.sesame && 'debug' === e.pool)) && + (o = 1), + o && 0 === e.won + ? t.push('Click to win!', '#00c462') + : o && e.won > 0 && t.push('Click to lose!', '#00c462'); + let { icon: n } = e; + e.iconFunction && (n = e.iconFunction()); + let { desc: i } = e; + e.descFunc && (i = e.descFunc('stats')); + let a = ''; + for (let e = 0; e < t.length; e += 2) + e % 2 == 0 && + (a += `
[${t[e]}]
`); + return ( + (a = a.substring(1)), + `
\n
\n
${ + e.name + }
\n ${a}
${i}
\n ${ + Game.sesame + ? `
Id : ${ + e.id + } | Order : ${Math.floor(e.order)}${ + e.tier ? ` | Tier : ${e.tier}` : '' + }
` + : '' + }` + ); + })(Game.AchievementsById[t]), + 'top', + ), + Game.tooltip.wobble()); + }); + } + }); + })(); + } + const Yn = { + Favourite: 'Favourite Settings', + Calculation: 'Calculation', + Notation: 'Notation', + Colours: 'Colours and colour coding', + BarsDisplay: 'Infobars and visual settings', + Tooltip: 'Tooltips', + Statistics: 'Statistics', + Notification: 'Notifications', + Miscellaneous: 'Miscellaneous', + }, + Kn = { + NotificationGeneral: 'General Notifications', + NotificationGC: 'Golden Cookie', + NotificationFC: 'Fortune Cookie', + NotificationSea: 'Season Special', + NotificationGard: 'Garden Tick', + NotificationMagi: 'Full Magic Bar', + NotificationWrink: 'Wrinkler', + NotificationWrinkMax: 'Maximum Wrinklers', + }; + function Jn(t, o) { + const n = document.createElement('div'); + (n.className = 'title'), + (n.style.opacity = '0.7'), + (n.style.fontSize = '17px'), + n.appendChild(document.createTextNode(`${o} `)); + const i = document.createElement('span'); + return ( + (i.style.cursor = 'pointer'), + (i.style.display = 'inline-block'), + (i.style.height = '14px'), + (i.style.width = '14px'), + (i.style.borderRadius = '7px'), + (i.style.textAlign = 'center'), + (i.style.backgroundColor = '#C0C0C0'), + (i.style.color = 'black'), + (i.style.fontSize = '13px'), + (i.style.verticalAlign = 'middle'), + (i.textContent = e.Header[t] ? '-' : '+'), + (i.onclick = function () { + Vn(t), Game.UpdateMenu(); + }), + n.appendChild(i), + n + ); + } + function Zn(t) { + const o = document.createElement('div'); + if ( + ((o.className = 'listing'), + 1 === e.FavouriteSettings && + o.appendChild( + (function (e) { + const t = document.createElement('a'); + return ( + lo.includes(e) + ? ((t.innerText = '★'), (t.style.color = 'yellow')) + : (t.innerText = '☆'), + (t.className = 'option'), + (t.onclick = function () { + !(function (e) { + lo.includes(e) ? (lo = lo.filter((t) => t !== e)) : lo.push(e); + })(e), + Ln(), + Game.UpdateMenu(); + }), + (t.onmouseover = function () { + Game.tooltip.draw(this, escape(Ut.FavouriteSettingPlaceholder.innerHTML)); + }), + (t.onmouseout = function () { + Game.tooltip.hide(); + }), + t.appendChild(document.createTextNode(' ')), + t + ); + })(t), + ), + 'bool' === wn[t].type) + ) { + const n = document.createElement('a'); + wn[t].toggle && 0 === e[t] ? (n.className = 'option off') : (n.className = 'option'), + (n.id = In + t), + (n.onclick = function () { + !(function (t) { + (e[t] += 1), + e[t] === wn[t].label.length + ? ((e[t] = 0), wn[t].toggle && (l(In + t).className = 'option off')) + : (l(In + t).className = 'option'), + void 0 !== wn[t].func && wn[t].func(), + Ln(); + })(t), + Game.UpdateMenu(); + }), + (n.textContent = wn[t].label[e[t]]), + o.appendChild(n); + const i = document.createElement('label'); + return (i.textContent = wn[t].desc), (i.style.lineHeight = '1.6'), o.appendChild(i), o; + } + if ('vol' === wn[t].type) { + const n = document.createElement('div'); + n.className = 'sliderBox'; + const i = document.createElement('div'); + (i.style.float = 'left'), (i.innerHTML = wn[t].desc), n.appendChild(i); + const a = document.createElement('div'); + (a.id = `slider${t}right`), + (a.style.float = 'right'), + (a.innerHTML = `${e[t]}%`), + n.appendChild(a); + const r = document.createElement('input'); + (r.className = 'slider'), + (r.id = `slider${t}`), + (r.style.clear = 'both'), + (r.type = 'range'), + (r.min = '0'), + (r.max = '100'), + (r.step = '1'), + (r.value = e[t]), + (r.oninput = function () { + zn(t), Game.UpdateMenu(); + }), + (r.onchange = function () { + zn(t), Game.UpdateMenu(); + }), + n.appendChild(r), + o.appendChild(n); + const l = document.createElement('a'); + return ( + (l.className = 'option'), + (l.onclick = function () { + En(e[t.replace('Volume', 'SoundURL')], t.replace('Volume', 'Sound'), t, !0); + }), + (l.textContent = 'Test sound'), + o.appendChild(l), + o + ); + } + if ('url' === wn[t].type) { + const n = document.createElement('span'); + (n.className = 'option'), + (n.textContent = `${wn[t].label} `), + (n.style.lineHeight = '1.6'), + o.appendChild(n); + const i = document.createElement('input'); + (i.id = In + t), + (i.className = 'option'), + (i.type = 'text'), + (i.readOnly = !0), + i.setAttribute('value', e[t]), + (i.style.width = '300px'), + o.appendChild(i), + o.appendChild(document.createTextNode(' ')); + const a = document.createElement('input'); + (a.id = `${In + t}Prompt`), + (a.className = 'option'), + (a.type = 'text'), + a.setAttribute('value', e[t]); + const r = document.createElement('a'); + (r.className = 'option'), + (r.onclick = function () { + !(function (e, t) { + Game.promptWrapL.className = 'framed'; + const o = e; + (Game.promptL.innerHTML = `${o}
`), + Object.keys(t).forEach((e) => { + const o = document.createElement('a'); + (o.id = `promptOption${e}`), + (o.className = 'option'), + (o.onclick = function () { + PlaySound('snd/tick.mp3'), t[e][1](); + }), + (o.textContent = t[e][0]), + Game.promptL.children[1].appendChild(o); + }), + (Game.promptAnchorL.style.display = 'block'), + (Game.darkenL.style.display = 'block'), + Game.promptL.focus(), + (Game.promptOn = 1), + Game.UpdatePrompt(); + })(a.outerHTML, [ + [ + 'Save', + function () { + (e[t] = l(`CMConfig${t}Prompt`).value), + Ln(), + Game.ClosePrompt(), + Game.UpdateMenu(); + }, + ], + [ + 'Cancel', + function () { + Game.ClosePrompt(); + }, + ], + ]); + }), + (r.textContent = 'Edit'), + o.appendChild(r); + const s = document.createElement('label'); + return (s.textContent = wn[t].desc), (s.style.lineHeight = '1.6'), o.appendChild(s), o; + } + if ('colour' === wn[t].type) { + const n = document.createElement('span'); + n.className = 'option'; + const i = document.createElement('input'); + (i.id = t), + (i.style.width = '65px'), + i.setAttribute('value', e[t]), + n.appendChild(i), + new $n(i, { + hash: !0, + position: 'right', + onInput: function () { + (e[this.targetElement.id] = this.toHEXString()), Fn(), Ln(), Game.UpdateMenu(); + }, + }); + const a = document.createElement('label'); + if ( + ((a.textContent = wn[t].desc), + (a.style.lineHeight = '1.6'), + n.appendChild(a), + t.includes('Flash')) + ) { + const e = document.createElement('a'); + (e.className = 'option'), + (e.onclick = function () { + Pn(3, t.replace('Colour', ''), !0); + }), + (e.textContent = 'Test flash'), + n.appendChild(e); + } + return o.appendChild(n), Rn().init(), o; + } + if ('numscale' === wn[t].type) { + const n = document.createElement('span'); + (n.className = 'option'), + (n.textContent = `${wn[t].label} `), + (n.style.lineHeight = '1.6'), + o.appendChild(n); + const i = document.createElement('input'); + (i.id = In + t), + (i.className = 'option'), + (i.type = 'number'), + (i.value = e[t]), + (i.min = wn[t].min), + (i.max = wn[t].max), + (i.oninput = function () { + (e[t] = this.value), Ln(), fn(), Game.UpdateMenu(); + }), + o.appendChild(i), + o.appendChild(document.createTextNode(' ')); + const a = document.createElement('label'); + return (a.textContent = wn[t].desc), (a.style.lineHeight = '1.6'), o.appendChild(a), o; + } + return o; + } + function ei(t) { + if (1 === e.TimerBar && 0 === e.TimerBarPos) { + const e = parseInt(l('CMTimerBar').style.height, 10); + (Game.mouseY -= e), t(), (Game.mouseY += e); + } else t(); + } + function ti() { + (M.Beautify = Beautify), + (Beautify = P), + (M.CalculateGains = Game.CalculateGains), + (Game.CalculateGains = function () { + M.CalculateGains(), (se = 1), (S = Date.now()), (B = Date.now()); + }), + (M.tooltip = {}), + (M.tooltip.draw = Game.tooltip.draw), + (M.tooltip.drawMod = new Function( + `return ${Game.tooltip.draw.toString().split('this').join('Game.tooltip')}`, + )()), + (Game.tooltip.draw = function (e, t, o) { + M.tooltip.drawMod(e, t, o); + }), + (M.tooltip.update = Game.tooltip.update), + (M.tooltip.updateMod = new Function( + `return ${Game.tooltip.update.toString().split('this.').join('Game.tooltip.')}`, + )()), + (Game.tooltip.update = function () { + M.tooltip.updateMod(), + (function () { + if ('store' === Game.tooltip.origin) { + let t = 0; + 1 === e.ToolWarnLucky && + 1 === e.ToolWarnPos && + null !== l('CMDispTooltipWarningParent') && + (t = l('CMDispTooltipWarningParent').clientHeight - 4), + (Game.tooltip.tta.style.top = `${Math.min( + parseInt(Game.tooltip.tta.style.top, 10), + l('game').clientHeight + + l('topBar').clientHeight - + Game.tooltip.tt.clientHeight - + t - + 46, + )}px`); + } + })(); + }), + (M.UpdateWrinklers = Game.UpdateWrinklers), + (Game.UpdateWrinklers = function () { + ei(M.UpdateWrinklers); + }), + (M.UpdateSpecial = Game.UpdateSpecial), + (Game.UpdateSpecial = function () { + ei(M.UpdateSpecial); + }), + l('bigCookie').removeEventListener('click', Game.ClickCookie, !1), + l('bigCookie').addEventListener( + 'click', + () => { + ei(Game.ClickCookie); + }, + !1, + ), + (M.RebuildUpgrades = Game.RebuildUpgrades), + (Game.RebuildUpgrades = function () { + M.RebuildUpgrades(), + (T = []), + Object.keys(Game.UpgradesInStore).forEach((e) => { + null !== l(`upgrade${e}`).onmouseover && + ((T[e] = l(`upgrade${e}`).onmouseover), + (l(`upgrade${e}`).onmouseover = function () { + Game.mouseDown || + (Game.setOnCrate(this), + (Game.tooltip.dynamic = 1), + Game.tooltip.draw(this, () => jn('u', `${e}`), 'store'), + Game.tooltip.wobble()); + })); + }), + Game.CalculateGains(); + }), + (M.ClickProduct = Game.ClickProduct), + (Game.ClickProduct = function (t) { + (!e.BulkBuyBlock || + Game.ObjectsById[t].bulkPrice < Game.cookies || + -1 === Game.buyMode) && + M.ClickProduct(t); + }), + (M.DescribeDragonAura = Game.DescribeDragonAura), + (Game.DescribeDragonAura = function (t) { + M.DescribeDragonAura(t), + (function (t) { + if (1 === e.DragonAuraInfo) { + const [e, o] = (function (e) { + So(), + l('promptContent').children[0].innerHTML.includes('secondary') + ? (ie = e) + : (ne = e); + let t = 0; + if (ne !== me || ie !== he) + for (let e = Game.ObjectsById.length - 1; e > -1; --e) + if (Game.ObjectsById[e].amount > 0) { + const o = Ct[Game.ObjectsById[e].name].name; + (Ct[o].amount -= 1), + (K -= 1), + (t = + Ct[o].basePrice * + Game.priceIncrease ** Math.max(0, Ct[o].amount - 1 - Ct[o].free)), + (t = Game.modifyBuildingPrice(Ct[o], t)), + (t = Math.ceil(t)); + break; + } + const o = ee; + return Fo(), Uo(), o !== ee && Fo(), [de - Game.cookiesPs, t]; + })(t), + n = uo(o / (e + Game.cookiesPs)); + let i; + (i = 0 === Game.cookiesPs ? P(1 / 0) : P((e / Game.cookiesPs) * 100)), + (l('dragonAuraInfo').style.minHeight = '60px'), + (l('dragonAuraInfo').style.margin = '8px'), + (l('dragonAuraInfo').appendChild(document.createElement('div')).className = + 'line'); + const a = document.createElement('div'); + (a.style.minWidth = '200px'), + (a.style.textAlign = 'center'), + (a.textContent = `Picking this aura will change CPS by ${P( + e, + )} (${i}% of current CPS).`), + l('dragonAuraInfo').appendChild(a); + const r = document.createElement('div'); + (r.style.minWidth = '200px'), + (r.style.textAlign = 'center'), + (r.textContent = `It will take ${n} to recover the cost.`), + l('dragonAuraInfo').appendChild(r); + } + })(t); + }), + (M.ToggleSpecialMenu = Game.ToggleSpecialMenu), + (Game.ToggleSpecialMenu = function (e) { + M.ToggleSpecialMenu(e), + (function () { + if ( + null !== + (l('specialPopup').className.match(/onScreen/) && + l('specialPopup').children[0].style.background.match(/dragon/)) + ) + for (let e = 0; e < l('specialPopup').childNodes.length; e++) + 'optionBox' === l('specialPopup').childNodes[e].className && + ((l('specialPopup').children[e].onmouseover = function () { + Tn(), + (Game.tooltip.dynamic = 1), + Game.tooltip.draw( + l('specialPopup'), + `
${fe}
`, + 'this', + ), + Game.tooltip.wobble(); + }), + (l('specialPopup').children[e].onmouseout = function () { + Game.tooltip.shouldHide = 1; + })); + })(); + }), + (M.UpdateMenu = Game.UpdateMenu), + (Game.UpdateMenu = function () { + (void 0 !== Rn().picker && void 0 !== Rn().picker.owner) || + (M.UpdateMenu(), + (function () { + const t = document.createElement('div'); + (t.className = 'title'), + 'prefs' === Game.onMenu + ? ((t.textContent = 'Cookie Monster Settings'), + (function (t) { + const o = document.createDocumentFragment(); + o.appendChild(t), + Object.keys(Yn).forEach((t) => { + if ('Favourite' === t) { + if ( + 0 !== lo.length && + e.FavouriteSettings > 0 && + (o.appendChild(Jn(t, Yn[t])), e.Header[t]) + ) + for (let e = 0; e < lo.length; e++) o.appendChild(Zn(lo[e])); + } else + o.appendChild(Jn(t, Yn[t])), + e.Header[t] && + ('Notification' === t + ? Object.keys(Kn).forEach((t) => { + const n = Jn(t, Kn[t]); + (n.style.fontSize = '15px'), + (n.style.opacity = '0.5'), + o.appendChild(n), + e.Header[t] && + Object.keys(wn).forEach((e) => { + wn[e].group === t && o.appendChild(Zn(e)); + }); + }) + : Object.keys(wn).forEach((e) => { + wn[e].group === t && o.appendChild(Zn(e)); + })); + }); + const n = document.createElement('div'); + n.className = 'listing'; + const i = document.createElement('a'); + (i.className = 'option'), + (i.onclick = function () { + Wn(mn); + }), + (i.textContent = 'Restore Default'), + n.appendChild(i), + o.appendChild(n), + l('menu').childNodes[2].insertBefore( + o, + l('menu').childNodes[2].childNodes[ + l('menu').childNodes[2].childNodes.length - 1 + ], + ); + })(t)) + : 'stats' === Game.onMenu + ? e.Stats && ((t.textContent = 'Cookie Monster Statistics'), qn(t)) + : 'log' === Game.onMenu && + ((t.textContent = 'Cookie Monster '), + (function (t) { + const o = document.createElement('div'); + o.className = 'subsection'; + const n = document.createElement('span'); + if ( + ((n.style.cursor = 'pointer'), + (n.style.display = 'inline-block'), + (n.style.height = '14px'), + (n.style.width = '14px'), + (n.style.borderRadius = '7px'), + (n.style.textAlign = 'center'), + (n.style.backgroundColor = '#C0C0C0'), + (n.style.color = 'black'), + (n.style.fontSize = '13px'), + (n.style.verticalAlign = 'middle'), + (n.textContent = e.Header.InfoTab ? '-' : '+'), + (n.onclick = function () { + Vn('InfoTab'), Game.UpdateMenu(); + }), + t.appendChild(n), + o.appendChild(t), + e.Header.InfoTab) + ) { + const e = document.createElement('div'); + (e.innerHTML = + '
\n Cookie Monster\n offers a wide range of tools and statistics to enhance your game experience.\n 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.
\n Progess on new updates and all previous release notes can be found on the GitHub page linked above!
\n Please also report any bugs you may find over there!
\n
\n '), + o.appendChild(e); + const t = document.createElement('div'); + (t.innerHTML = + "
\nThese are the release notes for the latest update (v 2.031.7).
\n
\nThis update implements the following functions:
\n- Updated the ordering and description of all settings of Cookie Monster
\n- Colours of Flash notifications can now be set by the user
\n- You can now select a number of settings to be your 'favourite'. They will be displayed at the top of all other settings in a new section. This functionality is toggleable and you can find it in the miscellaneous section
\n- The statistics page now shows cookies earned by clicking for a selected time period
\n- The statistics page can now show missing normal achievements, this can be toggled in the settings
\n
\nThis update fixes the following bugs:
\n- Fixed some typo's
\n- No longer show the wrinkler pop buttons when wrinklers can't spawn
\n- Fixed incorrect calculation of plant maturity for relevant tooltips
\n- Fixed edit prompts not working in settings
\n- Fixed red and purple being switched around for PP colour coding
\n- Fixed incorrect notation of numbers in Dragon tooltip and interface
\n- Fixed incorrect calculation of changing Dragon aura cost
\n- Fixed incorrect calculation of changing Pantheon gods effect
\n- Fixed fluctuating PP values when god Cyclius was selected
\n- Fixed black flickering when Golden Cookies or buffs start
\n
\n"), + o.appendChild(t); + } + const i = l('menu').children[1]; + i.insertBefore(o, i.children[1]); + })(t)); + })()); + }), + (M.sayTime = Game.sayTime), + (Vt = function (e, t) { + return Number.isNaN(e) || e <= 0 ? M.sayTime(e, t) : uo(e / Game.fps, 1); + }), + (M.Logic = Game.Logic), + (Game.Logic = function () { + M.Logic(); + let t = 'Cookie Clicker'; + 'fools' === Game.season && (t = 'Cookie Baker'), + (ro = `${Game.OnAscend ? 'Ascending! ' : ''}${P(Game.cookies)} ${ + 1 === Game.cookies ? 'cookie' : 'cookies' + } - ${t}`), + (function () { + if (Game.OnAscend || 0 === e.Title) document.title = ro; + else if (1 === e.Title) { + let e, + t, + o, + n = !1, + i = !1; + (e = ct + ? ct.wrath + ? `[W${Math.ceil(ct.life / Game.fps)}]` + : `[G${Math.ceil(ct.life / Game.fps)}]` + : Game.Has('Golden switch [off]') + ? '[GS]' + : `[${Number(l('CMTimerBarGCMinBar').textContent) < 0 ? '!' : ''}${Math.ceil( + (Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / + Game.fps, + )}]`), + f && ((n = !0), (t = '[F]')), + 'christmas' === Game.season && + ((i = !0), + (o = g + ? `[R${Math.ceil(dt.life / Game.fps)}]` + : `[${ + Number(l('CMTimerBarRenMinBar').textContent) < 0 ? '!' : '' + }${Math.ceil( + (Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / + Game.fps, + )}]`)); + let a = ro; + '[' === a.charAt(0) && (a = a.substring(a.lastIndexOf(']') + 1)), + (document.title = `${e + (n ? t : '') + (i ? o : '')} ${a}`); + } else if (2 === e.Title) { + let e = '', + t = !1; + ct && + ((t = !0), + ct.wrath + ? (e += `[W${Math.ceil(ct.life / Game.fps)}]`) + : (e += `[G${Math.ceil(ct.life / Game.fps)}]`)), + f && ((t = !0), (e += '[F]')), + 'christmas' === Game.season && + g && + ((e += `[R${Math.ceil(dt.life / Game.fps)}]`), (t = !0)), + t && (e += ' - '); + let o = 'Cookie Clicker'; + 'fools' === Game.season && (o = 'Cookie Baker'), (e += o), (document.title = e); + } + })(), + (function () { + const t = Math.max( + 0, + Game.HowManyCookiesReset( + Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + 1, + ) - + (Game.cookiesEarned + Game.cookiesReset), + ), + o = Game.sayTime(((Date.now() - Game.startDate) / 1e3) * Game.fps, -1); + let n = ''; + (n += `You've been on this run for ${'' === o ? 'not very long' : o}.
`), + (n += '
'), + Game.prestige > 0 && + ((n += `Your prestige level is currently ${P( + Game.prestige, + )}.
(CpS +${P(Game.prestige)}%)`), + (n += '
')), + (n += + X < 1 + ? 'Ascending now would grant you no prestige.' + : X < 2 + ? 'Ascending now would grant you
1 prestige level (+1% CpS)
and 1 heavenly chip to spend.' + : `Ascending now would grant you
${P(X)} prestige levels (+${P( + X, + )}% CpS)
and ${P(X)} heavenly chips to spend.`), + (n += '
'), + (n += `You need ${P(t)} more cookies for the next level.
`), + (n += e.TooltipAscendButton + ? `
It takes ${pt} to reach the next level and you were making ${P( + Ne, + 2, + )} chips on average in the last 5 seconds.
` + : ''), + (l('ascendTooltip').innerHTML = n); + })(); + }); + } + function oi() { + Sn(), + sn(), + un(), + (r = Object.keys(Game.mods).length), + (ue = document.createElement('style')), + (ue.type = 'text/css'), + (ue.id = 'CMCSS'), + document.head.appendChild(ue), + (function () { + const e = document.createElement('div'); + (e.id = 'CMBotBar'), + (e.style.height = '69px'), + (e.style.width = '100%'), + (e.style.position = 'absolute'), + (e.style.display = 'none'), + (e.style.backgroundColor = '#262224'), + (e.style.backgroundImage = 'linear-gradient(to bottom, #4d4548, #000000)'), + (e.style.borderTop = '1px solid black'), + (e.style.overflow = 'auto'), + (e.style.textShadow = '-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black'); + const t = e.appendChild(document.createElement('table')); + (t.style.width = '100%'), + (t.style.textAlign = 'center'), + (t.style.whiteSpace = 'nowrap'); + const o = t.appendChild(document.createElement('tbody')), + n = function (e, t) { + const o = document.createElement('td'); + return ( + (o.style.textAlign = 'right'), (o.className = St + t), (o.textContent = e), o + ); + }, + i = o.appendChild(document.createElement('tr')); + (i.style.fontWeight = 'bold'), + i.appendChild(n('CM 2.031.7', Nt)), + o.appendChild(document.createElement('tr')).appendChild(n('Bonus Income', Pt)), + o.appendChild(document.createElement('tr')).appendChild(n('Payback Period', Pt)), + o.appendChild(document.createElement('tr')).appendChild(n('Time Left', Pt)), + l('wrapper').appendChild(e), + Object.keys(Game.Objects).forEach((e) => { + Co(e); + }); + })(), + (function () { + const e = document.createElement('div'); + (e.id = 'CMTimerBar'), + (e.style.position = 'absolute'), + (e.style.display = 'none'), + (e.style.height = '0px'), + (e.style.fontSize = '10px'), + (e.style.fontWeight = 'bold'), + (e.style.backgroundColor = 'black'); + const t = fo('CMTimerBarGC', 'Next Cookie', [ + { id: 'CMTimerBarGCMinBar', color: Wt }, + { id: 'CMTimerBarGCBar', color: Lt }, + ]); + e.appendChild(t); + const o = fo('CMTimerBarRen', 'Next Reindeer', [ + { id: 'CMTimerBarRenMinBar', color: Wt }, + { id: 'CMTimerBarRenBar', color: Ot }, + ]); + e.appendChild(o); + const n = document.createElement('div'); + (n.id = 'CMTimerBarBuffTimers'), e.appendChild(n), l('wrapper').appendChild(e); + })(), + (function () { + const e = document.createElement('div'); + (e.id = 'CMUpgradeBar'), + (e.style.width = '100%'), + (e.style.backgroundColor = 'black'), + (e.style.textAlign = 'center'), + (e.style.fontWeight = 'bold'), + (e.style.display = 'none'), + (e.style.zIndex = '21'), + (e.onmouseout = function () { + Game.tooltip.hide(); + }); + const t = document.createElement('div'); + t.appendChild( + (function () { + const e = document.createElement('div'); + (e.style.minWidth = '330px'), (e.style.marginBottom = '4px'); + const t = document.createElement('div'); + (t.className = 'name'), + (t.style.marginBottom = '4px'), + (t.textContent = 'Legend'), + e.appendChild(t); + const o = function (e, t) { + const o = document.createElement('div'); + o.style.verticalAlign = 'middle'; + const n = document.createElement('span'); + return ( + (n.className = Bt + e), + (n.style.display = 'inline-block'), + (n.style.height = '10px'), + (n.style.width = '10px'), + (n.style.marginRight = '4px'), + o.appendChild(n), + o.appendChild(document.createTextNode(t)), + o + ); + }; + return ( + e.appendChild(o(Pt, 'Better than the best PP of a building option')), + e.appendChild(o(Et, 'Same as the best PP building option')), + e.appendChild(o(Nt, 'Within the top 10 of PP for buildings')), + e.appendChild(o(Ot, 'Within the top 20 of PP for buildings')), + e.appendChild(o(Ft, 'Within the top 30 of PP for buildings')), + e.appendChild(o(Lt, 'Outside of the top 30 of PP for buildings')), + e.appendChild(o(Wt, 'Negative or infinity PP')), + e + ); + })(), + ), + (e.onmouseover = function () { + Game.tooltip.draw(this, escape(t.innerHTML), 'store'); + }); + const o = function (e, t) { + const o = document.createElement('span'); + return ( + (o.id = e), + (o.className = St + t), + (o.style.width = '14.28571428571429%'), + (o.style.display = 'inline-block'), + (o.textContent = '0'), + o + ); + }; + e.appendChild(o('CMUpgradeBarBlue', Pt)), + e.appendChild(o('CMUpgradeBarGreen', Et)), + e.appendChild(o('CMUpgradeBarYellow', Nt)), + e.appendChild(o('CMUpgradeBarOrange', Ot)), + e.appendChild(o('CMUpgradeBarRed', Ft)), + e.appendChild(o('CMUpgradeBarPurple', Lt)), + e.appendChild(o('CMUpgradeBarGray', Wt)), + l('upgrades').parentNode.insertBefore(e, l('upgrades').parentNode.childNodes[3]); + })(), + (function () { + const e = document.createElement('div'); + (e.id = 'CMFlashScreen'), + (e.style.width = '100%'), + (e.style.height = '100%'), + (e.style.backgroundColor = 'white'), + (e.style.display = 'none'), + (e.style.zIndex = '9999999999'), + (e.style.position = 'absolute'), + l('wrapper').appendChild(e); + })(), + (function () { + const e = document.createElement('div'); + (e.id = 'CMSectionHidButtons'), (e.style.textAlign = 'center'); + const t = document.createElement('a'); + (t.className = 'option'), + (t.onclick = function () { + 'flex' === l('upgrades').style.display + ? ((l('upgrades').style.display = 'none'), + (l('toggleUpgrades').style.display = 'none'), + (l('techUpgrades').style.display = 'none'), + (l('vaultUpgrades').style.display = 'none')) + : ((l('upgrades').style.display = 'flex'), + 0 !== l('toggleUpgrades').children.length && + (l('toggleUpgrades').style.display = 'block'), + 0 !== l('techUpgrades').children.length && + (l('techUpgrades').style.display = 'block'), + 0 !== l('vaultUpgrades').children.length && + (l('vaultUpgrades').style.display = 'block')); + }), + (t.textContent = 'Hide/Show Upgrades'), + e.appendChild(t); + const o = document.createElement('a'); + (o.className = 'option'), + (o.onclick = function () { + 'grid' === l('products').style.display + ? (l('products').style.display = 'none') + : (l('products').style.display = 'grid'); + }), + (o.textContent = 'Hide/Show Buildings'), + e.appendChild(o), + l('store').insertBefore(e, l('store').childNodes[2]); + })(), + (function () { + const e = document.createElement('link'); + (e.id = 'CMFavicon'), + (e.rel = 'shortcut icon'), + (e.href = 'https://orteil.dashnet.org/cookieclicker/favicon.ico'), + document.getElementsByTagName('head')[0].appendChild(e); + })(), + Object.keys(Ht).forEach((e) => { + !(function (e, t, o) { + const n = document.createElement('div'); + n.id = e; + const i = document.createElement('div'); + (i.style.minWidth = o), (i.style.marginBottom = '4px'); + const a = document.createElement('div'); + (a.style.textAlign = 'left'), + (a.textContent = t), + i.appendChild(a), + n.appendChild(i), + (Ut[e] = n); + })(Ht[e][0], Ht[e][1], Ht[e][2]); + }), + (function () { + const e = document.createElement('a'); + (e.id = 'PopAllNormalWrinklerButton'), + (e.textContent = 'Pop All Normal'), + (e.className = 'option'), + (e.onclick = function () { + An(); + }), + (e.onmouseout = function () { + Game.tooltip.shouldHide = 1; + }), + (e.onmouseover = function () { + (Game.tooltip.dynamic = 1), + Game.tooltip.draw(this, () => jn('wb', 'PopAll'), 'this'), + Game.tooltip.wobble(); + }), + l('sectionLeftExtra').children[0].append(e); + const t = document.createElement('a'); + (t.id = 'PopFattestWrinklerButton'), + (t.textContent = 'Pop Single Fattest'), + (t.className = 'option'), + (t.onclick = function () { + null !== $e[1] && (Game.wrinklers[$e[1]].hp = 0); + }), + (t.onmouseout = function () { + Game.tooltip.shouldHide = 1; + }), + (t.onmouseover = function () { + (Game.tooltip.dynamic = 1), + Game.tooltip.draw(this, () => jn('wb', 'PopFattest'), 'this'), + Game.tooltip.wobble(); + }), + l('sectionLeftExtra').children[0].append(t); + })(), + (l('products').style.display = 'grid'), + (l('storeBulk').style.gridRow = '1/1'), + (l('upgrades').style.display = 'flex'), + (l('upgrades').style['flex-wrap'] = 'wrap'), + Object.keys(Game.Objects).forEach((e) => { + const t = Game.Objects[e]; + null !== l(`product${t.id}`).onmouseover && + ((w[e] = l(`product${t.id}`).onmouseover), + (l(`product${t.id}`).onmouseover = function () { + (Game.tooltip.dynamic = 1), + Game.tooltip.draw(this, () => jn('b', `${e}`), 'store'), + Game.tooltip.wobble(); + })); + }), + Game.canLumps() && + ((s = l('lumps').onmouseover), + (l('lumps').onmouseover = function () { + (Game.tooltip.dynamic = 1), + Game.tooltip.draw(this, () => jn('s', 'Lump'), 'this'), + Game.tooltip.wobble(); + })), + (h = Game.LoadMinigames), + (Game.LoadMinigames = function () { + h(), + Game.Objects.Farm.minigameLoaded && + ((l('gardenTool-1').onmouseover = function () { + (Game.tooltip.dynamic = 1), + Game.tooltip.draw(this, () => jn('ha', 'HarvestAllButton'), 'this'), + Game.tooltip.wobble(); + }), + Array.from(l('gardenPlot').children).forEach((e) => { + const t = e.id.slice(-3); + e.onmouseover = function () { + (Game.tooltip.dynamic = 1), + Game.tooltip.draw(this, () => jn('p', [`${t[0]}`, `${t[2]}`]), 'this'), + Game.tooltip.wobble(); + }; + })), + Dn(), + (function () { + if (Game.Objects.Temple.minigameLoaded) { + for (let e = 0; e < 11; e += 1) + l(`templeGod${e}`).onmouseover = function () { + (Game.tooltip.dynamic = 1), + Game.tooltip.draw(this, () => jn('pag', e), 'this'), + Game.tooltip.wobble(); + }; + for (let e = 0; e < 3; e += 1) + l(`templeSlot${e}`).onmouseover = function () { + (Game.tooltip.dynamic = 1), + Game.tooltip.draw( + this, + () => jn('pas', [e, Game.Objects.Temple.minigame.slot[e]]), + 'this', + ), + Game.tooltip.wobble(); + }; + } + })(), + Un(); + }), + Game.LoadMinigames(), + (l('backgroundLeftCanvas').onmouseover = function () { + Rt = 1; + }), + (l('backgroundLeftCanvas').onmouseout = function () { + (Rt = 0), + Game.tooltip.hide(), + Object.keys(Game.wrinklers).forEach((e) => { + zt[e] = 0; + }); + }), + ti(), + Un(), + Game.CalculateGains(), + Wn(), + ($t = Game.OnAscend), + Game.prefs.popups + ? Game.Popup('Cookie Monster version 2.031.7 loaded!') + : Game.Notify('Cookie Monster version 2.031.7 loaded!', '', '', 1, 1), + Game.Win('Third-party'); + } + const ni = { + init: function () { + Bn = !0; + let e = !0; + Game.version !== Number('2.031') && + (e = confirm( + 'Cookie Monster version 2.031.7 is meant for Game version 2.031. Loading a different version may cause errors. Do you still want to load Cookie Monster?', + )), + e && + (oi(), + Game.registerHook('click', _o), + Game.registerHook('draw', Vo), + Game.registerHook('logic', On), + (Bn = !1)); + }, + load: function (e) { + const t = JSON.parse(e); + Sn(), + void 0 !== t.favouriteSettings && (lo = t.favouriteSettings), + Wn(t.settings), + '2.031.7' !== t.version && + (Game.prefs.popups + ? Game.Popup( + 'A new version of Cookie Monster has been loaded, check out the release notes in the info tab!', + ) + : Game.Notify( + 'A new version of Cookie Monster has been loaded, check out the release notes in the info tab!', + '', + '', + 0, + 1, + )); + }, + save: xn, + }; + Game.registerMod('CookieMonster', ni); + })(); +})(); diff --git a/src/Cache/CPS/AverageQueue.js b/src/Cache/CPS/AverageQueue.js index ab2f4eb..76f3ede 100644 --- a/src/Cache/CPS/AverageQueue.js +++ b/src/Cache/CPS/AverageQueue.js @@ -37,11 +37,7 @@ export class CMAvgQueue { if (time > this.maxLength) time = this.maxLength; if (time > this.queue.length) time = this.queue.length; let ret = 0; - for ( - let i = this.queue.length - 1; - i >= 0 && i > this.queue.length - 1 - time; - i-- - ) { + for (let i = this.queue.length - 1; i >= 0 && i > this.queue.length - 1 - time; i--) { ret += this.queue[i]; } if (ret === 0) { diff --git a/src/Cache/CPS/CPS.js b/src/Cache/CPS/CPS.js index 33c69c3..db3b33a 100644 --- a/src/Cache/CPS/CPS.js +++ b/src/Cache/CPS/CPS.js @@ -45,11 +45,9 @@ export default function CacheAvgCPS() { // Add recent gains to AvgQueue's const timeDiff = currDate - CacheLastCPSCheck; const bankDiffAvg = Math.max(0, Game.cookies - CacheLastCookies) / timeDiff; - const wrinkDiffAvg = - Math.max(0, CacheWrinklersTotal - CacheLastWrinkCookies) / timeDiff; + const wrinkDiffAvg = Math.max(0, CacheWrinklersTotal - CacheLastWrinkCookies) / timeDiff; const wrinkFattestDiffAvg = - Math.max(0, CacheWrinklersFattest[0] - CacheLastWrinkFattestCookies) / - timeDiff; + Math.max(0, CacheWrinklersFattest[0] - CacheLastWrinkFattestCookies) / timeDiff; const choEggDiffAvg = Math.max(0, choEggTotal - CacheLastChoEgg) / timeDiff; const clicksDiffAvg = (Game.cookieClicks - CacheLastClicks) / timeDiff; for (let i = 0; i < timeDiff; i++) { @@ -76,22 +74,16 @@ export default function CacheAvgCPS() { CacheAverageGainChoEgg = ChoEggDiff.calcAverage(cpsLength); CacheAverageCPS = CacheAverageGainBank; if (CMOptions.CalcWrink === 1) CacheAverageCPS += CacheAverageGainWrink; - if (CMOptions.CalcWrink === 2) - CacheAverageCPS += CacheAverageGainWrinkFattest; + if (CMOptions.CalcWrink === 2) CacheAverageCPS += CacheAverageGainWrinkFattest; - const choEgg = - Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg'); + const choEgg = Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg'); if (choEgg || CMOptions.CalcWrink === 0) { CacheAvgCPSWithChoEgg = - CacheAverageGainBank + - CacheAverageGainWrink + - (choEgg ? CacheAverageGainChoEgg : 0); + CacheAverageGainBank + CacheAverageGainWrink + (choEgg ? CacheAverageGainChoEgg : 0); } else CacheAvgCPSWithChoEgg = CacheAverageCPS; // eslint-disable-line no-unused-vars // eslint-disable-next-line no-unused-vars - CacheAverageClicks = ClicksDiff.calcAverage( - ClickTimes[CMOptions.AvgClicksHist], - ); + CacheAverageClicks = ClicksDiff.calcAverage(ClickTimes[CMOptions.AvgClicksHist]); } } diff --git a/src/Cache/CPS/CurrWrinklerCPS.js b/src/Cache/CPS/CurrWrinklerCPS.js index f107bec..5bdd4cf 100644 --- a/src/Cache/CPS/CurrWrinklerCPS.js +++ b/src/Cache/CPS/CurrWrinklerCPS.js @@ -1,8 +1,5 @@ import { SimObjects } from '../../Sim/VariablesAndData'; -import { - CacheCurrWrinklerCount, - CacheCurrWrinklerCPSMult, -} from '../VariablesAndData'; +import { CacheCurrWrinklerCount, CacheCurrWrinklerCPSMult } from '../VariablesAndData'; /** * This functions caches the current Wrinkler CPS multiplier diff --git a/src/Cache/CPS/GetCPSBuffMult.js b/src/Cache/CPS/GetCPSBuffMult.js index 88db924..ad89c83 100644 --- a/src/Cache/CPS/GetCPSBuffMult.js +++ b/src/Cache/CPS/GetCPSBuffMult.js @@ -5,8 +5,7 @@ export default function GetCPSBuffMult() { let mult = 1; Object.keys(Game.buffs).forEach((i) => { - 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; } diff --git a/src/Cache/CacheInit.js b/src/Cache/CacheInit.js index a702944..e3d8319 100644 --- a/src/Cache/CacheInit.js +++ b/src/Cache/CacheInit.js @@ -3,23 +3,14 @@ import { CMAvgQueue, InitCookiesDiff } from './CPS/AverageQueue'; import CacheAvgCPS from './CPS/CPS'; import CacheDragonAuras from './Dragon/CacheDragonAuras'; import CachePP from './PP/PP'; -import { - CacheBuildingsPrices, - CacheIncome, -} from './PriceAndIncome/PriceAndIncome'; +import { CacheBuildingsPrices, CacheIncome } from './PriceAndIncome/PriceAndIncome'; import { CacheChain } from './Stats/ChainCookies'; import CacheHeavenlyChipsPS from './Stats/HeavenlyChips'; import CacheAllMissingUpgrades from './Stats/MissingUpgrades'; import CacheSeasonSpec from './Stats/Reindeer'; -import { - CacheGoldenAndWrathCookiesMults, - CacheStatsCookies, -} from './Stats/Stats'; +import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from './Stats/Stats'; import AllAmountTillNextAchievement from './TillNextAchievement/AllAmountTillNextAchievement'; -import { - CacheAverageCookiesFromClicks, - HeavenlyChipsDiff, -} from './VariablesAndData'; +import { CacheAverageCookiesFromClicks, HeavenlyChipsDiff } from './VariablesAndData'; import CacheWrinklers from './Wrinklers/Wrinklers'; /** @@ -36,9 +27,7 @@ export default function InitCache() { InitCookiesDiff(); /** Used by CM.Cache.CacheHeavenlyChipsPS() */ HeavenlyChipsDiff = new CMAvgQueue(5); // eslint-disable-line no-unused-vars - CacheAverageCookiesFromClicks = new CMAvgQueue( // eslint-disable-line no-unused-vars - ClickTimes[ClickTimes.length - 1] * 20, - ); + CacheAverageCookiesFromClicks = new CMAvgQueue(ClickTimes[ClickTimes.length - 1] * 20); // eslint-disable-line no-unused-vars CacheHeavenlyChipsPS(); AllAmountTillNextAchievement(); CacheAvgCPS(); diff --git a/src/Cache/CacheLoop.js b/src/Cache/CacheLoop.js index 9b7d92a..acd798c 100644 --- a/src/Cache/CacheLoop.js +++ b/src/Cache/CacheLoop.js @@ -22,8 +22,7 @@ export default function LoopCache() { const cookiesToNext = Game.HowManyCookiesReset( - Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + - 1, + Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + 1, ) - (Game.cookiesEarned + Game.cookiesReset); CacheTimeTillNextPrestige = FormatTime(cookiesToNext / GetCPS()); // eslint-disable-line no-unused-vars diff --git a/src/Cache/Dragon/Dragon.js b/src/Cache/Dragon/Dragon.js index 740c6c4..d466442 100644 --- a/src/Cache/Dragon/Dragon.js +++ b/src/Cache/Dragon/Dragon.js @@ -3,10 +3,7 @@ import Beautify from '../../Disp/BeautifyAndFormatting/Beautify'; import CopyData from '../../Sim/SimulationData/CopyData'; import { SimDoSims, SimObjects } from '../../Sim/VariablesAndData'; -import { - CacheCostDragonUpgrade, - CacheLastDragonLevel, -} from '../VariablesAndData'; +import { CacheCostDragonUpgrade, CacheLastDragonLevel } from '../VariablesAndData'; /** * This functions caches the current cost of upgrading the dragon level so it can be displayed in the tooltip @@ -17,9 +14,7 @@ export default function CacheDragonCost() { Game.dragonLevel < 25 && Game.dragonLevels[Game.dragonLevel].buy.toString().includes('sacrifice') ) { - let target = Game.dragonLevels[Game.dragonLevel].buy - .toString() - .match(/Objects\[(.*)\]/)[1]; + let target = Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1]; const amount = Game.dragonLevels[Game.dragonLevel].buy .toString() .match(/sacrifice\((.*?)\)/)[1]; @@ -34,10 +29,7 @@ export default function CacheDragonCost() { let price = SimObjects[target].basePrice * Game.priceIncrease ** - Math.max( - 0, - SimObjects[target].amount - 1 - SimObjects[target].free, - ); + Math.max(0, SimObjects[target].amount - 1 - SimObjects[target].free); price = Game.modifyBuildingPrice(SimObjects[target], price); price = Math.ceil(price); cost += price; @@ -58,10 +50,7 @@ export default function CacheDragonCost() { let price = SimObjects[target].basePrice * Game.priceIncrease ** - Math.max( - 0, - SimObjects[target].amount - 1 - SimObjects[target].free, - ); + Math.max(0, SimObjects[target].amount - 1 - SimObjects[target].free); price = Game.modifyBuildingPrice(SimObjects[target], price); price = Math.ceil(price); cost += price; diff --git a/src/Cache/PP/Building.js b/src/Cache/PP/Building.js index 13cc627..ba44113 100644 --- a/src/Cache/PP/Building.js +++ b/src/Cache/PP/Building.js @@ -22,10 +22,7 @@ function CacheColour(target, amount) { return; } // eslint-disable-next-line no-param-reassign - target[i].color = ColourOfPP( - target[i], - Game.Objects[i].getSumPrice(amount), - ); + target[i].color = ColourOfPP(target[i], Game.Objects[i].getSumPrice(amount)); // Colour based on excluding certain top-buildings for (let j = 0; j < CMOptions.PPExcludeTop; j++) { if (target[i].pp === CachePPArray[j][0]) target[i].color = ColourGray; // eslint-disable-line no-param-reassign @@ -38,12 +35,10 @@ function CachePP(target, amount) { const price = Game.Objects[i].getSumPrice(amount); if (Game.cookiesPs) { target[i].pp = // eslint-disable-line no-param-reassign - Math.max(price - (Game.cookies + GetWrinkConfigBank()), 0) / - Game.cookiesPs + + Math.max(price - (Game.cookies + GetWrinkConfigBank()), 0) / Game.cookiesPs + price / target[i].bonus; } else target[i].pp = price / target[i].bonus; // eslint-disable-line no-param-reassign - if (!(CMOptions.PPRigidelMode && amount === 1)) - CachePPArray.push([target[i].pp, amount]); + if (!(CMOptions.PPRigidelMode && amount === 1)) CachePPArray.push([target[i].pp, amount]); }); } diff --git a/src/Cache/PP/ColourOfPP.js b/src/Cache/PP/ColourOfPP.js index 8a2e5ad..42c4e70 100644 --- a/src/Cache/PP/ColourOfPP.js +++ b/src/Cache/PP/ColourOfPP.js @@ -31,8 +31,7 @@ export default function ColourOfPP(me, price) { // Colour based on price in terms of CPS if (Number(CMOptions.PPSecondsLowerLimit) !== 0) { - if (price / GetCPS() < Number(CMOptions.PPSecondsLowerLimit)) - color = ColourBlue; + if (price / GetCPS() < Number(CMOptions.PPSecondsLowerLimit)) color = ColourBlue; } // Colour based on being able to purchase if (CMOptions.PPOnlyConsiderBuyable) { diff --git a/src/Cache/PP/Upgrade.js b/src/Cache/PP/Upgrade.js index 9a3260f..808b6a4 100644 --- a/src/Cache/PP/Upgrade.js +++ b/src/Cache/PP/Upgrade.js @@ -10,20 +10,12 @@ export default function CacheUpgradePP() { Object.keys(CacheUpgrades).forEach((i) => { if (Game.cookiesPs) { CacheUpgrades[i].pp = - Math.max( - Game.Upgrades[i].getPrice() - (Game.cookies + GetWrinkConfigBank()), - 0, - ) / + Math.max(Game.Upgrades[i].getPrice() - (Game.cookies + GetWrinkConfigBank()), 0) / Game.cookiesPs + Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus; - } else - CacheUpgrades[i].pp = - Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus; + } else CacheUpgrades[i].pp = Game.Upgrades[i].getPrice() / CacheUpgrades[i].bonus; if (Number.isNaN(CacheUpgrades[i].pp)) CacheUpgrades[i].pp = Infinity; - CacheUpgrades[i].color = ColourOfPP( - CacheUpgrades[i], - Game.Upgrades[i].getPrice(), - ); + CacheUpgrades[i].color = ColourOfPP(CacheUpgrades[i], Game.Upgrades[i].getPrice()); }); } diff --git a/src/Cache/PriceAndIncome/PriceAndIncome.js b/src/Cache/PriceAndIncome/PriceAndIncome.js index 0ef7ddd..cc6208b 100644 --- a/src/Cache/PriceAndIncome/PriceAndIncome.js +++ b/src/Cache/PriceAndIncome/PriceAndIncome.js @@ -44,10 +44,8 @@ function CacheUpgradeIncome() { const bonusIncome = BuyUpgradesBonusIncome(i); if (i === 'Elder Pledge') { CacheUpgrades[i] = { bonus: Game.cookiesPs - CacheAverageGainBank }; - if (CMOptions.CalcWrink === 1) - CacheUpgrades[i].bonus -= CacheAverageGainWrink; - else if (CMOptions.CalcWrink === 2) - CacheUpgrades[i].bonus -= CacheAverageGainWrinkFattest; + if (CMOptions.CalcWrink === 1) CacheUpgrades[i].bonus -= CacheAverageGainWrink; + else if (CMOptions.CalcWrink === 2) CacheUpgrades[i].bonus -= CacheAverageGainWrinkFattest; if (!Number.isFinite(CacheUpgrades[i].bonus)) CacheUpgrades[i].bonus = 0; } else { CacheUpgrades[i] = {}; diff --git a/src/Cache/Stats/ChainCookies.js b/src/Cache/Stats/ChainCookies.js index c1741cb..1b81723 100644 --- a/src/Cache/Stats/ChainCookies.js +++ b/src/Cache/Stats/ChainCookies.js @@ -31,22 +31,15 @@ export function MaxChainCookieReward(digit, maxPayout, mult) { let moni = 0; let nextMoni = 0; let nextRequired = 0; - 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 * mult) { moni = Math.max( digit, - Math.min( - Math.floor((1 / 9) * 10 ** chain * digit * mult), - maxPayout * mult, - ), + Math.min(Math.floor((1 / 9) * 10 ** chain * digit * mult), maxPayout * mult), ); nextMoni = Math.max( digit, - Math.min( - Math.floor((1 / 9) * 10 ** (chain + 1) * digit * mult), - maxPayout * mult, - ), + Math.min(Math.floor((1 / 9) * 10 ** (chain + 1) * digit * mult), maxPayout * mult), ); nextRequired = Math.floor((1 / 9) * 10 ** (chain + 1) * digit * mult); totalFromChain += moni; @@ -72,65 +65,28 @@ export function MaxChainCookieReward(digit, maxPayout, mult) { * @global {number} CM.Cache.ChainFrenzyWrathRequiredNext Total cookies needed for next level for wrath frenzy chain */ export function CacheChain() { - let maxPayout = - CacheNoGoldSwitchCookiesPS * - 60 * - 60 * - 6 * - CacheDragonsFortuneMultAdjustment; + let maxPayout = CacheNoGoldSwitchCookiesPS * 60 * 60 * 6 * CacheDragonsFortuneMultAdjustment; // Removes effect of Frenzy etc. const cpsBuffMult = GetCPSBuffMult(); if (cpsBuffMult > 0) maxPayout /= cpsBuffMult; else maxPayout = 0; - CacheChainMaxReward = MaxChainCookieReward( - 7, - maxPayout, - CacheGoldenCookiesMult, - ); + CacheChainMaxReward = MaxChainCookieReward(7, maxPayout, CacheGoldenCookiesMult); CacheChainRequired = (CacheChainMaxReward[1] * 2) / CacheGoldenCookiesMult; // eslint-disable-line no-unused-vars - CacheChainRequiredNext = // eslint-disable-line no-unused-vars - CacheChainMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment; + CacheChainRequiredNext = CacheChainMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment; // eslint-disable-line no-unused-vars - CacheChainWrathMaxReward = MaxChainCookieReward( - 6, - maxPayout, - CacheWrathCookiesMult, - ); - CacheChainWrathRequired = // eslint-disable-line no-unused-vars - (CacheChainWrathMaxReward[1] * 2) / CacheWrathCookiesMult; + CacheChainWrathMaxReward = MaxChainCookieReward(6, maxPayout, CacheWrathCookiesMult); + CacheChainWrathRequired = (CacheChainWrathMaxReward[1] * 2) / CacheWrathCookiesMult; // eslint-disable-line no-unused-vars CacheChainWrathRequiredNext = // eslint-disable-line no-unused-vars - CacheChainWrathMaxReward[2] / - 60 / - 60 / - 6 / - CacheDragonsFortuneMultAdjustment; + CacheChainWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment; - CacheChainFrenzyMaxReward = MaxChainCookieReward( - 7, - maxPayout * 7, - CacheGoldenCookiesMult, - ); - CacheChainFrenzyRequired = // eslint-disable-line no-unused-vars - (CacheChainFrenzyMaxReward[1] * 2) / CacheGoldenCookiesMult; + CacheChainFrenzyMaxReward = MaxChainCookieReward(7, maxPayout * 7, CacheGoldenCookiesMult); + CacheChainFrenzyRequired = (CacheChainFrenzyMaxReward[1] * 2) / CacheGoldenCookiesMult; // eslint-disable-line no-unused-vars CacheChainFrenzyRequiredNext = // eslint-disable-line no-unused-vars - CacheChainFrenzyMaxReward[2] / - 60 / - 60 / - 6 / - CacheDragonsFortuneMultAdjustment; + CacheChainFrenzyMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment; - CacheChainFrenzyWrathMaxReward = MaxChainCookieReward( - 6, - maxPayout * 7, - CacheWrathCookiesMult, - ); - CacheChainFrenzyWrathRequired = // eslint-disable-line no-unused-vars - (CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult; + CacheChainFrenzyWrathMaxReward = MaxChainCookieReward(6, maxPayout * 7, CacheWrathCookiesMult); + CacheChainFrenzyWrathRequired = (CacheChainFrenzyWrathMaxReward[1] * 2) / CacheWrathCookiesMult; // eslint-disable-line no-unused-vars CacheChainFrenzyWrathRequiredNext = // eslint-disable-line no-unused-vars - CacheChainFrenzyWrathMaxReward[2] / - 60 / - 60 / - 6 / - CacheDragonsFortuneMultAdjustment; + CacheChainFrenzyWrathMaxReward[2] / 60 / 60 / 6 / CacheDragonsFortuneMultAdjustment; } diff --git a/src/Cache/Stats/HeavenlyChips.js b/src/Cache/Stats/HeavenlyChips.js index 452ebca..17b071a 100644 --- a/src/Cache/Stats/HeavenlyChips.js +++ b/src/Cache/Stats/HeavenlyChips.js @@ -15,15 +15,12 @@ export default function CacheHeavenlyChipsPS() { // Only calculate every new second if ((Game.T / Game.fps) % 1 === 0) { const chipsOwned = Game.HowMuchPrestige(Game.cookiesReset); - const ascendNowToOwn = Math.floor( - Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned), - ); + const ascendNowToOwn = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)); const ascendNowToGet = ascendNowToOwn - Math.floor(chipsOwned); // Add recent gains to AvgQueue's const timeDiff = currDate - CacheLastHeavenlyCheck; - const heavenlyChipsDiffAvg = - Math.max(0, ascendNowToGet - CacheLastHeavenlyChips) / timeDiff; + const heavenlyChipsDiffAvg = Math.max(0, ascendNowToGet - CacheLastHeavenlyChips) / timeDiff; for (let i = 0; i < timeDiff; i++) { HeavenlyChipsDiff.addLatest(heavenlyChipsDiffAvg); } diff --git a/src/Cache/Stats/MissingUpgrades.js b/src/Cache/Stats/MissingUpgrades.js index d410f64..e6eec50 100644 --- a/src/Cache/Stats/MissingUpgrades.js +++ b/src/Cache/Stats/MissingUpgrades.js @@ -38,11 +38,7 @@ export default function CacheAllMissingUpgrades() { /* eslint-disable no-unused-vars */ if (me.pool === 'prestige') CacheMissingUpgradesPrestige += str; else if (me.pool === 'cookie') CacheMissingUpgradesCookies += str; - else if ( - me.pool !== 'toggle' && - me.pool !== 'unused' && - me.pool !== 'debug' - ) + else if (me.pool !== 'toggle' && me.pool !== 'unused' && me.pool !== 'debug') CacheMissingUpgrades += str; /* eslint-enable no-unused-vars */ } diff --git a/src/Cache/Stats/Stats.js b/src/Cache/Stats/Stats.js index 2703b90..ce39109 100644 --- a/src/Cache/Stats/Stats.js +++ b/src/Cache/Stats/Stats.js @@ -31,10 +31,8 @@ export function CacheStatsCookies() { CacheLuckyReward = CacheGoldenCookiesMult * (CacheLucky * 0.15) + 13; // eslint-disable-line no-unused-vars CacheLuckyWrathReward = CacheWrathCookiesMult * (CacheLucky * 0.15) + 13; // eslint-disable-line no-unused-vars CacheLuckyFrenzy = CacheLucky * 7; - CacheLuckyRewardFrenzy = // eslint-disable-line no-unused-vars - CacheGoldenCookiesMult * (CacheLuckyFrenzy * 0.15) + 13; - CacheLuckyWrathRewardFrenzy = // eslint-disable-line no-unused-vars - CacheWrathCookiesMult * (CacheLuckyFrenzy * 0.15) + 13; + CacheLuckyRewardFrenzy = CacheGoldenCookiesMult * (CacheLuckyFrenzy * 0.15) + 13; // eslint-disable-line no-unused-vars + CacheLuckyWrathRewardFrenzy = CacheWrathCookiesMult * (CacheLuckyFrenzy * 0.15) + 13; // eslint-disable-line no-unused-vars CacheConjure = CacheLucky * 2; CacheConjureReward = CacheConjure * 0.15; // eslint-disable-line no-unused-vars @@ -84,7 +82,6 @@ export function CacheGoldenAndWrathCookiesMults() { // Otherwise, the aura effect will be factored in the base CPS making the multiplier not requiring adjustment. CacheDragonsFortuneMultAdjustment = 1; if (Game.shimmerTypes.golden.n === 0) { - CacheDragonsFortuneMultAdjustment *= - 1 + Game.auraMult("Dragon's Fortune") * 1.23; + CacheDragonsFortuneMultAdjustment *= 1 + Game.auraMult("Dragon's Fortune") * 1.23; } } diff --git a/src/Cache/TillNextAchievement/AllAmountTillNextAchievement.js b/src/Cache/TillNextAchievement/AllAmountTillNextAchievement.js index 8d89a1a..a61add3 100644 --- a/src/Cache/TillNextAchievement/AllAmountTillNextAchievement.js +++ b/src/Cache/TillNextAchievement/AllAmountTillNextAchievement.js @@ -10,8 +10,7 @@ export default function AllAmountTillNextAchievement() { CacheObjectsNextAchievement[i].TotalNeeded > Game.Objects[i].amount ) { result[i] = { - AmountNeeded: - CacheObjectsNextAchievement[i].TotalNeeded - Game.Objects[i].amount, + AmountNeeded: CacheObjectsNextAchievement[i].TotalNeeded - Game.Objects[i].amount, TotalNeeded: CacheObjectsNextAchievement[i].TotalNeeded, }; } else { diff --git a/src/Cache/Wrinklers/Wrinklers.js b/src/Cache/Wrinklers/Wrinklers.js index 443af7e..3963b91 100644 --- a/src/Cache/Wrinklers/Wrinklers.js +++ b/src/Cache/Wrinklers/Wrinklers.js @@ -34,8 +34,7 @@ export default function CacheWrinklers() { CacheWrinklersTotal += sucked; // eslint-disable-line no-unused-vars if (Game.wrinklers[i].type === 0) { CacheWrinklersNormal += sucked; // eslint-disable-line no-unused-vars - if (sucked > CacheWrinklersFattest[0]) - CacheWrinklersFattest = [sucked, i]; + if (sucked > CacheWrinklersFattest[0]) CacheWrinklersFattest = [sucked, i]; } } } diff --git a/src/Config/SaveLoadReload/SaveLoadReloadSettings.js b/src/Config/SaveLoadReload/SaveLoadReloadSettings.js index 93f6b86..aa17f69 100644 --- a/src/Config/SaveLoadReload/SaveLoadReloadSettings.js +++ b/src/Config/SaveLoadReload/SaveLoadReloadSettings.js @@ -19,14 +19,8 @@ export function SaveConfig() { ); const CookieMonsterSave = saveString.match(/CookieMonster.*(;|$)/); if (CookieMonsterSave !== null) { - const newSaveString = saveString.replace( - CookieMonsterSave[0], - `CookieMonster:${save()}`, - ); - localStorage.setItem( - 'CookieClickerGame', - escape(`${utf8_to_b64(newSaveString)}!END!`), - ); + const newSaveString = saveString.replace(CookieMonsterSave[0], `CookieMonster:${save()}`); + localStorage.setItem('CookieClickerGame', escape(`${utf8_to_b64(newSaveString)}!END!`)); } } diff --git a/src/Config/SpecificToggles.js b/src/Config/SpecificToggles.js index 17cd072..240462d 100644 --- a/src/Config/SpecificToggles.js +++ b/src/Config/SpecificToggles.js @@ -7,15 +7,9 @@ import { CMOptions } from './VariablesAndData'; * This function changes the position of both the bottom and timer bar */ export function UpdateBotTimerBarPosition() { - if ( - CMOptions.BotBar === 1 && - CMOptions.TimerBar === 1 && - CMOptions.TimerBarPos === 1 - ) { + if (CMOptions.BotBar === 1 && CMOptions.TimerBar === 1 && CMOptions.TimerBarPos === 1) { l('CMBotBar').style.bottom = l('CMTimerBar').style.height; - l('game').style.bottom = `${ - Number(l('CMTimerBar').style.height.replace('px', '')) + 70 - }px`; + l('game').style.bottom = `${Number(l('CMTimerBar').style.height.replace('px', '')) + 70}px`; } else if (CMOptions.BotBar === 1) { l('CMBotBar').style.bottom = '0px'; l('game').style.bottom = '70px'; diff --git a/src/Config/ToggleSetting.js b/src/Config/ToggleSetting.js index e90377d..ad889b4 100644 --- a/src/Config/ToggleSetting.js +++ b/src/Config/ToggleSetting.js @@ -17,8 +17,7 @@ export function ToggleConfig(config) { if (CMOptions[config] === ConfigData[config].label.length) { CMOptions[config] = 0; - if (ConfigData[config].toggle) - l(ConfigPrefix + config).className = 'option off'; + if (ConfigData[config].toggle) l(ConfigPrefix + config).className = 'option off'; } else l(ConfigPrefix + config).className = 'option'; if (typeof ConfigData[config].func !== 'undefined') { diff --git a/src/Data/SettingsDefault.ts b/src/Data/SettingsDefault.ts index 34b37b0..20b15fc 100644 --- a/src/Data/SettingsDefault.ts +++ b/src/Data/SettingsDefault.ts @@ -77,15 +77,13 @@ const ConfigDefault: { ColourFortuneFlash: '#ffffff', FortuneSound: 1, FortuneVolume: 100, - FortuneSoundURL: - 'https://freesound.org/data/previews/174/174027_3242494-lq.mp3', + FortuneSoundURL: 'https://freesound.org/data/previews/174/174027_3242494-lq.mp3', SeaNotification: 0, SeaFlash: 1, ColourSeaFlash: '#ffffff', SeaSound: 1, SeaVolume: 100, - SeaSoundURL: - 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', + SeaSoundURL: 'https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3', GardFlash: 1, ColourGardFlash: '#ffffff', GardSound: 1, @@ -96,22 +94,19 @@ const ConfigDefault: { ColourMagicFlash: '#ffffff', MagicSound: 1, MagicVolume: 100, - MagicSoundURL: - 'https://freesound.org/data/previews/221/221683_1015240-lq.mp3', + MagicSoundURL: 'https://freesound.org/data/previews/221/221683_1015240-lq.mp3', WrinklerNotification: 0, WrinklerFlash: 1, ColourWrinklerFlash: '#ffffff', WrinklerSound: 1, WrinklerVolume: 100, - WrinklerSoundURL: - 'https://freesound.org/data/previews/124/124186_8043-lq.mp3', + WrinklerSoundURL: 'https://freesound.org/data/previews/124/124186_8043-lq.mp3', WrinklerMaxNotification: 0, WrinklerMaxFlash: 1, ColourWrinklerMaxFlash: '#ffffff', WrinklerMaxSound: 1, WrinklerMaxVolume: 100, - WrinklerMaxSoundURL: - 'https://freesound.org/data/previews/152/152743_15663-lq.mp3', + WrinklerMaxSoundURL: 'https://freesound.org/data/previews/152/152743_15663-lq.mp3', BulkBuyBlock: 0, FavouriteSettings: 1, Header: { diff --git a/src/Disp/BeautifyAndFormatting/Beautify.js b/src/Disp/BeautifyAndFormatting/Beautify.js index 0ebb230..7f50914 100644 --- a/src/Disp/BeautifyAndFormatting/Beautify.js +++ b/src/Disp/BeautifyAndFormatting/Beautify.js @@ -1,11 +1,7 @@ /** General functions to format or beautify strings */ import { CMOptions } from '../../Config/VariablesAndData'; -import { - metric, - shortScale, - shortScaleAbbreviated, -} from '../../Data/Scales.ts'; +import { metric, shortScale, shortScaleAbbreviated } from '../../Data/Scales.ts'; import { BackupFunctions } from '../../Main/VariablesAndData'; /** @@ -44,12 +40,8 @@ export default function Beautify(num, floats, forced) { answer = num.toExponential(decimals).toString().replace('e', 'E'); } else { const exponential = num.toExponential().toString(); - const AmountOfTenPowerThree = Math.floor( - exponential.slice(exponential.indexOf('e') + 1) / 3, - ); - answer = (num / Number(`1e${AmountOfTenPowerThree * 3}`)).toFixed( - decimals, - ); + const AmountOfTenPowerThree = Math.floor(exponential.slice(exponential.indexOf('e') + 1) / 3); + answer = (num / Number(`1e${AmountOfTenPowerThree * 3}`)).toFixed(decimals); // answer is now "xxx.xx" (e.g., 123456789 would be 123.46) if ((CMOptions.Scale === 1 && !forced) || forced === 1) { // Metric scale, 123456789 => 123.457 M @@ -63,10 +55,7 @@ export default function Beautify(num, floats, forced) { } else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation } else if ((CMOptions.Scale === 3 && !forced) || forced === 3) { // Short scale, 123456789 => 123.457 M - if ( - num >= 0.01 && - num < Number(`1e${shortScaleAbbreviated.length * 3}`) - ) { + if (num >= 0.01 && num < Number(`1e${shortScaleAbbreviated.length * 3}`)) { answer += ` ${shortScaleAbbreviated[AmountOfTenPowerThree]}`; } else answer = Beautify(num, 0, 4); // If number is too large or little, revert to scientific notation } else if ((CMOptions.Scale === 5 && !forced) || forced === 5) { @@ -76,9 +65,7 @@ export default function Beautify(num, floats, forced) { } if (answer === '') { // eslint-disable-next-line no-console - console.log( - `Could not beautify number with Cookie Monster Beautify: ${num}`, - ); + console.log(`Could not beautify number with Cookie Monster Beautify: ${num}`); answer = BackupFunctions.Beautify(num, floats); } if (CMOptions.ScaleSeparator) answer = answer.replace('.', ','); diff --git a/src/Disp/BeautifyAndFormatting/FormatTime.js b/src/Disp/BeautifyAndFormatting/FormatTime.js index 3d5ac56..fe79cf4 100644 --- a/src/Disp/BeautifyAndFormatting/FormatTime.js +++ b/src/Disp/BeautifyAndFormatting/FormatTime.js @@ -25,8 +25,7 @@ export default function FormatTime(time, longFormat) { str += `${(m < 10 ? '0' : '') + m}:`; str += (s < 10 ? '0' : '') + s; } else { - if (formattedTime > 777600000) - return longFormat ? 'Over 9000 days!' : '>9000d'; + if (formattedTime > 777600000) return longFormat ? 'Over 9000 days!' : '>9000d'; str += y > 0 ? `${y + (longFormat ? (y === 1 ? ' year' : ' years') : 'y')}, ` // eslint-disable-line no-nested-ternary diff --git a/src/Disp/BeautifyAndFormatting/GetTimeColour.js b/src/Disp/BeautifyAndFormatting/GetTimeColour.js index 35f30d5..a33ff92 100644 --- a/src/Disp/BeautifyAndFormatting/GetTimeColour.js +++ b/src/Disp/BeautifyAndFormatting/GetTimeColour.js @@ -1,10 +1,5 @@ import { CMOptions } from '../../Config/VariablesAndData'; -import { - ColourGreen, - ColourOrange, - ColourRed, - ColourYellow, -} from '../VariablesAndData'; +import { ColourGreen, ColourOrange, ColourRed, ColourYellow } from '../VariablesAndData'; import FormatTime from './FormatTime'; /** diff --git a/src/Disp/BuildingsUpgrades/Buildings.js b/src/Disp/BuildingsUpgrades/Buildings.js index afa13ee..bf43652 100644 --- a/src/Disp/BuildingsUpgrades/Buildings.js +++ b/src/Disp/BuildingsUpgrades/Buildings.js @@ -1,8 +1,4 @@ -import { - CacheObjects1, - CacheObjects10, - CacheObjects100, -} from '../../Cache/VariablesAndData'; +import { CacheObjects1, CacheObjects10, CacheObjects100 } from '../../Cache/VariablesAndData'; import { CMOptions } from '../../Config/VariablesAndData'; import BuildingSell from '../../Sim/SimulationEvents/SellBuilding'; import Beautify from '../BeautifyAndFormatting/Beautify'; @@ -31,8 +27,7 @@ export default function UpdateBuildings() { if (Game.buyMode === 1) { if (CMOptions.BuildColour === 1) { Object.keys(target).forEach((i) => { - l(`productPrice${Game.Objects[i].id}`).style.color = - CMOptions[`Colour${target[i].color}`]; + l(`productPrice${Game.Objects[i].id}`).style.color = CMOptions[`Colour${target[i].color}`]; }); } else { Object.keys(Game.Objects).forEach((i) => { @@ -70,14 +65,16 @@ export default function UpdateBuildings() { return o; }); - arr.sort((a, b) => ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary - ColoursOrdering.indexOf(b.color) + arr.sort((a, b) => + ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary + ColoursOrdering.indexOf(b.color) ? 1 : ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary ? -1 : a.pp < b.pp ? -1 - : 0); + : 0, + ); } else if (CMOptions.SortBuildings === 2) { arr = Object.keys(target).map((k) => { const o = target[k]; @@ -86,14 +83,16 @@ export default function UpdateBuildings() { return o; }); - arr.sort((a, b) => ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary - ColoursOrdering.indexOf(b.color) + arr.sort((a, b) => + ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary + ColoursOrdering.indexOf(b.color) ? 1 : ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary ? -1 : a.pp < b.pp ? -1 - : 0); + : 0, + ); } for (let x = 0; x < arr.length; x++) { diff --git a/src/Disp/BuildingsUpgrades/UpgradeBar.js b/src/Disp/BuildingsUpgrades/UpgradeBar.js index c348170..81aa34d 100644 --- a/src/Disp/BuildingsUpgrades/UpgradeBar.js +++ b/src/Disp/BuildingsUpgrades/UpgradeBar.js @@ -38,24 +38,12 @@ function CreateUpgradeBarLegend() { return div; }; - legend.appendChild( - legendLine(ColourBlue, 'Better than the best PP of a building option'), - ); - legend.appendChild( - legendLine(ColourGreen, 'Same as the best PP building option'), - ); - legend.appendChild( - legendLine(ColourYellow, 'Within the top 10 of PP for buildings'), - ); - legend.appendChild( - legendLine(ColourOrange, 'Within the top 20 of PP for buildings'), - ); - legend.appendChild( - legendLine(ColourRed, 'Within the top 30 of PP for buildings'), - ); - legend.appendChild( - legendLine(ColourPurple, 'Outside of the top 30 of PP for buildings'), - ); + legend.appendChild(legendLine(ColourBlue, 'Better than the best PP of a building option')); + legend.appendChild(legendLine(ColourGreen, 'Same as the best PP building option')); + legend.appendChild(legendLine(ColourYellow, 'Within the top 10 of PP for buildings')); + legend.appendChild(legendLine(ColourOrange, 'Within the top 20 of PP for buildings')); + legend.appendChild(legendLine(ColourRed, 'Within the top 30 of PP for buildings')); + legend.appendChild(legendLine(ColourPurple, 'Outside of the top 30 of PP for buildings')); legend.appendChild(legendLine(ColourGray, 'Negative or infinity PP')); return legend; } @@ -99,8 +87,5 @@ export default function CreateUpgradeBar() { UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarPurple', ColourPurple)); UpgradeBar.appendChild(upgradeNumber('CMUpgradeBarGray', ColourGray)); - l('upgrades').parentNode.insertBefore( - UpgradeBar, - l('upgrades').parentNode.childNodes[3], - ); + l('upgrades').parentNode.insertBefore(UpgradeBar, l('upgrades').parentNode.childNodes[3]); } diff --git a/src/Disp/BuildingsUpgrades/Upgrades.js b/src/Disp/BuildingsUpgrades/Upgrades.js index d1f6e9c..0747591 100644 --- a/src/Disp/BuildingsUpgrades/Upgrades.js +++ b/src/Disp/BuildingsUpgrades/Upgrades.js @@ -33,11 +33,8 @@ export default function UpdateUpgrades() { const me = Game.UpgradesInStore[i]; let addedColour = false; for (let j = 0; j < l(`upgrade${i}`).childNodes.length; j += 1) { - if ( - l(`upgrade${i}`).childNodes[j].className.indexOf(ColourBackPre) !== -1 - ) { - l(`upgrade${i}`).childNodes[j].className = - ColourBackPre + CacheUpgrades[me.name].color; + if (l(`upgrade${i}`).childNodes[j].className.indexOf(ColourBackPre) !== -1) { + l(`upgrade${i}`).childNodes[j].className = ColourBackPre + CacheUpgrades[me.name].color; addedColour = true; break; } @@ -79,13 +76,15 @@ export default function UpdateUpgrades() { } if (CMOptions.SortUpgrades) { - arr.sort((a, b) => ColoursOrdering.indexOf(a.color) > ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary + arr.sort((a, b) => + ColoursOrdering.indexOf(a.color) > ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary ? 1 : ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary ? -1 : a.pp < b.pp ? -1 - : 0); + : 0, + ); } else { arr.sort((a, b) => a.price - b.price); } @@ -94,7 +93,6 @@ export default function UpdateUpgrades() { return arr2.findIndex((e) => e.name === upgrade.name); }; for (let x = 0; x < Game.UpgradesInStore.length; x += 1) { - l(`upgrade${x}`).style.order = - nameChecker(arr, Game.UpgradesInStore[x]) + 1; + l(`upgrade${x}`).style.order = nameChecker(arr, Game.UpgradesInStore[x]) + 1; } } diff --git a/src/Disp/Dragon/Dragon.js b/src/Disp/Dragon/Dragon.js index 3e982df..a9e27fa 100644 --- a/src/Disp/Dragon/Dragon.js +++ b/src/Disp/Dragon/Dragon.js @@ -14,17 +14,14 @@ import FormatTime from '../BeautifyAndFormatting/FormatTime'; export function AddAuraInfo(aura) { if (CMOptions.DragonAuraInfo === 1) { const [bonusCPS, priceOfChange] = CalculateChangeAura(aura); - const timeToRecover = FormatTime( - priceOfChange / (bonusCPS + Game.cookiesPs), - ); + const timeToRecover = FormatTime(priceOfChange / (bonusCPS + Game.cookiesPs)); let bonusCPSPercentage; if (Game.cookiesPs === 0) bonusCPSPercentage = Beautify(Infinity); else bonusCPSPercentage = Beautify((bonusCPS / Game.cookiesPs) * 100); l('dragonAuraInfo').style.minHeight = '60px'; l('dragonAuraInfo').style.margin = '8px'; - l('dragonAuraInfo').appendChild(document.createElement('div')).className = - 'line'; + l('dragonAuraInfo').appendChild(document.createElement('div')).className = 'line'; const div = document.createElement('div'); div.style.minWidth = '200px'; div.style.textAlign = 'center'; diff --git a/src/Disp/GoldenCookieTimers/GoldenCookieTimers.js b/src/Disp/GoldenCookieTimers/GoldenCookieTimers.js index 8aa5df8..a66d61d 100644 --- a/src/Disp/GoldenCookieTimers/GoldenCookieTimers.js +++ b/src/Disp/GoldenCookieTimers/GoldenCookieTimers.js @@ -27,10 +27,8 @@ export default function CreateGCTimer(cookie) { cookie.pop(); }; GCTimer.onmouseover = function () { - cookie.l.style.filter = // eslint-disable-line no-param-reassign - 'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))'; - cookie.l.style.webkitFilter = // eslint-disable-line no-param-reassign - 'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))'; + cookie.l.style.filter = 'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))'; // eslint-disable-line no-param-reassign + cookie.l.style.webkitFilter = 'brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))'; // eslint-disable-line no-param-reassign }; GCTimer.onmouseout = function () { cookie.l.style.filter = ''; // eslint-disable-line no-param-reassign diff --git a/src/Disp/HelperFunctions/CalculateGrimoireRefillTime.js b/src/Disp/HelperFunctions/CalculateGrimoireRefillTime.js index ccdffd6..cc71d83 100644 --- a/src/Disp/HelperFunctions/CalculateGrimoireRefillTime.js +++ b/src/Disp/HelperFunctions/CalculateGrimoireRefillTime.js @@ -5,11 +5,7 @@ * @param {number} targetMagic The target magic level * @returns {number} count / Game.fps The time it takes to reach targetMagic */ -export default function CalculateGrimoireRefillTime( - currentMagic, - maxMagic, - targetMagic, -) { +export default function CalculateGrimoireRefillTime(currentMagic, maxMagic, targetMagic) { let magic = currentMagic; let count = 0; while (magic < targetMagic) { diff --git a/src/Disp/HelperFunctions/GetCPS.js b/src/Disp/HelperFunctions/GetCPS.js index 0ff82a9..97afebc 100644 --- a/src/Disp/HelperFunctions/GetCPS.js +++ b/src/Disp/HelperFunctions/GetCPS.js @@ -18,16 +18,10 @@ export default function GetCPS() { return Game.cookiesPs * (1 - Game.cpsSucked); } if (CMOptions.CalcWrink === 1) { - return ( - Game.cookiesPs * - (CacheCurrWrinklerCPSMult + (1 - CacheCurrWrinklerCount * 0.05)) - ); + return Game.cookiesPs * (CacheCurrWrinklerCPSMult + (1 - CacheCurrWrinklerCount * 0.05)); } if (CacheWrinklersFattest[1] !== null) - if ( - CMOptions.CalcWrink === 2 && - Game.wrinklers[CacheWrinklersFattest[1]].type === 1 - ) { + if (CMOptions.CalcWrink === 2 && Game.wrinklers[CacheWrinklersFattest[1]].type === 1) { return ( Game.cookiesPs * ((CacheCurrWrinklerCPSMult * 3) / CacheCurrWrinklerCount + @@ -36,7 +30,6 @@ export default function GetCPS() { } return ( Game.cookiesPs * - (CacheCurrWrinklerCPSMult / CacheCurrWrinklerCount + - (1 - CacheCurrWrinklerCount * 0.05)) + (CacheCurrWrinklerCPSMult / CacheCurrWrinklerCount + (1 - CacheCurrWrinklerCount * 0.05)) ); } diff --git a/src/Disp/HelperFunctions/GetWrinkConfigBank.js b/src/Disp/HelperFunctions/GetWrinkConfigBank.js index 9c03987..1f6c2ac 100644 --- a/src/Disp/HelperFunctions/GetWrinkConfigBank.js +++ b/src/Disp/HelperFunctions/GetWrinkConfigBank.js @@ -1,7 +1,4 @@ -import { - CacheWrinklersFattest, - CacheWrinklersTotal, -} from '../../Cache/VariablesAndData'; +import { CacheWrinklersFattest, CacheWrinklersTotal } from '../../Cache/VariablesAndData'; import { CMOptions } from '../../Config/VariablesAndData'; /** diff --git a/src/Disp/HelperFunctions/UpdateBackground.js b/src/Disp/HelperFunctions/UpdateBackground.js index 8be41a5..932e1d1 100644 --- a/src/Disp/HelperFunctions/UpdateBackground.js +++ b/src/Disp/HelperFunctions/UpdateBackground.js @@ -5,11 +5,8 @@ */ export default function UpdateBackground() { Game.Background.canvas.width = Game.Background.canvas.parentNode.offsetWidth; - Game.Background.canvas.height = - Game.Background.canvas.parentNode.offsetHeight; - Game.LeftBackground.canvas.width = - Game.LeftBackground.canvas.parentNode.offsetWidth; - Game.LeftBackground.canvas.height = - Game.LeftBackground.canvas.parentNode.offsetHeight; + Game.Background.canvas.height = Game.Background.canvas.parentNode.offsetHeight; + Game.LeftBackground.canvas.width = Game.LeftBackground.canvas.parentNode.offsetWidth; + Game.LeftBackground.canvas.height = Game.LeftBackground.canvas.parentNode.offsetHeight; Game.DrawBackground(); } diff --git a/src/Disp/InfoBars/BottomBar.js b/src/Disp/InfoBars/BottomBar.js index 1a934b3..75516b3 100644 --- a/src/Disp/InfoBars/BottomBar.js +++ b/src/Disp/InfoBars/BottomBar.js @@ -1,10 +1,6 @@ /** Functions related to the Bottom Bar */ -import { - CacheObjects1, - CacheObjects10, - CacheObjects100, -} from '../../Cache/VariablesAndData'; +import { CacheObjects1, CacheObjects10, CacheObjects100 } from '../../Cache/VariablesAndData'; import { CMOptions } from '../../Config/VariablesAndData'; import { VersionMajor, VersionMinor } from '../../Data/Moddata.ts'; import Beautify from '../BeautifyAndFormatting/Beautify'; @@ -13,12 +9,7 @@ import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour'; import GetCPS from '../HelperFunctions/GetCPS'; import GetWrinkConfigBank from '../HelperFunctions/GetWrinkConfigBank'; -import { - ColourBlue, - ColourTextPre, - ColourYellow, - LastTargetBotBar, -} from '../VariablesAndData'; +import { ColourBlue, ColourTextPre, ColourYellow, LastTargetBotBar } from '../VariablesAndData'; import { CreateBotBarBuildingColumn } from './CreateDOMElements'; /** @@ -35,8 +26,7 @@ export function CreateBotBar() { BotBar.style.backgroundImage = 'linear-gradient(to bottom, #4d4548, #000000)'; BotBar.style.borderTop = '1px solid black'; BotBar.style.overflow = 'auto'; - BotBar.style.textShadow = - '-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black'; + BotBar.style.textShadow = '-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black'; const table = BotBar.appendChild(document.createElement('table')); table.style.width = '100%'; @@ -53,9 +43,7 @@ export function CreateBotBar() { }; const type = tbody.appendChild(document.createElement('tr')); type.style.fontWeight = 'bold'; - type.appendChild( - firstCol(`CM ${VersionMajor}.${VersionMinor}`, ColourYellow), - ); + type.appendChild(firstCol(`CM ${VersionMajor}.${VersionMinor}`, ColourYellow)); const bonus = tbody.appendChild(document.createElement('tr')); bonus.appendChild(firstCol('Bonus Income', ColourBlue)); const pp = tbody.appendChild(document.createElement('tr')); @@ -90,37 +78,28 @@ export function UpdateBotBar() { l('CMBotBar').firstChild.firstChild.childNodes[0].childNodes[ count ].childNodes[1].textContent = Game.Objects[i].amount; - l('CMBotBar').firstChild.firstChild.childNodes[1].childNodes[ - count - ].textContent = Beautify(target[i].bonus, 2); - l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[ - count - ].className = ColourTextPre + target[i].color; - let PPString; - if (CMOptions.PPDisplayTime) - PPString = FormatTime(Math.round(target[i].pp)); - else PPString = Beautify(Math.round(target[i].pp), 2); - l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[ - count - ].textContent = PPString; - const timeColour = GetTimeColour( - (Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) / - GetCPS(), + l('CMBotBar').firstChild.firstChild.childNodes[1].childNodes[count].textContent = Beautify( + target[i].bonus, + 2, ); - l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[ - count - ].className = ColourTextPre + timeColour.color; - if ( - timeColour.text === 'Done!' && - Game.cookies < Game.Objects[i].bulkPrice - ) { + l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[count].className = + ColourTextPre + target[i].color; + let PPString; + if (CMOptions.PPDisplayTime) PPString = FormatTime(Math.round(target[i].pp)); + else PPString = Beautify(Math.round(target[i].pp), 2); + l('CMBotBar').firstChild.firstChild.childNodes[2].childNodes[count].textContent = PPString; + const timeColour = GetTimeColour( + (Game.Objects[i].bulkPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(), + ); + l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].className = + ColourTextPre + timeColour.color; + if (timeColour.text === 'Done!' && Game.cookies < Game.Objects[i].bulkPrice) { l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[ count ].textContent = `${timeColour.text} (with Wrink)`; } else - l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[ - count - ].textContent = timeColour.text; + l('CMBotBar').firstChild.firstChild.childNodes[3].childNodes[count].textContent = + timeColour.text; }); } } diff --git a/src/Disp/InfoBars/CreateDOMElements.js b/src/Disp/InfoBars/CreateDOMElements.js index 5bd6b17..61d6274 100644 --- a/src/Disp/InfoBars/CreateDOMElements.js +++ b/src/Disp/InfoBars/CreateDOMElements.js @@ -77,9 +77,7 @@ export function CreateBotBarBuildingColumn(buildingName) { const i = buildingName; const header = type.appendChild(document.createElement('td')); header.appendChild( - document.createTextNode( - `${i.indexOf(' ') !== -1 ? i.substring(0, i.indexOf(' ')) : i} (`, - ), + document.createTextNode(`${i.indexOf(' ') !== -1 ? i.substring(0, i.indexOf(' ')) : i} (`), ); const span = header.appendChild(document.createElement('span')); diff --git a/src/Disp/InfoBars/TimerBar.js b/src/Disp/InfoBars/TimerBar.js index 2cba0b9..788f50d 100644 --- a/src/Disp/InfoBars/TimerBar.js +++ b/src/Disp/InfoBars/TimerBar.js @@ -57,28 +57,19 @@ export function UpdateTimerBar() { let numberOfTimers = 0; // Regulates visibility of Golden Cookie timer - if ( - Game.shimmerTypes.golden.spawned === 0 && - !Game.Has('Golden switch [off]') - ) { + if (Game.shimmerTypes.golden.spawned === 0 && !Game.Has('Golden switch [off]')) { l('CMTimerBarGC').style.display = ''; l('CMTimerBarGCMinBar').style.width = `${Math.round( - (Math.max( - 0, - Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time, - ) * + (Math.max(0, Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) * maxWidthTwoBar) / Game.shimmerTypes.golden.maxTime, )}px`; if (CMOptions.TimerBarOverlay >= 1) l('CMTimerBarGCMinBar').textContent = Math.ceil( - (Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) / - Game.fps, + (Game.shimmerTypes.golden.minTime - Game.shimmerTypes.golden.time) / Game.fps, ); else l('CMTimerBarGCMinBar').textContent = ''; - if ( - Game.shimmerTypes.golden.minTime === Game.shimmerTypes.golden.maxTime - ) { + if (Game.shimmerTypes.golden.minTime === Game.shimmerTypes.golden.maxTime) { l('CMTimerBarGCMinBar').style.borderTopRightRadius = '10px'; l('CMTimerBarGCMinBar').style.borderBottomRightRadius = '10px'; } else { @@ -102,37 +93,27 @@ export function UpdateTimerBar() { ); else l('CMTimerBarGCBar').textContent = ''; l('CMTimerBarGCTime').textContent = Math.ceil( - (Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / - Game.fps, + (Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps, ); numberOfTimers += 1; } else l('CMTimerBarGC').style.display = 'none'; // Regulates visibility of Reindeer timer - if ( - Game.season === 'christmas' && - Game.shimmerTypes.reindeer.spawned === 0 - ) { + if (Game.season === 'christmas' && Game.shimmerTypes.reindeer.spawned === 0) { l('CMTimerBarRen').style.display = ''; l('CMTimerBarRenMinBar').style.width = `${Math.round( - (Math.max( - 0, - Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time, - ) * + (Math.max(0, Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time) * maxWidthTwoBar) / Game.shimmerTypes.reindeer.maxTime, )}px`; if (CMOptions.TimerBarOverlay >= 1) l('CMTimerBarRenMinBar').textContent = Math.ceil( - (Game.shimmerTypes.reindeer.minTime - - Game.shimmerTypes.reindeer.time) / - Game.fps, + (Game.shimmerTypes.reindeer.minTime - Game.shimmerTypes.reindeer.time) / Game.fps, ); else l('CMTimerBarRenMinBar').textContent = ''; l('CMTimerBarRenBar').style.width = `${Math.round( (Math.min( - Game.shimmerTypes.reindeer.maxTime - - Game.shimmerTypes.reindeer.minTime, + Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime, Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time, ) * maxWidthTwoBar) / @@ -141,16 +122,13 @@ export function UpdateTimerBar() { if (CMOptions.TimerBarOverlay >= 1) l('CMTimerBarRenBar').textContent = Math.ceil( Math.min( - Game.shimmerTypes.reindeer.maxTime - - Game.shimmerTypes.reindeer.minTime, - Game.shimmerTypes.reindeer.maxTime - - Game.shimmerTypes.reindeer.time, + Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.minTime, + Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time, ) / Game.fps, ); else l('CMTimerBarRenBar').textContent = ''; l('CMTimerBarRenTime').textContent = Math.ceil( - (Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / - Game.fps, + (Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps, ); numberOfTimers += 1; } else { @@ -180,13 +158,10 @@ export function UpdateTimerBar() { else timer.lastChild.children[1].textContent = ''; timer.lastChild.children[1].style.width = `${Math.round( (Game.buffs[i].time * - (maxWidthOneBar - - Math.ceil(Game.buffs[i].time / Game.fps).toString().length * 8)) / + (maxWidthOneBar - Math.ceil(Game.buffs[i].time / Game.fps).toString().length * 8)) / Game.buffs[i].maxTime, )}px`; - timer.lastChild.children[2].textContent = Math.ceil( - Game.buffs[i].time / Game.fps, - ); + timer.lastChild.children[2].textContent = Math.ceil(Game.buffs[i].time / Game.fps); numberOfTimers += 1; BuffTimerBars[Game.buffs[i].name] = timer; } diff --git a/src/Disp/Initialization/CreateSectionHideButtons.js b/src/Disp/Initialization/CreateSectionHideButtons.js index c4b001e..1118f99 100644 --- a/src/Disp/Initialization/CreateSectionHideButtons.js +++ b/src/Disp/Initialization/CreateSectionHideButtons.js @@ -15,12 +15,9 @@ export default function CreateSectionHideButtons() { l('vaultUpgrades').style.display = 'none'; } else { l('upgrades').style.display = 'flex'; - if (l('toggleUpgrades').children.length !== 0) - l('toggleUpgrades').style.display = 'block'; - if (l('techUpgrades').children.length !== 0) - l('techUpgrades').style.display = 'block'; - if (l('vaultUpgrades').children.length !== 0) - l('vaultUpgrades').style.display = 'block'; + if (l('toggleUpgrades').children.length !== 0) l('toggleUpgrades').style.display = 'block'; + if (l('techUpgrades').children.length !== 0) l('techUpgrades').style.display = 'block'; + if (l('vaultUpgrades').children.length !== 0) l('vaultUpgrades').style.display = 'block'; } }; a.textContent = 'Hide/Show Upgrades'; @@ -28,8 +25,7 @@ export default function CreateSectionHideButtons() { const b = document.createElement('a'); b.className = 'option'; b.onclick = function () { - if (l('products').style.display === 'grid') - l('products').style.display = 'none'; + if (l('products').style.display === 'grid') l('products').style.display = 'none'; else l('products').style.display = 'grid'; }; b.textContent = 'Hide/Show Buildings'; diff --git a/src/Disp/Initialization/CreateWrinklerButton.js b/src/Disp/Initialization/CreateWrinklerButton.js index 5d8a7db..b3f03c3 100644 --- a/src/Disp/Initialization/CreateWrinklerButton.js +++ b/src/Disp/Initialization/CreateWrinklerButton.js @@ -18,11 +18,7 @@ export default function CreateWrinklerButtons() { }; popAllA.onmouseover = function () { Game.tooltip.dynamic = 1; - Game.tooltip.draw( - this, - () => CreateTooltip('wb', 'PopAll'), - 'this', - ); + Game.tooltip.draw(this, () => CreateTooltip('wb', 'PopAll'), 'this'); Game.tooltip.wobble(); }; l('sectionLeftExtra').children[0].append(popAllA); @@ -31,19 +27,14 @@ export default function CreateWrinklerButtons() { popFattestA.textContent = 'Pop Single Fattest'; popFattestA.className = 'option'; popFattestA.onclick = function () { - if (CacheWrinklersFattest[1] !== null) - Game.wrinklers[CacheWrinklersFattest[1]].hp = 0; + if (CacheWrinklersFattest[1] !== null) Game.wrinklers[CacheWrinklersFattest[1]].hp = 0; }; popFattestA.onmouseout = function () { Game.tooltip.shouldHide = 1; }; popFattestA.onmouseover = function () { Game.tooltip.dynamic = 1; - Game.tooltip.draw( - this, - () => CreateTooltip('wb', 'PopFattest'), - 'this', - ); + Game.tooltip.draw(this, () => CreateTooltip('wb', 'PopFattest'), 'this'); Game.tooltip.wobble(); }; l('sectionLeftExtra').children[0].append(popFattestA); diff --git a/src/Disp/MenuSections/Settings/CreateOption.js b/src/Disp/MenuSections/Settings/CreateOption.js index b745584..53f222f 100644 --- a/src/Disp/MenuSections/Settings/CreateOption.js +++ b/src/Disp/MenuSections/Settings/CreateOption.js @@ -1,11 +1,7 @@ import jscolor, * as JsColor from '@eastdesire/jscolor'; import ToggleFavouriteSetting from '../../../Config/Toggles/ToggleFavourites'; import { SaveConfig } from '../../../Config/SaveLoadReload/SaveLoadReloadSettings'; -import { - ConfigPrefix, - ToggleConfig, - ToggleConfigVolume, -} from '../../../Config/ToggleSetting'; +import { ConfigPrefix, ToggleConfig, ToggleConfigVolume } from '../../../Config/ToggleSetting'; import { CMOptions } from '../../../Config/VariablesAndData'; import {} from '../../../Data/Sectionheaders.ts'; import Config from '../../../Data/SettingsData'; @@ -13,10 +9,7 @@ import RefreshScale from '../../HelperFunctions/RefreshScale'; import UpdateColours from '../../HelperFunctions/UpdateColours'; import Flash from '../../Notifications/Flash'; import PlaySound from '../../Notifications/Sound'; -import { - FavouriteSettings, - SimpleTooltipElements, -} from '../../VariablesAndData'; +import { FavouriteSettings, SimpleTooltipElements } from '../../VariablesAndData'; import CookieMonsterPrompt from '../Prompt'; /** @@ -37,10 +30,7 @@ function CreateFavouriteStar(config) { Game.UpdateMenu(); }; FavStar.onmouseover = function () { - Game.tooltip.draw( - this, - escape(SimpleTooltipElements.FavouriteSettingPlaceholder.innerHTML), - ); + Game.tooltip.draw(this, escape(SimpleTooltipElements.FavouriteSettingPlaceholder.innerHTML)); }; FavStar.onmouseout = function () { Game.tooltip.hide(); diff --git a/src/Disp/MenuSections/Settings/SettingsPage.js b/src/Disp/MenuSections/Settings/SettingsPage.js index 46052ec..7850175 100644 --- a/src/Disp/MenuSections/Settings/SettingsPage.js +++ b/src/Disp/MenuSections/Settings/SettingsPage.js @@ -1,9 +1,6 @@ import { LoadConfig } from '../../../Config/SaveLoadReload/SaveLoadReloadSettings'; import { CMOptions } from '../../../Config/VariablesAndData'; -import { - ConfigGroups, - ConfigGroupsNotification, -} from '../../../Data/Sectionheaders.ts'; +import { ConfigGroups, ConfigGroupsNotification } from '../../../Data/Sectionheaders.ts'; import Config from '../../../Data/SettingsData'; import ConfigDefault from '../../../Data/SettingsDefault.ts'; import { FavouriteSettings } from '../../VariablesAndData'; @@ -35,24 +32,19 @@ export default function AddMenuPref(title) { // Make sub-sections of Notification section if (group === 'Notification') { Object.keys(ConfigGroupsNotification).forEach((subGroup) => { - const subGroupObject = CreatePrefHeader( - subGroup, - ConfigGroupsNotification[subGroup], - ); // (group, display-name of group) + const subGroupObject = CreatePrefHeader(subGroup, ConfigGroupsNotification[subGroup]); // (group, display-name of group) subGroupObject.style.fontSize = '15px'; subGroupObject.style.opacity = '0.5'; frag.appendChild(subGroupObject); if (CMOptions.Header[subGroup]) { Object.keys(Config).forEach((option) => { - if (Config[option].group === subGroup) - frag.appendChild(CreatePrefOption(option)); + if (Config[option].group === subGroup) frag.appendChild(CreatePrefOption(option)); }); } }); } else { Object.keys(Config).forEach((option) => { - if (Config[option].group === group) - frag.appendChild(CreatePrefOption(option)); + if (Config[option].group === group) frag.appendChild(CreatePrefOption(option)); }); } } @@ -72,8 +64,6 @@ export default function AddMenuPref(title) { l('menu').childNodes[2].insertBefore( frag, - l('menu').childNodes[2].childNodes[ - l('menu').childNodes[2].childNodes.length - 1 - ], + l('menu').childNodes[2].childNodes[l('menu').childNodes[2].childNodes.length - 1], ); } diff --git a/src/Disp/MenuSections/Statistics/AddStatsPage.js b/src/Disp/MenuSections/Statistics/AddStatsPage.js index 48d0e48..904ee90 100644 --- a/src/Disp/MenuSections/Statistics/AddStatsPage.js +++ b/src/Disp/MenuSections/Statistics/AddStatsPage.js @@ -64,9 +64,7 @@ export default function AddMenuStats(title) { const popAllFrag = document.createDocumentFragment(); popAllFrag.appendChild( document.createTextNode( - `${Beautify(CacheWrinklersTotal)} / ${Beautify( - CacheWrinklersNormal, - )} `, + `${Beautify(CacheWrinklersTotal)} / ${Beautify(CacheWrinklersNormal)} `, ), ); const popAllA = document.createElement('a'); @@ -77,31 +75,22 @@ export default function AddMenuStats(title) { }; popAllFrag.appendChild(popAllA); stats.appendChild( - CreateElements.StatsListing( - 'basic', - 'Rewards of Popping (All/Normal)', - popAllFrag, - ), + CreateElements.StatsListing('basic', 'Rewards of Popping (All/Normal)', popAllFrag), ); const popFattestFrag = document.createDocumentFragment(); - popFattestFrag.appendChild( - document.createTextNode(`${Beautify(CacheWrinklersFattest[0])} `), - ); + popFattestFrag.appendChild(document.createTextNode(`${Beautify(CacheWrinklersFattest[0])} `)); const popFattestA = document.createElement('a'); popFattestA.textContent = 'Pop Single Fattest'; popFattestA.className = 'option'; popFattestA.onclick = function () { - if (CacheWrinklersFattest[1] !== null) - Game.wrinklers[CacheWrinklersFattest[1]].hp = 0; + if (CacheWrinklersFattest[1] !== null) Game.wrinklers[CacheWrinklersFattest[1]].hp = 0; }; popFattestFrag.appendChild(popFattestA); stats.appendChild( CreateElements.StatsListing( 'basic', `Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ${ - CacheWrinklersFattest[1] !== null - ? CacheWrinklersFattest[1] - : 'None' + CacheWrinklersFattest[1] !== null ? CacheWrinklersFattest[1] : 'None' })`, popFattestFrag, ), @@ -128,9 +117,9 @@ export default function AddMenuStats(title) { stats.appendChild( CreateElements.StatsListing( 'basic', - `Average cookie clicks per second (past ${ - ClickTimes[CMOptions.AvgClicksHist] - }${CMOptions.AvgClicksHist === 0 ? ' second' : ' seconds'})`, + `Average cookie clicks per second (past ${ClickTimes[CMOptions.AvgClicksHist]}${ + CMOptions.AvgClicksHist === 0 ? ' second' : ' seconds' + })`, document.createTextNode(Beautify(CacheAverageClicks, 1)), ), ); @@ -181,9 +170,7 @@ export default function AddMenuStats(title) { Game.fps * 60 - (Game.OnAscend ? 0 : Game.T % (Game.fps * 60)), 4, ); - stats.appendChild( - CreateElements.StatsListing('basic', 'Time till autosave', timer), - ); + stats.appendChild(CreateElements.StatsListing('basic', 'Time till autosave', timer)); } } diff --git a/src/Disp/MenuSections/Statistics/CreateDOMElements.js b/src/Disp/MenuSections/Statistics/CreateDOMElements.js index ae36721..2fba825 100644 --- a/src/Disp/MenuSections/Statistics/CreateDOMElements.js +++ b/src/Disp/MenuSections/Statistics/CreateDOMElements.js @@ -64,10 +64,7 @@ export function StatsListing(type, name, text, placeholder) { Game.tooltip.hide(); }; tooltip.onmouseover = function () { - Game.tooltip.draw( - this, - escape(SimpleTooltipElements[placeholder].innerHTML), - ); + Game.tooltip.draw(this, escape(SimpleTooltipElements[placeholder].innerHTML)); }; tooltip.style.cursor = 'default'; tooltip.style.display = 'inline-block'; diff --git a/src/Disp/MenuSections/Statistics/CreateMissingAchievements.js b/src/Disp/MenuSections/Statistics/CreateMissingAchievements.js index e29dac6..b2c8ae4 100644 --- a/src/Disp/MenuSections/Statistics/CreateMissingAchievements.js +++ b/src/Disp/MenuSections/Statistics/CreateMissingAchievements.js @@ -7,8 +7,7 @@ function CrateTooltipLockedAchievements(me) { tags.push('Locked', 0); let neuromancy = 0; - if (Game.Has('Neuromancy') || (Game.sesame && me.pool === 'debug')) - neuromancy = 1; + if (Game.Has('Neuromancy') || (Game.sesame && me.pool === 'debug')) neuromancy = 1; if (neuromancy && me.won === 0) tags.push('Click to win!', '#00c462'); else if (neuromancy && me.won > 0) tags.push('Click to lose!', '#00c462'); @@ -21,9 +20,9 @@ function CrateTooltipLockedAchievements(me) { let tagsStr = ''; for (let i = 0; i < tags.length; i += 2) { if (i % 2 === 0) - tagsStr += `
[${tags[i]}]
`; + tagsStr += `
[${ + tags[i] + }]
`; } tagsStr = tagsStr.substring(1); @@ -35,9 +34,9 @@ function CrateTooltipLockedAchievements(me) { ${tagsStr}
${desc}
${ Game.sesame - ? `
Id : ${me.id} | Order : ${Math.floor( - me.order, - )}${me.tier ? ` | Tier : ${me.tier}` : ''}
` + ? `
Id : ${me.id} | Order : ${Math.floor(me.order)}${ + me.tier ? ` | Tier : ${me.tier}` : '' + }
` : '' }`; } @@ -58,9 +57,7 @@ export default function AddMissingAchievements() { const id = achievsCrate.onclick.toString().split(/\[(.*)\]/gi)[1]; const { icon } = Game.AchievementsById[id]; // eslint-disable-next-line no-param-reassign - achievsCrate.style.backgroundPosition = `${-icon[0] * 48}px ${ - -icon[1] * 48 - }px`; + achievsCrate.style.backgroundPosition = `${-icon[0] * 48}px ${-icon[1] * 48}px`; // eslint-disable-next-line no-param-reassign achievsCrate.onmouseover = function () { if (!Game.mouseDown) { @@ -68,10 +65,9 @@ export default function AddMissingAchievements() { Game.tooltip.dynamic = 1; Game.tooltip.draw( this, - () => (function () { - return CrateTooltipLockedAchievements( - Game.AchievementsById[id], - ); + () => + (function () { + return CrateTooltipLockedAchievements(Game.AchievementsById[id]); })(), 'top', ); diff --git a/src/Disp/MenuSections/Statistics/CreateMissingUpgrades.js b/src/Disp/MenuSections/Statistics/CreateMissingUpgrades.js index 86e32bd..4fbd959 100644 --- a/src/Disp/MenuSections/Statistics/CreateMissingUpgrades.js +++ b/src/Disp/MenuSections/Statistics/CreateMissingUpgrades.js @@ -12,22 +12,16 @@ import { export function AddMissingUpgrades() { l('menu').childNodes.forEach((menuSection) => { if (menuSection.children[0]) { - if ( - menuSection.children[0].innerHTML === 'Prestige' && - CacheMissingUpgradesPrestige - ) { + if (menuSection.children[0].innerHTML === 'Prestige' && CacheMissingUpgradesPrestige) { const prestigeUpgradesMissing = - CacheMissingUpgradesPrestige.match(new RegExp('div', 'g') || []) - .length / 2; + CacheMissingUpgradesPrestige.match(new RegExp('div', 'g') || []).length / 2; const title = document.createElement('div'); title.id = 'CMMissingUpgradesPrestigeTitle'; title.className = 'listing'; const titlefrag = document.createElement('div'); titlefrag.innerHTML = `Missing Prestige upgrades: ${prestigeUpgradesMissing}/${ Game.PrestigeUpgrades.length - } (${Math.floor( - (prestigeUpgradesMissing / Game.PrestigeUpgrades.length) * 100, - )}%)`; + } (${Math.floor((prestigeUpgradesMissing / Game.PrestigeUpgrades.length) * 100)}%)`; title.appendChild(titlefrag); menuSection.appendChild(title); const upgrades = document.createElement('div'); @@ -46,8 +40,7 @@ export function AddMissingUpgrades() { Game.UpgradesByPool[''].length + Game.UpgradesByPool.tech.length } (${Math.floor( (normalUpgradesMissing / - (Game.UpgradesByPool[''].length + - Game.UpgradesByPool.tech.length)) * + (Game.UpgradesByPool[''].length + Game.UpgradesByPool.tech.length)) * 100, )}%)`; title.appendChild(titlefrag); @@ -62,17 +55,14 @@ export function AddMissingUpgrades() { } if (CacheMissingUpgradesCookies) { const cookieUpgradesMissing = - CacheMissingUpgradesCookies.match(new RegExp('div', 'g') || []) - .length / 2; + CacheMissingUpgradesCookies.match(new RegExp('div', 'g') || []).length / 2; const title = document.createElement('div'); title.id = 'CMMissingUpgradesCookiesTitle'; title.className = 'listing'; const titlefrag = document.createElement('div'); titlefrag.innerHTML = `Missing Cookie upgrades: ${cookieUpgradesMissing}/${ Game.UpgradesByPool.cookie.length - } (${Math.floor( - (cookieUpgradesMissing / Game.UpgradesByPool.cookie.length) * 100, - )}%)`; + } (${Math.floor((cookieUpgradesMissing / Game.UpgradesByPool.cookie.length) * 100)}%)`; title.appendChild(titlefrag); menuSection.appendChild(title); const upgrades = document.createElement('div'); @@ -104,8 +94,8 @@ export function crateMissing(me) { const tooltip = `function() {return Game.crateTooltip(Game.UpgradesById[${me.id}], 'stats');}`; return `
+ style = "${`${icon[2] ? `background-image: url(${icon[2]});` : ''}background-position:${ + -icon[0] * 48 + }px ${-icon[1] * 48}px`};">
`; } diff --git a/src/Disp/MenuSections/Statistics/CreateStatsSections.js b/src/Disp/MenuSections/Statistics/CreateStatsSections.js index 09af9d8..84ff22d 100644 --- a/src/Disp/MenuSections/Statistics/CreateStatsSections.js +++ b/src/Disp/MenuSections/Statistics/CreateStatsSections.js @@ -58,13 +58,10 @@ export function LuckySection() { const section = document.createElement('div'); section.className = 'CMStatsLuckySection'; - const luckyColour = - Game.cookies + GetWrinkConfigBank() < CacheLucky ? ColourRed : ColourGreen; + const luckyColour = Game.cookies + GetWrinkConfigBank() < CacheLucky ? ColourRed : ColourGreen; const luckyTime = Game.cookies + GetWrinkConfigBank() < CacheLucky - ? FormatTime( - (CacheLucky - (Game.cookies + GetWrinkConfigBank())) / GetCPS(), - ) + ? FormatTime((CacheLucky - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : ''; const luckyReqFrag = document.createDocumentFragment(); const luckyReqSpan = document.createElement('span'); @@ -78,23 +75,14 @@ export function LuckySection() { luckyReqFrag.appendChild(luckyReqSmall); } section.appendChild( - StatsListing( - 'withTooltip', - '"Lucky!" cookies required', - luckyReqFrag, - goldCookTooltip, - ), + StatsListing('withTooltip', '"Lucky!" cookies required', luckyReqFrag, goldCookTooltip), ); const luckyColourFrenzy = - Game.cookies + GetWrinkConfigBank() < CacheLuckyFrenzy - ? ColourRed - : ColourGreen; + Game.cookies + GetWrinkConfigBank() < CacheLuckyFrenzy ? ColourRed : ColourGreen; const luckyTimeFrenzy = Game.cookies + GetWrinkConfigBank() < CacheLuckyFrenzy - ? FormatTime( - (CacheLuckyFrenzy - (Game.cookies + GetWrinkConfigBank())) / GetCPS(), - ) + ? FormatTime((CacheLuckyFrenzy - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : ''; const luckyReqFrenFrag = document.createDocumentFragment(); const luckyReqFrenSpan = document.createElement('span'); @@ -122,8 +110,7 @@ export function LuckySection() { luckyRewardMaxSpan.style.fontWeight = 'bold'; luckyRewardMaxSpan.className = ColourTextPre + CacheLuckyReward; luckyRewardMaxSpan.textContent = - Beautify(CacheLuckyReward) + - (luckySplit ? ` / ${Beautify(CacheLuckyWrathReward)}` : ''); + Beautify(CacheLuckyReward) + (luckySplit ? ` / ${Beautify(CacheLuckyWrathReward)}` : ''); section.appendChild( StatsListing( 'withTooltip', @@ -184,15 +171,10 @@ export function ChainSection() { section.className = 'CMStatsChainSection'; const chainColour = - Game.cookies + GetWrinkConfigBank() < CacheChainRequired - ? ColourRed - : ColourGreen; + Game.cookies + GetWrinkConfigBank() < CacheChainRequired ? ColourRed : ColourGreen; const chainTime = Game.cookies + GetWrinkConfigBank() < CacheChainRequired - ? FormatTime( - (CacheChainRequired - (Game.cookies + GetWrinkConfigBank())) / - GetCPS(), - ) + ? FormatTime((CacheChainRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : ''; const chainReqFrag = document.createDocumentFragment(); const chainReqSpan = document.createElement('span'); @@ -206,24 +188,14 @@ export function ChainSection() { chainReqFrag.appendChild(chainReqSmall); } section.appendChild( - StatsListing( - 'withTooltip', - '"Chain" cookies required', - chainReqFrag, - goldCookTooltip, - ), + StatsListing('withTooltip', '"Chain" cookies required', chainReqFrag, goldCookTooltip), ); const chainWrathColour = - Game.cookies + GetWrinkConfigBank() < CacheChainWrathRequired - ? ColourRed - : ColourGreen; + Game.cookies + GetWrinkConfigBank() < CacheChainWrathRequired ? ColourRed : ColourGreen; const chainWrathTime = Game.cookies + GetWrinkConfigBank() < CacheChainWrathRequired - ? FormatTime( - (CacheChainWrathRequired - (Game.cookies + GetWrinkConfigBank())) / - GetCPS(), - ) + ? FormatTime((CacheChainWrathRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : ''; const chainWrathReqFrag = document.createDocumentFragment(); const chainWrathReqSpan = document.createElement('span'); @@ -246,15 +218,10 @@ export function ChainSection() { ); const chainColourFrenzy = - Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyRequired - ? ColourRed - : ColourGreen; + Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyRequired ? ColourRed : ColourGreen; const chainTimeFrenzy = Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyRequired - ? FormatTime( - (CacheChainFrenzyRequired - (Game.cookies + GetWrinkConfigBank())) / - GetCPS(), - ) + ? FormatTime((CacheChainFrenzyRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : ''; const chainReqFrenFrag = document.createDocumentFragment(); const chainReqFrenSpan = document.createElement('span'); @@ -277,15 +244,11 @@ export function ChainSection() { ); const chainWrathColourFrenzy = - Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyWrathRequired - ? ColourRed - : ColourGreen; + Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyWrathRequired ? ColourRed : ColourGreen; const chainWrathTimeFrenzy = Game.cookies + GetWrinkConfigBank() < CacheChainFrenzyWrathRequired ? FormatTime( - (CacheChainFrenzyWrathRequired - - (Game.cookies + GetWrinkConfigBank())) / - GetCPS(), + (CacheChainFrenzyWrathRequired - (Game.cookies + GetWrinkConfigBank())) / GetCPS(), ) : ''; const chainWrathReqFrenFrag = document.createDocumentFragment(); @@ -313,9 +276,7 @@ export function ChainSection() { 'withTooltip', '"Chain" reward (max) (golden / wrath)', document.createTextNode( - `${Beautify(CacheChainMaxReward[0])} / ${Beautify( - CacheChainWrathMaxReward[0], - )}`, + `${Beautify(CacheChainMaxReward[0])} / ${Beautify(CacheChainWrathMaxReward[0])}`, ), goldCookTooltip, ), @@ -326,9 +287,7 @@ export function ChainSection() { 'withTooltip', '"Chain" reward (max) (frenzy) (golden / wrath)', document.createTextNode( - `${Beautify(CacheChainFrenzyMaxReward[0])} / ${Beautify( - CacheChainFrenzyMaxReward[0], - )}`, + `${Beautify(CacheChainFrenzyMaxReward[0])} / ${Beautify(CacheChainFrenzyMaxReward[0])}`, ), goldCookTooltip, ), @@ -338,23 +297,13 @@ export function ChainSection() { Game.cookiesPs * 60 * 60 * 6 * CacheDragonsFortuneMultAdjustment, Game.cookies * 0.5, ); - const chainCur = MaxChainCookieReward( - 7, - chainCurMax, - CacheGoldenCookiesMult, - )[0]; - const chainCurWrath = MaxChainCookieReward( - 6, - chainCurMax, - CacheWrathCookiesMult, - )[0]; + const chainCur = MaxChainCookieReward(7, chainCurMax, CacheGoldenCookiesMult)[0]; + const chainCurWrath = MaxChainCookieReward(6, chainCurMax, CacheWrathCookiesMult)[0]; section.appendChild( StatsListing( 'withTooltip', '"Chain" reward (cur) (golden / wrath)', - document.createTextNode( - `${Beautify(chainCur)} / ${Beautify(chainCurWrath)}`, - ), + document.createTextNode(`${Beautify(chainCur)} / ${Beautify(chainCurWrath)}`), goldCookTooltip, ), ); @@ -364,9 +313,7 @@ export function ChainSection() { 'withTooltip', 'CPS needed for next level (g / w)', document.createTextNode( - `${Beautify(CacheChainRequiredNext)} / ${Beautify( - CacheChainWrathRequiredNext, - )}`, + `${Beautify(CacheChainRequiredNext)} / ${Beautify(CacheChainWrathRequiredNext)}`, ), 'ChainNextLevelPlaceholder', ), @@ -395,14 +342,10 @@ export function SpellsSection() { section.className = 'CMStatsSpellsSection'; const conjureColour = - Game.cookies + GetWrinkConfigBank() < CacheConjure - ? ColourRed - : ColourGreen; + Game.cookies + GetWrinkConfigBank() < CacheConjure ? ColourRed : ColourGreen; const conjureTime = Game.cookies + GetWrinkConfigBank() < CacheConjure - ? FormatTime( - (CacheConjure - (Game.cookies + GetWrinkConfigBank())) / GetCPS(), - ) + ? FormatTime((CacheConjure - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : ''; const conjureReqFrag = document.createDocumentFragment(); @@ -434,18 +377,14 @@ export function SpellsSection() { ); const conjureFrenzyColour = - Game.cookies + GetWrinkConfigBank() < CacheConjure * 7 - ? ColourRed - : ColourGreen; + Game.cookies + GetWrinkConfigBank() < CacheConjure * 7 ? ColourRed : ColourGreen; const conjureFrenzyCur = Math.min( (Game.cookies + GetWrinkConfigBank()) * 0.15, CacheNoGoldSwitchCookiesPS * 60 * 30, ); const conjureFrenzyTime = Game.cookies + GetWrinkConfigBank() < CacheConjure * 7 - ? FormatTime( - (CacheConjure * 7 - (Game.cookies + GetWrinkConfigBank())) / GetCPS(), - ) + ? FormatTime((CacheConjure * 7 - (Game.cookies + GetWrinkConfigBank())) / GetCPS()) : ''; const conjureFrenzyReqFrag = document.createDocumentFragment(); @@ -488,9 +427,7 @@ export function SpellsSection() { StatsListing( 'withTooltip', '"Spontaneous Edifice" cookies required (most expensive building)', - document.createTextNode( - `${Beautify(CacheEdifice)} (${CacheEdificeBuilding})`, - ), + document.createTextNode(`${Beautify(CacheEdifice)} (${CacheEdificeBuilding})`), 'GoldCookTooltipPlaceholder', ), ); @@ -506,60 +443,40 @@ export function GardenSection() { const section = document.createElement('div'); section.className = 'CMStatsGardenSection'; - const bakeberryColour = - Game.cookies < Game.cookiesPs * 60 * 10 * 100 ? ColourRed : ColourGreen; + const bakeberryColour = Game.cookies < Game.cookiesPs * 60 * 10 * 100 ? ColourRed : ColourGreen; const bakeberryFrag = document.createElement('span'); bakeberryFrag.style.fontWeight = 'bold'; bakeberryFrag.className = ColourTextPre + bakeberryColour; bakeberryFrag.textContent = Beautify(Game.cookiesPs * 60 * 10 * 100); section.appendChild( - StatsListing( - 'basic', - 'Cookies required for max reward of Bakeberry: ', - bakeberryFrag, - ), + StatsListing('basic', 'Cookies required for max reward of Bakeberry: ', bakeberryFrag), ); - const chocorootColour = - Game.cookies < Game.cookiesPs * 60 * 100 ? ColourRed : ColourGreen; + const chocorootColour = Game.cookies < Game.cookiesPs * 60 * 100 ? ColourRed : ColourGreen; const chocorootFrag = document.createElement('span'); chocorootFrag.style.fontWeight = 'bold'; chocorootFrag.className = ColourTextPre + chocorootColour; chocorootFrag.textContent = Beautify(Game.cookiesPs * 60 * 100); section.appendChild( - StatsListing( - 'basic', - 'Cookies required for max reward of Chocoroot: ', - chocorootFrag, - ), + StatsListing('basic', 'Cookies required for max reward of Chocoroot: ', chocorootFrag), ); - const queenbeetColour = - Game.cookies < Game.cookiesPs * 60 * 60 * 25 ? ColourRed : ColourGreen; + const queenbeetColour = Game.cookies < Game.cookiesPs * 60 * 60 * 25 ? ColourRed : ColourGreen; const queenbeetFrag = document.createElement('span'); queenbeetFrag.style.fontWeight = 'bold'; queenbeetFrag.className = ColourTextPre + queenbeetColour; queenbeetFrag.textContent = Beautify(Game.cookiesPs * 60 * 60 * 25); section.appendChild( - StatsListing( - 'basic', - 'Cookies required for max reward of Queenbeet: ', - queenbeetFrag, - ), + StatsListing('basic', 'Cookies required for max reward of Queenbeet: ', queenbeetFrag), ); - const duketaterColour = - Game.cookies < Game.cookiesPs * 60 * 15 * 100 ? ColourRed : ColourGreen; + const duketaterColour = Game.cookies < Game.cookiesPs * 60 * 15 * 100 ? ColourRed : ColourGreen; const duketaterFrag = document.createElement('span'); duketaterFrag.style.fontWeight = 'bold'; duketaterFrag.className = ColourTextPre + duketaterColour; duketaterFrag.textContent = Beautify(Game.cookiesPs * 60 * 15 * 100); section.appendChild( - StatsListing( - 'basic', - 'Cookies required for max reward of Duketater: ', - duketaterFrag, - ), + StatsListing('basic', 'Cookies required for max reward of Duketater: ', duketaterFrag), ); const missingPlantDrops = []; Object.keys(GameData.PlantDrops).forEach((i) => { @@ -569,11 +486,7 @@ export function GardenSection() { }); if (missingPlantDrops.length !== 0) { section.appendChild( - StatsListing( - 'basic', - 'Rare plant drops left to unlock', - StatsMissDisp(missingPlantDrops), - ), + StatsListing('basic', 'Rare plant drops left to unlock', StatsMissDisp(missingPlantDrops)), ); } return section; @@ -592,18 +505,14 @@ export function PrestigeSection() { CacheRealCookiesEarned + Game.cookiesReset + CacheWrinklersTotal + - (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') - ? CacheLastChoEgg - : 0), + (Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? CacheLastChoEgg : 0), ), ); section.appendChild( StatsListing( 'withTooltip', 'Prestige level (cur / max)', - document.createTextNode( - `${Beautify(Game.prestige)} / ${Beautify(possiblePresMax)}`, - ), + document.createTextNode(`${Beautify(Game.prestige)} / ${Beautify(possiblePresMax)}`), 'PrestMaxTooltipPlaceholder', ), ); @@ -614,21 +523,14 @@ export function PrestigeSection() { (CacheRealCookiesEarned + Game.cookiesReset + CacheWrinklersTotal + - (( - Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') - ? CacheLastChoEgg - : 0 - ) + ((Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg') ? CacheLastChoEgg : 0) ? CacheLastChoEgg : 0)), ); const cookiesNextFrag = document.createDocumentFragment(); cookiesNextFrag.appendChild(document.createTextNode(Beautify(neededCook))); const cookiesNextSmall = document.createElement('small'); - cookiesNextSmall.textContent = ` (${FormatTime( - neededCook / CacheAvgCPSWithChoEgg, - 1, - )})`; + cookiesNextSmall.textContent = ` (${FormatTime(neededCook / CacheAvgCPSWithChoEgg, 1)})`; cookiesNextFrag.appendChild(cookiesNextSmall); section.appendChild( StatsListing( @@ -663,8 +565,7 @@ export function PrestigeSection() { const HCTarget = Number(CMOptions.HeavenlyChipsTarget); if (!Number.isNaN(HCTarget)) { const CookiesTillTarget = - HCTarget - - Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)); + HCTarget - Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)); if (CookiesTillTarget > 0) { section.appendChild( StatsListing( @@ -677,9 +578,7 @@ export function PrestigeSection() { StatsListing( 'basic', 'Time till target (cur, current 5 second average)', - document.createTextNode( - FormatTime(CookiesTillTarget / CacheHCPerSecond), - ), + document.createTextNode(FormatTime(CookiesTillTarget / CacheHCPerSecond)), ), ); } @@ -695,18 +594,11 @@ export function PrestigeSection() { resetFrag.appendChild(resetSmall); } section.appendChild( - StatsListing( - 'withTooltip', - 'Reset bonus income', - resetFrag, - 'ResetTooltipPlaceholder', - ), + StatsListing('withTooltip', 'Reset bonus income', resetFrag, 'ResetTooltipPlaceholder'), ); const currentPrestige = Math.floor(Game.HowMuchPrestige(Game.cookiesReset)); - const willHave = Math.floor( - Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned), - ); + const willHave = Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)); const willGet = willHave - currentPrestige; if (!Game.Has('Lucky digit')) { let delta7 = 7 - (willHave % 10); @@ -719,9 +611,7 @@ export function PrestigeSection() { `${next7Total.toLocaleString()} / ${next7Reset.toLocaleString()} (+${delta7})`, ), ); - section.appendChild( - StatsListing('basic', 'Next "Lucky Digit" (total / reset)', frag7), - ); + section.appendChild(StatsListing('basic', 'Next "Lucky Digit" (total / reset)', frag7)); } if (!Game.Has('Lucky number')) { @@ -735,9 +625,7 @@ export function PrestigeSection() { `${next777Total.toLocaleString()} / ${next777Reset.toLocaleString()} (+${delta777})`, ), ); - section.appendChild( - StatsListing('basic', 'Next "Lucky Number" (total / reset)', frag777), - ); + section.appendChild(StatsListing('basic', 'Next "Lucky Number" (total / reset)', frag777)); } if (!Game.Has('Lucky payout')) { @@ -751,9 +639,7 @@ export function PrestigeSection() { `${next777777Total.toLocaleString()} / ${next777777Reset.toLocaleString()} (+${delta777777})`, ), ); - section.appendChild( - StatsListing('basic', 'Next "Lucky Payout" (total / reset)', frag777777), - ); + section.appendChild(StatsListing('basic', 'Next "Lucky Payout" (total / reset)', frag777777)); } return section; @@ -803,8 +689,7 @@ export function SeasonSection() { specDisp = true; } }); - const choEgg = - Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg'); + const choEgg = Game.HasUnlocked('Chocolate egg') && !Game.Has('Chocolate egg'); const centEgg = Game.Has('Century egg'); if (Game.season === 'christmas' || specDisp || choEgg || centEgg) { @@ -834,9 +719,7 @@ export function SeasonSection() { 'basic', 'Chance of receiving a cookie from wrinkler/shiny wrinkler', document.createTextNode( - `${Beautify( - (1 - failRateHalloween) * obtainedCookiesChance * 100, - )}% / ${Beautify( + `${Beautify((1 - failRateHalloween) * obtainedCookiesChance * 100)}% / ${Beautify( (1 - failRateHalloween * 0.9) * obtainedCookiesChance * 100, )}%`, ), @@ -867,9 +750,7 @@ export function SeasonSection() { 'basic', 'Chance of receiving a cookie from reindeer', document.createTextNode( - `${Beautify( - (1 - failRateChristmas) * obtainedCookiesChance * 100, - )}%`, + `${Beautify((1 - failRateChristmas) * obtainedCookiesChance * 100)}%`, ), ), ); @@ -897,23 +778,14 @@ export function SeasonSection() { // Calculations courtesy of @svschouw, at https://github.com/Aktanusa/CookieMonster/issues/25 const succesRateEgg = 1 - failRateEgg; const obtainedEggs = Game.eggDrops.length - missingNormalEggs.length; - const obtainedRareEggs = - Game.rareEggDrops.length - missingRareEggs.length; - const pNormal1 = - succesRateEgg * 0.9 * (1 - obtainedEggs / Game.eggDrops.length); - const pRare1 = - succesRateEgg * - 0.1 * - (1 - obtainedRareEggs / Game.rareEggDrops.length); - const pRedropNormal = - succesRateEgg * 0.9 * (obtainedEggs / Game.eggDrops.length); - const pRedropRare = - succesRateEgg * 0.1 * (obtainedRareEggs / Game.rareEggDrops.length); + const obtainedRareEggs = Game.rareEggDrops.length - missingRareEggs.length; + const pNormal1 = succesRateEgg * 0.9 * (1 - obtainedEggs / Game.eggDrops.length); + const pRare1 = succesRateEgg * 0.1 * (1 - obtainedRareEggs / Game.rareEggDrops.length); + const pRedropNormal = succesRateEgg * 0.9 * (obtainedEggs / Game.eggDrops.length); + const pRedropRare = succesRateEgg * 0.1 * (obtainedRareEggs / Game.rareEggDrops.length); const pRedrop = pRedropNormal + pRedropRare; - const pNormal2 = - pRedrop * 0.9 * (1 - obtainedEggs / Game.eggDrops.length); - const pRare2 = - pRedrop * 0.1 * (1 - obtainedRareEggs / Game.rareEggDrops.length); + const pNormal2 = pRedrop * 0.9 * (1 - obtainedEggs / Game.eggDrops.length); + const pRare2 = pRedrop * 0.1 * (1 - obtainedRareEggs / Game.rareEggDrops.length); return [pNormal1 + pNormal2, pRare1 + pRare2]; }; if (missingNormalEggs.length !== 0) { @@ -929,29 +801,21 @@ export function SeasonSection() { 'basic', 'Chance of receiving an egg from wrinkler/golden cookie', document.createTextNode( - `${Beautify(dropRateEgg(0.98)[0] * 100)}% / ${Beautify( - dropRateEgg(0.9)[0] * 100, - )}%`, + `${Beautify(dropRateEgg(0.98)[0] * 100)}% / ${Beautify(dropRateEgg(0.9)[0] * 100)}%`, ), ), ); } if (missingRareEggs.length !== 0) { section.appendChild( - StatsListing( - 'basic', - 'Rare easter eggs left to unlock', - StatsMissDisp(missingRareEggs), - ), + StatsListing('basic', 'Rare easter eggs left to unlock', StatsMissDisp(missingRareEggs)), ); section.appendChild( StatsListing( 'basic', 'Chance of receiving a rare egg from wrinkler/golden cookie', document.createTextNode( - `${Beautify(dropRateEgg(0.98)[1] * 100)}% / ${Beautify( - dropRateEgg(0.9)[1] * 100, - )}%`, + `${Beautify(dropRateEgg(0.98)[1] * 100)}% / ${Beautify(dropRateEgg(0.9)[1] * 100)}%`, ), ), ); @@ -959,11 +823,7 @@ export function SeasonSection() { if (Game.season === 'christmas') section.appendChild( - StatsListing( - 'basic', - 'Reindeer reward', - document.createTextNode(Beautify(CacheSeaSpec)), - ), + StatsListing('basic', 'Reindeer reward', document.createTextNode(Beautify(CacheSeaSpec))), ); if (choEgg) { section.appendChild( @@ -980,9 +840,7 @@ export function SeasonSection() { StatsListing( 'basic', 'Century egg multiplier', - document.createTextNode( - `${Math.round((CacheCentEgg - 1) * 10000) / 100}%`, - ), + document.createTextNode(`${Math.round((CacheCentEgg - 1) * 10000) / 100}%`), ), ); } diff --git a/src/Disp/Notifications/Flash.js b/src/Disp/Notifications/Flash.js index 73d0cec..881f730 100644 --- a/src/Disp/Notifications/Flash.js +++ b/src/Disp/Notifications/Flash.js @@ -12,9 +12,7 @@ import { isInitializing } from '../../InitSaveLoad/Variables'; export default function Flash(mode, config, forced) { // The arguments check makes the sound not play upon initialization of the mod if ( - ((CMOptions[config] === 1 || forced) && - mode === 3 && - isInitializing === false) || + ((CMOptions[config] === 1 || forced) && mode === 3 && isInitializing === false) || mode === 1 ) { l('CMFlashScreen').style.backgroundColor = CMOptions[`Colour${config}`]; diff --git a/src/Disp/Notifications/Sound.js b/src/Disp/Notifications/Sound.js index c76df66..03cf684 100644 --- a/src/Disp/Notifications/Sound.js +++ b/src/Disp/Notifications/Sound.js @@ -14,8 +14,7 @@ export default function PlaySound(url, sndConfig, volConfig, forced) { if ((CMOptions[sndConfig] === 1 || forced) && isInitializing === false) { // eslint-disable-next-line new-cap const sound = new Audio(url); - if (CMOptions.GeneralSound) - sound.volume = (CMOptions[volConfig] / 100) * (Game.volume / 100); + if (CMOptions.GeneralSound) sound.volume = (CMOptions[volConfig] / 100) * (Game.volume / 100); else sound.volume = CMOptions[volConfig] / 100; sound.play(); } diff --git a/src/Disp/TabTitle/FavIcon.js b/src/Disp/TabTitle/FavIcon.js index f80bc24..227a4b2 100644 --- a/src/Disp/TabTitle/FavIcon.js +++ b/src/Disp/TabTitle/FavIcon.js @@ -20,12 +20,7 @@ export function CreateFavicon() { export function UpdateFavicon() { if (CMOptions.Favicon === 1 && LastGoldenCookieState > 0) { if (CacheSpawnedGoldenShimmer.wrath) - l('CMFavicon').href = - 'https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico'; - else - l('CMFavicon').href = - 'https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico'; - } else - l('CMFavicon').href = - 'https://orteil.dashnet.org/cookieclicker/favicon.ico'; + l('CMFavicon').href = 'https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico'; + else l('CMFavicon').href = 'https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico'; + } else l('CMFavicon').href = 'https://orteil.dashnet.org/cookieclicker/favicon.ico'; } diff --git a/src/Disp/TabTitle/TabTitle.js b/src/Disp/TabTitle/TabTitle.js index 8dd4259..6979fda 100644 --- a/src/Disp/TabTitle/TabTitle.js +++ b/src/Disp/TabTitle/TabTitle.js @@ -1,14 +1,8 @@ /** Functions related to updating the tab in the browser's tab-bar */ -import { - CacheSeasonPopShimmer, - CacheSpawnedGoldenShimmer, -} from '../../Cache/VariablesAndData'; +import { CacheSeasonPopShimmer, CacheSpawnedGoldenShimmer } from '../../Cache/VariablesAndData'; import { CMOptions } from '../../Config/VariablesAndData'; -import { - LastSeasonPopupState, - LastTickerFortuneState, -} from '../../Main/VariablesAndData'; +import { LastSeasonPopupState, LastTickerFortuneState } from '../../Main/VariablesAndData'; import { Title } from '../VariablesAndData'; /** @@ -28,14 +22,10 @@ export default function UpdateTitle() { if (CacheSpawnedGoldenShimmer) { if (CacheSpawnedGoldenShimmer.wrath) titleGC = `[W${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`; - else - titleGC = `[G${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`; + else titleGC = `[G${Math.ceil(CacheSpawnedGoldenShimmer.life / Game.fps)}]`; } else if (!Game.Has('Golden switch [off]')) { - titleGC = `[${ - Number(l('CMTimerBarGCMinBar').textContent) < 0 ? '!' : '' - }${Math.ceil( - (Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / - Game.fps, + titleGC = `[${Number(l('CMTimerBarGCMinBar').textContent) < 0 ? '!' : ''}${Math.ceil( + (Game.shimmerTypes.golden.maxTime - Game.shimmerTypes.golden.time) / Game.fps, )}]`; } else titleGC = '[GS]'; @@ -46,15 +36,10 @@ export default function UpdateTitle() { if (Game.season === 'christmas') { addSP = true; - if (LastSeasonPopupState) - titleSP = `[R${Math.ceil(CacheSeasonPopShimmer.life / Game.fps)}]`; + if (LastSeasonPopupState) titleSP = `[R${Math.ceil(CacheSeasonPopShimmer.life / Game.fps)}]`; else { - titleSP = `[${ - Number(l('CMTimerBarRenMinBar').textContent) < 0 ? '!' : '' - }${Math.ceil( - (Game.shimmerTypes.reindeer.maxTime - - Game.shimmerTypes.reindeer.time) / - Game.fps, + titleSP = `[${Number(l('CMTimerBarRenMinBar').textContent) < 0 ? '!' : ''}${Math.ceil( + (Game.shimmerTypes.reindeer.maxTime - Game.shimmerTypes.reindeer.time) / Game.fps, )}]`; } } @@ -64,9 +49,7 @@ export default function UpdateTitle() { if (str.charAt(0) === '[') { str = str.substring(str.lastIndexOf(']') + 1); } - document.title = `${ - titleGC + (addFC ? titleFC : '') + (addSP ? titleSP : '') - } ${str}`; + document.title = `${titleGC + (addFC ? titleFC : '') + (addSP ? titleSP : '')} ${str}`; } else if (CMOptions.Title === 2) { let str = ''; let spawn = false; diff --git a/src/Disp/Tooltips/AscendButton.js b/src/Disp/Tooltips/AscendButton.js index 8e796a5..044c7b7 100644 --- a/src/Disp/Tooltips/AscendButton.js +++ b/src/Disp/Tooltips/AscendButton.js @@ -15,44 +15,35 @@ export default function ReplaceAscendTooltip() { const cookiesToNext = Math.max( 0, Game.HowManyCookiesReset( - Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + - 1, + Math.floor(Game.HowMuchPrestige(Game.cookiesReset + Game.cookiesEarned)) + 1, ) - (Game.cookiesEarned + Game.cookiesReset), ); - const startDate = Game.sayTime( - ((Date.now() - Game.startDate) / 1000) * Game.fps, - -1, - ); + const startDate = Game.sayTime(((Date.now() - Game.startDate) / 1000) * Game.fps, -1); let str = ''; str += `You've been on this run for ${ startDate === '' ? 'not very long' : startDate }.
`; str += '
'; if (Game.prestige > 0) { - str += `Your prestige level is currently ${Beautify( + str += `Your prestige level is currently ${Beautify(Game.prestige)}.
(CpS +${Beautify( Game.prestige, - )}
.
(CpS +${Beautify(Game.prestige)}%)`; + )}%)`; str += '
'; } - if (CacheLastHeavenlyChips < 1) - str += 'Ascending now would grant you no prestige.'; + if (CacheLastHeavenlyChips < 1) str += 'Ascending now would grant you no prestige.'; else if (CacheLastHeavenlyChips < 2) str += 'Ascending now would grant you
1 prestige level (+1% CpS)
and 1 heavenly chip to spend.'; else str += `Ascending now would grant you
${Beautify( CacheLastHeavenlyChips, - )} prestige levels (+${Beautify( - CacheLastHeavenlyChips, - )}% CpS)
and ${Beautify( + )} prestige levels (+${Beautify(CacheLastHeavenlyChips)}% CpS)
and ${Beautify( CacheLastHeavenlyChips, )} heavenly chips to spend.`; str += '
'; - str += `You need ${Beautify( - cookiesToNext, - )} more cookies for the next level.
`; + str += `You need ${Beautify(cookiesToNext)} more cookies for the next level.
`; str += `${ CMOptions.TooltipAscendButton ? `
It takes ${CacheTimeTillNextPrestige} to reach the next level and you were making ${Beautify( diff --git a/src/Disp/Tooltips/Tooltip.js b/src/Disp/Tooltips/Tooltip.js index f26ea46..577912c 100644 --- a/src/Disp/Tooltips/Tooltip.js +++ b/src/Disp/Tooltips/Tooltip.js @@ -1,9 +1,5 @@ import UpdateTooltips from './UpdateTooltips'; -import { - SimpleTooltipElements, - TooltipName, - TooltipType, -} from '../VariablesAndData'; +import { SimpleTooltipElements, TooltipName, TooltipType } from '../VariablesAndData'; import { CMOptions } from '../../Config/VariablesAndData'; import BuildingGetPrice from '../../Sim/SimulationEvents/BuyBuilding'; import GetTimeColour from '../BeautifyAndFormatting/GetTimeColour'; @@ -93,32 +89,20 @@ export function CreateTooltip(type, name) { } else if (type === 'u') { // Upgrades if (!Game.UpgradesInStore[name]) return ''; - l('tooltip').innerHTML = Game.crateTooltip( - Game.UpgradesInStore[name], - 'store', - ); + l('tooltip').innerHTML = Game.crateTooltip(Game.UpgradesInStore[name], 'store'); } else if (type === 's') l('tooltip').innerHTML = Game.lumpTooltip(); // Sugar Lumps else if (type === 'g') - l('tooltip').innerHTML = Game.Objects['Wizard tower'].minigame.spellTooltip( - name, - )(); + l('tooltip').innerHTML = Game.Objects['Wizard tower'].minigame.spellTooltip(name)(); // Grimoire else if (type === 'p') - l('tooltip').innerHTML = Game.ObjectsById[2].minigame.tileTooltip( - name[0], - name[1], - )(); + l('tooltip').innerHTML = Game.ObjectsById[2].minigame.tileTooltip(name[0], name[1])(); // Harvest all button in garden - else if (type === 'ha') - l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)(); + else if (type === 'ha') l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)(); else if (type === 'wb') l('tooltip').innerHTML = ''; - else if (type === 'pag') - l('tooltip').innerHTML = Game.Objects.Temple.minigame.godTooltip(name)(); + else if (type === 'pag') l('tooltip').innerHTML = Game.Objects.Temple.minigame.godTooltip(name)(); else if (type === 'pas') - l('tooltip').innerHTML = Game.Objects.Temple.minigame.slotTooltip( - name[0], - )(); + l('tooltip').innerHTML = Game.Objects.Temple.minigame.slotTooltip(name[0])(); // Adds area for extra tooltip-sections if ( diff --git a/src/Disp/Tooltips/TypesOfTooltips/Building.js b/src/Disp/Tooltips/TypesOfTooltips/Building.js index 5f64a53..ece296e 100644 --- a/src/Disp/Tooltips/TypesOfTooltips/Building.js +++ b/src/Disp/Tooltips/TypesOfTooltips/Building.js @@ -45,9 +45,7 @@ export default function Building() { if (CMOptions.TooltipBuildUpgrade === 1 && Game.buyMode === 1) { l('CMTooltipIncome').textContent = Beautify(TooltipBonusIncome, 2); - const increase = Math.round( - (TooltipBonusIncome / Game.cookiesPs) * 10000, - ); + const increase = Math.round((TooltipBonusIncome / Game.cookiesPs) * 10000); if (Number.isFinite(increase) && increase !== 0) { l('CMTooltipIncome').textContent += ` (${increase / 100}% of income)`; } else { @@ -55,8 +53,7 @@ export default function Building() { CMOptions.ScaleSeparator ? ',' : '.' }01% of income)`; } - l('CMTooltipBorder').className = - ColourTextPre + target[TooltipName].color; + l('CMTooltipBorder').className = ColourTextPre + target[TooltipName].color; if (CMOptions.PPDisplayTime) l('CMTooltipPP').textContent = FormatTime(target[TooltipName].pp); else l('CMTooltipPP').textContent = Beautify(target[TooltipName].pp, 2); @@ -65,10 +62,7 @@ export default function Building() { (TooltipPrice - (Game.cookies + GetWrinkConfigBank())) / GetCPS(), ); l('CMTooltipTime').textContent = timeColour.text; - if ( - timeColour.text === 'Done!' && - Game.cookies < target[TooltipName].price - ) { + if (timeColour.text === 'Done!' && Game.cookies < target[TooltipName].price) { l('CMTooltipTime').textContent = `${timeColour.text} (with Wrink)`; } else l('CMTooltipTime').textContent = timeColour.text; l('CMTooltipTime').className = ColourTextPre + timeColour.color; @@ -80,18 +74,11 @@ export default function Building() { // eslint-disable-next-line no-restricted-syntax for (const i of Object.keys(Game.Objects[TooltipName].productionAchievs)) { - if ( - !Game.HasAchiev( - Game.Objects[TooltipName].productionAchievs[i].achiev.name, - ) - ) { - const nextProductionAchiev = - Game.Objects[TooltipName].productionAchievs[i]; + if (!Game.HasAchiev(Game.Objects[TooltipName].productionAchievs[i].achiev.name)) { + const nextProductionAchiev = Game.Objects[TooltipName].productionAchievs[i]; l('CMTooltipTime').style.marginBottom = '4px'; l('CMTooltipProductionLeftHeader').style.display = ''; - l( - 'CMTooltipProductionLeft', - ).className = `ProdAchievement${TooltipName}`; + l('CMTooltipProductionLeft').className = `ProdAchievement${TooltipName}`; l('CMTooltipProductionLeft').textContent = Beautify( nextProductionAchiev.pow - SimObjects[TooltipName].totalCookies, 15, @@ -109,10 +96,7 @@ export default function Building() { let PPOfAmount; if (Game.cookiesPs) { PPOfAmount = - Math.max( - ObjectsTillNext.price - (Game.cookies + GetWrinkConfigBank()), - 0, - ) / + Math.max(ObjectsTillNext.price - (Game.cookies + GetWrinkConfigBank()), 0) / Game.cookiesPs + ObjectsTillNext.price / BuyBuildingsBonusIncome(TooltipName, ObjectsTillNext.AmountNeeded); @@ -128,8 +112,7 @@ export default function Building() { const PPFrag = document.createElement('span'); if (CMOptions.PPDisplayTime) PPFrag.textContent = FormatTime(PPOfAmount); else PPFrag.textContent = Beautify(PPOfAmount); - PPFrag.className = - ColourTextPre + ColourOfPP({ pp: PPOfAmount }, ObjectsTillNext.price); + PPFrag.className = ColourTextPre + ColourOfPP({ pp: PPOfAmount }, ObjectsTillNext.price); l('CMTooltipNextAchievement').appendChild(PPFrag); } else { l('CMTooltipNextAchievementHeader').style.display = 'none'; diff --git a/src/Disp/Tooltips/TypesOfTooltips/GardenPlots.js b/src/Disp/Tooltips/TypesOfTooltips/GardenPlots.js index 5103548..bdaf87e 100644 --- a/src/Disp/Tooltips/TypesOfTooltips/GardenPlots.js +++ b/src/Disp/Tooltips/TypesOfTooltips/GardenPlots.js @@ -9,46 +9,31 @@ import * as Create from '../CreateTooltip'; */ export default function GardenPlots() { const { minigame } = Game.Objects.Farm; - if ( - CMOptions.TooltipPlots && - minigame.plot[TooltipName[1]][TooltipName[0]][0] !== 0 - ) { + if (CMOptions.TooltipPlots && minigame.plot[TooltipName[1]][TooltipName[0]][0] !== 0) { const mature = minigame.plot[TooltipName[1]][TooltipName[0]][1] > - minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1] - .mature; + minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1].mature; const plantName = - minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1] - .name; - l('CMTooltipBorder').appendChild( - Create.TooltipCreateHeader('Reward (Current / Maximum)'), - ); + minigame.plantsById[minigame.plot[TooltipName[1]][TooltipName[0]][0] - 1].name; + l('CMTooltipBorder').appendChild(Create.TooltipCreateHeader('Reward (Current / Maximum)')); const reward = document.createElement('div'); reward.id = 'CMTooltipPlantReward'; l('CMTooltipBorder').appendChild(reward); if (plantName === 'Bakeberry') { l('CMTooltipPlantReward').textContent = `${ - mature - ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) - : '0' + mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : '0' } / ${Beautify(Game.cookiesPs * 60 * 30)}`; } else if (plantName === 'Chocoroot' || plantName === 'White chocoroot') { l('CMTooltipPlantReward').textContent = `${ - mature - ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3)) - : '0' + mature ? Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3)) : '0' } / ${Beautify(Game.cookiesPs * 60 * 3)}`; } else if (plantName === 'Queenbeet') { l('CMTooltipPlantReward').textContent = `${ - mature - ? Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60)) - : '0' + mature ? Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60)) : '0' } / ${Beautify(Game.cookiesPs * 60 * 60)}`; } else if (plantName === 'Duketater') { l('CMTooltipPlantReward').textContent = `${ - mature - ? Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120)) - : '0' + mature ? Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120)) : '0' } / ${Beautify(Game.cookiesPs * 60 * 120)}`; } else l('CMTooltipArea').style.display = 'none'; } else l('CMTooltipArea').style.display = 'none'; diff --git a/src/Disp/Tooltips/TypesOfTooltips/Grimoire.js b/src/Disp/Tooltips/TypesOfTooltips/Grimoire.js index 3449680..1794008 100644 --- a/src/Disp/Tooltips/TypesOfTooltips/Grimoire.js +++ b/src/Disp/Tooltips/TypesOfTooltips/Grimoire.js @@ -48,9 +48,7 @@ export default function Grimoire() { // Extra information on cookies gained when spell is Conjure Baked Goods (Name === 0) if (TooltipName === '0') { - tooltipBox.appendChild( - Create.TooltipCreateHeader('Cookies to be gained/lost'), - ); + tooltipBox.appendChild(Create.TooltipCreateHeader('Cookies to be gained/lost')); const conjure = document.createElement('div'); conjure.id = 'x'; tooltipBox.appendChild(conjure); diff --git a/src/Disp/Tooltips/TypesOfTooltips/HarvestAll.js b/src/Disp/Tooltips/TypesOfTooltips/HarvestAll.js index 8ef53a0..5bb5460 100644 --- a/src/Disp/Tooltips/TypesOfTooltips/HarvestAll.js +++ b/src/Disp/Tooltips/TypesOfTooltips/HarvestAll.js @@ -10,9 +10,7 @@ import * as Create from '../CreateTooltip'; export default function HarvestAll() { const { minigame } = Game.Objects.Farm; if (CMOptions.TooltipLump) { - l('CMTooltipBorder').appendChild( - Create.TooltipCreateHeader('Cookies gained from harvesting:'), - ); + l('CMTooltipBorder').appendChild(Create.TooltipCreateHeader('Cookies gained from harvesting:')); let totalGain = 0; let mortal = 0; if (Game.keys[16] && Game.keys[17]) mortal = 1; @@ -27,31 +25,17 @@ export default function HarvestAll() { if (mortal && me.immortal) count = false; if (tile[1] < me.matureBase) count = false; if (count && plantName === 'Bakeberry') { - totalGain += Math.min( - Game.cookies * 0.03, - Game.cookiesPs * 60 * 30, - ); - } else if ( - (count && plantName === 'Chocoroot') || - plantName === 'White chocoroot' - ) { + totalGain += Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30); + } else if ((count && plantName === 'Chocoroot') || plantName === 'White chocoroot') { totalGain += Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3); } else if (count && plantName === 'Queenbeet') { - totalGain += Math.min( - Game.cookies * 0.04, - Game.cookiesPs * 60 * 60, - ); + totalGain += Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60); } else if (count && plantName === 'Duketater') { - totalGain += Math.min( - Game.cookies * 0.08, - Game.cookiesPs * 60 * 120, - ); + totalGain += Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120); } } } } - l('CMTooltipBorder').appendChild( - document.createTextNode(Beautify(totalGain)), - ); + l('CMTooltipBorder').appendChild(document.createTextNode(Beautify(totalGain))); } else l('CMTooltipArea').style.display = 'none'; } diff --git a/src/Disp/Tooltips/TypesOfTooltips/PantheonGods.js b/src/Disp/Tooltips/TypesOfTooltips/PantheonGods.js index 9cc3dcf..d3f987b 100644 --- a/src/Disp/Tooltips/TypesOfTooltips/PantheonGods.js +++ b/src/Disp/Tooltips/TypesOfTooltips/PantheonGods.js @@ -22,15 +22,11 @@ export default function PantheonGods() { cps1.id = 'CMPantheonTooltipPosition1'; if (CacheGods[GodID][0] !== 0) { cps1.textContent = Beautify(CacheGods[GodID][0]); - const increase = Math.round( - (CacheGods[GodID][0] / Game.cookiesPs) * 10000, - ); + const increase = Math.round((CacheGods[GodID][0] / Game.cookiesPs) * 10000); if (Number.isFinite(increase) && increase !== 0) { cps1.textContent += ` (${increase / 100}% of income)`; } else { - cps1.textContent += ` (<0${ - CMOptions.ScaleSeparator ? ',' : '.' - }01% of income)`; + cps1.textContent += ` (<0${CMOptions.ScaleSeparator ? ',' : '.'}01% of income)`; } } else cps1.textContent = 'No effect to CPS'; tooltipBox.appendChild(cps1); @@ -40,15 +36,11 @@ export default function PantheonGods() { cps2.id = 'CMPantheonTooltipPosition2'; if (CacheGods[GodID][1] !== 0) { cps2.textContent = Beautify(CacheGods[GodID][1]); - const increase = Math.round( - (CacheGods[GodID][1] / Game.cookiesPs) * 10000, - ); + const increase = Math.round((CacheGods[GodID][1] / Game.cookiesPs) * 10000); if (Number.isFinite(increase) && increase !== 0) { cps2.textContent += ` (${increase / 100}% of income)`; } else { - cps2.textContent += ` (<0${ - CMOptions.ScaleSeparator ? ',' : '.' - }01% of income)`; + cps2.textContent += ` (<0${CMOptions.ScaleSeparator ? ',' : '.'}01% of income)`; } } else cps2.textContent = 'No effect to CPS'; tooltipBox.appendChild(cps2); @@ -58,15 +50,11 @@ export default function PantheonGods() { cps3.id = 'CMPantheonTooltipPosition2'; if (CacheGods[GodID][2] !== 0) { cps3.textContent = Beautify(CacheGods[GodID][2]); - const increase = Math.round( - (CacheGods[GodID][2] / Game.cookiesPs) * 10000, - ); + const increase = Math.round((CacheGods[GodID][2] / Game.cookiesPs) * 10000); if (Number.isFinite(increase) && increase !== 0) { cps3.textContent += ` (${increase / 100}% of income)`; } else { - cps3.textContent += ` (<0${ - CMOptions.ScaleSeparator ? ',' : '.' - }01% of income)`; + cps3.textContent += ` (<0${CMOptions.ScaleSeparator ? ',' : '.'}01% of income)`; } } else cps3.textContent = 'No effect to CPS'; tooltipBox.appendChild(cps3); diff --git a/src/Disp/Tooltips/TypesOfTooltips/Upgrade.js b/src/Disp/Tooltips/TypesOfTooltips/Upgrade.js index 8a30ad1..ca2cd11 100644 --- a/src/Disp/Tooltips/TypesOfTooltips/Upgrade.js +++ b/src/Disp/Tooltips/TypesOfTooltips/Upgrade.js @@ -1,7 +1,4 @@ -import { - CacheLastChoEgg, - CacheUpgrades, -} from '../../../Cache/VariablesAndData'; +import { CacheLastChoEgg, CacheUpgrades } from '../../../Cache/VariablesAndData'; import { CMOptions } from '../../../Config/VariablesAndData'; import Beautify from '../../BeautifyAndFormatting/Beautify'; import FormatTime from '../../BeautifyAndFormatting/FormatTime'; @@ -25,22 +22,15 @@ export default function Upgrade() { const tooltipBox = l('CMTooltipBorder'); Create.TooltipCreateCalculationSection(tooltipBox); - TooltipBonusIncome = - CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonus; - TooltipPrice = Game.Upgrades[ - Game.UpgradesInStore[TooltipName].name - ].getPrice(); - TooltipBonusMouse = - CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonusMouse; + TooltipBonusIncome = CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonus; + TooltipPrice = Game.Upgrades[Game.UpgradesInStore[TooltipName].name].getPrice(); + TooltipBonusMouse = CacheUpgrades[Game.UpgradesInStore[TooltipName].name].bonusMouse; if (CMOptions.TooltipBuildUpgrade === 1) { l('CMTooltipIncome').textContent = Beautify(TooltipBonusIncome, 2); const increase = Math.round((TooltipBonusIncome / Game.cookiesPs) * 10000); // Don't display certain parts of tooltip if not applicable - if ( - l('CMTooltipIncome').textContent === '0' && - (TooltipType === 'b' || TooltipType === 'u') - ) { + if (l('CMTooltipIncome').textContent === '0' && (TooltipType === 'b' || TooltipType === 'u')) { l('Bonus IncomeTitle').style.display = 'none'; l('CMTooltipIncome').style.display = 'none'; l('Payback PeriodTitle').style.display = 'none'; @@ -54,8 +44,7 @@ export default function Upgrade() { }01% of income)`; } l('CMTooltipBorder').className = - ColourTextPre + - CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color; + ColourTextPre + CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color; // If clicking power upgrade if (TooltipBonusMouse) { l('CMTooltipCookiePerClick').textContent = Beautify(TooltipBonusMouse); @@ -64,9 +53,7 @@ export default function Upgrade() { } // If only a clicking power upgrade change PP to click-based period if (TooltipBonusIncome === 0 && TooltipBonusMouse) { - l('CMTooltipPP').textContent = `${Beautify( - TooltipPrice / TooltipBonusMouse, - )} Clicks`; + l('CMTooltipPP').textContent = `${Beautify(TooltipPrice / TooltipBonusMouse)} Clicks`; l('CMTooltipPP').style.color = 'white'; } else { if (CMOptions.PPDisplayTime) @@ -79,8 +66,7 @@ export default function Upgrade() { 2, ); l('CMTooltipPP').className = - ColourTextPre + - CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color; + ColourTextPre + CacheUpgrades[Game.UpgradesInStore[TooltipName].name].color; } } const timeColour = GetTimeColour( @@ -103,9 +89,7 @@ export default function Upgrade() { ); const chocolate = document.createElement('div'); chocolate.style.color = 'white'; - chocolate.textContent = `${Beautify(Game.cookies * 0.05)} / ${Beautify( - CacheLastChoEgg, - )}`; + chocolate.textContent = `${Beautify(Game.cookies * 0.05)} / ${Beautify(CacheLastChoEgg)}`; l('CMTooltipBorder').appendChild(chocolate); } } else l('CMTooltipArea').style.display = 'none'; diff --git a/src/Disp/Tooltips/TypesOfTooltips/Warnings.js b/src/Disp/Tooltips/TypesOfTooltips/Warnings.js index 80b3188..e91aa8b 100644 --- a/src/Disp/Tooltips/TypesOfTooltips/Warnings.js +++ b/src/Disp/Tooltips/TypesOfTooltips/Warnings.js @@ -6,11 +6,7 @@ import Beautify from '../../BeautifyAndFormatting/Beautify'; import FormatTime from '../../BeautifyAndFormatting/FormatTime'; import GetCPS from '../../HelperFunctions/GetCPS'; import GetWrinkConfigBank from '../../HelperFunctions/GetWrinkConfigBank'; -import { - TooltipBonusIncome, - TooltipPrice, - TooltipType, -} from '../../VariablesAndData'; +import { TooltipBonusIncome, TooltipPrice, TooltipType } from '../../VariablesAndData'; import * as Create from '../CreateTooltip'; /** @@ -23,16 +19,10 @@ export default function Warnings() { ToggleToolWarnPos(); } - if (CMOptions.ToolWarnPos === 0) - l('CMDispTooltipWarningParent').style.right = '0px'; - else - l('CMDispTooltipWarningParent').style.top = `${ - l('tooltip').offsetHeight - }px`; + if (CMOptions.ToolWarnPos === 0) l('CMDispTooltipWarningParent').style.right = '0px'; + else l('CMDispTooltipWarningParent').style.top = `${l('tooltip').offsetHeight}px`; - l('CMDispTooltipWarningParent').style.width = `${ - l('tooltip').offsetWidth - 6 - }px`; + l('CMDispTooltipWarningParent').style.width = `${l('tooltip').offsetWidth - 6}px`; const amount = Game.cookies + GetWrinkConfigBank() - TooltipPrice; const bonusIncomeUsed = CMOptions.ToolWarnBon ? TooltipBonusIncome : 0; @@ -48,72 +38,46 @@ export default function Warnings() { l('CMDispTooltipWarnLucky').style.display = ''; l('CMDispTooltipWarnLuckyText').textContent = `${Beautify( limitLucky - amount, - )} (${FormatTime( - (limitLucky - amount) / (GetCPS() + bonusIncomeUsed), - )})`; + )} (${FormatTime((limitLucky - amount) / (GetCPS() + bonusIncomeUsed))})`; } else l('CMDispTooltipWarnLucky').style.display = 'none'; } else l('CMDispTooltipWarnLucky').style.display = 'none'; if (CMOptions.ToolWarnLuckyFrenzy === 1) { const limitLuckyFrenzy = limitLucky * 7; - if ( - amount < limitLuckyFrenzy && - (TooltipType !== 'b' || Game.buyMode === 1) - ) { + if (amount < limitLuckyFrenzy && (TooltipType !== 'b' || Game.buyMode === 1)) { l('CMDispTooltipWarnLuckyFrenzy').style.display = ''; l('CMDispTooltipWarnLuckyFrenzyText').textContent = `${Beautify( limitLuckyFrenzy - amount, - )} (${FormatTime( - (limitLuckyFrenzy - amount) / (GetCPS() + bonusIncomeUsed), - )})`; + )} (${FormatTime((limitLuckyFrenzy - amount) / (GetCPS() + bonusIncomeUsed))})`; } else l('CMDispTooltipWarnLuckyFrenzy').style.display = 'none'; } else l('CMDispTooltipWarnLuckyFrenzy').style.display = 'none'; if (CMOptions.ToolWarnConjure === 1) { const limitConjure = limitLucky * 2; - if ( - amount < limitConjure && - (TooltipType !== 'b' || Game.buyMode === 1) - ) { + if (amount < limitConjure && (TooltipType !== 'b' || Game.buyMode === 1)) { l('CMDispTooltipWarnConjure').style.display = ''; l('CMDispTooltipWarnConjureText').textContent = `${Beautify( limitConjure - amount, - )} (${FormatTime( - (limitConjure - amount) / (GetCPS() + bonusIncomeUsed), - )})`; + )} (${FormatTime((limitConjure - amount) / (GetCPS() + bonusIncomeUsed))})`; } else l('CMDispTooltipWarnConjure').style.display = 'none'; } else l('CMDispTooltipWarnConjure').style.display = 'none'; if (CMOptions.ToolWarnConjureFrenzy === 1) { const limitConjureFrenzy = limitLucky * 2 * 7; - if ( - amount < limitConjureFrenzy && - (TooltipType !== 'b' || Game.buyMode === 1) - ) { + if (amount < limitConjureFrenzy && (TooltipType !== 'b' || Game.buyMode === 1)) { l('CMDispTooltipWarnConjureFrenzy').style.display = ''; l('CMDispTooltipWarnConjureFrenzyText').textContent = `${Beautify( limitConjureFrenzy - amount, - )} (${FormatTime( - (limitConjureFrenzy - amount) / (GetCPS() + bonusIncomeUsed), - )})`; + )} (${FormatTime((limitConjureFrenzy - amount) / (GetCPS() + bonusIncomeUsed))})`; } else l('CMDispTooltipWarnConjureFrenzy').style.display = 'none'; } else l('CMDispTooltipWarnConjureFrenzy').style.display = 'none'; - if ( - CMOptions.ToolWarnEdifice === 1 && - Game.Objects['Wizard tower'].minigameLoaded - ) { - if ( - CacheEdifice && - amount < CacheEdifice && - (TooltipType !== 'b' || Game.buyMode === 1) - ) { + if (CMOptions.ToolWarnEdifice === 1 && Game.Objects['Wizard tower'].minigameLoaded) { + if (CacheEdifice && amount < CacheEdifice && (TooltipType !== 'b' || Game.buyMode === 1)) { l('CMDispTooltipWarnEdifice').style.display = ''; l('CMDispTooltipWarnEdificeText').textContent = `${Beautify( CacheEdifice - amount, - )} (${FormatTime( - (CacheEdifice - amount) / (GetCPS() + bonusIncomeUsed), - )})`; + )} (${FormatTime((CacheEdifice - amount) / (GetCPS() + bonusIncomeUsed))})`; } else l('CMDispTooltipWarnEdifice').style.display = 'none'; } else l('CMDispTooltipWarnEdifice').style.display = 'none'; @@ -130,8 +94,7 @@ export default function Warnings() { l('CMDispTooltipWarnUserText').textContent = `${Beautify( CMOptions.ToolWarnUser * GetCPS() - amount, )} (${FormatTime( - (CMOptions.ToolWarnUser * GetCPS() - amount) / - (GetCPS() + bonusIncomeUsed), + (CMOptions.ToolWarnUser * GetCPS() - amount) / (GetCPS() + bonusIncomeUsed), )})`; } else l('CMDispTooltipWarnUser').style.display = 'none'; } else l('CMDispTooltipWarnUser').style.display = 'none'; diff --git a/src/Disp/Tooltips/TypesOfTooltips/WrinklerButton.js b/src/Disp/Tooltips/TypesOfTooltips/WrinklerButton.js index 327add2..3917b24 100644 --- a/src/Disp/Tooltips/TypesOfTooltips/WrinklerButton.js +++ b/src/Disp/Tooltips/TypesOfTooltips/WrinklerButton.js @@ -1,7 +1,4 @@ -import { - CacheWrinklersFattest, - CacheWrinklersTotal, -} from '../../../Cache/VariablesAndData'; +import { CacheWrinklersFattest, CacheWrinklersTotal } from '../../../Cache/VariablesAndData'; import Beautify from '../../BeautifyAndFormatting/Beautify'; import { TooltipName } from '../../VariablesAndData'; import * as Create from '../CreateTooltip'; diff --git a/src/Disp/Tooltips/UpdateTooltips.js b/src/Disp/Tooltips/UpdateTooltips.js index 9088f80..a1d7c41 100644 --- a/src/Disp/Tooltips/UpdateTooltips.js +++ b/src/Disp/Tooltips/UpdateTooltips.js @@ -35,10 +35,7 @@ export default function UpdateTooltips() { HarvestAll(); } else if (TooltipType === 'wb') { WrinklerButton(); - } else if ( - TooltipType === 'pag' || - (TooltipType === 'pas' && TooltipName[1] !== -1) - ) { + } else if (TooltipType === 'pag' || (TooltipType === 'pas' && TooltipName[1] !== -1)) { PantheonGods(); } Warnings(); diff --git a/src/Disp/Tooltips/WrinklerTooltips.js b/src/Disp/Tooltips/WrinklerTooltips.js index 2fd86be..f11d1af 100644 --- a/src/Disp/Tooltips/WrinklerTooltips.js +++ b/src/Disp/Tooltips/WrinklerTooltips.js @@ -20,10 +20,7 @@ export function CheckWrinklerTooltip() { const me = Game.wrinklers[i]; if (me.phase > 0 && me.selected) { showingTooltip = true; - if ( - TooltipWrinklerBeingShown[i] === 0 || - TooltipWrinklerBeingShown[i] === undefined - ) { + if (TooltipWrinklerBeingShown[i] === 0 || TooltipWrinklerBeingShown[i] === undefined) { const placeholder = document.createElement('div'); const wrinkler = document.createElement('div'); wrinkler.style.minWidth = '120px'; diff --git a/src/Disp/VariablesAndData.js b/src/Disp/VariablesAndData.js index c1953d4..3007374 100644 --- a/src/Disp/VariablesAndData.js +++ b/src/Disp/VariablesAndData.js @@ -73,11 +73,7 @@ export const TooltipText = [ 'The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and then buying Chocolate egg', '300px', ], - [ - 'ChainNextLevelPlaceholder', - 'Cheated cookies might break this formula', - '250px', - ], + ['ChainNextLevelPlaceholder', 'Cheated cookies might break this formula', '250px'], [ 'FavouriteSettingPlaceholder', "Click to set this setting as favourite and show it in 'favourite' settings at the top of the Cookie Monster Settings", diff --git a/src/InitSaveLoad/load.js b/src/InitSaveLoad/load.js index 040ce24..bc53f54 100644 --- a/src/InitSaveLoad/load.js +++ b/src/InitSaveLoad/load.js @@ -11,8 +11,7 @@ export default function load(str) { const save = JSON.parse(str); InitData(); // The if-statement is a failsafe for old saves - if (typeof save.favouriteSettings !== 'undefined') - FavouriteSettings = save.favouriteSettings; // eslint-disable-line no-unused-vars + if (typeof save.favouriteSettings !== 'undefined') FavouriteSettings = save.favouriteSettings; // eslint-disable-line no-unused-vars LoadConfig(save.settings); if (save.version !== `${VersionMajor}.${VersionMinor}`) { if (Game.prefs.popups) diff --git a/src/Main/CheckStates/GoldenCookie.js b/src/Main/CheckStates/GoldenCookie.js index e0ef142..2773ccf 100644 --- a/src/Main/CheckStates/GoldenCookie.js +++ b/src/Main/CheckStates/GoldenCookie.js @@ -1,7 +1,4 @@ -import { - CacheSpawnedGoldenShimmer, - CacheGoldenShimmersByID, -} from '../../Cache/VariablesAndData'; +import { CacheSpawnedGoldenShimmer, CacheGoldenShimmersByID } from '../../Cache/VariablesAndData'; import { CMOptions } from '../../Config/VariablesAndData'; import CreateGCTimer from '../../Disp/GoldenCookieTimers/GoldenCookieTimers'; import Flash from '../../Disp/Notifications/Flash'; @@ -69,11 +66,8 @@ export default function CheckGoldenCookie() { } else if (CMOptions.GCTimer === 1 && LastGoldenCookieState) { Object.keys(GCTimers).forEach((i) => { GCTimers[i].style.opacity = CacheGoldenShimmersByID[i].l.style.opacity; - GCTimers[i].style.transform = - CacheGoldenShimmersByID[i].l.style.transform; - GCTimers[i].textContent = Math.ceil( - CacheGoldenShimmersByID[i].life / Game.fps, - ); + GCTimers[i].style.transform = CacheGoldenShimmersByID[i].l.style.transform; + GCTimers[i].textContent = Math.ceil(CacheGoldenShimmersByID[i].life / Game.fps); }); } } diff --git a/src/Main/CheckStates/Grimoire.js b/src/Main/CheckStates/Grimoire.js index 4f2a219..ea532bc 100644 --- a/src/Main/CheckStates/Grimoire.js +++ b/src/Main/CheckStates/Grimoire.js @@ -9,10 +9,7 @@ import { LastMagicBarFull } from '../VariablesAndData'; * It is called by CM.Main.Loop */ export default function CheckMagicMeter() { - if ( - Game.Objects['Wizard tower'].minigameLoaded && - CMOptions.GrimoireBar === 1 - ) { + if (Game.Objects['Wizard tower'].minigameLoaded && CMOptions.GrimoireBar === 1) { const { minigame } = Game.Objects['Wizard tower']; if (minigame.magic < minigame.magicM) LastMagicBarFull = false; else if (!LastMagicBarFull) { diff --git a/src/Main/CheckStates/Ticker.js b/src/Main/CheckStates/Ticker.js index 9185d9f..2bba969 100644 --- a/src/Main/CheckStates/Ticker.js +++ b/src/Main/CheckStates/Ticker.js @@ -9,20 +9,11 @@ import { LastTickerFortuneState } from '../VariablesAndData'; * It is called by CM.Main.Loop */ export default function CheckTickerFortune() { - if ( - LastTickerFortuneState !== - (Game.TickerEffect && Game.TickerEffect.type === 'fortune') - ) { - LastTickerFortuneState = - Game.TickerEffect && Game.TickerEffect.type === 'fortune'; + if (LastTickerFortuneState !== (Game.TickerEffect && Game.TickerEffect.type === 'fortune')) { + LastTickerFortuneState = Game.TickerEffect && Game.TickerEffect.type === 'fortune'; if (LastTickerFortuneState) { Flash(3, 'FortuneFlash', false); - PlaySound( - CMOptions.FortuneSoundURL, - 'FortuneSound', - 'FortuneVolume', - false, - ); + PlaySound(CMOptions.FortuneSoundURL, 'FortuneSound', 'FortuneVolume', false); CreateNotification( 'FortuneNotification', 'Fortune Cookie found', diff --git a/src/Main/CheckStates/Wrinkler.js b/src/Main/CheckStates/Wrinkler.js index 2497194..2abd9bb 100644 --- a/src/Main/CheckStates/Wrinkler.js +++ b/src/Main/CheckStates/Wrinkler.js @@ -16,36 +16,17 @@ export default function CheckWrinklerCount() { }); if (CurrentWrinklers > LastWrinklerCount) { LastWrinklerCount = CurrentWrinklers; - if ( - CurrentWrinklers === Game.getWrinklersMax() && - CMOptions.WrinklerMaxFlash - ) { + if (CurrentWrinklers === Game.getWrinklersMax() && CMOptions.WrinklerMaxFlash) { Flash(3, 'WrinklerMaxFlash', false); } else { Flash(3, 'WrinklerFlash', false); } - if ( - CurrentWrinklers === Game.getWrinklersMax() && - CMOptions.WrinklerMaxSound - ) { - PlaySound( - CMOptions.WrinklerMaxSoundURL, - 'WrinklerMaxSound', - 'WrinklerMaxVolume', - false, - ); + if (CurrentWrinklers === Game.getWrinklersMax() && CMOptions.WrinklerMaxSound) { + PlaySound(CMOptions.WrinklerMaxSoundURL, 'WrinklerMaxSound', 'WrinklerMaxVolume', false); } else { - PlaySound( - CMOptions.WrinklerSoundURL, - 'WrinklerSound', - 'WrinklerVolume', - false, - ); + PlaySound(CMOptions.WrinklerSoundURL, 'WrinklerSound', 'WrinklerVolume', false); } - if ( - CurrentWrinklers === Game.getWrinklersMax() && - CMOptions.WrinklerMaxNotification - ) { + if (CurrentWrinklers === Game.getWrinklersMax() && CMOptions.WrinklerMaxNotification) { CreateNotification( 'WrinklerMaxNotification', 'Maximum Wrinklers Reached', diff --git a/src/Main/Initialization.js b/src/Main/Initialization.js index f4293f8..05f7435 100644 --- a/src/Main/Initialization.js +++ b/src/Main/Initialization.js @@ -40,11 +40,7 @@ export default function InitializeCookieMonster() { CreateSectionHideButtons(); CreateFavicon(); Object.keys(TooltipText).forEach((i) => { - CreateSimpleTooltip( - TooltipText[i][0], - TooltipText[i][1], - TooltipText[i][2], - ); + CreateSimpleTooltip(TooltipText[i][0], TooltipText[i][1], TooltipText[i][2]); }); CreateWrinklerButtons(); UpdateBuildingUpgradeStyle(); @@ -61,17 +57,8 @@ export default function InitializeCookieMonster() { CMLastAscendState = Game.OnAscend; // eslint-disable-line no-unused-vars if (Game.prefs.popups) - Game.Popup( - `Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`, - ); - else - Game.Notify( - `Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`, - '', - '', - 1, - 1, - ); + Game.Popup(`Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`); + else Game.Notify(`Cookie Monster version ${VersionMajor}.${VersionMinor} loaded!`, '', '', 1, 1); Game.Win('Third-party'); } diff --git a/src/Main/LoopHook.js b/src/Main/LoopHook.js index 996336b..5da4220 100644 --- a/src/Main/LoopHook.js +++ b/src/Main/LoopHook.js @@ -4,22 +4,13 @@ import CacheNoGoldSwitchCPS from '../Cache/CPS/NoGoldSwitchCPS'; import CacheSellAllForChoEgg from '../Cache/CPS/SellChoEgg'; import CacheDragonCost from '../Cache/Dragon/Dragon'; import CachePantheonGods from '../Cache/PantheonGods/CacheGods'; -import { - CacheBuildingsPrices, - CacheIncome, -} from '../Cache/PriceAndIncome/PriceAndIncome'; +import { CacheBuildingsPrices, CacheIncome } from '../Cache/PriceAndIncome/PriceAndIncome'; import { CacheChain } from '../Cache/Stats/ChainCookies'; import CacheAllMissingUpgrades from '../Cache/Stats/MissingUpgrades'; import CacheSeasonSpec from '../Cache/Stats/Reindeer'; -import { - CacheGoldenAndWrathCookiesMults, - CacheStatsCookies, -} from '../Cache/Stats/Stats'; +import { CacheGoldenAndWrathCookiesMults, CacheStatsCookies } from '../Cache/Stats/Stats'; import AllAmountTillNextAchievement from '../Cache/TillNextAchievement/AllAmountTillNextAchievement'; -import { - CacheDoRemakeBuildPrices, - CacheHadBuildAura, -} from '../Cache/VariablesAndData'; +import { CacheDoRemakeBuildPrices, CacheHadBuildAura } from '../Cache/VariablesAndData'; import UpdateAscendState from '../Disp/HelperFunctions/UpdateAscendState'; import { LastAscendState } from '../Disp/VariablesAndData'; import InitData from '../Sim/InitializeData/InitData'; diff --git a/src/Main/ReplaceGameElements/NativeGrimoire.js b/src/Main/ReplaceGameElements/NativeGrimoire.js index f766c20..b30f7e8 100644 --- a/src/Main/ReplaceGameElements/NativeGrimoire.js +++ b/src/Main/ReplaceGameElements/NativeGrimoire.js @@ -14,21 +14,14 @@ import ReplaceTooltipGrimoire from './TooltipGrimoire'; * This function fixes replaces the .draw function of the Grimoire */ function ReplaceNativeGrimoireDraw() { - if ( - !HasReplaceNativeGrimoireDraw && - Game.Objects['Wizard tower'].minigameLoaded - ) { + if (!HasReplaceNativeGrimoireDraw && Game.Objects['Wizard tower'].minigameLoaded) { const { minigame } = Game.Objects['Wizard tower']; BackupGrimoireDraw = minigame.draw; Game.Objects['Wizard tower'].minigame.draw = function () { BackupGrimoireDraw(); if (CMOptions.GrimoireBar === 1 && minigame.magic < minigame.magicM) { minigame.magicBarTextL.innerHTML += ` (${FormatTime( - CalculateGrimoireRefillTime( - minigame.magic, - minigame.magicM, - minigame.magicM, - ), + CalculateGrimoireRefillTime(minigame.magic, minigame.magicM, minigame.magicM), )})`; } }; @@ -40,10 +33,7 @@ function ReplaceNativeGrimoireDraw() { * This function fixes replaces the .launch function of the Grimoire */ function ReplaceNativeGrimoireLaunch() { - if ( - !HasReplaceNativeGrimoireLaunch && - Game.Objects['Wizard tower'].minigameLoaded - ) { + if (!HasReplaceNativeGrimoireLaunch && Game.Objects['Wizard tower'].minigameLoaded) { const { minigame } = Game.Objects['Wizard tower']; BackupGrimoireLaunch = minigame.launch; // eslint-disable-line no-unused-vars BackupGrimoireLaunchMod = new Function( // eslint-disable-line no-new-func diff --git a/src/Main/ReplaceGameElements/TooltipGrimoire.js b/src/Main/ReplaceGameElements/TooltipGrimoire.js index 30db55f..79bbb28 100644 --- a/src/Main/ReplaceGameElements/TooltipGrimoire.js +++ b/src/Main/ReplaceGameElements/TooltipGrimoire.js @@ -6,21 +6,15 @@ import { TooltipGrimoireBackup } from '../VariablesAndData'; */ export default function ReplaceTooltipGrimoire() { if (Game.Objects['Wizard tower'].minigameLoaded) { - Object.keys(Game.Objects['Wizard tower'].minigame.spellsById).forEach( - (i) => { - if (l(`grimoireSpell${i}`).onmouseover !== null) { - TooltipGrimoireBackup[i] = l(`grimoireSpell${i}`).onmouseover; - l(`grimoireSpell${i}`).onmouseover = function () { - Game.tooltip.dynamic = 1; - Game.tooltip.draw( - this, - () => CreateTooltip('g', `${i}`), - 'this', - ); - Game.tooltip.wobble(); - }; - } - }, - ); + Object.keys(Game.Objects['Wizard tower'].minigame.spellsById).forEach((i) => { + if (l(`grimoireSpell${i}`).onmouseover !== null) { + TooltipGrimoireBackup[i] = l(`grimoireSpell${i}`).onmouseover; + l(`grimoireSpell${i}`).onmouseover = function () { + Game.tooltip.dynamic = 1; + Game.tooltip.draw(this, () => CreateTooltip('g', `${i}`), 'this'); + Game.tooltip.wobble(); + }; + } + }); } } diff --git a/src/Main/ReplaceGameElements/TooltipUpgrades.js b/src/Main/ReplaceGameElements/TooltipUpgrades.js index ff2c6bf..c71ac2c 100644 --- a/src/Main/ReplaceGameElements/TooltipUpgrades.js +++ b/src/Main/ReplaceGameElements/TooltipUpgrades.js @@ -15,11 +15,7 @@ export default function ReplaceTooltipUpgrade() { if (!Game.mouseDown) { Game.setOnCrate(this); Game.tooltip.dynamic = 1; - Game.tooltip.draw( - this, - () => CreateTooltip('u', `${i}`), - 'store', - ); + Game.tooltip.draw(this, () => CreateTooltip('u', `${i}`), 'store'); Game.tooltip.wobble(); } }; diff --git a/src/Main/ReplaceGameElements/Tooltips.js b/src/Main/ReplaceGameElements/Tooltips.js index 3463549..09952fd 100644 --- a/src/Main/ReplaceGameElements/Tooltips.js +++ b/src/Main/ReplaceGameElements/Tooltips.js @@ -1,11 +1,7 @@ /** Functions related to replacing tooltips */ import { CreateTooltip } from '../../Disp/Tooltips/Tooltip'; -import { - LoadMinigames, - TooltipBuildBackup, - TooltipLumpBackup, -} from '../VariablesAndData'; +import { LoadMinigames, TooltipBuildBackup, TooltipLumpBackup } from '../VariablesAndData'; import ReplaceNativeGrimoire from './NativeGrimoire'; import ReplaceTooltipGrimoire from './TooltipGrimoire'; @@ -19,11 +15,7 @@ function ReplaceTooltipBuild() { TooltipBuildBackup[i] = l(`product${me.id}`).onmouseover; l(`product${me.id}`).onmouseover = function () { Game.tooltip.dynamic = 1; - Game.tooltip.draw( - this, - () => CreateTooltip('b', `${i}`), - 'store', - ); + Game.tooltip.draw(this, () => CreateTooltip('b', `${i}`), 'store'); Game.tooltip.wobble(); }; } @@ -38,11 +30,7 @@ function ReplaceTooltipLump() { TooltipLumpBackup = l('lumps').onmouseover; // eslint-disable-line no-unused-vars l('lumps').onmouseover = function () { Game.tooltip.dynamic = 1; - Game.tooltip.draw( - this, - () => CreateTooltip('s', 'Lump'), - 'this', - ); + Game.tooltip.draw(this, () => CreateTooltip('s', 'Lump'), 'this'); Game.tooltip.wobble(); }; } @@ -55,11 +43,7 @@ function ReplaceTooltipGarden() { if (Game.Objects.Farm.minigameLoaded) { l('gardenTool-1').onmouseover = function () { Game.tooltip.dynamic = 1; - Game.tooltip.draw( - this, - () => CreateTooltip('ha', 'HarvestAllButton'), - 'this', - ); + Game.tooltip.draw(this, () => CreateTooltip('ha', 'HarvestAllButton'), 'this'); Game.tooltip.wobble(); }; Array.from(l('gardenPlot').children).forEach((child) => { @@ -67,11 +51,7 @@ function ReplaceTooltipGarden() { // eslint-disable-next-line no-param-reassign child.onmouseover = function () { Game.tooltip.dynamic = 1; - Game.tooltip.draw( - this, - () => CreateTooltip('p', [`${coords[0]}`, `${coords[2]}`]), - 'this', - ); + Game.tooltip.draw(this, () => CreateTooltip('p', [`${coords[0]}`, `${coords[2]}`]), 'this'); Game.tooltip.wobble(); }; }); @@ -83,11 +63,7 @@ function ReplaceTooltipPantheon() { for (let i = 0; i < 11; i += 1) { l(`templeGod${i}`).onmouseover = function () { Game.tooltip.dynamic = 1; - Game.tooltip.draw( - this, - () => CreateTooltip('pag', i), - 'this', - ); + Game.tooltip.draw(this, () => CreateTooltip('pag', i), 'this'); Game.tooltip.wobble(); }; } @@ -96,10 +72,7 @@ function ReplaceTooltipPantheon() { Game.tooltip.dynamic = 1; Game.tooltip.draw( this, - () => CreateTooltip('pas', [ - i, - Game.Objects.Temple.minigame.slot[i], - ]), + () => CreateTooltip('pas', [i, Game.Objects.Temple.minigame.slot[i]]), 'this', ); Game.tooltip.wobble(); diff --git a/src/Main/ReplaceGameFunctions/ReplaceNative.js b/src/Main/ReplaceGameFunctions/ReplaceNative.js index bc020a7..d28ecb1 100644 --- a/src/Main/ReplaceGameFunctions/ReplaceNative.js +++ b/src/Main/ReplaceGameFunctions/ReplaceNative.js @@ -45,10 +45,7 @@ export default function ReplaceNative() { BackupFunctions.tooltip.update = Game.tooltip.update; BackupFunctions.tooltip.updateMod = new Function( // eslint-disable-line no-new-func - `return ${Game.tooltip.update - .toString() - .split('this.') - .join('Game.tooltip.')}`, + `return ${Game.tooltip.update.toString().split('this.').join('Game.tooltip.')}`, )(); Game.tooltip.update = function () { BackupFunctions.tooltip.updateMod(); @@ -119,10 +116,7 @@ export default function ReplaceNative() { BackupFunctions.UpdateMenu = Game.UpdateMenu; Game.UpdateMenu = function () { - if ( - typeof jscolor.picker === 'undefined' || - typeof jscolor.picker.owner === 'undefined' - ) { + if (typeof jscolor.picker === 'undefined' || typeof jscolor.picker.owner === 'undefined') { BackupFunctions.UpdateMenu(); AddMenu(); } @@ -131,8 +125,7 @@ export default function ReplaceNative() { BackupFunctions.sayTime = Game.sayTime; // eslint-disable-next-line no-unused-vars CMSayTime = function (time, detail) { - if (Number.isNaN(time) || time <= 0) - return BackupFunctions.sayTime(time, detail); + if (Number.isNaN(time) || time <= 0) return BackupFunctions.sayTime(time, detail); return FormatTime(time / Game.fps, 1); }; diff --git a/src/Main/WrinklerArea/AddDetectArea.js b/src/Main/WrinklerArea/AddDetectArea.js index bf8188a..fdf5520 100644 --- a/src/Main/WrinklerArea/AddDetectArea.js +++ b/src/Main/WrinklerArea/AddDetectArea.js @@ -1,7 +1,4 @@ -import { - TooltipWrinklerArea, - TooltipWrinklerBeingShown, -} from '../../Disp/VariablesAndData'; +import { TooltipWrinklerArea, TooltipWrinklerBeingShown } from '../../Disp/VariablesAndData'; /** * This function creates .onmouseover/out events that determine if the mouse is hovering-over a Wrinkler diff --git a/src/Sim/Calculations/CalculateGains.js b/src/Sim/Calculations/CalculateGains.js index 71d458d..9d46954 100644 --- a/src/Sim/Calculations/CalculateGains.js +++ b/src/Sim/Calculations/CalculateGains.js @@ -1,9 +1,6 @@ import GetCPSBuffMult from '../../Cache/CPS/GetCPSBuffMult'; import { CacheCentEgg } from '../../Cache/VariablesAndData'; -import { - CenturyDateAtBeginLoop, - CycliusDateAtBeginLoop, -} from '../../Main/VariablesAndData'; +import { CenturyDateAtBeginLoop, CycliusDateAtBeginLoop } from '../../Main/VariablesAndData'; import SimAuraMult from '../ReplacedGameFunctions/SimAuraMult'; import SimEff from '../ReplacedGameFunctions/SimEff'; import SimGetHeavenlyMultiplier from '../ReplacedGameFunctions/SimGetHeavenlyMultiplier'; @@ -44,16 +41,11 @@ export default function CalculateGains() { SimEffs = effs; // eslint-disable-line no-unused-vars if (Game.ascensionMode !== 1) - mult += - parseFloat(SimPrestige) * - 0.01 * - SimHeavenlyPower * - SimGetHeavenlyMultiplier(); + mult += parseFloat(SimPrestige) * 0.01 * SimHeavenlyPower * SimGetHeavenlyMultiplier(); mult *= SimEff('cps'); - if (SimHas('Heralds') && Game.ascensionMode !== 1) - mult *= 1 + 0.01 * Game.heralds; + if (SimHas('Heralds') && Game.ascensionMode !== 1) mult *= 1 + 0.01 * Game.heralds; Object.keys(Game.cookieUpgrades).forEach((i) => { const me = Game.cookieUpgrades[i]; @@ -94,26 +86,11 @@ export default function CalculateGains() { godLvl = SimHasGod('ages'); if (godLvl === 1) - mult *= - 1 + - 0.15 * - Math.sin( - (CycliusDateAtBeginLoop / 1000 / (60 * 60 * 3)) * Math.PI * 2, - ); + mult *= 1 + 0.15 * Math.sin((CycliusDateAtBeginLoop / 1000 / (60 * 60 * 3)) * Math.PI * 2); else if (godLvl === 2) - mult *= - 1 + - 0.15 * - Math.sin( - (CycliusDateAtBeginLoop / 1000 / (60 * 60 * 12)) * Math.PI * 2, - ); + mult *= 1 + 0.15 * Math.sin((CycliusDateAtBeginLoop / 1000 / (60 * 60 * 12)) * Math.PI * 2); else if (godLvl === 3) - mult *= - 1 + - 0.15 * - Math.sin( - (CycliusDateAtBeginLoop / 1000 / (60 * 60 * 24)) * Math.PI * 2, - ); + mult *= 1 + 0.15 * Math.sin((CycliusDateAtBeginLoop / 1000 / (60 * 60 * 24)) * Math.PI * 2); godLvl = SimHasGod('decadence'); if (godLvl === 1) buildMult *= 0.93; @@ -151,35 +128,25 @@ export default function CalculateGains() { if (SimHas('Kitten helpers')) catMult *= 1 + milkProgress * 0.1 * milkMult; if (SimHas('Kitten workers')) catMult *= 1 + milkProgress * 0.125 * milkMult; if (SimHas('Kitten engineers')) catMult *= 1 + milkProgress * 0.15 * milkMult; - if (SimHas('Kitten overseers')) - catMult *= 1 + milkProgress * 0.175 * milkMult; + if (SimHas('Kitten overseers')) catMult *= 1 + milkProgress * 0.175 * milkMult; if (SimHas('Kitten managers')) catMult *= 1 + milkProgress * 0.2 * milkMult; - if (SimHas('Kitten accountants')) - catMult *= 1 + milkProgress * 0.2 * milkMult; - if (SimHas('Kitten specialists')) - catMult *= 1 + milkProgress * 0.2 * milkMult; + if (SimHas('Kitten accountants')) catMult *= 1 + milkProgress * 0.2 * milkMult; + if (SimHas('Kitten specialists')) catMult *= 1 + milkProgress * 0.2 * milkMult; if (SimHas('Kitten experts')) catMult *= 1 + milkProgress * 0.2 * milkMult; - if (SimHas('Kitten consultants')) - catMult *= 1 + milkProgress * 0.2 * milkMult; + if (SimHas('Kitten consultants')) catMult *= 1 + milkProgress * 0.2 * milkMult; if (SimHas('Kitten assistants to the regional manager')) catMult *= 1 + milkProgress * 0.175 * milkMult; - if (SimHas('Kitten marketeers')) - catMult *= 1 + milkProgress * 0.15 * milkMult; + if (SimHas('Kitten marketeers')) catMult *= 1 + milkProgress * 0.15 * milkMult; if (SimHas('Kitten analysts')) catMult *= 1 + milkProgress * 0.125 * milkMult; - if (SimHas('Kitten executives')) - catMult *= 1 + milkProgress * 0.115 * milkMult; + if (SimHas('Kitten executives')) catMult *= 1 + milkProgress * 0.115 * milkMult; if (SimHas('Kitten angels')) catMult *= 1 + milkProgress * 0.1 * milkMult; if (SimHas('Fortune #103')) catMult *= 1 + milkProgress * 0.05 * milkMult; Object.keys(SimObjects).forEach((i) => { const me = SimObjects[i]; let storedCps = me.cps(me); - if (Game.ascensionMode !== 1) - storedCps *= (1 + me.level * 0.01) * buildMult; - if ( - me.name === 'Grandma' && - SimHas('Milkhelp® lactose intolerance relief tablets') - ) + if (Game.ascensionMode !== 1) storedCps *= (1 + me.level * 0.01) * buildMult; + if (me.name === 'Grandma' && SimHas('Milkhelp® lactose intolerance relief tablets')) storedCps *= 1 + 0.05 * milkProgress * milkMult; SimCookiesPs += me.amount * storedCps; }); @@ -204,10 +171,7 @@ export default function CalculateGains() { if (SimHas('Century egg')) { // The boost increases a little every day, with diminishing returns up to +10% on the 100th day let day = - (Math.floor((CenturyDateAtBeginLoop - Game.startDate) / 1000 / 10) * 10) / - 60 / - 60 / - 24; + (Math.floor((CenturyDateAtBeginLoop - Game.startDate) / 1000 / 10) * 10) / 60 / 60 / 24; day = Math.min(day, 100); // Sets a Cache value to be displayed in the Stats page, could be moved... CacheCentEgg = 1 + (1 - (1 - day / 100) ** 3) * 0.1; @@ -222,8 +186,7 @@ export default function CalculateGains() { const rawCookiesPs = SimCookiesPs * mult; Object.keys(Game.CpsAchievements).forEach((i) => { - if (rawCookiesPs >= Game.CpsAchievements[i].threshold) - SimWin(Game.CpsAchievements[i].name); + if (rawCookiesPs >= Game.CpsAchievements[i].threshold) SimWin(Game.CpsAchievements[i].name); }); SimCookiesPsRaw = rawCookiesPs; // eslint-disable-line no-unused-vars diff --git a/src/Sim/Calculations/CheckOtherAchiev.js b/src/Sim/Calculations/CheckOtherAchiev.js index 95ac62c..5d919c7 100644 --- a/src/Sim/Calculations/CheckOtherAchiev.js +++ b/src/Sim/Calculations/CheckOtherAchiev.js @@ -32,11 +32,7 @@ export default function CheckOtherAchiev() { mathematician = 0; } if (!SimHasAchiev('Base 10')) { - if ( - SimObjects[i].amount < - (Game.ObjectsById.length - Game.Objects[i].id) * 10 - ) - base10 = 0; + if (SimObjects[i].amount < (Game.ObjectsById.length - Game.Objects[i].id) * 10) base10 = 0; } }); if (minAmount >= 1) SimWin('One with everything'); @@ -69,11 +65,9 @@ export default function CheckOtherAchiev() { if (SimUpgradesOwned >= 400) SimWin("When there's nothing left to add"); if (buildingsOwned >= 4000 && SimUpgradesOwned >= 300) SimWin('Polymath'); - if (buildingsOwned >= 8000 && SimUpgradesOwned >= 400) - SimWin('Renaissance baker'); + if (buildingsOwned >= 8000 && SimUpgradesOwned >= 400) SimWin('Renaissance baker'); - if (SimObjects.Cursor.amount + SimObjects.Grandma.amount >= 777) - SimWin('The elder scrolls'); + if (SimObjects.Cursor.amount + SimObjects.Grandma.amount >= 777) SimWin('The elder scrolls'); let hasAllHalloCook = true; Object.keys(HalloCookies).forEach((i) => { diff --git a/src/Sim/InitializeData/InitialBuildingData.js b/src/Sim/InitializeData/InitialBuildingData.js index 07f799d..b5fe8fe 100644 --- a/src/Sim/InitializeData/InitialBuildingData.js +++ b/src/Sim/InitializeData/InitialBuildingData.js @@ -70,8 +70,7 @@ export default function InitialBuildingData(buildingName) { let add = 0; if (SimHas('One mind')) add += SimObjects.Grandma.amount * 0.02; - if (SimHas('Communal brainsweep')) - add += SimObjects.Grandma.amount * 0.02; + if (SimHas('Communal brainsweep')) add += SimObjects.Grandma.amount * 0.02; if (SimHas('Elder Pact')) add += SimObjects.Portal.amount * 0.05; let num = 0; diff --git a/src/Sim/ReplacedGameFunctions/SimGetTieredCpsMult.js b/src/Sim/ReplacedGameFunctions/SimGetTieredCpsMult.js index 6634972..47d7027 100644 --- a/src/Sim/ReplacedGameFunctions/SimGetTieredCpsMult.js +++ b/src/Sim/ReplacedGameFunctions/SimGetTieredCpsMult.js @@ -7,19 +7,14 @@ import SimHas from './SimHas'; export default function SimGetTieredCpsMult(me) { let mult = 1; Object.keys(me.tieredUpgrades).forEach((i) => { - if ( - !Game.Tiers[me.tieredUpgrades[i].tier].special && - SimHas(me.tieredUpgrades[i].name) - ) + if (!Game.Tiers[me.tieredUpgrades[i].tier].special && SimHas(me.tieredUpgrades[i].name)) mult *= 2; }); Object.keys(me.synergies).forEach((i) => { if (SimHas(me.synergies[i].name)) { const syn = me.synergies[i]; - if (syn.buildingTie1.name === me.name) - mult *= 1 + 0.05 * syn.buildingTie2.amount; - else if (syn.buildingTie2.name === me.name) - mult *= 1 + 0.001 * syn.buildingTie1.amount; + if (syn.buildingTie1.name === me.name) mult *= 1 + 0.05 * syn.buildingTie2.amount; + else if (syn.buildingTie2.name === me.name) mult *= 1 + 0.001 * syn.buildingTie1.amount; } }); if (me.fortune && SimHas(me.fortune.name)) mult *= 1.07; diff --git a/src/Sim/ReplacedGameFunctions/SimHas.js b/src/Sim/ReplacedGameFunctions/SimHas.js index 50f8436..17027e0 100644 --- a/src/Sim/ReplacedGameFunctions/SimHas.js +++ b/src/Sim/ReplacedGameFunctions/SimHas.js @@ -5,10 +5,6 @@ import { SimUpgrades } from '../VariablesAndData'; */ export default function SimHas(what) { const it = SimUpgrades[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; } diff --git a/src/Sim/SimulationEvents/AuraChange.js b/src/Sim/SimulationEvents/AuraChange.js index 008c8fb..6564aad 100644 --- a/src/Sim/SimulationEvents/AuraChange.js +++ b/src/Sim/SimulationEvents/AuraChange.js @@ -1,7 +1,4 @@ -import { - CacheDragonAura, - CacheDragonAura2, -} from '../../Cache/VariablesAndData'; +import { CacheDragonAura, CacheDragonAura2 } from '../../Cache/VariablesAndData'; import CalculateGains from '../Calculations/CalculateGains'; import CheckOtherAchiev from '../Calculations/CheckOtherAchiev'; import CopyData from '../SimulationData/CopyData'; @@ -24,18 +21,13 @@ export default function CalculateChangeAura(aura) { CopyData(); // Check if aura being changed is first or second aura - const auraToBeChanged = l('promptContent').children[0].innerHTML.includes( - 'secondary', - ); + const auraToBeChanged = l('promptContent').children[0].innerHTML.includes('secondary'); if (auraToBeChanged) SimDragonAura2 = aura; else SimDragonAura = aura; // Sell highest building but only if aura is different let price = 0; - if ( - SimDragonAura !== CacheDragonAura || - SimDragonAura2 !== CacheDragonAura2 - ) { + if (SimDragonAura !== CacheDragonAura || SimDragonAura2 !== CacheDragonAura2) { for (let i = Game.ObjectsById.length - 1; i > -1; --i) { if (Game.ObjectsById[i].amount > 0) { const highestBuilding = SimObjects[Game.ObjectsById[i].name].name; @@ -44,12 +36,7 @@ export default function CalculateChangeAura(aura) { price = SimObjects[highestBuilding].basePrice * Game.priceIncrease ** - Math.max( - 0, - SimObjects[highestBuilding].amount - - 1 - - SimObjects[highestBuilding].free, - ); + Math.max(0, SimObjects[highestBuilding].amount - 1 - SimObjects[highestBuilding].free); price = Game.modifyBuildingPrice(SimObjects[highestBuilding], price); price = Math.ceil(price); break; diff --git a/src/Sim/SimulationEvents/BuyBuilding.js b/src/Sim/SimulationEvents/BuyBuilding.js index 5142b37..6912aee 100644 --- a/src/Sim/SimulationEvents/BuyBuilding.js +++ b/src/Sim/SimulationEvents/BuyBuilding.js @@ -9,18 +9,11 @@ * @param {number} increase Increase of building * @returns {number} moni Total price */ -export default function BuildingGetPrice( - build, - basePrice, - start, - free, - increase, -) { +export default function BuildingGetPrice(build, basePrice, start, free, increase) { let startingAmount = start; let moni = 0; for (let i = 0; i < increase; i += 1) { - let price = - basePrice * Game.priceIncrease ** Math.max(0, startingAmount - free); + let price = basePrice * Game.priceIncrease ** Math.max(0, startingAmount - free); price = Game.modifyBuildingPrice(build, price); price = Math.ceil(price); moni += price; diff --git a/src/Sim/SimulationEvents/BuyBuildingBonusIncome.js b/src/Sim/SimulationEvents/BuyBuildingBonusIncome.js index ceb745c..3b7c807 100644 --- a/src/Sim/SimulationEvents/BuyBuildingBonusIncome.js +++ b/src/Sim/SimulationEvents/BuyBuildingBonusIncome.js @@ -2,11 +2,7 @@ import CalculateGains from '../Calculations/CalculateGains'; import CheckOtherAchiev from '../Calculations/CheckOtherAchiev'; import CopyData from '../SimulationData/CopyData'; import SimWin from '../SimulationData/SimWin'; -import { - SimAchievementsOwned, - SimCookiesPs, - SimObjects, -} from '../VariablesAndData'; +import { SimAchievementsOwned, SimCookiesPs, SimObjects } from '../VariablesAndData'; /** * This function calculates the bonus income of buying a building @@ -34,10 +30,7 @@ export default function BuyBuildingsBonusIncome(building, amount) { if (me.amount >= 800) SimWin("The devil's workshop"); } else { Object.keys(Game.Objects[me.name].tieredAchievs).forEach((j) => { - if ( - me.amount >= - Game.Tiers[Game.Objects[me.name].tieredAchievs[j].tier].achievUnlock - ) { + if (me.amount >= Game.Tiers[Game.Objects[me.name].tieredAchievs[j].tier].achievUnlock) { SimWin(Game.Objects[me.name].tieredAchievs[j].name); } }); diff --git a/src/Sim/SimulationEvents/BuyUpgrades.js b/src/Sim/SimulationEvents/BuyUpgrades.js index ce3182c..23fee71 100644 --- a/src/Sim/SimulationEvents/BuyUpgrades.js +++ b/src/Sim/SimulationEvents/BuyUpgrades.js @@ -63,13 +63,7 @@ function MouseCps() { if (SimHas('Dragon claw')) mult *= 1.03; if (SimHas('Aura gloves')) { - mult *= - 1 + - 0.05 * - Math.min( - Game.Objects.Cursor.level, - SimHas('Luminous gloves') ? 20 : 10, - ); + mult *= 1 + 0.05 * Math.min(Game.Objects.Cursor.level, SimHas('Luminous gloves') ? 20 : 10); } mult *= SimEff('click'); @@ -83,8 +77,7 @@ function MouseCps() { } Object.keys(Game.buffs).forEach((i) => { - if (typeof Game.buffs[i].multClick !== 'undefined') - mult *= Game.buffs[i].multClick; + if (typeof Game.buffs[i].multClick !== 'undefined') mult *= Game.buffs[i].multClick; }); // if (CM.Sim.auraMult('Dragon Cursor')) mult*=1.05; @@ -129,8 +122,7 @@ export default function BuyUpgradesBonusIncome(upgrade) { } else { SimUpgrades[upgrade].bought = (SimUpgrades[upgrade].bought + 1) % 2; } - if (Game.CountsAsUpgradeOwned(Game.Upgrades[upgrade].pool)) - SimUpgradesOwned += 1; // eslint-disable-line no-unused-vars + if (Game.CountsAsUpgradeOwned(Game.Upgrades[upgrade].pool)) SimUpgradesOwned += 1; // eslint-disable-line no-unused-vars if (upgrade === 'Elder Pledge') { SimPledges += 1; diff --git a/src/Sim/SimulationEvents/GodChange.js b/src/Sim/SimulationEvents/GodChange.js index 620d1d2..86198ac 100644 --- a/src/Sim/SimulationEvents/GodChange.js +++ b/src/Sim/SimulationEvents/GodChange.js @@ -1,13 +1,7 @@ import CalculateGains from '../Calculations/CalculateGains'; import CheckOtherAchiev from '../Calculations/CheckOtherAchiev'; import CopyData from '../SimulationData/CopyData'; -import { - SimAchievementsOwned, - SimCookiesPs, - SimGod1, - SimGod2, - SimGod3, -} from '../VariablesAndData'; +import { SimAchievementsOwned, SimCookiesPs, SimGod1, SimGod2, SimGod3 } from '../VariablesAndData'; /** * This functions calculates the cps and cost of changing a Dragon Aura diff --git a/src/Sim/SimulationEvents/ResetAscension.js b/src/Sim/SimulationEvents/ResetAscension.js index 193d753..5b3bcec 100644 --- a/src/Sim/SimulationEvents/ResetAscension.js +++ b/src/Sim/SimulationEvents/ResetAscension.js @@ -3,12 +3,7 @@ import CalculateGains from '../Calculations/CalculateGains'; import CheckOtherAchiev from '../Calculations/CheckOtherAchiev'; import CopyData from '../SimulationData/CopyData'; import SimWin from '../SimulationData/SimWin'; -import { - SimAchievementsOwned, - SimCookiesPs, - SimPrestige, - SimUpgrades, -} from '../VariablesAndData'; +import { SimAchievementsOwned, SimCookiesPs, SimPrestige, SimUpgrades } from '../VariablesAndData'; /** * This function calculates the cookies per click difference betwene current and after a ascension @@ -41,37 +36,23 @@ export default function ResetBonus(newHeavenlyChips) { if (CacheRealCookiesEarned >= 1000000000000) SimWin('From scratch'); if (CacheRealCookiesEarned >= 1000000000000000) SimWin('Nihilism'); if (CacheRealCookiesEarned >= 1000000000000000000) SimWin('Dematerialize'); - if (CacheRealCookiesEarned >= 1000000000000000000000) - SimWin('Nil zero zilch'); - if (CacheRealCookiesEarned >= 1000000000000000000000000) - SimWin('Transcendence'); - if (CacheRealCookiesEarned >= 1000000000000000000000000000) - SimWin('Obliterate'); - if (CacheRealCookiesEarned >= 1000000000000000000000000000000) - SimWin('Negative void'); - if (CacheRealCookiesEarned >= 1000000000000000000000000000000000) - SimWin('To crumbs, you say?'); - if (CacheRealCookiesEarned >= 1000000000000000000000000000000000000) - SimWin('You get nothing'); + if (CacheRealCookiesEarned >= 1000000000000000000000) SimWin('Nil zero zilch'); + if (CacheRealCookiesEarned >= 1000000000000000000000000) SimWin('Transcendence'); + if (CacheRealCookiesEarned >= 1000000000000000000000000000) SimWin('Obliterate'); + if (CacheRealCookiesEarned >= 1000000000000000000000000000000) SimWin('Negative void'); + if (CacheRealCookiesEarned >= 1000000000000000000000000000000000) SimWin('To crumbs, you say?'); + if (CacheRealCookiesEarned >= 1000000000000000000000000000000000000) SimWin('You get nothing'); if (CacheRealCookiesEarned >= 1000000000000000000000000000000000000000) SimWin('Humble rebeginnings'); if (CacheRealCookiesEarned >= 1000000000000000000000000000000000000000000) SimWin('The end of the world'); if (CacheRealCookiesEarned >= 1000000000000000000000000000000000000000000000) SimWin("Oh, you're back"); - if ( - CacheRealCookiesEarned >= 1000000000000000000000000000000000000000000000000 - ) + if (CacheRealCookiesEarned >= 1000000000000000000000000000000000000000000000000) SimWin('Lazarus'); - if ( - CacheRealCookiesEarned >= - 1000000000000000000000000000000000000000000000000000 - ) + if (CacheRealCookiesEarned >= 1000000000000000000000000000000000000000000000000000) SimWin('Smurf account'); - if ( - CacheRealCookiesEarned >= - 1000000000000000000000000000000000000000000000000000000 - ) + if (CacheRealCookiesEarned >= 1000000000000000000000000000000000000000000000000000000) SimWin("If at first you don't succeed"); SimUpgrades['Heavenly chip secret'].bought = 1; diff --git a/src/Sim/SimulationEvents/SellBuilding.js b/src/Sim/SimulationEvents/SellBuilding.js index c1386f1..606ef2f 100644 --- a/src/Sim/SimulationEvents/SellBuilding.js +++ b/src/Sim/SimulationEvents/SellBuilding.js @@ -12,14 +12,7 @@ import SimModifyBuildingPrice from '../ReplacedGameFunctions/SimModifyBuidlingPr * @param {number} noSim 1 of 0 depending on if function is called from CM.Sim * @returns {number} moni Total price gained */ -export default function BuildingSell( - build, - basePrice, - start, - free, - amount, - noSim, -) { +export default function BuildingSell(build, basePrice, start, free, amount, noSim) { // Calculate money gains from selling buildings // If noSim is set, use Game methods to compute price instead of Sim ones. const noSimRes = typeof noSim === 'undefined' ? 0 : noSim; @@ -29,15 +22,12 @@ export default function BuildingSell( if (amount === -1) toChange = startingAmount; if (!amount) toChange = Game.buyBulk; for (let i = 0; i < toChange; i++) { - let price = - basePrice * Game.priceIncrease ** Math.max(0, startingAmount - free); + let price = basePrice * Game.priceIncrease ** Math.max(0, startingAmount - free); price = noSimRes ? Game.modifyBuildingPrice(build, price) : SimModifyBuildingPrice(build, price); price = Math.ceil(price); - const giveBack = noSimRes - ? build.getSellMultiplier() - : SimGetSellMultiplier(); + const giveBack = noSimRes ? build.getSellMultiplier() : SimGetSellMultiplier(); price = Math.floor(price * giveBack); if (startingAmount > 0) { moni += price; diff --git a/src/Sim/SimulationEvents/SellBuildingForChoEgg.js b/src/Sim/SimulationEvents/SellBuildingForChoEgg.js index 5d95588..1bbfedb 100644 --- a/src/Sim/SimulationEvents/SellBuildingForChoEgg.js +++ b/src/Sim/SimulationEvents/SellBuildingForChoEgg.js @@ -1,10 +1,5 @@ import CopyData from '../SimulationData/CopyData'; -import { - SimBuildingsOwned, - SimDragonAura, - SimDragonAura2, - SimObjects, -} from '../VariablesAndData'; +import { SimBuildingsOwned, SimDragonAura, SimDragonAura2, SimObjects } from '../VariablesAndData'; import BuildingSell from './SellBuilding'; /** diff --git a/test/t_Disp/t_BeautifyFormatting.js b/test/t_Disp/t_BeautifyFormatting.js index 733df64..5ea559f 100644 --- a/test/t_Disp/t_BeautifyFormatting.js +++ b/test/t_Disp/t_BeautifyFormatting.js @@ -55,16 +55,10 @@ describe('FormatTime', () => { assert.equal(FormatTime(3601, 1), '1 hour, 0 minutes, 1 second'); }); it('Format when time is over 1 day', () => { - assert.equal( - FormatTime(86401, 1), - '1 day, 0 hours, 0 minutes, 1 second', - ); + assert.equal(FormatTime(86401, 1), '1 day, 0 hours, 0 minutes, 1 second'); }); it('Format when time is over 1 year', () => { - assert.equal( - FormatTime(31536001, 1), - '1 year, 0 days, 0 hours, 0 minutes, 1 second', - ); + assert.equal(FormatTime(31536001, 1), '1 year, 0 days, 0 hours, 0 minutes, 1 second'); }); it('Format when time is over >9000 days', () => { assert.equal(FormatTime(777600001, 1), 'Over 9000 days!'); diff --git a/tsconfig.json b/tsconfig.json index 00d6175..e7cfe69 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,6 @@ "noImplicitAny": true, "sourceMap": true, "target": "ES6", - "strictNullChecks": true, + "strictNullChecks": true } }