Merge pull request #1251 from SweetySweetingtonsSweets/patch-6
Update liquid_Master.js
This commit is contained in:
commit
9d0b60e3a8
|
|
@ -1,24 +1,12 @@
|
||||||
if (!elements.categories.custom) {
|
runAfterLoad(function() {
|
||||||
elements.categories.custom = "custom";
|
console.log("Liquefier Mod loaded!")
|
||||||
}
|
console.log("Created by Hitochi — turns elements into liquid forms.")
|
||||||
|
})
|
||||||
elements.hello_test = {
|
|
||||||
color: "#ff00ff",
|
|
||||||
behavior: behaviors.POWDER,
|
|
||||||
category: "custom",
|
|
||||||
state: "solid",
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Ensure category exists
|
|
||||||
if (!elements.categories.special) {
|
|
||||||
elements.categories.special = "special";
|
|
||||||
}
|
|
||||||
|
|
||||||
elements.liquefier = {
|
elements.liquefier = {
|
||||||
color: "#33ccff",
|
color: "#33ccff",
|
||||||
behavior: behaviors.POWDER, // stays in place better than liquid
|
behavior: behaviors.POWDER, // sits in place
|
||||||
category: "liquids",
|
category: "machines",
|
||||||
state: "solid",
|
state: "solid",
|
||||||
density: 2000,
|
density: 2000,
|
||||||
tick: function(pixel) {
|
tick: function(pixel) {
|
||||||
|
|
@ -37,19 +25,25 @@ elements.liquefier = {
|
||||||
|
|
||||||
const liquidName = target.element + "_liquid";
|
const liquidName = target.element + "_liquid";
|
||||||
|
|
||||||
// Define the "liquid" version if missing
|
// Define the liquid version if missing
|
||||||
if (!elements[liquidName]) {
|
if (!elements[liquidName]) {
|
||||||
let baseColor = elements[target.element]?.color || "#654321";
|
let baseColor = elements[target.element]?.color || "#654321";
|
||||||
if (Array.isArray(baseColor)) baseColor = baseColor[0];
|
if (Array.isArray(baseColor)) baseColor = baseColor[0];
|
||||||
|
|
||||||
|
// check if original is food
|
||||||
|
const isEdible =
|
||||||
|
elements[target.element]?.isFood === true ||
|
||||||
|
elements[target.element]?.category === "food";
|
||||||
|
|
||||||
elements[liquidName] = {
|
elements[liquidName] = {
|
||||||
color: [baseColor, "#3399ff"], // tint
|
color: [baseColor, "#3399ff"], // tinted version
|
||||||
behavior: behaviors.LIQUID,
|
behavior: behaviors.LIQUID,
|
||||||
category: "liquids",
|
category: "liquids",
|
||||||
state: "liquid",
|
state: "liquid",
|
||||||
density: 1050,
|
density: 1050,
|
||||||
viscosity: 8,
|
viscosity: 8,
|
||||||
isFood: elements[target.element]?.isFood || false,
|
isFood: isEdible, // only food is edible
|
||||||
|
desc: "Liquefied form of " + target.element
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -57,4 +51,5 @@ elements.liquefier = {
|
||||||
changePixel(target, liquidName);
|
changePixel(target, liquidName);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
desc: "Liquefies nearby pixels into their liquid versions. Food becomes drinkable."
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue