CursedSliver

More unshackled

Jan 14th, 2024 (edited)
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var impUns = undefined;
  2. Game.registerMod("improvedUnshackled",{
  3.     init:function(){
  4.         this.spritesheet=App?this.dir+"/img.png":"https://cdn.discordapp.com/attachments/416701488719724564/1196070242787541122/image.png"
  5.         this.allCreations=function(){
  6.             impUns = Game.mods.improvedUnshackled;
  7.             this.createUpgrades();
  8.             this.changeUpgrades();
  9.             this.overrideUpgrades();
  10.             this.overrideTooltips();
  11.             this.adjust();
  12.         }
  13.  
  14.         this.createUpgrades=function(){
  15.             this.upgrades = [];
  16.             this.upgrades.push(new Game.Upgrade('Unshackled synergies I',loc("Unshackles all <b>Synergies I</b> upgrades, making them more powerful.<br>Only applies to upgrades with both associated buildings unshackled.")+'<q>The Hunter Becomes the Hunted.</q>',222222222222222,[5,0, this.spritesheet]));
  17.             this.upgrades[0].parents = [Game.UpgradesById[792]];
  18.             this.upgrades.push(new Game.Upgrade('Unshackled synergies II',loc("Unshackles all <b>Synergies II</b> upgrades, making them more powerful.<br>Only applies to upgrades with both associated buildings unshackled.")+'<q>The Hunted Becomes the Hunter.</q>',222222222222222222,[5,1, this.spritesheet]));
  19.             this.upgrades[1].parents = [Game.UpgradesById[798]];
  20.             this.upgrades.push(new Game.Upgrade('Unshackled kitten',loc("Unshackles all <b>Kitten</b> upgrades, making them more powerful.<br>Only applies to kittens with its respective tier unshackled.")+'<q>mEeEeeEeEeeeeØwWWWWwwwWwwwWWWwwwW</q>', 9000000000000,[18,35]));
  21.             this.upgrades[2].parents = [Game.UpgradesById[718],Game.UpgradesById[771]];
  22.             this.upgrades.push(new Game.Upgrade('Unshackled mouse',loc("Unshackles all <b>Mouse</b> upgrades, making them more powerful.<br>Only applies to mouses with its respective tier unshackled."+'<q>Split the cookie open with each click.</q>'), 1500000000,[11,35]));
  23.             this.upgrades[3].parents = [Game.UpgradesById[768]];
  24.             this.upgrades.push(new Game.Upgrade('Unshackled cookie',loc("Unshackles all <b>Flavored cookies</b>, increasing cookie production multiplier of each by <b>1%</b>."+'<q>Gives your cookies a nice shine.</q>'), 100000000000000000,[10,35]));
  25.             this.upgrades[4].parents = [Game.UpgradesById[863],Game.UpgradesById[864]];
  26.            
  27.             this.upgrades[0]=this.setPos(this.upgrades[0],976,24);
  28.             this.upgrades[1]=this.setPos(this.upgrades[1],854,466);
  29.             this.upgrades[2]=this.setPos(this.upgrades[2],788,-454);
  30.             this.upgrades[3]=this.setPos(this.upgrades[3],380,-284);
  31.             this.upgrades[4]=this.setPos(this.upgrades[4],430,496);
  32.             for(let i of this.upgrades){i.pool="prestige";i.order=506;Game.PrestigeUpgrades.push(i);}
  33.             LocalizeUpgradesAndAchievs()
  34.         }
  35.        
  36.         this.setPos=function(upgrade,x,y) {
  37.             Game.UpgradePositions[upgrade.id]=[x,y]; upgrade.posX = x; upgrade.posY = y;
  38.             return upgrade;
  39.         }
  40.  
  41.         this.overrideUpgrades=function(){
  42.             Game.GetTieredCpsMult=function(me){
  43.                 var mult=1;
  44.                 for (var i in me.tieredUpgrades)
  45.                 {
  46.                     if (!Game.Tiers[me.tieredUpgrades[i].tier].special && Game.Has(me.tieredUpgrades[i].name))
  47.                     {
  48.                         var tierMult=2;
  49.                         //unshackled
  50.                         if (Game.ascensionMode!=1 && Game.Has(me.unshackleUpgrade) && Game.Has(Game.Tiers[me.tieredUpgrades[i].tier].unshackleUpgrade)) tierMult+=me.id==1?0.5:(20-me.id)*0.1;
  51.                         mult*=tierMult;
  52.                     }
  53.                 }
  54.                 for (var i in me.synergies)
  55.                 {
  56.                     var syn=me.synergies[i];
  57.                     if (Game.Has(syn.name))
  58.                     {
  59.                         var ti = syn.tier;
  60.                         if ((ti == "synergy1" && Game.Has("Unshackled synergies I") && Game.mods.improvedUnshackled.valid(syn.buildingTie1, syn.buildingTie2)) || (ti == "synergy2" && Game.Has("Unshackled synergies II") && Game.mods.improvedUnshackled.valid(syn.buildingTie1, syn.buildingTie2))) {
  61.                             if (syn.buildingTie1.name==me.name) mult*=(1+(0.05+0.01*(5-0.25*me.id))*syn.buildingTie2.amount);
  62.                             else if (syn.buildingTie2.name==me.name) mult*=(1+(0.001+0.01*(0.1-0.005*me.id))*syn.buildingTie1.amount);
  63.                         } else {
  64.                             if (syn.buildingTie1.name==me.name) mult*=(1+0.05*syn.buildingTie2.amount);
  65.                             else if (syn.buildingTie2.name==me.name) mult*=(1+0.001*syn.buildingTie1.amount);
  66.                         }
  67.                     }
  68.                 }
  69.                 if (me.fortune && Game.Has(me.fortune.name)) mult*=1.07;
  70.                 if (me.grandma && Game.Has(me.grandma.name)) mult*=(1+Game.Objects['Grandma'].amount*0.01*(1/(me.id-1)));
  71.                 return mult;
  72.             }
  73.         }
  74.        
  75.         this.overrideTooltips=function() {
  76.             for (let j in Game.Objects) {
  77.                 let me = Game.Objects[j];
  78.                 me.tooltip=function() {
  79.                     var ariaText='';
  80.                     var desc=me.desc;
  81.                     var name=me.dname;
  82.                     if (Game.season=='fools')
  83.                     {
  84.                         if (!Game.foolObjects[me.name])
  85.                             {
  86.                                 name=Game.foolObjects['Unknown'].name;
  87.                                 desc=Game.foolObjects['Unknown'].desc;
  88.                             }
  89.                         else
  90.                         {
  91.                             name=Game.foolObjects[me.name].name;
  92.                             desc=Game.foolObjects[me.name].desc;
  93.                         }
  94.                     }
  95.                     var icon=[me.iconColumn,0];
  96.                     if (me.locked)
  97.                     {
  98.                         name='???';
  99.                         desc='???';
  100.                         icon=[0,7];
  101.                     }
  102.                
  103.                     var canBuy=false;
  104.                     var price=me.bulkPrice;
  105.                     if ((Game.buyMode==1 && Game.cookies>=price) || (Game.buyMode==-1 && me.amount>0)) canBuy=true;
  106.                    
  107.                     var synergiesStr='';
  108.                     //note : might not be entirely accurate, math may need checking
  109.                     if (me.amount>0)
  110.                     {
  111.                         var synergiesWith={};
  112.                         var synergyBoost=0;
  113.                        
  114.                         if (me.name=='Grandma')
  115.                         {
  116.                             for (var i in Game.GrandmaSynergies)
  117.                             {
  118.                                 if (Game.Has(Game.GrandmaSynergies[i]))
  119.                                 {
  120.                                     var other=Game.Upgrades[Game.GrandmaSynergies[i]].buildingTie;
  121.                                     var mult=me.amount*0.01*(1/(other.id-1));
  122.                                     var boost=(other.storedTotalCps*Game.globalCpsMult)-(other.storedTotalCps*Game.globalCpsMult)/(1+mult);
  123.                                     synergyBoost+=boost;
  124.                                     if (!synergiesWith[other.plural]) synergiesWith[other.plural]=0;
  125.                                     synergiesWith[other.plural]+=mult;
  126.                                 }
  127.                             }
  128.                         }
  129.                         else if (me.name=='Portal' && Game.Has('Elder Pact'))
  130.                         {
  131.                             var other=Game.Objects['Grandma'];
  132.                             var boost=(me.amount*0.05*other.amount)*Game.globalCpsMult;
  133.                             synergyBoost+=boost;
  134.                             if (!synergiesWith[other.plural]) synergiesWith[other.plural]=0;
  135.                             synergiesWith[other.plural]+=boost/(other.storedTotalCps*Game.globalCpsMult);
  136.                         }
  137.                        
  138.                         for (var i in me.synergies)
  139.                         {
  140.                             var it=me.synergies[i];
  141.                             if (Game.Has(it.name))
  142.                             {
  143.                                 if ((it.tier == "synergy1" && Game.Has("Unshackled synergies I") && Game.mods.improvedUnshackled.valid(it.buildingTie1, it.buildingTie2)) || (it.tier == "synergy2" && Game.Has("Unshackled synergies II") && Game.mods.improvedUnshackled.valid(it.buildingTie1, it.buildingTie2))) {
  144.                                     var other=it.buildingTie1;
  145.                                     var weight=0.05+0.01*(5-0.25*other.id);
  146.                                     if (me==it.buildingTie1) {other=it.buildingTie2;weight=0.001+0.01*(0.1-0.005*other.id);}
  147.                                     var boost=(other.storedTotalCps*Game.globalCpsMult)-(other.storedTotalCps*Game.globalCpsMult)/(1+me.amount*weight);
  148.                                     synergyBoost+=boost;
  149.                                     if (!synergiesWith[other.plural]) synergiesWith[other.plural]=0;
  150.                                     synergiesWith[other.plural]+=me.amount*weight;
  151.                                 } else {
  152.                                     var weight=0.05;
  153.                                     var other=it.buildingTie1;
  154.                                     if (me==it.buildingTie1) {weight=0.001;other=it.buildingTie2;}
  155.                                     var boost=(other.storedTotalCps*Game.globalCpsMult)-(other.storedTotalCps*Game.globalCpsMult)/(1+me.amount*weight);
  156.                                     synergyBoost+=boost;
  157.                                     if (!synergiesWith[other.plural]) synergiesWith[other.plural]=0;
  158.                                     synergiesWith[other.plural]+=me.amount*weight;
  159.                                 }
  160.                             }
  161.                         }
  162.                         if (synergyBoost>0)
  163.                         {
  164.                             for (var i in synergiesWith)
  165.                             {
  166.                                 if (synergiesStr!='') synergiesStr+=', ';
  167.                                 synergiesStr+='<span style="color:#fff;font-weight:bold;font-size:80%;background:#000;box-shadow:0px 0px 0px 1px rgba(255,255,255,0.2);border-radius:3px;padding:0px 2px;display:inline-block;">'+i+' +'+Beautify(synergiesWith[i]*100,1)+'%</span>';
  168.                             }
  169.                             synergiesStr=loc("...also boosting some other buildings:")+' '+synergiesStr+' - '+loc("all combined, these boosts account for <b>%1</b> per second (<b>%2%</b> of total CpS)",[loc("%1 cookie",LBeautify(synergyBoost,1)),Beautify((synergyBoost/Game.cookiesPs)*100,1)]);
  170.                         }
  171.                     }
  172.                
  173.                     if (Game.prefs.screenreader)
  174.                     {
  175.                         if (me.locked) ariaText='This building is not yet unlocked. ';
  176.                         else ariaText=name+'. ';
  177.                         if (!me.locked) ariaText+='You own '+me.amount+'. ';
  178.                         ariaText+=(canBuy?'Can buy 1 for':'Cannot afford the')+' '+Beautify(Math.round(price))+' cookies. ';
  179.                         if (!me.locked && me.totalCookies>0)
  180.                         {
  181.                             ariaText+='Each '+me.single+' produces '+Beautify((me.storedTotalCps/me.amount)*Game.globalCpsMult,1)+' cookies per second. ';
  182.                             ariaText+=Beautify(me.totalCookies)+' cookies '+me.actionName+' so far. ';
  183.                         }
  184.                         if (!me.locked) ariaText+=desc;
  185.                    
  186.                         var ariaLabel=l('ariaReader-product-'+(me.id));
  187.                         if (ariaLabel) ariaLabel.innerHTML=ariaText.replace(/(<([^>]+)>)/gi,' ');
  188.                     }
  189.                
  190.                     return '<div style="position:absolute;left:1px;top:1px;right:1px;bottom:1px;background:linear-gradient(125deg,'+(false?'rgba(15,115,130,1) 0%,rgba(15,115,130,0)':'rgba(50,40,40,1) 0%,rgba(50,40,40,0)')+' 20%);mix-blend-mode:screen;z-index:1;"></div><div style="z-index:10;min-width:350px;padding:8px;position:relative;" id="tooltipBuilding"><div class="icon" style="float:left;margin-left:-8px;margin-top:-8px;'+writeIcon(icon)+'"></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><div class="tag">'+loc("owned: %1",me.amount)+'</div>'+(me.free>0?'<div class="tag">'+loc("free: %1!",me.free)+'</div>':'')+'</small>'+
  191.                 '<div class="line"></div><div class="description"><q>'+desc+'</q></div>'+
  192.                 (me.totalCookies>0?(
  193.                     '<div class="line"></div>'+
  194.                     (me.amount>0?'<div class="descriptionBlock">'+loc("each %1 produces <b>%2</b> per second",[me.single,loc("%1 cookie",LBeautify((me.storedTotalCps/me.amount)*Game.globalCpsMult,1))])+'</div>':'')+
  195.                     '<div class="descriptionBlock">'+loc("%1 producing <b>%2</b> per second",[loc("%1 "+me.bsingle,LBeautify(me.amount)),loc("%1 cookie",LBeautify(me.storedTotalCps*Game.globalCpsMult,1))])+' ('+loc("<b>%1%</b> of total CpS",Beautify(Game.cookiesPs>0?((me.amount>0?((me.storedTotalCps*Game.globalCpsMult)/Game.cookiesPs):0)*100):0,1))+')</div>'+
  196.                     (synergiesStr?('<div class="descriptionBlock">'+synergiesStr+'</div>'):'')+
  197.                     (EN?'<div class="descriptionBlock"><b>'+Beautify(me.totalCookies)+'</b> '+(Math.floor(me.totalCookies)==1?'cookie':'cookies')+' '+me.actionName+' so far</div>':'<div class="descriptionBlock">'+loc("<b>%1</b> produced so far",loc("%1 cookie",LBeautify(me.totalCookies)))+'</div>')
  198.                 ):'')+
  199.                 '</div>';
  200.                 }
  201.             }
  202.         }
  203.        
  204.         this.changeUpgrades=function(){
  205.             for (let i = 0; i < 14; i++) {
  206.                 Game.UpgradesById[i+787].icon = [i % 5, Math.floor(i / 5), this.spritesheet]
  207.             }
  208.             Game.UpgradesById[863].icon = [4, 2, this.spritesheet]
  209.  
  210.             locStrings["Unshackled! Each %1 provides an additional <b>+%4%</b> production to %3, and each %3 provides an additional <b>+%2%</b> production to %1."] = "Unshackled! Each %1 provides an additional <b>+%4%</b> production to %3, and each %3 provides an additional <b>+%2%</b> production to %1."
  211.             for (let j in Game.Upgrades) {
  212.                 let me = Game.Upgrades[j];
  213.                 if (Game.Upgrades[j].tier == "synergy1") {
  214.                     Game.Upgrades[j].descFunc = function() {
  215.                         return ((Game.ascensionMode!=1 && Game.Has("Unshackled synergies I") && Game.mods.improvedUnshackled.valid(me.buildingTie1, me.buildingTie2))?('<div style="font-size:80%;text-align:center;">'+loc("Unshackled! Each %1 provides an additional <b>+%4%</b> production to %3, and each %3 provides an additional <b>+%2%</b> production to %1.",[this.buildingTie1.name, (5-0.25*me.buildingTie1.id), this.buildingTie2.name, (0.1-0.005*me.buildingTie2.id)])+'</div><div class="line"></div>'):'')+this.ddesc;
  216.                     }
  217.                 }
  218.                 if (Game.Upgrades[j].tier == "synergy2") {
  219.                     Game.Upgrades[j].descFunc = function() {
  220.                         return ((Game.ascensionMode!=1 && Game.Has("Unshackled synergies II") && Game.mods.improvedUnshackled.valid(me.buildingTie1, me.buildingTie2))?('<div style="font-size:80%;text-align:center;">'+loc("Unshackled! Each %1 provides an additional <b>+%4%</b> production to %3, and each %3 provides an additional <b>+%2%</b> production to %1.",[this.buildingTie1.name, (5-0.25*me.buildingTie1.id), this.buildingTie2.name, (0.1-0.005*me.buildingTie2.id)])+'</div><div class="line"></div>'):'')+this.ddesc;
  221.                     }
  222.                 }
  223.                 if (Game.Upgrades[j].kitten) {
  224.                     Game.Upgrades[j].descFunc = function() {
  225.                         return ((Game.ascensionMode!=1 && impUns.tierCheck(Game.Upgrades[j].tier))?('<div style="font-size:80%;text-align:center;">'+loc("Unshackled! <b>+10%</b> power.")+'</div><div class="line"></div>'):'')+this.ddesc;
  226.                     }
  227.                 }
  228.                 if (Game.Upgrades[j].name.includes('mouse') && Game.Upgrades[j].name != 'Unshackled mouse') {
  229.                     Game.Upgrades[j].descFunc = function() {
  230.                         return ((Game.ascensionMode!=1 && impUns.tierCheckM(Game.Upgrades[j].tier))?('<div style="font-size:80%;text-align:center;">'+loc("Unshackled! Additional <b>+0.25%</b> of your CpS per click.")+'</div><div class="line"></div>'):'')+this.ddesc;
  231.                     }
  232.                 }
  233.             }
  234.             for (let j in Game.cookieUpgrades) {
  235.                 Game.cookieUpgrades[j].descFunc = function() {
  236.                     return ((Game.ascensionMode!=1 && Game.Upgrades['Unshackled cookie'].bought)?('<div style="font-size:80%;text-align:center;">'+loc("Unshackled! Additional <b>+1%</b> production multiplier.")+'</div><div class="line"></div>'):'')+this.ddesc;
  237.                 }
  238.             }
  239.         }
  240.        
  241.         this.adjust = function() {
  242.             eval('Game.CalculateGains='+Game.CalculateGains.toString().replace(`if (Game.Has('Kitten helpers')) catMult*=(1+Game.milkProgress*0.1*milkMult);
  243.             if (Game.Has('Kitten workers')) catMult*=(1+Game.milkProgress*0.125*milkMult);
  244.             if (Game.Has('Kitten engineers')) catMult*=(1+Game.milkProgress*0.15*milkMult);
  245.             if (Game.Has('Kitten overseers')) catMult*=(1+Game.milkProgress*0.175*milkMult);
  246.             if (Game.Has('Kitten managers')) catMult*=(1+Game.milkProgress*0.2*milkMult);
  247.             if (Game.Has('Kitten accountants')) catMult*=(1+Game.milkProgress*0.2*milkMult);
  248.             if (Game.Has('Kitten specialists')) catMult*=(1+Game.milkProgress*0.2*milkMult);
  249.             if (Game.Has('Kitten experts')) catMult*=(1+Game.milkProgress*0.2*milkMult);
  250.             if (Game.Has('Kitten consultants')) catMult*=(1+Game.milkProgress*0.2*milkMult);
  251.             if (Game.Has('Kitten assistants to the regional manager')) catMult*=(1+Game.milkProgress*0.175*milkMult);
  252.             if (Game.Has('Kitten marketeers')) catMult*=(1+Game.milkProgress*0.15*milkMult);
  253.             if (Game.Has('Kitten analysts')) catMult*=(1+Game.milkProgress*0.125*milkMult);
  254.             if (Game.Has('Kitten executives')) catMult*=(1+Game.milkProgress*0.115*milkMult);
  255.             if (Game.Has('Kitten admins')) catMult*=(1+Game.milkProgress*0.11*milkMult);
  256.             if (Game.Has('Kitten strategists')) catMult*=(1+Game.milkProgress*0.105*milkMult);`,
  257.                                                                     `
  258.             if (Game.Has('Kitten helpers')) catMult*=(1+Game.milkProgress*0.1*milkMult*(impUns.tierCheck(1)?1.1:1));
  259.             if (Game.Has('Kitten workers')) catMult*=(1+Game.milkProgress*0.125*milkMult*(impUns.tierCheck(2)?1.1:1));
  260.             if (Game.Has('Kitten engineers')) catMult*=(1+Game.milkProgress*0.15*milkMult*(impUns.tierCheck(3)?1.1:1));
  261.             if (Game.Has('Kitten overseers')) catMult*=(1+Game.milkProgress*0.175*milkMult*(impUns.tierCheck(4)?1.1:1));
  262.             if (Game.Has('Kitten managers')) catMult*=(1+Game.milkProgress*0.2*milkMult*(impUns.tierCheck(5)?1.1:1));
  263.             if (Game.Has('Kitten accountants')) catMult*=(1+Game.milkProgress*0.2*milkMult*(impUns.tierCheck(6)?1.1:1));
  264.             if (Game.Has('Kitten specialists')) catMult*=(1+Game.milkProgress*0.2*milkMult*(impUns.tierCheck(7)?1.1:1));
  265.             if (Game.Has('Kitten experts')) catMult*=(1+Game.milkProgress*0.2*milkMult*(impUns.tierCheck(8)?1.1:1));
  266.             if (Game.Has('Kitten consultants')) catMult*=(1+Game.milkProgress*0.2*milkMult*(impUns.tierCheck(9)?1.1:1));
  267.             if (Game.Has('Kitten assistants to the regional manager')) catMult*=(1+Game.milkProgress*0.175*milkMult*(impUns.tierCheck(10)?1.1:1));
  268.             if (Game.Has('Kitten marketeers')) catMult*=(1+Game.milkProgress*0.15*milkMult*(impUns.tierCheck(11)?1.1:1));
  269.             if (Game.Has('Kitten analysts')) catMult*=(1+Game.milkProgress*0.125*milkMult*(impUns.tierCheck(12)?1.1:1));
  270.             if (Game.Has('Kitten executives')) catMult*=(1+Game.milkProgress*0.115*milkMult*(impUns.tierCheck(13)?1.1:1));
  271.             if (Game.Has('Kitten admins')) catMult*=(1+Game.milkProgress*0.11*milkMult*(impUns.tierCheck(14)?1.1:1));
  272.             if (Game.Has('Kitten strategists')) catMult*=(1+Game.milkProgress*0.105*milkMult*(impUns.tierCheck(15)?1.1:1));`));
  273.            
  274.             eval('Game.mouseCps='+Game.mouseCps.toString().replace(`if (Game.Has('Plastic mouse')) add+=Game.cookiesPs*0.01;
  275.             if (Game.Has('Iron mouse')) add+=Game.cookiesPs*0.01;
  276.             if (Game.Has('Titanium mouse')) add+=Game.cookiesPs*0.01;
  277.             if (Game.Has('Adamantium mouse')) add+=Game.cookiesPs*0.01;
  278.             if (Game.Has('Unobtainium mouse')) add+=Game.cookiesPs*0.01;
  279.             if (Game.Has('Eludium mouse')) add+=Game.cookiesPs*0.01;
  280.             if (Game.Has('Wishalloy mouse')) add+=Game.cookiesPs*0.01;
  281.             if (Game.Has('Fantasteel mouse')) add+=Game.cookiesPs*0.01;
  282.             if (Game.Has('Nevercrack mouse')) add+=Game.cookiesPs*0.01;
  283.             if (Game.Has('Armythril mouse')) add+=Game.cookiesPs*0.01;
  284.             if (Game.Has('Technobsidian mouse')) add+=Game.cookiesPs*0.01;
  285.             if (Game.Has('Plasmarble mouse')) add+=Game.cookiesPs*0.01;
  286.             if (Game.Has('Miraculite mouse')) add+=Game.cookiesPs*0.01;
  287.             if (Game.Has('Aetherice mouse')) add+=Game.cookiesPs*0.01;
  288.             if (Game.Has('Omniplast mouse')) add+=Game.cookiesPs*0.01;`,`
  289.            
  290.             if (Game.Has('Plastic mouse')) add+=Game.cookiesPs*0.01*(impUns.tierCheckM(1)?1.25:1);
  291.             if (Game.Has('Iron mouse')) add+=Game.cookiesPs*0.01*(impUns.tierCheckM(2)?1.25:1);
  292.             if (Game.Has('Titanium mouse')) add+=Game.cookiesPs*0.01*(impUns.tierCheckM(3)?1.25:1);
  293.             if (Game.Has('Adamantium mouse')) add+=Game.cookiesPs*0.01*(impUns.tierCheckM(4)?1.25:1);
  294.             if (Game.Has('Unobtainium mouse')) add+=Game.cookiesPs*0.01*(impUns.tierCheckM(5)?1.25:1);
  295.             if (Game.Has('Eludium mouse')) add+=Game.cookiesPs*0.01*(impUns.tierCheckM(6)?1.25:1);
  296.             if (Game.Has('Wishalloy mouse')) add+=Game.cookiesPs*0.01*(impUns.tierCheckM(7)?1.25:1);
  297.             if (Game.Has('Fantasteel mouse')) add+=Game.cookiesPs*0.01*(impUns.tierCheckM(8)?1.25:1);
  298.             if (Game.Has('Nevercrack mouse')) add+=Game.cookiesPs*0.01*(impUns.tierCheckM(9)?1.25:1);
  299.             if (Game.Has('Armythril mouse')) add+=Game.cookiesPs*0.01*(impUns.tierCheckM(10)?1.25:1);
  300.             if (Game.Has('Technobsidian mouse')) add+=Game.cookiesPs*0.01*(impUns.tierCheckM(11)?1.25:1);
  301.             if (Game.Has('Plasmarble mouse')) add+=Game.cookiesPs*0.01*(impUns.tierCheckM(12)?1.25:1);
  302.             if (Game.Has('Miraculite mouse')) add+=Game.cookiesPs*0.01*(impUns.tierCheckM(13)?1.25:1);
  303.             if (Game.Has('Aetherice mouse')) add+=Game.cookiesPs*0.01*(impUns.tierCheckM(14)?1.25:1);
  304.             if (Game.Has('Omniplast mouse')) add+=Game.cookiesPs*0.01*(impUns.tierCheckM(15)?1.25:1);`));
  305.            
  306.             eval('Game.CalculateGains='+Game.CalculateGains.toString().replace(`mult*=(1+(typeof(me.power)==='function'?me.power(me):me.power)*0.01);`,`mult*=(1+(typeof(me.power)==='function'?me.power(me):me.power+(Game.Upgrades['Unshackled cookie'].bought))*0.01);`));
  307.         }
  308.        
  309.         this.valid = function(build1, build2){
  310.             let one = Game.Upgrades[build1.unshackleUpgrade].bought;
  311.             let two = Game.Upgrades[build2.unshackleUpgrade].bought;
  312.             if (one && two) {
  313.                 return true;
  314.             }
  315.             return false;
  316.         }
  317.        
  318.         this.tierCheck = function(tier) {
  319.             if (Game.Upgrades[Game.Tiers[tier].unshackleUpgrade].bought&&Game.Upgrades["Unshackled kitten"].bought) { return true; }
  320.             return false;
  321.         }
  322.        
  323.         this.tierCheckM = function(tier) {
  324.             if (Game.Upgrades[Game.Tiers[tier].unshackleUpgrade].bought&&Game.Upgrades["Unshackled mouse"].bought) { return true; }
  325.             return false;
  326.         }
  327.  
  328.         if(Game.ready) this.allCreations()
  329.         else Game.registerHook("create", this.allCreations)
  330.     },
  331.     save: function(){
  332.         let str = "";
  333.         for(let i of this.upgrades)str+=i.bought
  334.         return str;
  335.     },
  336.     load: function(str){
  337.         for(let i in this.upgrades)this.upgrades[i].bought=Number(str[i])
  338.         Game.recalculateGains = 1;
  339.     }
  340. })
Advertisement
Add Comment
Please, Sign In to add comment