Merge pull request #450 from Jayd-Rubies/main

jaydsfunctions.js update
This commit is contained in:
slweeb 2024-03-25 21:02:20 -04:00 committed by GitHub
commit af8daf38f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 72 additions and 13 deletions

View File

@ -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
}