this is the weapons.js update everyone has been waiting for
This commit is contained in:
parent
a8fd5f1208
commit
d6382dea93
|
|
@ -1,4 +1,21 @@
|
||||||
//jaydsfunctions
|
//jaydsfunctions
|
||||||
|
async function _jaydfunctionjsprompt(message, defaultValue = "") {
|
||||||
|
|
||||||
|
|
||||||
|
return new Promise(resolve => {
|
||||||
|
|
||||||
|
|
||||||
|
promptInput(message, (result) => {
|
||||||
|
|
||||||
|
|
||||||
|
resolve(result);
|
||||||
|
|
||||||
|
|
||||||
|
}, "jaydfunction.js is asking you...", defaultValue);
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
erase1Var = 0;
|
erase1Var = 0;
|
||||||
elements.selective_eraser = {
|
elements.selective_eraser = {
|
||||||
color: ["#ffff00","#ffff00","#ffff00","#555555","#555555","#555555"],
|
color: ["#ffff00","#ffff00","#ffff00","#555555","#555555","#555555"],
|
||||||
|
|
@ -8,8 +25,8 @@ elements.selective_eraser = {
|
||||||
deletePixel(pixel.x, pixel.y);
|
deletePixel(pixel.x, pixel.y);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var answer1 = prompt("Please input what element should be erased.",(erase1Var||undefined));
|
var answer1 = await _jaydfunctionjsprompt("Please input what element should be erased.",(erase1Var||undefined));
|
||||||
if (!answer1) { return }
|
if (!answer1) { return }
|
||||||
erase1Var = answer1;
|
erase1Var = answer1;
|
||||||
}
|
}
|
||||||
|
|
@ -23,8 +40,8 @@ elements.selective_exploder = {
|
||||||
changePixel(pixel, "explosion")
|
changePixel(pixel, "explosion")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var answer1 = prompt("Please input what element to explode.",(explode1Var||undefined));
|
var answer1 = await _jaydfunctionjsprompt("Please input what element to explode.",(explode1Var||undefined));
|
||||||
if (!answer1) { return }
|
if (!answer1) { return }
|
||||||
explode1Var = answer1;
|
explode1Var = answer1;
|
||||||
}
|
}
|
||||||
|
|
@ -40,11 +57,11 @@ elements.converter_tool = {
|
||||||
changePixel(pixel, convert22Var)
|
changePixel(pixel, convert22Var)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var answer1 = prompt("Please input what should element be converted.",(convert11Var||undefined));
|
var answer1 = await _jaydfunctionjsprompt("Please input what should element be converted.",(convert11Var||undefined));
|
||||||
if (!answer1) { return }
|
if (!answer1) { return }
|
||||||
convert11Var = answer1;
|
convert11Var = answer1;
|
||||||
var answer2 = prompt("Please input what element to convert into.",(convert22Var||undefined));
|
var answer2 = await _jaydfunctionjsprompt("Please input what element to convert into.",(convert22Var||undefined));
|
||||||
if (!answer2) { return }
|
if (!answer2) { return }
|
||||||
convert22Var = answer2;
|
convert22Var = answer2;
|
||||||
}
|
}
|
||||||
|
|
@ -81,8 +98,8 @@ elements.exclusive_eraser = {
|
||||||
deletePixel(pixel.x, pixel.y);
|
deletePixel(pixel.x, pixel.y);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var answer1 = prompt("Please input what element shouldn't be erased.",(exclude1Var||undefined));
|
var answer1 = await _jaydfunctionjsprompt("Please input what element shouldn't be erased.",(exclude1Var||undefined));
|
||||||
if (!answer1) { return }
|
if (!answer1) { return }
|
||||||
exclude1Var = answer1;
|
exclude1Var = answer1;
|
||||||
}
|
}
|
||||||
|
|
@ -128,8 +145,8 @@ elements.selective_paint_tool = {
|
||||||
delete pixel.origColor;
|
delete pixel.origColor;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var answer1 = prompt("Please input what element should be painted.",(paint1Var||undefined));
|
var answer1 = await _jaydfunctionjsprompt("Please input what element should be painted.",(paint1Var||undefined));
|
||||||
if (!answer1) { return }
|
if (!answer1) { return }
|
||||||
paint1Var = answer1;
|
paint1Var = answer1;
|
||||||
},
|
},
|
||||||
|
|
@ -157,8 +174,8 @@ elements.exclusive_paint_tool = {
|
||||||
delete pixel.origColor;
|
delete pixel.origColor;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var answer1 = prompt("Please input what element should be painted.",(paint2Var||undefined));
|
var answer1 = await _jaydfunctionjsprompt("Please input what element should be painted.",(paint2Var||undefined));
|
||||||
if (!answer1) { return }
|
if (!answer1) { return }
|
||||||
paint2Var = answer1;
|
paint2Var = answer1;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,23 @@
|
||||||
//jaydstuff
|
//jaydstuff
|
||||||
//ooooo dependencies
|
//ooooo dependencies
|
||||||
if (!enabledMods.includes("mods/nousersthings.js")) { enabledMods.unshift("mods/nousersthings.js"); localStorage.setItem("enabledMods", JSON.stringify(enabledMods)); alert("'nousersthings.js' is (not) a dependency for 'jaydstuff.js.js' and has been added. Please reload for it to take effect, also im dumb.") }
|
if (!enabledMods.includes("mods/nousersthings.js")) { enabledMods.unshift("mods/nousersthings.js"); localStorage.setItem("enabledMods", JSON.stringify(enabledMods)); window.location.reload(); };
|
||||||
else {
|
async function _jaydstuffjsprompt(message, defaultValue = "") {
|
||||||
|
|
||||||
|
|
||||||
|
return new Promise(resolve => {
|
||||||
|
|
||||||
|
|
||||||
|
promptInput(message, (result) => {
|
||||||
|
|
||||||
|
|
||||||
|
resolve(result);
|
||||||
|
|
||||||
|
|
||||||
|
}, "jaydstuff.js is asking you...", defaultValue);
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
elements.super_raincloud = {
|
elements.super_raincloud = {
|
||||||
color: "#0000ff",
|
color: "#0000ff",
|
||||||
behavior: [
|
behavior: [
|
||||||
|
|
@ -633,19 +649,124 @@ elements.upquake = {
|
||||||
cooldown: defaultCooldown,
|
cooldown: defaultCooldown,
|
||||||
excludeRandom: true,
|
excludeRandom: true,
|
||||||
},
|
},
|
||||||
|
elements.legacy_earthquake = {
|
||||||
|
color: ["#bda791","#997756","#613d19"],
|
||||||
|
tick: function(pixel) {
|
||||||
|
if (pixel.stage) {
|
||||||
|
var coords = circleCoords(pixel.x,pixel.y,pixel.stage);
|
||||||
|
if (pixel.stage >= pixel.mag) {
|
||||||
|
deletePixel(pixel.x,pixel.y);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
coords.forEach(function(coord){
|
||||||
|
var x = coord.x;
|
||||||
|
var y = coord.y;
|
||||||
|
if (!isEmpty(x,y,true)) {
|
||||||
|
var p = pixelMap[x][y];
|
||||||
|
if (p.element === "legacy_earthquake") {
|
||||||
|
if (pixel !== p) {
|
||||||
|
pixel.mag += 3;
|
||||||
|
deletePixel(p.x,p.y);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (elements[p.element].breakInto) {
|
||||||
|
if (Math.random() < (elements[p.element].hardness || 1) * 0.25) {
|
||||||
|
breakPixel(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (p.del || !elements[p.element].movable) { return }
|
||||||
|
tryMove(p,p.x,p.y-1);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
pixel.stage++;
|
||||||
|
}
|
||||||
|
else if (!tryMove(pixel,pixel.x,pixel.y+1)) {
|
||||||
|
// random 10 to 20
|
||||||
|
pixel.mag = Math.floor(Math.random() * 10) + 20;
|
||||||
|
pixel.stage = 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
category: "weapons",
|
||||||
|
state: "solid",
|
||||||
|
density: 100000000,
|
||||||
|
maxSize: 1,
|
||||||
|
cooldown: defaultCooldown,
|
||||||
|
excludeRandom: true,
|
||||||
|
},
|
||||||
|
// textures.rue = [
|
||||||
|
// [8,8,0,0,0,0,0,0,0,0,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
|
||||||
|
// [8,9,8,0,0,0,0,0,0,0,0,0,14,7,8,7,14,14,14,14,0,0,0,0,0,0,0,0,0,0,0,0],
|
||||||
|
// [9,10,9,8,0,9,10,9,9,9,8,14,7,8,9,8,14,14,14,14,14,14,14,0,0,0,0,0,0,0,0,0],
|
||||||
|
// [8,9,10,9,8,10,10,9,9,9,9,7,8,9,8,7,14,14,14,14,14,14,14,14,14,0,0,0,0,0,0,0],
|
||||||
|
// [8,8,9,10,8,9,9,9,9,9,9,7,9,8,7,7,13,13,13,13,13,13,13,14,14,13,0,0,0,0,0,0],
|
||||||
|
// [8,8,9,10,8,8,9,9,9,9,7,7,9,8,7,7,13,13,13,13,13,13,13,13,13,14,13,0,0,0,0,0],
|
||||||
|
// [8,9,10,9,8,8,8,8,8,8,7,7,8,9,8,7,13,13,13,13,13,13,13,13,13,13,14,12,0,0,0,0],
|
||||||
|
// [9,10,9,8,14,8,8,8,8,7,7,13,7,8,9,8,13,13,13,13,13,13,13,13,13,13,13,12,11,0,0,0],
|
||||||
|
// [8,9,8,14,14,14,14,13,13,13,13,13,1,7,8,7,13,13,13,13,13,13,1,1,13,13,13,13,12,17,0,0],
|
||||||
|
// [8,8,14,14,14,14,13,13,13,13,13,1,1,1,7,7,13,13,13,13,13,13,1,1,1,13,13,13,12,17,0,0],
|
||||||
|
// [0,14,14,14,14,13,13,13,13,13,1,1,1,13,13,13,13,13,13,13,13,13,13,1,1,1,13,13,13,12,17,0],
|
||||||
|
// [0,14,14,14,14,13,13,13,1,1,1,1,13,13,13,13,13,13,13,13,13,13,13,13,1,1,1,1,13,12,17,0],
|
||||||
|
// [0,14,14,14,13,13,13,13,1,1,1,13,13,13,13,13,13,13,13,13,13,13,13,13,13,1,1,1,13,12,17,0],
|
||||||
|
// [14,14,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,12,17],
|
||||||
|
// [14,14,14,14,13,13,13,13,13,1,1,1,1,1,13,13,13,13,13,13,13,13,1,1,1,1,1,13,13,13,12,17],
|
||||||
|
// [14,14,14,14,13,13,13,13,1,1,1,1,16,16,2,13,13,13,13,13,13,1,1,1,1,16,16,2,13,13,12,17],
|
||||||
|
// [14,14,14,13,13,13,1,16,14,14,14,1,1,1,16,16,1,13,13,1,16,14,14,14,1,1,1,16,16,1,12,17],
|
||||||
|
// [14,14,14,13,13,13,1,14,14,14,13,1,1,1,16,16,1,13,13,1,14,14,14,13,1,1,1,16,16,1,12,17],
|
||||||
|
// [14,14,14,14,13,13,1,1,14,13,1,1,1,1,16,16,1,13,13,1,1,14,13,1,1,1,1,16,16,1,12,17],
|
||||||
|
// [14,14,14,14,13,13,1,1,1,1,1,16,14,1,16,16,1,13,13,1,1,1,1,1,16,14,1,16,16,1,12,17],
|
||||||
|
// [0,14,14,14,13,13,1,1,1,1,1,14,12,2,16,16,1,13,13,1,1,1,1,1,14,12,2,16,16,1,17,0],
|
||||||
|
// [0,14,14,14,13,13,1,1,1,1,1,1,1,16,16,16,1,13,13,1,1,1,1,1,1,1,16,16,16,1,17,0],
|
||||||
|
// [0,14,14,14,14,13,13,1,1,1,1,2,16,16,16,16,1,13,13,1,1,1,1,1,2,16,16,16,16,1,17,0],
|
||||||
|
// [0,0,14,14,14,14,13,1,16,16,16,16,16,16,16,1,13,13,13,13,1,16,16,16,16,16,16,16,1,17,0,0],
|
||||||
|
// [0,0,14,14,14,14,13,13,1,16,16,16,16,16,1,13,13,13,13,13,13,1,16,16,16,16,16,1,12,17,0,0],
|
||||||
|
// [0,0,0,13,14,14,14,14,13,1,1,1,1,1,13,13,13,13,13,13,13,13,1,1,1,1,1,12,17,0,0,0],
|
||||||
|
// [0,0,0,0,13,14,14,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,12,17,0,0,0,0],
|
||||||
|
// [0,0,0,0,0,12,12,13,13,14,14,14,13,13,13,13,13,13,1,13,13,13,13,13,13,12,17,0,0,0,0,0],
|
||||||
|
// [0,0,0,0,0,0,12,12,12,13,13,13,14,14,14,13,13,1,13,1,13,13,13,12,12,17,0,0,0,0,0,0],
|
||||||
|
// [0,0,0,0,0,0,0,11,11,12,12,12,13,13,13,13,13,13,13,13,12,12,12,17,17,0,0,0,0,0,0,0],
|
||||||
|
// [0,0,0,0,0,0,0,0,0,17,17,17,12,12,12,12,12,12,12,12,17,17,17,0,0,0,0,0,0,0,0,0],
|
||||||
|
// [0,0,0,0,0,0,0,0,0,0,0,0,17,17,17,17,17,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0],
|
||||||
|
|
||||||
|
// ]
|
||||||
|
// elements.rue = {
|
||||||
|
// color: ["#000000","#111111","#333333","#555555","#777777","#999999","#bbbbbb","#dddddd","#ffffff"],
|
||||||
|
// colorPattern: textures.rue,
|
||||||
|
// colorKey: {
|
||||||
|
// "0": "#000000",
|
||||||
|
// "1": "#000000",
|
||||||
|
// "2": "#111111",
|
||||||
|
// "3": "#333333",
|
||||||
|
// "4": "#444444",
|
||||||
|
// "5": "#555555",
|
||||||
|
// "6": "#666666",
|
||||||
|
// "7": "#19bb20",
|
||||||
|
// "8": "#19bebe",
|
||||||
|
// "9": "#32d458",
|
||||||
|
// "10": "#32d5c6",
|
||||||
|
// "11": "#ddc231",
|
||||||
|
// "12": "#ebcc28",
|
||||||
|
// "13": "#ffe458",
|
||||||
|
// "14": "#ffed91",
|
||||||
|
// "15": "#f0f0f0",
|
||||||
|
// "16": "#ffffff",
|
||||||
|
// "17": "#cdb322",
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
|
||||||
createAtXvar = 0;
|
createAtXvar = 0;
|
||||||
createAtYvar = 0;
|
createAtYvar = 0;
|
||||||
create1var = "";
|
create1var = "";
|
||||||
elements.element_spawner = {
|
elements.element_spawner = {
|
||||||
color: "#71797E",
|
color: "#71797E",
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var answer1 = prompt("Please input the x value.",(createAtXvar||undefined));
|
var answer1 = await _jaydstuffjsprompt("Please input the x value.",(createAtXvar||undefined));
|
||||||
if (!answer1) {return}
|
if (!answer1) {return}
|
||||||
createAtXvar = parseInt(answer1);
|
createAtXvar = parseInt(answer1);
|
||||||
var answer2 = prompt("Please input the y value.",(createAtYvar||undefined));
|
var answer2 = await _jaydstuffjsprompt("Please input the y value.",(createAtYvar||undefined));
|
||||||
if (!answer2) {return}
|
if (!answer2) {return}
|
||||||
createAtYvar = parseInt(answer2);
|
createAtYvar = parseInt(answer2);
|
||||||
var answer3 = prompt("Please input what element should spawn.",(create1var||undefined));
|
var answer3 = await _jaydstuffjsprompt("Please input what element should spawn.",(create1var||undefined));
|
||||||
if (!answer3) {return}
|
if (!answer3) {return}
|
||||||
create1var = answer3;
|
create1var = answer3;
|
||||||
},
|
},
|
||||||
|
|
@ -659,7 +780,4 @@ elements.element_spawner = {
|
||||||
conduct: 1,
|
conduct: 1,
|
||||||
state: "solid",
|
state: "solid",
|
||||||
category: "machines"
|
category: "machines"
|
||||||
//hello nouser if you are reading this:
|
|
||||||
};
|
};
|
||||||
};
|
|
||||||
//get triggered
|
|
||||||
|
|
@ -1,3 +1,20 @@
|
||||||
|
async function _weaponsjsprompt(message, defaultValue = "") {
|
||||||
|
|
||||||
|
|
||||||
|
return new Promise(resolve => {
|
||||||
|
|
||||||
|
|
||||||
|
promptInput(message, (result) => {
|
||||||
|
|
||||||
|
|
||||||
|
resolve(result);
|
||||||
|
|
||||||
|
|
||||||
|
}, "weapons.js is asking you...", defaultValue);
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
elements.tsar_bomba = {
|
elements.tsar_bomba = {
|
||||||
color: "#524C41",
|
color: "#524C41",
|
||||||
behavior: [
|
behavior: [
|
||||||
|
|
@ -873,14 +890,14 @@ createAtYvar = 0;
|
||||||
create1var = "";
|
create1var = "";
|
||||||
elements.element_spawner = {
|
elements.element_spawner = {
|
||||||
color: "#71797E",
|
color: "#71797E",
|
||||||
onSelect: function() {
|
onSelect: async function() {
|
||||||
var answer1 = prompt("Please input the x value.",(createAtXvar||undefined));
|
var answer1 = await _weaponsjsprompt("Please input the x value.",(createAtXvar||undefined));
|
||||||
if (!answer1) {return}
|
if (!answer1) {return}
|
||||||
createAtXvar = parseInt(answer1);
|
createAtXvar = parseInt(answer1);
|
||||||
var answer2 = prompt("Please input the y value.",(createAtYvar||undefined));
|
var answer2 = await _weaponsjsprompt("Please input the y value.",(createAtYvar||undefined));
|
||||||
if (!answer2) {return}
|
if (!answer2) {return}
|
||||||
createAtYvar = parseInt(answer2);
|
createAtYvar = parseInt(answer2);
|
||||||
var answer3 = prompt("Please input what element should spawn.",(create1var||undefined));
|
var answer3 = await _weaponsjsprompt("Please input what element should spawn.",(create1var||undefined));
|
||||||
if (!answer3) {return}
|
if (!answer3) {return}
|
||||||
create1var = answer3;
|
create1var = answer3;
|
||||||
},
|
},
|
||||||
|
|
@ -1252,4 +1269,18 @@ elements.right_uranium_bullet = {
|
||||||
excludeRandom: true,
|
excludeRandom: true,
|
||||||
cooldown: defaultCooldown,
|
cooldown: defaultCooldown,
|
||||||
temp: 4000,
|
temp: 4000,
|
||||||
|
},
|
||||||
|
elements.cluster_nuke = {
|
||||||
|
color: "#323232",
|
||||||
|
ignore: "cluster_nuke",
|
||||||
|
category: "weapons",
|
||||||
|
behavior: behaviors.POWDER,
|
||||||
|
maxSize: 1,
|
||||||
|
tick: (pixel) => {
|
||||||
|
for (var y = 1; y < 50; y++) {
|
||||||
|
if (!isEmpty(pixel.x, pixel.y + y, false)) {
|
||||||
|
explodeAt(pixel.x,pixel.y,50,["dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","dirty_bomb","nuke",])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue