sandboxels/mods/switches.js

53 lines
1.4 KiB
JavaScript
Raw Normal View History

2026-01-12 17:57:23 -05:00
// var modName = "mods/switches.js";
// var formerlyNoConductMod = "mods/doElectricity changes.js";
2026-01-12 17:57:23 -05:00
// if(enabledMods.includes(formerlyNoConductMod)) {
2023-05-07 15:55:17 -04:00
2026-01-12 17:57:23 -05:00
// } 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).`)
// localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
// };
2023-05-07 15:55:17 -04:00
2026-01-12 17:57:23 -05:00
elements.switch_off = {
name: "switch (off)",
color: "#7F3333",
behavior: behaviors.WALL,
2026-01-12 17:58:48 -05:00
ignoreConduct: ["switch_on_control","switch_off_control"],
2026-01-12 17:57:23 -05:00
category: "machines",
};
elements.switch_on = {
name: "switch (on)",
color: "#33CC33",
behavior: behaviors.WALL,
conduct: 1,
2026-01-12 17:58:48 -05:00
ignoreConduct: ["switch_on_control","switch_off_control"],
2026-01-12 17:57:23 -05:00
category: "machines",
};
2023-05-07 15:55:17 -04:00
2026-01-12 17:57:23 -05:00
elements.switch_off_control = {
color: "#FF3333",
behavior: behaviors.WALL,
behaviorOn: [
"XX|CH:switch_on>switch_off|XX",
"CH:switch_on>switch_off|XX|CH:switch_on>switch_off",
"XX|CH:switch_on>switch_off|XX"
],
conduct: 1,
2026-01-12 17:58:48 -05:00
ignoreConduct: ["switch_on","switch_off"],
2026-01-12 17:57:23 -05:00
category: "machines",
2023-05-07 15:55:17 -04:00
};
2026-01-12 17:57:23 -05:00
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,
2026-01-12 17:58:48 -05:00
ignoreConduct: ["switch_on","switch_off"],
2026-01-12 17:57:23 -05:00
category: "machines",
};