Game.goldenCookie.click=function() { if (Game.goldenCookie.life>0) { Game.goldenCookie.toDie=1; Game.goldenClicks++; if (Game.goldenClicks>=1) Game.Win('Golden cookie'); if (Game.goldenClicks>=7) Game.Win('Lucky cookie'); if (Game.goldenClicks>=27) Game.Win('A stroke of luck'); if (Game.goldenClicks>=77) Game.Win('Leprechaun'); if (Game.goldenClicks>=7) Game.Unlock('Lucky day'); if (Game.goldenClicks>=27) Game.Unlock('Serendipity'); l('goldenCookie').style.display='none'; var list=[]; if (Game.goldenCookie.wrath>0) list.push('clot','multiply cookies','ruin cookies'); else list.push('frenzy','multiply cookies'); if (Game.goldenCookie.wrath>0 && Math.random()<0.2) list.push('blood frenzy','chain cookie'); else if (Math.random()<0.01) list.push('chain cookie'); if (Math.random()<0.05) list.push('click frenzy'); var choice=choose(list); if (Game.goldenCookie.chain>0) choice='chain cookie'; if (choice!='chain cookie') Game.goldenCookie.chain=0; if (choice=='frenzy') { Game.frenzy=Game.fps*77; Game.frenzyPower=7; Game.recalculateGains=1; Game.Popup('Frenzy : cookie production x7 for 77 seconds!'); } else if (choice=='multiply cookies') { var moni=Math.min(Game.cookies*0.1,Game.cookiesPs*60*30)+13;//add 10% to cookies owned (+13), or 30 minutes of cookie production - whichever is lowest Game.Earn(moni); Game.Popup('+'+Beautify(moni)+' cookies!'); } else if (choice=='ruin cookies') { var moni=Math.min(Game.cookies*0.1,Game.cookiesPs*60*10)+13;//lose 10% of cookies owned (-13), or 10 minutes of cookie production - whichever is lowest moni=Math.min(Game.cookies,moni); Game.Spend(moni); Game.Popup('Lost '+Beautify(moni)+' cookies!'); } else if (choice=='blood frenzy') { Game.frenzy=Game.fps*6; Game.frenzyPower=666; Game.recalculateGains=1; Game.Popup('Elder frenzy : cookie production x666 for 6 seconds!'); } else if (choice=='clot') { Game.frenzy=Game.fps*66; Game.frenzyPower=0.5; Game.recalculateGains=1; Game.Popup('Clot : cookie production halved for 66 seconds!'); } else if (choice=='click frenzy') { Game.clickFrenzy=Game.fps*13; Game.recalculateGains=1; Game.Popup('Click frenzy!
Clicking power x10 for 13 seconds!'); } else if (choice=='chain cookie') { Game.goldenCookie.chain++; var moni='0'; for (var i=0;i10) Game.goldenCookie.chain=0; } } }