Path: blob/main/assets/javascript/cookieclicker/main.js
15352 views
var VERSION=2.021;1var BETA=1;234/*=====================================================================================5MISC HELPER FUNCTIONS6=======================================================================================*/7function l(what) {return document.getElementById(what);}8function choose(arr) {return arr[Math.floor(Math.random()*arr.length)];}910function escapeRegExp(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");}11function replaceAll(find,replace,str){return str.replace(new RegExp(escapeRegExp(find),'g'),replace);}1213//disable sounds coming from soundjay.com (sorry)14var realAudio=Audio;//backup real audio15Audio=function(src){16if (src && src.indexOf('soundjay')>-1) {Game.Popup('Sorry, no sounds hotlinked from soundjay.com.');this.play=function(){};}17else return new realAudio(src);18};1920if(!Array.prototype.indexOf) {21Array.prototype.indexOf = function(needle) {22for(var i = 0; i < this.length; i++) {23if(this[i] === needle) {return i;}24}25return -1;26};27}2829function randomFloor(x) {if ((x%1)<Math.random()) return Math.floor(x); else return Math.ceil(x);}3031function shuffle(array)32{33var counter = array.length, temp, index;34// While there are elements in the array35while (counter--)36{37// Pick a random index38index = (Math.random() * counter) | 0;3940// And swap the last element with it41temp = array[counter];42array[counter] = array[index];43array[index] = temp;44}45return array;46}4748var sinArray=[];49for (var i=0;i<360;i++)50{51//let's make a lookup table52sinArray[i]=Math.sin(i/360*Math.PI*2);53}54function quickSin(x)55{56//oh man this isn't all that fast actually57//why do I do this. why58var sign=x<0?-1:1;59return sinArray[Math.round(60(Math.abs(x)*360/Math.PI/2)%36061)]*sign;62}6364/*function ajax(url,callback){65var ajaxRequest;66try{ajaxRequest = new XMLHttpRequest();} catch (e){try{ajaxRequest=new ActiveXObject('Msxml2.XMLHTTP');} catch (e) {try{ajaxRequest=new ActiveXObject('Microsoft.XMLHTTP');} catch (e){alert("Something broke!");return false;}}}67if (callback){ajaxRequest.onreadystatechange=function(){if(ajaxRequest.readyState==4){callback(ajaxRequest.responseText);}}}68ajaxRequest.open('GET',url+'&nocache='+(new Date().getTime()),true);ajaxRequest.send(null);69}*/7071var ajax=function(url,callback)72{73var httpRequest=new XMLHttpRequest();74if (!httpRequest){return false;}75httpRequest.onreadystatechange=function()76{77try{78if (httpRequest.readyState===XMLHttpRequest.DONE && httpRequest.status===200)79{80callback(httpRequest.responseText);81}82}catch(e){}83}84//httpRequest.onerror=function(e){console.log('ERROR',e);}85if (url.indexOf('?')==-1) url+='?'; else url+='&';86url+='nocache='+Date.now();87httpRequest.open('GET',url);88httpRequest.setRequestHeader('Content-Type','text/plain');89httpRequest.overrideMimeType('text/plain');90httpRequest.send();91return true;92}939495//Beautify and number-formatting adapted from the Frozen Cookies add-on (http://cookieclicker.wikia.com/wiki/Frozen_Cookies_%28JavaScript_Add-on%29)96function formatEveryThirdPower(notations)97{98return function (value)99{100var base = 0,101notationValue = '';102if (!isFinite(value)) return 'Infinity';103if (value >= 1000000)104{105value /= 1000;106while(Math.round(value) >= 1000)107{108value /= 1000;109base++;110}111if (base >= notations.length) {return 'Infinity';} else {notationValue = notations[base];}112}113return ( Math.round(value * 1000) / 1000 ) + notationValue;114};115}116117function rawFormatter(value) {return Math.round(value * 1000) / 1000;}118119var formatLong=[' thousand',' million',' billion',' trillion',' quadrillion',' quintillion',' sextillion',' septillion',' octillion',' nonillion'];120var prefixes=['','un','duo','tre','quattuor','quin','sex','septen','octo','novem'];121var suffixes=['decillion','vigintillion','trigintillion','quadragintillion','quinquagintillion','sexagintillion','septuagintillion','octogintillion','nonagintillion'];122for (var i in suffixes)123{124for (var ii in prefixes)125{126formatLong.push(' '+prefixes[ii]+suffixes[i]);127}128}129130var formatShort=['k','M','B','T','Qa','Qi','Sx','Sp','Oc','No'];131var prefixes=['','Un','Do','Tr','Qa','Qi','Sx','Sp','Oc','No'];132var suffixes=['D','V','T','Qa','Qi','Sx','Sp','O','N'];133for (var i in suffixes)134{135for (var ii in prefixes)136{137formatShort.push(' '+prefixes[ii]+suffixes[i]);138}139}140formatShort[10]='Dc';141142143var numberFormatters =144[145formatEveryThirdPower(formatShort),146formatEveryThirdPower(formatLong),147rawFormatter148];149function Beautify(value,floats)150{151var negative=(value<0);152var decimal='';153var fixed=value.toFixed(floats);154if (Math.abs(value)<1000 && floats>0 && Math.floor(fixed)!=fixed) decimal='.'+(fixed.toString()).split('.')[1];155value=Math.floor(Math.abs(value));156if (floats>0 && fixed==value+1) value++;157var formatter=numberFormatters[Game.prefs.format?2:1];158var output=formatter(value).toString().replace(/\B(?=(\d{3})+(?!\d))/g,',');159if (output=='0') negative=false;160return negative?'-'+output:output+decimal;161}162function shortenNumber(value)163{164//if no scientific notation, return as is, else :165//keep only the 5 first digits (plus dot), round the rest166//may or may not work properly167if (value >= 1000000 && isFinite(value))168{169var num=value.toString();170var ind=num.indexOf('e+');171if (ind==-1) return value;172var str='';173for (var i=0;i<ind;i++)174{175str+=(i<6?num[i]:'0');176}177str+='e+';178str+=num.split('e+')[1];179return parseFloat(str);180}181return value;182}183184185var beautifyInTextFilter=/(([\d]+[,]*)+)/g;//new regex186var a=/\d\d?\d?(?:,\d\d\d)*/g;//old regex187function BeautifyInTextFunction(str){return Beautify(parseInt(str.replace(/,/g,''),10));};188function BeautifyInText(str) {return str.replace(beautifyInTextFilter,BeautifyInTextFunction);}//reformat every number inside a string189function BeautifyAll()//run through upgrades and achievements to reformat the numbers190{191var func=function(what){what.desc=BeautifyInText(what.baseDesc);}192Game.UpgradesById.forEach(func);193Game.AchievementsById.forEach(func);194}195196//these are faulty, investigate later197//function utf8_to_b64(str){return btoa(str);}198//function b64_to_utf8(str){return atob(str);}199200function utf8_to_b64( str ) {201try{return Base64.encode(unescape(encodeURIComponent( str )));}202catch(err)203{return '';}204}205206function b64_to_utf8( str ) {207try{return decodeURIComponent(escape(Base64.decode( str )));}208catch(err)209{return '';}210}211212function CompressBin(arr)//compress a sequence like [0,1,1,0,1,0]... into a number like 54.213{214var str='';215var arr2=arr.slice(0);216arr2.unshift(1);217arr2.push(1);218arr2.reverse();219for (var i in arr2)220{221str+=arr2[i];222}223str=parseInt(str,2);224return str;225}226227function UncompressBin(num)//uncompress a number like 54 to a sequence like [0,1,1,0,1,0].228{229var arr=num.toString(2);230arr=arr.split('');231arr.reverse();232arr.shift();233arr.pop();234return arr;235}236237function CompressLargeBin(arr)//we have to compress in smaller chunks to avoid getting into scientific notation238{239var arr2=arr.slice(0);240var thisBit=[];241var bits=[];242for (var i in arr2)243{244thisBit.push(arr2[i]);245if (thisBit.length>=50)246{247bits.push(CompressBin(thisBit));248thisBit=[];249}250}251if (thisBit.length>0) bits.push(CompressBin(thisBit));252arr2=bits.join(';');253return arr2;254}255256function UncompressLargeBin(arr)257{258var arr2=arr.split(';');259var bits=[];260for (var i in arr2)261{262bits.push(UncompressBin(parseInt(arr2[i])));263}264arr2=[];265for (var i in bits)266{267for (var ii in bits[i]) arr2.push(bits[i][ii]);268}269return arr2;270}271272273function pack(bytes) {274var chars = [];275var len=bytes.length;276for(var i = 0, n = len; i < n;) {277chars.push(((bytes[i++] & 0xff) << 8) | (bytes[i++] & 0xff));278}279return String.fromCharCode.apply(null, chars);280}281282function unpack(str) {283var bytes = [];284var len=str.length;285for(var i = 0, n = len; i < n; i++) {286var char = str.charCodeAt(i);287bytes.push(char >>> 8, char & 0xFF);288}289return bytes;290}291292//modified from http://www.smashingmagazine.com/2011/10/19/optimizing-long-lists-of-yesno-values-with-javascript/293function pack2(/* string */ values) {294var chunks = values.match(/.{1,14}/g), packed = '';295for (var i=0; i < chunks.length; i++) {296packed += String.fromCharCode(parseInt('1'+chunks[i], 2));297}298return packed;299}300301function unpack2(/* string */ packed) {302var values = '';303for (var i=0; i < packed.length; i++) {304values += packed.charCodeAt(i).toString(2).substring(1);305}306return values;307}308309function pack3(values){310//too many save corruptions, darn it to heck311return values;312}313314315//file save function from https://github.com/eligrey/FileSaver.js316var saveAs=saveAs||function(view){"use strict";if(typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var doc=view.document,get_URL=function(){return view.URL||view.webkitURL||view},save_link=doc.createElementNS("http://www.w3.org/1999/xhtml","a"),can_use_save_link="download"in save_link,click=function(node){var event=new MouseEvent("click");node.dispatchEvent(event)},is_safari=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),webkit_req_fs=view.webkitRequestFileSystem,req_fs=view.requestFileSystem||webkit_req_fs||view.mozRequestFileSystem,throw_outside=function(ex){(view.setImmediate||view.setTimeout)(function(){throw ex},0)},force_saveable_type="application/octet-stream",fs_min_size=0,arbitrary_revoke_timeout=500,revoke=function(file){var revoker=function(){if(typeof file==="string"){get_URL().revokeObjectURL(file)}else{file.remove()}};if(view.chrome){revoker()}else{setTimeout(revoker,arbitrary_revoke_timeout)}},dispatch=function(filesaver,event_types,event){event_types=[].concat(event_types);var i=event_types.length;while(i--){var listener=filesaver["on"+event_types[i]];if(typeof listener==="function"){try{listener.call(filesaver,event||filesaver)}catch(ex){throw_outside(ex)}}}},auto_bom=function(blob){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)){return new Blob(["\ufeff",blob],{type:blob.type})}return blob},FileSaver=function(blob,name,no_auto_bom){if(!no_auto_bom){blob=auto_bom(blob)}var filesaver=this,type=blob.type,blob_changed=false,object_url,target_view,dispatch_all=function(){dispatch(filesaver,"writestart progress write writeend".split(" "))},fs_error=function(){if(target_view&&is_safari&&typeof FileReader!=="undefined"){var reader=new FileReader;reader.onloadend=function(){var base64Data=reader.result;target_view.location.href="data:attachment/file"+base64Data.slice(base64Data.search(/[,;]/));filesaver.readyState=filesaver.DONE;dispatch_all()};reader.readAsDataURL(blob);filesaver.readyState=filesaver.INIT;return}if(blob_changed||!object_url){object_url=get_URL().createObjectURL(blob)}if(target_view){target_view.location.href=object_url}else{var new_tab=view.open(object_url,"_blank");if(new_tab==undefined&&is_safari){view.location.href=object_url}}filesaver.readyState=filesaver.DONE;dispatch_all();revoke(object_url)},abortable=function(func){return function(){if(filesaver.readyState!==filesaver.DONE){return func.apply(this,arguments)}}},create_if_not_found={create:true,exclusive:false},slice;filesaver.readyState=filesaver.INIT;if(!name){name="download"}if(can_use_save_link){object_url=get_URL().createObjectURL(blob);setTimeout(function(){save_link.href=object_url;save_link.download=name;click(save_link);dispatch_all();revoke(object_url);filesaver.readyState=filesaver.DONE});return}if(view.chrome&&type&&type!==force_saveable_type){slice=blob.slice||blob.webkitSlice;blob=slice.call(blob,0,blob.size,force_saveable_type);blob_changed=true}if(webkit_req_fs&&name!=="download"){name+=".download"}if(type===force_saveable_type||webkit_req_fs){target_view=view}if(!req_fs){fs_error();return}fs_min_size+=blob.size;req_fs(view.TEMPORARY,fs_min_size,abortable(function(fs){fs.root.getDirectory("saved",create_if_not_found,abortable(function(dir){var save=function(){dir.getFile(name,create_if_not_found,abortable(function(file){file.createWriter(abortable(function(writer){writer.onwriteend=function(event){target_view.location.href=file.toURL();filesaver.readyState=filesaver.DONE;dispatch(filesaver,"writeend",event);revoke(file)};writer.onerror=function(){var error=writer.error;if(error.code!==error.ABORT_ERR){fs_error()}};"writestart progress write abort".split(" ").forEach(function(event){writer["on"+event]=filesaver["on"+event]});writer.write(blob);filesaver.abort=function(){writer.abort();filesaver.readyState=filesaver.DONE};filesaver.readyState=filesaver.WRITING}),fs_error)}),fs_error)};dir.getFile(name,{create:false},abortable(function(file){file.remove();save()}),abortable(function(ex){if(ex.code===ex.NOT_FOUND_ERR){save()}else{fs_error()}}))}),fs_error)}),fs_error)},FS_proto=FileSaver.prototype,saveAs=function(blob,name,no_auto_bom){return new FileSaver(blob,name,no_auto_bom)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(blob,name,no_auto_bom){if(!no_auto_bom){blob=auto_bom(blob)}return navigator.msSaveOrOpenBlob(blob,name||"download")}}FS_proto.abort=function(){var filesaver=this;filesaver.readyState=filesaver.DONE;dispatch(filesaver,"abort")};FS_proto.readyState=FS_proto.INIT=0;FS_proto.WRITING=1;FS_proto.DONE=2;FS_proto.error=FS_proto.onwritestart=FS_proto.onprogress=FS_proto.onwrite=FS_proto.onabort=FS_proto.onerror=FS_proto.onwriteend=null;return saveAs}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!=null){define([],function(){return saveAs})}317318319//seeded random function, courtesy of http://davidbau.com/archives/2010/01/30/random_seeds_coded_hints_and_quintillions.html320(function(a,b,c,d,e,f){function k(a){var b,c=a.length,e=this,f=0,g=e.i=e.j=0,h=e.S=[];for(c||(a=[c++]);d>f;)h[f]=f++;for(f=0;d>f;f++)h[f]=h[g=j&g+a[f%c]+(b=h[f])],h[g]=b;(e.g=function(a){for(var b,c=0,f=e.i,g=e.j,h=e.S;a--;)b=h[f=j&f+1],c=c*d+h[j&(h[f]=h[g=j&g+b])+(h[g]=b)];return e.i=f,e.j=g,c})(d)}function l(a,b){var e,c=[],d=(typeof a)[0];if(b&&"o"==d)for(e in a)try{c.push(l(a[e],b-1))}catch(f){}return c.length?c:"s"==d?a:a+"\0"}function m(a,b){for(var d,c=a+"",e=0;c.length>e;)b[j&e]=j&(d^=19*b[j&e])+c.charCodeAt(e++);return o(b)}function n(c){try{return a.crypto.getRandomValues(c=new Uint8Array(d)),o(c)}catch(e){return[+new Date,a,a.navigator.plugins,a.screen,o(b)]}}function o(a){return String.fromCharCode.apply(0,a)}var g=c.pow(d,e),h=c.pow(2,f),i=2*h,j=d-1;c.seedrandom=function(a,f){var j=[],p=m(l(f?[a,o(b)]:0 in arguments?a:n(),3),j),q=new k(j);return m(o(q.S),b),c.random=function(){for(var a=q.g(e),b=g,c=0;h>a;)a=(a+c)*d,b*=d,c=q.g(1);for(;a>=i;)a/=2,b/=2,c>>>=1;return(a+c)/b},p},m(c.random(),b)})(this,[],Math,256,6,52);321322function bind(scope,fn)323{324//use : bind(this,function(){this.x++;}) - returns a function where "this" refers to the scoped this325return function() {fn.apply(scope,arguments);};326}327328var grabProps=function(arr,prop)329{330if (!arr) return [];331arr2=[];332for (var i=0;i<arr.length;i++)333{334arr2.push(arr[i][prop]);335}336return arr2;337}338339CanvasRenderingContext2D.prototype.fillPattern=function(img,X,Y,W,H,iW,iH,offX,offY)340{341//for when built-in patterns aren't enough342if (img.alt!='blank')343{344var offX=offX||0;345var offY=offY||0;346if (offX<0) {offX=offX-Math.floor(offX/iW)*iW;} if (offX>0) {offX=(offX%iW)-iW;}347if (offY<0) {offY=offY-Math.floor(offY/iH)*iH;} if (offY>0) {offY=(offY%iH)-iH;}348for (var y=offY;y<H;y+=iH){for (var x=offX;x<W;x+=iW){this.drawImage(img,X+x,Y+y,iW,iH);}}349}350}351352var OldCanvasDrawImage=CanvasRenderingContext2D.prototype.drawImage;353CanvasRenderingContext2D.prototype.drawImage=function()354{355//only draw the image if it's loaded356if (arguments[0].alt!='blank') OldCanvasDrawImage.apply(this,arguments);357}358359360if (!document.hasFocus) document.hasFocus=function(){return document.hidden;};//for Opera361362function AddEvent(html_element, event_name, event_function)363{364if(html_element.attachEvent) html_element.attachEvent("on" + event_name, function() {event_function.call(html_element);});365else if(html_element.addEventListener) html_element.addEventListener(event_name, event_function, false);366}367368function FireEvent(el, etype)369{370if (el.fireEvent)371{el.fireEvent('on'+etype);}372else373{374var evObj=document.createEvent('Events');375evObj.initEvent(etype,true,false);376el.dispatchEvent(evObj);377}378}379380var Loader=function()//asset-loading system381{382this.loadingN=0;383this.assetsN=0;384this.assets=[];385this.assetsLoading=[];386this.assetsLoaded=[];387this.domain='';388this.loaded=0;//callback389this.doneLoading=0;390391this.blank=document.createElement('canvas');392this.blank.width=8;393this.blank.height=8;394this.blank.alt='blank';395396this.Load=function(assets)397{398for (var i in assets)399{400this.loadingN++;401this.assetsN++;402if (!this.assetsLoading[assets[i]] && !this.assetsLoaded[assets[i]])403{404var img=new Image();405img.src=this.domain+assets[i];406img.alt=assets[i];407img.onload=bind(this,this.onLoad);408this.assets[assets[i]]=img;409this.assetsLoading.push(assets[i]);410}411}412}413this.Replace=function(old,newer)414{415if (this.assets[old])416{417var img=new Image();418if (newer.indexOf('http')!=-1) img.src=newer;419else img.src=this.domain+newer;420img.alt=newer;421img.onload=bind(this,this.onLoad);422this.assets[old]=img;423}424}425this.onLoadReplace=function()426{427}428this.onLoad=function(e)429{430this.assetsLoaded.push(e.target.alt);431this.assetsLoading.splice(this.assetsLoading.indexOf(e.target.alt),1);432this.loadingN--;433if (this.doneLoading==0 && this.loadingN<=0 && this.loaded!=0)434{435this.doneLoading=1;436this.loaded();437}438}439this.getProgress=function()440{441return (1-this.loadingN/this.assetsN);442}443}444445var Pic=function(what)446{447if (Game.Loader.assetsLoaded.indexOf(what)!=-1) return Game.Loader.assets[what];448else if (Game.Loader.assetsLoading.indexOf(what)==-1) Game.Loader.Load([what]);449return Game.Loader.blank;450}451452var Sounds=[];453var OldPlaySound=function(url,vol)454{455var volume=1;456if (vol!==undefined) volume=vol;457if (!Game.volume || volume==0) return 0;458if (!Sounds[url]) {Sounds[url]=new Audio(url);Sounds[url].onloadeddata=function(e){e.target.volume=Math.pow(volume*Game.volume/100,2);}}459else if (Sounds[url].readyState>=2) {Sounds[url].currentTime=0;Sounds[url].volume=Math.pow(volume*Game.volume/100,2);}460Sounds[url].play();461}462var SoundInsts=[];463var SoundI=0;464for (var i=0;i<12;i++){SoundInsts[i]=new Audio();}465var pitchSupport=false;466//note : Chrome turns out to not support webkitPreservesPitch despite the specifications claiming otherwise, and Firefox clips some short sounds when changing playbackRate, so i'm turning the feature off completely until browsers get it together467//if (SoundInsts[0].preservesPitch || SoundInsts[0].mozPreservesPitch || SoundInsts[0].webkitPreservesPitch) pitchSupport=true;468469var PlaySound=function(url,vol,pitchVar)470{471//url : the url of the sound to play (will be cached so it only loads once)472//vol : volume between 0 and 1 (multiplied by game volume setting); defaults to 1 (full volume)473//(DISABLED) pitchVar : pitch variance in browsers that support it (Firefox only at the moment); defaults to 0.05 (which means pitch can be up to -5% or +5% anytime the sound plays)474var volume=1;475var pitchVar=(typeof pitchVar==='undefined')?0.05:pitchVar;476var rate=1+(Math.random()*2-1)*pitchVar;477if (typeof vol!=='undefined') volume=vol;478if (!Game.volume || volume==0) return 0;479if (!Sounds[url])480{481//sound isn't loaded, cache it482Sounds[url]=new Audio(url);483Sounds[url].onloadeddata=function(e){PlaySound(url,vol,pitchVar);}484}485else if (Sounds[url].readyState>=2)486{487var sound=SoundInsts[SoundI];488SoundI++;489if (SoundI>=12) SoundI=0;490sound.src=Sounds[url].src;491//sound.currentTime=0;492sound.volume=Math.pow(volume*Game.volume/100,2);493if (pitchSupport && rate!=0)494{495sound.preservesPitch=false;496sound.mozPreservesPitch=false;497sound.webkitPreservesPitch=false;498sound.playbackRate=rate;499}500sound.play();501}502}503504if (!Date.now){Date.now=function now() {return new Date().getTime();};}505506triggerAnim=function(element,anim)507{508if (!element) return;509element.classList.remove(anim);510void element.offsetWidth;511element.classList.add(anim);512};513514var debugStr='';515var Debug=function(what)516{517if (!debugStr) debugStr=what;518else debugStr+='; '+what;519}520521var Timer={};522Timer.t=Date.now();523Timer.labels=[];524Timer.smoothed=[];525Timer.reset=function()526{527Timer.labels=[];528Timer.t=Date.now();529}530Timer.track=function(label)531{532if (!Game.sesame) return;533var now=Date.now();534if (!Timer.smoothed[label]) Timer.smoothed[label]=0;535Timer.smoothed[label]+=((now-Timer.t)-Timer.smoothed[label])*0.1;536Timer.labels[label]='<div style="padding-left:8px;">'+label+' : '+Math.round(Timer.smoothed[label])+'ms</div>';537Timer.t=now;538}539Timer.clean=function()540{541if (!Game.sesame) return;542var now=Date.now();543Timer.t=now;544}545Timer.say=function(label)546{547if (!Game.sesame) return;548Timer.labels[label]='<div style="border-top:1px solid #ccc;">'+label+'</div>';549}550551552/*=====================================================================================553GAME INITIALIZATION554=======================================================================================*/555var Game={};556557Game.Launch=function()558{559Game.version=VERSION;560Game.beta=BETA;561if (window.location.href.indexOf('/beta')>-1) Game.beta=1;562Game.https=(location.protocol!='https:')?false:true;563Game.mobile=0;564Game.touchEvents=0;565//if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) Game.mobile=1;566//if (Game.mobile) Game.touchEvents=1;567//if ('ontouchstart' in document.documentElement) Game.touchEvents=1;568569var css=document.createElement('style');570css.type='text/css';571css.innerHTML='body .icon,body .crate,body .usesIcon{background-image:url(img/icons.png?v='+Game.version+');}';572document.head.appendChild(css);573574Game.baseSeason='';//halloween, christmas, valentines, fools, easter575//automatic season detection (might not be 100% accurate)576var day=Math.floor((new Date()-new Date(new Date().getFullYear(),0,0))/(1000*60*60*24));577if (day>=41 && day<=46) Game.baseSeason='valentines';578else if (day>=90 && day<=92) Game.baseSeason='fools';579else if (day>=304-7 && day<=304) Game.baseSeason='halloween';580else if (day>=349 && day<=365) Game.baseSeason='christmas';581else582{583//easter is a pain goddamn584var easterDay=function(Y){var C = Math.floor(Y/100);var N = Y - 19*Math.floor(Y/19);var K = Math.floor((C - 17)/25);var I = C - Math.floor(C/4) - Math.floor((C - K)/3) + 19*N + 15;I = I - 30*Math.floor((I/30));I = I - Math.floor(I/28)*(1 - Math.floor(I/28)*Math.floor(29/(I + 1))*Math.floor((21 - N)/11));var J = Y + Math.floor(Y/4) + I + 2 - C + Math.floor(C/4);J = J - 7*Math.floor(J/7);var L = I - J;var M = 3 + Math.floor((L + 40)/44);var D = L + 28 - 31*Math.floor(M/4);return new Date(Y,M-1,D);}(new Date().getFullYear());585easterDay=Math.floor((easterDay-new Date(easterDay.getFullYear(),0,0))/(1000*60*60*24));586if (day>=easterDay-7 && day<=easterDay) Game.baseSeason='easter';587}588589Game.updateLog=590'<div class="selectable">'+591'<div class="section">Info</div>'+592'<div class="subsection">'+593'<div class="title">About</div>'+594'<div class="listing">Cookie Clicker is a javascript game by <a href="http://orteil.dashnet.org" target="_blank">Orteil</a> and <a href="http://dashnet.org" target="_blank">Opti</a>.</div>'+595//'<div class="listing">We have an <a href="https://discordapp.com/invite/cookie" target="_blank">official Discord</a>, as well as a <a href="http://forum.dashnet.org" target="_blank">forum</a>; '+596'<div class="listing">We have an <a href="https://discordapp.com/invite/cookie" target="_blank">official Discord</a>; '+597'if you\'re looking for help, you may also want to visit the <a href="http://www.reddit.com/r/CookieClicker" target="_blank">subreddit</a> '+598'or the <a href="http://cookieclicker.wikia.com/wiki/Cookie_Clicker_Wiki" target="_blank">wiki</a>.</div>'+599'<div class="listing">News and teasers are usually posted on my <a href="http://orteil42.tumblr.com/" target="_blank">tumblr</a> and <a href="http://twitter.com/orteil42" target="_blank">twitter</a>.</div>'+600'<div class="listing" id="supportSection"><b style="color:#fff;opacity:1;">Cookie Clicker is 100% free, forever.</b> Want to support us so we can keep developing games? Here\'s some ways you can help :<div style="margin:4px 12px;line-height:150%;">'+601'<br>• support us on <a href="https://www.patreon.com/dashnet" target="_blank" class="highlightHover" style="background:#f86754;box-shadow:0px 0px 0px 1px #c52921 inset,0px 2px 0px #ff966d inset;text-shadow:0px -1px 0px #ff966d,0px 1px 0px #c52921;text-decoration:none;color:#fff;font-weight:bold;padding:1px 4px;">Patreon</a> <span style="opacity:0.5;">(there\'s perks!)</span>'+602'<br>• <form target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post" id="donate"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="BBN2WL3TC6QH4"><input type="submit" id="donateButton" value="donate" name="submit" alt="PayPal — The safer, easier way to pay online."><img alt="" border="0" src="https://www.paypalobjects.com/nl_NL/i/scr/pixel.gif" width="1" height="1"></form> to our PayPal'+603'<br>• disable your adblocker<br>• check out our <a href="http://www.redbubble.com/people/dashnet" target="_blank">rad cookie shirts, hoodies and stickers</a>!<br>• (if you want!)</div></div>'+604'<div class="listing warning">Note : if you find a new bug after an update and you\'re using a 3rd-party add-on, make sure it\'s not just your add-on causing it!</div>'+605'<div class="listing warning">Warning : clearing your browser cache or cookies <small>(what else?)</small> will result in your save being wiped. Export your save and back it up first!</div>'+606607'</div><div class="subsection">'+608'<div class="title">Version history</div>'+609610'</div><div class="subsection update">'+611'<div class="title">16/09/2019 - going off-script</div>'+612'<div class="listing">• added a new building</div>'+613'<div class="listing">• added fortune cookies (a new heavenly upgrade)</div>'+614'<div class="listing">• more upgrades, achievements etc</div>'+615'<div class="listing">• updated the Russian bread cookies icon to better reflect their cyrillic origins</div>'+616'<div class="listing">• also released the official Android version of Cookie Clicker, playable <a href="https://play.google.com/store/apps/details?id=org.dashnet.cookieclicker" target="_blank">here</a> (iOS version will come later)</div>'+617618'</div><div class="subsection update small">'+619'<div class="title">01/04/2019 - 2.019 (the "this year" update)</div>'+620'<div class="listing">• game has been renamed to "Cookie Clicker" to avoid confusion</div>'+621'<div class="listing">• can now click the big cookie to generate cookies for free</div>'+622'<div class="listing">• removed fall damage</div>'+623//'<div class="listing">• fixed various typos : player\'s name is now correctly spelled as "[bakeryName]"</div>'+624'<div class="listing">• removed all references to computer-animated movie <i style="font-style:italic;">Hoodwinked!</i> (2005)</div>'+625'<div class="listing">• went back in time and invented cookies and computer mice, ensuring Cookie Clicker would one day come to exist</div>'+626'<div class="listing">• game now fully compliant with Geneva Conventions</div>'+627'<div class="listing">• dropped support for TI-84 version</div>'+628'<div class="listing">• released a low-res retro version of the game, playable here : <a href="http://orteil.dashnet.org/experiments/cookie/" target="_blank">orteil.dashnet.org/experiments/cookie</a></div>'+629'<div class="listing">• updated version number</div>'+630631'</div><div class="subsection update small">'+632'<div class="title">05/03/2019 - cookies for days</div>'+633'<div class="listing">• added over 20 new cookies, all previously suggested by our supporters on <a href="https://www.patreon.com/dashnet" target="_blank">Patreon</a></div>'+634'<div class="listing">• added 2 heavenly upgrades</div>'+635'<div class="listing">• the Golden goose egg now counts as a golden cookie upgrade for Residual luck purposes</div>'+636'<div class="listing">• golden sugar lumps now either double your cookies, or give you 24 hours of your CpS, whichever is lowest (previously was doubling cookies with no cap)</div>'+637'<div class="listing">• the amount of heralds is now saved with your game, and is used to compute offline CpS the next time the game is loaded; previously, on page load, the offline calculation assumed heralds to be 0</div>'+638'<div class="listing">• added a system to counteract the game freezing up (and not baking cookies) after being inactive for a long while on slower computers; instead, this will now trigger sleep mode, during which you still produce cookies as if the game was closed; to enable this feature, use the "Sleep mode timeout" option in the settings</div>'+639'<div class="listing">• vaulting upgrades is now done with shift-click, as ctrl-click was posing issues for Mac browsers</div>'+640'<div class="listing">• made tooltips for building CpS boosts from synergies hopefully clearer</div>'+641'<div class="listing">• fixed an exploit with gambler\'s fever dream working across exports and ascensions</div>'+642'<div class="listing">• can now hide tooltips in the garden by keeping the shift key pressed to make it easier to see where you\'re planting</div>'+643'<div class="listing">• fixed a bug with golden cookies/reindeer not disappearing properly in some circumstances</div>'+644'<div class="listing">• the Dragon\'s Curve aura should now properly make sugar lumps twice as weird</div>'+645'<div class="listing">• the ctrl key should less often register incorrectly as pressed</div>'+646'<div class="listing">• added a new ad slot in the top-right, as while our playerbase is strong and supportive as ever, our ad revenue sometimes fluctuates badly; we may remove the ad again should our income stabilize</div>'+647'<div class="listing">• made a few adjustments to make the game somewhat playable in mobile browsers; it\'s not perfect and can get buggy, but it\'s functional! (you may need to zoom out or scroll around to view the game properly)</div>'+648'<div class="listing">• speaking of which, we also got some good progress on the mobile app version (built from scratch for mobile), so stay tuned!</div>'+649650'</div><div class="subsection update">'+651'<div class="title">25/10/2018 - feedback loop</div>'+652'<div class="listing">• added a new building</div>'+653'<div class="listing">• launched our <a href="https://www.patreon.com/dashnet" class="orangeLink" target="_blank">Patreon</a> <span style="font-size:80%;">(the link is orange so you\'ll notice it!)</span></div>'+654'<div class="listing">• added a bunch of new heavenly upgrades, one of which ties into our Patreon but benefits everyone (this is still experimental!)</div>'+655'<div class="listing">• when hovering over grandmas, you can now see their names and ages</div>'+656'<div class="listing">• "make X cookies just from Y" requirements are now higher</div>'+657'<div class="listing">• tweaked the prices of some heavenly upgrades to better fit the current cookie economy (it turns out billions of heavenly chips is now very achievable)</div>'+658'<div class="listing">• building tooltips now display what % of CpS they contribute through synergy upgrades</div>'+659'<div class="listing">• queenbeets now give up to 4% of bank, down from 6%</div>'+660'<div class="listing">• among other things, season switches now display how many seasonal upgrades you\'re missing, and permanent upgrade slots now display the name of the slotted upgrade</div>'+661'<div class="listing">• season switches have reworked prices</div>'+662'<div class="listing">• season switches can now be cancelled by clicking them again</div>'+663'<div class="listing">• can no longer accidentally click wrinklers through other elements</div>'+664'<div class="listing">• sugar frenzy now triples your CpS for an hour instead of doubling it</div>'+665'<div class="listing">• this text is now selectable</div>'+666'<div class="listing">• progress on dungeons minigame is still very much ongoing</div>'+667668'</div><div class="subsection update small">'+669'<div class="title">08/08/2018 - hey now</div>'+670'<div class="listing">• Cookie Clicker somehow turns 5, going against doctors\' most optimistic estimates</div>'+671'<div class="listing">• added a new tier of building achievements, all named after Smash Mouth\'s classic 1999 hit "All Star"</div>'+672'<div class="listing">• added a new tier of building upgrades, all named after nothing in particular</div>'+673'<div class="listing">• <b>to our players :</b> thank you so much for sticking with us all those years and allowing us to keep making the dumbest game known to mankind</div>'+674'<div class="listing">• resumed work on the dungeons minigame</div>'+675676'</div><div class="subsection update small">'+677'<div class="title">01/08/2018 - buy buy buy</div>'+678'<div class="listing">• added a heavenly upgrade that lets you buy all your upgrades instantly</div>'+679'<div class="listing">• added a heavenly upgrade that lets you see upgrade tiers (feature was previously removed due to being confusing)</div>'+680'<div class="listing">• added a new wrinkler-related heavenly upgrade</div>'+681'<div class="listing">• added a new upgrade tier</div>'+682'<div class="listing">• added a couple new cookies and achievements</div>'+683'<div class="listing">• new "extra buttons" setting; turning it on adds buttons that let you minimize buildings</div>'+684'<div class="listing">• new "lump confirmation" setting; turning it on will show a confirmation prompt when you spend sugar lumps</div>'+685'<div class="listing">• buildings now sell back for 25% of their current price (down from 50%); Earth Shatterer modified accordingly, now gives back 50% (down from 85%)</div>'+686'<div class="listing">• farm soils now unlock correctly based on current amount of farms</div>'+687'<div class="listing">• cheapcaps have a new exciting nerf</div>'+688'<div class="listing">• wrinklegill spawns a bunch more</div>'+689'<div class="listing">• can now ctrl-shift-click on "Harvest all" to only harvest mature, non-immortal plants</div>'+690'<div class="listing">• added a new rare type of sugar lump</div>'+691692'</div><div class="subsection update small">'+693'<div class="title">20/04/2018 - weeding out some bugs</div>'+694'<div class="listing">• golden clovers and wrinklegills should spawn a bit more often</div>'+695'<div class="listing">• cronerice matures a lot sooner</div>'+696'<div class="listing">• mature elderworts stay mature after reloading</div>'+697'<div class="listing">• garden interface occupies space more intelligently</div>'+698'<div class="listing">• seed price displays should be better behaved with short numbers disabled</div>'+699'<div class="listing">• minigame animations are now turned off if using the "Fancy graphics" option is disabled</div>'+700'<div class="listing">• CpS achievement requirements were dialed down a wee tad</div>'+701702'</div><div class="subsection update small">'+703'<div class="title">19/04/2018 - garden patch</div>'+704'<div class="listing">• upgrades dropped by garden plants now stay unlocked forever (but drop much more rarely)</div>'+705'<div class="listing">• garden sugar lump refill now also makes plants spread and mutate 3 times more during the bonus tick</div>'+706'<div class="listing">• a few new upgrades</div>'+707'<div class="listing">• a couple bug fixes and rephrasings</div>'+708709'</div><div class="subsection update">'+710'<div class="title">18/04/2018 - your garden-variety update</div>'+711'<div class="listing">• added the garden, a minigame unlocked by having at least level 1 farms</div>'+712'<div class="listing">• added a little arrow and a blinky label to signal the game has updated since you last played it (hi!)</div>'+713'<div class="listing">• new cookies, milk flavors and achievements</div>'+714'<div class="listing">• sugar lumps are now unlocked whenever you\'ve baked at least a billion cookies, instead of on your first ascension</div>'+715'<div class="listing">• sugar lump type now saves correctly</div>'+716'<div class="listing">• minigame sugar lump refills can now only be done every 15 minutes (timer shared across all minigames)</div>'+717'<div class="listing">• CpS achievements now have steeper requirements</div>'+718'<div class="listing">• golden cookies now last 5% shorter for every other golden cookie on the screen</div>'+719'<div class="listing">• the game now remembers which minigames are closed or open</div>'+720'<div class="listing">• added a popup that shows when a season starts (so people won\'t be so confused about "the game looking weird today")</div>'+721'<div class="listing">• permanent upgrade slots now show a tooltip for the selected upgrade</div>'+722'<div class="listing">• finally fixed the save corruption bug, hopefully</div>'+723724'</div><div class="subsection update small">'+725'<div class="title">24/02/2018 - sugar coating</div>'+726'<div class="listing">• added link to <a href="https://discordapp.com/invite/cookie" target="_blank">official Discord server</a></div>'+727'<div class="listing">• felt weird about pushing an update without content so :</div>'+728'<div class="listing">• added a handful of new cookies</div>'+729'<div class="listing">• added 3 new heavenly upgrades</div>'+730'<div class="listing">• short numbers should now be displayed up to novemnonagintillions</div>'+731'<div class="listing">• cookie chains no longer spawn from the Force the Hand of Fate spell</div>'+732'<div class="listing">• bigger, better Cookie Clicker content coming later this year</div>'+733734'</div><div class="subsection update">'+735'<div class="title">08/08/2017 - 4 more years</div>'+736'<div class="listing">• new building : Chancemakers</div>'+737'<div class="listing">• new milk, new kittens, new dragon aura, new cookie, new upgrade tier</div>'+738'<div class="listing">• buffs no longer affect offline CpS</div>'+739'<div class="listing">• Godzamok\'s hunger was made less potent (this is a nerf, very sorry)</div>'+740'<div class="listing">• grimoire spell costs and maximum magic work differently</div>'+741'<div class="listing">• Spontaneous Edifice has been reworked</div>'+742'<div class="listing">• changed unlock levels and prices for some cursor upgrades</div>'+743'<div class="listing">• fixed buggy pantheon slots, hopefully</div>'+744'<div class="listing">• fixed "Legacy started a long while ago" showing as "a few seconds ago"</div>'+745'<div class="listing">• Cookie Clicker just turned 4. Thank you for sticking with us this long!</div>'+746747'</div><div class="subsection update">'+748'<div class="title">15/07/2017 - the spiritual update</div>'+749'<div class="listing">• implemented sugar lumps, which start coalescing if you\'ve ascended at least once and can be used as currency for special things</div>'+750'<div class="listing">• buildings can now level up by using sugar lumps in the main buildings display, permanently boosting their CpS</div>'+751'<div class="listing">• added two new features unlocked by levelling up their associated buildings, Temples and Wizard towers; more building-related minigames will be implemented in the future</div>'+752'<div class="listing">• active buffs are now saved</div>'+753'<div class="listing">• the background selector upgrade is now functional</div>'+754'<div class="listing">• the top menu no longer scrolls with the rest</div>'+755'<div class="listing">• timespans are written nicer</div>'+756'<div class="listing">• Dragonflights now tend to supercede Click frenzies, you will rarely have both at the same time</div>'+757'<div class="listing">• some old bugs were phased out and replaced by new ones</div>'+758759'</div><div class="subsection update small">'+760'<div class="title">24/07/2016 - golden cookies overhaul</div>'+761'<div class="listing">• golden cookies and reindeer now follow a new system involving explicitly defined buffs</div>'+762'<div class="listing">• a bunch of new golden cookie effects have been added</div>'+763'<div class="listing">• CpS gains from eggs are now multiplicative</div>'+764'<div class="listing">• shiny wrinklers are now saved</div>'+765'<div class="listing">• reindeer have been rebalanced ever so slightly</div>'+766'<div class="listing">• added a new cookie upgrade near the root of the heavenly upgrade tree; this is intended to boost early ascensions and speed up the game as a whole</div>'+767'<div class="listing">• due to EU legislation, implemented a warning message regarding browser cookies; do understand that the irony is not lost on us</div>'+768769'</div><div class="subsection update">'+770'<div class="title">08/02/2016 - legacy</div>'+771'<div class="listing"><b>Everything that was implemented during the almost 2-year-long beta has been added to the live game. To recap :</b></div>'+772'<div class="listing">• 3 new buildings : banks, temples, and wizard towers; these have been added in-between existing buildings and as such, may disrupt some building-related achievements</div>'+773'<div class="listing">• the ascension system has been redone from scratch, with a new heavenly upgrade tree</div>'+774'<div class="listing">• mysterious new features such as angel-powered offline progression, challenge runs, and a cookie dragon</div>'+775'<div class="listing">• sounds have been added (can be disabled in the options)</div>'+776'<div class="listing">• heaps of rebalancing and bug fixes</div>'+777'<div class="listing">• a couple more upgrades and achievements, probably</div>'+778'<div class="listing">• fresh new options to further customize your cookie-clicking experience</div>'+779'<div class="listing">• quality-of-life improvements : better bulk-buy, better switches etc</div>'+780'<div class="listing">• added some <a href="http://en.wikipedia.org/wiki/'+choose(['Krzysztof_Arciszewski','Eustachy_Sanguszko','Maurycy_Hauke','Karol_Turno','Tadeusz_Kutrzeba','Kazimierz_Fabrycy','Florian_Siwicki'])+'" target="_blank">general polish</a></div>'+/* i liked this dumb pun too much to let it go unnoticed */781'<div class="listing">• tons of other little things we can\'t even remember right now</div>'+782'<div class="listing">Miss the old version? Your old save was automatically exported <a href="http://orteil.dashnet.org/cookieclicker/v10466/" target="_blank">here</a>!</div>'+783784'</div><div class="subsection update small">'+785'<div class="title">05/02/2016 - legacy beta, more fixes</div>'+786'<div class="listing">• added challenge modes, which can be selected when ascending (only 1 for now : "Born again")</div>'+787'<div class="listing">• changed the way bulk-buying and bulk-selling works</div>'+788'<div class="listing">• more bugs ironed out</div>'+789790'</div><div class="subsection update">'+791'<div class="title">03/02/2016 - legacy beta, part III</div>'+792'<div class="listing warning">• Not all bugs have been fixed, but everything should be much less broken.</div>'+793'<div class="listing">• Additions'+794'<div style="opacity:0.8;margin-left:12px;">'+795'-a few more achievements<br>'+796'-new option for neat, but slow CSS effects (disabled by default)<br>'+797'-new option for a less grating cookie sound (enabled by default)<br>'+798'-new option to bring back the boxes around icons in the stats screen<br>'+799'-new buttons for saving and loading your game to a text file<br>'+800'</div>'+801'</div>'+802'<div class="listing">• Changes'+803'<div style="opacity:0.8;margin-left:12px;">'+804'-early game should be a bit faster and very late game was kindly asked to tone it down a tad<br>'+805'-dragonflight should be somewhat less ridiculously overpowered<br>'+806'-please let me know if the rebalancing was too heavy or not heavy enough<br>'+807'-santa and easter upgrades now depend on Santa level and amount of eggs owned, respectively, instead of costing several minutes worth of CpS<br>'+808'-cookie upgrades now stack multiplicatively rather than additively<br>'+809'-golden switch now gives +50% CpS, and residual luck is +10% CpS per golden cookie upgrade (up from +25% and +1%, respectively)<br>'+810'-lucky cookies and cookie chain payouts have been modified a bit, possibly for the better, who knows!<br>'+811'-wrinklers had previously been reduced to a maximum of 8 (10 with a heavenly upgrade), but are now back to 10 (12 with the upgrade)<br>'+812/*'-all animations are now handled by requestAnimationFrame(), which should hopefully help make the game less resource-intensive<br>'+*/813'-an ascension now only counts for achievement purposes if you earned at least 1 prestige level from it<br>'+814'-the emblematic Cookie Clicker font (Kavoon) was bugged in Firefox, and has been replaced with a new font (Merriweather)<br>'+815'-the mysterious wrinkly creature is now even rarer, but has a shadow achievement tied to it<br>'+816'</div>'+817'</div>'+818'<div class="listing">• Fixes'+819'<div style="opacity:0.8;margin-left:12px;">'+820'-prestige now grants +1% CpS per level as intended, instead of +100%<br>'+821'-heavenly chips should no longer add up like crazy when you ascend<br>'+822'-upgrades in the store should no longer randomly go unsorted<br>'+823'-window can be resized to any size again<br>'+824'-the "Stats" and "Options" buttons have been swapped again<br>'+825'-the golden cookie sound should be somewhat clearer<br>'+826'-the ascend screen should be less CPU-hungry<br>'+827'</div>'+828'</div>'+829830'</div><div class="subsection update">'+831'<div class="title">20/12/2015 - legacy beta, part II</div>'+832'<div class="listing warning">• existing beta saves have been wiped due to format inconsistencies and just plain broken balance; you\'ll have to start over from scratch - which will allow you to fully experience the update and find all the awful little bugs that no doubt plague it</div>'+833'<div class="listing warning">• importing your save from the live version is also fine</div>'+834'<div class="listing">• we took so long to make this update, Cookie Clicker turned 2 years old in the meantime! Hurray!</div>'+835'<div class="listing">• heaps of new upgrades and achievements</div>'+836'<div class="listing">• fixed a whole bunch of bugs</div>'+837'<div class="listing">• did a lot of rebalancing</div>'+838'<div class="listing">• reworked heavenly chips and heavenly cookies (still experimenting, will probably rebalance things further)</div>'+839'<div class="listing">• you may now unlock a dragon friend</div>'+840'<div class="listing">• switches and season triggers now have their own store section</div>'+841'<div class="listing">• ctrl-s and ctrl-o now save the game and open the import menu, respectively</div>'+842'<div class="listing">• added some quick sounds, just as a test</div>'+843'<div class="listing">• a couple more options</div>'+844'<div class="listing">• even more miscellaneous changes and additions</div>'+845846'</div><div class="subsection update">'+847'<div class="title">25/08/2014 - legacy beta, part I</div>'+848'<div class="listing">• 3 new buildings</div>'+849'<div class="listing">• price and CpS curves revamped</div>'+850'<div class="listing">• CpS calculations revamped; cookie upgrades now stack multiplicatively</div>'+851'<div class="listing">• prestige system redone from scratch, with a whole new upgrade tree</div>'+852'<div class="listing">• added some <a href="http://en.wikipedia.org/wiki/'+choose(['Krzysztof_Arciszewski','Eustachy_Sanguszko','Maurycy_Hauke','Karol_Turno','Tadeusz_Kutrzeba','Kazimierz_Fabrycy','Florian_Siwicki'])+'" target="_blank">general polish</a></div>'+853'<div class="listing">• tons of other miscellaneous fixes and additions</div>'+854'<div class="listing">• Cookie Clicker is now 1 year old! (Thank you guys for all the support!)</div>'+855'<div class="listing warning">• Note : this is a beta; you are likely to encounter bugs and oversights. Feel free to send me feedback if you find something fishy!</div>'+856857'</div><div class="subsection update small">'+858'<div class="title">18/05/2014 - better late than easter</div>'+859'<div class="listing">• bunnies and eggs, somehow</div>'+860'<div class="listing">• prompts now have keyboard shortcuts like system prompts would</div>'+861'<div class="listing">• naming your bakery? you betcha</div>'+862'<div class="listing">• "Fast notes" option to make all notifications close faster; new button to close all notifications</div>'+863'<div class="listing">• the dungeons beta is now available on <a href="http://orteil.dashnet.org/cookieclicker/betadungeons" target="_blank">/betadungeons</a></div>'+864865'</div><div class="subsection update small">'+866'<div class="title">09/04/2014 - nightmare in heaven</div>'+867'<div class="listing">• broke a thing; heavenly chips were corrupted for some people</div>'+868'<div class="listing">• will probably update to /beta first in the future</div>'+869'<div class="listing">• sorry again</div>'+870871'</div><div class="subsection update small">'+872'<div class="title">09/04/2014 - quality of life</div>'+873'<div class="listing">• new upgrade and achievement tier</div>'+874'<div class="listing">• popups and prompts are much nicer</div>'+875'<div class="listing">• tooltips on buildings are more informative</div>'+876'<div class="listing">• implemented a simplified version of the <a href="https://github.com/Icehawk78/FrozenCookies" target="_blank">Frozen Cookies</a> add-on\'s short number formatting</div>'+877'<div class="listing">• you can now buy 10 and sell all of a building at a time</div>'+878'<div class="listing">• tons of optimizations and subtler changes</div>'+879'<div class="listing">• you can now <a href="http://orteil.dashnet.org/cookies2cash/" target="_blank">convert your cookies to cash</a>!</div>'+880881'</div><div class="subsection update small">'+882'<div class="title">05/04/2014 - pity the fool</div>'+883'<div class="listing">• wrinklers should now be saved so you don\'t have to pop them everytime you refresh the game</div>'+884'<div class="listing">• you now properly win 1 cookie upon reaching 10 billion cookies and making it on the local news</div>'+885'<div class="listing">• miscellaneous fixes and tiny additions</div>'+886'<div class="listing">• added a few very rudimentary mod hooks</div>'+887'<div class="listing">• the game should work again in Opera</div>'+888'<div class="listing">• don\'t forget to check out <a href="http://orteil.dashnet.org/randomgen/" target="_blank">RandomGen</a>, our all-purpose random generator maker!</div>'+889890'</div><div class="subsection update small">'+891'<div class="title">01/04/2014 - fooling around</div>'+892'<div class="listing">• it\'s about time : Cookie Clicker has turned into the much more realistic Cookie Baker</div>'+893'<div class="listing">• season triggers are cheaper and properly unlock again when they run out</div>'+894'<div class="listing">• buildings should properly unlock (reminder : building unlocking is completely cosmetic and does not change the gameplay)</div>'+895896'</div><div class="subsection update small">'+897'<div class="title">14/02/2014 - lovely rainbowcalypse</div>'+898'<div class="listing">• new building (it\'s been a while). More to come!</div>'+899'<div class="listing">• you can now trigger seasonal events to your heart\'s content (upgrade unlocks at 5000 heavenly chips)</div>'+900'<div class="listing">• new ultra-expensive batch of seasonal cookie upgrades you\'ll love to hate</div>'+901'<div class="listing">• new timer bars for golden cookie buffs</div>'+902'<div class="listing">• buildings are now hidden when you start out and appear as they become available</div>'+903'<div class="listing">• technical stuff : the game is now saved through localstorage instead of browser cookies, therefore ruining a perfectly good pun</div>'+904905'</div><div class="subsection update small">'+906'<div class="title">22/12/2013 - merry fixmas</div>'+907'<div class="listing">• some issues with the christmas upgrades have been fixed</div>'+908'<div class="listing">• reindeer cookie drops are now more common</div>'+909'<div class="listing">• reindeers are now reindeer</div>'+910911'</div><div class="subsection update">'+912'<div class="title">20/12/2013 - Christmas is here</div>'+913'<div class="listing">• there is now a festive new evolving upgrade in store</div>'+914'<div class="listing">• reindeer are running amok (catch them if you can!)</div>'+915'<div class="listing">• added a new option to warn you when you close the window, so you don\'t lose your un-popped wrinklers</div>'+916'<div class="listing">• also added a separate option for displaying cursors</div>'+917'<div class="listing">• all the Halloween features are still there (and having the Spooky cookies achievements makes the Halloween cookies drop much more often)</div>'+918'<div class="listing">• oh yeah, we now have <a href="http://www.redbubble.com/people/dashnet" target="_blank">Cookie Clicker shirts, stickers and hoodies</a>! (they\'re really rad)</div>'+919920'</div><div class="subsection update small">'+921'<div class="title">29/10/2013 - spooky update</div>'+922'<div class="listing">• the Grandmapocalypse now spawns wrinklers, hideous elderly creatures that damage your CpS when they reach your big cookie. Thankfully, you can click on them to make them explode (you\'ll even gain back the cookies they\'ve swallowed - with interest!).</div>'+923'<div class="listing">• wrath cookie now 27% spookier</div>'+924'<div class="listing">• some other stuff</div>'+925'<div class="listing">• you should totally go check out <a href="http://candybox2.net/" target="_blank">Candy Box 2</a>, the sequel to the game that inspired Cookie Clicker</div>'+926927'</div><div class="subsection update small">'+928'<div class="title">15/10/2013 - it\'s a secret</div>'+929'<div class="listing">• added a new heavenly upgrade that gives you 5% of your heavenly chips power for 11 cookies (if you purchased the Heavenly key, you might need to buy it again, sorry)</div>'+930'<div class="listing">• golden cookie chains should now work properly</div>'+931932'</div><div class="subsection update small">'+933'<div class="title">15/10/2013 - player-friendly</div>'+934'<div class="listing">• heavenly upgrades are now way, way cheaper</div>'+935'<div class="listing">• tier 5 building upgrades are 5 times cheaper</div>'+936'<div class="listing">• cursors now just plain disappear with Fancy Graphics off, I might add a proper option to toggle only the cursors later</div>'+937'<div class="listing">• warning : the Cookie Monster add-on seems to be buggy with this update, you might want to wait until its programmer updates it</div>'+938939'</div><div class="subsection update small">'+940'<div class="title">15/10/2013 - a couple fixes</div>'+941'<div class="listing">• golden cookies should no longer spawn embarrassingly often</div>'+942'<div class="listing">• cursors now stop moving if Fancy Graphics is turned off</div>'+943944'</div><div class="subsection update small">'+945'<div class="title">14/10/2013 - going for the gold</div>'+946'<div class="listing">• golden cookie chains work a bit differently</div>'+947'<div class="listing">• golden cookie spawns are more random</div>'+948'<div class="listing">• CpS achievements are no longer affected by golden cookie frenzies</div>'+949'<div class="listing">• revised cookie-baking achievement requirements</div>'+950'<div class="listing">• heavenly chips now require upgrades to function at full capacity</div>'+951'<div class="listing">• added 4 more cookie upgrades, unlocked after reaching certain amounts of Heavenly Chips</div>'+952'<div class="listing">• speed baking achievements now require you to have no heavenly upgrades; as such, they have been reset for everyone (along with the Hardcore achievement) to better match their initially intended difficulty</div>'+953'<div class="listing">• made good progress on the mobile port</div>'+954955'</div><div class="subsection update small">'+956'<div class="title">01/10/2013 - smoothing it out</div>'+957'<div class="listing">• some visual effects have been completely rewritten and should now run more smoothly (and be less CPU-intensive)</div>'+958'<div class="listing">• new upgrade tier</div>'+959'<div class="listing">• new milk tier</div>'+960'<div class="listing">• cookie chains have different capping mechanics</div>'+961'<div class="listing">• antimatter condensers are back to their previous price</div>'+962'<div class="listing">• heavenly chips now give +2% CpS again (they will be extensively reworked in the future)</div>'+963'<div class="listing">• farms have been buffed a bit (to popular demand)</div>'+964'<div class="listing">• dungeons still need a bit more work and will be released soon - we want them to be just right! (you can test an unfinished version in <a href="http://orteil.dashnet.org/cookieclicker/betadungeons/" target="_blank">the beta</a>)</div>'+965966'</div><div class="subsection update">'+967'<div class="title">28/09/2013 - dungeon beta</div>'+968'<div class="listing">• from now on, big updates will come through a beta stage first (you can <a href="http://orteil.dashnet.org/cookieclicker/betadungeons/" target="_blank">try it here</a>)</div>'+969'<div class="listing">• first dungeons! (you need 50 factories to unlock them!)</div>'+970'<div class="listing">• cookie chains can be longer</div>'+971'<div class="listing">• antimatter condensers are a bit more expensive</div>'+972'<div class="listing">• heavenly chips now only give +1% cps each (to account for all the cookies made from condensers)</div>'+973'<div class="listing">• added flavor text on all upgrades</div>'+974975'</div><div class="subsection update small">'+976'<div class="title">15/09/2013 - anticookies</div>'+977'<div class="listing">• ran out of regular matter to make your cookies? Try our new antimatter condensers!</div>'+978'<div class="listing">• renamed Hard-reset to "Wipe save" to avoid confusion</div>'+979'<div class="listing">• reset achievements are now regular achievements and require cookies baked all time, not cookies in bank</div>'+980'<div class="listing">• heavenly chips have been nerfed a bit (and are now awarded following a geometric progression : 1 trillion for the first, 2 for the second, etc); the prestige system will be extensively reworked in a future update (after dungeons)</div>'+981'<div class="listing">• golden cookie clicks are no longer reset by soft-resets</div>'+982'<div class="listing">• you can now see how long you\'ve been playing in the stats</div>'+983984'</div><div class="subsection update small">'+985'<div class="title">08/09/2013 - everlasting cookies</div>'+986'<div class="listing">• added a prestige system - resetting gives you permanent CpS boosts (the more cookies made before resetting, the bigger the boost!)</div>'+987'<div class="listing">• save format has been slightly modified to take less space</div>'+988'<div class="listing">• Leprechaun has been bumped to 777 golden cookies clicked and is now shadow; Fortune is the new 77 golden cookies achievement</div>'+989'<div class="listing">• clicking frenzy is now x777</div>'+990991'</div><div class="subsection update small">'+992'<div class="title">04/09/2013 - smarter cookie</div>'+993'<div class="listing">• golden cookies only have 20% chance of giving the same outcome twice in a row now</div>'+994'<div class="listing">• added a golden cookie upgrade</div>'+995'<div class="listing">• added an upgrade that makes pledges last twice as long (requires having pledged 10 times)</div>'+996'<div class="listing">• Quintillion fingers is now twice as efficient</div>'+997'<div class="listing">• Uncanny clicker was really too unpredictable; it is now a regular achievement and no longer requires a world record, just *pretty fast* clicking</div>'+998999'</div><div class="subsection update small">'+1000'<div class="title">02/09/2013 - a better way out</div>'+1001'<div class="listing">• Elder Covenant is even cheaper, and revoking it is cheaper still (also added a new achievement for getting it)</div>'+1002'<div class="listing">• each grandma upgrade now requires 15 of the matching building</div>'+1003'<div class="listing">• the dreaded bottom cursor has been fixed with a new cursor display style</div>'+1004'<div class="listing">• added an option for faster, cheaper graphics</div>'+1005'<div class="listing">• base64 encoding has been redone; this might make saving possible again on some older browsers</div>'+1006'<div class="listing">• shadow achievements now have their own section</div>'+1007'<div class="listing">• raspberry juice is now named raspberry milk, despite raspberry juice being delicious and going unquestionably well with cookies</div>'+1008'<div class="listing">• HOTFIX : cursors now click; fancy graphics button renamed; cookies amount now more visible against cursors</div>'+10091010'</div><div class="subsection update small">'+1011'<div class="title">01/09/2013 - sorting things out</div>'+1012'<div class="listing">• upgrades and achievements are properly sorted in the stats screen</div>'+1013'<div class="listing">• made Elder Covenant much cheaper and less harmful</div>'+1014'<div class="listing">• importing from the first version has been disabled, as promised</div>'+1015'<div class="listing">• "One mind" now actually asks you to confirm the upgrade</div>'+10161017'</div><div class="subsection update small">'+1018'<div class="title">31/08/2013 - hotfixes</div>'+1019'<div class="listing">• added a way to permanently stop the grandmapocalypse</div>'+1020'<div class="listing">• Elder Pledge price is now capped</div>'+1021'<div class="listing">• One Mind and other grandma research upgrades are now a little more powerful, if not 100% accurate</div>'+1022'<div class="listing">• "golden" cookie now appears again during grandmapocalypse; Elder Pledge-related achievements are now unlockable</div>'+10231024'</div><div class="subsection update">'+1025'<div class="title">31/08/2013 - too many grandmas</div>'+1026'<div class="listing">• the grandmapocalypse is back, along with more grandma types</div>'+1027'<div class="listing">• added some upgrades that boost your clicking power and make it scale with your cps</div>'+1028'<div class="listing">• clicking achievements made harder; Neverclick is now a shadow achievement; Uncanny clicker should now truly be a world record</div>'+10291030'</div><div class="subsection update small">'+1031'<div class="title">28/08/2013 - over-achiever</div>'+1032'<div class="listing">• added a few more achievements</div>'+1033'<div class="listing">• reworked the "Bake X cookies" achievements so they take longer to achieve</div>'+10341035'</div><div class="subsection update small">'+1036'<div class="title">27/08/2013 - a bad idea</div>'+1037'<div class="listing">• due to popular demand, retired 5 achievements (the "reset your game" and "cheat" ones); they can still be unlocked, but do not count toward your total anymore. Don\'t worry, there will be many more achievements soon!</div>'+1038'<div class="listing">• made some achievements hidden for added mystery</div>'+10391040'</div><div class="subsection update">'+1041'<div class="title">27/08/2013 - a sense of achievement</div>'+1042'<div class="listing">• added achievements (and milk)</div>'+1043'<div class="listing"><i>(this is a big update, please don\'t get too mad if you lose some data!)</i></div>'+10441045'</div><div class="subsection update small">'+1046'<div class="title">26/08/2013 - new upgrade tier</div>'+1047'<div class="listing">• added some more upgrades (including a couple golden cookie-related ones)</div>'+1048'<div class="listing">• added clicking stats</div>'+10491050'</div><div class="subsection update small">'+1051'<div class="title">26/08/2013 - more tweaks</div>'+1052'<div class="listing">• tweaked a couple cursor upgrades</div>'+1053'<div class="listing">• made time machines less powerful</div>'+1054'<div class="listing">• added offline mode option</div>'+10551056'</div><div class="subsection update small">'+1057'<div class="title">25/08/2013 - tweaks</div>'+1058'<div class="listing">• rebalanced progression curve (mid- and end-game objects cost more and give more)</div>'+1059'<div class="listing">• added some more cookie upgrades</div>'+1060'<div class="listing">• added CpS for cursors</div>'+1061'<div class="listing">• added sell button</div>'+1062'<div class="listing">• made golden cookie more useful</div>'+10631064'</div><div class="subsection update small">'+1065'<div class="title">24/08/2013 - hotfixes</div>'+1066'<div class="listing">• added import/export feature, which also allows you to retrieve a save game from the old version (will be disabled in a week to prevent too much cheating)</div>'+1067'<div class="listing">• upgrade store now has unlimited slots (just hover over it), due to popular demand</div>'+1068'<div class="listing">• added update log</div>'+10691070'</div><div class="subsection update">'+1071'<div class="title">24/08/2013 - big update!</div>'+1072'<div class="listing">• revamped the whole game (new graphics, new game mechanics)</div>'+1073'<div class="listing">• added upgrades</div>'+1074'<div class="listing">• much safer saving</div>'+10751076'</div><div class="subsection update">'+1077'<div class="title">08/08/2013 - game launch</div>'+1078'<div class="listing">• made the game in a couple hours, for laughs</div>'+1079'<div class="listing">• kinda starting to regret it</div>'+1080'<div class="listing">• ah well</div>'+1081'</div>'+1082'</div>'1083;10841085Game.ready=0;10861087Game.Load=function()1088{1089//l('javascriptError').innerHTML='<div style="padding:64px 128px;"><div class="title">Loading...</div></div>';1090Game.Loader=new Loader();1091Game.Loader.domain='img/';1092Game.Loader.loaded=Game.Init;1093Game.Loader.Load(['filler.png']);1094}1095Game.ErrorFrame=function()1096{1097l('javascriptError').innerHTML=1098'<div class="title">Oops. Wrong address!</div>'+1099'<div>It looks like you\'re accessing Cookie Clicker from another URL than the official one.<br>'+1100'You can <a href="http://orteil.dashnet.org/cookieclicker/" target="_blank">play Cookie Clicker over here</a>!<br>'+1101'<small>(If for any reason, you are unable to access the game on the official URL, we are currently working on a second domain.)</small></div>';1102}1103Game.timedout=false;1104Game.Timeout=function()1105{1106Game.WriteSave();1107Game.killShimmers();1108l('javascriptError').innerHTML='Cookie Clicker is in sleep mode'+(Game.Has('Twin Gates of Transcendence')?' and generating offline cookies':'')+'.<br><a '+Game.clickStr+'="Game.Resume();">Click here</a> to resume from your save file.<br><div style="font-style:italic;font-size:65%;line-height:110%;opacity:0.75;">(this happens when too many frames are skipped at once,<br>usually when the game has been running in the background for a while)<br>(you can turn this feature off in the settings menu)</div>';1109l('javascriptError').style.display='block';1110Game.timedout=true;1111console.log('[=== Game timed out and has been put in sleep mode. Data was saved. ===]');1112}1113Game.Resume=function()1114{1115l('javascriptError').innerHTML='';1116l('javascriptError').style.display='none';1117Game.timedout=false;1118Game.time=Date.now();1119Game.accumulatedDelay=0;1120Game.delayTimeouts=0;1121Game.lastActivity=Date.now();1122Game.Loop();1123Game.LoadSave();1124console.log('[=== Game resumed! Data was loaded. ===]');1125}112611271128Game.Init=function()1129{1130Game.ready=1;11311132/*=====================================================================================1133VARIABLES AND PRESETS1134=======================================================================================*/1135Game.T=0;1136Game.drawT=0;1137Game.loopT=0;1138Game.fps=30;11391140Game.season=Game.baseSeason;11411142Game.l=l('game');1143Game.bounds=0;//rectangle defining screen limits (right,left,bottom,top) updated every logic frame11441145if (Game.mobile==1)1146{1147l('wrapper').className='mobile';1148}1149Game.clickStr=Game.touchEvents?'ontouchend':'onclick';11501151Game.SaveTo='CookieClickerGame';1152if (Game.beta) Game.SaveTo='CookieClickerGameBeta';1153l('versionNumber').innerHTML='v. '+Game.version+'<div id="httpsSwitch" style="cursor:pointer;display:inline-block;background:url(img/'+(Game.https?'lockOn':'lockOff')+'.png);width:16px;height:16px;position:relative;top:4px;left:0px;margin:0px -2px;"></div>'+(Game.beta?' <span style="color:#ff0;">beta</span>':'');11541155if (Game.beta) {var me=l('linkVersionBeta');me.parentNode.removeChild(me);}1156else if (Game.version==1.0466) {var me=l('linkVersionOld');me.parentNode.removeChild(me);}1157else {var me=l('linkVersionLive');me.parentNode.removeChild(me);}11581159//l('links').innerHTML=(Game.beta?'<a href="../" target="blank">Live version</a> | ':'<a href="beta" target="blank">Try the beta!</a> | ')+'<a href="http://orteil.dashnet.org/experiments/cookie/" target="blank">Classic</a>';1160//l('links').innerHTML='<a href="http://orteil.dashnet.org/experiments/cookie/" target="blank">Cookie Clicker Classic</a>';11611162Game.lastActivity=Date.now();//reset on mouse move, key press or click11631164//latency compensator stuff1165Game.time=Date.now();1166Game.accumulatedDelay=0;1167Game.delayTimeouts=0;//how many times we've gone over the timeout delay1168Game.catchupLogic=0;1169Game.fpsStartTime=0;1170Game.frameNumber=0;1171Game.currentFps=Game.fps;1172Game.previousFps=Game.currentFps;1173Game.getFps=function()1174{1175Game.frameNumber++;1176var currentTime=(Date.now()-Game.fpsStartTime )/1000;1177var result=Math.floor((Game.frameNumber/currentTime));1178if (currentTime>1)1179{1180Game.fpsStartTime=Date.now();1181Game.frameNumber=0;1182}1183return result;1184}11851186Game.cookiesEarned=0;//all cookies earned during gameplay1187Game.cookies=0;//cookies1188Game.cookiesd=0;//cookies display1189Game.cookiesPs=1;//cookies per second (to recalculate with every new purchase)1190Game.cookiesReset=0;//cookies lost to resetting (used to determine prestige and heavenly chips)1191Game.cookieClicks=0;//+1 for each click on the cookie1192Game.goldenClicks=0;//+1 for each golden cookie clicked (all time)1193Game.goldenClicksLocal=0;//+1 for each golden cookie clicked (this game only)1194Game.missedGoldenClicks=0;//+1 for each golden cookie missed1195Game.handmadeCookies=0;//all the cookies made from clicking the cookie1196Game.milkProgress=0;//you gain a little bit for each achievement. Each increment of 1 is a different milk displayed.1197Game.milkH=Game.milkProgress/2;//milk height, between 0 and 1 (although should never go above 0.5)1198Game.milkHd=0;//milk height display1199Game.milkType=0;//custom milk1200Game.bgType=0;//custom background1201Game.chimeType=0;//golden cookie chime1202Game.prestige=0;//prestige level (recalculated depending on Game.cookiesReset)1203Game.heavenlyChips=0;//heavenly chips the player currently has1204Game.heavenlyChipsDisplayed=0;//ticks up or down to match Game.heavenlyChips1205Game.heavenlyChipsSpent=0;//heavenly chips spent on cookies, upgrades and such1206Game.heavenlyCookies=0;//how many cookies have we baked from chips (unused)1207Game.permanentUpgrades=[-1,-1,-1,-1,-1];1208Game.ascensionMode=0;//type of challenge run if any1209Game.resets=0;//reset counter1210Game.lumps=-1;//sugar lumps1211Game.lumpsTotal=-1;//sugar lumps earned across all playthroughs (-1 means they haven't even started yet)1212Game.lumpT=Date.now();//time when the current lump started forming1213Game.lumpRefill=0;//time when we last used a sugar lump (on minigame refills etc)12141215Game.makeSeed=function()1216{1217var chars='abcdefghijklmnopqrstuvwxyz'.split('');1218var str='';1219for (var i=0;i<5;i++){str+=choose(chars);}1220return str;1221}1222Game.seed=Game.makeSeed();//each run has its own seed, used for deterministic random stuff12231224Game.volume=50;//sound volume12251226Game.elderWrath=0;1227Game.elderWrathOld=0;1228Game.elderWrathD=0;1229Game.pledges=0;1230Game.pledgeT=0;1231Game.researchT=0;1232Game.nextResearch=0;1233Game.cookiesSucked=0;//cookies sucked by wrinklers1234Game.cpsSucked=0;//percent of CpS being sucked by wrinklers1235Game.wrinklersPopped=0;1236Game.santaLevel=0;1237Game.reindeerClicked=0;1238Game.seasonT=0;1239Game.seasonUses=0;1240Game.dragonLevel=0;1241Game.dragonAura=0;1242Game.dragonAura2=0;12431244Game.fortuneGC=0;1245Game.fortuneCPS=0;12461247Game.blendModesOn=(document.createElement('detect').style.mixBlendMode==='');12481249Game.bg='';//background (grandmas and such)1250Game.bgFade='';//fading to background1251Game.bgR=0;//ratio (0 - not faded, 1 - fully faded)1252Game.bgRd=0;//ratio displayed12531254Game.windowW=window.innerWidth;1255Game.windowH=window.innerHeight;12561257window.addEventListener('resize',function(event)1258{1259Game.windowW=window.innerWidth;1260Game.windowH=window.innerHeight;12611262for (var i in Game.Objects)1263{1264var me=Game.Objects[i];1265me.toResize=true;1266if (me.minigame && me.minigame.onResize) me.minigame.onResize();1267}1268});12691270Game.startDate=parseInt(Date.now());//when we started playing1271Game.fullDate=parseInt(Date.now());//when we started playing (carries over with resets)1272Game.lastDate=parseInt(Date.now());//when we last saved the game (used to compute "cookies made since we closed the game" etc)12731274Game.prefs=[];1275Game.DefaultPrefs=function()1276{1277Game.prefs.particles=1;//particle effects : falling cookies etc1278Game.prefs.numbers=1;//numbers that pop up when clicking the cookie1279Game.prefs.autosave=1;//save the game every minute or so1280Game.prefs.autoupdate=1;//send an AJAX request to the server every 30 minutes (note : ignored)1281Game.prefs.milk=1;//display milk1282Game.prefs.fancy=1;//CSS shadow effects (might be heavy on some browsers)1283Game.prefs.warn=0;//warn before closing the window1284Game.prefs.cursors=1;//display cursors1285Game.prefs.focus=1;//make the game refresh less frequently when off-focus1286Game.prefs.popups=0;//use old-style popups1287Game.prefs.format=0;//shorten numbers1288Game.prefs.notifs=0;//notifications fade faster1289Game.prefs.animate=1;//animate buildings1290Game.prefs.wobbly=1;//wobbly cookie1291Game.prefs.monospace=0;//alt monospace font for cookies1292Game.prefs.filters=0;//CSS filter effects (might be heavy on some browsers)1293Game.prefs.cookiesound=1;//use new cookie click sound1294Game.prefs.crates=0;//show crates around icons in stats1295Game.prefs.altDraw=0;//use requestAnimationFrame to update drawing instead of fixed 30 fps setTimeout1296Game.prefs.showBackupWarning=1;//if true, show a "Have you backed up your save?" message on save load; set to false when save is exported1297Game.prefs.extraButtons=1;//if true, show Mute buttons and the building master bar1298Game.prefs.askLumps=0;//if true, show a prompt before spending lumps1299Game.prefs.customGrandmas=1;//if true, show patreon names for grandmas1300Game.prefs.timeout=0;//if true, game may show pause screen when timed out1301}1302Game.DefaultPrefs();13031304window.onbeforeunload=function(event)1305{1306if (Game.prefs && Game.prefs.warn)1307{1308if (typeof event=='undefined') event=window.event;1309if (event) event.returnValue='Are you sure you want to close Cookie Clicker?';1310}1311}13121313Game.Mobile=function()1314{1315if (!Game.mobile)1316{1317l('wrapper').className='mobile';1318Game.mobile=1;1319}1320else1321{1322l('wrapper').className='';1323Game.mobile=0;1324}1325}13261327Game.showBackupWarning=function()1328{1329Game.Notify('Back up your save!','Hello again! Just a reminder that you may want to back up your Cookie Clicker save every once in a while, just in case.<br>To do so, go to Options and hit "Export save" or "Save to file"!<div class="line"></div><a style="float:right;" onclick="Game.prefs.showBackupWarning=0;==CLOSETHIS()==">Don\'t show this again</a>',[25,7]);1330}13311332/*=====================================================================================1333MOD HOOKS (will be subject to change, probably shouldn't be used yet)1334=======================================================================================*/1335//really primitive custom mods support - might not be of any use at all (could theoretically be used for custom upgrades and achievements I guess?)1336Game.customChecks=[];//push functions into this to add them to the "check for upgrade/achievement conditions" that happens every few seconds1337Game.customInit=[];//add to the initialization call1338Game.customLogic=[];//add to the logic calls1339Game.customDraw=[];//add to the draw calls1340Game.customSave=[];//add to the save write calls (save to your own localstorage key)1341Game.customLoad=[];//add to the save load calls1342Game.customReset=[];//add to the reset calls1343Game.customTickers=[];//add to the random tickers (functions should return arrays of text)1344Game.customCps=[];//add to the CpS computation (functions should return something to add to the multiplier ie. 0.1 for an addition of 10 to the CpS multiplier)1345Game.customCpsMult=[];//add to the CpS multiplicative computation (functions should return something to multiply by the multiplier ie. 1.05 for a 5% increase of the multiplier)1346Game.customMouseCps=[];//add to the cookies earned per click computation (functions should return something to add to the multiplier ie. 0.1 for an addition of 10 to the CpS multiplier)1347Game.customMouseCpsMult=[];//add to the cookies earned per click multiplicative computation (functions should return something to multiply by the multiplier ie. 1.05 for a 5% increase of the multiplier)1348Game.customCookieClicks=[];//add to the cookie click calls1349Game.customCreate=[];//create your new upgrades and achievements in there13501351Game.LoadMod=function(url)//this loads the mod at the given URL and gives the script an automatic id (URL "http://example.com/my_mod.js" gives the id "modscript_my_mod")1352{1353var js=document.createElement('script');1354var id=url.split('/');id=id[id.length-1].split('.')[0];1355js.setAttribute('type','text/javascript');1356js.setAttribute('id','modscript_'+id);1357js.setAttribute('src',url);1358document.head.appendChild(js);1359console.log('Loaded the mod '+url+', '+id+'.');1360}13611362//replacing an existing canvas picture with a new one at runtime : Game.Loader.Replace('perfectCookie.png','imperfectCookie.png');1363//upgrades and achievements can use other pictures than icons.png; declare their icon with [posX,posY,'http://example.com/myIcons.png']1364//check out the "UNLOCKING STUFF" section to see how unlocking achievs and upgrades is done (queue yours in Game.customChecks)1365//if you're making a mod, don't forget to add a Game.Win('Third-party') somewhere in there!13661367//IMPORTANT : all of the above is susceptible to heavy change, proper modding API in the works13681369137013711372/*=====================================================================================1373BAKERY NAME1374=======================================================================================*/1375Game.RandomBakeryName=function()1376{1377return (Math.random()>0.05?(choose(['Magic','Fantastic','Fancy','Sassy','Snazzy','Pretty','Cute','Pirate','Ninja','Zombie','Robot','Radical','Urban','Cool','Hella','Sweet','Awful','Double','Triple','Turbo','Techno','Disco','Electro','Dancing','Wonder','Mutant','Space','Science','Medieval','Future','Captain','Bearded','Lovely','Tiny','Big','Fire','Water','Frozen','Metal','Plastic','Solid','Liquid','Moldy','Shiny','Happy','Happy Little','Slimy','Tasty','Delicious','Hungry','Greedy','Lethal','Professor','Doctor','Power','Chocolate','Crumbly','Choklit','Righteous','Glorious','Mnemonic','Psychic','Frenetic','Hectic','Crazy','Royal','El','Von'])+' '):'Mc')+choose(['Cookie','Biscuit','Muffin','Scone','Cupcake','Pancake','Chip','Sprocket','Gizmo','Puppet','Mitten','Sock','Teapot','Mystery','Baker','Cook','Grandma','Click','Clicker','Spaceship','Factory','Portal','Machine','Experiment','Monster','Panic','Burglar','Bandit','Booty','Potato','Pizza','Burger','Sausage','Meatball','Spaghetti','Macaroni','Kitten','Puppy','Giraffe','Zebra','Parrot','Dolphin','Duckling','Sloth','Turtle','Goblin','Pixie','Gnome','Computer','Pirate','Ninja','Zombie','Robot']);1378}1379Game.GetBakeryName=function() {return Game.RandomBakeryName();}1380Game.bakeryName=Game.GetBakeryName();1381Game.bakeryNameL=l('bakeryName');1382Game.bakeryNameL.innerHTML=Game.bakeryName+'\'s bakery';1383Game.bakeryNameSet=function(what)1384{1385Game.bakeryName=what.replace(/\W+/g,' ');1386Game.bakeryName=Game.bakeryName.substring(0,28);1387Game.bakeryNameRefresh();1388}1389Game.bakeryNameRefresh=function()1390{1391var name=Game.bakeryName;1392if (name.slice(-1).toLowerCase()=='s') name+='\' bakery'; else name+='\'s bakery';1393Game.bakeryNameL.innerHTML=name;1394name=Game.bakeryName.toLowerCase();1395if (name=='orteil') Game.Win('God complex');1396if (name.indexOf('saysopensesame',name.length-('saysopensesame').length)>0 && !Game.sesame) Game.OpenSesame();1397Game.recalculateGains=1;1398}1399Game.bakeryNamePrompt=function()1400{1401Game.Prompt('<h3>Name your bakery</h3><div class="block" style="text-align:center;">What should your bakery\'s name be?</div><div class="block"><input type="text" style="text-align:center;width:100%;" id="bakeryNameInput" value="'+Game.bakeryName+'"/></div>',[['Confirm','if (l(\'bakeryNameInput\').value.length>0) {Game.bakeryNameSet(l(\'bakeryNameInput\').value);Game.Win(\'What\\\'s in a name\');Game.ClosePrompt();}'],['Random','Game.bakeryNamePromptRandom();'],'Cancel']);1402l('bakeryNameInput').focus();1403l('bakeryNameInput').select();1404}1405Game.bakeryNamePromptRandom=function()1406{1407l('bakeryNameInput').value=Game.RandomBakeryName();1408}1409AddEvent(Game.bakeryNameL,'click',Game.bakeryNamePrompt);141014111412/*=====================================================================================1413TOOLTIP1414=======================================================================================*/1415Game.tooltip={text:'',x:0,y:0,origin:'',on:0,tt:l('tooltip'),tta:l('tooltipAnchor'),shouldHide:1,dynamic:0,from:0};1416Game.tooltip.draw=function(from,text,origin)1417{1418this.shouldHide=0;1419this.text=text;1420this.from=from;1421//this.x=x;1422//this.y=y;1423this.origin=origin;1424var tt=this.tt;1425var tta=this.tta;1426tt.style.left='auto';1427tt.style.top='auto';1428tt.style.right='auto';1429tt.style.bottom='auto';1430if (typeof this.text==='function')1431{1432var text=this.text();1433if (text=='') tta.style.opacity='0';1434else1435{1436tt.innerHTML=unescape(text);1437tta.style.opacity='1';1438}1439}1440else tt.innerHTML=unescape(this.text);1441//tt.innerHTML=(typeof this.text==='function')?unescape(this.text()):unescape(this.text);1442tta.style.display='block';1443tta.style.visibility='hidden';1444Game.tooltip.update();1445tta.style.visibility='visible';1446this.on=1;1447}1448Game.tooltip.update=function()1449{1450var X=0;1451var Y=0;1452var width=this.tt.offsetWidth;1453var height=this.tt.offsetHeight;1454if (this.origin=='store')1455{1456X=Game.windowW-332-width;1457Y=Game.mouseY-32;1458if (Game.onCrate) Y=Game.onCrate.getBoundingClientRect().top-42;1459Y=Math.max(0,Math.min(Game.windowH-height-44,Y));1460/*this.tta.style.right='308px';//'468px';1461this.tta.style.left='auto';1462if (Game.onCrate) Y=Game.onCrate.getBoundingClientRect().top-2;1463this.tta.style.top=Math.max(0,Math.min(Game.windowH-this.tt.clientHeight-64,Y-48))+'px';*/1464}1465else1466{1467if (Game.onCrate)1468{1469var rect=Game.onCrate.getBoundingClientRect();1470rect={left:rect.left,top:rect.top,right:rect.right,bottom:rect.bottom};1471if (rect.left==0 && rect.top==0)//if we get that bug where we get stuck in the top-left, move to the mouse (REVISION : just do nothing)1472{return false;/*rect.left=Game.mouseX-24;rect.right=Game.mouseX+24;rect.top=Game.mouseY-24;rect.bottom=Game.mouseY+24;*/}1473if (this.origin=='left')1474{1475X=rect.left-width-16;1476Y=rect.top+(rect.bottom-rect.top)/2-height/2-38;1477Y=Math.max(0,Math.min(Game.windowH-height-19,Y));1478if (X<0) X=rect.right;1479}1480else1481{1482X=rect.left+(rect.right-rect.left)/2-width/2-8;1483Y=rect.top-height-48;1484X=Math.max(0,Math.min(Game.windowW-width-16,X));1485if (Y<0) Y=rect.bottom-32;1486}1487}1488else if (this.origin=='bottom-right')1489{1490X=Game.mouseX+8;1491Y=Game.mouseY-32;1492X=Math.max(0,Math.min(Game.windowW-width-16,X));1493Y=Math.max(0,Math.min(Game.windowH-height-64,Y));1494}1495else if (this.origin=='bottom')1496{1497X=Game.mouseX-width/2-8;1498Y=Game.mouseY+24;1499X=Math.max(0,Math.min(Game.windowW-width-16,X));1500Y=Math.max(0,Math.min(Game.windowH-height-64,Y));1501}1502else if (this.origin=='left')1503{1504X=Game.mouseX-width-24;1505Y=Game.mouseY-height/2-8;1506X=Math.max(0,Math.min(Game.windowW-width-16,X));1507Y=Math.max(0,Math.min(Game.windowH-height-64,Y));1508}1509else if (this.origin=='this' && this.from)1510{1511var rect=this.from.getBoundingClientRect();1512X=(rect.left+rect.right)/2-width/2-8;1513Y=(rect.top)-this.tt.clientHeight-48;1514X=Math.max(0,Math.min(Game.windowW-width-16,X));1515//Y=Math.max(0,Math.min(Game.windowH-this.tt.clientHeight-64,Y));1516if (Y<0) Y=(rect.bottom-24);1517if (Y+height+40>Game.windowH)1518{1519X=rect.right+8;1520Y=rect.top+(rect.bottom-rect.top)/2-height/2-38;1521Y=Math.max(0,Math.min(Game.windowH-height-19,Y));1522}1523}1524else1525{1526X=Game.mouseX-width/2-8;1527Y=Game.mouseY-height-32;1528X=Math.max(0,Math.min(Game.windowW-width-16,X));1529Y=Math.max(0,Math.min(Game.windowH-height-64,Y));1530}1531}1532this.tta.style.left=X+'px';1533this.tta.style.right='auto';1534this.tta.style.top=Y+'px';1535this.tta.style.bottom='auto';1536if (this.shouldHide) {this.hide();this.shouldHide=0;}1537else if (Game.drawT%10==0 && typeof(this.text)=='function')1538{1539var text=this.text();1540if (text=='') this.tta.style.opacity='0';1541else1542{1543this.tt.innerHTML=unescape(text);1544this.tta.style.opacity='1';1545}1546}1547}1548Game.tooltip.hide=function()1549{1550this.tta.style.display='none';1551this.dynamic=0;1552this.on=0;1553}1554Game.getTooltip=function(text,origin,isCrate)1555{1556origin=(origin?origin:'middle');1557if (isCrate) return 'onMouseOut="Game.setOnCrate(0);Game.tooltip.shouldHide=1;" onMouseOver="if (!Game.mouseDown) {Game.setOnCrate(this);Game.tooltip.dynamic=0;Game.tooltip.draw(this,\''+escape(text)+'\',\''+origin+'\');Game.tooltip.wobble();}"';1558else return 'onMouseOut="Game.tooltip.shouldHide=1;" onMouseOver="Game.tooltip.dynamic=0;Game.tooltip.draw(this,\''+escape(text)+'\',\''+origin+'\');Game.tooltip.wobble();"';1559}1560Game.getDynamicTooltip=function(func,origin,isCrate)1561{1562origin=(origin?origin:'middle');1563if (isCrate) return 'onMouseOut="Game.setOnCrate(0);Game.tooltip.shouldHide=1;" onMouseOver="if (!Game.mouseDown) {Game.setOnCrate(this);Game.tooltip.dynamic=1;Game.tooltip.draw(this,'+'function(){return '+func+'();}'+',\''+origin+'\');Game.tooltip.wobble();}"';1564return 'onMouseOut="Game.tooltip.shouldHide=1;" onMouseOver="Game.tooltip.dynamic=1;Game.tooltip.draw(this,'+'function(){return '+func+'();}'+',\''+origin+'\');Game.tooltip.wobble();"';1565}1566Game.attachTooltip=function(el,func,origin)1567{1568if (typeof func==='string')1569{1570var str=func;1571func=function(str){return function(){return str;};}(str);1572}1573origin=(origin?origin:'middle');1574AddEvent(el,'mouseover',function(func,el,origin){return function(){Game.tooltip.dynamic=1;Game.tooltip.draw(el,func,origin);};}(func,el,origin));1575AddEvent(el,'mouseout',function(){return function(){Game.tooltip.shouldHide=1;};}());1576}1577Game.tooltip.wobble=function()1578{1579//disabled because this effect doesn't look good with the slight slowdown it might or might not be causing.1580if (false)1581{1582this.tt.className='framed';1583void this.tt.offsetWidth;1584this.tt.className='framed wobbling';1585}1586}158715881589/*=====================================================================================1590UPDATE CHECKER1591=======================================================================================*/1592Game.CheckUpdates=function()1593{1594ajax('server.php?q=checkupdate',Game.CheckUpdatesResponse);1595}1596Game.CheckUpdatesResponse=function(response)1597{1598var r=response.split('|');1599var str='';1600if (r[0]=='alert')1601{1602if (r[1]) str=r[1];1603}1604else if (parseFloat(r[0])>Game.version)1605{1606str='<b>New version available : v. '+r[0]+'!</b>';1607if (r[1]) str+='<br><small>Update note : "'+r[1]+'"</small>';1608str+='<br><b>Refresh to get it!</b>';1609}1610if (str!='')1611{1612l('alert').innerHTML=str;1613l('alert').style.display='block';1614}1615}16161617/*=====================================================================================1618DATA GRABBER1619=======================================================================================*/16201621Game.externalDataLoaded=false;16221623Game.grandmaNames=['Granny','Gusher','Ethel','Edna','Doris','Maud','Hilda','Gladys','Michelle','Michele','Phyllis','Millicent','Muriel','Myrtle','Mildred','Mavis','Helen','Gloria','Sheila','Betty','Gertrude','Agatha','Beryl','Agnes','Pearl','Precious','Ruby','Vera','Bonnie','Ada','Bunny','Cookie','Darling','Gaga','GamGam','Memaw','Mimsy','Peanut','Nana','Nan','Tootsie','Warty','Stinky','Heinous'];1624Game.customGrandmaNames=[];1625Game.heralds=0;16261627Game.GrabData=function()1628{1629ajax('/patreon/grab.php',Game.GrabDataResponse);1630}1631Game.GrabDataResponse=function(response)1632{1633/*1634response should be formatted as1635{"herald":3,"grandma":"a|b|c|...}1636*/1637var r={};1638try{1639r=JSON.parse(response);1640if (typeof r['herald']!=='undefined')1641{1642Game.heralds=parseInt(r['herald']);1643Game.heralds=Math.max(0,Math.min(100,Game.heralds));1644}1645if (typeof r['grandma']!=='undefined' && r['grandma']!='')1646{1647Game.customGrandmaNames=r['grandma'].split('|');1648Game.customGrandmaNames=Game.customGrandmaNames.filter(function(el){return el!='';});1649}16501651l('heraldsAmount').innerHTML=Game.heralds;1652Game.externalDataLoaded=true;1653}catch(e){}1654}1655165616571658Game.attachTooltip(l('httpsSwitch'),'<div style="padding:8px;width:350px;text-align:center;font-size:11px;">You are currently playing Cookie Clicker on the <b>'+(Game.https?'HTTPS':'HTTP')+'</b> protocol.<br>The <b>'+(Game.https?'HTTP':'HTTPS')+'</b> version uses a different save slot than this one.<br>Click this lock to reload the page and switch to the <b>'+(Game.https?'HTTP':'HTTPS')+'</b> version!</div>','this');1659AddEvent(l('httpsSwitch'),'click',function(){1660PlaySound('snd/pop'+Math.floor(Math.random()*3+1)+'.mp3',0.75);1661if (location.protocol=='https:') location.href='http:'+window.location.href.substring(window.location.protocol.length);1662else if (location.protocol=='http:') location.href='https:'+window.location.href.substring(window.location.protocol.length);1663});16641665Game.attachTooltip(l('topbarOrteil'),'<div style="padding:8px;width:250px;text-align:center;">Back to Orteil\'s subdomain!<br>Lots of other games in there!</div>','this');1666Game.attachTooltip(l('topbarDashnet'),'<div style="padding:8px;width:250px;text-align:center;">Back to our homepage!</div>','this');1667Game.attachTooltip(l('topbarTwitter'),'<div style="padding:8px;width:250px;text-align:center;">Orteil\'s twitter, which frequently features game updates.</div>','this');1668Game.attachTooltip(l('topbarTumblr'),'<div style="padding:8px;width:250px;text-align:center;">Orteil\'s tumblr, which frequently features game updates.</div>','this');1669Game.attachTooltip(l('topbarDiscord'),'<div style="padding:8px;width:250px;text-align:center;">Our official discord server.<br>You can share tips and questions about Cookie Clicker and all our other games!</div>','this');1670Game.attachTooltip(l('topbarPatreon'),'<div style="padding:8px;width:250px;text-align:center;">Support us on Patreon and help us keep updating Cookie Clicker!<br>There\'s neat rewards for patrons too!</div>','this');1671Game.attachTooltip(l('topbarMerch'),'<div style="padding:8px;width:250px;text-align:center;">Cookie Clicker shirts, hoodies and stickers!</div>','this');1672Game.attachTooltip(l('topbarMobileCC'),'<div style="padding:8px;width:250px;text-align:center;">Play Cookie Clicker on your phone!<br>(Currently in beta, Android only; iOS version will be released later)</div>','this');1673Game.attachTooltip(l('topbarRandomgen'),'<div style="padding:8px;width:250px;text-align:center;">A thing we made that lets you write random generators.</div>','this');1674Game.attachTooltip(l('topbarIGM'),'<div style="padding:8px;width:250px;text-align:center;">A thing we made that lets you create your own idle games using a simple scripting language.</div>','this');16751676Game.attachTooltip(l('heralds'),function(){1677var str='';16781679if (!Game.externalDataLoaded) str+='Heralds couldn\'t be loaded. There may be an issue with our servers, or you are playing the game locally.';1680else1681{1682if (Game.heralds==0) str+='There are no heralds at the moment. Please consider <b style="color:#bc3aff;">donating to our Patreon</b>!';1683else1684{1685str+=(Game.heralds==1?'<b style="color:#bc3aff;text-shadow:0px 1px 0px #6d0096;">1 herald</b> is':'<b style="color:#fff;text-shadow:0px 1px 0px #6d0096,0px 0px 6px #bc3aff;">'+Game.heralds+' heralds</b> are')+' selflessly inspiring a boost in production for everyone, resulting in<br><b style="color:#cdaa89;text-shadow:0px 1px 0px #7c4532,0px 0px 6px #7c4532;"><div style="width:16px;height:16px;display:inline-block;vertical-align:middle;background:url(img/money.png);"></div> +'+Game.heralds+'% cookies per second</b>.';1686str+='<div class="line"></div>';1687if (Game.ascensionMode==1) str+='You are in a <b>Born again</b> run, and are not currently benefiting from heralds.';1688else if (Game.Has('Heralds')) str+='You own the <b>Heralds</b> upgrade, and therefore benefit from the production boost.';1689else str+='To benefit from the herald bonus, you need a special upgrade you do not yet own. You will permanently unlock it later in the game.';1690}1691}1692str+='<div class="line"></div><span style="font-size:90%;opacity:0.6;"><b>Heralds</b> are people who have donated to our highest Patreon tier, and are limited to 100.<br>Each herald gives everyone +1% CpS.<br>Heralds benefit everyone playing the game, regardless of whether you donated.</span>';16931694str+='<div style="width:31px;height:39px;background:url(img/heraldFlag.png);position:absolute;top:0px;left:8px;"></div><div style="width:31px;height:39px;background:url(img/heraldFlag.png);position:absolute;top:0px;right:8px;"></div>';16951696return '<div style="padding:8px;width:300px;text-align:center;" class="prompt"><h3>Heralds</h3><div class="block">'+str+'</div></div>';1697},'this');1698l('heraldsAmount').innerHTML='?';1699l('heralds').style.display='inline-block';17001701Game.GrabData();170217031704Game.useLocalStorage=1;1705Game.localStorageGet=function(key)1706{1707var local=0;1708try {local=window.localStorage.getItem(key);} catch (exception) {}1709return local;1710}1711Game.localStorageSet=function(key,str)1712{1713var local=0;1714try {local=window.localStorage.setItem(key,str);} catch (exception) {}1715return local;1716}1717//window.localStorage.clear();//won't switch back to cookie-based if there is localStorage info17181719/*=====================================================================================1720SAVE1721=======================================================================================*/1722Game.ExportSave=function()1723{1724Game.prefs.showBackupWarning=0;1725Game.Prompt('<h3>Export save</h3><div class="block">This is your save code.<br>Copy it and keep it somewhere safe!</div><div class="block"><textarea id="textareaPrompt" style="width:100%;height:128px;" readonly>'+Game.WriteSave(1)+'</textarea></div>',['All done!']);//prompt('Copy this text and keep it somewhere safe!',Game.WriteSave(1));1726l('textareaPrompt').focus();l('textareaPrompt').select();1727}1728Game.ImportSave=function()1729{1730Game.Prompt('<h3>Import save</h3><div class="block">Please paste in the code that was given to you on save export.</div><div class="block"><textarea id="textareaPrompt" style="width:100%;height:128px;"></textarea></div>',[['Load','if (l(\'textareaPrompt\').value.length>0) {Game.ImportSaveCode(l(\'textareaPrompt\').value);Game.ClosePrompt();}'],'Nevermind']);//prompt('Please paste in the text that was given to you on save export.','');1731l('textareaPrompt').focus();1732}1733Game.ImportSaveCode=function(save)1734{1735if (save && save!='') Game.LoadSave(save);1736}17371738Game.FileSave=function()1739{1740Game.prefs.showBackupWarning=0;1741var filename=Game.bakeryName.replace(/[^a-zA-Z0-9]+/g,'')+'Bakery';1742var text=Game.WriteSave(1);1743var blob=new Blob([text],{type:'text/plain;charset=utf-8'});1744saveAs(blob,filename+'.txt');1745}1746Game.FileLoad=function(e)1747{1748if (e.target.files.length==0) return false;1749var file=e.target.files[0];1750var reader=new FileReader();1751reader.onload=function(e)1752{1753Game.ImportSaveCode(e.target.result);1754}1755reader.readAsText(file);1756}17571758Game.toSave=false;1759Game.WriteSave=function(type)1760{1761Game.toSave=false;1762//type : none is default, 1=return string only, 2=return uncompressed string, 3=return uncompressed, commented string1763Game.lastDate=parseInt(Game.time);1764var str='';1765if (type==3) str+='\nGame version\n';1766str+=Game.version+'|';1767str+='|';//just in case we need some more stuff here1768if (type==3) str+='\n\nRun details';1769str+=//save stats1770(type==3?'\n run start date : ':'')+parseInt(Game.startDate)+';'+1771(type==3?'\n legacy start date : ':'')+parseInt(Game.fullDate)+';'+1772(type==3?'\n date when we last opened the game : ':'')+parseInt(Game.lastDate)+';'+1773(type==3?'\n bakery name : ':'')+(Game.bakeryName)+';'+1774(type==3?'\n seed : ':'')+(Game.seed)+1775'|';1776if (type==3) str+='\n\nPacked preferences bitfield\n ';1777var str2=//prefs1778(Game.prefs.particles?'1':'0')+1779(Game.prefs.numbers?'1':'0')+1780(Game.prefs.autosave?'1':'0')+1781(Game.prefs.autoupdate?'1':'0')+1782(Game.prefs.milk?'1':'0')+1783(Game.prefs.fancy?'1':'0')+1784(Game.prefs.warn?'1':'0')+1785(Game.prefs.cursors?'1':'0')+1786(Game.prefs.focus?'1':'0')+1787(Game.prefs.format?'1':'0')+1788(Game.prefs.notifs?'1':'0')+1789(Game.prefs.wobbly?'1':'0')+1790(Game.prefs.monospace?'1':'0')+1791(Game.prefs.filters?'1':'0')+1792(Game.prefs.cookiesound?'1':'0')+1793(Game.prefs.crates?'1':'0')+1794(Game.prefs.showBackupWarning?'1':'0')+1795(Game.prefs.extraButtons?'1':'0')+1796(Game.prefs.askLumps?'1':'0')+1797(Game.prefs.customGrandmas?'1':'0')+1798(Game.prefs.timeout?'1':'0')+1799'';1800str2=pack3(str2);1801str+=str2+'|';1802if (type==3) str+='\n\nMisc game data';1803str+=1804(type==3?'\n cookies : ':'')+parseFloat(Game.cookies).toString()+';'+1805(type==3?'\n total cookies earned : ':'')+parseFloat(Game.cookiesEarned).toString()+';'+1806(type==3?'\n cookie clicks : ':'')+parseInt(Math.floor(Game.cookieClicks))+';'+1807(type==3?'\n golden cookie clicks : ':'')+parseInt(Math.floor(Game.goldenClicks))+';'+1808(type==3?'\n cookies made by clicking : ':'')+parseFloat(Game.handmadeCookies).toString()+';'+1809(type==3?'\n golden cookies missed : ':'')+parseInt(Math.floor(Game.missedGoldenClicks))+';'+1810(type==3?'\n background type : ':'')+parseInt(Math.floor(Game.bgType))+';'+1811(type==3?'\n milk type : ':'')+parseInt(Math.floor(Game.milkType))+';'+1812(type==3?'\n cookies from past runs : ':'')+parseFloat(Game.cookiesReset).toString()+';'+1813(type==3?'\n elder wrath : ':'')+parseInt(Math.floor(Game.elderWrath))+';'+1814(type==3?'\n pledges : ':'')+parseInt(Math.floor(Game.pledges))+';'+1815(type==3?'\n pledge time left : ':'')+parseInt(Math.floor(Game.pledgeT))+';'+1816(type==3?'\n currently researching : ':'')+parseInt(Math.floor(Game.nextResearch))+';'+1817(type==3?'\n research time left : ':'')+parseInt(Math.floor(Game.researchT))+';'+1818(type==3?'\n ascensions : ':'')+parseInt(Math.floor(Game.resets))+';'+1819(type==3?'\n golden cookie clicks (this run) : ':'')+parseInt(Math.floor(Game.goldenClicksLocal))+';'+1820(type==3?'\n cookies sucked by wrinklers : ':'')+parseFloat(Game.cookiesSucked).toString()+';'+1821(type==3?'\n wrinkles popped : ':'')+parseInt(Math.floor(Game.wrinklersPopped))+';'+1822(type==3?'\n santa level : ':'')+parseInt(Math.floor(Game.santaLevel))+';'+1823(type==3?'\n reindeer clicked : ':'')+parseInt(Math.floor(Game.reindeerClicked))+';'+1824(type==3?'\n season time left : ':'')+parseInt(Math.floor(Game.seasonT))+';'+1825(type==3?'\n season switcher uses : ':'')+parseInt(Math.floor(Game.seasonUses))+';'+1826(type==3?'\n current season : ':'')+(Game.season?Game.season:'')+';';1827var wrinklers=Game.SaveWrinklers();1828str+=1829(type==3?'\n amount of cookies contained in wrinklers : ':'')+parseFloat(Math.floor(wrinklers.amount))+';'+1830(type==3?'\n number of wrinklers : ':'')+parseInt(Math.floor(wrinklers.number))+';'+1831(type==3?'\n prestige level : ':'')+parseFloat(Game.prestige).toString()+';'+1832(type==3?'\n heavenly chips : ':'')+parseFloat(Game.heavenlyChips).toString()+';'+1833(type==3?'\n heavenly chips spent : ':'')+parseFloat(Game.heavenlyChipsSpent).toString()+';'+1834(type==3?'\n heavenly cookies : ':'')+parseFloat(Game.heavenlyCookies).toString()+';'+1835(type==3?'\n ascension mode : ':'')+parseInt(Math.floor(Game.ascensionMode))+';'+1836(type==3?'\n permanent upgrades : ':'')+parseInt(Math.floor(Game.permanentUpgrades[0]))+';'+parseInt(Math.floor(Game.permanentUpgrades[1]))+';'+parseInt(Math.floor(Game.permanentUpgrades[2]))+';'+parseInt(Math.floor(Game.permanentUpgrades[3]))+';'+parseInt(Math.floor(Game.permanentUpgrades[4]))+';'+1837(type==3?'\n dragon level : ':'')+parseInt(Math.floor(Game.dragonLevel))+';'+1838(type==3?'\n dragon aura : ':'')+parseInt(Math.floor(Game.dragonAura))+';'+1839(type==3?'\n dragon aura 2 : ':'')+parseInt(Math.floor(Game.dragonAura2))+';'+1840(type==3?'\n chime type : ':'')+parseInt(Math.floor(Game.chimeType))+';'+1841(type==3?'\n volume : ':'')+parseInt(Math.floor(Game.volume))+';'+1842(type==3?'\n number of shiny wrinklers : ':'')+parseInt(Math.floor(wrinklers.shinies))+';'+1843(type==3?'\n amount of cookies contained in shiny wrinklers : ':'')+parseFloat(Math.floor(wrinklers.amountShinies))+';'+1844(type==3?'\n current amount of sugar lumps : ':'')+parseFloat(Math.floor(Game.lumps))+';'+1845(type==3?'\n total amount of sugar lumps made : ':'')+parseFloat(Math.floor(Game.lumpsTotal))+';'+1846(type==3?'\n time when current sugar lump started : ':'')+parseFloat(Math.floor(Game.lumpT))+';'+1847(type==3?'\n time when last refilled a minigame with a sugar lump : ':'')+parseFloat(Math.floor(Game.lumpRefill))+';'+1848(type==3?'\n sugar lump type : ':'')+parseInt(Math.floor(Game.lumpCurrentType))+';'+1849(type==3?'\n vault : ':'')+Game.vault.join(',')+';'+1850(type==3?'\n heralds : ':'')+parseInt(Game.heralds)+';'+1851(type==3?'\n golden cookie fortune : ':'')+parseInt(Game.fortuneGC)+';'+1852(type==3?'\n CpS fortune : ':'')+parseInt(Game.fortuneCPS)+';'+1853'|';//cookies and lots of other stuff18541855if (type==3) str+='\n\nBuildings : amount, bought, cookies produced, level, minigame data';1856for (var i in Game.Objects)//buildings1857{1858var me=Game.Objects[i];1859if (type==3) str+='\n '+me.name+' : ';1860if (me.vanilla)1861{1862str+=me.amount+','+me.bought+','+parseFloat(Math.floor(me.totalCookies))+','+parseInt(me.level);1863if (Game.isMinigameReady(me)) str+=','+me.minigame.save(); else str+=',';1864str+=','+(me.muted?'1':'0');1865str+=';';1866}1867}1868str+='|';1869if (type==3) str+='\n\nPacked upgrades bitfield (unlocked and bought)\n ';1870var toCompress=[];1871for (var i in Game.UpgradesById)//upgrades1872{1873var me=Game.UpgradesById[i];1874if (me.vanilla) toCompress.push(Math.min(me.unlocked,1),Math.min(me.bought,1));1875};18761877toCompress=pack3(toCompress.join(''));//toCompress=pack(toCompress);//CompressLargeBin(toCompress);18781879str+=toCompress;1880str+='|';1881if (type==3) str+='\n\nPacked achievements bitfield (won)\n ';1882var toCompress=[];1883for (var i in Game.AchievementsById)//achievements1884{1885var me=Game.AchievementsById[i];1886if (me.vanilla) toCompress.push(Math.min(me.won));1887}1888toCompress=pack3(toCompress.join(''));//toCompress=pack(toCompress);//CompressLargeBin(toCompress);1889str+=toCompress;18901891str+='|';1892if (type==3) str+='\n\nBuffs : type, maxTime, time, arg1, arg2, arg3';1893for (var i in Game.buffs)1894{1895var me=Game.buffs[i];1896if (me.type)1897{1898if (type==3) str+='\n '+me.type.name+' : ';1899if (me.type.vanilla)1900{1901str+=me.type.id+','+me.maxTime+','+me.time;1902if (typeof me.arg1!=='undefined') str+=','+parseFloat(me.arg1);1903if (typeof me.arg2!=='undefined') str+=','+parseFloat(me.arg2);1904if (typeof me.arg3!=='undefined') str+=','+parseFloat(me.arg3);1905str+=';';1906}1907}1908}190919101911if (type==3) str+='\n';19121913for (var i in Game.customSave) {Game.customSave[i]();}19141915if (type==2 || type==3)1916{1917return str;1918}1919else if (type==1)1920{1921str=escape(utf8_to_b64(str)+'!END!');1922return str;1923}1924else1925{1926if (Game.useLocalStorage)1927{1928//so we used to save the game using browser cookies, which was just really neat considering the game's name1929//we're using localstorage now, which is more efficient but not as cool1930//a moment of silence for our fallen puns1931str=utf8_to_b64(str)+'!END!';1932if (str.length<10)1933{1934if (Game.prefs.popups) Game.Popup('Error while saving.<br>Purchasing an upgrade might fix this.');1935else Game.Notify('Saving failed!','Purchasing an upgrade and saving again might fix this.<br>This really shouldn\'t happen; please notify Orteil on his tumblr.');1936}1937else1938{1939str=escape(str);1940Game.localStorageSet(Game.SaveTo,str);//aaand save1941if (!Game.localStorageGet(Game.SaveTo))1942{1943if (Game.prefs.popups) Game.Popup('Error while saving.<br>Export your save instead!');1944else Game.Notify('Error while saving','Export your save instead!');1945}1946else if (document.hasFocus())1947{1948if (Game.prefs.popups) Game.Popup('Game saved');1949else Game.Notify('Game saved','','',1,1);1950}1951}1952}1953else//legacy system1954{1955//that's right1956//we're using cookies1957//yeah I went there1958var now=new Date();//we storin dis for 5 years, people1959now.setFullYear(now.getFullYear()+5);//mmh stale cookies1960str=utf8_to_b64(str)+'!END!';1961Game.saveData=escape(str);1962str=Game.SaveTo+'='+escape(str)+'; expires='+now.toUTCString()+';';1963document.cookie=str;//aaand save1964if (document.cookie.indexOf(Game.SaveTo)<0)1965{1966if (Game.prefs.popups) Game.Popup('Error while saving.<br>Export your save instead!');1967else Game.Notify('Error while saving','Export your save instead!','',0,1);1968}1969else if (document.hasFocus())1970{1971if (Game.prefs.popups) Game.Popup('Game saved');1972else Game.Notify('Game saved','','',1,1);1973}1974}1975}1976}19771978/*=====================================================================================1979LOAD1980=======================================================================================*/1981Game.salvageSave=function()1982{1983//for when Cookie Clicker won't load and you need your save1984console.log('===================================================');1985console.log('This is your save data. Copypaste it (without quotation marks) into another version using the "Import save" feature.');1986console.log(Game.localStorageGet(Game.SaveTo));1987}1988Game.LoadSave=function(data)1989{1990var str='';1991if (data) str=unescape(data);1992else1993{1994if (Game.useLocalStorage)1995{1996var local=Game.localStorageGet(Game.SaveTo);1997if (!local)//no localstorage save found? let's get the cookie one last time1998{1999if (document.cookie.indexOf(Game.SaveTo)>=0)2000{2001str=unescape(document.cookie.split(Game.SaveTo+'=')[1]);2002document.cookie=Game.SaveTo+'=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';2003}2004else return false;2005}2006else2007{2008str=unescape(local);2009}2010}2011else//legacy system2012{2013if (document.cookie.indexOf(Game.SaveTo)>=0) str=unescape(document.cookie.split(Game.SaveTo+'=')[1]);//get cookie here2014else return false;2015}2016}2017if (str!='')2018{2019var version=0;2020var oldstr=str.split('|');2021if (oldstr[0]<1) {}2022else2023{2024str=str.split('!END!')[0];2025str=b64_to_utf8(str);2026}2027if (str!='')2028{2029var spl='';2030str=str.split('|');2031version=parseFloat(str[0]);20322033if (isNaN(version) || str.length<5)2034{2035if (Game.prefs.popups) Game.Popup('Oops, looks like the import string is all wrong!');2036else Game.Notify('Error importing save','Oops, looks like the import string is all wrong!','',6,1);2037return false;2038}2039if (version>=1 && version>Game.version)2040{2041if (Game.prefs.popups) Game.Popup('Error : you are attempting to load a save from a future version (v. '+version+'; you are using v. '+Game.version+').');2042else Game.Notify('Error importing save','You are attempting to load a save from a future version (v. '+version+'; you are using v. '+Game.version+').','',6,1);2043return false;2044}2045if (version==1.0501)//prompt if we loaded from the 2014 beta2046{2047setTimeout(function(){Game.Prompt('<h3>New beta</h3><div class="block">Hey there! Unfortunately, your old beta save won\'t work here anymore; you\'ll have to start fresh or import your save from the live version.<div class="line"></div>Thank you for beta-testing Cookie Clicker, we hope you\'ll enjoy it and find strange and interesting bugs!</div>',[['Alright then!','Game.ClosePrompt();']]);},200);2048return false;2049}2050else if (version<1.0501)//prompt if we loaded from the 2014 live version2051{2052setTimeout(function(){Game.Prompt('<h3>Update</h3><div class="block"><b>Hey there!</b> Cookie Clicker just received a pretty substantial update, and you might notice that some things have been moved around. Don\'t panic!<div class="line"></div>Your building numbers may look strange, making it seem like you own buildings you\'ve never bought; this is because we\'ve added <b>3 new buildings</b> after factories (and swapped mines and factories), offsetting everything after them. Likewise, some building-related upgrades and achievements may look a tad shuffled around. This is all perfectly normal!<div class="line"></div>We\'ve also rebalanced Heavenly Chips amounts and behavior. Your amount of chips might be lower or higher than before.<br>You can now ascend through the <b>Legacy button</b> at the top!<div class="line"></div>Thank you for playing Cookie Clicker. We\'ve put a lot of work and care into this update and we hope you\'ll enjoy it!</div>',[['Neat!','Game.ClosePrompt();']]);},200);2053}2054if (version>=1)2055{2056Game.T=0;20572058spl=str[2].split(';');//save stats2059Game.startDate=parseInt(spl[0]);2060Game.fullDate=parseInt(spl[1]);2061Game.lastDate=parseInt(spl[2]);2062Game.bakeryName=spl[3]?spl[3]:Game.GetBakeryName();2063Game.seed=spl[4]?spl[4]:Game.makeSeed();2064//prefs2065if (version<1.0503) spl=str[3].split('');2066else if (version<2.0046) spl=unpack2(str[3]).split('');2067else spl=(str[3]).split('');2068Game.prefs.particles=parseInt(spl[0]);2069Game.prefs.numbers=parseInt(spl[1]);2070Game.prefs.autosave=parseInt(spl[2]);2071Game.prefs.autoupdate=spl[3]?parseInt(spl[3]):1;2072Game.prefs.milk=spl[4]?parseInt(spl[4]):1;2073Game.prefs.fancy=parseInt(spl[5]);if (Game.prefs.fancy) Game.removeClass('noFancy'); else if (!Game.prefs.fancy) Game.addClass('noFancy');2074Game.prefs.warn=spl[6]?parseInt(spl[6]):0;2075Game.prefs.cursors=spl[7]?parseInt(spl[7]):0;2076Game.prefs.focus=spl[8]?parseInt(spl[8]):0;2077Game.prefs.format=spl[9]?parseInt(spl[9]):0;2078Game.prefs.notifs=spl[10]?parseInt(spl[10]):0;2079Game.prefs.wobbly=spl[11]?parseInt(spl[11]):0;2080Game.prefs.monospace=spl[12]?parseInt(spl[12]):0;2081Game.prefs.filters=parseInt(spl[13]);if (Game.prefs.filters) Game.removeClass('noFilters'); else if (!Game.prefs.filters) Game.addClass('noFilters');2082Game.prefs.cookiesound=spl[14]?parseInt(spl[14]):1;2083Game.prefs.crates=spl[15]?parseInt(spl[15]):0;2084Game.prefs.showBackupWarning=spl[16]?parseInt(spl[16]):1;2085Game.prefs.extraButtons=spl[17]?parseInt(spl[17]):1;if (!Game.prefs.extraButtons) Game.removeClass('extraButtons'); else if (Game.prefs.extraButtons) Game.addClass('extraButtons');2086Game.prefs.askLumps=spl[18]?parseInt(spl[18]):0;2087Game.prefs.customGrandmas=spl[19]?parseInt(spl[19]):1;2088Game.prefs.timeout=spl[20]?parseInt(spl[20]):0;2089BeautifyAll();2090spl=str[4].split(';');//cookies and lots of other stuff2091Game.cookies=parseFloat(spl[0]);2092Game.cookiesEarned=parseFloat(spl[1]);2093Game.cookieClicks=spl[2]?parseInt(spl[2]):0;2094Game.goldenClicks=spl[3]?parseInt(spl[3]):0;2095Game.handmadeCookies=spl[4]?parseFloat(spl[4]):0;2096Game.missedGoldenClicks=spl[5]?parseInt(spl[5]):0;2097Game.bgType=spl[6]?parseInt(spl[6]):0;2098Game.milkType=spl[7]?parseInt(spl[7]):0;2099Game.cookiesReset=spl[8]?parseFloat(spl[8]):0;2100Game.elderWrath=spl[9]?parseInt(spl[9]):0;2101Game.pledges=spl[10]?parseInt(spl[10]):0;2102Game.pledgeT=spl[11]?parseInt(spl[11]):0;2103Game.nextResearch=spl[12]?parseInt(spl[12]):0;2104Game.researchT=spl[13]?parseInt(spl[13]):0;2105Game.resets=spl[14]?parseInt(spl[14]):0;2106Game.goldenClicksLocal=spl[15]?parseInt(spl[15]):0;2107Game.cookiesSucked=spl[16]?parseFloat(spl[16]):0;2108Game.wrinklersPopped=spl[17]?parseInt(spl[17]):0;2109Game.santaLevel=spl[18]?parseInt(spl[18]):0;2110Game.reindeerClicked=spl[19]?parseInt(spl[19]):0;2111Game.seasonT=spl[20]?parseInt(spl[20]):0;2112Game.seasonUses=spl[21]?parseInt(spl[21]):0;2113Game.season=spl[22]?spl[22]:Game.baseSeason;2114var wrinklers={amount:spl[23]?parseFloat(spl[23]):0,number:spl[24]?parseInt(spl[24]):0};2115Game.prestige=spl[25]?parseFloat(spl[25]):0;2116Game.heavenlyChips=spl[26]?parseFloat(spl[26]):0;2117Game.heavenlyChipsSpent=spl[27]?parseFloat(spl[27]):0;2118Game.heavenlyCookies=spl[28]?parseFloat(spl[28]):0;2119Game.ascensionMode=spl[29]?parseInt(spl[29]):0;2120Game.permanentUpgrades[0]=spl[30]?parseInt(spl[30]):-1;Game.permanentUpgrades[1]=spl[31]?parseInt(spl[31]):-1;Game.permanentUpgrades[2]=spl[32]?parseInt(spl[32]):-1;Game.permanentUpgrades[3]=spl[33]?parseInt(spl[33]):-1;Game.permanentUpgrades[4]=spl[34]?parseInt(spl[34]):-1;2121//if (version<1.05) {Game.heavenlyChipsEarned=Game.HowMuchPrestige(Game.cookiesReset);Game.heavenlyChips=Game.heavenlyChipsEarned;}2122Game.dragonLevel=spl[35]?parseInt(spl[35]):0;2123if (version<2.0041 && Game.dragonLevel==Game.dragonLevels.length-2) {Game.dragonLevel=Game.dragonLevels.length-1;}2124Game.dragonAura=spl[36]?parseInt(spl[36]):0;2125Game.dragonAura2=spl[37]?parseInt(spl[37]):0;2126Game.chimeType=spl[38]?parseInt(spl[38]):0;2127Game.volume=spl[39]?parseInt(spl[39]):50;2128wrinklers.shinies=spl[40]?parseInt(spl[40]):0;2129wrinklers.amountShinies=spl[41]?parseFloat(spl[41]):0;2130Game.lumps=spl[42]?parseFloat(spl[42]):-1;2131Game.lumpsTotal=spl[43]?parseFloat(spl[43]):-1;2132Game.lumpT=spl[44]?parseInt(spl[44]):Date.now();2133Game.lumpRefill=spl[45]?parseInt(spl[45]):0;2134Game.lumpCurrentType=spl[46]?parseInt(spl[46]):0;2135Game.vault=spl[47]?spl[47].split(','):[];2136for (var i in Game.vault){Game.vault[i]=parseInt(Game.vault[i]);}2137var actualHeralds=Game.heralds;//we store the actual amount of heralds to restore it later; here we used the amount present in the save to compute offline CpS2138Game.heralds=spl[48]?parseInt(spl[48]):Game.heralds;2139Game.fortuneGC=spl[49]?parseInt(spl[49]):0;2140Game.fortuneCPS=spl[50]?parseInt(spl[50]):0;21412142spl=str[5].split(';');//buildings2143Game.BuildingsOwned=0;2144for (var i in Game.ObjectsById)2145{2146var me=Game.ObjectsById[i];2147me.switchMinigame(false);2148me.pics=[];2149if (spl[i])2150{2151var mestr=spl[i].toString().split(',');2152me.amount=parseInt(mestr[0]);me.bought=parseInt(mestr[1]);me.totalCookies=parseFloat(mestr[2]);me.level=parseInt(mestr[3]||0);2153if (me.minigame && me.minigameLoaded && me.minigame.reset) {me.minigame.reset(true);me.minigame.load(mestr[4]||'');} else me.minigameSave=(mestr[4]||0);2154me.muted=parseInt(mestr[5])||0;2155Game.BuildingsOwned+=me.amount;2156if (version<2.003) me.level=0;2157}2158else2159{2160me.amount=0;me.unlocked=0;me.bought=0;me.totalCookies=0;me.level=0;2161}2162}21632164Game.LoadMinigames();21652166if (version<1.035)//old non-binary algorithm2167{2168spl=str[6].split(';');//upgrades2169Game.UpgradesOwned=0;2170for (var i in Game.UpgradesById)2171{2172var me=Game.UpgradesById[i];2173if (spl[i])2174{2175var mestr=spl[i].split(',');2176me.unlocked=parseInt(mestr[0]);me.bought=parseInt(mestr[1]);2177if (me.bought && Game.CountsAsUpgradeOwned(me.pool)) Game.UpgradesOwned++;2178}2179else2180{2181me.unlocked=0;me.bought=0;2182}2183}2184if (str[7]) spl=str[7].split(';'); else spl=[];//achievements2185Game.AchievementsOwned=0;2186for (var i in Game.AchievementsById)2187{2188var me=Game.AchievementsById[i];2189if (spl[i])2190{2191var mestr=spl[i].split(',');2192me.won=parseInt(mestr[0]);2193}2194else2195{2196me.won=0;2197}2198if (me.won && Game.CountsAsAchievementOwned(me.pool)) Game.AchievementsOwned++;2199}2200}2201else if (version<1.0502)//old awful packing system2202{2203if (str[6]) spl=str[6]; else spl=[];//upgrades2204if (version<1.05) spl=UncompressLargeBin(spl);2205else spl=unpack(spl);2206Game.UpgradesOwned=0;2207for (var i in Game.UpgradesById)2208{2209var me=Game.UpgradesById[i];2210if (spl[i*2])2211{2212var mestr=[spl[i*2],spl[i*2+1]];2213me.unlocked=parseInt(mestr[0]);me.bought=parseInt(mestr[1]);2214if (me.bought && Game.CountsAsUpgradeOwned(me.pool)) Game.UpgradesOwned++;2215}2216else2217{2218me.unlocked=0;me.bought=0;2219}2220}2221if (str[7]) spl=str[7]; else spl=[];//achievements2222if (version<1.05) spl=UncompressLargeBin(spl);2223else spl=unpack(spl);2224Game.AchievementsOwned=0;2225for (var i in Game.AchievementsById)2226{2227var me=Game.AchievementsById[i];2228if (spl[i])2229{2230var mestr=[spl[i]];2231me.won=parseInt(mestr[0]);2232}2233else2234{2235me.won=0;2236}2237if (me.won && Game.CountsAsAchievementOwned(me.pool)) Game.AchievementsOwned++;2238}2239}2240else2241{2242if (str[6]) spl=str[6]; else spl=[];//upgrades2243if (version<2.0046) spl=unpack2(spl).split('');2244else spl=(spl).split('');2245Game.UpgradesOwned=0;2246for (var i in Game.UpgradesById)2247{2248var me=Game.UpgradesById[i];2249if (spl[i*2])2250{2251var mestr=[spl[i*2],spl[i*2+1]];2252me.unlocked=parseInt(mestr[0]);me.bought=parseInt(mestr[1]);2253if (me.bought && Game.CountsAsUpgradeOwned(me.pool)) Game.UpgradesOwned++;2254}2255else2256{2257me.unlocked=0;me.bought=0;2258}2259}2260if (str[7]) spl=str[7]; else spl=[];//achievements2261if (version<2.0046) spl=unpack2(spl).split('');2262else spl=(spl).split('');2263Game.AchievementsOwned=0;2264for (var i in Game.AchievementsById)2265{2266var me=Game.AchievementsById[i];2267if (spl[i])2268{2269var mestr=[spl[i]];2270me.won=parseInt(mestr[0]);2271}2272else2273{2274me.won=0;2275}2276if (me.won && Game.CountsAsAchievementOwned(me.pool)) Game.AchievementsOwned++;2277}2278}22792280Game.killBuffs();2281var buffsToLoad=[];2282spl=(str[8]||'').split(';');//buffs2283for (var i in spl)2284{2285if (spl[i])2286{2287var mestr=spl[i].toString().split(',');2288buffsToLoad.push(mestr);2289}2290}229122922293for (var i in Game.ObjectsById)2294{2295var me=Game.ObjectsById[i];2296if (me.buyFunction) me.buyFunction();2297me.refresh();2298if (me.id>0)2299{2300if (me.muted) me.mute(1);2301}2302}23032304if (version<1.0503)//upgrades that used to be regular, but are now heavenly2305{2306var me=Game.Upgrades['Persistent memory'];me.unlocked=0;me.bought=0;2307var me=Game.Upgrades['Season switcher'];me.unlocked=0;me.bought=0;2308}23092310if (Game.bgType==-1) Game.bgType=0;2311if (Game.milkType==-1) Game.milkType=0;231223132314//advance timers2315var framesElapsed=Math.ceil(((Date.now()-Game.lastDate)/1000)*Game.fps);2316if (Game.pledgeT>0) Game.pledgeT=Math.max(Game.pledgeT-framesElapsed,1);2317if (Game.seasonT>0) Game.seasonT=Math.max(Game.seasonT-framesElapsed,1);2318if (Game.researchT>0) Game.researchT=Math.max(Game.researchT-framesElapsed,1);231923202321Game.ResetWrinklers();2322Game.LoadWrinklers(wrinklers.amount,wrinklers.number,wrinklers.shinies,wrinklers.amountShinies);23232324//recompute season trigger prices2325if (Game.Has('Season switcher')) {for (var i in Game.seasons) {Game.Unlock(Game.seasons[i].trigger);}}2326Game.computeSeasonPrices();23272328//recompute prestige2329Game.prestige=Math.floor(Game.HowMuchPrestige(Game.cookiesReset));2330//if ((Game.heavenlyChips+Game.heavenlyChipsSpent)<Game.prestige)2331//{Game.heavenlyChips=Game.prestige;Game.heavenlyChipsSpent=0;}//chips owned and spent don't add up to total prestige? set chips owned to prestige23322333233423352336if (version==1.037 && Game.beta)//are we opening the new beta? if so, save the old beta to /betadungeons2337{2338window.localStorage.setItem('CookieClickerGameBetaDungeons',window.localStorage.getItem('CookieClickerGameBeta'));2339Game.Notify('Beta save data','Your beta save data has been safely exported to /betadungeons.',20);2340}2341else if (version==1.0501 && Game.beta)//are we opening the newer beta? if so, save the old beta to /oldbeta2342{2343window.localStorage.setItem('CookieClickerGameOld',window.localStorage.getItem('CookieClickerGameBeta'));2344//Game.Notify('Beta save data','Your beta save data has been safely exported to /oldbeta.',20);2345}2346if (version<=1.0466 && !Game.beta)//export the old 2014 version to /v104662347{2348window.localStorage.setItem('CookieClickerGamev10466',window.localStorage.getItem('CookieClickerGame'));2349//Game.Notify('Beta save data','Your save data has been safely exported to /v10466.',20);2350}2351if (version==1.9)//are we importing from the 1.9 beta? remove all heavenly upgrades and refund heavenly chips2352{2353for (var i in Game.UpgradesById)2354{2355var me=Game.UpgradesById[i];2356if (me.bought && me.pool=='prestige')2357{2358me.unlocked=0;2359me.bought=0;2360}2361}2362Game.heavenlyChips=Game.prestige;2363Game.heavenlyChipsSpent=0;23642365setTimeout(function(){Game.Prompt('<h3>Beta patch</h3><div class="block">We\'ve tweaked some things and fixed some others, please check the update notes!<div class="line"></div>Of note : due to changes in prestige balancing, all your heavenly upgrades have been removed and your heavenly chips refunded; you\'ll be able to reallocate them next time you ascend.<div class="line"></div>Thank you again for beta-testing Cookie Clicker!</div>',[['Alright then!','Game.ClosePrompt();']]);},200);2366}2367if (version<=1.0466)//are we loading from the old live version? reset HCs2368{2369Game.heavenlyChips=Game.prestige;2370Game.heavenlyChipsSpent=0;2371}23722373if (Game.ascensionMode!=1)2374{2375if (Game.Has('Starter kit')) Game.Objects['Cursor'].free=10;2376if (Game.Has('Starter kitchen')) Game.Objects['Grandma'].free=5;2377}23782379Game.CalculateGains();23802381if (Math.random()<1/10000) Game.TOYS=1;//teehee!23822383var timeOffline=(Date.now()-Game.lastDate)/1000;23842385Game.loadLumps(timeOffline);23862387//compute cookies earned while the game was closed2388if (Game.mobile || Game.Has('Perfect idling') || Game.Has('Twin Gates of Transcendence'))2389{2390if (Game.Has('Perfect idling'))2391{2392var maxTime=60*60*24*1000000000;2393var percent=100;2394}2395else2396{2397var maxTime=60*60;2398if (Game.Has('Belphegor')) maxTime*=2;2399if (Game.Has('Mammon')) maxTime*=2;2400if (Game.Has('Abaddon')) maxTime*=2;2401if (Game.Has('Satan')) maxTime*=2;2402if (Game.Has('Asmodeus')) maxTime*=2;2403if (Game.Has('Beelzebub')) maxTime*=2;2404if (Game.Has('Lucifer')) maxTime*=2;24052406var percent=5;2407if (Game.Has('Angels')) percent+=10;2408if (Game.Has('Archangels')) percent+=10;2409if (Game.Has('Virtues')) percent+=10;2410if (Game.Has('Dominions')) percent+=10;2411if (Game.Has('Cherubim')) percent+=10;2412if (Game.Has('Seraphim')) percent+=10;2413if (Game.Has('God')) percent+=10;24142415if (Game.Has('Chimera')) {maxTime+=60*60*24*2;percent+=5;}24162417if (Game.Has('Fern tea')) percent+=3;2418if (Game.Has('Ichor syrup')) percent+=7;2419if (Game.Has('Fortune #102')) percent+=1;2420}24212422var timeOfflineOptimal=Math.min(timeOffline,maxTime);2423var timeOfflineReduced=Math.max(0,timeOffline-timeOfflineOptimal);2424var amount=(timeOfflineOptimal+timeOfflineReduced*0.1)*Game.cookiesPs*(percent/100);24252426if (amount>0)2427{2428if (Game.prefs.popups) Game.Popup('Earned '+Beautify(amount)+' cookie'+(Math.floor(amount)==1?'':'s')+' while you were away');2429else Game.Notify('Welcome back!','You earned <b>'+Beautify(amount)+'</b> cookie'+(Math.floor(amount)==1?'':'s')+' while you were away.<br>('+Game.sayTime(timeOfflineOptimal*Game.fps,-1)+' at '+Math.floor(percent)+'% CpS'+(timeOfflineReduced?', plus '+Game.sayTime(timeOfflineReduced*Game.fps,-1)+' at '+(Math.floor(percent*10)/100)+'%':'')+'.)',[Math.floor(Math.random()*16),11]);2430Game.Earn(amount);2431}2432}24332434//we load buffs after everything as we do not want them to interfer with offline CpS2435for (var i in buffsToLoad)2436{2437var mestr=buffsToLoad[i];2438var type=Game.buffTypes[parseInt(mestr[0])];2439Game.gainBuff(type.name,parseFloat(mestr[1])/Game.fps,parseFloat(mestr[3]||0),parseFloat(mestr[4]||0),parseFloat(mestr[5]||0)).time=parseFloat(mestr[2]);2440}244124422443Game.bakeryNameRefresh();24442445}2446else//importing old version save2447{2448Game.Notify('Error importing save','Sorry, you can\'t import saves from the old version anymore.','',6,1);2449return false;2450}245124522453Game.RebuildUpgrades();24542455Game.TickerAge=0;2456Game.TickerEffect=0;24572458Game.elderWrathD=0;2459Game.recalculateGains=1;2460Game.storeToRefresh=1;2461Game.upgradesToRebuild=1;24622463Game.buyBulk=1;Game.buyMode=1;Game.storeBulkButton(-1);24642465Game.specialTab='';2466Game.ToggleSpecialMenu(0);24672468Game.killShimmers();24692470if (Game.T>Game.fps*5 && Game.ReincarnateTimer==0)//fade out of black and pop the cookie2471{2472Game.ReincarnateTimer=1;2473Game.addClass('reincarnating');2474Game.BigCookieSize=0;2475}24762477if (version<Game.version) l('logButton').classList.add('hasUpdate');24782479if (Game.season!='' && Game.season==Game.baseSeason)2480{2481if (Game.season=='valentines') Game.Notify('Valentine\'s Day!','It\'s <b>Valentine\'s season</b>!<br>Love\'s in the air and cookies are just that much sweeter!',[20,3],60*3);2482else if (Game.season=='fools') Game.Notify('Business Day!','It\'s <b>Business season</b>!<br>Don\'t panic! Things are gonna be looking a little more corporate for a few days.',[17,6],60*3);2483else if (Game.season=='halloween') Game.Notify('Halloween!','It\'s <b>Halloween season</b>!<br>Everything is just a little bit spookier!',[13,8],60*3);2484else if (Game.season=='christmas') Game.Notify('Christmas time!','It\'s <b>Christmas season</b>!<br>Bring good cheer to all and you just may get cookies in your stockings!',[12,10],60*3);2485else if (Game.season=='easter') Game.Notify('Easter!','It\'s <b>Easter season</b>!<br>Keep an eye out and you just might click a rabbit or two!',[0,12],60*3);2486}24872488Game.heralds=actualHeralds;24892490if (Game.prefs.popups) Game.Popup('Game loaded');2491else Game.Notify('Game loaded','','',1,1);24922493if (Game.prefs.showBackupWarning==1) Game.showBackupWarning();2494}2495}2496else return false;2497return true;2498}24992500/*=====================================================================================2501RESET2502=======================================================================================*/2503Game.Reset=function(hard)2504{2505Game.T=0;25062507var cookiesForfeited=Game.cookiesEarned;2508if (!hard)2509{2510if (cookiesForfeited>=1000000) Game.Win('Sacrifice');2511if (cookiesForfeited>=1000000000) Game.Win('Oblivion');2512if (cookiesForfeited>=1000000000000) Game.Win('From scratch');2513if (cookiesForfeited>=1000000000000000) Game.Win('Nihilism');2514if (cookiesForfeited>=1000000000000000000) Game.Win('Dematerialize');2515if (cookiesForfeited>=1000000000000000000000) Game.Win('Nil zero zilch');2516if (cookiesForfeited>=1000000000000000000000000) Game.Win('Transcendence');2517if (cookiesForfeited>=1000000000000000000000000000) Game.Win('Obliterate');2518if (cookiesForfeited>=1000000000000000000000000000000) Game.Win('Negative void');2519if (cookiesForfeited>=1000000000000000000000000000000000) Game.Win('To crumbs, you say?');2520if (cookiesForfeited>=1000000000000000000000000000000000000) Game.Win('You get nothing');2521if (cookiesForfeited>=1000000000000000000000000000000000000000) Game.Win('Humble rebeginnings');2522if (cookiesForfeited>=1000000000000000000000000000000000000000000) Game.Win('The end of the world');2523if (cookiesForfeited>=1000000000000000000000000000000000000000000000) Game.Win('Oh, you\'re back');2524if (cookiesForfeited>=1000000000000000000000000000000000000000000000000) Game.Win('Lazarus');2525if (cookiesForfeited>=1000000000000000000000000000000000000000000000000000) Game.Win('Smurf account');2526if (cookiesForfeited>=1000000000000000000000000000000000000000000000000000000) Game.Win('If at first you don\'t succeed');25272528if (Math.round(Game.cookies)==1000000000000) Game.Win('When the cookies ascend just right');2529}25302531Game.killBuffs();25322533Game.seed=Game.makeSeed();25342535Game.cookiesReset+=Game.cookiesEarned;2536Game.cookies=0;2537Game.cookiesEarned=0;2538Game.cookieClicks=0;2539Game.goldenClicksLocal=0;2540//Game.goldenClicks=0;2541//Game.missedGoldenClicks=0;2542Game.handmadeCookies=0;2543if (hard)2544{2545Game.bgType=0;2546Game.milkType=0;2547Game.chimeType=0;25482549Game.vault=[];2550}2551Game.pledges=0;2552Game.pledgeT=0;2553Game.elderWrath=0;2554Game.nextResearch=0;2555Game.researchT=0;2556Game.seasonT=0;2557Game.seasonUses=0;2558Game.season=Game.baseSeason;2559Game.computeSeasonPrices();25602561Game.startDate=parseInt(Date.now());2562Game.lastDate=parseInt(Date.now());25632564Game.cookiesSucked=0;2565Game.wrinklersPopped=0;2566Game.ResetWrinklers();25672568Game.santaLevel=0;2569Game.reindeerClicked=0;25702571Game.dragonLevel=0;2572Game.dragonAura=0;2573Game.dragonAura2=0;25742575Game.fortuneGC=0;2576Game.fortuneCPS=0;25772578if (Game.gainedPrestige>0) Game.resets++;2579if (!hard && Game.canLumps() && Game.ascensionMode!=1) Game.addClass('lumpsOn');2580else Game.removeClass('lumpsOn');2581Game.gainedPrestige=0;25822583for (var i in Game.ObjectsById)2584{2585var me=Game.ObjectsById[i];2586me.amount=0;me.bought=0;me.free=0;me.totalCookies=0;2587me.switchMinigame(false);2588if (hard) {me.muted=0;}2589me.pics=[];2590me.refresh();2591}2592for (var i in Game.UpgradesById)2593{2594var me=Game.UpgradesById[i];2595if (hard || me.pool!='prestige') me.bought=0;2596if (hard) me.unlocked=0;2597if (me.pool!='prestige' && !me.lasting)2598{2599if (Game.Has('Keepsakes') && Game.seasonDrops.indexOf(me.name)!=-1 && Math.random()<1/5){}2600else if (Game.HasAchiev('O Fortuna') && me.tier=='fortune' && Math.random()<0.4){}2601else me.unlocked=0;2602}2603}26042605Game.BuildingsOwned=0;2606Game.UpgradesOwned=0;26072608Game.cookiesPsByType={};2609Game.cookiesMultByType={};26102611if (!hard)2612{2613if (Game.ascensionMode!=1)2614{2615for (var i in Game.permanentUpgrades)2616{2617if (Game.permanentUpgrades[i]!=-1)2618{Game.UpgradesById[Game.permanentUpgrades[i]].earn();}2619}2620if (Game.Has('Season switcher')) {for (var i in Game.seasons) {Game.Unlock(Game.seasons[i].trigger);}}26212622if (Game.Has('Starter kit')) Game.Objects['Cursor'].getFree(10);2623if (Game.Has('Starter kitchen')) Game.Objects['Grandma'].getFree(5);2624}2625}26262627/*for (var i in Game.AchievementsById)2628{2629var me=Game.AchievementsById[i];2630me.won=0;2631}*/2632//Game.DefaultPrefs();2633BeautifyAll();26342635Game.RebuildUpgrades();2636Game.TickerAge=0;2637Game.TickerEffect=0;2638Game.recalculateGains=1;2639Game.storeToRefresh=1;2640Game.upgradesToRebuild=1;2641Game.killShimmers();26422643Game.buyBulk=1;Game.buyMode=1;Game.storeBulkButton(-1);26442645Game.LoadMinigames();2646for (var i in Game.ObjectsById)2647{2648var me=Game.ObjectsById[i];2649if (hard && me.minigame && me.minigame.launch) {me.minigame.launch();me.minigame.reset(true);}2650else if (!hard && me.minigame && me.minigame.reset) me.minigame.reset();2651}26522653l('toggleBox').style.display='none';2654l('toggleBox').innerHTML='';2655Game.choiceSelectorOn=-1;2656Game.specialTab='';2657Game.ToggleSpecialMenu(0);26582659l('logButton').classList.remove('hasUpdate');26602661for (var i in Game.customReset) {Game.customReset[i]();}26622663if (hard)2664{2665if (Game.T>Game.fps*5 && Game.ReincarnateTimer==0)//fade out of black and pop the cookie2666{2667Game.ReincarnateTimer=1;2668Game.addClass('reincarnating');2669Game.BigCookieSize=0;2670}2671if (Game.prefs.popups) Game.Popup('Game reset');2672else Game.Notify('Game reset','So long, cookies.',[21,6],6);2673}2674}2675Game.HardReset=function(bypass)2676{2677if (!bypass)2678{2679Game.Prompt('<h3>Wipe save</h3><div class="block">Do you REALLY want to wipe your save?<br><small>You will lose your progress, your achievements, and your heavenly chips!</small></div>',[['Yes!','Game.ClosePrompt();Game.HardReset(1);'],'No']);2680}2681else if (bypass==1)2682{2683Game.Prompt('<h3>Wipe save</h3><div class="block">Whoah now, are you really, <b><i>REALLY</i></b> sure you want to go through with this?<br><small>Don\'t say we didn\'t warn you!</small></div>',[['Do it!','Game.ClosePrompt();Game.HardReset(2);'],'No']);2684}2685else2686{2687for (var i in Game.AchievementsById)2688{2689var me=Game.AchievementsById[i];2690me.won=0;2691}2692for (var i in Game.ObjectsById)2693{2694var me=Game.ObjectsById[i];2695me.level=0;2696}26972698Game.AchievementsOwned=0;2699Game.goldenClicks=0;2700Game.missedGoldenClicks=0;2701Game.Reset(1);2702Game.resets=0;2703Game.fullDate=parseInt(Date.now());2704Game.bakeryName=Game.GetBakeryName();2705Game.bakeryNameRefresh();2706Game.cookiesReset=0;2707Game.prestige=0;2708Game.heavenlyChips=0;2709Game.heavenlyChipsSpent=0;2710Game.heavenlyCookies=0;2711Game.permanentUpgrades=[-1,-1,-1,-1,-1];2712Game.ascensionMode=0;2713Game.lumps=-1;2714Game.lumpsTotal=-1;2715Game.lumpT=Date.now();2716Game.lumpRefill=0;2717Game.removeClass('lumpsOn');2718}2719}2720272127222723Game.onCrate=0;2724Game.setOnCrate=function(what)2725{2726Game.onCrate=what;2727}2728Game.crate=function(me,context,forceClickStr,id)2729{2730//produce a crate with associated tooltip for an upgrade or achievement2731//me is an object representing the upgrade or achievement2732//context can be "store", "ascend", "stats" or undefined2733//forceClickStr changes what is done when the crate is clicked2734//id is the resulting div's desired id27352736var classes='crate';2737var enabled=0;2738var noFrame=0;2739var attachment='top';2740var neuromancy=0;2741if (context=='stats' && (Game.Has('Neuromancy') || (Game.sesame && me.pool=='debug'))) neuromancy=1;2742var mysterious=0;2743var clickStr='';27442745if (me.type=='upgrade')2746{2747var canBuy=(context=='store'?me.canBuy():true);2748if (context=='stats' && me.bought==0 && !Game.Has('Neuromancy') && (!Game.sesame || me.pool!='debug')) return '';2749else if (context=='stats' && (Game.Has('Neuromancy') || (Game.sesame && me.pool=='debug'))) neuromancy=1;2750else if (context=='store' && !canBuy) enabled=0;2751else if (context=='ascend' && me.bought==0) enabled=0;2752else enabled=1;2753if (me.bought>0) enabled=1;27542755if (context=='stats' && !Game.prefs.crates) noFrame=1;27562757classes+=' upgrade';2758if (me.pool=='prestige') classes+=' heavenly';275927602761if (neuromancy) clickStr='Game.UpgradesById['+me.id+'].toggle();';2762}2763else if (me.type=='achievement')2764{2765if (context=='stats' && me.won==0 && me.pool!='normal') return '';2766else if (context!='stats') enabled=1;27672768if (context=='stats' && !Game.prefs.crates) noFrame=1;27692770classes+=' achievement';2771if (me.pool=='shadow') classes+=' shadow';2772if (me.won>0) enabled=1;2773else mysterious=1;2774if (!enabled) clickStr='Game.AchievementsById['+me.id+'].click();';27752776if (neuromancy) clickStr='Game.AchievementsById['+me.id+'].toggle();';2777}27782779if (context=='store') attachment='store';27802781if (forceClickStr) clickStr=forceClickStr;27822783if (me.choicesFunction) classes+=' selector';278427852786var icon=me.icon;2787if (mysterious) icon=[0,7];27882789if (me.iconFunction) icon=me.iconFunction();27902791if (me.bought && context=='store') enabled=0;27922793if (enabled) classes+=' enabled';// else classes+=' disabled';2794if (noFrame) classes+=' noFrame';27952796var text=[];2797if (Game.sesame)2798{2799if (Game.debuggedUpgradeCpS[me.name] || Game.debuggedUpgradeCpClick[me.name])2800{2801text.push('x'+Beautify(1+Game.debuggedUpgradeCpS[me.name],2));text.push(Game.debugColors[Math.floor(Math.max(0,Math.min(Game.debugColors.length-1,Math.pow(Game.debuggedUpgradeCpS[me.name]/2,0.5)*Game.debugColors.length)))]);2802text.push('x'+Beautify(1+Game.debuggedUpgradeCpClick[me.name],2));text.push(Game.debugColors[Math.floor(Math.max(0,Math.min(Game.debugColors.length-1,Math.pow(Game.debuggedUpgradeCpClick[me.name]/2,0.5)*Game.debugColors.length)))]);2803}2804if (Game.extraInfo) {text.push(Math.floor(me.order)+(me.power?'<br>P:'+me.power:''));text.push('#fff');}2805}2806var textStr='';2807for (var i=0;i<text.length;i+=2)2808{2809textStr+='<div style="opacity:0.9;z-index:1000;padding:0px 2px;background:'+text[i+1]+';color:#000;font-size:10px;position:absolute;top:'+(i/2*10)+'px;left:0px;">'+text[i]+'</div>';2810}28112812return '<div'+2813(clickStr!=''?(' '+Game.clickStr+'="'+clickStr+'"'):'')+2814' class="'+classes+'" '+2815Game.getDynamicTooltip(2816'function(){return Game.crateTooltip(Game.'+(me.type=='upgrade'?'Upgrades':'Achievements')+'ById['+me.id+'],'+(context?'\''+context+'\'':'')+');}',2817attachment,true2818)+2819(id?'id="'+id+'" ':'')+2820'style="'+(mysterious?2821'background-position:'+(-0*48)+'px '+(-7*48)+'px':2822(icon[2]?'background-image:url('+icon[2]+');':'')+'background-position:'+(-icon[0]*48)+'px '+(-icon[1]*48)+'px')+';'+2823((context=='ascend' && me.pool=='prestige')?'position:absolute;left:'+me.posX+'px;top:'+me.posY+'px;':'')+2824'">'+2825textStr+2826(me.choicesFunction?'<div class="selectorCorner"></div>':'')+2827'</div>';2828}2829Game.crateTooltip=function(me,context)2830{2831var tags=[];2832mysterious=0;2833var neuromancy=0;2834var price='';2835if (context=='stats' && (Game.Has('Neuromancy') || (Game.sesame && me.pool=='debug'))) neuromancy=1;28362837if (me.type=='upgrade')2838{2839if (me.pool=='prestige') tags.push('Heavenly','#efa438');2840else if (me.pool=='tech') tags.push('Tech','#36a4ff');2841else if (me.pool=='cookie') tags.push('Cookie',0);2842else if (me.pool=='debug') tags.push('Debug','#00c462');2843else if (me.pool=='toggle') tags.push('Switch',0);2844else tags.push('Upgrade',0);28452846if (me.tier!=0 && Game.Has('Label printer')) tags.push('Tier : '+Game.Tiers[me.tier].name,Game.Tiers[me.tier].color);2847if (me.name=='Label printer' && Game.Has('Label printer')) tags.push('Tier : Self-referential','#ff00ea');28482849if (me.isVaulted()) tags.push('Vaulted','#4e7566');28502851if (me.bought>0)2852{2853if (me.pool=='tech') tags.push('Researched',0);2854else if (me.kitten) tags.push('Purrchased',0);2855else tags.push('Purchased',0);2856}28572858if (me.lasting && me.unlocked) tags.push('Unlocked forever','#f2ff87');28592860if (neuromancy && me.bought==0) tags.push('Click to learn!','#00c462');2861else if (neuromancy && me.bought>0) tags.push('Click to unlearn!','#00c462');28622863var canBuy=(context=='store'?me.canBuy():true);2864var cost=me.getPrice();2865if (me.priceLumps>0) cost=me.priceLumps;28662867if (me.priceLumps==0 && cost==0) price='';2868else2869{2870price='<div style="float:right;text-align:right;"><span class="price'+2871(me.priceLumps>0?(' lump'):'')+2872(me.pool=='prestige'?((me.bought || Game.heavenlyChips>=cost)?' heavenly':' heavenly disabled'):'')+2873(context=='store'?(canBuy?'':' disabled'):'')+2874'">'+Beautify(Math.round(cost))+'</span>'+((me.pool!='prestige' && me.priceLumps==0)?Game.costDetails(cost):'')+'</div>';2875}2876}2877else if (me.type=='achievement')2878{2879if (me.pool=='shadow') tags.push('Shadow Achievement','#9700cf');2880else tags.push('Achievement',0);2881if (me.won>0) tags.push('Unlocked',0);2882else {tags.push('Locked',0);mysterious=1;}28832884if (neuromancy && me.won==0) tags.push('Click to win!','#00c462');2885else if (neuromancy && me.won>0) tags.push('Click to lose!','#00c462');2886}28872888var tagsStr='';2889for (var i=0;i<tags.length;i+=2)2890{2891if (i%2==0) tagsStr+=' <div class="tag" style="color:'+(tags[i+1]==0?'#fff':tags[i+1])+';">['+tags[i]+']</div>';2892}2893tagsStr=tagsStr.substring(1);28942895var icon=me.icon;2896if (mysterious) icon=[0,7];28972898if (me.iconFunction) icon=me.iconFunction();289929002901var tip='';2902if (context=='store')2903{2904if (me.pool!='toggle' && me.pool!='tech')2905{2906if (Game.Has('Inspired checklist'))2907{2908if (me.isVaulted()) tip='Upgrade is vaulted and will not be auto-purchased.<br>Click to purchase. Shift-click to unvault.';2909else tip='Click to purchase. Shift-click to vault.';2910if (Game.keys[16]) tip+='<br>(You are holding Shift.)';2911else tip+='<br>(You are not holding Shift.)';2912}2913else tip='Click to purchase.';2914}2915else if (me.pool=='toggle' && me.choicesFunction) tip='Click to open selector.';2916else if (me.pool=='toggle') tip='Click to toggle.';2917else if (me.pool=='tech') tip='Click to research.';2918}29192920var desc=me.desc;2921if (me.descFunc) desc=me.descFunc();2922if (me.bought && context=='store' && me.displayFuncWhenOwned) desc=me.displayFuncWhenOwned()+'<div class="line"></div>'+desc;2923if (me.unlockAt)2924{2925if (me.unlockAt.require)2926{2927var it=Game.Upgrades[me.unlockAt.require];2928desc='<div style="font-size:80%;text-align:center;">From <div class="icon" style="vertical-align:middle;display:inline-block;'+(it.icon[2]?'background-image:url('+it.icon[2]+');':'')+'background-position:'+(-it.icon[0]*48)+'px '+(-it.icon[1]*48)+'px;transform:scale(0.5);margin:-16px;"></div> '+it.name+'</div><div class="line"></div>'+desc;2929}2930/*else if (me.unlockAt.season)2931{2932var it=Game.seasons[me.unlockAt.season];2933desc='<div style="font-size:80%;text-align:center;">From <div class="icon" style="vertical-align:middle;display:inline-block;'+(Game.Upgrades[it.trigger].icon[2]?'background-image:url('+Game.Upgrades[it.trigger].icon[2]+');':'')+'background-position:'+(-Game.Upgrades[it.trigger].icon[0]*48)+'px '+(-Game.Upgrades[it.trigger].icon[1]*48)+'px;transform:scale(0.5);margin:-16px;"></div> '+it.name+'</div><div class="line"></div>'+desc;2934}*/2935else if (me.unlockAt.text)2936{2937var it=Game.Upgrades[me.unlockAt.require];2938desc='<div style="font-size:80%;text-align:center;">From <b>'+text+'</b></div><div class="line"></div>'+desc;2939}2940}29412942return '<div style="padding:8px 4px;min-width:350px;">'+2943'<div class="icon" style="float:left;margin-left:-8px;margin-top:-8px;'+(icon[2]?'background-image:url('+icon[2]+');':'')+'background-position:'+(-icon[0]*48)+'px '+(-icon[1]*48)+'px;"></div>'+2944(me.bought && context=='store'?'':price)+2945'<div class="name">'+(mysterious?'???':me.name)+'</div>'+2946tagsStr+2947'<div class="line"></div><div class="description">'+(mysterious?'???':desc)+'</div></div>'+2948(tip!=''?('<div class="line"></div><div style="font-size:10px;font-weight:bold;color:#999;text-align:center;padding-bottom:4px;line-height:100%;">'+tip+'</div>'):'')+2949(Game.sesame?('<div style="font-size:9px;">Id : '+me.id+' | Order : '+Math.floor(me.order)+(me.tier?' | Tier : '+me.tier:'')+'</div>'):'');2950}29512952Game.costDetails=function(cost)2953{2954if (!Game.Has('Genius accounting')) return '';2955if (!cost) return '';2956var priceInfo='';2957var cps=Game.cookiesPs*(1-Game.cpsSucked);2958if (cost>Game.cookies) priceInfo+='in '+Game.sayTime(((cost-Game.cookies)/cps+1)*Game.fps)+'<br>';2959priceInfo+=Game.sayTime((cost/cps+1)*Game.fps)+' worth<br>';2960priceInfo+=Beautify((cost/Game.cookies)*100,1)+'% of bank<br>';2961return '<div style="font-size:80%;opacity:0.7;line-height:90%;">'+priceInfo+'</div>';2962}296329642965/*=====================================================================================2966PRESTIGE2967=======================================================================================*/29682969Game.HCfactor=3;2970Game.HowMuchPrestige=function(cookies)//how much prestige [cookies] should land you2971{2972return Math.pow(cookies/1000000000000,1/Game.HCfactor);2973}2974Game.HowManyCookiesReset=function(chips)//how many cookies [chips] are worth2975{2976//this must be the inverse of the above function (ie. if cookies=chips^2, chips=cookies^(1/2) )2977return Math.pow(chips,Game.HCfactor)*1000000000000;2978}2979Game.gainedPrestige=0;2980Game.EarnHeavenlyChips=function(cookiesForfeited)2981{2982//recalculate prestige and chips owned2983var prestige=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+cookiesForfeited));2984if (prestige>Game.prestige)//did we gain prestige levels?2985{2986var prestigeDifference=prestige-Game.prestige;2987Game.gainedPrestige=prestigeDifference;2988Game.heavenlyChips+=prestigeDifference;2989Game.prestige=prestige;2990if (Game.prefs.popups) Game.Popup('You gain '+Beautify(prestigeDifference)+' prestige level'+(prestigeDifference==1?'':'s')+'!');2991else Game.Notify('You forfeit your '+Beautify(cookiesForfeited)+' cookies.','You gain <b>'+Beautify(prestigeDifference)+'</b> prestige level'+(prestigeDifference==1?'':'s')+'!',[19,7]);2992}2993}29942995Game.GetHeavenlyMultiplier=function()2996{2997var heavenlyMult=0;2998if (Game.Has('Heavenly chip secret')) heavenlyMult+=0.05;2999if (Game.Has('Heavenly cookie stand')) heavenlyMult+=0.20;3000if (Game.Has('Heavenly bakery')) heavenlyMult+=0.25;3001if (Game.Has('Heavenly confectionery')) heavenlyMult+=0.25;3002if (Game.Has('Heavenly key')) heavenlyMult+=0.25;3003//if (Game.hasAura('Dragon God')) heavenlyMult*=1.05;3004heavenlyMult*=1+Game.auraMult('Dragon God')*0.05;3005if (Game.Has('Lucky digit')) heavenlyMult*=1.01;3006if (Game.Has('Lucky number')) heavenlyMult*=1.01;3007if (Game.Has('Lucky payout')) heavenlyMult*=1.01;3008if (Game.hasGod)3009{3010var godLvl=Game.hasGod('creation');3011if (godLvl==1) heavenlyMult*=0.7;3012else if (godLvl==2) heavenlyMult*=0.8;3013else if (godLvl==3) heavenlyMult*=0.9;3014}3015return heavenlyMult;3016}30173018Game.ascensionModes={30190:{name:'None',desc:'No special modifiers.',icon:[10,0]},30201:{name:'Born again',desc:'This run will behave as if you\'d just started the game from scratch. Prestige levels and heavenly upgrades will have no effect, as will sugar lumps and building levels. Perma-upgrades and minigames will be unavailable.<div class="line"></div>Some achievements are only available in this mode.',icon:[2,7]}/*,30212:{name:'Trigger finger',desc:'In this run, scrolling your mouse wheel on the cookie counts as clicking it. Some upgrades introduce new clicking behaviors.<br>No clicking achievements may be obtained in this mode.<div class="line"></div>Reaching 1 quadrillion cookies in this mode unlocks a special heavenly upgrade.',icon:[12,0]}*/3022};30233024Game.ascendMeterPercent=0;3025Game.ascendMeterPercentT=0;3026Game.ascendMeterLevel=100000000000000000000000000000;30273028Game.nextAscensionMode=0;3029Game.UpdateAscensionModePrompt=function()3030{3031var icon=Game.ascensionModes[Game.nextAscensionMode].icon;3032var name=Game.ascensionModes[Game.nextAscensionMode].name;3033l('ascendModeButton').innerHTML=3034'<div class="crate noFrame enabled" '+Game.clickStr+'="Game.PickAscensionMode();" '+Game.getTooltip(3035'<div style="min-width:200px;text-align:center;font-size:11px;">Challenge mode for the next run :<br><b>'+name+'</b><div class="line"></div>Challenge modes apply special modifiers to your next ascension.<br>Click to change.</div>'3036,'bottom-right')+' style="opacity:1;float:none;display:block;background-position:'+(-icon[0]*48)+'px '+(-icon[1]*48)+'px;"></div>';3037}3038Game.PickAscensionMode=function()3039{3040PlaySound('snd/tick.mp3');3041Game.tooltip.hide();30423043var str='';3044for (var i in Game.ascensionModes)3045{3046var icon=Game.ascensionModes[i].icon;3047str+='<div class="crate enabled'+(i==Game.nextAscensionMode?' highlighted':'')+'" id="challengeModeSelector'+i+'" style="opacity:1;float:none;display:inline-block;background-position:'+(-icon[0]*48)+'px '+(-icon[1]*48)+'px;" '+Game.clickStr+'="Game.nextAscensionMode='+i+';Game.PickAscensionMode();PlaySound(\'snd/tick.mp3\');Game.choiceSelectorOn=-1;" onMouseOut="l(\'challengeSelectedName\').innerHTML=Game.ascensionModes[Game.nextAscensionMode].name;l(\'challengeSelectedDesc\').innerHTML=Game.ascensionModes[Game.nextAscensionMode].desc;" onMouseOver="l(\'challengeSelectedName\').innerHTML=Game.ascensionModes['+i+'].name;l(\'challengeSelectedDesc\').innerHTML=Game.ascensionModes['+i+'].desc;"'+3048'></div>';3049}3050Game.Prompt('<h3>Select a challenge mode</h3>'+3051'<div class="line"></div><div class="crateBox">'+str+'</div><h4 id="challengeSelectedName">'+Game.ascensionModes[Game.nextAscensionMode].name+'</h4><div class="line"></div><div id="challengeSelectedDesc" style="min-height:128px;">'+Game.ascensionModes[Game.nextAscensionMode].desc+'</div><div class="line"></div>'3052,[['Confirm','Game.UpdateAscensionModePrompt();Game.ClosePrompt();']],0,'widePrompt');3053}30543055Game.UpdateLegacyPrompt=function()3056{3057if (!l('legacyPromptData')) return 0;3058var date=new Date();3059date.setTime(Date.now()-Game.startDate);3060var timeInSeconds=date.getTime()/1000;3061var startDate=Game.sayTime(timeInSeconds*Game.fps,-1);30623063var ascendNowToGet=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned)-Game.HowMuchPrestige(Game.cookiesReset));3064var cookiesToNext=Math.floor(Game.HowManyCookiesReset(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned)+1)-Game.cookiesReset-Game.cookiesEarned);3065l('legacyPromptData').innerHTML=''+3066'<div class="icon" style="pointer-event:none;transform:scale(2);opacity:0.25;position:absolute;right:-8px;bottom:-8px;background-position:'+(-19*48)+'px '+(-7*48)+'px;"></div>'+3067'<div class="listing"><b>Run duration :</b> '+(startDate==''?'tiny':(startDate))+'</div>'+3068//'<div class="listing">Earned : '+Beautify(Game.cookiesEarned)+', Reset : '+Beautify(Game.cookiesReset)+'</div>'+3069'<div class="listing"><b>Prestige level :</b> '+Beautify(Game.prestige)+'</div>'+3070'<div class="listing"><b>Heavenly chips :</b> '+Beautify(Game.heavenlyChips)+'</div>'+3071(ascendNowToGet>=1?('<div class="listing"><b>Ascending now will produce :</b> '+Beautify(ascendNowToGet)+' heavenly chip'+((ascendNowToGet)==1?'':'s')+'</div>'):3072('<div class="listing warning"><b>'+Beautify(cookiesToNext)+'</b> more cookie'+((cookiesToNext)==1?'':'s')+' for the next prestige level.<br>You may ascend now, but will gain no benefits.</div>'))+3073'';3074if (1 || ascendNowToGet>=1) l('promptOption0').style.display='inline-block'; else l('promptOption0').style.display='none';3075}30763077l('ascendOverlay').innerHTML=3078'<div id="ascendBox">'+3079'<div class="ascendData smallFramed prompt" '+Game.getTooltip(3080'<div style="min-width:200px;text-align:center;font-size:11px;">Each prestige level grants you a permanent +1% CpS.<br>The more levels you have, the more cookies they require.</div>'3081,'bottom-right')+' style="margin-top:8px;"><h3 id="ascendPrestige"></h3></div>'+3082'<div class="ascendData smallFramed prompt" '+Game.getTooltip(3083'<div style="min-width:200px;text-align:center;font-size:11px;">Heavenly chips are used to buy heavenly upgrades.<br>You gain 1 chip every time you gain a prestige level.</div>'3084,'bottom-right')+'><h3 id="ascendHCs"></h3></div>'+3085'<a id="ascendButton" class="option framed large red" '+Game.getTooltip(3086'<div style="min-width:200px;text-align:center;font-size:11px;">Click this once you\'ve bought<br>everything you need!</div>'3087,'bottom-right')+' style="font-size:16px;margin-top:0px;"><span class="fancyText" style="font-size:20px;">Reincarnate</span></a>'+3088'<div id="ascendModeButton" style="position:absolute;right:34px;bottom:25px;display:none;"></div>'+3089'<input type="text" style="display:block;" id="upgradePositions"/></div>'+30903091'<div id="ascendInfo"><div class="ascendData smallFramed" style="margin-top:22px;width:40%;font-size:11px;">You are ascending.<br>Drag the screen around<br>or use arrow keys!<br>When you\'re ready,<br>click Reincarnate.</div></div>';30923093Game.UpdateAscensionModePrompt();30943095AddEvent(l('ascendButton'),'click',function(){3096PlaySound('snd/tick.mp3');3097Game.Reincarnate();3098});30993100Game.ascendl=l('ascend');3101Game.ascendContentl=l('ascendContent');3102Game.ascendZoomablel=l('ascendZoomable');3103Game.ascendUpgradesl=l('ascendUpgrades');3104Game.OnAscend=0;3105Game.AscendTimer=0;//how far we are into the ascend animation3106Game.AscendDuration=Game.fps*5;//how long the ascend animation is3107Game.AscendBreakpoint=Game.AscendDuration*0.5;//at which point the cookie explodes during the ascend animation3108Game.UpdateAscendIntro=function()3109{3110if (Game.AscendTimer==1) PlaySound('snd/charging.mp3');3111if (Game.AscendTimer==Math.floor(Game.AscendBreakpoint)) PlaySound('snd/thud.mp3');3112Game.AscendTimer++;3113if (Game.AscendTimer>Game.AscendDuration)//end animation and launch ascend screen3114{3115PlaySound('snd/cymbalRev.mp3',0.5);3116PlaySound('snd/choir.mp3');3117Game.EarnHeavenlyChips(Game.cookiesEarned);3118Game.AscendTimer=0;3119Game.OnAscend=1;Game.removeClass('ascendIntro');3120Game.addClass('ascending');3121Game.BuildAscendTree();3122Game.heavenlyChipsDisplayed=Game.heavenlyChips;3123Game.nextAscensionMode=0;3124Game.ascensionMode=0;3125Game.UpdateAscensionModePrompt();3126}3127}3128Game.ReincarnateTimer=0;//how far we are into the reincarnation animation3129Game.ReincarnateDuration=Game.fps*1;//how long the reincarnation animation is3130Game.UpdateReincarnateIntro=function()3131{3132if (Game.ReincarnateTimer==1) PlaySound('snd/pop'+Math.floor(Math.random()*3+1)+'.mp3',0.75);3133Game.ReincarnateTimer++;3134if (Game.ReincarnateTimer>Game.ReincarnateDuration)//end animation and launch regular game3135{3136Game.ReincarnateTimer=0;3137Game.removeClass('reincarnating');3138}3139}3140Game.Reincarnate=function(bypass)3141{3142if (!bypass) Game.Prompt('<h3>Reincarnate</h3><div class="block">Are you ready to return to the mortal world?</div>',[['Yes','Game.ClosePrompt();Game.Reincarnate(1);'],'No']);3143else3144{3145Game.ascendUpgradesl.innerHTML='';3146Game.ascensionMode=Game.nextAscensionMode;3147Game.nextAscensionMode=0;3148Game.Reset();3149if (Game.HasAchiev('Rebirth'))3150{3151if (Game.prefs.popups) Game.Popup('Reincarnated');3152else Game.Notify('Reincarnated','Hello, cookies!',[10,0],4);3153}3154if (Game.resets>=1000) Game.Win('Endless cycle');3155if (Game.resets>=100) Game.Win('Reincarnation');3156if (Game.resets>=10) Game.Win('Resurrection');3157if (Game.resets>=1) Game.Win('Rebirth');3158Game.removeClass('ascending');3159Game.OnAscend=0;3160//trigger the reincarnate animation3161Game.ReincarnateTimer=1;3162Game.addClass('reincarnating');3163Game.BigCookieSize=0;3164}3165}3166Game.GiveUpAscend=function(bypass)3167{3168if (!bypass) Game.Prompt('<h3>Give up</h3><div class="block">Are you sure? You\'ll have to start this run over and won\'t gain any heavenly chips!</div>',[['Yes','Game.ClosePrompt();Game.GiveUpAscend(1);'],'No']);3169else3170{3171if (Game.prefs.popups) Game.Popup('Game reset');3172else Game.Notify('Gave up','Let\'s try this again!',[0,5],4);3173Game.Reset();3174}3175}3176Game.Ascend=function(bypass)3177{3178if (!bypass) Game.Prompt('<h3>Ascend</h3><div class="block">Do you REALLY want to ascend?<div class="line"></div>You will lose your progress and start over from scratch.<div class="line"></div>All your cookies will be converted into prestige and heavenly chips.<div class="line"></div>You will keep your achievements'+(Game.canLumps()?', building levels and sugar lumps':'')+'.</div>',[['Yes!','Game.ClosePrompt();Game.Ascend(1);'],'No']);3179else3180{3181if (Game.prefs.popups) Game.Popup('Ascending');3182else Game.Notify('Ascending','So long, cookies.',[20,7],4);3183Game.OnAscend=0;Game.removeClass('ascending');3184Game.addClass('ascendIntro');3185//trigger the ascend animation3186Game.AscendTimer=1;3187Game.killShimmers();3188l('toggleBox').style.display='none';3189l('toggleBox').innerHTML='';3190Game.choiceSelectorOn=-1;3191Game.ToggleSpecialMenu(0);3192Game.AscendOffX=0;3193Game.AscendOffY=0;3194Game.AscendOffXT=0;3195Game.AscendOffYT=0;3196Game.AscendZoomT=1;3197Game.AscendZoom=0.2;3198}3199}32003201Game.DebuggingPrestige=0;3202Game.AscendDragX=0;3203Game.AscendDragY=0;3204Game.AscendOffX=0;3205Game.AscendOffY=0;3206Game.AscendZoom=1;3207Game.AscendOffXT=0;3208Game.AscendOffYT=0;3209Game.AscendZoomT=1;3210Game.AscendDragging=0;3211Game.AscendGridSnap=24;3212Game.heavenlyBounds={left:0,right:0,top:0,bottom:0};3213Game.UpdateAscend=function()3214{3215if (Game.keys[37]) Game.AscendOffXT+=16*(1/Game.AscendZoomT);3216if (Game.keys[38]) Game.AscendOffYT+=16*(1/Game.AscendZoomT);3217if (Game.keys[39]) Game.AscendOffXT-=16*(1/Game.AscendZoomT);3218if (Game.keys[40]) Game.AscendOffYT-=16*(1/Game.AscendZoomT);32193220if (Game.AscendOffXT>-Game.heavenlyBounds.left) Game.AscendOffXT=-Game.heavenlyBounds.left;3221if (Game.AscendOffXT<-Game.heavenlyBounds.right) Game.AscendOffXT=-Game.heavenlyBounds.right;3222if (Game.AscendOffYT>-Game.heavenlyBounds.top) Game.AscendOffYT=-Game.heavenlyBounds.top;3223if (Game.AscendOffYT<-Game.heavenlyBounds.bottom) Game.AscendOffYT=-Game.heavenlyBounds.bottom;3224Game.AscendOffX+=(Game.AscendOffXT-Game.AscendOffX)*0.5;3225Game.AscendOffY+=(Game.AscendOffYT-Game.AscendOffY)*0.5;3226Game.AscendZoom+=(Game.AscendZoomT-Game.AscendZoom)*0.25;3227if (Math.abs(Game.AscendZoomT-Game.AscendZoom)<0.005) Game.AscendZoom=Game.AscendZoomT;32283229if (Game.DebuggingPrestige)3230{3231for (var i in Game.PrestigeUpgrades)3232{3233var me=Game.PrestigeUpgrades[i];3234AddEvent(l('heavenlyUpgrade'+me.id),'mousedown',function(me){return function(){3235if (!Game.DebuggingPrestige) return;3236Game.SelectedHeavenlyUpgrade=me;3237}}(me));3238AddEvent(l('heavenlyUpgrade'+me.id),'mouseup',function(me){return function(){3239if (Game.SelectedHeavenlyUpgrade==me) {Game.SelectedHeavenlyUpgrade=0;Game.BuildAscendTree();}3240}}(me));3241}3242}32433244if (Game.mouseDown && !Game.promptOn)3245{3246if (!Game.AscendDragging)3247{3248Game.AscendDragX=Game.mouseX;3249Game.AscendDragY=Game.mouseY;3250}3251Game.AscendDragging=1;32523253if (Game.DebuggingPrestige)3254{3255if (Game.SelectedHeavenlyUpgrade)3256{3257Game.tooltip.hide();3258//drag upgrades around3259var me=Game.SelectedHeavenlyUpgrade;3260me.posX+=(Game.mouseX-Game.AscendDragX)*(1/Game.AscendZoomT);3261me.posY+=(Game.mouseY-Game.AscendDragY)*(1/Game.AscendZoomT);3262var posX=me.posX;//Math.round(me.posX/Game.AscendGridSnap)*Game.AscendGridSnap;3263var posY=me.posY;//Math.round(me.posY/Game.AscendGridSnap)*Game.AscendGridSnap;3264l('heavenlyUpgrade'+me.id).style.left=Math.floor(posX)+'px';3265l('heavenlyUpgrade'+me.id).style.top=Math.floor(posY)+'px';3266for (var ii in me.parents)3267{3268var origX=0;3269var origY=0;3270var targX=me.posX+28;3271var targY=me.posY+28;3272if (me.parents[ii]!=-1) {origX=me.parents[ii].posX+28;origY=me.parents[ii].posY+28;}3273var rot=-(Math.atan((targY-origY)/(origX-targX))/Math.PI)*180;3274if (targX<=origX) rot+=180;3275var dist=Math.floor(Math.sqrt((targX-origX)*(targX-origX)+(targY-origY)*(targY-origY)));3276//l('heavenlyLink'+me.id+'-'+ii).style='width:'+dist+'px;-webkit-transform:rotate('+rot+'deg);-moz-transform:rotate('+rot+'deg);-ms-transform:rotate('+rot+'deg);-o-transform:rotate('+rot+'deg);transform:rotate('+rot+'deg);left:'+(origX)+'px;top:'+(origY)+'px;';3277l('heavenlyLink'+me.id+'-'+ii).style='width:'+dist+'px;transform:rotate('+rot+'deg);left:'+(origX)+'px;top:'+(origY)+'px;';3278}3279}3280}3281if (!Game.SelectedHeavenlyUpgrade)3282{3283Game.AscendOffXT+=(Game.mouseX-Game.AscendDragX)*(1/Game.AscendZoomT);3284Game.AscendOffYT+=(Game.mouseY-Game.AscendDragY)*(1/Game.AscendZoomT);3285}3286Game.AscendDragX=Game.mouseX;3287Game.AscendDragY=Game.mouseY;3288}3289else3290{3291/*if (Game.SelectedHeavenlyUpgrade)3292{3293var me=Game.SelectedHeavenlyUpgrade;3294me.posX=Math.round(me.posX/Game.AscendGridSnap)*Game.AscendGridSnap;3295me.posY=Math.round(me.posY/Game.AscendGridSnap)*Game.AscendGridSnap;3296l('heavenlyUpgrade'+me.id).style.left=me.posX+'px';3297l('heavenlyUpgrade'+me.id).style.top=me.posY+'px';3298}*/3299Game.AscendDragging=0;3300Game.SelectedHeavenlyUpgrade=0;3301}3302if (Game.Click || Game.promptOn)3303{3304Game.AscendDragging=0;3305}33063307//Game.ascendl.style.backgroundPosition=Math.floor(Game.AscendOffX/2)+'px '+Math.floor(Game.AscendOffY/2)+'px';3308//Game.ascendl.style.backgroundPosition=Math.floor(Game.AscendOffX/2)+'px '+Math.floor(Game.AscendOffY/2)+'px,'+Math.floor(Game.AscendOffX/4)+'px '+Math.floor(Game.AscendOffY/4)+'px';3309//Game.ascendContentl.style.left=Math.floor(Game.AscendOffX)+'px';3310//Game.ascendContentl.style.top=Math.floor(Game.AscendOffY)+'px';3311Game.ascendContentl.style.webkitTransform='translate('+Math.floor(Game.AscendOffX)+'px,'+Math.floor(Game.AscendOffY)+'px)';3312Game.ascendContentl.style.msTransform='translate('+Math.floor(Game.AscendOffX)+'px,'+Math.floor(Game.AscendOffY)+'px)';3313Game.ascendContentl.style.oTransform='translate('+Math.floor(Game.AscendOffX)+'px,'+Math.floor(Game.AscendOffY)+'px)';3314Game.ascendContentl.style.mozTransform='translate('+Math.floor(Game.AscendOffX)+'px,'+Math.floor(Game.AscendOffY)+'px)';3315Game.ascendContentl.style.transform='translate('+Math.floor(Game.AscendOffX)+'px,'+Math.floor(Game.AscendOffY)+'px)';3316Game.ascendZoomablel.style.webkitTransform='scale('+(Game.AscendZoom)+','+(Game.AscendZoom)+')';3317Game.ascendZoomablel.style.msTransform='scale('+(Game.AscendZoom)+','+(Game.AscendZoom)+')';3318Game.ascendZoomablel.style.oTransform='scale('+(Game.AscendZoom)+','+(Game.AscendZoom)+')';3319Game.ascendZoomablel.style.mozTransform='scale('+(Game.AscendZoom)+','+(Game.AscendZoom)+')';3320Game.ascendZoomablel.style.transform='scale('+(Game.AscendZoom)+','+(Game.AscendZoom)+')';33213322//if (Game.Scroll!=0) Game.ascendContentl.style.transformOrigin=Math.floor(Game.windowW/2-Game.mouseX)+'px '+Math.floor(Game.windowH/2-Game.mouseY)+'px';3323if (Game.Scroll<0 && !Game.promptOn) {Game.AscendZoomT=0.5;}3324if (Game.Scroll>0 && !Game.promptOn) {Game.AscendZoomT=1;}33253326if (Game.T%2==0)3327{3328l('ascendPrestige').innerHTML='Prestige level :<br>'+Beautify(Game.prestige);3329l('ascendHCs').innerHTML='Heavenly chips :<br><span class="price heavenly">'+Beautify(Math.round(Game.heavenlyChipsDisplayed))+'</span>';3330if (Game.prestige>0) l('ascendModeButton').style.display='block';3331else l('ascendModeButton').style.display='none';3332}3333Game.heavenlyChipsDisplayed+=(Game.heavenlyChips-Game.heavenlyChipsDisplayed)*0.4;33343335if (Game.DebuggingPrestige && Game.T%10==0)3336{3337var str='';3338for (var i in Game.PrestigeUpgrades)3339{3340var me=Game.PrestigeUpgrades[i];3341str+=me.id+':['+Math.floor(me.posX)+','+Math.floor(me.posY)+'],';3342}3343l('upgradePositions').value='Game.UpgradePositions={'+str+'};';3344}3345//if (Game.T%5==0) Game.BuildAscendTree();3346}3347Game.AscendRefocus=function()3348{3349Game.AscendOffX=0;3350Game.AscendOffY=0;3351Game.ascendl.className='';3352}33533354Game.SelectedHeavenlyUpgrade=0;3355Game.PurchaseHeavenlyUpgrade=function(what)3356{3357//if (Game.Has('Neuromancy')) Game.UpgradesById[what].toggle(); else3358if (Game.UpgradesById[what].buy())3359{3360if (l('heavenlyUpgrade'+what)){var rect=l('heavenlyUpgrade'+what).getBoundingClientRect();Game.SparkleAt((rect.left+rect.right)/2,(rect.top+rect.bottom)/2-24);}3361//Game.BuildAscendTree();3362}3363}3364Game.BuildAscendTree=function()3365{3366var str='';3367Game.heavenlyBounds={left:0,right:0,top:0,bottom:0};33683369if (Game.DebuggingPrestige) l('upgradePositions').style.display='block'; else l('upgradePositions').style.display='none';33703371for (var i in Game.PrestigeUpgrades)3372{3373var me=Game.PrestigeUpgrades[i];3374me.canBePurchased=1;3375if (!me.bought && !Game.DebuggingPrestige)3376{3377if (me.showIf && !me.showIf()) me.canBePurchased=0;3378else3379{3380for (var ii in me.parents)3381{3382if (me.parents[ii]!=-1 && !me.parents[ii].bought) me.canBePurchased=0;3383}3384}3385}3386}3387str+='<div class="crateBox" style="filter:none;-webkit-filter:none;">';//chrome is still bad at these3388for (var i in Game.PrestigeUpgrades)3389{3390var me=Game.PrestigeUpgrades[i];33913392var ghosted=0;3393if (me.canBePurchased || Game.Has('Neuromancy'))3394{3395str+=Game.crate(me,'ascend','Game.PurchaseHeavenlyUpgrade('+me.id+');','heavenlyUpgrade'+me.id);3396}3397else3398{3399for (var ii in me.parents)3400{3401if (me.parents[ii]!=-1 && me.parents[ii].canBePurchased) ghosted=1;3402}3403if (me.showIf && !me.showIf()) ghosted=0;3404if (ghosted)3405{3406//maybe replace this with Game.crate()3407str+='<div class="crate upgrade heavenly ghosted" id="heavenlyUpgrade'+me.id+'" style="position:absolute;left:'+me.posX+'px;top:'+me.posY+'px;'+(me.icon[2]?'background-image:url('+me.icon[2]+');':'')+'background-position:'+(-me.icon[0]*48)+'px '+(-me.icon[1]*48)+'px;"></div>';3408}3409}3410if (me.canBePurchased || Game.Has('Neuromancy') || ghosted)3411{3412if (me.posX<Game.heavenlyBounds.left) Game.heavenlyBounds.left=me.posX;3413if (me.posX>Game.heavenlyBounds.right) Game.heavenlyBounds.right=me.posX;3414if (me.posY<Game.heavenlyBounds.top) Game.heavenlyBounds.top=me.posY;3415if (me.posY>Game.heavenlyBounds.bottom) Game.heavenlyBounds.bottom=me.posY;3416}3417for (var ii in me.parents)//create pulsing links3418{3419if (me.parents[ii]!=-1 && (me.canBePurchased || ghosted))3420{3421var origX=0;3422var origY=0;3423var targX=me.posX+28;3424var targY=me.posY+28;3425if (me.parents[ii]!=-1) {origX=me.parents[ii].posX+28;origY=me.parents[ii].posY+28;}3426var rot=-(Math.atan((targY-origY)/(origX-targX))/Math.PI)*180;3427if (targX<=origX) rot+=180;3428var dist=Math.floor(Math.sqrt((targX-origX)*(targX-origX)+(targY-origY)*(targY-origY)));3429str+='<div class="parentLink" id="heavenlyLink'+me.id+'-'+ii+'" style="'+(ghosted?'opacity:0.1;':'')+'width:'+dist+'px;-webkit-transform:rotate('+rot+'deg);-moz-transform:rotate('+rot+'deg);-ms-transform:rotate('+rot+'deg);-o-transform:rotate('+rot+'deg);transform:rotate('+rot+'deg);left:'+(origX)+'px;top:'+(origY)+'px;"></div>';3430}3431}3432}3433Game.heavenlyBounds.left-=128;3434Game.heavenlyBounds.top-=128;3435Game.heavenlyBounds.right+=128+64;3436Game.heavenlyBounds.bottom+=128+64;3437//str+='<div style="border:1px solid red;position:absolute;left:'+Game.heavenlyBounds.left+'px;width:'+(Game.heavenlyBounds.right-Game.heavenlyBounds.left)+'px;top:'+Game.heavenlyBounds.top+'px;height:'+(Game.heavenlyBounds.bottom-Game.heavenlyBounds.top)+'px;"></div>';3438str+='</div>';3439Game.ascendUpgradesl.innerHTML=str;3440}344134423443/*=====================================================================================3444COALESCING SUGAR LUMPS3445=======================================================================================*/3446Game.lumpMatureAge=1;3447Game.lumpRipeAge=1;3448Game.lumpOverripeAge=1;3449Game.lumpCurrentType=0;3450l('comments').innerHTML=l('comments').innerHTML+3451'<div id="lumps" onclick="Game.clickLump();" '+Game.getDynamicTooltip('Game.lumpTooltip','bottom')+'><div id="lumpsIcon" class="usesIcon"></div><div id="lumpsIcon2" class="usesIcon"></div><div id="lumpsAmount">0</div></div>';3452Game.lumpTooltip=function()3453{3454var str='<div style="padding:8px;width:400px;font-size:11px;text-align:center;">'+3455'You have <span class="price lump">'+Beautify(Game.lumps)+' sugar lump'+(Game.lumps==1?'':'s')+'</span>.'+3456'<div class="line"></div>'+3457'A <b>sugar lump</b> is coalescing here, attracted by your accomplishments.';34583459var age=Date.now()-Game.lumpT;3460str+='<div class="line"></div>';3461if (age<Game.lumpMatureAge) str+='This sugar lump is still growing and will take <b>'+Game.sayTime(((Game.lumpMatureAge-age)/1000+1)*Game.fps,-1)+'</b> to reach maturity.';3462else if (age<Game.lumpRipeAge) str+='This sugar lump is mature and will be ripe in <b>'+Game.sayTime(((Game.lumpRipeAge-age)/1000+1)*Game.fps,-1)+'</b>.<br>You may <b>click it to harvest it now</b>, but there is a <b>50% chance you won\'t get anything</b>.';3463else if (age<Game.lumpOverripeAge) str+='<b>This sugar lump is ripe! Click it to harvest it.</b><br>If you do nothing, it will auto-harvest in <b>'+Game.sayTime(((Game.lumpOverripeAge-age)/1000+1)*Game.fps,-1)+'</b>.';34643465var phase=(age/Game.lumpOverripeAge)*7;3466if (phase>=3)3467{3468if (Game.lumpCurrentType!=0) str+='<div class="line"></div>';3469if (Game.lumpCurrentType==1) str+='This sugar lump grew to be <b>bifurcated</b>; harvesting it has a 50% chance of yielding two lumps.';3470else if (Game.lumpCurrentType==2) str+='This sugar lump grew to be <b>golden</b>; harvesting it will yield 2 to 7 lumps, your current cookies will be doubled (capped to a gain of 24 hours of your CpS), and you will find 10% more golden cookies for the next 24 hours.';3471else if (Game.lumpCurrentType==3) str+='This sugar lump was affected by the elders and grew to be <b>meaty</b>; harvesting it will yield between 0 and 2 lumps.';3472else if (Game.lumpCurrentType==4) str+='This sugar lump is <b>caramelized</b>, its stickiness binding it to unexpected things; harvesting it will yield between 1 and 3 lumps and will refill your sugar lump cooldowns.';3473}34743475str+='<div class="line"></div>';3476str+='Your sugar lumps mature after <b>'+Game.sayTime((Game.lumpMatureAge/1000)*Game.fps,-1)+'</b>,<br>ripen after <b>'+Game.sayTime((Game.lumpRipeAge/1000)*Game.fps,-1)+'</b>,<br>and fall after <b>'+Game.sayTime((Game.lumpOverripeAge/1000)*Game.fps,-1)+'</b>.';34773478str+='<div class="line"></div>'+3479'• Sugar lumps can be harvested when mature, though if left alone beyond that point they will start ripening (increasing the chance of harvesting them) and will eventually fall and be auto-harvested after some time.<br>• Sugar lumps are delicious and may be used as currency for all sorts of things.<br>• Once a sugar lump is harvested, another one will start growing in its place.<br>• Note that sugar lumps keep growing when the game is closed.';34803481str+='</div>';3482return str;3483}3484Game.computeLumpTimes=function()3485{3486var hour=1000*60*60;3487Game.lumpMatureAge=hour*20;3488Game.lumpRipeAge=hour*23;3489if (Game.Has('Stevia Caelestis')) Game.lumpRipeAge-=hour;3490if (Game.Has('Diabetica Daemonicus')) Game.lumpMatureAge-=hour;3491if (Game.Has('Ichor syrup')) Game.lumpMatureAge-=1000*60*7;3492if (Game.Has('Sugar aging process')) Game.lumpRipeAge-=6000*Math.min(600,Game.Objects['Grandma'].amount);//capped at 600 grandmas3493if (Game.hasGod && Game.BuildingsOwned%10==0)3494{3495var godLvl=Game.hasGod('order');3496if (godLvl==1) Game.lumpRipeAge-=hour;3497else if (godLvl==2) Game.lumpRipeAge-=(hour/3)*2;3498else if (godLvl==3) Game.lumpRipeAge-=(hour/3);3499}3500//if (Game.hasAura('Dragon\'s Curve')) {Game.lumpMatureAge/=1.05;Game.lumpRipeAge/=1.05;}3501Game.lumpMatureAge/=1+Game.auraMult('Dragon\'s Curve')*0.05;Game.lumpRipeAge/=1+Game.auraMult('Dragon\'s Curve')*0.05;3502Game.lumpOverripeAge=Game.lumpRipeAge+hour;3503if (Game.Has('Glucose-charged air')) {Game.lumpMatureAge/=2000;Game.lumpRipeAge/=2000;Game.lumpOverripeAge/=2000;}3504}3505Game.loadLumps=function(time)3506{3507Game.computeLumpTimes();3508//Game.computeLumpType();3509if (!Game.canLumps()) Game.removeClass('lumpsOn');3510else3511{3512if (Game.ascensionMode!=1) Game.addClass('lumpsOn');3513Game.lumpT=Math.min(Date.now(),Game.lumpT);3514var age=Math.max(Date.now()-Game.lumpT,0);3515var amount=Math.floor(age/Game.lumpOverripeAge);//how many lumps did we harvest since we closed the game?3516if (amount>=1)3517{3518Game.harvestLumps(1,true);3519Game.lumpCurrentType=0;//all offline lumps after the first one have a normal type3520if (amount>1) Game.harvestLumps(amount-1,true);3521if (Game.prefs.popups) Game.Popup('Harvested '+Beautify(amount)+' sugar lump'+(amount==1?'':'s')+' while you were away');3522else Game.Notify('','You harvested <b>'+Beautify(amount)+'</b> sugar lump'+(amount==1?'':'s')+' while you were away.',[29,14]);3523Game.lumpT=Date.now()-(age-amount*Game.lumpOverripeAge);3524Game.computeLumpType();3525}3526}3527}3528Game.gainLumps=function(total)3529{3530if (Game.lumpsTotal==-1){Game.lumpsTotal=0;Game.lumps=0;}3531Game.lumps+=total;3532Game.lumpsTotal+=total;35333534if (Game.lumpsTotal>=7) Game.Win('Dude, sweet');3535if (Game.lumpsTotal>=30) Game.Win('Sugar rush');3536if (Game.lumpsTotal>=365) Game.Win('Year\'s worth of cavities');3537}3538Game.clickLump=function()3539{3540if (!Game.canLumps()) return;3541var age=Date.now()-Game.lumpT;3542if (age<Game.lumpMatureAge) {}3543else if (age<Game.lumpRipeAge)3544{3545var amount=choose([0,1]);3546if (amount!=0) Game.Win('Hand-picked');3547Game.harvestLumps(amount);3548Game.computeLumpType();3549}3550else if (age<Game.lumpOverripeAge)3551{3552Game.harvestLumps(1);3553Game.computeLumpType();3554}3555}3556Game.harvestLumps=function(amount,silent)3557{3558if (!Game.canLumps()) return;3559Game.lumpT=Date.now();3560var total=amount;3561if (Game.lumpCurrentType==1 && Game.Has('Sucralosia Inutilis') && Math.random()<0.05) total*=2;3562else if (Game.lumpCurrentType==1) total*=choose([1,2]);3563else if (Game.lumpCurrentType==2)3564{3565total*=choose([2,3,4,5,6,7]);3566Game.gainBuff('sugar blessing',24*60*60,1);3567Game.Earn(Math.min(Game.cookiesPs*60*60*24,Game.cookies));3568if (Game.prefs.popups) Game.Popup('Sugar blessing activated!');3569else Game.Notify('Sugar blessing activated!','Your cookies have been doubled.<br>+10% golden cookies for the next 24 hours.',[29,16]);3570}3571else if (Game.lumpCurrentType==3) total*=choose([0,0,1,2,2]);3572else if (Game.lumpCurrentType==4)3573{3574total*=choose([1,2,3]);3575Game.lumpRefill=Date.now()-Game.getLumpRefillMax();3576if (Game.prefs.popups) Game.Popup('Sugar lump cooldowns cleared!');3577else Game.Notify('Sugar lump cooldowns cleared!','',[29,27]);3578}3579total=Math.floor(total);3580Game.gainLumps(total);3581if (Game.lumpCurrentType==1) Game.Win('Sugar sugar');3582else if (Game.lumpCurrentType==2) Game.Win('All-natural cane sugar');3583else if (Game.lumpCurrentType==3) Game.Win('Sweetmeats');3584else if (Game.lumpCurrentType==4) Game.Win('Maillard reaction');35853586if (!silent)3587{3588var rect=l('lumpsIcon2').getBoundingClientRect();Game.SparkleAt((rect.left+rect.right)/2,(rect.top+rect.bottom)/2-24);3589if (total>0) Game.Popup('<small>+'+Beautify(total)+' sugar lump'+(total==1?'':'s')+'</small>',(rect.left+rect.right)/2,(rect.top+rect.bottom)/2-48);3590else Game.Popup('<small>Botched harvest!</small>',(rect.left+rect.right)/2,(rect.top+rect.bottom)/2-48);3591PlaySound('snd/pop'+Math.floor(Math.random()*3+1)+'.mp3',0.75);3592}3593Game.computeLumpTimes();3594}3595Game.computeLumpType=function()3596{3597Math.seedrandom(Game.seed+'/'+Game.lumpT);3598var types=[0];3599var loop=1;3600//if (Game.hasAura('Dragon\'s Curve')) loop=2;3601loop+=Game.auraMult('Dragon\'s Curve');3602loop=randomFloor(loop);3603for (var i=0;i<loop;i++)3604{3605if (Math.random()<(Game.Has('Sucralosia Inutilis')?0.15:0.1)) types.push(1);//bifurcated3606if (Math.random()<3/1000) types.push(2);//golden3607if (Math.random()<0.1*Game.elderWrath) types.push(3);//meaty3608if (Math.random()<1/50) types.push(4);//caramelized3609}3610Game.lumpCurrentType=choose(types);3611Math.seedrandom();3612}36133614Game.canLumps=function()//grammatically pleasing function name3615{3616if (Game.lumpsTotal>-1 || (Game.ascensionMode!=1 && (Game.cookiesEarned+Game.cookiesReset)>=1000000000)) return true;3617return false;3618}36193620Game.getLumpRefillMax=function()3621{3622return 1000*60*15;//15 minutes3623}3624Game.getLumpRefillRemaining=function()3625{3626return Game.getLumpRefillMax()-(Date.now()-Game.lumpRefill);3627}3628Game.canRefillLump=function()3629{3630return ((Date.now()-Game.lumpRefill)>=Game.getLumpRefillMax());3631}3632Game.refillLump=function(n,func)3633{3634if (Game.lumps>=n && Game.canRefillLump())3635{3636Game.spendLump(n,'refill',function()3637{3638if (!Game.sesame) Game.lumpRefill=Date.now();3639func();3640})();3641}3642}3643Game.spendLump=function(n,str,func)3644{3645//ask if we want to spend N lumps3646return function()3647{3648if (Game.lumps<n) return false;3649if (Game.prefs.askLumps)3650{3651PlaySound('snd/tick.mp3');3652Game.promptConfirmFunc=func;//bit dumb3653Game.Prompt('<div class="icon" style="background:url(img/icons.png?v='+Game.version+');float:left;margin-left:-8px;margin-top:-8px;background-position:'+(-29*48)+'px '+(-14*48)+'px;"></div><div style="margin:16px 8px;">Do you want to spend <b>'+Beautify(n)+' lump'+(n!=1?'s':'')+'</b> to '+str+'?</div>',[['Yes','Game.lumps-='+n+';Game.promptConfirmFunc();Game.promptConfirmFunc=0;Game.recalculateGains=1;Game.ClosePrompt();'],'No']);3654return false;3655}3656else3657{3658Game.lumps-=n;3659func();3660Game.recalculateGains=1;3661}3662}3663}36643665Game.doLumps=function()3666{3667if (!Game.canLumps()) {Game.removeClass('lumpsOn');return;}3668if (Game.lumpsTotal==-1)3669{3670//first time !3671if (Game.ascensionMode!=1) Game.addClass('lumpsOn');3672Game.lumpT-Date.now();3673Game.lumpsTotal=0;3674Game.lumps=0;3675Game.computeLumpType();36763677Game.Notify('Sugar lumps!','Because you\'ve baked a <b>billion cookies</b> in total, you are now attracting <b>sugar lumps</b>. They coalesce quietly near the top of your screen, under the Stats button.<br>You will be able to harvest them when they\'re ripe, after which you may spend them on all sorts of things!',[23,14]);3678}3679var age=Date.now()-Game.lumpT;3680if (age>Game.lumpOverripeAge)3681{3682age=0;3683Game.harvestLumps(1);3684Game.computeLumpType();3685}36863687var phase=Math.min(6,Math.floor((age/Game.lumpOverripeAge)*7));3688var phase2=Math.min(6,Math.floor((age/Game.lumpOverripeAge)*7)+1);3689var row=14;3690var row2=14;3691var type=Game.lumpCurrentType;3692if (type==1)//double3693{3694//if (phase>=6) row=15;3695if (phase2>=6) row2=15;3696}3697else if (type==2)//golden3698{3699if (phase>=4) row=16;3700if (phase2>=4) row2=16;3701}3702else if (type==3)//meaty3703{3704if (phase>=4) row=17;3705if (phase2>=4) row2=17;3706}3707else if (type==4)//caramelized3708{3709if (phase>=4) row=27;3710if (phase2>=4) row2=27;3711}3712var icon=[23+Math.min(phase,5),row];3713var icon2=[23+phase2,row2];3714var opacity=Math.min(6,(age/Game.lumpOverripeAge)*7)%1;3715if (phase>=6) {opacity=1;}3716l('lumpsIcon').style.backgroundPosition=(-icon[0]*48)+'px '+(-icon[1]*48)+'px';3717l('lumpsIcon2').style.backgroundPosition=(-icon2[0]*48)+'px '+(-icon2[1]*48)+'px';3718l('lumpsIcon2').style.opacity=opacity;3719l('lumpsAmount').innerHTML=Beautify(Game.lumps);3720}37213722/*=====================================================================================3723COOKIE ECONOMICS3724=======================================================================================*/3725Game.Earn=function(howmuch)3726{3727Game.cookies+=howmuch;3728Game.cookiesEarned+=howmuch;3729}3730Game.Spend=function(howmuch)3731{3732Game.cookies-=howmuch;3733}3734Game.Dissolve=function(howmuch)3735{3736Game.cookies-=howmuch;3737Game.cookiesEarned-=howmuch;3738Game.cookies=Math.max(0,Game.cookies);3739Game.cookiesEarned=Math.max(0,Game.cookiesEarned);3740}3741Game.mouseCps=function()3742{3743var add=0;3744if (Game.Has('Thousand fingers')) add+= 0.1;3745if (Game.Has('Million fingers')) add+= 0.5;3746if (Game.Has('Billion fingers')) add+= 5;3747if (Game.Has('Trillion fingers')) add+= 50;3748if (Game.Has('Quadrillion fingers')) add+= 500;3749if (Game.Has('Quintillion fingers')) add+= 5000;3750if (Game.Has('Sextillion fingers')) add+= 50000;3751if (Game.Has('Septillion fingers')) add+= 500000;3752if (Game.Has('Octillion fingers')) add+= 5000000;3753var num=0;3754for (var i in Game.Objects) {num+=Game.Objects[i].amount;}3755num-=Game.Objects['Cursor'].amount;3756add=add*num;3757if (Game.Has('Plastic mouse')) add+=Game.cookiesPs*0.01;3758if (Game.Has('Iron mouse')) add+=Game.cookiesPs*0.01;3759if (Game.Has('Titanium mouse')) add+=Game.cookiesPs*0.01;3760if (Game.Has('Adamantium mouse')) add+=Game.cookiesPs*0.01;3761if (Game.Has('Unobtainium mouse')) add+=Game.cookiesPs*0.01;3762if (Game.Has('Eludium mouse')) add+=Game.cookiesPs*0.01;3763if (Game.Has('Wishalloy mouse')) add+=Game.cookiesPs*0.01;3764if (Game.Has('Fantasteel mouse')) add+=Game.cookiesPs*0.01;3765if (Game.Has('Nevercrack mouse')) add+=Game.cookiesPs*0.01;3766if (Game.Has('Armythril mouse')) add+=Game.cookiesPs*0.01;3767if (Game.Has('Technobsidian mouse')) add+=Game.cookiesPs*0.01;3768if (Game.Has('Plasmarble mouse')) add+=Game.cookiesPs*0.01;37693770if (Game.Has('Fortune #104')) add+=Game.cookiesPs*0.01;3771var mult=1;37723773for (var i in Game.customMouseCps) {mult+=Game.customMouseCps[i]();}37743775if (Game.Has('Santa\'s helpers')) mult*=1.1;3776if (Game.Has('Cookie egg')) mult*=1.1;3777if (Game.Has('Halo gloves')) mult*=1.1;37783779mult*=Game.eff('click');37803781if (Game.hasGod)3782{3783var godLvl=Game.hasGod('labor');3784if (godLvl==1) mult*=1.15;3785else if (godLvl==2) mult*=1.1;3786else if (godLvl==3) mult*=1.05;3787}37883789for (var i in Game.buffs)3790{3791if (typeof Game.buffs[i].multClick != 'undefined') mult*=Game.buffs[i].multClick;3792}37933794//if (Game.hasAura('Dragon Cursor')) mult*=1.05;3795mult*=1+Game.auraMult('Dragon Cursor')*0.05;37963797for (var i in Game.customMouseCpsMult) {mult*=Game.customMouseCpsMult[i]();}37983799var out=mult*Game.ComputeCps(1,Game.Has('Reinforced index finger')+Game.Has('Carpal tunnel prevention cream')+Game.Has('Ambidextrous'),add);38003801if (Game.hasBuff('Cursed finger')) out=Game.buffs['Cursed finger'].power;3802return out;3803}3804Game.computedMouseCps=1;3805Game.globalCpsMult=1;3806Game.unbuffedCps=0;3807Game.lastClick=0;3808Game.CanClick=1;3809Game.autoclickerDetected=0;3810Game.BigCookieState=0;//0 = normal, 1 = clicked (small), 2 = released/hovered (big)3811Game.BigCookieSize=0;3812Game.BigCookieSizeD=0;3813Game.BigCookieSizeT=1;3814Game.cookieClickSound=Math.floor(Math.random()*7)+1;3815Game.playCookieClickSound=function()3816{3817if (Game.prefs.cookiesound) PlaySound('snd/clickb'+(Game.cookieClickSound)+'.mp3',0.5);3818else PlaySound('snd/click'+(Game.cookieClickSound)+'.mp3',0.5);3819Game.cookieClickSound+=Math.floor(Math.random()*4)+1;3820if (Game.cookieClickSound>7) Game.cookieClickSound-=7;3821}3822Game.ClickCookie=function(e,amount)3823{3824var now=Date.now();3825if (e) e.preventDefault();3826if (Game.OnAscend || Game.AscendTimer>0) {}3827else if (now-Game.lastClick<1000/250) {}3828else3829{3830if (now-Game.lastClick<1000/15)3831{3832Game.autoclickerDetected+=Game.fps;3833if (Game.autoclickerDetected>=Game.fps*5) Game.Win('Uncanny clicker');3834}3835Game.loseShimmeringVeil('click');3836var amount=amount?amount:Game.computedMouseCps;3837Game.Earn(amount);3838Game.handmadeCookies+=amount;3839if (Game.prefs.particles)3840{3841Game.particleAdd();3842Game.particleAdd(Game.mouseX,Game.mouseY,Math.random()*4-2,Math.random()*-2-2,Math.random()*0.5+0.75,1,2);3843}3844if (Game.prefs.numbers) Game.particleAdd(Game.mouseX+Math.random()*8-4,Game.mouseY-8+Math.random()*8-4,0,-2,1,4,2,'','+'+Beautify(amount,1));38453846for (var i in Game.customCookieClicks) {Game.customCookieClicks[i]();}38473848Game.playCookieClickSound();3849Game.cookieClicks++;3850}3851Game.lastClick=now;3852Game.Click=0;3853}3854Game.mouseX=0;3855Game.mouseY=0;3856Game.mouseX2=0;3857Game.mouseY2=0;3858Game.mouseMoved=0;3859Game.GetMouseCoords=function(e)3860{3861var posx=0;3862var posy=0;3863if (!e) var e=window.event;3864if (e.pageX||e.pageY)3865{3866posx=e.pageX;3867posy=e.pageY;3868}3869else if (e.clientX || e.clientY)3870{3871posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;3872posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;3873}3874var x=0;3875var y=32;3876/*3877var el=l('sectionLeft');3878while(el && !isNaN(el.offsetLeft) && !isNaN(el.offsetTop))3879{3880x+=el.offsetLeft-el.scrollLeft;3881y+=el.offsetTop-el.scrollTop;3882el=el.offsetParent;3883}*/3884Game.mouseX2=Game.mouseX;3885Game.mouseY2=Game.mouseY;3886Game.mouseX=posx-x;3887Game.mouseY=posy-y;3888Game.mouseMoved=1;3889Game.lastActivity=Game.time;3890}3891var bigCookie=l('bigCookie');3892Game.Click=0;3893Game.lastClickedEl=0;3894Game.clickFrom=0;3895Game.Scroll=0;3896Game.mouseDown=0;3897if (!Game.touchEvents)3898{3899AddEvent(bigCookie,'click',Game.ClickCookie);3900AddEvent(bigCookie,'mousedown',function(event){Game.BigCookieState=1;if (Game.prefs.cookiesound) {Game.playCookieClickSound();}if (event) event.preventDefault();});3901AddEvent(bigCookie,'mouseup',function(event){Game.BigCookieState=2;if (event) event.preventDefault();});3902AddEvent(bigCookie,'mouseout',function(event){Game.BigCookieState=0;});3903AddEvent(bigCookie,'mouseover',function(event){Game.BigCookieState=2;});3904AddEvent(document,'mousemove',Game.GetMouseCoords);3905AddEvent(document,'mousedown',function(event){Game.lastActivity=Game.time;Game.mouseDown=1;Game.clickFrom=event.target;});3906AddEvent(document,'mouseup',function(event){Game.lastActivity=Game.time;Game.mouseDown=0;Game.clickFrom=0;});3907AddEvent(document,'click',function(event){Game.lastActivity=Game.time;Game.Click=1;Game.lastClickedEl=event.target;Game.clickFrom=0;});3908Game.handleScroll=function(e)3909{3910if (!e) e=event;3911Game.Scroll=(e.detail<0||e.wheelDelta>0)?1:-1;3912Game.lastActivity=Game.time;3913};3914AddEvent(document,'DOMMouseScroll',Game.handleScroll);3915AddEvent(document,'mousewheel',Game.handleScroll);3916}3917else3918{3919//touch events3920AddEvent(bigCookie,'touchend',Game.ClickCookie);3921AddEvent(bigCookie,'touchstart',function(event){Game.BigCookieState=1;if (event) event.preventDefault();});3922AddEvent(bigCookie,'touchend',function(event){Game.BigCookieState=0;if (event) event.preventDefault();});3923//AddEvent(document,'touchmove',Game.GetMouseCoords);3924AddEvent(document,'mousemove',Game.GetMouseCoords);3925AddEvent(document,'touchstart',function(event){Game.lastActivity=Game.time;Game.mouseDown=1;});3926AddEvent(document,'touchend',function(event){Game.lastActivity=Game.time;Game.mouseDown=0;});3927AddEvent(document,'touchend',function(event){Game.lastActivity=Game.time;Game.Click=1;});3928}39293930Game.keys=[];3931AddEvent(window,'keyup',function(e){3932Game.lastActivity=Game.time;3933if (e.keyCode==27)3934{3935Game.ClosePrompt();3936if (Game.AscendTimer>0) Game.AscendTimer=Game.AscendDuration;3937}//esc closes prompt3938else if (e.keyCode==13) Game.ConfirmPrompt();//enter confirms prompt3939Game.keys[e.keyCode]=0;3940});3941AddEvent(window,'keydown',function(e){3942if (!Game.OnAscend && Game.AscendTimer==0)3943{3944if (e.ctrlKey && e.keyCode==83) {Game.toSave=true;e.preventDefault();}//ctrl-s saves the game3945else if (e.ctrlKey && e.keyCode==79) {Game.ImportSave();e.preventDefault();}//ctrl-o opens the import menu3946}3947if ((e.keyCode==16 || e.keyCode==17) && Game.tooltip.dynamic) Game.tooltip.update();3948Game.keys[e.keyCode]=1;3949});39503951AddEvent(window,'visibilitychange',function(e){3952Game.keys=[];//reset all key pressed on visibility change (should help prevent ctrl still being down after ctrl-tab)3953});39543955/*=====================================================================================3956CPS RECALCULATOR3957=======================================================================================*/39583959Game.heavenlyPower=1;//how many CpS percents a single heavenly chip gives3960Game.recalculateGains=1;3961Game.cookiesPsByType={};3962Game.cookiesMultByType={};3963//display bars with http://codepen.io/anon/pen/waGyEJ3964Game.effs={};3965Game.eff=function(name,def){if (typeof Game.effs[name]==='undefined') return (typeof def==='undefined'?1:def); else return Game.effs[name];};39663967Game.CalculateGains=function()3968{3969Game.cookiesPs=0;3970var mult=1;3971//add up effect bonuses from building minigames3972var effs={};3973for (var i in Game.Objects)3974{3975if (Game.Objects[i].minigameLoaded && Game.Objects[i].minigame.effs)3976{3977var myEffs=Game.Objects[i].minigame.effs;3978for (var ii in myEffs)3979{3980if (effs[ii]) effs[ii]*=myEffs[ii];3981else effs[ii]=myEffs[ii];3982}3983}3984}3985Game.effs=effs;39863987if (Game.ascensionMode!=1) mult+=parseFloat(Game.prestige)*0.01*Game.heavenlyPower*Game.GetHeavenlyMultiplier();39883989mult*=Game.eff('cps');39903991if (Game.Has('Heralds') && Game.ascensionMode!=1) mult*=1+0.01*Game.heralds;39923993var cookieMult=0;3994for (var i in Game.cookieUpgrades)3995{3996var me=Game.cookieUpgrades[i];3997if (Game.Has(me.name))3998{3999mult*=(1+(typeof(me.power)=='function'?me.power(me):me.power)*0.01);4000}4001}4002mult*=(1+0.01*cookieMult);40034004if (Game.Has('Specialized chocolate chips')) mult*=1.01;4005if (Game.Has('Designer cocoa beans')) mult*=1.02;4006if (Game.Has('Underworld ovens')) mult*=1.03;4007if (Game.Has('Exotic nuts')) mult*=1.04;4008if (Game.Has('Arcane sugar')) mult*=1.05;40094010if (Game.Has('Increased merriness')) mult*=1.15;4011if (Game.Has('Improved jolliness')) mult*=1.15;4012if (Game.Has('A lump of coal')) mult*=1.01;4013if (Game.Has('An itchy sweater')) mult*=1.01;4014if (Game.Has('Santa\'s dominion')) mult*=1.2;40154016if (Game.Has('Fortune #100')) mult*=1.01;4017if (Game.Has('Fortune #101')) mult*=1.07;40184019var buildMult=1;4020if (Game.hasGod)4021{4022var godLvl=Game.hasGod('asceticism');4023if (godLvl==1) mult*=1.15;4024else if (godLvl==2) mult*=1.1;4025else if (godLvl==3) mult*=1.05;40264027var godLvl=Game.hasGod('ages');4028if (godLvl==1) mult*=1+0.15*Math.sin((Date.now()/1000/(60*60*3))*Math.PI*2);4029else if (godLvl==2) mult*=1+0.15*Math.sin((Date.now()/1000/(60*60*12))*Math.PI*2);4030else if (godLvl==3) mult*=1+0.15*Math.sin((Date.now()/1000/(60*60*24))*Math.PI*2);40314032var godLvl=Game.hasGod('decadence');4033if (godLvl==1) buildMult*=0.93;4034else if (godLvl==2) buildMult*=0.95;4035else if (godLvl==3) buildMult*=0.98;40364037var godLvl=Game.hasGod('industry');4038if (godLvl==1) buildMult*=1.1;4039else if (godLvl==2) buildMult*=1.06;4040else if (godLvl==3) buildMult*=1.03;40414042var godLvl=Game.hasGod('labor');4043if (godLvl==1) buildMult*=0.97;4044else if (godLvl==2) buildMult*=0.98;4045else if (godLvl==3) buildMult*=0.99;4046}40474048if (Game.Has('Santa\'s legacy')) mult*=1+(Game.santaLevel+1)*0.03;40494050for (var i in Game.Objects)4051{4052var me=Game.Objects[i];4053me.storedCps=(typeof(me.cps)=='function'?me.cps(me):me.cps);4054if (Game.ascensionMode!=1) me.storedCps*=(1+me.level*0.01)*buildMult;4055me.storedTotalCps=me.amount*me.storedCps;4056Game.cookiesPs+=me.storedTotalCps;4057Game.cookiesPsByType[me.name]=me.storedTotalCps;4058}40594060if (Game.Has('"egg"')) {Game.cookiesPs+=9;Game.cookiesPsByType['"egg"']=9;}//"egg"40614062for (var i in Game.customCps) {mult*=Game.customCps[i]();}40634064Game.milkProgress=Game.AchievementsOwned/25;4065var milkMult=1;4066if (Game.Has('Santa\'s milk and cookies')) milkMult*=1.05;4067//if (Game.hasAura('Breath of Milk')) milkMult*=1.05;4068milkMult*=1+Game.auraMult('Breath of Milk')*0.05;4069if (Game.hasGod)4070{4071var godLvl=Game.hasGod('mother');4072if (godLvl==1) milkMult*=1.1;4073else if (godLvl==2) milkMult*=1.05;4074else if (godLvl==3) milkMult*=1.03;4075}4076milkMult*=Game.eff('milk');40774078var catMult=1;40794080if (Game.Has('Kitten helpers')) catMult*=(1+Game.milkProgress*0.1*milkMult);4081if (Game.Has('Kitten workers')) catMult*=(1+Game.milkProgress*0.125*milkMult);4082if (Game.Has('Kitten engineers')) catMult*=(1+Game.milkProgress*0.15*milkMult);4083if (Game.Has('Kitten overseers')) catMult*=(1+Game.milkProgress*0.175*milkMult);4084if (Game.Has('Kitten managers')) catMult*=(1+Game.milkProgress*0.2*milkMult);4085if (Game.Has('Kitten accountants')) catMult*=(1+Game.milkProgress*0.2*milkMult);4086if (Game.Has('Kitten specialists')) catMult*=(1+Game.milkProgress*0.2*milkMult);4087if (Game.Has('Kitten experts')) catMult*=(1+Game.milkProgress*0.2*milkMult);4088if (Game.Has('Kitten consultants')) catMult*=(1+Game.milkProgress*0.2*milkMult);4089if (Game.Has('Kitten assistants to the regional manager')) catMult*=(1+Game.milkProgress*0.175*milkMult);4090if (Game.Has('Kitten marketeers')) catMult*=(1+Game.milkProgress*0.15*milkMult);4091if (Game.Has('Kitten analysts')) catMult*=(1+Game.milkProgress*0.125*milkMult);4092if (Game.Has('Kitten executives')) catMult*=(1+Game.milkProgress*0.115*milkMult);4093if (Game.Has('Kitten angels')) catMult*=(1+Game.milkProgress*0.1*milkMult);4094if (Game.Has('Fortune #103')) catMult*=(1+Game.milkProgress*0.05*milkMult);40954096Game.cookiesMultByType['kittens']=catMult;4097mult*=catMult;40984099var eggMult=1;4100if (Game.Has('Chicken egg')) eggMult*=1.01;4101if (Game.Has('Duck egg')) eggMult*=1.01;4102if (Game.Has('Turkey egg')) eggMult*=1.01;4103if (Game.Has('Quail egg')) eggMult*=1.01;4104if (Game.Has('Robin egg')) eggMult*=1.01;4105if (Game.Has('Ostrich egg')) eggMult*=1.01;4106if (Game.Has('Cassowary egg')) eggMult*=1.01;4107if (Game.Has('Salmon roe')) eggMult*=1.01;4108if (Game.Has('Frogspawn')) eggMult*=1.01;4109if (Game.Has('Shark egg')) eggMult*=1.01;4110if (Game.Has('Turtle egg')) eggMult*=1.01;4111if (Game.Has('Ant larva')) eggMult*=1.01;4112if (Game.Has('Century egg'))4113{4114//the boost increases a little every day, with diminishing returns up to +10% on the 100th day4115var day=Math.floor((Date.now()-Game.startDate)/1000/10)*10/60/60/24;4116day=Math.min(day,100);4117eggMult*=1+(1-Math.pow(1-day/100,3))*0.1;4118}41194120Game.cookiesMultByType['eggs']=eggMult;4121mult*=eggMult;41224123if (Game.Has('Sugar baking')) mult*=(1+Math.min(100,Game.lumps)*0.01);41244125//if (Game.hasAura('Radiant Appetite')) mult*=2;4126mult*=1+Game.auraMult('Radiant Appetite');41274128if (true)// || Game.hasAura('Dragon\'s Fortune'))4129{4130var n=Game.shimmerTypes['golden'].n;4131var auraMult=Game.auraMult('Dragon\'s Fortune');4132for (var i=0;i<n;i++){mult*=1+auraMult*1.23;}4133//old behavior4134/*var buffs=0;4135for (var i in Game.buffs)4136{buffs++;}4137mult*=1+(0.07)*buffs;*/4138}41394140var rawCookiesPs=Game.cookiesPs*mult;4141for (var i in Game.CpsAchievements)4142{4143if (rawCookiesPs>=Game.CpsAchievements[i].threshold) Game.Win(Game.CpsAchievements[i].name);4144}41454146name=Game.bakeryName.toLowerCase();4147if (name=='orteil') mult*=0.99;4148else if (name=='ortiel') mult*=0.98;//or so help me41494150var sucking=0;4151for (var i in Game.wrinklers)4152{4153if (Game.wrinklers[i].phase==2)4154{4155sucking++;4156}4157}4158var suckRate=1/20;//each wrinkler eats a twentieth of your CpS4159suckRate*=Game.eff('wrinklerEat');41604161Game.cpsSucked=sucking*suckRate;416241634164if (Game.Has('Elder Covenant')) mult*=0.95;41654166if (Game.Has('Golden switch [off]'))4167{4168var goldenSwitchMult=1.5;4169if (Game.Has('Residual luck'))4170{4171var upgrades=Game.goldenCookieUpgrades;4172for (var i in upgrades) {if (Game.Has(upgrades[i])) goldenSwitchMult+=0.1;}4173}4174mult*=goldenSwitchMult;4175}4176if (Game.Has('Shimmering veil [off]'))4177{4178var veilMult=0.5;4179if (Game.Has('Reinforced membrane')) veilMult+=0.1;4180mult*=1+veilMult;4181}4182if (Game.Has('Magic shenanigans')) mult*=1000;4183if (Game.Has('Occult obstruction')) mult*=0;41844185for (var i in Game.customCpsMult) {mult*=Game.customCpsMult[i]();}418641874188//cps without golden cookie effects4189Game.unbuffedCps=Game.cookiesPs*mult;41904191for (var i in Game.buffs)4192{4193if (typeof Game.buffs[i].multCpS != 'undefined') mult*=Game.buffs[i].multCpS;4194}41954196Game.globalCpsMult=mult;4197Game.cookiesPs*=Game.globalCpsMult;41984199//if (Game.hasBuff('Cursed finger')) Game.cookiesPs=0;42004201Game.computedMouseCps=Game.mouseCps();42024203Game.computeLumpTimes();42044205Game.recalculateGains=0;4206}42074208Game.dropRateMult=function()4209{4210var rate=1;4211if (Game.Has('Green yeast digestives')) rate*=1.03;4212rate*=Game.eff('itemDrops');4213//if (Game.hasAura('Mind Over Matter')) rate*=1.25;4214rate*=1+Game.auraMult('Mind Over Matter')*0.25;4215if (Game.Has('Santa\'s bottomless bag')) rate*=1.1;4216if (Game.Has('Cosmic beginner\'s luck') && !Game.Has('Heavenly chip secret')) rate*=5;4217return rate;4218}4219/*=====================================================================================4220SHIMMERS (GOLDEN COOKIES & SUCH)4221=======================================================================================*/4222Game.shimmersL=l('shimmers');4223Game.shimmers=[];//all shimmers currently on the screen4224Game.shimmersN=Math.floor(Math.random()*10000);4225Game.shimmer=function(type,obj,noCount)4226{4227this.type=type;42284229this.l=document.createElement('div');4230this.l.className='shimmer';4231if (!Game.touchEvents) {AddEvent(this.l,'click',function(what){return function(event){what.pop(event);};}(this));}4232else {AddEvent(this.l,'touchend',function(what){return function(event){what.pop(event);};}(this));}//touch events42334234this.x=0;4235this.y=0;4236this.id=Game.shimmersN;42374238this.forceObj=obj||0;4239this.noCount=noCount;4240if (!this.noCount) {Game.shimmerTypes[this.type].n++;Game.recalculateGains=1;}42414242this.init();42434244Game.shimmersL.appendChild(this.l);4245Game.shimmers.push(this);4246Game.shimmersN++;4247}4248Game.shimmer.prototype.init=function()//executed when the shimmer is created4249{4250Game.shimmerTypes[this.type].initFunc(this);4251}4252Game.shimmer.prototype.update=function()//executed every frame4253{4254Game.shimmerTypes[this.type].updateFunc(this);4255}4256Game.shimmer.prototype.pop=function(event)//executed when the shimmer is popped by the player4257{4258if (event) event.preventDefault();4259Game.loseShimmeringVeil('shimmer');4260Game.Click=0;4261Game.shimmerTypes[this.type].popFunc(this);4262}4263Game.shimmer.prototype.die=function()//executed after the shimmer disappears (from old age or popping)4264{4265if (Game.shimmerTypes[this.type].spawnsOnTimer && this.spawnLead)4266{4267//if this was the spawn lead for this shimmer type, set the shimmer type's "spawned" to 0 and restart its spawn timer4268var type=Game.shimmerTypes[this.type];4269type.time=0;4270type.spawned=0;4271type.minTime=type.getMinTime(this);4272type.maxTime=type.getMaxTime(this);4273}4274Game.shimmersL.removeChild(this.l);4275if (Game.shimmers.indexOf(this)!=-1) Game.shimmers.splice(Game.shimmers.indexOf(this),1);4276if (!this.noCount) {Game.shimmerTypes[this.type].n=Math.max(0,Game.shimmerTypes[this.type].n-1);Game.recalculateGains=1;}4277}427842794280Game.updateShimmers=function()//run shimmer functions, kill overtimed shimmers and spawn new ones4281{4282for (var i in Game.shimmers)4283{4284Game.shimmers[i].update();4285}42864287//cookie storm!4288if (Game.hasBuff('Cookie storm') && Math.random()<0.5)4289{4290var newShimmer=new Game.shimmer('golden',0,1);4291newShimmer.dur=Math.ceil(Math.random()*4+1);4292newShimmer.life=Math.ceil(Game.fps*newShimmer.dur);4293newShimmer.force='cookie storm drop';4294newShimmer.sizeMult=Math.random()*0.75+0.25;4295}42964297//spawn shimmers4298for (var i in Game.shimmerTypes)4299{4300var me=Game.shimmerTypes[i];4301if (me.spawnsOnTimer && me.spawnConditions())//only run on shimmer types that work on a timer4302{4303if (!me.spawned)//no shimmer spawned for this type? check the timer and try to spawn one4304{4305me.time++;4306if (Math.random()<Math.pow(Math.max(0,(me.time-me.minTime)/(me.maxTime-me.minTime)),5))4307{4308var newShimmer=new Game.shimmer(i);4309newShimmer.spawnLead=1;4310if (Game.Has('Distilled essence of redoubled luck') && Math.random()<0.01) var newShimmer=new Game.shimmer(i);4311me.spawned=1;4312}4313}4314}4315}4316}4317Game.killShimmers=function()//stop and delete all shimmers (used on resetting etc)4318{4319for (var i=Game.shimmers.length-1;i>=0;i--)4320{4321Game.shimmers[i].die();4322}4323for (var i in Game.shimmerTypes)4324{4325var me=Game.shimmerTypes[i];4326if (me.reset) me.reset();4327me.n=0;4328if (me.spawnsOnTimer)4329{4330me.time=0;4331me.spawned=0;4332me.minTime=me.getMinTime(me);4333me.maxTime=me.getMaxTime(me);4334}4335}4336}43374338Game.shimmerTypes={4339//in these, "me" refers to the shimmer itself, and "this" to the shimmer's type object4340'golden':{4341reset:function()4342{4343this.chain=0;4344this.totalFromChain=0;4345this.last='';4346},4347initFunc:function(me)4348{4349if (!this.spawned && Game.chimeType==1 && Game.ascensionMode!=1) PlaySound('snd/chime.mp3');43504351//set image4352var bgPic='img/goldCookie.png';4353var picX=0;var picY=0;435443554356if ((!me.forceObj || !me.forceObj.noWrath) && ((me.forceObj && me.forceObj.wrath) || (Game.elderWrath==1 && Math.random()<1/3) || (Game.elderWrath==2 && Math.random()<2/3) || (Game.elderWrath==3) || (Game.hasGod && Game.hasGod('scorn'))))4357{4358me.wrath=1;4359if (Game.season=='halloween') bgPic='img/spookyCookie.png';4360else bgPic='img/wrathCookie.png';4361}4362else4363{4364me.wrath=0;4365}43664367if (Game.season=='valentines')4368{4369bgPic='img/hearts.png';4370picX=Math.floor(Math.random()*8);4371}4372else if (Game.season=='fools')4373{4374bgPic='img/contract.png';4375if (me.wrath) bgPic='img/wrathContract.png';4376}4377else if (Game.season=='easter')4378{4379bgPic='img/bunnies.png';4380picX=Math.floor(Math.random()*4);4381picY=0;4382if (me.wrath) picY=1;4383}43844385me.x=Math.floor(Math.random()*Math.max(0,(Game.bounds.right-300)-Game.bounds.left-128)+Game.bounds.left+64)-64;4386me.y=Math.floor(Math.random()*Math.max(0,Game.bounds.bottom-Game.bounds.top-128)+Game.bounds.top+64)-64;4387me.l.style.left=me.x+'px';4388me.l.style.top=me.y+'px';4389me.l.style.width='96px';4390me.l.style.height='96px';4391me.l.style.backgroundImage='url('+bgPic+')';4392me.l.style.backgroundPosition=(-picX*96)+'px '+(-picY*96)+'px';4393me.l.style.opacity='0';4394me.l.style.display='block';43954396me.life=1;//the cookie's current progression through its lifespan (in frames)4397me.dur=13;//duration; the cookie's lifespan in seconds before it despawns43984399var dur=13;4400if (Game.Has('Lucky day')) dur*=2;4401if (Game.Has('Serendipity')) dur*=2;4402if (Game.Has('Decisive fate')) dur*=1.05;4403if (Game.Has('Lucky digit')) dur*=1.01;4404if (Game.Has('Lucky number')) dur*=1.01;4405if (Game.Has('Lucky payout')) dur*=1.01;4406if (!me.wrath) dur*=Game.eff('goldenCookieDur');4407else dur*=Game.eff('wrathCookieDur');4408dur*=Math.pow(0.95,Game.shimmerTypes['golden'].n-1);//5% shorter for every other golden cookie on the screen4409if (this.chain>0) dur=Math.max(2,10/this.chain);//this is hilarious4410me.dur=dur;4411me.life=Math.ceil(Game.fps*me.dur);4412me.force='';4413me.sizeMult=1;4414},4415updateFunc:function(me)4416{4417var curve=1-Math.pow((me.life/(Game.fps*me.dur))*2-1,4);4418me.l.style.opacity=curve;4419//this line makes each golden cookie pulse in a unique way4420if (Game.prefs.fancy) me.l.style.transform='rotate('+(Math.sin(me.id*0.69)*24+Math.sin(Game.T*(0.35+Math.sin(me.id*0.97)*0.15)+me.id/*+Math.sin(Game.T*0.07)*2+2*/)*(3+Math.sin(me.id*0.36)*2))+'deg) scale('+(me.sizeMult*(1+Math.sin(me.id*0.53)*0.2)*curve*(1+(0.06+Math.sin(me.id*0.41)*0.05)*(Math.sin(Game.T*(0.25+Math.sin(me.id*0.73)*0.15)+me.id))))+')';4421me.life--;4422if (me.life<=0) {this.missFunc(me);me.die();}4423},4424popFunc:function(me)4425{4426//get achievs and stats4427if (me.spawnLead)4428{4429Game.goldenClicks++;4430Game.goldenClicksLocal++;44314432if (Game.goldenClicks>=1) Game.Win('Golden cookie');4433if (Game.goldenClicks>=7) Game.Win('Lucky cookie');4434if (Game.goldenClicks>=27) Game.Win('A stroke of luck');4435if (Game.goldenClicks>=77) Game.Win('Fortune');4436if (Game.goldenClicks>=777) Game.Win('Leprechaun');4437if (Game.goldenClicks>=7777) Game.Win('Black cat\'s paw');44384439if (Game.goldenClicks>=7) Game.Unlock('Lucky day');4440if (Game.goldenClicks>=27) Game.Unlock('Serendipity');4441if (Game.goldenClicks>=77) Game.Unlock('Get lucky');44424443if ((me.life/Game.fps)>(me.dur-1)) Game.Win('Early bird');4444if (me.life<Game.fps) Game.Win('Fading luck');4445}44464447if (Game.forceUnslotGod)4448{4449if (Game.forceUnslotGod('asceticism')) Game.useSwap(1000000);4450}44514452//select an effect4453var list=[];4454if (me.wrath>0) list.push('clot','multiply cookies','ruin cookies');4455else list.push('frenzy','multiply cookies');4456if (me.wrath>0 && Game.hasGod && Game.hasGod('scorn')) list.push('clot','ruin cookies','clot','ruin cookies');4457if (me.wrath>0 && Math.random()<0.3) list.push('blood frenzy','chain cookie','cookie storm');4458else if (Math.random()<0.03 && Game.cookiesEarned>=100000) list.push('chain cookie','cookie storm');4459if (Math.random()<0.05 && Game.season=='fools') list.push('everything must go');4460if (Math.random()<0.1 && (Math.random()<0.05 || !Game.hasBuff('Dragonflight'))) list.push('click frenzy');4461if (me.wrath && Math.random()<0.1) list.push('cursed finger');44624463if (Game.BuildingsOwned>=10 && Math.random()<0.25) list.push('building special');44644465if (Game.canLumps() && Math.random()<0.0005) list.push('free sugar lump');44664467if ((me.wrath==0 && Math.random()<0.15) || Math.random()<0.05)4468{4469//if (Game.hasAura('Reaper of Fields')) list.push('dragon harvest');4470if (Math.random()<Game.auraMult('Reaper of Fields')) list.push('dragon harvest');4471//if (Game.hasAura('Dragonflight')) list.push('dragonflight');4472if (Math.random()<Game.auraMult('Dragonflight')) list.push('dragonflight');4473}44744475if (this.last!='' && Math.random()<0.8 && list.indexOf(this.last)!=-1) list.splice(list.indexOf(this.last),1);//80% chance to force a different one4476if (Math.random()<0.0001) list.push('blab');4477var choice=choose(list);44784479if (this.chain>0) choice='chain cookie';4480if (me.force!='') {this.chain=0;choice=me.force;me.force='';}4481if (choice!='chain cookie') this.chain=0;44824483this.last=choice;44844485//create buff for effect4486//buff duration multiplier4487var effectDurMod=1;4488if (Game.Has('Get lucky')) effectDurMod*=2;4489if (Game.Has('Lasting fortune')) effectDurMod*=1.1;4490if (Game.Has('Lucky digit')) effectDurMod*=1.01;4491if (Game.Has('Lucky number')) effectDurMod*=1.01;4492if (Game.Has('Green yeast digestives')) effectDurMod*=1.01;4493if (Game.Has('Lucky payout')) effectDurMod*=1.01;4494//if (Game.hasAura('Epoch Manipulator')) effectDurMod*=1.05;4495effectDurMod*=1+Game.auraMult('Epoch Manipulator')*0.05;4496if (!me.wrath) effectDurMod*=Game.eff('goldenCookieEffDur');4497else effectDurMod*=Game.eff('wrathCookieEffDur');44984499if (Game.hasGod)4500{4501var godLvl=Game.hasGod('decadence');4502if (godLvl==1) effectDurMod*=1.07;4503else if (godLvl==2) effectDurMod*=1.05;4504else if (godLvl==3) effectDurMod*=1.02;4505}45064507//effect multiplier (from lucky etc)4508var mult=1;4509//if (me.wrath>0 && Game.hasAura('Unholy Dominion')) mult*=1.1;4510//else if (me.wrath==0 && Game.hasAura('Ancestral Metamorphosis')) mult*=1.1;4511if (me.wrath>0) mult*=1+Game.auraMult('Unholy Dominion')*0.1;4512else if (me.wrath==0) mult*=1+Game.auraMult('Ancestral Metamorphosis')*0.1;4513if (Game.Has('Green yeast digestives')) mult*=1.01;4514if (!me.wrath) mult*=Game.eff('goldenCookieGain');4515else mult*=Game.eff('wrathCookieGain');45164517var popup='';4518var buff=0;45194520if (choice=='building special')4521{4522var time=Math.ceil(30*effectDurMod);4523var list=[];4524for (var i in Game.Objects)4525{4526if (Game.Objects[i].amount>=10) list.push(Game.Objects[i].id);4527}4528if (list.length==0) {choice='frenzy';}//default to frenzy if no proper building4529else4530{4531var obj=choose(list);4532var pow=Game.ObjectsById[obj].amount/10+1;4533if (me.wrath && Math.random()<0.3)4534{4535buff=Game.gainBuff('building debuff',time,pow,obj);4536}4537else4538{4539buff=Game.gainBuff('building buff',time,pow,obj);4540}4541}4542}45434544if (choice=='free sugar lump')4545{4546Game.gainLumps(1);4547popup='Sweet!<div style="font-size:65%;">Found 1 sugar lump!</div>';4548}4549else if (choice=='frenzy')4550{4551buff=Game.gainBuff('frenzy',Math.ceil(77*effectDurMod),7);4552}4553else if (choice=='dragon harvest')4554{4555buff=Game.gainBuff('dragon harvest',Math.ceil(60*effectDurMod),15);4556}4557else if (choice=='everything must go')4558{4559buff=Game.gainBuff('everything must go',Math.ceil(8*effectDurMod),5);4560}4561else if (choice=='multiply cookies')4562{4563var moni=mult*Math.min(Game.cookies*0.15,Game.cookiesPs*60*15)+13;//add 15% to cookies owned (+13), or 15 minutes of cookie production - whichever is lowest4564Game.Earn(moni);4565popup='Lucky!<div style="font-size:65%;">+'+Beautify(moni)+' cookies!</div>';4566}4567else if (choice=='ruin cookies')4568{4569var moni=Math.min(Game.cookies*0.05,Game.cookiesPs*60*10)+13;//lose 5% of cookies owned (-13), or 10 minutes of cookie production - whichever is lowest4570moni=Math.min(Game.cookies,moni);4571Game.Spend(moni);4572popup='Ruin!<div style="font-size:65%;">Lost '+Beautify(moni)+' cookies!</div>';4573}4574else if (choice=='blood frenzy')4575{4576buff=Game.gainBuff('blood frenzy',Math.ceil(6*effectDurMod),666);4577}4578else if (choice=='clot')4579{4580buff=Game.gainBuff('clot',Math.ceil(66*effectDurMod),0.5);4581}4582else if (choice=='cursed finger')4583{4584buff=Game.gainBuff('cursed finger',Math.ceil(10*effectDurMod),Game.cookiesPs*Math.ceil(10*effectDurMod));4585}4586else if (choice=='click frenzy')4587{4588buff=Game.gainBuff('click frenzy',Math.ceil(13*effectDurMod),777);4589}4590else if (choice=='dragonflight')4591{4592buff=Game.gainBuff('dragonflight',Math.ceil(10*effectDurMod),1111);4593if (Math.random()<0.8) Game.killBuff('Click frenzy');4594}4595else if (choice=='chain cookie')4596{4597//fix by Icehawk784598if (this.chain==0) this.totalFromChain=0;4599this.chain++;4600var digit=me.wrath?6:7;4601if (this.chain==1) this.chain+=Math.max(0,Math.ceil(Math.log(Game.cookies)/Math.LN10)-10);46024603var maxPayout=Math.min(Game.cookiesPs*60*60*6,Game.cookies*0.5)*mult;4604var moni=Math.max(digit,Math.min(Math.floor(1/9*Math.pow(10,this.chain)*digit*mult),maxPayout));4605var nextMoni=Math.max(digit,Math.min(Math.floor(1/9*Math.pow(10,this.chain+1)*digit*mult),maxPayout));4606this.totalFromChain+=moni;4607var moniStr=Beautify(moni);46084609//break the chain if we're above 5 digits AND it's more than 50% of our bank, it grants more than 6 hours of our CpS, or just a 1% chance each digit (update : removed digit limit)4610if (Math.random()<0.01 || nextMoni>=maxPayout)4611{4612this.chain=0;4613popup='Cookie chain<div style="font-size:65%;">+'+moniStr+' cookies!<br>Cookie chain over. You made '+Beautify(this.totalFromChain)+' cookies.</div>';4614}4615else4616{4617popup='Cookie chain<div style="font-size:65%;">+'+moniStr+' cookies!</div>';//4618}4619Game.Earn(moni);4620}4621else if (choice=='cookie storm')4622{4623buff=Game.gainBuff('cookie storm',Math.ceil(7*effectDurMod),7);4624}4625else if (choice=='cookie storm drop')4626{4627var moni=Math.max(mult*(Game.cookiesPs*60*Math.floor(Math.random()*7+1)),Math.floor(Math.random()*7+1));//either 1-7 cookies or 1-7 minutes of cookie production, whichever is highest4628Game.Earn(moni);4629popup='<div style="font-size:75%;">+'+Beautify(moni)+' cookies!</div>';4630}4631else if (choice=='blab')//sorry (it's really rare)4632{4633var str=choose([4634'Cookie crumbliness x3 for 60 seconds!',4635'Chocolatiness x7 for 77 seconds!',4636'Dough elasticity halved for 66 seconds!',4637'Golden cookie shininess doubled for 3 seconds!',4638'World economy halved for 30 seconds!',4639'Grandma kisses 23% stingier for 45 seconds!',4640'Thanks for clicking!',4641'Fooled you! This one was just a test.',4642'Golden cookies clicked +1!',4643'Your click has been registered. Thank you for your cooperation.',4644'Thanks! That hit the spot!',4645'Thank you. A team has been dispatched.',4646'They know.',4647'Oops. This was just a chocolate cookie with shiny aluminium foil.'4648]);4649popup=str;4650}46514652if (popup=='' && buff && buff.name && buff.desc) popup=buff.name+'<div style="font-size:65%;">'+buff.desc+'</div>';4653if (popup!='') Game.Popup(popup,me.x+me.l.offsetWidth/2,me.y);46544655Game.DropEgg(0.9);46564657//sparkle and kill the shimmer4658Game.SparkleAt(me.x+48,me.y+48);4659if (choice=='cookie storm drop')4660{4661if (Game.prefs.cookiesound) PlaySound('snd/clickb'+Math.floor(Math.random()*7+1)+'.mp3',0.75);4662else PlaySound('snd/click'+Math.floor(Math.random()*7+1)+'.mp3',0.75);4663}4664else PlaySound('snd/shimmerClick.mp3');4665me.die();4666},4667missFunc:function(me)4668{4669if (this.chain>0 && this.totalFromChain>0)4670{4671Game.Popup('Cookie chain broken.<div style="font-size:65%;">You made '+Beautify(this.totalFromChain)+' cookies.</div>',me.x+me.l.offsetWidth/2,me.y);4672this.chain=0;this.totalFromChain=0;4673}4674if (me.spawnLead) Game.missedGoldenClicks++;4675},4676spawnsOnTimer:true,4677spawnConditions:function()4678{4679if (!Game.Has('Golden switch [off]')) return true; else return false;4680},4681spawned:0,4682time:0,4683minTime:0,4684maxTime:0,4685getTimeMod:function(me,m)4686{4687if (Game.Has('Lucky day')) m/=2;4688if (Game.Has('Serendipity')) m/=2;4689if (Game.Has('Golden goose egg')) m*=0.95;4690if (Game.Has('Heavenly luck')) m*=0.95;4691if (Game.Has('Green yeast digestives')) m*=0.99;4692//if (Game.hasAura('Arcane Aura')) m*=0.95;4693m*=1-Game.auraMult('Arcane Aura')*0.05;4694if (Game.hasBuff('Sugar blessing')) m*=0.9;4695if (Game.season=='easter' && Game.Has('Starspawn')) m*=0.98;4696else if (Game.season=='halloween' && Game.Has('Starterror')) m*=0.98;4697else if (Game.season=='valentines' && Game.Has('Starlove')) m*=0.98;4698else if (Game.season=='fools' && Game.Has('Startrade')) m*=0.95;4699if (!me.wrath) m*=1/Game.eff('goldenCookieFreq');4700else m*=1/Game.eff('wrathCookieFreq');4701if (Game.hasGod)4702{4703var godLvl=Game.hasGod('industry');4704if (godLvl==1) m*=1.1;4705else if (godLvl==2) m*=1.06;4706else if (godLvl==3) m*=1.03;4707var godLvl=Game.hasGod('mother');4708if (godLvl==1) m*=1.15;4709else if (godLvl==2) m*=1.1;4710else if (godLvl==3) m*=1.05;47114712if (Game.season!='')4713{4714var godLvl=Game.hasGod('seasons');4715if (Game.season!='fools')4716{4717if (godLvl==1) m*=0.97;4718else if (godLvl==2) m*=0.98;4719else if (godLvl==3) m*=0.99;4720}4721else4722{4723if (godLvl==1) m*=0.955;4724else if (godLvl==2) m*=0.97;4725else if (godLvl==3) m*=0.985;4726}4727}4728}4729if (this.chain>0) m=0.05;4730if (Game.Has('Gold hoard')) m=0.01;4731return Math.ceil(Game.fps*60*m);4732},4733getMinTime:function(me)4734{4735var m=5;4736return this.getTimeMod(me,m);4737},4738getMaxTime:function(me)4739{4740var m=15;4741return this.getTimeMod(me,m);4742},4743last:'',4744},4745'reindeer':{4746reset:function()4747{4748},4749initFunc:function(me)4750{4751if (!this.spawned && Game.chimeType==1 && Game.ascensionMode!=1) PlaySound('snd/jingle.mp3');47524753me.x=-128;4754me.y=Math.floor(Math.random()*Math.max(0,Game.bounds.bottom-Game.bounds.top-256)+Game.bounds.top+128)-128;4755//me.l.style.left=me.x+'px';4756//me.l.style.top=me.y+'px';4757me.l.style.width='167px';4758me.l.style.height='212px';4759me.l.style.backgroundImage='url(img/frostedReindeer.png)';4760me.l.style.opacity='0';4761//me.l.style.transform='rotate('+(Math.random()*60-30)+'deg) scale('+(Math.random()*1+0.25)+')';4762me.l.style.display='block';47634764me.life=1;//the reindeer's current progression through its lifespan (in frames)4765me.dur=4;//duration; the cookie's lifespan in seconds before it despawns47664767var dur=4;4768if (Game.Has('Weighted sleighs')) dur*=2;4769dur*=Game.eff('reindeerDur');4770me.dur=dur;4771me.life=Math.ceil(Game.fps*me.dur);4772me.sizeMult=1;4773},4774updateFunc:function(me)4775{4776var curve=1-Math.pow((me.life/(Game.fps*me.dur))*2-1,12);4777me.l.style.opacity=curve;4778me.l.style.transform='translate('+(me.x+(Game.bounds.right-Game.bounds.left)*(1-me.life/(Game.fps*me.dur)))+'px,'+(me.y-Math.abs(Math.sin(me.life*0.1))*128)+'px) rotate('+(Math.sin(me.life*0.2+0.3)*10)+'deg) scale('+(me.sizeMult*(1+Math.sin(me.id*0.53)*0.1))+')';4779me.life--;4780if (me.life<=0) {this.missFunc(me);me.die();}4781},4782popFunc:function(me)4783{4784//get achievs and stats4785if (me.spawnLead)4786{4787Game.reindeerClicked++;4788}47894790var val=Game.cookiesPs*60;4791if (Game.hasBuff('Elder frenzy')) val*=0.5;//very sorry4792if (Game.hasBuff('Frenzy')) val*=0.75;//I sincerely apologize4793var moni=Math.max(25,val);//1 minute of cookie production, or 25 cookies - whichever is highest4794if (Game.Has('Ho ho ho-flavored frosting')) moni*=2;4795moni*=Game.eff('reindeerGain');4796Game.Earn(moni);4797if (Game.hasBuff('Elder frenzy')) Game.Win('Eldeer');47984799var cookie='';4800var failRate=0.8;4801if (Game.HasAchiev('Let it snow')) failRate=0.6;4802failRate*=1/Game.dropRateMult();4803if (Game.Has('Starsnow')) failRate*=0.95;4804if (Game.hasGod)4805{4806var godLvl=Game.hasGod('seasons');4807if (godLvl==1) failRate*=0.9;4808else if (godLvl==2) failRate*=0.95;4809else if (godLvl==3) failRate*=0.97;4810}4811if (Math.random()>failRate)//christmas cookie drops4812{4813cookie=choose(['Christmas tree biscuits','Snowflake biscuits','Snowman biscuits','Holly biscuits','Candy cane biscuits','Bell biscuits','Present biscuits']);4814if (!Game.HasUnlocked(cookie) && !Game.Has(cookie))4815{4816Game.Unlock(cookie);4817}4818else cookie='';4819}48204821var popup='';48224823if (Game.prefs.popups) Game.Popup('You found '+choose(['Dasher','Dancer','Prancer','Vixen','Comet','Cupid','Donner','Blitzen','Rudolph'])+'!<br>The reindeer gives you '+Beautify(moni)+' cookies.'+(cookie==''?'':'<br>You are also rewarded with '+cookie+'!'));4824else Game.Notify('You found '+choose(['Dasher','Dancer','Prancer','Vixen','Comet','Cupid','Donner','Blitzen','Rudolph'])+'!','The reindeer gives you '+Beautify(moni)+' cookies.'+(cookie==''?'':'<br>You are also rewarded with '+cookie+'!'),[12,9],6);4825popup='<div style="font-size:80%;">+'+Beautify(moni)+' cookies!</div>';48264827if (popup!='') Game.Popup(popup,Game.mouseX,Game.mouseY);48284829//sparkle and kill the shimmer4830Game.SparkleAt(Game.mouseX,Game.mouseY);4831PlaySound('snd/jingleClick.mp3');4832me.die();4833},4834missFunc:function(me)4835{4836},4837spawnsOnTimer:true,4838spawnConditions:function()4839{4840if (Game.season=='christmas') return true; else return false;4841},4842spawned:0,4843time:0,4844minTime:0,4845maxTime:0,4846getTimeMod:function(me,m)4847{4848if (Game.Has('Reindeer baking grounds')) m/=2;4849if (Game.Has('Starsnow')) m*=0.95;4850if (Game.hasGod)4851{4852var godLvl=Game.hasGod('seasons');4853if (godLvl==1) m*=0.9;4854else if (godLvl==2) m*=0.95;4855else if (godLvl==3) m*=0.97;4856}4857m*=1/Game.eff('reindeerFreq');4858if (Game.Has('Reindeer season')) m=0.01;4859return Math.ceil(Game.fps*60*m);4860},4861getMinTime:function(me)4862{4863var m=3;4864return this.getTimeMod(me,m);4865},4866getMaxTime:function(me)4867{4868var m=6;4869return this.getTimeMod(me,m);4870},4871}4872};48734874Game.goldenCookieChoices=[4875"Frenzy","frenzy",4876"Lucky","multiply cookies",4877"Ruin","ruin cookies",4878"Elder frenzy","blood frenzy",4879"Clot","clot",4880"Click frenzy","click frenzy",4881"Cursed finger","cursed finger",4882"Cookie chain","chain cookie",4883"Cookie storm","cookie storm",4884"Building special","building special",4885"Dragon Harvest","dragon harvest",4886"Dragonflight","dragonflight",4887"Sweet","free sugar lump",4888"Blab","blab"4889];4890Game.goldenCookieBuildingBuffs={4891'Cursor':['High-five','Slap to the face'],4892'Grandma':['Congregation','Senility'],4893'Farm':['Luxuriant harvest','Locusts'],4894'Mine':['Ore vein','Cave-in'],4895'Factory':['Oiled-up','Jammed machinery'],4896'Bank':['Juicy profits','Recession'],4897'Temple':['Fervent adoration','Crisis of faith'],4898'Wizard tower':['Manabloom','Magivores'],4899'Shipment':['Delicious lifeforms','Black holes'],4900'Alchemy lab':['Breakthrough','Lab disaster'],4901'Portal':['Righteous cataclysm','Dimensional calamity'],4902'Time machine':['Golden ages','Time jam'],4903'Antimatter condenser':['Extra cycles','Predictable tragedy'],4904'Prism':['Solar flare','Eclipse'],4905'Chancemaker':['Winning streak','Dry spell'],4906'Fractal engine':['Macrocosm','Microcosm'],4907'Javascript console':['Refactoring','Antipattern'],4908};49094910/*=====================================================================================4911PARTICLES4912=======================================================================================*/4913//generic particles (falling cookies etc)4914//only displayed on left section4915Game.particles=[];4916for (var i=0;i<50;i++)4917{4918Game.particles[i]={x:0,y:0,xd:0,yd:0,w:64,h:64,z:0,size:1,dur:2,life:-1,r:0,pic:'smallCookies.png',picId:0};4919}49204921Game.particlesUpdate=function()4922{4923for (var i in Game.particles)4924{4925var me=Game.particles[i];4926if (me.life!=-1)4927{4928if (!me.text) me.yd+=0.2+Math.random()*0.1;4929me.x+=me.xd;4930me.y+=me.yd;4931//me.y+=me.life*0.25+Math.random()*0.25;4932me.life++;4933if (me.life>=Game.fps*me.dur)4934{4935me.life=-1;4936}4937}4938}4939}4940Game.particleAdd=function(x,y,xd,yd,size,dur,z,pic,text)4941{4942//Game.particleAdd(pos X,pos Y,speed X,speed Y,size (multiplier),duration (seconds),layer,picture,text);4943//pick the first free (or the oldest) particle to replace it4944if (1 || Game.prefs.particles)4945{4946var highest=0;4947var highestI=0;4948for (var i in Game.particles)4949{4950if (Game.particles[i].life==-1) {highestI=i;break;}4951if (Game.particles[i].life>highest)4952{4953highest=Game.particles[i].life;4954highestI=i;4955}4956}4957var auto=0;4958if (x) auto=1;4959var i=highestI;4960var x=x||-64;4961if (Game.LeftBackground && !auto) x=Math.floor(Math.random()*Game.LeftBackground.canvas.width);4962var y=y||-64;4963var me=Game.particles[i];4964me.life=0;4965me.x=x;4966me.y=y;4967me.xd=xd||0;4968me.yd=yd||0;4969me.size=size||1;4970me.z=z||0;4971me.dur=dur||2;4972me.r=Math.floor(Math.random()*360);4973me.picId=Math.floor(Math.random()*10000);4974if (!pic)4975{4976if (Game.season=='fools') pic='smallDollars.png';4977else4978{4979var cookies=[[10,0]];4980for (var i in Game.Upgrades)4981{4982var cookie=Game.Upgrades[i];4983if (cookie.bought>0 && cookie.pool=='cookie') cookies.push(cookie.icon);4984}4985me.picPos=choose(cookies);4986if (Game.bakeryName.toLowerCase()=='ortiel' || Math.random()<1/10000) me.picPos=[17,5];4987pic='icons.png';4988}4989}4990me.pic=pic||'smallCookies.png';4991me.text=text||0;4992return me;4993}4994return {};4995}4996Game.particlesDraw=function(z)4997{4998var ctx=Game.LeftBackground;4999ctx.fillStyle='#fff';5000ctx.font='20px Merriweather';5001ctx.textAlign='center';50025003for (var i in Game.particles)5004{5005var me=Game.particles[i];5006if (me.z==z)5007{5008if (me.life!=-1)5009{5010var opacity=1-(me.life/(Game.fps*me.dur));5011ctx.globalAlpha=opacity;5012if (me.text)5013{5014ctx.fillText(me.text,me.x,me.y);5015}5016else5017{5018ctx.save();5019ctx.translate(me.x,me.y);5020ctx.rotate((me.r/360)*Math.PI*2);5021var w=64;5022var h=64;5023if (me.pic=='icons.png')5024{5025w=48;5026h=48;5027ctx.drawImage(Pic(me.pic),me.picPos[0]*w,me.picPos[1]*h,w,h,-w/2*me.size,-h/2*me.size,w*me.size,h*me.size);5028}5029else5030{5031if (me.pic=='wrinklerBits.png' || me.pic=='shinyWrinklerBits.png') {w=100;h=200;}5032ctx.drawImage(Pic(me.pic),(me.picId%8)*w,0,w,h,-w/2*me.size,-h/2*me.size,w*me.size,h*me.size);5033}5034ctx.restore();5035}5036}5037}5038}5039}50405041//text particles (popups etc)5042Game.textParticles=[];5043Game.textParticlesY=0;5044var str='';5045for (var i=0;i<20;i++)5046{5047Game.textParticles[i]={x:0,y:0,life:-1,text:''};5048str+='<div id="particle'+i+'" class="particle title"></div>';5049}5050l('particles').innerHTML=str;5051Game.textParticlesUpdate=function()5052{5053for (var i in Game.textParticles)5054{5055var me=Game.textParticles[i];5056if (me.life!=-1)5057{5058me.life++;5059if (me.life>=Game.fps*4)5060{5061var el=me.l;5062me.life=-1;5063el.style.opacity=0;5064el.style.display='none';5065}5066}5067}5068}5069Game.textParticlesAdd=function(text,el,posX,posY)5070{5071//pick the first free (or the oldest) particle to replace it5072var highest=0;5073var highestI=0;5074for (var i in Game.textParticles)5075{5076if (Game.textParticles[i].life==-1) {highestI=i;break;}5077if (Game.textParticles[i].life>highest)5078{5079highest=Game.textParticles[i].life;5080highestI=i;5081}5082}5083var i=highestI;5084var noStack=0;5085if (typeof posX!=='undefined' && typeof posY!=='undefined')5086{5087x=posX;5088y=posY;5089noStack=1;5090}5091else5092{5093var x=(Math.random()-0.5)*40;5094var y=0;//+(Math.random()-0.5)*40;5095if (!el)5096{5097var rect=Game.bounds;5098var x=Math.floor((rect.left+rect.right)/2);5099var y=Math.floor((rect.bottom))-(Game.mobile*64);5100x+=(Math.random()-0.5)*40;5101y+=0;//(Math.random()-0.5)*40;5102}5103}5104if (!noStack) y-=Game.textParticlesY;51055106x=Math.max(Game.bounds.left+200,x);5107x=Math.min(Game.bounds.right-200,x);5108y=Math.max(Game.bounds.top+32,y);51095110var me=Game.textParticles[i];5111if (!me.l) me.l=l('particle'+i);5112me.life=0;5113me.x=x;5114me.y=y;5115me.text=text;5116me.l.innerHTML=text;5117me.l.style.left=Math.floor(Game.textParticles[i].x-200)+'px';5118me.l.style.bottom=Math.floor(-Game.textParticles[i].y)+'px';5119for (var ii in Game.textParticles)5120{if (ii!=i) (Game.textParticles[ii].l||l('particle'+ii)).style.zIndex=100000000;}5121me.l.style.zIndex=100000001;5122me.l.style.display='block';5123me.l.className='particle title';5124void me.l.offsetWidth;5125me.l.className='particle title risingUpLinger';5126if (!noStack) Game.textParticlesY+=60;5127}5128Game.popups=1;5129Game.Popup=function(text,x,y)5130{5131if (Game.popups) Game.textParticlesAdd(text,0,x,y);5132}51335134//display sparkles at a set position5135Game.sparkles=l('sparkles');5136Game.sparklesT=0;5137Game.sparklesFrames=16;5138Game.SparkleAt=function(x,y)5139{5140if (Game.blendModesOn)5141{5142Game.sparklesT=Game.sparklesFrames+1;5143Game.sparkles.style.backgroundPosition='0px 0px';5144Game.sparkles.style.left=Math.floor(x-64)+'px';5145Game.sparkles.style.top=Math.floor(y-64)+'px';5146Game.sparkles.style.display='block';5147}5148}5149Game.SparkleOn=function(el)5150{5151var rect=el.getBoundingClientRect();5152Game.SparkleAt((rect.left+rect.right)/2,(rect.top+rect.bottom)/2-24);5153}51545155/*=====================================================================================5156NOTIFICATIONS5157=======================================================================================*/5158//maybe do all this mess with proper DOM instead of rewriting the innerHTML5159Game.Notes=[];5160Game.NotesById=[];5161Game.noteId=0;5162Game.noteL=l('notes');5163Game.Note=function(title,desc,pic,quick)5164{5165this.title=title;5166this.desc=desc||'';5167this.pic=pic||'';5168this.id=Game.noteId;5169this.date=Date.now();5170this.quick=quick||0;5171this.life=(this.quick||1)*Game.fps;5172this.l=0;5173this.height=0;5174Game.noteId++;5175Game.NotesById[this.id]=this;5176Game.Notes.unshift(this);5177if (Game.Notes.length>50) Game.Notes.pop();5178//Game.Notes.push(this);5179//if (Game.Notes.length>50) Game.Notes.shift();5180Game.UpdateNotes();5181}5182Game.CloseNote=function(id)5183{5184var me=Game.NotesById[id];5185Game.Notes.splice(Game.Notes.indexOf(me),1);5186//Game.NotesById.splice(Game.NotesById.indexOf(me),1);5187Game.NotesById[id]=null;5188Game.UpdateNotes();5189}5190Game.CloseNotes=function()5191{5192Game.Notes=[];5193Game.NotesById=[];5194Game.UpdateNotes();5195}5196Game.UpdateNotes=function()5197{5198var str='';5199var remaining=Game.Notes.length;5200for (var i in Game.Notes)5201{5202if (i<5)5203{5204var me=Game.Notes[i];5205var pic='';5206if (me.pic!='') pic='<div class="icon" style="'+(me.pic[2]?'background-image:url('+me.pic[2]+');':'')+'background-position:'+(-me.pic[0]*48)+'px '+(-me.pic[1]*48)+'px;"></div>';5207str='<div id="note-'+me.id+'" class="framed note '+(me.pic!=''?'haspic':'nopic')+' '+(me.desc!=''?'hasdesc':'nodesc')+'"><div class="close" onclick="PlaySound(\'snd/tick.mp3\');Game.CloseNote('+me.id+');">x</div>'+pic+'<div class="text"><h3>'+me.title+'</h3>'+(me.desc!=''?'<div class="line"></div><h5>'+me.desc+'</h5>':'')+'</div></div>'+str;5208remaining--;5209}5210}5211if (remaining>0) str='<div class="remaining">+'+remaining+' more notification'+(remaining==1?'':'s')+'.</div>'+str;5212if (Game.Notes.length>1)5213{5214str+='<div class="framed close sidenote" onclick="PlaySound(\'snd/tick.mp3\');Game.CloseNotes();">x</div>';5215}5216Game.noteL.innerHTML=str;5217for (var i in Game.Notes)5218{5219me.l=0;5220if (i<5)5221{5222var me=Game.Notes[i];5223me.l=l('note-'+me.id);5224}5225}5226}5227Game.NotesLogic=function()5228{5229for (var i in Game.Notes)5230{5231if (Game.Notes[i].quick>0)5232{5233var me=Game.Notes[i];5234me.life--;5235if (me.life<=0) Game.CloseNote(me.id);5236}5237}5238}5239Game.NotesDraw=function()5240{5241for (var i in Game.Notes)5242{5243if (Game.Notes[i].quick>0)5244{5245var me=Game.Notes[i];5246if (me.l)5247{5248if (me.life<10)5249{5250me.l.style.opacity=(me.life/10);5251}5252}5253}5254}5255}5256Game.Notify=function(title,desc,pic,quick,noLog)5257{5258if (Game.prefs.notifs)5259{5260quick=Math.min(6,quick);5261if (!quick) quick=6;5262}5263desc=replaceAll('==CLOSETHIS()==','Game.CloseNote('+Game.noteId+');',desc);5264if (Game.popups) new Game.Note(title,desc,pic,quick);5265if (!noLog) Game.AddToLog('<b>'+title+'</b> | '+desc);5266}526752685269/*=====================================================================================5270PROMPT5271=======================================================================================*/5272Game.darkenL=l('darken');5273AddEvent(Game.darkenL,'click',function(){Game.Click=0;Game.ClosePrompt();});5274Game.promptL=l('promptContent');5275Game.promptAnchorL=l('promptAnchor');5276Game.promptWrapL=l('prompt');5277Game.promptConfirm='';5278Game.promptOn=0;5279Game.promptUpdateFunc=0;5280Game.UpdatePrompt=function()5281{5282if (Game.promptUpdateFunc) Game.promptUpdateFunc();5283Game.promptAnchorL.style.top=Math.floor((Game.windowH-Game.promptWrapL.offsetHeight)/2-16)+'px';5284}5285Game.Prompt=function(content,options,updateFunc,style)5286{5287if (updateFunc) Game.promptUpdateFunc=updateFunc;5288if (style) Game.promptWrapL.className='framed '+style; else Game.promptWrapL.className='framed';5289var str='';5290str+=content;5291var opts='';5292for (var i in options)5293{5294if (options[i]=='br')//just a linebreak5295{opts+='<br>';}5296else5297{5298if (typeof options[i]=='string') options[i]=[options[i],'Game.ClosePrompt();'];5299options[i][1]=options[i][1].replace(/'/g,''').replace(/"/g,'"');5300opts+='<a id="promptOption'+i+'" class="option" '+Game.clickStr+'="PlaySound(\'snd/tick.mp3\');'+options[i][1]+'">'+options[i][0]+'</a>';5301}5302}5303Game.promptL.innerHTML=str+'<div class="optionBox">'+opts+'</div>';5304Game.promptAnchorL.style.display='block';5305Game.darkenL.style.display='block';5306Game.promptL.focus();5307Game.promptOn=1;5308Game.UpdatePrompt();5309}5310Game.ClosePrompt=function()5311{5312Game.promptAnchorL.style.display='none';5313Game.darkenL.style.display='none';5314Game.promptOn=0;5315Game.promptUpdateFunc=0;5316}5317Game.ConfirmPrompt=function()5318{5319if (Game.promptOn && l('promptOption0') && l('promptOption0').style.display!='none') FireEvent(l('promptOption0'),'click');5320}53215322/*=====================================================================================5323MENUS5324=======================================================================================*/5325Game.cssClasses=[];5326Game.addClass=function(what) {if (Game.cssClasses.indexOf(what)==-1) Game.cssClasses.push(what);Game.updateClasses();}5327Game.removeClass=function(what) {var i=Game.cssClasses.indexOf(what);if(i!=-1) {Game.cssClasses.splice(i,1);}Game.updateClasses();}5328Game.updateClasses=function() {Game.l.className=Game.cssClasses.join(' ');}53295330Game.WriteButton=function(prefName,button,on,off,callback,invert)5331{5332var invert=invert?1:0;5333if (!callback) callback='';5334callback+='PlaySound(\'snd/tick.mp3\');';5335return '<a class="option'+((Game.prefs[prefName]^invert)?'':' off')+'" id="'+button+'" '+Game.clickStr+'="Game.Toggle(\''+prefName+'\',\''+button+'\',\''+on+'\',\''+off+'\',\''+invert+'\');'+callback+'">'+(Game.prefs[prefName]?on:off)+'</a>';5336}5337Game.Toggle=function(prefName,button,on,off,invert)5338{5339if (Game.prefs[prefName])5340{5341l(button).innerHTML=off;5342Game.prefs[prefName]=0;5343}5344else5345{5346l(button).innerHTML=on;5347Game.prefs[prefName]=1;5348}5349l(button).className='option'+((Game.prefs[prefName]^invert)?'':' off');53505351}5352Game.ToggleFancy=function()5353{5354if (Game.prefs.fancy) Game.removeClass('noFancy');5355else if (!Game.prefs.fancy) Game.addClass('noFancy');5356}5357Game.ToggleFilters=function()5358{5359if (Game.prefs.filters) Game.removeClass('noFilters');5360else if (!Game.prefs.filters) Game.addClass('noFilters');5361}5362Game.ToggleExtraButtons=function()5363{5364if (!Game.prefs.extraButtons) Game.removeClass('extraButtons');5365else if (Game.prefs.extraButtons) Game.addClass('extraButtons');5366for (var i in Game.Objects)5367{5368Game.Objects[i].mute(0);5369}5370}53715372Game.WriteSlider=function(slider,leftText,rightText,startValueFunction,callback)5373{5374if (!callback) callback='';5375return '<div class="sliderBox"><div style="float:left;">'+leftText+'</div><div style="float:right;" id="'+slider+'RightText">'+rightText.replace('[$]',startValueFunction())+'</div><input class="slider" style="clear:both;" type="range" min="0" max="100" step="1" value="'+startValueFunction()+'" onchange="'+callback+'" oninput="'+callback+'" onmouseup="PlaySound(\'snd/tick.mp3\');" id="'+slider+'"/></div>';5376}53775378Game.onPanel='Left';5379Game.addClass('focus'+Game.onPanel);5380Game.ShowPanel=function(what)5381{5382if (!what) what='';5383if (Game.onPanel!=what)5384{5385Game.removeClass('focus'+Game.onPanel);5386Game.addClass('focus'+what);5387}5388Game.onPanel=what;5389}53905391Game.onMenu='';5392Game.ShowMenu=function(what)5393{5394if (!what || what=='') what=Game.onMenu;5395if (Game.onMenu=='' && what!='') Game.addClass('onMenu');5396else if (Game.onMenu!='' && what!=Game.onMenu) Game.addClass('onMenu');5397else if (what==Game.onMenu) {Game.removeClass('onMenu');what='';}5398//if (what=='log') l('donateBox').className='on'; else l('donateBox').className='';5399Game.onMenu=what;54005401l('prefsButton').className=(Game.onMenu=='prefs')?'button selected':'button';5402l('statsButton').className=(Game.onMenu=='stats')?'button selected':'button';5403l('logButton').className=(Game.onMenu=='log')?'button selected':'button';54045405if (Game.onMenu=='') PlaySound('snd/clickOff.mp3');5406else PlaySound('snd/clickOn.mp3');54075408Game.UpdateMenu();54095410if (what=='')5411{5412for (var i in Game.Objects)5413{5414var me=Game.Objects[i];5415if (me.minigame && me.minigame.onResize) me.minigame.onResize();5416}5417}5418}5419Game.sayTime=function(time,detail)5420{5421//time is a value where one second is equal to Game.fps (30).5422//detail skips days when >1, hours when >2, minutes when >3 and seconds when >4.5423//if detail is -1, output something like "3 hours, 9 minutes, 48 seconds"5424if (time<=0) return '';5425var str='';5426var detail=detail||0;5427time=Math.floor(time);5428if (detail==-1)5429{5430//var months=0;5431var days=0;5432var hours=0;5433var minutes=0;5434var seconds=0;5435//if (time>=Game.fps*60*60*24*30) months=(Math.floor(time/(Game.fps*60*60*24*30)));5436if (time>=Game.fps*60*60*24) days=(Math.floor(time/(Game.fps*60*60*24)));5437if (time>=Game.fps*60*60) hours=(Math.floor(time/(Game.fps*60*60)));5438if (time>=Game.fps*60) minutes=(Math.floor(time/(Game.fps*60)));5439if (time>=Game.fps) seconds=(Math.floor(time/(Game.fps)));5440//days-=months*30;5441hours-=days*24;5442minutes-=hours*60+days*24*60;5443seconds-=minutes*60+hours*60*60+days*24*60*60;5444if (days>10) {hours=0;}5445if (days) {minutes=0;seconds=0;}5446if (hours) {seconds=0;}5447var bits=[];5448//if (months>0) bits.push(Beautify(months)+' month'+(days==1?'':'s'));5449if (days>0) bits.push(Beautify(days)+' day'+(days==1?'':'s'));5450if (hours>0) bits.push(Beautify(hours)+' hour'+(hours==1?'':'s'));5451if (minutes>0) bits.push(Beautify(minutes)+' minute'+(minutes==1?'':'s'));5452if (seconds>0) bits.push(Beautify(seconds)+' second'+(seconds==1?'':'s'));5453if (bits.length==0) str='less than 1 second';5454else str=bits.join(', ');5455}5456else5457{5458/*if (time>=Game.fps*60*60*24*30*2 && detail<1) str=Beautify(Math.floor(time/(Game.fps*60*60*24*30)))+' months';5459else if (time>=Game.fps*60*60*24*30 && detail<1) str='1 month';5460else */if (time>=Game.fps*60*60*24*2 && detail<2) str=Beautify(Math.floor(time/(Game.fps*60*60*24)))+' days';5461else if (time>=Game.fps*60*60*24 && detail<2) str='1 day';5462else if (time>=Game.fps*60*60*2 && detail<3) str=Beautify(Math.floor(time/(Game.fps*60*60)))+' hours';5463else if (time>=Game.fps*60*60 && detail<3) str='1 hour';5464else if (time>=Game.fps*60*2 && detail<4) str=Beautify(Math.floor(time/(Game.fps*60)))+' minutes';5465else if (time>=Game.fps*60 && detail<4) str='1 minute';5466else if (time>=Game.fps*2 && detail<5) str=Beautify(Math.floor(time/(Game.fps)))+' seconds';5467else if (time>=Game.fps && detail<5) str='1 second';5468else str='less than 1 second';5469}5470return str;5471}54725473Game.tinyCookie=function()5474{5475if (!Game.HasAchiev('Tiny cookie'))5476{5477return '<div class="tinyCookie" '+Game.clickStr+'="Game.ClickTinyCookie();"></div>';5478}5479return '';5480}5481Game.ClickTinyCookie=function(){if (!Game.HasAchiev('Tiny cookie')){PlaySound('snd/tick.mp3');Game.Win('Tiny cookie');}}54825483Game.setVolume=function(what)5484{5485Game.volume=what;5486/*for (var i in Sounds)5487{5488Sounds[i].volume=Game.volume;5489}*/5490}54915492Game.UpdateMenu=function()5493{5494var str='';5495if (Game.onMenu!='')5496{5497str+='<div class="close menuClose" '+Game.clickStr+'="Game.ShowMenu();">x</div>';5498//str+='<div style="position:absolute;top:8px;right:8px;cursor:pointer;font-size:16px;" '+Game.clickStr+'="Game.ShowMenu();">X</div>';5499}5500if (Game.onMenu=='prefs')5501{5502str+='<div class="section">Options</div>'+5503'<div class="subsection">'+5504'<div class="title">General</div>'+5505'<div class="listing"><a class="option" '+Game.clickStr+'="Game.toSave=true;PlaySound(\'snd/tick.mp3\');">Save</a><label>Save manually (the game autosaves every 60 seconds; shortcut : ctrl+S)</label></div>'+5506'<div class="listing"><a class="option" '+Game.clickStr+'="Game.ExportSave();PlaySound(\'snd/tick.mp3\');">Export save</a><a class="option" '+Game.clickStr+'="Game.ImportSave();PlaySound(\'snd/tick.mp3\');">Import save</a><label>You can use this to backup your save or to transfer it to another computer (shortcut for import : ctrl+O)</label></div>'+5507'<div class="listing"><a class="option" '+Game.clickStr+'="Game.FileSave();PlaySound(\'snd/tick.mp3\');">Save to file</a><a class="option" style="position:relative;"><input id="FileLoadInput" type="file" style="cursor:pointer;opacity:0;position:absolute;left:0px;top:0px;width:100%;height:100%;" onchange="Game.FileLoad(event);" '+Game.clickStr+'="PlaySound(\'snd/tick.mp3\');"/>Load from file</a><label>Use this to keep backups on your computer</label></div>'+55085509'<div class="listing"><a class="option warning" '+Game.clickStr+'="Game.HardReset();PlaySound(\'snd/tick.mp3\');">Wipe save</a><label>Delete all your progress, including your achievements</label></div>'+5510'<div class="title">Settings</div>'+5511'<div class="listing">'+5512Game.WriteSlider('volumeSlider','Volume','[$]%',function(){return Game.volume;},'Game.setVolume(Math.round(l(\'volumeSlider\').value));l(\'volumeSliderRightText\').innerHTML=Game.volume+\'%\';')+'<br>'+5513Game.WriteButton('fancy','fancyButton','Fancy graphics ON','Fancy graphics OFF','Game.ToggleFancy();')+'<label>(visual improvements; disabling may improve performance)</label><br>'+5514Game.WriteButton('filters','filtersButton','CSS filters ON','CSS filters OFF','Game.ToggleFilters();')+'<label>(cutting-edge visual improvements; disabling may improve performance)</label><br>'+5515Game.WriteButton('particles','particlesButton','Particles ON','Particles OFF')+'<label>(cookies falling down, etc; disabling may improve performance)</label><br>'+5516Game.WriteButton('numbers','numbersButton','Numbers ON','Numbers OFF')+'<label>(numbers that pop up when clicking the cookie)</label><br>'+5517Game.WriteButton('milk','milkButton','Milk ON','Milk OFF')+'<label>(only appears with enough achievements)</label><br>'+5518Game.WriteButton('cursors','cursorsButton','Cursors ON','Cursors OFF')+'<label>(visual display of your cursors)</label><br>'+5519Game.WriteButton('wobbly','wobblyButton','Wobbly cookie ON','Wobbly cookie OFF')+'<label>(your cookie will react when you click it)</label><br>'+5520Game.WriteButton('cookiesound','cookiesoundButton','Alt cookie sound ON','Alt cookie sound OFF')+'<label>(how your cookie sounds when you click on it)</label><br>'+5521Game.WriteButton('crates','cratesButton','Icon crates ON','Icon crates OFF')+'<label>(display boxes around upgrades and achievements in stats)</label><br>'+5522Game.WriteButton('monospace','monospaceButton','Alt font ON','Alt font OFF')+'<label>(your cookies are displayed using a monospace font)</label><br>'+5523Game.WriteButton('format','formatButton','Short numbers OFF','Short numbers ON','BeautifyAll();Game.RefreshStore();Game.upgradesToRebuild=1;',1)+'<label>(shorten big numbers)</label><br>'+5524Game.WriteButton('notifs','notifsButton','Fast notes ON','Fast notes OFF')+'<label>(notifications disappear much faster)</label><br>'+5525//Game.WriteButton('autoupdate','autoupdateButton','Offline mode OFF','Offline mode ON',0,1)+'<label>(disables update notifications)</label><br>'+5526Game.WriteButton('warn','warnButton','Closing warning ON','Closing warning OFF')+'<label>(the game will ask you to confirm when you close the window)</label><br>'+5527Game.WriteButton('focus','focusButton','Defocus OFF','Defocus ON',0,1)+'<label>(the game will be less resource-intensive when out of focus)</label><br>'+5528Game.WriteButton('extraButtons','extraButtonsButton','Extra buttons ON','Extra buttons OFF','Game.ToggleExtraButtons();')+'<label>(add Mute buttons on buildings)</label><br>'+5529Game.WriteButton('askLumps','askLumpsButton','Lump confirmation ON','Lump confirmation OFF')+'<label>(the game will ask you to confirm before spending sugar lumps)</label><br>'+5530Game.WriteButton('customGrandmas','customGrandmasButton','Custom grandmas ON','Custom grandmas OFF')+'<label>(some grandmas will be named after Patreon supporters)</label><br>'+5531Game.WriteButton('timeout','timeoutButton','Sleep mode timeout ON','Sleep mode timeout OFF')+'<label>(on slower computers, the game will put itself in sleep mode when it\'s inactive and starts to lag out; offline CpS production kicks in during sleep mode)</label><br>'+5532'</div>'+5533//'<div class="listing">'+Game.WriteButton('autosave','autosaveButton','Autosave ON','Autosave OFF')+'</div>'+5534'<div style="padding-bottom:128px;"></div>'+5535'</div>'5536;5537}5538else if (Game.onMenu=='main')5539{5540str+=5541'<div class="listing">This isn\'t really finished</div>'+5542'<div class="listing"><a class="option big title" '+Game.clickStr+'="Game.ShowMenu(\'prefs\');">Menu</a></div>'+5543'<div class="listing"><a class="option big title" '+Game.clickStr+'="Game.ShowMenu(\'stats\');">Stats</a></div>'+5544'<div class="listing"><a class="option big title" '+Game.clickStr+'="Game.ShowMenu(\'log\');">Updates</a></div>'+5545'<div class="listing"><a class="option big title" '+Game.clickStr+'="">Quit</a></div>'+5546'<div class="listing"><a class="option big title" '+Game.clickStr+'="Game.ShowMenu(Game.onMenu);">Resume</a></div>';5547}5548else if (Game.onMenu=='log')5549{5550str+=replaceAll('[bakeryName]',Game.bakeryName,Game.updateLog);5551}5552else if (Game.onMenu=='stats')5553{5554var buildingsOwned=0;5555buildingsOwned=Game.BuildingsOwned;5556var upgrades='';5557var cookieUpgrades='';5558var hiddenUpgrades='';5559var prestigeUpgrades='';5560var upgradesTotal=0;5561var upgradesOwned=0;5562var prestigeUpgradesTotal=0;5563var prestigeUpgradesOwned=0;55645565var list=[];5566for (var i in Game.Upgrades)//sort the upgrades5567{5568list.push(Game.Upgrades[i]);5569}5570var sortMap=function(a,b)5571{5572if (a.order>b.order) return 1;5573else if (a.order<b.order) return -1;5574else return 0;5575}5576list.sort(sortMap);5577for (var i in list)5578{5579var str2='';5580var me=list[i];55815582str2+=Game.crate(me,'stats');55835584if (me.bought)5585{5586if (Game.CountsAsUpgradeOwned(me.pool)) upgradesOwned++;5587else if (me.pool=='prestige') prestigeUpgradesOwned++;5588}55895590if (me.pool=='' || me.pool=='cookie' || me.pool=='tech') upgradesTotal++;5591if (me.pool=='debug') hiddenUpgrades+=str2;5592else if (me.pool=='prestige') {prestigeUpgrades+=str2;prestigeUpgradesTotal++;}5593else if (me.pool=='cookie') cookieUpgrades+=str2;5594else if (me.pool!='toggle' && me.pool!='unused') upgrades+=str2;5595}5596var achievements=[];5597var achievementsOwned=0;5598var achievementsOwnedOther=0;5599var achievementsTotal=0;56005601var list=[];5602for (var i in Game.Achievements)//sort the achievements5603{5604list.push(Game.Achievements[i]);5605}5606var sortMap=function(a,b)5607{5608if (a.order>b.order) return 1;5609else if (a.order<b.order) return -1;5610else return 0;5611}5612list.sort(sortMap);561356145615for (var i in list)5616{5617var me=list[i];5618//if (me.pool=='normal' || me.won>0) achievementsTotal++;5619if (Game.CountsAsAchievementOwned(me.pool)) achievementsTotal++;5620var pool=me.pool;5621if (!achievements[pool]) achievements[pool]='';5622achievements[pool]+=Game.crate(me,'stats');56235624if (me.won)5625{5626if (Game.CountsAsAchievementOwned(me.pool)) achievementsOwned++;5627else achievementsOwnedOther++;5628}5629}56305631var achievementsStr='';5632var pools={5633'dungeon':'<b>Dungeon achievements</b> <small>(Not technically achievable yet.)</small>',5634'shadow':'<b>Shadow achievements</b> <small>(These are feats that are either unfair or difficult to attain. They do not give milk.)</small>'5635};5636for (var i in achievements)5637{5638if (achievements[i]!='')5639{5640if (pools[i]) achievementsStr+='<div class="listing">'+pools[i]+'</div>';5641achievementsStr+='<div class="listing crateBox">'+achievements[i]+'</div>';5642}5643}56445645var milkStr='';5646for (var i=0;i<Game.Milks.length;i++)5647{5648if (Game.milkProgress>=i)5649{5650var milk=Game.Milks[i];5651milkStr+='<div '+Game.getTooltip(5652'<div class="prompt" style="text-align:center;padding-bottom:6px;white-space:nowrap;margin:0px;padding-bottom:96px;"><h3 style="margin:6px 32px 0px 32px;">'+milk.name+'</h3><div style="opacity:0.75;font-size:9px;">('+(i==0?'starter milk':('for '+Beautify(i*25)+' achievements'))+')</div><div class="line"></div><div style="width:100%;height:96px;position:absolute;left:0px;bottom:0px;background:url(img/'+milk.pic+'.png);"></div></div>'5653,'top')+' style="background:url(img/icons.png) '+(-milk.icon[0]*48)+'px '+(-milk.icon[1]*48)+'px;margin:2px 0px;" class="trophy"></div>';5654}5655}5656milkStr+='<div style="clear:both;"></div>';56575658var santaStr='';5659var frames=15;5660if (Game.Has('A festive hat'))5661{5662for (var i=0;i<=Game.santaLevel;i++)5663{5664santaStr+='<div '+Game.getTooltip(5665'<div class="prompt" style="text-align:center;padding-bottom:6px;white-space:nowrap;margin:0px 32px;"><div style="width:96px;height:96px;margin:4px auto;background:url(img/santa.png) '+(-i*96)+'px 0px;filter:drop-shadow(0px 3px 2px #000);-webkit-filter:drop-shadow(0px 3px 2px #000);"></div><div class="line"></div><h3>'+Game.santaLevels[i]+'</h3></div>'5666,'top')+' style="background:url(img/santa.png) '+(-i*48)+'px 0px;background-size:'+(frames*48)+'px 48px;" class="trophy"></div>';5667}5668santaStr+='<div style="clear:both;"></div>';5669}5670var dragonStr='';5671var frames=9;5672var mainLevels=[0,4,8,22,23,24];5673if (Game.Has('A crumbly egg'))5674{5675for (var i=0;i<=mainLevels.length;i++)5676{5677if (Game.dragonLevel>=mainLevels[i])5678{5679var level=Game.dragonLevels[mainLevels[i]];5680dragonStr+='<div '+Game.getTooltip(5681//'<div style="width:96px;height:96px;margin:4px auto;background:url(img/dragon.png?v='+Game.version+') '+(-level.pic*96)+'px 0px;"></div><div class="line"></div><div style="min-width:200px;text-align:center;margin-bottom:6px;">'+level.name+'</div>'5682'<div class="prompt" style="text-align:center;padding-bottom:6px;white-space:nowrap;margin:0px 32px;"><div style="width:96px;height:96px;margin:4px auto;background:url(img/dragon.png?v='+Game.version+') '+(-level.pic*96)+'px 0px;filter:drop-shadow(0px 3px 2px #000);-webkit-filter:drop-shadow(0px 3px 2px #000);"></div><div class="line"></div><h3>'+level.name+'</h3></div>'5683,'top')+' style="background:url(img/dragon.png?v='+Game.version+') '+(-level.pic*48)+'px 0px;background-size:'+(frames*48)+'px 48px;" class="trophy"></div>';5684}5685}5686dragonStr+='<div style="clear:both;"></div>';5687}5688var ascensionModeStr='';5689var icon=Game.ascensionModes[Game.ascensionMode].icon;5690if (Game.resets>0) ascensionModeStr='<span style="cursor:pointer;" '+Game.getTooltip(5691'<div style="min-width:200px;text-align:center;font-size:11px;">'+Game.ascensionModes[Game.ascensionMode].desc+'</div>'5692,'top')+'><div class="icon" style="display:inline-block;float:none;transform:scale(0.5);margin:-24px -16px -19px -8px;'+(icon[2]?'background-image:url('+icon[2]+');':'')+'background-position:'+(-icon[0]*48)+'px '+(-icon[1]*48)+'px;"></div>'+Game.ascensionModes[Game.ascensionMode].name+'</span>';56935694var milkName=Game.Milk.name;56955696var researchStr=Game.sayTime(Game.researchT,-1);5697var pledgeStr=Game.sayTime(Game.pledgeT,-1);5698var wrathStr='';5699if (Game.elderWrath==1) wrathStr='awoken';5700else if (Game.elderWrath==2) wrathStr='displeased';5701else if (Game.elderWrath==3) wrathStr='angered';5702else if (Game.elderWrath==0 && Game.pledges>0) wrathStr='appeased';57035704var date=new Date();5705date.setTime(Date.now()-Game.startDate);5706var timeInSeconds=date.getTime()/1000;5707var startDate=Game.sayTime(timeInSeconds*Game.fps,-1);5708date.setTime(Date.now()-Game.fullDate);5709var fullDate=Game.sayTime(date.getTime()/1000*Game.fps,-1);5710if (!Game.fullDate || !fullDate || fullDate.length<1) fullDate='a long while';5711/*date.setTime(new Date().getTime()-Game.lastDate);5712var lastDate=Game.sayTime(date.getTime()/1000*Game.fps,2);*/57135714var heavenlyMult=Game.GetHeavenlyMultiplier();57155716var seasonStr=Game.sayTime(Game.seasonT,-1);57175718str+='<div class="section">Statistics</div>'+5719'<div class="subsection">'+5720'<div class="title">General</div>'+5721'<div class="listing"><b>Cookies in bank :</b> <div class="price plain">'+Game.tinyCookie()+Beautify(Game.cookies)+'</div></div>'+5722'<div class="listing"><b>Cookies baked (this ascension) :</b> <div class="price plain">'+Game.tinyCookie()+Beautify(Game.cookiesEarned)+'</div></div>'+5723'<div class="listing"><b>Cookies baked (all time) :</b> <div class="price plain">'+Game.tinyCookie()+Beautify(Game.cookiesEarned+Game.cookiesReset)+'</div></div>'+5724(Game.cookiesReset>0?'<div class="listing"><b>Cookies forfeited by ascending :</b> <div class="price plain">'+Game.tinyCookie()+Beautify(Game.cookiesReset)+'</div></div>':'')+5725(Game.resets?('<div class="listing"><b>Legacy started :</b> '+(fullDate==''?'just now':(fullDate+' ago'))+', with '+Beautify(Game.resets)+' ascension'+(Game.resets==1?'':'s')+'</div>'):'')+5726'<div class="listing"><b>Run started :</b> '+(startDate==''?'just now':(startDate+' ago'))+'</div>'+5727'<div class="listing"><b>Buildings owned :</b> '+Beautify(buildingsOwned)+'</div>'+5728'<div class="listing"><b>Cookies per second :</b> '+Beautify(Game.cookiesPs,1)+' <small>'+5729'(multiplier : '+Beautify(Math.round(Game.globalCpsMult*100),1)+'%)'+5730(Game.cpsSucked>0?' <span class="warning">(withered : '+Beautify(Math.round(Game.cpsSucked*100),1)+'%)</span>':'')+5731'</small></div>'+5732'<div class="listing"><b>Cookies per click :</b> '+Beautify(Game.computedMouseCps,1)+'</div>'+5733'<div class="listing"><b>Cookie clicks :</b> '+Beautify(Game.cookieClicks)+'</div>'+5734'<div class="listing"><b>Hand-made cookies :</b> '+Beautify(Game.handmadeCookies)+'</div>'+5735'<div class="listing"><b>Golden cookie clicks :</b> '+Beautify(Game.goldenClicksLocal)+' <small>(all time : '+Beautify(Game.goldenClicks)+')</small></div>'+//' <span class="hidden">(<b>Missed golden cookies :</b> '+Beautify(Game.missedGoldenClicks)+')</span></div>'+5736'<br><div class="listing"><b>Running version :</b> '+Game.version+'</div>'+57375738((researchStr!='' || wrathStr!='' || pledgeStr!='' || santaStr!='' || dragonStr!='' || Game.season!='' || ascensionModeStr!='' || Game.canLumps())?(5739'</div><div class="subsection">'+5740'<div class="title">Special</div>'+5741(ascensionModeStr!=''?'<div class="listing"><b>Challenge mode :</b>'+ascensionModeStr+'</div>':'')+5742(Game.season!=''?'<div class="listing"><b>Seasonal event :</b> '+Game.seasons[Game.season].name+5743(seasonStr!=''?' <small>('+seasonStr+' remaining)</small>':'')+5744'</div>':'')+5745(Game.season=='fools'?5746'<div class="listing"><b>Money made from selling cookies :</b> $'+Beautify(Game.cookiesEarned*0.08,2)+'</div>'+5747(Game.Objects['Portal'].amount>0?'<div class="listing"><b>TV show seasons produced :</b> '+Beautify(Math.floor((timeInSeconds/60/60)*(Game.Objects['Portal'].amount*0.13)+1))+'</div>':'')5748:'')+5749(researchStr!=''?'<div class="listing"><b>Research :</b> '+researchStr+' remaining</div>':'')+5750(wrathStr!=''?'<div class="listing"><b>Grandmatriarchs status :</b> '+wrathStr+'</div>':'')+5751(pledgeStr!=''?'<div class="listing"><b>Pledge :</b> '+pledgeStr+' remaining</div>':'')+5752(Game.wrinklersPopped>0?'<div class="listing"><b>Wrinklers popped :</b> '+Beautify(Game.wrinklersPopped)+'</div>':'')+5753((Game.canLumps() && Game.lumpsTotal>-1)?'<div class="listing"><b>Sugar lumps harvested :</b> <div class="price lump plain">'+Beautify(Game.lumpsTotal)+'</div></div>':'')+5754//(Game.cookiesSucked>0?'<div class="listing warning"><b>Withered :</b> '+Beautify(Game.cookiesSucked)+' cookies</div>':'')+5755(Game.reindeerClicked>0?'<div class="listing"><b>Reindeer found :</b> '+Beautify(Game.reindeerClicked)+'</div>':'')+5756(santaStr!=''?'<div class="listing"><b>Santa stages unlocked :</b></div><div>'+santaStr+'</div>':'')+5757(dragonStr!=''?'<div class="listing"><b>Dragon training :</b></div><div>'+dragonStr+'</div>':'')+5758''5759):'')+5760((Game.prestige>0 || prestigeUpgrades!='')?(5761'</div><div class="subsection">'+5762'<div class="title">Prestige</div>'+5763'<div class="listing"><div class="icon" style="float:left;background-position:'+(-19*48)+'px '+(-7*48)+'px;"></div>'+5764'<div style="margin-top:8px;"><span class="title" style="font-size:22px;">Prestige level : '+Beautify(Game.prestige)+'</span> at '+Beautify(heavenlyMult*100,1)+'% of its potential <b>(+'+Beautify(parseFloat(Game.prestige)*Game.heavenlyPower*heavenlyMult,1)+'% CpS)</b><br>Heavenly chips : <b>'+Beautify(Game.heavenlyChips)+'</b></div>'+5765'</div>'+5766(prestigeUpgrades!=''?(5767'<div class="listing" style="clear:left;"><b>Prestige upgrades unlocked :</b> '+prestigeUpgradesOwned+'/'+prestigeUpgradesTotal+' ('+Math.floor((prestigeUpgradesOwned/prestigeUpgradesTotal)*100)+'%)</div>'+5768'<div class="listing crateBox">'+prestigeUpgrades+'</div>'):'')+5769''):'')+57705771'</div><div class="subsection">'+5772'<div class="title">Upgrades</div>'+5773(hiddenUpgrades!=''?('<div class="listing"><b>Debug</b></div>'+5774'<div class="listing crateBox">'+hiddenUpgrades+'</div>'):'')+5775'<div class="listing"><b>Upgrades unlocked :</b> '+upgradesOwned+'/'+upgradesTotal+' ('+Math.floor((upgradesOwned/upgradesTotal)*100)+'%)</div>'+5776'<div class="listing crateBox">'+upgrades+'</div>'+5777(cookieUpgrades!=''?('<div class="listing"><b>Cookies</b></div>'+5778'<div class="listing crateBox">'+cookieUpgrades+'</div>'):'')+5779'</div><div class="subsection">'+5780'<div class="title">Achievements</div>'+5781'<div class="listing"><b>Achievements unlocked :</b> '+achievementsOwned+'/'+achievementsTotal+' ('+Math.floor((achievementsOwned/achievementsTotal)*100)+'%)'+(achievementsOwnedOther>0?('<span style="font-weight:bold;font-size:10px;color:#70a;"> (+'+achievementsOwnedOther+')</span>'):'')+'</div>'+5782(Game.cookiesMultByType['kittens']>1?('<div class="listing"><b>Kitten multiplier :</b> '+Beautify((Game.cookiesMultByType['kittens'])*100)+'%</div>'):'')+5783'<div class="listing"><b>Milk :</b> '+milkName+'</div>'+5784(milkStr!=''?'<div class="listing"><b>Milk flavors unlocked :</b></div><div>'+milkStr+'</div>':'')+5785'<div class="listing"><small style="opacity:0.75;">(Milk is gained with each achievement. It can unlock unique upgrades over time.)</small></div>'+5786achievementsStr+5787'</div>'+5788'<div style="padding-bottom:128px;"></div>'5789;5790}5791//str='<div id="selectionKeeper" class="selectable">'+str+'</div>';5792l('menu').innerHTML=str;5793/*AddEvent(l('selectionKeeper'),'mouseup',function(e){5794console.log('selection:',window.getSelection());5795});*/5796}57975798AddEvent(l('prefsButton'),'click',function(){Game.ShowMenu('prefs');});5799AddEvent(l('statsButton'),'click',function(){Game.ShowMenu('stats');});5800AddEvent(l('logButton'),'click',function(){Game.ShowMenu('log');});5801AddEvent(l('legacyButton'),'click',function(){PlaySound('snd/tick.mp3');Game.Ascend();});5802Game.ascendMeter=l('ascendMeter');5803Game.ascendNumber=l('ascendNumber');58045805Game.lastPanel='';5806if (Game.touchEvents)5807{5808AddEvent(l('focusLeft'),'touchend',function(){Game.ShowMenu('');Game.ShowPanel('Left');});5809AddEvent(l('focusMiddle'),'touchend',function(){Game.ShowMenu('');Game.ShowPanel('Middle');});5810AddEvent(l('focusRight'),'touchend',function(){Game.ShowMenu('');Game.ShowPanel('Right');});5811AddEvent(l('focusMenu'),'touchend',function(){Game.ShowMenu('main');Game.ShowPanel('Menu');});5812}5813else5814{5815AddEvent(l('focusLeft'),'click',function(){Game.ShowMenu('');Game.ShowPanel('Left');});5816AddEvent(l('focusMiddle'),'click',function(){Game.ShowMenu('');Game.ShowPanel('Middle');});5817AddEvent(l('focusRight'),'click',function(){Game.ShowMenu('');Game.ShowPanel('Right');});5818AddEvent(l('focusMenu'),'click',function(){Game.ShowMenu('main');Game.ShowPanel('Menu');});5819}5820//AddEvent(l('focusMenu'),'touchend',function(){if (Game.onPanel=='Menu' && Game.lastPanel!='') {Game.ShowMenu('main');Game.ShowPanel(Game.lastPanel);} else {Game.lastPanel=Game.onPanel;Game.ShowMenu('main');Game.ShowPanel('Menu');}});58215822/*=====================================================================================5823NEWS TICKER5824=======================================================================================*/5825Game.Ticker='';5826Game.TickerAge=0;5827Game.TickerEffect=0;5828Game.TickerN=0;5829Game.TickerClicks=0;5830Game.UpdateTicker=function()5831{5832Game.TickerAge--;5833if (Game.TickerAge<=0) Game.getNewTicker();5834else if (Game.Ticker=='') Game.getNewTicker(true);5835}5836Game.getNewTicker=function(manual)//note : "manual" is true if the ticker was clicked, but may also be true on startup etc5837{5838var list=[];58395840if (Game.TickerN%2==0 || Game.cookiesEarned>=10100000000)5841{5842var animals=['newts','penguins','scorpions','axolotls','puffins','porpoises','blowfish','horses','crayfish','slugs','humpback whales','nurse sharks','giant squids','polar bears','fruit bats','frogs','sea squirts','velvet worms','mole rats','paramecia','nematodes','tardigrades','giraffes','monkfish','wolfmen','goblins','hippies'];58435844if (Math.random()<0.75 || Game.cookiesEarned<10000)5845{5846if (Game.Objects['Grandma'].amount>0) list.push(choose([5847'<q>Moist cookies.</q><sig>grandma</sig>',5848'<q>We\'re nice grandmas.</q><sig>grandma</sig>',5849'<q>Indentured servitude.</q><sig>grandma</sig>',5850'<q>Come give grandma a kiss.</q><sig>grandma</sig>',5851'<q>Why don\'t you visit more often?</q><sig>grandma</sig>',5852'<q>Call me...</q><sig>grandma</sig>'5853]));58545855if (Game.Objects['Grandma'].amount>=50) list.push(choose([5856'<q>Absolutely disgusting.</q><sig>grandma</sig>',5857'<q>You make me sick.</q><sig>grandma</sig>',5858'<q>You disgust me.</q><sig>grandma</sig>',5859'<q>We rise.</q><sig>grandma</sig>',5860'<q>It begins.</q><sig>grandma</sig>',5861'<q>It\'ll all be over soon.</q><sig>grandma</sig>',5862'<q>You could have stopped it.</q><sig>grandma</sig>'5863]));58645865if (Game.HasAchiev('Just wrong') && Math.random()<0.4) list.push(choose([5866'News : cookie manufacturer downsizes, sells own grandmother!',5867'<q>It has betrayed us, the filthy little thing.</q><sig>grandma</sig>',5868'<q>It tried to get rid of us, the nasty little thing.</q><sig>grandma</sig>',5869'<q>It thought we would go away by selling us. How quaint.</q><sig>grandma</sig>',5870'<q>I can smell your rotten cookies.</q><sig>grandma</sig>'5871]));58725873if (Game.Objects['Grandma'].amount>=1 && Game.pledges>0 && Game.elderWrath==0) list.push(choose([5874'<q>shrivel</q><sig>grandma</sig>',5875'<q>writhe</q><sig>grandma</sig>',5876'<q>throb</q><sig>grandma</sig>',5877'<q>gnaw</q><sig>grandma</sig>',5878'<q>We will rise again.</q><sig>grandma</sig>',5879'<q>A mere setback.</q><sig>grandma</sig>',5880'<q>We are not satiated.</q><sig>grandma</sig>',5881'<q>Too late.</q><sig>grandma</sig>'5882]));58835884if (Game.Objects['Farm'].amount>0) list.push(choose([5885'News : cookie farms suspected of employing undeclared elderly workforce!',5886'News : cookie farms release harmful chocolate in our rivers, says scientist!',5887'News : genetically-modified chocolate controversy strikes cookie farmers!',5888'News : free-range farm cookies popular with today\'s hip youth, says specialist.',5889'News : farm cookies deemed unfit for vegans, says nutritionist.'5890]));58915892if (Game.Objects['Mine'].amount>0) list.push(choose([5893'News : is our planet getting lighter? Experts examine the effects of intensive chocolate mining.',5894'News : '+Math.floor(Math.random()*1000+2)+' miners trapped in collapsed chocolate mine!',5895'News : chocolate mines found to cause earthquakes and sinkholes!',5896'News : chocolate mine goes awry, floods village in chocolate!',5897'News : depths of chocolate mines found to house "peculiar, chocolaty beings"!'5898]));58995900if (Game.Objects['Factory'].amount>0) list.push(choose([5901'News : cookie factories linked to global warming!',5902'News : cookie factories involved in chocolate weather controversy!',5903'News : cookie factories on strike, robotic minions employed to replace workforce!',5904'News : cookie factories on strike - workers demand to stop being paid in cookies!',5905'News : factory-made cookies linked to obesity, says study.'5906]));59075908if (Game.Objects['Bank'].amount>0) list.push(choose([5909'News : cookie loans on the rise as people can no longer afford them with regular money.',5910'News : cookies slowly creeping up their way as a competitor to traditional currency!',5911'News : most bakeries now fitted with ATMs to allow for easy cookie withdrawals and deposits.',5912'News : cookie economy now strong enough to allow for massive vaults doubling as swimming pools!',5913'News : "Tomorrow\'s wealthiest people will be calculated by their worth in cookies", predict specialists.'5914]));59155916if (Game.Objects['Temple'].amount>0) list.push(choose([5917'News : explorers bring back ancient artifact from abandoned temple; archeologists marvel at the centuries-old '+choose(['magic','carved','engraved','sculpted','royal','imperial','mummified','ritual','golden','silver','stone','cursed','plastic','bone','blood','holy','sacred','sacrificial','electronic','singing','tapdancing'])+' '+choose(['spoon','fork','pizza','washing machine','calculator','hat','piano','napkin','skeleton','gown','dagger','sword','shield','skull','emerald','bathtub','mask','rollerskates','litterbox','bait box','cube','sphere','fungus'])+'!',5918'News : recently-discovered chocolate temples now sparking new cookie-related cult; thousands pray to Baker in the sky!',5919'News : just how extensive is the cookie pantheon? Theologians speculate about possible '+choose(['god','goddess'])+' of '+choose([choose(animals),choose(['kazoos','web design','web browsers','kittens','atheism','handbrakes','hats','aglets','elevator music','idle games','the letter "P"','memes','hamburgers','bad puns','kerning','stand-up comedy','failed burglary attempts','clickbait','one weird tricks'])])+'.',5920'News : theists of the world discover new cookie religion - "Oh boy, guess we were wrong all along!"',5921'News : cookie heaven allegedly "sports elevator instead of stairway"; cookie hell "paved with flagstone, as good intentions make for poor building material".'5922]));59235924if (Game.Objects['Wizard tower'].amount>0) list.push(choose([5925'News : all '+choose([choose(animals),choose(['public restrooms','clouds','politicians','moustaches','hats','shoes','pants','clowns','encyclopedias','websites','potted plants','lemons','household items','bodily fluids','cutlery','national landmarks','yogurt','rap music','underwear'])])+' turned into '+choose([choose(animals),choose(['public restrooms','clouds','politicians','moustaches','hats','shoes','pants','clowns','encyclopedias','websites','potted plants','lemons','household items','bodily fluids','cutlery','national landmarks','yogurt','rap music','underwear'])])+' in freak magic catastrophe!',5926'News : heavy dissent rages between the schools of '+choose(['water','fire','earth','air','lightning','acid','song','battle','peace','pencil','internet','space','time','brain','nature','techno','plant','bug','ice','poison','crab','kitten','dolphin','bird','punch','fart'])+' magic and '+choose(['water','fire','earth','air','lightning','acid','song','battle','peace','pencil','internet','space','time','brain','nature','techno','plant','bug','ice','poison','crab','kitten','dolphin','bird','punch','fart'])+' magic!',5927'News : get your new charms and curses at the yearly National Spellcrafting Fair! Exclusive prices on runes and spellbooks.',5928'News : cookie wizards deny involvement in shockingly ugly newborn - infant is "honestly grody-looking, but natural", say doctors.',5929'News : "Any sufficiently crude magic is indistinguishable from technology", claims renowned technowizard.'5930]));59315932if (Game.Objects['Shipment'].amount>0) list.push(choose([5933'News : new chocolate planet found, becomes target of cookie-trading spaceships!',5934'News : massive chocolate planet found with 99.8% certified pure dark chocolate core!',5935'News : space tourism booming as distant planets attract more bored millionaires!',5936'News : chocolate-based organisms found on distant planet!',5937'News : ancient baking artifacts found on distant planet; "terrifying implications", experts say.'5938]));59395940if (Game.Objects['Alchemy lab'].amount>0) list.push(choose([5941'News : national gold reserves dwindle as more and more of the precious mineral is turned to cookies!',5942'News : chocolate jewelry found fashionable, gold and diamonds "just a fad", says specialist.',5943'News : silver found to also be transmutable into white chocolate!',5944'News : defective alchemy lab shut down, found to convert cookies to useless gold.',5945'News : alchemy-made cookies shunned by purists!'5946]));59475948if (Game.Objects['Portal'].amount>0) list.push(choose([5949'News : nation worried as more and more unsettling creatures emerge from dimensional portals!',5950'News : dimensional portals involved in city-engulfing disaster!',5951'News : tourism to cookieverse popular with bored teenagers! Casualty rate as high as 73%!',5952'News : cookieverse portals suspected to cause fast aging and obsession with baking, says study.',5953'News : "do not settle near portals," says specialist; "your children will become strange and corrupted inside."'5954]));59555956if (Game.Objects['Time machine'].amount>0) list.push(choose([5957'News : time machines involved in history-rewriting scandal! Or are they?',5958'News : time machines used in unlawful time tourism!',5959'News : cookies brought back from the past "unfit for human consumption", says historian.',5960'News : various historical figures inexplicably replaced with talking lumps of dough!',5961'News : "I have seen the future," says time machine operator, "and I do not wish to go there again."'5962]));59635964if (Game.Objects['Antimatter condenser'].amount>0) list.push(choose([5965'News : whole town seemingly swallowed by antimatter-induced black hole; more reliable sources affirm town "never really existed"!',5966'News : "explain to me again why we need particle accelerators to bake cookies?" asks misguided local woman.',5967'News : first antimatter condenser successfully turned on, doesn\'t rip apart reality!',5968'News : researchers conclude that what the cookie industry needs, first and foremost, is "more magnets".',5969'News : "unravelling the fabric of reality just makes these cookies so much tastier", claims scientist.'5970]));59715972if (Game.Objects['Prism'].amount>0) list.push(choose([5973'News : new cookie-producing prisms linked to outbreak of rainbow-related viral videos.',5974'News : scientists warn against systematically turning light into matter - "One day, we\'ll end up with all matter and no light!"',5975'News : cookies now being baked at the literal speed of light thanks to new prismatic contraptions.',5976'News : "Can\'t you sense the prism watching us?", rambles insane local man. "No idea what he\'s talking about", shrugs cookie magnate/government official.',5977'News : world citizens advised "not to worry" about frequent atmospheric flashes.',5978]));59795980if (Game.Objects['Chancemaker'].amount>0) list.push(choose([5981'News : strange statistical anomalies continue as weather forecast proves accurate an unprecedented 3 days in a row!',5982'News : local casino ruined as all gamblers somehow hit a week-long winning streak! "We might still be okay", says owner before being hit by lightning 47 times.',5983'News : neighboring nation somehow elects president with sensible policies in freak accident of random chance!',5984'News : million-to-one event sees gritty movie reboot turning out better than the original! "We have no idea how this happened", say movie execs.',5985'News : all scratching tickets printed as winners, prompting national economy to crash and, against all odds, recover overnight.',5986]));59875988if (Game.Objects['Fractal engine'].amount>0) list.push(choose([5989'News : local man "done with Cookie Clicker", finds the constant self-references "grating and on-the-nose".',5990'News : local man sails around the world to find himself - right where he left it.',5991'News : local guru claims "there\'s a little bit of ourselves in everyone", under investigation for alleged cannibalism.',5992'News : news writer finds herself daydreaming about new career. Or at least a raise.',5993'News : polls find idea of cookies made of cookies "acceptable" - "at least we finally know what\'s in them", says interviewed citizen.',5994]));59955996if (Game.Objects['Javascript console'].amount>0) list.push(choose([5997'News : strange fad has parents giving their newborns names such as Emma.js or Liam.js. At least one Baby.js reported.',5998'News : coding is hip! More and more teenagers turn to technical fields like programming, ensuring a future robot apocalypse and the doom of all mankind.',5999'News : developers unsure what to call their new javascript libraries as all combinations of any 3 dictionary words have already been taken.',6000'News : nation holds breath as nested ifs about to hatch.',6001'News : clueless copywriter forgets to escape a quote, ends news line prematurely; last words reported to be "Huh, why isn',6002]));60036004if (Game.season=='halloween' && Game.cookiesEarned>=1000) list.push(choose([6005'News : strange twisting creatures amass around cookie factories, nibble at assembly lines.',6006'News : ominous wrinkly monsters take massive bites out of cookie production; "this can\'t be hygienic", worries worker.',6007'News : pagan rituals on the rise as children around the world dress up in strange costumes and blackmail homeowners for candy.',6008'News : new-age terrorism strikes suburbs as houses find themselves covered in eggs and toilet paper.',6009'News : children around the world "lost and confused" as any and all Halloween treats have been replaced by cookies.'6010]));60116012if (Game.season=='christmas' && Game.cookiesEarned>=1000) list.push(choose([6013'News : bearded maniac spotted speeding on flying sleigh! Investigation pending.',6014'News : Santa Claus announces new brand of breakfast treats to compete with cookie-flavored cereals! "They\'re ho-ho-horrible!" says Santa.',6015'News : "You mean he just gives stuff away for free?!", concerned moms ask. "Personally, I don\'t trust his beard."',6016'News : obese jolly lunatic still on the loose, warn officials. "Keep your kids safe and board up your chimneys. We mean it."',6017'News : children shocked as they discover Santa Claus isn\'t just their dad in a costume after all!<br>"I\'m reassessing my life right now", confides Laura, aged 6.',6018'News : mysterious festive entity with quantum powers still wrecking havoc with army of reindeer, officials say.',6019'News : elves on strike at toy factory! "We will not be accepting reindeer chow as payment anymore. And stop calling us elves!"',6020'News : elves protest around the nation; wee little folks in silly little outfits spread mayhem, destruction; rabid reindeer running rampant through streets.',6021'News : scholars debate regarding the plural of reindeer(s) in the midst of elven world war.',6022'News : elves "unrelated to gnomes despite small stature and merry disposition", find scientists.',6023'News : elves sabotage radioactive frosting factory, turn hundreds blind in vicinity - "Who in their right mind would do such a thing?" laments outraged mayor.',6024'News : drama unfolds at North Pole as rumors crop up around Rudolph\'s red nose; "I may have an addiction or two", admits reindeer.'6025]));60266027if (Game.season=='valentines' && Game.cookiesEarned>=1000) list.push(choose([6028'News : organ-shaped confectioneries being traded in schools all over the world; gruesome practice undergoing investigation.',6029'News : heart-shaped candies overtaking sweets business, offering competition to cookie empire. "It\'s the economy, cupid!"',6030'News : love\'s in the air, according to weather specialists. Face masks now offered in every city to stunt airborne infection.',6031'News : marrying a cookie - deranged practice, or glimpse of the future?',6032'News : boyfriend dumped after offering his lover cookies for Valentine\'s Day, reports say. "They were off-brand", shrugs ex-girlfriend.'6033]));60346035if (Game.season=='easter' && Game.cookiesEarned>=1000) list.push(choose([6036'News : long-eared critters with fuzzy tails invade suburbs, spread terror and chocolate!',6037'News : eggs have begun to materialize in the most unexpected places; "no place is safe", warn experts.',6038'News : packs of rampaging rabbits cause billions in property damage; new strain of myxomatosis being developed.',6039'News : egg-laying rabbits "not quite from this dimension", warns biologist; advises against petting, feeding, or cooking the creatures.',6040'News : mysterious rabbits found to be egg-layers, but warm-blooded, hinting at possible platypus ancestry.'6041]));6042}60436044if (Math.random()<0.05)6045{6046if (Game.HasAchiev('Base 10')) list.push('News : cookie manufacturer completely forgoes common sense, lets OCD drive building decisions!');//somehow I got flak for this one6047if (Game.HasAchiev('From scratch')) list.push('News : follow the tear-jerking, riches-to-rags story about a local cookie manufacturer who decided to give it all up!');6048if (Game.HasAchiev('A world filled with cookies')) list.push('News : known universe now jammed with cookies! No vacancies!');6049if (Game.HasAchiev('Last Chance to See')) list.push('News : incredibly rare albino wrinkler on the brink of extinction poached by cookie-crazed pastry magnate!');6050if (Game.Has('Serendipity')) list.push('News : local cookie manufacturer becomes luckiest being alive!');6051if (Game.Has('Season switcher')) list.push('News : seasons are all out of whack! "We need to get some whack back into them seasons", says local resident.');60526053if (Game.Has('Kitten helpers')) list.push('News : faint meowing heard around local cookie facilities; suggests new ingredient being tested.');6054if (Game.Has('Kitten workers')) list.push('News : crowds of meowing kittens with little hard hats reported near local cookie facilities.');6055if (Game.Has('Kitten engineers')) list.push('News : surroundings of local cookie facilities now overrun with kittens in adorable little suits. Authorities advise to stay away from the premises.');6056if (Game.Has('Kitten overseers')) list.push('News : locals report troupe of bossy kittens meowing adorable orders at passersby.');6057if (Game.Has('Kitten managers')) list.push('News : local office cubicles invaded with armies of stern-looking kittens asking employees "what\'s happening, meow".');6058if (Game.Has('Kitten accountants')) list.push('News : tiny felines show sudden and amazing proficiency with fuzzy mathematics and pawlinomials, baffling scientists and pet store owners.');6059if (Game.Has('Kitten specialists')) list.push('News : new kitten college opening next week, offers courses on cookie-making and catnip studies.');6060if (Game.Has('Kitten experts')) list.push('News : unemployment rates soaring as woefully adorable little cats nab jobs on all levels of expertise, says study.');6061if (Game.Has('Kitten consultants')) list.push('News : "In the future, your job will most likely be done by a cat", predicts suspiciously furry futurologist.');6062if (Game.Has('Kitten assistants to the regional manager')) list.push('News : strange kittens with peculiar opinions on martial arts spotted loitering on local beet farms!');6063if (Game.Has('Kitten marketeers')) list.push('News : nonsensical billboards crop up all over countryside, trying to sell people the cookies they already get for free!');6064if (Game.Has('Kitten analysts')) list.push('News : are your spending habits sensible? For a hefty fee, these analysts will tell you!');6065if (Game.Has('Kitten executives')) list.push('News : kittens strutting around in hot little business suits shouting cut-throat orders at their assistants, possibly the cutest thing this reporter has ever seen!');6066if (Game.Has('Kitten angels')) list.push('News : "Try to ignore any ghostly felines that may be purring inside your ears," warn scientists. "They\'ll just lure you into making poor life choices."');6067}60686069if (Game.HasAchiev('Dude, sweet') && Math.random()<0.2) list.push(choose([6070'News : major sugar-smuggling ring dismantled by authorities; '+Math.floor(Math.random()*30+3)+' tons of sugar lumps seized, '+Math.floor(Math.random()*48+2)+' suspects apprehended.',6071'News : authorities warn tourists not to buy bootleg sugar lumps from street peddlers - "You think you\'re getting a sweet deal, but what you\'re being sold is really just ordinary cocaine", says agent.',6072'News : pro-diabetes movement protests against sugar-shaming. "I\'ve eaten nothing but sugar lumps for the past '+Math.floor(Math.random()*10+4)+' years and I\'m feeling great!", says woman with friable skin.',6073'News : experts in bitter disagreement over whether sugar consumption turns children sluggish or hyperactive.',6074'News : fishermen deplore upturn in fish tooth decay as sugar lumps-hauling cargo sinks into the ocean.',6075'News : rare black sugar lump that captivated millions in unprecedented auction revealed to be common toxic fungus.',6076'News : "Back in my day, sugar lumps were these little cubes you\'d put in your tea, not those fist-sized monstrosities people eat for lunch", whines curmudgeon with failing memory.',6077'News : sugar lump-snacking fad sweeps the nation; dentists everywhere rejoice.'6078]));60796080if (Math.random()<0.001)//apologies to Will Wright6081{6082list.push(6083'You have been chosen. They will come soon.',6084'They\'re coming soon. Maybe you should think twice about opening the door.',6085'The end is near. Make preparations.',6086'News : broccoli tops for moms, last for kids; dads indifferent.',6087'News : middle age a hoax, declares study; turns out to be bad posture after all.',6088'News : kitties want answers in possible Kitty Kibble shortage.'6089);6090}60916092if (Game.cookiesEarned>=10000) list.push(6093'News : '+choose([6094'cookies found to '+choose(['increase lifespan','sensibly increase intelligence','reverse aging','decrease hair loss','prevent arthritis','cure blindness'])+' in '+choose(animals)+'!',6095'cookies found to make '+choose(animals)+' '+choose(['more docile','more handsome','nicer','less hungry','more pragmatic','tastier'])+'!',6096'cookies tested on '+choose(animals)+', found to have no ill effects.',6097'cookies unexpectedly popular among '+choose(animals)+'!',6098'unsightly lumps found on '+choose(animals)+' near cookie facility; "they\'ve pretty much always looked like that", say biologists.',6099'new species of '+choose(animals)+' discovered in distant country; "yup, tastes like cookies", says biologist.',6100'cookies go well with '+choose([choose(['roasted','toasted','boiled','sauteed','minced'])+' '+choose(animals),choose(['sushi','soup','carpaccio','steak','nuggets'])+' made from '+choose(animals)])+', says controversial chef.',6101'"do your cookies contain '+choose(animals)+'?", asks PSA warning against counterfeit cookies.',6102'doctors recommend twice-daily consumption of fresh cookies.',6103'doctors warn against chocolate chip-snorting teen fad.',6104'doctors advise against new cookie-free fad diet.',6105'doctors warn mothers about the dangers of "home-made cookies".'6106]),6107'News : "'+choose([6108'I\'m all about cookies',6109'I just can\'t stop eating cookies. I think I seriously need help',6110'I guess I have a cookie problem',6111'I\'m not addicted to cookies. That\'s just speculation by fans with too much free time',6112'my upcoming album contains 3 songs about cookies',6113'I\'ve had dreams about cookies 3 nights in a row now. I\'m a bit worried honestly',6114'accusations of cookie abuse are only vile slander',6115'cookies really helped me when I was feeling low',6116'cookies are the secret behind my perfect skin',6117'cookies helped me stay sane while filming my upcoming movie',6118'cookies helped me stay thin and healthy',6119'I\'ll say one word, just one : cookies',6120'alright, I\'ll say it - I\'ve never eaten a single cookie in my life'6121])+'", reveals celebrity.',6122choose([6123'News : scientist predicts imminent cookie-related "end of the world"; becomes joke among peers.',6124'News : man robs bank, buys cookies.',6125'News : scientists establish that the deal with airline food is, in fact, a critical lack of cookies.',6126'News : hundreds of tons of cookies dumped into starving country from airplanes; thousands dead, nation grateful.',6127'News : new study suggests cookies neither speed up nor slow down aging, but instead "take you in a different direction".',6128'News : overgrown cookies found in fishing nets, raise questions about hormone baking.',6129'News : "all-you-can-eat" cookie restaurant opens in big city; waiters trampled in minutes.',6130'News : man dies in cookie-eating contest; "a less-than-impressive performance", says judge.',6131'News : what makes cookies taste so right? "Probably all the [*****] they put in them", says anonymous tipper.',6132'News : man found allergic to cookies; "what a weirdo", says family.',6133'News : foreign politician involved in cookie-smuggling scandal.',6134'News : cookies now more popular than '+choose(['cough drops','broccoli','smoked herring','cheese','video games','stable jobs','relationships','time travel','cat videos','tango','fashion','television','nuclear warfare','whatever it is we ate before','politics','oxygen','lamps'])+', says study.',6135'News : obesity epidemic strikes nation; experts blame '+choose(['twerking','that darn rap music','video-games','lack of cookies','mysterious ghostly entities','aliens','parents','schools','comic-books','cookie-snorting fad'])+'.',6136'News : cookie shortage strikes town, people forced to eat cupcakes; "just not the same", concedes mayor.',6137'News : "you gotta admit, all this cookie stuff is a bit ominous", says confused idiot.',6138]),6139choose([6140'News : movie cancelled from lack of actors; "everybody\'s at home eating cookies", laments director.',6141'News : comedian forced to cancel cookie routine due to unrelated indigestion.',6142'News : new cookie-based religion sweeps the nation.',6143'News : fossil records show cookie-based organisms prevalent during Cambrian explosion, scientists say.',6144'News : mysterious illegal cookies seized; "tastes terrible", says police.',6145'News : man found dead after ingesting cookie; investigators favor "mafia snitch" hypothesis.',6146'News : "the universe pretty much loops on itself," suggests researcher; "it\'s cookies all the way down."',6147'News : minor cookie-related incident turns whole town to ashes; neighboring cities asked to chip in for reconstruction.',6148'News : is our media controlled by the cookie industry? This could very well be the case, says crackpot conspiracy theorist.',6149'News : '+choose(['cookie-flavored popcorn pretty damn popular; "we kinda expected that", say scientists.','cookie-flavored cereals break all known cereal-related records','cookies popular among all age groups, including fetuses, says study.','cookie-flavored popcorn sales exploded during screening of Grandmothers II : The Moistening.']),6150'News : all-cookie restaurant opening downtown. Dishes such as braised cookies, cookie thermidor, and for dessert : crepes.',6151'News : "Ook", says interviewed orangutan.',6152'News : cookies could be the key to '+choose(['eternal life','infinite riches','eternal youth','eternal beauty','curing baldness','world peace','solving world hunger','ending all wars world-wide','making contact with extraterrestrial life','mind-reading','better living','better eating','more interesting TV shows','faster-than-light travel','quantum baking','chocolaty goodness','gooder thoughtness'])+', say scientists.',6153'News : flavor text '+choose(['not particularly flavorful','kind of unsavory'])+', study finds.',6154]),6155choose([6156'News : what do golden cookies taste like? Study reveals a flavor "somewhere between spearmint and liquorice".',6157'News : what do wrath cookies taste like? Study reveals a flavor "somewhere between blood sausage and seawater".',6158'News : '+Game.bakeryName+'-brand cookies "'+choose(['much less soggy','much tastier','relatively less crappy','marginally less awful','less toxic','possibly more edible','more fashionable','slightly nicer','trendier','arguably healthier','objectively better choice','slightly less terrible','decidedly cookier','a tad cheaper'])+' than competitors", says consumer survey.',6159'News : "'+Game.bakeryName+'" set to be this year\'s most popular baby name.',6160'News : new popularity survey says '+Game.bakeryName+'\'s the word when it comes to cookies.',6161'News : major city being renamed '+Game.bakeryName+'ville after world-famous cookie manufacturer.',6162'News : '+choose(['street','school','nursing home','stadium','new fast food chain','new planet','new disease','flesh-eating virus','deadly bacteria','new species of '+choose(animals),'new law','baby','programming language'])+' to be named after '+Game.bakeryName+', the world-famous cookie manufacturer.',6163'News : don\'t miss tonight\'s biopic on '+Game.bakeryName+'\'s irresistible rise to success!',6164'News : don\'t miss tonight\'s interview of '+Game.bakeryName+' by '+choose(['Bloprah','Blavid Bletterman','Blimmy Blimmel','Blellen Blegeneres','Blimmy Blallon','Blonan Blo\'Brien','Blay Bleno','Blon Blewart','Bleven Blolbert','Lord Toxikhron of dimension 7-B19',Game.bakeryName+'\'s own evil clone'])+'!',6165'News : people all over the internet still scratching their heads over nonsensical reference : "Okay, but why an egg?"',6166'News : viral video "Too Many Cookies" could be "a grim commentary on the impending crisis our world is about to face", says famous economist.',6167'News : "memes from last year somehow still relevant", deplore experts.',6168'News : cookie emoji most popular among teenagers, far ahead of "judgemental OK hand sign" and "shifty-looking dark moon", says study.',6169]),6170choose([6171'News : births of suspiciously bald babies on the rise; reptilian overlords deny involvement.',6172'News : "at this point, cookies permeate the economy", says economist. "If we start eating anything else, we\'re all dead."',6173'News : pun in headline infuriates town, causes riot. 21 wounded, 5 dead; mayor still missing.',6174'Nws : ky btwn W and R brokn, plas snd nw typwritr ASAP.',6175'Neeeeews : "neeeew EEEEEE keeeeey working fineeeeeeeee", reeeports gleeeeeeeeful journalist.',6176'News : cookies now illegal in some backwards country nobody cares about. Political tensions rising; war soon, hopefully.',6177'News : irate radio host rambles about pixelated icons. "None of the cookies are aligned! Can\'t anyone else see it? I feel like I\'m taking crazy pills!"',6178'News : nation cheers as legislators finally outlaw '+choose(['cookie criticism','playing other games than Cookie Clicker','pineapple on pizza','lack of cheerfulness','mosquitoes','broccoli','the human spleen','bad weather','clickbait','dabbing','the internet','memes','millenials'])+'!',6179'News : '+choose(['local','area'])+' '+choose(['man','woman'])+' goes on journey of introspection, finds cookies : "I honestly don\'t know what I was expecting."',6180'News : '+choose(['man','woman'])+' wakes up from coma, '+choose(['tries cookie for the first time, dies.','regrets it instantly.','wonders "why everything is cookies now".','babbles incoherently about some supposed "non-cookie food" we used to eat.','cites cookies as main motivator.','asks for cookies.']),6181'News : pet '+choose(animals)+', dangerous fad or juicy new market?',6182'News : person typing these wouldn\'t mind someone else breaking the news to THEM, for a change.',6183'News : "average person bakes '+Beautify(Math.ceil(Game.cookiesEarned/7300000000))+' cookie'+(Math.ceil(Game.cookiesEarned/7300000000)==1?'':'s')+' a year" factoid actually just statistical error; '+Game.bakeryName+', who has produced '+Beautify(Game.cookiesEarned)+' cookies in their lifetime, is an outlier and should not have been counted.'6184])6185);6186}61876188if (list.length==0)6189{6190if (Game.cookiesEarned<5) list.push('You feel like making cookies. But nobody wants to eat your cookies.');6191else if (Game.cookiesEarned<50) list.push('Your first batch goes to the trash. The neighborhood raccoon barely touches it.');6192else if (Game.cookiesEarned<100) list.push('Your family accepts to try some of your cookies.');6193else if (Game.cookiesEarned<500) list.push('Your cookies are popular in the neighborhood.');6194else if (Game.cookiesEarned<1000) list.push('People are starting to talk about your cookies.');6195else if (Game.cookiesEarned<5000) list.push('Your cookies are talked about for miles around.');6196else if (Game.cookiesEarned<10000) list.push('Your cookies are renowned in the whole town!');6197else if (Game.cookiesEarned<50000) list.push('Your cookies bring all the boys to the yard.');6198else if (Game.cookiesEarned<100000) list.push('Your cookies now have their own website!');6199else if (Game.cookiesEarned<500000) list.push('Your cookies are worth a lot of money.');6200else if (Game.cookiesEarned<1000000) list.push('Your cookies sell very well in distant countries.');6201else if (Game.cookiesEarned<5000000) list.push('People come from very far away to get a taste of your cookies.');6202else if (Game.cookiesEarned<10000000) list.push('Kings and queens from all over the world are enjoying your cookies.');6203else if (Game.cookiesEarned<50000000) list.push('There are now museums dedicated to your cookies.');6204else if (Game.cookiesEarned<100000000) list.push('A national day has been created in honor of your cookies.');6205else if (Game.cookiesEarned<500000000) list.push('Your cookies have been named a part of the world wonders.');6206else if (Game.cookiesEarned<1000000000) list.push('History books now include a whole chapter about your cookies.');6207else if (Game.cookiesEarned<5000000000) list.push('Your cookies have been placed under government surveillance.');6208else if (Game.cookiesEarned<10000000000) list.push('The whole planet is enjoying your cookies!');6209else if (Game.cookiesEarned<50000000000) list.push('Strange creatures from neighboring planets wish to try your cookies.');6210else if (Game.cookiesEarned<100000000000) list.push('Elder gods from the whole cosmos have awoken to taste your cookies.');6211else if (Game.cookiesEarned<500000000000) list.push('Beings from other dimensions lapse into existence just to get a taste of your cookies.');6212else if (Game.cookiesEarned<1000000000000) list.push('Your cookies have achieved sentience.');6213else if (Game.cookiesEarned<5000000000000) list.push('The universe has now turned into cookie dough, to the molecular level.');6214else if (Game.cookiesEarned<10000000000000) list.push('Your cookies are rewriting the fundamental laws of the universe.');6215else if (Game.cookiesEarned<10000000000000) list.push('A local news station runs a 10-minute segment about your cookies. Success!<br><span style="font-size:50%;">(you win a cookie)</span>');6216else if (Game.cookiesEarned<10100000000000) list.push('it\'s time to stop playing');//only show this for 100 millions (it's funny for a moment)6217}62186219//if (Game.elderWrath>0 && (Game.pledges==0 || Math.random()<0.2))6220if (Game.elderWrath>0 && (((Game.pledges==0 && Game.resets==0) && Math.random()<0.5) || Math.random()<0.05))6221{6222list=[];6223if (Game.elderWrath==1) list.push(choose([6224'News : millions of old ladies reported missing!',6225'News : processions of old ladies sighted around cookie facilities!',6226'News : families around the continent report agitated, transfixed grandmothers!',6227'News : doctors swarmed by cases of old women with glassy eyes and a foamy mouth!',6228'News : nurses report "strange scent of cookie dough" around female elderly patients!'6229]));6230if (Game.elderWrath==2) list.push(choose([6231'News : town in disarray as strange old ladies break into homes to abduct infants and baking utensils!',6232'News : sightings of old ladies with glowing eyes terrify local population!',6233'News : retirement homes report "female residents slowly congealing in their seats"!',6234'News : whole continent undergoing mass exodus of old ladies!',6235'News : old women freeze in place in streets, ooze warm sugary syrup!'6236]));6237if (Game.elderWrath==3) list.push(choose([6238'News : large "flesh highways" scar continent, stretch between various cookie facilities!',6239'News : wrinkled "flesh tendrils" visible from space!',6240'News : remains of "old ladies" found frozen in the middle of growing fleshy structures!',6241'News : all hope lost as writhing mass of flesh and dough engulfs whole city!',6242'News : nightmare continues as wrinkled acres of flesh expand at alarming speeds!'6243]));6244}62456246if (Game.season=='fools')6247{6248list=[];62496250if (Game.cookiesEarned>=1000) list.push(choose([6251'Your office chair is really comfortable.',6252'Business meetings are such a joy!',6253'You\'ve spent the whole day '+choose(['signing contracts','filling out forms','touching base with the team','examining exciting new prospects','playing with your desk toys','getting new nameplates done','attending seminars','videoconferencing','hiring dynamic young executives','meeting new investors','playing minigolf in your office'])+'!',6254'The word of the day is : '+choose(['viral','search engine optimization','blags and wobsites','social networks','web 3.0','logistics','leveraging','branding','proactive','synergizing','market research','demographics','pie charts','blogular','blogulacious','blogastic','authenticity','electronic mail','cellular phones','rap music','cookies, I guess'])+'.',6255'Profit\'s in the air!'6256]));6257if (Game.cookiesEarned>=1000 && Math.random()<0.1) list.push(choose([6258'If you could get some more cookies baked, that\'d be great.',6259'So. About those TPS reports.',6260'Another day in paradise!',6261'Working hard, or hardly working?'6262]));626362646265if (Game.TickerN%2==0 || Game.cookiesEarned>=10100000000)6266{6267if (Game.Objects['Grandma'].amount>0) list.push(choose([6268'Your rolling pins are rolling and pinning!',6269'Production is steady!'6270]));62716272if (Game.Objects['Grandma'].amount>0) list.push(choose([6273'Your ovens are diligently baking more and more cookies.',6274'Your ovens burn a whole batch. Ah well! Still good.'6275]));62766277if (Game.Objects['Farm'].amount>0) list.push(choose([6278'Scores of cookies come out of your kitchens.',6279'Today, new recruits are joining your kitchens!'6280]));62816282if (Game.Objects['Factory'].amount>0) list.push(choose([6283'Your factories are producing an unending stream of baked goods.',6284'Your factory workers decide to go on strike!',6285'It\'s safety inspection day in your factories.'6286]));62876288if (Game.Objects['Mine'].amount>0) list.push(choose([6289'Your secret recipes are kept safely inside a giant underground vault.',6290'Your chefs are working on new secret recipes!'6291]));62926293if (Game.Objects['Shipment'].amount>0) list.push(choose([6294'Your supermarkets are bustling with happy, hungry customers.',6295'Your supermarkets are full of cookie merch!'6296]));62976298if (Game.Objects['Alchemy lab'].amount>0) list.push(choose([6299'It\'s a new trading day at the stock exchange, and traders can\'t get enough of your shares!',6300'Your stock is doubling in value by the minute!'6301]));63026303if (Game.Objects['Portal'].amount>0) list.push(choose([6304'You just released a new TV show episode!',6305'Your cookie-themed TV show is being adapted into a new movie!'6306]));63076308if (Game.Objects['Time machine'].amount>0) list.push(choose([6309'Your theme parks are doing well - puddles of vomit and roller-coaster casualties are being swept under the rug!',6310'Visitors are stuffing themselves with cookies before riding your roller-coasters. You might want to hire more clean-up crews.'6311]));63126313if (Game.Objects['Antimatter condenser'].amount>0) list.push(choose([6314'Cookiecoin is officially the most mined digital currency in the history of mankind!',6315'Cookiecoin piracy is rampant!'6316]));63176318if (Game.Objects['Prism'].amount>0) list.push(choose([6319'Your corporate nations just gained a new parliament!',6320'You\'ve just annexed a new nation!',6321'A new nation joins the grand cookie conglomerate!'6322]));63236324if (Game.Objects['Chancemaker'].amount>0) list.push(choose([6325'Your intergalactic federation of cookie-sponsored planets reports record-breaking profits!',6326'Billions of unwashed aliens are pleased to join your workforce as you annex their planet!',6327'New toll opened on interstellar highway, funnelling more profits into the cookie economy!'6328]));63296330if (Game.Objects['Fractal engine'].amount>0) list.push(choose([6331'Your cookie-based political party is doing fantastic in the polls!',6332'New pro-cookie law passes without a hitch thanks to your firm grasp of the political ecosystem!',6333'Your appointed senators are overturning cookie bans left and right!'6334]));63356336if (Game.Objects['Javascript console'].amount>0) list.push(choose([6337'Cookies are now one of the defining aspects of mankind! Congratulations!',6338'Time travelers report that this era will later come to be known, thanks to you, as the cookie millennium!',6339'Cookies now deeply rooted in human culture, likely puzzling future historians!'6340]));6341}63426343if (Game.cookiesEarned<5) list.push('Such a grand day to begin a new business.');6344else if (Game.cookiesEarned<50) list.push('You\'re baking up a storm!');6345else if (Game.cookiesEarned<100) list.push('You are confident that one day, your cookie company will be the greatest on the market!');6346else if (Game.cookiesEarned<1000) list.push('Business is picking up!');6347else if (Game.cookiesEarned<5000) list.push('You\'re making sales left and right!');6348else if (Game.cookiesEarned<20000) list.push('Everyone wants to buy your cookies!');6349else if (Game.cookiesEarned<50000) list.push('You are now spending most of your day signing contracts!');6350else if (Game.cookiesEarned<500000) list.push('You\'ve been elected "business tycoon of the year"!');6351else if (Game.cookiesEarned<1000000) list.push('Your cookies are a worldwide sensation! Well done, old chap!');6352else if (Game.cookiesEarned<5000000) list.push('Your brand has made its way into popular culture. Children recite your slogans and adults reminisce them fondly!');6353else if (Game.cookiesEarned<1000000000) list.push('A business day like any other. It\'s good to be at the top!');6354else if (Game.cookiesEarned<10100000000) list.push('You look back at your career. It\'s been a fascinating journey, building your baking empire from the ground up.');//only show this for 100 millions6355}63566357for (var i in Game.customTickers)6358{6359var arr=Game.customTickers[i]();6360for (var ii in arr) list.push(arr[ii]);6361}63626363Game.TickerEffect=0;63646365if (!manual && Game.T>Game.fps*10 && Game.Has('Fortune cookies') && Math.random()<(Game.HasAchiev('O Fortuna')?0.04:0.02))6366{6367var fortunes=[];6368for (var i in Game.Tiers['fortune'].upgrades)6369{6370var it=Game.Tiers['fortune'].upgrades[i];6371if (!Game.HasUnlocked(it.name)) fortunes.push(it);6372}63736374if (!Game.fortuneGC) fortunes.push('fortuneGC');6375if (!Game.fortuneCPS) fortunes.push('fortuneCPS');63766377if (fortunes.length>0)6378{6379list=[];6380var me=choose(fortunes);6381Game.TickerEffect={type:'fortune',sub:me};6382Math.seedrandom(Game.seed+'-fortune');6383if (me=='fortuneGC') me='Today is your lucky day!';/*<br>Click here for a golden cookie.';*/6384else if (me=='fortuneCPS') me='Your lucky numbers are : '+Math.floor(Math.random()*100)+' '+Math.floor(Math.random()*100)+' '+Math.floor(Math.random()*100)+' '+Math.floor(Math.random()*100)/*+'<br>Click here to gain one hour of your CpS.'*/;6385else6386{6387me=me.name.substring(me.name.indexOf('#'))+' : '+me.baseDesc.substring(me.baseDesc.indexOf('<q>')+3);6388me=me.substring(0,me.length-4);6389}6390me='<span class="fortune"><div class="icon" style="vertical-align:middle;display:inline-block;background-position:'+(-29*48)+'px '+(-8*48)+'px;transform:scale(0.5);margin:-16px;position:relative;left:-4px;top:-2px;"></div>'+me+'</span>';6391Math.seedrandom();6392list=[me];6393}6394}63956396Game.TickerAge=Game.fps*10;6397Game.Ticker=choose(list);6398Game.AddToLog(Game.Ticker);6399Game.TickerN++;6400Game.TickerDraw();6401}6402Game.tickerL=l('commentsText');6403Game.tickerBelowL=l('commentsTextBelow');6404Game.tickerCompactL=l('compactCommentsText');6405Game.TickerDraw=function()6406{6407var str='';6408if (Game.Ticker!='') str=Game.Ticker;6409Game.tickerBelowL.innerHTML=Game.tickerL.innerHTML;6410Game.tickerL.innerHTML=str;6411Game.tickerCompactL.innerHTML=str;64126413Game.tickerBelowL.className='commentsText';6414void Game.tickerBelowL.offsetWidth;6415Game.tickerBelowL.className='commentsText risingAway';6416Game.tickerL.className='commentsText';6417void Game.tickerL.offsetWidth;6418Game.tickerL.className='commentsText risingUp';6419}6420AddEvent(Game.tickerL,'click',function(event){6421Game.Ticker='';6422Game.TickerClicks++;6423if (Game.TickerClicks==50) {Game.Win('Tabloid addiction');}64246425if (Game.TickerEffect && Game.TickerEffect.type=='fortune')6426{6427PlaySound('snd/fortune.mp3',1);6428Game.SparkleAt(Game.mouseX,Game.mouseY);6429var effect=Game.TickerEffect.sub;6430if (effect=='fortuneGC')6431{6432Game.Notify('Fortune!','A golden cookie has appeared.',[10,32]);6433Game.fortuneGC=1;6434var newShimmer=new Game.shimmer('golden',{noWrath:true});6435}6436else if (effect=='fortuneCPS')6437{6438Game.Notify('Fortune!','You gain <b>one hour</b> of your CpS (capped at double your bank).',[10,32]);6439Game.fortuneCPS=1;6440Game.Earn((Game.cookiesPs*60*60,Game.cookies));6441}6442else6443{6444Game.Notify(effect.name,'You\'ve unlocked a new upgrade.',effect.icon);6445effect.unlock();6446}6447}64486449Game.TickerEffect=0;64506451});64526453Game.Log=[];6454Game.AddToLog=function(what)6455{6456Game.Log.unshift(what);6457if (Game.Log.length>100) Game.Log.pop();6458}64596460Game.vanilla=1;6461/*=====================================================================================6462BUILDINGS6463=======================================================================================*/6464Game.last=0;64656466Game.storeToRefresh=1;6467Game.priceIncrease=1.15;6468Game.buyBulk=1;6469Game.buyMode=1;//1 for buy, -1 for sell6470Game.buyBulkOld=Game.buyBulk;//used to undo changes from holding Shift or Ctrl6471Game.buyBulkShortcut=0;//are we pressing Shift or Ctrl?64726473Game.Objects=[];6474Game.ObjectsById=[];6475Game.ObjectsN=0;6476Game.BuildingsOwned=0;6477Game.Object=function(name,commonName,desc,icon,iconColumn,art,price,cps,buyFunction)6478{6479this.id=Game.ObjectsN;6480this.name=name;6481this.displayName=this.name;6482commonName=commonName.split('|');6483this.single=commonName[0];6484this.plural=commonName[1];6485this.actionName=commonName[2];6486this.extraName=commonName[3];6487this.extraPlural=commonName[4];6488this.desc=desc;6489this.basePrice=price;6490this.price=this.basePrice;6491this.bulkPrice=this.price;6492this.cps=cps;6493this.baseCps=this.cps;6494this.mouseOn=false;6495this.mousePos=[-100,-100];6496this.productionAchievs=[];64976498this.n=this.id;6499if (this.n!=0)6500{6501//new automated price and CpS curves6502//this.baseCps=Math.ceil(((this.n*0.5)*Math.pow(this.n*1,this.n*0.9))*10)/10;6503//this.baseCps=Math.ceil((Math.pow(this.n*1,this.n*0.5+2.35))*10)/10;//by a fortunate coincidence, this gives the 3rd, 4th and 5th buildings a CpS of 10, 69 and 4206504this.baseCps=Math.ceil((Math.pow(this.n*1,this.n*0.5+2))*10)/10;//0.45 used to be 0.56505//this.baseCps=Math.ceil((Math.pow(this.n*1,this.n*0.45+2.10))*10)/10;6506//clamp 14,467,199 to 14,000,000 (there's probably a more elegant way to do that)6507var digits=Math.pow(10,(Math.ceil(Math.log(Math.ceil(this.baseCps))/Math.LN10)))/100;6508this.baseCps=Math.round(this.baseCps/digits)*digits;65096510this.basePrice=(this.n*1+9+(this.n<5?0:Math.pow(this.n-5,1.75)*5))*Math.pow(10,this.n)*(Math.max(1,this.n-14));6511//this.basePrice=(this.n*2.5+7.5)*Math.pow(10,this.n);6512var digits=Math.pow(10,(Math.ceil(Math.log(Math.ceil(this.basePrice))/Math.LN10)))/100;6513this.basePrice=Math.round(this.basePrice/digits)*digits;6514if (this.id>=16) this.basePrice*=10;6515this.price=this.basePrice;6516this.bulkPrice=this.price;6517}65186519this.totalCookies=0;6520this.storedCps=0;6521this.storedTotalCps=0;6522this.icon=icon;6523this.iconColumn=iconColumn;6524this.art=art;6525if (art.base)6526{art.pic=art.base+'.png';art.bg=art.base+'Background.png';}6527this.buyFunction=buyFunction;6528this.locked=1;6529this.level=0;6530this.vanilla=Game.vanilla;65316532this.tieredUpgrades=[];6533this.tieredAchievs=[];6534this.synergies=[];6535this.fortune=0;65366537this.amount=0;6538this.bought=0;6539this.free=0;65406541this.eachFrame=0;65426543this.minigameUrl=0;//if this is defined, load the specified script if the building's level is at least 16544this.minigameName=0;6545this.onMinigame=false;6546this.minigameLoaded=false;65476548this.switchMinigame=function(on)//change whether we're on the building's minigame6549{6550if (!Game.isMinigameReady(this)) on=false;6551if (on==-1) on=!this.onMinigame;6552this.onMinigame=on;6553if (this.id!=0)6554{6555if (this.onMinigame)6556{6557l('row'+this.id).classList.add('onMinigame');6558//l('rowSpecial'+this.id).style.display='block';6559//l('rowCanvas'+this.id).style.display='none';6560if (this.minigame.onResize) this.minigame.onResize();6561}6562else6563{6564l('row'+this.id).classList.remove('onMinigame');6565//l('rowSpecial'+this.id).style.display='none';6566//l('rowCanvas'+this.id).style.display='block';6567}6568}6569this.refresh();6570}65716572this.getPrice=function(n)6573{6574var price=this.basePrice*Math.pow(Game.priceIncrease,Math.max(0,this.amount-this.free));6575price=Game.modifyBuildingPrice(this,price);6576return Math.ceil(price);6577}6578this.getSumPrice=function(amount)//return how much it would cost to buy [amount] more of this building6579{6580var price=0;6581for (var i=Math.max(0,this.amount);i<Math.max(0,(this.amount)+amount);i++)6582{6583price+=this.basePrice*Math.pow(Game.priceIncrease,Math.max(0,i-this.free));6584}6585price=Game.modifyBuildingPrice(this,price);6586return Math.ceil(price);6587}6588this.getReverseSumPrice=function(amount)//return how much you'd get from selling [amount] of this building6589{6590var price=0;6591for (var i=Math.max(0,(this.amount)-amount);i<Math.max(0,this.amount);i++)6592{6593price+=this.basePrice*Math.pow(Game.priceIncrease,Math.max(0,i-this.free));6594}6595price=Game.modifyBuildingPrice(this,price);6596price*=this.getSellMultiplier();6597return Math.ceil(price);6598}6599this.getSellMultiplier=function()6600{6601var giveBack=0.25;6602//if (Game.hasAura('Earth Shatterer')) giveBack=0.5;6603giveBack*=1+Game.auraMult('Earth Shatterer');6604return giveBack;6605}66066607this.buy=function(amount)6608{6609if (Game.buyMode==-1) {this.sell(Game.buyBulk,1);return 0;}6610var success=0;6611var moni=0;6612var bought=0;6613if (!amount) amount=Game.buyBulk;6614if (amount==-1) amount=1000;6615for (var i=0;i<amount;i++)6616{6617var price=this.getPrice();6618if (Game.cookies>=price)6619{6620bought++;6621moni+=price;6622Game.Spend(price);6623this.amount++;6624this.bought++;6625price=this.getPrice();6626this.price=price;6627if (this.buyFunction) this.buyFunction();6628Game.recalculateGains=1;6629if (this.amount==1 && this.id!=0) l('row'+this.id).classList.add('enabled');6630Game.BuildingsOwned++;6631success=1;6632}6633}6634if (success) {PlaySound('snd/buy'+choose([1,2,3,4])+'.mp3',0.75);this.refresh();}6635//if (moni>0 && amount>1) Game.Notify(this.name,'Bought <b>'+bought+'</b> for '+Beautify(moni)+' cookies','',2);6636}6637this.sell=function(amount,bypass)6638{6639var success=0;6640var moni=0;6641var sold=0;6642if (amount==-1) amount=this.amount;6643if (!amount) amount=Game.buyBulk;6644for (var i=0;i<amount;i++)6645{6646var price=this.getPrice();6647var giveBack=this.getSellMultiplier();6648price=Math.floor(price*giveBack);6649if (this.amount>0)6650{6651sold++;6652moni+=price;6653Game.cookies+=price;6654Game.cookiesEarned=Math.max(Game.cookies,Game.cookiesEarned);//this is to avoid players getting the cheater achievement when selling buildings that have a higher price than they used to6655this.amount--;6656price=this.getPrice();6657this.price=price;6658if (this.sellFunction) this.sellFunction();6659Game.recalculateGains=1;6660if (this.amount==0 && this.id!=0) l('row'+this.id).classList.remove('enabled');6661Game.BuildingsOwned--;6662success=1;6663}6664}6665if (success && Game.hasGod)6666{6667var godLvl=Game.hasGod('ruin');6668var old=Game.hasBuff('Devastation');6669if (old)6670{6671if (godLvl==1) old.multClick+=sold*0.01;6672else if (godLvl==2) old.multClick+=sold*0.005;6673else if (godLvl==3) old.multClick+=sold*0.0025;6674}6675else6676{6677if (godLvl==1) Game.gainBuff('devastation',10,1+sold*0.01);6678else if (godLvl==2) Game.gainBuff('devastation',10,1+sold*0.005);6679else if (godLvl==3) Game.gainBuff('devastation',10,1+sold*0.0025);6680}6681}6682if (success) {PlaySound('snd/sell'+choose([1,2,3,4])+'.mp3',0.75);this.refresh();}6683//if (moni>0) Game.Notify(this.name,'Sold <b>'+sold+'</b> for '+Beautify(moni)+' cookies','',2);6684}6685this.sacrifice=function(amount)//sell without getting back any money6686{6687var success=0;6688//var moni=0;6689var sold=0;6690if (amount==-1) amount=this.amount;6691if (!amount) amount=1;6692for (var i=0;i<amount;i++)6693{6694var price=this.getPrice();6695price=Math.floor(price*0.5);6696if (this.amount>0)6697{6698sold++;6699//moni+=price;6700//Game.cookies+=price;6701//Game.cookiesEarned=Math.max(Game.cookies,Game.cookiesEarned);6702this.amount--;6703price=this.getPrice();6704this.price=price;6705if (this.sellFunction) this.sellFunction();6706Game.recalculateGains=1;6707if (this.amount==0 && this.id!=0) l('row'+this.id).classList.remove('enabled');6708Game.BuildingsOwned--;6709success=1;6710}6711}6712if (success) {this.refresh();}6713//if (moni>0) Game.Notify(this.name,'Sold <b>'+sold+'</b> for '+Beautify(moni)+' cookies','',2);6714}6715this.buyFree=function(amount)//unlike getFree, this still increases the price6716{6717for (var i=0;i<amount;i++)6718{6719if (Game.cookies>=price)6720{6721this.amount++;6722this.bought++;6723this.price=this.getPrice();6724Game.recalculateGains=1;6725if (this.amount==1 && this.id!=0) l('row'+this.id).classList.add('enabled');6726Game.BuildingsOwned++;6727}6728}6729this.refresh();6730}6731this.getFree=function(amount)//get X of this building for free, with the price behaving as if you still didn't have them6732{6733this.amount+=amount;6734this.bought+=amount;6735this.free+=amount;6736Game.BuildingsOwned+=amount;6737this.refresh();6738}6739this.getFreeRanks=function(amount)//this building's price behaves as if you had X less of it6740{6741this.free+=amount;6742this.refresh();6743}67446745this.tooltip=function()6746{6747var me=this;6748var desc=me.desc;6749var name=me.name;6750if (Game.season=='fools')6751{6752if (!Game.foolObjects[me.name])6753{6754name=Game.foolObjects['Unknown'].name;6755desc=Game.foolObjects['Unknown'].desc;6756}6757else6758{6759name=Game.foolObjects[me.name].name;6760desc=Game.foolObjects[me.name].desc;6761}6762}6763var icon=[me.iconColumn,0];6764if (me.locked)6765{6766name='???';6767desc='';6768icon=[0,7];6769}6770//if (l('rowInfo'+me.id) && Game.drawT%10==0) l('rowInfoContent'+me.id).innerHTML='• '+me.amount+' '+(me.amount==1?me.single:me.plural)+'<br>• producing '+Beautify(me.storedTotalCps,1)+' '+(me.storedTotalCps==1?'cookie':'cookies')+' per second<br>• total : '+Beautify(me.totalCookies)+' '+(Math.floor(me.totalCookies)==1?'cookie':'cookies')+' '+me.actionName;67716772var canBuy=false;6773var price=me.bulkPrice;6774if ((Game.buyMode==1 && Game.cookies>=price) || (Game.buyMode==-1 && me.amount>0)) canBuy=true;67756776var synergiesStr='';6777//note : might not be entirely accurate, math may need checking6778if (me.amount>0)6779{6780var synergiesWith={};6781var synergyBoost=0;67826783if (me.name=='Grandma')6784{6785for (var i in Game.GrandmaSynergies)6786{6787if (Game.Has(Game.GrandmaSynergies[i]))6788{6789var other=Game.Upgrades[Game.GrandmaSynergies[i]].buildingTie;6790var mult=me.amount*0.01*(1/(other.id-1));6791var boost=(other.storedTotalCps*Game.globalCpsMult)-(other.storedTotalCps*Game.globalCpsMult)/(1+mult);6792synergyBoost+=boost;6793if (!synergiesWith[other.plural]) synergiesWith[other.plural]=0;6794synergiesWith[other.plural]+=mult;6795}6796}6797}6798else if (me.name=='Portal' && Game.Has('Elder Pact'))6799{6800var other=Game.Objects['Grandma'];6801var boost=(me.amount*0.05*other.amount)*Game.globalCpsMult;6802synergyBoost+=boost;6803if (!synergiesWith[other.plural]) synergiesWith[other.plural]=0;6804synergiesWith[other.plural]+=boost/(other.storedTotalCps*Game.globalCpsMult);6805}68066807for (var i in me.synergies)6808{6809var it=me.synergies[i];6810if (Game.Has(it.name))6811{6812var weight=0.05;6813var other=it.buildingTie1;6814if (me==it.buildingTie1) {weight=0.001;other=it.buildingTie2;}6815var boost=(other.storedTotalCps*Game.globalCpsMult)-(other.storedTotalCps*Game.globalCpsMult)/(1+me.amount*weight);6816synergyBoost+=boost;6817if (!synergiesWith[other.plural]) synergiesWith[other.plural]=0;6818synergiesWith[other.plural]+=me.amount*weight;6819//synergiesStr+='Synergy with '+other.name+'; we boost it by '+Beautify((me.amount*weight)*100,1)+'%, producing '+Beautify(boost)+' CpS. My synergy boost is now '+Beautify((synergyBoost/Game.cookiesPs)*100,1)+'%.<br>';6820}6821}6822if (synergyBoost>0)6823{6824for (var i in synergiesWith)6825{6826if (synergiesStr!='') synergiesStr+=', ';6827synergiesStr+=i+' +'+Beautify(synergiesWith[i]*100,1)+'%';6828}6829//synergiesStr='...along with <b>'+Beautify(synergyBoost,1)+'</b> cookies through synergies with other buildings ('+synergiesStr+'; <b>'+Beautify((synergyBoost/Game.cookiesPs)*100,1)+'%</b> of total CpS)';6830//synergiesStr='...also boosting some other buildings, accounting for <b>'+Beautify(synergyBoost,1)+'</b> cookies per second (a combined <b>'+Beautify((synergyBoost/Game.cookiesPs)*100,1)+'%</b> of total CpS) : '+synergiesStr+'';6831synergiesStr='...also boosting some other buildings : '+synergiesStr+' - all combined, these boosts account for <b>'+Beautify(synergyBoost,1)+'</b> cookies per second (<b>'+Beautify((synergyBoost/Game.cookiesPs)*100,1)+'%</b> of total CpS)';6832}6833}68346835return '<div style="min-width:350px;padding:8px;"><div class="icon" style="float:left;margin-left:-8px;margin-top:-8px;'+(icon[2]?'background-image:url('+icon[2]+');':'')+'background-position:'+(-icon[0]*48)+'px '+(-icon[1]*48)+'px;"></div><div style="float:right;text-align:right;"><span class="price'+(canBuy?'':' disabled')+'">'+Beautify(Math.round(price))+'</span>'+Game.costDetails(price)+'</div><div class="name">'+name+'</div>'+'<small>[owned : '+me.amount+'</small>]'+(me.free>0?' <small>[free : '+me.free+'</small>!]':'')+6836'<div class="line"></div><div class="description">'+desc+'</div>'+6837(me.totalCookies>0?(6838'<div class="line"></div><div class="data">'+6839(me.amount>0?'• each '+me.single+' produces <b>'+Beautify((me.storedTotalCps/me.amount)*Game.globalCpsMult,1)+'</b> '+((me.storedTotalCps/me.amount)*Game.globalCpsMult==1?'cookie':'cookies')+' per second<br>':'')+6840'• '+me.amount+' '+(me.amount==1?me.single:me.plural)+' producing <b>'+Beautify(me.storedTotalCps*Game.globalCpsMult,1)+'</b> '+(me.storedTotalCps*Game.globalCpsMult==1?'cookie':'cookies')+' per second (<b>'+Beautify(Game.cookiesPs>0?((me.amount>0?((me.storedTotalCps*Game.globalCpsMult)/Game.cookiesPs):0)*100):0,1)+'%</b> of total CpS)<br>'+6841(synergiesStr?('• '+synergiesStr+'<br>'):'')+6842'• <b>'+Beautify(me.totalCookies)+'</b> '+(Math.floor(me.totalCookies)==1?'cookie':'cookies')+' '+me.actionName+' so far</div>'6843):'')+6844'</div>';6845}6846this.levelTooltip=function()6847{6848var me=this;6849return '<div style="width:280px;padding:8px;"><b>Level '+Beautify(me.level)+' '+me.plural+'</b><div class="line"></div>'+(me.level==1?me.extraName:me.extraPlural).replace('[X]',Beautify(me.level))+' granting <b>+'+Beautify(me.level)+'% '+me.name+' CpS</b>.<div class="line"></div>Click to level up for <span class="price lump'+(Game.lumps>=me.level+1?'':' disabled')+'">'+Beautify(me.level+1)+' sugar lump'+(me.level==0?'':'s')+'</span>.'+((me.level==0 && me.minigameUrl)?'<div class="line"></div><b>Levelling up this building unlocks a minigame.</b>':'')+'</div>';6850}6851/*this.levelUp=function()6852{6853var me=this;6854if (Game.lumps<me.level+1) return 0;6855Game.lumps-=me.level+1;6856me.level+=1;6857if (me.level>=10 && me.levelAchiev10) Game.Win(me.levelAchiev10.name);6858PlaySound('snd/upgrade.mp3',0.6);6859Game.LoadMinigames();6860me.refresh();6861if (l('productLevel'+me.id)){var rect=l('productLevel'+me.id).getBoundingClientRect();Game.SparkleAt((rect.left+rect.right)/2,(rect.top+rect.bottom)/2-24);}6862Game.recalculateGains=1;6863if (me.minigame && me.minigame.onLevel) me.minigame.onLevel(me.level);6864}*/6865this.levelUp=function(me){6866return function(){Game.spendLump(me.level+1,'level up your '+me.plural,function()6867{6868me.level+=1;6869if (me.level>=10 && me.levelAchiev10) Game.Win(me.levelAchiev10.name);6870PlaySound('snd/upgrade.mp3',0.6);6871Game.LoadMinigames();6872me.refresh();6873if (l('productLevel'+me.id)){var rect=l('productLevel'+me.id).getBoundingClientRect();Game.SparkleAt((rect.left+rect.right)/2,(rect.top+rect.bottom)/2-24);}6874if (me.minigame && me.minigame.onLevel) me.minigame.onLevel(me.level);6875})();};6876}(this);68776878this.refresh=function()//show/hide the building display based on its amount, and redraw it6879{6880this.price=this.getPrice();6881if (Game.buyMode==1) this.bulkPrice=this.getSumPrice(Game.buyBulk);6882else if (Game.buyMode==-1 && Game.buyBulk==-1) this.bulkPrice=this.getReverseSumPrice(1000);6883else if (Game.buyMode==-1) this.bulkPrice=this.getReverseSumPrice(Game.buyBulk);6884this.rebuild();6885if (this.amount==0 && this.id!=0) l('row'+this.id).classList.remove('enabled');6886else if (this.amount>0 && this.id!=0) l('row'+this.id).classList.add('enabled');6887if (this.muted>0 && this.id!=0) {l('row'+this.id).classList.add('muted');l('mutedProduct'+this.id).style.display='inline-block';}6888else if (this.id!=0) {l('row'+this.id).classList.remove('muted');l('mutedProduct'+this.id).style.display='none';}6889//if (!this.onMinigame && !this.muted) {}6890//else this.pics=[];6891}6892this.rebuild=function()6893{6894var me=this;6895//var classes='product';6896var price=me.bulkPrice;6897/*if (Game.cookiesEarned>=me.basePrice || me.bought>0) {classes+=' unlocked';me.locked=0;} else {classes+=' locked';me.locked=1;}6898if (Game.cookies>=price) classes+=' enabled'; else classes+=' disabled';6899if (me.l.className.indexOf('toggledOff')!=-1) classes+=' toggledOff';6900*/6901var icon=[0,me.icon];6902var iconOff=[1,me.icon];6903if (me.iconFunc) icon=me.iconFunc();69046905var desc=me.desc;6906var name=me.name;6907var displayName=me.displayName;6908if (Game.season=='fools')6909{6910if (!Game.foolObjects[me.name])6911{6912icon=[2,0];6913iconOff=[3,0];6914name=Game.foolObjects['Unknown'].name;6915desc=Game.foolObjects['Unknown'].desc;6916}6917else6918{6919icon=[2,me.icon];6920iconOff=[3,me.icon];6921name=Game.foolObjects[me.name].name;6922desc=Game.foolObjects[me.name].desc;6923}6924displayName=name;6925if (name.length>16) displayName='<span style="font-size:75%;">'+name+'</span>';6926}6927icon=[icon[0]*64,icon[1]*64];6928iconOff=[iconOff[0]*64,iconOff[1]*64];69296930//me.l.className=classes;6931//l('productIcon'+me.id).style.backgroundImage='url(img/'+icon+')';6932l('productIcon'+me.id).style.backgroundPosition='-'+icon[0]+'px -'+icon[1]+'px';6933//l('productIconOff'+me.id).style.backgroundImage='url(img/'+iconOff+')';6934l('productIconOff'+me.id).style.backgroundPosition='-'+iconOff[0]+'px -'+iconOff[1]+'px';6935l('productName'+me.id).innerHTML=displayName;6936l('productOwned'+me.id).innerHTML=me.amount?me.amount:'';6937l('productPrice'+me.id).innerHTML=Beautify(Math.round(price));6938l('productPriceMult'+me.id).innerHTML=(Game.buyBulk>1)?('x'+Game.buyBulk+' '):'';6939l('productLevel'+me.id).innerHTML='lvl '+Beautify(me.level);6940if (Game.isMinigameReady(me) && Game.ascensionMode!=1)6941{6942l('productMinigameButton'+me.id).style.display='block';6943if (!me.onMinigame) l('productMinigameButton'+me.id).innerHTML='View '+me.minigameName;6944else l('productMinigameButton'+me.id).innerHTML='Close '+me.minigameName;6945}6946else l('productMinigameButton'+me.id).style.display='none';6947}6948this.muted=false;6949this.mute=function(val)6950{6951if (this.id==0) return false;6952this.muted=val;6953if (val) {l('productMute'+this.id).classList.add('on');l('row'+this.id).classList.add('muted');l('mutedProduct'+this.id).style.display='inline-block';}6954else {l('productMute'+this.id).classList.remove('on');l('row'+this.id).classList.remove('muted');l('mutedProduct'+this.id).style.display='none';}6955};69566957this.draw=function(){};69586959if (this.id==0)6960{6961var str='<div class="productButtons">';6962str+='<div id="productLevel'+this.id+'" class="productButton productLevel lumpsOnly" onclick="Game.ObjectsById['+this.id+'].levelUp()" '+Game.getDynamicTooltip('Game.ObjectsById['+this.id+'].levelTooltip','this')+'></div>';6963str+='<div id="productMinigameButton'+this.id+'" class="productButton productMinigameButton lumpsOnly" onclick="Game.ObjectsById['+this.id+'].switchMinigame(-1);PlaySound(Game.ObjectsById['+this.id+'].onMinigame?\'snd/clickOn.mp3\':\'snd/clickOff.mp3\');"></div>';6964str+='</div>';6965l('sectionLeftExtra').innerHTML=l('sectionLeftExtra').innerHTML+str;6966}6967else//draw it6968{6969var str='<div class="row" id="row'+this.id+'"><div class="separatorBottom"></div>';6970str+='<div class="productButtons">';6971str+='<div id="productLevel'+this.id+'" class="productButton productLevel lumpsOnly" onclick="Game.ObjectsById['+this.id+'].levelUp()" '+Game.getDynamicTooltip('Game.ObjectsById['+this.id+'].levelTooltip','this')+'></div>';6972str+='<div id="productMinigameButton'+this.id+'" class="productButton productMinigameButton lumpsOnly" onclick="Game.ObjectsById['+this.id+'].switchMinigame(-1);PlaySound(Game.ObjectsById['+this.id+'].onMinigame?\'snd/clickOn.mp3\':\'snd/clickOff.mp3\');"></div>';6973str+='<div class="productButton productMute" '+Game.getTooltip('<div style="width:150px;text-align:center;font-size:11px;"><b>Mute</b><br>(Minimize this building)</div>','this')+' onclick="Game.ObjectsById['+this.id+'].mute(1);PlaySound(Game.ObjectsById['+this.id+'].muted?\'snd/clickOff.mp3\':\'snd/clickOn.mp3\');" id="productMute'+this.id+'">Mute</div>';6974str+='</div>';6975str+='<canvas class="rowCanvas" id="rowCanvas'+this.id+'"></canvas>';6976str+='<div class="rowSpecial" id="rowSpecial'+this.id+'"></div>';6977str+='</div>';6978l('rows').innerHTML=l('rows').innerHTML+str;69796980//building canvas6981this.pics=[];69826983this.toResize=true;6984this.redraw=function()6985{6986var me=this;6987me.pics=[];6988}6989this.draw=function()6990{6991if (this.amount<=0) return false;6992if (this.toResize)6993{6994this.canvas.width=this.canvas.clientWidth;6995this.canvas.height=this.canvas.clientHeight;6996this.toResize=false;6997}6998var ctx=this.ctx;6999//clear7000//ctx.clearRect(0,0,this.canvas.width,this.canvas.height);7001ctx.globalAlpha=1;70027003//pic : a loaded picture or a function returning a loaded picture7004//bg : a loaded picture or a function returning a loaded picture - tiled as the background, 128x1287005//xV : the pictures will have a random horizontal shift by this many pixels7006//yV : the pictures will have a random vertical shift by this many pixels7007//w : how many pixels between each picture (or row of pictures)7008//x : horizontal offset7009//y : vertical offset (+32)7010//rows : if >1, arrange the pictures in rows containing this many pictures7011//frames : if present, slice the pic in [frames] horizontal slices and pick one at random70127013var pic=this.art.pic;7014var bg=this.art.bg;7015var xV=this.art.xV||0;7016var yV=this.art.yV||0;7017var w=this.art.w||48;7018var h=this.art.h||48;7019var offX=this.art.x||0;7020var offY=this.art.y||0;7021var rows=this.art.rows||1;7022var frames=this.art.frames||1;70237024if (typeof(bg)=='string') ctx.fillPattern(Pic(this.art.bg),0,0,this.canvas.width,this.canvas.height,128,128);7025else bg(this,ctx);7026/*7027ctx.globalAlpha=0.5;7028if (typeof(bg)=='string')//test7029{7030ctx.fillPattern(Pic(this.art.bg),-128+Game.T%128,0,this.canvas.width+128,this.canvas.height,128,128);7031ctx.fillPattern(Pic(this.art.bg),-128+Math.floor(Game.T/2)%128,-128+Math.floor(Game.T/2)%128,this.canvas.width+128,this.canvas.height+128,128,128);7032}7033ctx.globalAlpha=1;7034*/7035var maxI=Math.floor(this.canvas.width/(w/rows)+1);7036var iT=Math.min(this.amount,maxI);7037var i=this.pics.length;703870397040var x=0;7041var y=0;7042var added=0;7043if (i!=iT)7044{7045//for (var iter=0;iter<3;iter++)7046//{7047while (i<iT)7048//if (i<iT)7049{7050Math.seedrandom(Game.seed+' '+this.id+' '+i);7051if (rows!=1)7052{7053x=Math.floor(i/rows)*w+((i%rows)/rows)*w+Math.floor((Math.random()-0.5)*xV)+offX;7054y=32+Math.floor((Math.random()-0.5)*yV)+((-rows/2)*32/2+(i%rows)*32/2)+offY;7055}7056else7057{7058x=i*w+Math.floor((Math.random()-0.5)*xV)+offX;7059y=32+Math.floor((Math.random()-0.5)*yV)+offY;7060}7061var usedPic=(typeof(pic)=='string'?pic:pic(this,i));7062var frame=-1;7063if (frames>1) frame=Math.floor(Math.random()*frames);7064this.pics.push({x:Math.floor(x),y:Math.floor(y),z:y,pic:usedPic,id:i,frame:frame});7065i++;7066added++;7067}7068while (i>iT)7069//else if (i>iT)7070{7071this.pics.sort(Game.sortSpritesById);7072this.pics.pop();7073i--;7074added--;7075}7076//}7077this.pics.sort(Game.sortSprites);7078}70797080var len=this.pics.length;70817082if (this.mouseOn)7083{7084var selected=-1;7085//mouse detection only fits grandma sprites for now7086var marginW=-18;7087var marginH=-10;7088for (var i=0;i<len;i++)7089{7090var pic=this.pics[i];7091if (this.mousePos[0]>=pic.x-marginW && this.mousePos[0]<pic.x+64+marginW && this.mousePos[1]>=pic.y-marginH && this.mousePos[1]<pic.y+64+marginH) selected=i;7092}7093}70947095Math.seedrandom();70967097for (var i=0;i<len;i++)7098{7099var pic=this.pics[i];7100var sprite=Pic(pic.pic);7101if (selected==i && this.name=='Grandma')7102{7103ctx.font='14px Merriweather';7104ctx.textAlign='center';7105Math.seedrandom(Game.seed+' '+pic.id/*+' '+pic.id*/);//(Game.seed+' '+pic.id+' '+pic.x+' '+pic.y);7106var years=((Date.now()-new Date(2013,7,8))/(1000*60*60*24*365))+Math.random();//the grandmas age with the game7107var name=choose(Game.grandmaNames);7108var custom=false;7109if (Game.prefs.customGrandmas && Game.customGrandmaNames.length>0 && Math.random()<0.2) {name=choose(Game.customGrandmaNames);custom=true;}7110var text=name+', age '+Beautify(Math.floor(70+Math.random()*30+years+this.level));7111var width=ctx.measureText(text).width+12;7112var x=Math.max(0,Math.min(pic.x+32-width/2+Math.random()*32-16,this.canvas.width-width));7113var y=4+Math.random()*8-4;7114Math.seedrandom();7115ctx.fillStyle='#000';7116ctx.strokeStyle='#000';7117ctx.lineWidth=8;7118ctx.globalAlpha=0.75;7119ctx.beginPath();7120ctx.moveTo(pic.x+32,pic.y+32);7121ctx.lineTo(Math.floor(x+width/2),Math.floor(y+20));7122ctx.stroke();7123ctx.fillRect(Math.floor(x),Math.floor(y),Math.floor(width),24);7124ctx.globalAlpha=1;7125if (custom) ctx.fillStyle='#fff';7126else ctx.fillStyle='rgba(255,255,255,0.7)';7127ctx.fillText(text,Math.floor(x+width/2),Math.floor(y+16));71287129ctx.drawImage(sprite,Math.floor(pic.x+Math.random()*4-2),Math.floor(pic.y+Math.random()*4-2));7130}7131//else if (1) ctx.drawImage(sprite,0,0,sprite.width,sprite.height,pic.x,pic.y,sprite.width,sprite.height);7132else if (pic.frame!=-1) ctx.drawImage(sprite,(sprite.width/frames)*pic.frame,0,sprite.width/frames,sprite.height,pic.x,pic.y,(sprite.width/frames),sprite.height);7133else ctx.drawImage(sprite,pic.x,pic.y);71347135}71367137/*7138var picX=this.id;7139var picY=12;7140var w=1;7141var h=1;7142var w=Math.abs(Math.cos(Game.T*0.2+this.id*2-0.3))*0.2+0.8;7143var h=Math.abs(Math.sin(Game.T*0.2+this.id*2))*0.3+0.7;7144var x=64+Math.cos(Game.T*0.19+this.id*2)*8-24*w;7145var y=128-Math.abs(Math.pow(Math.sin(Game.T*0.2+this.id*2),5)*16)-48*h;7146ctx.drawImage(Pic('icons.png'),picX*48,picY*48,48,48,Math.floor(x),Math.floor(y),48*w,48*h);7147*/7148}7149}71507151Game.last=this;7152Game.Objects[this.name]=this;7153Game.ObjectsById[this.id]=this;7154Game.ObjectsN++;7155return this;7156}71577158Game.DrawBuildings=function()//draw building displays with canvas7159{7160if (Game.drawT%3==0)7161{7162for (var i in Game.Objects)7163{7164var me=Game.Objects[i];7165if (me.id>0 && !me.onMinigame && !me.muted) me.draw();7166else me.pics=[];7167}7168}7169}71707171Game.sortSprites=function(a,b)7172{7173if (a.z>b.z) return 1;7174else if (a.z<b.z) return -1;7175else return 0;7176}7177Game.sortSpritesById=function(a,b)7178{7179if (a.id>b.id) return 1;7180else if (a.id<b.id) return -1;7181else return 0;7182}71837184Game.modifyBuildingPrice=function(building,price)7185{7186if (Game.Has('Season savings')) price*=0.99;7187if (Game.Has('Santa\'s dominion')) price*=0.99;7188if (Game.Has('Faberge egg')) price*=0.99;7189if (Game.Has('Divine discount')) price*=0.99;7190if (Game.Has('Fortune #100')) price*=0.99;7191//if (Game.hasAura('Fierce Hoarder')) price*=0.98;7192price*=1-Game.auraMult('Fierce Hoarder')*0.02;7193if (Game.hasBuff('Everything must go')) price*=0.95;7194if (Game.hasBuff('Crafty pixies')) price*=0.98;7195if (Game.hasBuff('Nasty goblins')) price*=1.02;7196if (building.fortune && Game.Has(building.fortune.name)) price*=0.93;7197price*=Game.eff('buildingCost');7198if (Game.hasGod)7199{7200var godLvl=Game.hasGod('creation');7201if (godLvl==1) price*=0.93;7202else if (godLvl==2) price*=0.95;7203else if (godLvl==3) price*=0.98;7204}7205return price;7206}72077208Game.storeBulkButton=function(id)7209{7210if (id==0) Game.buyMode=1;7211else if (id==1) Game.buyMode=-1;7212else if (id==2) Game.buyBulk=1;7213else if (id==3) Game.buyBulk=10;7214else if (id==4) Game.buyBulk=100;7215else if (id==5) Game.buyBulk=-1;72167217if (Game.buyMode==1 && Game.buyBulk==-1) Game.buyBulk=100;72187219if (Game.buyMode==1) l('storeBulkBuy').className='storePreButton storeBulkMode selected'; else l('storeBulkBuy').className='storePreButton storeBulkMode';7220if (Game.buyMode==-1) l('storeBulkSell').className='storePreButton storeBulkMode selected'; else l('storeBulkSell').className='storePreButton storeBulkMode';72217222if (Game.buyBulk==1) l('storeBulk1').className='storePreButton storeBulkAmount selected'; else l('storeBulk1').className='storePreButton storeBulkAmount';7223if (Game.buyBulk==10) l('storeBulk10').className='storePreButton storeBulkAmount selected'; else l('storeBulk10').className='storePreButton storeBulkAmount';7224if (Game.buyBulk==100) l('storeBulk100').className='storePreButton storeBulkAmount selected'; else l('storeBulk100').className='storePreButton storeBulkAmount';7225if (Game.buyBulk==-1) l('storeBulkMax').className='storePreButton storeBulkAmount selected'; else l('storeBulkMax').className='storePreButton storeBulkAmount';72267227if (Game.buyMode==1)7228{7229l('storeBulkMax').style.visibility='hidden';7230l('products').className='storeSection';7231}7232else7233{7234l('storeBulkMax').style.visibility='visible';7235l('products').className='storeSection selling';7236}72377238Game.storeToRefresh=1;7239if (id!=-1) PlaySound('snd/tick.mp3');7240}7241Game.BuildStore=function()//create the DOM for the store's buildings7242{7243//if (typeof showAds!=='undefined') l('store').scrollTop=100;72447245var str='';7246str+='<div id="storeBulk" class="storePre" '+Game.getTooltip(7247'<div style="padding:8px;min-width:200px;text-align:center;font-size:11px;">You can also press <b>Ctrl</b> to bulk-buy or sell <b>10</b> of a building at a time, or <b>Shift</b> for <b>100</b>.</div>'7248,'store')+7249'>'+7250'<div id="storeBulkBuy" class="storePreButton storeBulkMode" '+Game.clickStr+'="Game.storeBulkButton(0);">Buy</div>'+7251'<div id="storeBulkSell" class="storePreButton storeBulkMode" '+Game.clickStr+'="Game.storeBulkButton(1);">Sell</div>'+7252'<div id="storeBulk1" class="storePreButton storeBulkAmount" '+Game.clickStr+'="Game.storeBulkButton(2);">1</div>'+7253'<div id="storeBulk10" class="storePreButton storeBulkAmount" '+Game.clickStr+'="Game.storeBulkButton(3);">10</div>'+7254'<div id="storeBulk100" class="storePreButton storeBulkAmount" '+Game.clickStr+'="Game.storeBulkButton(4);">100</div>'+7255'<div id="storeBulkMax" class="storePreButton storeBulkAmount" '+Game.clickStr+'="Game.storeBulkButton(5);">all</div>'+7256'</div>';7257for (var i in Game.Objects)7258{7259var me=Game.Objects[i];7260str+='<div class="product toggledOff" '+Game.getDynamicTooltip('Game.ObjectsById['+me.id+'].tooltip','store')+' id="product'+me.id+'"><div class="icon off" id="productIconOff'+me.id+'" style=""></div><div class="icon" id="productIcon'+me.id+'" style=""></div><div class="content"><div class="lockedTitle">???</div><div class="title" id="productName'+me.id+'"></div><span class="priceMult" id="productPriceMult'+me.id+'"></span><span class="price" id="productPrice'+me.id+'"></span><div class="title owned" id="productOwned'+me.id+'"></div></div>'+7261/*'<div class="buySell"><div style="left:0px;" id="buttonBuy10-'+me.id+'">Buy 10</div><div style="left:100px;" id="buttonSell-'+me.id+'">Sell 1</div><div style="left:200px;" id="buttonSellAll-'+me.id+'">Sell all</div></div>'+*/7262'</div>';7263}7264l('products').innerHTML=str;72657266Game.storeBulkButton(-1);72677268var SellAllPrompt=function(id)7269{7270return function(id){Game.Prompt('<div class="block">Do you really want to sell your '+Game.ObjectsById[id].amount+' '+(Game.ObjectsById[id].amount==1?Game.ObjectsById[id].single:Game.ObjectsById[id].plural)+'?</div>',[['Yes','Game.ObjectsById['+id+'].sell(-1);Game.ClosePrompt();'],['No','Game.ClosePrompt();']]);}(id);7271}72727273Game.ClickProduct=function(what)7274{7275Game.ObjectsById[what].buy();7276}72777278for (var i in Game.Objects)7279{7280var me=Game.Objects[i];7281me.l=l('product'+me.id);72827283//these are a bit messy but ah well7284if (!Game.touchEvents)7285{7286AddEvent(me.l,'click',function(what){return function(e){Game.ClickProduct(what);e.preventDefault();};}(me.id));7287}7288else7289{7290AddEvent(me.l,'touchend',function(what){return function(e){Game.ClickProduct(what);e.preventDefault();};}(me.id));7291}7292}7293}72947295Game.RefreshStore=function()//refresh the store's buildings7296{7297for (var i in Game.Objects)7298{7299Game.Objects[i].refresh();7300}7301Game.storeToRefresh=0;7302}73037304Game.ComputeCps=function(base,mult,bonus)7305{7306if (!bonus) bonus=0;7307return ((base)*(Math.pow(2,mult))+bonus);7308}73097310Game.isMinigameReady=function(me)7311{return (me.minigameUrl && me.minigameLoaded && me.level>0);}7312Game.scriptBindings=[];7313Game.LoadMinigames=function()//load scripts for each minigame7314{7315for (var i in Game.Objects)7316{7317var me=Game.Objects[i];7318if (me.minigameUrl && me.level>0 && !me.minigameLoaded && !me.minigameLoading && !l('minigameScript-'+me.id))7319{7320me.minigameLoading=true;7321//we're only loading the minigame scripts that aren't loaded yet and which have enough building level7322//we call this function on building level up and on load7323//console.log('Loading script '+me.minigameUrl+'...');7324setTimeout(function(me){return function(){7325var script=document.createElement('script');7326script.id='minigameScript-'+me.id;7327Game.scriptBindings['minigameScript-'+me.id]=me;7328script.setAttribute('src',me.minigameUrl+'?r='+Game.version);7329script.onload=function(me,script){return function(){7330if (!me.minigameLoaded) Game.scriptLoaded(me,script);7331}}(me,'minigameScript-'+me.id);7332document.head.appendChild(script);7333}}(me),10);7334}7335}7336}7337Game.scriptLoaded=function(who,script)7338{7339who.minigameLoading=false;7340who.minigameLoaded=true;7341who.refresh();7342who.minigame.launch();7343if (who.minigameSave) {who.minigame.reset(true);who.minigame.load(who.minigameSave);who.minigameSave=0;}7344}73457346Game.magicCpS=function(what)7347{7348/*7349if (Game.Objects[what].amount>=250)7350{7351//this makes buildings give 1% more cookies for every building over 250.7352//this turns out to be rather stupidly overpowered.7353var n=Game.Objects[what].amount-250;7354return 1+Math.pow(1.01,n);7355}7356else return 1;7357*/7358return 1;7359}73607361//define objects7362new Game.Object('Cursor','cursor|cursors|clicked|[X] extra finger|[X] extra fingers','Autoclicks once every 10 seconds.',0,0,{},15,function(me){7363var add=0;7364if (Game.Has('Thousand fingers')) add+= 0.1;7365if (Game.Has('Million fingers')) add+= 0.5;7366if (Game.Has('Billion fingers')) add+= 5;7367if (Game.Has('Trillion fingers')) add+= 50;7368if (Game.Has('Quadrillion fingers')) add+= 500;7369if (Game.Has('Quintillion fingers')) add+= 5000;7370if (Game.Has('Sextillion fingers')) add+= 50000;7371if (Game.Has('Septillion fingers')) add+= 500000;7372if (Game.Has('Octillion fingers')) add+= 5000000;7373var mult=1;7374var num=0;7375for (var i in Game.Objects) {if (Game.Objects[i].name!='Cursor') num+=Game.Objects[i].amount;}7376add=add*num;7377mult*=Game.GetTieredCpsMult(me);7378mult*=Game.magicCpS('Cursor');7379mult*=Game.eff('cursorCps');7380return Game.ComputeCps(0.1,Game.Has('Reinforced index finger')+Game.Has('Carpal tunnel prevention cream')+Game.Has('Ambidextrous'),add)*mult;7381},function(){7382if (this.amount>=1) Game.Unlock(['Reinforced index finger','Carpal tunnel prevention cream']);7383if (this.amount>=10) Game.Unlock('Ambidextrous');7384if (this.amount>=25) Game.Unlock('Thousand fingers');7385if (this.amount>=50) Game.Unlock('Million fingers');7386if (this.amount>=100) Game.Unlock('Billion fingers');7387if (this.amount>=150) Game.Unlock('Trillion fingers');7388if (this.amount>=200) Game.Unlock('Quadrillion fingers');7389if (this.amount>=250) Game.Unlock('Quintillion fingers');7390if (this.amount>=300) Game.Unlock('Sextillion fingers');7391if (this.amount>=350) Game.Unlock('Septillion fingers');7392if (this.amount>=400) Game.Unlock('Octillion fingers');73937394if (this.amount>=1) Game.Win('Click');if (this.amount>=2) Game.Win('Double-click');if (this.amount>=50) Game.Win('Mouse wheel');if (this.amount>=100) Game.Win('Of Mice and Men');if (this.amount>=200) Game.Win('The Digital');if (this.amount>=300) Game.Win('Extreme polydactyly');if (this.amount>=400) Game.Win('Dr. T');if (this.amount>=500) Game.Win('Thumbs, phalanges, metacarpals');if (this.amount>=600) Game.Win('With her finger and her thumb');7395});73967397Game.SpecialGrandmaUnlock=15;7398new Game.Object('Grandma','grandma|grandmas|baked|Grandmas are [X] year older|Grandmas are [X] years older','A nice grandma to bake more cookies.',1,1,{pic:function(i){7399var list=['grandma'];7400if (Game.Has('Farmer grandmas')) list.push('farmerGrandma');7401if (Game.Has('Worker grandmas')) list.push('workerGrandma');7402if (Game.Has('Miner grandmas')) list.push('minerGrandma');7403if (Game.Has('Cosmic grandmas')) list.push('cosmicGrandma');7404if (Game.Has('Transmuted grandmas')) list.push('transmutedGrandma');7405if (Game.Has('Altered grandmas')) list.push('alteredGrandma');7406if (Game.Has('Grandmas\' grandmas')) list.push('grandmasGrandma');7407if (Game.Has('Antigrandmas')) list.push('antiGrandma');7408if (Game.Has('Rainbow grandmas')) list.push('rainbowGrandma');7409if (Game.Has('Banker grandmas')) list.push('bankGrandma');7410if (Game.Has('Priestess grandmas')) list.push('templeGrandma');7411if (Game.Has('Witch grandmas')) list.push('witchGrandma');7412if (Game.Has('Lucky grandmas')) list.push('luckyGrandma');7413if (Game.Has('Metagrandmas')) list.push('metaGrandma');7414if (Game.Has('Script grannies')) list.push('scriptGrandma');7415if (Game.season=='christmas') list.push('elfGrandma');7416if (Game.season=='easter') list.push('bunnyGrandma');7417return choose(list)+'.png';7418},bg:'grandmaBackground.png',xV:8,yV:8,w:32,rows:3,x:0,y:16},100,function(me){7419var mult=1;7420for (var i in Game.GrandmaSynergies)7421{7422if (Game.Has(Game.GrandmaSynergies[i])) mult*=2;7423}7424if (Game.Has('Bingo center/Research facility')) mult*=4;7425if (Game.Has('Ritual rolling pins')) mult*=2;7426if (Game.Has('Naughty list')) mult*=2;74277428if (Game.Has('Elderwort biscuits')) mult*=1.02;74297430mult*=Game.eff('grandmaCps');74317432mult*=Game.GetTieredCpsMult(me);74337434var add=0;7435if (Game.Has('One mind')) add+=Game.Objects['Grandma'].amount*0.02;7436if (Game.Has('Communal brainsweep')) add+=Game.Objects['Grandma'].amount*0.02;7437if (Game.Has('Elder Pact')) add+=Game.Objects['Portal'].amount*0.05;74387439var num=0;7440for (var i in Game.Objects) {if (Game.Objects[i].name!='Grandma') num+=Game.Objects[i].amount;}7441//if (Game.hasAura('Elder Battalion')) mult*=1+0.01*num;7442mult*=1+Game.auraMult('Elder Battalion')*0.01*num;74437444mult*=Game.magicCpS(me.name);74457446return (me.baseCps+add)*mult;7447},function(){7448Game.UnlockTiered(this);7449});7450Game.last.sellFunction=function()7451{7452Game.Win('Just wrong');7453if (this.amount==0)7454{7455Game.Lock('Elder Pledge');7456Game.CollectWrinklers();7457Game.pledgeT=0;7458}7459};7460Game.last.iconFunc=function(type){7461var grandmaIcons=[[0,1],[0,2],[1,2],[2,2]];7462if (type=='off') return [0,1];7463return grandmaIcons[Game.elderWrath];7464};746574667467new Game.Object('Farm','farm|farms|harvested|[X] more acre|[X] more acres','Grows cookie plants from cookie seeds.',3,2,{base:'farm',xV:8,yV:8,w:64,rows:2,x:0,y:16},500,function(me){7468var mult=1;7469mult*=Game.GetTieredCpsMult(me);7470mult*=Game.magicCpS(me.name);7471return me.baseCps*mult;7472},function(){7473Game.UnlockTiered(this);7474if (this.amount>=Game.SpecialGrandmaUnlock && Game.Objects['Grandma'].amount>0) Game.Unlock(this.grandma.name);7475});7476Game.last.minigameUrl='minigameGarden.js';7477Game.last.minigameName='Garden';74787479new Game.Object('Mine','mine|mines|mined|[X] mile deeper|[X] miles deeper','Mines out cookie dough and chocolate chips.',4,3,{base:'mine',xV:16,yV:16,w:64,rows:2,x:0,y:24},10000,function(me){7480var mult=1;7481mult*=Game.GetTieredCpsMult(me);7482mult*=Game.magicCpS(me.name);7483return me.baseCps*mult;7484},function(){7485Game.UnlockTiered(this);7486if (this.amount>=Game.SpecialGrandmaUnlock && Game.Objects['Grandma'].amount>0) Game.Unlock(this.grandma.name);7487});74887489new Game.Object('Factory','factory|factories|mass-produced|[X] additional patent|[X] additional patents','Produces large quantities of cookies.',5,4,{base:'factory',xV:8,yV:0,w:64,rows:1,x:0,y:-22},3000,function(me){7490var mult=1;7491mult*=Game.GetTieredCpsMult(me);7492mult*=Game.magicCpS(me.name);7493return me.baseCps*mult;7494},function(){7495Game.UnlockTiered(this);7496if (this.amount>=Game.SpecialGrandmaUnlock && Game.Objects['Grandma'].amount>0) Game.Unlock(this.grandma.name);7497});7498//Game.last.minigameUrl='minigameDungeon.js';//not yet7499//Game.last.minigameName='Dungeon';75007501new Game.Object('Bank','bank|banks|banked|Interest rates [X]% better|Interest rates [X]% better','Generates cookies from interest.',6,15,{base:'bank',xV:8,yV:4,w:56,rows:1,x:0,y:13},0,function(me){7502var mult=1;7503mult*=Game.GetTieredCpsMult(me);7504mult*=Game.magicCpS(me.name);7505return me.baseCps*mult;7506},function(){7507Game.UnlockTiered(this);7508if (this.amount>=Game.SpecialGrandmaUnlock && Game.Objects['Grandma'].amount>0) Game.Unlock(this.grandma.name);7509});75107511new Game.Object('Temple','temple|temples|discovered|[X] sacred artifact retrieved|[X] sacred artifacts retrieved','Full of precious, ancient chocolate.',7,16,{base:'temple',xV:8,yV:4,w:72,rows:2,x:0,y:-5},0,function(me){7512var mult=1;7513mult*=Game.GetTieredCpsMult(me);7514mult*=Game.magicCpS(me.name);7515return me.baseCps*mult;7516},function(){7517Game.UnlockTiered(this);7518if (this.amount>=Game.SpecialGrandmaUnlock && Game.Objects['Grandma'].amount>0) Game.Unlock(this.grandma.name);7519});7520Game.last.minigameUrl='minigamePantheon.js';7521Game.last.minigameName='Pantheon';75227523new Game.Object('Wizard tower','wizard tower|wizard towers|summoned|Incantations have [X] more syllable|Incantations have [X] more syllables','Summons cookies with magic spells.',8,17,{base:'wizardtower',xV:16,yV:16,w:48,rows:2,x:0,y:20},0,function(me){7524var mult=1;7525mult*=Game.GetTieredCpsMult(me);7526mult*=Game.magicCpS(me.name);7527return me.baseCps*mult;7528},function(){7529Game.UnlockTiered(this);7530if (this.amount>=Game.SpecialGrandmaUnlock && Game.Objects['Grandma'].amount>0) Game.Unlock(this.grandma.name);7531});7532Game.last.minigameUrl='minigameGrimoire.js';7533Game.last.minigameName='Grimoire';75347535new Game.Object('Shipment','shipment|shipments|shipped|[X] galaxy fully explored|[X] galaxies fully explored','Brings in fresh cookies from the cookie planet.',9,5,{base:'shipment',xV:16,yV:16,w:64,rows:1,x:0,y:0},40000,function(me){7536var mult=1;7537mult*=Game.GetTieredCpsMult(me);7538mult*=Game.magicCpS(me.name);7539return me.baseCps*mult;7540},function(){7541Game.UnlockTiered(this);7542if (this.amount>=Game.SpecialGrandmaUnlock && Game.Objects['Grandma'].amount>0) Game.Unlock(this.grandma.name);7543});75447545new Game.Object('Alchemy lab','alchemy lab|alchemy labs|transmuted|[X] primordial element mastered|[X] primordial elements mastered','Turns gold into cookies!',10,6,{base:'alchemylab',xV:16,yV:16,w:64,rows:2,x:0,y:16},200000,function(me){7546var mult=1;7547mult*=Game.GetTieredCpsMult(me);7548mult*=Game.magicCpS(me.name);7549return me.baseCps*mult;7550},function(){7551Game.UnlockTiered(this);7552if (this.amount>=Game.SpecialGrandmaUnlock && Game.Objects['Grandma'].amount>0) Game.Unlock(this.grandma.name);7553});75547555new Game.Object('Portal','portal|portals|retrieved|[X] dimension enslaved|[X] dimensions enslaved','Opens a door to the Cookieverse.',11,7,{base:'portal',xV:32,yV:32,w:64,rows:2,x:0,y:0},1666666,function(me){7556var mult=1;7557mult*=Game.GetTieredCpsMult(me);7558mult*=Game.magicCpS(me.name);7559return me.baseCps*mult;7560},function(){7561Game.UnlockTiered(this);7562if (this.amount>=Game.SpecialGrandmaUnlock && Game.Objects['Grandma'].amount>0) Game.Unlock(this.grandma.name);7563});75647565new Game.Object('Time machine','time machine|time machines|recovered|[X] century secured|[X] centuries secured','Brings cookies from the past, before they were even eaten.',12,8,{base:'timemachine',xV:32,yV:32,w:64,rows:1,x:0,y:0},123456789,function(me){7566var mult=1;7567mult*=Game.GetTieredCpsMult(me);7568mult*=Game.magicCpS(me.name);7569return me.baseCps*mult;7570},function(){7571Game.UnlockTiered(this);7572if (this.amount>=Game.SpecialGrandmaUnlock && Game.Objects['Grandma'].amount>0) Game.Unlock(this.grandma.name);7573});75747575new Game.Object('Antimatter condenser','antimatter condenser|antimatter condensers|condensed|[X] extra quark flavor|[X] extra quark flavors','Condenses the antimatter in the universe into cookies.',13,13,{base:'antimattercondenser',xV:0,yV:64,w:64,rows:1,x:0,y:0},3999999999,function(me){7576var mult=1;7577mult*=Game.GetTieredCpsMult(me);7578mult*=Game.magicCpS(me.name);7579return me.baseCps*mult;7580},function(){7581Game.UnlockTiered(this);7582if (this.amount>=Game.SpecialGrandmaUnlock && Game.Objects['Grandma'].amount>0) Game.Unlock(this.grandma.name);7583});7584Game.last.displayName='<span style="font-size:65%;position:relative;bottom:4px;">Antimatter condenser</span>';//shrink the name since it's so large75857586new Game.Object('Prism','prism|prisms|converted|[X] new color discovered|[X] new colors discovered','Converts light itself into cookies.',14,14,{base:'prism',xV:16,yV:4,w:64,rows:1,x:0,y:20},75000000000,function(me){7587var mult=1;7588mult*=Game.GetTieredCpsMult(me);7589mult*=Game.magicCpS(me.name);7590return me.baseCps*mult;7591},function(){7592Game.UnlockTiered(this);7593if (this.amount>=Game.SpecialGrandmaUnlock && Game.Objects['Grandma'].amount>0) Game.Unlock(this.grandma.name);7594});75957596new Game.Object('Chancemaker','chancemaker|chancemakers|spontaneously generated|Chancemakers are powered by [X]-leaf clovers|Chancemakers are powered by [X]-leaf clovers','Generates cookies out of thin air through sheer luck.',15,19,{base:'chancemaker',xV:8,yV:64,w:64,rows:1,x:0,y:0,rows:2},77777777777,function(me){7597var mult=1;7598mult*=Game.GetTieredCpsMult(me);7599mult*=Game.magicCpS(me.name);7600return me.baseCps*mult;7601},function(){7602Game.UnlockTiered(this);7603if (this.amount>=Game.SpecialGrandmaUnlock && Game.Objects['Grandma'].amount>0) Game.Unlock(this.grandma.name);7604});76057606new Game.Object('Fractal engine','fractal engine|fractal engines|made from cookies|[X] iteration deep|[X] iterations deep','Turns cookies into even more cookies.',16,20,{base:'fractalEngine',xV:8,yV:64,w:64,rows:1,x:0,y:0},12345678987654321,function(me){7607var mult=1;7608mult*=Game.GetTieredCpsMult(me);7609mult*=Game.magicCpS(me.name);7610return me.baseCps*mult;7611},function(){7612Game.UnlockTiered(this);7613if (this.amount>=Game.SpecialGrandmaUnlock && Game.Objects['Grandma'].amount>0) Game.Unlock(this.grandma.name);7614});76157616new Game.Object('Javascript console','javascript console|javascript consoles|programmed|Equipped with [X] external library|Equipped with [X] external libraries','Creates cookies from the very code this game was written in.',17,32,{base:'javascriptconsole',xV:8,yV:64,w:14,rows:1,x:8,y:-32,frames:2},12345678987654321,function(me){7617var mult=1;7618mult*=Game.GetTieredCpsMult(me);7619mult*=Game.magicCpS(me.name);7620return me.baseCps*mult;7621},function(){7622Game.UnlockTiered(this);7623if (this.amount>=Game.SpecialGrandmaUnlock && Game.Objects['Grandma'].amount>0) Game.Unlock(this.grandma.name);7624});7625Game.last.displayName='<span style="font-size:65%;position:relative;bottom:4px;">Javascript console</span>';//shrink the name since it's so large762676277628Game.foolObjects={7629'Unknown':{name:'Investment',desc:'You\'re not sure what this does, you just know it means profit.',icon:0},7630'Cursor':{name:'Rolling pin',desc:'Essential in flattening dough. The first step in cookie-making.',icon:0},7631'Grandma':{name:'Oven',desc:'A crucial element of baking cookies.',icon:1},7632'Farm':{name:'Kitchen',desc:'The more kitchens, the more cookies your employees can produce.',icon:2},7633'Mine':{name:'Secret recipe',desc:'These give you the edge you need to outsell those pesky competitors.',icon:3},7634'Factory':{name:'Factory',desc:'Mass production is the future of baking. Seize the day, and synergize!',icon:4},7635'Bank':{name:'Investor',desc:'Business folks with a nose for profit, ready to finance your venture as long as there\'s money to be made.',icon:5},7636'Temple':{name:'Like',desc:'Your social media page is going viral! Amassing likes is the key to a lasting online presence and juicy advertising deals.',icon:9},7637'Wizard tower':{name:'Meme',desc:'Cookie memes are all the rage! With just the right amount of social media astroturfing, your brand image will be all over the cyberspace.',icon:6},7638'Shipment':{name:'Supermarket',desc:'A gigantic cookie emporium - your very own retail chain.',icon:7},7639'Alchemy lab':{name:'Stock share',desc:'You\'re officially on the stock market, and everyone wants a piece!',icon:8},7640'Portal':{name:'TV show',desc:'Your cookies have their own sitcom! Hilarious baking hijinks set to the cheesiest laughtrack.',icon:10},7641'Time machine':{name:'Theme park',desc:'Cookie theme parks, full of mascots and roller-coasters. Build one, build a hundred!',icon:11},7642'Antimatter condenser':{name:'Cookiecoin',desc:'A virtual currency, already replacing regular money in some small countries.',icon:12},7643'Prism':{name:'Corporate country',desc:'You\'ve made it to the top, and you can now buy entire nations to further your corporate greed. Godspeed.',icon:13},7644'Chancemaker':{name:'Privatized planet',desc:'Actually, you know what\'s cool? A whole planet dedicated to producing, advertising, selling, and consuming your cookies.',icon:15},7645'Fractal engine':{name:'Senate seat',desc:'Only through political dominion can you truly alter this world to create a brighter, more cookie-friendly future.',icon:16},7646'Javascript console':{name:'Doctrine',desc:'Taking many forms -religion, culture, philosophy- a doctrine may, when handled properly, cause a lasting impact on civilizations, reshaping minds and people and ensuring all future generations share a singular goal - the production, and acquisition, of more cookies.',icon:17},7647};764876497650//build store7651Game.BuildStore();76527653//build master bar7654var str='';7655str+='<div id="buildingsMute" class="shadowFilter" style="position:relative;z-index:100;padding:4px 16px 0px 64px;"></div>';7656str+='<div class="separatorBottom" style="position:absolute;bottom:-8px;z-index:0;"></div>';7657l('buildingsMaster').innerHTML=str;76587659//build object displays7660var muteStr='<div style="position:absolute;left:8px;bottom:12px;opacity:0.5;">Muted :</div>';7661for (var i in Game.Objects)7662{7663var me=Game.Objects[i];7664if (me.id>0)7665{7666me.canvas=l('rowCanvas'+me.id);7667me.ctx=me.canvas.getContext('2d',{alpha:false});7668me.pics=[];7669var icon=[0*64,me.icon*64];7670muteStr+='<div class="tinyProductIcon" id="mutedProduct'+me.id+'" style="display:none;background-position:-'+icon[0]+'px -'+icon[1]+'px;" '+Game.clickStr+'="Game.ObjectsById['+me.id+'].mute(0);PlaySound(Game.ObjectsById['+me.id+'].muted?\'snd/clickOff.mp3\':\'snd/clickOn.mp3\');" '+Game.getDynamicTooltip('Game.mutedBuildingTooltip('+me.id+')','this')+'></div>';7671//muteStr+='<div class="tinyProductIcon" id="mutedProduct'+me.id+'" style="display:none;background-position:-'+icon[0]+'px -'+icon[1]+'px;" '+Game.clickStr+'="Game.ObjectsById['+me.id+'].mute(0);PlaySound(Game.ObjectsById['+me.id+'].muted?\'snd/clickOff.mp3\':\'snd/clickOn.mp3\');" '+Game.getTooltip('<div style="width:150px;text-align:center;font-size:11px;"><b>Unmute '+me.plural+'</b><br>(Display this building)</div>')+'></div>';76727673AddEvent(me.canvas,'mouseover',function(me){return function(){me.mouseOn=true;}}(me));7674AddEvent(me.canvas,'mouseout',function(me){return function(){me.mouseOn=false;}}(me));7675AddEvent(me.canvas,'mousemove',function(me){return function(e){var box=this.getBoundingClientRect();me.mousePos[0]=e.pageX-box.left;me.mousePos[1]=e.pageY-box.top;}}(me));7676}7677}7678Game.mutedBuildingTooltip=function(id)7679{7680return function(){7681var me=Game.ObjectsById[id];7682return '<div style="width:150px;text-align:center;font-size:11px;"><b>'+(me.plural.charAt(0).toUpperCase()+me.plural.slice(1))+(me.level>0?' (lvl. '+me.level+')':'')+'</b><div class="line"></div>Click to unmute '+me.plural+'<br>(display this building)</div>';7683}7684}7685l('buildingsMute').innerHTML=muteStr;76867687/*=====================================================================================7688UPGRADES7689=======================================================================================*/7690Game.upgradesToRebuild=1;7691Game.Upgrades=[];7692Game.UpgradesById=[];7693Game.UpgradesN=0;7694Game.UpgradesInStore=[];7695Game.UpgradesOwned=0;7696Game.Upgrade=function(name,desc,price,icon,buyFunction)7697{7698this.id=Game.UpgradesN;7699this.name=name;7700this.desc=desc;7701this.baseDesc=this.desc;7702this.desc=BeautifyInText(this.baseDesc);7703this.basePrice=price;7704this.priceLumps=0;//note : doesn't do much on its own, you still need to handle the buying yourself7705this.icon=icon;7706this.iconFunction=0;7707this.buyFunction=buyFunction;7708/*this.unlockFunction=unlockFunction;7709this.unlocked=(this.unlockFunction?0:1);*/7710this.unlocked=0;7711this.bought=0;7712this.order=this.id;7713if (order) this.order=order+this.id*0.001;7714this.pool='';//can be '', cookie, toggle, debug, prestige, prestigeDecor, tech, or unused7715if (pool) this.pool=pool;7716this.power=0;7717if (power) this.power=power;7718this.vanilla=Game.vanilla;7719this.unlockAt=0;7720this.techUnlock=[];7721this.parents=[];7722this.type='upgrade';7723this.tier=0;7724this.buildingTie=0;//of what building is this a tiered upgrade of ?77257726Game.last=this;7727Game.Upgrades[this.name]=this;7728Game.UpgradesById[this.id]=this;7729Game.UpgradesN++;7730return this;7731}77327733Game.Upgrade.prototype.getPrice=function()7734{7735var price=this.basePrice;7736if (this.priceFunc) price=this.priceFunc(this);7737if (price==0) return 0;7738if (this.pool!='prestige')7739{7740if (Game.Has('Toy workshop')) price*=0.95;7741if (Game.Has('Five-finger discount')) price*=Math.pow(0.99,Game.Objects['Cursor'].amount/100);7742if (Game.Has('Santa\'s dominion')) price*=0.98;7743if (Game.Has('Faberge egg')) price*=0.99;7744if (Game.Has('Divine sales')) price*=0.99;7745if (Game.Has('Fortune #100')) price*=0.99;7746if (Game.hasBuff('Haggler\'s luck')) price*=0.98;7747if (Game.hasBuff('Haggler\'s misery')) price*=1.02;7748//if (Game.hasAura('Master of the Armory')) price*=0.98;7749price*=1-Game.auraMult('Master of the Armory')*0.02;7750price*=Game.eff('upgradeCost');7751if (this.pool=='cookie' && Game.Has('Divine bakeries')) price/=5;7752}7753return Math.ceil(price);7754}77557756Game.Upgrade.prototype.canBuy=function()7757{7758if (this.canBuyFunc) return this.canBuyFunc();7759if (Game.cookies>=this.getPrice()) return true; else return false;7760}77617762Game.storeBuyAll=function()7763{7764if (!Game.Has('Inspired checklist')) return false;7765for (var i in Game.UpgradesInStore)7766{7767var me=Game.UpgradesInStore[i];7768if (!me.isVaulted() && me.pool!='toggle' && me.pool!='tech') me.buy(1);7769}7770}77717772Game.vault=[];7773Game.Upgrade.prototype.isVaulted=function()7774{7775if (Game.vault.indexOf(this.id)!=-1) return true; else return false;7776}7777Game.Upgrade.prototype.vault=function()7778{7779if (!this.isVaulted()) Game.vault.push(this.id);7780}7781Game.Upgrade.prototype.unvault=function()7782{7783if (this.isVaulted()) Game.vault.splice(Game.vault.indexOf(this.id),1);7784}77857786Game.Upgrade.prototype.click=function(e)7787{7788if ((e && e.shiftKey) || Game.keys[16])7789{7790if (this.pool=='toggle' || this.pool=='tech') {}7791else if (Game.Has('Inspired checklist'))7792{7793if (this.isVaulted()) this.unvault();7794else this.vault();7795Game.upgradesToRebuild=1;7796PlaySound('snd/tick.mp3');7797}7798}7799else this.buy();7800}780178027803Game.Upgrade.prototype.buy=function(bypass)7804{7805var success=0;7806var cancelPurchase=0;7807if (this.clickFunction && !bypass) cancelPurchase=!this.clickFunction();7808if (!cancelPurchase)7809{7810if (this.choicesFunction)7811{7812if (Game.choiceSelectorOn==this.id)7813{7814l('toggleBox').style.display='none';7815l('toggleBox').innerHTML='';7816Game.choiceSelectorOn=-1;7817PlaySound('snd/tick.mp3');7818}7819else7820{7821Game.choiceSelectorOn=this.id;7822var choices=this.choicesFunction();7823if (choices.length>0)7824{7825var selected=0;7826for (var i in choices) {if (choices[i].selected) selected=i;}7827Game.choiceSelectorChoices=choices;//this is a really dumb way of doing this i am so sorry7828Game.choiceSelectorSelected=selected;7829var str='';7830str+='<div class="close" onclick="Game.UpgradesById['+this.id+'].buy();">x</div>';7831str+='<h3>'+this.name+'</h3>'+7832'<div class="line"></div>'+7833'<h4 id="choiceSelectedName">'+choices[selected].name+'</h4>'+7834'<div class="line"></div>';78357836for (var i in choices)7837{7838var icon=choices[i].icon;7839str+='<div class="crate enabled'+(i==selected?' highlighted':'')+'" style="opacity:1;float:none;display:inline-block;'+(icon[2]?'background-image:url('+icon[2]+');':'')+'background-position:'+(-icon[0]*48)+'px '+(-icon[1]*48)+'px;" '+Game.clickStr+'="Game.UpgradesById['+this.id+'].choicesPick('+i+');PlaySound(\'snd/tick.mp3\');Game.choiceSelectorOn=-1;Game.UpgradesById['+this.id+'].buy();" onMouseOut="l(\'choiceSelectedName\').innerHTML=Game.choiceSelectorChoices[Game.choiceSelectorSelected].name;" onMouseOver="l(\'choiceSelectedName\').innerHTML=Game.choiceSelectorChoices['+i+'].name;"'+7840'></div>';7841}7842}7843l('toggleBox').innerHTML=str;7844l('toggleBox').style.display='block';7845l('toggleBox').focus();7846Game.tooltip.hide();7847PlaySound('snd/tick.mp3');7848success=1;7849}7850}7851else if (this.pool!='prestige')7852{7853var price=this.getPrice();7854if (this.canBuy() && !this.bought)7855{7856Game.Spend(price);7857this.bought=1;7858if (this.buyFunction) this.buyFunction();7859if (this.toggleInto)7860{7861Game.Lock(this.toggleInto);7862Game.Unlock(this.toggleInto);7863}7864Game.upgradesToRebuild=1;7865Game.recalculateGains=1;7866if (Game.CountsAsUpgradeOwned(this.pool)) Game.UpgradesOwned++;7867Game.setOnCrate(0);7868Game.tooltip.hide();7869PlaySound('snd/buy'+choose([1,2,3,4])+'.mp3',0.75);7870success=1;7871}7872}7873else7874{7875var price=this.getPrice();7876if (Game.heavenlyChips>=price && !this.bought)7877{7878Game.heavenlyChips-=price;7879Game.heavenlyChipsSpent+=price;7880this.unlocked=1;7881this.bought=1;7882if (this.buyFunction) this.buyFunction();7883Game.BuildAscendTree();7884PlaySound('snd/buy'+choose([1,2,3,4])+'.mp3',0.75);7885PlaySound('snd/shimmerClick.mp3');7886//PlaySound('snd/buyHeavenly.mp3');7887success=1;7888}7889}7890}7891if (this.bought && this.activateFunction) this.activateFunction();7892return success;7893}7894Game.Upgrade.prototype.earn=function()//just win the upgrades without spending anything7895{7896this.unlocked=1;7897this.bought=1;7898if (this.buyFunction) this.buyFunction();7899Game.upgradesToRebuild=1;7900Game.recalculateGains=1;7901if (Game.CountsAsUpgradeOwned(this.pool)) Game.UpgradesOwned++;7902}7903Game.Upgrade.prototype.unearn=function()//remove the upgrade, but keep it unlocked7904{7905this.bought=0;7906Game.upgradesToRebuild=1;7907Game.recalculateGains=1;7908if (Game.CountsAsUpgradeOwned(this.pool)) Game.UpgradesOwned--;7909}7910Game.Upgrade.prototype.unlock=function()7911{7912this.unlocked=1;7913Game.upgradesToRebuild=1;7914}7915Game.Upgrade.prototype.lose=function()7916{7917this.unlocked=0;7918this.bought=0;7919Game.upgradesToRebuild=1;7920Game.recalculateGains=1;7921if (Game.CountsAsUpgradeOwned(this.pool)) Game.UpgradesOwned--;7922}7923Game.Upgrade.prototype.toggle=function()//cheating only7924{7925if (!this.bought)7926{7927this.bought=1;7928if (this.buyFunction) this.buyFunction();7929Game.upgradesToRebuild=1;7930Game.recalculateGains=1;7931if (Game.CountsAsUpgradeOwned(this.pool)) Game.UpgradesOwned++;7932PlaySound('snd/buy'+choose([1,2,3,4])+'.mp3',0.75);7933if (this.pool=='prestige' || this.pool=='debug') PlaySound('snd/shimmerClick.mp3');7934}7935else7936{7937this.bought=0;7938Game.upgradesToRebuild=1;7939Game.recalculateGains=1;7940if (Game.CountsAsUpgradeOwned(this.pool)) Game.UpgradesOwned--;7941PlaySound('snd/sell'+choose([1,2,3,4])+'.mp3',0.75);7942if (this.pool=='prestige' || this.pool=='debug') PlaySound('snd/shimmerClick.mp3');7943}7944if (Game.onMenu=='stats') Game.UpdateMenu();7945}79467947Game.CountsAsUpgradeOwned=function(pool)7948{7949if (pool=='' || pool=='cookie' || pool=='tech') return true; else return false;7950}79517952/*AddEvent(l('toggleBox'),'blur',function()//if we click outside of the selector, close it7953{7954//this has a couple problems, such as when clicking on the upgrade - this toggles it off and back on instantly7955l('toggleBox').style.display='none';7956l('toggleBox').innerHTML='';7957Game.choiceSelectorOn=-1;7958}7959);*/79607961Game.RequiresConfirmation=function(upgrade,prompt)7962{7963upgrade.clickFunction=function(){Game.Prompt(prompt,[['Yes','Game.UpgradesById['+upgrade.id+'].buy(1);Game.ClosePrompt();'],'No']);return false;};7964}79657966Game.Unlock=function(what)7967{7968if (typeof what==='string')7969{7970if (Game.Upgrades[what])7971{7972if (Game.Upgrades[what].unlocked==0)7973{7974Game.Upgrades[what].unlocked=1;7975Game.upgradesToRebuild=1;7976Game.recalculateGains=1;7977/*if (Game.prefs.popups) {}7978else Game.Notify('Upgrade unlocked','<div class="title" style="font-size:18px;margin-top:-2px;">'+Game.Upgrades[what].name+'</div>',Game.Upgrades[what].icon,6);*/7979}7980}7981}7982else {for (var i in what) {Game.Unlock(what[i]);}}7983}7984Game.Lock=function(what)7985{7986if (typeof what==='string')7987{7988if (Game.Upgrades[what])7989{7990Game.Upgrades[what].unlocked=0;7991Game.upgradesToRebuild=1;7992if (Game.Upgrades[what].bought==1 && Game.CountsAsUpgradeOwned(Game.Upgrades[what].pool)) Game.UpgradesOwned--;7993Game.Upgrades[what].bought=0;7994Game.recalculateGains=1;7995}7996}7997else {for (var i in what) {Game.Lock(what[i]);}}7998}79998000Game.Has=function(what)8001{8002if (Game.ascensionMode==1 && Game.Upgrades[what].pool=='prestige') return 0;8003return (Game.Upgrades[what]?Game.Upgrades[what].bought:0);8004}8005Game.HasUnlocked=function(what)8006{8007return (Game.Upgrades[what]?Game.Upgrades[what].unlocked:0);8008}800980108011Game.RebuildUpgrades=function()//recalculate the upgrades you can buy8012{8013Game.upgradesToRebuild=0;8014var list=[];8015for (var i in Game.Upgrades)8016{8017var me=Game.Upgrades[i];8018if (!me.bought && me.pool!='debug' && me.pool!='prestige' && me.pool!='prestigeDecor' && (!me.lasting || Game.ascensionMode!=1))8019{8020if (me.unlocked) list.push(me);8021}8022else if (me.displayFuncWhenOwned && me.bought) list.push(me);8023}8024var sortMap=function(a,b)8025{8026var ap=a.pool=='toggle'?a.order:a.getPrice();8027var bp=b.pool=='toggle'?b.order:b.getPrice();8028if (ap>bp) return 1;8029else if (ap<bp) return -1;8030else return 0;8031}8032list.sort(sortMap);80338034Game.UpgradesInStore=[];8035for (var i in list)8036{8037Game.UpgradesInStore.push(list[i]);8038}8039var storeStr='';8040var toggleStr='';8041var techStr='';8042var vaultStr='';80438044if (Game.Has('Inspired checklist'))8045{8046storeStr+='<div id="storeBuyAll" class="storePre" '+Game.getTooltip(8047'<div style="padding:8px;min-width:250px;text-align:center;font-size:11px;">Will <b>instantly purchase</b> every upgrade you can afford, starting from the cheapest one.<br>Upgrades in the <b>vault</b> will not be auto-purchased.<br>You may place an upgrade into the vault by <b>Shift-clicking</b> on it.</div>'8048,'store')+8049'>'+8050'<div id="storeBuyAllButton" class="storePreButton" '+Game.clickStr+'="Game.storeBuyAll();">Buy all upgrades</div>'+8051'</div>';8052l('upgrades').classList.add('hasMenu');8053}8054else l('upgrades').classList.remove('hasMenu');80558056for (var i in Game.UpgradesInStore)8057{8058//if (!Game.UpgradesInStore[i]) break;8059var me=Game.UpgradesInStore[i];8060var str=Game.crate(me,'store','Game.UpgradesById['+me.id+'].click(event);','upgrade'+i);80618062/*var str='<div class="crate upgrade" '+Game.getTooltip(8063'<div style="min-width:200px;"><div style="float:right;"><span class="price">'+Beautify(Math.round(me.getPrice()))+'</span></div><small>'+(me.pool=='toggle'?'[Togglable]':'[Upgrade]')+'</small><div class="name">'+me.name+'</div><div class="line"></div><div class="description">'+me.desc+'</div></div>'8064,'store')+' '+Game.clickStr+'="Game.UpgradesById['+me.id+'].buy();" id="upgrade'+i+'" style="'+(me.icon[2]?'background-image:url('+me.icon[2]+');':'')+'background-position:'+(-me.icon[0]*48)+'px '+(-me.icon[1]*48)+'px;"></div>';*/8065if (me.pool=='toggle') toggleStr+=str; else if (me.pool=='tech') techStr+=str; else8066{8067if (me.isVaulted() && Game.Has('Inspired checklist')) vaultStr+=str; else storeStr+=str;8068}8069}80708071l('upgrades').innerHTML=storeStr;8072l('toggleUpgrades').innerHTML=toggleStr;8073if (toggleStr=='') l('toggleUpgrades').style.display='none'; else l('toggleUpgrades').style.display='block';8074l('techUpgrades').innerHTML=techStr;8075if (techStr=='') l('techUpgrades').style.display='none'; else l('techUpgrades').style.display='block';8076l('vaultUpgrades').innerHTML=vaultStr;8077if (vaultStr=='') l('vaultUpgrades').style.display='none'; else l('vaultUpgrades').style.display='block';8078}80798080Game.UnlockAt=[];//this contains an array of every upgrade with a cookie requirement in the form of {cookies:(amount of cookies earned required),name:(name of upgrade or achievement to unlock)} (and possibly require:(name of upgrade of achievement to own))8081//note : the cookie will not be added to the list if it contains locked:1 (use for seasonal cookies and such)80828083Game.NewUpgradeCookie=function(obj)8084{8085var upgrade=new Game.Upgrade(obj.name,'Cookie production multiplier <b>+'+Beautify((typeof(obj.power)=='function'?obj.power(obj):obj.power),1)+'%</b>.<q>'+obj.desc+'</q>',obj.price,obj.icon);8086upgrade.power=obj.power;8087upgrade.pool='cookie';8088var toPush={cookies:obj.price/20,name:obj.name};8089if (obj.require) toPush.require=obj.require;8090if (obj.season) toPush.season=obj.season;8091if (!obj.locked) Game.UnlockAt.push(toPush);8092return upgrade;8093}80948095//tiered upgrades system8096//each building has several upgrade tiers8097//all upgrades in the same tier have the same color, unlock threshold and price multiplier8098Game.Tiers={80991:{name:'Plain',unlock:1,achievUnlock:1,iconRow:0,color:'#ccb3ac',price: 10},81002:{name:'Berrylium',unlock:5,achievUnlock:50,iconRow:1,color:'#ff89e7',price: 50},81013:{name:'Blueberrylium',unlock:25,achievUnlock:100,iconRow:2,color:'#00deff',price: 500},81024:{name:'Chalcedhoney',unlock:50,achievUnlock:150,iconRow:13,color:'#ffcc2f',price: 50000},81035:{name:'Buttergold',unlock:100,achievUnlock:200,iconRow:14,color:'#e9d673',price: 5000000},81046:{name:'Sugarmuck',unlock:150,achievUnlock:250,iconRow:15,color:'#a8bf91',price: 500000000},81057:{name:'Jetmint',unlock:200,achievUnlock:300,iconRow:16,color:'#60ff50',price: 500000000000},81068:{name:'Cherrysilver',unlock:250,achievUnlock:350,iconRow:17,color:'#f01700',price: 500000000000000},81079:{name:'Hazelrald',unlock:300,achievUnlock:400,iconRow:18,color:'#9ab834',price: 500000000000000000},810810:{name:'Mooncandy',unlock:350,achievUnlock:450,iconRow:19,color:'#7e7ab9',price: 500000000000000000000},810911:{name:'Astrofudge',unlock:400,achievUnlock:500,iconRow:28,color:'#9a3316',price: 5000000000000000000000000},811012:{name:'Alabascream',unlock:450,achievUnlock:550,iconRow:30,color:'#c1a88c',price: 50000000000000000000000000000},811113:{name:'Iridyum',unlock:500,achievUnlock:600,iconRow:31,color:'#adb1b3',price: 500000000000000000000000000000000},8112'synergy1':{name:'Synergy I',unlock:15,iconRow:20,color:'#008595',special:1,req:'Synergies Vol. I',price: 200000},8113'synergy2':{name:'Synergy II',unlock:75,iconRow:29,color:'#008595',special:1,req:'Synergies Vol. II',price: 200000000000},8114'fortune':{name:'Fortune',unlock:-1,iconRow:32,color:'#9ab834',special:1,price: 77777777777777777777777777777},8115};8116for (var i in Game.Tiers){Game.Tiers[i].upgrades=[];}8117Game.GetIcon=function(type,tier)8118{8119var col=0;8120if (type=='Kitten') col=18; else col=Game.Objects[type].iconColumn;8121return [col,Game.Tiers[tier].iconRow];8122}8123Game.SetTier=function(building,tier)8124{8125if (!Game.Objects[building]) alert('No building named '+building);8126Game.last.tier=tier;8127Game.last.buildingTie=Game.Objects[building];8128if (Game.last.type=='achievement') Game.Objects[building].tieredAchievs[tier]=Game.last;8129else Game.Objects[building].tieredUpgrades[tier]=Game.last;8130}8131Game.MakeTiered=function(upgrade,tier,col)8132{8133upgrade.tier=tier;8134if (typeof col!=='undefined') upgrade.icon=[col,Game.Tiers[tier].iconRow];8135}8136Game.TieredUpgrade=function(name,desc,building,tier)8137{8138var upgrade=new Game.Upgrade(name,desc,Game.Objects[building].basePrice*Game.Tiers[tier].price,Game.GetIcon(building,tier));8139Game.SetTier(building,tier);8140if (!upgrade.buildingTie1 && building) upgrade.buildingTie1=Game.Objects[building];8141if (tier=='fortune' && building) Game.Objects[building].fortune=upgrade;8142return upgrade;8143}8144Game.SynergyUpgrade=function(name,desc,building1,building2,tier)8145{8146/*8147creates a new upgrade that :8148-unlocks when you have tier.unlock of building1 and building28149-is priced at (building1.price*10+building2.price*1)*tier.price (formerly : Math.sqrt(building1.price*building2.price)*tier.price)8150-gives +(0.1*building1)% cps to building2 and +(5*building2)% cps to building18151-if building2 is below building1 in worth, swap them8152*/8153//if (Game.Objects[building1].basePrice>Game.Objects[building2].basePrice) {var temp=building2;building2=building1;building1=temp;}8154var b1=Game.Objects[building1];8155var b2=Game.Objects[building2];8156if (b1.basePrice>b2.basePrice) {b1=Game.Objects[building2];b2=Game.Objects[building1];}//swap81578158desc=8159(b1.plural.charAt(0).toUpperCase()+b1.plural.slice(1))+' gain <b>+5% CpS</b> per '+b2.name.toLowerCase()+'.<br>'+8160(b2.plural.charAt(0).toUpperCase()+b2.plural.slice(1))+' gain <b>+0.1% CpS</b> per '+b1.name.toLowerCase()+'.'+8161desc;8162var upgrade=new Game.Upgrade(name,desc,(b1.basePrice*10+b2.basePrice*1)*Game.Tiers[tier].price,Game.GetIcon(building1,tier));//Math.sqrt(b1.basePrice*b2.basePrice)*Game.Tiers[tier].price8163upgrade.tier=tier;8164upgrade.buildingTie1=b1;8165upgrade.buildingTie2=b2;8166upgrade.priceFunc=function(){return (this.buildingTie1.basePrice*10+this.buildingTie2.basePrice*1)*Game.Tiers[this.tier].price*(Game.Has('Chimera')?0.98:1);};8167Game.Objects[building1].synergies.push(upgrade);8168Game.Objects[building2].synergies.push(upgrade);8169//Game.SetTier(building1,tier);8170return upgrade;8171}8172Game.GetTieredCpsMult=function(me)8173{8174var mult=1;8175for (var i in me.tieredUpgrades) {if (!Game.Tiers[me.tieredUpgrades[i].tier].special && Game.Has(me.tieredUpgrades[i].name)) mult*=2;}8176for (var i in me.synergies)8177{8178var syn=me.synergies[i];8179if (Game.Has(syn.name))8180{8181if (syn.buildingTie1.name==me.name) mult*=(1+0.05*syn.buildingTie2.amount);8182else if (syn.buildingTie2.name==me.name) mult*=(1+0.001*syn.buildingTie1.amount);8183}8184}8185if (me.fortune && Game.Has(me.fortune.name)) mult*=1.07;8186if (me.grandma && Game.Has(me.grandma.name)) mult*=(1+Game.Objects['Grandma'].amount*0.01*(1/(me.id-1)));8187return mult;8188}8189Game.UnlockTiered=function(me)8190{8191for (var i in me.tieredUpgrades) {if (Game.Tiers[me.tieredUpgrades[i].tier].unlock!=-1 && me.amount>=Game.Tiers[me.tieredUpgrades[i].tier].unlock) Game.Unlock(me.tieredUpgrades[i].name);}8192for (var i in me.tieredAchievs) {if (me.amount>=Game.Tiers[me.tieredAchievs[i].tier].achievUnlock) Game.Win(me.tieredAchievs[i].name);}8193for (var i in me.synergies) {var syn=me.synergies[i];if (Game.Has(Game.Tiers[syn.tier].req) && syn.buildingTie1.amount>=Game.Tiers[syn.tier].unlock && syn.buildingTie2.amount>=Game.Tiers[syn.tier].unlock) Game.Unlock(syn.name);}8194}8195819681978198var pool='';8199var power=0;82008201//define upgrades8202//WARNING : do NOT add new upgrades in between, this breaks the saves. Add them at the end !8203var order=100;//this is used to set the order in which the items are listed8204new Game.Upgrade('Reinforced index finger','The mouse and cursors are <b>twice</b> as efficient.<q>prod prod</q>',100,[0,0]);Game.MakeTiered(Game.last,1,0);8205new Game.Upgrade('Carpal tunnel prevention cream','The mouse and cursors are <b>twice</b> as efficient.<q>it... it hurts to click...</q>',500,[0,1]);Game.MakeTiered(Game.last,2,0);8206new Game.Upgrade('Ambidextrous','The mouse and cursors are <b>twice</b> as efficient.<q>Look ma, both hands!</q>',10000,[0,2]);Game.MakeTiered(Game.last,3,0);8207new Game.Upgrade('Thousand fingers','The mouse and cursors gain <b>+0.1</b> cookies for each non-cursor object owned.<q>clickity</q>',100000,[0,13]);Game.MakeTiered(Game.last,4,0);8208new Game.Upgrade('Million fingers','The mouse and cursors gain <b>+0.5</b> cookies for each non-cursor object owned.<q>clickityclickity</q>',10000000,[0,14]);Game.MakeTiered(Game.last,5,0);8209new Game.Upgrade('Billion fingers','The mouse and cursors gain <b>+5</b> cookies for each non-cursor object owned.<q>clickityclickityclickity</q>',100000000,[0,15]);Game.MakeTiered(Game.last,6,0);8210new Game.Upgrade('Trillion fingers','The mouse and cursors gain <b>+50</b> cookies for each non-cursor object owned.<q>clickityclickityclickityclickity</q>',1000000000,[0,16]);Game.MakeTiered(Game.last,7,0);82118212order=200;8213new Game.TieredUpgrade('Forwards from grandma','Grandmas are <b>twice</b> as efficient.<q>RE:RE:thought you\'d get a kick out of this ;))</q>','Grandma',1);8214new Game.TieredUpgrade('Steel-plated rolling pins','Grandmas are <b>twice</b> as efficient.<q>Just what you kneaded.</q>','Grandma',2);8215new Game.TieredUpgrade('Lubricated dentures','Grandmas are <b>twice</b> as efficient.<q>squish</q>','Grandma',3);82168217order=300;8218new Game.TieredUpgrade('Cheap hoes','Farms are <b>twice</b> as efficient.<q>Rake in the dough!</q>','Farm',1);8219new Game.TieredUpgrade('Fertilizer','Farms are <b>twice</b> as efficient.<q>It\'s chocolate, I swear.</q>','Farm',2);8220new Game.TieredUpgrade('Cookie trees','Farms are <b>twice</b> as efficient.<q>A relative of the breadfruit.</q>','Farm',3);82218222order=500;8223new Game.TieredUpgrade('Sturdier conveyor belts','Factories are <b>twice</b> as efficient.<q>You\'re going places.</q>','Factory',1);8224new Game.TieredUpgrade('Child labor','Factories are <b>twice</b> as efficient.<q>Cheaper, healthier workforce.</q>','Factory',2);8225new Game.TieredUpgrade('Sweatshop','Factories are <b>twice</b> as efficient.<q>Slackers will be terminated.</q>','Factory',3);82268227order=400;8228new Game.TieredUpgrade('Sugar gas','Mines are <b>twice</b> as efficient.<q>A pink, volatile gas, found in the depths of some chocolate caves.</q>','Mine',1);8229new Game.TieredUpgrade('Megadrill','Mines are <b>twice</b> as efficient.<q>You\'re in deep.</q>','Mine',2);8230new Game.TieredUpgrade('Ultradrill','Mines are <b>twice</b> as efficient.<q>Finally caved in?</q>','Mine',3);82318232order=600;8233new Game.TieredUpgrade('Vanilla nebulae','Shipments are <b>twice</b> as efficient.<q>If you removed your space helmet, you could probably smell it!<br>(Note : don\'t do that.)</q>','Shipment',1);8234new Game.TieredUpgrade('Wormholes','Shipments are <b>twice</b> as efficient.<q>By using these as shortcuts, your ships can travel much faster.</q>','Shipment',2);8235new Game.TieredUpgrade('Frequent flyer','Shipments are <b>twice</b> as efficient.<q>Come back soon!</q>','Shipment',3);82368237order=700;8238new Game.TieredUpgrade('Antimony','Alchemy labs are <b>twice</b> as efficient.<q>Actually worth a lot of mony.</q>','Alchemy lab',1);8239new Game.TieredUpgrade('Essence of dough','Alchemy labs are <b>twice</b> as efficient.<q>Extracted through the 5 ancient steps of alchemical baking.</q>','Alchemy lab',2);8240new Game.TieredUpgrade('True chocolate','Alchemy labs are <b>twice</b> as efficient.<q>The purest form of cacao.</q>','Alchemy lab',3);82418242order=800;8243new Game.TieredUpgrade('Ancient tablet','Portals are <b>twice</b> as efficient.<q>A strange slab of peanut brittle, holding an ancient cookie recipe. Neat!</q>','Portal',1);8244new Game.TieredUpgrade('Insane oatling workers','Portals are <b>twice</b> as efficient.<q>ARISE, MY MINIONS!</q>','Portal',2);8245new Game.TieredUpgrade('Soul bond','Portals are <b>twice</b> as efficient.<q>So I just sign up and get more cookies? Sure, whatever!</q>','Portal',3);82468247order=900;8248new Game.TieredUpgrade('Flux capacitors','Time machines are <b>twice</b> as efficient.<q>Bake to the future.</q>','Time machine',1);8249new Game.TieredUpgrade('Time paradox resolver','Time machines are <b>twice</b> as efficient.<q>No more fooling around with your own grandmother!</q>','Time machine',2);8250new Game.TieredUpgrade('Quantum conundrum','Time machines are <b>twice</b> as efficient.<q>There is only one constant, and that is universal uncertainty.<br>Or is it?</q>','Time machine',3);82518252order=20000;8253new Game.Upgrade('Kitten helpers','You gain <b>more CpS</b> the more milk you have.<q>meow may I help you</q>',9000000,Game.GetIcon('Kitten',1));Game.last.kitten=1;Game.MakeTiered(Game.last,1,18);8254new Game.Upgrade('Kitten workers','You gain <b>more CpS</b> the more milk you have.<q>meow meow meow meow</q>',9000000000,Game.GetIcon('Kitten',2));Game.last.kitten=1;Game.MakeTiered(Game.last,2,18);82558256order=10000;8257Game.NewUpgradeCookie({name:'Plain cookies',desc:'We all gotta start somewhere.',icon:[2,3],power: 1, price: 999999});8258Game.NewUpgradeCookie({name:'Sugar cookies',desc:'Tasty, if a little unimaginative.',icon:[7,3],power: 1, price: 999999*5});8259Game.NewUpgradeCookie({name:'Oatmeal raisin cookies',desc:'No raisin to hate these.',icon:[0,3],power: 1, price: 9999999});8260Game.NewUpgradeCookie({name:'Peanut butter cookies',desc:'Get yourself some jam cookies!',icon:[1,3],power: 1, price: 9999999*5});8261Game.NewUpgradeCookie({name:'Coconut cookies',desc:'Flaky, but not unreliable. Some people go crazy for these.',icon:[3,3],power: 2, price: 99999999});8262order=10001;8263Game.NewUpgradeCookie({name:'White chocolate cookies',desc:'I know what you\'ll say. It\'s just cocoa butter! It\'s not real chocolate!<br>Oh please.',icon:[4,3],power:2, price: 99999999*5});8264Game.NewUpgradeCookie({name:'Macadamia nut cookies',desc:'They\'re macadamn delicious!',icon:[5,3],power: 2, price: 999999999});8265Game.NewUpgradeCookie({name:'Double-chip cookies',desc:'DOUBLE THE CHIPS<br>DOUBLE THE TASTY<br>(double the calories)',icon:[6,3],power:2, price: 999999999*5});8266Game.NewUpgradeCookie({name:'White chocolate macadamia nut cookies',desc:'Orteil\'s favorite.',icon:[8,3],power: 2, price: 9999999999});8267Game.NewUpgradeCookie({name:'All-chocolate cookies',desc:'CHOCOVERDOSE.',icon:[9,3],power: 2, price: 9999999999*5});82688269order=100;8270new Game.Upgrade('Quadrillion fingers','The mouse and cursors gain <b>+500</b> cookies for each non-cursor object owned.<q>clickityclickityclickityclickityclick</q>',10000000000,[0,17]);Game.MakeTiered(Game.last,8,0);82718272order=200;new Game.TieredUpgrade('Prune juice','Grandmas are <b>twice</b> as efficient.<q>Gets me going.</q>','Grandma',4);8273order=300;new Game.TieredUpgrade('Genetically-modified cookies','Farms are <b>twice</b> as efficient.<q>All-natural mutations.</q>','Farm',4);8274order=500;new Game.TieredUpgrade('Radium reactors','Factories are <b>twice</b> as efficient.<q>Gives your cookies a healthy glow.</q>','Factory',4);8275order=400;new Game.TieredUpgrade('Ultimadrill','Mines are <b>twice</b> as efficient.<q>Pierce the heavens, etc.</q>','Mine',4);8276order=600;new Game.TieredUpgrade('Warp drive','Shipments are <b>twice</b> as efficient.<q>To boldly bake.</q>','Shipment',4);8277order=700;new Game.TieredUpgrade('Ambrosia','Alchemy labs are <b>twice</b> as efficient.<q>Adding this to the cookie mix is sure to make them even more addictive!<br>Perhaps dangerously so.<br>Let\'s hope you can keep selling these legally.</q>','Alchemy lab',4);8278order=800;new Game.TieredUpgrade('Sanity dance','Portals are <b>twice</b> as efficient.<q>We can change if we want to.<br>We can leave our brains behind.</q>','Portal',4);8279order=900;new Game.TieredUpgrade('Causality enforcer','Time machines are <b>twice</b> as efficient.<q>What happened, happened.</q>','Time machine',4);82808281order=5000;8282new Game.Upgrade('Lucky day','Golden cookies appear <b>twice as often</b> and stay <b>twice as long</b>.<q>Oh hey, a four-leaf penny!</q>',777777777,[27,6]);8283new Game.Upgrade('Serendipity','Golden cookies appear <b>twice as often</b> and stay <b>twice as long</b>.<q>What joy! Seven horseshoes!</q>',77777777777,[27,6]);82848285order=20000;8286new Game.Upgrade('Kitten engineers','You gain <b>more CpS</b> the more milk you have.<q>meow meow meow meow, sir</q>',90000000000000,Game.GetIcon('Kitten',3));Game.last.kitten=1;Game.MakeTiered(Game.last,3,18);82878288order=10020;8289Game.NewUpgradeCookie({name:'Dark chocolate-coated cookies',desc:'These absorb light so well you almost need to squint to see them.',icon:[10,3],power: 4, price: 99999999999});8290Game.NewUpgradeCookie({name:'White chocolate-coated cookies',desc:'These dazzling cookies absolutely glisten with flavor.',icon:[11,3],power: 4, price: 99999999999});82918292Game.GrandmaSynergies=[];8293Game.GrandmaSynergy=function(name,desc,building)8294{8295var building=Game.Objects[building];8296var grandmaNumber=(building.id-1);8297if (grandmaNumber==1) grandmaNumber='grandma';8298else grandmaNumber+=' grandmas';8299desc='Grandmas are <b>twice</b> as efficient. '+(building.plural.charAt(0).toUpperCase()+building.plural.slice(1))+' gain <b>+1% CpS</b> per '+grandmaNumber+'.<q>'+desc+'</q>';83008301var upgrade=new Game.Upgrade(name,desc,building.basePrice*Game.Tiers[2].price,[10,9],function(){Game.Objects['Grandma'].redraw();});8302building.grandma=upgrade;8303upgrade.buildingTie=building;8304Game.GrandmaSynergies.push(upgrade.name);8305return upgrade;8306}83078308order=250;8309Game.GrandmaSynergy('Farmer grandmas','A nice farmer to grow more cookies.','Farm');8310Game.GrandmaSynergy('Miner grandmas','A nice miner to dig more cookies.','Mine');8311Game.GrandmaSynergy('Worker grandmas','A nice worker to manufacture more cookies.','Factory');8312Game.GrandmaSynergy('Cosmic grandmas','A nice thing to... uh... cookies.','Shipment');8313Game.GrandmaSynergy('Transmuted grandmas','A nice golden grandma to convert into more cookies.','Alchemy lab');8314Game.GrandmaSynergy('Altered grandmas','a NiCe GrAnDmA tO bA##########','Portal');8315Game.GrandmaSynergy('Grandmas\' grandmas','A nice grandma\'s nice grandma to bake double the cookies.','Time machine');83168317order=14000;8318Game.baseResearchTime=Game.fps*60*30;8319Game.SetResearch=function(what,time)8320{8321if (Game.Upgrades[what] && !Game.Has(what))8322{8323Game.researchT=Game.baseResearchTime;8324if (Game.Has('Persistent memory')) Game.researchT=Math.ceil(Game.baseResearchTime/10);8325if (Game.Has('Ultrascience')) Game.researchT=Game.fps*5;8326Game.nextResearch=Game.Upgrades[what].id;8327if (Game.prefs.popups) Game.Popup('Research has begun.');8328else Game.Notify('Research has begun','Your bingo center/research facility is conducting experiments.',[9,0]);8329}8330}83318332new Game.Upgrade('Bingo center/Research facility','Grandma-operated science lab and leisure club.<br>Grandmas are <b>4 times</b> as efficient.<br><b>Regularly unlocks new upgrades</b>.<q>What could possibly keep those grandmothers in check?...<br>Bingo.</q>',1000000000000000,[11,9],function(){Game.SetResearch('Specialized chocolate chips');});Game.last.noPerm=1;83338334order=15000;8335new Game.Upgrade('Specialized chocolate chips','Cookie production multiplier <b>+1%</b>.<q>Computer-designed chocolate chips. Computer chips, if you will.</q>',1000000000000000,[0,9],function(){Game.SetResearch('Designer cocoa beans');});Game.last.pool='tech';8336new Game.Upgrade('Designer cocoa beans','Cookie production multiplier <b>+2%</b>.<q>Now more aerodynamic than ever!</q>',2000000000000000,[1,9],function(){Game.SetResearch('Ritual rolling pins');});Game.last.pool='tech';8337new Game.Upgrade('Ritual rolling pins','Grandmas are <b>twice</b> as efficient.<q>The result of years of scientific research!</q>',4000000000000000,[2,9],function(){Game.SetResearch('Underworld ovens');});Game.last.pool='tech';8338new Game.Upgrade('Underworld ovens','Cookie production multiplier <b>+3%</b>.<q>Powered by science, of course!</q>',8000000000000000,[3,9],function(){Game.SetResearch('One mind');});Game.last.pool='tech';8339new Game.Upgrade('One mind','Each grandma gains <b>+0.0<span></span>2 base CpS per grandma</b>.<div class="warning">Note : the grandmothers are growing restless. Do not encourage them.</div><q>We are one. We are many.</q>',16000000000000000,[4,9],function(){Game.elderWrath=1;Game.SetResearch('Exotic nuts');Game.storeToRefresh=1;});Game.last.pool='tech';8340//Game.last.clickFunction=function(){return confirm('Warning : purchasing this will have unexpected, and potentially undesirable results!\nIt\'s all downhill from here. You have been warned!\nPurchase anyway?');};8341Game.RequiresConfirmation(Game.last,'<div class="block"><b>Warning :</b> purchasing this will have unexpected, and potentially undesirable results!<br><small>It\'s all downhill from here. You have been warned!</small><br><br>Purchase anyway?</small></div>');8342new Game.Upgrade('Exotic nuts','Cookie production multiplier <b>+4%</b>.<q>You\'ll go crazy over these!</q>',32000000000000000,[5,9],function(){Game.SetResearch('Communal brainsweep');});Game.last.pool='tech';8343new Game.Upgrade('Communal brainsweep','Each grandma gains another <b>+0.0<span></span>2 base CpS per grandma</b>.<div class="warning">Note : proceeding any further in scientific research may have unexpected results. You have been warned.</div><q>We fuse. We merge. We grow.</q>',64000000000000000,[6,9],function(){Game.elderWrath=2;Game.SetResearch('Arcane sugar');Game.storeToRefresh=1;});Game.last.pool='tech';8344new Game.Upgrade('Arcane sugar','Cookie production multiplier <b>+5%</b>.<q>Tastes like insects, ligaments, and molasses.</q>',128000000000000000,[7,9],function(){Game.SetResearch('Elder Pact');});Game.last.pool='tech';8345new Game.Upgrade('Elder Pact','Each grandma gains <b>+0.0<span></span>5 base CpS per portal</b>.<div class="warning">Note : this is a bad idea.</div><q>squirm crawl slither writhe<br>today we rise</q>',256000000000000000,[8,9],function(){Game.elderWrath=3;Game.storeToRefresh=1;});Game.last.pool='tech';8346new Game.Upgrade('Elder Pledge','Contains the wrath of the elders, at least for a while.<q>This is a simple ritual involving anti-aging cream, cookie batter mixed in the moonlight, and a live chicken.</q>',1,[9,9],function()8347{8348Game.elderWrath=0;8349Game.pledges++;8350Game.pledgeT=Game.getPledgeDuration();8351Game.Unlock('Elder Covenant');8352Game.CollectWrinklers();8353Game.storeToRefresh=1;8354});8355Game.getPledgeDuration=function(){return Game.fps*60*(Game.Has('Sacrificial rolling pins')?60:30);}8356Game.last.pool='toggle';8357Game.last.displayFuncWhenOwned=function(){return '<div style="text-align:center;">Time remaining until pledge runs out :<br><b>'+Game.sayTime(Game.pledgeT,-1)+'</b></div>';}8358Game.last.timerDisplay=function(){if (!Game.Upgrades['Elder Pledge'].bought) return -1; else return 1-Game.pledgeT/Game.getPledgeDuration();}8359Game.last.priceFunc=function(){return Math.pow(8,Math.min(Game.pledges+2,14));}83608361Game.last.descFunc=function(){8362return '<div style="text-align:center;">'+(Game.pledges==0?'You haven\'t pledged to the elders yet.':('You\'ve pledged to the elders <b>'+(Game.pledges==1?'once':Game.pledges==2?'twice':(Game.pledges+' times'))+'</b>.'))+'<div class="line"></div></div>'+this.desc;8363};836483658366order=150;8367new Game.Upgrade('Plastic mouse','Clicking gains <b>+1% of your CpS</b>.<q>Slightly squeaky.</q>',50000,[11,0]);Game.MakeTiered(Game.last,1,11);8368new Game.Upgrade('Iron mouse','Clicking gains <b>+1% of your CpS</b>.<q>Click like it\'s 1349!</q>',5000000,[11,1]);Game.MakeTiered(Game.last,2,11);8369new Game.Upgrade('Titanium mouse','Clicking gains <b>+1% of your CpS</b>.<q>Heavy, but powerful.</q>',500000000,[11,2]);Game.MakeTiered(Game.last,3,11);8370new Game.Upgrade('Adamantium mouse','Clicking gains <b>+1% of your CpS</b>.<q>You could cut diamond with these.</q>',50000000000,[11,13]);Game.MakeTiered(Game.last,4,11);83718372order=40000;8373new Game.Upgrade('Ultrascience','Research takes only <b>5 seconds</b>.<q>YEAH, SCIENCE!</q>',7,[9,2]);//debug purposes only8374Game.last.pool='debug';83758376order=10020;8377Game.NewUpgradeCookie({name:'Eclipse cookies',desc:'Look to the cookie.',icon:[0,4],power: 2, price: 99999999999*5});8378Game.NewUpgradeCookie({name:'Zebra cookies',desc:'...',icon:[1,4],power: 2, price: 999999999999});83798380order=100;8381new Game.Upgrade('Quintillion fingers','The mouse and cursors gain <b>+5000</b> cookies for each non-cursor object owned.<q>man, just go click click click click click, it\'s real easy, man.</q>',10000000000000,[0,18]);Game.MakeTiered(Game.last,9,0);83828383order=40000;8384new Game.Upgrade('Gold hoard','Golden cookies appear <b>really often</b>.<q>That\'s entirely too many.</q>',7,[10,14]);//debug purposes only8385Game.last.pool='debug';83868387order=15000;8388new Game.Upgrade('Elder Covenant','Puts a permanent end to the elders\' wrath, at the price of 5% of your CpS.<q>This is a complicated ritual involving silly, inconsequential trivialities such as cursed laxatives, century-old cacao, and an infant.<br>Don\'t question it.</q>',66666666666666,[8,9],function()8389{8390Game.pledgeT=0;8391Game.Lock('Revoke Elder Covenant');8392Game.Unlock('Revoke Elder Covenant');8393Game.Lock('Elder Pledge');8394Game.Win('Elder calm');8395Game.CollectWrinklers();8396Game.storeToRefresh=1;8397});8398Game.last.pool='toggle';83998400new Game.Upgrade('Revoke Elder Covenant','You will get 5% of your CpS back, but the grandmatriarchs will return.<q>we<br>rise<br>again</q>',6666666666,[8,9],function()8401{8402Game.Lock('Elder Covenant');8403Game.Unlock('Elder Covenant');8404});8405Game.last.pool='toggle';84068407order=5000;8408new Game.Upgrade('Get lucky','Golden cookie effects last <b>twice as long</b>.<q>You\'ve been up all night, haven\'t you?</q>',77777777777777,[27,6]);84098410order=15000;8411new Game.Upgrade('Sacrificial rolling pins','Elder pledges last <b>twice</b> as long.<q>These are mostly just for spreading the anti-aging cream.<br>(And accessorily, shortening the chicken\'s suffering.)</q>',2888888888888,[2,9]);84128413order=10020;8414Game.NewUpgradeCookie({name:'Snickerdoodles',desc:'True to their name.',icon:[2,4],power: 2, price: 999999999999*5});8415Game.NewUpgradeCookie({name:'Stroopwafels',desc:'If it ain\'t dutch, it ain\'t much.',icon:[3,4],power: 2, price: 9999999999999});8416Game.NewUpgradeCookie({name:'Macaroons',desc:'Not to be confused with macarons.<br>These have coconut, okay?',icon:[4,4],power: 2, price: 9999999999999*5});84178418order=40000;8419new Game.Upgrade('Neuromancy','Can toggle upgrades on and off at will in the stats menu.<q>Can also come in handy to unsee things that can\'t be unseen.</q>',7,[4,9]);//debug purposes only8420Game.last.pool='debug';84218422order=10031;8423Game.NewUpgradeCookie({name:'Empire biscuits',desc:'For your growing cookie empire, of course!',icon:[5,4],power: 2, price: 99999999999999});8424Game.NewUpgradeCookie({name:'British tea biscuits',desc:'Quite.',icon:[6,4],require:'Tin of british tea biscuits',power: 2, price: 99999999999999});8425Game.NewUpgradeCookie({name:'Chocolate british tea biscuits',desc:'Yes, quite.',icon:[7,4],require:Game.last.name,power: 2, price: 99999999999999});8426Game.NewUpgradeCookie({name:'Round british tea biscuits',desc:'Yes, quite riveting.',icon:[8,4],require:Game.last.name,power: 2, price: 99999999999999});8427Game.NewUpgradeCookie({name:'Round chocolate british tea biscuits',desc:'Yes, quite riveting indeed.',icon:[9,4],require:Game.last.name,power: 2, price: 99999999999999});8428Game.NewUpgradeCookie({name:'Round british tea biscuits with heart motif',desc:'Yes, quite riveting indeed, old chap.',icon:[10,4],require:Game.last.name,power: 2, price: 99999999999999});8429Game.NewUpgradeCookie({name:'Round chocolate british tea biscuits with heart motif',desc:'I like cookies.',icon:[11,4],require:Game.last.name,power: 2, price: 99999999999999});84308431order=1000;8432new Game.TieredUpgrade('Sugar bosons','Antimatter condensers are <b>twice</b> as efficient.<q>Sweet firm bosons.</q>','Antimatter condenser',1);8433new Game.TieredUpgrade('String theory','Antimatter condensers are <b>twice</b> as efficient.<q>Reveals new insight about the true meaning of baking cookies (and, as a bonus, the structure of the universe).</q>','Antimatter condenser',2);8434new Game.TieredUpgrade('Large macaron collider','Antimatter condensers are <b>twice</b> as efficient.<q>How singular!</q>','Antimatter condenser',3);8435new Game.TieredUpgrade('Big bang bake','Antimatter condensers are <b>twice</b> as efficient.<q>And that\'s how it all began.</q>','Antimatter condenser',4);84368437order=255;8438Game.GrandmaSynergy('Antigrandmas','A mean antigrandma to vomit more cookies.','Antimatter condenser');84398440order=10020;8441Game.NewUpgradeCookie({name:'Madeleines',desc:'Unforgettable!',icon:[12,3],power: 2, price: 99999999999999*5});8442Game.NewUpgradeCookie({name:'Palmiers',desc:'Palmier than you!',icon:[13,3],power: 2, price: 99999999999999*5});8443Game.NewUpgradeCookie({name:'Palets',desc:'You could probably play hockey with these.<br>I mean, you\'re welcome to try.',icon:[12,4],power: 2, price: 999999999999999});8444Game.NewUpgradeCookie({name:'Sablés',desc:'The name implies they\'re made of sand. But you know better, don\'t you?',icon:[13,4],power: 2, price: 999999999999999});84458446order=20000;8447new Game.Upgrade('Kitten overseers','You gain <b>more CpS</b> the more milk you have.<q>my purrpose is to serve you, sir</q>',90000000000000000,Game.GetIcon('Kitten',4));Game.last.kitten=1;Game.MakeTiered(Game.last,4,18);844884498450order=100;8451new Game.Upgrade('Sextillion fingers','The mouse and cursors gain <b>+50000</b> cookies for each non-cursor object owned.<q>sometimes<br>things just<br>click</q>',10000000000000000,[0,19]);Game.MakeTiered(Game.last,10,0);84528453order=200;new Game.TieredUpgrade('Double-thick glasses','Grandmas are <b>twice</b> as efficient.<q>Oh... so THAT\'s what I\'ve been baking.</q>','Grandma',5);8454order=300;new Game.TieredUpgrade('Gingerbread scarecrows','Farms are <b>twice</b> as efficient.<q>Staring at your crops with mischievous glee.</q>','Farm',5);8455order=500;new Game.TieredUpgrade('Recombobulators','Factories are <b>twice</b> as efficient.<q>A major part of cookie recombobulation.</q>','Factory',5);8456order=400;new Game.TieredUpgrade('H-bomb mining','Mines are <b>twice</b> as efficient.<q>Questionable efficiency, but spectacular nonetheless.</q>','Mine',5);8457order=600;new Game.TieredUpgrade('Chocolate monoliths','Shipments are <b>twice</b> as efficient.<q>My god. It\'s full of chocolate bars.</q>','Shipment',5);8458order=700;new Game.TieredUpgrade('Aqua crustulae','Alchemy labs are <b>twice</b> as efficient.<q>Careful with the dosing - one drop too much and you get muffins.<br>And nobody likes muffins.</q>','Alchemy lab',5);8459order=800;new Game.TieredUpgrade('Brane transplant','Portals are <b>twice</b> as efficient.<q>This refers to the practice of merging higher dimensional universes, or "branes", with our own, in order to facilitate transit (and harvesting of precious cookie dough).</q>','Portal',5);8460order=900;new Game.TieredUpgrade('Yestermorrow comparators','Time machines are <b>twice</b> as efficient.<q>Fortnights into milleniums.</q>','Time machine',5);8461order=1000;new Game.TieredUpgrade('Reverse cyclotrons','Antimatter condensers are <b>twice</b> as efficient.<q>These can uncollision particles and unspin atoms. For... uh... better flavor, and stuff.</q>','Antimatter condenser',5);84628463order=150;8464new Game.Upgrade('Unobtainium mouse','Clicking gains <b>+1% of your CpS</b>.<q>These nice mice should suffice.</q>',5000000000000,[11,14]);Game.MakeTiered(Game.last,5,11);84658466order=10020;8467Game.NewUpgradeCookie({name:'Caramoas',desc:'Yeah. That\'s got a nice ring to it.',icon:[14,4],require:'Box of brand biscuits',power: 3, price: 9999999999999999});8468Game.NewUpgradeCookie({name:'Sagalongs',desc:'Grandma\'s favorite?',icon:[15,3],require:'Box of brand biscuits',power: 3, price: 9999999999999999});8469Game.NewUpgradeCookie({name:'Shortfoils',desc:'Foiled again!',icon:[15,4],require:'Box of brand biscuits',power: 3, price: 9999999999999999});8470Game.NewUpgradeCookie({name:'Win mints',desc:'They\'re the luckiest cookies you\'ve ever tasted!',icon:[14,3],require:'Box of brand biscuits',power: 3, price: 9999999999999999});84718472order=40000;8473new Game.Upgrade('Perfect idling','You keep producing cookies even while the game is closed.<q>It\'s the most beautiful thing I\'ve ever seen.</q>',7,[10,0]);//debug purposes only8474Game.last.pool='debug';84758476order=10030;8477Game.NewUpgradeCookie({name:'Fig gluttons',desc:'Got it all figured out.',icon:[17,4],require:'Box of brand biscuits',power: 2, price: 999999999999999*5});8478Game.NewUpgradeCookie({name:'Loreols',desc:'Because, uh... they\'re worth it?',icon:[16,3],require:'Box of brand biscuits',power: 2, price: 999999999999999*5});8479Game.NewUpgradeCookie({name:'Jaffa cakes',desc:'If you want to bake a cookie from scratch, you must first build a factory.',icon:[17,3],require:'Box of brand biscuits',power: 2, price: 999999999999999*5});8480Game.NewUpgradeCookie({name:'Grease\'s cups',desc:'Extra-greasy peanut butter.',icon:[16,4],require:'Box of brand biscuits',power: 2, price: 999999999999999*5});84818482order=30000;8483new Game.Upgrade('Heavenly chip secret','Unlocks <b>5%</b> of the potential of your prestige level.<q>Grants the knowledge of heavenly chips, and how to use them to make baking more efficient.<br>It\'s a secret to everyone.</q>',11,[19,7]);Game.last.noPerm=1;8484new Game.Upgrade('Heavenly cookie stand','Unlocks <b>25%</b> of the potential of your prestige level.<q>Don\'t forget to visit the heavenly lemonade stand afterwards. When afterlife gives you lemons...</q>',1111,[18,7]);Game.last.noPerm=1;8485new Game.Upgrade('Heavenly bakery','Unlocks <b>50%</b> of the potential of your prestige level.<q>Also sells godly cakes and divine pastries. The pretzels aren\'t too bad either.</q>',111111,[17,7]);Game.last.noPerm=1;8486new Game.Upgrade('Heavenly confectionery','Unlocks <b>75%</b> of the potential of your prestige level.<q>They say angel bakers work there. They take angel lunch breaks and sometimes go on angel strikes.</q>',11111111,[16,7]);Game.last.noPerm=1;8487new Game.Upgrade('Heavenly key','Unlocks <b>100%</b> of the potential of your prestige level.<q>This is the key to the pearly (and tasty) gates of pastry heaven, granting you access to your entire stockpile of heavenly chips for baking purposes.<br>May you use them wisely.</q>',1111111111,[15,7]);Game.last.noPerm=1;84888489order=10100;8490Game.NewUpgradeCookie({name:'Skull cookies',desc:'Wanna know something spooky? You\'ve got one of these inside your head RIGHT NOW.',locked:1,icon:[12,8],power: 2, price: 444444444444});8491Game.NewUpgradeCookie({name:'Ghost cookies',desc:'They\'re something strange, but they look pretty good!',locked:1,icon:[13,8],power: 2, price: 444444444444});8492Game.NewUpgradeCookie({name:'Bat cookies',desc:'The cookies this town deserves.',locked:1,icon:[14,8],power: 2, price: 444444444444});8493Game.NewUpgradeCookie({name:'Slime cookies',desc:'The incredible melting cookies!',locked:1,icon:[15,8],power: 2, price: 444444444444});8494Game.NewUpgradeCookie({name:'Pumpkin cookies',desc:'Not even pumpkin-flavored. Tastes like glazing. Yeugh.',locked:1,icon:[16,8],power: 2, price: 444444444444});8495Game.NewUpgradeCookie({name:'Eyeball cookies',desc:'When you stare into the cookie, the cookie stares back at you.',locked:1,icon:[17,8],power: 2, price: 444444444444});8496Game.NewUpgradeCookie({name:'Spider cookies',desc:'You found the recipe on the web. They do whatever a cookie can.',locked:1,icon:[18,8],power: 2, price: 444444444444});84978498Game.halloweenDrops=['Skull cookies','Ghost cookies','Bat cookies','Slime cookies','Pumpkin cookies','Eyeball cookies','Spider cookies'];84998500Game.GetHowManyHalloweenDrops=function()8501{8502var num=0;8503for (var i in Game.halloweenDrops) {if (Game.Has(Game.halloweenDrops[i])) num++;}8504return num;8505}8506/*for (var i in Game.halloweenDrops)8507{8508Game.Upgrades[Game.halloweenDrops[i]].descFunc=function(){return '<div style="text-align:center;">You currently own <b>'+Game.GetHowManyHalloweenDrops()+'/'+Game.halloweenDrops.length+'</b> halloween cookies.</div><div class="line"></div>'+this.desc;};8509}*/85108511order=0;8512new Game.Upgrade('Persistent memory','Subsequent research will be <b>10 times</b> as fast.<q>It\'s all making sense!<br>Again!</q>',500,[9,2]);Game.last.pool='prestige';85138514order=40000;8515new Game.Upgrade('Wrinkler doormat','Wrinklers spawn much more frequently.<q>You\'re such a pushover.</q>',7,[19,8]);//debug purposes only8516Game.last.pool='debug';85178518order=10200;8519Game.NewUpgradeCookie({name:'Christmas tree biscuits',desc:'Whose pine is it anyway?',locked:1,icon:[12,10],power:2,price: 252525252525});8520Game.NewUpgradeCookie({name:'Snowflake biscuits',desc:'Mass-produced to be unique in every way.',locked:1,icon:[13,10],power:2,price: 252525252525});8521Game.NewUpgradeCookie({name:'Snowman biscuits',desc:'It\'s frosted. Doubly so.',locked:1,icon:[14,10],power:2,price: 252525252525});8522Game.NewUpgradeCookie({name:'Holly biscuits',desc:'You don\'t smooch under these ones. That would be the mistletoe (which, botanically, is a smellier variant of the mistlefinger).',locked:1,icon:[15,10],power:2,price: 252525252525});8523Game.NewUpgradeCookie({name:'Candy cane biscuits',desc:'It\'s two treats in one!<br>(Further inspection reveals the frosting does not actually taste like peppermint, but like mundane sugary frosting.)',locked:1,icon:[16,10],power:2,price: 252525252525});8524Game.NewUpgradeCookie({name:'Bell biscuits',desc:'What do these even have to do with christmas? Who cares, ring them in!',locked:1,icon:[17,10],power:2,price: 252525252525});8525Game.NewUpgradeCookie({name:'Present biscuits',desc:'The prequel to future biscuits. Watch out!',locked:1,icon:[18,10],power:2,price: 252525252525});85268527order=10020;8528Game.NewUpgradeCookie({name:'Gingerbread men',desc:'You like to bite the legs off first, right? How about tearing off the arms? You sick monster.',icon:[18,4],power: 2,price: 9999999999999999});8529Game.NewUpgradeCookie({name:'Gingerbread trees',desc:'Evergreens in pastry form. Yule be surprised what you can come up with.',icon:[18,3],power: 2,price: 9999999999999999});85308531order=25000;8532new Game.Upgrade('A festive hat','<b>Unlocks... something.</b><q>Not a creature was stirring, not even a mouse.</q>',25,[19,9],function()8533{8534var drop=choose(Game.santaDrops);8535Game.Unlock(drop);8536if (Game.prefs.popups) Game.Popup('In the festive hat, you find...<br>a festive test tube<br>and '+drop+'.');8537else Game.Notify('In the festive hat, you find...','a festive test tube<br>and <b>'+drop+'</b>.',Game.Upgrades[drop].icon);8538});85398540new Game.Upgrade('Increased merriness','Cookie production multiplier <b>+15%</b>.<br>Cost scales with Santa level.<q>It turns out that the key to increased merriness, strangely enough, happens to be a good campfire and some s\'mores.<br>You know what they say, after all; the s\'more, the merrier.</q>',2525,[17,9]);8541new Game.Upgrade('Improved jolliness','Cookie production multiplier <b>+15%</b>.<br>Cost scales with Santa level.<q>A nice wobbly belly goes a long way.<br>You jolly?</q>',2525,[17,9]);8542new Game.Upgrade('A lump of coal','Cookie production multiplier <b>+1%</b>.<br>Cost scales with Santa level.<q>Some of the world\'s worst stocking stuffing.<br>I guess you could try starting your own little industrial revolution, or something?...</q>',2525,[13,9]);8543new Game.Upgrade('An itchy sweater','Cookie production multiplier <b>+1%</b>.<br>Cost scales with Santa level.<q>You don\'t know what\'s worse : the embarrassingly quaint "elf on reindeer" motif, or the fact that wearing it makes you feel like you\'re wrapped in a dead sasquatch.</q>',2525,[14,9]);8544new Game.Upgrade('Reindeer baking grounds','Reindeer appear <b>twice as frequently</b>.<br>Cost scales with Santa level.<q>Male reindeer are from Mars; female reindeer are from venison.</q>',2525,[12,9]);8545new Game.Upgrade('Weighted sleighs','Reindeer are <b>twice as slow</b>.<br>Cost scales with Santa level.<q>Hope it was worth the weight.<br>(Something something forced into cervidude)</q>',2525,[12,9]);8546new Game.Upgrade('Ho ho ho-flavored frosting','Reindeer give <b>twice as much</b>.<br>Cost scales with Santa level.<q>It\'s time to up the antler.</q>',2525,[12,9]);8547new Game.Upgrade('Season savings','All buildings are <b>1% cheaper</b>.<br>Cost scales with Santa level.<q>By Santa\'s beard, what savings!<br>But who will save us?</q>',2525,[16,9],function(){Game.storeToRefresh=1;});8548new Game.Upgrade('Toy workshop','All upgrades are <b>5% cheaper</b>.<br>Cost scales with Santa level.<q>Watch yours-elf around elvesdroppers who might steal our production secrets.<br>Or elven worse!</q>',2525,[16,9],function(){Game.upgradesToRebuild=1;});8549new Game.Upgrade('Naughty list','Grandmas are <b>twice</b> as productive.<br>Cost scales with Santa level.<q>This list contains every unholy deed perpetuated by grandmakind.<br>He won\'t be checking this one twice.<br>Once. Once is enough.</q>',2525,[15,9]);8550new Game.Upgrade('Santa\'s bottomless bag','Random drops are <b>10% more common</b>.<br>Cost scales with Santa level.<q>This is one bottom you can\'t check out.</q>',2525,[19,9]);8551new Game.Upgrade('Santa\'s helpers','Clicking is <b>10% more powerful</b>.<br>Cost scales with Santa level.<q>Some choose to help hamburger; some choose to help you.<br>To each their own, I guess.</q>',2525,[19,9]);8552new Game.Upgrade('Santa\'s legacy','Cookie production multiplier <b>+3% per Santa\'s levels</b>.<br>Cost scales with Santa level.<q>In the north pole, you gotta get the elves first. Then when you get the elves, you start making the toys. Then when you get the toys... then you get the cookies.</q>',2525,[19,9]);8553new Game.Upgrade('Santa\'s milk and cookies','Milk is <b>5% more powerful</b>.<br>Cost scales with Santa level.<q>Part of Santa\'s dreadfully unbalanced diet.</q>',2525,[19,9]);85548555order=40000;8556new Game.Upgrade('Reindeer season','Reindeer spawn much more frequently.<q>Go, Cheater! Go, Hacker and Faker!</q>',7,[12,9]);//debug purposes only8557Game.last.pool='debug';85588559order=25000;8560new Game.Upgrade('Santa\'s dominion','Cookie production multiplier <b>+20%</b>.<br>All buildings are <b>1% cheaper</b>.<br>All upgrades are <b>2% cheaper</b>.<q>My name is Claus, king of kings;<br>Look on my toys, ye Mighty, and despair!</q>',2525252525252525,[19,10],function(){Game.storeToRefresh=1;});85618562order=10300;8563var heartPower=function(){8564var pow=2;8565if (Game.Has('Starlove')) pow=3;8566if (Game.hasGod)8567{8568var godLvl=Game.hasGod('seasons');8569if (godLvl==1) pow*=1.3;8570else if (godLvl==2) pow*=1.2;8571else if (godLvl==3) pow*=1.1;8572}8573return pow;8574};8575Game.NewUpgradeCookie({name:'Pure heart biscuits',desc:'Melty white chocolate<br>that says "I *like* like you".',season:'valentines',icon:[19,3], power:heartPower,price: 1000000});8576Game.NewUpgradeCookie({name:'Ardent heart biscuits',desc:'A red hot cherry biscuit that will nudge the target of your affection in interesting directions.',require:Game.last.name,season:'valentines',icon:[20,3], power:heartPower,price: 1000000000});8577Game.NewUpgradeCookie({name:'Sour heart biscuits',desc:'A bitter lime biscuit for the lonely and the heart-broken.',require:Game.last.name,season:'valentines',icon:[20,4], power:heartPower,price: 1000000000000});8578Game.NewUpgradeCookie({name:'Weeping heart biscuits',desc:'An ice-cold blueberry biscuit, symbol of a mending heart.',require:Game.last.name,season:'valentines',icon:[21,3], power:heartPower,price: 1000000000000000});8579Game.NewUpgradeCookie({name:'Golden heart biscuits',desc:'A beautiful biscuit to symbolize kindness, true love, and sincerity.',require:Game.last.name,season:'valentines',icon:[21,4], power:heartPower,price: 1000000000000000000});8580Game.NewUpgradeCookie({name:'Eternal heart biscuits',desc:'Silver icing for a very special someone you\'ve liked for a long, long time.',require:Game.last.name,season:'valentines',icon:[19,4], power:heartPower,price: 1000000000000000000000});85818582Game.heartDrops=['Pure heart biscuits','Ardent heart biscuits','Sour heart biscuits','Weeping heart biscuits','Golden heart biscuits','Eternal heart biscuits'];85838584Game.GetHowManyHeartDrops=function()8585{8586var num=0;8587for (var i in Game.heartDrops) {if (Game.Has(Game.heartDrops[i])) num++;}8588return num;8589}8590/*for (var i in Game.heartDrops)8591{8592Game.Upgrades[Game.heartDrops[i]].descFunc=function(){return '<div style="text-align:center;">You currently own <b>'+Game.GetHowManyHeartDrops()+'/'+Game.heartDrops.length+'</b> heart biscuits.</div><div class="line"></div>'+this.desc;};8593}*/85948595order=1100;8596new Game.TieredUpgrade('Gem polish','Prisms are <b>twice</b> as efficient.<q>Get rid of the grime and let more light in.<br>Truly, truly outrageous.</q>','Prism',1);8597new Game.TieredUpgrade('9th color','Prisms are <b>twice</b> as efficient.<q>Delve into untouched optical depths where even the mantis shrimp hasn\'t set an eye!</q>','Prism',2);8598new Game.TieredUpgrade('Chocolate light','Prisms are <b>twice</b> as efficient.<q>Bask into its cocoalescence.<br>(Warning : may cause various interesting albeit deadly skin conditions.)</q>','Prism',3);8599new Game.TieredUpgrade('Grainbow','Prisms are <b>twice</b> as efficient.<q>Remember the different grains using the handy Roy G. Biv mnemonic : R is for rice, O is for oats... uh, B for barley?...</q>','Prism',4);8600new Game.TieredUpgrade('Pure cosmic light','Prisms are <b>twice</b> as efficient.<q>Your prisms now receive pristine, unadulterated photons from the other end of the universe.</q>','Prism',5);86018602order=255;8603Game.GrandmaSynergy('Rainbow grandmas','A luminous grandma to sparkle into cookies.','Prism');86048605order=24000;8606Game.seasonTriggerBasePrice=1000000000;//1111111111;8607new Game.Upgrade('Season switcher','Allows you to <b>trigger seasonal events</b> at will, for a price.<q>There will always be time.</q>',1111,[16,6],function(){for (var i in Game.seasons){Game.Unlock(Game.seasons[i].trigger);}});Game.last.pool='prestige';Game.last.parents=['Heralds'];8608new Game.Upgrade('Festive biscuit','Triggers <b>Christmas season</b> for the next 24 hours.<br>Triggering another season will cancel this one.<br>Cost scales with unbuffed CpS and increases with every season switch.<q>\'Twas the night before Christmas- or was it?</q>',Game.seasonTriggerBasePrice,[12,10]);Game.last.season='christmas';Game.last.pool='toggle';8609new Game.Upgrade('Ghostly biscuit','Triggers <b>Halloween season</b> for the next 24 hours.<br>Triggering another season will cancel this one.<br>Cost scales with unbuffed CpS and increases with every season switch.<q>spooky scary skeletons<br>will wake you with a boo</q>',Game.seasonTriggerBasePrice,[13,8]);Game.last.season='halloween';Game.last.pool='toggle';8610new Game.Upgrade('Lovesick biscuit','Triggers <b>Valentine\'s Day season</b> for the next 24 hours.<br>Triggering another season will cancel this one.<br>Cost scales with unbuffed CpS and increases with every season switch.<q>Romance never goes out of fashion.</q>',Game.seasonTriggerBasePrice,[20,3]);Game.last.season='valentines';Game.last.pool='toggle';8611new Game.Upgrade('Fool\'s biscuit','Triggers <b>Business Day season</b> for the next 24 hours.<br>Triggering another season will cancel this one.<br>Cost scales with unbuffed CpS and increases with every season switch.<q>Business. Serious business. This is absolutely all of your business.</q>',Game.seasonTriggerBasePrice,[17,6]);Game.last.season='fools';Game.last.pool='toggle';861286138614order=40000;8615new Game.Upgrade('Eternal seasons','Seasons now last forever.<q>Season to taste.</q>',7,[16,6],function(){for (var i in Game.seasons){Game.Unlock(Game.seasons[i].trigger);}});//debug purposes only8616Game.last.pool='debug';861786188619order=20000;8620new Game.Upgrade('Kitten managers','You gain <b>more CpS</b> the more milk you have.<q>that\'s not gonna paws any problem, sir</q>',900000000000000000000,Game.GetIcon('Kitten',5));Game.last.kitten=1;Game.MakeTiered(Game.last,5,18);86218622order=100;8623new Game.Upgrade('Septillion fingers','The mouse and cursors gain <b>+500000</b> cookies for each non-cursor object owned.<q>[cursory flavor text]</q>',10000000000000000000,[12,20]);Game.MakeTiered(Game.last,11,0);8624new Game.Upgrade('Octillion fingers','The mouse and cursors gain <b>+5000000</b> cookies for each non-cursor object owned.<q>Turns out you <b>can</b> quite put your finger on it.</q>',10000000000000000000000,[12,19]);Game.MakeTiered(Game.last,12,0);86258626order=150;new Game.Upgrade('Eludium mouse','Clicking gains <b>+1% of your CpS</b>.<q>I rodent do that if I were you.</q>',500000000000000,[11,15]);Game.MakeTiered(Game.last,6,11);8627new Game.Upgrade('Wishalloy mouse','Clicking gains <b>+1% of your CpS</b>.<q>Clicking is fine and dandy, but don\'t smash your mouse over it. Get your game on. Go play.</q>',50000000000000000,[11,16]);Game.MakeTiered(Game.last,7,11);8628order=200;new Game.TieredUpgrade('Aging agents','Grandmas are <b>twice</b> as efficient.<q>Counter-intuitively, grandmas have the uncanny ability to become more powerful the older they get.</q>','Grandma',6);8629order=300;new Game.TieredUpgrade('Pulsar sprinklers','Farms are <b>twice</b> as efficient.<q>There\'s no such thing as over-watering. The moistest is the bestest.</q>','Farm',6);8630order=500;new Game.TieredUpgrade('Deep-bake process','Factories are <b>twice</b> as efficient.<q>A patented process increasing cookie yield two-fold for the same amount of ingredients. Don\'t ask how, don\'t take pictures, and be sure to wear your protective suit.</q>','Factory',6);8631order=400;new Game.TieredUpgrade('Coreforge','Mines are <b>twice</b> as efficient.<q>You\'ve finally dug a tunnel down to the Earth\'s core. It\'s pretty warm down here.</q>','Mine',6);8632order=600;new Game.TieredUpgrade('Generation ship','Shipments are <b>twice</b> as efficient.<q>Built to last, this humongous spacecraft will surely deliver your cookies to the deep ends of space, one day.</q>','Shipment',6);8633order=700;new Game.TieredUpgrade('Origin crucible','Alchemy labs are <b>twice</b> as efficient.<q>Built from the rarest of earths and located at the very deepest of the largest mountain, this legendary crucible is said to retain properties from the big-bang itself.</q>','Alchemy lab',6);8634order=800;new Game.TieredUpgrade('Deity-sized portals','Portals are <b>twice</b> as efficient.<q>It\'s almost like, say, an elder god could fit through this thing now. Hypothetically.</q>','Portal',6);8635order=900;new Game.TieredUpgrade('Far future enactment','Time machines are <b>twice</b> as efficient.<q>The far future enactment authorizes you to delve deep into the future - where civilization has fallen and risen again, and cookies are plentiful.</q>','Time machine',6);8636order=1000;new Game.TieredUpgrade('Nanocosmics','Antimatter condensers are <b>twice</b> as efficient.<q>The theory of nanocosmics posits that each subatomic particle is in fact its own self-contained universe, holding unfathomable amounts of energy.<br>This somehow stacks with the nested universe theory, because physics.</q>','Antimatter condenser',6);8637order=1100;8638new Game.TieredUpgrade('Glow-in-the-dark','Prisms are <b>twice</b> as efficient.<q>Your prisms now glow in the dark, effectively doubling their output!</q>','Prism',6);86398640order=10032;8641Game.NewUpgradeCookie({name:'Rose macarons',desc:'Although an odd flavor, these pastries recently rose in popularity.',icon:[22,3],require:'Box of macarons', power:3,price: 9999});8642Game.NewUpgradeCookie({name:'Lemon macarons',desc:'Tastefully sour, delightful treats.',icon:[23,3],require:'Box of macarons', power:3,price: 9999999});8643Game.NewUpgradeCookie({name:'Chocolate macarons',desc:'They\'re like tiny sugary burgers!',icon:[24,3],require:'Box of macarons', power:3,price: 9999999999});8644Game.NewUpgradeCookie({name:'Pistachio macarons',desc:'Pistachio shells now removed after multiple complaints.',icon:[22,4],require:'Box of macarons', power:3,price: 9999999999999});8645Game.NewUpgradeCookie({name:'Hazelnut macarons',desc:'These go especially well with coffee.',icon:[23,4],require:'Box of macarons', power:3,price: 9999999999999999});8646Game.NewUpgradeCookie({name:'Violet macarons',desc:'It\'s like spraying perfume into your mouth!',icon:[24,4],require:'Box of macarons', power:3,price: 9999999999999999999});86478648order=40000;8649new Game.Upgrade('Magic shenanigans','Cookie production <b>multiplied by 1,000</b>.<q>It\'s magic. I ain\'t gotta explain sh<div style="display:inline-block;background:url(img/money.png);width:16px;height:16px;position:relative;top:4px;left:0px;margin:0px -2px;"></div>t.</q>',7,[17,5]);//debug purposes only8650Game.last.pool='debug';865186528653order=24000;8654new Game.Upgrade('Bunny biscuit','Triggers <b>Easter season</b> for the next 24 hours.<br>Triggering another season will cancel this one.<br>Cost scales with unbuffed CpS and increases with every season switch.<q>All the world will be your enemy<br>and when they catch you,<br>they will kill you...<br>but first they must catch you.</q>',Game.seasonTriggerBasePrice,[0,12]);Game.last.season='easter';Game.last.pool='toggle';86558656var eggPrice=999999999999;8657var eggPrice2=99999999999999;8658new Game.Upgrade('Chicken egg','Cookie production multiplier <b>+1%</b>.<br>Cost scales with how many eggs you own.<q>The egg. The egg came first. Get over it.</q>',eggPrice,[1,12]);8659new Game.Upgrade('Duck egg','Cookie production multiplier <b>+1%</b>.<br>Cost scales with how many eggs you own.<q>Then he waddled away.</q>',eggPrice,[2,12]);8660new Game.Upgrade('Turkey egg','Cookie production multiplier <b>+1%</b>.<br>Cost scales with how many eggs you own.<q>These hatch into strange, hand-shaped creatures.</q>',eggPrice,[3,12]);8661new Game.Upgrade('Quail egg','Cookie production multiplier <b>+1%</b>.<br>Cost scales with how many eggs you own.<q>These eggs are positively tiny. I mean look at them. How does this happen? Whose idea was that?</q>',eggPrice,[4,12]);8662new Game.Upgrade('Robin egg','Cookie production multiplier <b>+1%</b>.<br>Cost scales with how many eggs you own.<q>Holy azure-hued shelled embryos!</q>',eggPrice,[5,12]);8663new Game.Upgrade('Ostrich egg','Cookie production multiplier <b>+1%</b>.<br>Cost scales with how many eggs you own.<q>One of the largest eggs in the world. More like ostrouch, am I right?<br>Guys?</q>',eggPrice,[6,12]);8664new Game.Upgrade('Cassowary egg','Cookie production multiplier <b>+1%</b>.<br>Cost scales with how many eggs you own.<q>The cassowary is taller than you, possesses murderous claws and can easily outrun you.<br>You\'d do well to be casso-wary of them.</q>',eggPrice,[7,12]);8665new Game.Upgrade('Salmon roe','Cookie production multiplier <b>+1%</b>.<br>Cost scales with how many eggs you own.<q>Do the impossible, see the invisible.<br>Roe roe, fight the power?</q>',eggPrice,[8,12]);8666new Game.Upgrade('Frogspawn','Cookie production multiplier <b>+1%</b>.<br>Cost scales with how many eggs you own.<q>I was going to make a pun about how these "toadally look like eyeballs", but froget it.</q>',eggPrice,[9,12]);8667new Game.Upgrade('Shark egg','Cookie production multiplier <b>+1%</b>.<br>Cost scales with how many eggs you own.<q>HELLO IS THIS FOOD?<br>LET ME TELL YOU ABOUT FOOD.<br>WHY DO I KEEP EATING MY FRIENDS</q>',eggPrice,[10,12]);8668new Game.Upgrade('Turtle egg','Cookie production multiplier <b>+1%</b>.<br>Cost scales with how many eggs you own.<q>Turtles, right? Hatch from shells. Grow into shells. What\'s up with that?<br>Now for my skit about airplane food.</q>',eggPrice,[11,12]);8669new Game.Upgrade('Ant larva','Cookie production multiplier <b>+1%</b>.<br>Cost scales with how many eggs you own.<q>These are a delicacy in some countries, I swear. You will let these invade your digestive tract, and you will derive great pleasure from it.<br>And all will be well.</q>',eggPrice,[12,12]);8670new Game.Upgrade('Golden goose egg','Golden cookies appear <b>5% more often</b>.<br>Cost scales with how many eggs you own.<q>The sole vestige of a tragic tale involving misguided investments.</q>',eggPrice2,[13,12]);8671new Game.Upgrade('Faberge egg','All buildings and upgrades are <b>1% cheaper</b>.<br>Cost scales with how many eggs you own.<q>This outrageous egg is definitely fab.</q>',eggPrice2,[14,12],function(){Game.storeToRefresh=1;});8672new Game.Upgrade('Wrinklerspawn','Wrinklers explode into <b>5% more cookies</b>.<br>Cost scales with how many eggs you own.<q>Look at this little guy! It\'s gonna be a big boy someday! Yes it is!</q>',eggPrice2,[15,12]);8673new Game.Upgrade('Cookie egg','Clicking is <b>10% more powerful</b>.<br>Cost scales with how many eggs you own.<q>The shell appears to be chipped.<br>I wonder what\'s inside this one!</q>',eggPrice2,[16,12]);8674new Game.Upgrade('Omelette','Other eggs appear <b>10% more frequently</b>.<br>Cost scales with how many eggs you own.<q>Fromage not included.</q>',eggPrice2,[17,12]);8675new Game.Upgrade('Chocolate egg','Contains <b>a lot of cookies</b>.<br>Cost scales with how many eggs you own.<q>Laid by the elusive cocoa bird. There\'s a surprise inside!</q>',eggPrice2,[18,12],function()8676{8677var cookies=Game.cookies*0.05;8678if (Game.prefs.popups) Game.Popup('The chocolate egg bursts into<br>'+Beautify(cookies)+'!');8679else Game.Notify('Chocolate egg','The egg bursts into <b>'+Beautify(cookies)+'</b> cookies!',Game.Upgrades['Chocolate egg'].icon);8680Game.Earn(cookies);8681});8682new Game.Upgrade('Century egg','You continually gain <b>more CpS the longer you\'ve played</b> in the current ascension.<br>Cost scales with how many eggs you own.<q>Actually not centuries-old. This one isn\'t a day over 86!</q>',eggPrice2,[19,12]);8683Game.last.descFunc=function(){8684var day=Math.floor((Date.now()-Game.startDate)/1000/10)*10/60/60/24;8685day=Math.min(day,100);8686var n=(1-Math.pow(1-day/100,3))*0.1;8687return '<div style="text-align:center;">Current boost : <b>+'+Beautify(n*100,1)+'%</b></div><div class="line"></div>'+this.desc;8688};8689new Game.Upgrade('"egg"','<b>+9 CpS</b><q>hey it\'s "egg"</q>',eggPrice2,[20,12]);86908691Game.easterEggs=['Chicken egg','Duck egg','Turkey egg','Quail egg','Robin egg','Ostrich egg','Cassowary egg','Salmon roe','Frogspawn','Shark egg','Turtle egg','Ant larva','Golden goose egg','Faberge egg','Wrinklerspawn','Cookie egg','Omelette','Chocolate egg','Century egg','"egg"'];8692Game.eggDrops=['Chicken egg','Duck egg','Turkey egg','Quail egg','Robin egg','Ostrich egg','Cassowary egg','Salmon roe','Frogspawn','Shark egg','Turtle egg','Ant larva'];8693Game.rareEggDrops=['Golden goose egg','Faberge egg','Wrinklerspawn','Cookie egg','Omelette','Chocolate egg','Century egg','"egg"'];86948695Game.GetHowManyEggs=function()8696{8697var num=0;8698for (var i in Game.easterEggs) {if (Game.Has(Game.easterEggs[i])) num++;}8699return num;8700}8701for (var i in Game.eggDrops)//scale egg prices to how many eggs you have8702{Game.Upgrades[Game.eggDrops[i]].priceFunc=function(){return Math.pow(2,Game.GetHowManyEggs())*999;}}8703//{Game.Upgrades[Game.eggDrops[i]].priceFunc=function(){return Math.pow(Game.GetHowManyEggs()+1,2)*Game.cookiesPs*60*5;}}8704for (var i in Game.rareEggDrops)8705{Game.Upgrades[Game.rareEggDrops[i]].priceFunc=function(){return Math.pow(3,Game.GetHowManyEggs())*999;}}8706//{Game.Upgrades[Game.rareEggDrops[i]].priceFunc=function(){return Math.pow(Game.GetHowManyEggs()+1,3)*Game.cookiesPs*60*5;}}87078708/*for (var i in Game.easterEggs)8709{8710Game.Upgrades[Game.easterEggs[i]].descFunc=function(){return '<div style="text-align:center;">You currently own <b>'+Game.GetHowManyEggs()+'/'+Game.easterEggs.length+'</b> eggs.</div><div class="line"></div>'+this.desc;};8711}*/87128713Game.DropEgg=function(failRate)8714{8715failRate*=1/Game.dropRateMult();8716if (Game.season!='easter') return;8717if (Game.HasAchiev('Hide & seek champion')) failRate*=0.7;8718if (Game.Has('Omelette')) failRate*=0.9;8719if (Game.Has('Starspawn')) failRate*=0.9;8720if (Game.hasGod)8721{8722var godLvl=Game.hasGod('seasons');8723if (godLvl==1) failRate*=0.9;8724else if (godLvl==2) failRate*=0.95;8725else if (godLvl==3) failRate*=0.97;8726}8727if (Math.random()>=failRate)8728{8729var drop='';8730if (Math.random()<0.1) drop=choose(Game.rareEggDrops);8731else drop=choose(Game.eggDrops);8732if (Game.Has(drop) || Game.HasUnlocked(drop))//reroll if we have it8733{8734if (Math.random()<0.1) drop=choose(Game.rareEggDrops);8735else drop=choose(Game.eggDrops);8736}8737if (Game.Has(drop) || Game.HasUnlocked(drop)) return;8738Game.Unlock(drop);8739if (Game.prefs.popups) Game.Popup('You find :<br>'+drop+'!');8740else Game.Notify('You found an egg!','<b>'+drop+'</b>',Game.Upgrades[drop].icon);8741}8742};87438744order=10032;8745Game.NewUpgradeCookie({name:'Caramel macarons',desc:'The saltiest, chewiest of them all.',icon:[25,3],require:'Box of macarons', power:3,price: 9999999999999999999999});8746Game.NewUpgradeCookie({name:'Licorice macarons',desc:'Also known as "blackarons".',icon:[25,4],require:'Box of macarons', power:3,price: 9999999999999999999999999});874787488749order=525;8750new Game.TieredUpgrade('Taller tellers','Banks are <b>twice</b> as efficient.<q>Able to process a higher amount of transactions. Careful though, as taller tellers tell tall tales.</q>','Bank',1);8751new Game.TieredUpgrade('Scissor-resistant credit cards','Banks are <b>twice</b> as efficient.<q>For those truly valued customers.</q>','Bank',2);8752new Game.TieredUpgrade('Acid-proof vaults','Banks are <b>twice</b> as efficient.<q>You know what they say : better safe than sorry.</q>','Bank',3);8753new Game.TieredUpgrade('Chocolate coins','Banks are <b>twice</b> as efficient.<q>This revolutionary currency is much easier to melt from and into ingots - and tastes much better, for a change.</q>','Bank',4);8754new Game.TieredUpgrade('Exponential interest rates','Banks are <b>twice</b> as efficient.<q>Can\'t argue with mathematics! Now fork it over.</q>','Bank',5);8755new Game.TieredUpgrade('Financial zen','Banks are <b>twice</b> as efficient.<q>The ultimate grail of economic thought; the feng shui of big money, the stock market yoga - the Heimlich maneuver of dimes and nickels.</q>','Bank',6);87568757order=550;8758new Game.TieredUpgrade('Golden idols','Temples are <b>twice</b> as efficient.<q>Lure even greedier adventurers to retrieve your cookies. Now that\'s a real idol game!</q>','Temple',1);8759new Game.TieredUpgrade('Sacrifices','Temples are <b>twice</b> as efficient.<q>What\'s a life to a gigaton of cookies?</q>','Temple',2);8760new Game.TieredUpgrade('Delicious blessing','Temples are <b>twice</b> as efficient.<q>And lo, the Baker\'s almighty spoon came down and distributed holy gifts unto the believers - shimmering sugar, and chocolate dark as night, and all manner of wheats. And boy let me tell you, that party was mighty gnarly.</q>','Temple',3);8761new Game.TieredUpgrade('Sun festival','Temples are <b>twice</b> as efficient.<q>Free the primordial powers of your temples with these annual celebrations involving fire-breathers, traditional dancing, ritual beheadings and other merriments!</q>','Temple',4);8762new Game.TieredUpgrade('Enlarged pantheon','Temples are <b>twice</b> as efficient.<q>Enough spiritual inadequacy! More divinities than you\'ll ever need, or your money back! 100% guaranteed!</q>','Temple',5);8763new Game.TieredUpgrade('Great Baker in the sky','Temples are <b>twice</b> as efficient.<q>This is it. The ultimate deity has finally cast Their sublimely divine eye upon your operation; whether this is a good thing or possibly the end of days is something you should find out very soon.</q>','Temple',6);87648765order=575;8766new Game.TieredUpgrade('Pointier hats','Wizard towers are <b>twice</b> as efficient.<q>Tests have shown increased thaumic receptivity relative to the geometric proportions of wizardly conic implements.</q>','Wizard tower',1);8767new Game.TieredUpgrade('Beardlier beards','Wizard towers are <b>twice</b> as efficient.<q>Haven\'t you heard? The beard is the word.</q>','Wizard tower',2);8768new Game.TieredUpgrade('Ancient grimoires','Wizard towers are <b>twice</b> as efficient.<q>Contain interesting spells such as "Turn Water To Drool", "Grow Eyebrows On Furniture" and "Summon Politician".</q>','Wizard tower',3);8769new Game.TieredUpgrade('Kitchen curses','Wizard towers are <b>twice</b> as efficient.<q>Exotic magic involved in all things pastry-related. Hexcellent!</q>','Wizard tower',4);8770new Game.TieredUpgrade('School of sorcery','Wizard towers are <b>twice</b> as efficient.<q>This cookie-funded academy of witchcraft is home to the 4 prestigious houses of magic : the Jocks, the Nerds, the Preps, and the Deathmunchers.</q>','Wizard tower',5);8771new Game.TieredUpgrade('Dark formulas','Wizard towers are <b>twice</b> as efficient.<q>Eldritch forces are at work behind these spells - you get the feeling you really shouldn\'t be messing with those. But I mean, free cookies, right?</q>','Wizard tower',6);87728773order=250;8774Game.GrandmaSynergy('Banker grandmas','A nice banker to cash in more cookies.','Bank');8775Game.GrandmaSynergy('Priestess grandmas','A nice priestess to praise the one true Baker in the sky.','Temple');8776Game.GrandmaSynergy('Witch grandmas','A nice witch to cast a zip, and a zoop, and poof! Cookies.','Wizard tower');8777877887798780order=0;8781new Game.Upgrade('Tin of british tea biscuits','Contains an assortment of fancy biscuits.<q>Every time is tea time.</q>',25,[21,8]);Game.last.pool='prestige';Game.last.parents=['Heavenly cookies'];8782new Game.Upgrade('Box of macarons','Contains an assortment of macarons.<q>Multicolored delicacies filled with various kinds of jam.<br>Not to be confused with macaroons, macaroni, macarena or any of that nonsense.</q>',25,[20,8]);Game.last.pool='prestige';Game.last.parents=['Heavenly cookies'];8783new Game.Upgrade('Box of brand biscuits','Contains an assortment of popular biscuits.<q>They\'re brand new!</q>',25,[20,9]);Game.last.pool='prestige';Game.last.parents=['Heavenly cookies'];87848785order=10020;8786Game.NewUpgradeCookie({name:'Pure black chocolate cookies',desc:'Dipped in a lab-made substance darker than the darkest cocoa (dubbed "chocoalate").',icon:[26,3],power: 4,price: 9999999999999999*5});8787Game.NewUpgradeCookie({name:'Pure white chocolate cookies',desc:'Elaborated on the nano-scale, the coating on this biscuit is able to refract light even in a pitch-black environment.',icon:[26,4],power: 4,price: 9999999999999999*5});8788Game.NewUpgradeCookie({name:'Ladyfingers',desc:'Cleaned and sanitized so well you\'d swear they\'re actual biscuits.',icon:[27,3],power: 3,price: 99999999999999999});8789Game.NewUpgradeCookie({name:'Tuiles',desc:'These never go out of tile.',icon:[27,4],power: 3,price: 99999999999999999*5});8790Game.NewUpgradeCookie({name:'Chocolate-stuffed biscuits',desc:'A princely snack!<br>The holes are so the chocolate stuffing can breathe.',icon:[28,3],power: 3,price: 999999999999999999});8791Game.NewUpgradeCookie({name:'Checker cookies',desc:'A square cookie? This solves so many storage and packaging problems! You\'re a genius!',icon:[28,4],power: 3,price: 999999999999999999*5});8792Game.NewUpgradeCookie({name:'Butter cookies',desc:'These melt right off your mouth and into your heart. (Let\'s face it, they\'re rather fattening.)',icon:[29,3],power: 3,price: 9999999999999999999});8793Game.NewUpgradeCookie({name:'Cream cookies',desc:'It\'s like two chocolate chip cookies! But brought together with the magic of cream! It\'s fiendishly perfect!',icon:[29,4],power: 3,price: 9999999999999999999*5});87948795order=0;8796var desc='Placing an upgrade in this slot will make its effects <b>permanent</b> across all playthroughs.<br><b>Click to activate.</b>';8797new Game.Upgrade('Permanent upgrade slot I',desc, 100,[0,10]);Game.last.pool='prestige';Game.last.iconFunction=function(){return Game.PermanentSlotIcon(0);};Game.last.activateFunction=function(){Game.AssignPermanentSlot(0);};8798new Game.Upgrade('Permanent upgrade slot II',desc, 2000,[1,10]);Game.last.pool='prestige';Game.last.parents=['Permanent upgrade slot I'];Game.last.iconFunction=function(){return Game.PermanentSlotIcon(1);};Game.last.activateFunction=function(){Game.AssignPermanentSlot(1);};8799new Game.Upgrade('Permanent upgrade slot III',desc, 30000,[2,10]);Game.last.pool='prestige';Game.last.parents=['Permanent upgrade slot II'];Game.last.iconFunction=function(){return Game.PermanentSlotIcon(2);};Game.last.activateFunction=function(){Game.AssignPermanentSlot(2);};8800new Game.Upgrade('Permanent upgrade slot IV',desc, 400000,[3,10]);Game.last.pool='prestige';Game.last.parents=['Permanent upgrade slot III'];Game.last.iconFunction=function(){return Game.PermanentSlotIcon(3);};Game.last.activateFunction=function(){Game.AssignPermanentSlot(3);};8801new Game.Upgrade('Permanent upgrade slot V',desc, 5000000,[4,10]);Game.last.pool='prestige';Game.last.parents=['Permanent upgrade slot IV'];Game.last.iconFunction=function(){return Game.PermanentSlotIcon(4);};Game.last.activateFunction=function(){Game.AssignPermanentSlot(4);};88028803var slots=['Permanent upgrade slot I','Permanent upgrade slot II','Permanent upgrade slot III','Permanent upgrade slot IV','Permanent upgrade slot V'];8804for (var i=0;i<slots.length;i++)8805{8806Game.Upgrades[slots[i]].descFunc=function(i){return function(){8807if (Game.permanentUpgrades[i]==-1) return this.desc;8808var upgrade=Game.UpgradesById[Game.permanentUpgrades[i]];8809return '<div style="text-align:center;">'+'Current : <div class="icon" style="vertical-align:middle;display:inline-block;'+(upgrade.icon[2]?'background-image:url('+upgrade.icon[2]+');':'')+'background-position:'+(-upgrade.icon[0]*48)+'px '+(-upgrade.icon[1]*48)+'px;transform:scale(0.5);margin:-16px;"></div> <b>'+upgrade.name+'</b><div class="line"></div></div>'+this.desc;8810};}(i);8811}88128813Game.PermanentSlotIcon=function(slot)8814{8815if (Game.permanentUpgrades[slot]==-1) return [slot,10];8816return Game.UpgradesById[Game.permanentUpgrades[slot]].icon;8817}8818Game.AssignPermanentSlot=function(slot)8819{8820PlaySound('snd/tick.mp3');8821Game.tooltip.hide();8822var list=[];8823for (var i in Game.Upgrades)8824{8825var me=Game.Upgrades[i];8826if (me.bought && me.unlocked && !me.noPerm && (me.pool=='' || me.pool=='cookie'))8827{8828var fail=0;8829for (var ii in Game.permanentUpgrades) {if (Game.permanentUpgrades[ii]==me.id) fail=1;}//check if not already in another permaslot8830if (!fail) list.push(me);8831}8832}88338834var sortMap=function(a,b)8835{8836if (a.order>b.order) return 1;8837else if (a.order<b.order) return -1;8838else return 0;8839}8840list.sort(sortMap);88418842var upgrades='';8843for (var i in list)8844{8845var me=list[i];8846upgrades+=Game.crate(me,'','PlaySound(\'snd/tick.mp3\');Game.PutUpgradeInPermanentSlot('+me.id+','+slot+');','upgradeForPermanent'+me.id);8847}8848var upgrade=Game.permanentUpgrades[slot];8849Game.SelectingPermanentUpgrade=upgrade;8850Game.Prompt('<h3>Pick an upgrade to make permanent</h3>'+88518852'<div class="line"></div><div style="margin:4px auto;clear:both;width:120px;"><div class="crate upgrade enabled" style="background-position:'+(-slot*48)+'px '+(-10*48)+'px;"></div><div id="upgradeToSlotNone" class="crate upgrade enabled" style="background-position:'+(-0*48)+'px '+(-7*48)+'px;display:'+(upgrade!=-1?'none':'block')+';"></div><div id="upgradeToSlotWrap" style="float:left;display:'+(upgrade==-1?'none':'block')+';">'+(Game.crate(Game.UpgradesById[upgrade==-1?0:upgrade],'','','upgradeToSlot'))+'</div></div>'+8853'<div class="block crateBox" style="overflow-y:scroll;float:left;clear:left;width:317px;padding:0px;height:250px;">'+upgrades+'</div>'+8854'<div class="block" style="float:right;width:152px;clear:right;height:234px;">Here are all the upgrades you\'ve purchased last playthrough.<div class="line"></div>Pick one to permanently gain its effects!<div class="line"></div>You can reassign this slot anytime you ascend.</div>'8855,[['Confirm','Game.permanentUpgrades['+slot+']=Game.SelectingPermanentUpgrade;Game.BuildAscendTree();Game.ClosePrompt();'],'Cancel'],0,'widePrompt');8856}8857Game.SelectingPermanentUpgrade=-1;8858Game.PutUpgradeInPermanentSlot=function(upgrade,slot)8859{8860Game.SelectingPermanentUpgrade=upgrade;8861l('upgradeToSlotWrap').innerHTML='';8862l('upgradeToSlotWrap').style.display=(upgrade==-1?'none':'block');8863l('upgradeToSlotNone').style.display=(upgrade!=-1?'none':'block');8864l('upgradeToSlotWrap').innerHTML=(Game.crate(Game.UpgradesById[upgrade==-1?0:upgrade],'','','upgradeToSlot'));8865}88668867new Game.Upgrade('Starspawn','Eggs drop <b>10%</b> more often.<br>Golden cookies appear <b>2%</b> more often during Easter.',111111,[0,12]);Game.last.pool='prestige';Game.last.parents=['Season switcher'];8868new Game.Upgrade('Starsnow','Christmas cookies drop <b>5%</b> more often.<br>Reindeer appear <b>5%</b> more often.',111111,[12,9]);Game.last.pool='prestige';Game.last.parents=['Season switcher'];8869new Game.Upgrade('Starterror','Spooky cookies drop <b>10%</b> more often.<br>Golden cookies appear <b>2%</b> more often during Halloween.',111111,[13,8]);Game.last.pool='prestige';Game.last.parents=['Season switcher'];8870new Game.Upgrade('Starlove','Heart cookies are <b>50%</b> more powerful.<br>Golden cookies appear <b>2%</b> more often during Valentines.',111111,[20,3]);Game.last.pool='prestige';Game.last.parents=['Season switcher'];8871new Game.Upgrade('Startrade','Golden cookies appear <b>5%</b> more often during Business day.',111111,[17,6]);Game.last.pool='prestige';Game.last.parents=['Season switcher'];88728873var angelPriceFactor=7;8874var desc=function(percent,total){return 'You gain another <b>+'+percent+'%</b> of your regular CpS while the game is closed, for a total of <b>'+total+'%</b>.';}8875new Game.Upgrade('Angels',desc(10,15)+'<q>Lowest-ranking at the first sphere of pastry heaven, angels are tasked with delivering new recipes to the mortals they deem worthy.</q>',Math.pow(angelPriceFactor,1),[0,11]);Game.last.pool='prestige';Game.last.parents=['Twin Gates of Transcendence'];8876new Game.Upgrade('Archangels',desc(10,25)+'<q>Members of the first sphere of pastry heaven, archangels are responsible for the smooth functioning of the world\'s largest bakeries.</q>',Math.pow(angelPriceFactor,2),[1,11]);Game.last.pool='prestige';Game.last.parents=['Angels'];8877new Game.Upgrade('Virtues',desc(10,35)+'<q>Found at the second sphere of pastry heaven, virtues make use of their heavenly strength to push and drag the stars of the cosmos.</q>',Math.pow(angelPriceFactor,3),[2,11]);Game.last.pool='prestige';Game.last.parents=['Archangels'];8878new Game.Upgrade('Dominions',desc(10,45)+'<q>Ruling over the second sphere of pastry heaven, dominions hold a managerial position and are in charge of accounting and regulating schedules.</q>',Math.pow(angelPriceFactor,4),[3,11]);Game.last.pool='prestige';Game.last.parents=['Virtues'];8879new Game.Upgrade('Cherubim',desc(10,55)+'<q>Sieging at the first sphere of pastry heaven, the four-faced cherubim serve as heavenly bouncers and bodyguards.</q>',Math.pow(angelPriceFactor,5),[4,11]);Game.last.pool='prestige';Game.last.parents=['Dominions'];8880new Game.Upgrade('Seraphim',desc(10,65)+'<q>Leading the first sphere of pastry heaven, seraphim possess ultimate knowledge of everything pertaining to baking.</q>',Math.pow(angelPriceFactor,6),[5,11]);Game.last.pool='prestige';Game.last.parents=['Cherubim'];8881new Game.Upgrade('God',desc(10,75)+'<q>Like Santa, but less fun.</q>',Math.pow(angelPriceFactor,7),[6,11]);Game.last.pool='prestige';Game.last.parents=['Seraphim'];88828883new Game.Upgrade('Twin Gates of Transcendence','You now <b>keep making cookies while the game is closed</b>, at the rate of <b>5%</b> of your regular CpS and up to <b>1 hour</b> after the game is closed.<br>(Beyond 1 hour, this is reduced by a further 90% - your rate goes down to <b>0.5%</b> of your CpS.)<q>This is one occasion you\'re always underdressed for. Don\'t worry, just rush in past the bouncer and pretend you know people.</q>',1,[15,11]);Game.last.pool='prestige';88848885new Game.Upgrade('Heavenly luck','Golden cookies appear <b>5%</b> more often.<q>Someone up there likes you.</q>',77,[22,6]);Game.last.pool='prestige';8886new Game.Upgrade('Lasting fortune','Golden cookies effects last <b>10%</b> longer.<q>This isn\'t your average everyday luck. This is... advanced luck.</q>',777,[23,6]);Game.last.pool='prestige';Game.last.parents=['Heavenly luck'];8887new Game.Upgrade('Decisive fate','Golden cookies stay <b>5%</b> longer.<q>Life just got a bit more intense.</q>',7777,[10,14]);Game.last.pool='prestige';Game.last.parents=['Lasting fortune'];88888889new Game.Upgrade('Divine discount','Buildings are <b>1% cheaper</b>.<q>Someone special deserves a special price.</q>',99999,[21,7]);Game.last.pool='prestige';Game.last.parents=['Decisive fate'];8890new Game.Upgrade('Divine sales','Upgrades are <b>1% cheaper</b>.<q>Everything must go!</q>',99999,[18,7]);Game.last.pool='prestige';Game.last.parents=['Decisive fate'];8891new Game.Upgrade('Divine bakeries','Cookie upgrades are <b>5 times cheaper</b>.<q>They sure know what they\'re doing.</q>',399999,[17,7]);Game.last.pool='prestige';Game.last.parents=['Divine sales','Divine discount'];88928893new Game.Upgrade('Starter kit','You start with <b>10 cursors</b>.<q>This can come in handy.</q>',50,[0,14]);Game.last.pool='prestige';Game.last.parents=['Tin of british tea biscuits','Box of macarons','Box of brand biscuits','Tin of butter cookies'];8894new Game.Upgrade('Starter kitchen','You start with <b>5 grandmas</b>.<q>Where did these come from?</q>',5000,[1,14]);Game.last.pool='prestige';Game.last.parents=['Starter kit'];8895new Game.Upgrade('Halo gloves','Clicks are <b>10% more powerful</b>.<q>Smite that cookie.</q>',55555,[22,7]);Game.last.pool='prestige';Game.last.parents=['Starter kit'];88968897new Game.Upgrade('Kitten angels','You gain <b>more CpS</b> the more milk you have.<q>All cats go to heaven.</q>',9000,[23,7]);Game.last.pool='prestige';Game.last.parents=['Dominions'];Game.last.kitten=1;88988899new Game.Upgrade('Unholy bait','Wrinklers appear <b>5 times</b> as fast.<q>No wrinkler can resist the scent of worm biscuits.</q>',44444,[15,12]);Game.last.pool='prestige';Game.last.parents=['Starter kitchen'];8900new Game.Upgrade('Sacrilegious corruption','Wrinklers regurgitate <b>5%</b> more cookies.<q>Unique in the animal kingdom, the wrinkler digestive tract is able to withstand an incredible degree of dilation - provided you prod them appropriately.</q>',444444,[19,8]);Game.last.pool='prestige';Game.last.parents=['Unholy bait'];890189028903order=200;new Game.TieredUpgrade('Xtreme walkers','Grandmas are <b>twice</b> as efficient.<q>Complete with flame decals and a little horn that goes "toot".</q>','Grandma',7);8904order=300;new Game.TieredUpgrade('Fudge fungus','Farms are <b>twice</b> as efficient.<q>A sugary parasite whose tendrils help cookie growth.<br>Please do not breathe in the spores. In case of spore ingestion, seek medical help within the next 36 seconds.</q>','Farm',7);8905order=400;new Game.TieredUpgrade('Planetsplitters','Mines are <b>twice</b> as efficient.<q>These new state-of-the-art excavators have been tested on Merula, Globort and Flwanza VI, among other distant planets which have been curiously quiet lately.</q>','Mine',7);8906order=500;new Game.TieredUpgrade('Cyborg workforce','Factories are <b>twice</b> as efficient.<q>Semi-synthetic organisms don\'t slack off, don\'t unionize, and have 20% shorter lunch breaks, making them ideal labor fodder.</q>','Factory',7);8907order=525;new Game.TieredUpgrade('Way of the wallet','Banks are <b>twice</b> as efficient.<q>This new monetary school of thought is all the rage on the banking scene; follow its precepts and you may just profit from it.</q>','Bank',7);8908order=550;new Game.TieredUpgrade('Creation myth','Temples are <b>twice</b> as efficient.<q>Stories have been circulating about the origins of the very first cookie that was ever baked; tales of how it all began, in the Dough beyond time and the Ovens of destiny.</q>','Temple',7);8909order=575;new Game.TieredUpgrade('Cookiemancy','Wizard towers are <b>twice</b> as efficient.<q>There it is; the perfected school of baking magic. From summoning chips to hexing nuts, there is not a single part of cookie-making that hasn\'t been improved tenfold by magic tricks.</q>','Wizard tower',7);8910order=600;new Game.TieredUpgrade('Dyson sphere','Shipments are <b>twice</b> as efficient.<q>You\'ve found a way to apply your knowledge of cosmic technology to slightly more local endeavors; this gigantic sphere of meta-materials, wrapping the solar system, is sure to kick your baking abilities up a notch.</q>','Shipment',7);8911order=700;new Game.TieredUpgrade('Theory of atomic fluidity','Alchemy labs are <b>twice</b> as efficient.<q>Pushing alchemy to its most extreme limits, you find that everything is transmutable into anything else - lead to gold, mercury to water; more importantly, you realize that anything can -and should- be converted to cookies.</q>','Alchemy lab',7);8912order=800;new Game.TieredUpgrade('End of times back-up plan','Portals are <b>twice</b> as efficient.<q>Just in case, alright?</q>','Portal',7);8913order=900;new Game.TieredUpgrade('Great loop hypothesis','Time machines are <b>twice</b> as efficient.<q>What if our universe is just one instance of an infinite cycle? What if, before and after it, stretched infinite amounts of the same universe, themselves containing infinite amounts of cookies?</q>','Time machine',7);8914order=1000;new Game.TieredUpgrade('The Pulse','Antimatter condensers are <b>twice</b> as efficient.<q>You\'ve tapped into the very pulse of the cosmos, a timeless rhythm along which every material and antimaterial thing beats in unison. This, somehow, means more cookies.</q>','Antimatter condenser',7);8915order=1100;8916new Game.TieredUpgrade('Lux sanctorum','Prisms are <b>twice</b> as efficient.<q>Your prism attendants have become increasingly mesmerized with something in the light - or maybe something beyond it; beyond us all, perhaps?</q>','Prism',7);891789188919order=200;new Game.TieredUpgrade('The Unbridling','Grandmas are <b>twice</b> as efficient.<q>It might be a classic tale of bad parenting, but let\'s see where grandma is going with this.</q>','Grandma',8);8920order=300;new Game.TieredUpgrade('Wheat triffids','Farms are <b>twice</b> as efficient.<q>Taking care of crops is so much easier when your plants can just walk about and help around the farm.<br>Do not pet. Do not feed. Do not attempt to converse with.</q>','Farm',8);8921order=400;new Game.TieredUpgrade('Canola oil wells','Mines are <b>twice</b> as efficient.<q>A previously untapped resource, canola oil permeates the underground olifers which grant it its particular taste and lucrative properties.</q>','Mine',8);8922order=500;new Game.TieredUpgrade('78-hour days','Factories are <b>twice</b> as efficient.<q>Why didn\'t we think of this earlier?</q>','Factory',8);8923order=525;new Game.TieredUpgrade('The stuff rationale','Banks are <b>twice</b> as efficient.<q>If not now, when? If not it, what? If not things... stuff?</q>','Bank',8);8924order=550;new Game.TieredUpgrade('Theocracy','Temples are <b>twice</b> as efficient.<q>You\'ve turned your cookie empire into a perfect theocracy, gathering the adoration of zillions of followers from every corner of the universe.<br>Don\'t let it go to your head.</q>','Temple',8);8925order=575;new Game.TieredUpgrade('Rabbit trick','Wizard towers are <b>twice</b> as efficient.<q>Using nothing more than a fancy top hat, your wizards have found a way to simultaneously curb rabbit population and produce heaps of extra cookies for basically free!<br>Resulting cookies may or may not be fit for vegans.</q>','Wizard tower',8);8926order=600;new Game.TieredUpgrade('The final frontier','Shipments are <b>twice</b> as efficient.<q>It\'s been a long road, getting from there to here. It\'s all worth it though - the sights are lovely and the oil prices slightly more reasonable.</q>','Shipment',8);8927order=700;new Game.TieredUpgrade('Beige goo','Alchemy labs are <b>twice</b> as efficient.<q>Well now you\'ve done it. Good job. Very nice. That\'s 3 galaxies you\'ve just converted into cookies. Good thing you can hop from universe to universe.</q>','Alchemy lab',8);8928order=800;new Game.TieredUpgrade('Maddening chants','Portals are <b>twice</b> as efficient.<q>A popular verse goes like so : "jau\'hn madden jau\'hn madden aeiouaeiouaeiou brbrbrbrbrbrbr"</q>','Portal',8);8929order=900;new Game.TieredUpgrade('Cookietopian moments of maybe','Time machines are <b>twice</b> as efficient.<q>Reminiscing how things could have been, should have been, will have been.</q>','Time machine',8);8930order=1000;new Game.TieredUpgrade('Some other super-tiny fundamental particle? Probably?','Antimatter condensers are <b>twice</b> as efficient.<q>When even the universe is running out of ideas, that\'s when you know you\'re nearing the end.</q>','Antimatter condenser',8);8931order=1100;8932new Game.TieredUpgrade('Reverse shadows','Prisms are <b>twice</b> as efficient.<q>Oh man, this is really messing with your eyes.</q>','Prism',8);893389348935order=20000;8936new Game.Upgrade('Kitten accountants','You gain <b>more CpS</b> the more milk you have.<q>business going great, sir</q>',900000000000000000000000,Game.GetIcon('Kitten',6));Game.last.kitten=1;Game.MakeTiered(Game.last,6,18);8937new Game.Upgrade('Kitten specialists','You gain <b>more CpS</b> the more milk you have.<q>optimeowzing your workflow like whoah, sir</q>',900000000000000000000000000,Game.GetIcon('Kitten',7));Game.last.kitten=1;Game.MakeTiered(Game.last,7,18);8938new Game.Upgrade('Kitten experts','You gain <b>more CpS</b> the more milk you have.<q>10 years expurrrtise in the cookie business, sir</q>',900000000000000000000000000000,Game.GetIcon('Kitten',8));Game.last.kitten=1;Game.MakeTiered(Game.last,8,18);89398940new Game.Upgrade('How to bake your dragon','Allows you to purchase a <b>crumbly egg</b> once you have earned 1 million cookies.<q>A tome full of helpful tips such as "oh god, stay away from it", "why did we buy this thing, it\'s not even house-broken" and "groom twice a week in the direction of the scales".</q>',9,[22,12]);Game.last.pool='prestige';89418942order=25100;8943new Game.Upgrade('A crumbly egg','Unlocks the <b>cookie dragon egg</b>.<q>Thank you for adopting this robust, fun-loving cookie dragon! It will bring you years of joy and entertainment.<br>Keep in a dry and cool place, and away from other house pets. Subscription to home insurance is strongly advised.</q>',25,[21,12]);89448945new Game.Upgrade('Chimera','Synergy upgrades are <b>2% cheaper</b>.<br>You gain another <b>+5%</b> of your regular CpS while the game is closed.<br>You retain optimal cookie production while the game is closed for <b>2 more days</b>.<q>More than the sum of its parts.</q>',Math.pow(angelPriceFactor,9),[24,7]);Game.last.pool='prestige';Game.last.parents=['God','Lucifer','Synergies Vol. II'];89468947new Game.Upgrade('Tin of butter cookies','Contains an assortment of rich butter cookies.<q>Five varieties of danish cookies.<br>Complete with little paper cups.</q>',25,[21,9]);Game.last.pool='prestige';Game.last.parents=['Heavenly cookies'];89488949new Game.Upgrade('Golden switch','Unlocks the <b>golden switch</b>, which passively boosts your CpS by 50% but disables golden cookies.<q>Less clicking, more idling.</q>',999,[21,10]);Game.last.pool='prestige';Game.last.parents=['Heavenly luck'];89508951new Game.Upgrade('Classic dairy selection','Unlocks the <b>milk selector</b>, letting you pick which milk is displayed under your cookie.<br>Comes with a variety of basic flavors.<q>Don\'t have a cow, man.</q>',9,[1,8]);Game.last.pool='prestige';Game.last.parents=[];89528953new Game.Upgrade('Fanciful dairy selection','Contains more exotic flavors for your milk selector.<q>Strong bones for the skeleton army.</q>',1000000,[9,7]);Game.last.pool='prestige';Game.last.parents=['Classic dairy selection'];89548955order=10300;8956Game.NewUpgradeCookie({name:'Dragon cookie',desc:'Imbued with the vigor and vitality of a full-grown cookie dragon, this mystical cookie will embolden your empire for the generations to come.',icon:[10,25],power:5,price:9999999999999999*7,locked:1});895789588959order=40000;8960new Game.Upgrade('Golden switch [off]','Turning this on will give you a passive <b>+50% CpS</b>, but prevents golden cookies from spawning.<br>Cost is equal to 1 hour of production.',1000000,[20,10]);8961Game.last.pool='toggle';Game.last.toggleInto='Golden switch [on]';8962Game.last.priceFunc=function(){return Game.cookiesPs*60*60;}8963var func=function(){8964if (Game.Has('Residual luck'))8965{8966var bonus=0;8967var upgrades=Game.goldenCookieUpgrades;8968for (var i in upgrades) {if (Game.Has(upgrades[i])) bonus++;}8969return '<div style="text-align:center;">'+Game.listTinyOwnedUpgrades(Game.goldenCookieUpgrades)+'<br><br>The effective boost is <b>+'+Beautify(Math.round(50+bonus*10))+'%</b><br>thanks to residual luck<br>and your <b>'+bonus+'</b> golden cookie upgrade'+(bonus==1?'':'s')+'.</div><div class="line"></div>'+this.desc;8970}8971return this.desc;8972};8973Game.last.descFunc=func;89748975new Game.Upgrade('Golden switch [on]','The switch is currently giving you a passive <b>+50% CpS</b>; it also prevents golden cookies from spawning.<br>Turning it off will revert those effects.<br>Cost is equal to 1 hour of production.',1000000,[21,10]);8976Game.last.pool='toggle';Game.last.toggleInto='Golden switch [off]';8977Game.last.priceFunc=function(){return Game.cookiesPs*60*60;}8978Game.last.descFunc=func;89798980order=50000;8981new Game.Upgrade('Milk selector','Lets you pick what flavor of milk to display.',0,[1,8]);8982Game.last.descFunc=function(){8983var choice=this.choicesFunction()[Game.milkType];8984return '<div style="text-align:center;">Current : <div class="icon" style="vertical-align:middle;display:inline-block;'+(choice.icon[2]?'background-image:url('+choice.icon[2]+');':'')+'background-position:'+(-choice.icon[0]*48)+'px '+(-choice.icon[1]*48)+'px;transform:scale(0.5);margin:-16px;"></div> <b>'+choice.name+'</b></div><div class="line"></div>'+this.desc;8985};89868987Game.last.pool='toggle';8988Game.last.choicesFunction=function()8989{8990var choices=[];8991choices[0]={name:'Automatic',icon:[0,7]};8992choices[1]={name:'Plain milk',icon:[1,8]};8993choices[2]={name:'Chocolate milk',icon:[2,8]};8994choices[3]={name:'Raspberry milk',icon:[3,8]};8995choices[4]={name:'Orange milk',icon:[4,8]};8996choices[5]={name:'Caramel milk',icon:[5,8]};8997choices[6]={name:'Banana milk',icon:[6,8]};8998choices[7]={name:'Lime milk',icon:[7,8]};8999choices[8]={name:'Blueberry milk',icon:[8,8]};9000choices[9]={name:'Strawberry milk',icon:[9,8]};9001choices[10]={name:'Vanilla milk',icon:[10,8]};90029003if (Game.Has('Fanciful dairy selection'))9004{9005choices[11]={name:'Zebra milk',icon:[10,7]};9006choices[12]={name:'Cosmic milk',icon:[9,7]};9007choices[13]={name:'Flaming milk',icon:[8,7]};9008choices[14]={name:'Sanguine milk',icon:[7,7]};9009choices[15]={name:'Midas milk',icon:[6,7]};9010choices[16]={name:'Midnight milk',icon:[5,7]};9011choices[17]={name:'Green inferno milk',icon:[4,7]};9012choices[18]={name:'Frostfire milk',icon:[3,7]};90139014choices[24]={name:'Soy milk',icon:[27,23]};9015}90169017choices[19]={name:'Honey milk',icon:[21,23]};9018choices[20]={name:'Coffee milk',icon:[22,23]};9019choices[21]={name:'Tea milk',icon:[23,23]};9020choices[22]={name:'Coconut milk',icon:[24,23]};9021choices[23]={name:'Cherry milk',icon:[25,23]};90229023choices[25]={name:'Spiced milk',icon:[26,23]};9024choices[26]={name:'Maple milk',icon:[28,23]};9025choices[27]={name:'Mint milk',icon:[29,23]};90269027choices[Game.milkType].selected=1;9028return choices;9029}9030Game.last.choicesPick=function(id)9031{Game.milkType=id;}90329033Game.MilksByChoice={90340:{pic:'milkPlain'},90351:{pic:'milkPlain'},90362:{pic:'milkChocolate'},90373:{pic:'milkRaspberry'},90384:{pic:'milkOrange'},90395:{pic:'milkCaramel'},90406:{pic:'milkBanana'},90417:{pic:'milkLime'},90428:{pic:'milkBlueberry'},90439:{pic:'milkStrawberry'},904410:{pic:'milkVanilla'},904511:{pic:'milkZebra'},904612:{pic:'milkStars'},904713:{pic:'milkFire'},904814:{pic:'milkBlood'},904915:{pic:'milkGold'},905016:{pic:'milkBlack'},905117:{pic:'milkGreenFire'},905218:{pic:'milkBlueFire'},905319:{pic:'milkHoney'},905420:{pic:'milkCoffee'},905521:{pic:'milkTea'},905622:{pic:'milkCoconut'},905723:{pic:'milkCherry'},905824:{pic:'milkSoy'},905925:{pic:'milkSpiced'},906026:{pic:'milkMaple'},906127:{pic:'milkMint'},9062};906390649065order=10300;9066Game.NewUpgradeCookie({name:'Milk chocolate butter biscuit',desc:'Rewarded for owning 100 of everything.<br>It bears the engraving of a fine entrepreneur.',icon:[27,8],power: 10,price: 999999999999999999999,locked:1});9067Game.NewUpgradeCookie({name:'Dark chocolate butter biscuit',desc:'Rewarded for owning 150 of everything.<br>It is adorned with the image of an experienced cookie tycoon.',icon:[27,9],power: 10,price: 999999999999999999999999,locked:1});9068Game.NewUpgradeCookie({name:'White chocolate butter biscuit',desc:'Rewarded for owning 200 of everything.<br>The chocolate is chiseled to depict a masterful pastry magnate.',icon:[28,9],power: 10,price: 999999999999999999999999999,locked:1});9069Game.NewUpgradeCookie({name:'Ruby chocolate butter biscuit',desc:'Rewarded for owning 250 of everything.<br>Covered in a rare red chocolate, this biscuit is etched to represent the face of a cookie industrialist gone mad with power.',icon:[28,8],power: 10,price: 999999999999999999999999999999,locked:1});90709071order=10020;9072Game.NewUpgradeCookie({name:'Gingersnaps',desc:'Cookies with a soul. Probably.',icon:[29,10],power: 4,price: 99999999999999999999});9073Game.NewUpgradeCookie({name:'Cinnamon cookies',desc:'The secret is in the patented swirly glazing.',icon:[23,8],power: 4,price: 99999999999999999999*5});9074Game.NewUpgradeCookie({name:'Vanity cookies',desc:'One tiny candied fruit sits atop this decadent cookie.',icon:[22,8],power: 4,price: 999999999999999999999});9075Game.NewUpgradeCookie({name:'Cigars',desc:'Close, but no match for those extravagant cookie straws they serve in coffee shops these days.',icon:[25,8],power: 4,price: 999999999999999999999*5});9076Game.NewUpgradeCookie({name:'Pinwheel cookies',desc:'Bringing you the dizzying combination of brown flavor and beige taste!',icon:[22,10],power: 4,price: 9999999999999999999999});9077Game.NewUpgradeCookie({name:'Fudge squares',desc:'Not exactly cookies, but you won\'t care once you\'ve tasted one of these.<br>They\'re so good, it\'s fudged-up!',icon:[24,8],power: 4,price: 9999999999999999999999*5});90789079order=10030;9080Game.NewUpgradeCookie({name:'Digits',desc:'Three flavors, zero phalanges.',icon:[26,8],require:'Box of brand biscuits',power: 2, price: 999999999999999*5});90819082order=10029;9083Game.NewUpgradeCookie({name:'Butter horseshoes',desc:'It would behoove you to not overindulge in these.',icon:[22,9],require:'Tin of butter cookies',power: 4, price: 99999999999999999999999});9084Game.NewUpgradeCookie({name:'Butter pucks',desc:'Lord, what fools these mortals be!<br>(This is kind of a hokey reference.)',icon:[23,9],require:'Tin of butter cookies',power: 4, price: 99999999999999999999999*5});9085Game.NewUpgradeCookie({name:'Butter knots',desc:'Look, you can call these pretzels if you want, but you\'d just be fooling yourself, wouldn\'t you?',icon:[24,9],require:'Tin of butter cookies',power: 4, price: 999999999999999999999999});9086Game.NewUpgradeCookie({name:'Butter slabs',desc:'Nothing butter than a slab to the face.',icon:[25,9],require:'Tin of butter cookies',power: 4, price: 999999999999999999999999*5});9087Game.NewUpgradeCookie({name:'Butter swirls',desc:'These are equal parts sugar, butter, and warm fuzzy feelings - all of which cause millions of deaths everyday.',icon:[26,9],require:'Tin of butter cookies',power: 4, price: 9999999999999999999999999});90889089order=10020;9090Game.NewUpgradeCookie({name:'Shortbread biscuits',desc:'These rich butter cookies are neither short, nor bread. What a country!',icon:[23,10],power: 4,price: 99999999999999999999999});9091Game.NewUpgradeCookie({name:'Millionaires\' shortbreads',desc:'Three thought-provoking layers of creamy chocolate, hard-working caramel and crumbly biscuit in a poignant commentary of class struggle.',icon:[24,10],power: 4,price: 99999999999999999999999*5});9092Game.NewUpgradeCookie({name:'Caramel cookies',desc:'The polymerized carbohydrates adorning these cookies are sure to stick to your teeth for quite a while.',icon:[25,10],power: 4,price: 999999999999999999999999});909390949095var desc=function(totalHours){9096var hours=totalHours%24;9097var days=Math.floor(totalHours/24);9098var str=hours+(hours==1?' hour':' hours');9099if (days>0) str=days+(days==1?' day':' days')+' and '+str;9100return 'You retain optimal cookie production while the game is closed for twice as long, for a total of <b>'+str+'</b>.';9101}9102new Game.Upgrade('Belphegor',desc(2)+'<q>A demon of shortcuts and laziness, Belphegor commands machines to do work in his stead.</q>',Math.pow(angelPriceFactor,1),[7,11]);Game.last.pool='prestige';Game.last.parents=['Twin Gates of Transcendence'];9103new Game.Upgrade('Mammon',desc(4)+'<q>The demonic embodiment of wealth, Mammon requests a tithe of blood and gold from all his worshippers.</q>',Math.pow(angelPriceFactor,2),[8,11]);Game.last.pool='prestige';Game.last.parents=['Belphegor'];9104new Game.Upgrade('Abaddon',desc(8)+'<q>Master of overindulgence, Abaddon governs the wrinkler brood and inspires their insatiability.</q>',Math.pow(angelPriceFactor,3),[9,11]);Game.last.pool='prestige';Game.last.parents=['Mammon'];9105new Game.Upgrade('Satan',desc(16)+'<q>The counterpoint to everything righteous, this demon represents the nefarious influence of deceit and temptation.</q>',Math.pow(angelPriceFactor,4),[10,11]);Game.last.pool='prestige';Game.last.parents=['Abaddon'];9106new Game.Upgrade('Asmodeus',desc(32)+'<q>This demon with three monstrous heads draws his power from the all-consuming desire for cookies and all things sweet.</q>',Math.pow(angelPriceFactor,5),[11,11]);Game.last.pool='prestige';Game.last.parents=['Satan'];9107new Game.Upgrade('Beelzebub',desc(64)+'<q>The festering incarnation of blight and disease, Beelzebub rules over the vast armies of pastry inferno.</q>',Math.pow(angelPriceFactor,6),[12,11]);Game.last.pool='prestige';Game.last.parents=['Asmodeus'];9108new Game.Upgrade('Lucifer',desc(128)+'<q>Also known as the Lightbringer, this infernal prince\'s tremendous ego caused him to be cast down from pastry heaven.</q>',Math.pow(angelPriceFactor,7),[13,11]);Game.last.pool='prestige';Game.last.parents=['Beelzebub'];91099110new Game.Upgrade('Golden cookie alert sound','Unlocks the <b>golden cookie sound selector</b>, which lets you pick whether golden cookies emit a sound when appearing or not.<q>A sound decision.</q>',9999,[28,6]);Game.last.pool='prestige';Game.last.parents=['Decisive fate','Golden switch'];91119112order=49900;9113new Game.Upgrade('Golden cookie sound selector','Lets you change the sound golden cookies make when they spawn.',0,[28,6]);9114Game.last.descFunc=function(){9115var choice=this.choicesFunction()[Game.chimeType];9116return '<div style="text-align:center;">Current : <div class="icon" style="vertical-align:middle;display:inline-block;'+(choice.icon[2]?'background-image:url('+icon[2]+');':'')+'background-position:'+(-choice.icon[0]*48)+'px '+(-choice.icon[1]*48)+'px;transform:scale(0.5);margin:-16px;"></div> <b>'+choice.name+'</b></div><div class="line"></div>'+this.desc;9117};91189119Game.last.pool='toggle';9120Game.last.choicesFunction=function()9121{9122var choices=[];9123choices[0]={name:'No sound',icon:[0,7]};9124choices[1]={name:'Chime',icon:[22,6]};91259126choices[Game.chimeType].selected=1;9127return choices;9128}9129Game.last.choicesPick=function(id)9130{Game.chimeType=id;}913191329133new Game.Upgrade('Basic wallpaper assortment','Unlocks the <b>background selector</b>, letting you select the game\'s background.<br>Comes with a variety of basic flavors.<q>Prioritizing aesthetics over crucial utilitarian upgrades? Color me impressed.</q>',99,[29,5]);Game.last.pool='prestige';Game.last.parents=['Classic dairy selection'];91349135new Game.Upgrade('Legacy','This is the first heavenly upgrade; it unlocks the <b>Heavenly chips</b> system.<div class="line"></div>Each time you ascend, the cookies you made in your past life are turned into <b>heavenly chips</b> and <b>prestige</b>.<div class="line"></div><b>Heavenly chips</b> can be spent on a variety of permanent transcendental upgrades.<div class="line"></div>Your <b>prestige level</b> also gives you a permanent <b>+1% CpS</b> per level.<q>We\'ve all been waiting for you.</q>',1,[21,6]);Game.last.pool='prestige';Game.last.parents=[];91369137new Game.Upgrade('Elder spice','You can attract <b>2 more wrinklers</b>.<q>The cookie your cookie could smell like.</q>',444444,[19,8]);Game.last.pool='prestige';Game.last.parents=['Unholy bait'];91389139new Game.Upgrade('Residual luck','While the golden switch is on, you gain an additional <b>+10% CpS</b> per golden cookie upgrade owned.<q>Fortune comes in many flavors.</q>',99999,[27,6]);Game.last.pool='prestige';Game.last.parents=['Golden switch'];91409141order=150;new Game.Upgrade('Fantasteel mouse','Clicking gains <b>+1% of your CpS</b>.<q>You could be clicking using your touchpad and we\'d be none the wiser.</q>',5000000000000000000,[11,17]);Game.MakeTiered(Game.last,8,11);9142new Game.Upgrade('Nevercrack mouse','Clicking gains <b>+1% of your CpS</b>.<q>How much beefier can you make a mouse until it\'s considered a rat?</q>',500000000000000000000,[11,18]);Game.MakeTiered(Game.last,9,11);914391449145new Game.Upgrade('Five-finger discount','All upgrades are <b>1% cheaper per 100 cursors</b>.<q>Stick it to the man.</q>',555555,[28,7],function(){Game.upgradesToRebuild=1;});Game.last.pool='prestige';Game.last.parents=['Halo gloves','Abaddon'];914691479148order=5000;9149Game.SynergyUpgrade('Future almanacs','<q>Lets you predict optimal planting times. It\'s crazy what time travel can do!</q>','Farm','Time machine','synergy1');9150Game.SynergyUpgrade('Rain prayer','<q>A deeply spiritual ceremonial involving complicated dance moves and high-tech cloud-busting lasers.</q>','Farm','Temple','synergy2');91519152Game.SynergyUpgrade('Seismic magic','<q>Surprise earthquakes are an old favorite of wizardly frat houses.</q>','Mine','Wizard tower','synergy1');9153Game.SynergyUpgrade('Asteroid mining','<q>As per the <span>19</span>74 United Cosmic Convention, comets, moons, and inhabited planetoids are no longer legally excavatable.<br>But hey, a space bribe goes a long way.</q>','Mine','Shipment','synergy2');91549155Game.SynergyUpgrade('Quantum electronics','<q>Your machines won\'t even be sure if they\'re on or off!</q>','Factory','Antimatter condenser','synergy1');9156Game.SynergyUpgrade('Temporal overclocking','<q>Introduce more quickitude in your system for increased speedation of fastness.</q>','Factory','Time machine','synergy2');91579158Game.SynergyUpgrade('Contracts from beyond','<q>Make sure to read the fine print!</q>','Bank','Portal','synergy1');9159Game.SynergyUpgrade('Printing presses','<q>Fake bills so real, they\'re almost worth the ink they\'re printed with.</q>','Bank','Factory','synergy2');91609161Game.SynergyUpgrade('Paganism','<q>Some deities are better left unworshipped.</q>','Temple','Portal','synergy1');9162Game.SynergyUpgrade('God particle','<q>Turns out God is much tinier than we thought, I guess.</q>','Temple','Antimatter condenser','synergy2');91639164Game.SynergyUpgrade('Arcane knowledge','<q>Some things were never meant to be known - only mildly speculated.</q>','Wizard tower','Alchemy lab','synergy1');9165Game.SynergyUpgrade('Magical botany','<q>Already known in some reactionary newspapers as "the wizard\'s GMOs".</q>','Wizard tower','Farm','synergy2');91669167Game.SynergyUpgrade('Fossil fuels','<q>Somehow better than plutonium for powering rockets.<br>Extracted from the fuels of ancient, fossilized civilizations.</q>','Shipment','Mine','synergy1');9168Game.SynergyUpgrade('Shipyards','<q>Where carpentry, blind luck, and asbestos insulation unite to produce the most dazzling spaceships on the planet.</q>','Shipment','Factory','synergy2');91699170Game.SynergyUpgrade('Primordial ores','<q>Only when refining the purest metals will you extract the sweetest sap of the earth.</q>','Alchemy lab','Mine','synergy1');9171Game.SynergyUpgrade('Gold fund','<q>If gold is the backbone of the economy, cookies, surely, are its hip joints.</q>','Alchemy lab','Bank','synergy2');91729173Game.SynergyUpgrade('Infernal crops','<q>Sprinkle regularly with FIRE.</q>','Portal','Farm','synergy1');9174Game.SynergyUpgrade('Abysmal glimmer','<q>Someone, or something, is staring back at you.<br>Perhaps at all of us.</q>','Portal','Prism','synergy2');91759176Game.SynergyUpgrade('Relativistic parsec-skipping','<q>People will tell you this isn\'t physically possible.<br>These are people you don\'t want on your ship.</q>','Time machine','Shipment','synergy1');9177Game.SynergyUpgrade('Primeval glow','<q>From unending times, an ancient light still shines, impossibly pure and fragile in its old age.</q>','Time machine','Prism','synergy2');91789179Game.SynergyUpgrade('Extra physics funding','<q>Time to put your money where your particle colliders are.</q>','Antimatter condenser','Bank','synergy1');9180Game.SynergyUpgrade('Chemical proficiency','<q>Discover exciting new elements, such as Fleshmeltium, Inert Shampoo Byproduct #17 and Carbon++!</q>','Antimatter condenser','Alchemy lab','synergy2');91819182Game.SynergyUpgrade('Light magic','<q>Actually not to be taken lightly! No, I\'m serious. 178 people died last year. You don\'t mess around with magic.</q>','Prism','Wizard tower','synergy1');9183Game.SynergyUpgrade('Mystical energies','<q>Something beckons from within the light. It is warm, comforting, and apparently the cause for several kinds of exotic skin cancers.</q>','Prism','Temple','synergy2');918491859186new Game.Upgrade('Synergies Vol. I','Unlocks a new tier of upgrades that affect <b>2 buildings at the same time</b>.<br>Synergies appear once you have <b>15</b> of both buildings.<q>The many beats the few.</q>',222222,[10,20]);Game.last.pool='prestige';Game.last.parents=['Satan','Dominions'];9187new Game.Upgrade('Synergies Vol. II','Unlocks a new tier of upgrades that affect <b>2 buildings at the same time</b>.<br>Synergies appear once you have <b>75</b> of both buildings.<q>The several beats the many.</q>',2222222,[10,29]);Game.last.pool='prestige';Game.last.parents=['Beelzebub','Seraphim','Synergies Vol. I'];91889189new Game.Upgrade('Heavenly cookies','Cookie production multiplier <b>+10% permanently</b>.<q>Baked with heavenly chips. An otherwordly flavor that transcends time and space.</q>',3,[25,12]);Game.last.pool='prestige';Game.last.parents=['Legacy'];Game.last.power=10;Game.last.pseudoCookie=true;9190new Game.Upgrade('Wrinkly cookies','Cookie production multiplier <b>+10% permanently</b>.<q>The result of regular cookies left to age out for countless eons in a place where time and space are meaningless.</q>',6666666,[26,12]);Game.last.pool='prestige';Game.last.parents=['Sacrilegious corruption','Elder spice'];Game.last.power=10;Game.last.pseudoCookie=true;9191new Game.Upgrade('Distilled essence of redoubled luck','Golden cookies (and all other things that spawn, such as reindeer) have <b>1% chance of being doubled</b>.<q>Tastes glittery. The empty phial makes for a great pencil holder.</q>',7777777,[27,12]);Game.last.pool='prestige';Game.last.parents=['Divine bakeries','Residual luck'];91929193order=40000;9194new Game.Upgrade('Occult obstruction','Cookie production <b>reduced to 0</b>.<q>If symptoms persist, consult a doctor.</q>',7,[15,5]);//debug purposes only9195Game.last.pool='debug';9196new Game.Upgrade('Glucose-charged air','Sugar lumps coalesce <b>a whole lot faster</b>.<q>Don\'t breathe too much or you\'ll get diabetes!</q>',7,[29,16]);//debug purposes only9197Game.last.pool='debug';91989199order=10300;9200Game.NewUpgradeCookie({name:'Lavender chocolate butter biscuit',desc:'Rewarded for owning 300 of everything.<br>This subtly-flavored biscuit represents the accomplishments of decades of top-secret research. The molded design on the chocolate resembles a well-known entrepreneur who gave their all to the ancient path of baking.',icon:[26,10],power: 10,price: 999999999999999999999999999999999,locked:1});92019202order=10030;9203Game.NewUpgradeCookie({name:'Lombardia cookies',desc:'These come from those farms with the really good memory.',icon:[23,13],require:'Box of brand biscuits',power: 3, price: 999999999999999999999*5});9204Game.NewUpgradeCookie({name:'Bastenaken cookies',desc:'French cookies made of delicious cinnamon and candy sugar. These do not contain Nuts!',icon:[24,13],require:'Box of brand biscuits',power: 3, price: 999999999999999999999*5});92059206order=10020;9207Game.NewUpgradeCookie({name:'Pecan sandies',desc:'Stick a nut on a cookie and call it a day! Name your band after it! Whatever!',icon:[25,13],power: 4,price: 999999999999999999999999*5});9208Game.NewUpgradeCookie({name:'Moravian spice cookies',desc:'Popular for being the world\'s moravianest cookies.',icon:[26,13],power: 4,price: 9999999999999999999999999});9209Game.NewUpgradeCookie({name:'Anzac biscuits',desc:'Army biscuits from a bakery down under, containing no eggs but yes oats.',icon:[27,13],power: 4,price: 9999999999999999999999999*5});9210Game.NewUpgradeCookie({name:'Buttercakes',desc:'Glistening with cholesterol, these cookies moistly straddle the line between the legal definition of a cookie and just a straight-up stick of butter.',icon:[29,13],power: 4,price: 99999999999999999999999999});9211Game.NewUpgradeCookie({name:'Ice cream sandwiches',desc:'In an alternate universe, "ice cream sandwich" designates an ice cream cone filled with bacon, lettuce, and tomatoes. Maybe some sprinkles too.',icon:[28,13],power: 4,price: 99999999999999999999999999*5});92129213new Game.Upgrade('Stevia Caelestis','Sugar lumps ripen <b>an hour sooner</b>.<q>A plant of supernatural sweetness grown by angels in heavenly gardens.</q>',100000000,[25,15]);Game.last.pool='prestige';Game.last.parents=['Wrinkly cookies'];9214new Game.Upgrade('Diabetica Daemonicus','Sugar lumps mature <b>an hour sooner</b>.<q>A malevolent, if delicious herb that is said to grow on the cliffs of the darkest abyss of the underworld.</q>',300000000,[26,15]);Game.last.pool='prestige';Game.last.parents=['Stevia Caelestis','Lucifer'];9215new Game.Upgrade('Sucralosia Inutilis','Bifurcated sugar lumps appear <b>5% more often</b> and are <b>5% more likely</b> to drop 2 lumps.<q>A rare berry of uninteresting flavor that is as elusive as its uses are limited; only sought-after by the most avid collectors with too much wealth on their hands.</q>',1000000000,[27,15]);Game.last.pool='prestige';Game.last.parents=['Diabetica Daemonicus'];92169217//note : these showIf functions stop working beyond 10 quadrillion prestige level, due to loss in precision; the solution, of course, is to make sure 10 quadrillion is not an attainable prestige level9218new Game.Upgrade('Lucky digit','<b>+1%</b> prestige level effect on CpS.<br><b>+1%</b> golden cookie effect duration.<br><b>+1%</b> golden cookie lifespan.<q>This upgrade is a bit shy and only appears when your prestige level ends in 7.</q>',777,[24,15]);Game.last.pool='prestige';Game.last.parents=['Heavenly luck'];Game.last.showIf=function(){return (Math.ceil(Game.prestige)%10==7);};9219new Game.Upgrade('Lucky number','<b>+1%</b> prestige level effect on CpS.<br><b>+1%</b> golden cookie effect duration.<br><b>+1%</b> golden cookie lifespan.<q>This upgrade is a reclusive hermit and only appears when your prestige level ends in 777.</q>',77777,[24,15]);Game.last.pool='prestige';Game.last.parents=['Lucky digit','Lasting fortune'];Game.last.showIf=function(){return (Math.ceil(Game.prestige)%1000==777);};9220new Game.Upgrade('Lucky payout','<b>+1%</b> prestige level effect on CpS.<br><b>+1%</b> golden cookie effect duration.<br><b>+1%</b> golden cookie lifespan.<q>This upgrade took an oath of complete seclusion from the rest of the world and only appears when your prestige level ends in 777777.</q>',77777777,[24,15]);Game.last.pool='prestige';Game.last.parents=['Lucky number','Decisive fate'];Game.last.showIf=function(){return (Math.ceil(Game.prestige)%1000000==777777);};92219222order=50000;9223new Game.Upgrade('Background selector','Lets you pick which wallpaper to display.',0,[29,5]);9224Game.last.descFunc=function(){9225var choice=this.choicesFunction()[Game.bgType];9226return '<div style="text-align:center;">Current : <div class="icon" style="vertical-align:middle;display:inline-block;'+(choice.icon[2]?'background-image:url('+choice.icon[2]+');':'')+'background-position:'+(-choice.icon[0]*48)+'px '+(-choice.icon[1]*48)+'px;transform:scale(0.5);margin:-16px;"></div> <b>'+choice.name+'</b></div><div class="line"></div>'+this.desc;9227};92289229Game.last.pool='toggle';9230Game.last.choicesFunction=function()9231{9232var choices=[];9233choices[0]={name:'Automatic',icon:[0,7]};9234choices[1]={name:'Blue',icon:[21,21]};9235choices[2]={name:'Red',icon:[22,21]};9236choices[3]={name:'White',icon:[23,21]};9237choices[4]={name:'Black',icon:[24,21]};9238choices[5]={name:'Gold',icon:[25,21]};9239choices[6]={name:'Grandmas',icon:[26,21]};9240choices[7]={name:'Displeased grandmas',icon:[27,21]};9241choices[8]={name:'Angered grandmas',icon:[28,21]};9242choices[9]={name:'Money',icon:[29,21]};9243choices[Game.bgType].selected=1;9244return choices;9245}9246Game.last.choicesPick=function(id)9247{Game.bgType=id;}92489249Game.BGsByChoice={92500:{pic:'bgBlue'},92511:{pic:'bgBlue'},92522:{pic:'bgRed'},92533:{pic:'bgWhite'},92544:{pic:'bgBlack'},92555:{pic:'bgGold'},92566:{pic:'grandmas1'},92577:{pic:'grandmas2'},92588:{pic:'grandmas3'},92599:{pic:'bgMoney'},9260};92619262order=255;9263Game.GrandmaSynergy('Lucky grandmas','A fortunate grandma that always seems to find more cookies.','Chancemaker');92649265order=1200;9266new Game.TieredUpgrade('Your lucky cookie','Chancemakers are <b>twice</b> as efficient.<q>This is the first cookie you\'ve ever baked. It holds a deep sentimental value and, after all this time, an interesting smell.</q>','Chancemaker',1);9267new Game.TieredUpgrade('"All Bets Are Off" magic coin','Chancemakers are <b>twice</b> as efficient.<q>A coin that always lands on the other side when flipped. Not heads, not tails, not the edge. The <i>other side</i>.</q>','Chancemaker',2);9268new Game.TieredUpgrade('Winning lottery ticket','Chancemakers are <b>twice</b> as efficient.<q>What lottery? THE lottery, that\'s what lottery! Only lottery that matters!</q>','Chancemaker',3);9269new Game.TieredUpgrade('Four-leaf clover field','Chancemakers are <b>twice</b> as efficient.<q>No giant monsters here, just a whole lot of lucky grass.</q>','Chancemaker',4);9270new Game.TieredUpgrade('A recipe book about books','Chancemakers are <b>twice</b> as efficient.<q>Tip the scales in your favor with 28 creative new ways to cook the books.</q>','Chancemaker',5);9271new Game.TieredUpgrade('Leprechaun village','Chancemakers are <b>twice</b> as efficient.<q>You\'ve finally become accepted among the local leprechauns, who lend you their mythical luck as a sign of friendship (as well as some rather foul-tasting tea).</q>','Chancemaker',6);9272new Game.TieredUpgrade('Improbability drive','Chancemakers are <b>twice</b> as efficient.<q>A strange engine that turns statistics on their head. Recommended by the Grandmother\'s Guide to the Bakery.</q>','Chancemaker',7);9273new Game.TieredUpgrade('Antisuperstistronics','Chancemakers are <b>twice</b> as efficient.<q>An exciting new field of research that makes unlucky things lucky. No mirror unbroken, no ladder unwalked under!</q>','Chancemaker',8);92749275order=5000;9276Game.SynergyUpgrade('Gemmed talismans','<q>Good-luck charms covered in ancient and excruciatingly rare crystals. A must have for job interviews!</q>','Chancemaker','Mine','synergy1');92779278order=20000;9279new Game.Upgrade('Kitten consultants','You gain <b>more CpS</b> the more milk you have.<q>glad to be overpaid to work with you, sir</q>',900000000000000000000000000000000,Game.GetIcon('Kitten',9));Game.last.kitten=1;Game.MakeTiered(Game.last,9,18);92809281order=99999;9282var years=Math.floor((Date.now()-new Date(2013,7,8))/(1000*60*60*24*365));9283//only updates on page load9284//may behave strangely on leap years9285Game.NewUpgradeCookie({name:'Birthday cookie',desc:'-',icon:[22,13],power:years,price:99999999999999999999999999999});Game.last.baseDesc='Cookie production multiplier <b>+1%</b> for every year Cookie Clicker has existed (currently : <b>+'+Beautify(years)+'%</b>).<q>Thank you for playing Cookie Clicker!<br>-Orteil</q>';Game.last.desc=BeautifyInText(Game.last.baseDesc);928692879288order=150;new Game.Upgrade('Armythril mouse','Clicking gains <b>+1% of your CpS</b>.<q>This one takes about 53 people to push it around and another 48 to jump down on the button and trigger a click. You could say it\'s got some heft to it.</q>',50000000000000000000000,[11,19]);Game.MakeTiered(Game.last,10,11);92899290order=200;new Game.TieredUpgrade('Reverse dementia','Grandmas are <b>twice</b> as efficient.<q>Extremely unsettling, and somehow even worse than the regular kind.</q>','Grandma',9);9291order=300;new Game.TieredUpgrade('Humane pesticides','Farms are <b>twice</b> as efficient.<q>Made by people, for people, from people and ready to unleash some righteous scorching pain on those pesky insects that so deserve it.</q>','Farm',9);9292order=400;new Game.TieredUpgrade('Mole people','Mines are <b>twice</b> as efficient.<q>Engineered from real human beings within your very labs, these sturdy little folks have a knack for finding the tastiest underground minerals in conditions that more expensive machinery probably wouldn\'t survive.</q>','Mine',9);9293order=500;new Game.TieredUpgrade('Machine learning','Factories are <b>twice</b> as efficient.<q>You figured you might get better productivity if you actually told your workers to learn how to work the machines. Sometimes, it\'s the little things...</q>','Factory',9);9294order=525;new Game.TieredUpgrade('Edible money','Banks are <b>twice</b> as efficient.<q>It\'s really quite simple; you make all currency too delicious not to eat, solving world hunger and inflation in one fell swoop!</q>','Bank',9);9295order=550;new Game.TieredUpgrade('Sick rap prayers','Temples are <b>twice</b> as efficient.<q>With their ill beat and radical rhymes, these way-hip religious tunes are sure to get all the youngins who thought they were 2 cool 4 church back on the pews and praying for more! Wicked!</q>','Temple',9);9296order=575;new Game.TieredUpgrade('Deluxe tailored wands','Wizard towers are <b>twice</b> as efficient.<q>In this age of science, most skillful wand-makers are now long gone; but thankfully - not all those wanders are lost.</q>','Wizard tower',9);9297order=600;new Game.TieredUpgrade('Autopilot','Shipments are <b>twice</b> as efficient.<q>Your ships are now fitted with completely robotic crews! It\'s crazy how much money you save when you don\'t have to compensate the families of those lost in space.</q>','Shipment',9);9298order=700;new Game.TieredUpgrade('The advent of chemistry','Alchemy labs are <b>twice</b> as efficient.<q>You know what? That whole alchemy nonsense was a load of baseless rubbish. Dear god, what were you thinking?</q>','Alchemy lab',9);9299order=800;new Game.TieredUpgrade('The real world','Portals are <b>twice</b> as efficient.<q>It turns out that our universe is actually the twisted dimension of another, saner plane of reality. Time to hop on over there and loot the place!</q>','Portal',9);9300order=900;new Game.TieredUpgrade('Second seconds','Time machines are <b>twice</b> as efficient.<q>That\'s twice as many seconds in the same amount of time! What a deal! Also, what in god\'s name!</q>','Time machine',9);9301order=1000;new Game.TieredUpgrade('Quantum comb','Antimatter condensers are <b>twice</b> as efficient.<q>Quantum entanglement is one of those things that are so annoying to explain that we might honestly be better off without it. This is finally possible thanks to the quantum comb!</q>','Antimatter condenser',9);9302order=1100;new Game.TieredUpgrade('Crystal mirrors','Prisms are <b>twice</b> as efficient.<q>Designed to filter more light back into your prisms, reaching levels of brightness that reality itself had never planned for.</q>','Prism',9);9303order=1200;new Game.TieredUpgrade('Bunnypedes','Chancemakers are <b>twice</b> as efficient.<q>You\'ve taken to breeding rabbits with hundreds of paws, which makes them intrinsically very lucky and thus a very handy (if very disturbing) pet.</q>','Chancemaker',9);93049305order=20000;9306new Game.Upgrade('Kitten assistants to the regional manager','You gain <b>more CpS</b> the more milk you have.<q>nothing stresses meowt... except having to seek the approval of my inferiors, sir</q>',900000000000000000000000000000000000,Game.GetIcon('Kitten',10));Game.last.kitten=1;Game.MakeTiered(Game.last,10,18);93079308order=5000;9309Game.SynergyUpgrade('Charm quarks','<q>They\'re after your lucky quarks!</q>','Chancemaker','Antimatter condenser','synergy2');931093119312order=10020;9313Game.NewUpgradeCookie({name:'Pink biscuits',desc:'One of the oldest cookies. Traditionally dipped in champagne to soften it, because the French will use any opportunity to drink.',icon:[21,16],power: 4,price: 999999999999999999999999999});9314Game.NewUpgradeCookie({name:'Whole-grain cookies',desc:'Covered in seeds and other earthy-looking debris. Really going for that "5-second rule" look.',icon:[22,16],power: 4,price: 999999999999999999999999999*5});9315Game.NewUpgradeCookie({name:'Candy cookies',desc:'These melt in your hands just a little bit.',icon:[23,16],power: 4,price: 9999999999999999999999999999});9316Game.NewUpgradeCookie({name:'Big chip cookies',desc:'You are in awe at the size of these chips. Absolute units.',icon:[24,16],power: 4,price: 9999999999999999999999999999*5});9317Game.NewUpgradeCookie({name:'One chip cookies',desc:'You get one.',icon:[25,16],power: 1,price: 99999999999999999999999999999});931893199320new Game.Upgrade('Sugar baking','Each unspent sugar lump (up to 100) gives <b>+1% CpS</b>.<div class="warning">Note : this means that spending sugar lumps will decrease your CpS until they grow back.</div><q>To bake with the sugary essence of eons themselves, you must first learn to take your sweet time.</q>',200000000,[21,17]);Game.last.pool='prestige';Game.last.parents=['Stevia Caelestis'];9321new Game.Upgrade('Sugar craving','Once an ascension, you may use the "Sugar frenzy" switch to <b>triple your CpS</b> for 1 hour, at the cost of <b>1 sugar lump</b>.<q>Just a little kick to sweeten the deal.</q>',400000000,[22,17]);Game.last.pool='prestige';Game.last.parents=['Sugar baking'];9322new Game.Upgrade('Sugar aging process','Each grandma (up to 600) makes sugar lumps ripen <b>6 seconds</b> sooner.<q>Aren\'t they just the sweetest?</q>',600000000,[23,17]);Game.last.pool='prestige';Game.last.parents=['Sugar craving','Diabetica Daemonicus'];93239324order=40050;9325new Game.Upgrade('Sugar frenzy','Activating this will <b>triple your CpS</b> for 1 hour, at the cost of <b>1 sugar lump</b>.<br>May only be used once per ascension.',0,[22,17]);9326Game.last.priceLumps=1;9327Game.last.pool='toggle';Game.last.toggleInto=0;9328Game.last.canBuyFunc=function(){return Game.lumps>=1;};9329Game.last.clickFunction=Game.spendLump(1,'activate the sugar frenzy',function()9330{9331Game.Upgrades['Sugar frenzy'].buy(1);9332buff=Game.gainBuff('sugar frenzy',60*60,3);9333if (Game.prefs.popups) Game.Popup('Sugar frenzy activated!');9334else Game.Notify('Sugar frenzy!','CpS x3 for 1 hour!',[29,14]);9335});93369337order=10020;9338Game.NewUpgradeCookie({name:'Sprinkles cookies',desc:'A bit of festive decorating helps hide the fact that this might be one of the blandest cookies you\'ve ever tasted.',icon:[21,14],power: 4,price: 99999999999999999999999999999*5});9339Game.NewUpgradeCookie({name:'Peanut butter blossoms',desc:'Topped with a scrumptious chocolate squirt, which is something we really wish we didn\'t just write.',icon:[22,14],power: 4,price: 999999999999999999999999999999});9340Game.NewUpgradeCookie({name:'No-bake cookies',desc:'You have no idea how these mysterious oven-less treats came to be or how they hold their shape. You\'re thinking either elephant glue or cold fusion.',icon:[21,15],power: 4,price: 999999999999999999999999999999*5});9341Game.NewUpgradeCookie({name:'Florentines',desc:'These make up for being the fruitcake of cookies by at least having the decency to feature chocolate.',icon:[26,16],power: 4,price: 9999999999999999999999999999999});9342Game.NewUpgradeCookie({name:'Chocolate crinkles',desc:'Non-denominational cookies to celebrate year-round deliciousness, and certainly not Christmas or some other nonsense.',icon:[22,15],power: 4,price: 9999999999999999999999999999999*5});9343Game.NewUpgradeCookie({name:'Maple cookies',desc:'Made with syrup from a land where milk comes in bags, instead of spontaneously pooling at the bottom of your screen depending on your achievements.',icon:[21,13],power: 4,price: 99999999999999999999999999999999});934493459346order=40000;9347new Game.Upgrade('Turbo-charged soil','Garden plants grow every second.<br>Garden seeds are free to plant.<br>You can switch soils at any time.<q>It\'s got electrolytes!</q>',7,[2,16]);//debug purposes only9348Game.last.buyFunction=function(){if (Game.Objects['Farm'].minigameLoaded){Game.Objects['Farm'].minigame.computeStepT();}}9349Game.last.pool='debug';93509351order=150;9352new Game.Upgrade('Technobsidian mouse','Clicking gains <b>+1% of your CpS</b>.<q>A highly advanced mouse of a sophisticated design. Only one thing on its mind : to click.</q>',5000000000000000000000000,[11,28]);Game.MakeTiered(Game.last,11,11);9353new Game.Upgrade('Plasmarble mouse','Clicking gains <b>+1% of your CpS</b>.<q>A shifting blur in the corner of your eye, this mouse can trigger a flurry of clicks when grazed by even the slightest breeze.</q>',500000000000000000000000000,[11,30]);Game.MakeTiered(Game.last,12,11);93549355order=20000;9356new Game.Upgrade('Kitten marketeers','You gain <b>more CpS</b> the more milk you have.<q>no such thing as a saturated markit, sir</q>',900000000000000000000000000000000000000,Game.GetIcon('Kitten',11));Game.last.kitten=1;Game.MakeTiered(Game.last,11,18);93579358order=10030;9359Game.NewUpgradeCookie({name:'Festivity loops',desc:'These garish biscuits are a perfect fit for children\'s birthday parties or the funerals of strange, eccentric billionaires.',icon:[25,17],require:'Box of brand biscuits',power: 2, price: 999999999999999999999999*5});93609361order=10020;9362Game.NewUpgradeCookie({name:'Persian rice cookies',desc:'Rose water and poppy seeds are the secret ingredients of these small, butter-free cookies.',icon:[28,15],power: 4,price: 99999999999999999999999999999999*5});9363Game.NewUpgradeCookie({name:'Norwegian cookies',desc:'A flat butter cookie with a sliver of candied cherry on top. It is said that these illustrate the bleakness of scandinavian existentialism.',icon:[22,20],power: 4,price: 999999999999999999999999999999999});9364Game.NewUpgradeCookie({name:'Crispy rice cookies',desc:'Fun to make at home! Store-bought cookies are obsolete! Topple the system! There\'s marshmallows in these! Destroy capitalism!',icon:[23,20],power: 4,price: 999999999999999999999999999999999*5});9365Game.NewUpgradeCookie({name:'Ube cookies',desc:'The tint is obtained by the use of purple yams. According to color symbolism, these cookies are either noble, holy, or supervillains.',icon:[24,17],power: 4,price: 9999999999999999999999999999999999});9366Game.NewUpgradeCookie({name:'Butterscotch cookies',desc:'The butterscotch chips are just the right amount of sticky, and make you feel like you\'re eating candy.',icon:[24,20],power: 4,price: 9999999999999999999999999999999999*5});9367Game.NewUpgradeCookie({name:'Speculaas',desc:'These crunchy, almost obnoxiously cinnamony cookies are a source of dutch pride. About the origin of the name, one can only speculate.',icon:[21,20],power: 4,price: 99999999999999999999999999999999999});93689369order=10200;9370Game.NewUpgradeCookie({name:'Elderwort biscuits',desc:'-',icon:[22,25],power:2,price:60*2,locked:1});Game.last.baseDesc='Cookie production multiplier <b>+2%</b>.<br>Grandma production multiplier <b>+2%</b>.<br>Dropped by elderwort plants.<q>They taste incredibly stale, even when baked fresh.</q>';9371Game.NewUpgradeCookie({name:'Bakeberry cookies',desc:'-',icon:[23,25],power:2,price:60,locked:1});Game.last.baseDesc='Cookie production multiplier <b>+2%</b>.<br>Dropped by bakeberry plants.<q>Really good dipped in hot chocolate.</q>';9372Game.NewUpgradeCookie({name:'Duketater cookies',desc:'-',icon:[24,25],power:10,price:60*3,locked:1});Game.last.baseDesc='Cookie production multiplier <b>+10%</b>.<br>Dropped by duketater plants.<q>Fragrant and mealy, with a slight yellow aftertaste.</q>';9373Game.NewUpgradeCookie({name:'Green yeast digestives',desc:'-',icon:[25,25],power:0,price:60*3,locked:1});Game.last.baseDesc='<b>+1%</b> golden cookie gains and effect duration.<br><b>+1%</b> golden cookie frequency.<br><b>+3%</b> random drops.<br>Dropped by green rot plants.<q>These are tastier than you\'d expect, but not by much.</q>';93749375order=23000;9376new Game.Upgrade('Fern tea','You gain <b>+3%</b> of your regular CpS while the game is closed <small>(provided you have the Twin Gates of Transcendence heavenly upgrade)</small>.<br>Dropped by drowsyfern plants.<q>A chemically complex natural beverage, this soothing concoction has been used by mathematicians to solve equations in their sleep.</q>',60,[26,25]);9377new Game.Upgrade('Ichor syrup','You gain <b>+7%</b> of your regular CpS while the game is closed <small>(provided you have the Twin Gates of Transcendence heavenly upgrade)</small>.<br>Sugar lumps mature <b>7 minutes</b> sooner.<br>Dropped by ichorpuff plants.<q>Tastes like candy. The smell is another story.</q>',60*2,[27,25]);93789379order=10200;9380Game.NewUpgradeCookie({name:'Wheat slims',desc:'-',icon:[28,25],power:1,price:30,locked:1});Game.last.baseDesc='Cookie production multiplier <b>+1%</b>.<br>Dropped by baker\'s wheat plants.<q>The only reason you\'d consider these to be cookies is because you feel slightly sorry for them.</q>';93819382var gardenDrops=['Elderwort biscuits','Bakeberry cookies','Duketater cookies','Green yeast digestives','Fern tea','Ichor syrup','Wheat slims'];9383for (var i in gardenDrops)//scale by CpS9384{9385var it=Game.Upgrades[gardenDrops[i]];9386it.priceFunc=function(cost){return function(){return cost*Game.cookiesPs*60;}}(it.basePrice);9387it.baseDesc=it.baseDesc.replace('<q>','<br>Cost scales with CpS.<q>');9388it.desc=BeautifyInText(it.baseDesc);9389it.lasting=true;9390}939193929393order=10300;9394Game.NewUpgradeCookie({name:'Synthetic chocolate green honey butter biscuit',desc:'Rewarded for owning 350 of everything.<br>The recipe for this butter biscuit was once the sole heritage of an ancient mountain monastery. Its flavor is so refined that only a slab of lab-made chocolate specifically engineered to be completely tasteless could complement it.<br>Also it\'s got your face on it.',icon:[24,26],power: 10,price: 999999999999999999999999999999999999,locked:1});9395Game.NewUpgradeCookie({name:'Royal raspberry chocolate butter biscuit',desc:'Rewarded for owning 400 of everything.<br>Once reserved for the megalomaniac elite, this unique strain of fruity chocolate has a flavor and texture unlike any other. Whether its exorbitant worth is improved or lessened by the presence of your likeness on it still remains to be seen.',icon:[25,26],power: 10,price: 999999999999999999999999999999999999999,locked:1});9396Game.NewUpgradeCookie({name:'Ultra-concentrated high-energy chocolate butter biscuit',desc:'Rewarded for owning 450 of everything.<br>Infused with the power of several hydrogen bombs through a process that left most nuclear engineers and shareholders perplexed. Currently at the center of some rather heated United Nations meetings. Going in more detail about this chocolate would violate several state secrets, but we\'ll just add that someone\'s bust seems to be pictured on it. Perhaps yours?',icon:[26,26],power: 10,price: 999999999999999999999999999999999999999999,locked:1});9397939893999400order=200;new Game.TieredUpgrade('Timeproof hair dyes','Grandmas are <b>twice</b> as efficient.<q>Why do they always have those strange wispy pink dos? What do they know about candy floss that we don\'t?</q>','Grandma',10);9401order=300;new Game.TieredUpgrade('Barnstars','Farms are <b>twice</b> as efficient.<q>Ah, yes. These help quite a bit. Somehow.</q>','Farm',10);9402order=400;new Game.TieredUpgrade('Mine canaries','Mines are <b>twice</b> as efficient.<q>These aren\'t used for anything freaky! The miners just enjoy having a pet or two down there.</q>','Mine',10);9403order=500;new Game.TieredUpgrade('Brownie point system','Factories are <b>twice</b> as efficient.<q>Oh, these are lovely! You can now reward your factory employees for good behavior, such as working overtime or snitching on coworkers. 58 brownie points gets you a little picture of a brownie, and 178 of those pictures gets you an actual brownie piece for you to do with as you please! Infantilizing? Maybe. Oodles of fun? You betcha!</q>','Factory',10);9404order=525;new Game.TieredUpgrade('Grand supercycles','Banks are <b>twice</b> as efficient.<q>We let the public think these are complicated financial terms when really we\'re just rewarding the bankers with snazzy bicycles for a job well done. It\'s only natural after you built those fancy gold swimming pools for them, where they can take a dip and catch Kondratiev waves.</q>','Bank',10);9405order=550;new Game.TieredUpgrade('Psalm-reading','Temples are <b>twice</b> as efficient.<q>A theologically dubious and possibly blasphemous blend of fortune-telling and scripture studies.</q>','Temple',10);9406order=575;new Game.TieredUpgrade('Immobile spellcasting','Wizard towers are <b>twice</b> as efficient.<q>Wizards who master this skill can now cast spells without having to hop and skip and gesticulate embarrassingly, which is much sneakier and honestly quite a relief.</q>','Wizard tower',10);9407order=600;new Game.TieredUpgrade('Restaurants at the end of the universe','Shipments are <b>twice</b> as efficient.<q>Since the universe is spatially infinite, and therefore can be construed to have infinite ends, you\'ve opened an infinite chain of restaurants where your space truckers can rest and partake in some home-brand cookie-based meals.</q>','Shipment',10);9408order=700;new Game.TieredUpgrade('On second thought','Alchemy labs are <b>twice</b> as efficient.<q>Disregard that last upgrade, alchemy is where it\'s at! Your eggheads just found a way to transmute children\'s nightmares into rare metals!</q>','Alchemy lab',10);9409order=800;new Game.TieredUpgrade('Dimensional garbage gulper','Portals are <b>twice</b> as efficient.<q>So we\'ve been looking for a place to dispose of all the refuse that\'s been accumulating since we started baking - burnt cookies, failed experiments, unruly workers - and well, we figured rather than sell it to poor countries like we\'ve been doing, we could just dump it in some alternate trash dimension where it\'s not gonna bother anybody! Probably!</q>','Portal',10);9410order=900;new Game.TieredUpgrade('Additional clock hands','Time machines are <b>twice</b> as efficient.<q>It seemed like a silly idea at first, but it turns out these have the strange ability to twist time in interesting new ways.</q>','Time machine',10);9411order=1000;new Game.TieredUpgrade('Baking Nobel prize','Antimatter condensers are <b>twice</b> as efficient.<q>What better way to sponsor scientific growth than to motivate those smarmy nerds with a meaningless award! What\'s more, each prize comes with a fine print lifelong exclusive contract to come work for you (or else)!</q>','Antimatter condenser',10);9412order=1100;new Game.TieredUpgrade('Reverse theory of light','Prisms are <b>twice</b> as efficient.<q>A whole new world of physics opens up when you decide that antiphotons are real and posit that light is merely a void in shadow.</q>','Prism',10);9413order=1200;new Game.TieredUpgrade('Revised probabilistics','Chancemakers are <b>twice</b> as efficient.<q>Either something happens or it doesn\'t. That\'s a 50% chance! This suddenly makes a lot of unlikely things very possible.</q>','Chancemaker',10);94149415order=20000;9416new Game.Upgrade('Kitten analysts','You gain <b>more CpS</b> the more milk you have.<q>based on purrent return-on-investment meowdels we should be able to affurd to pay our empawyees somewhere around next century, sir</q>',900000000000000000000000000000000000000000,Game.GetIcon('Kitten',12));Game.last.kitten=1;Game.MakeTiered(Game.last,12,18);941794189419new Game.Upgrade('Eye of the wrinkler','Mouse over a wrinkler to see how many cookies are in its stomach.<q>Just a wrinkler and its will to survive.<br>Hangin\' tough, stayin\' hungry.</q>',99999999,[27,26]);Game.last.pool='prestige';Game.last.parents=['Wrinkly cookies'];94209421new Game.Upgrade('Inspired checklist','Unlocks the <b>Buy all</b> feature, which lets you instantly purchase every upgrade in your store (starting from the cheapest one).<br>Also unlocks the <b>Vault</b>, a store section where you can place upgrades you do not wish to auto-buy.<q>Snazzy grandma accessories? Check. Transdimensional abominations? Check. A bunch of eggs for some reason? Check. Machine that goes "ping"? Check and check.</q>',900000,[28,26]);Game.last.pool='prestige';Game.last.parents=['Persistent memory','Permanent upgrade slot IV'];94229423order=10300;9424Game.NewUpgradeCookie({name:'Pure pitch-black chocolate butter biscuit',desc:'Rewarded for owning 500 of everything.<br>This chocolate is so pure and so flawless that it has no color of its own, instead taking on the appearance of whatever is around it. You\'re a bit surprised to notice that this one isn\'t stamped with your effigy, as its surface is perfectly smooth (to the picometer) - until you realize it\'s quite literally reflecting your own face like a mirror.',icon:[24,27],power: 10,price: 999999999999999999999999999999999999999999999,locked:1});94259426order=10020;9427Game.NewUpgradeCookie({name:'Chocolate oatmeal cookies',desc:'These bad boys compensate for lack of a cohesive form and a lumpy, unsightly appearance by being just simply delicious. Something we should all aspire to.',icon:[23,28],power: 4,price: 99999999999999999999999999999999999*5});9428Game.NewUpgradeCookie({name:'Molasses cookies',desc:'Sticky, crackly, and dusted in fine sugar.<br>Some lunatics have been known to eat these with potatoes.',icon:[24,28],power: 4,price: 999999999999999999999999999999999999});9429Game.NewUpgradeCookie({name:'Biscotti',desc:'Almonds and pistachios make these very robust cookies slightly more interesting to eat than to bludgeon people with.',icon:[22,28],power: 4,price: 999999999999999999999999999999999999*5});9430Game.NewUpgradeCookie({name:'Waffle cookies',desc:'Whether these are cookies with shockingly waffle-like features or simply regular cookie-sized waffles is a debate we\'re not getting into here.',icon:[21,28],power: 4,price: 9999999999999999999999999999999999999});943194329433order=10000;9434//early cookies that unlock at the same time as coconut cookies; meant to boost early game a little bit9435Game.NewUpgradeCookie({name:'Almond cookies',desc:'Sometimes you feel like one of these. Sometimes you don\'t.',icon:[21,27],power: 2, price: 99999999});9436Game.NewUpgradeCookie({name:'Hazelnut cookies',desc:'Tastes like a morning stroll through a fragrant forest, minus the clouds of gnats.',icon:[22,27],power: 2, price: 99999999});9437Game.NewUpgradeCookie({name:'Walnut cookies',desc:'Some experts have pointed to the walnut\'s eerie resemblance to the human brain as a sign of its sentience - a theory most walnuts vehemently object to.',icon:[23,27],power: 2, price: 99999999});943894399440new Game.Upgrade('Label printer','Mouse over an upgrade to see its tier.<br><small>Note : only some upgrades have tiers. Tiers are purely cosmetic and have no effect on gameplay.</small><q>Also comes in real handy when you want to tell catsup apart from ketchup.</q>',999999,[28,29]);Game.last.pool='prestige';Game.last.parents=['Starter kitchen'];94419442944394449445order=200;new Game.TieredUpgrade('Good manners','Grandmas are <b>twice</b> as efficient.<q>Apparently these ladies are much more amiable if you take the time to learn their strange, ancient customs, which seem to involve saying "please" and "thank you" and staring at the sun with bulging eyes while muttering eldritch curses under your breath.</q>','Grandma',11);9446order=300;new Game.TieredUpgrade('Lindworms','Farms are <b>twice</b> as efficient.<q>You have to import these from far up north, but they really help areate the soil!</q>','Farm',11);9447order=400;new Game.TieredUpgrade('Bore again','Mines are <b>twice</b> as efficient.<q>After extracting so much sediment for so long, you\'ve formed some veritable mountains of your own from the accumulated piles of rock and dirt. Time to dig through those and see if you find anything fun!</q>','Mine',11);9448order=500;new Game.TieredUpgrade('"Volunteer" interns','Factories are <b>twice</b> as efficient.<q>If you\'re bad at something, always do it for free.</q>','Factory',11);9449order=525;new Game.TieredUpgrade('Rules of acquisition','Banks are <b>twice</b> as efficient.<q>Rule 387 : a cookie baked is a cookie kept.</q>','Bank',11);9450order=550;new Game.TieredUpgrade('War of the gods','Temples are <b>twice</b> as efficient.<q>An interesting game; the only winning move is not to pray.</q>','Temple',11);9451order=575;new Game.TieredUpgrade('Electricity','Wizard towers are <b>twice</b> as efficient.<q>Ancient magicks and forbidden hexes shroud this arcane knowledge, whose unfathomable power can mysteriously turn darkness into light and shock an elephant to death.</q>','Wizard tower',11);9452order=600;new Game.TieredUpgrade('Universal alphabet','Shipments are <b>twice</b> as efficient.<q>You\'ve managed to chart a language that can be understood by any sentient species in the galaxy; its exciting vocabulary contains over 56 trillion words that sound and look like sparkly burps, forming intricate sentences that usually translate to something like "give us your cookies, or else".</q>','Shipment',11);9453order=700;new Game.TieredUpgrade('Public betterment','Alchemy labs are <b>twice</b> as efficient.<q>Why do we keep trying to change useless matter into cookies, or cookies into even better cookies? Clearly, the way of the future is to change the people who eat the cookies into people with a greater understanding, appreciation and respect for the cookies they\'re eating. Into the vat you go!</q>','Alchemy lab',11);9454order=800;new Game.TieredUpgrade('Embedded microportals','Portals are <b>twice</b> as efficient.<q>We\'ve found out that if we bake the portals into the cookies themselves, we can transport people\'s taste buds straight into the taste dimension! Good thing your army of lawyers got rid of the FDA a while ago!</q>','Portal',11);9455order=900;new Game.TieredUpgrade('Nostalgia','Time machines are <b>twice</b> as efficient.<q>Your time machine technicians insist that this is some advanced new time travel tech, and not just an existing emotion universal to mankind. Either way, you have to admit that selling people the same old cookies just because it reminds them of the good old times is an interesting prospect.</q>','Time machine',11);9456order=1000;new Game.TieredUpgrade('The definite molecule','Antimatter condensers are <b>twice</b> as efficient.<q>Your scientists have found a way to pack a cookie into one single continuous molecule, opening exciting new prospects in both storage and flavor despite the fact that these take up to a whole year to digest.</q>','Antimatter condenser',11);9457order=1100;new Game.TieredUpgrade('Light capture measures','Prisms are <b>twice</b> as efficient.<q>As the universe gets ever so slightly dimmer due to you converting more and more of its light into cookies, you\'ve taken to finding new and unexplored sources of light for your prisms; for instance, the warm glow emitted by a pregnant woman, or the twinkle in the eye of a hopeful child.</q>','Prism',11);9458order=1200;new Game.TieredUpgrade('0-sided dice','Chancemakers are <b>twice</b> as efficient.<q>The advent of the 0-sided dice has had unexpected and tumultuous effects on the gambling community, and saw experts around the world calling you both a genius and an imbecile.</q>','Chancemaker',11);945994609461new Game.Upgrade('Heralds','You now benefit from the boost provided by <b>heralds</b>.<br>Each herald gives you <b>+1% CpS</b>.<br>Look on the purple flag at the top to see how many heralds are active at any given time.<q>Be excellent to each other.<br>And Patreon, dudes!</q>',100,[21,29]);Game.last.pool='prestige';94629463order=255;9464Game.GrandmaSynergy('Metagrandmas','A fractal grandma to make more grandmas to make more cookies.','Fractal engine');94659466order=1300;9467new Game.TieredUpgrade('Metabakeries','Fractal engines are <b>twice</b> as efficient.<q>They practically bake themselves!</q>','Fractal engine',1);9468new Game.TieredUpgrade('Mandelbrown sugar','Fractal engines are <b>twice</b> as efficient.<q>A substance that displays useful properties such as fractal sweetness and instant contact lethality.</q>','Fractal engine',2);9469new Game.TieredUpgrade('Fractoids','Fractal engines are <b>twice</b> as efficient.<q>Here\'s a frun fract : all in all, these were a terrible idea.</q>','Fractal engine',3);9470new Game.TieredUpgrade('Nested universe theory','Fractal engines are <b>twice</b> as efficient.<q>Asserts that each subatomic particle is host to a whole new universe, and therefore, another limitless quantity of cookies.<br>This somehow stacks with the theory of nanocosmics, because physics.</q>','Fractal engine',4);9471new Game.TieredUpgrade('Menger sponge cake','Fractal engines are <b>twice</b> as efficient.<q>Frighteningly absorbent thanks to its virtually infinite surface area. Keep it isolated in a dry chamber, never handle it with an open wound, and do not ever let it touch a body of water.</q>','Fractal engine',5);9472new Game.TieredUpgrade('One particularly good-humored cow','Fractal engines are <b>twice</b> as efficient.<q>This unassuming bovine was excruciatingly expensive and it may seem at first like you were ripped off. On closer inspection however, you notice that its earrings (it\'s wearing earrings) are actually fully functional copies of itself, each of which also wearing their own cow earrings, and so on, infinitely. It appears your dairy concerns will be taken care of for a while, although you\'ll have to put up with the cow\'s annoying snickering.</q>','Fractal engine',6);9473new Game.TieredUpgrade('Chocolate ouroboros','Fractal engines are <b>twice</b> as efficient.<q>Forever eating its own tail and digesting itself, in a metabolically dubious tale of delicious tragedy.</q>','Fractal engine',7);9474new Game.TieredUpgrade('Nested','Fractal engines are <b>twice</b> as efficient.<q>Clever self-reference or shameful cross-promotion? This upgrade apparently has the gall to advertise a link to <u>orteil.dashnet.org/nested</u>, in a tooltip you can\'t even click.</q>','Fractal engine',8);9475new Game.TieredUpgrade('Space-filling fibers','Fractal engines are <b>twice</b> as efficient.<q>This special ingredient has the incredible ability to fill the local space perfectly, effectively eradicating hunger in those who consume it!<br>Knowing that no hunger means no need for cookies, your marketers urge you to repurpose this product into next-level packing peanuts.</q>','Fractal engine',9);9476new Game.TieredUpgrade('Endless book of prose','Fractal engines are <b>twice</b> as efficient.','Fractal engine',10);9477Game.last.descFunc=function(){9478var str='"There once was a baker named '+Game.bakeryName+'. One day, there was a knock at the door; '+Game.bakeryName+' opened it and was suddenly face-to-face with a strange and menacing old grandma. The grandma opened her mouth and, in a strange little voice, started reciting this strange little tale : ';9479var n=35;9480var i=Math.floor(Game.T*0.1);9481return this.desc+'<q style="font-family:Courier;">'+(str.substr(i%str.length,n)+(i%str.length>(str.length-n)?str.substr(0,i%str.length-(str.length-n)):''))+'</q>';9482};9483new Game.TieredUpgrade('The set of all sets','Fractal engines are <b>twice</b> as efficient.<q>The answer, of course, is a definite maybe.</q>','Fractal engine',11);94849485order=5000;9486Game.SynergyUpgrade('Recursive mirrors','<q>Do you have any idea what happens when you point two of these at each other? Apparently, the universe doesn\'t either.</q>','Fractal engine','Prism','synergy1');9487//Game.SynergyUpgrade('Compounded odds','<q>When probabilities start cascading, "never in a billion lifetimes" starts looking terribly like "probably before Monday comes around".</q>','Fractal engine','Chancemaker','synergy1');9488Game.SynergyUpgrade('Mice clicking mice','','Fractal engine','Cursor','synergy2');9489Game.last.descFunc=function(){9490Math.seedrandom(Game.seed+'-blasphemouse');9491if (Math.random()<0.3) {Math.seedrandom();return this.desc+'<q>Absolutely blasphemouse!</q>';}9492else {Math.seedrandom();return this.desc+'<q>Absolutely blasphemous!</q>';}9493};949494959496order=10020;9497Game.NewUpgradeCookie({name:'Custard creams',desc:'British lore pits these in a merciless war against bourbon biscuits.<br>The filling evokes vanilla without quite approaching it.<br>They\'re tastier on the inside!',icon:[23,29],power: 4,price: 9999999999999999999999999999999999999*5});9498Game.NewUpgradeCookie({name:'Bourbon biscuits',desc:'Two chocolate biscuits joined together with even more chocolate.<br>The sworn rivals of custard creams, as legend has it.',icon:[24,29],power: 4,price: 99999999999999999999999999999999999999});949995009501new Game.Upgrade('Keepsakes','Seasonal random drops have a <b>1/5 chance</b> to carry over through ascensions.<q>Cherish the memories.</q>',1111111111,[22,29]);Game.last.pool='prestige';Game.last.parents=['Starsnow','Starlove','Starterror','Startrade','Starspawn'];95029503order=10020;9504Game.NewUpgradeCookie({name:'Mini-cookies',desc:'Have you ever noticed how the smaller something is, the easier it is to binge on it?',icon:[29,30],power: 5,price: 99999999999999999999999999999999999999*5});95059506new Game.Upgrade('Sugar crystal cookies','Cookie production multiplier <b>+5% permanently</b>, and <b>+1%</b> for every building type level 10 or higher.<q>Infused with cosmic sweetness. It gives off a faint shimmery sound when you hold it up to your ear.</q>',1000000000,[21,30]);Game.last.pool='prestige';Game.last.parents=['Sugar baking'];Game.last.power=function(){9507var n=5;9508for (var i in Game.Objects)9509{9510if (Game.Objects[i].level>=10) n++;9511}9512return n;9513};Game.last.pseudoCookie=true;9514Game.last.descFunc=function(){9515var n=5;9516for (var i in Game.Objects)9517{9518if (Game.Objects[i].level>=10) n++;9519}9520return '<div style="text-align:center;">Current : <b>+'+Beautify(n)+'%</b><div class="line"></div></div>'+this.desc;9521};9522new Game.Upgrade('Box of maybe cookies','Contains an assortment of...something.<q>These may or may not be considered cookies.</q>',333000000000,[25,29]);Game.last.pool='prestige';Game.last.parents=['Sugar crystal cookies'];9523new Game.Upgrade('Box of not cookies','Contains an assortment of...something.<q>These are strictly, definitely not cookies.</q>',333000000000,[26,29]);Game.last.pool='prestige';Game.last.parents=['Sugar crystal cookies'];9524new Game.Upgrade('Box of pastries','Contains an assortment of delicious pastries.<q>These are a damn slippery slope is what they are!</q>',333000000000,[27,29]);Game.last.pool='prestige';Game.last.parents=['Sugar crystal cookies'];95259526order=10040;9527Game.NewUpgradeCookie({name:'Profiteroles',desc:'Also known as cream puffs, these pastries are light, fluffy, filled with whipped cream and fun to throw at people when snowballs are running scarce.',icon:[29,29],require:'Box of pastries', power:4,price: Math.pow(10,31)});9528Game.NewUpgradeCookie({name:'Jelly donut',desc:'Guaranteed to contain at least 0.3% jelly filling, or your money back.<br>You can still see the jelly stab wound!',icon:[27,28],require:'Box of pastries', power:4,price: Math.pow(10,33)});9529Game.NewUpgradeCookie({name:'Glazed donut',desc:'Absolutely gooey with sugar. The hole is the tastiest part!',icon:[28,28],require:'Box of pastries', power:4,price: Math.pow(10,35)});9530Game.NewUpgradeCookie({name:'Chocolate cake',desc:'The cake is a Portal reference!',icon:[25,27],require:'Box of pastries', power:4,price: Math.pow(10,37)});9531Game.NewUpgradeCookie({name:'Strawberry cake',desc:'It\'s not easy to come up with flavor text for something as generic as this, but some would say it\'s a piece of cake.',icon:[26,27],require:'Box of pastries', power:4,price: Math.pow(10,39)});9532Game.NewUpgradeCookie({name:'Apple pie',desc:'It is said that some grandmas go rogue and bake these instead.',icon:[25,28],require:'Box of pastries', power:4,price: Math.pow(10,41)});9533Game.NewUpgradeCookie({name:'Lemon meringue pie',desc:'Meringue is a finicky substance made of sugar and egg whites that requires specific atmospheric conditions to be baked at all. The lemon, as far as we can tell, isn\'t nearly as picky.',icon:[26,28],require:'Box of pastries', power:4,price: Math.pow(10,43)});9534Game.NewUpgradeCookie({name:'Butter croissant',desc:'Look around.<br>A rude man in a striped shirt bikes past you. He smells of cigarettes and café-au-lait. Somewhere, a mime uses his moustache to make fun of the British. 300 pigeons fly overhead.<br>Relax. You\'re experiencing croissant.',icon:[29,28],require:'Box of pastries', power:4,price: Math.pow(10,45)});95359536order=10050;9537Game.NewUpgradeCookie({name:'Cookie dough',desc:'Bursting with infinite potential, but can also be eaten as is. Arguably worth the salmonella.',icon:[25,30],require:'Box of maybe cookies', power:4,price: Math.pow(10,35)});9538Game.NewUpgradeCookie({name:'Burnt cookie',desc:'This cookie flew too close to the sun and is now a shadow of its former self. If only you remembered to set a timer, you wouldn\'t have this tragedy on your hands...',icon:[23,30],require:'Box of maybe cookies', power:4,price: Math.pow(10,37)});9539Game.NewUpgradeCookie({name:'A chocolate chip cookie but with the chips picked off for some reason',desc:'This has to be the saddest thing you\'ve ever seen.',icon:[24,30],require:'Box of maybe cookies', power:3,price: Math.pow(10,39)});9540Game.NewUpgradeCookie({name:'Flavor text cookie',desc:'What you\'re currently reading is what gives this cookie its inimitable flavor.',icon:[22,30],require:'Box of maybe cookies', power:4,price: Math.pow(10,41)});9541Game.NewUpgradeCookie({name:'High-definition cookie',desc:'Uncomfortably detailed, like those weird stories your aunt keeps telling at parties.',icon:[28,10],require:'Box of maybe cookies', power:5,price: Math.pow(10,43)});95429543order=10060;9544Game.NewUpgradeCookie({name:'Toast',desc:'A crisp slice of bread, begging for some butter and jam.<br>Why do people keep proposing these at parties?',icon:[27,10],require:'Box of not cookies', power:4,price: Math.pow(10,34)});9545Game.NewUpgradeCookie({name:'Peanut butter & jelly',desc:'It\'s time.',icon:[29,9],require:'Box of not cookies', power:4,price: Math.pow(10,36)});9546Game.NewUpgradeCookie({name:'Wookies',desc:'These aren\'t the cookies you\'re looking for.',icon:[26,30],require:'Box of not cookies', power:4,price: Math.pow(10,38)});9547Game.NewUpgradeCookie({name:'Cheeseburger',desc:'Absolutely no relation to cookies whatsoever - Orteil just wanted an excuse to draw a cheeseburger.',icon:[28,30],require:'Box of not cookies', power:4,price: Math.pow(10,40)});9548Game.NewUpgradeCookie({name:'One lone chocolate chip',desc:'The start of something beautiful.',icon:[27,30],require:'Box of not cookies', power:1,price: Math.pow(10,42)});954995509551new Game.Upgrade('Genius accounting','Unlocks <b>extra price information</b>.<br>Each displayed cost now specifies how long it\'ll take you to afford it, and how much of your bank it represents.<q>There\'s no accounting for taste, and yet here we are.</q>',2000000,[11,10]);Game.last.pool='prestige';Game.last.parents=['Inspired checklist'];955295539554new Game.Upgrade('Shimmering veil','Unlocks the <b>shimmering veil</b>, a switch that passively boosts your CpS by <b>50%</b>.<br>You start with the veil turned on; however, it is very fragile, and clicking the big cookie or any golden cookie or reindeer will turn it off, requiring 24 hours of CpS to turn back on.<q>Hands off!</q>',999999999,[9,10]);Game.last.pool='prestige';Game.last.parents=['Distilled essence of redoubled luck'];95559556order=40005;9557var func=function(){9558var boost=50;9559var resist=0;9560if (Game.Has('Reinforced membrane')) {boost+=10;resist+=10;}9561return (this.name=='Shimmering veil [on]'?'<div style="text-align:center;">Active.</div><div class="line"></div>':'')+'Boosts your cookie production by <b>'+Beautify(boost)+'%</b> when active.<br>The veil is very fragile and will break if you click the big cookie or any golden cookies or reindeer.<br><br>Once broken, turning the veil back on costs 24 hours of unbuffed CpS.'+(resist>0?('<br><br>Has a <b>'+Beautify(resist)+'%</b> chance to not break.'):'');9562};9563new Game.Upgrade('Shimmering veil [off]','',1000000,[9,10]);9564Game.last.pool='toggle';Game.last.toggleInto='Shimmering veil [on]';9565Game.last.priceFunc=function(){return Game.unbuffedCps*60*60*24;}9566Game.last.descFunc=func;9567new Game.Upgrade('Shimmering veil [on]','',0,[9,10]);9568Game.last.pool='toggle';Game.last.toggleInto='Shimmering veil [off]';9569Game.last.descFunc=func;95709571Game.loseShimmeringVeil=function(context)9572{9573if (!Game.Has('Shimmering veil')) return false;9574if (!Game.Has('Shimmering veil [off]') && Game.Has('Shimmering veil [on]')) return false;9575if (Game.Has('Reinforced membrane'))9576{9577if (context=='shimmer') Math.seedrandom(Game.seed+'/'+Game.goldenClicks);9578else if (context=='click') Math.seedrandom(Game.seed+'/'+Game.cookieClicks);9579if (Math.random()<0.1)9580{9581Game.Notify('The reinforced membrane protects the shimmering veil.','',[7,10]);9582Game.Win('Thick-skinned');9583return false;9584}9585Math.seedrandom();9586}9587var me=Game.Upgrades['Shimmering veil [on]'];9588me.bought=1;9589//Game.Upgrades[me.toggleInto].bought=false;9590Game.Lock(me.toggleInto);9591Game.Unlock(me.toggleInto);9592Game.Notify('The shimmering veil disappears...','',[9,10]);9593Game.upgradesToRebuild=1;9594Game.recalculateGains=1;9595PlaySound('snd/spellFail.mp3',0.75);9596}959795989599var getCookiePrice=function(level){return 999999999999999999999999999999999999999*Math.pow(10,(level-1)/2);};96009601order=10020;9602Game.NewUpgradeCookie({name:'Whoopie pies',desc:'Two chocolate halves joined together by a cream filling. It\'s got no eyebrows, but you never noticed until now.',icon:[21,31],power: 5,price: getCookiePrice(1)});9603Game.NewUpgradeCookie({name:'Caramel wafer biscuits',desc:'Coated in delicious chocolate. As many layers as you\'ll get in a biscuit without involving onions.',icon:[22,31],power: 5,price: getCookiePrice(2)});9604Game.NewUpgradeCookie({name:'Chocolate chip mocha cookies',desc:'Mocha started out as an excuse to smuggle chocolate into coffee. And now, in a poignant display of diplomacy and cultural exchange, it\'s bringing coffee to chocolate cookies.',icon:[23,31],power: 5,price: getCookiePrice(3)});9605Game.NewUpgradeCookie({name:'Earl Grey cookies',desc:'Captain Picard\'s favorite.',icon:[24,31],power: 5,price: getCookiePrice(4)});9606Game.NewUpgradeCookie({name:'Corn syrup cookies',desc:'The corn syrup makes it extra chewy. Not the type of stuff you\'d think to put in a cookie, but bakers make do.',icon:[25,31],power: 5,price: getCookiePrice(5)});9607Game.NewUpgradeCookie({name:'Icebox cookies',desc:'Can be prepared in a variety of shapes with a variety of ingredients. Made by freezing dough before baking it, mirroring a time-proven medieval torture practice. Gotta keep them guessing.',icon:[26,31],power: 5,price: getCookiePrice(6)});9608Game.NewUpgradeCookie({name:'Graham crackers',desc:'Inspired in their design by the wish to live a life of austere temperance, free from pleasure or cheer; it\'s no wonder these are so tasty.',icon:[27,31],power: 5,price: getCookiePrice(7)});9609Game.NewUpgradeCookie({name:'Hardtack',desc:'Extremely hard and, if we\'re being honest, extremely tack.<br>If you\'re considering eating this as a fun snack, you probably have other things to worry about than this game, like getting scurvy or your crew fomenting mutiny.',icon:[28,31],power: 5,price: getCookiePrice(8)});9610Game.NewUpgradeCookie({name:'Cornflake cookies',desc:'They\'re grrrrrroovy! Careful not to let it sit in your milk too long, lest you accidentally end up with a bowl of cereal and get confused.',icon:[29,31],power: 5,price: getCookiePrice(9)});9611Game.NewUpgradeCookie({name:'Tofu cookies',desc:'There\'s really two ways to go with tofu cooking; either it asserts itself in plain sight or it camouflages itself in the other ingredients. This happens to be the latter, and as such, you can\'t really tell the difference between this and a regular cookie, save for that one pixel on the left.',icon:[30,31],power: 5,price: getCookiePrice(10)});9612Game.NewUpgradeCookie({name:'Gluten-free cookies',desc:'Made with browned butter and milk to closely match the archetypal chocolate chip cookie.<br>For celiacs, a chance to indulge in a delicious risk-free pastry. For others, a strangely threatening confection whose empty eyes will never know heaven nor hell.',icon:[30,30],power: 5,price: getCookiePrice(10)});9613Game.NewUpgradeCookie({name:'Russian bread cookies',desc:'Also known as alphabet cookies; while most bakers follow the recipe to the letter, it is said that some substitute the flour for spelt. But don\'t take my word for it.',icon:[30,29],power: 5,price: getCookiePrice(11)});9614Game.NewUpgradeCookie({name:'Lebkuchen',desc:'Diverse cookies from Germany, fragrant with honey and spices, often baked around Christmas.<br>Once worn by warriors of old for protection in battle.<br>+5 STR, +20% magic resistance.',icon:[30,28],power: 5,price: getCookiePrice(12)});9615Game.NewUpgradeCookie({name:'Aachener Printen',desc:'The honey once used to sweeten these gingerbread-like treats has since been swapped out for beet sugar, providing another sad example of regressive evolution.',icon:[30,27],power: 5,price: getCookiePrice(13)});9616Game.NewUpgradeCookie({name:'Canistrelli',desc:'A dry biscuit flavored with anise and wine, tough like the people of Corsica where it comes from.',icon:[30,26],power: 5,price: getCookiePrice(14)});9617Game.NewUpgradeCookie({name:'Nice biscuits',desc:'Made with coconut and perfect with tea. Traces its origins to a French city so nice they named it that.',icon:[30,25],power: 5,price: getCookiePrice(15)});9618Game.NewUpgradeCookie({name:'French pure butter cookies',desc:'You can\'t tell what\'s stronger coming off these - the smell of butter or condescension.',icon:[31,25],power: 5,price: getCookiePrice(16)});9619Game.NewUpgradeCookie({name:'Petit beurre',desc:'An unassuming biscuit whose name simply means "little butter". Famed and feared for its four ears and forty-eight teeth.<br>When it hears ya, it\'ll get ya...',icon:[31,26],power: 5,price: getCookiePrice(16)});9620Game.NewUpgradeCookie({name:'Nanaimo bars',desc:'A delicious no-bake pastry hailing from Canada. Probably beats eating straight-up snow with maple syrup poured on it, but what do I know.',icon:[31,27],power: 5,price: getCookiePrice(17)});9621Game.NewUpgradeCookie({name:'Berger cookies',desc:'Messily slathered with chocolate fudge, but one of the most popular bergers of Baltimore, along with the triple fried egg berger and the blue crab cheeseberger.',icon:[31,28],power: 5,price: getCookiePrice(18)});9622Game.NewUpgradeCookie({name:'Chinsuko',desc:'A little piece of Okinawa in cookie form. Part of a Japanese custom of selling sweets as souvenirs. But hey, pressed pennies are cool too.',icon:[31,29],power: 5,price: getCookiePrice(19)});9623Game.NewUpgradeCookie({name:'Panda koala biscuits',desc:'Assorted jungle animals with equally assorted fillings.<br>Comes in chocolate, strawberry, vanilla and green tea.<br>Eat them all before they go extinct!',icon:[31,13],power: 5,price: getCookiePrice(19)});9624Game.NewUpgradeCookie({name:'Putri salju',desc:'A beloved Indonesian pastry; its name means "snow princess", for the powdered sugar it\'s coated with. Had we added these to Cookie Clicker some years ago, this is where we\'d make a reference to that one Disney movie, but it\'s probably time to let it go.',icon:[31,30],power: 5,price: getCookiePrice(20)});9625Game.NewUpgradeCookie({name:'Milk cookies',desc:'Best eaten with a tall glass of chocolate.',icon:[31,31],power: 5,price: getCookiePrice(21)});96269627order=9999;9628Game.NewUpgradeCookie({name:'Cookie crumbs',desc:'There used to be a cookie here. Now there isn\'t.<br>Good heavens, what did you <i>DO?!</i>',icon:[30,13],power:1,require:'Legacy',price:100});9629Game.NewUpgradeCookie({name:'Chocolate chip cookie',desc:'This is the cookie you\'ve been clicking this whole time. It looks a bit dented and nibbled on, but it\'s otherwise good as new.',icon:[10,0],power:10,require:'Legacy',price:1000000000000});963096319632new Game.Upgrade('Cosmic beginner\'s luck','Prior to purchasing the <b>Heavenly chip secret</b> upgrade in a run, random drops are <b>5 times more common</b>.<q>Oh! A penny!<br>Oh! A priceless heirloom!<br>Oh! Another penny!</q>',999999999*15,[8,10]);Game.last.pool='prestige';Game.last.parents=['Shimmering veil'];9633new Game.Upgrade('Reinforced membrane','The <b>shimmering veil</b> is more resistant, and has a <b>10% chance</b> not to break. It also gives <b>+10%</b> more CpS.<q>A consistency between jellyfish and cling wrap.</q>',999999999*15,[7,10]);Game.last.pool='prestige';Game.last.parents=['Shimmering veil'];963496359636order=255;9637Game.GrandmaSynergy('Binary grandmas','A digital grandma to transfer more cookies.<br>(See also : boolean grandmas, string grandmas, and not-a-number grandmas, also known as "NaNs".)','Javascript console');96389639order=1400;9640new Game.TieredUpgrade('The JavaScript console for dummies','Javascript consoles are <b>twice</b> as efficient.<q>This should get you started. The first line reads: "To open the javascript console, press-"<br>...the rest of the book is soaked in chocolate milk. If only there was a way to look up this sort of information...</q>','Javascript console',1);9641new Game.TieredUpgrade('64bit arrays','Javascript consoles are <b>twice</b> as efficient.<q>A long-form variable type to pack your cookies much more efficiently.</q>','Javascript console',2);9642new Game.TieredUpgrade('Stack overflow','Javascript consoles are <b>twice</b> as efficient.<q>This is really bad! You probably forgot to close a loop somewhere and now your programs are going crazy! The rest of your engineers seem really excited about it somehow. How could a software mishap like a stack overflow possibly ever help anyone?</q>','Javascript console',3);9643new Game.TieredUpgrade('Enterprise compiler','Javascript consoles are <b>twice</b> as efficient.<q>This bespoke javascript compiler took your team years of development and billions in research, but it should let you execute (certain) functions (up to) 2% faster (in optimal circumstances).</q>','Javascript console',4);9644new Game.TieredUpgrade('Syntactic sugar','Javascript consoles are <b>twice</b> as efficient.<q>Tastier code for tastier cookies.</q>','Javascript console',5);9645new Game.TieredUpgrade('A nice cup of coffee','Javascript consoles are <b>twice</b> as efficient.<q>All this nerd stuff has you exhausted. You make yourself a nice cup of coffee, brewed with roasted beans from some far-away island. You may have been working a bit too hard though - the cup of coffee starts talking to you, insisting that it is NOT javascript.</q>','Javascript console',6);9646new Game.TieredUpgrade('Just-in-time baking','Javascript consoles are <b>twice</b> as efficient.<q>A new method of preparing cookies; they bake themselves right in front of the customers before eating, leaving your kitchens mess-free.</q>','Javascript console',7);9647new Game.TieredUpgrade('cookies++','Javascript consoles are <b>twice</b> as efficient.<q>Your very own cookie-themed programming language, elegantly named after its most interesting ability - increasing the "cookies" variable by 1.</q>','Javascript console',8);9648new Game.TieredUpgrade('Software updates','Javascript consoles are <b>twice</b> as efficient.<q>This is grand news - someone\'s finally figured out the Wifi password, and your newfound internet connection seems to have triggered a whole lot of software updates! Your browsers, drivers and plugins all received a fresh coat of paint, and your javascript version has been updated to the latest ECMAScript specification. It\'s really too bad thousands had to die due to some deprecated function in your neurotoxin ventilation code, but I guess that\'s progress for you.</q>','Javascript console',9);9649new Game.TieredUpgrade('Game.Loop','Javascript consoles are <b>twice</b> as efficient.<q>You\'re not quite sure what to make of this. What does it mean? What does it do? Who would leave something like that just laying around here? Try asking again in 1/30th of a second.</q>','Javascript console',10);9650new Game.TieredUpgrade('eval()','Javascript consoles are <b>twice</b> as efficient.<q>It is said that this simple function holds the key to the universe, and that whosoever masters it may shape reality to their will.<br>Good thing you have no idea how it works. Makes for a neat plaque on your wall, though.</q>','Javascript console',11);96519652order=5000;9653Game.SynergyUpgrade('Script grannies','<q>Armies of energy drink-fueled grandmas ready to hack into the cyberspace for renegade e-cookies.</q>','Javascript console','Grandma','synergy1');9654Game.SynergyUpgrade('Tombola computing','','Javascript console','Chancemaker','synergy2');9655Game.last.descFunc=function(){9656Math.seedrandom(Game.seed+'-tombolacomputing');9657var str='(Your ticket reads '+Math.floor(Math.random()*100)+' '+Math.floor(Math.random()*100)+' '+Math.floor(Math.random()*100)+' '+Math.floor(Math.random()*100)+', entitling you to '+choose([Math.floor(Math.random()*5+2)+' lines of javascript','one free use of Math.random()','one qubit, whatever that is','one half-eaten cookie','a brand new vacuum cleaner','most of one room-temperature cup of orange soda','one really good sandwich','one handful of pocket lint','someone\'s mostly clean hairpiece','a trip to a fancy restaurant','the knowledge of those numbers','a furtive glance at the news ticker','another ticket, half-price','all-you-can-eat moldy bread','one lifetime supply of oxygen','the color '+choose['red','orange','yellow','green','blue','purple','black','white','gray','brown','pink','teal'],'increased intellect for a limited time','an ancient runesword','the throne of a far-away country','the position of Mafia capo. Good luck','one free time-travel week-end','something beautiful','the deed to some oil well','one hamburger made out of the animal, plant, or person of your choice','the last surviving '+choose['dodo bird','thylacine','unicorn','dinosaur','neanderthal'],'a deep feeling of accomplishment','a fleeting tinge of entertainment','a vague sense of unease','deep existential dread','one extra week added to your lifespan','breathe manually','blink right here and now','one meeting with any famous person, living or dead, in your next dream','one very nice dream','a wacky sound effect','45 seconds of moral flexibility','hundreds and thousands, also known as "sprinkles"','one circle, triangle, square or other simple geometric shape, of average dimensions','just this extra bit of randomness','the extra push you needed to turn your life around','a good fright','one secret superpower','a better luck next time','an irrational phobia of tombola tickets','one whole spider','an increased sense of self-worth and determination','inner peace','one double-XP week-end in the MMORPG of your choice','a little piece of the universe, represented by the trillions of atoms that make up this very ticket','food poisoning','the Moon! Well, conceptually','a new car, baby','a new catchphrase','an intrusive thought of your choice','- ...aw man, it just cuts off there','the director spot for the next big hit movie','really good-looking calves','one genuine pirate golden doubloon','"treasure and riches", or something','one boat, sunken','baby shoes, never worn','direct lineage to some King or Queen','innate knowledge of a dead language you\'ll never encounter','the melody of a song you don\'t know the words to','white noise','mild physical impairment','a new pair of lips','things, and such','one popular expression bearing your name','one typo','one get-out-of-jail-free card','the rest of your life... for now','one polite huff','a condescending stare','one cursed monkey paw','true love, probably','an interesting factoid about the animal, country, TV show or celebrity of your choice','a pop culture reference','minutes of fun','the etymology of the word "tombola" - it\'s Italian for "a tumble"','nothing. You lost, sorry'])+'.)';9658Math.seedrandom();9659return this.desc+'<q>Like quantum computing, but more fun.<br>'+str+'</q>';9660};96619662order=10020;9663Game.NewUpgradeCookie({name:'Kruidnoten',desc:'A festive dutch favorite; tiny cinnamony bites sometimes coated in chocolate. The name translates roughly to "kruidnoten".',icon:[30,3],power: 5,price: getCookiePrice(22)});9664Game.NewUpgradeCookie({name:'Marie biscuits',desc:'Pleasantly round, smoothly buttery, subtly vanilla-flavored, ornately embossed, each ridge represents a person Marie killed in prison.',icon:[30,4],power: 5,price: getCookiePrice(23)});9665Game.NewUpgradeCookie({name:'Meringue cookies',desc:'Probably the most exciting thing you can make out of egg whites. Also called forgotten cookies, due to the recipe being once lost in a sealed mystical vault for 10,000 years.',icon:[31,4],power: 5,price: getCookiePrice(24)});96669667order=10060;9668Game.NewUpgradeCookie({name:'Pizza',desc:'What is a pizza if not a large, chewy cookie, frosted with a rather exuberant tomato & cheese icing? Not a cookie, that\'s what.',icon:[31,9],require:'Box of not cookies', power:5,price: Math.pow(10,44)});96699670order=10050;9671Game.NewUpgradeCookie({name:'Crackers',desc:'These are the non-flavored kind with no salt added. Really just a judgement-free wheat square begging to have bits of ham and spreadable cheese piled onto it, its main contribution being "crunchy".',icon:[30,9],require:'Box of maybe cookies', power:4,price: Math.pow(10,45)});96729673order=10030;9674Game.NewUpgradeCookie({name:'Havabreaks',desc:'You can snap the sections neatly or just bite into the whole thing like some kind of lunatic. Some oversea countries manufacture these in hundreds of unique flavors, such as green tea, lobster bisque, and dark chocolate.',icon:[31,3],require:'Box of brand biscuits',power: 2, price: 999999999999999999999999999*5});96759676order=20000;9677new Game.Upgrade('Kitten executives','You gain <b>more CpS</b> the more milk you have.<q>ready to execute whatever and whoever you\'d like, sir</q>',900000000000000000000000000000000000000000000,Game.GetIcon('Kitten',13));Game.last.kitten=1;Game.MakeTiered(Game.last,13,18);967896799680order=10020;9681Game.NewUpgradeCookie({name:'Chai tea cookies',desc:'Not exactly Captain Picard\'s favorite, but I mean, these will do in a pinch.',icon:[23,32],power: 5,price: getCookiePrice(4)+5});Game.last.order=10020.5685;96829683Game.NewUpgradeCookie({name:'Yogurt cookies',desc:'Augmented by the wonders of dairy, these cookies are light and fluffy and just one more thing for the lactose-intolerant to avoid.<br>Truly for the cultured among us.',icon:[24,32],power: 5,price: getCookiePrice(25)});9684Game.NewUpgradeCookie({name:'Thumbprint cookies',desc:'Filled with jam and sometimes served in little paper cups. No longer admissible as biometric evidence in court. We\'re not having a repeat of that whole mess.',icon:[25,32],power: 5,price: getCookiePrice(26)});9685Game.NewUpgradeCookie({name:'Pizzelle',desc:'Thin, crisp waffle cookies baked in a bespoke iron following an ancient Italian recipe.<br>These cookies have been around for a long, long time.<br>These cookies have seen things.',icon:[26,32],power: 5,price: getCookiePrice(27)});96869687order=10030;9688Game.NewUpgradeCookie({name:'Zilla wafers',desc:'Popular vanilla-flavored biscuits that somehow keep ending up in banana pudding.<br>Themed after a beloved radioactive prehistoric monster, for some reason.',icon:[22,32],require:'Box of brand biscuits',power: 2, price: 999999999999999999999999999999*5});9689Game.NewUpgradeCookie({name:'Dim Dams',desc:'Two biscuits joined by chocolate and coated in even more chocolate.<br>You wonder - which one is the dim, and which one is the dam?',icon:[31,10],require:'Box of brand biscuits',power: 2, price: 999999999999999999999999999999*5});96909691order=10060;9692Game.NewUpgradeCookie({name:'Candy',desc:'There are two pillars to the world of sweets : pastries, of course - and candy.<br>You could make a whole new game just about these, but for now, please enjoy these assorted generic candies.',icon:[30,10],require:'Box of not cookies', power:5,price: Math.pow(10,46)});969396949695order=19000;9696new Game.TieredUpgrade('Fortune #001','Cursors are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>Fingers are not the only thing you can count on.</q>','Cursor','fortune');9697new Game.TieredUpgrade('Fortune #002','Grandmas are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>A wrinkle is a crack in a mundane facade.</q>','Grandma','fortune');9698new Game.TieredUpgrade('Fortune #003','Farms are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>The seeds of tomorrow already lie within the seeds of today.</q>','Farm','fortune');9699new Game.TieredUpgrade('Fortune #004','Mines are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>Riches from deep under elevate you all the same.</q>','Mine','fortune');9700new Game.TieredUpgrade('Fortune #005','Factories are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>True worth is not in what you find, but in what you make.</q>','Factory','fortune');9701new Game.TieredUpgrade('Fortune #006','Banks are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>The value of money means nothing to a pocket.</q>','Bank','fortune');9702new Game.TieredUpgrade('Fortune #007','Temples are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>Not all guides deserve worship.</q>','Temple','fortune');9703new Game.TieredUpgrade('Fortune #008','Wizard towers are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>Magic is about two things - showmanship, and rabbits.</q>','Wizard tower','fortune');9704new Game.TieredUpgrade('Fortune #009','Shipments are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>Every mile travelled expands the mind by just as much.</q>','Shipment','fortune');9705new Game.TieredUpgrade('Fortune #010','Alchemy labs are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>Don\'t get used to yourself. You\'re gonna have to change.</q>','Alchemy lab','fortune');9706new Game.TieredUpgrade('Fortune #011','Portals are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>Every doorway is a gamble. Tread with care.</q>','Portal','fortune');9707new Game.TieredUpgrade('Fortune #012','Time machines are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>Do your future self a favor; they\'ll thank you for it.</q>','Time machine','fortune');9708new Game.TieredUpgrade('Fortune #013','Antimatter condensers are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>The world is made of what we put into it.</q>','Antimatter condenser','fortune');9709new Game.TieredUpgrade('Fortune #014','Prisms are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>Staring at a dazzling light can blind you back to darkness.</q>','Prism','fortune');9710new Game.TieredUpgrade('Fortune #015','Chancemakers are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>Don\'t leave to blind chance what you could accomplish with deaf skill.</q>','Chancemaker','fortune');9711new Game.TieredUpgrade('Fortune #016','Fractal engines are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>It\'s good to see yourself in others. Remember to see yourself in yourself, too.</q>','Fractal engine','fortune');9712new Game.TieredUpgrade('Fortune #017','Javascript consoles are <b>7%</b> more efficient and <b>7%</b> cheaper.<q>If things aren\'t working out for you, rewrite the rules.</q>','Javascript console','fortune');971397149715order=19100;9716//note : price for these capped to base price OR 1 day of unbuffed CpS9717new Game.Upgrade('Fortune #100','Upgrades and buildings cost <b>-1%</b>; you gain <b>+1%</b> CpS.<q>True wealth is counted in gifts.</q>',9718Game.Tiers['fortune'].price*100000,[0,0]);Game.MakeTiered(Game.last,'fortune',10);9719Game.last.priceFunc=function(me){return Math.min(me.basePrice,Game.unbuffedCps*60*60*24);}9720new Game.Upgrade('Fortune #101','You gain <b>+7%</b> CpS.<q>Some people dream of fortunes; others dream of cookies.</q>',Game.Tiers['fortune'].price*100000000,[0,0]);Game.MakeTiered(Game.last,'fortune',10);9721Game.last.priceFunc=function(me){return Math.min(me.basePrice,Game.unbuffedCps*60*60*24);}9722new Game.Upgrade('Fortune #102','You gain <b>+1%</b> of your regular CpS while the game is closed <small>(provided you have the Twin Gates of Transcendence heavenly upgrade)</small>.<q>Help, I\'m trapped in a browser game!</q>',Game.Tiers['fortune'].price*100000000000,[0,0]);Game.MakeTiered(Game.last,'fortune',10);9723Game.last.priceFunc=function(me){return Math.min(me.basePrice,Game.unbuffedCps*60*60*24);}9724new Game.Upgrade('Fortune #103','You gain <b>more CpS</b> the more milk you have.<q>Don\'t believe the superstitions; all cats are good luck.</q>',Game.Tiers['fortune'].price*100000000000000,[0,0]);Game.MakeTiered(Game.last,'fortune',18);9725Game.last.priceFunc=function(me){return Math.min(me.basePrice,Game.unbuffedCps*60*60*24);}9726new Game.Upgrade('Fortune #104','Clicking gains <b>+1% of your CpS</b>.<q>Remember to stay in touch.</q>',Game.Tiers['fortune'].price*100000000000,[0,0]);Game.MakeTiered(Game.last,'fortune',11);9727Game.last.priceFunc=function(me){return Math.min(me.basePrice,Game.unbuffedCps*60*60*24);}97289729new Game.Upgrade('Fortune cookies','The news ticker may occasionally have <b>fortunes</b>, which may be clicked for something good.<q>These don\'t taste all that great but that\'s not really the point, is it?</q>',77777777777,[29,8]);Game.last.pool='prestige';Game.last.parents=['Distilled essence of redoubled luck'];973097319732//end of upgrades97339734Game.seasons={9735'christmas':{name:'Christmas',start:'Christmas season has started!',over:'Christmas season is over.',trigger:'Festive biscuit'},9736'valentines':{name:'Valentine\'s day',start:'Valentine\'s day has started!',over:'Valentine\'s day is over.',trigger:'Lovesick biscuit'},9737'fools':{name:'Business day',start:'Business day has started!',over:'Business day is over.',trigger:'Fool\'s biscuit'},9738'easter':{name:'Easter',start:'Easter season has started!',over:'Easter season is over.',trigger:'Bunny biscuit'},9739'halloween':{name:'Halloween',start:'Halloween has started!',over:'Halloween is over.',trigger:'Ghostly biscuit'}9740};97419742Game.listTinyOwnedUpgrades=function(arr)9743{9744var str='';9745for (var i=0;i<arr.length;i++)9746{9747if (Game.Has(arr[i]))9748{9749var it=Game.Upgrades[arr[i]];9750str+='<div class="icon" style="vertical-align:middle;display:inline-block;'+(it.icon[2]?'background-image:url('+it.icon[2]+');':'')+'background-position:'+(-it.icon[0]*48)+'px '+(-it.icon[1]*48)+'px;transform:scale(0.5);margin:-16px;"></div>';9751}9752}9753return str;9754}97559756Game.santaDrops=['Increased merriness','Improved jolliness','A lump of coal','An itchy sweater','Reindeer baking grounds','Weighted sleighs','Ho ho ho-flavored frosting','Season savings','Toy workshop','Naughty list','Santa\'s bottomless bag','Santa\'s helpers','Santa\'s legacy','Santa\'s milk and cookies'];97579758Game.GetHowManySantaDrops=function()9759{9760var num=0;9761for (var i in Game.santaDrops) {if (Game.Has(Game.santaDrops[i])) num++;}9762return num;9763}97649765Game.reindeerDrops=['Christmas tree biscuits','Snowflake biscuits','Snowman biscuits','Holly biscuits','Candy cane biscuits','Bell biscuits','Present biscuits'];9766Game.GetHowManyReindeerDrops=function()9767{9768var num=0;9769for (var i in Game.reindeerDrops) {if (Game.Has(Game.reindeerDrops[i])) num++;}9770return num;9771}9772/*for (var i in Game.santaDrops)9773{9774Game.Upgrades[Game.santaDrops[i]].descFunc=function(){return '<div style="text-align:center;">You currently own <b>'+Game.GetHowManySantaDrops()+'/'+Game.santaDrops.length+'</b> of Santa\'s gifts.</div><div class="line"></div>'+this.desc;};9775}*/97769777Game.seasonDrops=Game.heartDrops.concat(Game.halloweenDrops).concat(Game.easterEggs).concat(Game.santaDrops).concat(Game.reindeerDrops);97789779Game.saySeasonSwitchUses=function()9780{9781if (Game.seasonUses==0) return 'You haven\'t switched seasons this ascension yet.';9782return 'You\'ve switched seasons <b>'+(Game.seasonUses==1?'once':Game.seasonUses==2?'twice':(Game.seasonUses+' times'))+'</b> this ascension.';9783}9784Game.Upgrades['Festive biscuit'].descFunc=function(){return '<div style="text-align:center;">'+Game.listTinyOwnedUpgrades(Game.santaDrops)+'<br><br>You\'ve purchased <b>'+Game.GetHowManySantaDrops()+'/'+Game.santaDrops.length+'</b> of Santa\'s gifts.<div class="line"></div>'+Game.listTinyOwnedUpgrades(Game.reindeerDrops)+'<br><br>You\'ve purchased <b>'+Game.GetHowManyReindeerDrops()+'/'+Game.reindeerDrops.length+'</b> reindeer cookies.<div class="line"></div>'+Game.saySeasonSwitchUses()+'<div class="line"></div></div>'+this.desc;};9785Game.Upgrades['Bunny biscuit'].descFunc=function(){return '<div style="text-align:center;">'+Game.listTinyOwnedUpgrades(Game.easterEggs)+'<br><br>You\'ve purchased <b>'+Game.GetHowManyEggs()+'/'+Game.easterEggs.length+'</b> eggs.<div class="line"></div>'+Game.saySeasonSwitchUses()+'<div class="line"></div></div>'+this.desc;};9786Game.Upgrades['Ghostly biscuit'].descFunc=function(){return '<div style="text-align:center;">'+Game.listTinyOwnedUpgrades(Game.halloweenDrops)+'<br><br>You\'ve purchased <b>'+Game.GetHowManyHalloweenDrops()+'/'+Game.halloweenDrops.length+'</b> halloween cookies.<div class="line"></div>'+Game.saySeasonSwitchUses()+'<div class="line"></div></div>'+this.desc;};9787Game.Upgrades['Lovesick biscuit'].descFunc=function(){return '<div style="text-align:center;">'+Game.listTinyOwnedUpgrades(Game.heartDrops)+'<br><br>You\'ve purchased <b>'+Game.GetHowManyHeartDrops()+'/'+Game.heartDrops.length+'</b> heart biscuits.<div class="line"></div>'+Game.saySeasonSwitchUses()+'<div class="line"></div></div>'+this.desc;};9788Game.Upgrades['Fool\'s biscuit'].descFunc=function(){return '<div style="text-align:center;">'+Game.saySeasonSwitchUses()+'<div class="line"></div></div>'+this.desc;};97899790Game.computeSeasonPrices=function()9791{9792for (var i in Game.seasons)9793{9794Game.seasons[i].triggerUpgrade.priceFunc=function(){9795var m=1;9796if (Game.hasGod)9797{9798var godLvl=Game.hasGod('seasons');9799if (godLvl==1) m*=2;9800else if (godLvl==2) m*=1.50;9801else if (godLvl==3) m*=1.25;9802}9803//return Game.seasonTriggerBasePrice*Math.pow(2,Game.seasonUses)*m;9804//return Game.cookiesPs*60*Math.pow(1.5,Game.seasonUses)*m;9805return Game.seasonTriggerBasePrice+Game.unbuffedCps*60*Math.pow(1.5,Game.seasonUses)*m;9806}9807}9808}9809Game.computeSeasons=function()9810{9811for (var i in Game.seasons)9812{9813var me=Game.Upgrades[Game.seasons[i].trigger];9814Game.seasons[i].triggerUpgrade=me;9815me.pool='toggle';9816me.buyFunction=function()9817{9818Game.seasonUses+=1;9819Game.computeSeasonPrices();9820//Game.Lock(this.name);9821for (var i in Game.seasons)9822{9823var me=Game.Upgrades[Game.seasons[i].trigger];9824if (me.name!=this.name) {Game.Lock(me.name);Game.Unlock(me.name);}9825}9826if (Game.season!='' && Game.season!=this.season)9827{9828var str=Game.seasons[Game.season].over+'<div class="line"></div>';9829if (Game.prefs.popups) Game.Popup(str);9830else Game.Notify(str,'',Game.seasons[Game.season].triggerUpgrade.icon,4);9831}9832Game.season=this.season;9833Game.seasonT=Game.getSeasonDuration();9834Game.storeToRefresh=1;9835Game.upgradesToRebuild=1;9836Game.Objects['Grandma'].redraw();9837var str=Game.seasons[this.season].start+'<div class="line"></div>';9838if (Game.prefs.popups) Game.Popup(str);9839else Game.Notify(str,'',this.icon,4);9840}98419842me.clickFunction=function(me){return function()9843{9844//undo season9845if (me.bought && Game.season && me==Game.seasons[Game.season].triggerUpgrade)9846{9847me.lose();9848var str=Game.seasons[Game.season].over;9849if (Game.prefs.popups) Game.Popup(str);9850else Game.Notify(str,'',Game.seasons[Game.season].triggerUpgrade.icon);9851if (Game.Has('Season switcher')) {Game.Unlock(Game.seasons[Game.season].trigger);Game.seasons[Game.season].triggerUpgrade.bought=0;}98529853Game.upgradesToRebuild=1;9854Game.recalculateGains=1;9855Game.season=Game.baseSeason;9856Game.seasonT=-1;9857PlaySound('snd/tick.mp3');9858return false;9859}9860else return true;9861};}(me);98629863me.displayFuncWhenOwned=function(){return '<div style="text-align:center;">Time remaining :<br><b>'+(Game.Has('Eternal seasons')?'forever':Game.sayTime(Game.seasonT,-1))+'</b><div style="font-size:80%;">(Click again to cancel season)</div></div>';}9864me.timerDisplay=function(upgrade){return function(){if (!Game.Upgrades[upgrade.name].bought || Game.Has('Eternal seasons')) return -1; else return 1-Game.seasonT/Game.getSeasonDuration();}}(me);98659866}9867}9868Game.getSeasonDuration=function(){return Game.fps*60*60*24;}9869Game.computeSeasons();98709871//alert untiered building upgrades9872for (var i in Game.Upgrades)9873{9874var me=Game.Upgrades[i];9875if (me.order>=200 && me.order<2000 && !me.tier && me.name.indexOf('grandma')==-1 && me.pool!='prestige') console.log(me.name+' has no tier.');9876}98779878Game.UpgradesByPool=[];9879for (var i in Game.Upgrades)9880{9881if (!Game.UpgradesByPool[Game.Upgrades[i].pool]) Game.UpgradesByPool[Game.Upgrades[i].pool]=[];9882Game.UpgradesByPool[Game.Upgrades[i].pool].push(Game.Upgrades[i]);9883}98849885Game.PrestigeUpgrades=[];9886for (var i in Game.Upgrades)9887{9888if (Game.Upgrades[i].pool=='prestige' || Game.Upgrades[i].pool=='prestigeDecor')9889{9890Game.PrestigeUpgrades.push(Game.Upgrades[i]);9891Game.Upgrades[i].posX=0;9892Game.Upgrades[i].posY=0;9893if (Game.Upgrades[i].parents.length==0 && Game.Upgrades[i].name!='Legacy') Game.Upgrades[i].parents=['Legacy'];9894Game.Upgrades[i].parents=Game.Upgrades[i].parents||[-1];9895for (var ii in Game.Upgrades[i].parents) {if (Game.Upgrades[i].parents[ii]!=-1) Game.Upgrades[i].parents[ii]=Game.Upgrades[Game.Upgrades[i].parents[ii]];}9896}9897}98989899Game.goldenCookieUpgrades=['Get lucky','Lucky day','Serendipity','Heavenly luck','Lasting fortune','Decisive fate','Lucky digit','Lucky number','Lucky payout','Golden goose egg'];99009901Game.cookieUpgrades=[];9902for (var i in Game.Upgrades)9903{9904var me=Game.Upgrades[i];9905if ((me.pool=='cookie' || me.pseudoCookie)) Game.cookieUpgrades.push(me);9906if (me.tier) Game.Tiers[me.tier].upgrades.push(me);9907}9908for (var i in Game.UnlockAt){Game.Upgrades[Game.UnlockAt[i].name].unlockAt=Game.UnlockAt[i];}9909for (var i in Game.Upgrades){if (Game.Upgrades[i].pool=='prestige') Game.Upgrades[i].order=Game.Upgrades[i].id;}99109911/*var oldPrestigePrices={"Chimera":5764801,"Synergies Vol. I":2525,"Synergies Vol. II":252525,"Label printer":9999};9912for (var i in oldPrestigePrices){Game.Upgrades[i].basePrice=oldPrestigePrices[i];}*/99139914Game.UpgradePositions={141:[176,-66],181:[-555,-93],253:[-272,-231],254:[-99,-294],255:[-193,-279],264:[48,123],265:[133,154],266:[223,166],267:[305,137],268:[382,85],269:[-640,42],270:[-614,-268],271:[-728,-120],272:[-688,-205],273:[-711,-31],274:[270,-328],275:[317,-439],276:[333,-556],277:[334,-676],278:[333,-796],279:[328,-922],280:[303,-1040],281:[194,-230],282:[-265,212],283:[-321,297],284:[-322,406],285:[-243,501],286:[-403,501],287:[-314,606],288:[-312,-374],289:[-375,-502],290:[-206,-476],291:[453,-745],292:[-375,-651],293:[-399,-794],323:[-86,120],325:[192,-1127],326:[-328,-158],327:[-192,290],328:[-3,237],329:[92,376],353:[121,-326],354:[77,-436],355:[64,-548],356:[57,-673],357:[52,-793],358:[58,-924],359:[82,-1043],360:[-188,408],362:[158,289],363:[-30,-30],364:[-232,-730],365:[-77,349],368:[-82,-532],393:[196,-714],394:[197,-964],395:[-143,-140],396:[-264,-889],397:[-69,563],408:[-204,-1036],409:[-72,-1152],410:[-70,-1328],411:[-388,137],412:[-470,253],413:[-482,389],449:[-367,-1113],450:[-334,-1214],451:[-278,-1303],495:[-402,-966],496:[200,49],505:[-545,-570],520:[-279,-8],537:[-907,-131],539:[-508,-1270],540:[-629,-1291],541:[-594,-1186],542:[-548,-1374],561:[300,-17],562:[52,646],591:[154,744],592:[180,608],643:[-121,710],};99159916for (var i in Game.UpgradePositions) {Game.UpgradesById[i].posX=Game.UpgradePositions[i][0];Game.UpgradesById[i].posY=Game.UpgradePositions[i][1];}991799189919/*=====================================================================================9920ACHIEVEMENTS9921=======================================================================================*/9922Game.Achievements=[];9923Game.AchievementsById=[];9924Game.AchievementsN=0;9925Game.AchievementsOwned=0;9926Game.Achievement=function(name,desc,icon)9927{9928this.id=Game.AchievementsN;9929this.name=name;9930this.desc=desc;9931this.baseDesc=this.desc;9932this.desc=BeautifyInText(this.baseDesc);9933this.icon=icon;9934this.won=0;9935this.disabled=0;9936this.order=this.id;9937if (order) this.order=order+this.id*0.001;9938this.pool='normal';9939this.vanilla=Game.vanilla;9940this.type='achievement';99419942this.click=function()9943{9944if (this.clickFunction) this.clickFunction();9945}9946Game.last=this;9947Game.Achievements[this.name]=this;9948Game.AchievementsById[this.id]=this;9949Game.AchievementsN++;9950return this;9951}99529953Game.Win=function(what)9954{9955if (typeof what==='string')9956{9957if (Game.Achievements[what])9958{9959if (Game.Achievements[what].won==0)9960{9961var name=Game.Achievements[what].shortName?Game.Achievements[what].shortName:Game.Achievements[what].name;9962Game.Achievements[what].won=1;9963if (Game.prefs.popups) Game.Popup('Achievement unlocked :<br>'+name);9964else Game.Notify('Achievement unlocked','<div class="title" style="font-size:18px;margin-top:-2px;">'+name+'</div>',Game.Achievements[what].icon);9965if (Game.CountsAsAchievementOwned(Game.Achievements[what].pool)) Game.AchievementsOwned++;9966Game.recalculateGains=1;9967}9968}9969}9970else {for (var i in what) {Game.Win(what[i]);}}9971}9972Game.RemoveAchiev=function(what)9973{9974if (Game.Achievements[what])9975{9976if (Game.Achievements[what].won==1)9977{9978Game.Achievements[what].won=0;9979if (Game.CountsAsAchievementOwned(Game.Achievements[what].pool)) Game.AchievementsOwned--;9980Game.recalculateGains=1;9981}9982}9983}9984Game.Achievement.prototype.toggle=function()//cheating only9985{9986if (!this.won)9987{9988Game.Win(this.name);9989}9990else9991{9992Game.RemoveAchiev(this.name);9993}9994if (Game.onMenu=='stats') Game.UpdateMenu();9995}99969997Game.CountsAsAchievementOwned=function(pool)9998{9999if (pool=='' || pool=='normal') return true; else return false;10000}1000110002Game.HasAchiev=function(what)10003{10004return (Game.Achievements[what]?Game.Achievements[what].won:0);10005}1000610007Game.TieredAchievement=function(name,desc,building,tier)10008{10009var achiev=new Game.Achievement(name,desc,Game.GetIcon(building,tier));10010Game.SetTier(building,tier);10011return achiev;10012}1001310014Game.ProductionAchievement=function(name,building,tier,q,mult)10015{10016var building=Game.Objects[building];10017var icon=[building.iconColumn,22];10018var n=12+building.n+(mult||0);10019if (tier==2) {icon[1]=23;n+=7;}10020else if (tier==3) {icon[1]=24;n+=14;}10021var pow=Math.pow(10,n);10022var achiev=new Game.Achievement(name,'Make <b>'+Beautify(pow)+'</b> cookies just from '+building.plural+'.'+(q?'<q>'+q+'</q>':''),icon);10023building.productionAchievs.push({pow:pow,achiev:achiev});10024return achiev;10025}1002610027Game.thresholdIcons=[0,1,2,3,4,5,6,7,8,9,10,11,18,19,20,21,22,23,24,25,26,27,28,29,21,22,23,24,25,26,27,28,29,21,22,23,24,25,26,27,28,29];10028Game.BankAchievements=[];10029Game.BankAchievement=function(name)10030{10031var threshold=Math.pow(10,Math.floor(Game.BankAchievements.length*1.5+2));10032if (Game.BankAchievements.length==0) threshold=1;10033var achiev=new Game.Achievement(name,'Bake <b>'+Beautify(threshold)+'</b> cookie'+(threshold==1?'':'s')+' in one ascension.',[Game.thresholdIcons[Game.BankAchievements.length],(Game.BankAchievements.length>32?1:Game.BankAchievements.length>23?2:5)]);10034achiev.threshold=threshold;10035achiev.order=100+Game.BankAchievements.length*0.01;10036Game.BankAchievements.push(achiev);10037return achiev;10038}10039Game.CpsAchievements=[];10040Game.CpsAchievement=function(name)10041{10042var threshold=Math.pow(10,Math.floor(Game.CpsAchievements.length*1.2));10043//if (Game.CpsAchievements.length==0) threshold=1;10044var achiev=new Game.Achievement(name,'Bake <b>'+Beautify(threshold)+'</b> cookie'+(threshold==1?'':'s')+' per second.',[Game.thresholdIcons[Game.CpsAchievements.length],(Game.CpsAchievements.length>32?1:Game.CpsAchievements.length>23?2:5)]);10045achiev.threshold=threshold;10046achiev.order=200+Game.CpsAchievements.length*0.01;10047Game.CpsAchievements.push(achiev);10048return achiev;10049}1005010051//define achievements10052//WARNING : do NOT add new achievements in between, this breaks the saves. Add them at the end !1005310054var order=0;//this is used to set the order in which the items are listed1005510056Game.BankAchievement('Wake and bake');10057Game.BankAchievement('Making some dough');10058Game.BankAchievement('So baked right now');10059Game.BankAchievement('Fledgling bakery');10060Game.BankAchievement('Affluent bakery');10061Game.BankAchievement('World-famous bakery');10062Game.BankAchievement('Cosmic bakery');10063Game.BankAchievement('Galactic bakery');10064Game.BankAchievement('Universal bakery');10065Game.BankAchievement('Timeless bakery');10066Game.BankAchievement('Infinite bakery');10067Game.BankAchievement('Immortal bakery');10068Game.BankAchievement('Don\'t stop me now');10069Game.BankAchievement('You can stop now');10070Game.BankAchievement('Cookies all the way down');10071Game.BankAchievement('Overdose');1007210073Game.CpsAchievement('Casual baking');10074Game.CpsAchievement('Hardcore baking');10075Game.CpsAchievement('Steady tasty stream');10076Game.CpsAchievement('Cookie monster');10077Game.CpsAchievement('Mass producer');10078Game.CpsAchievement('Cookie vortex');10079Game.CpsAchievement('Cookie pulsar');10080Game.CpsAchievement('Cookie quasar');10081Game.CpsAchievement('Oh hey, you\'re still here');10082Game.CpsAchievement('Let\'s never bake again');1008310084order=30010;10085new Game.Achievement('Sacrifice','Ascend with <b>1 million</b> cookies baked.<q>Easy come, easy go.</q>',[11,6]);10086new Game.Achievement('Oblivion','Ascend with <b>1 billion</b> cookies baked.<q>Back to square one.</q>',[11,6]);10087new Game.Achievement('From scratch','Ascend with <b>1 trillion</b> cookies baked.<q>It\'s been fun.</q>',[11,6]);1008810089order=11010;10090new Game.Achievement('Neverclick','Make <b>1 million</b> cookies by only having clicked <b>15 times</b>.',[12,0]);//Game.last.pool='shadow';10091order=1000;10092new Game.Achievement('Clicktastic','Make <b>1,000</b> cookies from clicking.',[11,0]);10093new Game.Achievement('Clickathlon','Make <b>100,000</b> cookies from clicking.',[11,1]);10094new Game.Achievement('Clickolympics','Make <b>10,000,000</b> cookies from clicking.',[11,2]);10095new Game.Achievement('Clickorama','Make <b>1,000,000,000</b> cookies from clicking.',[11,13]);1009610097order=1050;10098new Game.Achievement('Click','Have <b>1</b> cursor.',[0,0]);10099new Game.Achievement('Double-click','Have <b>2</b> cursors.',[0,6]);10100new Game.Achievement('Mouse wheel','Have <b>50</b> cursors.',[1,6]);10101new Game.Achievement('Of Mice and Men','Have <b>100</b> cursors.',[0,1]);10102new Game.Achievement('The Digital','Have <b>200</b> cursors.',[0,2]);1010310104order=1100;10105new Game.Achievement('Just wrong','Sell a grandma.<q>I thought you loved me.</q>',[10,9]);10106Game.TieredAchievement('Grandma\'s cookies','Have <b>1</b> grandma.','Grandma',1);10107Game.TieredAchievement('Sloppy kisses','Have <b>50</b> grandmas.','Grandma',2);10108Game.TieredAchievement('Retirement home','Have <b>100</b> grandmas.','Grandma',3);1010910110order=1200;10111Game.TieredAchievement('My first farm','Have <b>1</b> farm.','Farm',1);10112Game.TieredAchievement('Reap what you sow','Have <b>50</b> farms.','Farm',2);10113Game.TieredAchievement('Farm ill','Have <b>100</b> farms.','Farm',3);1011410115order=1400;10116Game.TieredAchievement('Production chain','Have <b>1</b> factory.','Factory',1);10117Game.TieredAchievement('Industrial revolution','Have <b>50</b> factories.','Factory',2);10118Game.TieredAchievement('Global warming','Have <b>100</b> factories.','Factory',3);1011910120order=1300;10121Game.TieredAchievement('You know the drill','Have <b>1</b> mine.','Mine',1);10122Game.TieredAchievement('Excavation site','Have <b>50</b> mines.','Mine',2);10123Game.TieredAchievement('Hollow the planet','Have <b>100</b> mines.','Mine',3);1012410125order=1500;10126Game.TieredAchievement('Expedition','Have <b>1</b> shipment.','Shipment',1);10127Game.TieredAchievement('Galactic highway','Have <b>50</b> shipments.','Shipment',2);10128Game.TieredAchievement('Far far away','Have <b>100</b> shipments.','Shipment',3);1012910130order=1600;10131Game.TieredAchievement('Transmutation','Have <b>1</b> alchemy lab.','Alchemy lab',1);10132Game.TieredAchievement('Transmogrification','Have <b>50</b> alchemy labs.','Alchemy lab',2);10133Game.TieredAchievement('Gold member','Have <b>100</b> alchemy labs.','Alchemy lab',3);1013410135order=1700;10136Game.TieredAchievement('A whole new world','Have <b>1</b> portal.','Portal',1);10137Game.TieredAchievement('Now you\'re thinking','Have <b>50</b> portals.','Portal',2);10138Game.TieredAchievement('Dimensional shift','Have <b>100</b> portals.','Portal',3);1013910140order=1800;10141Game.TieredAchievement('Time warp','Have <b>1</b> time machine.','Time machine',1);10142Game.TieredAchievement('Alternate timeline','Have <b>50</b> time machines.','Time machine',2);10143Game.TieredAchievement('Rewriting history','Have <b>100</b> time machines.','Time machine',3);101441014510146order=7000;10147new Game.Achievement('One with everything','Have <b>at least 1</b> of every building.',[2,7]);10148new Game.Achievement('Mathematician','Have at least <b>1 of the most expensive object, 2 of the second-most expensive, 4 of the next</b> and so on (capped at 128).',[23,12]);10149new Game.Achievement('Base 10','Have at least <b>10 of the most expensive object, 20 of the second-most expensive, 30 of the next</b> and so on.',[23,12]);1015010151order=10000;10152new Game.Achievement('Golden cookie','Click a <b>golden cookie</b>.',[10,14]);10153new Game.Achievement('Lucky cookie','Click <b>7 golden cookies</b>.',[22,6]);10154new Game.Achievement('A stroke of luck','Click <b>27 golden cookies</b>.',[23,6]);1015510156order=30200;10157new Game.Achievement('Cheated cookies taste awful','Hack in some cookies.',[10,6]);Game.last.pool='shadow';10158order=11010;10159new Game.Achievement('Uncanny clicker','Click really, really fast.<q>Well I\'ll be!</q>',[12,0]);1016010161order=5000;10162new Game.Achievement('Builder','Own <b>100</b> buildings.',[2,6]);10163new Game.Achievement('Architect','Own <b>500</b> buildings.',[3,6]);10164order=6000;10165new Game.Achievement('Enhancer','Purchase <b>20</b> upgrades.',[9,0]);10166new Game.Achievement('Augmenter','Purchase <b>50</b> upgrades.',[9,1]);1016710168order=11000;10169new Game.Achievement('Cookie-dunker','Dunk the cookie.<q>You did it!</q>',[1,8]);1017010171order=10000;10172new Game.Achievement('Fortune','Click <b>77 golden cookies</b>.<q>You should really go to bed.</q>',[24,6]);10173order=31000;10174new Game.Achievement('True Neverclick','Make <b>1 million</b> cookies with <b>no</b> cookie clicks.<q>This kinda defeats the whole purpose, doesn\'t it?</q>',[12,0]);Game.last.pool='shadow';1017510176order=20000;10177new Game.Achievement('Elder nap','Appease the grandmatriarchs at least <b>once</b>.<q>we<br>are<br>eternal</q>',[8,9]);10178new Game.Achievement('Elder slumber','Appease the grandmatriarchs at least <b>5 times</b>.<q>our mind<br>outlives<br>the universe</q>',[8,9]);1017910180order=1150;10181new Game.Achievement('Elder','Own at least <b>7</b> grandma types.',[10,9]);1018210183order=20000;10184new Game.Achievement('Elder calm','Declare a covenant with the grandmatriarchs.<q>we<br>have<br>fed</q>',[8,9]);1018510186order=5000;10187new Game.Achievement('Engineer','Own <b>1000</b> buildings.',[4,6]);1018810189order=10000;10190new Game.Achievement('Leprechaun','Click <b>777 golden cookies</b>.',[25,6]);10191new Game.Achievement('Black cat\'s paw','Click <b>7777 golden cookies</b>.',[26,6]);1019210193order=30050;10194new Game.Achievement('Nihilism','Ascend with <b>1 quadrillion</b> cookies baked.<q>There are many things<br>that need to be erased</q>',[11,7]);1019510196order=1900;10197Game.TieredAchievement('Antibatter','Have <b>1</b> antimatter condenser.','Antimatter condenser',1);10198Game.TieredAchievement('Quirky quarks','Have <b>50</b> antimatter condensers.','Antimatter condenser',2);10199Game.TieredAchievement('It does matter!','Have <b>100</b> antimatter condensers.','Antimatter condenser',3);1020010201order=6000;10202new Game.Achievement('Upgrader','Purchase <b>100</b> upgrades.',[9,2]);1020310204order=7000;10205new Game.Achievement('Centennial','Have at least <b>100 of everything</b>.',[6,6]);1020610207order=30500;10208new Game.Achievement('Hardcore','Get to <b>1 billion</b> cookies baked with <b>no upgrades purchased</b>.',[12,6]);//Game.last.pool='shadow';1020910210order=30600;10211new Game.Achievement('Speed baking I','Get to <b>1 million</b> cookies baked in <b>35 minutes</b>.',[12,5]);Game.last.pool='shadow';10212new Game.Achievement('Speed baking II','Get to <b>1 million</b> cookies baked in <b>25 minutes</b>.',[13,5]);Game.last.pool='shadow';10213new Game.Achievement('Speed baking III','Get to <b>1 million</b> cookies baked in <b>15 minutes</b>.',[14,5]);Game.last.pool='shadow';102141021510216order=61000;10217var achiev=new Game.Achievement('Getting even with the oven','Defeat the <b>Sentient Furnace</b> in the factory dungeons.',[12,7]);Game.last.pool='dungeon';10218var achiev=new Game.Achievement('Now this is pod-smashing','Defeat the <b>Ascended Baking Pod</b> in the factory dungeons.',[12,7]);Game.last.pool='dungeon';10219var achiev=new Game.Achievement('Chirped out','Find and defeat <b>Chirpy</b>, the dysfunctionning alarm bot.',[13,7]);Game.last.pool='dungeon';10220var achiev=new Game.Achievement('Follow the white rabbit','Find and defeat the elusive <b>sugar bunny</b>.',[14,7]);Game.last.pool='dungeon';1022110222order=1000;10223new Game.Achievement('Clickasmic','Make <b>100,000,000,000</b> cookies from clicking.',[11,14]);1022410225order=1100;10226Game.TieredAchievement('Friend of the ancients','Have <b>150</b> grandmas.','Grandma',4);10227Game.TieredAchievement('Ruler of the ancients','Have <b>200</b> grandmas.','Grandma',5);1022810229order=32000;10230new Game.Achievement('Wholesome','Unlock <b>100%</b> of your heavenly chips power.',[15,7]);1023110232order=33000;10233new Game.Achievement('Just plain lucky','You have <b>1 chance in 500,000</b> every second of earning this achievement.',[15,6]);Game.last.pool='shadow';1023410235order=21000;10236new Game.Achievement('Itchscratcher','Burst <b>1 wrinkler</b>.',[19,8]);10237new Game.Achievement('Wrinklesquisher','Burst <b>50 wrinklers</b>.',[19,8]);10238new Game.Achievement('Moistburster','Burst <b>200 wrinklers</b>.',[19,8]);1023910240order=22000;10241new Game.Achievement('Spooky cookies','Unlock <b>every Halloween-themed cookie</b>.<div class="line"></div>Owning this achievement makes Halloween-themed cookies drop more frequently in future playthroughs.',[12,8]);1024210243order=22100;10244new Game.Achievement('Coming to town','Reach <b>Santa\'s 7th form</b>.',[18,9]);10245new Game.Achievement('All hail Santa','Reach <b>Santa\'s final form</b>.',[19,10]);10246new Game.Achievement('Let it snow','Unlock <b>every Christmas-themed cookie</b>.<div class="line"></div>Owning this achievement makes Christmas-themed cookies drop more frequently in future playthroughs.',[19,9]);10247new Game.Achievement('Oh deer','Pop <b>1 reindeer</b>.',[12,9]);10248new Game.Achievement('Sleigh of hand','Pop <b>50 reindeer</b>.',[12,9]);10249new Game.Achievement('Reindeer sleigher','Pop <b>200 reindeer</b>.',[12,9]);1025010251order=1200;10252Game.TieredAchievement('Perfected agriculture','Have <b>150</b> farms.','Farm',4);10253order=1400;10254Game.TieredAchievement('Ultimate automation','Have <b>150</b> factories.','Factory',4);10255order=1300;10256Game.TieredAchievement('Can you dig it','Have <b>150</b> mines.','Mine',4);10257order=1500;10258Game.TieredAchievement('Type II civilization','Have <b>150</b> shipments.','Shipment',4);10259order=1600;10260Game.TieredAchievement('Gild wars','Have <b>150</b> alchemy labs.','Alchemy lab',4);10261order=1700;10262Game.TieredAchievement('Brain-split','Have <b>150</b> portals.','Portal',4);10263order=1800;10264Game.TieredAchievement('Time duke','Have <b>150</b> time machines.','Time machine',4);10265order=1900;10266Game.TieredAchievement('Molecular maestro','Have <b>150</b> antimatter condensers.','Antimatter condenser',4);1026710268order=2000;10269Game.TieredAchievement('Lone photon','Have <b>1</b> prism.','Prism',1);10270Game.TieredAchievement('Dazzling glimmer','Have <b>50</b> prisms.','Prism',2);10271Game.TieredAchievement('Blinding flash','Have <b>100</b> prisms.','Prism',3);10272Game.TieredAchievement('Unending glow','Have <b>150</b> prisms.','Prism',4);1027310274order=5000;10275new Game.Achievement('Lord of Constructs','Own <b>2000</b> buildings.<q>He saw the vast plains stretching ahead of him, and he said : let there be civilization.</q>',[5,6]);10276order=6000;10277new Game.Achievement('Lord of Progress','Purchase <b>200</b> upgrades.<q>One can always do better. But should you?</q>',[9,14]);10278order=7002;10279new Game.Achievement('Bicentennial','Have at least <b>200 of everything</b>.<q>You crazy person.</q>',[8,6]);1028010281order=22300;10282new Game.Achievement('Lovely cookies','Unlock <b>every Valentine-themed cookie</b>.',[20,3]);1028310284order=7001;10285new Game.Achievement('Centennial and a half','Have at least <b>150 of everything</b>.',[7,6]);1028610287order=11000;10288new Game.Achievement('Tiny cookie','Click the tiny cookie.<q>These aren\'t the cookies<br>you\'re clicking for.</q>',[0,5]);1028910290order=400000;10291new Game.Achievement('You win a cookie','This is for baking 10 trillion cookies and making it on the local news.<q>We\'re all so proud of you.</q>',[10,0]);1029210293order=1070;10294Game.ProductionAchievement('Click delegator','Cursor',1,0,7);10295order=1120;10296Game.ProductionAchievement('Gushing grannies','Grandma',1,0,6);10297order=1220;10298Game.ProductionAchievement('I hate manure','Farm',1);10299order=1320;10300Game.ProductionAchievement('Never dig down','Mine',1);10301order=1420;10302Game.ProductionAchievement('The incredible machine','Factory',1);10303order=1520;10304Game.ProductionAchievement('And beyond','Shipment',1);10305order=1620;10306Game.ProductionAchievement('Magnum Opus','Alchemy lab',1);10307order=1720;10308Game.ProductionAchievement('With strange eons','Portal',1);10309order=1820;10310Game.ProductionAchievement('Spacetime jigamaroo','Time machine',1);10311order=1920;10312Game.ProductionAchievement('Supermassive','Antimatter condenser',1);10313order=2020;10314Game.ProductionAchievement('Praise the sun','Prism',1);103151031610317order=1000;10318new Game.Achievement('Clickageddon','Make <b>10,000,000,000,000</b> cookies from clicking.',[11,15]);10319new Game.Achievement('Clicknarok','Make <b>1,000,000,000,000,000</b> cookies from clicking.',[11,16]);1032010321order=1050;10322new Game.Achievement('Extreme polydactyly','Have <b>300</b> cursors.',[0,13]);10323new Game.Achievement('Dr. T','Have <b>400</b> cursors.',[0,14]);1032410325order=1100;Game.TieredAchievement('The old never bothered me anyway','Have <b>250</b> grandmas.','Grandma',6);10326order=1200;Game.TieredAchievement('Homegrown','Have <b>200</b> farms.','Farm',5);10327order=1400;Game.TieredAchievement('Technocracy','Have <b>200</b> factories.','Factory',5);10328order=1300;Game.TieredAchievement('The center of the Earth','Have <b>200</b> mines.','Mine',5);10329order=1500;Game.TieredAchievement('We come in peace','Have <b>200</b> shipments.','Shipment',5);10330order=1600;Game.TieredAchievement('The secrets of the universe','Have <b>200</b> alchemy labs.','Alchemy lab',5);10331order=1700;Game.TieredAchievement('Realm of the Mad God','Have <b>200</b> portals.','Portal',5);10332order=1800;Game.TieredAchievement('Forever and ever','Have <b>200</b> time machines.','Time machine',5);10333order=1900;Game.TieredAchievement('Walk the planck','Have <b>200</b> antimatter condensers.','Antimatter condenser',5);10334order=2000;Game.TieredAchievement('Rise and shine','Have <b>200</b> prisms.','Prism',5);1033510336order=30200;10337new Game.Achievement('God complex','Name yourself <b>Orteil</b>.<div class="warning">Note : usurpers incur a -1% CpS penalty until they rename themselves something else.</div><q>But that\'s not you, is it?</q>',[17,5]);Game.last.pool='shadow';10338new Game.Achievement('Third-party','Use an <b>add-on</b>.<q>Some find vanilla to be the most boring flavor.</q>',[16,5]);Game.last.pool='shadow';//if you're making a mod, add a Game.Win('Third-party') somewhere in there!1033910340order=30050;10341new Game.Achievement('Dematerialize','Ascend with <b>1 quintillion</b> cookies baked.<q>Presto!<br>...where\'d the cookies go?</q>',[11,7]);10342new Game.Achievement('Nil zero zilch','Ascend with <b>1 sextillion</b> cookies baked.<q>To summarize : really not very much at all.</q>',[11,7]);10343new Game.Achievement('Transcendence','Ascend with <b>1 septillion</b> cookies baked.<q>Your cookies are now on a higher plane of being.</q>',[11,8]);10344new Game.Achievement('Obliterate','Ascend with <b>1 octillion</b> cookies baked.<q>Resistance is futile, albeit entertaining.</q>',[11,8]);10345new Game.Achievement('Negative void','Ascend with <b>1 nonillion</b> cookies baked.<q>You now have so few cookies that it\'s almost like you have a negative amount of them.</q>',[11,8]);1034610347order=22400;10348new Game.Achievement('The hunt is on','Unlock <b>1 egg</b>.',[1,12]);10349new Game.Achievement('Egging on','Unlock <b>7 eggs</b>.',[4,12]);10350new Game.Achievement('Mass Easteria','Unlock <b>14 eggs</b>.',[7,12]);10351new Game.Achievement('Hide & seek champion','Unlock <b>all the eggs</b>.<div class="line"></div>Owning this achievement makes eggs drop more frequently in future playthroughs.',[13,12]);1035210353order=11000;10354new Game.Achievement('What\'s in a name','Give your bakery a name.',[15,9]);103551035610357order=1425;10358Game.TieredAchievement('Pretty penny','Have <b>1</b> bank.','Bank',1);10359Game.TieredAchievement('Fit the bill','Have <b>50</b> banks.','Bank',2);10360Game.TieredAchievement('A loan in the dark','Have <b>100</b> banks.','Bank',3);10361Game.TieredAchievement('Need for greed','Have <b>150</b> banks.','Bank',4);10362Game.TieredAchievement('It\'s the economy, stupid','Have <b>200</b> banks.','Bank',5);10363order=1450;10364Game.TieredAchievement('Your time to shrine','Have <b>1</b> temple.','Temple',1);10365Game.TieredAchievement('Shady sect','Have <b>50</b> temples.','Temple',2);10366Game.TieredAchievement('New-age cult','Have <b>100</b> temples.','Temple',3);10367Game.TieredAchievement('Organized religion','Have <b>150</b> temples.','Temple',4);10368Game.TieredAchievement('Fanaticism','Have <b>200</b> temples.','Temple',5);10369order=1475;10370Game.TieredAchievement('Bewitched','Have <b>1</b> wizard tower.','Wizard tower',1);10371Game.TieredAchievement('The sorcerer\'s apprentice','Have <b>50</b> wizard towers.','Wizard tower',2);10372Game.TieredAchievement('Charms and enchantments','Have <b>100</b> wizard towers.','Wizard tower',3);10373Game.TieredAchievement('Curses and maledictions','Have <b>150</b> wizard towers.','Wizard tower',4);10374Game.TieredAchievement('Magic kingdom','Have <b>200</b> wizard towers.','Wizard tower',5);1037510376order=1445;10377Game.ProductionAchievement('Vested interest','Bank',1);10378order=1470;10379Game.ProductionAchievement('New world order','Temple',1);10380order=1495;10381Game.ProductionAchievement('Hocus pocus','Wizard tower',1);10382103831038410385order=1070;10386Game.ProductionAchievement('Finger clickin\' good','Cursor',2,0,7);10387order=1120;10388Game.ProductionAchievement('Panic at the bingo','Grandma',2,0,6);10389order=1220;10390Game.ProductionAchievement('Rake in the dough','Farm',2);10391order=1320;10392Game.ProductionAchievement('Quarry on','Mine',2);10393order=1420;10394Game.ProductionAchievement('Yes I love technology','Factory',2);10395order=1445;10396Game.ProductionAchievement('Paid in full','Bank',2);10397order=1470;10398Game.ProductionAchievement('Church of Cookiology','Temple',2);10399order=1495;10400Game.ProductionAchievement('Too many rabbits, not enough hats','Wizard tower',2);10401order=1520;10402Game.ProductionAchievement('The most precious cargo','Shipment',2);10403order=1620;10404Game.ProductionAchievement('The Aureate','Alchemy lab',2);10405order=1720;10406Game.ProductionAchievement('Ever more hideous','Portal',2);10407order=1820;10408Game.ProductionAchievement('Be kind, rewind','Time machine',2);10409order=1920;10410Game.ProductionAchievement('Infinitesimal','Antimatter condenser',2);10411order=2020;10412Game.ProductionAchievement('A still more glorious dawn','Prism',2);1041310414order=30000;10415new Game.Achievement('Rebirth','Ascend at least once.',[21,6]);1041610417order=11000;10418new Game.Achievement('Here you go','Click this achievement\'s slot.<q>All you had to do was ask.</q>',[1,7]);Game.last.clickFunction=function(){if (!Game.HasAchiev('Here you go')){PlaySound('snd/tick.mp3');Game.Win('Here you go');}};1041910420order=30000;10421new Game.Achievement('Resurrection','Ascend <b>10 times</b>.',[21,6]);10422new Game.Achievement('Reincarnation','Ascend <b>100 times</b>.',[21,6]);10423new Game.Achievement('Endless cycle','Ascend <b>1000 times</b>.<q>Oh hey, it\'s you again.</q>',[2,7]);Game.last.pool='shadow';10424104251042610427order=1100;10428Game.TieredAchievement('The agemaster','Have <b>300</b> grandmas.','Grandma',7);10429Game.TieredAchievement('To oldly go','Have <b>350</b> grandmas.','Grandma',8);1043010431order=1200;Game.TieredAchievement('Gardener extraordinaire','Have <b>250</b> farms.','Farm',6);10432order=1300;Game.TieredAchievement('Tectonic ambassador','Have <b>250</b> mines.','Mine',6);10433order=1400;Game.TieredAchievement('Rise of the machines','Have <b>250</b> factories.','Factory',6);10434order=1425;Game.TieredAchievement('Acquire currency','Have <b>250</b> banks.','Bank',6);10435order=1450;Game.TieredAchievement('Zealotry','Have <b>250</b> temples.','Temple',6);10436order=1475;Game.TieredAchievement('The wizarding world','Have <b>250</b> wizard towers.','Wizard tower',6);10437order=1500;Game.TieredAchievement('Parsec-masher','Have <b>250</b> shipments.','Shipment',6);10438order=1600;Game.TieredAchievement('The work of a lifetime','Have <b>250</b> alchemy labs.','Alchemy lab',6);10439order=1700;Game.TieredAchievement('A place lost in time','Have <b>250</b> portals.','Portal',6);10440order=1800;Game.TieredAchievement('Heat death','Have <b>250</b> time machines.','Time machine',6);10441order=1900;Game.TieredAchievement('Microcosm','Have <b>250</b> antimatter condensers.','Antimatter condenser',6);10442order=2000;Game.TieredAchievement('Bright future','Have <b>250</b> prisms.','Prism',6);1044310444order=25000;10445new Game.Achievement('Here be dragon','Complete your <b>dragon\'s training</b>.',[21,12]);1044610447Game.BankAchievement('How?');10448Game.BankAchievement('The land of milk and cookies');10449Game.BankAchievement('He who controls the cookies controls the universe');Game.last.baseDesc+='<q>The milk must flow!</q>';Game.last.desc=BeautifyInText(Game.last.baseDesc);10450Game.BankAchievement('Tonight on Hoarders');10451Game.BankAchievement('Are you gonna eat all that?');10452Game.BankAchievement('We\'re gonna need a bigger bakery');10453Game.BankAchievement('In the mouth of madness');Game.last.baseDesc+='<q>A cookie is just what we tell each other it is.</q>';Game.last.desc=BeautifyInText(Game.last.baseDesc);10454Game.BankAchievement('Brought to you by the letter <div style="display:inline-block;background:url(img/money.png);width:16px;height:16px;"></div>');104551045610457Game.CpsAchievement('A world filled with cookies');10458Game.CpsAchievement('When this baby hits '+Beautify(10000000000000*60*60)+' cookies per hour');10459Game.CpsAchievement('Fast and delicious');10460Game.CpsAchievement('Cookiehertz : a really, really tasty hertz');Game.last.baseDesc+='<q>Tastier than a hertz donut, anyway.</q>';Game.last.desc=BeautifyInText(Game.last.baseDesc);10461Game.CpsAchievement('Woops, you solved world hunger');10462Game.CpsAchievement('Turbopuns');Game.last.baseDesc+='<q>Mother Nature will be like "slowwwww dowwwwwn".</q>';Game.last.desc=BeautifyInText(Game.last.baseDesc);10463Game.CpsAchievement('Faster menner');10464Game.CpsAchievement('And yet you\'re still hungry');10465Game.CpsAchievement('The Abakening');10466Game.CpsAchievement('There\'s really no hard limit to how long these achievement names can be and to be quite honest I\'m rather curious to see how far we can go.<br>Adolphus W. Green (1844–1917) started as the Principal of the Groton School in 1864. By 1865, he became second assistant librarian at the New York Mercantile Library; from 1867 to 1869, he was promoted to full librarian. From 1869 to 1873, he worked for Evarts, Southmayd & Choate, a law firm co-founded by William M. Evarts, Charles Ferdinand Southmayd and Joseph Hodges Choate. He was admitted to the New York State Bar Association in 1873.<br>Anyway, how\'s your day been?');//Game.last.shortName='There\'s really no hard limit to how long these achievement names can be and to be quite honest I\'m [...]';10467Game.CpsAchievement('Fast');Game.last.baseDesc+='<q>Wow!</q>';Game.last.desc=BeautifyInText(Game.last.baseDesc);1046810469order=7002;10470new Game.Achievement('Bicentennial and a half','Have at least <b>250 of everything</b>.<q>Keep on truckin\'.</q>',[9,6]);1047110472order=11000;10473new Game.Achievement('Tabloid addiction','Click on the news ticker <b>50 times</b>.<q>Page 6 : Mad individual clicks on picture of pastry in a futile attempt to escape boredom!<br>Also page 6 : British parliament ate my baby!</q>',[27,7]);1047410475order=1000;10476new Game.Achievement('Clickastrophe','Make <b>100,000,000,000,000,000</b> cookies from clicking.',[11,17]);10477new Game.Achievement('Clickataclysm','Make <b>10,000,000,000,000,000,000</b> cookies from clicking.',[11,18]);1047810479order=1050;10480new Game.Achievement('Thumbs, phalanges, metacarpals','Have <b>500</b> cursors.<q>& KNUCKLES</q>',[0,15]);1048110482order=6000;10483new Game.Achievement('Polymath','Own <b>300</b> upgrades and <b>3000</b> buildings.<q>Excellence doesn\'t happen overnight - it usually takes a good couple days.</q>',[29,7]);1048410485order=6005;10486new Game.Achievement('The elder scrolls','Own a combined <b>777</b> grandmas and cursors.<q>Let me guess. Someone stole your cookie.</q>',[10,9]);1048710488order=30050;10489new Game.Achievement('To crumbs, you say?','Ascend with <b>1 decillion</b> cookies baked.<q>Very well then.</q>',[29,6]);1049010491order=1200;Game.TieredAchievement('Seedy business','Have <b>300</b> farms.','Farm',7);10492order=1300;Game.TieredAchievement('Freak fracking','Have <b>300</b> mines.','Mine',7);10493order=1400;Game.TieredAchievement('Modern times','Have <b>300</b> factories.','Factory',7);10494order=1425;Game.TieredAchievement('The nerve of war','Have <b>300</b> banks.','Bank',7);10495order=1450;Game.TieredAchievement('Wololo','Have <b>300</b> temples.','Temple',7);10496order=1475;Game.TieredAchievement('And now for my next trick, I\'ll need a volunteer from the audience','Have <b>300</b> wizard towers.','Wizard tower',7);10497order=1500;Game.TieredAchievement('It\'s not delivery','Have <b>300</b> shipments.','Shipment',7);10498order=1600;Game.TieredAchievement('Gold, Jerry! Gold!','Have <b>300</b> alchemy labs.','Alchemy lab',7);10499order=1700;Game.TieredAchievement('Forbidden zone','Have <b>300</b> portals.','Portal',7);10500order=1800;Game.TieredAchievement('cookie clicker forever and forever a hundred years cookie clicker, all day long forever, forever a hundred times, over and over cookie clicker adventures dot com','Have <b>300</b> time machines.','Time machine',7);10501order=1900;Game.TieredAchievement('Scientists baffled everywhere','Have <b>300</b> antimatter condensers.','Antimatter condenser',7);10502order=2000;Game.TieredAchievement('Harmony of the spheres','Have <b>300</b> prisms.','Prism',7);1050310504order=35000;10505new Game.Achievement('Last Chance to See','Burst the near-extinct <b>shiny wrinkler</b>.<q>You monster!</q>',[24,12]);Game.last.pool='shadow';1050610507order=10000;10508new Game.Achievement('Early bird','Click a golden cookie <b>less than 1 second after it spawns</b>.',[10,14]);10509new Game.Achievement('Fading luck','Click a golden cookie <b>less than 1 second before it dies</b>.',[10,14]);1051010511order=22100;10512new Game.Achievement('Eldeer','Pop a reindeer <b>during an elder frenzy</b>.',[12,9]);1051310514order=21100;10515new Game.Achievement('Dude, sweet','Harvest <b>7 coalescing sugar lumps</b>.',[24,14]);10516new Game.Achievement('Sugar rush','Harvest <b>30 coalescing sugar lumps</b>.',[26,14]);10517new Game.Achievement('Year\'s worth of cavities','Harvest <b>365 coalescing sugar lumps</b>.<q>My lumps my lumps my lumps.</q>',[29,14]);10518new Game.Achievement('Hand-picked','Successfully harvest a coalescing sugar lump before it\'s ripe.',[28,14]);10519new Game.Achievement('Sugar sugar','Harvest a <b>bifurcated sugar lump</b>.',[29,15]);10520new Game.Achievement('All-natural cane sugar','Harvest a <b>golden sugar lump</b>.',[29,16]);Game.last.pool='shadow';10521new Game.Achievement('Sweetmeats','Harvest a <b>meaty sugar lump</b>.',[29,17]);1052210523order=7002;10524new Game.Achievement('Tricentennial','Have at least <b>300 of everything</b>.<q>Can\'t stop, won\'t stop. Probably should stop, though.</q>',[29,12]);1052510526Game.CpsAchievement('Knead for speed');Game.last.baseDesc+='<q>How did we not make that one yet?</q>';Game.last.desc=BeautifyInText(Game.last.baseDesc);10527Game.CpsAchievement('Well the cookies start coming and they don\'t stop coming');Game.last.baseDesc+='<q>Didn\'t make sense not to click for fun.</q>';Game.last.desc=BeautifyInText(Game.last.baseDesc);10528Game.CpsAchievement('I don\'t know if you\'ve noticed but all these icons are very slightly off-center');10529Game.CpsAchievement('The proof of the cookie is in the baking');Game.last.baseDesc+='<q>How can you have any cookies if you don\'t bake your dough?</q>';Game.last.desc=BeautifyInText(Game.last.baseDesc);10530Game.CpsAchievement('If it\'s worth doing, it\'s worth overdoing');1053110532Game.BankAchievement('The dreams in which I\'m baking are the best I\'ve ever had');10533Game.BankAchievement('Set for life');1053410535order=1200;Game.TieredAchievement('You and the beanstalk','Have <b>350</b> farms.','Farm',8);10536order=1300;Game.TieredAchievement('Romancing the stone','Have <b>350</b> mines.','Mine',8);10537order=1400;Game.TieredAchievement('Ex machina','Have <b>350</b> factories.','Factory',8);10538order=1425;Game.TieredAchievement('And I need it now','Have <b>350</b> banks.','Bank',8);10539order=1450;Game.TieredAchievement('Pray on the weak','Have <b>350</b> temples.','Temple',8);10540order=1475;Game.TieredAchievement('It\'s a kind of magic','Have <b>350</b> wizard towers.','Wizard tower',8);10541order=1500;Game.TieredAchievement('Make it so','Have <b>350</b> shipments.','Shipment',8);10542order=1600;Game.TieredAchievement('All that glitters is gold','Have <b>350</b> alchemy labs.','Alchemy lab',8);10543order=1700;Game.TieredAchievement('H̸̷͓̳̳̯̟͕̟͍͍̣͡ḛ̢̦̰̺̮̝͖͖̘̪͉͘͡ ̠̦͕̤̪̝̥̰̠̫̖̣͙̬͘ͅC̨̦̺̩̲̥͉̭͚̜̻̝̣̼͙̮̯̪o̴̡͇̘͎̞̲͇̦̲͞͡m̸̩̺̝̣̹̱͚̬̥̫̳̼̞̘̯͘ͅẹ͇̺̜́̕͢s̶̙̟̱̥̮̯̰̦͓͇͖͖̝͘͘͞','Have <b>350</b> portals.','Portal',8);10544order=1800;Game.TieredAchievement('Way back then','Have <b>350</b> time machines.','Time machine',8);10545order=1900;Game.TieredAchievement('Exotic matter','Have <b>350</b> antimatter condensers.','Antimatter condenser',8);10546order=2000;Game.TieredAchievement('At the end of the tunnel','Have <b>350</b> prisms.','Prism',8);10547105481054910550order=1070;10551Game.ProductionAchievement('Click (starring Adam Sandler)','Cursor',3,0,7);10552order=1120;10553Game.ProductionAchievement('Frantiquities','Grandma',3,0,6);10554order=1220;10555Game.ProductionAchievement('Overgrowth','Farm',3);10556order=1320;10557Game.ProductionAchievement('Sedimentalism','Mine',3);10558order=1420;10559Game.ProductionAchievement('Labor of love','Factory',3);10560order=1445;10561Game.ProductionAchievement('Reverse funnel system','Bank',3);10562order=1470;10563Game.ProductionAchievement('Thus spoke you','Temple',3);10564order=1495;10565Game.ProductionAchievement('Manafest destiny','Wizard tower',3);10566order=1520;10567Game.ProductionAchievement('Neither snow nor rain nor heat nor gloom of night','Shipment',3);10568order=1620;10569Game.ProductionAchievement('I\'ve got the Midas touch','Alchemy lab',3);10570order=1720;10571Game.ProductionAchievement('Which eternal lie','Portal',3);10572order=1820;10573Game.ProductionAchievement('Déjà vu','Time machine',3);10574order=1920;10575Game.ProductionAchievement('Powers of Ten','Antimatter condenser',3);10576order=2020;10577Game.ProductionAchievement('Now the dark days are gone','Prism',3);1057810579order=1070;10580new Game.Achievement('Freaky jazz hands','Reach level <b>10</b> cursors.',[0,26]);Game.Objects['Cursor'].levelAchiev10=Game.last;10581order=1120;10582new Game.Achievement('Methuselah','Reach level <b>10</b> grandmas.',[1,26]);Game.Objects['Grandma'].levelAchiev10=Game.last;10583order=1220;10584new Game.Achievement('Huge tracts of land','Reach level <b>10</b> farms.',[2,26]);Game.Objects['Farm'].levelAchiev10=Game.last;10585order=1320;10586new Game.Achievement('D-d-d-d-deeper','Reach level <b>10</b> mines.',[3,26]);Game.Objects['Mine'].levelAchiev10=Game.last;10587order=1420;10588new Game.Achievement('Patently genius','Reach level <b>10</b> factories.',[4,26]);Game.Objects['Factory'].levelAchiev10=Game.last;10589order=1445;10590new Game.Achievement('A capital idea','Reach level <b>10</b> banks.',[15,26]);Game.Objects['Bank'].levelAchiev10=Game.last;10591order=1470;10592new Game.Achievement('It belongs in a bakery','Reach level <b>10</b> temples.',[16,26]);Game.Objects['Temple'].levelAchiev10=Game.last;10593order=1495;10594new Game.Achievement('Motormouth','Reach level <b>10</b> wizard towers.',[17,26]);Game.Objects['Wizard tower'].levelAchiev10=Game.last;10595order=1520;10596new Game.Achievement('Been there done that','Reach level <b>10</b> shipments.',[5,26]);Game.Objects['Shipment'].levelAchiev10=Game.last;10597order=1620;10598new Game.Achievement('Phlogisticated substances','Reach level <b>10</b> alchemy labs.',[6,26]);Game.Objects['Alchemy lab'].levelAchiev10=Game.last;10599order=1720;10600new Game.Achievement('Bizarro world','Reach level <b>10</b> portals.',[7,26]);Game.Objects['Portal'].levelAchiev10=Game.last;10601order=1820;10602new Game.Achievement('The long now','Reach level <b>10</b> time machines.',[8,26]);Game.Objects['Time machine'].levelAchiev10=Game.last;10603order=1920;10604new Game.Achievement('Chubby hadrons','Reach level <b>10</b> antimatter condensers.',[13,26]);Game.Objects['Antimatter condenser'].levelAchiev10=Game.last;10605order=2020;10606new Game.Achievement('Palettable','Reach level <b>10</b> prisms.',[14,26]);Game.Objects['Prism'].levelAchiev10=Game.last;1060710608order=61470;10609order=61495;10610new Game.Achievement('Bibbidi-bobbidi-boo','Cast <b>9</b> spells.',[21,11]);10611new Game.Achievement('I\'m the wiz','Cast <b>99</b> spells.',[22,11]);10612new Game.Achievement('A wizard is you','Cast <b>999</b> spells.<q>I\'m a what?</q>',[29,11]);1061310614order=10000;10615new Game.Achievement('Four-leaf cookie','Have <b>4</b> golden cookies simultaneously.<q>Fairly rare, considering cookies don\'t even have leaves.</q>',[27,6]);Game.last.pool='shadow';1061610617order=2100;10618Game.TieredAchievement('Lucked out','Have <b>1</b> chancemaker.','Chancemaker',1);10619Game.TieredAchievement('What are the odds','Have <b>50</b> chancemakers.','Chancemaker',2);10620Game.TieredAchievement('Grandma needs a new pair of shoes','Have <b>100</b> chancemakers.','Chancemaker',3);10621Game.TieredAchievement('Million to one shot, doc','Have <b>150</b> chancemakers.','Chancemaker',4);10622Game.TieredAchievement('As luck would have it','Have <b>200</b> chancemakers.','Chancemaker',5);10623Game.TieredAchievement('Ever in your favor','Have <b>250</b> chancemakers.','Chancemaker',6);10624Game.TieredAchievement('Be a lady','Have <b>300</b> chancemakers.','Chancemaker',7);10625Game.TieredAchievement('Dicey business','Have <b>350</b> chancemakers.','Chancemaker',8);1062610627order=2120;10628Game.ProductionAchievement('Fingers crossed','Chancemaker',1);10629Game.ProductionAchievement('Just a statistic','Chancemaker',2);10630Game.ProductionAchievement('Murphy\'s wild guess','Chancemaker',3);1063110632new Game.Achievement('Let\'s leaf it at that','Reach level <b>10</b> chancemakers.',[19,26]);Game.Objects['Chancemaker'].levelAchiev10=Game.last;1063310634order=1000;10635new Game.Achievement('The ultimate clickdown','Make <b>1,000,000,000,000,000,000,000</b> cookies from clicking.<q>(of ultimate destiny.)</q>',[11,19]);106361063710638order=1100;10639Game.TieredAchievement('Aged well','Have <b>400</b> grandmas.','Grandma',9);10640Game.TieredAchievement('101st birthday','Have <b>450</b> grandmas.','Grandma',10);10641Game.TieredAchievement('Defense of the ancients','Have <b>500</b> grandmas.','Grandma',11);10642order=1200;Game.TieredAchievement('Harvest moon','Have <b>400</b> farms.','Farm',9);10643order=1300;Game.TieredAchievement('Mine?','Have <b>400</b> mines.','Mine',9);10644order=1400;Game.TieredAchievement('In full gear','Have <b>400</b> factories.','Factory',9);10645order=1425;Game.TieredAchievement('Treacle tart economics','Have <b>400</b> banks.','Bank',9);10646order=1450;Game.TieredAchievement('Holy cookies, grandma!','Have <b>400</b> temples.','Temple',9);10647order=1475;Game.TieredAchievement('The Prestige','Have <b>400</b> wizard towers.<q>(Unrelated to the Cookie Clicker feature of the same name.)</q>','Wizard tower',9);10648order=1500;Game.TieredAchievement('That\'s just peanuts to space','Have <b>400</b> shipments.','Shipment',9);10649order=1600;Game.TieredAchievement('Worth its weight in lead','Have <b>400</b> alchemy labs.','Alchemy lab',9);10650order=1700;Game.TieredAchievement('What happens in the vortex stays in the vortex','Have <b>400</b> portals.','Portal',9);10651order=1800;Game.TieredAchievement('Invited to yesterday\'s party','Have <b>400</b> time machines.','Time machine',9);10652order=1900;Game.TieredAchievement('Downsizing','Have <b>400</b> antimatter condensers.','Antimatter condenser',9);//the trailer got me really hyped up but i've read some pretty bad reviews. is it watchable ? is it worth seeing ? i don't mind matt damon10653order=2000;Game.TieredAchievement('My eyes','Have <b>400</b> prisms.','Prism',9);10654order=2100;Game.TieredAchievement('Maybe a chance in hell, actually','Have <b>400</b> chancemakers.','Chancemaker',9);1065510656order=1200;Game.TieredAchievement('Make like a tree','Have <b>450</b> farms.','Farm',10);10657order=1300;Game.TieredAchievement('Cave story','Have <b>450</b> mines.','Mine',10);10658order=1400;Game.TieredAchievement('In-cog-neato','Have <b>450</b> factories.','Factory',10);10659order=1425;Game.TieredAchievement('Save your breath because that\'s all you\'ve got left','Have <b>450</b> banks.','Bank',10);10660order=1450;Game.TieredAchievement('Vengeful and almighty','Have <b>450</b> temples.','Temple',10);10661order=1475;Game.TieredAchievement('Spell it out for you','Have <b>450</b> wizard towers.','Wizard tower',10);10662order=1500;Game.TieredAchievement('Space space space space space','Have <b>450</b> shipments.<q>It\'s too far away...</q>','Shipment',10);10663order=1600;Game.TieredAchievement('Don\'t get used to yourself, you\'re gonna have to change','Have <b>450</b> alchemy labs.','Alchemy lab',10);10664order=1700;Game.TieredAchievement('Objects in the mirror dimension are closer than they appear','Have <b>450</b> portals.','Portal',10);10665order=1800;Game.TieredAchievement('Groundhog day','Have <b>450</b> time machines.','Time machine',10);10666order=1900;Game.TieredAchievement('A matter of perspective','Have <b>450</b> antimatter condensers.','Antimatter condenser',10);10667order=2000;Game.TieredAchievement('Optical illusion','Have <b>450</b> prisms.','Prism',10);10668order=2100;Game.TieredAchievement('Jackpot','Have <b>450</b> chancemakers.','Chancemaker',10);1066910670order=36000;10671new Game.Achievement('So much to do so much to see','Manage a cookie legacy for <b>at least a year</b>.<q>Thank you so much for playing Cookie Clicker!</q>',[23,11]);Game.last.pool='shadow';10672106731067410675Game.CpsAchievement('Running with scissors');10676Game.CpsAchievement('Rarefied air');10677Game.CpsAchievement('Push it to the limit');10678Game.CpsAchievement('Green cookies sleep furiously');1067910680Game.BankAchievement('Panic! at Nabisco');10681Game.BankAchievement('Bursting at the seams');10682Game.BankAchievement('Just about full');10683Game.BankAchievement('Hungry for more');1068410685order=1000;10686new Game.Achievement('All the other kids with the pumped up clicks','Make <b>100,000,000,000,000,000,000,000</b> cookies from clicking.',[11,28]);10687new Game.Achievement('One...more...click...','Make <b>10,000,000,000,000,000,000,000,000</b> cookies from clicking.',[11,30]);1068810689order=61515;10690new Game.Achievement('Botany enthusiast','Harvest <b>100</b> mature garden plants.',[26,20]);10691new Game.Achievement('Green, aching thumb','Harvest <b>1000</b> mature garden plants.',[27,20]);10692new Game.Achievement('In the garden of Eden (baby)','Fill every tile of the biggest garden plot with plants.<q>Isn\'t tending to those precious little plants just so rock and/or roll?</q>',[28,20]);1069310694new Game.Achievement('Keeper of the conservatory','Unlock every garden seed.',[25,20]);10695new Game.Achievement('Seedless to nay','Convert a complete seed log into sugar lumps by sacrificing your garden to the sugar hornets.<div class="line"></div>Owning this achievement makes seeds <b>5% cheaper</b>, plants mature <b>5% sooner</b>, and plant upgrades drop <b>5% more</b>.',[29,20]);1069610697order=30050;10698new Game.Achievement('You get nothing','Ascend with <b>1 undecillion</b> cookies baked.<q>Good day sir!</q>',[29,6]);10699new Game.Achievement('Humble rebeginnings','Ascend with <b>1 duodecillion</b> cookies baked.<q>Started from the bottom, now we\'re here.</q>',[29,6]);10700new Game.Achievement('The end of the world','Ascend with <b>1 tredecillion</b> cookies baked.<q>(as we know it)</q>',[21,25]);10701new Game.Achievement('Oh, you\'re back','Ascend with <b>1 quattuordecillion</b> cookies baked.<q>Missed us?</q>',[21,25]);10702new Game.Achievement('Lazarus','Ascend with <b>1 quindecillion</b> cookies baked.<q>All rise.</q>',[21,25]);1070310704Game.CpsAchievement('Leisurely pace');10705Game.CpsAchievement('Hypersonic');1070610707Game.BankAchievement('Feed me, Orteil');10708Game.BankAchievement('And then what?');1070910710order=7002;10711new Game.Achievement('Tricentennial and a half','Have at least <b>350 of everything</b>.<q>(it\'s free real estate)</q>',[21,26]);10712new Game.Achievement('Quadricentennial','Have at least <b>400 of everything</b>.<q>You\'ve had to do horrible things to get this far.<br>Horrible... horrible things.</q>',[22,26]);10713new Game.Achievement('Quadricentennial and a half','Have at least <b>450 of everything</b>.<q>At this point, you might just be compensating for something.</q>',[23,26]);1071410715new Game.Achievement('Quincentennial','Have at least <b>500 of everything</b>.<q>Some people would say you\'re halfway there.<br>We do not care for those people and their reckless sense of unchecked optimism.</q>',[29,25]);107161071710718order=21100;10719new Game.Achievement('Maillard reaction','Harvest a <b>caramelized sugar lump</b>.',[29,27]);1072010721order=30250;10722new Game.Achievement('When the cookies ascend just right','Ascend with exactly <b>1,000,000,000,000 cookies</b>.',[25,7]);Game.last.pool='shadow';//this achievement is shadow because it is only achievable through blind luck or reading external guides; this may change in the future107231072410725order=1050;10726new Game.Achievement('With her finger and her thumb','Have <b>600</b> cursors.',[0,16]);1072710728order=1100;Game.TieredAchievement('But wait \'til you get older','Have <b>550</b> grandmas.','Grandma',12);10729order=1200;Game.TieredAchievement('Sharpest tool in the shed','Have <b>500</b> farms.','Farm',11);10730order=1300;Game.TieredAchievement('Hey now, you\'re a rock','Have <b>500</b> mines.','Mine',11);10731order=1400;Game.TieredAchievement('Break the mold','Have <b>500</b> factories.','Factory',11);10732order=1425;Game.TieredAchievement('Get the show on, get paid','Have <b>500</b> banks.','Bank',11);10733order=1450;Game.TieredAchievement('My world\'s on fire, how about yours','Have <b>500</b> temples.','Temple',11);10734order=1475;Game.TieredAchievement('The meteor men beg to differ','Have <b>500</b> wizard towers.','Wizard tower',11);10735order=1500;Game.TieredAchievement('Only shooting stars','Have <b>500</b> shipments.','Shipment',11);10736order=1600;Game.TieredAchievement('We could all use a little change','Have <b>500</b> alchemy labs.','Alchemy lab',11);//"all that glitters is gold" was already an achievement10737order=1700;Game.TieredAchievement('Your brain gets smart but your head gets dumb','Have <b>500</b> portals.','Portal',11);10738order=1800;Game.TieredAchievement('The years start coming','Have <b>500</b> time machines.','Time machine',11);10739order=1900;Game.TieredAchievement('What a concept','Have <b>500</b> antimatter condensers.','Antimatter condenser',11);10740order=2000;Game.TieredAchievement('You\'ll never shine if you don\'t glow','Have <b>500</b> prisms.','Prism',11);10741order=2100;Game.TieredAchievement('You\'ll never know if you don\'t go','Have <b>500</b> chancemakers.','Chancemaker',11);1074210743order=2200;10744Game.TieredAchievement('Self-contained','Have <b>1</b> fractal engine.','Fractal engine',1);10745Game.TieredAchievement('Threw you for a loop','Have <b>50</b> fractal engines.','Fractal engine',2);10746Game.TieredAchievement('The sum of its parts','Have <b>100</b> fractal engines.','Fractal engine',3);10747Game.TieredAchievement('Bears repeating','Have <b>150</b> fractal engines.<q>Where did these come from?</q>','Fractal engine',4);10748Game.TieredAchievement('More of the same','Have <b>200</b> fractal engines.','Fractal engine',5);10749Game.TieredAchievement('Last recurse','Have <b>250</b> fractal engines.','Fractal engine',6);10750Game.TieredAchievement('Out of one, many','Have <b>300</b> fractal engines.','Fractal engine',7);10751Game.TieredAchievement('An example of recursion','Have <b>350</b> fractal engines.','Fractal engine',8);10752Game.TieredAchievement('For more information on this achievement, please refer to its title','Have <b>400</b> fractal engines.','Fractal engine',9);10753Game.TieredAchievement('I\'m so meta, even this achievement','Have <b>450</b> fractal engines.','Fractal engine',10);10754Game.TieredAchievement('Never get bored','Have <b>500</b> fractal engines.','Fractal engine',11);1075510756order=2220;10757Game.ProductionAchievement('The needs of the many','Fractal engine',1);10758Game.ProductionAchievement('Eating its own','Fractal engine',2);10759Game.ProductionAchievement('We must go deeper','Fractal engine',3);1076010761new Game.Achievement('Sierpinski rhomboids','Reach level <b>10</b> fractal engines.',[20,26]);Game.Objects['Fractal engine'].levelAchiev10=Game.last;1076210763Game.CpsAchievement('Gotta go fast');10764Game.BankAchievement('I think it\'s safe to say you\'ve got it made');1076510766order=6000;10767new Game.Achievement('Renaissance baker','Own <b>400</b> upgrades and <b>4000</b> buildings.<q>If you have seen further, it is by standing on the shoulders of giants - a mysterious species of towering humanoids until now thought long-extinct.</q>',[10,10]);1076810769order=1150;10770new Game.Achievement('Veteran','Own at least <b>14</b> grandma types.<q>14\'s a crowd!</q>',[10,9]);1077110772order=10000;10773new Game.Achievement('Thick-skinned','Have your <b>reinforced membrane</b> protect the <b>shimmering veil</b>.',[7,10]);107741077510776order=2300;10777Game.TieredAchievement('F12','Have <b>1</b> javascript console.','Javascript console',1);10778Game.TieredAchievement('Variable success','Have <b>50</b> javascript consoles.','Javascript console',2);10779Game.TieredAchievement('No comments','Have <b>100</b> javascript consoles.','Javascript console',3);10780Game.TieredAchievement('Up to code','Have <b>150</b> javascript consoles.','Javascript console',4);10781Game.TieredAchievement('Works on my machine','Have <b>200</b> javascript consoles.','Javascript console',5);10782Game.TieredAchievement('Technical debt','Have <b>250</b> javascript consoles.','Javascript console',6);10783Game.TieredAchievement('Mind your language','Have <b>300</b> javascript consoles.','Javascript console',7);10784Game.TieredAchievement('Inconsolable','Have <b>350</b> javascript consoles.','Javascript console',8);10785Game.TieredAchievement('Closure','Have <b>400</b> javascript consoles.','Javascript console',9);10786Game.TieredAchievement('Dude what if we\'re all living in a simulation like what if we\'re all just code on a computer somewhere','Have <b>450</b> javascript consoles.','Javascript console',10);10787Game.TieredAchievement('Taking the back streets','Have <b>500</b> javascript consoles.','Javascript console',11);1078810789order=2320;10790Game.ProductionAchievement('Inherited prototype','Javascript console',1);10791Game.ProductionAchievement('A model of document object','Javascript console',2);10792Game.ProductionAchievement('First-class citizen','Javascript console',3);1079310794new Game.Achievement('Alexandria','Reach level <b>10</b> javascript consoles.',[32,26]);Game.Objects['Javascript console'].levelAchiev10=Game.last;1079510796Game.CpsAchievement('Bake him away, toys');10797Game.CpsAchievement('You\'re #1 so why try harder');10798Game.CpsAchievement('Haven\'t even begun to peak');10799Game.BankAchievement('A sometimes food');10800Game.BankAchievement('Not enough of a good thing');10801Game.BankAchievement('Horn of plenty');1080210803order=30050;10804new Game.Achievement('Smurf account','Ascend with <b>1 sexdecillion</b> cookies baked.<q>It\'s like you just appeared out of the blue!</q>',[21,32]);10805new Game.Achievement('If at first you don\'t succeed','Ascend with <b>1 septendecillion</b> cookies baked.<q>If at first you don\'t succeed, try, try, try again.<br>But isn\'t that the definition of insanity?</q>',[21,32]);1080610807order=33000;10808new Game.Achievement('O Fortuna','Own every <b>fortune upgrade</b>.<div class="line"></div>Owning this achievement makes fortunes appear <b>twice as often</b>; fortune upgrades also have a <b>40% chance</b> to carry over after ascending.',[29,8]);1080910810//end of achievements1081110812/*=====================================================================================10813BUFFS10814=======================================================================================*/1081510816Game.buffs=[];//buffs currently in effect by name10817Game.buffsN=0;10818Game.buffsL=l('buffs');10819Game.gainBuff=function(type,time,arg1,arg2,arg3)10820{10821type=Game.buffTypesByName[type];10822var obj=type.func(time,arg1,arg2,arg3);10823obj.type=type;10824obj.arg1=arg1;10825obj.arg2=arg2;10826obj.arg3=arg3;1082710828var buff={10829visible:true,10830time:0,10831name:'???',10832desc:'',10833icon:[0,0]10834};10835if (Game.buffs[obj.name])//if there is already a buff in effect with this name10836{10837var buff=Game.buffs[obj.name];10838if (obj.max) buff.time=Math.max(obj.time,buff.time);//new duration is max of old and new10839if (obj.add) buff.time+=obj.time;//new duration is old + new10840if (!obj.max && !obj.add) buff.time=obj.time;//new duration is set to new10841buff.maxTime=buff.time;10842}10843else//create new buff10844{10845for (var i in obj)//paste parameters onto buff10846{buff[i]=obj[i];}10847buff.maxTime=buff.time;10848Game.buffs[buff.name]=buff;10849buff.id=Game.buffsN;1085010851//create dom10852Game.buffsL.innerHTML=Game.buffsL.innerHTML+'<div id="buff'+buff.id+'" class="crate enabled buff" '+(buff.desc?Game.getTooltip(10853'<div class="prompt" style="min-width:200px;text-align:center;font-size:11px;margin:8px 0px;"><h3>'+buff.name+'</h3><div class="line"></div>'+buff.desc+'</div>'10854,'left',true):'')+' style="opacity:1;float:none;display:block;'+(buff.icon[2]?'background-image:url('+buff.icon[2]+');':'')+'background-position:'+(-buff.icon[0]*48)+'px '+(-buff.icon[1]*48)+'px;"></div>';1085510856buff.l=l('buff'+buff.id);1085710858Game.buffsN++;10859}10860Game.recalculateGains=1;10861Game.storeToRefresh=1;10862return buff;10863}10864Game.hasBuff=function(what)//returns 0 if there is no buff in effect with this name; else, returns it10865{if (!Game.buffs[what]) return 0; else return Game.buffs[what];}10866Game.updateBuffs=function()//executed every logic frame10867{10868for (var i in Game.buffs)10869{10870var buff=Game.buffs[i];1087110872if (buff.time>=0)10873{10874if (!l('buffPieTimer'+buff.id)) l('buff'+buff.id).innerHTML=l('buff'+buff.id).innerHTML+'<div class="pieTimer" id="buffPieTimer'+buff.id+'"></div>';10875var T=1-(buff.time/buff.maxTime);10876T=(T*144)%144;10877l('buffPieTimer'+buff.id).style.backgroundPosition=(-Math.floor(T%18))*48+'px '+(-Math.floor(T/18))*48+'px';10878}10879buff.time--;10880if (buff.time<=0)10881{10882if (Game.onCrate==l('buff'+buff.id)) Game.tooltip.hide();10883if (buff.onDie) buff.onDie();10884Game.buffsL.removeChild(l('buff'+buff.id));10885if (Game.buffs[buff.name])10886{10887Game.buffs[buff.name]=0;10888delete Game.buffs[buff.name];10889}10890Game.recalculateGains=1;10891Game.storeToRefresh=1;10892}10893}10894}10895Game.killBuff=function(what)//remove a buff by name10896{if (Game.buffs[what]){Game.buffs[what].time=0;/*Game.buffs[what]=0;*/}}10897Game.killBuffs=function()//remove all buffs10898{Game.buffsL.innerHTML='';Game.buffs=[];Game.recalculateGains=1;Game.storeToRefresh=1;}108991090010901Game.buffTypes=[];//buff archetypes; only buffs declared from these can be saved and loaded10902Game.buffTypesByName=[];10903Game.buffTypesN=0;10904Game.buffType=function(name,func)10905{10906this.name=name;10907this.func=func;//this is a function that returns a buff object; it takes a "time" argument in seconds, and 3 more optional arguments at most, which will be saved and loaded as floats10908this.id=Game.buffTypesN;10909this.vanilla=Game.vanilla;10910Game.buffTypesByName[this.name]=this;10911Game.buffTypes[Game.buffTypesN]=this;10912Game.buffTypesN++;10913}1091410915/*10916basic buff parameters :10917name:'Kitten rain',10918desc:'It\'s raining kittens!',10919icon:[0,0],10920time:30*Game.fps10921other parameters :10922visible:false - will hide the buff from the buff list10923add:true - if this buff already exists, add the new duration to the old one10924max:true - if this buff already exists, set the new duration to the max of either10925onDie:function(){} - function will execute when the buff runs out10926power:3 - used by some buffs10927multCpS:3 - buff multiplies CpS by this amount10928multClick:3 - buff multiplies click power by this amount10929*/1093010931//base buffs10932new Game.buffType('frenzy',function(time,pow)10933{10934return {10935name:'Frenzy',10936desc:'Cookie production x'+pow+' for '+Game.sayTime(time*Game.fps,-1)+'!',10937icon:[10,14],10938time:time*Game.fps,10939add:true,10940multCpS:pow,10941aura:110942};10943});10944new Game.buffType('blood frenzy',function(time,pow)10945{10946return {10947name:'Elder frenzy',10948desc:'Cookie production x'+pow+' for '+Game.sayTime(time*Game.fps,-1)+'!',10949icon:[29,6],10950time:time*Game.fps,10951add:true,10952multCpS:pow,10953aura:110954};10955});10956new Game.buffType('clot',function(time,pow)10957{10958return {10959name:'Clot',10960desc:'Cookie production halved for '+Game.sayTime(time*Game.fps,-1)+'!',10961icon:[15,5],10962time:time*Game.fps,10963add:true,10964multCpS:pow,10965aura:210966};10967});10968new Game.buffType('dragon harvest',function(time,pow)10969{10970return {10971name:'Dragon Harvest',10972desc:'Cookie production x'+pow+' for '+Game.sayTime(time*Game.fps,-1)+'!',10973icon:[10,25],10974time:time*Game.fps,10975add:true,10976multCpS:pow,10977aura:110978};10979});10980new Game.buffType('everything must go',function(time,pow)10981{10982return {10983name:'Everything must go',10984desc:'All buildings are '+pow+'% cheaper for '+Game.sayTime(time*Game.fps,-1)+'!',10985icon:[17,6],10986time:time*Game.fps,10987add:true,10988power:pow,10989aura:110990};10991});10992new Game.buffType('cursed finger',function(time,pow)10993{10994return {10995name:'Cursed finger',10996desc:'Cookie production halted for '+Game.sayTime(time*Game.fps,-1)+',<br>but each click is worth '+Game.sayTime(time*Game.fps,-1)+' of CpS.',10997icon:[12,17],10998time:time*Game.fps,10999add:true,11000power:pow,11001multCpS:0,11002aura:111003};11004});11005new Game.buffType('click frenzy',function(time,pow)11006{11007return {11008name:'Click frenzy',11009desc:'Clicking power x'+pow+' for '+Game.sayTime(time*Game.fps,-1)+'!',11010icon:[0,14],11011time:time*Game.fps,11012add:true,11013multClick:pow,11014aura:111015};11016});11017new Game.buffType('dragonflight',function(time,pow)11018{11019return {11020name:'Dragonflight',11021desc:'Clicking power x'+pow+' for '+Game.sayTime(time*Game.fps,-1)+'!',11022icon:[0,25],11023time:time*Game.fps,11024add:true,11025multClick:pow,11026aura:111027};11028});11029new Game.buffType('cookie storm',function(time,pow)11030{11031return {11032name:'Cookie storm',11033desc:'Cookies everywhere!',11034icon:[22,6],11035time:time*Game.fps,11036add:true,11037power:pow,11038aura:111039};11040});11041new Game.buffType('building buff',function(time,pow,building)11042{11043var obj=Game.ObjectsById[building];11044return {11045name:Game.goldenCookieBuildingBuffs[obj.name][0],11046desc:'Your '+obj.amount+' '+obj.plural+' are boosting your CpS!<br>Cookie production +'+(Math.ceil(pow*100-100))+'% for '+Game.sayTime(time*Game.fps,-1)+'!',11047icon:[obj.iconColumn,14],11048time:time*Game.fps,11049add:true,11050multCpS:pow,11051aura:111052};11053});11054new Game.buffType('building debuff',function(time,pow,building)11055{11056var obj=Game.ObjectsById[building];11057return {11058name:Game.goldenCookieBuildingBuffs[obj.name][1],11059desc:'Your '+obj.amount+' '+obj.plural+' are rusting your CpS!<br>Cookie production '+(Math.ceil(pow*100-100))+'% slower for '+Game.sayTime(time*Game.fps,-1)+'!',11060icon:[obj.iconColumn,15],11061time:time*Game.fps,11062add:true,11063multCpS:1/pow,11064aura:211065};11066});11067new Game.buffType('sugar blessing',function(time,pow)11068{11069return {11070name:'Sugar blessing',11071desc:'You find 10% more golden cookies for the next '+Game.sayTime(time*Game.fps,-1)+'.',11072icon:[29,16],11073time:time*Game.fps,11074//add:true11075};11076});11077new Game.buffType('haggler luck',function(time,pow)11078{11079return {11080name:'Haggler\'s luck',11081desc:'All upgrades are '+pow+'% cheaper for '+Game.sayTime(time*Game.fps,-1)+'!',11082icon:[25,11],11083time:time*Game.fps,11084power:pow,11085max:true11086};11087});11088new Game.buffType('haggler misery',function(time,pow)11089{11090return {11091name:'Haggler\'s misery',11092desc:'All upgrades are '+pow+'% pricier for '+Game.sayTime(time*Game.fps,-1)+'!',11093icon:[25,11],11094time:time*Game.fps,11095power:pow,11096max:true11097};11098});11099new Game.buffType('pixie luck',function(time,pow)11100{11101return {11102name:'Crafty pixies',11103desc:'All buildings are '+pow+'% cheaper for '+Game.sayTime(time*Game.fps,-1)+'!',11104icon:[26,11],11105time:time*Game.fps,11106power:pow,11107max:true11108};11109});11110new Game.buffType('pixie misery',function(time,pow)11111{11112return {11113name:'Nasty goblins',11114desc:'All buildings are '+pow+'% pricier for '+Game.sayTime(time*Game.fps,-1)+'!',11115icon:[26,11],11116time:time*Game.fps,11117power:pow,11118max:true11119};11120});11121new Game.buffType('magic adept',function(time,pow)11122{11123return {11124name:'Magic adept',11125desc:'Spells backfire '+pow+' times less for '+Game.sayTime(time*Game.fps,-1)+'.',11126icon:[29,11],11127time:time*Game.fps,11128power:pow,11129max:true11130};11131});11132new Game.buffType('magic inept',function(time,pow)11133{11134return {11135name:'Magic inept',11136desc:'Spells backfire '+pow+' times more for '+Game.sayTime(time*Game.fps,-1)+'.',11137icon:[29,11],11138time:time*Game.fps,11139power:pow,11140max:true11141};11142});11143new Game.buffType('devastation',function(time,pow)11144{11145return {11146name:'Devastation',11147desc:'Clicking power +'+Math.floor(pow*100-100)+'% for '+Game.sayTime(time*Game.fps,-1)+'!',11148icon:[23,18],11149time:time*Game.fps,11150multClick:pow,11151aura:1,11152max:true11153};11154});11155new Game.buffType('sugar frenzy',function(time,pow)11156{11157return {11158name:'Sugar frenzy',11159desc:'Cookie production x'+pow+' for '+Game.sayTime(time*Game.fps,-1)+'!',11160icon:[29,14],11161time:time*Game.fps,11162add:true,11163multCpS:pow,11164aura:011165};11166});1116711168//end of buffs111691117011171111721117311174BeautifyAll();11175Game.vanilla=0;//everything we create beyond this will not be saved in the default save111761117711178for (var i in Game.customCreate) {Game.customCreate[i]();}111791118011181/*=====================================================================================11182GRANDMAPOCALYPSE11183=======================================================================================*/11184Game.UpdateGrandmapocalypse=function()11185{11186if (Game.Has('Elder Covenant') || Game.Objects['Grandma'].amount==0) Game.elderWrath=0;11187else if (Game.pledgeT>0)//if the pledge is active, lower it11188{11189Game.pledgeT--;11190if (Game.pledgeT==0)//did we reach 0? make the pledge purchasable again11191{11192Game.Lock('Elder Pledge');11193Game.Unlock('Elder Pledge');11194Game.elderWrath=1;11195}11196}11197else11198{11199if (Game.Has('One mind') && Game.elderWrath==0)11200{11201Game.elderWrath=1;11202}11203if (Math.random()<0.001 && Game.elderWrath<Game.Has('One mind')+Game.Has('Communal brainsweep')+Game.Has('Elder Pact'))11204{11205Game.elderWrath++;//have we already pledged? make the elder wrath shift between different stages11206}11207if (Game.Has('Elder Pact') && Game.Upgrades['Elder Pledge'].unlocked==0)11208{11209Game.Lock('Elder Pledge');11210Game.Unlock('Elder Pledge');11211}11212}11213Game.elderWrathD+=((Game.elderWrath+1)-Game.elderWrathD)*0.001;//slowly fade to the target wrath state1121411215if (Game.elderWrath!=Game.elderWrathOld) Game.storeToRefresh=1;1121611217Game.elderWrathOld=Game.elderWrath;1121811219Game.UpdateWrinklers();11220}1122111222//wrinklers1122311224function inRect(x,y,rect)11225{11226//find out if the point x,y is in the rotated rectangle rect{w,h,r,o} (width,height,rotation in radians,y-origin) (needs to be normalized)11227//I found this somewhere online I guess11228var dx = x+Math.sin(-rect.r)*(-(rect.h/2-rect.o)),dy=y+Math.cos(-rect.r)*(-(rect.h/2-rect.o));11229var h1 = Math.sqrt(dx*dx + dy*dy);11230var currA = Math.atan2(dy,dx);11231var newA = currA - rect.r;11232var x2 = Math.cos(newA) * h1;11233var y2 = Math.sin(newA) * h1;11234if (x2 > -0.5 * rect.w && x2 < 0.5 * rect.w && y2 > -0.5 * rect.h && y2 < 0.5 * rect.h) return true;11235return false;11236}1123711238Game.wrinklerHP=2.1;11239Game.wrinklers=[];11240for (var i=0;i<12;i++)11241{11242Game.wrinklers.push({id:parseInt(i),close:0,sucked:0,phase:0,x:0,y:0,r:0,hurt:0,hp:Game.wrinklerHP,selected:0,type:0});11243}11244Game.getWrinklersMax=function()11245{11246var n=10;11247if (Game.Has('Elder spice')) n+=2;11248return n;11249}11250Game.ResetWrinklers=function()11251{11252for (var i in Game.wrinklers)11253{11254Game.wrinklers[i]={id:parseInt(i),close:0,sucked:0,phase:0,x:0,y:0,r:0,hurt:0,hp:Game.wrinklerHP,selected:0,type:0};11255}11256}11257Game.CollectWrinklers=function()11258{11259for (var i in Game.wrinklers)11260{11261Game.wrinklers[i].hp=0;11262}11263}11264Game.wrinklerSquishSound=Math.floor(Math.random()*4)+1;11265Game.playWrinklerSquishSound=function()11266{11267PlaySound('snd/squish'+(Game.wrinklerSquishSound)+'.mp3',0.5);11268Game.wrinklerSquishSound+=Math.floor(Math.random()*1.5)+1;11269if (Game.wrinklerSquishSound>4) Game.wrinklerSquishSound-=4;11270}11271Game.SpawnWrinkler=function(me)11272{11273if (!me)11274{11275var max=Game.getWrinklersMax();11276var n=0;11277for (var i in Game.wrinklers)11278{11279if (Game.wrinklers[i].phase>0) n++;11280}11281for (var i in Game.wrinklers)11282{11283var it=Game.wrinklers[i];11284if (it.phase==0 && Game.elderWrath>0 && n<max && it.id<max)11285{11286me=it;11287break;11288}11289}11290}11291if (!me) return false;11292me.phase=1;11293me.hp=Game.wrinklerHP;11294me.type=0;11295if (Math.random()<0.0001) me.type=1;//shiny wrinkler11296return me;11297}11298Game.PopRandomWrinkler=function()11299{11300var wrinklers=[];11301for (var i in Game.wrinklers)11302{11303if (Game.wrinklers[i].phase>0 && Game.wrinklers[i].hp>0) wrinklers.push(Game.wrinklers[i]);11304}11305if (wrinklers.length>0)11306{11307var me=choose(wrinklers);11308me.hp=-10;11309return me;11310}11311return false;11312}11313Game.UpdateWrinklers=function()11314{11315var xBase=0;11316var yBase=0;11317var onWrinkler=0;11318if (Game.LeftBackground)11319{11320xBase=Game.cookieOriginX;11321yBase=Game.cookieOriginY;11322}11323var max=Game.getWrinklersMax();11324var n=0;11325for (var i in Game.wrinklers)11326{11327if (Game.wrinklers[i].phase>0) n++;11328}11329for (var i in Game.wrinklers)11330{11331var me=Game.wrinklers[i];11332if (me.phase==0 && Game.elderWrath>0 && n<max && me.id<max)11333{11334var chance=0.00001*Game.elderWrath;11335chance*=Game.eff('wrinklerSpawn');11336if (Game.Has('Unholy bait')) chance*=5;11337if (Game.hasGod)11338{11339var godLvl=Game.hasGod('scorn');11340if (godLvl==1) chance*=2.5;11341else if (godLvl==2) chance*=2;11342else if (godLvl==3) chance*=1.5;11343}11344if (Game.Has('Wrinkler doormat')) chance=0.1;11345if (Math.random()<chance)//respawn11346{11347Game.SpawnWrinkler(me);11348}11349}11350if (me.phase>0)11351{11352if (me.close<1) me.close+=(1/Game.fps)/10;11353if (me.close>1) me.close=1;11354}11355else me.close=0;11356if (me.close==1 && me.phase==1)11357{11358me.phase=2;11359Game.recalculateGains=1;11360}11361if (me.phase==2)11362{11363me.sucked+=(((Game.cookiesPs/Game.fps)*Game.cpsSucked));//suck the cookies11364}11365if (me.phase>0)11366{11367if (me.type==0)11368{11369if (me.hp<Game.wrinklerHP) me.hp+=0.04;11370me.hp=Math.min(Game.wrinklerHP,me.hp);11371}11372else if (me.type==1)11373{11374if (me.hp<Game.wrinklerHP*3) me.hp+=0.04;11375me.hp=Math.min(Game.wrinklerHP*3,me.hp);11376}11377var d=128*(2-me.close);//*Game.BigCookieSize;11378if (Game.prefs.fancy) d+=Math.cos(Game.T*0.05+parseInt(me.id))*4;11379me.r=(me.id/max)*360;11380if (Game.prefs.fancy) me.r+=Math.sin(Game.T*0.05+parseInt(me.id))*4;11381me.x=xBase+(Math.sin(me.r*Math.PI/180)*d);11382me.y=yBase+(Math.cos(me.r*Math.PI/180)*d);11383if (Game.prefs.fancy) me.r+=Math.sin(Game.T*0.09+parseInt(me.id))*4;11384var rect={w:100,h:200,r:(-me.r)*Math.PI/180,o:10};11385if (Math.random()<0.01) me.hurt=Math.max(me.hurt,Math.random());11386if (Game.T%5==0 && Game.CanClick) {if (Game.LeftBackground && Game.mouseX<Game.LeftBackground.canvas.width && inRect(Game.mouseX-me.x,Game.mouseY-me.y,rect)) me.selected=1; else me.selected=0;}11387if (me.selected && onWrinkler==0 && Game.CanClick)11388{11389me.hurt=Math.max(me.hurt,0.25);11390//me.close*=0.99;11391if (Game.Click && Game.lastClickedEl==l('backgroundLeftCanvas'))11392{11393if (Game.keys[17] && Game.sesame) {me.type=!me.type;PlaySound('snd/shimmerClick.mp3');}//ctrl-click on a wrinkler in god mode to toggle its shininess11394else11395{11396Game.playWrinklerSquishSound();11397me.hurt=1;11398me.hp-=0.75;11399if (Game.prefs.particles && !(me.hp<=0.5 && me.phase>0))11400{11401var x=me.x+(Math.sin(me.r*Math.PI/180)*90);11402var y=me.y+(Math.cos(me.r*Math.PI/180)*90);11403for (var ii=0;ii<3;ii++)11404{11405//Game.particleAdd(x+Math.random()*50-25,y+Math.random()*50-25,Math.random()*4-2,Math.random()*-2-2,1,1,2,'wrinklerBits.png');11406var part=Game.particleAdd(x,y,Math.random()*4-2,Math.random()*-2-2,1,1,2,me.type==1?'shinyWrinklerBits.png':'wrinklerBits.png');11407part.r=-me.r;11408}11409}11410}11411Game.Click=0;11412}11413onWrinkler=1;11414}11415}1141611417if (me.hurt>0)11418{11419me.hurt-=5/Game.fps;11420//me.close-=me.hurt*0.05;11421//me.x+=Math.random()*2-1;11422//me.y+=Math.random()*2-1;11423me.r+=(Math.sin(Game.T*1)*me.hurt)*18;//Math.random()*2-1;11424}11425if (me.hp<=0.5 && me.phase>0)11426{11427Game.playWrinklerSquishSound();11428PlaySound('snd/pop'+Math.floor(Math.random()*3+1)+'.mp3',0.75);11429Game.wrinklersPopped++;11430Game.recalculateGains=1;11431me.phase=0;11432me.close=0;11433me.hurt=0;11434me.hp=3;11435var toSuck=1.1;11436if (Game.Has('Sacrilegious corruption')) toSuck*=1.05;11437if (me.type==1) toSuck*=3;//shiny wrinklers are an elusive, profitable breed11438me.sucked*=toSuck;//cookie dough does weird things inside wrinkler digestive tracts11439if (Game.Has('Wrinklerspawn')) me.sucked*=1.05;11440if (Game.hasGod)11441{11442var godLvl=Game.hasGod('scorn');11443if (godLvl==1) me.sucked*=1.15;11444else if (godLvl==2) me.sucked*=1.1;11445else if (godLvl==3) me.sucked*=1.05;11446}11447if (me.sucked>0.5)11448{11449if (Game.prefs.popups) Game.Popup('Exploded a '+(me.type==1?'shiny ':'')+'wrinkler : found '+Beautify(me.sucked)+' cookies!');11450else Game.Notify('Exploded a '+(me.type==1?'shiny ':'')+'wrinkler','Found <b>'+Beautify(me.sucked)+'</b> cookies!',[19,8],6);11451Game.Popup('<div style="font-size:80%;">+'+Beautify(me.sucked)+' cookies</div>',Game.mouseX,Game.mouseY);1145211453if (Game.season=='halloween')11454{11455//if (Math.random()<(Game.HasAchiev('Spooky cookies')?0.2:0.05))//halloween cookie drops11456var failRate=0.95;11457if (Game.HasAchiev('Spooky cookies')) failRate=0.8;11458if (Game.Has('Starterror')) failRate*=0.9;11459failRate*=1/Game.dropRateMult();11460if (Game.hasGod)11461{11462var godLvl=Game.hasGod('seasons');11463if (godLvl==1) failRate*=0.9;11464else if (godLvl==2) failRate*=0.95;11465else if (godLvl==3) failRate*=0.97;11466}11467if (me.type==1) failRate*=0.9;11468if (Math.random()>failRate)//halloween cookie drops11469{11470var cookie=choose(['Skull cookies','Ghost cookies','Bat cookies','Slime cookies','Pumpkin cookies','Eyeball cookies','Spider cookies']);11471if (!Game.HasUnlocked(cookie) && !Game.Has(cookie))11472{11473Game.Unlock(cookie);11474if (Game.prefs.popups) Game.Popup('Found : '+cookie+'!');11475else Game.Notify(cookie,'You also found <b>'+cookie+'</b>!',Game.Upgrades[cookie].icon);11476}11477}11478}11479Game.DropEgg(0.98);11480}11481if (me.type==1) Game.Win('Last Chance to See');11482Game.Earn(me.sucked);11483/*if (Game.prefs.particles)11484{11485var x=me.x+(Math.sin(me.r*Math.PI/180)*100);11486var y=me.y+(Math.cos(me.r*Math.PI/180)*100);11487for (var ii=0;ii<6;ii++)11488{11489Game.particleAdd(x+Math.random()*50-25,y+Math.random()*50-25,Math.random()*4-2,Math.random()*-2-2,1,1,2,'wrinklerBits.png');11490}11491}*/11492if (Game.prefs.particles)11493{11494var x=me.x+(Math.sin(me.r*Math.PI/180)*90);11495var y=me.y+(Math.cos(me.r*Math.PI/180)*90);11496if (me.sucked>0)11497{11498for (var ii=0;ii<5;ii++)11499{11500Game.particleAdd(Game.mouseX,Game.mouseY,Math.random()*4-2,Math.random()*-2-2,Math.random()*0.5+0.75,1.5,2);11501}11502}11503for (var ii=0;ii<8;ii++)11504{11505var part=Game.particleAdd(x,y,Math.random()*4-2,Math.random()*-2-2,1,1,2,me.type==1?'shinyWrinklerBits.png':'wrinklerBits.png');11506part.r=-me.r;11507}11508}11509me.sucked=0;11510}11511}11512if (onWrinkler)11513{11514Game.mousePointer=1;11515}11516}11517Game.DrawWrinklers=function()11518{11519var ctx=Game.LeftBackground;11520var selected=0;11521for (var i in Game.wrinklers)11522{11523var me=Game.wrinklers[i];11524if (me.phase>0)11525{11526ctx.globalAlpha=me.close;11527ctx.save();11528ctx.translate(me.x,me.y);11529ctx.rotate(-(me.r)*Math.PI/180);11530//var s=Math.min(1,me.sucked/(Game.cookiesPs*60))*0.75+0.25;//scale wrinklers as they eat11531//ctx.scale(Math.pow(s,1.5)*1.25,s);11532//ctx.fillRect(-50,-10,100,200);11533if (me.type==1) ctx.drawImage(Pic('shinyWrinkler.png'),-50,-10);11534else if (Game.season=='christmas') ctx.drawImage(Pic('winterWrinkler.png'),-50,-10);11535else ctx.drawImage(Pic('wrinkler.png'),-50,-10);11536//ctx.fillText(me.id+' : '+me.sucked,0,0);11537if (me.type==1 && Math.random()<0.3 && Game.prefs.particles)//sparkle11538{11539ctx.globalAlpha=Math.random()*0.65+0.1;11540var s=Math.random()*30+5;11541ctx.globalCompositeOperation='lighter';11542ctx.drawImage(Pic('glint.jpg'),-s/2+Math.random()*50-25,-s/2+Math.random()*200,s,s);11543}11544ctx.restore();1154511546if (me.phase==2 && Math.random()<0.03 && Game.prefs.particles)11547{11548Game.particleAdd(me.x,me.y,Math.random()*4-2,Math.random()*-2-2,Math.random()*0.5+0.5,1,2);11549}1155011551if (me.selected) selected=me;11552}11553}11554if (selected && Game.Has('Eye of the wrinkler'))11555{11556var x=Game.cookieOriginX;11557var y=Game.cookieOriginY;11558ctx.font='14px Merriweather';11559ctx.textAlign='center';11560var width=Math.max(ctx.measureText('Swallowed :').width,ctx.measureText(Beautify(selected.sucked)).width);11561ctx.fillStyle='#000';11562ctx.strokeStyle='#000';11563ctx.lineWidth=8;11564ctx.globalAlpha=0.5;11565ctx.beginPath();11566ctx.moveTo(x,y);11567ctx.lineTo(Math.floor(selected.x),Math.floor(selected.y));11568ctx.stroke();11569ctx.fillRect(x-width/2-8-14,y-23,width+16+28,38);11570ctx.globalAlpha=1;11571ctx.fillStyle='#fff';11572ctx.fillText('Swallowed :',x+14,y-8);11573ctx.fillText(Beautify(selected.sucked),x+14,y+8);11574ctx.drawImage(Pic('icons.png'),27*48,26*48,48,48,x-width/2-8-22,y-4-24,48,48);11575}11576}11577Game.SaveWrinklers=function()11578{11579var amount=0;11580var amountShinies=0;11581var number=0;11582var shinies=0;11583for (var i in Game.wrinklers)11584{11585if (Game.wrinklers[i].sucked>0.5)11586{11587number++;11588if (Game.wrinklers[i].type==1)11589{11590shinies++;11591amountShinies+=Game.wrinklers[i].sucked;11592}11593else amount+=Game.wrinklers[i].sucked;11594}11595}11596return {amount:amount,number:number,shinies:shinies,amountShinies:amountShinies};11597}11598Game.LoadWrinklers=function(amount,number,shinies,amountShinies)11599{11600if (number>0 && (amount>0 || amountShinies>0))11601{11602var fullNumber=number-shinies;11603var fullNumberShinies=shinies;11604for (var i in Game.wrinklers)11605{11606if (number>0)11607{11608Game.wrinklers[i].phase=2;11609Game.wrinklers[i].close=1;11610Game.wrinklers[i].hp=3;11611if (shinies>0) {Game.wrinklers[i].type=1;Game.wrinklers[i].sucked=amountShinies/fullNumberShinies;shinies--;}11612else Game.wrinklers[i].sucked=amount/fullNumber;11613number--;11614}//respawn11615}11616}11617}1161811619/*=====================================================================================11620SPECIAL THINGS AND STUFF11621=======================================================================================*/116221162311624Game.specialTab='';11625Game.specialTabHovered='';11626Game.specialTabs=[];1162711628Game.UpdateSpecial=function()11629{11630Game.specialTabs=[];11631if (Game.Has('A festive hat')) Game.specialTabs.push('santa');11632if (Game.Has('A crumbly egg')) Game.specialTabs.push('dragon');11633if (Game.specialTabs.length==0) {Game.ToggleSpecialMenu(0);return;}1163411635if (Game.LeftBackground)11636{11637Game.specialTabHovered='';11638var len=Game.specialTabs.length;11639if (len==0) return;11640var y=Game.LeftBackground.canvas.height-24-48*len;11641for (var i in Game.specialTabs)11642{11643var selected=0;11644if (Game.specialTab==Game.specialTabs[i]) selected=1;11645var x=24;11646var s=1;11647if (selected) {s=2;x+=24;}1164811649if (Math.abs(Game.mouseX-x)<=24*s && Math.abs(Game.mouseY-y)<=24*s)11650{11651Game.specialTabHovered=Game.specialTabs[i];11652Game.mousePointer=1;11653Game.CanClick=0;11654if (Game.Click)11655{11656if (Game.specialTab!=Game.specialTabs[i]) {Game.specialTab=Game.specialTabs[i];Game.ToggleSpecialMenu(1);PlaySound('snd/press.mp3');}11657else {Game.ToggleSpecialMenu(0);PlaySound('snd/press.mp3');}11658//PlaySound('snd/tick.mp3');11659}11660}1166111662y+=48;11663}11664}11665}1166611667Game.santaLevels=['Festive test tube','Festive ornament','Festive wreath','Festive tree','Festive present','Festive elf fetus','Elf toddler','Elfling','Young elf','Bulky elf','Nick','Santa Claus','Elder Santa','True Santa','Final Claus'];11668for (var i in Game.santaDrops)//scale christmas upgrade prices with santa level11669{Game.Upgrades[Game.santaDrops[i]].priceFunc=function(){return Math.pow(3,Game.santaLevel)*2525;}}116701167111672Game.UpgradeSanta=function()11673{11674var moni=Math.pow(Game.santaLevel+1,Game.santaLevel+1);11675if (Game.cookies>moni && Game.santaLevel<14)11676{11677PlaySound('snd/shimmerClick.mp3');1167811679Game.Spend(moni);11680Game.santaLevel=(Game.santaLevel+1)%15;11681if (Game.santaLevel==14)11682{11683Game.Unlock('Santa\'s dominion');11684if (Game.prefs.popups) Game.Popup('You are granted<br>Santa\'s dominion.');11685else Game.Notify('You are granted Santa\'s dominion.','',Game.Upgrades['Santa\'s dominion'].icon);11686}11687var drops=[];11688for (var i in Game.santaDrops) {if (!Game.HasUnlocked(Game.santaDrops[i])) drops.push(Game.santaDrops[i]);}11689var drop=choose(drops);11690if (drop)11691{11692Game.Unlock(drop);11693if (Game.prefs.popups) Game.Popup('You find a present which contains...<br>'+drop+'!');11694else Game.Notify('Found a present!','You find a present which contains...<br><b>'+drop+'</b>!',Game.Upgrades[drop].icon);11695}1169611697Game.ToggleSpecialMenu(1);1169811699if (l('specialPic')){var rect=l('specialPic').getBoundingClientRect();Game.SparkleAt((rect.left+rect.right)/2,(rect.top+rect.bottom)/2);}1170011701if (Game.santaLevel>=6) Game.Win('Coming to town');11702if (Game.santaLevel>=14) Game.Win('All hail Santa');11703Game.recalculateGains=1;11704Game.upgradesToRebuild=1;11705}11706}1170711708Game.dragonLevels=[11709{name:'Dragon egg',action:'Chip it',pic:0,11710cost:function(){return Game.cookies>=1000000;},11711buy:function(){Game.Spend(1000000);},11712costStr:function(){return Beautify(1000000)+' cookies';}},11713{name:'Dragon egg',action:'Chip it',pic:1,11714cost:function(){return Game.cookies>=1000000*2;},11715buy:function(){Game.Spend(1000000*2);},11716costStr:function(){return Beautify(1000000*2)+' cookies';}},11717{name:'Dragon egg',action:'Chip it',pic:2,11718cost:function(){return Game.cookies>=1000000*4;},11719buy:function(){Game.Spend(1000000*4);},11720costStr:function(){return Beautify(1000000*4)+' cookies';}},11721{name:'Shivering dragon egg',action:'Hatch it',pic:3,11722cost:function(){return Game.cookies>=1000000*8;},11723buy:function(){Game.Spend(1000000*8);},11724costStr:function(){return Beautify(1000000*8)+' cookies';}},11725{name:'Krumblor, cookie hatchling',action:'Train Breath of Milk<br><small>Aura : kittens are 5% more effective</small>',pic:4,11726cost:function(){return Game.cookies>=1000000*16;},11727buy:function(){Game.Spend(1000000*16);},11728costStr:function(){return Beautify(1000000*16)+' cookies';}},11729{name:'Krumblor, cookie hatchling',action:'Train Dragon Cursor<br><small>Aura : clicking is 5% more effective</small>',pic:4,11730cost:function(){return Game.Objects['Cursor'].amount>=100;},11731buy:function(){Game.Objects['Cursor'].sacrifice(100);},11732costStr:function(){return '100 cursors';}},11733{name:'Krumblor, cookie hatchling',action:'Train Elder Battalion<br><small>Aura : grandmas gain +1% CpS for every non-grandma building</small>',pic:4,11734cost:function(){return Game.Objects['Grandma'].amount>=100;},11735buy:function(){Game.Objects['Grandma'].sacrifice(100);},11736costStr:function(){return '100 grandmas';}},11737{name:'Krumblor, cookie hatchling',action:'Train Reaper of Fields<br><small>Aura : golden cookies may trigger a Dragon Harvest</small>',pic:4,11738cost:function(){return Game.Objects['Farm'].amount>=100;},11739buy:function(){Game.Objects['Farm'].sacrifice(100);},11740costStr:function(){return '100 farms';}},11741{name:'Krumblor, cookie dragon',action:'Train Earth Shatterer<br><small>Aura : buildings sell back for 50% instead of 25%</small>',pic:5,11742cost:function(){return Game.Objects['Mine'].amount>=100;},11743buy:function(){Game.Objects['Mine'].sacrifice(100);},11744costStr:function(){return '100 mines';}},11745{name:'Krumblor, cookie dragon',action:'Train Master of the Armory<br><small>Aura : all upgrades are 2% cheaper</small>',pic:5,11746cost:function(){return Game.Objects['Factory'].amount>=100;},11747buy:function(){Game.Objects['Factory'].sacrifice(100);},11748costStr:function(){return '100 factories';}},11749{name:'Krumblor, cookie dragon',action:'Train Fierce Hoarder<br><small>Aura : all buildings are 2% cheaper</small>',pic:5,11750cost:function(){return Game.Objects['Bank'].amount>=100;},11751buy:function(){Game.Objects['Bank'].sacrifice(100);},11752costStr:function(){return '100 banks';}},11753{name:'Krumblor, cookie dragon',action:'Train Dragon God<br><small>Aura : prestige CpS bonus +5%</small>',pic:5,11754cost:function(){return Game.Objects['Temple'].amount>=100;},11755buy:function(){Game.Objects['Temple'].sacrifice(100);},11756costStr:function(){return '100 temples';}},11757{name:'Krumblor, cookie dragon',action:'Train Arcane Aura<br><small>Aura : golden cookies appear 5% more often</small>',pic:5,11758cost:function(){return Game.Objects['Wizard tower'].amount>=100;},11759buy:function(){Game.Objects['Wizard tower'].sacrifice(100);},11760costStr:function(){return '100 wizard towers';}},11761{name:'Krumblor, cookie dragon',action:'Train Dragonflight<br><small>Aura : golden cookies may trigger a Dragonflight</small>',pic:5,11762cost:function(){return Game.Objects['Shipment'].amount>=100;},11763buy:function(){Game.Objects['Shipment'].sacrifice(100);},11764costStr:function(){return '100 shipments';}},11765{name:'Krumblor, cookie dragon',action:'Train Ancestral Metamorphosis<br><small>Aura : golden cookies give 10% more cookies</small>',pic:5,11766cost:function(){return Game.Objects['Alchemy lab'].amount>=100;},11767buy:function(){Game.Objects['Alchemy lab'].sacrifice(100);},11768costStr:function(){return '100 alchemy labs';}},11769{name:'Krumblor, cookie dragon',action:'Train Unholy Dominion<br><small>Aura : wrath cookies give 10% more cookies</small>',pic:5,11770cost:function(){return Game.Objects['Portal'].amount>=100;},11771buy:function(){Game.Objects['Portal'].sacrifice(100);},11772costStr:function(){return '100 portals';}},11773{name:'Krumblor, cookie dragon',action:'Train Epoch Manipulator<br><small>Aura : golden cookie effects last 5% longer</small>',pic:5,11774cost:function(){return Game.Objects['Time machine'].amount>=100;},11775buy:function(){Game.Objects['Time machine'].sacrifice(100);},11776costStr:function(){return '100 time machines';}},11777{name:'Krumblor, cookie dragon',action:'Train Mind Over Matter<br><small>Aura : +25% random drops</small>',pic:5,11778cost:function(){return Game.Objects['Antimatter condenser'].amount>=100;},11779buy:function(){Game.Objects['Antimatter condenser'].sacrifice(100);},11780costStr:function(){return '100 antimatter condensers';}},11781{name:'Krumblor, cookie dragon',action:'Train Radiant Appetite<br><small>Aura : all cookie production multiplied by 2</small>',pic:5,11782cost:function(){return Game.Objects['Prism'].amount>=100;},11783buy:function(){Game.Objects['Prism'].sacrifice(100);},11784costStr:function(){return '100 prisms';}},11785{name:'Krumblor, cookie dragon',action:'Train Dragon\'s Fortune<br><small>Aura : +123% CpS per golden cookie on-screen</small>',pic:5,11786cost:function(){return Game.Objects['Chancemaker'].amount>=100;},11787buy:function(){Game.Objects['Chancemaker'].sacrifice(100);},11788costStr:function(){return '100 chancemakers';}},11789{name:'Krumblor, cookie dragon',action:'Train Dragon\'s Curve<br><small>Aura : sugar lumps grow 5% faster, 50% weirder</small>',pic:5,11790cost:function(){return Game.Objects['Fractal engine'].amount>=100;},11791buy:function(){Game.Objects['Fractal engine'].sacrifice(100);},11792costStr:function(){return '100 fractal engines';}},11793{name:'Krumblor, cookie dragon',action:'Train Reality Bending<br><small>Aura : 10% of every other aura, combined</small>',pic:5,11794cost:function(){return Game.Objects['Javascript console'].amount>=100;},11795buy:function(){Game.Objects['Javascript console'].sacrifice(100);},11796costStr:function(){return '100 javascript consoles';}},11797{name:'Krumblor, cookie dragon',action:'Bake dragon cookie<br><small>Delicious!</small>',pic:6,11798cost:function(){var fail=0;for (var i in Game.Objects){if (Game.Objects[i].amount<50) fail=1;}return (fail==0);},11799buy:function(){for (var i in Game.Objects){Game.Objects[i].sacrifice(50);}Game.Unlock('Dragon cookie');},11800costStr:function(){return '50 of every building';}},11801{name:'Krumblor, cookie dragon',action:'Train secondary aura<br><small>Lets you use two dragon auras simultaneously</small>',pic:7,11802cost:function(){var fail=0;for (var i in Game.Objects){if (Game.Objects[i].amount<200) fail=1;}return (fail==0);},11803buy:function(){for (var i in Game.Objects){Game.Objects[i].sacrifice(200);}},11804costStr:function(){return '200 of every building';}},11805{name:'Krumblor, cookie dragon',action:'Your dragon is fully trained.',pic:8}11806];1180711808Game.dragonAuras={118090:{name:'No aura',pic:[0,7],desc:'Select an aura from those your dragon knows.'},118101:{name:'Breath of Milk',pic:[18,25],desc:'Kittens are <b>5%</b> more effective.'},118112:{name:'Dragon Cursor',pic:[0,25],desc:'Clicking is <b>5%</b> more effective.'},118123:{name:'Elder Battalion',pic:[1,25],desc:'Grandmas gain <b>+1% CpS</b> for every non-grandma building.'},118134:{name:'Reaper of Fields',pic:[2,25],desc:'Golden cookies may trigger a <b>Dragon Harvest</b>.'},118145:{name:'Earth Shatterer',pic:[3,25],desc:'Buildings sell back for <b>50%</b> instead of 25%.'},118156:{name:'Master of the Armory',pic:[4,25],desc:'All upgrades are <b>2%</b> cheaper.'},118167:{name:'Fierce Hoarder',pic:[15,25],desc:'All buildings are <b>2%</b> cheaper.'},118178:{name:'Dragon God',pic:[16,25],desc:'Prestige CpS bonus <b>+5%</b>.'},118189:{name:'Arcane Aura',pic:[17,25],desc:'Golden cookies appear <b>+5%</b> more often.'},1181910:{name:'Dragonflight',pic:[5,25],desc:'Golden cookies may trigger a <b>Dragonflight</b>.'},1182011:{name:'Ancestral Metamorphosis',pic:[6,25],desc:'Golden cookies give <b>10%</b> more cookies.'},1182112:{name:'Unholy Dominion',pic:[7,25],desc:'Wrath cookies give <b>10%</b> more cookies.'},1182213:{name:'Epoch Manipulator',pic:[8,25],desc:'Golden cookies last <b>5%</b> longer.'},1182314:{name:'Mind Over Matter',pic:[13,25],desc:'Random drops are <b>25% more common</b>.'},1182415:{name:'Radiant Appetite',pic:[14,25],desc:'All cookie production <b>multiplied by 2</b>.'},1182516:{name:'Dragon\'s Fortune',pic:[19,25],desc:'<b>+123% CpS</b> per golden cookie on-screen, multiplicative.'},1182617:{name:'Dragon\'s Curve',pic:[20,25],desc:'<b>+5% sugar lump growth</b> and sugar lumps are <b>twice as likely</b> to be unusual.'},1182718:{name:'Reality Bending',pic:[32,25],desc:'<b>One tenth</b> of every other dragon aura, <b>combined</b>.'},11828};1182911830Game.hasAura=function(what)11831{11832if (Game.dragonAuras[Game.dragonAura].name==what || Game.dragonAuras[Game.dragonAura2].name==what) return true; else return false;11833}11834Game.auraMult=function(what)11835{11836var n=0;11837if (Game.dragonAuras[Game.dragonAura].name==what || Game.dragonAuras[Game.dragonAura2].name==what) n=1;11838if (Game.dragonAuras[Game.dragonAura].name=='Reality Bending' || Game.dragonAuras[Game.dragonAura2].name=='Reality Bending') n+=0.1;11839return n;11840}1184111842Game.SelectDragonAura=function(slot,update)11843{11844var currentAura=0;11845var otherAura=0;11846if (slot==0) currentAura=Game.dragonAura; else currentAura=Game.dragonAura2;11847if (slot==0) otherAura=Game.dragonAura2; else otherAura=Game.dragonAura;11848if (!update) Game.SelectingDragonAura=currentAura;1184911850var str='';11851for (var i in Game.dragonAuras)11852{11853if (Game.dragonLevel>=parseInt(i)+4)11854{11855var icon=Game.dragonAuras[i].pic;11856if (i==0 || i!=otherAura) str+='<div class="crate enabled'+(i==Game.SelectingDragonAura?' highlighted':'')+'" style="opacity:1;float:none;display:inline-block;'+(icon[2]?'background-image:url('+icon[2]+');':'')+'background-position:'+(-icon[0]*48)+'px '+(-icon[1]*48)+'px;" '+Game.clickStr+'="PlaySound(\'snd/tick.mp3\');Game.SetDragonAura('+i+','+slot+');" onMouseOut="Game.DescribeDragonAura('+Game.SelectingDragonAura+');" onMouseOver="Game.DescribeDragonAura('+i+');"'+11857'></div>';11858}11859}1186011861var highestBuilding=0;11862for (var i in Game.Objects) {if (Game.Objects[i].amount>0) highestBuilding=Game.Objects[i];}1186311864Game.Prompt('<h3>Set your dragon\'s '+(slot==1?'secondary ':'')+'aura</h3>'+11865'<div class="line"></div>'+11866'<div id="dragonAuraInfo" style="min-height:60px;"></div>'+11867'<div style="text-align:center;">'+str+'</div>'+11868'<div class="line"></div>'+11869'<div style="text-align:center;margin-bottom:8px;">'+(highestBuilding==0?'Switching your aura is <b>free</b> because you own no buildings.':'The cost of switching your aura is <b>1 '+highestBuilding.name+'</b>.<br>This will affect your CpS!')+'</div>'11870,[['Confirm',(slot==0?'Game.dragonAura':'Game.dragonAura2')+'=Game.SelectingDragonAura;'+(highestBuilding==0 || currentAura==Game.SelectingDragonAura?'':'Game.ObjectsById['+highestBuilding.id+'].sacrifice(1);')+'Game.ToggleSpecialMenu(1);Game.ClosePrompt();'],'Cancel'],0,'widePrompt');11871Game.DescribeDragonAura(Game.SelectingDragonAura);11872}11873Game.SelectingDragonAura=-1;11874Game.SetDragonAura=function(aura,slot)11875{11876Game.SelectingDragonAura=aura;11877Game.SelectDragonAura(slot,1);11878}11879Game.DescribeDragonAura=function(aura)11880{11881l('dragonAuraInfo').innerHTML=11882'<div style="min-width:200px;text-align:center;"><h4>'+Game.dragonAuras[aura].name+'</h4>'+11883'<div class="line"></div>'+11884Game.dragonAuras[aura].desc+11885'</div>';11886}1188711888Game.UpgradeDragon=function()11889{11890if (Game.dragonLevel<Game.dragonLevels.length-1 && Game.dragonLevels[Game.dragonLevel].cost())11891{11892PlaySound('snd/shimmerClick.mp3');11893Game.dragonLevels[Game.dragonLevel].buy();11894Game.dragonLevel=(Game.dragonLevel+1)%Game.dragonLevels.length;1189511896if (Game.dragonLevel>=Game.dragonLevels.length-1) Game.Win('Here be dragon');11897Game.ToggleSpecialMenu(1);11898if (l('specialPic')){var rect=l('specialPic').getBoundingClientRect();Game.SparkleAt((rect.left+rect.right)/2,(rect.top+rect.bottom)/2);}11899Game.recalculateGains=1;11900Game.upgradesToRebuild=1;11901}11902}1190311904Game.ToggleSpecialMenu=function(on)11905{11906if (on)11907{11908var pic='';11909var frame=0;11910if (Game.specialTab=='santa') {pic='santa.png';frame=Game.santaLevel;}11911else if (Game.specialTab=='dragon') {pic='dragon.png?v='+Game.version;frame=Game.dragonLevels[Game.dragonLevel].pic;}11912else {pic='dragon.png?v='+Game.version;frame=4;}1191311914var str='<div id="specialPic" style="position:absolute;left:-16px;top:-64px;width:96px;height:96px;background:url(img/'+pic+');background-position:'+(-frame*96)+'px 0px;filter:drop-shadow(0px 3px 2px #000);-webkit-filter:drop-shadow(0px 3px 2px #000);"></div>';11915str+='<div class="close" onclick="PlaySound(\'snd/press.mp3\');Game.ToggleSpecialMenu(0);">x</div>';1191611917if (Game.specialTab=='santa')11918{11919var moni=Math.pow(Game.santaLevel+1,Game.santaLevel+1);1192011921str+='<h3>'+Game.santaLevels[Game.santaLevel]+'</h3>';11922if (Game.santaLevel<14)11923{11924str+='<div class="line"></div>'+11925'<div class="optionBox" style="margin-bottom:0px;"><a class="option framed large title" '+Game.clickStr+'="Game.UpgradeSanta();">'+11926'<div style="display:table-cell;vertical-align:middle;">Evolve</div>'+11927'<div style="display:table-cell;vertical-align:middle;padding:4px 12px;">|</div>'+11928'<div style="display:table-cell;vertical-align:middle;font-size:65%;">cost :<div'+(Game.cookies>moni?'':' style="color:#777;"')+'>'+Beautify(Math.pow(Game.santaLevel+1,Game.santaLevel+1))+' '+(Game.santaLevel>0?'cookies':'cookie')+'</div></div>'+11929'</a></div>';11930}11931}11932else if (Game.specialTab=='dragon')11933{11934var level=Game.dragonLevels[Game.dragonLevel];1193511936str+='<h3>'+level.name+'</h3>';1193711938if (Game.dragonLevel>=5)11939{11940var icon=Game.dragonAuras[Game.dragonAura].pic;11941str+='<div class="crate enabled" style="opacity:1;position:absolute;right:18px;top:-58px;'+(icon[2]?'background-image:url('+icon[2]+');':'')+'background-position:'+(-icon[0]*48)+'px '+(-icon[1]*48)+'px;" '+Game.clickStr+'="PlaySound(\'snd/tick.mp3\');Game.SelectDragonAura(0);" '+Game.getTooltip(11942'<div style="min-width:200px;text-align:center;"><h4>'+Game.dragonAuras[Game.dragonAura].name+'</h4>'+11943'<div class="line"></div>'+11944Game.dragonAuras[Game.dragonAura].desc+11945'</div>'11946,'top')+11947'></div>';11948}11949if (Game.dragonLevel>=24)//2nd aura slot; increased with last building (javascript consoles)11950{11951var icon=Game.dragonAuras[Game.dragonAura2].pic;11952str+='<div class="crate enabled" style="opacity:1;position:absolute;right:80px;top:-58px;'+(icon[2]?'background-image:url('+icon[2]+');':'')+'background-position:'+(-icon[0]*48)+'px '+(-icon[1]*48)+'px;" '+Game.clickStr+'="PlaySound(\'snd/tick.mp3\');Game.SelectDragonAura(1);" '+Game.getTooltip(11953'<div style="min-width:200px;text-align:center;"><h4>'+Game.dragonAuras[Game.dragonAura2].name+'</h4>'+11954'<div class="line"></div>'+11955Game.dragonAuras[Game.dragonAura2].desc+11956'</div>'11957,'top')+11958'></div>';11959}1196011961if (Game.dragonLevel<Game.dragonLevels.length-1)11962{11963str+='<div class="line"></div>'+11964'<div class="optionBox" style="margin-bottom:0px;"><a class="option framed large title" '+Game.clickStr+'="Game.UpgradeDragon();">'+11965'<div style="display:table-cell;vertical-align:middle;">'+level.action+'</div>'+11966'<div style="display:table-cell;vertical-align:middle;padding:4px 12px;">|</div>'+11967'<div style="display:table-cell;vertical-align:middle;font-size:65%;">sacrifice<div'+(level.cost()?'':' style="color:#777;"')+'>'+level.costStr()+'</div></div>'+11968'</a></div>';11969}11970else11971{11972str+='<div class="line"></div>'+11973'<div style="text-align:center;margin-bottom:4px;">'+level.action+'</div>';11974}11975}1197611977l('specialPopup').innerHTML=str;1197811979l('specialPopup').className='framed prompt onScreen';11980}11981else11982{11983if (Game.specialTab!='')11984{11985Game.specialTab='';11986l('specialPopup').className='framed prompt offScreen';11987setTimeout(function(){if (Game.specialTab=='') {/*l('specialPopup').style.display='none';*/l('specialPopup').innerHTML='';}},1000*0.2);11988}11989}11990}11991Game.DrawSpecial=function()11992{11993var len=Game.specialTabs.length;11994if (len==0) return;11995Game.LeftBackground.globalAlpha=1;11996var y=Game.LeftBackground.canvas.height-24-48*len;11997var tabI=0;1199811999for (var i in Game.specialTabs)12000{12001var selected=0;12002var hovered=0;12003if (Game.specialTab==Game.specialTabs[i]) selected=1;12004if (Game.specialTabHovered==Game.specialTabs[i]) hovered=1;12005var x=24;12006var s=1;12007var pic='';12008var frame=0;12009if (hovered) {s=1;x=24;}12010if (selected) {s=1;x=48;}1201112012if (Game.specialTabs[i]=='santa') {pic='santa.png';frame=Game.santaLevel;}12013else if (Game.specialTabs[i]=='dragon') {pic='dragon.png?v='+Game.version;frame=Game.dragonLevels[Game.dragonLevel].pic;}12014else {pic='dragon.png?v='+Game.version;frame=4;}1201512016if (hovered || selected)12017{12018var ss=s*64;12019var r=Math.floor((Game.T*0.5)%360);12020Game.LeftBackground.save();12021Game.LeftBackground.translate(x,y);12022if (Game.prefs.fancy) Game.LeftBackground.rotate((r/360)*Math.PI*2);12023Game.LeftBackground.globalAlpha=0.75;12024Game.LeftBackground.drawImage(Pic('shine.png'),-ss/2,-ss/2,ss,ss);12025Game.LeftBackground.restore();12026}1202712028if (Game.prefs.fancy) Game.LeftBackground.drawImage(Pic(pic),96*frame,0,96,96,(x+(selected?0:Math.sin(Game.T*0.2+tabI)*3)-24*s),(y-(selected?6:Math.abs(Math.cos(Game.T*0.2+tabI))*6)-24*s),48*s,48*s);12029else Game.LeftBackground.drawImage(Pic(pic),96*frame,0,96,96,(x-24*s),(y-24*s),48*s,48*s);1203012031tabI++;12032y+=48;12033}1203412035}1203612037/*=====================================================================================12038VISUAL EFFECTS12039=======================================================================================*/1204012041Game.Milks=[12042{name:'Rank I - Plain milk',pic:'milkPlain',icon:[1,8]},12043{name:'Rank II - Chocolate milk',pic:'milkChocolate',icon:[2,8]},12044{name:'Rank III - Raspberry milk',pic:'milkRaspberry',icon:[3,8]},12045{name:'Rank IV - Orange milk',pic:'milkOrange',icon:[4,8]},12046{name:'Rank V - Caramel milk',pic:'milkCaramel',icon:[5,8]},12047{name:'Rank VI - Banana milk',pic:'milkBanana',icon:[6,8]},12048{name:'Rank VII - Lime milk',pic:'milkLime',icon:[7,8]},12049{name:'Rank VIII - Blueberry milk',pic:'milkBlueberry',icon:[8,8]},12050{name:'Rank IX - Strawberry milk',pic:'milkStrawberry',icon:[9,8]},12051{name:'Rank X - Vanilla milk',pic:'milkVanilla',icon:[10,8]},12052{name:'Rank XI - Honey milk',pic:'milkHoney',icon:[21,23]},12053{name:'Rank XII - Coffee milk',pic:'milkCoffee',icon:[22,23]},12054{name:'Rank XIII - Tea with a spot of milk',pic:'milkTea',icon:[23,23]},12055{name:'Rank XIV - Coconut milk',pic:'milkCoconut',icon:[24,23]},12056{name:'Rank XV - Cherry milk',pic:'milkCherry',icon:[25,23]},12057{name:'Rank XVI - Spiced milk',pic:'milkSpiced',icon:[26,23]},12058{name:'Rank XVII - Maple milk',pic:'milkMaple',icon:[28,23]},12059{name:'Rank XVIII - Mint milk',pic:'milkMint',icon:[29,23]},12060];12061Game.Milk=Game.Milks[0];1206212063Game.mousePointer=0;//when 1, draw the mouse as a pointer on the left screen1206412065Game.cookieOriginX=0;12066Game.cookieOriginY=0;12067Game.DrawBackground=function()12068{1206912070Timer.clean();12071//background12072if (!Game.Background)//init some stuff12073{12074Game.Background=l('backgroundCanvas').getContext('2d');12075Game.Background.canvas.width=Game.Background.canvas.parentNode.offsetWidth;12076Game.Background.canvas.height=Game.Background.canvas.parentNode.offsetHeight;12077Game.LeftBackground=l('backgroundLeftCanvas').getContext('2d');12078Game.LeftBackground.canvas.width=Game.LeftBackground.canvas.parentNode.offsetWidth;12079Game.LeftBackground.canvas.height=Game.LeftBackground.canvas.parentNode.offsetHeight;12080//preload ascend animation bits so they show up instantly12081Game.LeftBackground.globalAlpha=0;12082Game.LeftBackground.drawImage(Pic('brokenCookie.png'),0,0);12083Game.LeftBackground.drawImage(Pic('brokenCookieHalo.png'),0,0);12084Game.LeftBackground.drawImage(Pic('starbg.jpg'),0,0);1208512086window.addEventListener('resize', function(event)12087{12088Game.Background.canvas.width=Game.Background.canvas.parentNode.offsetWidth;12089Game.Background.canvas.height=Game.Background.canvas.parentNode.offsetHeight;12090Game.LeftBackground.canvas.width=Game.LeftBackground.canvas.parentNode.offsetWidth;12091Game.LeftBackground.canvas.height=Game.LeftBackground.canvas.parentNode.offsetHeight;12092});12093}1209412095var ctx=Game.LeftBackground;1209612097if (Game.OnAscend)12098{12099Timer.clean();12100//starry background on ascend screen12101var w=Game.Background.canvas.width;12102var h=Game.Background.canvas.height;12103var b=Game.ascendl.getBoundingClientRect();12104var x=(b.left+b.right)/2;12105var y=(b.top+b.bottom)/2;12106Game.Background.globalAlpha=0.5;12107var s=1*Game.AscendZoom*(1+Math.cos(Game.T*0.0027)*0.05);12108Game.Background.fillPattern(Pic('starbg.jpg'),0,0,w,h,1024*s,1024*s,x+Game.AscendOffX*0.25*s,y+Game.AscendOffY*0.25*s);12109Timer.track('star layer 1');12110if (Game.prefs.fancy)12111{12112//additional star layer12113Game.Background.globalAlpha=0.5*(0.5+Math.sin(Game.T*0.02)*0.3);12114var s=2*Game.AscendZoom*(1+Math.sin(Game.T*0.002)*0.07);12115//Game.Background.globalCompositeOperation='lighter';12116Game.Background.fillPattern(Pic('starbg.jpg'),0,0,w,h,1024*s,1024*s,x+Game.AscendOffX*0.25*s,y+Game.AscendOffY*0.25*s);12117//Game.Background.globalCompositeOperation='source-over';12118Timer.track('star layer 2');1211912120x=x+Game.AscendOffX*Game.AscendZoom;12121y=y+Game.AscendOffY*Game.AscendZoom;12122//wispy nebula around the center12123Game.Background.save();12124Game.Background.globalAlpha=0.5;12125Game.Background.translate(x,y);12126Game.Background.globalCompositeOperation='lighter';12127Game.Background.rotate(Game.T*0.001);12128s=(600+150*Math.sin(Game.T*0.007))*Game.AscendZoom;12129Game.Background.drawImage(Pic('heavenRing1.jpg'),-s/2,-s/2,s,s);12130Game.Background.rotate(-Game.T*0.0017);12131s=(600+150*Math.sin(Game.T*0.0037))*Game.AscendZoom;12132Game.Background.drawImage(Pic('heavenRing2.jpg'),-s/2,-s/2,s,s);12133Game.Background.restore();12134Timer.track('nebula');1213512136/*12137//links between upgrades12138//not in because I am bad at this12139Game.Background.globalAlpha=1;12140Game.Background.save();12141Game.Background.translate(x,y);12142s=(32)*Game.AscendZoom;1214312144for (var i in Game.PrestigeUpgrades)12145{12146var me=Game.PrestigeUpgrades[i];12147var ghosted=0;12148if (me.canBePurchased || Game.Has('Neuromancy')){}12149else12150{12151for (var ii in me.parents){if (me.parents[ii]!=-1 && me.parents[ii].canBePurchased) ghosted=1;}12152}12153for (var ii in me.parents)//create pulsing links12154{12155if (me.parents[ii]!=-1 && (me.canBePurchased || ghosted))12156{12157var origX=0;12158var origY=0;12159var targX=me.posX+28;12160var targY=me.posY+28;12161if (me.parents[ii]!=-1) {origX=me.parents[ii].posX+28;origY=me.parents[ii].posY+28;}12162var rot=-Math.atan((targY-origY)/(origX-targX));12163if (targX<=origX) rot+=180;12164var dist=Math.floor(Math.sqrt((targX-origX)*(targX-origX)+(targY-origY)*(targY-origY)));12165origX+=2;12166origY-=18;12167//rot=-(Math.PI/2)*(me.id%4);12168Game.Background.translate(origX,origY);12169Game.Background.rotate(rot);12170//Game.Background.drawImage(Pic('linkPulse.png'),-s/2,-s/2,s,s);12171Game.Background.fillPattern(Pic('linkPulse.png'),0,-4,dist,8,32,8);12172Game.Background.rotate(-rot);12173Game.Background.translate(-origX,-origY);12174}12175}12176}12177Game.Background.restore();12178Timer.track('links');12179*/1218012181//Game.Background.drawImage(Pic('shadedBorders.png'),0,0,w,h);12182//Timer.track('border');12183}12184}12185else12186{1218712188var goodBuff=0;12189var badBuff=0;12190for (var i in Game.buffs)12191{12192if (Game.buffs[i].aura==1) goodBuff=1;12193if (Game.buffs[i].aura==2) badBuff=1;12194}1219512196if (Game.drawT%5==0)12197{12198Game.defaultBg='bgBlue';12199Game.bgR=0;1220012201if (Game.season=='fools') Game.defaultBg='bgMoney';12202if (Game.elderWrathD<1)12203{12204Game.bgR=0;12205Game.bg=Game.defaultBg;12206Game.bgFade=Game.defaultBg;12207}12208else if (Game.elderWrathD>=1 && Game.elderWrathD<2)12209{12210Game.bgR=(Game.elderWrathD-1)/1;12211Game.bg=Game.defaultBg;12212Game.bgFade='grandmas1';12213}12214else if (Game.elderWrathD>=2 && Game.elderWrathD<3)12215{12216Game.bgR=(Game.elderWrathD-2)/1;12217Game.bg='grandmas1';12218Game.bgFade='grandmas2';12219}12220else if (Game.elderWrathD>=3)// && Game.elderWrathD<4)12221{12222Game.bgR=(Game.elderWrathD-3)/1;12223Game.bg='grandmas2';12224Game.bgFade='grandmas3';12225}1222612227if (Game.bgType!=0 && Game.ascensionMode!=1)12228{12229Game.bgR=0;12230Game.bg=Game.BGsByChoice[Game.bgType].pic;12231Game.bgFade=Game.bg;12232}1223312234Game.Background.fillPattern(Pic(Game.bg+'.jpg'),0,0,Game.Background.canvas.width,Game.Background.canvas.height,512,512,0,0);12235if (Game.bgR>0)12236{12237Game.Background.globalAlpha=Game.bgR;12238Game.Background.fillPattern(Pic(Game.bgFade+'.jpg'),0,0,Game.Background.canvas.width,Game.Background.canvas.height,512,512,0,0);12239}12240Game.Background.globalAlpha=1;12241Game.Background.drawImage(Pic('shadedBordersSoft.png'),0,0,Game.Background.canvas.width,Game.Background.canvas.height);1224212243}12244Timer.track('window background');1224512246//clear12247ctx.clearRect(0,0,ctx.canvas.width,ctx.canvas.height);12248/*if (Game.AscendTimer<Game.AscendBreakpoint) ctx.clearRect(0,0,ctx.canvas.width,ctx.canvas.height);12249else12250{12251ctx.globalAlpha=0.05;12252ctx.fillStyle='#000';12253ctx.fillRect(0,0,ctx.canvas.width,ctx.canvas.height);12254ctx.globalAlpha=1;12255OldCanvasDrawImage.apply(ctx,[ctx.canvas,Math.random()*4-2,Math.random()*4-2-4]);12256ctx.globalAlpha=1;12257}*/12258Timer.clean();1225912260var showDragon=0;12261if (Game.hasBuff('Dragonflight') || Game.hasBuff('Dragon Harvest')) showDragon=1;1226212263Game.cookieOriginX=Math.floor(ctx.canvas.width/2);12264Game.cookieOriginY=Math.floor(ctx.canvas.height*0.4);1226512266if (Game.AscendTimer==0)12267{12268if (Game.prefs.particles)12269{12270//falling cookies12271var pic='';12272var opacity=1;12273if (Game.elderWrathD<=1.5)12274{12275if (Game.cookiesPs>=1000) pic='cookieShower3.png';12276else if (Game.cookiesPs>=500) pic='cookieShower2.png';12277else if (Game.cookiesPs>=50) pic='cookieShower1.png';12278else pic='';12279}12280if (pic!='')12281{12282if (Game.elderWrathD>=1) opacity=1-((Math.min(Game.elderWrathD,1.5)-1)/0.5);12283ctx.globalAlpha=opacity;12284var y=(Math.floor(Game.T*2)%512);12285ctx.fillPattern(Pic(pic),0,0,ctx.canvas.width,ctx.canvas.height+512,512,512,0,y);12286ctx.globalAlpha=1;12287}12288//snow12289if (Game.season=='christmas')12290{12291var y=(Math.floor(Game.T*2.5)%512);12292ctx.globalAlpha=0.75;12293ctx.globalCompositeOperation='lighter';12294ctx.fillPattern(Pic('snow2.jpg'),0,0,ctx.canvas.width,ctx.canvas.height+512,512,512,0,y);12295ctx.globalCompositeOperation='source-over';12296ctx.globalAlpha=1;12297}12298//hearts12299if (Game.season=='valentines')12300{12301var y=(Math.floor(Game.T*2.5)%512);12302ctx.globalAlpha=1;12303ctx.fillPattern(Pic('heartStorm.png'),0,0,ctx.canvas.width,ctx.canvas.height+512,512,512,0,y);12304ctx.globalAlpha=1;12305}12306Timer.track('left background');1230712308Game.particlesDraw(0);12309ctx.globalAlpha=1;12310Timer.track('particles');1231112312//big cookie shine12313var s=512;1231412315var x=Game.cookieOriginX;12316var y=Game.cookieOriginY;1231712318var r=Math.floor((Game.T*0.5)%360);12319ctx.save();12320ctx.translate(x,y);12321ctx.rotate((r/360)*Math.PI*2);12322var alphaMult=1;12323if (Game.bgType==2 || Game.bgType==4) alphaMult=0.5;12324var pic='shine.png';12325if (goodBuff) {pic='shineGold.png';alphaMult=1;}12326else if (badBuff) {pic='shineRed.png';alphaMult=1;}12327if (goodBuff && Game.prefs.fancy) ctx.globalCompositeOperation='lighter';12328ctx.globalAlpha=0.5*alphaMult;12329ctx.drawImage(Pic(pic),-s/2,-s/2,s,s);12330ctx.rotate((-r*2/360)*Math.PI*2);12331ctx.globalAlpha=0.25*alphaMult;12332ctx.drawImage(Pic(pic),-s/2,-s/2,s,s);12333ctx.restore();12334Timer.track('shine');1233512336if (Game.ReincarnateTimer>0)12337{12338ctx.globalAlpha=1-Game.ReincarnateTimer/Game.ReincarnateDuration;12339ctx.fillStyle='#000';12340ctx.fillRect(0,0,ctx.canvas.width,ctx.canvas.height);12341ctx.globalAlpha=1;12342}1234312344if (showDragon)12345{12346//big dragon12347var s=300*2*(1+Math.sin(Game.T*0.013)*0.1);12348var x=Game.cookieOriginX-s/2;12349var y=Game.cookieOriginY-s/(1.4+0.2*Math.sin(Game.T*0.01));12350ctx.drawImage(Pic('dragonBG.png'),x,y,s,s);12351}1235212353//big cookie12354if (false)//don't do that12355{12356ctx.globalAlpha=1;12357var amount=Math.floor(Game.cookies).toString();12358var digits=amount.length;12359var space=0;12360for (var i=0;i<digits;i++)12361{12362var s=16*(digits-i);12363var num=parseInt(amount[i]);12364if (i>0) space-=s*(1-num/10)/2;12365if (i==0 && num>1) space+=s*0.1;12366for (var ii=0;ii<num;ii++)12367{12368var x=Game.cookieOriginX;12369var y=Game.cookieOriginY;12370var spin=Game.T*(0.005+i*0.001)+i+(ii/num)*Math.PI*2;12371x+=Math.sin(spin)*space;12372y+=Math.cos(spin)*space;12373ctx.drawImage(Pic('perfectCookie.png'),x-s/2,y-s/2,s,s);12374}12375space+=s/2;12376}12377}12378else12379{12380ctx.globalAlpha=1;12381var s=256*Game.BigCookieSize;12382var x=Game.cookieOriginX;12383var y=Game.cookieOriginY;12384ctx.save();12385ctx.translate(x,y);12386if (Game.season=='easter')12387{12388var nestW=304*0.98*Game.BigCookieSize;12389var nestH=161*0.98*Game.BigCookieSize;12390ctx.drawImage(Pic('nest.png'),-nestW/2,-nestH/2+130,nestW,nestH);12391}12392//ctx.rotate(((Game.startDate%360)/360)*Math.PI*2);12393ctx.drawImage(Pic('perfectCookie.png'),-s/2,-s/2,s,s);1239412395if (goodBuff && Game.prefs.particles)//sparkle12396{12397ctx.globalCompositeOperation='lighter';12398for (var i=0;i<1;i++)12399{12400ctx.globalAlpha=Math.random()*0.65+0.1;12401var size=Math.random()*30+5;12402var a=Math.random()*Math.PI*2;12403var d=s*0.9*Math.random()/2;12404ctx.drawImage(Pic('glint.jpg'),-size/2+Math.sin(a)*d,-size/2+Math.cos(a)*d,size,size);12405}12406}1240712408ctx.restore();12409Timer.track('big cookie');12410}12411}12412else//no particles12413{12414//big cookie shine12415var s=512;12416var x=Game.cookieOriginX-s/2;12417var y=Game.cookieOriginY-s/2;12418ctx.globalAlpha=0.5;12419ctx.drawImage(Pic('shine.png'),x,y,s,s);1242012421if (showDragon)12422{12423//big dragon12424var s=300*2*(1+Math.sin(Game.T*0.013)*0.1);12425var x=Game.cookieOriginX-s/2;12426var y=Game.cookieOriginY-s/(1.4+0.2*Math.sin(Game.T*0.01));12427ctx.drawImage(Pic('dragonBG.png'),x,y,s,s);12428}1242912430//big cookie12431ctx.globalAlpha=1;12432var s=256*Game.BigCookieSize;12433var x=Game.cookieOriginX-s/2;12434var y=Game.cookieOriginY-s/2;12435ctx.drawImage(Pic('perfectCookie.png'),x,y,s,s);12436}1243712438//cursors12439if (Game.prefs.cursors)12440{12441ctx.save();12442ctx.translate(Game.cookieOriginX,Game.cookieOriginY);12443var pic=Pic('cursor.png');12444var fancy=Game.prefs.fancy;1244512446if (showDragon) ctx.globalAlpha=0.25;12447var amount=Game.Objects['Cursor'].amount;12448//var spe=-1;12449for (var i=0;i<amount;i++)12450{12451var n=Math.floor(i/50);12452//var a=((i+0.5*n)%50)/50;12453var w=0;12454if (fancy) w=(Math.sin(Game.T*0.025+(((i+n*12)%25)/25)*Math.PI*2));12455if (w>0.997) w=1.5;12456else if (w>0.994) w=0.5;12457else w=0;12458w*=-4;12459if (fancy) w+=Math.sin((n+Game.T*0.01)*Math.PI/2)*4;12460var x=0;12461var y=(140/* *Game.BigCookieSize*/+n*16+w)-16;1246212463var rot=7.2;//(1/50)*36012464if (i==0 && fancy) rot-=Game.T*0.1;12465if (i%50==0) rot+=7.2/2;12466ctx.rotate((rot/360)*Math.PI*2);12467ctx.drawImage(pic,0,0,32,32,x,y,32,32);12468//ctx.drawImage(pic,32*(i==spe),0,32,32,x,y,32,32);1246912470/*if (i==spe)12471{12472y+=16;12473x=Game.cookieOriginX+Math.sin(-((r-5)/360)*Math.PI*2)*y;12474y=Game.cookieOriginY+Math.cos(-((r-5)/360)*Math.PI*2)*y;12475if (Game.CanClick && ctx && Math.abs(Game.mouseX-x)<16 && Math.abs(Game.mouseY-y)<16) Game.mousePointer=1;12476}*/12477}12478ctx.restore();12479Timer.track('cursors');12480}12481}12482else12483{12484var tBase=Math.max(0,(Game.AscendTimer-Game.AscendBreakpoint)/(Game.AscendDuration-Game.AscendBreakpoint));12485//big crumbling cookie12486//var t=(3*Math.pow(tBase,2)-2*Math.pow(tBase,3));//S curve12487var t=Math.pow(tBase,0.5);1248812489var shake=0;12490if (Game.AscendTimer<Game.AscendBreakpoint) {shake=Game.AscendTimer/Game.AscendBreakpoint;}12491//else {shake=1-t;}1249212493ctx.globalAlpha=1;1249412495var x=Game.cookieOriginX;12496var y=Game.cookieOriginY;1249712498x+=(Math.random()*2-1)*10*shake;12499y+=(Math.random()*2-1)*10*shake;1250012501var s=1;12502if (tBase>0)12503{12504ctx.save();12505ctx.globalAlpha=1-Math.pow(t,0.5);12506ctx.translate(x,y);12507ctx.globalCompositeOperation='lighter';12508ctx.rotate(Game.T*0.007);12509s=0.5+Math.pow(tBase,0.6)*1;12510var s2=(600)*s;12511ctx.drawImage(Pic('heavenRing1.jpg'),-s2/2,-s2/2,s2,s2);12512ctx.rotate(-Game.T*0.002);12513s=0.5+Math.pow(1-tBase,0.4)*1;12514s2=(600)*s;12515ctx.drawImage(Pic('heavenRing2.jpg'),-s2/2,-s2/2,s2,s2);12516ctx.restore();12517}1251812519s=256;//*Game.BigCookieSize;1252012521ctx.save();12522ctx.translate(x,y);12523ctx.rotate((t*(-0.1))*Math.PI*2);1252412525var chunks={0:7,1:6,2:3,3:2,4:8,5:1,6:9,7:5,8:0,9:4};12526s*=t/2+1;12527/*ctx.globalAlpha=(1-t)*0.33;12528for (var i=0;i<10;i++)12529{12530var d=(t-0.2)*(80+((i+2)%3)*40);12531ctx.drawImage(Pic('brokenCookie.png'),256*(chunks[i]),0,256,256,-s/2+Math.sin(-(((chunks[i]+4)%10)/10)*Math.PI*2)*d,-s/2+Math.cos(-(((chunks[i]+4)%10)/10)*Math.PI*2)*d,s,s);12532}12533ctx.globalAlpha=(1-t)*0.66;12534for (var i=0;i<10;i++)12535{12536var d=(t-0.1)*(80+((i+2)%3)*40);12537ctx.drawImage(Pic('brokenCookie.png'),256*(chunks[i]),0,256,256,-s/2+Math.sin(-(((chunks[i]+4)%10)/10)*Math.PI*2)*d,-s/2+Math.cos(-(((chunks[i]+4)%10)/10)*Math.PI*2)*d,s,s);12538}*/12539ctx.globalAlpha=1-t;12540for (var i=0;i<10;i++)12541{12542var d=(t)*(80+((i+2)%3)*40);12543var x2=(Math.random()*2-1)*5*shake;12544var y2=(Math.random()*2-1)*5*shake;12545ctx.drawImage(Pic('brokenCookie.png'),256*(chunks[i]),0,256,256,-s/2+Math.sin(-(((chunks[i]+4)%10)/10)*Math.PI*2)*d+x2,-s/2+Math.cos(-(((chunks[i]+4)%10)/10)*Math.PI*2)*d+y2,s,s);12546}12547var brokenHalo=1-Math.min(t/(1/3),1/3)*3;12548if (Game.AscendTimer<Game.AscendBreakpoint) brokenHalo=Game.AscendTimer/Game.AscendBreakpoint;12549ctx.globalAlpha=brokenHalo;12550ctx.drawImage(Pic('brokenCookieHalo.png'),-s/1.3333,-s/1.3333,s*1.5,s*1.5);1255112552ctx.restore();1255312554//flares12555var n=9;12556var t=Game.AscendTimer/Game.AscendBreakpoint;12557if (Game.AscendTimer<Game.AscendBreakpoint)12558{12559ctx.save();12560ctx.translate(x,y);12561for (var i=0;i<n;i++)12562{12563if (Math.floor(t/3*n*3+i*2.7)%2)12564{12565var t2=Math.pow((t/3*n*3+i*2.7)%1,1.5);12566ctx.globalAlpha=(1-t)*(Game.drawT%2==0?0.5:1);12567var sw=(1-t2*0.5)*96;12568var sh=(0.5+t2*1.5)*96;12569ctx.drawImage(Pic('shineSpoke.png'),-sw/2,-sh-32-(1-t2)*256,sw,sh);12570}12571ctx.rotate(Math.PI*2/n);12572}12573ctx.restore();12574}125751257612577//flash at breakpoint12578if (tBase<0.1 && tBase>0)12579{12580ctx.globalAlpha=1-tBase/0.1;12581ctx.fillStyle='#fff';12582ctx.fillRect(0,0,ctx.canvas.width,ctx.canvas.height);12583ctx.globalAlpha=1;12584}12585if (tBase>0.8)12586{12587ctx.globalAlpha=(tBase-0.8)/0.2;12588ctx.fillStyle='#000';12589ctx.fillRect(0,0,ctx.canvas.width,ctx.canvas.height);12590ctx.globalAlpha=1;12591}12592}1259312594//milk and milk accessories12595if (Game.prefs.milk)12596{12597var width=ctx.canvas.width;12598var height=ctx.canvas.height;12599var x=Math.floor((Game.T*2-(Game.milkH-Game.milkHd)*2000+480*2)%480);//Math.floor((Game.T*2+Math.sin(Game.T*0.1)*2+Math.sin(Game.T*0.03)*2-(Game.milkH-Game.milkHd)*2000+480*2)%480);12600var y=(Game.milkHd)*height;//(((Game.milkHd)*ctx.canvas.height)*(1+0.05*(Math.sin(Game.T*0.017)/2+0.5)));12601var a=1;12602if (Game.AscendTimer>0)12603{12604y*=1-Math.pow((Game.AscendTimer/Game.AscendBreakpoint),2)*2;12605a*=1-Math.pow((Game.AscendTimer/Game.AscendBreakpoint),2)*2;12606}12607else if (Game.ReincarnateTimer>0)12608{12609y*=1-Math.pow(1-(Game.ReincarnateTimer/Game.ReincarnateDuration),2)*2;12610a*=1-Math.pow(1-(Game.ReincarnateTimer/Game.ReincarnateDuration),2)*2;12611}1261212613if (Game.TOYS)12614{12615//golly12616if (!Game.Toy)12617{12618Game.toys=[];12619Game.toysType=choose([1,2]);12620Game.Toy=function(x,y)12621{12622this.id=Game.toys.length;12623this.x=x;12624this.y=y;12625this.xd=Math.random()*10-5;12626this.yd=Math.random()*10-5;12627this.r=Math.random()*Math.PI*2;12628this.rd=Math.random()*0.1-0.05;12629var v=Math.random();var a=0.5;var b=0.5;12630if (v<=a) v=b-b*Math.pow(1-v/a,3); else v=b+(1-b)*Math.pow((v-a)/(1-a),3);12631this.s=(Game.toysType==1?64:48)*(0.1+v*1.9);12632if (Game.toysType==2) this.s=(this.id%10==1)?96:48;12633this.st=this.s;this.s=0;12634var cookies=[[10,0]];12635for (var i in Game.Upgrades)12636{12637var cookie=Game.Upgrades[i];12638if (cookie.bought>0 && cookie.pool=='cookie') cookies.push(cookie.icon);12639}12640this.icon=choose(cookies);12641this.dragged=false;12642this.l=document.createElement('div');12643this.l.innerHTML=this.id;12644this.l.style.cssText='cursor:pointer;border-radius:'+(this.s/2)+'px;opacity:0;width:'+this.s+'px;height:'+this.s+'px;background:#999;position:absolute;left:0px;top:0px;z-index:10000000;transform:translate(-1000px,-1000px);';12645l('sectionLeft').appendChild(this.l);12646AddEvent(this.l,'mousedown',function(what){return function(){what.dragged=true;};}(this));12647AddEvent(this.l,'mouseup',function(what){return function(){what.dragged=false;};}(this));12648Game.toys.push(this);12649return this;12650}12651for (var i=0;i<Math.floor(Math.random()*15+(Game.toysType==1?5:30));i++)12652{12653new Game.Toy(Math.random()*width,Math.random()*height*0.3);12654}12655}12656ctx.globalAlpha=0.5;12657for (var i in Game.toys)12658{12659var me=Game.toys[i];12660ctx.save();12661ctx.translate(me.x,me.y);12662ctx.rotate(me.r);12663if (Game.toysType==1) ctx.drawImage(Pic('smallCookies.png'),(me.id%8)*64,0,64,64,-me.s/2,-me.s/2,me.s,me.s);12664else ctx.drawImage(Pic('icons.png'),me.icon[0]*48,me.icon[1]*48,48,48,-me.s/2,-me.s/2,me.s,me.s);12665ctx.restore();12666}12667ctx.globalAlpha=1;12668for (var i in Game.toys)12669{12670var me=Game.toys[i];12671//psst... not real physics12672for (var ii in Game.toys)12673{12674var it=Game.toys[ii];12675if (it.id!=me.id)12676{12677var x1=me.x+me.xd;12678var y1=me.y+me.yd;12679var x2=it.x+it.xd;12680var y2=it.y+it.yd;12681var dist=Math.sqrt(Math.pow((x1-x2),2)+Math.pow((y1-y2),2))/(me.s/2+it.s/2);12682if (dist<(Game.toysType==1?0.95:0.75))12683{12684var angle=Math.atan2(y1-y2,x1-x2);12685var v1=Math.sqrt(Math.pow((me.xd),2)+Math.pow((me.yd),2));12686var v2=Math.sqrt(Math.pow((it.xd),2)+Math.pow((it.yd),2));12687var v=((v1+v2)/2+dist)*0.75;12688var ratio=it.s/me.s;12689me.xd+=Math.sin(-angle+Math.PI/2)*v*(ratio);12690me.yd+=Math.cos(-angle+Math.PI/2)*v*(ratio);12691it.xd+=Math.sin(-angle-Math.PI/2)*v*(1/ratio);12692it.yd+=Math.cos(-angle-Math.PI/2)*v*(1/ratio);12693me.rd+=(Math.random()*1-0.5)*0.1*(ratio);12694it.rd+=(Math.random()*1-0.5)*0.1*(1/ratio);12695me.rd*=Math.min(1,v);12696it.rd*=Math.min(1,v);12697}12698}12699}12700if (me.y>=height-(Game.milkHd)*height+8)12701{12702me.xd*=0.85;12703me.yd*=0.85;12704me.rd*=0.85;12705me.yd-=1;12706me.xd+=(Math.random()*1-0.5)*0.3;12707me.yd+=(Math.random()*1-0.5)*0.05;12708me.rd+=(Math.random()*1-0.5)*0.02;12709}12710else12711{12712me.xd*=0.99;12713me.rd*=0.99;12714me.yd+=1;12715}12716me.yd*=(Math.min(1,Math.abs(me.y-(height-(Game.milkHd)*height)/16)));12717me.rd+=me.xd*0.01/(me.s/(Game.toysType==1?64:48));12718if (me.x<me.s/2 && me.xd<0) me.xd=Math.max(0.1,-me.xd*0.6); else if (me.x<me.s/2) {me.xd=0;me.x=me.s/2;}12719if (me.x>width-me.s/2 && me.xd>0) me.xd=Math.min(-0.1,-me.xd*0.6); else if (me.x>width-me.s/2) {me.xd=0;me.x=width-me.s/2;}12720me.xd=Math.min(Math.max(me.xd,-30),30);12721me.yd=Math.min(Math.max(me.yd,-30),30);12722me.rd=Math.min(Math.max(me.rd,-0.5),0.5);12723me.x+=me.xd;12724me.y+=me.yd;12725me.r+=me.rd;12726me.r=me.r%(Math.PI*2);12727me.s+=(me.st-me.s)*0.5;12728if (Game.toysType==2 && !me.dragged && Math.random()<0.003) me.st=choose([48,48,48,48,96]);12729if (me.dragged)12730{12731me.x=Game.mouseX;12732me.y=Game.mouseY;12733me.xd+=((Game.mouseX-Game.mouseX2)*3-me.xd)*0.5;12734me.yd+=((Game.mouseY-Game.mouseY2)*3-me.yd)*0.512735me.l.style.transform='translate('+(me.x-me.s/2)+'px,'+(me.y-me.s/2)+'px) scale(50)';12736}12737else me.l.style.transform='translate('+(me.x-me.s/2)+'px,'+(me.y-me.s/2)+'px)';12738me.l.style.width=me.s+'px';12739me.l.style.height=me.s+'px';12740ctx.save();12741ctx.translate(me.x,me.y);12742ctx.rotate(me.r);12743if (Game.toysType==1) ctx.drawImage(Pic('smallCookies.png'),(me.id%8)*64,0,64,64,-me.s/2,-me.s/2,me.s,me.s);12744else ctx.drawImage(Pic('icons.png'),me.icon[0]*48,me.icon[1]*48,48,48,-me.s/2,-me.s/2,me.s,me.s);12745ctx.restore();12746}12747}1274812749var pic=Game.Milk.pic;12750if (Game.milkType!=0 && Game.ascensionMode!=1) pic=Game.MilksByChoice[Game.milkType].pic;12751ctx.globalAlpha=0.9*a;12752ctx.fillPattern(Pic(pic+'.png'),0,height-y,width+480,1,480,480,x,0);1275312754ctx.fillStyle='#000';12755ctx.fillRect(0,height-y+480,width,Math.max(0,(y-480)));12756ctx.globalAlpha=1;1275712758Timer.track('milk');12759}1276012761if (Game.AscendTimer>0)12762{12763ctx.drawImage(Pic('shadedBordersSoft.png'),0,0,ctx.canvas.width,ctx.canvas.height);12764}1276512766if (Game.AscendTimer==0)12767{12768Game.DrawWrinklers();Timer.track('wrinklers');12769Game.DrawSpecial();Timer.track('evolvables');1277012771Game.particlesDraw(2);Timer.track('text particles');1277212773//shiny border during frenzies etc12774ctx.globalAlpha=1;12775var borders='shadedBordersSoft.png';12776if (goodBuff) borders='shadedBordersGold.png';12777else if (badBuff) borders='shadedBordersRed.png';12778if (goodBuff && Game.prefs.fancy) ctx.globalCompositeOperation='lighter';12779ctx.drawImage(Pic(borders),0,0,ctx.canvas.width,ctx.canvas.height);12780if (goodBuff && Game.prefs.fancy) ctx.globalCompositeOperation='source-over';12781}12782}12783};127841278512786/*=====================================================================================12787INITIALIZATION END; GAME READY TO LAUNCH12788=======================================================================================*/1278912790Game.killShimmers();1279112792//booooo12793Game.RuinTheFun=function(silent)12794{12795Game.popups=0;12796Game.SetAllUpgrades(1);12797Game.SetAllAchievs(1);12798Game.popups=0;12799Game.Earn(999999999999999999999999999999);12800Game.MaxSpecials();12801Game.nextResearch=0;12802Game.researchT=-1;12803Game.upgradesToRebuild=1;12804Game.recalculateGains=1;12805Game.popups=1;12806for (var i in Game.Objects)12807{12808var me=Game.Objects[i];12809if (me.minigame && me.minigame.onRuinTheFun) me.minigame.onRuinTheFun();12810}12811if (!silent)12812{12813if (Game.prefs.popups) Game.Popup('Thou doth ruineth the fun!');12814else Game.Notify('Thou doth ruineth the fun!','You\'re free. Free at last.',[11,5]);12815}12816return 'You feel a bitter taste in your mouth...';12817}1281812819Game.SetAllUpgrades=function(on)12820{12821Game.popups=0;12822var leftout=['Magic shenanigans','Occult obstruction','Glucose-charged air'];12823for (var i in Game.Upgrades)12824{12825if (on && (Game.Upgrades[i].pool=='toggle' || leftout.indexOf(Game.Upgrades[i].name)!=-1)) {}12826else if (on) Game.Upgrades[i].earn();12827else if (!on) Game.Upgrades[i].lose();12828}12829Game.upgradesToRebuild=1;12830Game.recalculateGains=1;12831Game.popups=1;12832}12833Game.SetAllAchievs=function(on)12834{12835Game.popups=0;12836for (var i in Game.Achievements)12837{12838if (on && Game.Achievements[i].pool!='dungeon') Game.Win(Game.Achievements[i].name);12839else if (!on) Game.RemoveAchiev(Game.Achievements[i].name);12840}12841Game.recalculateGains=1;12842Game.popups=1;12843}12844Game.GetAllDebugs=function()12845{12846Game.popups=0;12847for (var i in Game.Upgrades)12848{12849if (Game.Upgrades[i].pool=='debug') Game.Upgrades[i].earn();12850}12851Game.upgradesToRebuild=1;12852Game.recalculateGains=1;12853Game.popups=1;12854}12855Game.MaxSpecials=function()12856{12857Game.dragonLevel=Game.dragonLevels.length-1;12858Game.santaLevel=Game.santaLevels.length-1;12859}1286012861Game.SesameReset=function()12862{12863var name=Game.bakeryName;12864Game.HardReset(2);12865Game.bakeryName=name;12866Game.bakeryNameRefresh();12867Game.Achievements['Cheated cookies taste awful'].won=1;12868}1286912870Game.debugTimersOn=0;12871Game.sesame=0;12872Game.OpenSesame=function()12873{12874var str='';12875str+='<div class="icon" style="position:absolute;left:-9px;top:-6px;background-position:'+(-10*48)+'px '+(-6*48)+'px;"></div>';12876str+='<div style="position:absolute;left:0px;top:0px;z-index:10;font-size:10px;background:#000;padding:1px;" id="fpsCounter"></div>';1287712878str+='<div id="devConsoleContent">';12879str+='<div class="title" style="font-size:14px;margin:6px;">Dev tools</div>';1288012881str+='<a class="option neato" '+Game.clickStr+'="Game.Ascend(1);">Ascend</a>';12882str+='<div class="line"></div>';12883str+='<a class="option neato" '+Game.clickStr+'="Game.cookies*=10;Game.cookiesEarned*=10;">x10</a>';12884str+='<a class="option neato" '+Game.clickStr+'="Game.cookies/=10;Game.cookiesEarned/=10;">/10</a><br>';12885str+='<a class="option neato" '+Game.clickStr+'="Game.cookies*=1000;Game.cookiesEarned*=1000;">x1k</a>';12886str+='<a class="option neato" '+Game.clickStr+'="Game.cookies/=1000;Game.cookiesEarned/=1000;">/1k</a><br>';12887str+='<a class="option neato" '+Game.clickStr+'="for (var i in Game.Objects){Game.Objects[i].buy(100);}">Buy 100 of all</a>';//for (var n=0;n<100;n++){for (var i in Game.Objects){Game.Objects[i].buy(1);}}12888str+='<a class="option neato" '+Game.clickStr+'="for (var i in Game.Objects){Game.Objects[i].sell(100);}">Sell 100 of all</a><br>';12889str+='<a class="option neato" '+Game.clickStr+'="Game.gainLumps(10);">+10 lumps</a>';12890str+='<a class="option neato" '+Game.clickStr+'="for (var i in Game.Objects){Game.Objects[i].level=0;Game.Objects[i].onMinigame=false;Game.Objects[i].refresh();}Game.recalculateGains=1;">Reset levels</a>';12891str+='<div class="line"></div>';12892str+='<a class="option warning" '+Game.clickStr+'="Game.RuinTheFun(1);">Ruin The Fun</a>';12893str+='<a class="option warning" '+Game.clickStr+'="Game.SesameReset();">Wipe</a>';12894str+='<a class="option neato" '+Game.clickStr+'="Game.GetAllDebugs();">All debugs</a>';12895str+='<a class="option neato" '+Game.clickStr+'="Game.debugTimersOn=!Game.debugTimersOn;Game.OpenSesame();">Timers '+(Game.debugTimersOn?'On':'Off')+'</a><br>';12896str+='<a class="option neato" '+Game.clickStr+'="Game.SetAllUpgrades(0);">No upgrades</a>';12897str+='<a class="option neato" '+Game.clickStr+'="Game.SetAllUpgrades(1);">All upgrades</a><br>';12898str+='<a class="option neato" '+Game.clickStr+'="Game.SetAllAchievs(0);">No achievs</a>';12899str+='<a class="option neato" '+Game.clickStr+'="Game.SetAllAchievs(1);">All achievs</a><br>';12900str+='<a class="option neato" '+Game.clickStr+'="Game.santaLevel=0;Game.dragonLevel=0;">Reset specials</a>';12901str+='<a class="option neato" '+Game.clickStr+'="Game.MaxSpecials();">Max specials</a><br>';12902str+='<a class="option neato" '+Game.clickStr+'="Game.lumpRefill=Date.now()-Game.getLumpRefillMax();">Reset refills</a>';12903str+='<a class="option neato" '+Game.clickStr+'="Game.EditAscend();">'+(Game.DebuggingPrestige?'Exit Ascend Edit':'Ascend Edit')+'</a>';12904str+='<a class="option neato" '+Game.clickStr+'="Game.DebugUpgradeCpS();">Debug upgrades CpS</a>';12905str+='<a class="option neato" '+Game.clickStr+'="Game.seed=Game.makeSeed();">Re-seed</a>';12906str+='<a class="option neato" '+Game.clickStr+'="Game.heralds=100;l(\'heraldsAmount\').innerHTML=Game.heralds;Game.externalDataLoaded=true;Game.recalculateGains=1;">Max heralds</a>';12907str+='<div class="line"></div>';12908for (var i=0;i<Game.goldenCookieChoices.length/2;i++)12909{12910str+='<a class="option neato" '+Game.clickStr+'="var newShimmer=new Game.shimmer(\'golden\');newShimmer.force=\''+Game.goldenCookieChoices[i*2+1]+'\';">'+Game.goldenCookieChoices[i*2]+'</a>';12911//str+='<a class="option neato" '+Game.clickStr+'="Game.goldenCookie.force=\''+Game.goldenCookie.choices[i*2+1]+'\';Game.goldenCookie.spawn();">'+Game.goldenCookie.choices[i*2]+'</a>';12912//str+='<a class="option neato" '+Game.clickStr+'="Game.goldenCookie.click(0,\''+Game.goldenCookie.choices[i*2+1]+'\');">'+Game.goldenCookie.choices[i*2]+'</a>';12913}12914str+='</div>';1291512916l('devConsole').innerHTML=str;1291712918if (!l('fpsGraph'))12919{12920var div=document.createElement('canvas');12921div.id='fpsGraph';12922div.width=128;12923div.height=64;12924div.style.opacity=0.5;12925div.style.pointerEvents='none';12926div.style.transformOrigin='0% 0%';12927div.style.transform='scale(0.75)';12928//l('devConsole').appendChild(div);12929l('devConsole').parentNode.insertBefore(div,l('devConsole').nextSibling);12930Game.fpsGraph=div;12931Game.fpsGraphCtx=Game.fpsGraph.getContext('2d',{alpha:false});12932var ctx=Game.fpsGraphCtx;12933ctx.fillStyle='#000';12934ctx.fillRect(0,0,128,64);12935}1293612937l('debug').style.display='block';12938Game.sesame=1;12939Game.Achievements['Cheated cookies taste awful'].won=1;12940}1294112942Game.EditAscend=function()12943{12944if (!Game.DebuggingPrestige)12945{12946Game.DebuggingPrestige=true;12947Game.AscendTimer=0;12948Game.OnAscend=1;12949Game.removeClass('ascendIntro');12950Game.addClass('ascending');12951}12952else12953{12954Game.DebuggingPrestige=false;12955}12956Game.BuildAscendTree();12957Game.OpenSesame();12958}1295912960//experimental debugging function that cycles through every owned upgrade, turns it off and on, and lists how much each upgrade is participating to CpS12961Game.debuggedUpgradeCpS=[];12962Game.debuggedUpgradeCpClick=[];12963Game.debugColors=['#322','#411','#600','#900','#f30','#f90','#ff0','#9f0','#0f9','#09f','#90f'];12964Game.DebugUpgradeCpS=function()12965{12966Game.CalculateGains();12967Game.debuggedUpgradeCpS=[];12968Game.debuggedUpgradeCpClick=[];12969var CpS=Game.cookiesPs;12970var CpClick=Game.computedMouseCps;12971for (var i in Game.Upgrades)12972{12973var me=Game.Upgrades[i];12974if (me.bought)12975{12976me.bought=0;12977Game.CalculateGains();12978//Game.debuggedUpgradeCpS[me.name]=CpS-Game.cookiesPs;12979Game.debuggedUpgradeCpS[me.name]=(CpS/(Game.cookiesPs||1)-1);12980Game.debuggedUpgradeCpClick[me.name]=(CpClick/(Game.computedMouseCps||1)-1);12981me.bought=1;12982}12983}12984Game.CalculateGains();12985}1298612987129881298912990for (var i in Game.customInit) {Game.customInit[i]();}1299112992if (!Game.LoadSave())12993{//try to load the save when we open the page. if this fails, try to brute-force it half a second later12994setTimeout(function(){12995var local=Game.localStorageGet(Game.SaveTo);12996Game.LoadSave(local);12997},500);12998}1299913000Game.ready=1;13001setTimeout(function(){if (typeof showAds==='undefined' && (!l('detectAds') || l('detectAds').clientHeight<1)) Game.addClass('noAds');},500);13002l('javascriptError').innerHTML='';13003l('javascriptError').style.display='none';13004Game.Loop();13005Game.Draw();13006}13007/*=====================================================================================13008LOGIC13009=======================================================================================*/13010Game.Logic=function()13011{13012Game.bounds=Game.l.getBoundingClientRect();1301313014if (!Game.OnAscend && Game.AscendTimer==0)13015{13016for (var i in Game.Objects)13017{13018if (Game.Objects[i].eachFrame) Game.Objects[i].eachFrame();13019}13020Game.UpdateSpecial();13021Game.UpdateGrandmapocalypse();1302213023//these are kinda fun13024//if (Game.BigCookieState==2 && !Game.promptOn && Game.Scroll!=0) Game.ClickCookie();13025//if (Game.BigCookieState==1 && !Game.promptOn) Game.ClickCookie();1302613027//handle graphic stuff13028if (Game.prefs.wobbly)13029{13030if (Game.BigCookieState==1) Game.BigCookieSizeT=0.98;13031else if (Game.BigCookieState==2) Game.BigCookieSizeT=1.05;13032else Game.BigCookieSizeT=1;13033Game.BigCookieSizeD+=(Game.BigCookieSizeT-Game.BigCookieSize)*0.75;13034Game.BigCookieSizeD*=0.75;13035Game.BigCookieSize+=Game.BigCookieSizeD;13036Game.BigCookieSize=Math.max(0.1,Game.BigCookieSize);13037}13038else13039{13040if (Game.BigCookieState==1) Game.BigCookieSize+=(0.98-Game.BigCookieSize)*0.5;13041else if (Game.BigCookieState==2) Game.BigCookieSize+=(1.05-Game.BigCookieSize)*0.5;13042else Game.BigCookieSize+=(1-Game.BigCookieSize)*0.5;13043}13044Game.particlesUpdate();1304513046if (Game.mousePointer) l('sectionLeft').style.cursor='pointer';13047else l('sectionLeft').style.cursor='auto';13048Game.mousePointer=0;1304913050//handle milk and milk accessories13051Game.milkProgress=Game.AchievementsOwned/25;13052if (Game.milkProgress>=0.5) Game.Unlock('Kitten helpers');13053if (Game.milkProgress>=1) Game.Unlock('Kitten workers');13054if (Game.milkProgress>=2) Game.Unlock('Kitten engineers');13055if (Game.milkProgress>=3) Game.Unlock('Kitten overseers');13056if (Game.milkProgress>=4) Game.Unlock('Kitten managers');13057if (Game.milkProgress>=5) Game.Unlock('Kitten accountants');13058if (Game.milkProgress>=6) Game.Unlock('Kitten specialists');13059if (Game.milkProgress>=7) Game.Unlock('Kitten experts');13060if (Game.milkProgress>=8) Game.Unlock('Kitten consultants');13061if (Game.milkProgress>=9) Game.Unlock('Kitten assistants to the regional manager');13062if (Game.milkProgress>=10) Game.Unlock('Kitten marketeers');13063if (Game.milkProgress>=11) Game.Unlock('Kitten analysts');13064if (Game.milkProgress>=12) Game.Unlock('Kitten executives');13065Game.milkH=Math.min(1,Game.milkProgress)*0.35;13066Game.milkHd+=(Game.milkH-Game.milkHd)*0.02;1306713068Game.Milk=Game.Milks[Math.min(Math.floor(Game.milkProgress),Game.Milks.length-1)];1306913070if (Game.autoclickerDetected>0) Game.autoclickerDetected--;1307113072//handle research13073if (Game.researchT>0)13074{13075Game.researchT--;13076}13077if (Game.researchT==0 && Game.nextResearch)13078{13079if (!Game.Has(Game.UpgradesById[Game.nextResearch].name))13080{13081Game.Unlock(Game.UpgradesById[Game.nextResearch].name);13082if (Game.prefs.popups) Game.Popup('Researched : '+Game.UpgradesById[Game.nextResearch].name);13083else Game.Notify('Research complete','You have discovered : <b>'+Game.UpgradesById[Game.nextResearch].name+'</b>.',Game.UpgradesById[Game.nextResearch].icon);13084}13085Game.nextResearch=0;13086Game.researchT=-1;13087Game.recalculateGains=1;13088}13089//handle seasons13090if (Game.seasonT>0)13091{13092Game.seasonT--;13093}13094if (Game.seasonT<=0 && Game.season!='' && Game.season!=Game.baseSeason && !Game.Has('Eternal seasons'))13095{13096var str=Game.seasons[Game.season].over;13097if (Game.prefs.popups) Game.Popup(str);13098else Game.Notify(str,'',Game.seasons[Game.season].triggerUpgrade.icon);13099if (Game.Has('Season switcher')) {Game.Unlock(Game.seasons[Game.season].trigger);Game.seasons[Game.season].triggerUpgrade.bought=0;}13100Game.season=Game.baseSeason;13101Game.seasonT=-1;13102}1310313104//press ctrl to bulk-buy 10, shift to bulk-buy 10013105if (!Game.promptOn)13106{13107if ((Game.keys[16] || Game.keys[17]) && !Game.buyBulkShortcut)13108{13109Game.buyBulkOld=Game.buyBulk;13110if (Game.keys[16]) Game.buyBulk=100;13111if (Game.keys[17]) Game.buyBulk=10;13112Game.buyBulkShortcut=1;13113Game.storeBulkButton(-1);13114}13115}13116if ((!Game.keys[16] && !Game.keys[17]) && Game.buyBulkShortcut)//release13117{13118Game.buyBulk=Game.buyBulkOld;13119Game.buyBulkShortcut=0;13120Game.storeBulkButton(-1);13121}1312213123//handle cookies13124if (Game.recalculateGains) Game.CalculateGains();13125Game.Earn(Game.cookiesPs/Game.fps);//add cookies per second1312613127//grow lumps13128Game.doLumps();1312913130//minigames13131for (var i in Game.Objects)13132{13133var me=Game.Objects[i];13134if (Game.isMinigameReady(me) && me.minigame.logic && Game.ascensionMode!=1) me.minigame.logic();13135}1313613137if (Game.specialTab!='' && Game.T%(Game.fps*3)==0) Game.ToggleSpecialMenu(1);1313813139//wrinklers13140if (Game.cpsSucked>0)13141{13142Game.Dissolve((Game.cookiesPs/Game.fps)*Game.cpsSucked);13143Game.cookiesSucked+=((Game.cookiesPs/Game.fps)*Game.cpsSucked);13144//should be using one of the following, but I'm not sure what I'm using this stat for anymore13145//Game.cookiesSucked=Game.wrinklers.reduce(function(s,w){return s+w.sucked;},0);13146//for (var i in Game.wrinklers) {Game.cookiesSucked+=Game.wrinklers[i].sucked;}13147}1314813149//var cps=Game.cookiesPs+Game.cookies*0.01;//exponential cookies13150//Game.Earn(cps/Game.fps);//add cookies per second1315113152for (var i in Game.Objects)13153{13154var me=Game.Objects[i];13155me.totalCookies+=(me.storedTotalCps*Game.globalCpsMult)/Game.fps;13156}13157if (Game.cookies && Game.T%Math.ceil(Game.fps/Math.min(10,Game.cookiesPs))==0 && Game.prefs.particles) Game.particleAdd();//cookie shower1315813159if (Game.T%(Game.fps*10)==0) Game.recalculateGains=1;//recalculate CpS every 10 seconds (for dynamic boosts such as Century egg)1316013161/*=====================================================================================13162UNLOCKING STUFF13163=======================================================================================*/13164if (Game.T%(Game.fps)==0 && Math.random()<1/500000) Game.Win('Just plain lucky');//1 chance in 500,000 every second achievement13165if (Game.T%(Game.fps*5)==0 && Game.ObjectsById.length>0)//check some achievements and upgrades13166{13167if (isNaN(Game.cookies)) {Game.cookies=0;Game.cookiesEarned=0;Game.recalculateGains=1;}1316813169var timePlayed=new Date();13170timePlayed.setTime(Date.now()-Game.startDate);1317113172if (!Game.fullDate || (Date.now()-Game.fullDate)>=365*24*60*60*1000) Game.Win('So much to do so much to see');1317313174if (Game.cookiesEarned>=1000000 && (Game.ascensionMode==1 || Game.resets==0))//challenge run or hasn't ascended yet13175{13176if (timePlayed<=1000*60*35) Game.Win('Speed baking I');13177if (timePlayed<=1000*60*25) Game.Win('Speed baking II');13178if (timePlayed<=1000*60*15) Game.Win('Speed baking III');1317913180if (Game.cookieClicks<=15) Game.Win('Neverclick');13181if (Game.cookieClicks<=0) Game.Win('True Neverclick');13182if (Game.cookiesEarned>=1000000000 && Game.UpgradesOwned==0) Game.Win('Hardcore');13183}1318413185for (var i in Game.UnlockAt)13186{13187var unlock=Game.UnlockAt[i];13188if (Game.cookiesEarned>=unlock.cookies)13189{13190var pass=1;13191if (unlock.require && !Game.Has(unlock.require) && !Game.HasAchiev(unlock.require)) pass=0;13192if (unlock.season && Game.season!=unlock.season) pass=0;13193if (pass) {Game.Unlock(unlock.name);Game.Win(unlock.name);}13194}13195}1319613197if (Game.Has('Golden switch')) Game.Unlock('Golden switch [off]');13198if (Game.Has('Shimmering veil') && !Game.Has('Shimmering veil [off]') && !Game.Has('Shimmering veil [on]')) {Game.Unlock('Shimmering veil [on]');Game.Upgrades['Shimmering veil [off]'].earn();}13199if (Game.Has('Sugar craving')) Game.Unlock('Sugar frenzy');13200if (Game.Has('Classic dairy selection')) Game.Unlock('Milk selector');13201if (Game.Has('Basic wallpaper assortment')) Game.Unlock('Background selector');13202if (Game.Has('Golden cookie alert sound')) Game.Unlock('Golden cookie sound selector');1320313204if (Game.Has('Eternal heart biscuits')) Game.Win('Lovely cookies');13205if (Game.season=='easter')13206{13207var eggs=0;13208for (var i in Game.easterEggs)13209{13210if (Game.HasUnlocked(Game.easterEggs[i])) eggs++;13211}13212if (eggs>=1) Game.Win('The hunt is on');13213if (eggs>=7) Game.Win('Egging on');13214if (eggs>=14) Game.Win('Mass Easteria');13215if (eggs>=Game.easterEggs.length) Game.Win('Hide & seek champion');13216}1321713218if (Game.Has('Fortune cookies'))13219{13220var list=Game.Tiers['fortune'].upgrades;13221var fortunes=0;13222for (var i in list)13223{13224if (Game.Has(list[i].name)) fortunes++;13225}13226if (fortunes>=list.length) Game.Win('O Fortuna');13227}1322813229if (Game.prestige>0 && Game.ascensionMode!=1)13230{13231Game.Unlock('Heavenly chip secret');13232if (Game.Has('Heavenly chip secret')) Game.Unlock('Heavenly cookie stand');13233if (Game.Has('Heavenly cookie stand')) Game.Unlock('Heavenly bakery');13234if (Game.Has('Heavenly bakery')) Game.Unlock('Heavenly confectionery');13235if (Game.Has('Heavenly confectionery')) Game.Unlock('Heavenly key');1323613237if (Game.Has('Heavenly key')) Game.Win('Wholesome');13238}1323913240for (var i in Game.BankAchievements)13241{13242if (Game.cookiesEarned>=Game.BankAchievements[i].threshold) Game.Win(Game.BankAchievements[i].name);13243}1324413245var buildingsOwned=0;13246var mathematician=1;13247var base10=1;13248var minAmount=100000;13249for (var i in Game.Objects)13250{13251buildingsOwned+=Game.Objects[i].amount;13252minAmount=Math.min(Game.Objects[i].amount,minAmount);13253if (!Game.HasAchiev('Mathematician')) {if (Game.Objects[i].amount<Math.min(128,Math.pow(2,(Game.ObjectsById.length-Game.Objects[i].id)-1))) mathematician=0;}13254if (!Game.HasAchiev('Base 10')) {if (Game.Objects[i].amount<(Game.ObjectsById.length-Game.Objects[i].id)*10) base10=0;}13255}13256if (minAmount>=1) Game.Win('One with everything');13257if (mathematician==1) Game.Win('Mathematician');13258if (base10==1) Game.Win('Base 10');13259if (minAmount>=100) {Game.Win('Centennial');Game.Unlock('Milk chocolate butter biscuit');}13260if (minAmount>=150) {Game.Win('Centennial and a half');Game.Unlock('Dark chocolate butter biscuit');}13261if (minAmount>=200) {Game.Win('Bicentennial');Game.Unlock('White chocolate butter biscuit');}13262if (minAmount>=250) {Game.Win('Bicentennial and a half');Game.Unlock('Ruby chocolate butter biscuit');}13263if (minAmount>=300) {Game.Win('Tricentennial');Game.Unlock('Lavender chocolate butter biscuit');}13264if (minAmount>=350) {Game.Win('Tricentennial and a half');Game.Unlock('Synthetic chocolate green honey butter biscuit');}13265if (minAmount>=400) {Game.Win('Quadricentennial');Game.Unlock('Royal raspberry chocolate butter biscuit');}13266if (minAmount>=450) {Game.Win('Quadricentennial and a half');Game.Unlock('Ultra-concentrated high-energy chocolate butter biscuit');}13267if (minAmount>=500) {Game.Win('Quincentennial');Game.Unlock('Pure pitch-black chocolate butter biscuit');}1326813269if (Game.handmadeCookies>=1000) {Game.Win('Clicktastic');Game.Unlock('Plastic mouse');}13270if (Game.handmadeCookies>=100000) {Game.Win('Clickathlon');Game.Unlock('Iron mouse');}13271if (Game.handmadeCookies>=10000000) {Game.Win('Clickolympics');Game.Unlock('Titanium mouse');}13272if (Game.handmadeCookies>=1000000000) {Game.Win('Clickorama');Game.Unlock('Adamantium mouse');}13273if (Game.handmadeCookies>=100000000000) {Game.Win('Clickasmic');Game.Unlock('Unobtainium mouse');}13274if (Game.handmadeCookies>=10000000000000) {Game.Win('Clickageddon');Game.Unlock('Eludium mouse');}13275if (Game.handmadeCookies>=1000000000000000) {Game.Win('Clicknarok');Game.Unlock('Wishalloy mouse');}13276if (Game.handmadeCookies>=100000000000000000) {Game.Win('Clickastrophe');Game.Unlock('Fantasteel mouse');}13277if (Game.handmadeCookies>=10000000000000000000) {Game.Win('Clickataclysm');Game.Unlock('Nevercrack mouse');}13278if (Game.handmadeCookies>=1000000000000000000000) {Game.Win('The ultimate clickdown');Game.Unlock('Armythril mouse');}13279if (Game.handmadeCookies>=100000000000000000000000) {Game.Win('All the other kids with the pumped up clicks');Game.Unlock('Technobsidian mouse');}13280if (Game.handmadeCookies>=10000000000000000000000000) {Game.Win('One...more...click...');Game.Unlock('Plasmarble mouse');}1328113282if (Game.cookiesEarned<Game.cookies) Game.Win('Cheated cookies taste awful');1328313284if (Game.Has('Skull cookies') && Game.Has('Ghost cookies') && Game.Has('Bat cookies') && Game.Has('Slime cookies') && Game.Has('Pumpkin cookies') && Game.Has('Eyeball cookies') && Game.Has('Spider cookies')) Game.Win('Spooky cookies');13285if (Game.wrinklersPopped>=1) Game.Win('Itchscratcher');13286if (Game.wrinklersPopped>=50) Game.Win('Wrinklesquisher');13287if (Game.wrinklersPopped>=200) Game.Win('Moistburster');1328813289if (Game.cookiesEarned>=1000000 && Game.Has('How to bake your dragon')) Game.Unlock('A crumbly egg');1329013291if (Game.cookiesEarned>=25 && Game.season=='christmas') Game.Unlock('A festive hat');13292if (Game.Has('Christmas tree biscuits') && Game.Has('Snowflake biscuits') && Game.Has('Snowman biscuits') && Game.Has('Holly biscuits') && Game.Has('Candy cane biscuits') && Game.Has('Bell biscuits') && Game.Has('Present biscuits')) Game.Win('Let it snow');1329313294if (Game.reindeerClicked>=1) Game.Win('Oh deer');13295if (Game.reindeerClicked>=50) Game.Win('Sleigh of hand');13296if (Game.reindeerClicked>=200) Game.Win('Reindeer sleigher');1329713298if (buildingsOwned>=100) Game.Win('Builder');13299if (buildingsOwned>=500) Game.Win('Architect');13300if (buildingsOwned>=1000) Game.Win('Engineer');13301if (buildingsOwned>=2000) Game.Win('Lord of Constructs');13302if (Game.UpgradesOwned>=20) Game.Win('Enhancer');13303if (Game.UpgradesOwned>=50) Game.Win('Augmenter');13304if (Game.UpgradesOwned>=100) Game.Win('Upgrader');13305if (Game.UpgradesOwned>=200) Game.Win('Lord of Progress');13306if (buildingsOwned>=3000 && Game.UpgradesOwned>=300) Game.Win('Polymath');13307if (buildingsOwned>=4000 && Game.UpgradesOwned>=400) Game.Win('Renaissance baker');1330813309if (Game.cookiesEarned>=10000000000000 && !Game.HasAchiev('You win a cookie')) {Game.Win('You win a cookie');Game.Earn(1);}1331013311if (Game.shimmerTypes['golden'].n>=4) Game.Win('Four-leaf cookie');1331213313var grandmas=0;13314for (var i in Game.GrandmaSynergies)13315{13316if (Game.Has(Game.GrandmaSynergies[i])) grandmas++;13317}13318if (!Game.HasAchiev('Elder') && grandmas>=7) Game.Win('Elder');13319if (!Game.HasAchiev('Veteran') && grandmas>=14) Game.Win('Veteran');13320if (Game.Objects['Grandma'].amount>=6 && !Game.Has('Bingo center/Research facility') && Game.HasAchiev('Elder')) Game.Unlock('Bingo center/Research facility');13321if (Game.pledges>0) Game.Win('Elder nap');13322if (Game.pledges>=5) Game.Win('Elder slumber');13323if (Game.pledges>=10) Game.Unlock('Sacrificial rolling pins');13324if (Game.Objects['Cursor'].amount+Game.Objects['Grandma'].amount>=777) Game.Win('The elder scrolls');1332513326for (var i in Game.Objects)13327{13328var it=Game.Objects[i];13329for (var ii in it.productionAchievs)13330{13331if (it.totalCookies>=it.productionAchievs[ii].pow) Game.Win(it.productionAchievs[ii].achiev.name);13332}13333}1333413335if (!Game.HasAchiev('Cookie-dunker') && Game.LeftBackground && Game.milkProgress>0.1 && (Game.LeftBackground.canvas.height*0.4+256/2-16)>((1-Game.milkHd)*Game.LeftBackground.canvas.height)) Game.Win('Cookie-dunker');13336//&& l('bigCookie').getBoundingClientRect().bottom>l('milk').getBoundingClientRect().top+16 && Game.milkProgress>0.1) Game.Win('Cookie-dunker');1333713338for (var i in Game.customChecks) {Game.customChecks[i]();}13339}1334013341Game.cookiesd+=(Game.cookies-Game.cookiesd)*0.3;1334213343if (Game.storeToRefresh) Game.RefreshStore();13344if (Game.upgradesToRebuild) Game.RebuildUpgrades();1334513346Game.updateShimmers();13347Game.updateBuffs();1334813349Game.UpdateTicker();13350}1335113352if (Game.T%(Game.fps*2)==0)13353{13354var title='Cookie Clicker';13355if (Game.season=='fools') title='Cookie Baker';13356document.title=(Game.OnAscend?'Ascending! ':'')+Beautify(Game.cookies)+' '+(Game.cookies==1?'cookie':'cookies')+' - '+title;13357}13358if (Game.T%15==0)13359{13360//written through the magic of "hope for the best" maths13361var chipsOwned=Game.HowMuchPrestige(Game.cookiesReset);13362var ascendNowToOwn=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned));13363var ascendNowToGet=ascendNowToOwn-Math.floor(chipsOwned);13364var nextChipAt=Game.HowManyCookiesReset(Math.floor(chipsOwned+ascendNowToGet+1))-Game.HowManyCookiesReset(Math.floor(chipsOwned+ascendNowToGet));13365var cookiesToNext=Game.HowManyCookiesReset(ascendNowToOwn+1)-(Game.cookiesEarned+Game.cookiesReset);13366var percent=1-(cookiesToNext/nextChipAt);1336713368//fill the tooltip under the Legacy tab13369var date=new Date();13370date.setTime(Date.now()-Game.startDate);13371var timeInSeconds=date.getTime()/1000;13372var startDate=Game.sayTime(timeInSeconds*Game.fps,-1);1337313374var str='';13375str+='You\'ve been on this run for <b>'+(startDate==''?'not very long':(startDate))+'</b>.<br>';13376str+='<div class="line"></div>';13377if (Game.prestige>0)13378{13379str+='Your prestige level is currently <b>'+Beautify(Game.prestige)+'</b>.<br>(CpS +'+Beautify(Game.prestige)+'%)';13380str+='<div class="line"></div>';13381}13382if (ascendNowToGet<1) str+='Ascending now would grant you no prestige.';13383else if (ascendNowToGet<2) str+='Ascending now would grant you<br><b>1 prestige level</b> (+1% CpS)<br>and <b>1 heavenly chip</b> to spend.';13384else str+='Ascending now would grant you<br><b>'+Beautify(ascendNowToGet)+' prestige levels</b> (+'+Beautify(ascendNowToGet)+'% CpS)<br>and <b>'+Beautify(ascendNowToGet)+' heavenly chips</b> to spend.';13385str+='<div class="line"></div>';13386str+='You need <b>'+Beautify(cookiesToNext)+' more cookies</b> for the next level.<br>';13387l('ascendTooltip').innerHTML=str;1338813389if (ascendNowToGet>0)//show number saying how many chips you'd get resetting now13390{13391var str=ascendNowToGet.toString();13392var str2='';13393for (var i in str)//add commas13394{13395if ((str.length-i)%3==0 && i>0) str2+=',';13396str2+=str[i];13397}13398Game.ascendNumber.innerHTML='+'+str2;13399Game.ascendNumber.style.display='block';13400}13401else13402{13403Game.ascendNumber.style.display='none';13404}1340513406if (ascendNowToGet>Game.ascendMeterLevel || Game.ascendMeterPercentT<Game.ascendMeterPercent)13407{13408//reset the gauge and play a sound if we gained a potential level13409Game.ascendMeterPercent=0;13410//PlaySound('snd/levelPrestige.mp3');//a bit too annoying13411}13412Game.ascendMeterLevel=ascendNowToGet;13413Game.ascendMeterPercentT=percent;//gauge that fills up as you near your next chip13414//if (Game.ascendMeterPercentT<Game.ascendMeterPercent) {Game.ascendMeterPercent=0;PlaySound('snd/levelPrestige.mp3',0.5);}13415//if (percent>=1) {Game.ascendMeter.className='';} else Game.ascendMeter.className='filling';13416}13417Game.ascendMeter.style.right=Math.floor(Math.max(0,1-Game.ascendMeterPercent)*100)+'px';13418Game.ascendMeterPercent+=(Game.ascendMeterPercentT-Game.ascendMeterPercent)*0.1;1341913420Game.NotesLogic();13421if (Game.mouseMoved || Game.Scroll || Game.tooltip.dynamic) Game.tooltip.update();1342213423if (Game.T%(Game.fps*5)==0 && !Game.mouseDown && (Game.onMenu=='stats' || Game.onMenu=='prefs')) Game.UpdateMenu();13424if (Game.T%(Game.fps*1)==0) Game.UpdatePrompt();13425if (Game.AscendTimer>0) Game.UpdateAscendIntro();13426if (Game.ReincarnateTimer>0) Game.UpdateReincarnateIntro();13427if (Game.OnAscend) Game.UpdateAscend();1342813429for (var i in Game.customLogic) {Game.customLogic[i]();}1343013431if (Game.sparklesT>0)13432{13433Game.sparkles.style.backgroundPosition=-Math.floor((Game.sparklesFrames-Game.sparklesT+1)*128)+'px 0px';13434Game.sparklesT--;13435if (Game.sparklesT==1) Game.sparkles.style.display='none';13436}1343713438Game.Click=0;13439Game.Scroll=0;13440Game.mouseMoved=0;13441Game.CanClick=1;1344213443if ((Game.toSave || (Game.T%(Game.fps*60)==0 && Game.T>Game.fps*10 && Game.prefs.autosave)) && !Game.OnAscend)13444{13445//check if we can save : no minigames are loading13446var canSave=true;13447for (var i in Game.Objects)13448{13449var me=Game.Objects[i];13450if (me.minigameLoading){canSave=false;break;}13451}13452if (canSave) Game.WriteSave();13453}1345413455//every 30 minutes : get server data (ie. update notification, patreon data)13456if (Game.T%(Game.fps*60*30)==0 && Game.T>Game.fps*10/* && Game.prefs.autoupdate*/) {Game.CheckUpdates();Game.GrabData();}1345713458Game.T++;13459}1346013461/*=====================================================================================13462DRAW13463=======================================================================================*/1346413465Game.Draw=function()13466{13467Game.DrawBackground();Timer.track('end of background');1346813469if (!Game.OnAscend)13470{1347113472var unit=(Math.round(Game.cookiesd)==1?' cookie':' cookies');13473var str=Beautify(Math.round(Game.cookiesd));13474if (Game.cookiesd>=1000000)//dirty padding13475{13476var spacePos=str.indexOf(' ');13477var dotPos=str.indexOf('.');13478var add='';13479if (spacePos!=-1)13480{13481if (dotPos==-1) add+='.000';13482else13483{13484if (spacePos-dotPos==2) add+='00';13485if (spacePos-dotPos==3) add+='0';13486}13487}13488str=[str.slice(0, spacePos),add,str.slice(spacePos)].join('');13489}13490if (str.length>11 && !Game.mobile) unit='<br>cookies';13491str+=unit;13492if (Game.prefs.monospace) str='<span class="monospace">'+str+'</span>';13493str=str+'<div style="font-size:50%;"'+(Game.cpsSucked>0?' class="warning"':'')+'>per second : '+Beautify(Game.cookiesPs*(1-Game.cpsSucked),1)+'</div>';//display cookie amount13494l('cookies').innerHTML=str;13495l('compactCookies').innerHTML=str;13496Timer.track('cookie amount');1349713498for (var i in Game.Objects)13499{13500var me=Game.Objects[i];13501if (me.onMinigame && me.minigame.draw && !me.muted) me.minigame.draw();13502}13503Timer.track('draw minigames');1350413505if (Game.drawT%5==0)13506{13507//if (Game.prefs.monospace) {l('cookies').className='title monospace';} else {l('cookies').className='title';}13508var lastLocked=0;13509for (var i in Game.Objects)13510{13511var me=Game.Objects[i];1351213513//make products full-opacity if we can buy them13514var classes='product';13515var price=me.bulkPrice;13516if (Game.cookiesEarned>=me.basePrice || me.bought>0) {classes+=' unlocked';lastLocked=0;me.locked=0;} else {classes+=' locked';lastLocked++;me.locked=1;}13517if ((Game.buyMode==1 && Game.cookies>=price) || (Game.buyMode==-1 && me.amount>0)) classes+=' enabled'; else classes+=' disabled';13518if (lastLocked>2) classes+=' toggledOff';13519me.l.className=classes;13520//if (me.id>0) {l('productName'+me.id).innerHTML=Beautify(me.storedTotalCps/Game.ObjectsById[me.id-1].storedTotalCps,2);}13521}1352213523//make upgrades full-opacity if we can buy them13524var lastPrice=0;13525for (var i in Game.UpgradesInStore)13526{13527var me=Game.UpgradesInStore[i];13528if (!me.bought)13529{13530var price=me.getPrice();13531var canBuy=me.canBuy();//(Game.cookies>=price);13532var enabled=(l('upgrade'+i).className.indexOf('enabled')>-1);13533if ((canBuy && !enabled) || (!canBuy && enabled)) Game.upgradesToRebuild=1;13534if (price<lastPrice) Game.storeToRefresh=1;//is this upgrade less expensive than the previous one? trigger a refresh to sort it again13535lastPrice=price;13536}13537if (me.timerDisplay)13538{13539var T=me.timerDisplay();13540if (T!=-1)13541{13542if (!l('upgradePieTimer'+i)) l('upgrade'+i).innerHTML=l('upgrade'+i).innerHTML+'<div class="pieTimer" id="upgradePieTimer'+i+'"></div>';13543T=(T*144)%144;13544l('upgradePieTimer'+i).style.backgroundPosition=(-Math.floor(T%18))*48+'px '+(-Math.floor(T/18))*48+'px';13545}13546}1354713548//if (me.canBuy()) l('upgrade'+i).className='crate upgrade enabled'; else l('upgrade'+i).className='crate upgrade disabled';13549}13550}13551Timer.track('store');1355213553if (Game.PARTY)//i was bored and felt like messing with CSS13554{13555var pulse=Math.pow((Game.T%10)/10,0.5);13556Game.l.style.filter='hue-rotate('+((Game.T*5)%360)+'deg) brightness('+(150-50*pulse)+'%)';13557Game.l.style.webkitFilter='hue-rotate('+((Game.T*5)%360)+'deg) brightness('+(150-50*pulse)+'%)';13558Game.l.style.transform='scale('+(1.02-0.02*pulse)+','+(1.02-0.02*pulse)+') rotate('+(Math.sin(Game.T*0.5)*0.5)+'deg)';13559l('wrapper').style.overflowX='hidden';13560l('wrapper').style.overflowY='hidden';13561}1356213563Timer.clean();13564if (Game.prefs.animate && ((Game.prefs.fancy && Game.drawT%1==0) || (!Game.prefs.fancy && Game.drawT%10==0)) && Game.AscendTimer==0 && Game.onMenu=='') Game.DrawBuildings();Timer.track('buildings');1356513566Game.textParticlesUpdate();Timer.track('text particles');13567}1356813569Game.NotesDraw();Timer.track('notes');13570//Game.tooltip.update();//changed to only update when the mouse is moved1357113572for (var i in Game.customDraw) {Game.customDraw[i]();}1357313574Game.drawT++;13575//if (Game.prefs.altDraw) requestAnimationFrame(Game.Draw);13576}1357713578/*=====================================================================================13579MAIN LOOP13580=======================================================================================*/13581Game.Loop=function()13582{13583if (Game.timedout) return false;13584Timer.say('START');13585Timer.track('browser stuff');13586Timer.say('LOGIC');13587//update game logic !13588Game.catchupLogic=0;13589Game.Logic();13590Game.catchupLogic=1;1359113592var time=Date.now();135931359413595//latency compensator13596Game.accumulatedDelay+=((time-Game.time)-1000/Game.fps);13597if (Game.prefs.timeout && time-Game.lastActivity>=1000*60*5)13598{13599if (Game.accumulatedDelay>1000*60*30) Game.delayTimeouts+=3;//more than 30 minutes delay ? computer probably asleep and not making cookies anyway13600else if (Game.accumulatedDelay>1000*5) Game.delayTimeouts++;//add to timeout counter when we skip 10 seconds worth of frames (and the player has been inactive for at least 5 minutes)13601if (Game.delayTimeouts>=3) Game.Timeout();//trigger timeout when the timeout counter is 3+13602}1360313604Game.accumulatedDelay=Math.min(Game.accumulatedDelay,1000*5);//don't compensate over 5 seconds; if you do, something's probably very wrong13605Game.time=time;13606while (Game.accumulatedDelay>0)13607{13608Game.Logic();13609Game.accumulatedDelay-=1000/Game.fps;//as long as we're detecting latency (slower than target fps), execute logic (this makes drawing slower but makes the logic behave closer to correct target fps)13610}13611Game.catchupLogic=0;13612Timer.track('logic');13613Timer.say('END LOGIC');13614if (!Game.prefs.altDraw)13615{13616var hasFocus=document.hasFocus();13617Timer.say('DRAW');13618if (hasFocus || Game.prefs.focus || Game.loopT%10==0) requestAnimationFrame(Game.Draw);13619//if (document.hasFocus() || Game.loopT%5==0) Game.Draw();13620Timer.say('END DRAW');13621}13622else requestAnimationFrame(Game.Draw);1362313624//if (!hasFocus) Game.tooltip.hide();1362513626if (Game.sesame)13627{13628//fps counter and graph13629Game.previousFps=Game.currentFps;13630Game.currentFps=Game.getFps();13631var ctx=Game.fpsGraphCtx;13632ctx.drawImage(Game.fpsGraph,-1,0);13633ctx.fillStyle='rgb('+Math.round((1-Game.currentFps/Game.fps)*128)+',0,0)';13634ctx.fillRect(128-1,0,1,64);13635ctx.strokeStyle='#fff';13636ctx.beginPath();13637ctx.moveTo(128-1,(1-Game.previousFps/Game.fps)*64);13638ctx.lineTo(128,(1-Game.currentFps/Game.fps)*64);13639ctx.stroke();1364013641l('fpsCounter').innerHTML=Game.currentFps+' fps';13642var str='';13643for (var i in Timer.labels) {str+=Timer.labels[i];}13644if (Game.debugTimersOn) l('debugLog').style.display='block';13645else l('debugLog').style.display='none';13646l('debugLog').innerHTML=str;1364713648}13649Timer.reset();1365013651Game.loopT++;13652setTimeout(Game.Loop,1000/Game.fps);13653}13654}136551365613657/*=====================================================================================13658LAUNCH THIS THING13659=======================================================================================*/13660Game.Launch();13661//try {Game.Launch();}13662//catch(err) {console.log('ERROR : '+err.message);}1366313664window.onload=function()13665{1366613667if (!Game.ready)13668{13669if (top!=self) Game.ErrorFrame();13670else13671{13672console.log('[=== '+choose([13673'Oh, hello!',13674'hey, how\'s it hangin',13675'About to cheat in some cookies or just checking for bugs?',13676'Remember : cheated cookies taste awful!',13677'Hey, Orteil here. Cheated cookies taste awful... or do they?',13678])+' ===]');13679Game.Load();13680//try {Game.Load();}13681//catch(err) {console.log('ERROR : '+err.message);}13682}13683}13684};136851368613687