Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Cookie Clicker script by klattmose
- // based largely on the mod by Shylight with some modifications by Gouchnox (found at https://pastebin.com/raw/6pbdStD0)
- // and incorporating code from Cookie Clicker FtHoF Planner (found at http://fthof-planner.s3-website.us-east-2.amazonaws.com/)
- function choose(arr) {return arr[Math.floor(Math.random()*arr.length)];}
- if (!("statsloaded" in window)) {
- var style = document.createElement('style')
- style.type = 'text/css'
- style.innerHTML = `
- .diceIcon{
- padding-left: 18px;
- position: relative;
- cursor: pointer;
- }
- .diceIcon:before{
- content: '';
- background-image: url(img/icons.png?v=2.0042);
- background-position: -304px 0px;
- background-size: 480px;
- width: 16px;
- height: 16px;
- display: block;
- position: absolute;
- left: 0;
- top: 0px;
- }
- b{
- opacity: 1!important;
- color: rgba(255,255,255,0.6);
- }`
- var diceIcon = '<span class="diceIcon"></span>'
- //class="diceIcon" onclick="Game.seed=Game.makeSeed()"
- document.getElementsByTagName('head')[0].appendChild(style)
- eval('Game.UpdateMenu=' + Game.UpdateMenu.toString().replace(/(str\+=.*Statistics)/,
- `with(Game){
- var spellOutcome = '';
- if (isMinigameReady(Objects["Wizard tower"])){
- var spellsCast = Objects["Wizard tower"].minigame.spellsCastTotal
- var target = spellsCast + 10
- while(spellsCast < target){
- Math.seedrandom(\`\${Game.seed}/\${spellsCast}\`)
- roll = Math.random()
- if(roll < 0.85){
- /* Random is called a few times in setting up the golden cookie */
- if (Game.chimeType==1 && Game.ascensionMode!=1) Math.random();
- if (Game.season=='valentines' || Game.season=='easter') Math.random();
- Math.random();
- Math.random();
- /**/
- var choices=[];
- choices.push('Frenzy','Lucky');
- if (Game.dragonAura!=10 && Game.dragonAura2!=10) choices.push('Click Frenzy');
- if (Math.random()<0.1) choices.push('Cookie Storm','Cookie Storm','Blab');
- if (Math.random()<0.25) choices.push('Building Special');
- if (Math.random()<0.15) choices=['Cookie Storm Drop'];
- if (Math.random()<0.0001) choices.push('Free Sugar Lump');
- var FTHOFcookie = choose(choices);
- spellOutcome += "<b><font color=#66ff66> " + FTHOFcookie + "</font></b><br/>"
- } else {
- /* Random is called a few times in setting up the golden cookie */
- if (Game.chimeType==1 && Game.ascensionMode!=1) Math.random();
- if (Game.season=='valentines' || Game.season=='easter') Math.random();
- Math.random();
- Math.random();
- /**/
- var choices=[];
- choices.push('Clot','Ruin');
- if (Math.random()<0.1) choices.push('Cursed Finger','Elder Frenzy');
- if (Math.random()<0.003) choices.push('Free Sugar Lump');
- if (Math.random()<0.1) choices=['Blab'];
- var FTHOFcookie = choose(choices);
- spellOutcome += "<b><font color=#ff6666> " + FTHOFcookie + "</font></b><br/>"
- }
- spellsCast+=1
- Math.seedrandom()
- }
- }
- }
- $1`).replace(/(Game\.wrinklersPopped>0\?.*)/,
- `$1
- \`<div class="listing"><b onclick="Game.seed=Game.makeSeed()" title="Reroll outcomes">\${diceIcon}</b> <b>Next spells:</b><br/> \${spellOutcome}</div>\`+`
- )
- )
- };
- statsloaded = 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement