sandboxels/mods/weapons.js

99 lines
2.5 KiB
JavaScript
Raw Normal View History

2024-01-23 23:31:01 -05:00
elements.tsar_bomba = {
color: "#524C41",
behavior: [
"XX|EX:150>plasma|XX",
"XX|XX|XX",
"M2|M1 AND EX:150>plasma|M2",
],
category: "weapons",
state: "solid",
density: 1300,
excludeRandom: true,
cooldown: defaultCooldown
},
elements.little_boy = {
color: "#F5F5DC",
behavior: [
"XX|EX:20>plasma|XX",
"XX|XX|XX",
"M2|M1 AND EX:70>plasma,plasma,plasma,plasma,radiation,fallout|M2",
],
category: "weapons",
state: "solid",
density: 500,
excludeRandom: true,
cooldown: defaultCooldown
},
elements.fat_man = {
2024-01-25 21:42:15 -05:00
color: ["#ffff00","#333333"],
2024-01-23 23:31:01 -05:00
behavior: [
"XX|EX:28>plasma|XX",
"XX|XX|XX",
"M2|M1 AND EX:98>plasma,plasma,plasma,plasma,radiation,fallout|M2",
],
category: "weapons",
state: "solid",
density: 1000,
excludeRandom: true,
cooldown: defaultCooldown
},
2024-05-25 23:15:44 -04:00
elements.self_propelled_bomb = {
2024-01-23 23:31:01 -05:00
color: "#71797E",
tick: function(pixel) {
if ((pixel.temp > 1000 || pixel.charge) && !pixel.burning) {
pixel.burning = true;
pixel.burnStart = pixelTicks;
}
if (pixel.burning) {
if (!tryMove(pixel, pixel.x, pixel.y-1)) {
// tryMove again to the top left or top right
tryMove(pixel, pixel.x+(Math.random() < 0.5 ? -1 : 1), pixel.y-1);
}
if (pixelTicks-pixel.burnStart > 50 && Math.random() < 0.1) {
explodeAt(pixel.x, pixel.y, 10, "bomb");
}
}
else {
if (!tryMove(pixel, pixel.x, pixel.y+1)) {
// tryMove again to the bottom left or bottom right
tryMove(pixel, pixel.x+(Math.random() < 0.5 ? -1 : 1), pixel.y+1);
}
}
doDefaults(pixel);
},
burn: 90,
burnTime: 100,
density: 2000,
conduct: 1,
state: "solid",
category: "weapons"
},
elements.left_missile = {
2024-01-25 21:42:15 -05:00
color: "#4c4e42",
2024-01-23 23:31:01 -05:00
behavior: [
2024-01-25 21:42:15 -05:00
"M2|EX:10|XX",
"M1 AND EX:10|XX|EX:10",
"M2|EX:10|XX",
2024-01-23 23:31:01 -05:00
],
2024-05-25 23:15:44 -04:00
category:"weapons",
2024-01-23 23:31:01 -05:00
},
elements.right_missile = {
2024-01-25 21:42:15 -05:00
color: "#4c4e42",
2024-01-23 23:31:01 -05:00
behavior: [
2024-01-25 21:42:15 -05:00
"XX|EX:10|M2",
"EX:10|XX|M1 AND EX:10",
"XX|EX:10|M2",
2024-01-23 23:31:01 -05:00
],
2024-05-25 23:15:44 -04:00
category:"weapons",
},
elements.cluster_munition = {
color: "#444444",
behavior: [
"XX|EX:10>smoke,smoke,smoke,smoke,bomb,bomb|XX",
"XX|XX|XX",
"M2|M1 AND EX:10>smoke,smoke,smoke,smoke,bomb,cluster_munition|M2",
],
category: "weapons",
state: "solid",
density: 1300,
2024-05-25 23:15:44 -04:00
};