From 09be9530e9f91d9738a2e4ca4087e6f7ec4a96d9 Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Fri, 27 Dec 2024 20:49:11 -0800 Subject: [PATCH] Technicalities update --- mods/biology.js | 8416 ++++++++++++++++++++++++++++------------------- 1 file changed, 4987 insertions(+), 3429 deletions(-) diff --git a/mods/biology.js b/mods/biology.js index a3ab9fb3..da9845d3 100644 --- a/mods/biology.js +++ b/mods/biology.js @@ -7,7 +7,6 @@ viewInfo[4] = { // Nutrition View var nutrition = pixel.nutrition; if (nutrition < 0) {nutrition = 0} if (nutrition > 6000) {nutrition = 6000} - // logarithmic scale, with coldest being 225 (-50 degrees) and hottest being 0 (6000 degrees) var hue = Math.round(225 - (Math.log(nutrition)/Math.log(6000))*225); if (hue < 0) {hue = 0} if (hue > 225) {hue = 225} @@ -23,7 +22,6 @@ viewInfo[5] = { // Oxygen View var oxygen = pixel.oxygen; if (oxygen < 0) {oxygen = 0} if (oxygen > 6000) {oxygen = 6000} - // logarithmic scale, with coldest being 225 (-50 degrees) and hottest being 0 (6000 degrees) var hue = Math.round(225 - (Math.log(oxygen)/Math.log(6000))*225); if (hue < 0) {hue = 0} if (hue > 225) {hue = 225} @@ -39,7 +37,6 @@ viewInfo[6] = { // Speed View var speed = pixel.speed; if (speed < -50) {speed = -50} if (speed > 150) {speed = 150} - // logarithmic scale, with coldest being 225 (-50 degrees) and hottest being 0 (6000 degrees) var hue = Math.round(225 - (Math.log(speed+50)/Math.log(100+50))*225); if (hue < 0) {hue = 0} if (hue > 225) {hue = 225} @@ -48,6 +45,27 @@ viewInfo[6] = { // Speed View } } +viewInfo[7] = { // Illness View + name: "ill", + pixel: function(pixel,ctx) { + if ((elements[pixel.element].id === elements.infected_vessel.id || elements[pixel.element].id === elements.infection.id || elements[pixel.element].id === elements.cancer.id || elements[pixel.element].id === elements.plague.id || elements[pixel.element].id === elements.rotten_meat.id) || ((elements[pixel.element].isBio === true || elements[pixel.element].id === elements.digested_material.id || elements[pixel.element].id === elements.gaseous_material.id) && (pixel.speed < -5 || pixel.oxygen < 250 || pixel.nutrition < 250))) { + var a = (settings.textures !== 0) ? pixel.alpha : undefined; + if (((elements[pixel.element].isGas && elements[pixel.element].glow !== false) || elements[pixel.element].glow || pixel.glow) && pixel.glow !== false) { + drawPlus(ctx,pixel.color,pixel.x,pixel.y,undefined,a) + // if (isEmpty(pixel.x+1,pixel.y) || isEmpty(pixel.x-1,pixel.y) || isEmpty(pixel.x,pixel.y+1) || isEmpty(pixel.x,pixel.y-1)) {} + } + else { + drawSquare(ctx,pixel.color,pixel.x,pixel.y,undefined,a) + } + if (pixel.charge && view !== 2) { // Yellow glow on charge + if (!elements[pixel.element].colorOn) { + drawSquare(ctx,"rgba(255,255,0,0.5)",pixel.x,pixel.y); + } + } + } + } +} + elements.flesh = { color: ["#9e4839","#ba6449"], category: "structural", @@ -329,7 +347,7 @@ elements.epidermis = { stateHigh: "cooked_meat", tempLow: -25, stateLow: "frozen_meat", - burn: 5, + burn: 3, burnTime: 350, burnInto: "cooked_meat", breakInto: ["blood","meat","dust","dust","dust","dust"], @@ -481,7 +499,7 @@ elements.dermis = { stateHigh: "cooked_meat", tempLow: -25, stateLow: "frozen_meat", - burn: 5, + burn: 4, burnTime: 350, burnInto: "cooked_meat", breakInto: ["blood","meat"], @@ -499,298 +517,213 @@ elements.dermis = { movable: false, } -elements.loose_hair = { - color: "#79554D", - singleColor: true, - behavior: behaviors.POWDER, - category:"powders", - tempHigh: 223, - stateHigh: ["smoke","smoke","smoke","ash","ash","stench"], - burn: 20, - burnTime: 350, - burnInto:["smoke","smoke","fire","ash","ash","stench"], - breakInto: [null,null,null,null,"dust"], - state: "solid", - density: 2395, - conduct: 0.05, - hidden: true -} - -elements.hair_end = { - color: "#754a41", +elements.cloak_skin = { + color: "#CFD4A5", category: "structural", behavior: behaviors.WALL, + hoverStat: function(pixel) { + return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen + }, tick: function(pixel) { - if (pixel.dir === "up") { - if (isEmpty(pixel.x,pixel.y+1)) { - changePixel(pixel,"loose_hair"); - } - else if (!isEmpty(pixel.x,pixel.y+1,true)) { - if (elements[pixelMap[pixel.x][pixel.y+1].element].isHair != true) { - changePixel(pixel,"loose_hair"); + 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; + createPixel("salt_water",x,y); + break; + } + pixel.temp += 20; + break; } } } - else if (pixel.dir === "down") { - if (isEmpty(pixel.x,pixel.y-1)) { - changePixel(pixel,"loose_hair"); + 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.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"); + } + else { + changePixel(pixel,"cooked_meat"); + } } - else if (!isEmpty(pixel.x,pixel.y-1,true)) { - if (elements[pixelMap[pixel.x][pixel.y-1].element].isHair != true) { - changePixel(pixel,"loose_hair"); + else if (pixel.temp < -15) { + if (Math.random() < 0.75) { + changePixel(pixel,"dust"); + } + } + else { + if (Math.random() < 0.999) { + changePixel(pixel,"dust"); + } + else { + changePixel(pixel,"meat"); } } } - else if (pixel.dir === "left") { - if (isEmpty(pixel.x+1,pixel.y)) { - changePixel(pixel,"loose_hair"); + 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 (pixel.color != hitPixel.color) { + hitPixel.color = pixel.color + } } - else if (!isEmpty(pixel.x+1,pixel.y,true)) { - if (elements[pixelMap[pixel.x+1][pixel.y].element].isHair != true) { - changePixel(pixel,"loose_hair"); + else if (elements[hitPixel.element].movable) { + if (pixel.color != hitPixel.color) { + pixel.color = hitPixel.color } } } - else if (pixel.dir === "right") { - if (isEmpty(pixel.x-1,pixel.y)) { - changePixel(pixel,"loose_hair"); + 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 (pixel.color != hitPixel.color) { + hitPixel.color = pixel.color + } } - else if (!isEmpty(pixel.x-1,pixel.y,true)) { - if (elements[pixelMap[pixel.x-1][pixel.y].element].isHair != true) { - changePixel(pixel,"loose_hair"); + else if (elements[hitPixel.element].movable) { + if (pixel.color != hitPixel.color) { + pixel.color = hitPixel.color } } } - else if (!pixel.dir && pixel.age > 10) { - changePixel(pixel,"loose_hair"); - } - if (pixel.temp < 5 && Math.random() < 0.01) { - 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)) { - pixel.temp += 10; - break; + 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 (pixel.color != hitPixel.color) { + hitPixel.color = pixel.color + } + } + else if (elements[hitPixel.element].movable) { + if (pixel.color != hitPixel.color) { + pixel.color = hitPixel.color } } } - if (pixel.temp < 10 && Math.random() < 0.1) { - pixel.temp += 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 (pixel.color != hitPixel.color) { + hitPixel.color = pixel.color + } + } + else if (elements[hitPixel.element].movable) { + if (pixel.color != hitPixel.color) { + pixel.color = hitPixel.color + } + } } - doDefaults(pixel); - pixel.age++ - }, - properties: { - age: 0, }, density: 2710, state: "solid", conduct: .001, + tempHigh: 200, + stateHigh: "cooked_meat", tempLow: -25, - stateLow: "loose_hair", - tempHigh: 123, - stateHigh: "loose_hair", - burn:15, - burnTime: 400, - burnInto:"loose_hair", - breakInto:"loose_hair", + stateLow: "frozen_meat", + burn: 3, + burnTime: 350, + burnInto: "cooked_meat", + breakInto: ["blood","meat","dust","dust","dust","dust"], forceSaveColor: true, reactions: { - "cancer": { elem1:null, chance:0.0005 }, - "radiation": { elem1:["ash","dust"], chance:0.2 }, + "cancer": { elem1:"cancer", chance:0.0005 }, + "radiation": { elem1:["ash","meat","rotten_meat","cooked_meat","flesh"], chance:0.2 }, }, - isHair: true, + properties: { + oxygen: 1000, + nutrition: 1000, + speed: 0, + }, + isBio: true, movable: false, - hidden: true, } -elements.attached_hair = { - color: "#754a41", +elements.cloak_dermis = { + color: "#BC9F7B", category: "structural", behavior: behaviors.WALL, + hoverStat: function(pixel) { + return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen + }, tick: function(pixel) { - if (Math.random() < 0.005) { - if (pixel.dir === "up") { - if (isEmpty(pixel.x,pixel.y-1)) { - if (Math.random() > 0.2) { - createPixel("attached_hair",pixel.x,pixel.y-1) - pixelMap[pixel.x][pixel.y-1].dir = "up" - } - else { - createPixel("hair_end",pixel.x,pixel.y-1) - pixelMap[pixel.x][pixel.y-1].dir = "up" - } - } - } - else if (pixel.dir === "down") { - if (isEmpty(pixel.x,pixel.y+1)) { - if (Math.random() > 0.2) { - createPixel("attached_hair",pixel.x,pixel.y+1) - pixelMap[pixel.x][pixel.y+1].dir = "down" - } - else { - createPixel("hair_end",pixel.x,pixel.y+1) - pixelMap[pixel.x][pixel.y+1].dir = "down" - } + if (Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) && 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)) { + createPixel("cloak_skin",x,y); } } - else if (pixel.dir === "left") { - if (isEmpty(pixel.x-1,pixel.y)) { - if (Math.random() > 0.2) { - createPixel("attached_hair",pixel.x-1,pixel.y) - pixelMap[pixel.x-1][pixel.y].dir = "left" - } - else { - createPixel("hair_end",pixel.x-1,pixel.y) - pixelMap[pixel.x-1][pixel.y].dir = "left" - } - } - } - else if (pixel.dir === "right") { - if (isEmpty(pixel.x+1,pixel.y)) { - if (Math.random() > 0.2) { - createPixel("attached_hair",pixel.x+1,pixel.y) - pixelMap[pixel.x+1][pixel.y].dir = "right" - } - else { - createPixel("hair_end",pixel.x+1,pixel.y) - pixelMap[pixel.x+1][pixel.y].dir = "right" - } - } - } - } - if (pixel.dir === "up") { - if (isEmpty(pixel.x,pixel.y+1)) { - changePixel(pixel,"loose_hair"); - } - else if (!isEmpty(pixel.x,pixel.y+1,true)) { - if (elements[pixelMap[pixel.x][pixel.y+1].element].isHair != true) { - changePixel(pixel,"loose_hair"); - } - } - } - else if (pixel.dir === "down") { - if (isEmpty(pixel.x,pixel.y-1)) { - changePixel(pixel,"loose_hair"); - } - else if (!isEmpty(pixel.x,pixel.y-1,true)) { - if (elements[pixelMap[pixel.x][pixel.y-1].element].isHair != true) { - changePixel(pixel,"loose_hair"); - } - } - } - else if (pixel.dir === "left") { - if (isEmpty(pixel.x+1,pixel.y)) { - changePixel(pixel,"loose_hair"); - } - else if (!isEmpty(pixel.x+1,pixel.y,true)) { - if (elements[pixelMap[pixel.x+1][pixel.y].element].isHair != true) { - changePixel(pixel,"loose_hair"); - } - } - } - else if (pixel.dir === "right") { - if (isEmpty(pixel.x-1,pixel.y)) { - changePixel(pixel,"loose_hair"); - } - else if (!isEmpty(pixel.x-1,pixel.y,true)) { - if (elements[pixelMap[pixel.x-1][pixel.y].element].isHair != true) { - changePixel(pixel,"loose_hair"); - } - } - } - else if (!pixel.dir && pixel.age > 10) { - changePixel(pixel,"loose_hair"); - } - if (pixel.temp < 5 && Math.random() < 0.01) { - 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)) { - pixel.temp += 10; - break; - } - } - } - if (pixel.temp < 10 && Math.random() < 0.1) { - pixel.temp += 1; - } - doDefaults(pixel); - pixel.age++ - }, - properties: { - age: 0, - }, - density: 2710, - state: "solid", - conduct: .001, - tempLow: -25, - stateLow: "loose_hair", - tempHigh: 123, - stateHigh: "loose_hair", - burn:15, - burnTime: 400, - burnInto:"loose_hair", - breakInto:"loose_hair", - forceSaveColor: true, - reactions: { - "cancer": { elem1:null, chance:0.0005 }, - "radiation": { elem1:["ash","dust"], chance:0.2 }, - }, - isHair: true, - movable: false, - hidden: true, -} - -elements.hairy_skin = { - color: "#ECDCC3", - category: "structural", - behavior: behaviors.WALL, - hoverStat: function(pixel) { - return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen - }, - tick: function(pixel) { - if (Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) && Math.random() < 0.01) { - if (isEmpty(pixel.x,pixel.y-1)) { - createPixel("attached_hair",pixel.x,pixel.y-1) - pixelMap[pixel.x][pixel.y-1].dir = "up" - } - if (isEmpty(pixel.x,pixel.y+1)) { - createPixel("attached_hair",pixel.x,pixel.y+1) - pixelMap[pixel.x][pixel.y+1].dir = "down" - } - - if (isEmpty(pixel.x-1,pixel.y)) { - createPixel("attached_hair",pixel.x-1,pixel.y) - pixelMap[pixel.x-1][pixel.y].dir = "left" - } - - if (isEmpty(pixel.x+1,pixel.y)) { - createPixel("attached_hair",pixel.x+1,pixel.y) - pixelMap[pixel.x+1][pixel.y].dir = "right" - } - - } - 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; - createPixel("salt_water",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.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)) { @@ -799,8 +732,8 @@ elements.hairy_skin = { } 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,"cooked_meat"); @@ -808,15 +741,18 @@ elements.hairy_skin = { } else if (pixel.temp < -15) { if (Math.random() < 0.75) { - changePixel(pixel,"dust"); + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"frozen_meat"); } } else { if (Math.random() < 0.999) { - changePixel(pixel,"dust"); + changePixel(pixel,"meat"); } else { - changePixel(pixel,"meat"); + changePixel(pixel,"rotten_meat"); } } } @@ -844,6 +780,14 @@ elements.hairy_skin = { hitPixel.speed += 1 pixel.speed -= 1 } + if (pixel.color != hitPixel.color) { + hitPixel.color = pixel.color + } + } + else if (elements[hitPixel.element].movable) { + if (pixel.color != hitPixel.color) { + pixel.color = hitPixel.color + } } } if (!isEmpty(pixel.x, pixel.y+1, true)) { @@ -861,6 +805,14 @@ elements.hairy_skin = { hitPixel.speed += 1 pixel.speed -= 1 } + if (pixel.color != hitPixel.color) { + hitPixel.color = pixel.color + } + } + else if (elements[hitPixel.element].movable) { + if (pixel.color != hitPixel.color) { + pixel.color = hitPixel.color + } } } if (!isEmpty(pixel.x-1, pixel.y, true)) { @@ -878,6 +830,14 @@ elements.hairy_skin = { hitPixel.speed += 1 pixel.speed -= 1 } + if (pixel.color != hitPixel.color) { + hitPixel.color = pixel.color + } + } + else if (elements[hitPixel.element].movable) { + if (pixel.color != hitPixel.color) { + pixel.color = hitPixel.color + } } } if (!isEmpty(pixel.x+1, pixel.y, true)) { @@ -895,6 +855,14 @@ elements.hairy_skin = { hitPixel.speed += 1 pixel.speed -= 1 } + if (pixel.color != hitPixel.color) { + hitPixel.color = pixel.color + } + } + else if (elements[hitPixel.element].movable) { + if (pixel.color != hitPixel.color) { + pixel.color = hitPixel.color + } } } }, @@ -905,10 +873,10 @@ elements.hairy_skin = { stateHigh: "cooked_meat", tempLow: -25, stateLow: "frozen_meat", - burn: 5, - burnTime: 375, + burn: 4, + burnTime: 350, burnInto: "cooked_meat", - breakInto: ["blood","meat","dust","dust","dust","dust"], + breakInto: ["blood","meat"], forceSaveColor: true, reactions: { "cancer": { elem1:"cancer", chance:0.0005 }, @@ -919,329 +887,303 @@ elements.hairy_skin = { nutrition: 1000, speed: 0, }, - isHair: true, isBio: true, movable: false, } -elements.hair_dermis = { - color: "#C89985", +elements.loose_hair = { + color: "#79554D", + singleColor: true, + behavior: behaviors.POWDER, + category:"powders", + tempHigh: 223, + stateHigh: ["smoke","smoke","smoke","ash","ash","stench"], + burn: 20, + burnTime: 350, + burnInto:["smoke","smoke","fire","ash","ash","stench"], + breakInto: [null,null,null,null,"dust"], + state: "solid", + density: 2395, + conduct: 0.05, + hidden: true +} + +elements.hair_end = { + color: "#754a41", category: "structural", behavior: behaviors.WALL, - hoverStat: function(pixel) { - return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen - }, tick: function(pixel) { - if (Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) && 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 (Math.random() > 0.05) { - createPixel("hairy_skin",x,y); - } - else { - createPixel("epidermis",x,y); - } + if (pixel.dir === "up") { + if (isEmpty(pixel.x,pixel.y+1)) { + changePixel(pixel,"loose_hair"); + } + else if (!isEmpty(pixel.x,pixel.y+1,true)) { + if (elements[pixelMap[pixel.x][pixel.y+1].element].isHair != true) { + changePixel(pixel,"loose_hair"); } } } - doDefaults(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 -= 2 - } - 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.dir === "down") { + if (isEmpty(pixel.x,pixel.y-1)) { + changePixel(pixel,"loose_hair"); } - else if (pixel.temp < -15) { - if (Math.random() < 0.75) { - changePixel(pixel,"meat"); - } - else { - changePixel(pixel,"frozen_meat"); + else if (!isEmpty(pixel.x,pixel.y-1,true)) { + if (elements[pixelMap[pixel.x][pixel.y-1].element].isHair != true) { + changePixel(pixel,"loose_hair"); } } - 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 - } + else if (pixel.dir === "left") { + if (isEmpty(pixel.x+1,pixel.y)) { + changePixel(pixel,"loose_hair"); } - } - 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 + else if (!isEmpty(pixel.x+1,pixel.y,true)) { + if (elements[pixelMap[pixel.x+1][pixel.y].element].isHair != true) { + changePixel(pixel,"loose_hair"); } } } - 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 + else if (pixel.dir === "right") { + if (isEmpty(pixel.x-1,pixel.y)) { + changePixel(pixel,"loose_hair"); + } + else if (!isEmpty(pixel.x-1,pixel.y,true)) { + if (elements[pixelMap[pixel.x-1][pixel.y].element].isHair != true) { + changePixel(pixel,"loose_hair"); } } } - 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 + else if (!pixel.dir && pixel.age > 10) { + changePixel(pixel,"loose_hair"); + } + if (pixel.temp < 5 && Math.random() < 0.01) { + 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)) { + pixel.temp += 10; + break; } } } + if (pixel.temp < 10 && Math.random() < 0.1) { + pixel.temp += 1; + } + doDefaults(pixel); + pixel.age++ + }, + properties: { + age: 0, }, density: 2710, state: "solid", conduct: .001, - tempHigh: 200, - stateHigh: "cooked_meat", tempLow: -25, - stateLow: "frozen_meat", - burn: 5, - burnTime: 360, - burnInto: "cooked_meat", - breakInto: ["blood","meat"], + stateLow: "loose_hair", + tempHigh: 123, + stateHigh: "loose_hair", + burn:15, + burnTime: 400, + burnInto:"loose_hair", + breakInto:"loose_hair", forceSaveColor: true, reactions: { - "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","meat","rotten_meat","cooked_meat","flesh"], chance:0.2 }, + "cancer": { elem1:null, chance:0.0005 }, + "radiation": { elem1:["ash","dust"], chance:0.2 }, }, - properties: { - oxygen: 1000, - nutrition: 1000, - speed: 0, - }, isHair: true, - isBio: true, movable: false, + hidden: true, } -elements.scales = { - color: "#6b839a", +elements.attached_hair = { + color: "#754a41", category: "structural", 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) { - 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"); - } - else { - changePixel(pixel,"calcium"); + if (Math.random() < 0.005) { + if (pixel.dir === "up") { + if (isEmpty(pixel.x,pixel.y-1)) { + if (Math.random() > 0.2) { + createPixel("attached_hair",pixel.x,pixel.y-1) + pixelMap[pixel.x][pixel.y-1].dir = "up" + } + else { + createPixel("hair_end",pixel.x,pixel.y-1) + pixelMap[pixel.x][pixel.y-1].dir = "up" + } } } - else if (pixel.temp < -15) { - if (Math.random() < 0.95) { - changePixel(pixel,"dust"); - } - else { - changePixel(pixel,"calcium"); + else if (pixel.dir === "down") { + if (isEmpty(pixel.x,pixel.y+1)) { + if (Math.random() > 0.2) { + createPixel("attached_hair",pixel.x,pixel.y+1) + pixelMap[pixel.x][pixel.y+1].dir = "down" + } + else { + createPixel("hair_end",pixel.x,pixel.y+1) + pixelMap[pixel.x][pixel.y+1].dir = "down" + } } } - else { - if (Math.random() < 0.999) { - changePixel(pixel,"dust"); + else if (pixel.dir === "left") { + if (isEmpty(pixel.x-1,pixel.y)) { + if (Math.random() > 0.2) { + createPixel("attached_hair",pixel.x-1,pixel.y) + pixelMap[pixel.x-1][pixel.y].dir = "left" + } + else { + createPixel("hair_end",pixel.x-1,pixel.y) + pixelMap[pixel.x-1][pixel.y].dir = "left" + } } - else { - changePixel(pixel,"calcium"); + } + else if (pixel.dir === "right") { + if (isEmpty(pixel.x+1,pixel.y)) { + if (Math.random() > 0.2) { + createPixel("attached_hair",pixel.x+1,pixel.y) + pixelMap[pixel.x+1][pixel.y].dir = "right" + } + else { + createPixel("hair_end",pixel.x+1,pixel.y) + pixelMap[pixel.x+1][pixel.y].dir = "right" + } } } } - 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 (pixel.dir === "up") { + if (isEmpty(pixel.x,pixel.y+1)) { + changePixel(pixel,"loose_hair"); + } + else if (!isEmpty(pixel.x,pixel.y+1,true)) { + if (elements[pixelMap[pixel.x][pixel.y+1].element].isHair != true) { + changePixel(pixel,"loose_hair"); } } } - 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 + else if (pixel.dir === "down") { + if (isEmpty(pixel.x,pixel.y-1)) { + changePixel(pixel,"loose_hair"); + } + else if (!isEmpty(pixel.x,pixel.y-1,true)) { + if (elements[pixelMap[pixel.x][pixel.y-1].element].isHair != true) { + changePixel(pixel,"loose_hair"); } } } - 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 + else if (pixel.dir === "left") { + if (isEmpty(pixel.x+1,pixel.y)) { + changePixel(pixel,"loose_hair"); + } + else if (!isEmpty(pixel.x+1,pixel.y,true)) { + if (elements[pixelMap[pixel.x+1][pixel.y].element].isHair != true) { + changePixel(pixel,"loose_hair"); } } } - 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 + else if (pixel.dir === "right") { + if (isEmpty(pixel.x-1,pixel.y)) { + changePixel(pixel,"loose_hair"); + } + else if (!isEmpty(pixel.x-1,pixel.y,true)) { + if (elements[pixelMap[pixel.x-1][pixel.y].element].isHair != true) { + changePixel(pixel,"loose_hair"); } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 + } + } + else if (!pixel.dir && pixel.age > 10) { + changePixel(pixel,"loose_hair"); + } + if (pixel.temp < 5 && Math.random() < 0.01) { + 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)) { + pixel.temp += 10; + break; } } } + if (pixel.temp < 10 && Math.random() < 0.1) { + pixel.temp += 1; + } + doDefaults(pixel); + pixel.age++ + }, + properties: { + age: 0, }, density: 2710, state: "solid", conduct: .001, - tempHigh: 210, - stateHigh: "cooked_meat", tempLow: -25, - stateLow: "frozen_meat", - breakInto: ["blood","meat"], + stateLow: "loose_hair", + tempHigh: 123, + stateHigh: "loose_hair", + burn:15, + burnTime: 400, + burnInto:"loose_hair", + breakInto:"loose_hair", 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:null, chance:0.0005 }, + "radiation": { elem1:["ash","dust"], chance:0.2 }, }, - properties: { - oxygen: 1000, - nutrition: 1000, - speed: 0, - }, - isBio: true, + isHair: true, movable: false, + hidden: true, } -elements.scale_dermis = { - color: "#CFA08B", +elements.hairy_skin = { + color: "#ECDCC3", category: "structural", behavior: behaviors.WALL, hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - if (Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) && Math.random() < 0.005) { + if (Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) && Math.random() < 0.01) { + if (isEmpty(pixel.x,pixel.y-1)) { + createPixel("attached_hair",pixel.x,pixel.y-1) + pixelMap[pixel.x][pixel.y-1].dir = "up" + } + if (isEmpty(pixel.x,pixel.y+1)) { + createPixel("attached_hair",pixel.x,pixel.y+1) + pixelMap[pixel.x][pixel.y+1].dir = "down" + } + + if (isEmpty(pixel.x-1,pixel.y)) { + createPixel("attached_hair",pixel.x-1,pixel.y) + pixelMap[pixel.x-1][pixel.y].dir = "left" + } + + if (isEmpty(pixel.x+1,pixel.y)) { + createPixel("attached_hair",pixel.x+1,pixel.y) + pixelMap[pixel.x+1][pixel.y].dir = "right" + } + + } + 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)) { - createPixel("scales",x,y); + if (pixel.temp > 35) { + pixel.temp -= 20; + createPixel("salt_water",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.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-- @@ -1249,8 +1191,8 @@ elements.scale_dermis = { } 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"); @@ -1258,18 +1200,15 @@ elements.scale_dermis = { } else if (pixel.temp < -15) { if (Math.random() < 0.75) { - changePixel(pixel,"meat"); - } - else { - changePixel(pixel,"frozen_meat"); + changePixel(pixel,"dust"); } } else { if (Math.random() < 0.999) { - changePixel(pixel,"meat"); + changePixel(pixel,"dust"); } else { - changePixel(pixel,"rotten_meat"); + changePixel(pixel,"meat"); } } } @@ -1359,9 +1298,9 @@ elements.scale_dermis = { tempLow: -25, stateLow: "frozen_meat", burn: 5, - burnTime: 350, + burnTime: 375, burnInto: "cooked_meat", - breakInto: ["blood","meat"], + breakInto: ["blood","meat","dust","dust","dust","dust"], forceSaveColor: true, reactions: { "cancer": { elem1:"cancer", chance:0.0005 }, @@ -1372,12 +1311,13 @@ elements.scale_dermis = { nutrition: 1000, speed: 0, }, + isHair: true, isBio: true, movable: false, } -elements.bug_dermis = { - color: "#C6AD5B", +elements.hair_dermis = { + color: "#C89985", category: "structural", behavior: behaviors.WALL, hoverStat: function(pixel) { @@ -1390,7 +1330,12 @@ elements.bug_dermis = { var x = pixel.x + coords[0]; var y = pixel.y + coords[1]; if (isEmpty(x,y)) { - createPixel("exoskeleton",x,y); + if (Math.random() > 0.05) { + createPixel("hairy_skin",x,y); + } + else { + createPixel("epidermis",x,y); + } } } } @@ -1511,7 +1456,7 @@ elements.bug_dermis = { tempLow: -25, stateLow: "frozen_meat", burn: 5, - burnTime: 350, + burnTime: 360, burnInto: "cooked_meat", breakInto: ["blood","meat"], forceSaveColor: true, @@ -1524,57 +1469,50 @@ elements.bug_dermis = { nutrition: 1000, speed: 0, }, + isHair: true, isBio: true, movable: false, } -elements.amphib_dermis = { - color: "#9DAB6A", - name: "amphibian_dermis", +elements.scales = { + color: "#6b839a", category: "structural", behavior: behaviors.WALL, hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - if (Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) && 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)) { - createPixel("amphib_skin",x,y); - } - } + if (pixel.temp > 40 && Math.random() < 0.1) { + pixel.temp -= 1; } doDefaults(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)) { + if (Math.random() > 0.92 && 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.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"); } } } @@ -1659,18 +1597,15 @@ elements.amphib_dermis = { density: 2710, state: "solid", conduct: .001, - tempHigh: 200, + tempHigh: 210, stateHigh: "cooked_meat", tempLow: -25, stateLow: "frozen_meat", - burn: 5, - burnTime: 350, - burnInto: "cooked_meat", - breakInto: ["blood","meat","meat","slime","slime"], + breakInto: ["blood","meat"], forceSaveColor: true, reactions: { - "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","slime","meat","rotten_meat","cooked_meat","flesh"], chance:0.2 }, + "cancer": { elem1:"cancer", chance:0.000075 }, + "radiation": { elem1:["calcium","calcium","ash","meat","rotten_meat","cooked_meat","skin","epidermis"], chance:0.1 }, }, properties: { oxygen: 1000, @@ -1681,14 +1616,25 @@ elements.amphib_dermis = { movable: false, } -elements.acidic_flesh = { - color: ["#946231","#976E30"], +elements.scale_dermis = { + color: "#CFA08B", category: "structural", behavior: behaviors.WALL, hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { + if (Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) && 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)) { + createPixel("scales",x,y); + } + } + } + doDefaults(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 -= 2 @@ -1698,30 +1644,24 @@ elements.acidic_flesh = { if (Math.random() < 0.75) { changePixel(pixel,"meat"); } - else if (Math.random() < 0.5) { - changePixel(pixel,"cooked_meat"); - } else { - changePixel(pixel,"acid"); + changePixel(pixel,"cooked_meat"); } } else if (pixel.temp < -15) { if (Math.random() < 0.75) { changePixel(pixel,"meat"); } - else if (Math.random() < 0.5) { - changePixel(pixel,"frozen_meat"); - } else { - changePixel(pixel,"acid"); + changePixel(pixel,"frozen_meat"); } } else { - if (Math.random() < 0.95) { + if (Math.random() < 0.999) { changePixel(pixel,"meat"); } else { - changePixel(pixel,"acid"); + changePixel(pixel,"rotten_meat"); } } } @@ -1807,16 +1747,17 @@ elements.acidic_flesh = { state: "solid", conduct: .001, tempHigh: 200, - stateHigh: ["acid_gas","cooked_meat","cooked_meat","cooked_meat"], + stateHigh: "cooked_meat", tempLow: -25, - stateLow: ["frozen_meat","acid","acid"], + stateLow: "frozen_meat", burn: 5, burnTime: 350, - burnInto: ["acid_gas","cooked_meat","cooked_meat"], - breakInto: ["acid","acid","meat"], + burnInto: "cooked_meat", + breakInto: ["blood","meat"], + forceSaveColor: true, reactions: { - "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","acid","fat","meat","rotten_meat","cooked_meat"], chance:0.4 }, + "cancer": { elem1:"cancer", chance:0.0005 }, + "radiation": { elem1:["ash","meat","rotten_meat","cooked_meat","flesh"], chance:0.2 }, }, properties: { oxygen: 1000, @@ -1827,14 +1768,25 @@ elements.acidic_flesh = { movable: false, } -elements.slimey_flesh = { - color: ["#8EA714","#96B013"], +elements.bug_dermis = { + color: "#C6AD5B", category: "structural", behavior: behaviors.WALL, hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { + if (Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) && 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)) { + createPixel("exoskeleton",x,y); + } + } + } + doDefaults(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 -= 2 @@ -1844,30 +1796,24 @@ elements.slimey_flesh = { if (Math.random() < 0.75) { changePixel(pixel,"meat"); } - else if (Math.random() < 0.5) { - changePixel(pixel,"cooked_meat"); - } else { - changePixel(pixel,"slime"); + changePixel(pixel,"cooked_meat"); } } else if (pixel.temp < -15) { if (Math.random() < 0.75) { changePixel(pixel,"meat"); } - else if (Math.random() < 0.5) { - changePixel(pixel,"frozen_meat"); - } else { - changePixel(pixel,"slime"); + changePixel(pixel,"frozen_meat"); } } else { - if (Math.random() < 0.95) { + if (Math.random() < 0.999) { changePixel(pixel,"meat"); } else { - changePixel(pixel,"slime"); + changePixel(pixel,"rotten_meat"); } } } @@ -1953,16 +1899,17 @@ elements.slimey_flesh = { state: "solid", conduct: .001, tempHigh: 200, - stateHigh: ["slime","cooked_meat","cooked_meat","cooked_meat"], + stateHigh: "cooked_meat", tempLow: -25, - stateLow: ["frozen_meat","slime_ice","slime_ice"], + stateLow: "frozen_meat", burn: 5, burnTime: 350, - burnInto: ["slime","cooked_meat","cooked_meat"], - breakInto: ["slime","slime","meat"], + burnInto: "cooked_meat", + breakInto: ["blood","meat"], + forceSaveColor: true, reactions: { - "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","slime","slime","meat","rotten_meat","cooked_meat"], chance:0.4 }, + "cancer": { elem1:"cancer", chance:0.0005 }, + "radiation": { elem1:["ash","meat","rotten_meat","cooked_meat","flesh"], chance:0.2 }, }, properties: { oxygen: 1000, @@ -1973,15 +1920,28 @@ elements.slimey_flesh = { movable: false, } -elements.adipose = { - color: ["#C3A375","#B9945A"], - category: "nutrition", +elements.amphib_dermis = { + color: "#9DAB6A", + name: "amphibian_dermis", + category: "structural", behavior: behaviors.WALL, 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) { + if (Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) && 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)) { + createPixel("amphib_skin",x,y); + } + } + } + doDefaults(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 -= 2 } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { @@ -1990,7 +1950,7 @@ elements.adipose = { changePixel(pixel,"meat"); } else { - changePixel(pixel,"grease"); + changePixel(pixel,"cooked_meat"); } } else if (pixel.temp < -15) { @@ -1998,7 +1958,7 @@ elements.adipose = { changePixel(pixel,"meat"); } else { - changePixel(pixel,"fat"); + changePixel(pixel,"frozen_meat"); } } else { @@ -2006,26 +1966,33 @@ elements.adipose = { changePixel(pixel,"meat"); } else { - changePixel(pixel,"grease"); + changePixel(pixel,"rotten_meat"); } } } if (pixel.nutrition === null || isNaN(pixel.nutrition)) { - pixel.nutrition = 1000 + 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 += 15 - pixel.oxygen -= 15 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 5 - pixel.nutrition -= 5 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } @@ -2033,12 +2000,16 @@ elements.adipose = { 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 += 15 - pixel.oxygen -= 15 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 5 - pixel.nutrition -= 5 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } @@ -2046,12 +2017,16 @@ elements.adipose = { 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 += 15 - pixel.oxygen -= 15 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 5 - pixel.nutrition -= 5 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } @@ -2059,56 +2034,88 @@ elements.adipose = { 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 += 15 - pixel.oxygen -= 15 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 5 - pixel.nutrition -= 5 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } }, density: 2710, state: "solid", - conduct: .03, + conduct: .001, tempHigh: 200, - stateHigh: ["fat","fat","fat","cooked_meat"], + stateHigh: "cooked_meat", tempLow: -25, - stateLow: ["fat","frozen_meat"], - burn: 10, - burnTime: 300, - burnInto: ["fat","fat","fat","cooked_meat"], - breakInto: ["fat","meat"], + stateLow: "frozen_meat", + burn: 5, + burnTime: 350, + burnInto: "cooked_meat", + breakInto: ["blood","meat","meat","slime","slime"], + forceSaveColor: true, reactions: { - "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","blood","fat","fat","fat","fat","fat","meat","rotten_meat","cooked_meat"], chance:0.4 }, + "cancer": { elem1:"cancer", chance:0.0005 }, + "radiation": { elem1:["ash","slime","meat","rotten_meat","cooked_meat","flesh"], chance:0.2 }, }, properties: { oxygen: 1000, - nutrition: 1005, + nutrition: 1000, + speed: 0, }, isBio: true, movable: false, } -elements.acid_vessel = { - color: "#BF6B0E", - behavior: [ - "XX|SW:acid_vessel%1|XX", - "SW:acid_vessel%1|XX|SW:acid_vessel%1", - "XX|SW:acid_vessel%1|XX", - ], +elements.acidic_flesh = { + color: ["#946231","#976E30"], + category: "structural", + behavior: behaviors.WALL, hoverStat: function(pixel) { 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.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 -= 2 } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { - changePixel(pixel,"acid"); + if (pixel.temp > 95) { + if (Math.random() < 0.75) { + changePixel(pixel,"meat"); + } + else if (Math.random() < 0.5) { + changePixel(pixel,"cooked_meat"); + } + else { + changePixel(pixel,"acid"); + } + } + else if (pixel.temp < -15) { + if (Math.random() < 0.75) { + changePixel(pixel,"meat"); + } + else if (Math.random() < 0.5) { + changePixel(pixel,"frozen_meat"); + } + else { + changePixel(pixel,"acid"); + } + } + else { + if (Math.random() < 0.95) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"acid"); + } + } } if (pixel.nutrition === null || isNaN(pixel.nutrition)) { pixel.nutrition = 500 @@ -2123,12 +2130,12 @@ elements.acid_vessel = { 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 += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 @@ -2136,23 +2143,16 @@ elements.acid_vessel = { } } } - else if (isEmpty(pixel.x, pixel.y-1) && Math.random() > 0.75) { - if (Math.random() > 0.95) { - createPixel("acid",pixel.x,pixel.y-1) - } - 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].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 @@ -2160,23 +2160,16 @@ elements.acid_vessel = { } } } - else if (isEmpty(pixel.x, pixel.y+1) && Math.random() > 0.75) { - if (Math.random() > 0.95) { - createPixel("acid",pixel.x,pixel.y+1) - } - 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].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 @@ -2184,23 +2177,16 @@ elements.acid_vessel = { } } } - else if (isEmpty(pixel.x-1, pixel.y) && Math.random() > 0.75) { - if (Math.random() > 0.95) { - createPixel("acid",pixel.x-1,pixel.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].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 @@ -2208,73 +2194,72 @@ elements.acid_vessel = { } } } - else if (isEmpty(pixel.x+1, pixel.y) && Math.random() > 0.75) { - if (Math.random() > 0.95) { - createPixel("acid",pixel.x+1,pixel.y) - } - pixel.oxygen -= 50 - pixel.nutrition -= 50 - } }, - properties: { + density: 2710, + state: "solid", + conduct: .001, + tempHigh: 200, + stateHigh: ["acid_gas","cooked_meat","cooked_meat","cooked_meat"], + tempLow: -25, + stateLow: ["frozen_meat","acid","acid"], + burn: 5, + burnTime: 350, + burnInto: ["acid_gas","cooked_meat","cooked_meat"], + breakInto: ["acid","acid","meat"], + reactions: { + "cancer": { elem1:"cancer", chance:0.0005 }, + "radiation": { elem1:["ash","acid","fat","meat","rotten_meat","cooked_meat"], chance:0.4 }, + }, + properties: { oxygen: 1000, nutrition: 1000, speed: 0, }, - tempHigh: 175, - stateHigh: ["acid_gas","acid_gas","acid_gas","cooked_meat","cooked_meat"], - tempLow: -50, - stateLow: "frozen_meat", - burn: 20, - burnTime: 160, - burnInto: ["acid_gas","acid_gas","acid_gas","acid_gas","cooked_meat"], - breakInto: "acid", - category: "circulation", - state: "solid", - density: 1250, - conduct: .001, - movable: false, isBio: true, + movable: false, } -elements.heart = { - color: ["#98002e","#532e63","#6f1200","#551900"], - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|XX|XX", - ], +elements.slimey_flesh = { + color: ["#8EA714","#96B013"], + category: "structural", + behavior: behaviors.WALL, hoverStat: function(pixel) { 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) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { + 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 -= 2 } 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,"blood"); + changePixel(pixel,"meat"); } - else { + else if (Math.random() < 0.5) { changePixel(pixel,"cooked_meat"); } + else { + changePixel(pixel,"slime"); + } } else if (pixel.temp < -15) { if (Math.random() < 0.75) { - changePixel(pixel,"blood"); + changePixel(pixel,"meat"); } - else { + else if (Math.random() < 0.5) { changePixel(pixel,"frozen_meat"); } + else { + changePixel(pixel,"slime"); + } } else { if (Math.random() < 0.95) { changePixel(pixel,"meat"); } else { - changePixel(pixel,"blood"); + changePixel(pixel,"slime"); } } } @@ -2291,128 +2276,106 @@ elements.heart = { 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 += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } - if (elements[hitPixel.element].isBlood === true && hitPixel.heartAttached === false && Math.random() > 0.5) { - hitPixel.heartAttached = true + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } - else if (isEmpty(pixel.x, pixel.y-1) && Math.random() > 0.75) { - if (Math.random() > 0.95) { - createPixel("blood",pixel.x,pixel.y-1) - } - 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].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } - if (elements[hitPixel.element].isBlood === true && hitPixel.heartAttached === false && Math.random() > 0.5) { - hitPixel.heartAttached = true + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } - else if (isEmpty(pixel.x, pixel.y+1) && Math.random() > 0.75) { - if (Math.random() > 0.95) { - createPixel("blood",pixel.x,pixel.y+1) - } - 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].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } - if (elements[hitPixel.element].isBlood === true && hitPixel.heartAttached === false && Math.random() > 0.5) { - hitPixel.heartAttached = true + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } - else if (isEmpty(pixel.x-1, pixel.y) && Math.random() > 0.75) { - if (Math.random() > 0.95) { - createPixel("blood",pixel.x-1,pixel.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].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } - if (elements[hitPixel.element].isBlood === true && hitPixel.heartAttached === false && Math.random() > 0.5) { - hitPixel.heartAttached = true + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } - else if (isEmpty(pixel.x+1, pixel.y) && Math.random() > 0.75) { - if (Math.random() > 0.95) { - createPixel("blood",pixel.x+1,pixel.y) - } - pixel.oxygen -= 50 - pixel.nutrition -= 50 - } }, - properties: { + density: 2710, + state: "solid", + conduct: .001, + tempHigh: 200, + stateHigh: ["slime","cooked_meat","cooked_meat","cooked_meat"], + tempLow: -25, + stateLow: ["frozen_meat","slime_ice","slime_ice"], + burn: 5, + burnTime: 350, + burnInto: ["slime","cooked_meat","cooked_meat"], + breakInto: ["slime","slime","meat"], + reactions: { + "cancer": { elem1:"cancer", chance:0.0005 }, + "radiation": { elem1:["ash","slime","slime","meat","rotten_meat","cooked_meat"], chance:0.4 }, + }, + properties: { oxygen: 1000, nutrition: 1000, speed: 0, }, - tempHigh: 175, - stateHigh: "meat", - tempLow: -50, - stateLow: "frozen_meat", - burn: 20, - burnTime: 160, - burnInto: "meat", - breakInto: "blood", - category: "circulation", - state: "solid", - density: 1250, - conduct: .001, - movable: false, isBio: true, + movable: false, } -elements.kidney = { - color: ["#AB1354","#89212E","#74272E"], - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|XX|XX", - ], +elements.cloak_flesh = { + color: ["#879720","#8C9D1F"], + grain: 0, + category: "structural", + behavior: behaviors.WALL, hoverStat: function(pixel) { 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) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { + doDefaults(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 -= 2 } @@ -2455,20 +2418,24 @@ elements.kidney = { 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 += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } - 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 (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 + } + if (pixel.color != hitPixel.color) { + hitPixel.color = pixel.color + } + } + else if (elements[hitPixel.element].movable) { + if (pixel.color != hitPixel.color) { + pixel.color = hitPixel.color } } } @@ -2476,20 +2443,24 @@ elements.kidney = { 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 += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } - 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 (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 + } + if (pixel.color != hitPixel.color) { + hitPixel.color = pixel.color + } + } + else if (elements[hitPixel.element].movable) { + if (pixel.color != hitPixel.color) { + pixel.color = hitPixel.color } } } @@ -2497,20 +2468,24 @@ elements.kidney = { 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 += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } - 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 (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 + } + if (pixel.color != hitPixel.color) { + hitPixel.color = pixel.color + } + } + else if (elements[hitPixel.element].movable) { + if (pixel.color != hitPixel.color) { + pixel.color = hitPixel.color } } } @@ -2518,58 +2493,62 @@ elements.kidney = { 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 += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } - 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 (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 + } + if (pixel.color != hitPixel.color) { + hitPixel.color = pixel.color + } + } + else if (elements[hitPixel.element].movable) { + if (pixel.color != hitPixel.color) { + pixel.color = hitPixel.color } } } }, - properties: { - oxygen: 1000, - nutrition: 1000, - speed: 0, - }, - tempHigh: 175, - stateHigh: "meat", - tempLow: -50, - stateLow: "frozen_meat", - burn: 20, - burnTime: 160, - burnInto: "meat", - breakInto: "blood", - category: "circulation", + density: 2710, state: "solid", - density: 1250, conduct: .001, - movable: false, + tempHigh: 200, + stateHigh: "cooked_meat", + tempLow: -25, + stateLow: "frozen_meat", + burn: 4, + burnTime: 350, + burnInto: "cooked_meat", + breakInto: ["blood","meat"], + forceSaveColor: true, + reactions: { + "cancer": { elem1:"cancer", chance:0.0005 }, + "radiation": { elem1:["ash","meat","rotten_meat","cooked_meat","flesh"], chance:0.2 }, + }, + properties: { + oxygen: 1000, + nutrition: 1000, + speed: 0, + }, isBio: true, + movable: false, } -elements.liver = { - color: ["#6c2e1f","#7B2827","#702B27"], - behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|XX|XX", - ], +elements.adipose = { + color: ["#C3A375","#B9945A"], + category: "nutrition", + behavior: behaviors.WALL, hoverStat: function(pixel) { 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) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) { - pixel.nutrition-- + if (Math.random() > 0.92 && pixel.nutrition > 0 && pixel.oxygen > 0 || pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) { pixel.oxygen -= 2 } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { @@ -2578,7 +2557,7 @@ elements.liver = { changePixel(pixel,"meat"); } else { - changePixel(pixel,"cooked_meat"); + changePixel(pixel,"grease"); } } else if (pixel.temp < -15) { @@ -2586,20 +2565,20 @@ elements.liver = { changePixel(pixel,"meat"); } else { - changePixel(pixel,"frozen_meat"); + changePixel(pixel,"fat"); } } else { - if (Math.random() < 0.90) { + if (Math.random() < 0.999) { changePixel(pixel,"meat"); } else { - changePixel(pixel,"rotten_meat"); + changePixel(pixel,"grease"); } } } if (pixel.nutrition === null || isNaN(pixel.nutrition)) { - pixel.nutrition = 500 + pixel.nutrition = 1000 } if (pixel.oxygen === null || isNaN(pixel.oxygen)) { pixel.oxygen = 500 @@ -2607,19 +2586,20 @@ elements.liver = { if (pixel.speed === null || isNaN(pixel.speed)) { pixel.speed = 0 } - if (pixel.speed < -1 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { - 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 += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 15 + pixel.oxygen -= 15 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 5 + pixel.nutrition -= 5 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } @@ -2627,12 +2607,16 @@ elements.liver = { 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 += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 15 + pixel.oxygen -= 15 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 5 + pixel.nutrition -= 5 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } @@ -2640,12 +2624,16 @@ elements.liver = { 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 += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 15 + pixel.oxygen -= 15 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 5 + pixel.nutrition -= 5 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } @@ -2653,64 +2641,60 @@ elements.liver = { 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 += 25 - pixel.oxygen -= 25 + hitPixel.oxygen += 15 + pixel.oxygen -= 15 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 5 + pixel.nutrition -= 5 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } }, - properties: { + density: 2710, + state: "solid", + conduct: .03, + tempHigh: 200, + stateHigh: ["fat","fat","fat","cooked_meat"], + tempLow: -25, + stateLow: ["fat","frozen_meat"], + burn: 10, + burnTime: 300, + burnInto: ["fat","fat","fat","cooked_meat"], + breakInto: ["fat","meat"], + reactions: { + "cancer": { elem1:"cancer", chance:0.0005 }, + "radiation": { elem1:["ash","blood","fat","fat","fat","fat","fat","meat","rotten_meat","cooked_meat"], chance:0.4 }, + }, + properties: { oxygen: 1000, - nutrition: 1000, - speed: 0, + nutrition: 1005, }, - tempHigh: 175, - stateHigh: "meat", - tempLow: -50, - stateLow: "frozen_meat", - burn: 20, - burnTime: 160, - burnInto: "meat", - breakInto: "blood", - category: "nutrition", - state: "solid", - density: 1250, - conduct: .001, - movable: false, isBio: true, + movable: false, } -elements.blood_vessel = { - color: "#c72114", +elements.acid_vessel = { + color: "#BF6B0E", behavior: [ - "XX|SW:blood_vessel%1|XX", - "SW:blood_vessel%1|XX|SW:blood_vessel%1", - "XX|SW:blood_vessel%1|XX", + "XX|SW:acid_vessel%1|XX", + "SW:acid_vessel%1|XX|SW:acid_vessel%1", + "XX|SW:acid_vessel%1|XX", ], hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - if (Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) && Math.random() < 0.001) { - 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)) { - createPixel("flesh",x,y); - } - } - } if (Math.random() > 0.975 && pixel.nutrition > 0 && pixel.oxygen > 0 || pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) { pixel.nutrition-- - pixel.oxygen-- + pixel.oxygen -= 2 } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { - changePixel(pixel,"blood"); + changePixel(pixel,"acid"); } if (pixel.nutrition === null || isNaN(pixel.nutrition)) { pixel.nutrition = 500 @@ -2721,47 +2705,26 @@ 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) { if (hitPixel.oxygen < pixel.oxygen) { - if (pixel.heartAttached === true) { - hitPixel.oxygen += 35 - pixel.oxygen -= 34 - } - else { - hitPixel.oxygen += 25 - pixel.oxygen -= 25 - } + hitPixel.oxygen += 25 + pixel.oxygen -= 25 } if (hitPixel.nutrition < pixel.nutrition) { - if (pixel.heartAttached === true) { - hitPixel.nutrition += 30 - pixel.nutrition -= 29 - } - else { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 - } + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 pixel.speed -= 1 } - 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))) { + else if (isEmpty(pixel.x, pixel.y-1) && Math.random() > 0.75) { if (Math.random() > 0.95) { - createPixel("blood",pixel.x,pixel.y-1) + createPixel("acid",pixel.x,pixel.y-1) } pixel.oxygen -= 50 pixel.nutrition -= 50 @@ -2770,40 +2733,22 @@ elements.blood_vessel = { var hitPixel = pixelMap[pixel.x][pixel.y+1] if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - if (pixel.heartAttached === true) { - hitPixel.oxygen += 35 - pixel.oxygen -= 35 - } - else { - hitPixel.oxygen += 25 - pixel.oxygen -= 25 - } + hitPixel.oxygen += 25 + pixel.oxygen -= 25 } if (hitPixel.nutrition < pixel.nutrition) { - if (pixel.heartAttached === true) { - hitPixel.nutrition += 30 - pixel.nutrition -= 30 - } - else { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 - } + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 pixel.speed -= 1 } - 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))) { + else if (isEmpty(pixel.x, pixel.y+1) && Math.random() > 0.75) { if (Math.random() > 0.95) { - createPixel("blood",pixel.x,pixel.y+1) + createPixel("acid",pixel.x,pixel.y+1) } pixel.oxygen -= 50 pixel.nutrition -= 50 @@ -2812,40 +2757,22 @@ elements.blood_vessel = { var hitPixel = pixelMap[pixel.x-1][pixel.y] if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - if (pixel.heartAttached === true) { - hitPixel.oxygen += 35 - pixel.oxygen -= 35 - } - else { - hitPixel.oxygen += 25 - pixel.oxygen -= 25 - } + hitPixel.oxygen += 25 + pixel.oxygen -= 25 } if (hitPixel.nutrition < pixel.nutrition) { - if (pixel.heartAttached === true) { - hitPixel.nutrition += 30 - pixel.nutrition -= 30 - } - else { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 - } + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 2 - pixel.speed -= 2 - } - 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 + hitPixel.speed += 1 + pixel.speed -= 1 } } } - else if (isEmpty(pixel.x-1, pixel.y) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + else if (isEmpty(pixel.x-1, pixel.y) && Math.random() > 0.75) { if (Math.random() > 0.95) { - createPixel("blood",pixel.x-1,pixel.y) + createPixel("acid",pixel.x-1,pixel.y) } pixel.oxygen -= 50 pixel.nutrition -= 50 @@ -2854,40 +2781,22 @@ elements.blood_vessel = { var hitPixel = pixelMap[pixel.x+1][pixel.y] if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - if (pixel.heartAttached === true) { - hitPixel.oxygen += 35 - pixel.oxygen -= 35 - } - else { - hitPixel.oxygen += 25 - pixel.oxygen -= 25 - } + hitPixel.oxygen += 25 + pixel.oxygen -= 25 } if (hitPixel.nutrition < pixel.nutrition) { - if (pixel.heartAttached === true) { - hitPixel.nutrition += 30 - pixel.nutrition -= 30 - } - else { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 - } + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 pixel.speed -= 1 } - 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))) { + else if (isEmpty(pixel.x+1, pixel.y) && Math.random() > 0.75) { if (Math.random() > 0.95) { - createPixel("blood",pixel.x+1,pixel.y) + createPixel("acid",pixel.x+1,pixel.y) } pixel.oxygen -= 50 pixel.nutrition -= 50 @@ -2896,43 +2805,64 @@ elements.blood_vessel = { properties: { oxygen: 1000, nutrition: 1000, - heartAttached: false, - kidneyAttached: false, + speed: 0, }, tempHigh: 175, - stateHigh: "meat", + stateHigh: ["acid_gas","acid_gas","acid_gas","cooked_meat","cooked_meat"], tempLow: -50, stateLow: "frozen_meat", burn: 20, burnTime: 160, - burnInto: "meat", - breakInto: "blood", + burnInto: ["acid_gas","acid_gas","acid_gas","acid_gas","cooked_meat"], + breakInto: "acid", category: "circulation", state: "solid", density: 1250, conduct: .001, movable: false, isBio: true, - isBlood: true, } -elements.white_blood_cell = { - color: "#F5D7D4", +elements.heart = { + color: ["#98002e","#532e63","#6f1200","#551900"], behavior: [ - "XX|SW:blood,blood_vessel%1|XX", - "SW:blood,blood_vessel%1 AND M2%10|XX|SW:blood,blood_vessel%1 AND M2%10", - "M2|SW:blood,blood_vessel%1 AND M1|M2", + "XX|XX|XX", + "XX|XX|XX", + "XX|XX|XX", ], hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - if (Math.random() > 0.975 && 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 -= 2 } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { - changePixel(pixel,"blood"); + if (pixel.temp > 95) { + if (Math.random() < 0.75) { + changePixel(pixel,"blood"); + } + else { + changePixel(pixel,"cooked_meat"); + } + } + else if (pixel.temp < -15) { + if (Math.random() < 0.75) { + changePixel(pixel,"blood"); + } + else { + changePixel(pixel,"frozen_meat"); + } + } + else { + if (Math.random() < 0.95) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"blood"); + } + } } if (pixel.nutrition === null || isNaN(pixel.nutrition)) { pixel.nutrition = 500 @@ -2943,9 +2873,6 @@ 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))) { - changePixel(pixel,"blood_vessel"); - } 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) { @@ -2957,18 +2884,18 @@ elements.white_blood_cell = { hitPixel.nutrition += 20 pixel.nutrition -= 20 } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 - } - if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { + if (elements[hitPixel.element].isBlood === 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) { + if (Math.random() > 0.95) { + createPixel("blood",pixel.x,pixel.y-1) + } + 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].isBio === true && Math.random() > 0.5) { @@ -2980,18 +2907,18 @@ elements.white_blood_cell = { hitPixel.nutrition += 20 pixel.nutrition -= 20 } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 - } - if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { + if (elements[hitPixel.element].isBlood === 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) { + if (Math.random() > 0.95) { + createPixel("blood",pixel.x,pixel.y+1) + } + 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].isBio === true && Math.random() > 0.5) { @@ -3003,18 +2930,18 @@ elements.white_blood_cell = { hitPixel.nutrition += 20 pixel.nutrition -= 20 } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 - } - if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { + if (elements[hitPixel.element].isBlood === 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) { + if (Math.random() > 0.95) { + createPixel("blood",pixel.x-1,pixel.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].isBio === true && Math.random() > 0.5) { @@ -3026,33 +2953,24 @@ elements.white_blood_cell = { hitPixel.nutrition += 20 pixel.nutrition -= 20 } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 - } - if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) { + if (elements[hitPixel.element].isBlood === 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) { + if (Math.random() > 0.95) { + createPixel("blood",pixel.x+1,pixel.y) + } + pixel.oxygen -= 50 + pixel.nutrition -= 50 + } }, properties: { oxygen: 1000, nutrition: 1000, - heartAttached: false, - kidneyAttached: false, + speed: 0, }, - reactions: { - "cancer": { elem2:"flesh", chance:10 }, - "infection": { elem2:"blood_vessel", chance:10 }, - "plague": { elem2:null, chance:10 }, - "cell": { elem2:"flesh", chance:10 }, - "rotten_meat": { elem2:"flesh", chance:10 }, - "meat": { elem2:"flesh", chance:10 }, - }, tempHigh: 175, stateHigh: "meat", tempLow: -50, @@ -3067,29 +2985,47 @@ elements.white_blood_cell = { conduct: .001, movable: false, isBio: true, - isBlood: true, } -elements.eye = { - color: "#451800", - category: "nervous system", +elements.kidney = { + color: ["#AB1354","#89212E","#74272E"], + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|XX|XX", + ], hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - doHeat(pixel); - doBurning(pixel); - doElectricity(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.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 -= 2 } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { - if (Math.random() < 0.95) { - changePixel(pixel,"meat"); + 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 { - changePixel(pixel,"salt_water"); + if (Math.random() < 0.999) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"rotten_meat"); + } } } if (pixel.nutrition === null || isNaN(pixel.nutrition)) { @@ -3103,186 +3039,149 @@ elements.eye = { } if (!isEmpty(pixel.x, pixel.y-1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y-1] - doElectricity(hitPixel); - if (elements[hitPixel.element].id === elements.light.id) { - pixel.saw = true - } - else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye.id && Math.random() > 0.5) { - 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))) { - if (!hitPixel.charge) { - hitPixel.charge = 0.1 - } - else if (hitPixel.charge) { - hitPixel.charge += 0.1 - } - pixel.saw = false - } - 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 + hitPixel.oxygen += 25 + pixel.oxygen -= 25 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 + 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 (!isEmpty(pixel.x, pixel.y+1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y+1] - doElectricity(hitPixel); - if (elements[hitPixel.element].id === elements.light.id && Math.random() > 0.5) { - pixel.saw = true - } - else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye.id && Math.random() > 0.5) { - 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))) { - if (!hitPixel.charge) { - hitPixel.charge = 0.1 - } - else if (hitPixel.charge) { - hitPixel.charge += 0.1 - } - pixel.saw = false - } - 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 + hitPixel.oxygen += 25 + pixel.oxygen -= 25 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 + 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 (!isEmpty(pixel.x-1, pixel.y, true)) { var hitPixel = pixelMap[pixel.x-1][pixel.y] - doElectricity(hitPixel); - if (elements[hitPixel.element].id === elements.light.id && Math.random() > 0.5) { - pixel.saw = true - } - else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye.id && Math.random() > 0.5) { - 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))) { - if (!hitPixel.charge) { - hitPixel.charge = 0.1 - } - else if (hitPixel.charge) { - hitPixel.charge += 0.1 - } - pixel.saw = false - } - 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 + hitPixel.oxygen += 25 + pixel.oxygen -= 25 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 + 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 (!isEmpty(pixel.x+1, pixel.y, true)) { var hitPixel = pixelMap[pixel.x+1][pixel.y] - doElectricity(hitPixel); - if (elements[hitPixel.element].id === elements.light.id && Math.random() > 0.5) { - pixel.saw = true - } - else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye.id && Math.random() > 0.5) { - 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))) { - if (!hitPixel.charge) { - hitPixel.charge = 0.1 - } - else if (hitPixel.charge) { - hitPixel.charge += 0.1 - } - pixel.saw = false - } - 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 + hitPixel.oxygen += 25 + pixel.oxygen -= 25 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 + 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"); + } } } } }, - density: 2710, - state: "solid", - tempHigh: 200, - stateHigh: ["cooked_meat","salt_water","blood"], - tempLow: -25, - stateLow: ["salt_water","cerebrospinal_fluid","salt_water","blood","frozen_meat"], - burn: 5, - burnTime: 350, - conduct: .001, - burnInto: ["cooked_meat","salt_water","blood"], - breakInto: ["blood","blood","blood","blood","cerebrospinal_fluid","cerebrospinal_fluid","salt_water","meat"], - 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.5 }, - }, - properties: { + properties: { oxygen: 1000, nutrition: 1000, - saw: false, + speed: 0, }, - isBio: true, + tempHigh: 175, + stateHigh: "meat", + tempLow: -50, + stateLow: "frozen_meat", + burn: 20, + burnTime: 160, + burnInto: "meat", + breakInto: "blood", + category: "circulation", + state: "solid", + density: 1250, + conduct: .001, movable: false, + isBio: true, } -elements.olfactory_bulb = { - color: "#8A7650", - category: "nervous system", +elements.liver = { + color: ["#6c2e1f","#7B2827","#702B27"], + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|XX|XX", + ], hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - doHeat(pixel); - doBurning(pixel); - doElectricity(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.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 -= 2 } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { - if (Math.random() < 0.85) { - changePixel(pixel,"meat"); + 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 { - changePixel(pixel,"rotten_meat"); + if (Math.random() < 0.90) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"rotten_meat"); + } } } if (pixel.nutrition === null || isNaN(pixel.nutrition)) { @@ -3294,36 +3193,15 @@ elements.olfactory_bulb = { if (pixel.speed === null || isNaN(pixel.speed)) { pixel.speed = 0 } + if (pixel.speed < -1 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + pixel.speed += 1 + } if (!isEmpty(pixel.x, pixel.y-1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y-1] - doElectricity(hitPixel); - if ((elements[hitPixel.element].id === elements.stench.id || elements[hitPixel.element].id === elements.fragrance.id || elements[hitPixel.element].id === elements.methane.id || elements[hitPixel.element].id === elements.ammonia.id) && Math.random() > 0.5) { - pixel.smell = true - deletePixel(hitPixel.x,hitPixel.y) - } - 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 (pixel.smell === true && elements[hitPixel.element].id === elements.olfactory_bulb.id && Math.random() > 0.5) { - 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))) { - if (!hitPixel.charge) { - hitPixel.charge = 0.1 - } - else if (hitPixel.charge) { - hitPixel.charge += 0.1 - } - pixel.smell = false - } - 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 += 20 - pixel.oxygen -= 20 + hitPixel.oxygen += 25 + pixel.oxygen -= 25 } if (hitPixel.nutrition < pixel.nutrition) { hitPixel.nutrition += 20 @@ -3333,34 +3211,10 @@ elements.olfactory_bulb = { } if (!isEmpty(pixel.x, pixel.y+1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y+1] - doElectricity(hitPixel); - if ((elements[hitPixel.element].id === elements.stench.id || elements[hitPixel.element].id === elements.fragrance.id || elements[hitPixel.element].id === elements.methane.id || elements[hitPixel.element].id === elements.ammonia.id) && Math.random() > 0.5) { - pixel.smell = true - deletePixel(hitPixel.x,hitPixel.y) - } - 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 (pixel.smell === true && elements[hitPixel.element].id === elements.olfactory_bulb.id && Math.random() > 0.5) { - 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))) { - if (!hitPixel.charge) { - hitPixel.charge = 0.1 - } - else if (hitPixel.charge) { - hitPixel.charge += 0.1 - } - pixel.smell = false - } - 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 += 20 - pixel.oxygen -= 20 + hitPixel.oxygen += 25 + pixel.oxygen -= 25 } if (hitPixel.nutrition < pixel.nutrition) { hitPixel.nutrition += 20 @@ -3370,34 +3224,10 @@ elements.olfactory_bulb = { } if (!isEmpty(pixel.x-1, pixel.y, true)) { var hitPixel = pixelMap[pixel.x-1][pixel.y] - doElectricity(hitPixel); - if ((elements[hitPixel.element].id === elements.stench.id || elements[hitPixel.element].id === elements.fragrance.id || elements[hitPixel.element].id === elements.methane.id || elements[hitPixel.element].id === elements.ammonia.id) && Math.random() > 0.5) { - pixel.smell = true - deletePixel(hitPixel.x,hitPixel.y) - } - 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 (pixel.smell === true && elements[hitPixel.element].id === elements.olfactory_bulb.id && Math.random() > 0.5) { - 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))) { - if (!hitPixel.charge) { - hitPixel.charge = 0.1 - } - else if (hitPixel.charge) { - hitPixel.charge += 0.1 - } - pixel.smell = false - } - 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 += 20 - pixel.oxygen -= 20 + hitPixel.oxygen += 25 + pixel.oxygen -= 25 } if (hitPixel.nutrition < pixel.nutrition) { hitPixel.nutrition += 20 @@ -3407,106 +3237,66 @@ elements.olfactory_bulb = { } if (!isEmpty(pixel.x+1, pixel.y, true)) { var hitPixel = pixelMap[pixel.x+1][pixel.y] - doElectricity(hitPixel); - if ((elements[hitPixel.element].id === elements.stench.id || elements[hitPixel.element].id === elements.fragrance.id || elements[hitPixel.element].id === elements.methane.id || elements[hitPixel.element].id === elements.ammonia.id) && Math.random() > 0.5) { - pixel.smell = true - deletePixel(hitPixel.x,hitPixel.y) - } - 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 (pixel.smell === true && elements[hitPixel.element].id === elements.olfactory_bulb.id && Math.random() > 0.5) { - 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))) { - if (!hitPixel.charge) { - hitPixel.charge = 0.1 - } - else if (hitPixel.charge) { - hitPixel.charge += 0.1 - } - pixel.smell = false - } - else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { - if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 20 - pixel.oxygen -= 20 - } - if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 - } + if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { + if (hitPixel.oxygen < pixel.oxygen) { + hitPixel.oxygen += 25 + pixel.oxygen -= 25 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 20 + pixel.nutrition -= 20 + } } } }, - density: 2710, - state: "solid", - tempHigh: 200, - stateHigh: ["cooked_meat","slime","blood"], - tempLow: -25, - stateLow: ["slime","slime","blood","frozen_meat"], - burn: 5, - burnTime: 350, - conduct: .001, - burnInto: ["cooked_meat","slime","blood"], - breakInto: ["blood","blood","meat","meat","slime","slime","slime","meat"], - forceSaveColor: true, - reactions: { - "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","steam","slime","ash","slime","slime","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 }, - }, - properties: { + properties: { oxygen: 1000, nutrition: 1000, - smell: false, + speed: 0, }, - isBio: true, + tempHigh: 175, + stateHigh: "meat", + tempLow: -50, + stateLow: "frozen_meat", + burn: 20, + burnTime: 160, + burnInto: "meat", + breakInto: "blood", + category: "nutrition", + state: "solid", + density: 1250, + conduct: .001, movable: false, + isBio: true, } -elements.brain = { - color: ["#fce3e3","#deb6c5","#f5ced5","#e87b8f"], - category: "nervous system", +elements.blood_vessel = { + color: "#c72114", + behavior: [ + "XX|SW:blood_vessel%1|XX", + "SW:blood_vessel%1|XX|SW:blood_vessel%1", + "XX|SW:blood_vessel%1|XX", + ], hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - doHeat(pixel); - doBurning(pixel); - doElectricity(pixel); - if ((Math.random() > 0.85 && 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() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) && Math.random() < 0.001) { + 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)) { + createPixel("flesh",x,y); + } + } + } + if (Math.random() > 0.975 && pixel.nutrition > 0 && pixel.oxygen > 0 || pixel.burning === true && 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) { - 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"); - } - } + changePixel(pixel,"blood"); } if (pixel.nutrition === null || isNaN(pixel.nutrition)) { pixel.nutrition = 500 @@ -3517,166 +3307,229 @@ elements.brain = { 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] - doElectricity(hitPixel); - if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { - pixel.chargeCD = 16 - hitPixel.charge = 0.5 - } - 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 + if (pixel.heartAttached === true) { + hitPixel.oxygen += 35 + pixel.oxygen -= 34 + } + else { + hitPixel.oxygen += 25 + pixel.oxygen -= 25 + } } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 + if (pixel.heartAttached === true) { + hitPixel.nutrition += 30 + pixel.nutrition -= 29 + } + else { + hitPixel.nutrition += 20 + pixel.nutrition -= 20 + } } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 pixel.speed -= 1 } + 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))) { + if (Math.random() > 0.95) { + createPixel("blood",pixel.x,pixel.y-1) + } + pixel.oxygen -= 50 + pixel.nutrition -= 50 + } if (!isEmpty(pixel.x, pixel.y+1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y+1] - doElectricity(hitPixel); - if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { - pixel.chargeCD = 16 - hitPixel.charge = 0.5 - } - 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 + if (pixel.heartAttached === true) { + hitPixel.oxygen += 35 + pixel.oxygen -= 35 + } + else { + hitPixel.oxygen += 25 + pixel.oxygen -= 25 + } } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 + if (pixel.heartAttached === true) { + hitPixel.nutrition += 30 + pixel.nutrition -= 30 + } + else { + hitPixel.nutrition += 20 + pixel.nutrition -= 20 + } } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 pixel.speed -= 1 } + 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))) { + if (Math.random() > 0.95) { + createPixel("blood",pixel.x,pixel.y+1) + } + pixel.oxygen -= 50 + pixel.nutrition -= 50 + } if (!isEmpty(pixel.x-1, pixel.y, true)) { var hitPixel = pixelMap[pixel.x-1][pixel.y] - doElectricity(hitPixel); - if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { - pixel.chargeCD = 16 - hitPixel.charge = 0.5 - } - 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 + if (pixel.heartAttached === true) { + hitPixel.oxygen += 35 + pixel.oxygen -= 35 + } + else { + hitPixel.oxygen += 25 + pixel.oxygen -= 25 + } } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 + if (pixel.heartAttached === true) { + hitPixel.nutrition += 30 + pixel.nutrition -= 30 + } + else { + hitPixel.nutrition += 20 + pixel.nutrition -= 20 + } } if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 + hitPixel.speed += 2 + pixel.speed -= 2 + } + 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))) { + if (Math.random() > 0.95) { + createPixel("blood",pixel.x-1,pixel.y) + } + pixel.oxygen -= 50 + pixel.nutrition -= 50 + } if (!isEmpty(pixel.x+1, pixel.y, true)) { var hitPixel = pixelMap[pixel.x+1][pixel.y] - doElectricity(hitPixel); - if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { - pixel.chargeCD = 16 - hitPixel.charge = 0.5 - } - 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 + if (pixel.heartAttached === true) { + hitPixel.oxygen += 35 + pixel.oxygen -= 35 + } + else { + hitPixel.oxygen += 25 + pixel.oxygen -= 25 + } } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 - } - if (hitPixel.speed < pixel.speed) { + if (pixel.heartAttached === true) { + hitPixel.nutrition += 30 + pixel.nutrition -= 30 + } + else { + hitPixel.nutrition += 20 + pixel.nutrition -= 20 + } + } + if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 pixel.speed -= 1 } + 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 (pixel.charge) { - pixel.charge = 0; - pixel.chargeCD = 16; + else if (isEmpty(pixel.x+1, pixel.y) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + if (Math.random() > 0.95) { + createPixel("blood",pixel.x+1,pixel.y) + } + pixel.oxygen -= 50 + pixel.nutrition -= 50 } }, - 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"], - forceSaveColor: true, - reactions: { - "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, - }, - properties: { + properties: { oxygen: 1000, nutrition: 1000, - speed: 0, + heartAttached: false, + kidneyAttached: false, }, - isBio: true, + tempHigh: 175, + stateHigh: "meat", + tempLow: -50, + stateLow: "frozen_meat", + burn: 20, + burnTime: 160, + burnInto: "meat", + breakInto: "blood", + category: "circulation", + state: "solid", + density: 1250, + conduct: .001, movable: false, + isBio: true, + isBlood: true, } -elements.amygdala = { // please please please ignore that i callled it the amygdala imstupid and trided to fix it IM SORGYRY - color: ["#B33E93","#B33E93","#f5ced5","#e87b8f"], - category: "nervous system", - name:"hypothalamus", - behavior: behaviors.WALL, +elements.infected_vessel = { + color: "#BF0347", + behavior: [ + "XX|SW:blood_vessel%1|XX", + "SW:blood_vessel%1|XX|SW:blood_vessel%1", + "XX|SW:blood_vessel%1|XX", + ], hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - doHeat(pixel); - doBurning(pixel); - doElectricity(pixel); - if (Math.random() > 0.895 && pixel.nutrition > 0 && pixel.oxygen > 0 || pixel.burning === true && 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 (Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) && Math.random() < 0.001) { + 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)) { + createPixel("flesh",x,y); } } } + if (Math.random() > 0.5 && pixel.nutrition > 0 && pixel.oxygen > 0 || pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) { + pixel.nutrition -= 5 + pixel.oxygen -= 5 + } + if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { + changePixel(pixel,"infection"); + } if (pixel.nutrition === null || isNaN(pixel.nutrition)) { pixel.nutrition = 500 } @@ -3690,140 +3543,231 @@ elements.amygdala = { // please please please ignore that i callled it the amygd 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 (pixel.heartAttached === true) { + hitPixel.oxygen += 35 + pixel.oxygen -= 40 + } + else { + hitPixel.oxygen += 25 + pixel.oxygen -= 30 + } } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 + if (pixel.heartAttached === true) { + hitPixel.nutrition += 30 + pixel.nutrition -= 35 + } + else { + hitPixel.nutrition += 20 + pixel.nutrition -= 25 + } } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 - pixel.speed -= 1 + pixel.speed -= 2 + } + if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) { + if (Math.random() > 0.95) { + changePixel(hitPixel,"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))) { + if (Math.random() > 0.95) { + createPixel("infection",pixel.x,pixel.y-1) + } + 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].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 10 - pixel.oxygen -= 10 + if (pixel.heartAttached === true) { + hitPixel.oxygen += 35 + pixel.oxygen -= 40 + } + else { + hitPixel.oxygen += 25 + pixel.oxygen -= 30 + } } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 + if (pixel.heartAttached === true) { + hitPixel.nutrition += 30 + pixel.nutrition -= 35 + } + else { + hitPixel.nutrition += 20 + pixel.nutrition -= 25 + } } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 - pixel.speed -= 1 + pixel.speed -= 2 + } + if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) { + if (Math.random() > 0.95) { + changePixel(hitPixel,"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))) { + if (Math.random() > 0.95) { + createPixel("infection",pixel.x,pixel.y+1) + } + 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].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 10 - pixel.oxygen -= 10 + if (pixel.heartAttached === true) { + hitPixel.oxygen += 35 + pixel.oxygen -= 40 + } + else { + hitPixel.oxygen += 25 + pixel.oxygen -= 30 + } } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 + if (pixel.heartAttached === true) { + hitPixel.nutrition += 30 + pixel.nutrition -= 35 + } + else { + hitPixel.nutrition += 20 + pixel.nutrition -= 25 + } } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 - pixel.speed -= 1 + pixel.speed -= 2 + } + if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) { + if (Math.random() > 0.95) { + changePixel(hitPixel,"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))) { + if (Math.random() > 0.95) { + createPixel("infection",pixel.x-1,pixel.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].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 10 - pixel.oxygen -= 10 + if (pixel.heartAttached === true) { + hitPixel.oxygen += 35 + pixel.oxygen -= 40 + } + else { + hitPixel.oxygen += 25 + pixel.oxygen -= 30 + } } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 + if (pixel.heartAttached === true) { + hitPixel.nutrition += 30 + pixel.nutrition -= 35 + } + else { + hitPixel.nutrition += 20 + pixel.nutrition -= 25 + } } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 - pixel.speed -= 1 + pixel.speed -= 2 + } + if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) { + if (Math.random() > 0.95) { + changePixel(hitPixel,"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 } } } - if (pixel.temp > 25) { pixel.temp -= 10; } - else if (pixel.temp < 15) { pixel.temp += 10; } - if (pixel.charge) { - pixel.charge = 0; - pixel.chargeCD = 16; + else if (isEmpty(pixel.x+1, pixel.y) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + if (Math.random() > 0.95) { + createPixel("infection",pixel.x+1,pixel.y) + } + pixel.oxygen -= 50 + pixel.nutrition -= 50 } }, - 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"], - 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 }, - }, - properties: { + properties: { oxygen: 1000, nutrition: 1000, - speed: 0, + heartAttached: false, + kidneyAttached: false, }, - isBio: true, + tempHigh: 175, + stateHigh: "meat", + tempLow: -50, + stateLow: "frozen_meat", + burn: 20, + burnTime: 160, + burnInto: "meat", + breakInto: "blood", + category: "circulation", + state: "solid", + density: 1250, + conduct: .001, movable: false, + isBio: true, + isBlood: true, } -elements.eye_nerve = { - color: "#B33E93", - category: "nervous system", - behavior: behaviors.WALL, +elements.white_blood_cell = { + color: "#F5D7D4", + behavior: [ + "XX|SW:blood_vessel%1|XX", + "SW:blood_vessel%1 AND M2%10|XX|SW:blood_vessel%1 AND M2%10", + "M2|SW:blood_vessel%1 AND M1|M2", + ], 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.975 && 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.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"); - } - } + changePixel(pixel,"blood"); } if (pixel.nutrition === null || isNaN(pixel.nutrition)) { pixel.nutrition = 500 @@ -3834,137 +3778,171 @@ elements.eye_nerve = { 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))) { + changePixel(pixel,"blood_vessel"); + } 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 + hitPixel.oxygen += 25 + pixel.oxygen -= 25 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 pixel.speed -= 1 } + if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.infected_vessel.id) { + changePixel(hitPixel,"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 + } } } 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 + hitPixel.oxygen += 25 + pixel.oxygen -= 25 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 pixel.speed -= 1 } + if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.infected_vessel.id) { + changePixel(hitPixel,"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 + } } } 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 + hitPixel.oxygen += 25 + pixel.oxygen -= 25 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 pixel.speed -= 1 } + if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.infected_vessel.id) { + changePixel(hitPixel,"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 + } } } 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 + hitPixel.oxygen += 25 + pixel.oxygen -= 25 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } if (hitPixel.speed < pixel.speed) { hitPixel.speed += 1 pixel.speed -= 1 } + if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) { + if (elements[hitPixel.element].id === elements.infected_vessel.id) { + changePixel(hitPixel,"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 + } } } }, - 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"], - 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 }, - }, - properties: { + properties: { oxygen: 1000, nutrition: 1000, - speed: 0, + heartAttached: false, + kidneyAttached: false, }, - isBio: true, + reactions: { + "cancer": { elem2:"flesh", chance:0.10 }, + "infected_vessel": { elem2:"blood_vessel", chance:0.10 }, + "plague": { elem2:null, chance:0.10 }, + "rotten_meat": { elem2:"flesh", chance:0.10 }, + }, + tempHigh: 175, + stateHigh: "meat", + tempLow: -50, + stateLow: "frozen_meat", + burn: 20, + burnTime: 160, + burnInto: "meat", + breakInto: "blood", + category: "circulation", + state: "solid", + density: 1250, + conduct: .001, movable: false, + isBio: true, + isBlood: true, } -elements.bulb_nerve = { - color: "#B33E93", +elements.eye = { + color: "#451800", category: "nervous system", - behavior: behaviors.WALL, hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - doDefaults(pixel); + doHeat(pixel); + doBurning(pixel); + doElectricity(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)) { 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.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"); - } + if (Math.random() < 0.95) { + changePixel(pixel,"meat"); } else { - if (Math.random() < 0.999) { - changePixel(pixel,"meat"); - } - else { - changePixel(pixel,"rotten_meat"); - } + changePixel(pixel,"salt_water"); } } if (pixel.nutrition === null || isNaN(pixel.nutrition)) { @@ -3978,7 +3956,24 @@ elements.bulb_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) { + doElectricity(hitPixel); + if (elements[hitPixel.element].id === elements.light.id) { + pixel.saw = true + } + else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye.id && Math.random() > 0.5) { + 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))) { + if (!hitPixel.charge) { + hitPixel.charge = 0.1 + } + else if (hitPixel.charge) { + hitPixel.charge += 0.1 + } + pixel.saw = false + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -3995,7 +3990,24 @@ elements.bulb_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) { + doElectricity(hitPixel); + if (elements[hitPixel.element].id === elements.light.id && Math.random() > 0.5) { + pixel.saw = true + } + else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye.id && Math.random() > 0.5) { + 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))) { + if (!hitPixel.charge) { + hitPixel.charge = 0.1 + } + else if (hitPixel.charge) { + hitPixel.charge += 0.1 + } + pixel.saw = false + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -4012,7 +4024,24 @@ elements.bulb_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) { + doElectricity(hitPixel); + if (elements[hitPixel.element].id === elements.light.id && Math.random() > 0.5) { + pixel.saw = true + } + else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye.id && Math.random() > 0.5) { + 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))) { + if (!hitPixel.charge) { + hitPixel.charge = 0.1 + } + else if (hitPixel.charge) { + hitPixel.charge += 0.1 + } + pixel.saw = false + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -4029,7 +4058,24 @@ elements.bulb_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) { + doElectricity(hitPixel); + if (elements[hitPixel.element].id === elements.light.id && Math.random() > 0.5) { + pixel.saw = true + } + else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye.id && Math.random() > 0.5) { + 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))) { + if (!hitPixel.charge) { + hitPixel.charge = 0.1 + } + else if (hitPixel.charge) { + hitPixel.charge += 0.1 + } + pixel.saw = false + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -4047,67 +4093,49 @@ elements.bulb_nerve = { }, density: 2710, state: "solid", - conduct: 1, tempHigh: 200, - stateHigh: "cooked_meat", + stateHigh: ["cooked_meat","salt_water","blood"], tempLow: -25, - stateLow: "frozen_meat", + stateLow: ["salt_water","cerebrospinal_fluid","salt_water","blood","frozen_meat"], burn: 5, burnTime: 350, - burnInto: "cooked_meat", - breakInto: ["blood","meat"], + conduct: .001, + burnInto: ["cooked_meat","salt_water","blood"], + breakInto: ["blood","blood","blood","blood","cerebrospinal_fluid","cerebrospinal_fluid","salt_water","meat"], 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","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 }, }, properties: { oxygen: 1000, nutrition: 1000, - speed: 0, + saw: false, }, isBio: true, movable: false, } - -elements.nerve = { - color: "#B33E93", +elements.olfactory_bulb = { + color: "#8A7650", category: "nervous system", - behavior: behaviors.WALL, hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - doDefaults(pixel); + doHeat(pixel); + doBurning(pixel); + doElectricity(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)) { 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.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"); - } + if (Math.random() < 0.85) { + changePixel(pixel,"meat"); } else { - if (Math.random() < 0.999) { - changePixel(pixel,"meat"); - } - else { - changePixel(pixel,"rotten_meat"); - } + changePixel(pixel,"rotten_meat"); } } if (pixel.nutrition === null || isNaN(pixel.nutrition)) { @@ -4121,111 +4149,189 @@ 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) { + doElectricity(hitPixel); + if ((elements[hitPixel.element].id === elements.smoke.id || elements[hitPixel.element].id === elements.stench.id || elements[hitPixel.element].id === elements.fragrance.id || elements[hitPixel.element].id === elements.methane.id || elements[hitPixel.element].id === elements.ammonia.id) && Math.random() > 0.5) { + pixel.smell = true + deletePixel(hitPixel.x,hitPixel.y) + } + 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 (pixel.smell === true && elements[hitPixel.element].id === elements.olfactory_bulb.id && Math.random() > 0.5) { + 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))) { + if (!hitPixel.charge) { + hitPixel.charge = 0.1 + } + else if (hitPixel.charge) { + hitPixel.charge += 0.1 + } + pixel.smell = false + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 10 - pixel.oxygen -= 10 + hitPixel.oxygen += 20 + pixel.oxygen -= 20 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 - } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } } } 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) { + doElectricity(hitPixel); + if ((elements[hitPixel.element].id === elements.smoke.id || elements[hitPixel.element].id === elements.stench.id || elements[hitPixel.element].id === elements.fragrance.id || elements[hitPixel.element].id === elements.methane.id || elements[hitPixel.element].id === elements.ammonia.id) && Math.random() > 0.5) { + pixel.smell = true + deletePixel(hitPixel.x,hitPixel.y) + } + 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 (pixel.smell === true && elements[hitPixel.element].id === elements.olfactory_bulb.id && Math.random() > 0.5) { + 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))) { + if (!hitPixel.charge) { + hitPixel.charge = 0.1 + } + else if (hitPixel.charge) { + hitPixel.charge += 0.1 + } + pixel.smell = false + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 10 - pixel.oxygen -= 10 + hitPixel.oxygen += 20 + pixel.oxygen -= 20 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 - } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } } } 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) { + doElectricity(hitPixel); + if ((elements[hitPixel.element].id === elements.smoke.id || elements[hitPixel.element].id === elements.stench.id || elements[hitPixel.element].id === elements.fragrance.id || elements[hitPixel.element].id === elements.methane.id || elements[hitPixel.element].id === elements.ammonia.id) && Math.random() > 0.5) { + pixel.smell = true + deletePixel(hitPixel.x,hitPixel.y) + } + 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 (pixel.smell === true && elements[hitPixel.element].id === elements.olfactory_bulb.id && Math.random() > 0.5) { + 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))) { + if (!hitPixel.charge) { + hitPixel.charge = 0.1 + } + else if (hitPixel.charge) { + hitPixel.charge += 0.1 + } + pixel.smell = false + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 10 - pixel.oxygen -= 10 + hitPixel.oxygen += 20 + pixel.oxygen -= 20 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 - } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } } } 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) { + doElectricity(hitPixel); + if ((elements[hitPixel.element].id === elements.smoke.id || elements[hitPixel.element].id === elements.stench.id || elements[hitPixel.element].id === elements.fragrance.id || elements[hitPixel.element].id === elements.methane.id || elements[hitPixel.element].id === elements.ammonia.id) && Math.random() > 0.5) { + pixel.smell = true + deletePixel(hitPixel.x,hitPixel.y) + } + 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 (pixel.smell === true && elements[hitPixel.element].id === elements.olfactory_bulb.id && Math.random() > 0.5) { + 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))) { + if (!hitPixel.charge) { + hitPixel.charge = 0.1 + } + else if (hitPixel.charge) { + hitPixel.charge += 0.1 + } + pixel.smell = false + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 10 - pixel.oxygen -= 10 + hitPixel.oxygen += 20 + pixel.oxygen -= 20 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 10 - pixel.nutrition -= 10 - } - if (hitPixel.speed < pixel.speed) { - hitPixel.speed += 1 - pixel.speed -= 1 + hitPixel.nutrition += 20 + pixel.nutrition -= 20 } } } }, density: 2710, state: "solid", - conduct: 1, tempHigh: 200, - stateHigh: "cooked_meat", + stateHigh: ["cooked_meat","slime","blood"], tempLow: -25, - stateLow: "frozen_meat", + stateLow: ["slime","slime","blood","frozen_meat"], burn: 5, burnTime: 350, - burnInto: "cooked_meat", - breakInto: ["blood","meat"], + conduct: .001, + burnInto: ["cooked_meat","slime","blood"], + breakInto: ["blood","blood","meat","meat","slime","slime","slime","meat"], 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","slime","ash","slime","slime","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 }, }, properties: { oxygen: 1000, nutrition: 1000, - speed: 0, + smell: false, }, isBio: true, movable: false, } -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", - ], +elements.brain = { + color: ["#fce3e3","#deb6c5","#f5ced5","#e87b8f"], + category: "nervous system", 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)) { + doHeat(pixel); + doBurning(pixel); + doElectricity(pixel); + if ((Math.random() > 0.85 && 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 } @@ -4266,7 +4372,12 @@ 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) { + doElectricity(hitPixel); + if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + pixel.chargeCD = 16 + hitPixel.charge = 0.5 + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -4283,11 +4394,16 @@ 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 (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 10 - pixel.oxygen -= 10 - } + doElectricity(hitPixel); + if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + pixel.chargeCD = 16 + hitPixel.charge = 0.5 + } + else 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 @@ -4300,7 +4416,12 @@ 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) { + doElectricity(hitPixel); + if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + pixel.chargeCD = 16 + hitPixel.charge = 0.5 + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -4317,7 +4438,12 @@ 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) { + doElectricity(hitPixel); + if (elements[hitPixel.element].id === elements.nerve.id && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { + pixel.chargeCD = 16 + hitPixel.charge = 0.5 + } + else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -4332,10 +4458,14 @@ elements.throat_lining = { } } } + if (pixel.charge) { + pixel.charge = 0; + pixel.chargeCD = 16; + } }, density: 2710, state: "solid", - conduct: .001, + conduct: 1, tempHigh: 200, stateHigh: "cooked_meat", tempLow: -25, @@ -4347,7 +4477,7 @@ elements.throat_lining = { 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","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, }, properties: { oxygen: 1000, @@ -4358,17 +4488,21 @@ elements.throat_lining = { movable: false, } -elements.intestines = { - color: "#bc6157", - category: "nutrition", +elements.amygdala = { // please please please ignore that i callled it the amygdala imstupid and trided to fix it IM SORGYRY + color: ["#B33E93","#B33E93","#f5ced5","#e87b8f"], + category: "nervous system", + name:"hypothalamus", behavior: behaviors.WALL, - hoverStat: function(pixel) { + 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)) { + doHeat(pixel); + doBurning(pixel); + doElectricity(pixel); + if (Math.random() > 0.895 && pixel.nutrition > 0 && pixel.oxygen > 0 || pixel.burning === true && 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) { @@ -4405,28 +4539,9 @@ elements.intestines = { 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.digested_material.id && Math.random() > 0.99) { - if (Math.random() > 0.5) { - changePixel(hitPixel,"poop"); - } - else if (Math.random() > 0.5) { - 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 @@ -4443,26 +4558,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 if (Math.random() > 0.5) { - 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 @@ -4479,24 +4575,7 @@ elements.intestines = { } 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 if (Math.random() > 0.5) { - 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 (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -4513,26 +4592,7 @@ elements.intestines = { } 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 if (Math.random() > 0.5) { - 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 @@ -4547,10 +4607,16 @@ elements.intestines = { } } } + if (pixel.temp > 25) { pixel.temp -= 10; } + else if (pixel.temp < 15) { pixel.temp += 10; } + if (pixel.charge) { + pixel.charge = 0; + pixel.chargeCD = 16; + } }, density: 2710, state: "solid", - conduct: .001, + conduct: 1, tempHigh: 200, stateHigh: "cooked_meat", tempLow: -25, @@ -4562,64 +4628,53 @@ elements.intestines = { 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","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, }, properties: { oxygen: 1000, nutrition: 1000, speed: 0, }, + isBio: true, movable: false, - isBio: true } -elements.appendix = { - color: "#B45942", - category: "nutrition", +elements.eye_nerve = { + color: "#B33E93", + category: "nervous system", behavior: behaviors.WALL, - hoverStat: function(pixel) { + 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)) { + 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)) { 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"); + changePixel(pixel,"cooked_meat"); } } 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"); + changePixel(pixel,"frozen_meat"); } } else { if (Math.random() < 0.999) { changePixel(pixel,"meat"); } - else if (Math.random() < 0.75) { - changePixel(pixel,"rotten_meat"); - } else { - changePixel(pixel,"stomach_acid"); + changePixel(pixel,"rotten_meat"); } } } @@ -4632,25 +4687,9 @@ elements.appendix = { if (pixel.speed === null || isNaN(pixel.speed)) { pixel.speed = 0 } - 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)) { + 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 @@ -4667,14 +4706,7 @@ elements.appendix = { } 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 @@ -4691,14 +4723,7 @@ elements.appendix = { } 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 @@ -4715,14 +4740,7 @@ elements.appendix = { } 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 @@ -4740,7 +4758,7 @@ elements.appendix = { }, density: 2710, state: "solid", - conduct: .001, + conduct: 1, tempHigh: 200, stateHigh: "cooked_meat", tempLow: -25, @@ -4748,37 +4766,31 @@ 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","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, }, properties: { oxygen: 1000, nutrition: 1000, speed: 0, }, + isBio: true, movable: false, - isBio: true } -elements.simple_lung = { - color: "#EB85D9", - category: "oxygen", +elements.bulb_nerve = { + color: "#B33E93", + category: "nervous system", behavior: behaviors.WALL, - hoverStat: function(pixel) { + 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)) { + 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)) { pixel.nutrition-- pixel.oxygen -= 2 } @@ -4814,10 +4826,10 @@ elements.simple_lung = { if (pixel.oxygen === null || isNaN(pixel.oxygen)) { pixel.oxygen = 500 } - if (pixel.speed === null || isNaN(pixel.speed)) { + if (pixel.l || 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 (hitPixel.oxygen < pixel.oxygen) { @@ -4833,12 +4845,6 @@ elements.simple_lung = { 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] @@ -4856,12 +4862,6 @@ elements.simple_lung = { 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] @@ -4879,12 +4879,6 @@ elements.simple_lung = { 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] @@ -4902,17 +4896,11 @@ elements.simple_lung = { 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, + conduct: 1, tempHigh: 200, stateHigh: "cooked_meat", tempLow: -25, @@ -4924,26 +4912,28 @@ elements.simple_lung = { 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 }, + "radiation": { elem1:["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, }, properties: { oxygen: 1000, nutrition: 1000, speed: 0, }, + isBio: true, movable: false, - isBio: true } -elements.lungs = { - color: "#d4aaab", - category: "oxygen", + +elements.nerve = { + color: "#B33E93", + category: "nervous system", behavior: behaviors.WALL, - hoverStat: function(pixel) { + 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)) { + 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)) { pixel.nutrition-- pixel.oxygen -= 2 } @@ -4982,15 +4972,9 @@ elements.lungs = { 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 @@ -5004,22 +4988,10 @@ elements.lungs = { 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.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 @@ -5033,22 +5005,10 @@ elements.lungs = { 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 (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5062,22 +5022,10 @@ elements.lungs = { 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 (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5091,17 +5039,11 @@ elements.lungs = { 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, + conduct: 1, tempHigh: 200, stateHigh: "cooked_meat", tempLow: -25, @@ -5113,53 +5055,30 @@ elements.lungs = { 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 }, + "radiation": { elem1:["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, }, properties: { oxygen: 1000, nutrition: 1000, speed: 0, }, + isBio: true, movable: false, - isBio: true } -elements.amphib_skin = { - name: "amphibian_skin", - color: "#7E9C33", - category: "oxygen", +elements.throat_lining = { + color: "#bc6157", + category: "nutrition", behavior: [ - "XX|CR:slime%0.001|XX", - "CR:slime%0.001|XX|CR:slime%0.001", - "XX|CR:slime%0.001|XX", + "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) { + 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; - } - 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 } @@ -5195,18 +5114,12 @@ elements.amphib_skin = { if (pixel.oxygen === null || isNaN(pixel.oxygen)) { pixel.oxygen = 500 } - if (pixel.speed === null || isNaN(pixel.speed)) { + if (pixel.l || 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 @@ -5220,22 +5133,10 @@ elements.amphib_skin = { 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.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 @@ -5249,22 +5150,10 @@ elements.amphib_skin = { 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 (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5278,22 +5167,10 @@ elements.amphib_skin = { 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 (elements[hitPixel.element].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 @@ -5307,26 +5184,23 @@ elements.amphib_skin = { 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","slime"], + tempHigh: 200, + stateHigh: "cooked_meat", tempLow: -25, - stateLow: ["frozen_meat","slime_ice","slime_ice"], - breakInto: ["blood","meat","slime","slime"], + stateLow: "frozen_meat", + burn: 5, + burnTime: 350, + burnInto: "cooked_meat", + breakInto: ["blood","meat"], forceSaveColor: true, reactions: { - "cancer": { elem1:"cancer", chance:0.000075 }, - "radiation": { elem1:["slime","slime","ash","meat","rotten_meat","cooked_meat","skin","epidermis"], chance:0.1 }, + "cancer": { elem1:"cancer", chance:0.0005 }, + "radiation": { elem1:["ash","slime","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, }, properties: { oxygen: 1000, @@ -5335,50 +5209,43 @@ elements.amphib_skin = { }, isBio: true, movable: false, - burn:5, - burnTime: 100, - burnInto: ["cooked_meat","calcium","calcium","cooked_meat","calcium","calcium","quicklime"], } -elements.exoskeleton = { - color: ["#453a2e","#241d15","#242e23"], - category: "oxygen", +elements.intestines = { + color: "#bc6157", + category: "nutrition", 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"); } } } @@ -5393,13 +5260,26 @@ elements.exoskeleton = { } 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 + 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].isBio === true && Math.random() > 0.5) { + 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 @@ -5413,22 +5293,29 @@ 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, 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 + 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].isBio === true && Math.random() > 0.5) { + 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 @@ -5442,22 +5329,27 @@ 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 + 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].isBio === true && Math.random() > 0.5) { + 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 @@ -5471,22 +5363,29 @@ 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 + 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].isBio === true && Math.random() > 0.5) { + 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 @@ -5500,42 +5399,37 @@ 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","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", - category: "oxygen", +elements.appendix = { + color: "#B45942", + category: "nutrition", + behavior: behaviors.WALL, hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, @@ -5543,31 +5437,43 @@ elements.gills = { 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)) { @@ -5579,9 +5485,16 @@ elements.gills = { 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 @@ -5595,39 +5508,17 @@ elements.gills = { pixel.speed -= 1 } } - 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]) - } - } - } - 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") - } - 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]) - } - } - } - 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 (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 @@ -5644,7 +5535,14 @@ elements.gills = { } 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 @@ -5658,33 +5556,17 @@ elements.gills = { pixel.speed -= 1 } } - 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].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 @@ -5710,11 +5592,11 @@ elements.gills = { 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","steam","oxygen","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, @@ -5725,18 +5607,21 @@ elements.gills = { isBio: true } -elements.stomach_lining = { - color: "#be5c4b", - category: "nutrition", - behavior: [ - "XX|CR:stomach_acid%1|XX", - "CR:stomach_acid%1|XX|CR:stomach_acid%1", - "XX|CR:stomach_acid%1|XX", - ], - hoverStat: function(pixel) { +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 @@ -5776,7 +5661,7 @@ elements.stomach_lining = { 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 (hitPixel.oxygen < pixel.oxygen) { @@ -5792,6 +5677,12 @@ elements.stomach_lining = { 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] @@ -5809,11 +5700,17 @@ elements.stomach_lining = { 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) { + 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].isBio === true && Math.random() > 0.5) { + if (hitPixel.oxygen < pixel.oxygen) { hitPixel.oxygen += 10 pixel.oxygen -= 10 } @@ -5826,6 +5723,12 @@ elements.stomach_lining = { 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] @@ -5843,6 +5746,12 @@ elements.stomach_lining = { 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, @@ -5859,7 +5768,7 @@ elements.stomach_lining = { 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, @@ -5870,15 +5779,11 @@ elements.stomach_lining = { isBio: true } -elements.decomposer_stomach = { - color: "#A4593F", - category: "nutrition", - behavior: [ - "XX|CR:decomposer_acid%5|XX", - "CR:decomposer_acid%5|XX|CR:decomposer_acid%5", - "XX|CR:decomposer_acid%5|XX", - ], - hoverStat: function(pixel) { +elements.lungs = { + color: "#d4aaab", + category: "oxygen", + behavior: behaviors.WALL, + hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { @@ -5921,9 +5826,15 @@ elements.decomposer_stomach = { 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.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 @@ -5937,10 +5848,22 @@ elements.decomposer_stomach = { 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].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 @@ -5954,10 +5877,22 @@ elements.decomposer_stomach = { 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].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 @@ -5971,10 +5906,22 @@ elements.decomposer_stomach = { 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].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 @@ -5988,6 +5935,12 @@ elements.decomposer_stomach = { 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, @@ -6004,7 +5957,7 @@ elements.decomposer_stomach = { 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, @@ -6015,19 +5968,42 @@ elements.decomposer_stomach = { isBio: true } -elements.herbi_stomach = { - color: "#B77A3D", - category: "nutrition", +elements.amphib_skin = { + name: "amphibian_skin", + color: "#7E9C33", + category: "oxygen", behavior: [ - "XX|CR:herbi_acid%5|XX", - "CR:herbi_acid%5|XX|CR:herbi_acid%5", - "XX|CR:herbi_acid%5|XX", + "XX|CR:slime%0.001|XX", + "CR:slime%0.001|XX|CR:slime%0.001", + "XX|CR:slime%0.001|XX", ], - hoverStat: function(pixel) { + 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 } @@ -6066,9 +6042,15 @@ elements.herbi_stomach = { 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.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 @@ -6082,10 +6064,22 @@ elements.herbi_stomach = { 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].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 @@ -6099,10 +6093,22 @@ elements.herbi_stomach = { 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].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 @@ -6116,10 +6122,22 @@ elements.herbi_stomach = { 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].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 @@ -6133,72 +6151,78 @@ elements.herbi_stomach = { 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: 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","steam","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.carni_stomach = { - color: "#8E2A3E", - category: "nutrition", - behavior: [ - "XX|CR:carni_acid%5|XX", - "CR:carni_acid%5|XX|CR:carni_acid%5", - "XX|CR:carni_acid%5|XX", - ], - hoverStat: function(pixel) { +elements.exoskeleton = { + color: ["#453a2e","#241d15","#242e23"], + category: "oxygen", + 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)) { + if (pixel.temp > 40 && 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 } 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"); } } } @@ -6211,10 +6235,16 @@ elements.carni_stomach = { 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 (hitPixel.oxygen < pixel.oxygen) { + 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 } @@ -6227,10 +6257,22 @@ elements.carni_stomach = { 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].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 @@ -6244,10 +6286,22 @@ elements.carni_stomach = { 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].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 @@ -6261,10 +6315,22 @@ elements.carni_stomach = { 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].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 @@ -6278,42 +6344,43 @@ elements.carni_stomach = { 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: 200, - stateHigh: "cooked_meat", + tempHigh: 220, + stateHigh: ["cooked_meat","calcium","calcium"], tempLow: -25, stateLow: "frozen_meat", - burn: 5, - burnTime: 350, - burnInto: "cooked_meat", - breakInto: ["blood","meat"], + breakInto: ["blood","meat","calcium"], forceSaveColor: true, reactions: { - "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","steam","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, + "cancer": { elem1:"cancer", chance:0.000075 }, + "radiation": { elem1:["calcium","calcium","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.explosive_stomach = { - color: "#AA9167", - category: "nutrition", - behavior: [ - "XX|CR:explosive_acid%5|XX", - "CR:explosive_acid%5|XX|CR:explosive_acid%5", - "XX|CR:explosive_acid%5|XX", - ], - hoverStat: function(pixel) { +elements.gills = { + color: "#5EBAE3", + category: "oxygen", + hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { @@ -6323,11 +6390,11 @@ elements.explosive_stomach = { } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { if (pixel.temp > 95) { - if (Math.random() < 0.85) { + if (Math.random() < 0.75) { changePixel(pixel,"meat"); } else { - changePixel(pixel,"pop"); + changePixel(pixel,"cooked_meat"); } } else if (pixel.temp < -15) { @@ -6343,7 +6410,7 @@ elements.explosive_stomach = { changePixel(pixel,"meat"); } else { - changePixel(pixel,"pop"); + changePixel(pixel,"rotten_meat"); } } } @@ -6372,6 +6439,35 @@ elements.explosive_stomach = { pixel.speed -= 1 } } + 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]) + } + } + } + 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") + } + 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]) + } + } + } + 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] @@ -6406,6 +6502,29 @@ elements.explosive_stomach = { pixel.speed -= 1 } } + 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] @@ -6439,7 +6558,7 @@ elements.explosive_stomach = { 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","steam","oxygen","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, }, properties: { oxygen: 1000, @@ -6450,15 +6569,15 @@ elements.explosive_stomach = { isBio: true } -elements.stomach_valve = { - color: "#c8846f", +elements.stomach_lining = { + color: "#be5c4b", category: "nutrition", behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|CR:intestine_bacteria%0.01|XX", + "XX|CR:stomach_acid%1|XX", + "CR:stomach_acid%1|XX|CR:stomach_acid%1", + "XX|CR:stomach_acid%1|XX", ], - hoverStat: function(pixel) { + hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { @@ -6517,11 +6636,6 @@ elements.stomach_valve = { pixel.speed -= 1 } } - else if ((elements[hitPixel.element].id === elements.digested_material.id || elements[hitPixel.element].id === elements.gaseous_material.id) && Math.random() > 0.75) { - if (isEmpty(pixel.x, pixel.y+1)) { - tryMove(hitPixel,pixel.x,pixel.y+1); - } - } } if (!isEmpty(pixel.x, pixel.y+1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y+1] @@ -6600,10 +6714,15 @@ elements.stomach_valve = { isBio: true } -elements.sphincter = { - color: "#c8846f", +elements.decomposer_stomach = { + color: "#A4593F", category: "nutrition", - hoverStat: function(pixel) { + behavior: [ + "XX|CR:decomposer_acid%5|XX", + "CR:decomposer_acid%5|XX|CR:decomposer_acid%5", + "XX|CR:decomposer_acid%5|XX", + ], + hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { @@ -6662,14 +6781,6 @@ elements.sphincter = { pixel.speed -= 1 } } - else if ((elements[hitPixel.element].id === elements.excreted_poop.id || elements[hitPixel.element].id === elements.poop.id || elements[hitPixel.element].id === elements.stench.id || elements[hitPixel.element].id === elements.dirty_water.id) && Math.random() > 0.75) { - if (elements[hitPixel.element].id === elements.poop.id) { - changePixel(hitPixel,"excreted_poop"); - } - if (isEmpty(pixel.x, pixel.y+1)) { - tryMove(hitPixel,pixel.x,pixel.y+1); - } - } } if (!isEmpty(pixel.x, pixel.y+1, true)) { var hitPixel = pixelMap[pixel.x][pixel.y+1] @@ -6737,7 +6848,7 @@ elements.sphincter = { forceSaveColor: true, reactions: { "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","steam","poop","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, @@ -6748,20 +6859,21 @@ elements.sphincter = { isBio: true } -elements.real_udder = { - color: "#ecb3f5", +elements.herbi_stomach = { + color: "#B77A3D", + category: "nutrition", behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|XX|XX", + "XX|CR:herbi_acid%5|XX", + "CR:herbi_acid%5|XX|CR:herbi_acid%5", + "XX|CR:herbi_acid%5|XX", ], hoverStat: function(pixel) { 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.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-- + pixel.oxygen -= 2 } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { if (pixel.temp > 95) { @@ -6781,11 +6893,11 @@ elements.real_udder = { } } else { - if (Math.random() < 0.9999) { + if (Math.random() < 0.999) { changePixel(pixel,"meat"); } else { - changePixel(pixel,"milk"); + changePixel(pixel,"rotten_meat"); } } } @@ -6802,126 +6914,115 @@ elements.real_udder = { 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 += 20 - pixel.oxygen -= 20 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } - } - } - 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) { - if (Math.random() > 0.95) { - pixel.nutrition -= 25 + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } - createPixel("milk",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 += 20 - pixel.oxygen -= 20 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } - } - } - 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) { - if (Math.random() > 0.95) { - pixel.nutrition -= 25 + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } - createPixel("milk",pixel.x,pixel.y+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 += 20 - pixel.oxygen -= 20 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } - } - } - 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) { - if (Math.random() > 0.95) { - pixel.nutrition -= 20 - } - createPixel("milk",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].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 20 - pixel.oxygen -= 20 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } - } - } - 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) { - if (Math.random() > 0.95) { - pixel.nutrition -= 20 + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } - createPixel("milk",pixel.x+1,pixel.y) } } }, - properties: { + 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, }, - tempHigh: 175, - stateHigh: "meat", - tempLow: -50, - stateLow: "frozen_meat", - burn: 20, - burnTime: 160, - burnInto: "meat", - breakInto: ["meat","meat","meat","milk"], - category: "structural", - state: "solid", - density: 1250, - conduct: .001, movable: false, - isBio: true, + isBio: true } -elements.biotorch = { - color: ["#856559","#7F6057","#815C50"], +elements.carni_stomach = { + color: "#8E2A3E", + category: "nutrition", behavior: [ - "XX|XX|XX", - "XX|XX|XX", - "XX|XX|XX", + "XX|CR:carni_acid%5|XX", + "CR:carni_acid%5|XX|CR:carni_acid%5", + "XX|CR:carni_acid%5|XX", ], hoverStat: function(pixel) { 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.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.55) { + if (Math.random() < 0.75) { changePixel(pixel,"meat"); } else { @@ -6933,15 +7034,15 @@ elements.biotorch = { changePixel(pixel,"meat"); } else { - changePixel(pixel,"ash"); + changePixel(pixel,"frozen_meat"); } } else { - if (Math.random() < 0.95) { + if (Math.random() < 0.999) { changePixel(pixel,"meat"); } else { - changePixel(pixel,"cooked_meat"); + changePixel(pixel,"rotten_meat"); } } } @@ -6958,340 +7059,1185 @@ elements.biotorch = { 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 += 20 - pixel.oxygen -= 20 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } - 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) { - pixel.oxygen -= 5 - } - createPixel("fire",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 += 20 - pixel.oxygen -= 20 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } - } - } - 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) { - if (Math.random() > 0.95) { - pixel.oxygen -= 5 + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } - createPixel("fire",pixel.x,pixel.y+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 += 20 - pixel.oxygen -= 20 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } - } - } - 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) { - if (Math.random() > 0.95) { - pixel.oxygen -= 5 + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } - createPixel("fire",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].isBio === true && Math.random() > 0.5) { if (hitPixel.oxygen < pixel.oxygen) { - hitPixel.oxygen += 20 - pixel.oxygen -= 20 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 20 - pixel.nutrition -= 20 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 } - } - } - 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) { - if (Math.random() > 0.95) { - pixel.oxygen -= 5 + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } - createPixel("fire",pixel.x+1, pixel.y) } } }, - properties: { + 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, }, - tempHigh: 650, - stateHigh: "cooked_meat", - tempLow: -20, - stateLow: "frozen_meat", - breakInto: ["meat","cooked_meat","cooked_meat","fire"], - category: "structural", - state: "solid", - density: 1250, - conduct: .001, - insulate: true, movable: false, - isBio: true, -} - -elements.digested_material = { - color: "#B5C306", - behavior: [ - "XX|XX|XX", - "SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%3 AND M2%5|XX|SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%3 AND M2%5", - "SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%5 AND M2%75|SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%10 AND M1|SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%5 AND M2%75", - ], - properties: { - nutrition: 100, - speed: 0, - }, - category: "nutrition", - state: "solid", - density: 900, - conduct: 0.25, - stain: 0.001, - darkText: true, - hidden: true, - tempHigh: 90, - stateHigh: "dirty_water", - tempLow: -30, - stateLow: "dirty_ice", -} - -elements.gaseous_material = { - color: "#B5C306", - behavior: [ - "XX|XX|XX", - "SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%3 AND M2%35|XX|SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%3 AND M2%35", - "SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%5 AND M2%50|SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%10 AND M1|SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%5 AND M2%50", - ], - properties: { - nutrition: 100, - }, - category: "nutrition", - state: "solid", - density: 800, - conduct: 0.25, - stain: 0.001, - darkText: true, - hidden: true, - tempHigh: 95, - stateHigh: "dirty_water", - tempLow: -35, - stateLow: "dirty_ice", + isBio: true } -elements.poop = { - color: "#593001", +elements.explosive_stomach = { + color: "#AA9167", + category: "nutrition", behavior: [ - "CR:stench%0.0002|CR:stench%0.001|CR:stench%0.0002", - "M2%45|XX|M2%45", - "M2%55|M1|M2%55", + "XX|CR:explosive_acid%5|XX", + "CR:explosive_acid%5|XX|CR:explosive_acid%5", + "XX|CR:explosive_acid%5|XX", ], - reactions: { - "soap": { elem1:null, chance:0.2 }, - "bleach": { elem1:null, chance:0.5 }, - "pool_water": { elem1:null, elem2:"water", chance:0.05 }, - "water": { elem1:null, elem2:"dirty_water", chance:0.02 }, - "deoxygenated_water": { elem1:null, elem2:"dirty_water", chance:0.0175 }, - "salt_water": { elem1:null, elem2:"dirty_water", chance:0.02 }, - "sugar_water": { elem1:null, elem2:"dirty_water", chance:0.02 }, - "plant": { elem2:"dead_plant", chance:0.02}, + hoverStat: function(pixel) { + return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, - category: "nutrition", - state: "liquid", - viscosity: 1000, - density: 200, - conduct: 0.25, - darkText: true, - hidden: true, - tempHigh: 160, - stateHigh: ["ash","stench","steam","steam","carbon_dioxide"], - burn: 5, - burnTime: 30, - burnInto: ["ash","stench","steam","steam","carbon_dioxide","fire","fire"], - tempLow: -30, - stain: 0.005, - stateLowName: "frozen_poop", -} - -elements.excreted_poop = { - color: "#593001", - behavior: [ - "CR:stench,stench,stench,stench,bacteria,stench,stench,fly,stench,stench,fly,stench,stench%0.0002|CR:stench,stench,stench,stench,bacteria,stench,stench,fly,stench,stench,fly,stench,stench%0.001|CR:stench,stench,stench,stench,bacteria,stench,stench,fly,stench,stench,fly,stench,stench%0.0002", - "XX|XX|XX", - "M2%55|M1|M2%55", - ], - reactions: { - "soap": { elem1:null, chance:0.2 }, - "bleach": { elem1:null, chance:0.5 }, - "pool_water": { elem1:null, elem2:"water", chance:0.05 }, - "water": { elem1:null, elem2:"dirty_water", chance:0.02 }, - "deoxygenated_water": { elem1:null, elem2:"dirty_water", chance:0.0175 }, - "salt_water": { elem1:null, elem2:"dirty_water", chance:0.02 }, - "sugar_water": { elem1:null, elem2:"dirty_water", chance:0.02 }, - "plant": { elem2:"dead_plant", chance:0.02}, + 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.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { + if (pixel.temp > 95) { + if (Math.random() < 0.85) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"pop"); + } + } + 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,"pop"); + } + } + } + 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: "nutrition", - state: "liquid", - viscosity: 1000, - density: 200, - conduct: 0.25, - darkText: true, - hidden: true, - tempHigh: 160, - stateHigh: ["ash","stench","steam","steam","carbon_dioxide"], + density: 2710, + state: "solid", + conduct: .001, + tempHigh: 200, + stateHigh: "cooked_meat", + tempLow: -25, + stateLow: "frozen_meat", burn: 5, - burnTime: 30, - burnInto: ["ash","stench","steam","steam","carbon_dioxide","fire","fire"], - tempLow: -10, - stain: 0.005, - stateLowName: "solid_poop", -} - -elements.intestine_bacteria = { - color: "#955E93", - behavior: [ - "XX|M2%0.3|M2%3", - "XX|FX%2 AND DL%0.0005|M2%3 AND BO", - "XX|M1|M2%3", - ], - reactions: { - "water": { elem1:null, elem2:"dirty_water", chance:0.01 }, - "poop": { elem2:null, chance:0.01, func:behaviors.FEEDPIXEL }, - "bacteria": { elem2:[null,"intestine_bacteria","intestine_bacteria","intestine_bacteria","intestine_bacteria","intestine_bacteria","intestine_bacteria","intestine_bacteria"], chance:0.5, func:behaviors.FEEDPIXEL }, - "intestine_bacteria": { elem2:["intestine_bacteria",null,null,null,null,null,null,null], chance:0.001, func:behaviors.FEEDPIXEL }, - "mercury": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, - "bleach": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, - "uranium": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, - "cyanide": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, - "chlorine": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, - "alcohol": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.25 }, - "vinegar": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.01 }, - "mouthwash": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.001 }, + 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, }, - foodNeed: 15, - egg: "intestine_bacteria", - tempHigh: 80, - stateHigh: "dna", - tempLow: -10, - stateLow: "dna", - breakInto: "dna", - category:"nutrition", - burn:95, - burnTime: 100, - burnInto: "dna", - state: "solid", - density: 600, - stain: -0.005, - conduct: 0.1 + movable: false, + isBio: true } -elements.stomach_acid = { - color: ["#b5cf91","#288f2a"], +elements.stomach_valve = { + color: "#c8846f", + category: "nutrition", behavior: [ - "XX|DB%1|XX", - "DB%1 AND M2|DL%0.03|DB%1 AND M2", - "DB%1 AND M2|DB%2 AND M1|DB%1 AND M2", + "XX|XX|XX", + "XX|XX|XX", + "XX|CR:intestine_bacteria%0.01|XX", ], - 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: { - "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 }, - "sugar_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":10, "speed":-1}, chance:0.02 }, - "tree_branch": { elem1:null, elem2:"wood", chance:0.02 }, - "sugar": { elem2:"digested_material", attr2:{"nutrition":30, "speed":5}, chance:0.02 }, - "dead_plant": { elem2:"digested_material", attr2:{"nutrition":15, "speed":1}, chance:0.02 }, - "meat": { elem2:"digested_material", attr2:{"nutrition":30, "speed":-1}, chance:0.02 }, - "cooked_meat": { elem2:"digested_material", attr2:{"nutrition":60}, chance:0.02 }, - "broth": { elem1:null, elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, - "rotten_meat": { elem2:["digested_material","ammonia",null,null,null], attr2:{"nutrition":-10, "speed":-10}, chance:0.02 }, - "cured_meat": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, - "cheese": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "lettuce": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "herb": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "toast": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "bread": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "hard_yolk": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "yolk": { elem2:"gaseous_material", attr2:{"nutrition":5, "speed":-2}, chance:0.02 }, - "milk": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "crumb": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "pickle": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "salt": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, - "worm": { elem2:"gaseous_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, - "ant": { elem2:"gaseous_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, - "bee": { elem2:"gaseous_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, - "spider": { elem2:"gaseous_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, - "egg": { elem2:"gaseous_material", attr2:{"nutrition":-5, "speed":-2}, chance:0.02 }, - "soda": { elem2:"digested_material", attr2:{"nutrition":20, "speed":2}, chance:0.02 }, - "sap": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":-1}, chance:0.02 }, - "juice": { elem2:"digested_material", attr2:{"nutrition":25, "speed":1}, chance:0.02 }, - "mayo": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "nut_butter": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "ketchup": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "jelly": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "bleach": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-10}, chance:0.02 }, - "poison": { elem2:"digested_material", attr2:{"nutrition":-750, "speed":-10}, chance:0.02 }, - "soap": { elem2:"digested_material", attr2:{"nutrition":-20, "speed":-10}, chance:0.02 }, - "mercury": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-10}, chance:0.02 }, - "chlorine": { elem2:"gaseous_material", attr2:{"nutrition":-500, "speed":-10}, chance:0.02 }, + 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.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 + } + } + else if ((elements[hitPixel.element].id === elements.digested_material.id || elements[hitPixel.element].id === elements.gaseous_material.id) && Math.random() > 0.75) { + if (isEmpty(pixel.x, pixel.y+1)) { + tryMove(hitPixel,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 + } + 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 + } + } + } + }, + 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.sphincter = { + color: "#c8846f", + category: "nutrition", + 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.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 + } + } + else if ((elements[hitPixel.element].id === elements.excreted_poop.id || elements[hitPixel.element].id === elements.poop.id || elements[hitPixel.element].id === elements.stench.id || elements[hitPixel.element].id === elements.dirty_water.id) && Math.random() > 0.75) { + if (elements[hitPixel.element].id === elements.poop.id) { + changePixel(hitPixel,"excreted_poop"); + } + if (isEmpty(pixel.x, pixel.y+1)) { + tryMove(hitPixel,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 + } + 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 + } + } + } + }, + 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","poop","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }, + }, + properties: { + oxygen: 1000, + nutrition: 1000, + speed: 0, + }, + movable: false, + isBio: true +} + +elements.real_udder = { + color: "#ecb3f5", + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|XX|XX", + ], + hoverStat: function(pixel) { + 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) { + 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.9999) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"milk"); + } + } + } + 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 += 20 + pixel.oxygen -= 20 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 20 + pixel.nutrition -= 20 + } + } + } + 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) { + if (Math.random() > 0.95) { + pixel.nutrition -= 25 + } + createPixel("milk",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 += 20 + pixel.oxygen -= 20 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 20 + pixel.nutrition -= 20 + } + } + } + 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) { + if (Math.random() > 0.95) { + pixel.nutrition -= 25 + } + createPixel("milk",pixel.x,pixel.y+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 += 20 + pixel.oxygen -= 20 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 20 + pixel.nutrition -= 20 + } + } + } + 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) { + if (Math.random() > 0.95) { + pixel.nutrition -= 20 + } + createPixel("milk",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].isBio === true && Math.random() > 0.5) { + if (hitPixel.oxygen < pixel.oxygen) { + hitPixel.oxygen += 20 + pixel.oxygen -= 20 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 20 + pixel.nutrition -= 20 + } + } + } + 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) { + if (Math.random() > 0.95) { + pixel.nutrition -= 20 + } + createPixel("milk",pixel.x+1,pixel.y) + } + } + }, + properties: { + oxygen: 1000, + nutrition: 1000, + speed: 0, + }, + tempHigh: 175, + stateHigh: "meat", + tempLow: -50, + stateLow: "frozen_meat", + burn: 20, + burnTime: 160, + burnInto: "meat", + breakInto: ["meat","meat","meat","milk"], + category: "structural", + state: "solid", + density: 1250, + conduct: .001, + movable: false, + isBio: true, +} + +elements.biotorch = { + color: ["#856559","#7F6057","#815C50"], + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "XX|XX|XX", + ], + hoverStat: function(pixel) { + 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) { + 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.55) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"cooked_meat"); + } + } + else if (pixel.temp < -15) { + if (Math.random() < 0.75) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"ash"); + } + } + else { + if (Math.random() < 0.95) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"cooked_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 += 20 + pixel.oxygen -= 20 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 20 + pixel.nutrition -= 20 + } + } + } + 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) { + pixel.oxygen -= 5 + } + createPixel("fire",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 += 20 + pixel.oxygen -= 20 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 20 + pixel.nutrition -= 20 + } + } + } + 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) { + if (Math.random() > 0.95) { + pixel.oxygen -= 5 + } + createPixel("fire",pixel.x,pixel.y+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 += 20 + pixel.oxygen -= 20 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 20 + pixel.nutrition -= 20 + } + } + } + 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) { + if (Math.random() > 0.95) { + pixel.oxygen -= 5 + } + createPixel("fire",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].isBio === true && Math.random() > 0.5) { + if (hitPixel.oxygen < pixel.oxygen) { + hitPixel.oxygen += 20 + pixel.oxygen -= 20 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 20 + pixel.nutrition -= 20 + } + } + } + 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) { + if (Math.random() > 0.95) { + pixel.oxygen -= 5 + } + createPixel("fire",pixel.x+1, pixel.y) + } + } + }, + properties: { + oxygen: 1000, + nutrition: 1000, + speed: 0, + }, + tempHigh: 650, + stateHigh: "cooked_meat", + tempLow: -20, + stateLow: "frozen_meat", + breakInto: ["meat","cooked_meat","cooked_meat","fire"], + category: "structural", + state: "solid", + density: 1250, + conduct: .001, + insulate: true, + movable: false, + isBio: true, +} + +elements.digested_material = { + color: "#B5C306", + behavior: [ + "XX|XX|XX", + "SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%3 AND M2%5|XX|SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%3 AND M2%5", + "SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%5 AND M2%75|SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%10 AND M1|SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%5 AND M2%75", + ], + properties: { + nutrition: 100, + speed: 0, + }, + category: "nutrition", + state: "solid", + density: 900, + conduct: 0.25, + stain: 0.001, + darkText: true, + hidden: true, + tempHigh: 90, + stateHigh: "dirty_water", + tempLow: -30, + stateLow: "dirty_ice", +} + +elements.gaseous_material = { + color: "#B5C306", + behavior: [ + "XX|XX|XX", + "SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%3 AND M2%35|XX|SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%3 AND M2%35", + "SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%5 AND M2%50|SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%10 AND M1|SW:stomach_acid,decomposer_acid,herbi_acid,carni_acid,explosive_acid%5 AND M2%50", + ], + properties: { + nutrition: 100, + }, + category: "nutrition", + state: "solid", + density: 800, + conduct: 0.25, + stain: 0.001, + darkText: true, + hidden: true, + tempHigh: 95, + stateHigh: "dirty_water", + tempLow: -35, + stateLow: "dirty_ice", +} + +elements.poop = { + color: "#593001", + behavior: [ + "CR:stench%0.0002|CR:stench%0.001|CR:stench%0.0002", + "M2%45|XX|M2%45", + "M2%55|M1|M2%55", + ], + reactions: { + "soap": { elem1:null, chance:0.2 }, + "bleach": { elem1:null, chance:0.5 }, + "pool_water": { elem1:null, elem2:"water", chance:0.05 }, + "water": { elem1:null, elem2:"dirty_water", chance:0.02 }, + "deoxygenated_water": { elem1:null, elem2:"dirty_water", chance:0.0175 }, + "salt_water": { elem1:null, elem2:"dirty_water", chance:0.02 }, + "sugar_water": { elem1:null, elem2:"dirty_water", chance:0.02 }, + "plant": { elem2:"dead_plant", chance:0.02}, + }, + category: "nutrition", + state: "liquid", + viscosity: 1000, + density: 200, + conduct: 0.25, + darkText: true, + hidden: true, + tempHigh: 160, + stateHigh: ["ash","stench","steam","steam","carbon_dioxide"], + burn: 5, + burnTime: 30, + burnInto: ["ash","stench","steam","steam","carbon_dioxide","fire","fire"], + tempLow: -30, + stain: 0.005, + stateLowName: "frozen_poop", +} + +elements.excreted_poop = { + color: "#593001", + behavior: [ + "CR:stench,stench,stench,stench,bacteria,stench,stench,fly,stench,stench,fly,stench,stench%0.0002|CR:stench,stench,stench,stench,bacteria,stench,stench,fly,stench,stench,fly,stench,stench%0.001|CR:stench,stench,stench,stench,bacteria,stench,stench,fly,stench,stench,fly,stench,stench%0.0002", + "XX|XX|XX", + "M2%55|M1|M2%55", + ], + reactions: { + "soap": { elem1:null, chance:0.2 }, + "bleach": { elem1:null, chance:0.5 }, + "pool_water": { elem1:null, elem2:"water", chance:0.05 }, + "water": { elem1:null, elem2:"dirty_water", chance:0.02 }, + "deoxygenated_water": { elem1:null, elem2:"dirty_water", chance:0.0175 }, + "salt_water": { elem1:null, elem2:"dirty_water", chance:0.02 }, + "sugar_water": { elem1:null, elem2:"dirty_water", chance:0.02 }, + "plant": { elem2:"dead_plant", chance:0.02}, + }, + category: "nutrition", + state: "liquid", + viscosity: 1000, + density: 200, + conduct: 0.25, + darkText: true, + hidden: true, + tempHigh: 160, + stateHigh: ["ash","stench","steam","steam","carbon_dioxide"], + burn: 5, + burnTime: 30, + burnInto: ["ash","stench","steam","steam","carbon_dioxide","fire","fire"], + tempLow: -10, + stain: 0.005, + stateLowName: "solid_poop", +} + +elements.intestine_bacteria = { + color: "#955E93", + behavior: [ + "XX|M2%0.3|M2%3", + "XX|FX%2 AND DL%0.0005|M2%3 AND BO", + "XX|M1|M2%3", + ], + reactions: { + "water": { elem1:null, elem2:"dirty_water", chance:0.01 }, + "poop": { elem2:null, chance:0.01, func:behaviors.FEEDPIXEL }, + "bacteria": { elem2:[null,"intestine_bacteria","intestine_bacteria","intestine_bacteria","intestine_bacteria","intestine_bacteria","intestine_bacteria","intestine_bacteria"], chance:0.5, func:behaviors.FEEDPIXEL }, + "intestine_bacteria": { elem2:["intestine_bacteria",null,null,null,null,null,null,null], chance:0.001, func:behaviors.FEEDPIXEL }, + "mercury": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, + "bleach": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, + "uranium": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, + "cyanide": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, + "chlorine": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, + "alcohol": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.25 }, + "vinegar": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.01 }, + "mouthwash": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.001 }, + }, + foodNeed: 15, + egg: "intestine_bacteria", + tempHigh: 80, + stateHigh: "dna", + tempLow: -10, + stateLow: "dna", + breakInto: "dna", + category:"nutrition", + burn:95, + burnTime: 100, + burnInto: "dna", + state: "solid", + density: 600, + stain: -0.005, + conduct: 0.1 +} + +elements.stomach_acid = { + color: ["#b5cf91","#288f2a"], + behavior: [ + "XX|DB%1|XX", + "DB%1 AND M2|DL%0.03|DB%1 AND M2", + "DB%1 AND M2|DB%2 AND M1|DB%1 AND M2", + ], + 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: { + "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 }, + "sugar_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":10, "speed":-1}, chance:0.02 }, + "tree_branch": { elem1:null, elem2:"wood", chance:0.02 }, + "sugar": { elem2:"digested_material", attr2:{"nutrition":30, "speed":5}, chance:0.02 }, + "dead_plant": { elem2:"digested_material", attr2:{"nutrition":15, "speed":1}, chance:0.02 }, + "meat": { elem2:"digested_material", attr2:{"nutrition":30, "speed":-1}, chance:0.02 }, + "cooked_meat": { elem2:"digested_material", attr2:{"nutrition":60}, chance:0.02 }, + "broth": { elem1:null, elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, + "rotten_meat": { elem2:["digested_material","ammonia",null,null,null], attr2:{"nutrition":-10, "speed":-10}, chance:0.02 }, + "cured_meat": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, + "cheese": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "lettuce": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "herb": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "toast": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "bread": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "hard_yolk": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "yolk": { elem2:"gaseous_material", attr2:{"nutrition":5, "speed":-2}, chance:0.02 }, + "milk": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "crumb": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "pickle": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "salt": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, + "worm": { elem2:"gaseous_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, + "ant": { elem2:"gaseous_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, + "bee": { elem2:"gaseous_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, + "spider": { elem2:"gaseous_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, + "egg": { elem2:"gaseous_material", attr2:{"nutrition":-5, "speed":-2}, chance:0.02 }, + "soda": { elem2:"digested_material", attr2:{"nutrition":20, "speed":2}, chance:0.02 }, + "sap": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":-1}, chance:0.02 }, + "juice": { elem2:"digested_material", attr2:{"nutrition":25, "speed":1}, chance:0.02 }, + "mayo": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "nut_butter": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "ketchup": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "jelly": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "bleach": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-10}, chance:0.02 }, + "poison": { elem2:"digested_material", attr2:{"nutrition":-750, "speed":-10}, chance:0.02 }, + "soap": { elem2:"digested_material", attr2:{"nutrition":-20, "speed":-10}, chance:0.02 }, + "mercury": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-10}, chance:0.02 }, + "chlorine": { elem2:"gaseous_material", attr2:{"nutrition":-500, "speed":-10}, chance:0.02 }, "pool_water": { elem2:"digested_material", attr2:{"nutrition":-400, "speed":-10}, chance:0.02 }, "coffee": { elem2:"digested_material", attr2:{"nutrition":20, "speed":10}, chance:0.02 }, - "tomato": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, - "grape": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, + "tomato": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, + "grape": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, + "beans": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "sauce": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, + "butter": { elem2:"digested_material", attr2:{"nutrition":15, "speed":-1}, chance:0.02 }, + "melted_cheese": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "melted_chocolate": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "melted_butter": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "chocolate": { elem2:"digested_material", attr2:{"nutrition":35, "speed":2}, chance:0.02 }, + "rice": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "dough": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, + "batter": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, + "baked_batter": { elem2:"digested_material", attr2:{"nutrition":45, "speed":2}, chance:0.02 }, + "gingerbread": { elem2:"digested_material", attr2:{"nutrition":45, "speed":2}, chance:0.02 }, + "ice_cream": { elem2:"digested_material", attr2:{"nutrition":40, "speed":2}, chance:0.02 }, + "cream": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "caramel": { elem2:"digested_material", attr2:{"nutrition":30, "speed":3}, chance:0.02 }, + "potato": { elem2:"digested_material", attr2:{"nutrition":15, "speed":-1}, chance:0.02 }, + "baked_potato": { elem2:"digested_material", attr2:{"nutrition":45, "speed":1}, chance:0.02 }, + "mashed_potato": { elem2:"digested_material", attr2:{"nutrition":40, "speed":1}, chance:0.02 }, + "yogurt": { elem2:"digested_material", attr2:{"nutrition":35, "speed":1}, chance:0.02 }, + "frozen_yogurt": { elem2:"digested_material", attr2:{"nutrition":35, "speed":2}, chance:0.02 }, + "slush": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, + "coffee_bean": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":20}, chance:0.02 }, + "coffee_ground": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":15}, chance:0.02 }, + "yeast": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":-1}, chance:0.02 }, + "alcohol": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-15}, chance:0.02 }, + "honey": { elem2:"digested_material", attr2:{"nutrition":35, "speed":3}, chance:0.02 }, + "blood": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, + "poop": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-10}, chance:0.02 }, + "infection": { elem2:"digested_material", attr2:{"nutrition":-15, "speed":-5}, chance:0.02 }, + "cancer": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-15}, chance:0.02 }, + "plague": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-10}, chance:0.02 }, + "glue": { elem2:"gaseous_material", attr2:{"nutrition":-10, "speed":-10}, chance:0.02 }, + }, + category: "nutrition", + tempHigh: 110, + stateHigh: "acid_gas", + tempLow: -58.88, + burn: 30, + burnTime: 1, + state: "liquid", + density: 1050, + stain: -0.1 +} + +elements.herbi_acid = { + color: ["#A8E54F","#5BC217"], + behavior: [ + "XX|DB%1|XX", + "DB%1 AND M2|DL%0.03|DB%1 AND M2", + "DB%1 AND M2|DB%2 AND M1|DB%1 AND M2", + ], + 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: { + "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 }, + "sugar_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":10, "speed":1}, chance:0.02 }, + "plant": { elem2:"digested_material", attr2:{"nutrition":80, "speed":1}, chance:0.02}, + "tree_branch": { elem1:null, elem2:"wood", attr2:{"nutrition":10, "speed":1}, chance:0.02 }, + "sugar": { elem2:"digested_material", attr2:{"nutrition":30, "speed":5}, chance:0.02 }, + "dead_plant": { elem2:"digested_material", attr2:{"nutrition":75}, chance:0.02 }, + "meat": { elem2:"gaseous_material", attr2:{"nutrition":-10, "speed":-1}, chance:0.02 }, + "cooked_meat": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":1}, chance:0.02 }, + "broth": { elem1:null, elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, + "rotten_meat": { elem2:["digested_material","ammonia",null,null,null], attr2:{"nutrition":-25, "speed":-20}, chance:0.02 }, + "cured_meat": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":-1}, chance:0.02 }, + "cheese": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "vine": { elem2:"digested_material", attr2:{"nutrition":60}, chance:0.02 }, + "grass": { elem2:"digested_material", attr2:{"nutrition":60}, chance:0.02 }, + "kelp": { elem2:"digested_material", attr2:{"nutrition":60}, chance:0.02 }, + "algae": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, + "lettuce": { elem2:"digested_material", attr2:{"nutrition":60}, chance:0.02 }, + "herb": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, + "toast": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "bread": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "hard_yolk": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, + "yolk": { elem2:"digested_material", attr2:{"nutrition":10, "speed":5}, chance:0.02 }, + "milk": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "crumb": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "pickle": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, + "salt": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "worm": { elem2:"gaseous_material", attr2:{"nutrition":-10}, chance:0.02 }, + "ant": { elem2:"gaseous_material", attr2:{"nutrition":-10}, chance:0.02 }, + "bee": { elem2:"gaseous_material", attr2:{"nutrition":-10}, chance:0.02 }, + "spider": { elem2:"gaseous_material", attr2:{"nutrition":-10}, chance:0.02 }, + "egg": { elem2:"digested_material", attr2:{"nutrition":-20}, chance:0.02 }, + "soda": { elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, + "sap": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "juice": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "mayo": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "nut_butter": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "ketchup": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "jelly": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "bleach": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-20}, chance:0.02 }, + "poison": { elem2:"digested_material", attr2:{"nutrition":-750, "speed":-20}, chance:0.02 }, + "soap": { elem2:"digested_material", attr2:{"nutrition":-20, "speed":-10}, chance:0.02 }, + "mercury": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-20}, chance:0.02 }, + "chlorine": { elem2:"gaseous_material", attr2:{"nutrition":-500, "speed":-20}, chance:0.02 }, + "pool_water": { elem2:"digested_material", attr2:{"nutrition":-400, "speed":-15}, chance:0.02 }, + "coffee": { elem2:"digested_material", attr2:{"nutrition":20, "speed":10}, chance:0.02 }, + "tomato": { elem2:"digested_material", attr2:{"nutrition":55}, chance:0.02 }, + "grape": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, "beans": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, "sauce": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, - "butter": { elem2:"digested_material", attr2:{"nutrition":15, "speed":-1}, chance:0.02 }, - "melted_cheese": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "melted_chocolate": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "melted_butter": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "chocolate": { elem2:"digested_material", attr2:{"nutrition":35, "speed":2}, chance:0.02 }, - "rice": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "dough": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, - "batter": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, - "baked_batter": { elem2:"digested_material", attr2:{"nutrition":45, "speed":2}, chance:0.02 }, - "gingerbread": { elem2:"digested_material", attr2:{"nutrition":45, "speed":2}, chance:0.02 }, - "ice_cream": { elem2:"digested_material", attr2:{"nutrition":40, "speed":2}, chance:0.02 }, + "butter": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "melted_cheese": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "melted_chocolate": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "melted_butter": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "chocolate": { elem2:"digested_material", attr2:{"nutrition":20, "speed":2}, chance:0.02 }, + "rice": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, + "dough": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "batter": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "baked_batter": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "gingerbread": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "ice_cream": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, "cream": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "caramel": { elem2:"digested_material", attr2:{"nutrition":30, "speed":3}, chance:0.02 }, - "potato": { elem2:"digested_material", attr2:{"nutrition":15, "speed":-1}, chance:0.02 }, - "baked_potato": { elem2:"digested_material", attr2:{"nutrition":45, "speed":1}, chance:0.02 }, - "mashed_potato": { elem2:"digested_material", attr2:{"nutrition":40, "speed":1}, chance:0.02 }, - "yogurt": { elem2:"digested_material", attr2:{"nutrition":35, "speed":1}, chance:0.02 }, - "frozen_yogurt": { elem2:"digested_material", attr2:{"nutrition":35, "speed":2}, chance:0.02 }, + "caramel": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "potato": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "baked_potato": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, + "mashed_potato": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "yogurt": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "frozen_yogurt": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, "slush": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, "coffee_bean": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":20}, chance:0.02 }, - "coffee_ground": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":15}, chance:0.02 }, - "yeast": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":-1}, chance:0.02 }, - "alcohol": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-15}, chance:0.02 }, + "coffee_ground": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":15}, chance:0.02 }, + "yeast": { elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, + "alcohol": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":-15}, chance:0.02 }, "honey": { elem2:"digested_material", attr2:{"nutrition":35, "speed":3}, chance:0.02 }, - "blood": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, + "blood": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":-1}, chance:0.02 }, "poop": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-10}, chance:0.02 }, - "infection": { elem2:"digested_material", attr2:{"nutrition":-15, "speed":-5}, chance:0.02 }, - "cancer": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-15}, chance:0.02 }, + "infection": { elem2:"digested_material", attr2:{"nutrition":-20, "speed":-5}, chance:0.02 }, + "cancer": { elem2:"gaseous_material", attr2:{"nutrition":-25, "speed":-15}, chance:0.02 }, "plague": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-10}, chance:0.02 }, "glue": { elem2:"gaseous_material", attr2:{"nutrition":-10, "speed":-10}, chance:0.02 }, }, @@ -7306,71 +8252,272 @@ elements.stomach_acid = { stain: -0.1 } -elements.herbi_acid = { - color: ["#A8E54F","#5BC217"], +elements.carni_acid = { + color: ["#ADA469","#5B6517"], + behavior: [ + "XX|DB%1|XX", + "DB%1 AND M2|DL%0.005|DB%1 AND M2", + "DB%1 AND M2|DB%2 AND M1|DB%1 AND M2", + ], + 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: { + "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 }, + "sugar_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":10, "speed":1}, chance:0.02 }, + "plant": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-5}, chance:0.02}, + "tree_branch": { elem1:null, elem2:"wood", chance:0.02 }, + "sugar": { elem2:"digested_material", attr2:{"nutrition":10, "speed":3}, chance:0.02 }, + "dead_plant": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, + "meat": { elem2:"digested_material", attr2:{"nutrition":70, "speed":5}, chance:0.02 }, + "cooked_meat": { elem2:"digested_material", attr2:{"nutrition":60, "speed":4}, chance:0.02 }, + "broth": { elem1:null, elem2:"digested_material", attr2:{"nutrition":50, "speed":6}, chance:0.02 }, + "rotten_meat": { elem2:["digested_material","ammonia",null,null,null], attr2:{"nutrition":5, "speed":-5}, chance:0.02 }, + "cured_meat": { elem2:"digested_material", attr2:{"nutrition":50, "speed":-1}, chance:0.02 }, + "cheese": { elem2:"digested_material", attr2:{"nutrition":35, "speed":-1}, chance:0.02 }, + "lettuce": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, + "herb": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, + "toast": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, + "bread": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, + "hard_yolk": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, + "yolk": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, + "milk": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "crumb": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "pickle": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "salt": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "worm": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "ant": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "bee": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "spider": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "rat": { elem2:"digested_material", attr2:{"nutrition":15, "speed":-1}, chance:0.02 }, + "bird": { elem2:"digested_material", attr2:{"nutrition":15, "speed":1}, chance:0.02 }, + "fish": { elem2:"digested_material", attr2:{"nutrition":15, "speed":1}, chance:0.02 }, + "head": { elem2:"digested_material", attr2:{"nutrition":15, "speed":2}, chance:0.02 }, + "body": { elem2:"digested_material", attr2:{"nutrition":15, "speed":2}, chance:0.02 }, + "egg": { elem2:"digested_material", attr2:{"nutrition":25, "speed":1}, chance:0.02 }, + "soda": { elem2:"digested_material", attr2:{"nutrition":10, "speed":-1}, chance:0.02 }, + "sap": { elem2:"gaseous_material", attr2:{"nutrition":-10, "speed":-1}, chance:0.02 }, + "juice": { elem2:"digested_material", attr2:{"nutrition":10, "speed":1}, chance:0.02 }, + "mayo": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "nut_butter": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "ketchup": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "jelly": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "bleach": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-20}, chance:0.02 }, + "poison": { elem2:"digested_material", attr2:{"nutrition":-750, "speed":-20}, chance:0.02 }, + "soap": { elem2:"digested_material", attr2:{"nutrition":-20, "speed":-15}, chance:0.02 }, + "mercury": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-20}, chance:0.02 }, + "chlorine": { elem2:"gaseous_material", attr2:{"nutrition":-500, "speed":-20}, chance:0.02 }, + "pool_water": { elem2:"digested_material", attr2:{"nutrition":-400, "speed":-15}, chance:0.02 }, + "coffee": { elem2:"digested_material", attr2:{"nutrition":10, "speed":5}, chance:0.02 }, + "tomato": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "grape": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "beans": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, + "sauce": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "butter": { elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, + "melted_cheese": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "melted_chocolate": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "melted_butter": { elem2:"gaseous_material", attr2:{"nutrition":-10}, chance:0.02 }, + "chocolate": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "rice": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "dough": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "batter": { elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, + "baked_batter": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "gingerbread": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "ice_cream": { elem2:"digested_material", attr2:{"nutrition":30, "speed":1}, chance:0.02 }, + "cream": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "caramel": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, + "potato": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "baked_potato": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "mashed_potato": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, + "yogurt": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "frozen_yogurt": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "slush": { elem2:"digested_material", attr2:{"nutrition":-1, "speed":1}, chance:0.02 }, + "coffee_bean": { elem2:"gaseous_material", attr2:{"nutrition":-10, "speed":15}, chance:0.02 }, + "yeast": { elem2:"gaseous_material", attr2:{"nutrition":-10}, chance:0.02 }, + "alcohol": { elem2:"digested_material", attr2:{"nutrition":"-15", "speed":-15}, chance:0.02 }, + "honey": { elem2:"digested_material", attr2:{"nutrition":35, "speed":5}, chance:0.02 }, + "blood": { elem2:"digested_material", attr2:{"nutrition":15, "speed":3}, chance:0.02 }, + "poop": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-5}, chance:0.02 }, + "infection": { elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, + "cancer": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":-5}, chance:0.02 }, + "plague": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-10}, chance:0.02 }, + "glue": { elem2:"gaseous_material", attr2:{"nutrition":-10, "speed":-15}, chance:0.02 }, + }, + category: "nutrition", + tempHigh: 110, + stateHigh: "acid_gas", + tempLow: -58.88, + burn: 30, + burnTime: 1, + state: "liquid", + density: 1050, + stain: -0.1 +} + +elements.explosive_acid = { + color: ["#E9DC8C","#D0C15A"], + behavior: [ + "XX|DB%1|XX", + "DB%1 AND M2|DL%0.001|DB%1 AND M2", + "DB%1 AND M2|DB%2 AND M1|DB%1 AND M2", + ], + 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: { + "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 }, + "sugar_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "plant": { elem2:"digested_material", attr2:{"nutrition":10, "speed":5}, chance:0.02}, + "tree_branch": { elem1:null, elem2:"wood", chance:0.02 }, + "sugar": { elem2:"digested_material", attr2:{"nutrition":30, "speed":5}, chance:0.02 }, + "dead_plant": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "meat": { elem2:"digested_material", attr2:{"nutrition":30, "speed":5}, chance:0.02 }, + "cooked_meat": { elem2:"digested_material", attr2:{"nutrition":60}, chance:0.02 }, + "broth": { elem1:null, elem2:"digested_material", attr2:{"nutrition":55}, chance:0.02 }, + "rotten_meat": { elem2:["digested_material","ammonia",null,null,null], attr2:{"nutrition":30}, chance:0.02 }, + "cured_meat": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, + "cheese": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "lettuce": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "herb": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "toast": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "bread": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "hard_yolk": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "yolk": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "milk": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "crumb": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "pickle": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "salt": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "worm": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "ant": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "bee": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "spider": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "egg": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "soda": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, + "sap": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "juice": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "mayo": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "nut_butter": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "ketchup": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "jelly": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "bleach": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "poison": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, + "soap": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "mercury": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "chlorine": { elem2:"gaseous_material", attr2:{"nutrition":5}, chance:0.02 }, + "pool_water": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "coffee": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, + "tomato": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, + "grape": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, + "beans": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "sauce": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, + "butter": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "melted_cheese": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "melted_chocolate": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "melted_butter": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "chocolate": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "rice": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "dough": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "batter": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "baked_batter": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, + "gingerbread": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, + "ice_cream": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "cream": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "caramel": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, + "potato": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "baked_potato": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, + "mashed_potato": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, + "yogurt": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "frozen_yogurt": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "slush": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "coffee_bean": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "yeast": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "alcohol": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "honey": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "blood": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "poop": { elem2:"gaseous_material", attr2:{"nutrition":5}, chance:0.02 }, + "infection": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "cancer": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "plague": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "glue": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + }, + category: "nutrition", + tempHigh: 600, + stateHigh: "pop", + burn: 100, + burnTime: 1, + burnInto: "explosion", + breakInto: ["explosion","pop"], + viscosity: 36, + tempLow: -58.88, + state: "liquid", + density: 1050, +} + +elements.decomposer_acid = { + color: ["#847C35","#6F7326"], behavior: [ "XX|DB%1|XX", - "DB%1 AND M2|DL%0.03|DB%1 AND M2", + "DB%1 AND M2|DL%0.005|DB%1 AND M2", "DB%1 AND M2|DB%2 AND M1|DB%1 AND M2", ], - 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"], + 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: { - "dirty_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":-5, "speed":-3}, chance:0.02 }, + "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, "speed":-1}, chance:0.02 }, - "sugar_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":10, "speed":1}, chance:0.02 }, - "plant": { elem2:"digested_material", attr2:{"nutrition":80, "speed":1}, chance:0.02}, - "tree_branch": { elem1:null, elem2:"wood", attr2:{"nutrition":10, "speed":1}, chance:0.02 }, - "sugar": { elem2:"digested_material", attr2:{"nutrition":30, "speed":5}, chance:0.02 }, - "dead_plant": { elem2:"digested_material", attr2:{"nutrition":75}, chance:0.02 }, - "meat": { elem2:"gaseous_material", attr2:{"nutrition":-10, "speed":-1}, chance:0.02 }, - "cooked_meat": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":1}, chance:0.02 }, - "broth": { elem1:null, elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, - "rotten_meat": { elem2:["digested_material","ammonia",null,null,null], attr2:{"nutrition":-25, "speed":-20}, chance:0.02 }, - "cured_meat": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":-1}, chance:0.02 }, - "cheese": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "vine": { elem2:"digested_material", attr2:{"nutrition":60}, chance:0.02 }, - "grass": { elem2:"digested_material", attr2:{"nutrition":60}, chance:0.02 }, - "kelp": { elem2:"digested_material", attr2:{"nutrition":60}, chance:0.02 }, - "algae": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, - "lettuce": { elem2:"digested_material", attr2:{"nutrition":60}, chance:0.02 }, + "salt_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "sugar_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "plant": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02}, + "tree_branch": { elem1:null, elem2:"wood", attr2:{"nutrition":30}, chance:0.02 }, + "sugar": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, + "dead_plant": { elem2:"digested_material", attr2:{"nutrition":90, "speed":5}, chance:0.02 }, + "meat": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, + "cooked_meat": { elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, + "broth": { elem1:null, elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "rotten_meat": { elem2:["digested_material","ammonia",null,null,null], attr2:{"nutrition":55, "speed":5}, chance:0.02 }, + "cured_meat": { elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, + "cheese": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, + "vine": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, + "grass": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, + "kelp": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, + "algae": { elem2:"digested_material", attr2:{"nutrition":60, "speed":5}, chance:0.02 }, + "lettuce": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, "herb": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, - "toast": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "bread": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "hard_yolk": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, - "yolk": { elem2:"digested_material", attr2:{"nutrition":10, "speed":5}, chance:0.02 }, - "milk": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "toast": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, + "bread": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, + "hard_yolk": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "yolk": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "milk": { elem2:"digested_material", attr2:{"nutrition":55}, chance:0.02 }, "crumb": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "pickle": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, + "pickle": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, "salt": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "worm": { elem2:"gaseous_material", attr2:{"nutrition":-10}, chance:0.02 }, - "ant": { elem2:"gaseous_material", attr2:{"nutrition":-10}, chance:0.02 }, - "bee": { elem2:"gaseous_material", attr2:{"nutrition":-10}, chance:0.02 }, - "spider": { elem2:"gaseous_material", attr2:{"nutrition":-10}, chance:0.02 }, - "egg": { elem2:"digested_material", attr2:{"nutrition":-20}, chance:0.02 }, - "soda": { elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, + "worm": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "ant": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "bee": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "spider": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "egg": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, + "soda": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, "sap": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "juice": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, + "juice": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, "mayo": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "nut_butter": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "ketchup": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "jelly": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "bleach": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-20}, chance:0.02 }, - "poison": { elem2:"digested_material", attr2:{"nutrition":-750, "speed":-20}, chance:0.02 }, + "nut_butter": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "ketchup": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, + "jelly": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "bleach": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-15}, chance:0.02 }, + "poison": { elem2:"digested_material", attr2:{"nutrition":-750, "speed":-15}, chance:0.02 }, "soap": { elem2:"digested_material", attr2:{"nutrition":-20, "speed":-10}, chance:0.02 }, - "mercury": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-20}, chance:0.02 }, - "chlorine": { elem2:"gaseous_material", attr2:{"nutrition":-500, "speed":-20}, chance:0.02 }, + "mercury": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-15}, chance:0.02 }, + "chlorine": { elem2:"gaseous_material", attr2:{"nutrition":-500, "speed":-15}, chance:0.02 }, "pool_water": { elem2:"digested_material", attr2:{"nutrition":-400, "speed":-15}, chance:0.02 }, "coffee": { elem2:"digested_material", attr2:{"nutrition":20, "speed":10}, chance:0.02 }, "tomato": { elem2:"digested_material", attr2:{"nutrition":55}, chance:0.02 }, - "grape": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, + "grape": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, "beans": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, "sauce": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, "butter": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, "melted_cheese": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, "melted_chocolate": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, "melted_butter": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "chocolate": { elem2:"digested_material", attr2:{"nutrition":20, "speed":2}, chance:0.02 }, + "chocolate": { elem2:"digested_material", attr2:{"nutrition":30, "speed":1}, chance:0.02 }, "rice": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, "dough": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, "batter": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, @@ -7384,414 +8531,755 @@ elements.herbi_acid = { "mashed_potato": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, "yogurt": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, "frozen_yogurt": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "slush": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, - "coffee_bean": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":20}, chance:0.02 }, - "coffee_ground": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":15}, chance:0.02 }, + "slush": { elem2:"digested_material", attr2:{"nutrition":0}, chance:0.02 }, + "coffee_bean": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":15}, chance:0.02 }, "yeast": { elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, - "alcohol": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":-15}, chance:0.02 }, - "honey": { elem2:"digested_material", attr2:{"nutrition":35, "speed":3}, chance:0.02 }, - "blood": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":-1}, chance:0.02 }, - "poop": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-10}, chance:0.02 }, - "infection": { elem2:"digested_material", attr2:{"nutrition":-20, "speed":-5}, chance:0.02 }, - "cancer": { elem2:"gaseous_material", attr2:{"nutrition":-25, "speed":-15}, chance:0.02 }, - "plague": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-10}, chance:0.02 }, - "glue": { elem2:"gaseous_material", attr2:{"nutrition":-10, "speed":-10}, chance:0.02 }, + "alcohol": { elem2:"digested_material", attr2:{"nutrition":-35, "speed":-5}, chance:0.02 }, + "honey": { elem2:"digested_material", attr2:{"nutrition":35, "speed":1}, chance:0.02 }, + "blood": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, + "infection": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-15}, chance:0.02 }, + "cancer": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-15}, chance:0.02 }, + "plague": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-15}, chance:0.02 }, + "glue": { elem2:"gaseous_material", attr2:{"nutrition":-10, "speed":-15}, chance:0.02 }, + "poop": { elem2:"digested_material", attr2:{"nutrition":25, "speed":1}, chance:0.02 }, + "excreted_poop": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, + "dead_bug": { elem2:"digested_material", attr2:{"nutrition":35, "speed":5}, chance:0.02 }, + }, + category: "nutrition", + tempHigh: 110, + stateHigh: "acid_gas", + tempLow: -58.88, + burn: 30, + burnTime: 1, + state: "liquid", + density: 1050, + stain: -0.1 +} + +elements.deoxygenated_water = { + color: "#829BD4", + behavior: behaviors.LIQUID, + tempHigh: 100, + stateHigh: "steam", + tempLow: 0, + stateLow: "ice", + category: "liquids", + heatCapacity: 4.184, + reactions: { + "oxygen": { elem1: "water", elem2: null }, + "dust": { elem1: "dirty_water", elem2: null }, + "ash": { elem1: "dirty_water", elem2: null }, + "cyanide": { elem1: "dirty_water", elem2: null }, + "cyanide_gas": { elem1: "dirty_water", elem2: null }, + "carbon_dioxide": { elem1: "seltzer", elem2: null, oneway:true }, + "sulfur": { elem1: "dirty_water", elem2: null }, + "rat": { elem1: "dirty_water", chance:0.005 }, + "plague": { elem1: "dirty_water", elem2: null }, + "rust": { elem1: "dirty_water", chance:0.005 }, + "lead": { elem1: "dirty_water", chance:0.005 }, + "solder": { elem1: "dirty_water", chance:0.005 }, + "fallout": { elem1: "dirty_water", chance:0.25 }, + "radiation": { elem1: "dirty_water", chance:0.25 }, + "uranium": { elem1: "dirty_water", chance:0.25 }, + "rad_steam": { elem1: "dirty_water", chance:0.02 }, + "rad_glass": { elem1: "dirty_water", chance:0.005 }, + "rad_shard": { elem1: "dirty_water", chance:0.01 }, + "rotten_meat": { elem1: "dirty_water", chance:0.25 }, + "rotten_cheese": { elem1: "dirty_water", chance:0.25 }, + "cancer": { elem1: "dirty_water", chance:0.25 }, + "oil": { elem1: "dirty_water", chance:0.005 }, + "dioxin": { elem1: "dirty_water", chance:0.1 }, + "rock": { elem2: "wet_sand", chance: 0.00035 }, + "limestone": { elem2: "wet_sand", chance: 0.00035 }, + "tuff": { elem2: "wet_sand", color2:"#7a6b5c", chance: 0.00035 }, + "ruins": { elem2: "rock", chance: 0.00035 }, + "mudstone": { elem2: "mud", chance: 0.00035 }, + "fly": { elem2:"dead_bug", chance:0.1, oneway:true }, + "firefly": { elem2:"dead_bug", chance:0.1, oneway:true }, + "bee": { elem2:"dead_bug", chance:0.05, oneway:true }, + "stink_bug": { elem2:"dead_bug", chance:0.1, oneway:true }, + "cured_meat": { elem1:"salt_water", elem2:"meat" }, + "water": { elem1:"water", chance:0.005 }, + "salt_water": { elem1:"water", chance:0.005 }, + "deoxygenated_water": { elem2:"bubble", attr2:{"clone":"water"}, chance:0.001, tempMin:85 }, + }, + state: "liquid", + density: 1100, + conduct: 0.02, + stain: -0.5, + extinguish: true +} + +elements.real_bone = { + color: "#d9d9d9", + behavior: behaviors.WALL, + reactions: { + "water": { elem2:"broth", tempMin:70 }, + "salt_water": { elem2:"broth", tempMin:70 }, + "sugar_water": { elem2:"broth", tempMin:70 }, + "seltzer": { elem2:"broth", tempMin:70 }, + }, + 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) { + changePixel(pixel,"bone"); + } + else if (pixel.temp < -15) { + changePixel(pixel,"bone"); + } + else { + changePixel(pixel,"bone"); + } + } + 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: "nutrition", - tempHigh: 110, - stateHigh: "acid_gas", - tempLow: -58.88, - burn: 30, - burnTime: 1, - state: "liquid", - density: 1050, - stain: -0.1 + category:"structural", + tempHigh: 260, + stateHigh: "bone", + tempLow: -36, + stateLow: "bone", + state: "solid", + density: 1900, + hardness: 0.5, + properties: { + oxygen: 1000, + nutrition: 1000, + speed: 0, + }, + breakInto: ["quicklime","quicklime","quicklime","blood","bone","bone","bone","bone","bone","bone"], + movable: false, + isBio: true, + burn: 1, + burnTime: 100, + burnInto: ["bone","bone","bone","bone","quicklime"], } -elements.carni_acid = { - color: ["#ADA469","#5B6517"], - behavior: [ - "XX|DB%1|XX", - "DB%1 AND M2|DL%0.005|DB%1 AND M2", - "DB%1 AND M2|DB%2 AND M1|DB%1 AND M2", - ], - 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: { - "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 }, - "sugar_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":10, "speed":1}, chance:0.02 }, - "plant": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-5}, chance:0.02}, - "tree_branch": { elem1:null, elem2:"wood", chance:0.02 }, - "sugar": { elem2:"digested_material", attr2:{"nutrition":10, "speed":3}, chance:0.02 }, - "dead_plant": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, - "meat": { elem2:"digested_material", attr2:{"nutrition":70, "speed":5}, chance:0.02 }, - "cooked_meat": { elem2:"digested_material", attr2:{"nutrition":60, "speed":4}, chance:0.02 }, - "broth": { elem1:null, elem2:"digested_material", attr2:{"nutrition":50, "speed":6}, chance:0.02 }, - "rotten_meat": { elem2:["digested_material","ammonia",null,null,null], attr2:{"nutrition":5, "speed":-5}, chance:0.02 }, - "cured_meat": { elem2:"digested_material", attr2:{"nutrition":50, "speed":-1}, chance:0.02 }, - "cheese": { elem2:"digested_material", attr2:{"nutrition":35, "speed":-1}, chance:0.02 }, - "lettuce": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, - "herb": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, - "toast": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, - "bread": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, - "hard_yolk": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, - "yolk": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, - "milk": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "crumb": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "pickle": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "salt": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "worm": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "ant": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "bee": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "spider": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "rat": { elem2:"digested_material", attr2:{"nutrition":15, "speed":-1}, chance:0.02 }, - "bird": { elem2:"digested_material", attr2:{"nutrition":15, "speed":1}, chance:0.02 }, - "fish": { elem2:"digested_material", attr2:{"nutrition":15, "speed":1}, chance:0.02 }, - "head": { elem2:"digested_material", attr2:{"nutrition":15, "speed":2}, chance:0.02 }, - "body": { elem2:"digested_material", attr2:{"nutrition":15, "speed":2}, chance:0.02 }, - "egg": { elem2:"digested_material", attr2:{"nutrition":25, "speed":1}, chance:0.02 }, - "soda": { elem2:"digested_material", attr2:{"nutrition":10, "speed":-1}, chance:0.02 }, - "sap": { elem2:"gaseous_material", attr2:{"nutrition":-10, "speed":-1}, chance:0.02 }, - "juice": { elem2:"digested_material", attr2:{"nutrition":10, "speed":1}, chance:0.02 }, - "mayo": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "nut_butter": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "ketchup": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "jelly": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "bleach": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-20}, chance:0.02 }, - "poison": { elem2:"digested_material", attr2:{"nutrition":-750, "speed":-20}, chance:0.02 }, - "soap": { elem2:"digested_material", attr2:{"nutrition":-20, "speed":-15}, chance:0.02 }, - "mercury": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-20}, chance:0.02 }, - "chlorine": { elem2:"gaseous_material", attr2:{"nutrition":-500, "speed":-20}, chance:0.02 }, - "pool_water": { elem2:"digested_material", attr2:{"nutrition":-400, "speed":-15}, chance:0.02 }, - "coffee": { elem2:"digested_material", attr2:{"nutrition":10, "speed":5}, chance:0.02 }, - "tomato": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "grape": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "beans": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, - "sauce": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "butter": { elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, - "melted_cheese": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "melted_chocolate": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "melted_butter": { elem2:"gaseous_material", attr2:{"nutrition":-10}, chance:0.02 }, - "chocolate": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "rice": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "dough": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "batter": { elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, - "baked_batter": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "gingerbread": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "ice_cream": { elem2:"digested_material", attr2:{"nutrition":30, "speed":1}, chance:0.02 }, - "cream": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "caramel": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, - "potato": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "baked_potato": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "mashed_potato": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, - "yogurt": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "frozen_yogurt": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "slush": { elem2:"digested_material", attr2:{"nutrition":-1, "speed":1}, chance:0.02 }, - "coffee_bean": { elem2:"gaseous_material", attr2:{"nutrition":-10, "speed":15}, chance:0.02 }, - "yeast": { elem2:"gaseous_material", attr2:{"nutrition":-10}, chance:0.02 }, - "alcohol": { elem2:"digested_material", attr2:{"nutrition":"-15", "speed":-15}, chance:0.02 }, - "honey": { elem2:"digested_material", attr2:{"nutrition":35, "speed":5}, chance:0.02 }, - "blood": { elem2:"digested_material", attr2:{"nutrition":15, "speed":3}, chance:0.02 }, - "poop": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-5}, chance:0.02 }, - "infection": { elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, - "cancer": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":-5}, chance:0.02 }, - "plague": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-10}, chance:0.02 }, - "glue": { elem2:"gaseous_material", attr2:{"nutrition":-10, "speed":-15}, chance:0.02 }, +elements.real_bone_marrow = { + color: "#D3A491", + category: "structural", + behavior: behaviors.WALL, + hoverStat: function(pixel) { + return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen + }, + tick: function(pixel) { + if (Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) && 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)) { + createPixel("real_bone",x,y); + } + } + } + doDefaults(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 -= 2 + } + if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { + if (pixel.temp > 95) { + if (Math.random() < 0.95) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"blood"); + } + } + else if (pixel.temp < -15) { + if (Math.random() < 0.95) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"blood"); + } + } + else { + if (Math.random() < 0.95) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"blood"); + } + } + } + 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 (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) { + if (Math.random() > 0.9999 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen) / 2000))) { + changePixel(hitPixel,"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) { + 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 (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) { + if (Math.random() > 0.9999 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen) / 2000))) { + changePixel(hitPixel,"white_blood_cell"); + } + } + } + } + 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 (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) { + if (Math.random() > 0.9999 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen) / 2000))) { + changePixel(hitPixel,"white_blood_cell"); + } + } + } + } + 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 (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) { + if (Math.random() > 0.9999 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen) / 2000))) { + changePixel(hitPixel,"white_blood_cell"); + } + } + } + } }, - category: "nutrition", - tempHigh: 110, - stateHigh: "acid_gas", - tempLow: -58.88, - burn: 30, - burnTime: 1, - state: "liquid", - density: 1050, - stain: -0.1 + density: 2710, + state: "solid", + conduct: .001, + tempHigh: 350, + stateHigh: "cooked_meat", + tempLow: -40, + stateLow: "frozen_meat", + burn: 5, + burnTime: 400, + burnInto: "cooked_meat", + breakInto: ["blood","meat"], + hardness: 0.2, + forceSaveColor: true, + reactions: { + "cancer": { elem1:"cancer", chance:0.0005 }, + "radiation": { elem1:["ash","meat","rotten_meat","cooked_meat","flesh"], chance:0.2 }, + }, + properties: { + oxygen: 1000, + nutrition: 1000, + speed: 0, + }, + isBio: true, + movable: false, } -elements.explosive_acid = { - color: ["#E9DC8C","#D0C15A"], - behavior: [ - "XX|DB%1|XX", - "DB%1 AND M2|DL%0.001|DB%1 AND M2", - "DB%1 AND M2|DB%2 AND M1|DB%1 AND M2", - ], - 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"], +elements.cerebrospinal_fluid = { + color: "#CBC3E3", + behavior: behaviors.LIQUID, + tick: function(pixel) { + 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 + } + } + } + }, + tempHigh: 102, + stateHigh: ["steam","salt"], + tempLow: -5, + category: "nervous system", reactions: { - "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 }, - "sugar_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "plant": { elem2:"digested_material", attr2:{"nutrition":10, "speed":5}, chance:0.02}, - "tree_branch": { elem1:null, elem2:"wood", chance:0.02 }, - "sugar": { elem2:"digested_material", attr2:{"nutrition":30, "speed":5}, chance:0.02 }, - "dead_plant": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "meat": { elem2:"digested_material", attr2:{"nutrition":30, "speed":5}, chance:0.02 }, - "cooked_meat": { elem2:"digested_material", attr2:{"nutrition":60}, chance:0.02 }, - "broth": { elem1:null, elem2:"digested_material", attr2:{"nutrition":55}, chance:0.02 }, - "rotten_meat": { elem2:["digested_material","ammonia",null,null,null], attr2:{"nutrition":30}, chance:0.02 }, - "cured_meat": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, - "cheese": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "lettuce": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "herb": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "toast": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "bread": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "hard_yolk": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "yolk": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "milk": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "crumb": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "pickle": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "salt": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "worm": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "ant": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "bee": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "spider": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "egg": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "soda": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, - "sap": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "juice": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "mayo": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "nut_butter": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "ketchup": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "jelly": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "bleach": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "poison": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, - "soap": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "mercury": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "chlorine": { elem2:"gaseous_material", attr2:{"nutrition":5}, chance:0.02 }, - "pool_water": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "coffee": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, - "tomato": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, - "grape": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, - "beans": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "sauce": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, - "butter": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "melted_cheese": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "melted_chocolate": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "melted_butter": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "chocolate": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "rice": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "dough": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "batter": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "baked_batter": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, - "gingerbread": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, - "ice_cream": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "cream": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "caramel": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, - "potato": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "baked_potato": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, - "mashed_potato": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "yogurt": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "frozen_yogurt": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "slush": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "coffee_bean": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "yeast": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "alcohol": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "honey": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "blood": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "poop": { elem2:"gaseous_material", attr2:{"nutrition":5}, chance:0.02 }, - "infection": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "cancer": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "plague": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "glue": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, + "dust": { elem1: "dirty_water", elem2: null }, + "ash": { elem1: "dirty_water", elem2: null }, + "carbon_dioxide": { elem1: "dirty_water", elem2: null }, + "sulfur": { elem1: "dirty_water", elem2: null }, + "rat": { elem1: "dirty_water", chance:0.005 }, + "plague": { elem1: "dirty_water", elem2: null }, + "fallout": { elem1: "dirty_water", chance:0.25 }, + "radiation": { elem1: "dirty_water", chance:0.25 }, + "rust": { elem1: "dirty_water", chance:0.005 }, + "lead": { elem1: "dirty_water", chance:0.005 }, + "solder": { elem1: "dirty_water", chance:0.005 }, + "rock": { elem2: "wet_sand", chance: 0.0005 }, + "limestone": { elem2: "wet_sand", chance: 0.0005 }, + "fly": { elem2:"dead_bug", chance:0.1, oneway:true }, + "firefly": { elem2:"dead_bug", chance:0.1, oneway:true }, + "bee": { elem2:"dead_bug", chance:0.05, oneway:true }, + "stink_bug": { elem2:"dead_bug", chance:0.1, oneway:true }, + "cancer": { elem1: "dirty_water", chance:0.25 }, + "oil": { elem1: "dirty_water", chance:0.005 }, + "uranium": { elem1: "dirty_water", chance:0.25 }, + "wet_sand": { oneway:true, chance:0.007, func:function(pixel){ + if (isEmpty(pixel.x,pixel.y-1) || isEmpty(pixel.x,pixel.y-2) || isEmpty(pixel.x,pixel.y-3)) { + changePixel(pixel,"foam"); + pixel.clone = "salt_water"; + } + }}, + "salt_water": { elem2:"bubble", attr2:{"clone":"salt_water"}, chance:0.001, tempMin:85 }, + // electrolysis: + "aluminum": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.0025 }, + "zinc": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.015 }, + "steel": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.0125 }, + "iron": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.0125 }, + "tin": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.01 }, + "brass": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.001 }, + "bronze": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.001 }, + "copper": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.0075 }, + "silver": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.0075 }, + "gold": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.0075 }, }, - category: "nutrition", - tempHigh: 600, - stateHigh: "pop", - burn: 100, - burnTime: 1, - burnInto: "explosion", - breakInto: ["explosion","pop"], - viscosity: 36, - tempLow: -58.88, state: "liquid", - density: 1050, + density: 1026, + stain: -0.01, + properties: { + oxygen: 1000, + nutrition: 1000, + speed: 0, + }, + extinguish: true, + isBio: true } -elements.decomposer_acid = { - color: ["#847C35","#6F7326"], - behavior: [ - "XX|DB%1|XX", - "DB%1 AND M2|DL%0.005|DB%1 AND M2", - "DB%1 AND M2|DB%2 AND M1|DB%1 AND M2", - ], - 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"], +elements.elixir = { + color: "#8CB6AA", + behavior: behaviors.LIQUID, reactions: { - "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 }, - "sugar_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "plant": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02}, - "tree_branch": { elem1:null, elem2:"wood", attr2:{"nutrition":30}, chance:0.02 }, - "sugar": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, - "dead_plant": { elem2:"digested_material", attr2:{"nutrition":90, "speed":5}, chance:0.02 }, - "meat": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, - "cooked_meat": { elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, - "broth": { elem1:null, elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "rotten_meat": { elem2:["digested_material","ammonia",null,null,null], attr2:{"nutrition":55, "speed":5}, chance:0.02 }, - "cured_meat": { elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, - "cheese": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, - "vine": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, - "grass": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, - "kelp": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, - "algae": { elem2:"digested_material", attr2:{"nutrition":60, "speed":5}, chance:0.02 }, - "lettuce": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, - "herb": { elem2:"digested_material", attr2:{"nutrition":50}, chance:0.02 }, - "toast": { elem2:"digested_material", attr2:{"nutrition":20}, chance:0.02 }, - "bread": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, - "hard_yolk": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "yolk": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "milk": { elem2:"digested_material", attr2:{"nutrition":55}, chance:0.02 }, - "crumb": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "pickle": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "salt": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "worm": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "ant": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "bee": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "spider": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "egg": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "soda": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "sap": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "juice": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "mayo": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "nut_butter": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "ketchup": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "jelly": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "bleach": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-15}, chance:0.02 }, - "poison": { elem2:"digested_material", attr2:{"nutrition":-750, "speed":-15}, chance:0.02 }, - "soap": { elem2:"digested_material", attr2:{"nutrition":-20, "speed":-10}, chance:0.02 }, - "mercury": { elem2:"digested_material", attr2:{"nutrition":-500, "speed":-15}, chance:0.02 }, - "chlorine": { elem2:"gaseous_material", attr2:{"nutrition":-500, "speed":-15}, chance:0.02 }, - "pool_water": { elem2:"digested_material", attr2:{"nutrition":-400, "speed":-15}, chance:0.02 }, - "coffee": { elem2:"digested_material", attr2:{"nutrition":20, "speed":10}, chance:0.02 }, - "tomato": { elem2:"digested_material", attr2:{"nutrition":55}, chance:0.02 }, - "grape": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "beans": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "sauce": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, - "butter": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "melted_cheese": { elem2:"digested_material", attr2:{"nutrition":15}, chance:0.02 }, - "melted_chocolate": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "melted_butter": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "chocolate": { elem2:"digested_material", attr2:{"nutrition":30, "speed":1}, chance:0.02 }, - "rice": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, - "dough": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "batter": { elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 }, - "baked_batter": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "gingerbread": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "ice_cream": { elem2:"digested_material", attr2:{"nutrition":30}, chance:0.02 }, - "cream": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "caramel": { elem2:"digested_material", attr2:{"nutrition":10}, chance:0.02 }, - "potato": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "baked_potato": { elem2:"digested_material", attr2:{"nutrition":45}, chance:0.02 }, - "mashed_potato": { elem2:"digested_material", attr2:{"nutrition":40}, chance:0.02 }, - "yogurt": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "frozen_yogurt": { elem2:"digested_material", attr2:{"nutrition":35}, chance:0.02 }, - "slush": { elem2:"digested_material", attr2:{"nutrition":0}, chance:0.02 }, - "coffee_bean": { elem2:"digested_material", attr2:{"nutrition":-5, "speed":15}, chance:0.02 }, - "yeast": { elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 }, - "alcohol": { elem2:"digested_material", attr2:{"nutrition":-35, "speed":-5}, chance:0.02 }, - "honey": { elem2:"digested_material", attr2:{"nutrition":35, "speed":1}, chance:0.02 }, - "blood": { elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 }, - "infection": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-15}, chance:0.02 }, - "cancer": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-15}, chance:0.02 }, - "plague": { elem2:"gaseous_material", attr2:{"nutrition":-15, "speed":-15}, chance:0.02 }, - "glue": { elem2:"gaseous_material", attr2:{"nutrition":-10, "speed":-15}, chance:0.02 }, - "poop": { elem2:"digested_material", attr2:{"nutrition":25, "speed":1}, chance:0.02 }, - "excreted_poop": { elem2:"digested_material", attr2:{"nutrition":25}, chance:0.02 }, - "dead_bug": { elem2:"digested_material", attr2:{"nutrition":35, "speed":5}, chance:0.02 }, + "dirt": { elem2: "mud", elem1: null }, + "dust": { elem1: "dirty_water", elem2: null }, + "ash": { elem1: "dirty_water", elem2: null }, + "carbon_dioxide": { elem1: "dirty_water", elem2: null }, + "sulfur": { elem1: "dirty_water", elem2: null }, + "rat": { elem1: "dirty_water", chance:0.005 }, + "plague": { elem1: "dirty_water", elem2: null }, + "fallout": { elem1: "dirty_water", chance:0.25 }, + "radiation": { elem1: "dirty_water", chance:0.25 }, + "rust": { elem1: "dirty_water", chance:0.005 }, + "lead": { elem1: "dirty_water", chance:0.005 }, + "solder": { elem1: "dirty_water", chance:0.005 }, + "rock": { elem2: "wet_sand", chance: 0.0005 }, + "limestone": { elem2: "wet_sand", chance: 0.0005 }, + "fly": { elem2:"dead_bug", chance:0.1, oneway:true }, + "firefly": { elem2:"dead_bug", chance:0.1, oneway:true }, + "bee": { elem2:"dead_bug", chance:0.05, oneway:true }, + "stink_bug": { elem2:"dead_bug", chance:0.1, oneway:true }, + "cancer": { elem1: "dirty_water", chance:0.25 }, + "oil": { elem1: "dirty_water", chance:0.005 }, + "uranium": { elem1: "dirty_water", chance:0.25 }, + "cerebrospinal_fluid": { elem1:"brain_jar_juice", elem2:"brain_jar_juice", chance:0.01 }, }, - category: "nutrition", - tempHigh: 110, - stateHigh: "acid_gas", - tempLow: -58.88, - burn: 30, - burnTime: 1, + viscosity: 4000, + tempHigh: 120, + stateHigh: ["steam","steam","dna","dna","stench","salt",], + tempLow: 0, + category:"liquids", state: "liquid", - density: 1050, - stain: -0.1 + density: 1450, + stain: 0.05, + hidden: true, } -elements.deoxygenated_water = { - color: "#829BD4", +elements.brain_jar_juice = { + color: "#4F8C24", behavior: behaviors.LIQUID, - tempHigh: 100, - stateHigh: "steam", - tempLow: 0, - stateLow: "ice", - category: "liquids", - heatCapacity: 4.184, + hidden: true, + tick: function(pixel) { + 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 += 1 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 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 += 1 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 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 += 1 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 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 += 1 + } + if (hitPixel.nutrition < pixel.nutrition) { + hitPixel.nutrition += 1 + } + } + } + }, + tempHigh: 102, + stateHigh: ["steam","steam","dna","dna","stench","salt",], + tempLow: -5, + category: "circulation", reactions: { - "oxygen": { elem1: "water", elem2: null }, "dust": { elem1: "dirty_water", elem2: null }, "ash": { elem1: "dirty_water", elem2: null }, - "cyanide": { elem1: "dirty_water", elem2: null }, - "cyanide_gas": { elem1: "dirty_water", elem2: null }, - "carbon_dioxide": { elem1: "seltzer", elem2: null, oneway:true }, + "carbon_dioxide": { elem1: "dirty_water", elem2: null }, "sulfur": { elem1: "dirty_water", elem2: null }, "rat": { elem1: "dirty_water", chance:0.005 }, "plague": { elem1: "dirty_water", elem2: null }, - "rust": { elem1: "dirty_water", chance:0.005 }, - "lead": { elem1: "dirty_water", chance:0.005 }, - "solder": { elem1: "dirty_water", chance:0.005 }, "fallout": { elem1: "dirty_water", chance:0.25 }, "radiation": { elem1: "dirty_water", chance:0.25 }, - "uranium": { elem1: "dirty_water", chance:0.25 }, - "rad_steam": { elem1: "dirty_water", chance:0.02 }, - "rad_glass": { elem1: "dirty_water", chance:0.005 }, - "rad_shard": { elem1: "dirty_water", chance:0.01 }, - "rotten_meat": { elem1: "dirty_water", chance:0.25 }, - "rotten_cheese": { elem1: "dirty_water", chance:0.25 }, - "cancer": { elem1: "dirty_water", chance:0.25 }, - "oil": { elem1: "dirty_water", chance:0.005 }, - "dioxin": { elem1: "dirty_water", chance:0.1 }, - "rock": { elem2: "wet_sand", chance: 0.00035 }, - "limestone": { elem2: "wet_sand", chance: 0.00035 }, - "tuff": { elem2: "wet_sand", color2:"#7a6b5c", chance: 0.00035 }, - "ruins": { elem2: "rock", chance: 0.00035 }, - "mudstone": { elem2: "mud", chance: 0.00035 }, + "rust": { elem1: "dirty_water", chance:0.005 }, + "lead": { elem1: "dirty_water", chance:0.005 }, + "solder": { elem1: "dirty_water", chance:0.005 }, + "rock": { elem2: "wet_sand", chance: 0.0005 }, + "limestone": { elem2: "wet_sand", chance: 0.0005 }, "fly": { elem2:"dead_bug", chance:0.1, oneway:true }, "firefly": { elem2:"dead_bug", chance:0.1, oneway:true }, "bee": { elem2:"dead_bug", chance:0.05, oneway:true }, "stink_bug": { elem2:"dead_bug", chance:0.1, oneway:true }, - "cured_meat": { elem1:"salt_water", elem2:"meat" }, - "water": { elem1:"water", chance:0.005 }, - "salt_water": { elem1:"water", chance:0.005 }, - "deoxygenated_water": { elem2:"bubble", attr2:{"clone":"water"}, chance:0.001, tempMin:85 }, + "cancer": { elem1: "dirty_water", chance:0.25 }, + "oil": { elem1: "dirty_water", chance:0.005 }, + "uranium": { elem1: "dirty_water", chance:0.25 }, + "wet_sand": { oneway:true, chance:0.007, func:function(pixel){ + if (isEmpty(pixel.x,pixel.y-1) || isEmpty(pixel.x,pixel.y-2) || isEmpty(pixel.x,pixel.y-3)) { + changePixel(pixel,"foam"); + pixel.clone = "salt_water"; + } + }}, + "brain_jar_juice": { elem2:"bubble", color2:"#81cf63", attr2:{"clone":"brain_jar_juice"}, chance:0.0001 }, }, state: "liquid", - density: 1100, - conduct: 0.02, - stain: -0.5, + density: 1026, + stain: -0.01, + properties: { + oxygen: 1000, + nutrition: 1000, + speed: 0, + }, extinguish: true } -elements.real_bone = { - color: "#d9d9d9", - behavior: behaviors.WALL, +elements.bacteria = { + color: "#769356", + behavior: [ + "XX|SW:poop,dirty_water%5 AND M2%0.5|M2%5 AND SW:poop,dirty_water%5", + "XX|FX%2|M2%5 AND SW:poop,dirty_water%5 AND BO", + "XX|M1 AND SW:poop,dirty_water%5|M2%5 AND SW:poop,dirty_water%5", + ], reactions: { - "water": { elem2:"broth", tempMin:70 }, - "salt_water": { elem2:"broth", tempMin:70 }, - "sugar_water": { elem2:"broth", tempMin:70 }, - "seltzer": { elem2:"broth", tempMin:70 }, + "sphincter": { elem2:null, chance:0.01, func:behaviors.FEEDPIXEL }, + "flesh": { elem2:null, chance:0.02, func:behaviors.FEEDPIXEL }, + "intestine": { elem2:null, chance:0.01, func:behaviors.FEEDPIXEL }, + "blood_vessel": { elem2:null, chance:0.02, func:behaviors.FEEDPIXEL }, + "dermis": { elem2:null, chance:0.02, func:behaviors.FEEDPIXEL }, + "scale_dermis": { elem2:null, chance:0.01, func:behaviors.FEEDPIXEL }, + "bug_dermis": { elem2:null, chance:0.01, func:behaviors.FEEDPIXEL }, + "lungs": { elem2:null, chance:0.02, func:behaviors.FEEDPIXEL }, + "rotten_meat": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "poop": { elem2:[null,null,null,null,"poop"], chance:0.05, func:behaviors.FEEDPIXEL }, + "rotten_cheese": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "cheese": { elem2:"rotten_cheese", chance:0.5, func:behaviors.FEEDPIXEL }, + "meat": { elem2:"rotten_meat", chance:0.5, func:behaviors.FEEDPIXEL }, + "cured_meat": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.01 }, + "dead_plant": { elem2:"dirt", chance:0.05, func:behaviors.FEEDPIXEL }, + "dead_bug": { elem2:null, chance:0.02, func:behaviors.FEEDPIXEL }, + "mercury": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, + "bleach": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, + "uranium": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, + "cyanide": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, + "chlorine": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, + "alcohol": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.25 }, + "water": { elem1:null, elem2:"dirty_water", chance:0.01 }, + "blood": { elem1:null, elem2:"infection", chance:0.01 }, + "salt_water": { elem1:null, elem2:"dirty_water", chance:0.01 }, + "sugar_water": { elem1:null, elem2:"dirty_water", chance:0.01, func:behaviors.FEEDPIXEL }, + "pool_water": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], elem2:"water", chance:0.005 }, + "vinegar": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.001 }, + "mouthwash": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.01 }, + }, + foodNeed: 15, + egg: "bacteria", + tempHigh: 100, + stateHigh: ["dna","dna","dna","dna","dna","dna","carbon_dioxide","steam"], + tempLow: 0, + stateLow: "dna", + breakInto: "dna", + category:"life", + burn:95, + burnTime: 100, + burnInto: ["dna","dna","dna","dna","dna","smoke","carbon_dioxide","steam"], + state: "solid", + density: 600, + conduct: .1 +} + +elements.tract = { + color: ["#7C4941","#83594C"], + onSelect: function() { + logMessage("Draw a pipe, wait for walls to appear, then erase the exit hole."); }, 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)) { + 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 -= 2 } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { if (pixel.temp > 95) { - changePixel(pixel,"bone"); + if (Math.random() < 0.75) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"cooked_meat"); + } } else if (pixel.temp < -15) { - changePixel(pixel,"bone"); + if (Math.random() < 0.75) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"frozen_meat"); + } } else { - changePixel(pixel,"meat"); + if (Math.random() < 0.999) { + changePixel(pixel,"meat"); + } + else { + changePixel(pixel,"rotten_meat"); + } } } if (pixel.nutrition === null || isNaN(pixel.nutrition)) { @@ -7871,74 +9359,188 @@ elements.real_bone = { } } } + if (!pixel.stage && pixelTicks-pixel.start > 60) { + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true) && elements[pixelMap[x][y].element].movable) { + deletePixel(x,y) + } + if (isEmpty(x,y)) { + createPixel("flesh",x,y); + } + } + pixel.stage = 1; + } + else if (pixel.stage === 1 && pixelTicks-pixel.start > 70) { //uninitialized + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + pixel.stage = 2; //blue + pixel.color = pixelColorPick(pixel,"#552D3F"); + break; + } + } + } + else if (pixel.stage > 1 && pixelTicks % 3 === pixel.stage-2) { //initialized + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true) && pixelMap[x][y].element === "tract") { + var newPixel = pixelMap[x][y]; + if (newPixel.stage === 1) { + var newColor; + switch (pixel.stage) { + case 2: newPixel.stage = 3; newColor = "#554B21"; break; //green + case 3: newPixel.stage = 4; newColor = "#66241B"; break; //red + case 4: newPixel.stage = 2; newColor = "#552D3F"; break; //blue + } + newPixel.color = pixelColorPick(newPixel,newColor); + } + } + } + var moved = false; + shuffleArray(squareCoordsShuffle); + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y,true)) { + var newPixel = pixelMap[x][y]; + if (newPixel.element === "tract") { + 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 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { //transfer to adjacent pipe + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + moved = true; + break; + } + } + else if (!pixel.con && elements[newPixel.element].movable) { //suck up pixel + pixel.con = newPixel; + deletePixel(newPixel.x,newPixel.y); + pixel.con.x = pixel.x; + pixel.con.y = pixel.y; + pixel.con.del; + moved = true; + break; + } + } + } + if (pixel.con && !moved && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { // move to same stage if none other + for (var i = 0; i < squareCoordsShuffle.length; i++) { + var coord = squareCoordsShuffle[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (isEmpty(x,y)) { + delete pixel.con.del; + pixel.con.x = x; + pixel.con.y = y; + pixelMap[x][y] = pixel.con; + currentPixels.push(pixel.con); + pixel.con = null; + break; + } + if (!isEmpty(x,y,true) && pixelMap[x][y].element === "tract") { + var newPixel = pixelMap[x][y]; + if (pixel.con && !newPixel.con && newPixel.stage === pixel.stage) { + newPixel.con = pixel.con; + newPixel.con.x = newPixel.x; + newPixel.con.y = newPixel.y; + pixel.con = null; + break; + } + } + } + } + } + doDefaults(pixel); }, - category:"structural", - tempHigh: 260, - stateHigh: "bone", - tempLow: -36, - stateLow: "bone", + category: "structural", + movable: false, + canContain: true, + forceSaveColor: true, + density: 2710, state: "solid", - density: 1900, - hardness: 0.5, - properties: { + 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, }, - breakInto: ["quicklime","quicklime","quicklime","blood","bone","bone","bone","bone","bone","bone"], - movable: false, - isBio: true, - burn: 1, - burnTime: 100, - burnInto: ["bone","bone","bone","bone","quicklime"], + isBio: true, } -elements.real_bone_marrow = { - color: "#D3A491", - category: "structural", +elements.biosensor = { + color: ["#AD6770","#B0707D"], + category: "nervous system", behavior: behaviors.WALL, hoverStat: function(pixel) { return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, tick: function(pixel) { - if (Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) && 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)) { - createPixel("real_bone",x,y); + 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)) { + var sensed = pixelMap[x][y]; + if (sensed.con || elements[sensed.element].movable && elements.biosensor.ignore.indexOf(sensed.element) === -1) { + pixel.charge = 5; + break; } } } - doDefaults(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 -= 2 } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { if (pixel.temp > 95) { - if (Math.random() < 0.95) { + if (Math.random() < 0.75) { changePixel(pixel,"meat"); } else { - changePixel(pixel,"blood"); + changePixel(pixel,"cooked_meat"); } } else if (pixel.temp < -15) { - if (Math.random() < 0.95) { + if (Math.random() < 0.75) { changePixel(pixel,"meat"); } else { - changePixel(pixel,"blood"); + changePixel(pixel,"frozen_meat"); } } else { - if (Math.random() < 0.95) { + if (Math.random() < 0.999) { changePixel(pixel,"meat"); } else { - changePixel(pixel,"blood"); + changePixel(pixel,"rotten_meat"); } } } @@ -8019,23 +9621,23 @@ elements.real_bone_marrow = { } } } + doDefaults(pixel); }, + ignore: ["flash"], density: 2710, state: "solid", - conduct: .001, - tempHigh: 350, + conduct: 1, + tempHigh: 200, stateHigh: "cooked_meat", - tempLow: -40, + tempLow: -25, stateLow: "frozen_meat", burn: 5, - burnTime: 400, + burnTime: 350, burnInto: "cooked_meat", breakInto: ["blood","meat"], - hardness: 0.2, - forceSaveColor: true, reactions: { - "cancer": { elem1:"cancer", chance:0.0005 }, - "radiation": { elem1:["ash","meat","rotten_meat","cooked_meat","flesh"], chance:0.2 }, + "cancer": { elem1:"cancer", chance:0.0005 }, + "radiation": { elem1:["ash","blood","fat","meat","rotten_meat","cooked_meat"], chance:0.4 }, }, properties: { oxygen: 1000, @@ -8046,10 +9648,68 @@ elements.real_bone_marrow = { movable: false, } -elements.cerebrospinal_fluid = { - color: "#CBC3E3", - behavior: behaviors.LIQUID, +elements.bioplate = { + color: ["#AD6770","#B0707D"], + category: "nervous system", + behavior: behaviors.WALL, + hoverStat: function(pixel) { + return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen + }, tick: function(pixel) { + if (!isEmpty(pixel.x, pixel.y-1, true)){ + if (pixel.min && elements[pixelMap[pixel.x][pixel.y-1].element].density < pixel.min) {} + else if (pixelMap[pixel.x][pixel.y-1].element != "pressure_plate" || pixelMap[pixel.x][pixel.y-1].on) { + pixel.on = true; + var coordsToShock = [ + [pixel.x, pixel.y+1], + [pixel.x+1, pixel.y], + [pixel.x-1, pixel.y], + ] + for (var i = 0; i < coordsToShock.length; i++) { + var x = coordsToShock[i][0]; + var y = coordsToShock[i][1]; + if (!isEmpty(x,y,true)) { + var newpixel = pixelMap[x][y]; + if (elements[newpixel.element].conduct) { + newpixel.charge = 1; + } + } + } + } + } + else if (pixel.on) { + pixel.on = false; + } + 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 -= 2 + } + 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 } @@ -8127,106 +9787,76 @@ elements.cerebrospinal_fluid = { } } } + doDefaults(pixel); }, - tempHigh: 102, - stateHigh: ["steam","salt"], - tempLow: -5, - category: "nervous system", - reactions: { - "dust": { elem1: "dirty_water", elem2: null }, - "ash": { elem1: "dirty_water", elem2: null }, - "carbon_dioxide": { elem1: "dirty_water", elem2: null }, - "sulfur": { elem1: "dirty_water", elem2: null }, - "rat": { elem1: "dirty_water", chance:0.005 }, - "plague": { elem1: "dirty_water", elem2: null }, - "fallout": { elem1: "dirty_water", chance:0.25 }, - "radiation": { elem1: "dirty_water", chance:0.25 }, - "rust": { elem1: "dirty_water", chance:0.005 }, - "lead": { elem1: "dirty_water", chance:0.005 }, - "solder": { elem1: "dirty_water", chance:0.005 }, - "rock": { elem2: "wet_sand", chance: 0.0005 }, - "limestone": { elem2: "wet_sand", chance: 0.0005 }, - "fly": { elem2:"dead_bug", chance:0.1, oneway:true }, - "firefly": { elem2:"dead_bug", chance:0.1, oneway:true }, - "bee": { elem2:"dead_bug", chance:0.05, oneway:true }, - "stink_bug": { elem2:"dead_bug", chance:0.1, oneway:true }, - "cancer": { elem1: "dirty_water", chance:0.25 }, - "oil": { elem1: "dirty_water", chance:0.005 }, - "uranium": { elem1: "dirty_water", chance:0.25 }, - "wet_sand": { oneway:true, chance:0.007, func:function(pixel){ - if (isEmpty(pixel.x,pixel.y-1) || isEmpty(pixel.x,pixel.y-2) || isEmpty(pixel.x,pixel.y-3)) { - changePixel(pixel,"foam"); - pixel.clone = "salt_water"; - } - }}, - "salt_water": { elem2:"bubble", attr2:{"clone":"salt_water"}, chance:0.001, tempMin:85 }, - // electrolysis: - "aluminum": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.0025 }, - "zinc": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.015 }, - "steel": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.0125 }, - "iron": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.0125 }, - "tin": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.01 }, - "brass": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.001 }, - "bronze": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.001 }, - "copper": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.0075 }, - "silver": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.0075 }, - "gold": { elem1:["hydrogen","hydrogen","oxygen","chlorine"], charged:true, chance:0.0075 }, - }, - state: "liquid", - density: 1026, - stain: -0.01, - properties: { + ignore: ["flash"], + 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, }, - extinguish: true, - isBio: true + isBio: true, + movable: false, } -elements.elixir = { - color: "#8CB6AA", - behavior: behaviors.LIQUID, - reactions: { - "dirt": { elem2: "mud", elem1: null }, - "dust": { elem1: "dirty_water", elem2: null }, - "ash": { elem1: "dirty_water", elem2: null }, - "carbon_dioxide": { elem1: "dirty_water", elem2: null }, - "sulfur": { elem1: "dirty_water", elem2: null }, - "rat": { elem1: "dirty_water", chance:0.005 }, - "plague": { elem1: "dirty_water", elem2: null }, - "fallout": { elem1: "dirty_water", chance:0.25 }, - "radiation": { elem1: "dirty_water", chance:0.25 }, - "rust": { elem1: "dirty_water", chance:0.005 }, - "lead": { elem1: "dirty_water", chance:0.005 }, - "solder": { elem1: "dirty_water", chance:0.005 }, - "rock": { elem2: "wet_sand", chance: 0.0005 }, - "limestone": { elem2: "wet_sand", chance: 0.0005 }, - "fly": { elem2:"dead_bug", chance:0.1, oneway:true }, - "firefly": { elem2:"dead_bug", chance:0.1, oneway:true }, - "bee": { elem2:"dead_bug", chance:0.05, oneway:true }, - "stink_bug": { elem2:"dead_bug", chance:0.1, oneway:true }, - "cancer": { elem1: "dirty_water", chance:0.25 }, - "oil": { elem1: "dirty_water", chance:0.005 }, - "uranium": { elem1: "dirty_water", chance:0.25 }, - "cerebrospinal_fluid": { elem1:"brain_jar_juice", elem2:"brain_jar_juice", chance:0.01 }, +elements.valve = { + color: ["#A9436A","#B64F71"], + category: "nervous system", + behavior: behaviors.WALL, + behaviorOn: [ + "XX|DL:valve_extension|XX", + "DL:valve_extension|XX|DL:valve_extension", + "XX|DL:valve_extension|XX", + ], + hoverStat: function(pixel) { + return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen }, - viscosity: 4000, - tempHigh: 120, - stateHigh: ["steam","steam","dna","dna","stench","salt",], - tempLow: 0, - category:"liquids", - state: "liquid", - density: 1450, - stain: 0.05, - hidden: true, -} - -elements.brain_jar_juice = { - color: "#4F8C24", - behavior: behaviors.LIQUID, - hidden: true, 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 -= 2 + } + 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 } @@ -8236,14 +9866,39 @@ elements.brain_jar_juice = { if (pixel.speed === null || isNaN(pixel.speed)) { pixel.speed = 0 } + if (pixel.charge || !pixel.open) { + pixel.openAge = 0 + pixel.open = true + } + if (pixel.open === true) { + pixel.openAge++ + } + if (pixel.openAge > 29) { + 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)) { + createPixel("valve_extension",x,y); + pixel.openAge = 0; + pixel.open = false; + } + } + } 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 += 1 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 1 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } @@ -8251,10 +9906,16 @@ elements.brain_jar_juice = { 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 += 1 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 1 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } @@ -8262,10 +9923,16 @@ elements.brain_jar_juice = { 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 += 1 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 1 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } @@ -8273,123 +9940,56 @@ elements.brain_jar_juice = { 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 += 1 + hitPixel.oxygen += 10 + pixel.oxygen -= 10 } if (hitPixel.nutrition < pixel.nutrition) { - hitPixel.nutrition += 1 + hitPixel.nutrition += 10 + pixel.nutrition -= 10 + } + if (hitPixel.speed < pixel.speed) { + hitPixel.speed += 1 + pixel.speed -= 1 } } } + doDefaults(pixel); }, - tempHigh: 102, - stateHigh: ["steam","steam","dna","dna","stench","salt",], - tempLow: -5, - category: "circulation", - reactions: { - "dust": { elem1: "dirty_water", elem2: null }, - "ash": { elem1: "dirty_water", elem2: null }, - "carbon_dioxide": { elem1: "dirty_water", elem2: null }, - "sulfur": { elem1: "dirty_water", elem2: null }, - "rat": { elem1: "dirty_water", chance:0.005 }, - "plague": { elem1: "dirty_water", elem2: null }, - "fallout": { elem1: "dirty_water", chance:0.25 }, - "radiation": { elem1: "dirty_water", chance:0.25 }, - "rust": { elem1: "dirty_water", chance:0.005 }, - "lead": { elem1: "dirty_water", chance:0.005 }, - "solder": { elem1: "dirty_water", chance:0.005 }, - "rock": { elem2: "wet_sand", chance: 0.0005 }, - "limestone": { elem2: "wet_sand", chance: 0.0005 }, - "fly": { elem2:"dead_bug", chance:0.1, oneway:true }, - "firefly": { elem2:"dead_bug", chance:0.1, oneway:true }, - "bee": { elem2:"dead_bug", chance:0.05, oneway:true }, - "stink_bug": { elem2:"dead_bug", chance:0.1, oneway:true }, - "cancer": { elem1: "dirty_water", chance:0.25 }, - "oil": { elem1: "dirty_water", chance:0.005 }, - "uranium": { elem1: "dirty_water", chance:0.25 }, - "wet_sand": { oneway:true, chance:0.007, func:function(pixel){ - if (isEmpty(pixel.x,pixel.y-1) || isEmpty(pixel.x,pixel.y-2) || isEmpty(pixel.x,pixel.y-3)) { - changePixel(pixel,"foam"); - pixel.clone = "salt_water"; - } - }}, - "brain_jar_juice": { elem2:"bubble", color2:"#81cf63", attr2:{"clone":"brain_jar_juice"}, chance:0.0001 }, - }, - state: "liquid", - density: 1026, - stain: -0.01, - properties: { + 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, }, - extinguish: true -} - -elements.bacteria = { - color: "#769356", - behavior: [ - "XX|SW:poop,dirty_water%5 AND M2%0.5|M2%5 AND SW:poop,dirty_water%5", - "XX|FX%2|M2%5 AND SW:poop,dirty_water%5 AND BO", - "XX|M1 AND SW:poop,dirty_water%5|M2%5 AND SW:poop,dirty_water%5", - ], - reactions: { - "sphincter": { elem2:null, chance:0.01, func:behaviors.FEEDPIXEL }, - "flesh": { elem2:null, chance:0.02, func:behaviors.FEEDPIXEL }, - "intestine": { elem2:null, chance:0.01, func:behaviors.FEEDPIXEL }, - "blood_vessel": { elem2:null, chance:0.02, func:behaviors.FEEDPIXEL }, - "dermis": { elem2:null, chance:0.02, func:behaviors.FEEDPIXEL }, - "scale_dermis": { elem2:null, chance:0.01, func:behaviors.FEEDPIXEL }, - "bug_dermis": { elem2:null, chance:0.01, func:behaviors.FEEDPIXEL }, - "lungs": { elem2:null, chance:0.02, func:behaviors.FEEDPIXEL }, - "rotten_meat": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, - "poop": { elem2:[null,null,null,null,"poop"], chance:0.05, func:behaviors.FEEDPIXEL }, - "rotten_cheese": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, - "cheese": { elem2:"rotten_cheese", chance:0.5, func:behaviors.FEEDPIXEL }, - "meat": { elem2:"rotten_meat", chance:0.5, func:behaviors.FEEDPIXEL }, - "cured_meat": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.01 }, - "dead_plant": { elem2:"dirt", chance:0.05, func:behaviors.FEEDPIXEL }, - "dead_bug": { elem2:null, chance:0.02, func:behaviors.FEEDPIXEL }, - "mercury": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, - "bleach": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, - "uranium": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, - "cyanide": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, - "chlorine": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.1 }, - "alcohol": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.25 }, - "water": { elem1:null, elem2:"dirty_water", chance:0.01 }, - "blood": { elem1:null, elem2:"infection", chance:0.01 }, - "salt_water": { elem1:null, elem2:"dirty_water", chance:0.01 }, - "sugar_water": { elem1:null, elem2:"dirty_water", chance:0.01, func:behaviors.FEEDPIXEL }, - "pool_water": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], elem2:"water", chance:0.005 }, - "vinegar": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.001 }, - "mouthwash": { elem1:[null,null,null,null,null,null,null,null,null,"dna"], chance:0.01 }, - }, - foodNeed: 15, - egg: "bacteria", - tempHigh: 100, - stateHigh: ["dna","dna","dna","dna","dna","dna","carbon_dioxide","steam"], - tempLow: 0, - stateLow: "dna", - breakInto: "dna", - category:"life", - burn:95, - burnTime: 100, - burnInto: ["dna","dna","dna","dna","dna","smoke","carbon_dioxide","steam"], - state: "solid", - density: 600, - conduct: .1 + isBio: true, + movable: false, } -elements.tract = { - color: ["#7C4941","#83594C"], - onSelect: function() { - logMessage("Draw a pipe, wait for walls to appear, then erase the exit hole."); - }, +elements.valve_extension = { + name: "valve", + color: ["#9e4839","#ba6449"], + category: "nervous system", + behavior: behaviors.WALL, 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.nutrition -= 2 pixel.oxygen -= 2 } if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) { @@ -8495,121 +10095,10 @@ elements.tract = { } } } - if (!pixel.stage && pixelTicks-pixel.start > 60) { - for (var i = 0; i < squareCoords.length; i++) { - var coord = squareCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true) && elements[pixelMap[x][y].element].movable) { - deletePixel(x,y) - } - if (isEmpty(x,y)) { - createPixel("flesh",x,y); - } - } - pixel.stage = 1; - } - else if (pixel.stage === 1 && pixelTicks-pixel.start > 70) { //uninitialized - for (var i = 0; i < squareCoords.length; i++) { - var coord = squareCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (isEmpty(x,y)) { - pixel.stage = 2; //blue - pixel.color = pixelColorPick(pixel,"#552D3F"); - break; - } - } - } - else if (pixel.stage > 1 && pixelTicks % 3 === pixel.stage-2) { //initialized - for (var i = 0; i < squareCoords.length; i++) { - var coord = squareCoords[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true) && pixelMap[x][y].element === "tract") { - var newPixel = pixelMap[x][y]; - if (newPixel.stage === 1) { - var newColor; - switch (pixel.stage) { - case 2: newPixel.stage = 3; newColor = "#554B21"; break; //green - case 3: newPixel.stage = 4; newColor = "#66241B"; break; //red - case 4: newPixel.stage = 2; newColor = "#552D3F"; break; //blue - } - newPixel.color = pixelColorPick(newPixel,newColor); - } - } - } - var moved = false; - shuffleArray(squareCoordsShuffle); - for (var i = 0; i < squareCoordsShuffle.length; i++) { - var coord = squareCoordsShuffle[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (!isEmpty(x,y,true)) { - var newPixel = pixelMap[x][y]; - if (newPixel.element === "tract") { - 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 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { //transfer to adjacent pipe - newPixel.con = pixel.con; - newPixel.con.x = newPixel.x; - newPixel.con.y = newPixel.y; - pixel.con = null; - moved = true; - break; - } - } - else if (!pixel.con && elements[newPixel.element].movable) { //suck up pixel - pixel.con = newPixel; - deletePixel(newPixel.x,newPixel.y); - pixel.con.x = pixel.x; - pixel.con.y = pixel.y; - pixel.con.del; - moved = true; - break; - } - } - } - if (pixel.con && !moved && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) { // move to same stage if none other - for (var i = 0; i < squareCoordsShuffle.length; i++) { - var coord = squareCoordsShuffle[i]; - var x = pixel.x+coord[0]; - var y = pixel.y+coord[1]; - if (isEmpty(x,y)) { - delete pixel.con.del; - pixel.con.x = x; - pixel.con.y = y; - pixelMap[x][y] = pixel.con; - currentPixels.push(pixel.con); - pixel.con = null; - break; - } - if (!isEmpty(x,y,true) && pixelMap[x][y].element === "tract") { - var newPixel = pixelMap[x][y]; - if (pixel.con && !newPixel.con && newPixel.stage === pixel.stage) { - newPixel.con = pixel.con; - newPixel.con.x = newPixel.x; - newPixel.con.y = newPixel.y; - pixel.con = null; - break; - } - } - } - } - } doDefaults(pixel); }, - category: "structural", - movable: false, - canContain: true, - forceSaveColor: true, density: 2710, state: "solid", - conduct: .001, tempHigh: 200, stateHigh: "cooked_meat", tempLow: -25, @@ -8628,6 +10117,8 @@ elements.tract = { speed: 0, }, isBio: true, + movable: false, + hidden: true, } elements.revive = { @@ -8703,55 +10194,84 @@ elements.drain_health = { } if (!elements.cancer.reactions) { elements.cancer.reactions = {} } +elements.cancer.reactions.attached_hair = { "elem2": "loose_hair", chance:0.4 }; +elements.cancer.reactions.hair_end = { "elem2": "loose_hair", chance:0.4 }; elements.cancer.reactions.flesh = { "elem2": "cancer", chance:0.005 }; +elements.cancer.reactions.slimey_flesh = { "elem2": ["slime","cancer"], chance:0.004 }; +elements.cancer.reactions.acidic_flesh = { "elem2": ["acid","cancer"], chance:0.004 }; +elements.cancer.reactions.cloak_flesh = { "elem2": "cancer", chance:0.004 }; elements.cancer.reactions.adipose = { "elem2": "cancer", chance:0.005 }; -elements.cancer.reactions.blood_vessel = { "elem2": "cancer", chance:0.005 }; +elements.cancer.reactions.blood_vessel = { "elem2": ["cancer","infected_vessel","infected_vessel","infected_vessel","infected_vessel"], chance:0.05 }; +elements.cancer.reactions.white_blood_cell = { "elem2": ["cancer","blood","blood_vessel","blood_vessel","infected_vessel"], chance:0.005 }; elements.cancer.reactions.heart = { "elem2": "cancer", chance:0.005 }; +elements.cancer.reactions.kidney = { "elem2": "cancer", chance:0.005 }; +elements.cancer.reactions.liver = { "elem2": "cancer", chance:0.005 }; elements.cancer.reactions.dermis = { "elem2": "cancer", chance:0.005 }; elements.cancer.reactions.amphib_dermis = { "elem2": "cancer", chance:0.005 }; elements.cancer.reactions.scale_dermis = { "elem2": "cancer", chance:0.004 }; elements.cancer.reactions.epidermis = { "elem2": "cancer", chance:0.0002 }; elements.cancer.reactions.amphib_skin = { "elem2": "cancer", chance:0.0003 }; +elements.cancer.reactions.hairy_skin = { "elem2": "cancer", chance:0.0003 }; +elements.cancer.reactions.hair_dermis = { "elem2": "cancer", chance:0.0003 }; elements.cancer.reactions.scales = { "elem2": "cancer", chance:0.0001 }; elements.cancer.reactions.real_bone = { "elem2": ["bone","bone","cancer"], chance:0.0001 }; elements.cancer.reactions.real_bone_marrow = { "elem2": ["bone","cancer","cancer","cancer","cancer","cancer","cancer"], chance:0.0001 }; elements.cancer.reactions.lungs = { "elem2": "cancer", chance:0.005 }; +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 }; elements.cancer.reactions.digested_material = { "elem2": "cancer", chance:0.001 }; elements.cancer.reactions.intestines = { "elem2": "cancer", chance:0.005 }; elements.cancer.reactions.stomach_valve = { "elem2": "cancer", chance:0.005 }; elements.cancer.reactions.stomach_lining = { "elem2": "cancer", chance:0.005 }; -elements.uranium.reactions.decomposer_stomach = { "elem2": "cancer", chance:0.004 }; -elements.uranium.reactions.herbi_stomach = { "elem2": "cancer", chance:0.004 }; -elements.uranium.reactions.carni_stomach = { "elem2": "cancer", chance:0.004 }; -elements.uranium.reactions.explosive_stomach = { "elem2": ["pop","cancer","cancer","cancer"], chance:0.003 }; +elements.cancer.reactions.decomposer_stomach = { "elem2": "cancer", chance:0.004 }; +elements.cancer.reactions.herbi_stomach = { "elem2": "cancer", chance:0.004 }; +elements.cancer.reactions.carni_stomach = { "elem2": "cancer", chance:0.004 }; +elements.cancer.reactions.explosive_stomach = { "elem2": ["pop","cancer","cancer","cancer"], chance:0.003 }; +elements.cancer.reactions.biotorch = { "elem2": ["cooked_meat","cancer","cancer","cancer"], chance:0.003 }; +elements.cancer.reactions.biosensor = { "elem2": "cancer", chance:0.005 }; +elements.cancer.reactions.valve = { "elem2": "cancer", chance:0.005 }; +elements.cancer.reactions.valve_extension = { "elem2": "cancer", chance:0.005 }; elements.cancer.reactions.throat_lining = { "elem2": "cancer", chance:0.005 }; if (!elements.uranium.reactions) { elements.uranium.reactions = {} } +elements.uranium.reactions.attached_hair = { "elem2": "loose_hair", chance:0.4 }; +elements.uranium.reactions.hair_end = { "elem2": "loose_hair", chance:0.4 }; elements.uranium.reactions.flesh = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat"], chance:0.5 }; +elements.uranium.reactions.slimey_flesh = { "elem2": ["ash","slime","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.4 }; +elements.uranium.reactions.acidic_flesh = { "elem2": ["ash","acid","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.4 }; +elements.uranium.reactions.cloak_flesh = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.4 }; elements.uranium.reactions.adipose = { "elem2": ["ash","blood","fat","fat","meat","rotten_meat","cooked_meat"], chance:0.5 }; -elements.uranium.reactions.blood_vessel = { "elem2": ["ash","blood","blood","blood","blood","blood","blood","meat","rotten_meat","cooked_meat"], chance:0.5 }; -elements.uranium.reactions.heart = { "elem2": ["ash","blood","blood","blood","blood","blood","blood","meat","rotten_meat","cooked_meat"], chance:0.5 }; +elements.uranium.reactions.blood_vessel = { "elem2": ["ash","blood","blood","blood","blood","blood","infected_vessel","meat","rotten_meat","cooked_meat"], chance:0.5 }; +elements.uranium.reactions.heart = { "elem2": ["ash","blood","blood","blood","blood","blood","infected_vessel","meat","rotten_meat","cooked_meat"], chance:0.5 }; +elements.uranium.reactions.kidney = { "elem2": ["ash","blood","meat","rotten_meat","cooked_meat"], chance:0.5 }; +elements.uranium.reactions.liver = { "elem2": ["ash","blood","meat","rotten_meat","cooked_meat"], chance:0.5 }; elements.uranium.reactions.dermis = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.5 }; elements.uranium.reactions.amphib_dermis = { "elem2": ["ash","blood","slime","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.5 }; elements.uranium.reactions.scale_dermis = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.5 }; elements.uranium.reactions.bug_dermis = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.5 }; -elements.uranium.reactions.epidermis = { "elem2": ["cooked_meat","cancer","ash","skin","hair"], chance:0.1 }; +elements.uranium.reactions.epidermis = { "elem2": ["cooked_meat","cancer","ash","skin"], chance:0.1 }; +elements.uranium.reactions.hairy_skin = { "elem2": ["cooked_meat","cancer","ash","skin","hair"], chance:0.1 }; +elements.uranium.reactions.hair_dermis = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.5 }; elements.uranium.reactions.amphib_skin = { "elem2": ["cooked_meat","cancer","ash","skin","slime"], chance:0.4 }; elements.uranium.reactions.scales = { "elem2": ["cooked_meat","cancer","ash","epidermis","skin","dust","calcium"], chance:0.1 }; elements.uranium.reactions.exoskeleton = { "elem2": ["cooked_meat","cancer","ash","epidermis","skin","dust","calcium"], chance:0.1 }; elements.uranium.reactions.real_bone = { "elem2": ["bone","bone","radiation"], chance:0.01 }; elements.uranium.reactions.gills = { "elem2": ["ash","steam","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 }; elements.uranium.reactions.lungs = { "elem2": ["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.5 }; +elements.uranium.reactions.simple_lung = { "elem2": ["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.5 }; 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 }; elements.uranium.reactions.intestines = { "elem2": ["ash","steam","meat","rotten_meat","cooked_meat","flesh","ash","steam","meat","rotten_meat","cooked_meat","flesh","poop"], chance:0.5 }; @@ -8762,27 +10282,43 @@ elements.uranium.reactions.herbi_stomach = { "elem2": ["cancer","ash","steam","m elements.uranium.reactions.carni_stomach = { "elem2": ["cancer","ash","steam","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 }; elements.uranium.reactions.explosive_stomach = { "elem2": ["cancer","ash","steam","meat","rotten_meat","cooked_meat","flesh","pop"], chance:0.4 }; elements.uranium.reactions.throat_lining = { "elem2": ["ash","slime","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 }; +elements.uranium.reactions.biotorch = { "elem2": ["cancer","ash","steam","cooked_meat","rotten_meat","cooked_meat","flesh","fire"], chance:0.5 }; +elements.uranium.reactions.biosensor = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat"], chance:0.5 }; +elements.uranium.reactions.valve = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat"], chance:0.5 }; +elements.uranium.reactions.valve_extension = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat"], chance:0.5 }; if (!elements.radiation.reactions) { elements.radiation.reactions = {} } +elements.radiation.reactions.attached_hair = { "elem2": "loose_hair", chance:0.4 }; +elements.radiation.reactions.hair_end = { "elem2": "loose_hair", chance:0.4 }; elements.radiation.reactions.flesh = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.4 }; +elements.radiation.reactions.slimey_flesh = { "elem2": ["ash","slime","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.4 }; +elements.radiation.reactions.acidic_flesh = { "elem2": ["ash","acid","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.4 }; +elements.radiation.reactions.cloak_flesh = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.4 }; elements.radiation.reactions.adipose = { "elem2": ["ash","blood","fat","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.4 }; -elements.radiation.reactions.blood_vessel = { "elem2": ["ash","blood","blood","blood","blood","blood","blood","meat","rotten_meat","cooked_meat"], chance:0.4 }; -elements.radiation.reactions.heart = { "elem2": ["ash","blood","blood","blood","blood","blood","blood","meat","rotten_meat","cooked_meat"], chance:0.4 }; +elements.radiation.reactions.blood_vessel = { "elem2": ["ash","blood","blood","blood","blood","blood","infected_vessel","meat","rotten_meat","cooked_meat"], chance:0.4 }; +elements.radiation.reactions.heart = { "elem2": ["ash","blood","blood","blood","blood","infected_vessel","blood","meat","rotten_meat","cooked_meat"], chance:0.4 }; +elements.radiation.reactions.kidney = { "elem2": ["ash","blood","meat","rotten_meat","cooked_meat"], chance:0.5 }; +elements.radiation.reactions.liver = { "elem2": ["ash","blood","meat","rotten_meat","cooked_meat"], chance:0.5 }; elements.radiation.reactions.dermis = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.4 }; elements.radiation.reactions.amphib_dermis = { "elem2": ["ash","blood","slime","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.4 }; elements.radiation.reactions.scale_dermis = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.4 }; elements.radiation.reactions.scales = { "elem2": ["cooked_meat","cancer","ash","epidermis","skin","dust","calcium"], chance:0.1 }; elements.radiation.reactions.exoskeleton = { "elem2": ["cooked_meat","cancer","ash","epidermis","skin","dust","calcium"], chance:0.1 }; elements.radiation.reactions.bug_dermis = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.4 }; -elements.radiation.reactions.epidermis = { "elem2": ["cooked_meat","cancer","ash","skin","hair"], chance:0.1 }; +elements.radiation.reactions.epidermis = { "elem2": ["cooked_meat","cancer","ash","skin"], chance:0.1 }; +elements.radiation.reactions.hairy_skin = { "elem2": ["cooked_meat","cancer","ash","skin","hair"], chance:0.1 }; +elements.radiation.reactions.hair_dermis = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat","cancer","cancer"], chance:0.4 }; elements.radiation.reactions.amphib_skin = { "elem2": ["cooked_meat","cancer","ash","skin","slime"], chance:0.1 }; elements.radiation.reactions.real_bone = { "elem2": ["bone","bone","radiation"], chance:0.01 }; elements.radiation.reactions.gills = { "elem2": ["ash","steam","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }; elements.radiation.reactions.lungs = { "elem2": ["cancer","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 }; +elements.radiation.reactions.simple_lung = { "elem2": ["cancer","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 }; 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 }; elements.radiation.reactions.intestines = { "elem2": ["cancer","ash","steam","meat","rotten_meat","cooked_meat","flesh","ash","steam","meat","rotten_meat","cooked_meat","flesh","poop"], chance:0.4 }; @@ -8793,25 +10329,41 @@ elements.radiation.reactions.herbi_stomach = { "elem2": ["cancer","ash","steam", elements.radiation.reactions.carni_stomach = { "elem2": ["cancer","ash","steam","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }; elements.radiation.reactions.explosive_stomach = { "elem2": ["cancer","ash","steam","meat","rotten_meat","cooked_meat","flesh","pop"], chance:0.3 }; elements.radiation.reactions.throat_lining = { "elem2": ["cancer","ash","slime","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 }; +elements.radiation.reactions.biotorch = { "elem2": ["cancer","ash","steam","cooked_meat","rotten_meat","cooked_meat","flesh","fire"], chance:0.4 }; +elements.radiation.reactions.biosensor = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat"], chance:0.4 }; +elements.radiation.reactions.valve = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat"], chance:0.4 }; +elements.radiation.reactions.valve_extension = { "elem2": ["ash","blood","fat","meat","rotten_meat","cooked_meat"], chance:0.4 }; if (!elements.plague.reactions) { elements.plague.reactions = {} } +elements.plague.reactions.attached_hair = { "elem2": "loose_hair", chance:0.04 }; +elements.plague.reactions.hair_end = { "elem2": "loose_hair", chance:0.04 }; elements.plague.reactions.flesh = { "elem2": ["rotten_meat","plague","fat","meat","rotten_meat","plague","infection","infection"], chance:0.04 }; +elements.plague.reactions.slimey_flesh = { "elem2": ["slime","slime","rotten_meat","plague","fat","meat","rotten_meat","plague","infection","infection"], chance:0.04 }; +elements.plague.reactions.cloak_flesh = { "elem2": ["rotten_meat","plague","fat","meat","rotten_meat","plague","infection","infection"], chance:0.04 }; +elements.plague.reactions.acidic_flesh = { "elem2": ["acid","rotten_meat","steam","meat","rotten_meat","plague","flesh"], chance:0.04 }; elements.plague.reactions.adipose = { "elem2": ["rotten_meat","plague","fat","fat","meat","rotten_meat","plague","infection","infection"], chance:0.04 }; -elements.plague.reactions.blood_vessel = { "elem2": ["rotten_meat","plague","meat","rotten_meat","plague","infection","infection","infection","infection","infection","infection"], chance:0.04 }; -elements.plague.reactions.heart = { "elem2": ["rotten_meat","plague","meat","rotten_meat","plague","infection","infection","infection","infection","infection","infection"], chance:0.04 }; +elements.plague.reactions.blood_vessel = { "elem2": ["rotten_meat","plague","meat","rotten_meat","plague","infected_vessel","infected_vessel","infected_vessel","infected_vessel","infected_vessel","infected_vessel"], chance:0.1 }; +elements.plague.reactions.heart = { "elem2": ["rotten_meat","plague","meat","rotten_meat","plague","infected_vessel","infection","infection","infection","infection","infection"], chance:0.04 }; +elements.plague.reactions.kidney = { "elem2": ["rotten_meat","plague","rotten_meat","meat","rotten_meat","plague","infection","infection"], chance:0.04 }; +elements.plague.reactions.liver = { "elem2": ["rotten_meat","plague","rotten_meat","meat","rotten_meat","plague","infection","infection"], chance:0.04 }; elements.plague.reactions.dermis = { "elem2": ["rotten_meat","infection","fat","meat","rotten_meat","plague","infection","infection"], chance:0.04 }; -elements.plague.reactions.amphib_dermis = { "elem2": ["rotten_meat","infection","slime","meat","rotten_meat","plague","infection","infection"], chance:0.04 }; +elements.plague.reactions.hair_dermis = { "elem2": ["rotten_meat","infection","fat","meat","rotten_meat","plague","infection","infection"], chance:0.04 }; +elements.plague.reactions.hairy_skin = { "elem2": ["plague","infection","rotten_meat","dust","dust","hair"], chance:0.04 }; +elements.plague.reactions.amphib_dermis = { "elem2": ["rotten_meat","infection","slime","meat","rotten_meat","plague","infection","infection"], chance:0.01 }; elements.plague.reactions.scale_dermis = { "elem2": ["rotten_meat","infection","fat","meat","rotten_meat","plague","infection","infection"], chance:0.04 }; -elements.plague.reactions.epidermis = { "elem2": ["plague","infection","rotten_meat","skin","hair"], chance:0.1 }; -elements.plague.reactions.amphib_skin = { "elem2": ["plague","infection","rotten_meat","skin","slime"], chance:0.1 }; -elements.plague.reactions.scales = { "elem2": ["plague","infection","rotten_meat","dust","skin","calcium"], chance:0.1 }; +elements.plague.reactions.epidermis = { "elem2": ["plague","infection","rotten_meat","dust","dust"], chance:0.01 }; +elements.plague.reactions.amphib_skin = { "elem2": ["plague","infection","rotten_meat","skin","slime"], chance:0.01 }; +elements.plague.reactions.scales = { "elem2": ["plague","infection","rotten_meat","dust","skin","calcium"], chance:0.01 }; elements.plague.reactions.real_bone = { "elem2": ["bone","bone","infection","plague"], chance:0.01 }; -elements.plague.reactions.gills = { "elem2": ["infection","steam","meat","rotten_meat","plague","flesh","plague"], chance:0.04 }; -elements.plague.reactions.lungs = { "elem2": ["infection","rotten_meat","carbon_dioxide","meat","rotten_meat","plague","flesh","rotten_meat","carbon_dioxide","meat","rotten_meat","plague","flesh","rotten_meat","oxygen","meat","rotten_meat","plague","flesh"], chance:0.04 }; +elements.plague.reactions.gills = { "elem2": ["infection","steam","meat","rotten_meat","plague","flesh","plague"], chance:0.05 }; +elements.plague.reactions.lungs = { "elem2": ["infection","rotten_meat","carbon_dioxide","meat","rotten_meat","plague","flesh","rotten_meat","carbon_dioxide","meat","rotten_meat","plague","flesh","rotten_meat","oxygen","meat","rotten_meat","plague","flesh"], chance:0.1 }; +elements.plague.reactions.simple_lung = { "elem2": ["infection","rotten_meat","carbon_dioxide","meat","rotten_meat","plague","flesh","rotten_meat","carbon_dioxide","meat","rotten_meat","plague","flesh","rotten_meat","oxygen","meat","rotten_meat","plague","flesh"], chance:0.04 }; 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 }; elements.plague.reactions.intestines = { "elem2": ["infection","rotten_meat","steam","meat","rotten_meat","plague","flesh","rotten_meat","steam","meat","rotten_meat","plague","flesh","poop"], chance:0.04 }; @@ -8822,11 +10374,17 @@ elements.plague.reactions.herbi_stomach = { "elem2": ["infection","rotten_meat", elements.plague.reactions.carni_stomach = { "elem2": ["infection","rotten_meat","steam","meat","rotten_meat","plague","flesh"], chance:0.04 }; elements.plague.reactions.explosive_stomach = { "elem2": ["infection","plague","steam","meat","rotten_meat","plague","flesh","pop"], chance:0.03 }; elements.plague.reactions.throat_lining = { "elem2": ["infection","rotten_meat","slime","meat","rotten_meat","plague","flesh"], chance:0.04 }; +elements.plague.reactions.biotorch = { "elem2": ["infection","ash","steam","cooked_meat","rotten_meat","plague","plague","fire"], chance:0.04 }; +elements.plague.reactions.biosensor = { "elem2": ["infection","blood","fat","meat","rotten_meat","plague"], chance:0.04 }; +elements.plague.reactions.valve = { "elem2": ["infection","infection","fat","meat","rotten_meat","plague"], chance:0.04 }; +elements.plague.reactions.valve_extension = { "elem2": ["infection","infection","plague","meat","rotten_meat","plague"], chance:0.04 }; + +if (!elements.infection.reactions) { elements.infection.reactions = {} } +elements.infection.reactions.blood_vessel = { "elem2": ["infection","infected_vessel","infected_vessel","infected_vessel","infected_vessel","infected_vessel","infected_vessel","infected_vessel"], chance:0.1 }; +elements.infection.reactions.heart = { "elem2": ["infection","infected_vessel","infection","infection","infection","infection","infected_vessel","infected_vessel"], chance:0.02 }; if (!elements.fly.reactions) { elements.infection.reactions = {} } elements.fly.reactions.poop = { elem2:[null,null,"stench"], chance:0.15, func:behaviors.FEEDPIXEL }; -elements.fly.reactions.intestines = { elem1:[null,null,"stench"], chance:0.015, }; -elements.fly.reactions.stomach_valve = { elem1:[null,null,"stench"], chance:0.05, }; if (!elements.stench.reactions) { elements.infection.reactions = {} } elements.stench.reactions.intestines = { elem1:[null,null,null,null,null,null,"foam"], chance:0.015, };