-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
power.html
1 lines (1 loc) · 7.94 KB
/
power.html
1
<!DOCTYPE html><html lang="en"><head><title>Power Game</title><meta charset="utf-8"><style>*{font-family:Verdana,Geneva,Tahoma,sans-serif;font-size:18px;line-height:1.36;color:black;outline:0 none}body{visibility:collapse;cursor:default}button{font-size:16px;border:solid black;border-radius:4px;padding:3px;line-height:1.2;background:#f2ce00}span{vertical-align:middle}#message,#type{visibility:hidden;border:black solid 2px;border-radius:4px;background-color:#ddc32e}</style></head><body>Costs: <b id=costs>0.9</b><br>Power Loss: <b id=loss>0</b><br>Power: <b id=power>0.000</b><br>Money: <b id=money>0.000</b><br>Users: <b id=users>1</b><br>Spread: <b id=spread>0.000</b><div id=message>The company <b id=compName></b> has bought <span id=compPrice></span> power!</div><div id=type> </div><br><button onclick=checkReset() id=reset>Reset</button><br><div id=con></div><br><br><div id=gen></div><br><br>Containers:<div id=con0></div><div id=con1>Super</div><div id=con2></div><div id=con3></div><div id=con4></div><div id=con5></div><div id=con6></div><div id=con7></div><br><br>Generators:<div id=gen0></div><div id=gen1>Starter</div><div id=gen2></div><div id=gen3></div><div id=gen4></div><div id=gen5></div><div id=gen6></div><div id=gen7></div><script>onbeforeunload=()=>!0,oncontextmenu=()=>!1,onselectstart=()=>!1,ondragstart=()=>!1,conData="",conItems=["Super","Broken","Rusty","Normal","Battery","Improved","Titanium","Thermal","Zircornium","Expensive","Advanced","Large","Metallic","Futuristic","New","Magical","Enhanced","Silver","Legendary","Mythical","Compressed","Lucky","Nuclear","Pure","Golden","Diamond","Vacuum","Superior","Impossible","Kingly"],conStorage=[50,20,40,65,75,85,100,115,105,120,250,200,350,450,700,670,725,800,900,1e3,1100,1250,1350,1750,2e3,2200,2500,2800,4e3,5e3],conLoss=[0,1,2,3,2,2,3,5,3,3,8,5,9,6,7,6,6,5,7,10,9,8,11,10,12,9,10,15,11,12,14],conPurchase=[0,25,60,105,130,160,185,210,235,260,600,625,700,1150,1500,2700,3e3,3300,3800,4e3,5e3,6500,7250,9500,14e3,25e3,3e4,37500,45e3,75e3,1e5],genData="",genItems=["Starter","Broken","Rusty","Normal","Improved","Coal","Expensive","Biomass","Advanced","Large","Futuristic","New","Wind","Solar","Hydro","Magical","Enhanced","Silver","Legendary","Mythical","Lucky","Nuclear","Golden","Geothermal","Acidic","Diamond","Mega","Plasma","Photonic","Mass","Time","Superior","Impossible","Kingly"],genCosts=[.9,.4,.8,1.1,1.6,2.7,2,2.8,3.5,2.5,3,2.5,2.7,1.4,3.6,2,2.2,2,2.5,2.4,2.6,1,2.6,2.3,5,2.3,2.6,2.5,2.7,3,2.4,2.4,1.6,1.8],genEarn=[5,2,4,6,9,12,12,14,18,16,22,25,26,22,28,26,28,30,31,35,36,35,38,40,44,42,45,47,50,53,52,54,65,90],genPurchase=[0,15,35,75,120,130,185,210,250,280,480,750,800,800,850,925,1e3,1400,1650,2750,3e3,3300,3600,4e3,4400,5500,6500,7500,8200,8500,9400,10500,13e3,2e4];for(var i=1;i<conItems.length;i++)conData+="<button onclick='buyCon("+i+")' onmouseover='conItem("+i+")' onmouseout='resetColor(event,this);resetText=true;resetInfo()' onmouseup='resetColor(event,this);resetText=true;resetInfo()' onmousedown='changeColor(event,this)'>"+conItems[i]+" Container ($"+conPurchase[i]+")</button>";for(i=1;i<genItems.length;i++)genData+="<button onclick='buyGen("+i+")' onmouseover='genItem("+i+")' onmouseout='resetColor(event,this);resetText=true;resetInfo()' onmouseup='resetColor(event,this);resetText=true;resetInfo()' onmousedown='changeColor(event,this)'>"+genItems[i]+" Generator ($"+genPurchase[i]+")</button>";function setup(){usedc=1,usedg=1,operationCost=.9,powerLoss=0,storage=50,powerLoss=0,spread=0,power=0,money=0,users=1,gen="Super-------".split("-"),con="Starter-------".split("-")}function run(){var e;document.hasFocus()&&(bigBuyNum<1?Math.random()<.015&&(Math.random()<.1&&bigBuy(1),bigBuy(),bigBuyNum=40):bigBuyNum--,(e=power+powerEarn/12-powerLoss/35)-.2*users>=storage?(power=storage,spread+=users/12,set("spread",spread),earn()):e<=0?setup():e-.2*users<=0?(power=e,set("power",power),spread-=users/12,set("spread",spread-users)):(power=e-.2*users,earn(),spread+=users/12,set("spread",spread)))}function earn(){money+=.125*users-.08*operationCost,set("money",money),set("power",power)}function set(e,t,s){s||("spread"===e&&0<t&&(8500<=t?(users=16+Math.floor((t-8250)/1500),set("users",users)):7e3<=t?set("users",users=15):5900<=t?set("users",users=14):4900<=t?set("users",users=13):4e3<=t?set("users",users=12):3200<=t?set("users",users=11):2500<=t?set("users",users=10):1800<=t?set("users",users=9):1250<=t?set("users",users=8):800<=t?set("users",users=7):450<=t?set("users",users=6):250<=t?set("users",users=5):120<=t?set("users",users=4):50<=t?set("users",users=3):15<=t&&set("users",users=2)),"number"==typeof t&&"users"!==e&&"loss"!==e&&(t=t.toFixed(3))),"costs"===e&&(t=t.toFixed(1)),document.getElementById(e).textContent=t}function buyCon(e){var t;7!==usedc&&money>=conPurchase[e]&&(t=conItems[e],usedc++,money-=conPurchase[e],powerLoss+=conLoss[e],spread+=3*e,storage+=conStorage[e],set("money",money),set("spread",spread),set("power",power),set("con"+usedc,t,1),set("loss",powerLoss,1),con[usedc]=t)}function buyGen(e){var t;7!==usedg&&money>=genPurchase[e]&&(t=genItems[e],usedg++,money-=genPurchase[e],operationCost+=genCosts[e],powerEarn+=genEarn[e],spread+=3*e,set("money",money),set("spread",spread),set("gen"+usedg,t,1),set("costs",operationCost,1),gen[usedg]=t)}function bigBuy(e){var t;e?(t=Math.random()*spread*.6+200+400*Math.random(),power>=t&&(power-=t,money+=.65*t,set("power",power),set("money",money),send(specialCompanies[Math.floor(Math.random()*specialCompanies.length)],+t.toFixed(3)))):(t=Math.random()*spread*.35+20,power>=t&&(power-=t,money+=.58*t,set("power",power),set("money",money),send(companies[Math.floor(Math.random()*companies.length)],+t.toFixed(3))))}function checkReset(){0===resetID?(document.getElementById("reset").textContent="Are you sure?",resetConfirmation()):(setup(),document.getElementById("reset").textContent="Reset",resetID=0)}function resetConfirmation(){resetID=setTimeout(()=>{e===resetID&&(document.getElementById("reset").textContent="Reset",resetID=0)},1250);var e=resetID}function send(e,t){document.getElementById("compName").textContent=e,document.getElementById("compPrice").textContent=t,document.getElementById("message").style.visibility="visible",sendReset()}function sendReset(){messageID=setTimeout(()=>{e===messageID&&(document.getElementById("message").style.visibility="hidden",resetID=0)},2500);var e=messageID}function conItem(e){resetText=!1,set("type",conItems[e]+" Container",1),document.getElementById("type").style.visibility="visible"}function genItem(e){resetText=!1,set("type",genItems[e]+" Generator",1),document.getElementById("type").style.visibility="visible"}function resetInfo(){setTimeout(()=>{resetText&&(document.getElementById("type").style.visibility="hidden")},30)}function changeColor(e,t){0===e.button&&(t.style.backgroundColor="#b09604")}function resetColor(e,t){0===e.button&&(t.style.backgroundColor="#f2ce00")}document.getElementById("con").innerHTML=conData,document.getElementById("gen").innerHTML=genData,companies=["Electric.ly","Electrific","Tinergy","infinergy","Zenergy","QuantaEnergy","HyperLectric","MOTERona","Electricr Plus","Electramotor","Powergies","H8 Laboratories","Electoz","Super8","WebUp","Teched","PowerZ","SolutionRena","Trackbin","Stratos","TechE","Statmap","Bigbiz","Summet","Hyperlabbed","Pallet4","DVT","Ninfinity","PERM Servers","Zerogistics","Starto","Hyperhost","StratosWare","SteadyG","Gamed","QuantumLeap","Spotted Solutions","RJ Gamewares","M32","LaserUps","Walled","BestrTrack","Zapped","NeverG","Magcel","QPARTY","QuantumFutures","MinuteSpeed","QBin Tracks","Absolute Solutions","H38 Labs","StatWare","Phantim","Logolistic","ArtificalHelpers","Ecell","Strated","Modeer Solutions","AdMagics","HoledStatistics","MotiveTech","HatTech","TopTracks","OPTIMIZEDH","Qualitified","StandIN","EnObfusticate"],specialCompanies=["Apple","Google","Nintendo","Microsoft","Amazon","Samsung"],powerEarn=5,operationCost=0,storage=0,powerLoss=0,resetID=0,messageID=0,bigBuyNum=40,resetText=!1,setup(),setInterval(run,5),document.body.style.visibility="visible",ZZZ=1</script></body></html>