From 045c3845c1ce79d2c577ccc5e239500c95e4593b Mon Sep 17 00:00:00 2001 From: Jayd-Rubies <155784127+Jayd-Rubies@users.noreply.github.com> Date: Mon, 25 Mar 2024 09:41:36 -0400 Subject: [PATCH] Add files via upload --- mods/jaydsfunctions.js | 85 +++++++++++++++++++++++++++++++++++------- 1 file changed, 72 insertions(+), 13 deletions(-) diff --git a/mods/jaydsfunctions.js b/mods/jaydsfunctions.js index 724ace4b..61f0c00c 100644 --- a/mods/jaydsfunctions.js +++ b/mods/jaydsfunctions.js @@ -24,9 +24,9 @@ elements.selective_exploder = { } }, onSelect: function() { - var answer2 = prompt("Please input what element to explode.",(explode1Var||undefined)); - if (!answer2) { return } - explode1Var = answer2; + var answer1 = prompt("Please input what element to explode.",(explode1Var||undefined)); + if (!answer1) { return } + explode1Var = answer1; } }, convert11Var = 0; @@ -41,12 +41,12 @@ elements.converter_tool = { } }, onSelect: function() { - var answer3 = prompt("Please input what should element be converted.",(convert11Var||undefined)); - if (!answer3) { return } - convert11Var = answer3; - var answer4 = prompt("Please input what element to convert into.",(convert22Var||undefined)); - if (!answer4) { return } - convert22Var = answer4; + var answer1 = prompt("Please input what should element be converted.",(convert11Var||undefined)); + if (!answer1) { return } + convert11Var = answer1; + var answer2 = prompt("Please input what element to convert into.",(convert22Var||undefined)); + if (!answer2) { return } + convert22Var = answer2; } }, elements.fast_bomb = { @@ -82,9 +82,9 @@ elements.exclusive_eraser = { } }, onSelect: function() { - var answer5 = prompt("Please input what element shouldn't be erased.",(exclude1Var||undefined)); - if (!answer5) { return } - exclude1Var = answer5; + var answer1 = prompt("Please input what element shouldn't be erased.",(exclude1Var||undefined)); + if (!answer1) { return } + exclude1Var = answer1; } }, elements.tenth_heater = { @@ -99,7 +99,7 @@ elements.tenth_heater = { }, elements.e_tenth_heater = { category: "special", - color: "#ff0000", + color: "#ff3000", behavior: behaviors.WALL, behaviorOn: [ "XX|HT:0.1|XX", @@ -108,4 +108,63 @@ elements.e_tenth_heater = { ], ignore: "tenth_heater", conduct: 1 +}, +paint1Var = 0; +elements.selective_paint_tool = { + color: ["#ff0000","#ff0000","#ff0000","#00ff00","#00ff00","#00ff00","#0000ff","#0000ff","#0000ff"], + tool: function(pixel) { + if (pixel.element === paint1Var) { + if (!shiftDown) { + pixel.color = pixelColorPick(pixel,currentColor) + } + else { + // convert the hex of currentColor to rgb and set it as a string + var rgb = currentColor.replace("#","").match(/.{1,2}/g); + for (var i = 0; i < rgb.length; i++) { + rgb[i] = parseInt(rgb[i],16); + } + pixel.color = "rgb(" + rgb.join(",") + ")" + } + delete pixel.origColor; + } + }, + onSelect: function() { + var answer1 = prompt("Please input what element should be painted.",(paint1Var||undefined)); + if (!answer1) { return } + paint1Var = answer1; + }, + customColor: true, + category: "tools", + canPlace: false, + desc: "Select certain pixels to change color." +}, +paint2Var = 0; +elements.exclusive_paint_tool = { + color: ["#ff0000","#00ff00","#0000ff","#0000ff","#00ff00","#ff0000"], + tool: function(pixel) { + if (pixel.element !== paint2Var) { + if (!shiftDown) { + pixel.color = pixelColorPick(pixel,currentColor) + } + else { + // convert the hex of currentColor to rgb and set it as a string + var rgb = currentColor.replace("#","").match(/.{1,2}/g); + for (var i = 0; i < rgb.length; i++) { + rgb[i] = parseInt(rgb[i],16); + } + pixel.color = "rgb(" + rgb.join(",") + ")" + } + delete pixel.origColor; + } + }, + onSelect: function() { + var answer1 = prompt("Please input what element should be painted.",(paint2Var||undefined)); + if (!answer1) { return } + paint2Var = answer1; + }, + customColor: true, + category: "tools", + canPlace: false, + desc: "Excludes pixels you don't want to color." + //hello } \ No newline at end of file