Exclude certain spouts from random anyway
that is, if their corresponding element is already excluded from random (*cough* supernova)
This commit is contained in:
parent
8607d8d72d
commit
74bbffdab2
|
|
@ -14,9 +14,11 @@ function _randomInt(max) {
|
|||
}
|
||||
}
|
||||
|
||||
excludedElements = ["ketchup", "liquid_cloner", "fire_cloner"]
|
||||
|
||||
runAfterLoad(function() {
|
||||
liquidArray = Object.keys(elements).filter(function(e) {
|
||||
return (elements[e].state == "liquid" || elements[e].state == "gas") && elements[e] != "ketchup" && elements[e] != "liquid_cloner" && elements[e] != "fire_cloner";
|
||||
return (elements[e].state == "liquid" || elements[e].state == "gas") && !excludedElements.includes(elements[e]);
|
||||
});
|
||||
for(i = 0; i < liquidArray.length; i++) {
|
||||
elements[`${liquidArray[i]}_spout`] = {
|
||||
|
|
@ -30,9 +32,10 @@ runAfterLoad(function() {
|
|||
temp: elements[liquidArray[i]].temp,
|
||||
hardness: 1,
|
||||
};
|
||||
includeRandom == true ? elements[`${liquidArray[i]}_spout`].excludeRandom = false : elements[`${liquidArray[i]}_spout`].excludeRandom = true;
|
||||
};
|
||||
if(elements.liquid_cloner) { liquidArray.push("ketchup") };
|
||||
if(elements.fire_cloner) { liquidArray.push("fire") };
|
||||
liquidArray.push("ketchup");
|
||||
if(includeRandom == true) {
|
||||
elements[liquidArray[i]].excludeRandom ? elements[`${liquidArray[i]}_spout`].excludeRandom = true : elements[`${liquidArray[i]}_spout`].excludeRandom = false;
|
||||
} else {
|
||||
elements[`${liquidArray[i]}_spout`].excludeRandom = false;
|
||||
};
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue