revamp + f&m compatibility

This commit is contained in:
Laetitia (O-01-67) 2022-12-18 13:38:27 -05:00 committed by GitHub
parent af8c1205ba
commit 3e0bfdff6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 69 additions and 24 deletions

View File

@ -1,24 +1,69 @@
elements.solid_rock = { var modName = "mods/random_rocks.js";
color: ["#808080","#4f4f4f","#949494"], var libraryMod = "mods/code_library.js";
behavior: behaviors.WALL,
reactions: { if(enabledMods.includes(libraryMod)) {
"water": {elem1: "wet_sand", chance: 0.00035}, elements.solid_rock = {
"salt_water": {elem1: "wet_sand", chance: 0.0005}, color: ["#808080","#4f4f4f","#949494"],
"sugar_water": {elem1: "wet_sand", chance: 0.0004}, behavior: behaviors.WALL,
"seltzer": {elem1: "wet_sand", chance: 0.0004}, reactions: {
"dirty_water": {elem1: "wet_sand", chance: 0.0004}, "water": {elem1: "wet_sand", chance: 0.00035},
"soda": {elem1: "wet_sand", chance: 0.0004}, "salt_water": {elem1: "wet_sand", chance: 0.0005},
"lichen": {elem1: "dirt", chance: 0.0025}, "sugar_water": {elem1: "wet_sand", chance: 0.0004},
"grape": {elem2: "juice", chance: 0.1, color2: "#291824"}, "seltzer": {elem1: "wet_sand", chance: 0.0004},
"root": {elem1: "sand", chance: 0.0004}, "dirty_water": {elem1: "wet_sand", chance: 0.0004},
"wheat": {elem2: "flour"}, "soda": {elem1: "wet_sand", chance: 0.0004},
"primordial_soup": {elem1: "wet_sand", chance: 0.001} "lichen": {elem1: "dirt", chance: 0.0025},
}, "grape": {elem2: "juice", chance: 0.1, color2: "#291824"},
tempHigh: 950, "root": {elem1: "sand", chance: 0.0004},
stateHigh: "magma", "wheat": {elem2: "flour"},
category: "land", "primordial_soup": {elem1: "wet_sand", chance: 0.001}
state: "solid", },
density: 2600, onTryMoveInto: function(pixel,otherPixel) {
hardness: 0.55, if(elements[otherPixel.element].category === "corruption") {
breakInto: "rock", if(Math.random() < 0.05) {
} changePixel(pixel,"corrupt_solid_rock");
return;
};
} else {
reactionStealer(pixel,otherPixel,"rock");
};
},
tempHigh: 950,
stateHigh: "magma",
category: "land",
state: "solid",
density: 2600,
hardness: 0.55,
breakInto: "rock",
}
if(enabledMods.includes("mods/fey_and_more.js")) {
elements.corrupt_solid_rock = {
color: ["#514c78","#514c78","#2a264d","#2a264d","#514c78","#514c78"],
behavior: behaviors.WALL,
tempHigh: 1200,
category: "corruption",
state: "solid",
density: 1250,
breakInto: "corrupt_rock",
reactions: elements.corrupt_land.reactions,
tick: function(pixel) {
var randomNeighborOffset = adjacentCoords[Math.floor(Math.random() * adjacentCoords.length)];
var rfX = pixel.x+randomNeighborOffset[0];
var rfY = pixel.y+randomNeighborOffset[1];
if(!isEmpty(rfX,rfY,true)) {
var otherPixel = pixelMap[rfX][rfY];
if(otherPixel.element === "solid_rock") {
if(Math.random() < 0.05) {
changePixel(otherPixel,"corrupt_solid_rock")
};
};
};
},
};
}
} else {
alert(`The ${libraryMod} mod is required and has been automatically inserted (reload for this to take effect).`)
enabledMods.splice(enabledMods.indexOf(modName),0,libraryMod)
localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
};