This commit is contained in:
An Orbit 2025-02-15 20:01:23 -05:00 committed by GitHub
parent f33ff01e9d
commit ca93d5be95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 61 additions and 9 deletions

View File

@ -5759,6 +5759,38 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
} }
clearInterval(renderInterval); clearInterval(renderInterval);
renderInterval = window.setInterval(drawLayers, 1000/60); renderInterval = window.setInterval(drawLayers, 1000/60);
viewInfo[4] = {
name: 'element',
pixel: function(pixel,ctx) {
var data = elements[pixel.element];
var _color = data.color;
if(Array.isArray(_color)) {
_color = _color[Math.floor(pixelTicks / 6) % _color.length]
};
drawSquare(ctx,_color,pixel.x,pixel.y,undefined,1 - (data.alpha ?? 0))
}
};
viewInfo[5] = {
name: 'velocity',
pixel: function(pixel,ctx) {
var data = elements[pixel.element];
var vx = pixel.vx ?? 0;
var vy = pixel.vy ?? 0;
var _color = null;
if(vx === 0 && vy === 0) {
_color = "rgb(15,15,15)"
} else {
var magnitude = Math.sqrt ((vx ** 2) + (vy ** 2));
var direction = Math.atan2(pixel.vy ?? 0,pixel.vx ?? 0)*180/Math.PI;
if(direction < 0) { direction = scale(direction,-180,0,360,180) };
hue = direction;
sat = 100;
lig = bound(scale(magnitude,0,100,10,100),0,100);
_color = "hsl("+hue+","+sat+"%,"+lig+"%)";
};
drawSquare(ctx,_color,pixel.x,pixel.y,undefined,1 - (data.alpha ?? 0))
}
};
canvasLayers.pressure = document.createElement("canvas"); canvasLayers.pressure = document.createElement("canvas");
canvasLayersPre.push(canvasLayers.pressure); canvasLayersPre.push(canvasLayers.pressure);
function drawPressure() { function drawPressure() {
@ -11735,6 +11767,7 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
}; };
elements.planet_cracker = { elements.planet_cracker = {
color: "#ffc8ba", color: "#ffc8ba",
excludeRandom: true,
behavior: behaviors.WALL, behavior: behaviors.WALL,
properties: { properties: {
active: true, active: true,
@ -15232,6 +15265,7 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
}; };
elements.light_petroleum_fuel_gas = { //it's not liquified, and sandboxels doesn't even have a pressure system, and there is no generic name for uncompressed, gaseous "L"PG, so we need a different name elements.light_petroleum_fuel_gas = { //it's not liquified, and sandboxels doesn't even have a pressure system, and there is no generic name for uncompressed, gaseous "L"PG, so we need a different name
burn: 100, burn: 100,
burnTime: 10,
color: "#b5b5b3", color: "#b5b5b3",
density: 3.5, density: 3.5,
tempLow: -44, tempLow: -44,
@ -15241,10 +15275,17 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
pixel.burnStart = pixelTicks; pixel.burnStart = pixelTicks;
} }
}, },
burnInto: "explosion,explosion,fire,fire,fire,carbon_dioxide,carbon_dioxide,carbon_dioxide,carbon_dioxide,carbon_dioxide,steam,steam,steam,steam,steam".split(","), burnInto: "explosion,explosion,ignited_gas,fire,fire,fire,carbon_dioxide,carbon_dioxide,carbon_dioxide,carbon_dioxide,carbon_dioxide,steam,steam,steam,steam,steam".split(","),
state: "gas", state: "gas",
behavior: behaviors.GAS, behavior: behaviors.GAS,
}; };
elements.liquid_light_petroleum_fuel = {
burn: 50,
burnTime: 165,
fireElement: ["light_petroleum_fuel_gas","fire","fire"],
burnInto: "ignited_gas,fire,fire,smoke,carbon_dioxide,carbon_dioxide,carbon_dioxide,carbon_dioxide,carbon_dioxide,steam,steam,steam,steam,steam".split(","),
tempLow: -180 //based off of ethane
}
elements.lamp_oil.tempHigh = 170; elements.lamp_oil.tempHigh = 170;
elements.lamp_oil.stateHigh = "lamp_oil_gas"; elements.lamp_oil.stateHigh = "lamp_oil_gas";
elements.lamp_oil.density = 810; elements.lamp_oil.density = 810;
@ -21561,7 +21602,7 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
elements[name] = { elements[name] = {
behavior: itsActuallySolidNotPowderLol ? behaviors.WALL : behaviors.POWDER, behavior: itsActuallySolidNotPowderLol ? behaviors.WALL : behaviors.POWDER,
color: color, color: color,
category: "solids", category: itsActuallySolidNotPowderLol ? "solids" : "powders",
state: "solid", state: "solid",
density: density ?? 1000, density: density ?? 1000,
}; };
@ -25916,7 +25957,6 @@ Pixel size (rendering only): <input id="pixelSize"> (Use if the save looks cut o
goldenZirconColors = ["#e99209","#fcb111","#d88208","#b97605"]; goldenZirconColors = ["#e99209","#fcb111","#d88208","#b97605"];
//heatTreated 0 = untreated, 1 = inertly (blue), 2 = with oxygen (golden) //heatTreated 0 = untreated, 1 = inertly (blue), 2 = with oxygen (golden)
elements.zircon = { elements.zircon = {
//Corundum with different impurities, so I can copy/paste everything but the color
color: ["#37130b","#a9301a","#3c1810"], color: ["#37130b","#a9301a","#3c1810"],
properties: { properties: {
heatTreated: 0 heatTreated: 0
@ -27959,9 +27999,16 @@ ${eightSpaces}Example full decor definition: bird:0.04:10:#FF0000,#FFFF00,#00FF0
console.error("pixelsize: supplied pixel size was zero or negative"); console.error("pixelsize: supplied pixel size was zero or negative");
return false; return false;
} else { } else {
var confirmation = confirm("Due to changes in the game, this command must reset the canvas. Proceed?")
if(confirmation) {
document.querySelector('span[setting="pixelsize"]').querySelector("select").selectedIndex = pixelSizeSettingDropdownOtherOptionIndex; document.querySelector('span[setting="pixelsize"]').querySelector("select").selectedIndex = pixelSizeSettingDropdownOtherOptionIndex;
settings.pixelsize = argPixelSize; settings.pixelsize = argPixelSize;
resizeCanvas(ctx.canvas.height,ctx.canvas.width,settings.pixelsize,false) resizeCanvas(ctx.canvas.height,ctx.canvas.width,settings.pixelsize,false);
clearAll();
return argPixelSize
} else {
return false
}
}; };
} else { } else {
alert(pixelSize); alert(pixelSize);
@ -28733,7 +28780,8 @@ Make sure to save your command in a file if you want to add this preset again.`
elements.smash_ray = { elements.smash_ray = {
color: ["#ff9999", "#8c8279"], color: ["#ff9999", "#8c8279"],
tick: function(pixel) { tick: function(pixel) {
if(pixel.done) { deletePixel(pixel); return }; if(!pixel) { return };
if(pixel?.done) { deletePixel(pixel.x,pixel.y); return };
var x = pixel.x; var x = pixel.x;
for (var y = pixel.y; y < height; y++) { for (var y = pixel.y; y < height; y++) {
if (outOfBounds(x, y)) { if (outOfBounds(x, y)) {
@ -35763,6 +35811,7 @@ Make sure to save your command in a file if you want to add this preset again.`
}; };
elements.amba_tsunami = { elements.amba_tsunami = {
color: ["#2449d1","#4b6adb","#8093d9"], color: ["#2449d1","#4b6adb","#8093d9"],
excludeRandom: true,
behavior: behaviors.WALL, behavior: behaviors.WALL,
properties: { properties: {
active: true, active: true,
@ -35842,6 +35891,7 @@ Make sure to save your command in a file if you want to add this preset again.`
elements.megatsunami = { elements.megatsunami = {
color: ["#1f2aa3","#2641c9","#3a57c9"], color: ["#1f2aa3","#2641c9","#3a57c9"],
behavior: behaviors.WALL, behavior: behaviors.WALL,
excludeRandom: true,
properties: { properties: {
active: true, active: true,
}, },
@ -35922,6 +35972,7 @@ Make sure to save your command in a file if you want to add this preset again.`
elements.lava_tsunami = { elements.lava_tsunami = {
color: ["#ff370a","#e84a23","#e67740"], color: ["#ff370a","#e84a23","#e67740"],
behavior: behaviors.WALL, behavior: behaviors.WALL,
excludeRandom: true,
properties: { properties: {
active: true, active: true,
}, },
@ -36012,6 +36063,7 @@ Make sure to save your command in a file if you want to add this preset again.`
elements.lava_megatsunami = { elements.lava_megatsunami = {
color: ["#b32b10","#c24d1f","#d66924"], color: ["#b32b10","#c24d1f","#d66924"],
behavior: behaviors.WALL, behavior: behaviors.WALL,
excludeRandom: true,
properties: { properties: {
active: true, active: true,
}, },
@ -39929,7 +39981,7 @@ Make sure to save your command in a file if you want to add this preset again.`
}; };
}); });
function propPrompt() { function propPrompt() {
propProperty = prompt("Enter the property you want to set"); propProperty = prompt("(Prop) Enter the property you want to set");
propValue = prompt("Enter the value you want to set to"); propValue = prompt("Enter the value you want to set to");
//special check: element //special check: element
if(propProperty === "element") { if(propProperty === "element") {
@ -40108,7 +40160,7 @@ Make sure to save your command in a file if you want to add this preset again.`
if(oldProperty === null) { if(oldProperty === null) {
oldProperty = "temp"; oldProperty = "temp";
}; };
numberAdjusterProperty = prompt("Enter the property you want to change"); numberAdjusterProperty = prompt("(Number adjuster) Enter the value you want to change");
if(numberAdjusterProperty === null) { if(numberAdjusterProperty === null) {
numberAdjusterProperty = oldProperty; numberAdjusterProperty = oldProperty;
return false; return false;