diff --git a/mod-list.html b/mod-list.html index 07bba2b9..74cdac83 100644 --- a/mod-list.html +++ b/mod-list.html @@ -161,7 +161,6 @@ moretools.jsAdds more temperature-modifying tools (±10/tick, ±50/tick, and absolute zero tools)Sightnado move_tools.jsAdds tools that move pixelsAlice noconfirm.jsRemoves all confirmation pop upsmollthecoder -nopixellimit.jsRemoves the pixel limitJayd page_color.jsAllows changing the background color outside of the canvas with the “pageColor” query parameterAlice pixelResizeTool.jsAdds a button to change pixel scalefeeshmaster prompt.jsAdds a primitive command consoleAlice @@ -334,13 +333,14 @@ heatglow.jsRed glowing effect for hot metalsnousernamefound invisible_dye.jsAdds elements like Dye and Spray Paint that take the color of the backgroundAlice invisible_wall.jsAdds an element like Wall that takes the color of the backgroundAlice +lightmap.jsMakes light sources glowRedBirdly moreViews.jsMany new rendering modesggod onecolor.jsMakes all placed pixels single-colorednousernamefound paint_event.jsAdds a random event that randomly paints a circleAlice rainbow_tests.jsAdds variants of the rainbow element with different mathsAlice +shader_by_jayd.jsAdds a glow around light elementsJayd Shroomboxels.jsA variant of acid_and_shapes.js that uses a different trigonometric functionAlice singleColor.jsMakes all elements pick one color each time they're drawnstefanblox -lightmap.jsMakes light sources glowRedBirdly Compilations a_mod_by_alice.jsA mod combining most of Alice’s mods, and some other thingsAlice @@ -383,6 +383,7 @@ humans.jsAdds humans. Now part of the base gameR74n unhide.jsUnhides all elements except molten ones. (This functionality now exists as a vanilla setting)R74n wheel_fix.jsAttempts to fix the brush scaling too much with the mouse wheel for some people. DeprecatedNubo318 +nopixellimit.jsRemoves the pixel limit. (now a setting)Jayd diff --git a/mods/heatglow.js b/mods/heatglow.js index 8267a6fa..57863e1f 100644 --- a/mods/heatglow.js +++ b/mods/heatglow.js @@ -1,8 +1,6 @@ if (!settings.heatglowMode){settings.heatglowMode = 1; saveSettings();} -if (!eLists.metals) { eLists.metals = [] } - eLists.metals = eLists.metals.concat(["iron", "glass", "copper", "gold", "brass","steel","nickel","zinc","silver","aluminum","bronze","metal_scrap","oxidized_copper","tin","lead", "rose_gold", "tungsten"]) if (!eLists.heatBlacklist) {eLists.heatBlacklist = []} - eLists.heatBlacklist = eLists.heatBlacklist.concat(["void", "sun", "light", "plasma", "fire", "border", "heater", "superheater"]) + eLists.heatBlacklist = eLists.heatBlacklist.concat(["void", "sun", "light", "plasma", "fire", "border", "heater", "superheater", "laser", "ray"]) function tempToRGB(temp){ if (temp <= 6500){ return{ @@ -58,7 +56,7 @@ renderEachPixel(function(pixel,ctx) { } else { color = oldtempToRgb(pixel.temp, pixel) opacity = color.opacity - if (!eLists.metals.includes(pixel.element)){ + if (!((elements[pixel.element].tempHigh > 400 && elements[elements[pixel.element].stateHigh] && elements[elements[pixel.element].stateHigh].state === "liquid"))){ return; } } diff --git a/mods/nousersthings.js b/mods/nousersthings.js index bfc148d7..b24fe08e 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -3282,6 +3282,7 @@ elements.function_machine = { excludeRandom: true, } */ + /* elements.galvanized_steel = { color: "#4c585f", behavior: behaviors.WALL, @@ -3327,6 +3328,7 @@ if (!elements.steel.reactions){elements.steel.reactions = {}} elements.steel.reactions.molten_zinc = {elem1: "galvanized_steel", chance: 0.035} if (!elements.molten_zinc.reactions){elements.zinc.reactions = {}} elements.molten_zinc.reactions.steel = {elem1: "null", chance: 0.2} +*/ elements.super_heat_conductor = { color: "#b66b61", behavior: behaviors.WALL, @@ -3483,15 +3485,12 @@ elements.colored_filler = { properties: { "initalized": false, }, - onSelect: function(pixel){ - logMessage("It is reccomended to place this while paused.") - }, tick: function(pixel){ let fillerNeighbors = {} for (var i = 0; i < adjacentCoords.length; i++) { var x = pixel.x+adjacentCoords[i][0]; var y = pixel.y+adjacentCoords[i][1]; - if (isEmpty(x,y)) { + if (isEmpty(x,y) && pixel.initalized) { createPixel("colored_filler", x, y) pixelMap[x][y].color = pixel.color; pixelMap[x][y].initalized = true @@ -3531,4 +3530,84 @@ elements.colored_filler = { } } } +} +let copycatfillerElem = "sand" +elements.copycat_filler = { + color: elements.random.color, + behavior:behaviors.WALL, + category: "special", + onSelect: function(){ + let ans1 = prompt("Enter the element you want to use for the copycat filler", copycatfillerElem||"sand") + copycatfillerElem = mostSimilarElement(ans1) + }, + tick: function(pixel){ + let fillerNeighbors = {} + if (!pixel.copycatElement){ + pixel.copycatElement = copycatfillerElem + } + if (!pixel.rSeed){ + pixel.rSeed = [Math.random(), Math.random(), Math.random(), Math.random()] + } + for (var i = 0; i < adjacentCoords.length; i++) { + var x = pixel.x+adjacentCoords[i][0]; + var y = pixel.y+adjacentCoords[i][1]; + if (isEmpty(x,y)) { + createPixel("copycat_filler", x, y) + pixelMap[x][y].copycatElement = pixel.copycatElement + } + } + for (var i = 0; i < squareCoords.length; i++) { + var x = pixel.x+squareCoords[i][0]; + var y = pixel.y+squareCoords[i][1]; + if (!isEmpty(x, y, true)){ + var otherPixel = pixelMap[x][y]; + if (otherPixel.element == "copycat_filler" && otherPixel.copycatElement != pixel.copycatElement){ + fillerNeighbors[otherPixel.copycatElement] = (fillerNeighbors[otherPixel.copycatElement]||0)+1; + } + } + } + if(Object.keys(fillerNeighbors).length > 0){ + let mostSeenColor = highestValueObjectKey(fillerNeighbors) + let opposingCount = sumOfObjectValues(fillerNeighbors) + if (Math.random() < neighborRandomChance[opposingCount]){ + pixel.copycatElement = mostSeenColor; + } + } + }, + renderer: function(pixel, ctx){ + if (!pixel.copycatElement){pixel.copycatElement = copycatfillerElem} + if (!pixel.rSeed){pixel.rSeed = [Math.random(), Math.random(), Math.random(), Math.random()]} + if (typeof elements[pixel.copycatElement].color == "object"){ + let selectedColor = elements[pixel.copycatElement].color[Math.floor(pixel.rSeed[1]*elements[pixel.copycatElement].color.length)] + let rgb = { + r: parseInt(selectedColor.match(/\d+/g)[0]), + g: parseInt(selectedColor.match(/\d+/g)[1]), + b: parseInt(selectedColor.match(/\d+/g)[2]) + } + for (let c in rgb){ + rgb[c] += Math.floor(pixel.rSeed[0] * (pixel.rSeed[2] > 0.5 ? -1 : 1) * pixel.rSeed[3] * 15); + rgb[c] = Math.max(0, Math.min(255, rgb[c])); + } + if (elements[pixel.copycatElement].glow || elements[pixel.copycatElement].isGas){ + drawPlus(ctx, "rgb("+rgb.r+","+rgb.g+","+rgb.b+")", pixel.x, pixel.y, 1); + } else { + drawSquare(ctx, "rgb("+rgb.r+","+rgb.g+","+rgb.b+")", pixel.x, pixel.y); + } + } else { + let rgb = { + r: parseInt(elements[pixel.copycatElement].color.match(/\d+/g)[0]), + g: parseInt(elements[pixel.copycatElement].color.match(/\d+/g)[1]), + b: parseInt(elements[pixel.copycatElement].color.match(/\d+/g)[2]) + } + for (let c in rgb){ + rgb[c] += Math.floor(pixel.rSeed[0] * (pixel.rSeed[2] > 0.5 ? -1 : 1) * pixel.rSeed[3] * 15); + rgb[c] = Math.max(0, Math.min(255, rgb[c])); + } + if (elements[pixel.copycatElement].glow || elements[pixel.copycatElement].isGas){ + drawPlus(ctx, "rgb("+rgb.r+","+rgb.g+","+rgb.b+")", pixel.x, pixel.y, 1); + } else { + drawSquare(ctx, "rgb("+rgb.r+","+rgb.g+","+rgb.b+")", pixel.x, pixel.y); + } + } + } } \ No newline at end of file diff --git a/mods/shader_by_jayd.js b/mods/shader_by_jayd.js new file mode 100644 index 00000000..9826cb1c --- /dev/null +++ b/mods/shader_by_jayd.js @@ -0,0 +1,154 @@ +elements.shader_test = { + color: "#FFFFFF", + category: "special", + renderer: function(pixel,ctx) { + var circlec = circleCoords(pixel.x, pixel.y, 3); + for (var i = 0; i < circlec.length; i++){ + var coord = circlec[i]; + var x = coord.x; + var y = coord.y; + drawSquare(ctx,"#ffffff",x,y,1,0.25) + } + } +} +elements.fire.renderer = function(pixel,ctx) { + var circlec = circleCoords(pixel.x, pixel.y, 3); + for (var i = 0; i < circlec.length; i++){ + var coord = circlec[i]; + var x = coord.x; + var y = coord.y; + drawSquare(ctx,pixel.color,x,y,1,0.25) + } +} +elements.cold_fire.renderer = function(pixel,ctx) { + var circlec = circleCoords(pixel.x, pixel.y, 3); + for (var i = 0; i < circlec.length; i++){ + var coord = circlec[i]; + var x = coord.x; + var y = coord.y; + drawSquare(ctx,pixel.color,x,y,1,0.25) + } +} +elements.light.renderer = function(pixel,ctx) { + var circlec = circleCoords(pixel.x, pixel.y, 2); + for (var i = 0; i < circlec.length; i++){ + var coord = circlec[i]; + var x = coord.x; + var y = coord.y; + drawSquare(ctx,pixel.color,x,y,1,0.75) + } +} +elements.laser.renderer = function(pixel,ctx) { + var circlec = circleCoords(pixel.x, pixel.y, 2); + for (var i = 0; i < circlec.length; i++){ + var coord = circlec[i]; + var x = coord.x; + var y = coord.y; + drawSquare(ctx,pixel.color,x,y,1,0.75) + } +} +elements.plasma.renderer = function(pixel,ctx) { + var circlec = circleCoords(pixel.x, pixel.y, 3); + for (var i = 0; i < circlec.length; i++){ + var coord = circlec[i]; + var x = coord.x; + var y = coord.y; + drawSquare(ctx,pixel.color,x,y,1,0.5) + } +} +elements.electric.renderer = function(pixel,ctx) { + var circlec = circleCoords(pixel.x, pixel.y, 2); + for (var i = 0; i < circlec.length; i++){ + var coord = circlec[i]; + var x = coord.x; + var y = coord.y; + drawSquare(ctx,pixel.color,x,y,1,0.25) + } +} +elements.heat_ray.renderer = function(pixel,ctx) { + var circlec = circleCoords(pixel.x, pixel.y, 3); + for (var i = 0; i < circlec.length; i++){ + var coord = circlec[i]; + var x = coord.x; + var y = coord.y; + drawSquare(ctx,pixel.color,x,y,1,0.25) + } +} +elements.freeze_ray.renderer = function(pixel,ctx) { + var circlec = circleCoords(pixel.x, pixel.y, 3); + for (var i = 0; i < circlec.length; i++){ + var coord = circlec[i]; + var x = coord.x; + var y = coord.y; + drawSquare(ctx,pixel.color,x,y,1,0.25) + } +} +elements.flash.renderer = function(pixel,ctx) { + var circlec = circleCoords(pixel.x, pixel.y, 3); + for (var i = 0; i < circlec.length; i++){ + var coord = circlec[i]; + var x = coord.x; + var y = coord.y; + drawSquare(ctx,pixel.color,x,y,1,0.7) + } +} +elements.smoke.renderer = function(pixel,ctx) { + var circlec = circleCoords(pixel.x, pixel.y, 2); + for (var i = 0; i < circlec.length; i++){ + var coord = circlec[i]; + var x = coord.x; + var y = coord.y; + drawSquare(ctx,pixel.color,x,y,1,0.25) + } +} +elements.radiation.renderer = function(pixel,ctx) { + var circlec = circleCoords(pixel.x, pixel.y, 2); + for (var i = 0; i < circlec.length; i++){ + var coord = circlec[i]; + var x = coord.x; + var y = coord.y; + drawSquare(ctx,pixel.color,x,y,1,0.25) + } +} +elements.led_r.renderer = function(pixel,ctx) { + var circlec = circleCoords(pixel.x, pixel.y, 3); + for (var i = 0; i < circlec.length; i++){ + var coord = circlec[i]; + var x = coord.x; + var y = coord.y; + if (pixel.charge) { + drawSquare(ctx,pixel.color,x,y,1,0.5) + } + else { + drawSquare(ctx,pixel.color,pixel.x,pixel.y,1,1) + } + } +} +elements.led_g.renderer = function(pixel,ctx) { + var circlec = circleCoords(pixel.x, pixel.y, 3); + for (var i = 0; i < circlec.length; i++){ + var coord = circlec[i]; + var x = coord.x; + var y = coord.y; + if (pixel.charge) { + drawSquare(ctx,pixel.color,x,y,1,0.5) + } + else { + drawSquare(ctx,pixel.color,pixel.x,pixel.y,1,1) + } + } +} +elements.led_b.renderer = function(pixel,ctx) { + var circlec = circleCoords(pixel.x, pixel.y, 3); + for (var i = 0; i < circlec.length; i++){ + var coord = circlec[i]; + var x = coord.x; + var y = coord.y; + if (pixel.charge) { + drawSquare(ctx,pixel.color,x,y,1,0.5) + } + else { + drawSquare(ctx,pixel.color,pixel.x,pixel.y,1,1) + } + } +}