This commit is contained in:
Vito 2026-01-15 09:43:51 -06:00
commit 2ce83a9ebe
5 changed files with 105 additions and 104 deletions

View File

@ -387,7 +387,6 @@
<tr><td>funny elements 2022-11-15.js</td><td>Few curated randomly-generated elements</td><td>Alice</td></tr> <tr><td>funny elements 2022-11-15.js</td><td>Few curated randomly-generated elements</td><td>Alice</td></tr>
<tr><td>funny_solid.js</td><td>Feces</td><td>Alice</td></tr> <tr><td>funny_solid.js</td><td>Feces</td><td>Alice</td></tr>
<tr><td>funnynames.js</td><td>Various ways to mess with the names of elements</td><td>nousernamefound</td></tr> <tr><td>funnynames.js</td><td>Various ways to mess with the names of elements</td><td>nousernamefound</td></tr>
<tr><td>haseulite.js</td><td>Loona-related materials with various properties</td><td>Alice</td></tr>
<tr><td>lactose_intolerance_and_celiac.js</td><td>Humans explode on contact with milk, wheat, bread, or toast</td><td>Nubo318</td></tr> <tr><td>lactose_intolerance_and_celiac.js</td><td>Humans explode on contact with milk, wheat, bread, or toast</td><td>Nubo318</td></tr>
<tr><td>lattice_filler.js</td><td>Combination of lattice and filler and a destructive variant</td><td>Suss</td></tr> <tr><td>lattice_filler.js</td><td>Combination of lattice and filler and a destructive variant</td><td>Suss</td></tr>
<tr><td>liquid_mixing.js</td><td>Liquids can mix colors dynamically</td><td>Nekonico</td></tr> <tr><td>liquid_mixing.js</td><td>Liquids can mix colors dynamically</td><td>Nekonico</td></tr>
@ -417,8 +416,6 @@
<!----><tr><td class="modCat" colspan="3">Visual Effects</td></tr><!----> <!----><tr><td class="modCat" colspan="3">Visual Effects</td></tr><!---->
<tr><td>acid_and_shapes.js</td><td>Weird visual effects enabled in settings</td><td>Alice</td></tr> <tr><td>acid_and_shapes.js</td><td>Weird visual effects enabled in settings</td><td>Alice</td></tr>
<tr><td>asciiboxels.js</td><td>Renders pixels as ASCII characters</td><td>Nekonico</td></tr> <tr><td>asciiboxels.js</td><td>Renders pixels as ASCII characters</td><td>Nekonico</td></tr>
<tr><td>background_changer.js</td><td>Press 'B' to change canvas background to a URL</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>borders.js</td><td>Black borders around pixels (Use bright background)</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
<tr><td>clouds.js</td><td>Moving clouds, sky.js recommended</td><td>RedBirdly</td></tr> <tr><td>clouds.js</td><td>Moving clouds, sky.js recommended</td><td>RedBirdly</td></tr>
<tr><td>customBackground.js</td><td>Set your background to an image link</td><td>Jayd</td></tr> <tr><td>customBackground.js</td><td>Set your background to an image link</td><td>Jayd</td></tr>
<tr><td>fractals.js</td><td>Element and tools to render fractals in game</td><td>nousernamefound</td></tr> <tr><td>fractals.js</td><td>Element and tools to render fractals in game</td><td>nousernamefound</td></tr>
@ -487,6 +484,7 @@
<!----><tr><td class="modCat" colspan="3">Broken or Deprecated</td></tr><!----> <!----><tr><td class="modCat" colspan="3">Broken or Deprecated</td></tr><!---->
<tr class="deprecated"><td>a_mod_by_alice.js</td><td>Combination of most of Alice's mods, and some other things</td><td>Alice</td></tr> <tr class="deprecated"><td>a_mod_by_alice.js</td><td>Combination of most of Alice's mods, and some other things</td><td>Alice</td></tr>
<tr class="deprecated"><td>haseulite.js</td><td>Loona-related materials with various properties</td><td>Alice</td></tr>
<tr class="deprecated"><td>adjustablepixelsize.js</td><td>Set the pixelSize with a URL parameter</td><td>Alice</td></tr> <tr class="deprecated"><td>adjustablepixelsize.js</td><td>Set the pixelSize with a URL parameter</td><td>Alice</td></tr>
<tr class="deprecated"><td>advanced_colonies.js</td><td>Davlers, creatures with complex colonies</td><td>DaviStudios</td></tr> <tr class="deprecated"><td>advanced_colonies.js</td><td>Davlers, creatures with complex colonies</td><td>DaviStudios</td></tr>
<tr class="deprecated"><td>background_changer.js</td><td>Press 'B' to change canvas background to a URL</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr> <tr class="deprecated"><td>background_changer.js</td><td>Press 'B' to change canvas background to a URL</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>

View File

@ -1098,7 +1098,7 @@ elements.polytetrafluoroethylene = {
colored: false, colored: false,
}, },
tick: function (pixel) { tick: function (pixel) {
if (!pixel.colored) { if (!pixel.colored || !pixel.origColor) {
let rgb = elements.polytetrafluoroethylene.colorObject; let rgb = elements.polytetrafluoroethylene.colorObject;
let coloroffset = Math.floor(Math.random() * (Math.random() > 0.5 ? -1 : 1) * Math.random() * 2); let coloroffset = Math.floor(Math.random() * (Math.random() > 0.5 ? -1 : 1) * Math.random() * 2);

View File

@ -1,54 +1,55 @@
//console.log("doElectricity should be changed"); //console.log("doElectricity should be changed");
function doElectricity(pixel) { // [DEPRECATED - BREAKS GAME as of 2026-01]
if(isNaN(pixel.charge)) { // function doElectricity(pixel) {
pixel.charge = 0; // if(isNaN(pixel.charge)) {
}; // pixel.charge = 0;
if (pixel.charge) { // };
// Check each adjacent pixel, if that pixel's charge is false, set it to the same charge // if (pixel.charge) {
for (var i = 0; i < adjacentCoords.length; i++) { // // Check each adjacent pixel, if that pixel's charge is false, set it to the same charge
var x = pixel.x+adjacentCoords[i][0]; // for (var i = 0; i < adjacentCoords.length; i++) {
var y = pixel.y+adjacentCoords[i][1]; // var x = pixel.x+adjacentCoords[i][0];
if (!isEmpty(x,y,true)) { // var y = pixel.y+adjacentCoords[i][1];
var newPixel = pixelMap[x][y]; // if (!isEmpty(x,y,true)) {
var con = elements[newPixel.element].conduct; // var newPixel = pixelMap[x][y];
if (con == undefined) {continue} // var con = elements[newPixel.element].conduct;
if (elements[pixel.element].noConduct?.length && elements[pixel.element].noConduct.includes(newPixel.element)) {continue}; // if (con == undefined) {continue}
if (Math.random() < con) { // If random number is less than conductivity // if (elements[pixel.element].noConduct?.length && elements[pixel.element].noConduct.includes(newPixel.element)) {continue};
if (!newPixel.charge && !newPixel.chargeCD) { // if (Math.random() < con) { // If random number is less than conductivity
newPixel.charge = isNaN(pixel.charge) ? 0 : pixel.charge; //Actually set it to the same charge // if (!newPixel.charge && !newPixel.chargeCD) {
if (elements[newPixel.element].colorOn) { // newPixel.charge = isNaN(pixel.charge) ? 0 : pixel.charge; //Actually set it to the same charge
newPixel.color = pixelColorPick(newPixel); // if (elements[newPixel.element].colorOn) {
} // newPixel.color = pixelColorPick(newPixel);
if(elements[newPixel.element].onCharge) { // }
pixel.charge ??= 0; // if(elements[newPixel.element].onCharge) {
if(isNaN(pixel.charge)) { pixel.charge = 0 }; // pixel.charge ??= 0;
elements[newPixel.element].onCharge(pixel); // if(isNaN(pixel.charge)) { pixel.charge = 0 };
}; // elements[newPixel.element].onCharge(pixel);
} // };
} // }
else if (elements[newPixel.element].insulate != true && !elements[newPixel.element].noResistance) { // Otherwise heat the pixel (Resistance simulation) // }
newPixel.temp += isNaN(pixel.charge) ? 0.25 : pixel.charge/4; // else if (elements[newPixel.element].insulate != true && !elements[newPixel.element].noResistance) { // Otherwise heat the pixel (Resistance simulation)
pixelTempCheck(newPixel); // newPixel.temp += isNaN(pixel.charge) ? 0.25 : pixel.charge/4;
} // pixelTempCheck(newPixel);
} // }
} // }
pixel.charge -= 0.25; // }
if (pixel.charge <= 0) { // pixel.charge -= 0.25;
delete pixel.charge; // if (pixel.charge <= 0) {
//console.log(elements[pixel.element].chargeCD); // delete pixel.charge;
var chargeCd = elements[pixel.element].chargeCD ?? 4; // //console.log(elements[pixel.element].chargeCD);
pixel.chargeCD = chargeCd; //Customizable chargeCD // var chargeCd = elements[pixel.element].chargeCD ?? 4;
} // pixel.chargeCD = chargeCd; //Customizable chargeCD
} // }
// Lower charge cooldown // }
else if (pixel.chargeCD) { // // Lower charge cooldown
pixel.chargeCD -= 1; // else if (pixel.chargeCD) {
if (pixel.chargeCD <= 0) { // pixel.chargeCD -= 1;
delete pixel.chargeCD; // if (pixel.chargeCD <= 0) {
if (elements[pixel.element].colorOn) { // delete pixel.chargeCD;
pixel.color = pixelColorPick(pixel); // if (elements[pixel.element].colorOn) {
} // pixel.color = pixelColorPick(pixel);
} // }
} // }
} // }
// }

View File

@ -1,51 +1,53 @@
var modName = "mods/switches.js"; // var modName = "mods/switches.js";
var formerlyNoConductMod = "mods/doElectricity changes.js"; // var formerlyNoConductMod = "mods/doElectricity changes.js";
if(enabledMods.includes(formerlyNoConductMod)) { // if(enabledMods.includes(formerlyNoConductMod)) {
elements.switch_off = {
name: "switch (off)",
color: "#7F3333",
behavior: behaviors.WALL,
noConduct: ["switch_on_control","switch_off_control"],
category: "machines",
};
elements.switch_on = { // } else {
name: "switch (on)", // enabledMods.splice(enabledMods.indexOf(modName),0,formerlyNoConductMod)
color: "#33CC33", // alert(`The ${formerlyNoConductMod} mod is required and has been automatically inserted (reload for this to take effect).`)
behavior: behaviors.WALL, // localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
conduct: 1, // };
noConduct: ["switch_on_control","switch_off_control"],
category: "machines",
};
elements.switch_off_control = { elements.switch_off = {
color: "#FF3333", name: "switch (off)",
behavior: behaviors.WALL, color: "#7F3333",
behaviorOn: [ behavior: behaviors.WALL,
"XX|CH:switch_on>switch_off|XX", ignoreConduct: ["switch_on_control","switch_off_control"],
"CH:switch_on>switch_off|XX|CH:switch_on>switch_off", category: "machines",
"XX|CH:switch_on>switch_off|XX" };
],
conduct: 1, elements.switch_on = {
noConduct: ["switch_on","switch_off"], name: "switch (on)",
category: "machines", color: "#33CC33",
}; behavior: behaviors.WALL,
conduct: 1,
elements.switch_on_control = { ignoreConduct: ["switch_on_control","switch_off_control"],
color: "#33FF33", category: "machines",
behavior: behaviors.WALL, };
behaviorOn: [
"XX|CH:switch_off>switch_on|XX", elements.switch_off_control = {
"CH:switch_off>switch_on|XX|CH:switch_off>switch_on", color: "#FF3333",
"XX|CH:switch_off>switch_on|XX" behavior: behaviors.WALL,
], behaviorOn: [
conduct: 1, "XX|CH:switch_on>switch_off|XX",
noConduct: ["switch_on","switch_off"], "CH:switch_on>switch_off|XX|CH:switch_on>switch_off",
category: "machines", "XX|CH:switch_on>switch_off|XX"
}; ],
} else { conduct: 1,
enabledMods.splice(enabledMods.indexOf(modName),0,formerlyNoConductMod) ignoreConduct: ["switch_on","switch_off"],
alert(`The ${formerlyNoConductMod} mod is required and has been automatically inserted (reload for this to take effect).`) category: "machines",
localStorage.setItem("enabledMods", JSON.stringify(enabledMods)); };
elements.switch_on_control = {
color: "#33FF33",
behavior: behaviors.WALL,
behaviorOn: [
"XX|CH:switch_off>switch_on|XX",
"CH:switch_off>switch_on|XX|CH:switch_off>switch_on",
"XX|CH:switch_off>switch_on|XX"
],
conduct: 1,
ignoreConduct: ["switch_on","switch_off"],
category: "machines",
}; };

View File

@ -2531,7 +2531,7 @@ Proper classification of limestone within these code comments
] ]
}; };
elements.plasma.noConduct = ["stellar_plasma","liquid_stellar_plasma","liquid_degenerate_neutronium","gaseous_degenerate_neutronium","neutron_star"]; //I can't suppress the charge overlay and keep the tick color, only effective with noConduct.js but not strictly required elements.plasma.ignoreConduct = ["stellar_plasma","liquid_stellar_plasma","liquid_degenerate_neutronium","gaseous_degenerate_neutronium","neutron_star"]; //I can't suppress the charge overlay and keep the tick color, only effective with noConduct.js but not strictly required
//Main preset //Main preset