From 11156ecf9fe444930b40edce57e76af2824eb304 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:17:36 -0400 Subject: [PATCH 01/11] d --- mods/nousersthings.js | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/nousersthings.js b/mods/nousersthings.js index 7af6436b..59fa76cb 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -3104,6 +3104,7 @@ elements.piston_ray_emitter = { var lx = lcoord[0]; var ly = lcoord[1]; if (!isEmpty(lx, ly, true)){ + if (pixelMap[lx][ly].element == "insulator"){break;} tryMove(pixelMap[lx][ly], pCoord[0], pCoord[1], null, true) } pCoord[0] = lx; From 4a77eb6552fa00a4fab882dbf7a108e8ea397f11 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:20:02 -0400 Subject: [PATCH 02/11] g --- mods/10kelements.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/10kelements.js b/mods/10kelements.js index f22387d6..a7c371e7 100644 --- a/mods/10kelements.js +++ b/mods/10kelements.js @@ -11,7 +11,7 @@ elements.change_count = { if (!cans) { return } if (cans == "skin"){settings.randomcount = 10000; settings.skineasteregg = true; settings.sandeasteregg = false; saveSettings(); alert("skin"); return} if (cans == "sand"){settings.randomcount = 10000; settings.skineasteregg = false; settings.sandeasteregg = true; saveSettings(); alert("sand"); return} - if (cans > 2000000){alert("You have put too big of a number! This would surely crash your browser or eat up all your RAM! Element count will remain unchanged."); return} + if (cans > 100000){alert("You have put too big of a number! This would surely crash your browser or eat up all your RAM! Element count will remain unchanged."); return} if (cans < 1 && (parseInt(cans) > -1) ){alert("You have either put a decimal or zero. Why? Element count will remain unchanged."); return} if (isNaN(parseInt(cans))){alert("Apparently your input isnt even a number. Try again. Element count will remain unchanged."); return} settings.randomcount = parseInt(cans) @@ -24,7 +24,7 @@ elements.change_count = { var choosebehaviors = behaviors delete choosebehaviors.KILLPIXEL2 delete choosebehaviors.KILLPIXEL1 -if (!settings.randomcount || settings.randomcount > 50000){settings.randomcount = 10000; saveSettings()} +if (!settings.randomcount || settings.randomcount > 100000){settings.randomcount = 10000; saveSettings()} var color = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "a", "b", "c", "d", "e","f"] var states = ["solid", "liquid", "gas"] var essentialelements = ["molten_gallium", "gallium", "gallium_gas", "change_count"] From 93f8e452bc8a2e24c8205327c4b1a4cc57f8c340 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Thu, 26 Dec 2024 23:01:27 -0500 Subject: [PATCH 03/11] f --- mod-list.html | 1 + mods/fractals.js | 156 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 157 insertions(+) create mode 100644 mods/fractals.js diff --git a/mod-list.html b/mod-list.html index 65ecc76e..a2b74b4d 100644 --- a/mod-list.html +++ b/mod-list.html @@ -342,6 +342,7 @@

Sandboxels Mod List

Visual Effects acid_and_shapes.jsWeird visual effects. Enable in SettingsAlice customBackground.jsSet your background to an image linkJayd +fractals.jsAdds an element and tools to render fractals in gamenousernamefound 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 diff --git a/mods/fractals.js b/mods/fractals.js new file mode 100644 index 00000000..b2b7279f --- /dev/null +++ b/mods/fractals.js @@ -0,0 +1,156 @@ +let jmax = 2 +let jmin = -2 +let offsetx = 0 +let offsety = 0 +let mode = `mandelbrot` +preCalculatedGrid = [] +runEveryTick(function(){ + preCalculatedGrid = [] + for (let x = 0; x < pixelMap.length; x++){ + preCalculatedGrid.push([]) + for (let y = 0; y < pixelMap[x].length; y++){ + preCalculatedGrid[x].push({ + x: x, + y: y, + iteration: 100, + }) + } + } + for (let ix = 0; ix < preCalculatedGrid.length; ix++){ + for (let iy = 0; iy < preCalculatedGrid[ix].length; iy++){ + const range = jmax - jmin; + const scale = range / Math.min(width, height); + let x = (ix - width / 2) * scale + offsetx; + let y = (iy - height / 2) * scale + offsety; + let iteration = 0; + if (mode == `mandelbrot`){ + let zx = 0; + let zy = 0; + let c = {x: x, y: y}; + while (zx * zx + zy * zy < 4 && iteration < 100) { + let xtemp = zx * zx - zy * zy + c.x; + zy = 2 * zx * zy + c.y; + zx = xtemp; + iteration++; + }} + else { // burning ship + let zx = 0; + let zy = 0; + let c = {x: x, y: y}; + while (zx * zx + zy * zy < 4 && iteration < 100) { + let xtemp = zx * zx - zy * zy + c.x; + zy = Math.abs(2 * zx * zy) + c.y; + zx = Math.abs(xtemp); + iteration++; + } + } + preCalculatedGrid[ix][iy].iteration = iteration + } + } +}) +elements.mandelbrot = { + color: "#000000", + behavior: behaviors.WALL, + category: "mandelbrot tools", + onSelect: function(){ + jmax = parseFloat(prompt("How far would you like it to extend in each direction?"))||2 + jmin = -jmax + offsetx = parseFloat(prompt("How far would you like it to be offset in the x direction?"))||0 + offsety = parseFloat(prompt("How far would you like it to be offset in the y direction?"))||0 + mode = prompt("Mandelbrot or burning ship?") + }, + tick: function(pixel){ + // first, map canvas coord to a range of -2 to 2, but dont scale it, using width, height, and pixel.x and pixel.y + /* + const range = jmax - jmin; + const scale = range / Math.min(width, height); + const x = (pixel.x - width / 2) * scale + offsetx; + const y = -(pixel.y - height / 2) * scale + offsety; + let iteration = 0; + if (mode == `mandelbrot`){ + let zx = 0; + let zy = 0; + let c = {x: x, y: y}; + while (zx * zx + zy * zy < 4 && iteration < 100) { + let xtemp = zx * zx - zy * zy + c.x; + zy = 2 * zx * zy + c.y; + zx = xtemp; + iteration++; + }} + else { // burning ship + let zx = 0; + let zy = 0; + let c = {x: x, y: y}; + while (zx * zx + zy * zy < 4 && iteration < 100) { + let xtemp = zx * zx - zy * zy + c.x; + zy = Math.abs(2 * zx * zy) + c.y; + zx = Math.abs(xtemp); + iteration++; + } + } + */ + iteration = gridWeightedAverage(pixel.x, pixel.y) + if (iteration >= 99.5) { + pixel.color = "rgb(255, 255, 255)" + } else { + pixel.color = `rgb(0, ${67.3684*Math.pow(1.01578, iteration)-67.3684}, ${67.3684*Math.pow(1.01578, iteration)-67.3684})` + //console.log(iteration) + } + } +} +elements.mandelbrot_zoom_in = { + color: elements.heater.color, + category: "mandelbrot tools", + canPlace: false, + tool: function(){}, + onSelect: function(){ + jmax *= 0.95 + jmin = -jmax + } +} +elements.mandelbrot_zoom_out = { + color: elements.cooler.color, + category: "mandelbrot tools", + canPlace: false, + tool: function(){}, + onSelect: function(){ + jmax *= 1.05 + jmin = -jmax + } +} +elements.mandelbrot_move_left = { + color: elements.grape.color, + category: "mandelbrot tools", + canPlace: false, + tool: function(){}, + onSelect: function(){ + offsetx -= 0.05*jmax + } +} +elements.mandelbrot_move_right = { + color: elements.tomato.color, + category: "mandelbrot tools", + canPlace: false, + tool: function(){}, + onSelect: function(){ + offsetx += 0.05*jmax + } +} +elements.mandelbrot_move_up = { + color: elements.mix.color, + category: "mandelbrot tools", + canPlace: false, + tool: function(){}, + onSelect: function(){ + offsety += 0.05*jmax + } +} +elements.mandelbrot_move_down = { + color: elements.drag.color, + category: "mandelbrot tools", + canPlace: false, + tool: function(){}, + onSelect: function(){ + offsety -= 0.05*jmax + } +} \ No newline at end of file From 0a33f0531684267851fe3b73cce939d297dfe743 Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Sat, 28 Dec 2024 19:34:32 -0800 Subject: [PATCH 04/11] Biocloner update --- mods/biology.js | 318 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 226 insertions(+), 92 deletions(-) diff --git a/mods/biology.js b/mods/biology.js index da9845d3..149f4b20 100644 --- a/mods/biology.js +++ b/mods/biology.js @@ -66,6 +66,35 @@ viewInfo[7] = { // Illness View } } +behaviorRules.BCF = function() { + if (btemp.pixel.clone) { + if (isEmpty(btemp.newCoords.x, btemp.newCoords.y)) { + createPixel(btemp.pixel.clone, btemp.newCoords.x, btemp.newCoords.y) + btemp.pixel.nutrition = (btemp.pixel.nutrition - 1) + if (pixelMap[btemp.newCoords.x][btemp.newCoords.y]) { + pixelMap[btemp.newCoords.x][btemp.newCoords.y].temp = btemp.pixel.temp; + pixelTempCheck(pixelMap[btemp.newCoords.x][btemp.newCoords.y]); + } + } + } + else { + if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y,true)) { + var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y]; + if (!btemp.pixel.clone && btemp.info.ignore && btemp.info.ignore.indexOf(newPixel.element) !== -1) { + return; + } + if (newPixel.element !== btemp.pixel.element) { + btemp.pixel.clone = newPixel.element; + btemp.pixel.temp = newPixel.temp; + } + else if (newPixel.clone) { + btemp.pixel.clone = newPixel.clone; + btemp.pixel.temp = newPixel.temp; + } + } + } + }, + elements.flesh = { color: ["#9e4839","#ba6449"], category: "structural", @@ -3048,12 +3077,9 @@ elements.kidney = { hitPixel.nutrition += 20 pixel.nutrition -= 20 } - if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) { - if (hitPixel.kidneyAttached === false) { - hitPixel.kidneyAttached = true - } - if (Math.random() > 0.9999 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen) / 2000))) { - changePixel(hitPixel,"white_blood_cell"); + if (elements[hitPixel.element].id === elements.infected_vessel.id && Math.random() > 0.75) { + if (Math.random() > 0.5 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2020))) { + changePixel(hitPixel,"blood_vessel"); } } } @@ -3069,12 +3095,9 @@ elements.kidney = { hitPixel.nutrition += 20 pixel.nutrition -= 20 } - if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) { - if (hitPixel.kidneyAttached === false) { - hitPixel.kidneyAttached = true - } - if (Math.random() > 0.995 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { - changePixel(hitPixel,"white_blood_cell"); + if (elements[hitPixel.element].id === elements.infected_vessel.id && Math.random() > 0.75) { + if (Math.random() > 0.5 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + changePixel(hitPixel,"blood_vessel"); } } } @@ -3090,12 +3113,9 @@ elements.kidney = { hitPixel.nutrition += 20 pixel.nutrition -= 20 } - if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) { - if (hitPixel.kidneyAttached === false) { - hitPixel.kidneyAttached = true - } - if (Math.random() > 0.995 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { - changePixel(hitPixel,"white_blood_cell"); + if (elements[hitPixel.element].id === elements.infected_vessel.id && Math.random() > 0.75) { + if (Math.random() > 0.5 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + changePixel(hitPixel,"blood_vessel"); } } } @@ -3111,12 +3131,9 @@ elements.kidney = { hitPixel.nutrition += 20 pixel.nutrition -= 20 } - if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) { - if (hitPixel.kidneyAttached === false) { - hitPixel.kidneyAttached = true - } - if (Math.random() > 0.995 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { - changePixel(hitPixel,"white_blood_cell"); + if (elements[hitPixel.element].id === elements.infected_vessel.id && Math.random() > 0.75) { + if (Math.random() > 0.5 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + changePixel(hitPixel,"blood_vessel"); } } } @@ -3307,9 +3324,6 @@ elements.blood_vessel = { if (pixel.speed === null || isNaN(pixel.speed)) { pixel.speed = 0 } - if (pixel.kidneyAttached == true && Math.random() > 0.9999 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { - changePixel(pixel,"white_blood_cell"); - } if (!isEmpty(pixel.x, pixel.y-1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y-1] if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { @@ -3340,9 +3354,6 @@ elements.blood_vessel = { if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { hitPixel.heartAttached = true } - if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) { - hitPixel.kidneyAttached = true - } } } else if (isEmpty(pixel.x, pixel.y-1) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { @@ -3382,9 +3393,6 @@ elements.blood_vessel = { if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { hitPixel.heartAttached = true } - if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) { - hitPixel.kidneyAttached = true - } } } else if (isEmpty(pixel.x, pixel.y+1) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { @@ -3424,9 +3432,6 @@ elements.blood_vessel = { if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { hitPixel.heartAttached = true } - if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) { - hitPixel.kidneyAttached = true - } } } else if (isEmpty(pixel.x-1, pixel.y) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { @@ -3466,9 +3471,6 @@ elements.blood_vessel = { if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { hitPixel.heartAttached = true } - if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) { - hitPixel.kidneyAttached = true - } } } else if (isEmpty(pixel.x+1, pixel.y) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { @@ -3483,7 +3485,6 @@ elements.blood_vessel = { oxygen: 1000, nutrition: 1000, heartAttached: false, - kidneyAttached: false, }, tempHigh: 175, stateHigh: "meat", @@ -3574,9 +3575,6 @@ elements.infected_vessel = { if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { hitPixel.heartAttached = true } - if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) { - hitPixel.kidneyAttached = true - } } } else if (isEmpty(pixel.x, pixel.y-1) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { @@ -3621,9 +3619,6 @@ elements.infected_vessel = { if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { hitPixel.heartAttached = true } - if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) { - hitPixel.kidneyAttached = true - } } } else if (isEmpty(pixel.x, pixel.y+1) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { @@ -3668,9 +3663,6 @@ elements.infected_vessel = { if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { hitPixel.heartAttached = true } - if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) { - hitPixel.kidneyAttached = true - } } } else if (isEmpty(pixel.x-1, pixel.y) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { @@ -3715,9 +3707,6 @@ elements.infected_vessel = { if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { hitPixel.heartAttached = true } - if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) { - hitPixel.kidneyAttached = true - } } } else if (isEmpty(pixel.x+1, pixel.y) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { @@ -3732,7 +3721,6 @@ elements.infected_vessel = { oxygen: 1000, nutrition: 1000, heartAttached: false, - kidneyAttached: false, }, tempHigh: 175, stateHigh: "meat", @@ -3778,7 +3766,7 @@ elements.white_blood_cell = { if (pixel.speed === null || isNaN(pixel.speed)) { pixel.speed = 0 } - if (Math.random() > 0.9995 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + if (Math.random() > 0.995 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) || Math.random() > 0.9995) { changePixel(pixel,"blood_vessel"); } if (!isEmpty(pixel.x, pixel.y-1, true)) { @@ -3796,7 +3784,7 @@ elements.white_blood_cell = { hitPixel.speed += 1 pixel.speed -= 1 } - if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) { + if (elements[hitPixel.element].isBlood === true && Math.random() > 0.25) { if (elements[hitPixel.element].id === elements.infected_vessel.id) { changePixel(hitPixel,"blood_vessel") } @@ -3804,9 +3792,6 @@ elements.white_blood_cell = { if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { hitPixel.heartAttached = true } - if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) { - hitPixel.kidneyAttached = true - } } } if (!isEmpty(pixel.x, pixel.y+1, true)) { @@ -3824,7 +3809,7 @@ elements.white_blood_cell = { hitPixel.speed += 1 pixel.speed -= 1 } - if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) { + if (elements[hitPixel.element].isBlood === true && Math.random() > 0.25) { if (elements[hitPixel.element].id === elements.infected_vessel.id) { changePixel(hitPixel,"blood_vessel") } @@ -3832,9 +3817,6 @@ elements.white_blood_cell = { if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { hitPixel.heartAttached = true } - if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) { - hitPixel.kidneyAttached = true - } } } if (!isEmpty(pixel.x-1, pixel.y, true)) { @@ -3852,7 +3834,7 @@ elements.white_blood_cell = { hitPixel.speed += 1 pixel.speed -= 1 } - if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) { + if (elements[hitPixel.element].isBlood === true && Math.random() > 0.25) { if (elements[hitPixel.element].id === elements.infected_vessel.id) { changePixel(hitPixel,"blood_vessel") } @@ -3860,9 +3842,6 @@ elements.white_blood_cell = { if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { hitPixel.heartAttached = true } - if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) { - hitPixel.kidneyAttached = true - } } } if (!isEmpty(pixel.x+1, pixel.y, true)) { @@ -3880,7 +3859,7 @@ elements.white_blood_cell = { hitPixel.speed += 1 pixel.speed -= 1 } - if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) { + if (elements[hitPixel.element].isBlood === true && Math.random() > 0.25) { if (elements[hitPixel.element].id === elements.infected_vessel.id) { changePixel(hitPixel,"blood_vessel") } @@ -3888,9 +3867,6 @@ elements.white_blood_cell = { if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { hitPixel.heartAttached = true } - if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) { - hitPixel.kidneyAttached = true - } } } }, @@ -3898,7 +3874,6 @@ elements.white_blood_cell = { oxygen: 1000, nutrition: 1000, heartAttached: false, - kidneyAttached: false, }, reactions: { "cancer": { elem2:"flesh", chance:0.10 }, @@ -8810,8 +8785,8 @@ elements.real_bone_marrow = { hitPixel.speed += 1 pixel.speed -= 1 } - if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) { - if (Math.random() > 0.9999 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen) / 2000))) { + if (elements[hitPixel.element].isBlood === true) { + if (Math.random() > 0.999 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2020))) { changePixel(hitPixel,"white_blood_cell"); } } @@ -8832,8 +8807,8 @@ elements.real_bone_marrow = { hitPixel.speed += 1 pixel.speed -= 1 } - if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) { - if (Math.random() > 0.9999 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen) / 2000))) { + if (elements[hitPixel.element].isBlood === true) { + if (Math.random() > 0.999 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2020))) { changePixel(hitPixel,"white_blood_cell"); } } @@ -8854,8 +8829,8 @@ elements.real_bone_marrow = { hitPixel.speed += 1 pixel.speed -= 1 } - if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) { - if (Math.random() > 0.9999 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen) / 2000))) { + if (elements[hitPixel.element].isBlood === true) { + if (Math.random() > 0.999 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2020))) { changePixel(hitPixel,"white_blood_cell"); } } @@ -8876,8 +8851,8 @@ elements.real_bone_marrow = { hitPixel.speed += 1 pixel.speed -= 1 } - if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) { - if (Math.random() > 0.9999 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen) / 2000))) { + if (elements[hitPixel.element].isBlood === true) { + if (Math.random() > 0.999 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2020))) { changePixel(hitPixel,"white_blood_cell"); } } @@ -9814,6 +9789,168 @@ elements.bioplate = { movable: false, } +elements.biocloner = { + color: ["#BE9247","#C09850"], + category: "nervous system", + behavior: behaviors.WALL, + behaviorOn: [ + "XX|BCF|XX", + "BCF|XX|BCF", + "XX|BCF|XX", + ], + hoverStat: function(pixel) { + return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen + }, + tick: function(pixel) { + if ((Math.random() > 0.92 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { + pixel.nutrition-- + pixel.oxygen -- + } + if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { + if (pixel.temp > 95) { + if (Math.random() < 0.75) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"cooked_meat"); + } + } + else if (pixel.temp < -15) { + if (Math.random() < 0.75) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"frozen_meat"); + } + } + else { + if (Math.random() < 0.999) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"rotten_meat"); + } + } + } + if (pixel.nutrition === null || isNaN(pixel.nutrition)) { + pixel.nutrition = 500 + } + if (pixel.oxygen === null || isNaN(pixel.oxygen)) { + pixel.oxygen = 500 + } + if (pixel.speed === null || isNaN(pixel.speed)) { + pixel.speed = 0 + } + if (!isEmpty(pixel.x, pixel.y-1, true)) { + var hitPixel = pixelMap[pixel.x][pixel.y-1] + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (hitPixel.oxygen < pixel.oxygen) { + hitPixel.oxygen += 10 + pixel.oxygen -= 10 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 + } + } + } + if (!isEmpty(pixel.x, pixel.y+1, true)) { + var hitPixel = pixelMap[pixel.x][pixel.y+1] + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (hitPixel.oxygen < pixel.oxygen) { + hitPixel.oxygen += 10 + pixel.oxygen -= 10 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 + } + } + } + if (!isEmpty(pixel.x-1, pixel.y, true)) { + var hitPixel = pixelMap[pixel.x-1][pixel.y] + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (hitPixel.oxygen < pixel.oxygen) { + hitPixel.oxygen += 10 + pixel.oxygen -= 10 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 + } + } + } + if (!isEmpty(pixel.x+1, pixel.y, true)) { + var hitPixel = pixelMap[pixel.x+1][pixel.y] + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (hitPixel.oxygen < pixel.oxygen) { + hitPixel.oxygen += 10 + pixel.oxygen -= 10 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 + } + } + } + doDefaults(pixel) + if (pixel.clone) { return } + for (var i = 0; i < adjacentCoords.length; i++) { + var coords = adjacentCoords[i]; + var x = pixel.x + coords[0]; + var y = pixel.y + coords[1]; + if (!isEmpty(x,y,true)) { + pixel.temp = pixelMap[x][y].temp; + if (pixelMap[x][y].clone) { pixel.clone = pixelMap[x][y].clone; break } + var element = pixelMap[x][y].element; + if (element === pixel.element || elements[pixel.element].ignore.indexOf(element) !== -1 && element !== "fuse") { continue } + pixel.clone = element; + break; + } + } + }, + ignore: ["cloner","slow_cloner","clone_powder","floating_cloner","wire","ewall","sensor","battery","fuse","nerve","flesh"], + ignoreConduct:["fuse"], + density: 2710, + state: "solid", + conduct: 1, + tempHigh: 200, + stateHigh: "cooked_meat", + tempLow: -25, + stateLow: "frozen_meat", + burn: 5, + burnTime: 350, + burnInto: "cooked_meat", + breakInto: ["blood","meat"], + reactions: { + "cancer": { elem1:"cancer", chance:0.0005 }, + "radiation": { elem1:["ash","blood","fat","meat","rotten_meat","cooked_meat"], chance:0.4 }, + }, + properties: { + oxygen: 1000, + nutrition: 1000, + speed: 0, + }, + isBio: true, + movable: false, +} + elements.valve = { color: ["#A9436A","#B64F71"], category: "nervous system", @@ -10143,26 +10280,23 @@ elements.revive = { pixel.burning = false } } - if (elements[pixel.element].id === elements.meat.id || elements[pixel.element].id === elements.rotten_meat.id || elements[pixel.element].id === elements.cured_meat.id || elements[pixel.element].id === elements.cooked_meat.id || elements[pixel.element].id === elements.cancer.id) { + if (elements[pixel.element].id === elements.rotten_meat.id || elements[pixel.element].id === elements.cancer.id) { changePixel(pixel,"flesh"); } - else if (elements[pixel.element].id === elements.bone.id || elements[pixel.element].id === elements.bone_marrow.id || elements[pixel.element].id === elements.quicklime.id) { + else if (elements[pixel.element].id === elements.bone.id) { changePixel(pixel,"real_bone"); } - else if (elements[pixel.element].id === elements.dust.id || elements[pixel.element].id === elements.skin.id) { + else if (elements[pixel.element].id === elements.bone_marrow.id) { + changePixel(pixel,"real_bone_marrow"); + } + else if (elements[pixel.element].id === elements.skin.id) { changePixel(pixel,"epidermis"); } - else if (elements[pixel.element].id === elements.blood.id) { - if (Math.random() < 0.65) { - if (Math.random() < 0.95) { - changePixel(pixel,"blood_vessel"); - } - else {changePixel(pixel,"white_blood_cell"); } + else if (elements[pixel.element].id === elements.infected_vessel.id) { + if (Math.random() < 0.95) { + changePixel(pixel,"blood_vessel"); } - else {changePixel(pixel,"flesh"); } - } - else if (elements[pixel.element].id === elements.infection.id || elements[pixel.element].id === elements.antibody.id) { - changePixel(pixel,"white_blood_cell"); + else {changePixel(pixel,"white_blood_cell"); } } }, canPlace: false, From 10adc9968232dfe621aad7ba11887189eb07f244 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:39:50 -0500 Subject: [PATCH 05/11] the funny pipe portals --- mods/nousersthings.js | 96 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 82 insertions(+), 14 deletions(-) diff --git a/mods/nousersthings.js b/mods/nousersthings.js index 59fa76cb..5a94537c 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -358,14 +358,14 @@ elements.destroyable_pipe = { var y = pixel.y+coord[1]; if (!isEmpty(x,y,true)) { var newPixel = pixelMap[x][y]; - if (newPixel.element === "destroyable_pipe" || newPixel.element === "bridge_pipe") { + if (newPixel.element === "destroyable_pipe" || newPixel.element === "bridge_pipe" || newPixel.element === "pipe_transmitter") { var nextStage; switch (pixel.stage) { case 2: nextStage = 4; break; //green case 3: nextStage = 2; break; //red case 4: nextStage = 3; break; //blue } - if (pixel.con && !newPixel.con && newPixel.stage === nextStage) { //transfer to adjacent pipe + if (pixel.con && !newPixel.con && (newPixel.stage === nextStage || newPixel.element === "pipe_transmitter")) { //transfer to adjacent pipe newPixel.con = pixel.con; newPixel.con.x = newPixel.x; newPixel.con.y = newPixel.y; @@ -669,14 +669,14 @@ elements.e_pipe = { var y = pixel.y+coord[1]; if (!isEmpty(x,y,true)) { var newPixel = pixelMap[x][y]; - if (newPixel.element === "e_pipe" || newPixel.element === "bridge_pipe") { + if (newPixel.element === "e_pipe" || newPixel.element === "bridge_pipe" || newPixel.element === "pipe_transmitter") { var nextStage; switch (pixel.stage) { case 2: nextStage = 4; break; //green case 3: nextStage = 2; break; //red case 4: nextStage = 3; break; //blue } - if (pixel.con && !newPixel.con && newPixel.stage === nextStage && (pixel.charge || pixel.chargeCD)) { //transfer to adjacent pipe + if (pixel.con && !newPixel.con && (newPixel.stage === nextStage || newPixel.element === "pipe_transmitter") && (pixel.charge || pixel.chargeCD)) { //transfer to adjacent pipe newPixel.con = pixel.con; newPixel.con.x = newPixel.x; newPixel.con.y = newPixel.y; @@ -787,14 +787,14 @@ elements.destroyable_e_pipe = { var y = pixel.y+coord[1]; if (!isEmpty(x,y,true)) { var newPixel = pixelMap[x][y]; - if (newPixel.element === "destroyable_e_pipe" || newPixel.element === "bridge_pipe") { + if (newPixel.element === "destroyable_e_pipe" || newPixel.element === "bridge_pipe" || newPixel.element === "pipe_transmitter") { var nextStage; switch (pixel.stage) { case 2: nextStage = 4; break; //green case 3: nextStage = 2; break; //red case 4: nextStage = 3; break; //blue } - if (pixel.con && !newPixel.con && newPixel.stage === nextStage && (pixel.charge || pixel.chargeCD)) { //transfer to adjacent pipe + if (pixel.con && !newPixel.con && (newPixel.stage === nextStage || newPixel.element === "pipe_transmitter") && (pixel.charge || pixel.chargeCD)) { //transfer to adjacent pipe newPixel.con = pixel.con; newPixel.con.x = newPixel.x; newPixel.con.y = newPixel.y; @@ -914,14 +914,14 @@ elements.channel_pipe = { var y = pixel.y+coord[1]; if (!isEmpty(x,y,true)) { var newPixel = pixelMap[x][y]; - if ((newPixel.element === "channel_pipe" && pixelMap[x][y].channel == pixel.channel || newPixel.element === "bridge_pipe")) { + if ((newPixel.element === "channel_pipe" && pixelMap[x][y].channel == pixel.channel || newPixel.element === "bridge_pipe" || (newPixel.element === "pipe_transmitter" && pixelMap[x][y].channel == pixel.channel))) { var nextStage; switch (pixel.stage) { case 2: nextStage = 4; break; //green case 3: nextStage = 2; break; //red case 4: nextStage = 3; break; //blue } - if (pixel.con && !newPixel.con && newPixel.stage === nextStage) { //transfer to adjacent pipe + if (pixel.con && !newPixel.con && (newPixel.stage === nextStage || newPixel.element === "pipe_transmitter")) { //transfer to adjacent pipe newPixel.con = pixel.con; newPixel.con.x = newPixel.x; newPixel.con.y = newPixel.y; @@ -1037,14 +1037,14 @@ elements.destroyable_channel_pipe = { var y = pixel.y+coord[1]; if (!isEmpty(x,y,true)) { var newPixel = pixelMap[x][y]; - if ((newPixel.element === "destroyable_channel_pipe" && pixelMap[x][y].channel == pixel.channel) || newPixel.element === "bridge_pipe") { + if ((newPixel.element === "destroyable_channel_pipe" && pixelMap[x][y].channel == pixel.channel) || newPixel.element === "bridge_pipe" || (newPixel.element === "pipe_transmitter" && pixelMap[x][y].channel == pixel.channel)) { var nextStage; switch (pixel.stage) { case 2: nextStage = 4; break; //green case 3: nextStage = 2; break; //red case 4: nextStage = 3; break; //blue } - if (pixel.con && !newPixel.con && newPixel.stage === nextStage) { //transfer to adjacent pipe + if (pixel.con && !newPixel.con && (newPixel.stage === nextStage || newPixel.element === "pipe_transmitter")) { //transfer to adjacent pipe newPixel.con = pixel.con; newPixel.con.x = newPixel.x; newPixel.con.y = newPixel.y; @@ -1097,7 +1097,7 @@ elements.destroyable_channel_pipe = { movable: false, canContain: true, }, -listPipes = ["pipe", "destroyable_pipe", "destroyable_e_pipe","channel_pipe","destroyable_channel_pipe","bridge_pipe","e_pipe"]; +listPipes = ["pipe", "destroyable_pipe", "destroyable_e_pipe","channel_pipe","destroyable_channel_pipe","bridge_pipe","e_pipe","pipe_transmitter"]; elements.bridge_pipe = { color: "#414c4f", onSelect: function() { @@ -1161,7 +1161,7 @@ elements.bridge_pipe = { case 3: nextStage = 2; break; //red case 4: nextStage = 3; break; //blue } - if (pixel.con && !newPixel.con && newPixel.stage === nextStage) { //transfer to adjacent pipe + if (pixel.con && !newPixel.con && (newPixel.stage === nextStage || newPixel.element === "pipe_transmitter")) { //transfer to adjacent pipe newPixel.con = pixel.con; newPixel.con.x = newPixel.x; newPixel.con.y = newPixel.y; @@ -1266,14 +1266,14 @@ elements.pipe.tick = function(pixel) { var y = pixel.y+coord[1]; if (!isEmpty(x,y,true)) { var newPixel = pixelMap[x][y]; - if (newPixel.element === "pipe" || newPixel.element === "bridge_pipe") { + if (newPixel.element === "pipe" || newPixel.element === "bridge_pipe" || newPixel.element === "pipe_transmitter") { var nextStage; switch (pixel.stage) { case 2: nextStage = 4; break; //green case 3: nextStage = 2; break; //red case 4: nextStage = 3; break; //blue } - if (pixel.con && !newPixel.con && newPixel.stage === nextStage) { //transfer to adjacent pipe + if (pixel.con && !newPixel.con && (newPixel.stage === nextStage || newPixel.element === "pipe_transmitter")) { //transfer to adjacent pipe newPixel.con = pixel.con; newPixel.con.x = newPixel.x; newPixel.con.y = newPixel.y; @@ -3759,4 +3759,72 @@ elements.hotter_sensor = { } } } +} +let pipe_transmitter_channelVar = 0; +elements.pipe_transmitter = { + color: "#6e6250", + category: "machines", + movable: false, + canContain: true, + insulate: true, + onSelect: () => { + let newChannel = prompt("Enter the channel of this pipe transmitter. It will not work if you do multiple while paused.", pipe_transmitter_channelVar); + pipe_transmitter_channelVar = newChannel; + }, + tick: (pixel) => { + if (!pixel.channel){ + pixel.channel = pipe_transmitter_channelVar; + } + if (pixel.channel && pixel.con){ + for (x in pixelMap){ + for (y in pixelMap[x]){ + if (!isEmpty(x, y, true)){ + if (pixelMap[x][y].element == "pipe_receiver" && pixelMap[x][y].channel == pixel.channel){ + pixelMap[x][y].con = pixel.con; + delete pixel.con; + } + } + } + } + } + } +} +let pipe_receiver_channelVar = 0; +elements.pipe_receiver = { + color: "#4d4b63", + category: "machines", + movable: false, + canContain: true, + insulate: true, + onSelect: () => { + let newChannel = prompt("Enter the channel of this pipe receiver. It will not work if you do multiple while paused.", pipe_receiver_channelVar); + pipe_receiver_channelVar = newChannel; + }, + tick: (pixel) => { + if (!pixel.channel){ + pixel.channel = pipe_receiver_channelVar; + } + if (pixel.channel && pixel.con){ + // just scan neighbors for elements on the pipe list; transfer con to them. if its a type of channel pipe, also check if channel matches + for (i = 0; i < squareCoords.length; i++){ + let x = squareCoords[i][0] + pixel.x; + let y = squareCoords[i][1] + pixel.y; + if (!isEmpty(x, y, true)){ + if (listPipes.includes(pixelMap[x][y].element)){ + if (["channel_pipe", "destroyable_channel_pipe"].includes(pixelMap[x][y].element)){ + if (pixelMap[x][y].channel == pixel.channel){ + pixelMap[x][y].con = pixel.con; + delete pixel.con; + } + } else { + pixel.con.x = x; + pixel.con.y = y; + pixelMap[x][y].con = pixel.con; + delete pixel.con; + } + } + } + } + } + } } \ No newline at end of file From 431cecb711a36a6a41f9126b3d1cf9463d0ae4dd Mon Sep 17 00:00:00 2001 From: redbirdly <155550833+redbirdly@users.noreply.github.com> Date: Tue, 31 Dec 2024 15:01:40 +0800 Subject: [PATCH 06/11] Update mod-list.html --- mod-list.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mod-list.html b/mod-list.html index d683e72f..41153a67 100644 --- a/mod-list.html +++ b/mod-list.html @@ -217,6 +217,7 @@

Sandboxels Mod List

the_ground.jsAdds several rock types, worldgen settings, and gemstonesAlice Machines & Technology +circuitcore.jsAn extension to logicgates.js that adds advanced circuits. Documentation.RedBirdly clone_liquid.jsAdds a liquid form of clonerAlice colored_lightbulbs.jsAdds a light bulb that can be painted.guzzo86, ggod combustion.jsAdds components necessary for combustion enginesuptzik @@ -293,6 +294,7 @@

Sandboxels Mod List

human_edit.jsImprovements to humansAlice Humanitize.jsMakes humans cultured and able to craft, mine, build houses, trade, and much more.Nekonico kopalstuff.jsAdds creatures, spirits, DNA, foods, and moreDaviStudios +lizard_mod.jsAdds lizards to sandboxels.RedBirdly lost_souls.jsAdds souls and related elements, the mod can also be found on Githubpixelegend4, SquareScreamYT, salmonfishy miscible_psoup_and_birthpool.jsMakes Primordial Soup and Birthpool mix instead of the birthpool settling to the bottom. Will be deprecated upon the release of Magical MenagerieAlice mobs.jsAdds Creepers, Zombies, and SkeletonsAlice From 41a43bed2a4acaaeee7626c8149df1132426b34d Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Tue, 31 Dec 2024 12:02:31 -0500 Subject: [PATCH 07/11] oopsies --- mods/fractals.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/fractals.js b/mods/fractals.js index b2b7279f..eec2964f 100644 --- a/mods/fractals.js +++ b/mods/fractals.js @@ -89,7 +89,7 @@ elements.mandelbrot = { } } */ - iteration = gridWeightedAverage(pixel.x, pixel.y) + iteration = preCalculatedGrid[pixel.x][pixel.y].iteration if (iteration >= 99.5) { pixel.color = "rgb(255, 255, 255)" } else { From 38d5f33b9a273ebe59a1aac208fe98486f46b923 Mon Sep 17 00:00:00 2001 From: Suss <167750109+therealsuss@users.noreply.github.com> Date: Wed, 1 Jan 2025 16:33:09 +1100 Subject: [PATCH 08/11] Create lattice_filler.js --- mods/lattice_filler.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 mods/lattice_filler.js diff --git a/mods/lattice_filler.js b/mods/lattice_filler.js new file mode 100644 index 00000000..f38f5ef1 --- /dev/null +++ b/mods/lattice_filler.js @@ -0,0 +1,29 @@ +elements.lattice_filler = { + behavior: [ + "XX|CL|XX", + "CL|DL|CL", + "XX|CL|XX", + ], + category: "special", + state: "solid", + density: 1834, + color: "#ff266e", + reactions: { + "lightning": {elem1: "destructive_lattice_filler", elem2: null} + } +}; + +elements.destructive_lattice_filler = { + behavior: [ + "DL|CL|DL", + "CL|DL|CL", + "DL|CL|DL", + ], + category: "special", + state: "solid", + density: 1834, + color: "#ff0037", + hidden: true, +}; + +elements.filler.reactions.laser = { "elem1":"lattice_filler", "elem2": "lattice_filler" } From cac0b1c7a2c45a5ba965f31d0bdb5834dfe9604c Mon Sep 17 00:00:00 2001 From: Suss <167750109+therealsuss@users.noreply.github.com> Date: Wed, 1 Jan 2025 16:34:38 +1100 Subject: [PATCH 09/11] Delete mods/lattice_filler.js --- mods/lattice_filler.js | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 mods/lattice_filler.js diff --git a/mods/lattice_filler.js b/mods/lattice_filler.js deleted file mode 100644 index f38f5ef1..00000000 --- a/mods/lattice_filler.js +++ /dev/null @@ -1,29 +0,0 @@ -elements.lattice_filler = { - behavior: [ - "XX|CL|XX", - "CL|DL|CL", - "XX|CL|XX", - ], - category: "special", - state: "solid", - density: 1834, - color: "#ff266e", - reactions: { - "lightning": {elem1: "destructive_lattice_filler", elem2: null} - } -}; - -elements.destructive_lattice_filler = { - behavior: [ - "DL|CL|DL", - "CL|DL|CL", - "DL|CL|DL", - ], - category: "special", - state: "solid", - density: 1834, - color: "#ff0037", - hidden: true, -}; - -elements.filler.reactions.laser = { "elem1":"lattice_filler", "elem2": "lattice_filler" } From 2f6ed1d56b3fb902c6b965388673e6dd22fcd156 Mon Sep 17 00:00:00 2001 From: Suss <167750109+therealsuss@users.noreply.github.com> Date: Wed, 1 Jan 2025 16:44:00 +1100 Subject: [PATCH 10/11] lattice filler thingy --- mods/lattice_filler.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 mods/lattice_filler.js diff --git a/mods/lattice_filler.js b/mods/lattice_filler.js new file mode 100644 index 00000000..e1c69f71 --- /dev/null +++ b/mods/lattice_filler.js @@ -0,0 +1,29 @@ +elements.lattice_filler = { + behavior: [ + "XX|CL|XX", + "CL|DL|CL", + "XX|CL|XX", + ], + category: "special", + state: "solid", + density: 1834, + color: "#ff266e", + reactions: { + "lightning": {elem1: "destructive_lattice_filler", elem2: null} + } +}; + +elements.destructive_lattice_filler = { + behavior: [ + "DL|CL|DL", + "CL|DL|CL", + "DL|CL|DL", + ], + category: "special", + state: "solid", + density: 1834, + color: "#ff0037", + hidden: true, +}; + +elements.filler.reactions.laser = { "elem1":"lattice_filler", "elem2": "lattice_filler" } \ No newline at end of file From c89c71add220fd18bf201fbf39ec1613d72701c9 Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:06:28 -0800 Subject: [PATCH 11/11] Nerve trimming and cartilage --- mods/biology.js | 1181 +++++++++++++++++++++++++++-------------------- 1 file changed, 684 insertions(+), 497 deletions(-) diff --git a/mods/biology.js b/mods/biology.js index 149f4b20..ac78d0f3 100644 --- a/mods/biology.js +++ b/mods/biology.js @@ -70,7 +70,8 @@ behaviorRules.BCF = function() { if (btemp.pixel.clone) { if (isEmpty(btemp.newCoords.x, btemp.newCoords.y)) { createPixel(btemp.pixel.clone, btemp.newCoords.x, btemp.newCoords.y) - btemp.pixel.nutrition = (btemp.pixel.nutrition - 1) + btemp.pixel.nutrition = (btemp.pixel.nutrition - 10) + btemp.pixel.oxygen = (btemp.pixel.oxygen - 1) if (pixelMap[btemp.newCoords.x][btemp.newCoords.y]) { pixelMap[btemp.newCoords.x][btemp.newCoords.y].temp = btemp.pixel.temp; pixelTempCheck(pixelMap[btemp.newCoords.x][btemp.newCoords.y]); @@ -93,7 +94,27 @@ behaviorRules.BCF = function() { } } } - }, +} + +behaviorRules.BCR = function() { + if (isEmpty(btemp.newCoords.x,btemp.newCoords.y)) { + if (btemp.arg == null) { + btemp.arg = btemp.pixel.element; + } + else if (btemp.arg.indexOf(",") !== -1) { + btemp.arg = choose(btemp.arg.split(",")); + } + if (elements[btemp.arg]) { + createPixel(btemp.arg,btemp.newCoords.x,btemp.newCoords.y); + btemp.pixel.nutrition = (btemp.pixel.nutrition - 1) + if (btemp.info.fireColor && btemp.arg==="fire") { + pixelMap[btemp.newCoords.x][btemp.newCoords.y].color = pixelColorPick(pixelMap[btemp.newCoords.x][btemp.newCoords.y],btemp.info.fireColor); + } + pixelMap[btemp.newCoords.x][btemp.newCoords.y].temp = btemp.pixel.temp + pixelTempCheck(pixelMap[btemp.newCoords.x][btemp.newCoords.y]); + } + } +} elements.flesh = { color: ["#9e4839","#ba6449"], @@ -409,6 +430,10 @@ elements.dermis = { var y = pixel.y + coords[1]; if (isEmpty(x,y)) { createPixel("epidermis",x,y); + pixelMap[x][y].nutrition = (Math.round(pixel.nutrition / 2)) + pixelMap[x][y].oxygen = (Math.round(pixel.oxygen / 2)) + pixel.nutrition = (Math.round(pixel.nutrition / 2)) + pixel.oxygen = (Math.round(pixel.oxygen / 2)) } } } @@ -751,6 +776,10 @@ elements.cloak_dermis = { var y = pixel.y + coords[1]; if (isEmpty(x,y)) { createPixel("cloak_skin",x,y); + pixelMap[x][y].nutrition = (Math.round(pixel.nutrition / 2)) + pixelMap[x][y].oxygen = (Math.round(pixel.oxygen / 2)) + pixel.nutrition = (Math.round(pixel.nutrition / 2)) + pixel.oxygen = (Math.round(pixel.oxygen / 2)) } } } @@ -1361,9 +1390,17 @@ elements.hair_dermis = { if (isEmpty(x,y)) { if (Math.random() > 0.05) { createPixel("hairy_skin",x,y); + pixelMap[x][y].nutrition = (Math.round(pixel.nutrition / 2)) + pixelMap[x][y].oxygen = (Math.round(pixel.oxygen / 2)) + pixel.nutrition = (Math.round(pixel.nutrition / 2)) + pixel.oxygen = (Math.round(pixel.oxygen / 2)) } else { createPixel("epidermis",x,y); + pixelMap[x][y].nutrition = (Math.round(pixel.nutrition / 2)) + pixelMap[x][y].oxygen = (Math.round(pixel.oxygen / 2)) + pixel.nutrition = (Math.round(pixel.nutrition / 2)) + pixel.oxygen = (Math.round(pixel.oxygen / 2)) } } } @@ -1660,6 +1697,10 @@ elements.scale_dermis = { var y = pixel.y + coords[1]; if (isEmpty(x,y)) { createPixel("scales",x,y); + pixelMap[x][y].nutrition = (Math.round(pixel.nutrition / 2)) + pixelMap[x][y].oxygen = (Math.round(pixel.oxygen / 2)) + pixel.nutrition = (Math.round(pixel.nutrition / 2)) + pixel.oxygen = (Math.round(pixel.oxygen / 2)) } } } @@ -1812,6 +1853,10 @@ elements.bug_dermis = { var y = pixel.y + coords[1]; if (isEmpty(x,y)) { createPixel("exoskeleton",x,y); + pixelMap[x][y].nutrition = (Math.round(pixel.nutrition / 2)) + pixelMap[x][y].oxygen = (Math.round(pixel.oxygen / 2)) + pixel.nutrition = (Math.round(pixel.nutrition / 2)) + pixel.oxygen = (Math.round(pixel.oxygen / 2)) } } } @@ -1951,7 +1996,6 @@ elements.bug_dermis = { elements.amphib_dermis = { color: "#9DAB6A", - name: "amphibian_dermis", category: "structural", behavior: behaviors.WALL, hoverStat: function(pixel) { @@ -1965,6 +2009,10 @@ elements.amphib_dermis = { var y = pixel.y + coords[1]; if (isEmpty(x,y)) { createPixel("amphib_skin",x,y); + pixelMap[x][y].nutrition = (Math.round(pixel.nutrition - ((pixel.nutrition / 4) * 3))) + pixelMap[x][y].oxygen = (Math.round(pixel.oxygen - ((pixel.oxygen / 4) * 3))) + pixel.nutrition = (Math.round(pixel.nutrition - (pixel.nutrition / 4))) + pixel.oxygen = (Math.round(pixel.oxygen - (pixel.oxygen / 4))) } } } @@ -3722,6 +3770,9 @@ elements.infected_vessel = { nutrition: 1000, heartAttached: false, }, + reactions: { + "bless": { elem1:"blood_vessel" }, + }, tempHigh: 175, stateHigh: "meat", tempLow: -50, @@ -3939,7 +3990,7 @@ elements.eye = { pixel.saw = false hitPixel.saw = true } - else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + else if (pixel.saw === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { if (!hitPixel.charge) { hitPixel.charge = 0.1 } @@ -3973,7 +4024,7 @@ elements.eye = { pixel.saw = false hitPixel.saw = true } - else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + else if (pixel.saw === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { if (!hitPixel.charge) { hitPixel.charge = 0.1 } @@ -4007,7 +4058,7 @@ elements.eye = { pixel.saw = false hitPixel.saw = true } - else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + else if (pixel.saw === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { if (!hitPixel.charge) { hitPixel.charge = 0.1 } @@ -4041,7 +4092,7 @@ elements.eye = { pixel.saw = false hitPixel.saw = true } - else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + else if (pixel.saw === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { if (!hitPixel.charge) { hitPixel.charge = 0.1 } @@ -4139,7 +4190,7 @@ elements.olfactory_bulb = { pixel.smell = false hitpixel.smell = true } - else if (pixel.smell === true && elements[hitPixel.element].id === elements.bulb_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + else if (pixel.smell === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { if (!hitPixel.charge) { hitPixel.charge = 0.1 } @@ -4176,7 +4227,7 @@ elements.olfactory_bulb = { pixel.smell = false hitpixel.smell = true } - else if (pixel.smell === true && elements[hitPixel.element].id === elements.bulb_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + else if (pixel.smell === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { if (!hitPixel.charge) { hitPixel.charge = 0.1 } @@ -4213,7 +4264,7 @@ elements.olfactory_bulb = { pixel.smell = false hitpixel.smell = true } - else if (pixel.smell === true && elements[hitPixel.element].id === elements.bulb_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + else if (pixel.smell === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { if (!hitPixel.charge) { hitPixel.charge = 0.1 } @@ -4250,7 +4301,7 @@ elements.olfactory_bulb = { pixel.smell = false hitpixel.smell = true } - else if (pixel.smell === true && elements[hitPixel.element].id === elements.bulb_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + else if (pixel.smell === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { if (!hitPixel.charge) { hitPixel.charge = 0.1 } @@ -4614,7 +4665,7 @@ elements.amygdala = { // please please please ignore that i callled it the amygd movable: false, } -elements.eye_nerve = { +elements.nerve = { color: "#B33E93", category: "nervous system", behavior: behaviors.WALL, @@ -4756,16 +4807,19 @@ elements.eye_nerve = { movable: false, } -elements.bulb_nerve = { - color: "#B33E93", - category: "nervous system", - behavior: behaviors.WALL, +elements.throat_lining = { + color: "#bc6157", + category: "nutrition", + behavior: [ + "XX|DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5|XX", + "DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5|XX|DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5", + "XX|DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5|XX", + ], hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - doDefaults(pixel); - if ((Math.random() > 0.895 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { + if ((Math.random() > 0.9 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { pixel.nutrition-- pixel.oxygen -= 2 } @@ -4875,7 +4929,7 @@ elements.bulb_nerve = { }, density: 2710, state: "solid", - conduct: 1, + conduct: .001, tempHigh: 200, stateHigh: "cooked_meat", tempLow: -25, @@ -4887,7 +4941,7 @@ elements.bulb_nerve = { forceSaveColor: true, reactions: { "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, + "radiation": { elem1:["ash","slime","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, }, properties: { oxygen: 1000, @@ -4898,17 +4952,15 @@ elements.bulb_nerve = { movable: false, } - -elements.nerve = { - color: "#B33E93", - category: "nervous system", +elements.intestines = { + color: "#bc6157", + category: "nutrition", behavior: behaviors.WALL, - hoverStat: function(pixel) { + hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - doDefaults(pixel); - if ((Math.random() > 0.895 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { + if ((Math.random() > 0.9 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { pixel.nutrition-- pixel.oxygen -= 2 } @@ -4947,9 +4999,28 @@ elements.nerve = { if (pixel.speed === null || isNaN(pixel.speed)) { pixel.speed = 0 } - if (!isEmpty(pixel.x, pixel.y-1, true)) { + if (!isEmpty(pixel.x, pixel.y-1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y-1] - if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.99) { + if (Math.random() > 0.5) { + changePixel(hitPixel,"poop"); + } + else { + changePixel(hitPixel,"stench"); + } + pixel.nutrition += hitPixel.nutrition; + hitPixel.nutrition = 0; + pixel.speed += hitPixel.speed; + hitPixel.speed = 0; + } + else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) { + changePixel(hitPixel,"stench"); + pixel.nutrition += hitPixel.nutrition; + hitPixel.nutrition = 0; + pixel.speed += hitPixel.speed; + hitPixel.speed = 0; + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -4966,7 +5037,26 @@ elements.nerve = { } if (!isEmpty(pixel.x, pixel.y+1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y+1] - if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.99) { + if (Math.random() > 0.5) { + changePixel(hitPixel,"poop"); + } + else { + changePixel(hitPixel,"stench"); + } + pixel.nutrition += hitPixel.nutrition; + hitPixel.nutrition = 0; + pixel.speed += hitPixel.speed; + hitPixel.speed = 0; + } + else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) { + changePixel(hitPixel,"stench"); + pixel.nutrition += hitPixel.nutrition; + hitPixel.nutrition = 0; + pixel.speed += hitPixel.speed; + hitPixel.speed = 0; + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -4983,7 +5073,24 @@ elements.nerve = { } if (!isEmpty(pixel.x-1, pixel.y, true)) { var hitPixel = pixelMap[pixel.x-1][pixel.y] - if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.99) { + if (Math.random() > 0.5) { + changePixel(hitPixel,"poop"); + } + else { + changePixel(hitPixel,"stench"); + } + pixel.nutrition += hitPixel.nutrition; + hitPixel.nutrition = 0; + pixel.speed += hitPixel.speed; + hitPixel.speed = 0; + } + else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) { + changePixel(hitPixel,"stench"); + pixel.nutrition += hitPixel.nutrition; + hitPixel.nutrition = 0; + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5000,7 +5107,26 @@ elements.nerve = { } if (!isEmpty(pixel.x+1, pixel.y, true)) { var hitPixel = pixelMap[pixel.x+1][pixel.y] - if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.99) { + if (Math.random() > 0.5) { + changePixel(hitPixel,"poop"); + } + else { + changePixel(hitPixel,"stench"); + } + pixel.nutrition += hitPixel.nutrition; + hitPixel.nutrition = 0; + pixel.speed += hitPixel.speed; + hitPixel.speed = 0; + } + else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) { + changePixel(hitPixel,"stench"); + pixel.nutrition += hitPixel.nutrition; + hitPixel.nutrition = 0; + pixel.speed += hitPixel.speed; + hitPixel.speed = 0; + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5018,7 +5144,7 @@ elements.nerve = { }, density: 2710, state: "solid", - conduct: 1, + conduct: .001, tempHigh: 200, stateHigh: "cooked_meat", tempLow: -25, @@ -5030,57 +5156,65 @@ elements.nerve = { forceSaveColor: true, reactions: { "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, + "radiation": { elem1:["ash","steam","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, }, properties: { oxygen: 1000, nutrition: 1000, speed: 0, }, - isBio: true, movable: false, + isBio: true } -elements.throat_lining = { - color: "#bc6157", +elements.appendix = { + color: "#B45942", category: "nutrition", - behavior: [ - "XX|DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5|XX", - "DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5|XX|DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5", - "XX|DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5|XX", - ], - hoverStat: function(pixel) { + behavior: behaviors.WALL, + hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { if ((Math.random() > 0.9 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { pixel.nutrition-- pixel.oxygen -= 2 + if (Math.random() > 0.999 && (pixel.nutrition < 750 || pixel.oxygen < 500)) { + changePixel(pixel,"stomach_acid"); + } } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { if (pixel.temp > 95) { if (Math.random() < 0.75) { changePixel(pixel,"meat"); } - else { + else if (Math.random() < 0.75) { changePixel(pixel,"cooked_meat"); } + else { + changePixel(pixel,"stomach_acid"); + } } else if (pixel.temp < -15) { if (Math.random() < 0.75) { changePixel(pixel,"meat"); } - else { + else if (Math.random() < 0.75) { changePixel(pixel,"frozen_meat"); } + else { + changePixel(pixel,"stomach_acid"); + } } else { if (Math.random() < 0.999) { changePixel(pixel,"meat"); } - else { + else if (Math.random() < 0.75) { changePixel(pixel,"rotten_meat"); } + else { + changePixel(pixel,"stomach_acid"); + } } } if (pixel.nutrition === null || isNaN(pixel.nutrition)) { @@ -5089,12 +5223,19 @@ elements.throat_lining = { if (pixel.oxygen === null || isNaN(pixel.oxygen)) { pixel.oxygen = 500 } - if (pixel.l || isNaN(pixel.speed)) { + if (pixel.speed === null || isNaN(pixel.speed)) { pixel.speed = 0 } - if (!isEmpty(pixel.x, pixel.y-1, true)) { + if (!isEmpty(pixel.x, pixel.y-1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y-1] - if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.999) { + changePixel(hitPixel,"poop"); + pixel.nutrition += hitPixel.nutrition + if (Math.random() > 0.99) { + changePixel(pixel,"stomach_acid"); + } + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5111,7 +5252,14 @@ elements.throat_lining = { } if (!isEmpty(pixel.x, pixel.y+1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y+1] - if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.999) { + changePixel(hitPixel,"poop"); + pixel.nutrition += hitPixel.nutrition + if (Math.random() > 0.99) { + changePixel(pixel,"stomach_acid"); + } + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5128,7 +5276,14 @@ elements.throat_lining = { } if (!isEmpty(pixel.x-1, pixel.y, true)) { var hitPixel = pixelMap[pixel.x-1][pixel.y] - if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.999) { + changePixel(hitPixel,"poop"); + pixel.nutrition += hitPixel.nutrition + if (Math.random() > 0.99) { + changePixel(pixel,"stomach_acid"); + } + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5145,7 +5300,14 @@ elements.throat_lining = { } if (!isEmpty(pixel.x+1, pixel.y, true)) { var hitPixel = pixelMap[pixel.x+1][pixel.y] - if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.999) { + changePixel(hitPixel,"poop"); + pixel.nutrition += hitPixel.nutrition + if (Math.random() > 0.90) { + changePixel(pixel,"stomach_acid"); + } + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5171,29 +5333,36 @@ elements.throat_lining = { burn: 5, burnTime: 350, burnInto: "cooked_meat", - breakInto: ["blood","meat"], + breakInto: ["stomach_acid","blood","meat"], forceSaveColor: true, reactions: { "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","slime","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, + "radiation": { elem1:["ash","steam","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, }, properties: { oxygen: 1000, nutrition: 1000, speed: 0, }, - isBio: true, movable: false, + isBio: true } -elements.intestines = { - color: "#bc6157", - category: "nutrition", +elements.simple_lung = { + color: "#EB85D9", + category: "oxygen", behavior: behaviors.WALL, hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { + 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)) { + if (Math.random() < 0.01) { pixel.oxygen += 100 } + break + } } if ((Math.random() > 0.9 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { pixel.nutrition-- pixel.oxygen -= 2 @@ -5235,26 +5404,7 @@ elements.intestines = { } if (!isEmpty(pixel.x, pixel.y-1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y-1] - if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.99) { - if (Math.random() > 0.5) { - changePixel(hitPixel,"poop"); - } - else { - changePixel(hitPixel,"stench"); - } - pixel.nutrition += hitPixel.nutrition; - hitPixel.nutrition = 0; - pixel.speed += hitPixel.speed; - hitPixel.speed = 0; - } - else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) { - changePixel(hitPixel,"stench"); - pixel.nutrition += hitPixel.nutrition; - hitPixel.nutrition = 0; - pixel.speed += hitPixel.speed; - hitPixel.speed = 0; - } - else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5268,208 +5418,16 @@ elements.intestines = { pixel.speed -= 1 } } + else if ((elements[hitPixel.element].id === elements.chlorine.id || elements[hitPixel.element].id === elements.poison_gas.id || elements[hitPixel.element].id === elements.acid_gas.id || elements[hitPixel.element].id === elements.cyanide_gas.id || elements[hitPixel.element].id === elements.dioxin.id) && Math.random() > 0.5) { + pixel.smell = true + deletePixel(hitPixel.x,hitPixel.y) + pixel.oxygen -= 50 + pixel.nutrition -= 50 + } } if (!isEmpty(pixel.x, pixel.y+1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y+1] - if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.99) { - if (Math.random() > 0.5) { - changePixel(hitPixel,"poop"); - } - else { - changePixel(hitPixel,"stench"); - } - pixel.nutrition += hitPixel.nutrition; - hitPixel.nutrition = 0; - pixel.speed += hitPixel.speed; - hitPixel.speed = 0; - } - else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) { - changePixel(hitPixel,"stench"); - pixel.nutrition += hitPixel.nutrition; - hitPixel.nutrition = 0; - pixel.speed += hitPixel.speed; - hitPixel.speed = 0; - } - else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { - if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 10 - pixel.oxygen -= 10 - } - if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 - } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 - } - } - } - if (!isEmpty(pixel.x-1, pixel.y, true)) { - var hitPixel = pixelMap[pixel.x-1][pixel.y] - if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.99) { - if (Math.random() > 0.5) { - changePixel(hitPixel,"poop"); - } - else { - changePixel(hitPixel,"stench"); - } - pixel.nutrition += hitPixel.nutrition; - hitPixel.nutrition = 0; - pixel.speed += hitPixel.speed; - hitPixel.speed = 0; - } - else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) { - changePixel(hitPixel,"stench"); - pixel.nutrition += hitPixel.nutrition; - hitPixel.nutrition = 0; - } - else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { - if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 10 - pixel.oxygen -= 10 - } - if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 - } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 - } - } - } - if (!isEmpty(pixel.x+1, pixel.y, true)) { - var hitPixel = pixelMap[pixel.x+1][pixel.y] - if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.99) { - if (Math.random() > 0.5) { - changePixel(hitPixel,"poop"); - } - else { - changePixel(hitPixel,"stench"); - } - pixel.nutrition += hitPixel.nutrition; - hitPixel.nutrition = 0; - pixel.speed += hitPixel.speed; - hitPixel.speed = 0; - } - else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) { - changePixel(hitPixel,"stench"); - pixel.nutrition += hitPixel.nutrition; - hitPixel.nutrition = 0; - pixel.speed += hitPixel.speed; - hitPixel.speed = 0; - } - else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { - if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 10 - pixel.oxygen -= 10 - } - if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 - } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 - } - } - } - }, - density: 2710, - state: "solid", - conduct: .001, - tempHigh: 200, - stateHigh: "cooked_meat", - tempLow: -25, - stateLow: "frozen_meat", - burn: 5, - burnTime: 350, - burnInto: "cooked_meat", - breakInto: ["blood","meat"], - forceSaveColor: true, - reactions: { - "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","steam","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, - }, - properties: { - oxygen: 1000, - nutrition: 1000, - speed: 0, - }, - movable: false, - isBio: true -} - -elements.appendix = { - color: "#B45942", - category: "nutrition", - behavior: behaviors.WALL, - hoverStat: function(pixel) { - return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen - }, - tick: function(pixel) { - if ((Math.random() > 0.9 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { - pixel.nutrition-- - pixel.oxygen -= 2 - if (Math.random() > 0.999 && (pixel.nutrition < 750 || pixel.oxygen < 500)) { - changePixel(pixel,"stomach_acid"); - } - } - if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { - if (pixel.temp > 95) { - if (Math.random() < 0.75) { - changePixel(pixel,"meat"); - } - else if (Math.random() < 0.75) { - changePixel(pixel,"cooked_meat"); - } - else { - changePixel(pixel,"stomach_acid"); - } - } - else if (pixel.temp < -15) { - if (Math.random() < 0.75) { - changePixel(pixel,"meat"); - } - else if (Math.random() < 0.75) { - changePixel(pixel,"frozen_meat"); - } - else { - changePixel(pixel,"stomach_acid"); - } - } - else { - if (Math.random() < 0.999) { - changePixel(pixel,"meat"); - } - else if (Math.random() < 0.75) { - changePixel(pixel,"rotten_meat"); - } - else { - changePixel(pixel,"stomach_acid"); - } - } - } - if (pixel.nutrition === null || isNaN(pixel.nutrition)) { - pixel.nutrition = 500 - } - if (pixel.oxygen === null || isNaN(pixel.oxygen)) { - pixel.oxygen = 500 - } - if (pixel.speed === null || isNaN(pixel.speed)) { - pixel.speed = 0 - } - if (!isEmpty(pixel.x, pixel.y-1, true)) { - var hitPixel = pixelMap[pixel.x][pixel.y-1] - if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.999) { - changePixel(hitPixel,"poop"); - pixel.nutrition += hitPixel.nutrition - if (Math.random() > 0.99) { - changePixel(pixel,"stomach_acid"); - } - } - else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5483,41 +5441,16 @@ elements.appendix = { pixel.speed -= 1 } } - } - if (!isEmpty(pixel.x, pixel.y+1, true)) { - var hitPixel = pixelMap[pixel.x][pixel.y+1] - if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.999) { - changePixel(hitPixel,"poop"); - pixel.nutrition += hitPixel.nutrition - if (Math.random() > 0.99) { - changePixel(pixel,"stomach_acid"); - } - } - else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { - if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 10 - pixel.oxygen -= 10 - } - if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 - } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 - } + else if ((elements[hitPixel.element].id === elements.chlorine.id || elements[hitPixel.element].id === elements.poison_gas.id || elements[hitPixel.element].id === elements.acid_gas.id || elements[hitPixel.element].id === elements.cyanide_gas.id || elements[hitPixel.element].id === elements.dioxin.id) && Math.random() > 0.5) { + pixel.smell = true + deletePixel(hitPixel.x,hitPixel.y) + pixel.oxygen -= 50 + pixel.nutrition -= 50 } } if (!isEmpty(pixel.x-1, pixel.y, true)) { var hitPixel = pixelMap[pixel.x-1][pixel.y] - if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.999) { - changePixel(hitPixel,"poop"); - pixel.nutrition += hitPixel.nutrition - if (Math.random() > 0.99) { - changePixel(pixel,"stomach_acid"); - } - } - else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5531,17 +5464,16 @@ elements.appendix = { pixel.speed -= 1 } } + else if ((elements[hitPixel.element].id === elements.chlorine.id || elements[hitPixel.element].id === elements.poison_gas.id || elements[hitPixel.element].id === elements.acid_gas.id || elements[hitPixel.element].id === elements.cyanide_gas.id || elements[hitPixel.element].id === elements.dioxin.id) && Math.random() > 0.5) { + pixel.smell = true + deletePixel(hitPixel.x,hitPixel.y) + pixel.oxygen -= 50 + pixel.nutrition -= 50 + } } if (!isEmpty(pixel.x+1, pixel.y, true)) { var hitPixel = pixelMap[pixel.x+1][pixel.y] - if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.999) { - changePixel(hitPixel,"poop"); - pixel.nutrition += hitPixel.nutrition - if (Math.random() > 0.90) { - changePixel(pixel,"stomach_acid"); - } - } - else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) { + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5555,6 +5487,12 @@ elements.appendix = { pixel.speed -= 1 } } + else if ((elements[hitPixel.element].id === elements.chlorine.id || elements[hitPixel.element].id === elements.poison_gas.id || elements[hitPixel.element].id === elements.acid_gas.id || elements[hitPixel.element].id === elements.cyanide_gas.id || elements[hitPixel.element].id === elements.dioxin.id) && Math.random() > 0.5) { + pixel.smell = true + deletePixel(hitPixel.x,hitPixel.y) + pixel.oxygen -= 50 + pixel.nutrition -= 50 + } } }, density: 2710, @@ -5567,11 +5505,11 @@ elements.appendix = { burn: 5, burnTime: 350, burnInto: "cooked_meat", - breakInto: ["stomach_acid","blood","meat"], + breakInto: ["blood","meat"], forceSaveColor: true, reactions: { "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","steam","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, + "radiation": { elem1:["ash","carbon_dioxide","meat","rotten_meat","cooked_meat","flesh","ash","carbon_dioxide","meat","rotten_meat","cooked_meat","flesh","ash","oxygen","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, }, properties: { oxygen: 1000, @@ -5582,21 +5520,14 @@ elements.appendix = { isBio: true } -elements.simple_lung = { - color: "#EB85D9", +elements.lungs = { + color: "#d4aaab", category: "oxygen", behavior: behaviors.WALL, hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - 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)) { - if (Math.random() < 0.01) { pixel.oxygen += 100 } - break - } } if ((Math.random() > 0.9 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { pixel.nutrition-- pixel.oxygen -= 2 @@ -5638,7 +5569,13 @@ elements.simple_lung = { } if (!isEmpty(pixel.x, pixel.y-1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y-1] - if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.oxygen.id && Math.random() > 0.95) { + if (Math.random() > 0.75) { + changePixel(hitPixel,"carbon_dioxide"); + } + pixel.oxygen += 100 + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5661,7 +5598,13 @@ elements.simple_lung = { } if (!isEmpty(pixel.x, pixel.y+1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y+1] - if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.oxygen.id && Math.random() > 0.95) { + if (Math.random() > 0.75) { + changePixel(hitPixel,"carbon_dioxide"); + } + pixel.oxygen += 100 + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5684,7 +5627,13 @@ elements.simple_lung = { } if (!isEmpty(pixel.x-1, pixel.y, true)) { var hitPixel = pixelMap[pixel.x-1][pixel.y] - if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.oxygen.id && Math.random() > 0.95) { + if (Math.random() > 0.75) { + changePixel(hitPixel,"carbon_dioxide"); + } + pixel.oxygen += 100 + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5707,7 +5656,13 @@ elements.simple_lung = { } if (!isEmpty(pixel.x+1, pixel.y, true)) { var hitPixel = pixelMap[pixel.x+1][pixel.y] - if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.oxygen.id && Math.random() > 0.95) { + if (Math.random() > 0.75) { + changePixel(hitPixel,"carbon_dioxide"); + } + pixel.oxygen += 100 + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5754,15 +5709,41 @@ elements.simple_lung = { isBio: true } -elements.lungs = { - color: "#d4aaab", +elements.amphib_skin = { + color: "#7E9C33", category: "oxygen", - behavior: behaviors.WALL, + behavior: [ + "XX|CR:slime%0.001|XX", + "CR:slime%0.001|XX|CR:slime%0.001", + "XX|CR:slime%0.001|XX", + ], hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - if ((Math.random() > 0.9 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { + if ((pixel.temp > 35 || pixel.temp < 10) && Math.random() < 0.005) { + for (var i = 0; i < squareCoords.length; i++) { + var coords = squareCoords[i]; + var x = pixel.x + coords[0]; + var y = pixel.y + coords[1]; + if (isEmpty(x,y)) { + if (pixel.temp > 35) { + pixel.temp -= 20; + if (Math.random() < 0.01) { + createPixel("slime",x,y); + } + break; + } + pixel.temp += 20; + break; + } + } + } + if (pixel.temp < 15 && Math.random() < 0.1) { + pixel.temp += 1; + } + doDefaults(pixel); + if (Math.random() > 0.92 && pixel.nutrition > 0 && pixel.oxygen > 0) { pixel.nutrition-- pixel.oxygen -= 2 } @@ -5921,61 +5902,38 @@ elements.lungs = { density: 2710, state: "solid", conduct: .001, - tempHigh: 200, - stateHigh: "cooked_meat", + tempHigh: 220, + stateHigh: ["cooked_meat","slime"], tempLow: -25, - stateLow: "frozen_meat", - burn: 5, - burnTime: 350, - burnInto: "cooked_meat", - breakInto: ["blood","meat"], + stateLow: ["frozen_meat","slime_ice","slime_ice"], + breakInto: ["blood","meat","slime","slime"], forceSaveColor: true, reactions: { - "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","carbon_dioxide","meat","rotten_meat","cooked_meat","flesh","ash","carbon_dioxide","meat","rotten_meat","cooked_meat","flesh","ash","oxygen","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, + "cancer": { elem1:"cancer", chance:0.000075 }, + "radiation": { elem1:["slime","slime","ash","meat","rotten_meat","cooked_meat","skin","epidermis"], chance:0.1 }, }, properties: { oxygen: 1000, nutrition: 1000, speed: 0, }, + isBio: true, movable: false, - isBio: true + burn:5, + burnTime: 100, + burnInto: ["cooked_meat","calcium","calcium","cooked_meat","calcium","calcium","quicklime"], } -elements.amphib_skin = { - name: "amphibian_skin", - color: "#7E9C33", +elements.exoskeleton = { + color: ["#453a2e","#241d15","#242e23"], category: "oxygen", - behavior: [ - "XX|CR:slime%0.001|XX", - "CR:slime%0.001|XX|CR:slime%0.001", - "XX|CR:slime%0.001|XX", - ], + behavior: behaviors.WALL, hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - if ((pixel.temp > 35 || pixel.temp < 10) && Math.random() < 0.005) { - for (var i = 0; i < squareCoords.length; i++) { - var coords = squareCoords[i]; - var x = pixel.x + coords[0]; - var y = pixel.y + coords[1]; - if (isEmpty(x,y)) { - if (pixel.temp > 35) { - pixel.temp -= 20; - if (Math.random() < 0.01) { - createPixel("slime",x,y); - } - break; - } - pixel.temp += 20; - break; - } - } - } - if (pixel.temp < 15 && Math.random() < 0.1) { - pixel.temp += 1; + if (pixel.temp > 40 && Math.random() < 0.1) { + pixel.temp -= 1; } doDefaults(pixel); if (Math.random() > 0.92 && pixel.nutrition > 0 && pixel.oxygen > 0) { @@ -5984,27 +5942,27 @@ elements.amphib_skin = { } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { if (pixel.temp > 95) { - if (Math.random() < 0.75) { - changePixel(pixel,"meat"); + if (Math.random() < 0.999) { + changePixel(pixel,"dust"); } else { - changePixel(pixel,"cooked_meat"); + changePixel(pixel,"calcium"); } } else if (pixel.temp < -15) { - if (Math.random() < 0.75) { - changePixel(pixel,"meat"); + if (Math.random() < 0.95) { + changePixel(pixel,"dust"); } else { - changePixel(pixel,"frozen_meat"); + changePixel(pixel,"calcium"); } } else { if (Math.random() < 0.999) { - changePixel(pixel,"meat"); + changePixel(pixel,"dust"); } else { - changePixel(pixel,"rotten_meat"); + changePixel(pixel,"calcium"); } } } @@ -6138,14 +6096,14 @@ elements.amphib_skin = { state: "solid", conduct: .001, tempHigh: 220, - stateHigh: ["cooked_meat","slime"], + stateHigh: ["cooked_meat","calcium","calcium"], tempLow: -25, - stateLow: ["frozen_meat","slime_ice","slime_ice"], - breakInto: ["blood","meat","slime","slime"], + stateLow: "frozen_meat", + breakInto: ["blood","meat","calcium"], forceSaveColor: true, reactions: { "cancer": { elem1:"cancer", chance:0.000075 }, - "radiation": { elem1:["slime","slime","ash","meat","rotten_meat","cooked_meat","skin","epidermis"], chance:0.1 }, + "radiation": { elem1:["calcium","calcium","ash","meat","rotten_meat","cooked_meat","skin","epidermis"], chance:0.1 }, }, properties: { oxygen: 1000, @@ -6159,45 +6117,40 @@ elements.amphib_skin = { burnInto: ["cooked_meat","calcium","calcium","cooked_meat","calcium","calcium","quicklime"], } -elements.exoskeleton = { - color: ["#453a2e","#241d15","#242e23"], +elements.gills = { + color: "#5EBAE3", category: "oxygen", - behavior: behaviors.WALL, hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - if (pixel.temp > 40 && Math.random() < 0.1) { - pixel.temp -= 1; - } - doDefaults(pixel); - if (Math.random() > 0.92 && pixel.nutrition > 0 && pixel.oxygen > 0) { + if ((Math.random() > 0.9 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { pixel.nutrition-- pixel.oxygen -= 2 } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { if (pixel.temp > 95) { - if (Math.random() < 0.999) { - changePixel(pixel,"dust"); + if (Math.random() < 0.75) { + changePixel(pixel,"meat"); } else { - changePixel(pixel,"calcium"); + changePixel(pixel,"cooked_meat"); } } else if (pixel.temp < -15) { - if (Math.random() < 0.95) { - changePixel(pixel,"dust"); + if (Math.random() < 0.75) { + changePixel(pixel,"meat"); } else { - changePixel(pixel,"calcium"); + changePixel(pixel,"frozen_meat"); } } else { if (Math.random() < 0.999) { - changePixel(pixel,"dust"); + changePixel(pixel,"meat"); } else { - changePixel(pixel,"calcium"); + changePixel(pixel,"rotten_meat"); } } } @@ -6210,15 +6163,9 @@ elements.exoskeleton = { if (pixel.speed === null || isNaN(pixel.speed)) { pixel.speed = 0 } - if (!isEmpty(pixel.x, pixel.y-1, true)) { + if (!isEmpty(pixel.x, pixel.y-1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y-1] - if (elements[hitPixel.element].id === elements.oxygen.id && Math.random() > 0.95) { - if (Math.random() > 0.75) { - changePixel(hitPixel,"carbon_dioxide"); - } - pixel.oxygen += 100 - } - else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -6232,22 +6179,39 @@ elements.exoskeleton = { pixel.speed -= 1 } } - else if ((elements[hitPixel.element].id === elements.chlorine.id || elements[hitPixel.element].id === elements.poison_gas.id || elements[hitPixel.element].id === elements.acid_gas.id || elements[hitPixel.element].id === elements.cyanide_gas.id || elements[hitPixel.element].id === elements.dioxin.id) && Math.random() > 0.5) { - pixel.smell = true - deletePixel(hitPixel.x,hitPixel.y) - pixel.oxygen -= 50 - pixel.nutrition -= 50 + else if (elements[hitPixel.element].id === elements.deoxygenated_water.id && Math.random() > 0.75) { + if (!tryMove(hitPixel,pixel.x,pixel.y+1)) { + if (elements[pixelMap[pixel.x][pixel.y+1].element].state === "liquid") { + swapPixels(hitPixel,pixelMap[pixel.x][pixel.y+1]) + } + } } - } - if (!isEmpty(pixel.x, pixel.y+1, true)) { - var hitPixel = pixelMap[pixel.x][pixel.y+1] - if (elements[hitPixel.element].id === elements.oxygen.id && Math.random() > 0.95) { + else if (elements[hitPixel.element].id === elements.water.id && Math.random() > 0.75) { + pixel.oxygen += 100 if (Math.random() > 0.75) { - changePixel(hitPixel,"carbon_dioxide"); + changePixel(hitPixel,"deoxygenated_water") + } + if (!tryMove(hitPixel,pixel.x,pixel.y+1)) { + if (elements[pixelMap[pixel.x][pixel.y+1].element].state === "liquid") { + swapPixels(hitPixel,pixelMap[pixel.x][pixel.y+1]) + } } - pixel.oxygen += 100 } - else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + else if (elements[hitPixel.element].id === elements.salt_water.id && Math.random() > 0.75) { + pixel.oxygen += 90 + if (Math.random() > 0.85) { + changePixel(hitPixel,"deoxygenated_water") + } + if (!tryMove(hitPixel,pixel.x,pixel.y+1)) { + if (elements[pixelMap[pixel.x][pixel.y+1].element].state === "liquid") { + swapPixels(hitPixel,pixelMap[pixel.x][pixel.y+1]) + } + } + } + } + if (!isEmpty(pixel.x, pixel.y+1, true)) { + var hitPixel = pixelMap[pixel.x][pixel.y+1] + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -6261,22 +6225,10 @@ elements.exoskeleton = { pixel.speed -= 1 } } - else if ((elements[hitPixel.element].id === elements.chlorine.id || elements[hitPixel.element].id === elements.poison_gas.id || elements[hitPixel.element].id === elements.acid_gas.id || elements[hitPixel.element].id === elements.cyanide_gas.id || elements[hitPixel.element].id === elements.dioxin.id) && Math.random() > 0.5) { - pixel.smell = true - deletePixel(hitPixel.x,hitPixel.y) - pixel.oxygen -= 50 - pixel.nutrition -= 50 - } } - if (!isEmpty(pixel.x-1, pixel.y, true)) { - var hitPixel = pixelMap[pixel.x-1][pixel.y] - if (elements[hitPixel.element].id === elements.oxygen.id && Math.random() > 0.95) { - if (Math.random() > 0.75) { - changePixel(hitPixel,"carbon_dioxide"); - } - pixel.oxygen += 100 - } - else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (!isEmpty(pixel.x-1, pixel.y, true)) { + var hitPixel = pixelMap[pixel.x-1][pixel.y] + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -6290,22 +6242,33 @@ elements.exoskeleton = { pixel.speed -= 1 } } - else if ((elements[hitPixel.element].id === elements.chlorine.id || elements[hitPixel.element].id === elements.poison_gas.id || elements[hitPixel.element].id === elements.acid_gas.id || elements[hitPixel.element].id === elements.cyanide_gas.id || elements[hitPixel.element].id === elements.dioxin.id) && Math.random() > 0.5) { - pixel.smell = true - deletePixel(hitPixel.x,hitPixel.y) - pixel.oxygen -= 50 - pixel.nutrition -= 50 + else if (elements[hitPixel.element].id === elements.deoxygenated_water.id && Math.random() > 0.75) { + if (isEmpty(pixel.x+1, pixel.y)) { + tryMove(hitPixel,pixel.x+1,pixel.y); + } + } + else if (elements[hitPixel.element].id === elements.water.id && Math.random() > 0.75) { + if (isEmpty(pixel.x+1, pixel.y)) { + pixel.oxygen += 100 + if (Math.random() > 0.75) { + changePixel(hitPixel,"deoxygenated_water") + } + tryMove(hitPixel,pixel.x+1,pixel.y); + } + } + else if (elements[hitPixel.element].id === elements.salt_water.id && Math.random() > 0.75) { + if (isEmpty(pixel.x+1, pixel.y)) { + pixel.oxygen += 90 + if (Math.random() > 0.85) { + changePixel(hitPixel,"deoxygenated_water") + } + tryMove(hitPixel,pixel.x+1,pixel.y); + } } } if (!isEmpty(pixel.x+1, pixel.y, true)) { var hitPixel = pixelMap[pixel.x+1][pixel.y] - if (elements[hitPixel.element].id === elements.oxygen.id && Math.random() > 0.95) { - if (Math.random() > 0.75) { - changePixel(hitPixel,"carbon_dioxide"); - } - pixel.oxygen += 100 - } - else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -6319,41 +6282,35 @@ elements.exoskeleton = { pixel.speed -= 1 } } - else if ((elements[hitPixel.element].id === elements.chlorine.id || elements[hitPixel.element].id === elements.poison_gas.id || elements[hitPixel.element].id === elements.acid_gas.id || elements[hitPixel.element].id === elements.cyanide_gas.id || elements[hitPixel.element].id === elements.dioxin.id) && Math.random() > 0.5) { - pixel.smell = true - deletePixel(hitPixel.x,hitPixel.y) - pixel.oxygen -= 50 - pixel.nutrition -= 50 - } } }, density: 2710, state: "solid", conduct: .001, - tempHigh: 220, - stateHigh: ["cooked_meat","calcium","calcium"], + tempHigh: 200, + stateHigh: "cooked_meat", tempLow: -25, stateLow: "frozen_meat", - breakInto: ["blood","meat","calcium"], + burn: 5, + burnTime: 350, + burnInto: "cooked_meat", + breakInto: ["blood","meat"], forceSaveColor: true, reactions: { - "cancer": { elem1:"cancer", chance:0.000075 }, - "radiation": { elem1:["calcium","calcium","ash","meat","rotten_meat","cooked_meat","skin","epidermis"], chance:0.1 }, + "cancer": { elem1:"cancer", chance:0.0005 }, + "radiation": { elem1:["ash","steam","oxygen","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, }, properties: { oxygen: 1000, nutrition: 1000, speed: 0, }, - isBio: true, movable: false, - burn:5, - burnTime: 100, - burnInto: ["cooked_meat","calcium","calcium","cooked_meat","calcium","calcium","quicklime"], + isBio: true } -elements.gills = { - color: "#5EBAE3", +elements.simple_gill = { + color: "#75C0E2", category: "oxygen", hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen @@ -6361,7 +6318,7 @@ elements.gills = { tick: function(pixel) { if ((Math.random() > 0.9 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { pixel.nutrition-- - pixel.oxygen -= 2 + pixel.oxygen -- } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { if (pixel.temp > 95) { @@ -6422,10 +6379,7 @@ elements.gills = { } } else if (elements[hitPixel.element].id === elements.water.id && Math.random() > 0.75) { - pixel.oxygen += 100 - if (Math.random() > 0.75) { - changePixel(hitPixel,"deoxygenated_water") - } + pixel.oxygen += 50 if (!tryMove(hitPixel,pixel.x,pixel.y+1)) { if (elements[pixelMap[pixel.x][pixel.y+1].element].state === "liquid") { swapPixels(hitPixel,pixelMap[pixel.x][pixel.y+1]) @@ -6433,10 +6387,7 @@ elements.gills = { } } else if (elements[hitPixel.element].id === elements.salt_water.id && Math.random() > 0.75) { - pixel.oxygen += 90 - if (Math.random() > 0.85) { - changePixel(hitPixel,"deoxygenated_water") - } + pixel.oxygen += 50 if (!tryMove(hitPixel,pixel.x,pixel.y+1)) { if (elements[pixelMap[pixel.x][pixel.y+1].element].state === "liquid") { swapPixels(hitPixel,pixelMap[pixel.x][pixel.y+1]) @@ -6484,19 +6435,13 @@ elements.gills = { } else if (elements[hitPixel.element].id === elements.water.id && Math.random() > 0.75) { if (isEmpty(pixel.x+1, pixel.y)) { - pixel.oxygen += 100 - if (Math.random() > 0.75) { - changePixel(hitPixel,"deoxygenated_water") - } + pixel.oxygen += 50 tryMove(hitPixel,pixel.x+1,pixel.y); } } else if (elements[hitPixel.element].id === elements.salt_water.id && Math.random() > 0.75) { if (isEmpty(pixel.x+1, pixel.y)) { - pixel.oxygen += 90 - if (Math.random() > 0.85) { - changePixel(hitPixel,"deoxygenated_water") - } + pixel.oxygen += 50 tryMove(hitPixel,pixel.x+1,pixel.y); } } @@ -7098,6 +7043,7 @@ elements.carni_stomach = { } } } + doDefaults(pixel); }, density: 2710, state: "solid", @@ -7243,6 +7189,7 @@ elements.explosive_stomach = { } } } + doDefaults(pixel); }, density: 2710, state: "solid", @@ -7393,6 +7340,7 @@ elements.stomach_valve = { } } } + doDefaults(pixel); }, density: 2710, state: "solid", @@ -7541,6 +7489,7 @@ elements.sphincter = { } } } + doDefaults(pixel); }, density: 2710, state: "solid", @@ -7578,7 +7527,7 @@ elements.real_udder = { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - if (Math.random() > 0.975 && pixel.nutrition > 0 && pixel.oxygen > 0 || pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) { + if ((Math.random() > 0.975 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { pixel.nutrition-- pixel.oxygen-- } @@ -7701,6 +7650,7 @@ elements.real_udder = { createPixel("milk",pixel.x+1,pixel.y) } } + doDefaults(pixel); }, properties: { oxygen: 1000, @@ -7734,7 +7684,7 @@ elements.biotorch = { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - if (Math.random() > 0.975 && pixel.nutrition > 0 && pixel.oxygen > 0 || pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) { + if ((Math.random() > 0.975 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 550 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -5 && pixel.nutrition > 0 && pixel.oxygen > 0)) { pixel.nutrition-- pixel.oxygen -= 2 } @@ -7804,6 +7754,16 @@ elements.biotorch = { pixel.nutrition -= 20 } } + if (elements[hitPixel.element].isBio != true && Math.random() > 0.5) { + if (hitPixel.temp < pixel.temp) { + hitPixel.temp++ + pixel.temp-- + } + if (hitPixel.temp > pixel.temp) { + hitPixel.temp-- + pixel.temp++ + } + } } else if (isEmpty(pixel.x, pixel.y+1) && Math.random() > 0.95 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { if (Math.random() > 0.95) { @@ -7825,6 +7785,16 @@ elements.biotorch = { pixel.nutrition -= 20 } } + if (elements[hitPixel.element].isBio != true && Math.random() > 0.5) { + if (hitPixel.temp < pixel.temp) { + hitPixel.temp++ + pixel.temp-- + } + if (hitPixel.temp > pixel.temp) { + hitPixel.temp-- + pixel.temp++ + } + } } else if (isEmpty(pixel.x-1, pixel.y) && Math.random() > 0.95 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { if (Math.random() > 0.95) { @@ -7846,6 +7816,16 @@ elements.biotorch = { pixel.nutrition -= 20 } } + if (elements[hitPixel.element].isBio != true && Math.random() > 0.5) { + if (hitPixel.temp < pixel.temp) { + hitPixel.temp++ + pixel.temp-- + } + if (hitPixel.temp > pixel.temp) { + hitPixel.temp-- + pixel.temp++ + } + } } else if (isEmpty(pixel.x+1, pixel.y) && Math.random() > 0.95 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { if (Math.random() > 0.95) { @@ -7855,22 +7835,23 @@ elements.biotorch = { createPixel("fire",pixel.x+1, pixel.y) } } + doDefaults(pixel); }, properties: { oxygen: 1000, nutrition: 1000, speed: 0, }, - tempHigh: 650, + tempHigh: 750, stateHigh: "cooked_meat", tempLow: -20, stateLow: "frozen_meat", breakInto: ["meat","cooked_meat","cooked_meat","fire"], category: "structural", state: "solid", + insulate: true, density: 1250, conduct: .001, - insulate: true, movable: false, isBio: true, } @@ -8037,6 +8018,7 @@ elements.stomach_acid = { ], ignore: ["amphib_skin","amphib_dermis","acidic_flesh","acid_vessel","throat_lining","explosive_stomach","stomach_lining","stomach_valve","slime","gaseous_material","digested_material","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","gold_coin","silver","nickel","calcium","bone","earthquake","tornado","tsunami","liquid_light","sensor"], reactions: { + "bless": { elem1:null, elem2:["gaseous_material",null,null,null,null,null,null,null,null,null,null], attr2:{"nutrition":100, "speed":10}, chance:0.5 }, "dirty_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":-5, "speed":-1}, chance:0.02 }, "water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":0, "speed":2}, chance:0.02 }, "salt_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, @@ -8134,6 +8116,7 @@ elements.herbi_acid = { ], ignore: ["amphib_skin","amphib_dermis","acidic_flesh","acid_vessel","throat_lining","explosive_stomach","herbi_stomach","carni_stomach","stomach_lining","stomach_valve","slime","gaseous_material","digested_material","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","gold_coin","silver","nickel","calcium","bone","earthquake","tornado","tsunami","liquid_light","sensor"], reactions: { + "bless": { elem1:null, elem2:["gaseous_material",null,null,null,null,null,null,null,null,null,null], attr2:{"nutrition":100, "speed":10}, chance:0.5 }, "dirty_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":-5, "speed":-3}, chance:0.02 }, "water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":0, "speed":5}, chance:0.02 }, "salt_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, @@ -8236,6 +8219,7 @@ elements.carni_acid = { ], ignore: ["amphib_skin","amphib_dermis","acidic_flesh","acid_vessel","throat_lining","explosive_stomach","stomach_lining","carni_stomach","stomach_valve","slime","gaseous_material","digested_material","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","gold_coin","silver","nickel","calcium","bone","earthquake","tornado","tsunami","liquid_light","sensor"], reactions: { + "bless": { elem1:null, elem2:["gaseous_material",null,null,null,null,null,null,null,null,null,null], attr2:{"nutrition":100, "speed":10}, chance:0.5 }, "dirty_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":-5, "speed":-2}, chance:0.02 }, "water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":0, "speed":5}, chance:0.02 }, "salt_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, @@ -8338,6 +8322,7 @@ elements.explosive_acid = { ], ignore: ["amphib_skin","amphib_dermis","acidic_flesh","acid_vessel","throat_lining","stomach_lining","explosive_stomach","stomach_valve","slime","gaseous_material","digested_material","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","gold_coin","silver","nickel","calcium","bone","earthquake","tornado","tsunami","liquid_light","sensor"], reactions: { + "bless": { elem1:null, elem2:["gaseous_material",null,null,null,null,null,null,null,null,null,null], attr2:{"nutrition":100, "speed":10}, chance:0.5 }, "dirty_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, "water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":0, "speed":10}, chance:0.02 }, "salt_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, @@ -8437,6 +8422,7 @@ elements.decomposer_acid = { ], ignore: ["amphib_skin","amphib_dermis","acidic_flesh","acid_vessel","decomposer_stomach","throat_lining","explosive_stomach","herbi_stomach","carni_stomach","stomach_lining","stomach_valve","slime","gaseous_material","digested_material","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","gold_coin","silver","nickel","calcium","bone","earthquake","tornado","tsunami","liquid_light","sensor"], reactions: { + "bless": { elem1:null, elem2:["gaseous_material",null,null,null,null,null,null,null,null,null,null], attr2:{"nutrition":100, "speed":10}, chance:0.5 }, "dirty_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, "water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":0, "speed":5}, chance:0.02 }, "salt_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, @@ -8885,6 +8871,160 @@ elements.real_bone_marrow = { movable: false, } +elements.cartilage = { + color: "#DBDBDB", + behavior: behaviors.WALL, + hoverStat: function(pixel) { + return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen + }, + tick: function(pixel) { + if ((Math.random() > 0.99 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { + pixel.nutrition-- + pixel.oxygen -= 2 + } + if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { + if (pixel.temp > 95) { + if (Math.random() < 0.9) { + changePixel(pixel,"water"); + } + else if (Math.random() < 0.75) { + changePixel(pixel,"meat"); + } + else if (Math.random() < 0.75) { + changePixel(pixel,"calcium"); + } + else { + changePixel(pixel,"glue"); + } + } + else if (pixel.temp < -15) { + if (Math.random() < 0.9) { + changePixel(pixel,"water"); + } + else if (Math.random() < 0.75) { + changePixel(pixel,"meat"); + } + else if (Math.random() < 0.75) { + changePixel(pixel,"quicklime"); + } + else { + changePixel(pixel,"calcium"); + } + } + else { + if (Math.random() < 0.9) { + changePixel(pixel,"water"); + } + else if (Math.random() < 0.75) { + changePixel(pixel,"meat"); + } + else if (Math.random() < 0.75) { + changePixel(pixel,"quicklime"); + } + else { + changePixel(pixel,"calcium"); + } + } + } + if (pixel.nutrition === null || isNaN(pixel.nutrition)) { + pixel.nutrition = 500 + } + if (pixel.oxygen === null || isNaN(pixel.oxygen)) { + pixel.oxygen = 500 + } + if (pixel.speed === null || isNaN(pixel.speed)) { + pixel.speed = 0 + } + if (!isEmpty(pixel.x, pixel.y-1, true)) { + var hitPixel = pixelMap[pixel.x][pixel.y-1] + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (hitPixel.oxygen < pixel.oxygen) { + hitPixel.oxygen += 10 + pixel.oxygen -= 10 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 + } + } + } + if (!isEmpty(pixel.x, pixel.y+1, true)) { + var hitPixel = pixelMap[pixel.x][pixel.y+1] + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (hitPixel.oxygen < pixel.oxygen) { + hitPixel.oxygen += 10 + pixel.oxygen -= 10 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 + } + } + } + if (!isEmpty(pixel.x-1, pixel.y, true)) { + var hitPixel = pixelMap[pixel.x-1][pixel.y] + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (hitPixel.oxygen < pixel.oxygen) { + hitPixel.oxygen += 10 + pixel.oxygen -= 10 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 + } + } + } + if (!isEmpty(pixel.x+1, pixel.y, true)) { + var hitPixel = pixelMap[pixel.x+1][pixel.y] + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (hitPixel.oxygen < pixel.oxygen) { + hitPixel.oxygen += 10 + pixel.oxygen -= 10 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 + } + } + } + }, + category:"structural", + tempHigh: 200, + stateHigh: ["calcium","glue","steam","steam","meat","steam",null], + tempLow: -36, + stateLow: ["calcium","calcium","meat","water","water","water",null], + state: "solid", + density: 1900, + hardness: 0.05, + properties: { + oxygen: 1000, + nutrition: 1000, + speed: 0, + }, + breakInto: ["quicklime","calcium","meat","meat","water","water",null], + movable: false, + isBio: true, + burn: 1, + burnTime: 100, + burnInto: ["bone","bone","bone","bone","quicklime"], +} + elements.cerebrospinal_fluid = { color: "#CBC3E3", behavior: behaviors.LIQUID, @@ -9151,7 +9291,7 @@ elements.brain_jar_juice = { pixel.clone = "salt_water"; } }}, - "brain_jar_juice": { elem2:"bubble", color2:"#81cf63", attr2:{"clone":"brain_jar_juice"}, chance:0.0001 }, + "brain_jar_juice": { elem2:"bubble", color2:"#81cf63", attr2:{"clone":"brain_jar_juice"}, chance:0.00005 }, }, state: "liquid", density: 1026, @@ -10355,8 +10495,6 @@ elements.cancer.reactions.simple_lung = { "elem2": "cancer", chance:0.005 }; elements.cancer.reactions.gills = { "elem2": "cancer", chance:0.005 }; elements.cancer.reactions.brain = { "elem2": "cancer", chance:0.005 }; elements.cancer.reactions.nerve = { "elem2": "cancer", chance:0.005 }; -elements.cancer.reactions.eye_nerve = { "elem2": "cancer", chance:0.005 }; -elements.cancer.reactions.bulb_nerve = { "elem2": "cancer", chance:0.005 }; elements.cancer.reactions.olfactory_bulb = { "elem2": "cancer", chance:0.005 }; elements.cancer.reactions.eye = { "elem2": "cancer", chance:0.005 }; elements.cancer.reactions.sphincter = { "elem2": "cancer", chance:0.005 }; @@ -10403,8 +10541,6 @@ elements.uranium.reactions.simple_lung = { "elem2": ["ash","carbon_dioxide","mea elements.uranium.reactions.brain = { "elem2": ["ash","steam","salt","meat","rotten_meat","cooked_meat","flesh","cerebrospinal_fluid"], chance:0.5 }; elements.uranium.reactions.amygdala = { "elem2": ["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 }; elements.uranium.reactions.nerve = { "elem2": ["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 }; -elements.uranium.reactions.eye_nerve = { "elem2": ["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 }; -elements.uranium.reactions.bulb_nerve = { "elem2": ["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 }; elements.uranium.reactions.olfactory_bulb = { "elem2": ["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 }; elements.uranium.reactions.eye = { "elem2": ["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 }; elements.uranium.reactions.sphincter = { "elem2": ["ash","steam","poop","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 }; @@ -10450,8 +10586,6 @@ elements.radiation.reactions.simple_lung = { "elem2": ["cancer","ash","carbon_di elements.radiation.reactions.brain = { "elem2": ["cancer","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh","cerebrospinal_fluid"], chance:0.4 }; elements.radiation.reactions.amygdala = { "elem2": ["cancer","ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }; elements.radiation.reactions.nerve = { "elem2": ["cancer","ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }; -elements.radiation.reactions.eye_nerve = { "elem2": ["cancer","ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }; -elements.radiation.reactions.bulb_nerve = { "elem2": ["cancer","ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }; elements.radiation.reactions.olfactory_bulb = { "elem2": ["cancer","ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }; elements.radiation.reactions.eye = { "elem2": ["cancer","ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }; elements.radiation.reactions.sphincter = { "elem2": ["cancer","ash","steam","poop","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }; @@ -10495,8 +10629,6 @@ elements.plague.reactions.simple_lung = { "elem2": ["infection","rotten_meat","c elements.plague.reactions.brain = { "elem2": ["infection","rotten_meat","steam","salt","meat","rotten_meat","plague","flesh","cerebrospinal_fluid"], chance:0.04 }; elements.plague.reactions.amygdala = { "elem2": ["infection","rotten_meat","steam","salt","rotten_meat","steam","salt","meat","rotten_meat","plague","flesh"], chance:0.04 }; elements.plague.reactions.nerve = { "elem2": ["infection","rotten_meat","steam","salt","rotten_meat","steam","salt","meat","rotten_meat","plague","flesh"], chance:0.04 }; -elements.plague.reactions.eye_nerve = { "elem2": ["infection","rotten_meat","steam","salt","rotten_meat","steam","salt","meat","rotten_meat","plague","flesh"], chance:0.04 }; -elements.plague.reactions.bulb_nerve = { "elem2": ["infection","rotten_meat","steam","salt","rotten_meat","steam","salt","meat","rotten_meat","plague","flesh"], chance:0.04 }; elements.plague.reactions.olfactory_bulb = { "elem2": ["infection","rotten_meat","steam","salt","rotten_meat","steam","salt","meat","rotten_meat","plague","flesh"], chance:0.04 }; elements.plague.reactions.eye = { "elem2": ["infection","rotten_meat","steam","salt","rotten_meat","steam","salt","meat","rotten_meat","plague","flesh"], chance:0.04 }; elements.plague.reactions.sphincter = { "elem2": ["infection","rotten_meat","steam","poop","meat","rotten_meat","plague","flesh"], chance:0.04 }; @@ -10521,11 +10653,66 @@ if (!elements.fly.reactions) { elements.infection.reactions = {} } elements.fly.reactions.poop = { elem2:[null,null,"stench"], chance:0.15, func:behaviors.FEEDPIXEL }; if (!elements.stench.reactions) { elements.infection.reactions = {} } -elements.stench.reactions.intestines = { elem1:[null,null,null,null,null,null,"foam"], chance:0.015, }; -elements.stench.reactions.stomach_valve = { elem1:[null,null,null,null,null,null,"foam"], chance:0.05, }; +elements.stench.reactions.intestines = { elem1:[null,null,null,null,null,null,"foam"], chance:0.005, }; +elements.stench.reactions.stomach_valve = { elem1:[null,null,null,null,null,null,"foam"], chance:0.015, }; elements.bless.reactions.poop = { elem2:null } elements.bless.reactions.excreted_poop = { elem2:null } +elements.bless.reactions.infected_vessel = { elem2:["blood_vessel","blood_vessel","blood_vessel","blood_vessel","blood_vessel","blood_vessel","white_blood_cell"] } +elements.bless.tool = function(pixel) { + if (elements.bless.ignore.indexOf(pixel.element) !== -1) { return; } + if (pixel.burning && !elements[pixel.element].burning) { // stop burning + delete pixel.burning; + delete pixel.burnStart; + } + if (!elements[pixel.element].insulate) { + if (pixel.temp > 100) { + pixel.temp = (pixel.temp+100)/2; + pixelTempCheck(pixel); + if (pixel.del) {return} + } + if (pixel.temp < -200) { + pixel.temp = (pixel.temp-200)/2; + pixelTempCheck(pixel); + if (pixel.del) {return} + } + } + if (pixel.origColor) { + pixel.color = "rgb("+pixel.origColor.join(",")+")"; + delete pixel.origColor; + } + if (pixel.charge) { + delete pixel.charge; + pixel.chargeCD = 16; + } + if (elements.bless.reactions[pixel.element] && Math.random()<0.25) { + var r = elements.bless.reactions[pixel.element]; + var elem2 = r.elem2; + if (elem2 !== undefined) { + if (Array.isArray(elem2)) { elem2 = elem2[Math.floor(Math.random()*elem2.length)]; } + if (elem2 === null) { deletePixel(pixel.x,pixel.y) } + else { changePixel(pixel, elem2); } + } + if (r.func) { r.func(pixel,pixel) } + if (r.color2) { pixel.color = pixelColorPick(pixel,r.color2) } + } + if (elements[pixel.element].isBio == true) { + if (pixel.nutrition < 2000 || pixel.oxygen < 2000) { + if (pixel.nutrition < 2000) { + pixel.nutrition += 100 + } + if (pixel.oxygen < 2000) { + pixel.oxygen += 100 + } + if (pixel.speed < 0) { + pixel.oxygen += 10 + } + } + if (pixel.burning) { + pixel.burning = false + } + } +} elements.dna.reactions.juice = { "elem1": null, "elem2": "elixir", chance:0.01 };