Last active
March 29, 2024 02:53
-
-
Save gistya/03764efb38816fe4b2d6629ec8bb4dbe to your computer and use it in GitHub Desktop.
Filter by number of farmable biomes in system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add at line 5: | |
<select name="NumberOfFarmBiomes" id="NumberOfFarmBiomes"> | |
<option value="-NumberOfFarmBiomes-">-NumberOfFarmBiomes-</option> | |
<option value="0">0</option> | |
<option value="1">1</option> | |
<option value="2">2</option> | |
<option value="3">3</option> | |
<option value="4">4</option> | |
<option value="5">5</option> | |
<option value="6">6</option> | |
</select> | |
// then add at line 894: | |
var NumberOfFarmBiomes = document.getElementById("NumberOfFarmBiomes").value | |
// add at line 1055 (after the other per planet check loop: | |
if (match == true && NumberOfFarmBiomes != "-NumberOfFarmBiomes-") { | |
var hasLush = false | |
var hasBarren = false | |
var hasToxic = false | |
var hasFrozen = false | |
var hasScorched = false | |
var hasRadioactive = false | |
for (var j = 1; j < PlanenNumber; j++) { | |
if (NumberOfFarmBiomes != "-NumberOfFarmBiomes-") { | |
switch (BiomeTable[j].innerText) { | |
case "Lush": | |
if (SubBiomeTable[j].innerText != "Swamp") { | |
hasLush = true | |
} | |
break; | |
case "Barren": | |
hasBarren = true | |
break; | |
case "Toxic": | |
hasToxic = true | |
break; | |
case "Frozen": | |
hasFrozen = true | |
break; | |
case "Scorched": | |
if (SubBiomeTable[j].innerText != "Lava") { | |
hasScorched = true | |
} | |
break; | |
case "Radioactive": | |
hasRadioactive = true | |
break; | |
} | |
} | |
} | |
var farmBiomeCount = 0 | |
if (hasLush == true) { farmBiomeCount++ } | |
if (hasBarren == true) { farmBiomeCount++ } | |
if (hasToxic == true) { farmBiomeCount++ } | |
if (hasFrozen == true) { farmBiomeCount++ } | |
if (hasScorched == true) { farmBiomeCount++ } | |
if (hasRadioactive == true) { farmBiomeCount++ } | |
if (farmBiomeCount < NumberOfFarmBiomes) { | |
match = false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment