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";
|
var fireMod = "mods/fire_mod.js";
|
||||||
|
|
||||||
if(!enabledMods.includes(fireMod)) {
|
if(!enabledMods.includes(fireMod)) {
|
||||||
|
enabledMods.splice(enabledMods.indexOf(modName),0,fireMod);
|
||||||
enabledMods.splice(enabledMods.indexOf(modName),0,fireMod);
|
enabledMods.splice(enabledMods.indexOf(modName),0,fireMod);
|
||||||
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
|
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
|
||||||
alert(`The ${fireMod} mod is required and has been automatically inserted (reload for this to take effect).`);
|
alert(`The ${fireMod} mod is required and has been automatically inserted (reload for this to take effect).`);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
var lifeEaterCategories = ["life","auto creepers","shit","cum"];
|
var lifeEaterCategories = ["life","auto creepers","shit","cum","food","fantastic creatures","fey","auto_fey"];
|
||||||
var lifeEaterBlacklist = ["life_eater_virus","life_eater_infection","organic_slurry"];
|
var lifeEaterBlacklist = ["life_eater_virus","life_eater_slurry"];
|
||||||
var lifeEaterWhitelist = ["blood","poop","blood_ice"];
|
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) {
|
function tryCreatePlus(element,centerX,centerY) {
|
||||||
for(i = 0; i < adjacentCoords.length; i++) { //iterate through neighbor spots
|
var plusCoords = adjacentCoords.concat([[0,0]]);
|
||||||
if(!isEmpty(pixel.x+adjacentCoords[i][0],pixel.y+adjacentCoords[i][1],true)) { //check for adjacentCoords
|
var pixels = 0;
|
||||||
var newPixel = pixelMap[pixel.x+adjacentCoords[i][0]][pixel.y+adjacentCoords[i][1]]
|
for(let i = 0; i < plusCoords.length; i++) {
|
||||||
if(
|
var newX = centerX + plusCoords[i][0];
|
||||||
(lifeEaterCategories.includes(elements[newPixel.element].category) || lifeEaterWhitelist.includes(newPixel.element)) &&
|
var newY = centerY + plusCoords[i][1];
|
||||||
!lifeEaterBlacklist.includes(newPixel.element)
|
if(isEmpty(newX,newY)) {
|
||||||
) {
|
while(element instanceof Array) { element = element[Math.floor(Math.random() * element.length)] };
|
||||||
changePixel(newPixel,"life_eater_infection");
|
createPixel(element,newX,newY);
|
||||||
|
pixels++;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
return pixels;
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
|
function spreadLifeEater(pixel) {
|
||||||
elements.life_eater_virus = {
|
var convertedPixels = [];
|
||||||
color: ["#7bb064", "#aabd60", "#9e9e29"],
|
for(i = 0; i < adjacentCoords.length; i++) { //iterate through neighbor spots
|
||||||
behavior: behaviors.GAS,
|
if(!isEmpty(pixel.x+adjacentCoords[i][0],pixel.y+adjacentCoords[i][1],true)) { //check for adjacentCoords
|
||||||
tick: function(pixel) {
|
var newPixel = pixelMap[pixel.x+adjacentCoords[i][0]][pixel.y+adjacentCoords[i][1]]
|
||||||
spreadLifeEater(pixel);
|
var isLifeEaterFairy = (elements[newPixel.element].category == "auto_fey" && newPixel.element.includes("life_eater_"))
|
||||||
},
|
//console.log(newPixel.element,isLifeEaterFairy);
|
||||||
category: "life",
|
if(
|
||||||
state: "gas",
|
(lifeEaterCategories.includes(elements[newPixel.element].category) || lifeEaterWhitelist.includes(newPixel.element)) &&
|
||||||
density: airDensity,
|
!lifeEaterBlacklist.includes(newPixel.element) &&
|
||||||
excludeRandom: true,
|
!isLifeEaterFairy //exclude fairies which produce life eater
|
||||||
};
|
) {
|
||||||
|
changePixel(newPixel,"life_eater_slurry");
|
||||||
elements.life_eater_infection = {
|
convertedPixels.push(newPixel);
|
||||||
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");
|
|
||||||
};
|
};
|
||||||
},
|
return convertedPixels;
|
||||||
category: "life",
|
};
|
||||||
state: "liquid",
|
|
||||||
density: 1050,
|
|
||||||
burn: 70,
|
|
||||||
burnTime: 20,
|
|
||||||
fireSpawnTemp: 1000,
|
|
||||||
burnTempChange: 100,
|
|
||||||
excludeRandom: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
elements.organic_slurry = {
|
elements.life_eater_explosion = {
|
||||||
color: ["#6f8046", "#857539"],
|
color: ["#96c785","#f0d654","#ffb47a"],
|
||||||
behavior: behaviors.LIQUID,
|
behavior: [
|
||||||
reactions: {
|
"XX|XX|XX",
|
||||||
"dirt": {elem1: null, elem2: "mud"},
|
"XX|EX:9>plasma,fire,life_eater_virus|XX",
|
||||||
"sand": {elem1: null, elem2: "wet_sand"},
|
"XX|XX|XX",
|
||||||
|
],
|
||||||
|
temp: 1600,
|
||||||
|
category: "energy",
|
||||||
|
state: "gas",
|
||||||
|
density: 1000,
|
||||||
|
excludeRandom: true,
|
||||||
|
hidden: true,
|
||||||
},
|
},
|
||||||
category: "life",
|
|
||||||
state: "liquid",
|
elements.life_eater_virus = {
|
||||||
density: 1050,
|
color: ["#7bb064", "#aabd60", "#9e9e29"],
|
||||||
burn: 80,
|
behavior: behaviors.GAS,
|
||||||
burnTime: 10,
|
tick: function(pixel) {
|
||||||
fireSpawnTemp: 1000,
|
spreadLifeEater(pixel).forEach(infectedPixel => spreadLifeEater(infectedPixel));
|
||||||
burnTempChange: 100,
|
},
|
||||||
excludeRandom: true,
|
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