Merge branch 'R74nCom:main' into main

This commit is contained in:
JustAGenericUsername 2024-06-18 21:50:37 -04:00 committed by GitHub
commit 903d35f556
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 143 additions and 1 deletions

View File

@ -543,5 +543,5 @@
"tsunami": "Tsunami",
"blaster": "Blaster",
"propane_ice": "Zrmzlý_Propan",
"molten_caustic_potash": "Rozteklý_Potaš",
"molten_caustic_potash": "Rozteklý_Potaš"
}

View File

@ -19,8 +19,14 @@ let fireColor = [255, 69, 0];
let plasmaColor = [160, 69, 255];
let coldFireColor = [0, 191, 255];
let magmaColor = [255, 140, 0];
let fireFlyColors = [[180, 255, 70], scaleList([180, 255, 70], 0.75), scaleList([180, 255, 70], 0.5), scaleList([180, 255, 70], 0.25)];
let radColor = [75, 100, 30];
let neonColor = [255*2, 60*2, 10*2];
function scaleList(numbers, scale) {
return numbers.map(number => number * scale);
}
function initializeLightmap(width, height) {
lightmapWidth = Math.ceil(width / lightmapScale);
lightmapHeight = Math.ceil(height / lightmapScale);
@ -265,6 +271,71 @@ elements.plasma.tick = function(pixel) {
lightmap[y][x] = { color: plasmaColor };
};
let originalFireflyTick = elements.firefly.tick;
elements.firefly.tick = function(pixel) {
originalFireflyTick(pixel);
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
let col = undefined;
if (pixelTicks % pixel.fff <= 5) { col = fireFlyColors[3]; }
if (pixelTicks % pixel.fff <= 4) { col = fireFlyColors[2]; }
if (pixelTicks % pixel.fff <= 3) { col = fireFlyColors[1]; }
if (pixelTicks % pixel.fff <= 2) { col = fireFlyColors[0]; }
if (col) {
lightmap[y][x] = { color: col };
}
};
// Radioactive elements
elements.uranium.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
elements.radiation.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
elements.rad_glass.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
elements.fallout.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
elements.molten_uranium.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
elements.rad_shard.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
elements.rad_cloud.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
elements.rad_steam.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
window.addEventListener('load', function() {
initializeLightmap(width, height);
});

View File

@ -19,8 +19,14 @@ let fireColor = [255, 69, 0];
let plasmaColor = [160, 69, 255];
let coldFireColor = [0, 191, 255];
let magmaColor = [255, 140, 0];
let fireFlyColors = [[180, 255, 70], scaleList([180, 255, 70], 0.75), scaleList([180, 255, 70], 0.5), scaleList([180, 255, 70], 0.25)];
let radColor = [75, 100, 30];
let neonColor = [255*2, 60*2, 10*2];
function scaleList(numbers, scale) {
return numbers.map(number => number * scale);
}
function initializeLightmap(width, height) {
lightmapWidth = Math.ceil(width / lightmapScale);
lightmapHeight = Math.ceil(height / lightmapScale);
@ -265,6 +271,71 @@ elements.plasma.tick = function(pixel) {
lightmap[y][x] = { color: plasmaColor };
};
let originalFireflyTick = elements.firefly.tick;
elements.firefly.tick = function(pixel) {
originalFireflyTick(pixel);
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
let col = undefined;
if (pixelTicks % pixel.fff <= 5) { col = fireFlyColors[3]; }
if (pixelTicks % pixel.fff <= 4) { col = fireFlyColors[2]; }
if (pixelTicks % pixel.fff <= 3) { col = fireFlyColors[1]; }
if (pixelTicks % pixel.fff <= 2) { col = fireFlyColors[0]; }
if (col) {
lightmap[y][x] = { color: col };
}
};
// Radioactive elements
elements.uranium.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
elements.radiation.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
elements.rad_glass.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
elements.fallout.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
elements.molten_uranium.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
elements.rad_shard.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
elements.rad_cloud.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
elements.rad_steam.tick = function(pixel) {
let x = Math.floor(pixel.x / lightmapScale);
let y = Math.floor(pixel.y / lightmapScale);
lightmap[y][x] = { color: radColor };
};
window.addEventListener('load', function() {
initializeLightmap(width, height);
});