diff --git a/gator.js b/gator.js index 9304e5d..389dd48 100644 --- a/gator.js +++ b/gator.js @@ -1,5 +1,5 @@ window.onload = setup; -var version = "1.5"; +var version = "1.6"; var hze = 0; var ticked = false; var fuelStart = 230; @@ -12,6 +12,8 @@ var carp = 0; var carp2 = 0; var carpMod = 0; var coord = 0; +var randimp = false; +var tauntimpFrequency = 2.97; var efficiency = 0; var capacity = 0; var maxCapacity = 3; @@ -160,6 +162,18 @@ function changeCoord(value) { calculateCurrentPop(); } +function changeRandimp(value) { + if (value == "No" || !value) { + randimp = false; + tauntimpFrequency = 2.97; + } + else { + randimp = true + tauntimpFrequency = 3.366; + } + calculateCurrentPop(); +} + function changeEfficiency(value, mod) { efficiency = parseInt(value); calculateMinTick(); @@ -334,8 +348,8 @@ function changeSlowburn(value) { } function changeMagmaFlow(value) { - if (value == "Yes" || value) magmaFlow = true; - else magmaFlow = false; + if (value == "No" || !value) magmaFlow = false; + else magmaFlow = true; if (magmaFlow) magmaCells = 18; else magmaCells = 16; calculateMagma(); @@ -408,9 +422,9 @@ function calculateCurrentPop() { overclockPop[i] = Math.floor(overclockTicks[i]) * (carpMod * tickRatio) * overclocker; if (i == 0) overclockPopThisZone[0] = Math.max(overclockPop[0], 0); else overclockPopThisZone[i] = Math.max(overclockPop[i] - overclockPop[i - 1], 0); - if (i == 0) popWithTauntimp[0] = Math.floor(overclockPopThisZone[0] * Math.pow(1.003, 2.97)); - else if (useConf) popWithTauntimp[i] = Math.floor((overclockPopThisZone[i] + popWithTauntimp[i - 1]) * Math.pow(confValue, 2.97)); - else popWithTauntimp[i] = Math.floor((overclockPopThisZone[i] + popWithTauntimp[i - 1]) * Math.pow(1.003, 2.97)); + if (i == 0) popWithTauntimp[0] = Math.floor(overclockPopThisZone[0] * Math.pow(1.003, tauntimpFrequency)); + else if (useConf) popWithTauntimp[i] = Math.floor((overclockPopThisZone[i] + popWithTauntimp[i - 1]) * Math.pow(confValue, tauntimpFrequency)); + else popWithTauntimp[i] = Math.floor((overclockPopThisZone[i] + popWithTauntimp[i - 1]) * Math.pow(1.003, tauntimpFrequency)); if (i == 0) sum[0] = overclockPopThisZone[0]; else sum[i] = overclockPopThisZone[i] + sum[i - 1]; popFromTauntimp[i] = popWithTauntimp[i] - sum[i]; @@ -597,6 +611,14 @@ function pasteSave(save) { coord = game.portal.Coordinated.level; changeCoord(coord); document.getElementById("coord").value = coord; + randimp = game.talents.magimp.purchased; + if (randimp) { + changeRandimp(true); + document.getElementById("randimp").value = "Yes"; + } else { + changeRandimp(false); + document.getElementById("randimp").value = "No"; + } efficiency = game.generatorUpgrades.Efficiency.upgrades; changeEfficiency(efficiency); document.getElementById("efficiency").value = efficiency; @@ -690,7 +712,7 @@ function minimize(dif, variant) { var myEnd = runEnd; if (variant == 1) changeRunEnd(minimizeZone); changeFuelEnd(runEnd); - var bestAmals = maxAmals - dif; + var bestAmals = finalAmals - dif; var bestJ = fuelZones; var maxedAmals = false; if (variant == 1) { @@ -702,7 +724,7 @@ function minimize(dif, variant) { if (variant == 2) var myCapacity = capacity; while (fuelStart >= 230) { - while (maxAmals >= bestAmals && fuelZones >= 0) { + while (finalAmals >= bestAmals && fuelZones >= 0) { if (variant == 2) { var myPop = totalPop; while (totalPop >= myPop) { @@ -723,7 +745,7 @@ function minimize(dif, variant) { if (fuelStart >= 230) changeFuelStart(fuelStart); if (variant == 1) changeFuelZones(Math.min(minimizeZone - fuelStart, bestJ)); else changeFuelZones(Math.min(runEnd - fuelStart, bestJ)); - if (maxedAmals == true && maxAmals < bestAmals) break; + if (maxedAmals == true && finalAmals < bestAmals) break; } changeFuelZones(bestJ); @@ -731,13 +753,12 @@ function minimize(dif, variant) { optimize(); if (variant == 1) { changeRunEnd(myEnd); - document.getElementById("runEnd").value = runEnd; } if (variant == 2) { myPop = totalPop; for (b = 0; b < 4; b++) { //run this a bunch or something changeCapacity(capacity + 1, 2); - while (totalPop >= myPop && maxAmals >= bestAmals && capacity <= myCapacity) { + while (totalPop >= myPop && finalAmals >= bestAmals && capacity <= myCapacity) { myPop = totalPop; changeCapacity(capacity + 1, 2); } @@ -862,6 +883,7 @@ function saveSettings() { carp : carp, carp2 : carp2, coord : coord, + randimp : randimp, efficiency : efficiency, capacity : capacity, supply : supply, @@ -893,6 +915,7 @@ function loadSettings() { if (typeof settings.carp != "undefined") carp = settings.carp; if (typeof settings.carp2 != "undefined") carp2 = settings.carp2; if (typeof settings.coord != "undefined") coord = settings.coord; + if (typeof settings.randimp != "undefined") randimp = settings.randimp; if (typeof settings.efficiency != "undefined") efficiency = settings.efficiency; if (typeof settings.capacity != "undefined") capacity = settings.capacity; if (typeof settings.supply != "undefined") supply = settings.supply; @@ -932,6 +955,9 @@ function loadSettings() { document.getElementById("carp2").value = carp2; changeCoord(coord); document.getElementById("coord").value = coord; + changeRandimp(randimp); + if (randimp) document.getElementById("randimp").value = "Yes"; + else document.getElementById("randimp").value = "No"; changeEfficiency(efficiency); document.getElementById("efficiency").value = efficiency; changeCapacity(capacity); @@ -1015,4 +1041,4 @@ function enumerate(x) { return x + "e" + n; } -//Copyright Nohmou, 2018 \ No newline at end of file +//Copyright Nohmou, 2018 diff --git a/gatorTest.js b/gatorTest.js new file mode 100644 index 0000000..02e85a7 --- /dev/null +++ b/gatorTest.js @@ -0,0 +1,250 @@ +window.onload = setup; +var version = "1.6"; +var hze = 1; +var lockedRunStats = false; +var fuelStart = 230; +var fuelEnd = 230; +var fuelZones = 0; +var runEnd = 230; +var housingMod = 1; +var spiresCleared = 0; + +var carpentry = 0; +var carpentry2 = 0; +var carpentryMod = 0; +var coordinated = 0; + +var randimp = false; +var tauntimpFrequency = 2.97; +var magmaFlow = false; +var magmaCellsPerZone = 16; + +var efficiency = 0; +var efficiencyMod = 1 +var capacity = 0; +var maxCapacity = 3; +var supply = 0; +var supplyCap = 230; +var maxSupply = 0.2; +var overclocker = 0; +var overclockRate = 0; + +var storage = false; +var storageMod = 1; +var slowburn = false; +var fuelPerTick = 0.5; +var popPerTick = 0; + +var efficiencyCost = 8; +var capacityCost = 32; +var supplyCost = 64; +var overclockerCost = 512; + +var efficiencyValue = 1; +var capacityValue = 1; +var supplyValue = 1; +var overclockerValue = 0; + +var totalPop = 0; +var finalArmySize = 0; +var maxAmalgamators = 0; +var finalAmalgamators = 0; +var finalAmalgamatorZone = 0; + +var magmaZones = 0; +var magmiteZones = 0; +var magmiteEarned = 0; +var currentPop = []; + +var tauntimpPercent = 0; + +var lastCoordination = 0; + +var neededPop = 0; + +var coordinationArmyIncrease = 0; +var armySizes = []; +var coordinationThresholds = []; +var finalAmalRatio = 0; +var yourFinalRatio = 0; + + +var minimizeZone = 230; +var offset = false; + +function setup() { + loadSettings(); //Load + document.getElementById("version").innerHTML = version; +} + +function changeFuelStart(value) { + fuelStart = Math.max(230, parseInt(value)); + if (fuelEnd < fuelStart) { + fuelEnd = fuelStart; + document.getElementById("fuelEnd").value = fuelEnd; + } + if (runEnd < fuelEnd) { + runEnd = fuelEnd; + document.getElementById("runEnd").value = runEnd; + } + fuelZones = fuelEnd - fuelStart; + document.getElementById("fuelZones").value = fuelZones; +} + +function changeFuelEnd(value) { + fuelEnd = Math.max(230, parseInt(value)); + if (fuelStart > fuelEnd) { + fuelStart = fuelEnd; + document.getElementById("fuelStart").value = fuelStart; + } + if (runEnd < fuelEnd) { + runEnd = fuelEnd; + document.getElementById("runEnd").value = runEnd; + } + fuelZones = fuelEnd - fuelStart; + document.getElementById("fuelZones").value = fuelZones; +} + +function changeFuelZones(value) { + fuelZones = Math.max(0, parseInt(value)); + fuelEnd = fuelStart + fuelZones; + document.getElementById("fuelEnd").value = fuelEnd; + if (runEnd < fuelEnd) { + runEnd = fuelEnd; + document.getElementById("runEnd").value = runEnd; + } +} + +function changeRunEnd(value) { + runEnd = Math.max(1, parseInt(value)); + if (fuelStart > runEnd) { + fuelStart = runEnd; + document.getElementById("fuelStart").value = fuelStart; + } + if (fuelEnd > runEnd) { + fuelEnd = runEnd; + document.getElementById("fuelEnd").value = fuelEnd; + fuelZones = fuelEnd - fuelStart; + document.getElementById("fuelZones").value = fuelZones; + } +} + +function changeHousingMod(value) { + housingMod = parsefloat(value); + if (housingMod < 0) { + housingMod = 1 + housingMod / 100; + document.getElementById("housingMod").value = housingMod; + } +} + +function changeSpiresCleared(value) { + spiresCleared = Math.min(7, Math.max(0, parseInt(value))); +} + +function changeCarpentry(value) { + carpentry = Math.max(0, parseInt(value)); + calculateCarpentryMod(); +} + +function changeCarpentry2(value) { + carpentry2 = Math.max(0, parseInt(value)); + calculateCarpentryMod(); +} + +function calculateCarpentryMod() { + carpentryMod = Math.pow(1.1, carpentry) * (1 + 0.0025 * carpentry2); +} + +function changeCoordinated(value) { + coordinated = Math.max(0, parseInt(value)); + calculateCoordinationIncrease(); +} + +function calculateCoordinationIncrease() { + coordinationArmyIncrease = 25 * 0.98 ** coordinated; + document.getElementById("coordinationArmyIncrease").textContent = coordinationArmyIncrease.toFixed(4) + "%"; +} + +function changeRandimp(value) { + randimp = value; + if (value) tauntimpFrequency = 2.97; + else tauntimpFrequency = 3.366; +} + +function changeMagmaFlow(value) { + magmaFlow = value; + if (value) magmaCellsPerZone = 18; + else magmaCellsPerZone = 16; +} + +function calculateMagma() { + magmaZones = runEnd - fuelStart; + document.getElementById("magmaZones").textContent = magmaZones; + + document.getElementById("fuelZones").textContent = fuelZones; + + magmiteZones = magmaZones - fuelZones; + document.getElementById("magmiteZones").textContent = magmiteZones; + + magmiteEarned = magmiteZones * magmaCelsPerZone; + document.getElementById("magmiteEarned").textContent = magmiteEarned; +} + +function changeEfficiency(value) { + efficiency = Math.max(0, parseInt(value)); + efficiencyMod = 1 + efficiency / 10; +} + +function changeCapacity(value) { + capacity = Math.max(0, parseint(value)); + maxCapacity = 3 + capacity * 0.4; +} + +function changeSupply(value) { + supply = Math.max(0, parseInt(value)); + maxSupply = 0.2 + 0.02 * supply; +} + +function changeOverclocker(value) { + overclocker = Math.max(0, parseInt(value)); + if (overclocker = 0) overclockRate = 0; + else overclockRate = 1 - 0.50 * Math.pow(0.99, overclocker-1); +} + +function checkDimensionalGeneratorUpgrades() {} + +function changeHZE(value) { + hze = Math.max(1, parseInt(value)); +} + +function changeStorage(value) { + storage = value; + if (storage) storageMod = 2; + else storageMod = 1; +} + +function changeSlowburn(value) { + slowburn = value; + if (slowwburn) fuelPerTick = 0.4; + else fuelPerTick = 0.5; +} + +function calculateCurrentPop() {} + +function pasteSave(save) {} + +function clearSaveBox() {} + +function optimize() {} + +function minimize() {} + +function changeMinimizeZone() {} + +function saveSettings() {} + +function loadSettings() {} + +function openFAQ() {} + +function enumerate() {} diff --git a/index.html b/index.html index f10d490..c25b3f4 100644 --- a/index.html +++ b/index.html @@ -57,6 +57,17 @@
 Coordinated


+ Masteries
+  Randimp +
+  Magma Flow +

DG LevelsNext Upgrade
 Efficiency @@ -87,14 +98,10 @@  Slowburn
-  Magma Flow

-
Version
+



@@ -166,19 +173,19 @@ Your Final Ratio0 - Zones of MI0 + Magma Zones0 Zones Withheld- - Zones of Fuel0 + Fuel Zones0 - Magma Zones0 + Magmite Zones0 - Total MI Earned0 + Magmite Earned0 @@ -252,7 +259,7 @@ This calculator assumes no population before you begin fueling. The population received before your first DG tick is inconsequential to your total population, and won't affect the results shown for the intended users of this page.
- The calculator assumes exactly 2.97 tauntimps received per zone. This averages out to the expected value, but it is possible to have good/bad luck with tauntimps, and have your population thrive/suffer accordingly. + The calculator assumes exactly 2.97 tauntimps received per zone, or 3.366 with the Randimp mastery. This averages out to the expected value, but it is possible to have good/bad luck with tauntimps, and have your population thrive/suffer accordingly.
The calculator assumes all DG ticks made are overclocks. This slightly affects the final results, especially for those with lower overclocker levels, as those non-OC ticks will be stronger that OC ticks, and happen earlier, therefore benefitting more from tauntimp compounding. However, the differences are still small, and largely unnoticable for fueling more than a couple of zones. @@ -265,16 +272,16 @@
I found an error, what can I do? - Please contact me on reddit (u/Nohmou) or discord (@Nohmou#5097) and I'll look at it right away! Screenshots of your settings are helpful in diagnosing any technical issues. + Please contact me on reddit (u/Zeralyos) or discord (@Zeraalyos#3692) and I'll look at it right away! Screenshots of your settings are helpful in diagnosing any technical issues.
Is this up to date? - This was last updated on November 7, 2018. + This was last updated on June 17, 2020.

- \ No newline at end of file + diff --git a/indexTest.html b/indexTest.html new file mode 100644 index 0000000..fb79f37 --- /dev/null +++ b/indexTest.html @@ -0,0 +1,287 @@ + + + + GatorCalc Test Version + + + + + + + +
+
+ + +
+ + +
+ +

+ Run Stats
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +


+ Perk Levels
+  Carpentry +
+
+  Carpentry II +
+
+  Coordinated +


+ Masteries
+  Randimp +
+  Magma Flow +


+ DG LevelsNext Upgrade
+  Efficiency + +
+
+  Capacity + +
+
+  Supply + +
+
+  Overclocker + +
+ + Push Run Goal:  +

+ DG Upgrades
+  Storage +
+  Slowburn +
+
+
+
+

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+


+
+
+
+

Results
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Total Population0Final Amals0
% from Tauntimps0Max Amals0
Last Coord-@ Zone0
Needed Pop0Final Army Size0
Increase per Coord0Final Amal Ratio0
Your Final Ratio0
Magma Zones0Zones Withheld-
Fuel Zones0
Magmite Zones0
Magmite Earned0
Max Supply @ Zone0
+
+ + + + + + + +
RangeExtra GatorNeeded Pop MultUnbought Coords
230-300
301-400
401-500
501-600
601+
+
+ + + + +