User:Fredy-san/common.js

//Fredy-san test - stats calculator var cfcountmulti = [ 'Treasure HP% Treasure ATK% Treasure Respawn% Production Res +  Chapter Cost Chapter 1 Chapter 2 / SOL  Chapter 3  Custom Level + ' ].join(''); var cusstats = document.createElement('div'); cusstats.setAttribute('class', 'custom_stats'); cusstats.innerHTML = cfcountmulti; document.getElementById('customstat').appendChild(cusstats); //Parameters var cftreasurehp = document.getElementById("treasurehp"); var cftreasureatk = document.getElementById("treasureatk"); var cftreasurespawn = document.getElementById("treasurespawn"); var cfspawnres = document.getElementById("spawnres"); var cfspawnresplus = document.getElementById("spawnresplus"); var cfchapcost = document.getElementById("chapcost"); var cfcuslevel = document.getElementById("cuslevel"); var cfcuslevelplus = document.getElementById("cuslevelplus"); //health calculator var cfhealth1 = document.getElementById("health1"); var cfhealth2 = document.getElementById("health2"); var cfhealth3 = document.getElementById("health3"); var cfhealth1c = document.getElementById("health1c"); var cfhealth2c = document.getElementById("health2c"); var cfhealth3c = document.getElementById("health3c"); //damage calculator var cfdamage1 = document.getElementById("damage1"); var cfdamage2 = document.getElementById("damage2"); var cfdamage3 = document.getElementById("damage3"); var cfdamage1c = document.getElementById("damage1c"); var cfdamage2c = document.getElementById("damage2c"); var cfdamage3c = document.getElementById("damage3c"); var cfdps1 = document.getElementById("dps1c"); var cfdps2 = document.getElementById("dps2c"); var cfdps3 = document.getElementById("dps3c"); var cfdps1b = document.getElementById("dps1bc"); var cfdps2b = document.getElementById("dps2bc"); var cfdps3b = document.getElementById("dps3bc"); //atk animation calculator var cfaspd1 = document.getElementById("aspd1"); var cfaspd2 = document.getElementById("aspd2"); var cfaspd3 = document.getElementById("aspd3"); var cfaspd1f = document.getElementById("aspd1f"); var cfaspd2f = document.getElementById("aspd2f"); var cfaspd3f = document.getElementById("aspd3f"); var cfaspd1cf = document.getElementById("aspd1cf"); var cfaspd2cf = document.getElementById("aspd2cf"); var cfaspd3cf = document.getElementById("aspd3cf"); var cfasanis1 = document.getElementById("asanis1"); var cfasanis2 = document.getElementById("asanis2"); var cfasanis3 = document.getElementById("asanis3"); var cfasanis1cf = document.getElementById("asanis1cf"); var cfasanis2cf = document.getElementById("asanis2cf"); var cfasanis3cf = document.getElementById("asanis3cf"); var cfasanie1 = document.getElementById("asanie1"); var cfasanie2 = document.getElementById("asanie2"); var cfasanie3 = document.getElementById("asanie3"); var cfasanie1cf = document.getElementById("asanie1cf"); var cfasanie2cf = document.getElementById("asanie2cf"); var cfasanie3cf = document.getElementById("asanie3cf"); //respawn speed and cost calculator var cfspawn1 = document.getElementById("spawn1"); var cfspawn2 = document.getElementById("spawn2"); var cfspawn3 = document.getElementById("spawn3"); var cfspawn1c = document.getElementById("spawn1c"); var cfspawn2c = document.getElementById("spawn2c"); var cfspawn3c = document.getElementById("spawn3c"); var cfspawn1cf = document.getElementById("spawn1cf"); var cfspawn2cf = document.getElementById("spawn2cf"); var cfspawn3cf = document.getElementById("spawn3cf"); var cfcost1 = document.getElementById("cost1"); var cfcost2 = document.getElementById("cost2"); var cfcost3 = document.getElementById("cost3"); var cfcost1c = document.getElementById("cost1c"); var cfcost2c = document.getElementById("cost2c"); var cfcost3c = document.getElementById("cost3c"); //Auto update setInterval(function{ var cftreasurehpval = 1 + (cftreasurehp.value / 100) * 0.5; var cftreasureatkval = 1 + (cftreasureatk.value / 100) * 0.5; var cftreasurespawnval = 1 + (cftreasurespawn.value / 100) * 0.5; //Health var cfhealth1calc = cfhealth1.innerHTML * (1 + ((cfcuslevel.value - 1) / 5) + (cfcuslevelplus.value / 5)) * cftreasurehpval; cfhealth1c.innerHTML = cfhealth1calc.toFixed(0); var cfhealth2calc = cfhealth2.innerHTML * (1 + ((cfcuslevel.value - 1) / 5) + (cfcuslevelplus.value / 5)) * cftreasurehpval; cfhealth2c.innerHTML = cfhealth2calc.toFixed(0); var cfhealth3calc = cfhealth3.innerHTML * (1 + ((cfcuslevel.value - 1) / 5) + (cfcuslevelplus.value / 5)) * cftreasurehpval; cfhealth3c.innerHTML = cfhealth3calc.toFixed(0); //Attack var cfatk1calc = cfdamage1.innerHTML * (1 + ((cfcuslevel.value - 1) / 5) + (cfcuslevelplus.value / 5)) * cftreasureatkval; cfdamage1c.innerHTML = cfatk1calc.toFixed(0); var cfatk2calc = cfdamage2.innerHTML * (1 + ((cfcuslevel.value - 1) / 5) + (cfcuslevelplus.value / 5)) * cftreasureatkval; cfdamage2c.innerHTML = cfatk2calc.toFixed(0); var cfatk3calc = cfdamage3.innerHTML * (1 + ((cfcuslevel.value - 1) / 5) + (cfcuslevelplus.value / 5)) * cftreasureatkval; cfdamage3c.innerHTML = cfatk3calc.toFixed(0); var cfdps1calc = cfdamage1c.innerHTML / cfaspd1.innerHTML; cfdps1.innerHTML = cfdps1calc.toFixed(0); var cfdps2calc = cfdamage2c.innerHTML / cfaspd2.innerHTML; cfdps2.innerHTML = cfdps1calc.toFixed(0); var cfdps3calc = cfdamage3c.innerHTML / cfaspd3.innerHTML; cfdps3.innerHTML = cfdps3calc.toFixed(0); var cfdps1bcalc = cfdamage1c.innerHTML / (cfaspd1f.innerHTML / 30); cfdps1b.innerHTML = cfdps1bcalc.toFixed(0); var cfdps2bcalc = cfdamage2c.innerHTML / (cfaspd2f.innerHTML / 30); cfdps2b.innerHTML = cfdps2bcalc.toFixed(0); var cfdps3bcalc = cfdamage3c.innerHTML / (cfaspd3f.innerHTML / 30); cfdps3b.innerHTML = cfdps3bcalc.toFixed(0); //Count frame of attack animations var cfaspd1calf = cfaspd1.innerHTML * 30; aspd1cf.innerHTML = cfaspd1calf.toFixed(0); var cfaspd2calf = cfaspd2.innerHTML * 30; aspd2cf.innerHTML = cfaspd2calf.toFixed(0); var cfaspd3calf = cfaspd3.innerHTML * 30; aspd3cf.innerHTML = cfaspd3calf.toFixed(0); var cfasanis1calf = cfasanis1.innerHTML * 30; asanis1cf.innerHTML = cfasanis1calf.toFixed(0); var cfasanis2calf = cfasanis2.innerHTML * 30; asanis2cf.innerHTML = cfasanis2calf.toFixed(0); var cfasanis3calf = cfasanis3.innerHTML * 30; asanis3cf.innerHTML = cfasanis3calf.toFixed(0); var cfasanie1calf = cfasanie1.innerHTML * 30; asanie1cf.innerHTML = cfasanie1calf.toFixed(0); var cfasanie2calf = cfasanie2.innerHTML * 30; asanie2cf.innerHTML = cfasanie2calf.toFixed(0); var cfasanie3calf = cfasanie3.innerHTML * 30; asanie3cf.innerHTML = cfasanie3calf.toFixed(0); //Spawn Speed And Cost var cfspawn1cal = cfspawn1.innerHTML - (0.2 * (cfspawnres.value  - 1)) - (0.2 * cfspawnresplus.value) - cftreasurespawnval; spawn1c.innerHTML = cfspawn1cal.toFixed(2); var cfspawn2cal = cfspawn2.innerHTML - (0.2 * (cfspawnres.value  - 1)) - (0.2 * cfspawnresplus.value) - cftreasurespawnval; spawn2c.innerHTML = cfspawn2cal.toFixed(2); var cfspawn3cal = cfspawn3.innerHTML - (0.2 * (cfspawnres.value  - 1)) - (0.2 * cfspawnresplus.value) - cftreasurespawnval; spawn3c.innerHTML = cfspawn3cal.toFixed(2); var cfspawn1calf = cfspawn1c.innerHTML * 30; spawn1cf.innerHTML = cfspawn1calf.toFixed(0); var cfspawn2calf = cfspawn2c.innerHTML * 30; spawn2cf.innerHTML = cfspawn2calf.toFixed(0); var cfspawn3calf = cfspawn3c.innerHTML * 30; spawn3cf.innerHTML = cfspawn3calf.toFixed(0); var cfcost1cal = cfcost1.innerHTML * cfchapcost.value; cost1c.innerHTML = cfcost1cal.toFixed(0); var cfcost2cal = cfcost2.innerHTML * cfchapcost.value; cost2c.innerHTML = cfcost2cal.toFixed(0); var cfcost3cal = cfcost3.innerHTML * cfchapcost.value; cost3c.innerHTML = cfcost3cal.toFixed(0); }, 1000);