Skip to content

Commit

Permalink
devtests
Browse files Browse the repository at this point in the history
  • Loading branch information
slweeb committed Jan 4, 2025
1 parent 146ba32 commit ecc442d
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 11 deletions.
91 changes: 82 additions & 9 deletions mods/devtests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ elements.rad_fluid = {
category: "liquids",
density: 1500,
state: "liquid",
emit: true
}
elements.rad_fluid.color = elements.radiation.color;
elements.rad_fluid.reactions = elements.radiation.reactions;
Expand Down Expand Up @@ -214,12 +215,44 @@ viewInfo[9] = { // Blur
};

elements.fire.emit = true;
elements.lightning.emit = true;
elements.lightning.emit = 15;
elements.electric.emit = true;
elements.plasma.emit = true;
elements.uranium.emit = true;
elements.uranium.emitColor = "#00ff00";
elements.uranium.emit = 3;
elements.uranium.emitColor = "#009800";
elements.rainbow.emit = true;
elements.static.emit = true;
elements.flash.emit = true;
elements.cold_fire.emit = true;
elements.blaster.emit = true;
elements.ember.emit = true;
elements.fw_ember.emit = 10;
elements.bless.emit = true;
elements.pop.emit = true;
elements.explosion.emit = true;
elements.n_explosion.emit = 10;
elements.supernova.emit = 20;
elements.midas_touch.emit = true;
elements.fireball.emit = true;

elements.sun.emit = 15;
elements.light.emit = 3;
elements.liquid_light.emit = true;
elements.laser.emit = 3;
elements.neutron.emit = 3;
elements.proton.emit = 3;
elements.radiation.emit = 3;
elements.fallout.emit = 3;
elements.rad_steam.emit = 2;
elements.rad_steam.emitColor = "#6ad48c";
elements.rad_cloud.emit = 2;
elements.rad_cloud.emitColor = "#009800";
elements.rad_glass.emit = 2;
elements.rad_glass.emitColor = "#009800";
elements.rad_shard.emit = 2;
elements.rad_shard.emitColor = "#009800";
elements.malware.emit = 2;
elements.border.emit = 2;

viewInfo[8] = { // Blur Glow (Emissive pixels only)
name: "blurglow",
Expand All @@ -234,21 +267,61 @@ viewInfo[8] = { // Blur Glow (Emissive pixels only)
post: function(ctx) {
devtestsCtx.canvas.width = ctx.canvas.width;
devtestsCtx.canvas.height = ctx.canvas.height;
devtestsCtx.filter = "blur(20px)";
devtestsCtx.filter = "blur(30px)";
// Draw the blurred content on the canvas
devtestsCtx.drawImage(devtestsCtx2.canvas, 0, 0);
devtestsCtx.drawImage(devtestsCtx2.canvas, 0, 0);
devtestsCtx.drawImage(devtestsCtx2.canvas, 0, 0);
devtestsCtx.filter = "none";
},
};

// viewInfo[7] = { // Pixelized Glow (Emissive pixels only)
// name: "pixelglow",
// pixel: viewInfo[1].pixel,
// effects: true,
// colorEffects: true,
// pre: function(ctx) {
// devtestsCtx2.canvas.width = width;
// devtestsCtx2.canvas.height = height;
// devtestsCtx.canvas.width = ctx.canvas.width;
// devtestsCtx.canvas.height = ctx.canvas.height;
// if (devtestsCtx.msImageSmoothingEnabled !== false) {
// devtestsCtx.msImageSmoothingEnabled = false;
// devtestsCtx.mozImageSmoothingEnabled = false;
// devtestsCtx.webkitImageSmoothingEnabled = false;
// devtestsCtx.imageSmoothingEnabled = false;
// }
// },
// pixel: viewInfo[1].pixel,
// post: function(ctx) {
// // devtestsCtx.canvas.width = ctx.canvas.width;
// // devtestsCtx.canvas.height = ctx.canvas.height;
// // devtestsCtx.filter = "blur(30px)";
// // Draw the blurred content on the canvas
// devtestsCtx.filter = "blur(30px)";
// devtestsCtx.drawImage(devtestsCtx2.canvas, 0, 0, width, height, 0, 0, devtestsCtx.canvas.width, devtestsCtx.canvas.height);
// devtestsCtx.filter = "none";
// devtestsCtx.drawImage(devtestsCtx.canvas, 0, 0, devtestsCtx.canvas.width, devtestsCtx.canvas.height, 0, 0, devtestsCtx.canvas.width, devtestsCtx.canvas.height);
// },
// };

renderEachPixel(function(pixel,ctx) {
if (view === 8) {
if (elements[pixel.element].emit || pixel.emit) {
var a = (settings.textures !== 0) ? pixel.alpha : undefined;
drawSquare(devtestsCtx2,elements[pixel.element].emitColor||pixel.color,pixel.x,pixel.y,undefined,a);
if (elements[pixel.element].emit || pixel.emit || (elements[pixel.element].colorOn && pixel.charge)) {
let a = (settings.textures !== 0) ? pixel.alpha : undefined;
let d = elements[pixel.element].emit||true;
if (d === true) d = 5;
let r = Math.floor(d/2);
drawSquare(devtestsCtx2,elements[pixel.element].emitColor||pixel.color,pixel.x-r,pixel.y-r,d,a);
// viewInfo[1].pixel(pixel,devtestsCtx2);
}
}
// else if (view === 7) {
// let a = (settings.textures !== 0) ? pixel.alpha : undefined;
// let d = elements[pixel.element].emit||true;
// if (d === true) d = 5;
// let r = Math.floor(d/2);
// devtestsCtx2.fillStyle = pixel.color;
// if (devtestsCtx2.globalAlpha !== a) { devtestsCtx2.globalAlpha = a; }
// devtestsCtx2.fillRect(pixel.x-r, pixel.y-r, d, d);
// }
})
6 changes: 4 additions & 2 deletions mods/souls.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ elements.soul = {
ignoreAir: true,
category: "life",
insulate: true,
hidden: true
hidden: true,
emit: 3
}

elements.ectoplasm = {
Expand All @@ -106,7 +107,8 @@ elements.ectoplasm = {
insulate: true,
viscosity: 1666,
hardness: 100,
hidden: true
hidden: true,
emit: 2
}

elements.head.breakInto = "soul";
Expand Down

0 comments on commit ecc442d

Please sign in to comment.