sex with github

This commit is contained in:
An Orbit 2023-05-07 15:55:17 -04:00 committed by GitHub
parent c32a3e58bc
commit 66234c8484
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 49 additions and 53 deletions

View File

@ -1,55 +1,51 @@
console.log("doElectricity should be changed"); var modName = "mods/switches.js";
var formerlyNoConductMod = "mods/doElectricity changes.js";
function doElectricity(pixel) { if(enabledMods.includes(formerlyNoConductMod)) {
if(isNaN(pixel.charge)) { elements.switch_off = {
pixel.charge = 0; name: "switch (off)",
color: "#7F3333",
behavior: behaviors.WALL,
noConduct: ["switch_on_control","switch_off_control"],
category: "machines",
}; };
if (pixel.charge) {
// Check each adjacent pixel, if that pixel's charge is false, set it to the same charge elements.switch_on = {
for (var i = 0; i < adjacentCoords.length; i++) { name: "switch (on)",
var x = pixel.x+adjacentCoords[i][0]; color: "#33CC33",
var y = pixel.y+adjacentCoords[i][1]; behavior: behaviors.WALL,
if (!isEmpty(x,y,true)) { conduct: 1,
var newPixel = pixelMap[x][y]; noConduct: ["switch_on_control","switch_off_control"],
var con = elements[newPixel.element].conduct; category: "machines",
if (con == undefined) {continue} };
var info = elements[pixel.element];
if (info.noConduct && info.noConduct.includes(newPixel.element)) {continue}; elements.switch_off_control = {
if (Math.random() < con) { // If random number is less than conductivity color: "#FF3333",
if (!newPixel.charge && !newPixel.chargeCD) { behavior: behaviors.WALL,
newPixel.charge = isNaN(pixel.charge) ? 0 : pixel.charge; //Actually set it to the same charge behaviorOn: [
if (elements[newPixel.element].colorOn) { "XX|CH:switch_on>switch_off|XX",
newPixel.color = pixelColorPick(newPixel); "CH:switch_on>switch_off|XX|CH:switch_on>switch_off",
} "XX|CH:switch_on>switch_off|XX"
if(elements[newPixel.element].onCharge) { ],
pixel.charge ??= 0; conduct: 1,
if(isNaN(pixel.charge)) { pixel.charge = 0 }; noConduct: ["switch_on","switch_off"],
elements[newPixel.element].onCharge(pixel); category: "machines",
}; };
}
} elements.switch_on_control = {
else if (elements[newPixel.element].insulate != true && !elements[newPixel.element].noResistance) { // Otherwise heat the pixel (Resistance simulation) color: "#33FF33",
newPixel.temp += isNaN(pixel.charge) ? 0.25 : pixel.charge/4; behavior: behaviors.WALL,
pixelTempCheck(newPixel); 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"
pixel.charge -= 0.25; ],
if (pixel.charge <= 0) { conduct: 1,
delete pixel.charge; noConduct: ["switch_on","switch_off"],
//console.log(elements[pixel.element].chargeCD); category: "machines",
var chargeCd = elements[pixel.element].chargeCD ?? 4; };
pixel.chargeCD = chargeCd; //Customizable chargeCD } else {
} enabledMods.splice(enabledMods.indexOf(modName),0,formerlyNoConductMod)
} alert(`The ${formerlyNoConductMod} mod is required and has been automatically inserted (reload for this to take effect).`)
// Lower charge cooldown localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
else if (pixel.chargeCD) { };
pixel.chargeCD -= 1;
if (pixel.chargeCD <= 0) {
delete pixel.chargeCD;
if (elements[pixel.element].colorOn) {
pixel.color = pixelColorPick(pixel);
}
}
}
}