various buffs
This commit is contained in:
parent
e129fa30d4
commit
4a67bec9f4
|
|
@ -2,77 +2,108 @@ var modName = "mods/life_eater.js";
|
|||
var fireMod = "mods/fire_mod.js";
|
||||
|
||||
if(!enabledMods.includes(fireMod)) {
|
||||
enabledMods.splice(enabledMods.indexOf(modName),0,fireMod);
|
||||
enabledMods.splice(enabledMods.indexOf(modName),0,fireMod);
|
||||
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
|
||||
alert(`The ${fireMod} mod is required and has been automatically inserted (reload for this to take effect).`);
|
||||
} else {
|
||||
|
||||
var lifeEaterCategories = ["life","auto creepers","shit","cum"];
|
||||
var lifeEaterBlacklist = ["life_eater_virus","life_eater_infection","organic_slurry"];
|
||||
var lifeEaterWhitelist = ["blood","poop","blood_ice"];
|
||||
var lifeEaterCategories = ["life","auto creepers","shit","cum","food","fantastic creatures","fey","auto_fey"];
|
||||
var lifeEaterBlacklist = ["life_eater_virus","life_eater_slurry"];
|
||||
var lifeEaterWhitelist = ["blood","poop","blood_ice","wood","wood_plank","sawdust","straw","paper","birthpool","dried_poop","gloomfly","meat_monster","rotten_ravager","bone_beast","withery","withery_plant","banana","apple","rotten_apple","apioform_player","apioform_bee","apioform","apiodiagoform","sugar_cactus","sugar_cactus_seed","flowering_sugar_cactus"];
|
||||
|
||||
function spreadLifeEater(pixel) {
|
||||
for(i = 0; i < adjacentCoords.length; i++) { //iterate through neighbor spots
|
||||
if(!isEmpty(pixel.x+adjacentCoords[i][0],pixel.y+adjacentCoords[i][1],true)) { //check for adjacentCoords
|
||||
var newPixel = pixelMap[pixel.x+adjacentCoords[i][0]][pixel.y+adjacentCoords[i][1]]
|
||||
if(
|
||||
(lifeEaterCategories.includes(elements[newPixel.element].category) || lifeEaterWhitelist.includes(newPixel.element)) &&
|
||||
!lifeEaterBlacklist.includes(newPixel.element)
|
||||
) {
|
||||
changePixel(newPixel,"life_eater_infection");
|
||||
function tryCreatePlus(element,centerX,centerY) {
|
||||
var plusCoords = adjacentCoords.concat([[0,0]]);
|
||||
var pixels = 0;
|
||||
for(let i = 0; i < plusCoords.length; i++) {
|
||||
var newX = centerX + plusCoords[i][0];
|
||||
var newY = centerY + plusCoords[i][1];
|
||||
if(isEmpty(newX,newY)) {
|
||||
while(element instanceof Array) { element = element[Math.floor(Math.random() * element.length)] };
|
||||
createPixel(element,newX,newY);
|
||||
pixels++;
|
||||
};
|
||||
};
|
||||
return pixels;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
elements.life_eater_virus = {
|
||||
color: ["#7bb064", "#aabd60", "#9e9e29"],
|
||||
behavior: behaviors.GAS,
|
||||
tick: function(pixel) {
|
||||
spreadLifeEater(pixel);
|
||||
},
|
||||
category: "life",
|
||||
state: "gas",
|
||||
density: airDensity,
|
||||
excludeRandom: true,
|
||||
};
|
||||
|
||||
elements.life_eater_infection = {
|
||||
color: ["#3d6e29", "#666617", "#7d5716"],
|
||||
behavior: behaviors.LIQUID,
|
||||
tick: function(pixel) {
|
||||
spreadLifeEater(pixel);
|
||||
|
||||
if(pixelTicks - pixel.start > 6) {
|
||||
changePixel(pixel,Math.random() < 0.5 ? "methane" : "organic_slurry");
|
||||
function spreadLifeEater(pixel) {
|
||||
var convertedPixels = [];
|
||||
for(i = 0; i < adjacentCoords.length; i++) { //iterate through neighbor spots
|
||||
if(!isEmpty(pixel.x+adjacentCoords[i][0],pixel.y+adjacentCoords[i][1],true)) { //check for adjacentCoords
|
||||
var newPixel = pixelMap[pixel.x+adjacentCoords[i][0]][pixel.y+adjacentCoords[i][1]]
|
||||
var isLifeEaterFairy = (elements[newPixel.element].category == "auto_fey" && newPixel.element.includes("life_eater_"))
|
||||
//console.log(newPixel.element,isLifeEaterFairy);
|
||||
if(
|
||||
(lifeEaterCategories.includes(elements[newPixel.element].category) || lifeEaterWhitelist.includes(newPixel.element)) &&
|
||||
!lifeEaterBlacklist.includes(newPixel.element) &&
|
||||
!isLifeEaterFairy //exclude fairies which produce life eater
|
||||
) {
|
||||
changePixel(newPixel,"life_eater_slurry");
|
||||
convertedPixels.push(newPixel);
|
||||
};
|
||||
};
|
||||
};
|
||||
},
|
||||
category: "life",
|
||||
state: "liquid",
|
||||
density: 1050,
|
||||
burn: 70,
|
||||
burnTime: 20,
|
||||
fireSpawnTemp: 1000,
|
||||
burnTempChange: 100,
|
||||
excludeRandom: true,
|
||||
};
|
||||
return convertedPixels;
|
||||
};
|
||||
|
||||
elements.organic_slurry = {
|
||||
color: ["#6f8046", "#857539"],
|
||||
behavior: behaviors.LIQUID,
|
||||
reactions: {
|
||||
"dirt": {elem1: null, elem2: "mud"},
|
||||
"sand": {elem1: null, elem2: "wet_sand"},
|
||||
elements.life_eater_explosion = {
|
||||
color: ["#96c785","#f0d654","#ffb47a"],
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|EX:9>plasma,fire,life_eater_virus|XX",
|
||||
"XX|XX|XX",
|
||||
],
|
||||
temp: 1600,
|
||||
category: "energy",
|
||||
state: "gas",
|
||||
density: 1000,
|
||||
excludeRandom: true,
|
||||
hidden: true,
|
||||
},
|
||||
category: "life",
|
||||
state: "liquid",
|
||||
density: 1050,
|
||||
burn: 80,
|
||||
burnTime: 10,
|
||||
fireSpawnTemp: 1000,
|
||||
burnTempChange: 100,
|
||||
excludeRandom: true,
|
||||
};
|
||||
|
||||
elements.life_eater_virus = {
|
||||
color: ["#7bb064", "#aabd60", "#9e9e29"],
|
||||
behavior: behaviors.GAS,
|
||||
tick: function(pixel) {
|
||||
spreadLifeEater(pixel).forEach(infectedPixel => spreadLifeEater(infectedPixel));
|
||||
},
|
||||
category: "life",
|
||||
state: "gas",
|
||||
density: airDensity,
|
||||
excludeRandom: true,
|
||||
tempHigh: 300,
|
||||
stateHigh: null,
|
||||
};
|
||||
|
||||
elements.life_eater_slurry = {
|
||||
color: ["#3d6e29", "#666617", "#7d5716"],
|
||||
behavior: behaviors.LIQUID,
|
||||
properties: {
|
||||
methaned: false,
|
||||
},
|
||||
tick: function(pixel) {
|
||||
spreadLifeEater(pixel).forEach(infectedPixel => spreadLifeEater(infectedPixel));
|
||||
|
||||
if(pixelTicks - pixel.start > 6) {
|
||||
if(!pixel.methaned && Math.random() < 0.2) {
|
||||
changePixel(pixel,Math.random() < 0.2 ? "life_eater_virus" : "methane");
|
||||
} else {
|
||||
pixel.methaned = true;
|
||||
};
|
||||
tryCreatePlus(["methane","methane","methane","methane","life_eater_virus"],pixel.x,pixel.y);
|
||||
return;
|
||||
};
|
||||
},
|
||||
category: "life",
|
||||
state: "liquid",
|
||||
density: 1050,
|
||||
burn: 100,
|
||||
burnTime: 10,
|
||||
fireSpawnTemp: 1500,
|
||||
burnTempChange: 200,
|
||||
burnInto: ["life_eater_virus","plasma","fire","life_eater_explosion"],
|
||||
excludeRandom: true,
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue