Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c4efe9a
Add randimp functionality, fix changeMagmaFlow
Zeralyos Jun 17, 2020
9772c92
Adding randimp UI
Zeralyos Jun 17, 2020
526e9e8
Update gator.js
Zeralyos Jun 17, 2020
b75efdf
Update gator.js
Zeralyos Jun 17, 2020
a9a001e
Update index.html
Zeralyos Jun 17, 2020
35f9a3d
Update index.html
Zeralyos Jun 17, 2020
92d8f01
Update index.html
Zeralyos Jun 17, 2020
4f2a899
Update gator.js
Zeralyos Jun 17, 2020
20737fa
Update gator.js
Zeralyos Jun 17, 2020
acf3d62
Update gator.js
Zeralyos Jun 17, 2020
9357363
Update gator.js
Zeralyos Jun 17, 2020
c7350d1
Update gator.js
Zeralyos Jun 17, 2020
77d5f53
Update gator.js
Zeralyos Jun 17, 2020
53b520d
Update gator.js
Zeralyos Jun 17, 2020
932197b
Update gator.js
Zeralyos Jun 17, 2020
4286e33
Update index.html
Zeralyos Jun 17, 2020
063007d
Update gator.js
Zeralyos Jun 17, 2020
c4a550e
Update index.html
Zeralyos Jun 18, 2020
5a16f65
Blank functions named
Zeralyos Jun 18, 2020
8dbd192
Testing pattern attribute
Zeralyos Jun 18, 2020
2a4e49b
Update index.html
Zeralyos Jun 18, 2020
31f7a65
Create testIndex.html
Zeralyos Jun 18, 2020
9202cfc
Rename testIndex.html to indexTest.html
Zeralyos Jun 18, 2020
c34db82
Added setup() and changeFuelStart()
Zeralyos Jun 19, 2020
d35f5c2
Update gatorTest.js
Zeralyos Jun 19, 2020
f0029d7
Update gatorTest.js
Zeralyos Jun 19, 2020
89b45a1
Finished changeFuelStart()
Zeralyos Jun 19, 2020
386fdcc
Added changeFuelEnd, changeFuelZones, changeRunEnd
Zeralyos Jun 19, 2020
545ab72
Fixed changeRunEnd
Zeralyos Jun 19, 2020
5cdeb03
Added functions
Zeralyos Jun 19, 2020
87923dc
Update indexTest.html
Zeralyos Jun 19, 2020
303b416
Update gatorTest.js
Zeralyos Jun 19, 2020
ac3321e
Update gatorTest.js
Zeralyos Jun 19, 2020
4030a73
Update indexTest.html
Zeralyos Jun 19, 2020
6d10657
Update gatorTest.js
Zeralyos Jun 19, 2020
a38db5a
Update gatorTest.js
Zeralyos Jun 19, 2020
db06916
Shuffled Magma Flow to the Masteries section
Zeralyos Jun 22, 2020
fbaf1e3
Update gatorTest.js
Zeralyos Jun 22, 2020
4225d44
Update indexTest.html
Zeralyos Jun 25, 2020
138d43b
Update gatorTest.js
Zeralyos Jun 25, 2020
6600bd3
Update indexTest.html
Zeralyos Jun 25, 2020
6de91ae
Update indexTest.html
Zeralyos Jun 25, 2020
f015666
Update gatorTest.js
Zeralyos Jun 25, 2020
18d0631
Update index.html
Zeralyos Oct 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 38 additions & 12 deletions gator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
window.onload = setup;
var version = "1.5";
var version = "1.6";
var hze = 0;
var ticked = false;
var fuelStart = 230;
Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -723,21 +745,20 @@ 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);
document.getElementById("fuelZones").value = fuelZones;
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);
}
Expand Down Expand Up @@ -862,6 +883,7 @@ function saveSettings() {
carp : carp,
carp2 : carp2,
coord : coord,
randimp : randimp,
efficiency : efficiency,
capacity : capacity,
supply : supply,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1015,4 +1041,4 @@ function enumerate(x) {
return x + "e" + n;
}

//Copyright Nohmou, 2018
//Copyright Nohmou, 2018
250 changes: 250 additions & 0 deletions gatorTest.js
Original file line number Diff line number Diff line change
@@ -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() {}
Loading