diff --git a/mod-list.html b/mod-list.html
index 24dfaf0e..41153a67 100644
--- a/mod-list.html
+++ b/mod-list.html
@@ -217,6 +217,7 @@
Sandboxels Mod List
the_ground.js | Adds several rock types, worldgen settings, and gemstones | Alice |
Machines & Technology |
+circuitcore.js | An extension to logicgates.js that adds advanced circuits. Documentation. | RedBirdly |
clone_liquid.js | Adds a liquid form of cloner | Alice |
colored_lightbulbs.js | Adds a light bulb that can be painted. | guzzo86, ggod |
combustion.js | Adds components necessary for combustion engines | uptzik |
@@ -293,6 +294,7 @@ Sandboxels Mod List
human_edit.js | Improvements to humans | Alice |
Humanitize.js | Makes humans cultured and able to craft, mine, build houses, trade, and much more. | Nekonico |
kopalstuff.js | Adds creatures, spirits, DNA, foods, and more | DaviStudios |
+lizard_mod.js | Adds lizards to sandboxels. | RedBirdly |
lost_souls.js | Adds souls and related elements, the mod can also be found on Github | pixelegend4, SquareScreamYT, salmonfishy |
miscible_psoup_and_birthpool.js | Makes Primordial Soup and Birthpool mix instead of the birthpool settling to the bottom. Will be deprecated upon the release of Magical Menagerie | Alice |
mobs.js | Adds Creepers, Zombies, and Skeletons | Alice |
@@ -347,6 +349,7 @@ Sandboxels Mod List
Visual Effects |
acid_and_shapes.js | Weird visual effects. Enable in Settings | Alice |
customBackground.js | Set your background to an image link | Jayd |
+fractals.js | Adds an element and tools to render fractals in game | nousernamefound |
heatglow.js | Red glowing effect for hot metals | nousernamefound |
invisible_dye.js | Adds elements like Dye and Spray Paint that take the color of the background | Alice |
invisible_wall.js | Adds an element like Wall that takes the color of the background | Alice |
diff --git a/mods/10kelements.js b/mods/10kelements.js
index f22387d6..a7c371e7 100644
--- a/mods/10kelements.js
+++ b/mods/10kelements.js
@@ -11,7 +11,7 @@ elements.change_count = {
if (!cans) { return }
if (cans == "skin"){settings.randomcount = 10000; settings.skineasteregg = true; settings.sandeasteregg = false; saveSettings(); alert("skin"); return}
if (cans == "sand"){settings.randomcount = 10000; settings.skineasteregg = false; settings.sandeasteregg = true; saveSettings(); alert("sand"); return}
- if (cans > 2000000){alert("You have put too big of a number! This would surely crash your browser or eat up all your RAM! Element count will remain unchanged."); return}
+ if (cans > 100000){alert("You have put too big of a number! This would surely crash your browser or eat up all your RAM! Element count will remain unchanged."); return}
if (cans < 1 && (parseInt(cans) > -1) ){alert("You have either put a decimal or zero. Why? Element count will remain unchanged."); return}
if (isNaN(parseInt(cans))){alert("Apparently your input isnt even a number. Try again. Element count will remain unchanged."); return}
settings.randomcount = parseInt(cans)
@@ -24,7 +24,7 @@ elements.change_count = {
var choosebehaviors = behaviors
delete choosebehaviors.KILLPIXEL2
delete choosebehaviors.KILLPIXEL1
-if (!settings.randomcount || settings.randomcount > 50000){settings.randomcount = 10000; saveSettings()}
+if (!settings.randomcount || settings.randomcount > 100000){settings.randomcount = 10000; saveSettings()}
var color = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "a", "b", "c", "d", "e","f"]
var states = ["solid", "liquid", "gas"]
var essentialelements = ["molten_gallium", "gallium", "gallium_gas", "change_count"]
diff --git a/mods/biology.js b/mods/biology.js
index da9845d3..ac78d0f3 100644
--- a/mods/biology.js
+++ b/mods/biology.js
@@ -66,6 +66,56 @@ viewInfo[7] = { // Illness View
}
}
+behaviorRules.BCF = function() {
+ if (btemp.pixel.clone) {
+ if (isEmpty(btemp.newCoords.x, btemp.newCoords.y)) {
+ createPixel(btemp.pixel.clone, btemp.newCoords.x, btemp.newCoords.y)
+ btemp.pixel.nutrition = (btemp.pixel.nutrition - 10)
+ btemp.pixel.oxygen = (btemp.pixel.oxygen - 1)
+ if (pixelMap[btemp.newCoords.x][btemp.newCoords.y]) {
+ pixelMap[btemp.newCoords.x][btemp.newCoords.y].temp = btemp.pixel.temp;
+ pixelTempCheck(pixelMap[btemp.newCoords.x][btemp.newCoords.y]);
+ }
+ }
+ }
+ else {
+ if (!isEmpty(btemp.newCoords.x, btemp.newCoords.y,true)) {
+ var newPixel = pixelMap[btemp.newCoords.x][btemp.newCoords.y];
+ if (!btemp.pixel.clone && btemp.info.ignore && btemp.info.ignore.indexOf(newPixel.element) !== -1) {
+ return;
+ }
+ if (newPixel.element !== btemp.pixel.element) {
+ btemp.pixel.clone = newPixel.element;
+ btemp.pixel.temp = newPixel.temp;
+ }
+ else if (newPixel.clone) {
+ btemp.pixel.clone = newPixel.clone;
+ btemp.pixel.temp = newPixel.temp;
+ }
+ }
+ }
+}
+
+behaviorRules.BCR = function() {
+ if (isEmpty(btemp.newCoords.x,btemp.newCoords.y)) {
+ if (btemp.arg == null) {
+ btemp.arg = btemp.pixel.element;
+ }
+ else if (btemp.arg.indexOf(",") !== -1) {
+ btemp.arg = choose(btemp.arg.split(","));
+ }
+ if (elements[btemp.arg]) {
+ createPixel(btemp.arg,btemp.newCoords.x,btemp.newCoords.y);
+ btemp.pixel.nutrition = (btemp.pixel.nutrition - 1)
+ if (btemp.info.fireColor && btemp.arg==="fire") {
+ pixelMap[btemp.newCoords.x][btemp.newCoords.y].color = pixelColorPick(pixelMap[btemp.newCoords.x][btemp.newCoords.y],btemp.info.fireColor);
+ }
+ pixelMap[btemp.newCoords.x][btemp.newCoords.y].temp = btemp.pixel.temp
+ pixelTempCheck(pixelMap[btemp.newCoords.x][btemp.newCoords.y]);
+ }
+ }
+}
+
elements.flesh = {
color: ["#9e4839","#ba6449"],
category: "structural",
@@ -380,6 +430,10 @@ elements.dermis = {
var y = pixel.y + coords[1];
if (isEmpty(x,y)) {
createPixel("epidermis",x,y);
+ pixelMap[x][y].nutrition = (Math.round(pixel.nutrition / 2))
+ pixelMap[x][y].oxygen = (Math.round(pixel.oxygen / 2))
+ pixel.nutrition = (Math.round(pixel.nutrition / 2))
+ pixel.oxygen = (Math.round(pixel.oxygen / 2))
}
}
}
@@ -722,6 +776,10 @@ elements.cloak_dermis = {
var y = pixel.y + coords[1];
if (isEmpty(x,y)) {
createPixel("cloak_skin",x,y);
+ pixelMap[x][y].nutrition = (Math.round(pixel.nutrition / 2))
+ pixelMap[x][y].oxygen = (Math.round(pixel.oxygen / 2))
+ pixel.nutrition = (Math.round(pixel.nutrition / 2))
+ pixel.oxygen = (Math.round(pixel.oxygen / 2))
}
}
}
@@ -1332,9 +1390,17 @@ elements.hair_dermis = {
if (isEmpty(x,y)) {
if (Math.random() > 0.05) {
createPixel("hairy_skin",x,y);
+ pixelMap[x][y].nutrition = (Math.round(pixel.nutrition / 2))
+ pixelMap[x][y].oxygen = (Math.round(pixel.oxygen / 2))
+ pixel.nutrition = (Math.round(pixel.nutrition / 2))
+ pixel.oxygen = (Math.round(pixel.oxygen / 2))
}
else {
createPixel("epidermis",x,y);
+ pixelMap[x][y].nutrition = (Math.round(pixel.nutrition / 2))
+ pixelMap[x][y].oxygen = (Math.round(pixel.oxygen / 2))
+ pixel.nutrition = (Math.round(pixel.nutrition / 2))
+ pixel.oxygen = (Math.round(pixel.oxygen / 2))
}
}
}
@@ -1631,6 +1697,10 @@ elements.scale_dermis = {
var y = pixel.y + coords[1];
if (isEmpty(x,y)) {
createPixel("scales",x,y);
+ pixelMap[x][y].nutrition = (Math.round(pixel.nutrition / 2))
+ pixelMap[x][y].oxygen = (Math.round(pixel.oxygen / 2))
+ pixel.nutrition = (Math.round(pixel.nutrition / 2))
+ pixel.oxygen = (Math.round(pixel.oxygen / 2))
}
}
}
@@ -1783,6 +1853,10 @@ elements.bug_dermis = {
var y = pixel.y + coords[1];
if (isEmpty(x,y)) {
createPixel("exoskeleton",x,y);
+ pixelMap[x][y].nutrition = (Math.round(pixel.nutrition / 2))
+ pixelMap[x][y].oxygen = (Math.round(pixel.oxygen / 2))
+ pixel.nutrition = (Math.round(pixel.nutrition / 2))
+ pixel.oxygen = (Math.round(pixel.oxygen / 2))
}
}
}
@@ -1922,7 +1996,6 @@ elements.bug_dermis = {
elements.amphib_dermis = {
color: "#9DAB6A",
- name: "amphibian_dermis",
category: "structural",
behavior: behaviors.WALL,
hoverStat: function(pixel) {
@@ -1936,6 +2009,10 @@ elements.amphib_dermis = {
var y = pixel.y + coords[1];
if (isEmpty(x,y)) {
createPixel("amphib_skin",x,y);
+ pixelMap[x][y].nutrition = (Math.round(pixel.nutrition - ((pixel.nutrition / 4) * 3)))
+ pixelMap[x][y].oxygen = (Math.round(pixel.oxygen - ((pixel.oxygen / 4) * 3)))
+ pixel.nutrition = (Math.round(pixel.nutrition - (pixel.nutrition / 4)))
+ pixel.oxygen = (Math.round(pixel.oxygen - (pixel.oxygen / 4)))
}
}
}
@@ -3048,12 +3125,9 @@ elements.kidney = {
hitPixel.nutrition += 20
pixel.nutrition -= 20
}
- if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) {
- if (hitPixel.kidneyAttached === false) {
- hitPixel.kidneyAttached = true
- }
- if (Math.random() > 0.9999 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen) / 2000))) {
- changePixel(hitPixel,"white_blood_cell");
+ if (elements[hitPixel.element].id === elements.infected_vessel.id && Math.random() > 0.75) {
+ if (Math.random() > 0.5 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2020))) {
+ changePixel(hitPixel,"blood_vessel");
}
}
}
@@ -3069,12 +3143,9 @@ elements.kidney = {
hitPixel.nutrition += 20
pixel.nutrition -= 20
}
- if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) {
- if (hitPixel.kidneyAttached === false) {
- hitPixel.kidneyAttached = true
- }
- if (Math.random() > 0.995 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
- changePixel(hitPixel,"white_blood_cell");
+ if (elements[hitPixel.element].id === elements.infected_vessel.id && Math.random() > 0.75) {
+ if (Math.random() > 0.5 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
+ changePixel(hitPixel,"blood_vessel");
}
}
}
@@ -3090,12 +3161,9 @@ elements.kidney = {
hitPixel.nutrition += 20
pixel.nutrition -= 20
}
- if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) {
- if (hitPixel.kidneyAttached === false) {
- hitPixel.kidneyAttached = true
- }
- if (Math.random() > 0.995 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
- changePixel(hitPixel,"white_blood_cell");
+ if (elements[hitPixel.element].id === elements.infected_vessel.id && Math.random() > 0.75) {
+ if (Math.random() > 0.5 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
+ changePixel(hitPixel,"blood_vessel");
}
}
}
@@ -3111,12 +3179,9 @@ elements.kidney = {
hitPixel.nutrition += 20
pixel.nutrition -= 20
}
- if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) {
- if (hitPixel.kidneyAttached === false) {
- hitPixel.kidneyAttached = true
- }
- if (Math.random() > 0.995 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
- changePixel(hitPixel,"white_blood_cell");
+ if (elements[hitPixel.element].id === elements.infected_vessel.id && Math.random() > 0.75) {
+ if (Math.random() > 0.5 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
+ changePixel(hitPixel,"blood_vessel");
}
}
}
@@ -3307,9 +3372,6 @@ elements.blood_vessel = {
if (pixel.speed === null || isNaN(pixel.speed)) {
pixel.speed = 0
}
- if (pixel.kidneyAttached == true && Math.random() > 0.9999 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
- changePixel(pixel,"white_blood_cell");
- }
if (!isEmpty(pixel.x, pixel.y-1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y-1]
if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) {
@@ -3340,9 +3402,6 @@ elements.blood_vessel = {
if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) {
hitPixel.heartAttached = true
}
- if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) {
- hitPixel.kidneyAttached = true
- }
}
}
else if (isEmpty(pixel.x, pixel.y-1) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
@@ -3382,9 +3441,6 @@ elements.blood_vessel = {
if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) {
hitPixel.heartAttached = true
}
- if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) {
- hitPixel.kidneyAttached = true
- }
}
}
else if (isEmpty(pixel.x, pixel.y+1) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
@@ -3424,9 +3480,6 @@ elements.blood_vessel = {
if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) {
hitPixel.heartAttached = true
}
- if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) {
- hitPixel.kidneyAttached = true
- }
}
}
else if (isEmpty(pixel.x-1, pixel.y) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
@@ -3466,9 +3519,6 @@ elements.blood_vessel = {
if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) {
hitPixel.heartAttached = true
}
- if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) {
- hitPixel.kidneyAttached = true
- }
}
}
else if (isEmpty(pixel.x+1, pixel.y) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
@@ -3483,7 +3533,6 @@ elements.blood_vessel = {
oxygen: 1000,
nutrition: 1000,
heartAttached: false,
- kidneyAttached: false,
},
tempHigh: 175,
stateHigh: "meat",
@@ -3574,9 +3623,6 @@ elements.infected_vessel = {
if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) {
hitPixel.heartAttached = true
}
- if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) {
- hitPixel.kidneyAttached = true
- }
}
}
else if (isEmpty(pixel.x, pixel.y-1) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
@@ -3621,9 +3667,6 @@ elements.infected_vessel = {
if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) {
hitPixel.heartAttached = true
}
- if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) {
- hitPixel.kidneyAttached = true
- }
}
}
else if (isEmpty(pixel.x, pixel.y+1) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
@@ -3668,9 +3711,6 @@ elements.infected_vessel = {
if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) {
hitPixel.heartAttached = true
}
- if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) {
- hitPixel.kidneyAttached = true
- }
}
}
else if (isEmpty(pixel.x-1, pixel.y) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
@@ -3715,9 +3755,6 @@ elements.infected_vessel = {
if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) {
hitPixel.heartAttached = true
}
- if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) {
- hitPixel.kidneyAttached = true
- }
}
}
else if (isEmpty(pixel.x+1, pixel.y) && Math.random() > 0.75 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
@@ -3732,8 +3769,10 @@ elements.infected_vessel = {
oxygen: 1000,
nutrition: 1000,
heartAttached: false,
- kidneyAttached: false,
},
+ reactions: {
+ "bless": { elem1:"blood_vessel" },
+ },
tempHigh: 175,
stateHigh: "meat",
tempLow: -50,
@@ -3778,7 +3817,7 @@ elements.white_blood_cell = {
if (pixel.speed === null || isNaN(pixel.speed)) {
pixel.speed = 0
}
- if (Math.random() > 0.9995 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
+ if (Math.random() > 0.995 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050)) || Math.random() > 0.9995) {
changePixel(pixel,"blood_vessel");
}
if (!isEmpty(pixel.x, pixel.y-1, true)) {
@@ -3796,7 +3835,7 @@ elements.white_blood_cell = {
hitPixel.speed += 1
pixel.speed -= 1
}
- if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) {
+ if (elements[hitPixel.element].isBlood === true && Math.random() > 0.25) {
if (elements[hitPixel.element].id === elements.infected_vessel.id) {
changePixel(hitPixel,"blood_vessel")
}
@@ -3804,9 +3843,6 @@ elements.white_blood_cell = {
if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) {
hitPixel.heartAttached = true
}
- if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) {
- hitPixel.kidneyAttached = true
- }
}
}
if (!isEmpty(pixel.x, pixel.y+1, true)) {
@@ -3824,7 +3860,7 @@ elements.white_blood_cell = {
hitPixel.speed += 1
pixel.speed -= 1
}
- if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) {
+ if (elements[hitPixel.element].isBlood === true && Math.random() > 0.25) {
if (elements[hitPixel.element].id === elements.infected_vessel.id) {
changePixel(hitPixel,"blood_vessel")
}
@@ -3832,9 +3868,6 @@ elements.white_blood_cell = {
if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) {
hitPixel.heartAttached = true
}
- if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) {
- hitPixel.kidneyAttached = true
- }
}
}
if (!isEmpty(pixel.x-1, pixel.y, true)) {
@@ -3852,7 +3885,7 @@ elements.white_blood_cell = {
hitPixel.speed += 1
pixel.speed -= 1
}
- if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) {
+ if (elements[hitPixel.element].isBlood === true && Math.random() > 0.25) {
if (elements[hitPixel.element].id === elements.infected_vessel.id) {
changePixel(hitPixel,"blood_vessel")
}
@@ -3860,9 +3893,6 @@ elements.white_blood_cell = {
if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) {
hitPixel.heartAttached = true
}
- if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) {
- hitPixel.kidneyAttached = true
- }
}
}
if (!isEmpty(pixel.x+1, pixel.y, true)) {
@@ -3880,7 +3910,7 @@ elements.white_blood_cell = {
hitPixel.speed += 1
pixel.speed -= 1
}
- if (elements[hitPixel.element].isBlood === true && Math.random() > 0.5) {
+ if (elements[hitPixel.element].isBlood === true && Math.random() > 0.25) {
if (elements[hitPixel.element].id === elements.infected_vessel.id) {
changePixel(hitPixel,"blood_vessel")
}
@@ -3888,9 +3918,6 @@ elements.white_blood_cell = {
if (elements[hitPixel.element].isBlood === true && pixel.heartAttached === true && hitPixel.heartAttached === false && Math.random() > 0.5) {
hitPixel.heartAttached = true
}
- if (elements[hitPixel.element].isBlood === true && pixel.kidneyAttached === true && hitPixel.kidneyAttached === false && Math.random() > 0.5) {
- hitPixel.kidneyAttached = true
- }
}
}
},
@@ -3898,7 +3925,6 @@ elements.white_blood_cell = {
oxygen: 1000,
nutrition: 1000,
heartAttached: false,
- kidneyAttached: false,
},
reactions: {
"cancer": { elem2:"flesh", chance:0.10 },
@@ -3964,7 +3990,7 @@ elements.eye = {
pixel.saw = false
hitPixel.saw = true
}
- else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
+ else if (pixel.saw === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
if (!hitPixel.charge) {
hitPixel.charge = 0.1
}
@@ -3998,7 +4024,7 @@ elements.eye = {
pixel.saw = false
hitPixel.saw = true
}
- else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
+ else if (pixel.saw === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
if (!hitPixel.charge) {
hitPixel.charge = 0.1
}
@@ -4032,7 +4058,7 @@ elements.eye = {
pixel.saw = false
hitPixel.saw = true
}
- else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
+ else if (pixel.saw === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
if (!hitPixel.charge) {
hitPixel.charge = 0.1
}
@@ -4066,7 +4092,7 @@ elements.eye = {
pixel.saw = false
hitPixel.saw = true
}
- else if (pixel.saw === true && elements[hitPixel.element].id === elements.eye_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
+ else if (pixel.saw === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
if (!hitPixel.charge) {
hitPixel.charge = 0.1
}
@@ -4164,7 +4190,7 @@ elements.olfactory_bulb = {
pixel.smell = false
hitpixel.smell = true
}
- else if (pixel.smell === true && elements[hitPixel.element].id === elements.bulb_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
+ else if (pixel.smell === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
if (!hitPixel.charge) {
hitPixel.charge = 0.1
}
@@ -4201,7 +4227,7 @@ elements.olfactory_bulb = {
pixel.smell = false
hitpixel.smell = true
}
- else if (pixel.smell === true && elements[hitPixel.element].id === elements.bulb_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
+ else if (pixel.smell === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
if (!hitPixel.charge) {
hitPixel.charge = 0.1
}
@@ -4238,7 +4264,7 @@ elements.olfactory_bulb = {
pixel.smell = false
hitpixel.smell = true
}
- else if (pixel.smell === true && elements[hitPixel.element].id === elements.bulb_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
+ else if (pixel.smell === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
if (!hitPixel.charge) {
hitPixel.charge = 0.1
}
@@ -4275,7 +4301,7 @@ elements.olfactory_bulb = {
pixel.smell = false
hitpixel.smell = true
}
- else if (pixel.smell === true && elements[hitPixel.element].id === elements.bulb_nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
+ else if (pixel.smell === true && elements[hitPixel.element].id === elements.nerve.id && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
if (!hitPixel.charge) {
hitPixel.charge = 0.1
}
@@ -4639,7 +4665,7 @@ elements.amygdala = { // please please please ignore that i callled it the amygd
movable: false,
}
-elements.eye_nerve = {
+elements.nerve = {
color: "#B33E93",
category: "nervous system",
behavior: behaviors.WALL,
@@ -4781,16 +4807,19 @@ elements.eye_nerve = {
movable: false,
}
-elements.bulb_nerve = {
- color: "#B33E93",
- category: "nervous system",
- behavior: behaviors.WALL,
+elements.throat_lining = {
+ color: "#bc6157",
+ category: "nutrition",
+ behavior: [
+ "XX|DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5|XX",
+ "DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5|XX|DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5",
+ "XX|DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5|XX",
+ ],
hoverStat: function(pixel) {
return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen
},
tick: function(pixel) {
- doDefaults(pixel);
- if ((Math.random() > 0.895 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) {
+ if ((Math.random() > 0.9 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) {
pixel.nutrition--
pixel.oxygen -= 2
}
@@ -4900,7 +4929,7 @@ elements.bulb_nerve = {
},
density: 2710,
state: "solid",
- conduct: 1,
+ conduct: .001,
tempHigh: 200,
stateHigh: "cooked_meat",
tempLow: -25,
@@ -4912,7 +4941,7 @@ elements.bulb_nerve = {
forceSaveColor: true,
reactions: {
"cancer": { elem1:"cancer", chance:0.0005 },
- "radiation": { elem1:["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 },
+ "radiation": { elem1:["ash","slime","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 },
},
properties: {
oxygen: 1000,
@@ -4923,17 +4952,15 @@ elements.bulb_nerve = {
movable: false,
}
-
-elements.nerve = {
- color: "#B33E93",
- category: "nervous system",
+elements.intestines = {
+ color: "#bc6157",
+ category: "nutrition",
behavior: behaviors.WALL,
- hoverStat: function(pixel) {
+ hoverStat: function(pixel) {
return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen
},
tick: function(pixel) {
- doDefaults(pixel);
- if ((Math.random() > 0.895 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) {
+ if ((Math.random() > 0.9 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) {
pixel.nutrition--
pixel.oxygen -= 2
}
@@ -4972,9 +4999,28 @@ elements.nerve = {
if (pixel.speed === null || isNaN(pixel.speed)) {
pixel.speed = 0
}
- if (!isEmpty(pixel.x, pixel.y-1, true)) {
+ if (!isEmpty(pixel.x, pixel.y-1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y-1]
- if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) {
+ if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.99) {
+ if (Math.random() > 0.5) {
+ changePixel(hitPixel,"poop");
+ }
+ else {
+ changePixel(hitPixel,"stench");
+ }
+ pixel.nutrition += hitPixel.nutrition;
+ hitPixel.nutrition = 0;
+ pixel.speed += hitPixel.speed;
+ hitPixel.speed = 0;
+ }
+ else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) {
+ changePixel(hitPixel,"stench");
+ pixel.nutrition += hitPixel.nutrition;
+ hitPixel.nutrition = 0;
+ pixel.speed += hitPixel.speed;
+ hitPixel.speed = 0;
+ }
+ else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) {
if (hitPixel.oxygen < pixel.oxygen) {
hitPixel.oxygen += 10
pixel.oxygen -= 10
@@ -4991,7 +5037,26 @@ elements.nerve = {
}
if (!isEmpty(pixel.x, pixel.y+1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y+1]
- if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) {
+ if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.99) {
+ if (Math.random() > 0.5) {
+ changePixel(hitPixel,"poop");
+ }
+ else {
+ changePixel(hitPixel,"stench");
+ }
+ pixel.nutrition += hitPixel.nutrition;
+ hitPixel.nutrition = 0;
+ pixel.speed += hitPixel.speed;
+ hitPixel.speed = 0;
+ }
+ else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) {
+ changePixel(hitPixel,"stench");
+ pixel.nutrition += hitPixel.nutrition;
+ hitPixel.nutrition = 0;
+ pixel.speed += hitPixel.speed;
+ hitPixel.speed = 0;
+ }
+ else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) {
if (hitPixel.oxygen < pixel.oxygen) {
hitPixel.oxygen += 10
pixel.oxygen -= 10
@@ -5008,7 +5073,24 @@ elements.nerve = {
}
if (!isEmpty(pixel.x-1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x-1][pixel.y]
- if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) {
+ if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.99) {
+ if (Math.random() > 0.5) {
+ changePixel(hitPixel,"poop");
+ }
+ else {
+ changePixel(hitPixel,"stench");
+ }
+ pixel.nutrition += hitPixel.nutrition;
+ hitPixel.nutrition = 0;
+ pixel.speed += hitPixel.speed;
+ hitPixel.speed = 0;
+ }
+ else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) {
+ changePixel(hitPixel,"stench");
+ pixel.nutrition += hitPixel.nutrition;
+ hitPixel.nutrition = 0;
+ }
+ else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) {
if (hitPixel.oxygen < pixel.oxygen) {
hitPixel.oxygen += 10
pixel.oxygen -= 10
@@ -5025,7 +5107,26 @@ elements.nerve = {
}
if (!isEmpty(pixel.x+1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x+1][pixel.y]
- if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) {
+ if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.99) {
+ if (Math.random() > 0.5) {
+ changePixel(hitPixel,"poop");
+ }
+ else {
+ changePixel(hitPixel,"stench");
+ }
+ pixel.nutrition += hitPixel.nutrition;
+ hitPixel.nutrition = 0;
+ pixel.speed += hitPixel.speed;
+ hitPixel.speed = 0;
+ }
+ else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) {
+ changePixel(hitPixel,"stench");
+ pixel.nutrition += hitPixel.nutrition;
+ hitPixel.nutrition = 0;
+ pixel.speed += hitPixel.speed;
+ hitPixel.speed = 0;
+ }
+ else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) {
if (hitPixel.oxygen < pixel.oxygen) {
hitPixel.oxygen += 10
pixel.oxygen -= 10
@@ -5043,7 +5144,7 @@ elements.nerve = {
},
density: 2710,
state: "solid",
- conduct: 1,
+ conduct: .001,
tempHigh: 200,
stateHigh: "cooked_meat",
tempLow: -25,
@@ -5055,57 +5156,65 @@ elements.nerve = {
forceSaveColor: true,
reactions: {
"cancer": { elem1:"cancer", chance:0.0005 },
- "radiation": { elem1:["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 },
+ "radiation": { elem1:["ash","steam","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 },
},
properties: {
oxygen: 1000,
nutrition: 1000,
speed: 0,
},
- isBio: true,
movable: false,
+ isBio: true
}
-elements.throat_lining = {
- color: "#bc6157",
+elements.appendix = {
+ color: "#B45942",
category: "nutrition",
- behavior: [
- "XX|DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5|XX",
- "DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5|XX|DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5",
- "XX|DL:stomach_acid,explosive_acid,decomposer_acid,carni_acid,herbi_acid%5|XX",
- ],
- hoverStat: function(pixel) {
+ behavior: behaviors.WALL,
+ hoverStat: function(pixel) {
return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen
},
tick: function(pixel) {
if ((Math.random() > 0.9 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) {
pixel.nutrition--
pixel.oxygen -= 2
+ if (Math.random() > 0.999 && (pixel.nutrition < 750 || pixel.oxygen < 500)) {
+ changePixel(pixel,"stomach_acid");
+ }
}
if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) {
if (pixel.temp > 95) {
if (Math.random() < 0.75) {
changePixel(pixel,"meat");
}
- else {
+ else if (Math.random() < 0.75) {
changePixel(pixel,"cooked_meat");
}
+ else {
+ changePixel(pixel,"stomach_acid");
+ }
}
else if (pixel.temp < -15) {
if (Math.random() < 0.75) {
changePixel(pixel,"meat");
}
- else {
+ else if (Math.random() < 0.75) {
changePixel(pixel,"frozen_meat");
}
+ else {
+ changePixel(pixel,"stomach_acid");
+ }
}
else {
if (Math.random() < 0.999) {
changePixel(pixel,"meat");
}
- else {
+ else if (Math.random() < 0.75) {
changePixel(pixel,"rotten_meat");
}
+ else {
+ changePixel(pixel,"stomach_acid");
+ }
}
}
if (pixel.nutrition === null || isNaN(pixel.nutrition)) {
@@ -5114,12 +5223,19 @@ elements.throat_lining = {
if (pixel.oxygen === null || isNaN(pixel.oxygen)) {
pixel.oxygen = 500
}
- if (pixel.l || isNaN(pixel.speed)) {
+ if (pixel.speed === null || isNaN(pixel.speed)) {
pixel.speed = 0
}
- if (!isEmpty(pixel.x, pixel.y-1, true)) {
+ if (!isEmpty(pixel.x, pixel.y-1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y-1]
- if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) {
+ if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.999) {
+ changePixel(hitPixel,"poop");
+ pixel.nutrition += hitPixel.nutrition
+ if (Math.random() > 0.99) {
+ changePixel(pixel,"stomach_acid");
+ }
+ }
+ else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) {
if (hitPixel.oxygen < pixel.oxygen) {
hitPixel.oxygen += 10
pixel.oxygen -= 10
@@ -5136,7 +5252,14 @@ elements.throat_lining = {
}
if (!isEmpty(pixel.x, pixel.y+1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y+1]
- if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) {
+ if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.999) {
+ changePixel(hitPixel,"poop");
+ pixel.nutrition += hitPixel.nutrition
+ if (Math.random() > 0.99) {
+ changePixel(pixel,"stomach_acid");
+ }
+ }
+ else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) {
if (hitPixel.oxygen < pixel.oxygen) {
hitPixel.oxygen += 10
pixel.oxygen -= 10
@@ -5153,7 +5276,14 @@ elements.throat_lining = {
}
if (!isEmpty(pixel.x-1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x-1][pixel.y]
- if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) {
+ if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.999) {
+ changePixel(hitPixel,"poop");
+ pixel.nutrition += hitPixel.nutrition
+ if (Math.random() > 0.99) {
+ changePixel(pixel,"stomach_acid");
+ }
+ }
+ else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) {
if (hitPixel.oxygen < pixel.oxygen) {
hitPixel.oxygen += 10
pixel.oxygen -= 10
@@ -5170,7 +5300,14 @@ elements.throat_lining = {
}
if (!isEmpty(pixel.x+1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x+1][pixel.y]
- if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) {
+ if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.999) {
+ changePixel(hitPixel,"poop");
+ pixel.nutrition += hitPixel.nutrition
+ if (Math.random() > 0.90) {
+ changePixel(pixel,"stomach_acid");
+ }
+ }
+ else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) {
if (hitPixel.oxygen < pixel.oxygen) {
hitPixel.oxygen += 10
pixel.oxygen -= 10
@@ -5196,432 +5333,36 @@ elements.throat_lining = {
burn: 5,
burnTime: 350,
burnInto: "cooked_meat",
- breakInto: ["blood","meat"],
+ breakInto: ["stomach_acid","blood","meat"],
forceSaveColor: true,
reactions: {
"cancer": { elem1:"cancer", chance:0.0005 },
- "radiation": { elem1:["ash","slime","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 },
+ "radiation": { elem1:["ash","steam","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 },
},
properties: {
oxygen: 1000,
nutrition: 1000,
speed: 0,
},
- isBio: true,
movable: false,
+ isBio: true
}
-elements.intestines = {
- color: "#bc6157",
- category: "nutrition",
+elements.simple_lung = {
+ color: "#EB85D9",
+ category: "oxygen",
behavior: behaviors.WALL,
hoverStat: function(pixel) {
return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen
},
tick: function(pixel) {
- 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].id === elements.digested_material.id && Math.random() > 0.99) {
- if (Math.random() > 0.5) {
- changePixel(hitPixel,"poop");
- }
- else {
- changePixel(hitPixel,"stench");
- }
- pixel.nutrition += hitPixel.nutrition;
- hitPixel.nutrition = 0;
- pixel.speed += hitPixel.speed;
- hitPixel.speed = 0;
- }
- else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) {
- changePixel(hitPixel,"stench");
- pixel.nutrition += hitPixel.nutrition;
- hitPixel.nutrition = 0;
- pixel.speed += hitPixel.speed;
- hitPixel.speed = 0;
- }
- else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) {
- if (hitPixel.oxygen < pixel.oxygen) {
- hitPixel.oxygen += 10
- pixel.oxygen -= 10
- }
- if (hitPixel.nutrition < pixel.nutrition) {
- hitPixel.nutrition += 10
- pixel.nutrition -= 10
- }
- if (hitPixel.speed < pixel.speed) {
- hitPixel.speed += 1
- pixel.speed -= 1
- }
- }
- }
- if (!isEmpty(pixel.x, pixel.y+1, true)) {
- var hitPixel = pixelMap[pixel.x][pixel.y+1]
- if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.99) {
- if (Math.random() > 0.5) {
- changePixel(hitPixel,"poop");
- }
- else {
- changePixel(hitPixel,"stench");
- }
- pixel.nutrition += hitPixel.nutrition;
- hitPixel.nutrition = 0;
- pixel.speed += hitPixel.speed;
- hitPixel.speed = 0;
- }
- else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) {
- changePixel(hitPixel,"stench");
- pixel.nutrition += hitPixel.nutrition;
- hitPixel.nutrition = 0;
- pixel.speed += hitPixel.speed;
- hitPixel.speed = 0;
- }
- else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) {
- if (hitPixel.oxygen < pixel.oxygen) {
- hitPixel.oxygen += 10
- pixel.oxygen -= 10
- }
- if (hitPixel.nutrition < pixel.nutrition) {
- hitPixel.nutrition += 10
- pixel.nutrition -= 10
- }
- if (hitPixel.speed < pixel.speed) {
- hitPixel.speed += 1
- pixel.speed -= 1
- }
- }
- }
- if (!isEmpty(pixel.x-1, pixel.y, true)) {
- var hitPixel = pixelMap[pixel.x-1][pixel.y]
- if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.99) {
- if (Math.random() > 0.5) {
- changePixel(hitPixel,"poop");
- }
- else {
- changePixel(hitPixel,"stench");
- }
- pixel.nutrition += hitPixel.nutrition;
- hitPixel.nutrition = 0;
- pixel.speed += hitPixel.speed;
- hitPixel.speed = 0;
- }
- else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) {
- changePixel(hitPixel,"stench");
- pixel.nutrition += hitPixel.nutrition;
- hitPixel.nutrition = 0;
- }
- else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) {
- if (hitPixel.oxygen < pixel.oxygen) {
- hitPixel.oxygen += 10
- pixel.oxygen -= 10
- }
- if (hitPixel.nutrition < pixel.nutrition) {
- hitPixel.nutrition += 10
- pixel.nutrition -= 10
- }
- if (hitPixel.speed < pixel.speed) {
- hitPixel.speed += 1
- pixel.speed -= 1
- }
- }
- }
- if (!isEmpty(pixel.x+1, pixel.y, true)) {
- var hitPixel = pixelMap[pixel.x+1][pixel.y]
- if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.99) {
- if (Math.random() > 0.5) {
- changePixel(hitPixel,"poop");
- }
- else {
- changePixel(hitPixel,"stench");
- }
- pixel.nutrition += hitPixel.nutrition;
- hitPixel.nutrition = 0;
- pixel.speed += hitPixel.speed;
- hitPixel.speed = 0;
- }
- else if (elements[hitPixel.element].id === elements.gaseous_material.id && Math.random() > 0.99) {
- changePixel(hitPixel,"stench");
- pixel.nutrition += hitPixel.nutrition;
- hitPixel.nutrition = 0;
- pixel.speed += hitPixel.speed;
- hitPixel.speed = 0;
- }
- else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) {
- if (hitPixel.oxygen < pixel.oxygen) {
- hitPixel.oxygen += 10
- pixel.oxygen -= 10
- }
- if (hitPixel.nutrition < pixel.nutrition) {
- hitPixel.nutrition += 10
- pixel.nutrition -= 10
- }
- if (hitPixel.speed < pixel.speed) {
- hitPixel.speed += 1
- pixel.speed -= 1
- }
- }
- }
- },
- density: 2710,
- state: "solid",
- conduct: .001,
- tempHigh: 200,
- stateHigh: "cooked_meat",
- tempLow: -25,
- stateLow: "frozen_meat",
- burn: 5,
- burnTime: 350,
- burnInto: "cooked_meat",
- breakInto: ["blood","meat"],
- forceSaveColor: true,
- reactions: {
- "cancer": { elem1:"cancer", chance:0.0005 },
- "radiation": { elem1:["ash","steam","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 },
- },
- properties: {
- oxygen: 1000,
- nutrition: 1000,
- speed: 0,
- },
- movable: false,
- isBio: true
-}
-
-elements.appendix = {
- color: "#B45942",
- category: "nutrition",
- behavior: behaviors.WALL,
- hoverStat: function(pixel) {
- return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen
- },
- tick: function(pixel) {
- if ((Math.random() > 0.9 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) {
- pixel.nutrition--
- pixel.oxygen -= 2
- if (Math.random() > 0.999 && (pixel.nutrition < 750 || pixel.oxygen < 500)) {
- changePixel(pixel,"stomach_acid");
- }
- }
- if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) {
- if (pixel.temp > 95) {
- if (Math.random() < 0.75) {
- changePixel(pixel,"meat");
- }
- else if (Math.random() < 0.75) {
- changePixel(pixel,"cooked_meat");
- }
- else {
- changePixel(pixel,"stomach_acid");
- }
- }
- else if (pixel.temp < -15) {
- if (Math.random() < 0.75) {
- changePixel(pixel,"meat");
- }
- else if (Math.random() < 0.75) {
- changePixel(pixel,"frozen_meat");
- }
- else {
- changePixel(pixel,"stomach_acid");
- }
- }
- else {
- if (Math.random() < 0.999) {
- changePixel(pixel,"meat");
- }
- else if (Math.random() < 0.75) {
- changePixel(pixel,"rotten_meat");
- }
- else {
- changePixel(pixel,"stomach_acid");
- }
- }
- }
- if (pixel.nutrition === null || isNaN(pixel.nutrition)) {
- pixel.nutrition = 500
- }
- if (pixel.oxygen === null || isNaN(pixel.oxygen)) {
- pixel.oxygen = 500
- }
- if (pixel.speed === null || isNaN(pixel.speed)) {
- pixel.speed = 0
- }
- if (!isEmpty(pixel.x, pixel.y-1, true)) {
- var hitPixel = pixelMap[pixel.x][pixel.y-1]
- if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.999) {
- changePixel(hitPixel,"poop");
- pixel.nutrition += hitPixel.nutrition
- if (Math.random() > 0.99) {
- changePixel(pixel,"stomach_acid");
- }
- }
- else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) {
- if (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].id === elements.digested_material.id && Math.random() > 0.999) {
- changePixel(hitPixel,"poop");
- pixel.nutrition += hitPixel.nutrition
- if (Math.random() > 0.99) {
- changePixel(pixel,"stomach_acid");
- }
- }
- else if (elements[hitPixel.element].isBio === true && Math.random() > 0.25) {
- if (hitPixel.oxygen < pixel.oxygen) {
- hitPixel.oxygen += 10
- pixel.oxygen -= 10
- }
- if (hitPixel.nutrition < pixel.nutrition) {
- hitPixel.nutrition += 10
- pixel.nutrition -= 10
- }
- if (hitPixel.speed < pixel.speed) {
- hitPixel.speed += 1
- pixel.speed -= 1
- }
- }
- }
- 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 (hitPixel.oxygen < pixel.oxygen) {
- hitPixel.oxygen += 10
- pixel.oxygen -= 10
- }
- if (hitPixel.nutrition < pixel.nutrition) {
- hitPixel.nutrition += 10
- pixel.nutrition -= 10
- }
- if (hitPixel.speed < pixel.speed) {
- hitPixel.speed += 1
- pixel.speed -= 1
- }
- }
- }
- if (!isEmpty(pixel.x+1, pixel.y, true)) {
- var hitPixel = pixelMap[pixel.x+1][pixel.y]
- if (elements[hitPixel.element].id === elements.digested_material.id && Math.random() > 0.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
- }
- 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: ["stomach_acid","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.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
- } }
+ 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
@@ -5969,7 +5710,6 @@ elements.lungs = {
}
elements.amphib_skin = {
- name: "amphibian_skin",
color: "#7E9C33",
category: "oxygen",
behavior: [
@@ -6310,27 +6050,225 @@ elements.exoskeleton = {
hitPixel.nutrition += 10
pixel.nutrition -= 10
}
- if (hitPixel.speed < pixel.speed) {
- hitPixel.speed += 1
- pixel.speed -= 1
+ if (hitPixel.speed < pixel.speed) {
+ hitPixel.speed += 1
+ pixel.speed -= 1
+ }
+ }
+ else if ((elements[hitPixel.element].id === elements.chlorine.id || elements[hitPixel.element].id === elements.poison_gas.id || elements[hitPixel.element].id === elements.acid_gas.id || elements[hitPixel.element].id === elements.cyanide_gas.id || elements[hitPixel.element].id === elements.dioxin.id) && Math.random() > 0.5) {
+ pixel.smell = true
+ deletePixel(hitPixel.x,hitPixel.y)
+ pixel.oxygen -= 50
+ pixel.nutrition -= 50
+ }
+ }
+ if (!isEmpty(pixel.x+1, pixel.y, true)) {
+ var hitPixel = pixelMap[pixel.x+1][pixel.y]
+ if (elements[hitPixel.element].id === elements.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
+ }
+ if (hitPixel.nutrition < pixel.nutrition) {
+ hitPixel.nutrition += 10
+ pixel.nutrition -= 10
+ }
+ if (hitPixel.speed < pixel.speed) {
+ hitPixel.speed += 1
+ pixel.speed -= 1
+ }
+ }
+ else if ((elements[hitPixel.element].id === elements.chlorine.id || elements[hitPixel.element].id === elements.poison_gas.id || elements[hitPixel.element].id === elements.acid_gas.id || elements[hitPixel.element].id === elements.cyanide_gas.id || elements[hitPixel.element].id === elements.dioxin.id) && Math.random() > 0.5) {
+ pixel.smell = true
+ deletePixel(hitPixel.x,hitPixel.y)
+ pixel.oxygen -= 50
+ pixel.nutrition -= 50
+ }
+ }
+ },
+ density: 2710,
+ state: "solid",
+ conduct: .001,
+ tempHigh: 220,
+ stateHigh: ["cooked_meat","calcium","calcium"],
+ tempLow: -25,
+ stateLow: "frozen_meat",
+ breakInto: ["blood","meat","calcium"],
+ forceSaveColor: true,
+ reactions: {
+ "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,
+ burn:5,
+ burnTime: 100,
+ burnInto: ["cooked_meat","calcium","calcium","cooked_meat","calcium","calcium","quicklime"],
+}
+
+elements.gills = {
+ color: "#5EBAE3",
+ category: "oxygen",
+ 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.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 (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
+ }
+ }
+ 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.chlorine.id || elements[hitPixel.element].id === elements.poison_gas.id || elements[hitPixel.element].id === elements.acid_gas.id || elements[hitPixel.element].id === elements.cyanide_gas.id || elements[hitPixel.element].id === elements.dioxin.id) && Math.random() > 0.5) {
- pixel.smell = true
- deletePixel(hitPixel.x,hitPixel.y)
- pixel.oxygen -= 50
- pixel.nutrition -= 50
+ else if (elements[hitPixel.element].id === elements.salt_water.id && Math.random() > 0.75) {
+ if (isEmpty(pixel.x+1, pixel.y)) {
+ pixel.oxygen += 90
+ if (Math.random() > 0.85) {
+ changePixel(hitPixel,"deoxygenated_water")
+ }
+ tryMove(hitPixel,pixel.x+1,pixel.y);
+ }
}
}
if (!isEmpty(pixel.x+1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x+1][pixel.y]
- if (elements[hitPixel.element].id === elements.oxygen.id && Math.random() > 0.95) {
- if (Math.random() > 0.75) {
- changePixel(hitPixel,"carbon_dioxide");
- }
- pixel.oxygen += 100
- }
- else if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) {
+ if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) {
if (hitPixel.oxygen < pixel.oxygen) {
hitPixel.oxygen += 10
pixel.oxygen -= 10
@@ -6344,41 +6282,35 @@ elements.exoskeleton = {
pixel.speed -= 1
}
}
- else if ((elements[hitPixel.element].id === elements.chlorine.id || elements[hitPixel.element].id === elements.poison_gas.id || elements[hitPixel.element].id === elements.acid_gas.id || elements[hitPixel.element].id === elements.cyanide_gas.id || elements[hitPixel.element].id === elements.dioxin.id) && Math.random() > 0.5) {
- pixel.smell = true
- deletePixel(hitPixel.x,hitPixel.y)
- pixel.oxygen -= 50
- pixel.nutrition -= 50
- }
}
},
density: 2710,
state: "solid",
conduct: .001,
- tempHigh: 220,
- stateHigh: ["cooked_meat","calcium","calcium"],
+ tempHigh: 200,
+ stateHigh: "cooked_meat",
tempLow: -25,
stateLow: "frozen_meat",
- breakInto: ["blood","meat","calcium"],
+ burn: 5,
+ burnTime: 350,
+ burnInto: "cooked_meat",
+ breakInto: ["blood","meat"],
forceSaveColor: true,
reactions: {
- "cancer": { elem1:"cancer", chance:0.000075 },
- "radiation": { elem1:["calcium","calcium","ash","meat","rotten_meat","cooked_meat","skin","epidermis"], chance:0.1 },
+ "cancer": { elem1:"cancer", chance:0.0005 },
+ "radiation": { elem1:["ash","steam","oxygen","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 },
},
properties: {
oxygen: 1000,
nutrition: 1000,
speed: 0,
},
- isBio: true,
movable: false,
- burn:5,
- burnTime: 100,
- burnInto: ["cooked_meat","calcium","calcium","cooked_meat","calcium","calcium","quicklime"],
+ isBio: true
}
-elements.gills = {
- color: "#5EBAE3",
+elements.simple_gill = {
+ color: "#75C0E2",
category: "oxygen",
hoverStat: function(pixel) {
return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen
@@ -6386,7 +6318,7 @@ elements.gills = {
tick: function(pixel) {
if ((Math.random() > 0.9 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) {
pixel.nutrition--
- pixel.oxygen -= 2
+ pixel.oxygen --
}
if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) {
if (pixel.temp > 95) {
@@ -6447,10 +6379,7 @@ elements.gills = {
}
}
else if (elements[hitPixel.element].id === elements.water.id && Math.random() > 0.75) {
- pixel.oxygen += 100
- if (Math.random() > 0.75) {
- changePixel(hitPixel,"deoxygenated_water")
- }
+ pixel.oxygen += 50
if (!tryMove(hitPixel,pixel.x,pixel.y+1)) {
if (elements[pixelMap[pixel.x][pixel.y+1].element].state === "liquid") {
swapPixels(hitPixel,pixelMap[pixel.x][pixel.y+1])
@@ -6458,10 +6387,7 @@ elements.gills = {
}
}
else if (elements[hitPixel.element].id === elements.salt_water.id && Math.random() > 0.75) {
- pixel.oxygen += 90
- if (Math.random() > 0.85) {
- changePixel(hitPixel,"deoxygenated_water")
- }
+ pixel.oxygen += 50
if (!tryMove(hitPixel,pixel.x,pixel.y+1)) {
if (elements[pixelMap[pixel.x][pixel.y+1].element].state === "liquid") {
swapPixels(hitPixel,pixelMap[pixel.x][pixel.y+1])
@@ -6509,19 +6435,13 @@ elements.gills = {
}
else if (elements[hitPixel.element].id === elements.water.id && Math.random() > 0.75) {
if (isEmpty(pixel.x+1, pixel.y)) {
- pixel.oxygen += 100
- if (Math.random() > 0.75) {
- changePixel(hitPixel,"deoxygenated_water")
- }
+ pixel.oxygen += 50
tryMove(hitPixel,pixel.x+1,pixel.y);
}
}
else if (elements[hitPixel.element].id === elements.salt_water.id && Math.random() > 0.75) {
if (isEmpty(pixel.x+1, pixel.y)) {
- pixel.oxygen += 90
- if (Math.random() > 0.85) {
- changePixel(hitPixel,"deoxygenated_water")
- }
+ pixel.oxygen += 50
tryMove(hitPixel,pixel.x+1,pixel.y);
}
}
@@ -7123,6 +7043,7 @@ elements.carni_stomach = {
}
}
}
+ doDefaults(pixel);
},
density: 2710,
state: "solid",
@@ -7268,6 +7189,7 @@ elements.explosive_stomach = {
}
}
}
+ doDefaults(pixel);
},
density: 2710,
state: "solid",
@@ -7418,6 +7340,7 @@ elements.stomach_valve = {
}
}
}
+ doDefaults(pixel);
},
density: 2710,
state: "solid",
@@ -7566,6 +7489,7 @@ elements.sphincter = {
}
}
}
+ doDefaults(pixel);
},
density: 2710,
state: "solid",
@@ -7603,7 +7527,7 @@ elements.real_udder = {
return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen
},
tick: function(pixel) {
- if (Math.random() > 0.975 && pixel.nutrition > 0 && pixel.oxygen > 0 || pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) {
+ if ((Math.random() > 0.975 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) {
pixel.nutrition--
pixel.oxygen--
}
@@ -7726,6 +7650,7 @@ elements.real_udder = {
createPixel("milk",pixel.x+1,pixel.y)
}
}
+ doDefaults(pixel);
},
properties: {
oxygen: 1000,
@@ -7759,7 +7684,7 @@ elements.biotorch = {
return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen
},
tick: function(pixel) {
- if (Math.random() > 0.975 && pixel.nutrition > 0 && pixel.oxygen > 0 || pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) {
+ if ((Math.random() > 0.975 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 550 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -5 && pixel.nutrition > 0 && pixel.oxygen > 0)) {
pixel.nutrition--
pixel.oxygen -= 2
}
@@ -7829,6 +7754,16 @@ elements.biotorch = {
pixel.nutrition -= 20
}
}
+ if (elements[hitPixel.element].isBio != true && Math.random() > 0.5) {
+ if (hitPixel.temp < pixel.temp) {
+ hitPixel.temp++
+ pixel.temp--
+ }
+ if (hitPixel.temp > pixel.temp) {
+ hitPixel.temp--
+ pixel.temp++
+ }
+ }
}
else if (isEmpty(pixel.x, pixel.y+1) && Math.random() > 0.95 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
if (Math.random() > 0.95) {
@@ -7850,6 +7785,16 @@ elements.biotorch = {
pixel.nutrition -= 20
}
}
+ if (elements[hitPixel.element].isBio != true && Math.random() > 0.5) {
+ if (hitPixel.temp < pixel.temp) {
+ hitPixel.temp++
+ pixel.temp--
+ }
+ if (hitPixel.temp > pixel.temp) {
+ hitPixel.temp--
+ pixel.temp++
+ }
+ }
}
else if (isEmpty(pixel.x-1, pixel.y) && Math.random() > 0.95 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
if (Math.random() > 0.95) {
@@ -7871,6 +7816,16 @@ elements.biotorch = {
pixel.nutrition -= 20
}
}
+ if (elements[hitPixel.element].isBio != true && Math.random() > 0.5) {
+ if (hitPixel.temp < pixel.temp) {
+ hitPixel.temp++
+ pixel.temp--
+ }
+ if (hitPixel.temp > pixel.temp) {
+ hitPixel.temp--
+ pixel.temp++
+ }
+ }
}
else if (isEmpty(pixel.x+1, pixel.y) && Math.random() > 0.95 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2050))) {
if (Math.random() > 0.95) {
@@ -7880,22 +7835,23 @@ elements.biotorch = {
createPixel("fire",pixel.x+1, pixel.y)
}
}
+ doDefaults(pixel);
},
properties: {
oxygen: 1000,
nutrition: 1000,
speed: 0,
},
- tempHigh: 650,
+ tempHigh: 750,
stateHigh: "cooked_meat",
tempLow: -20,
stateLow: "frozen_meat",
breakInto: ["meat","cooked_meat","cooked_meat","fire"],
category: "structural",
state: "solid",
+ insulate: true,
density: 1250,
conduct: .001,
- insulate: true,
movable: false,
isBio: true,
}
@@ -8062,6 +8018,7 @@ elements.stomach_acid = {
],
ignore: ["amphib_skin","amphib_dermis","acidic_flesh","acid_vessel","throat_lining","explosive_stomach","stomach_lining","stomach_valve","slime","gaseous_material","digested_material","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","gold_coin","silver","nickel","calcium","bone","earthquake","tornado","tsunami","liquid_light","sensor"],
reactions: {
+ "bless": { elem1:null, elem2:["gaseous_material",null,null,null,null,null,null,null,null,null,null], attr2:{"nutrition":100, "speed":10}, chance:0.5 },
"dirty_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":-5, "speed":-1}, chance:0.02 },
"water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":0, "speed":2}, chance:0.02 },
"salt_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 },
@@ -8159,6 +8116,7 @@ elements.herbi_acid = {
],
ignore: ["amphib_skin","amphib_dermis","acidic_flesh","acid_vessel","throat_lining","explosive_stomach","herbi_stomach","carni_stomach","stomach_lining","stomach_valve","slime","gaseous_material","digested_material","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","gold_coin","silver","nickel","calcium","bone","earthquake","tornado","tsunami","liquid_light","sensor"],
reactions: {
+ "bless": { elem1:null, elem2:["gaseous_material",null,null,null,null,null,null,null,null,null,null], attr2:{"nutrition":100, "speed":10}, chance:0.5 },
"dirty_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":-5, "speed":-3}, chance:0.02 },
"water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":0, "speed":5}, chance:0.02 },
"salt_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 },
@@ -8261,6 +8219,7 @@ elements.carni_acid = {
],
ignore: ["amphib_skin","amphib_dermis","acidic_flesh","acid_vessel","throat_lining","explosive_stomach","stomach_lining","carni_stomach","stomach_valve","slime","gaseous_material","digested_material","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","gold_coin","silver","nickel","calcium","bone","earthquake","tornado","tsunami","liquid_light","sensor"],
reactions: {
+ "bless": { elem1:null, elem2:["gaseous_material",null,null,null,null,null,null,null,null,null,null], attr2:{"nutrition":100, "speed":10}, chance:0.5 },
"dirty_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":-5, "speed":-2}, chance:0.02 },
"water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":0, "speed":5}, chance:0.02 },
"salt_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":5, "speed":-1}, chance:0.02 },
@@ -8363,6 +8322,7 @@ elements.explosive_acid = {
],
ignore: ["amphib_skin","amphib_dermis","acidic_flesh","acid_vessel","throat_lining","stomach_lining","explosive_stomach","stomach_valve","slime","gaseous_material","digested_material","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","gold_coin","silver","nickel","calcium","bone","earthquake","tornado","tsunami","liquid_light","sensor"],
reactions: {
+ "bless": { elem1:null, elem2:["gaseous_material",null,null,null,null,null,null,null,null,null,null], attr2:{"nutrition":100, "speed":10}, chance:0.5 },
"dirty_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 },
"water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":0, "speed":10}, chance:0.02 },
"salt_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 },
@@ -8462,6 +8422,7 @@ elements.decomposer_acid = {
],
ignore: ["amphib_skin","amphib_dermis","acidic_flesh","acid_vessel","decomposer_stomach","throat_lining","explosive_stomach","herbi_stomach","carni_stomach","stomach_lining","stomach_valve","slime","gaseous_material","digested_material","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid_gas","neutral_acid","acid_cloud","water","salt_water","sugar_water","dirty_water","copper","gold","porcelain","plastic","bead","microplastic","molten_plastic","pool_water","chlorine","hydrogen","gold_coin","silver","nickel","calcium","bone","earthquake","tornado","tsunami","liquid_light","sensor"],
reactions: {
+ "bless": { elem1:null, elem2:["gaseous_material",null,null,null,null,null,null,null,null,null,null], attr2:{"nutrition":100, "speed":10}, chance:0.5 },
"dirty_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":-5}, chance:0.02 },
"water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":0, "speed":5}, chance:0.02 },
"salt_water": { elem1:null, elem2:"digested_material", attr2:{"nutrition":5}, chance:0.02 },
@@ -8729,60 +8690,239 @@ elements.real_bone = {
nutrition: 1000,
speed: 0,
},
- breakInto: ["quicklime","quicklime","quicklime","blood","bone","bone","bone","bone","bone","bone"],
- movable: false,
+ 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.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) {
+ if (Math.random() > 0.999 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2020))) {
+ 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) {
+ if (Math.random() > 0.999 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2020))) {
+ 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) {
+ if (Math.random() > 0.999 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2020))) {
+ 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) {
+ if (Math.random() > 0.999 && Math.random() > (1 - ((pixel.nutrition + pixel.oxygen + pixel.speed) / 2020))) {
+ changePixel(hitPixel,"white_blood_cell");
+ }
+ }
+ }
+ }
+ },
+ 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,
- burn: 1,
- burnTime: 100,
- burnInto: ["bone","bone","bone","bone","quicklime"],
+ movable: false,
}
-elements.real_bone_marrow = {
- color: "#D3A491",
- category: "structural",
+elements.cartilage = {
+ color: "#DBDBDB",
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)) {
+ if ((Math.random() > 0.99 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) {
pixel.nutrition--
pixel.oxygen -= 2
}
if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) {
if (pixel.temp > 95) {
- if (Math.random() < 0.95) {
+ if (Math.random() < 0.9) {
+ changePixel(pixel,"water");
+ }
+ else if (Math.random() < 0.75) {
changePixel(pixel,"meat");
}
+ else if (Math.random() < 0.75) {
+ changePixel(pixel,"calcium");
+ }
else {
- changePixel(pixel,"blood");
+ changePixel(pixel,"glue");
}
}
else if (pixel.temp < -15) {
- if (Math.random() < 0.95) {
+ if (Math.random() < 0.9) {
+ changePixel(pixel,"water");
+ }
+ else if (Math.random() < 0.75) {
changePixel(pixel,"meat");
}
+ else if (Math.random() < 0.75) {
+ changePixel(pixel,"quicklime");
+ }
else {
- changePixel(pixel,"blood");
+ changePixel(pixel,"calcium");
}
}
else {
- if (Math.random() < 0.95) {
+ if (Math.random() < 0.9) {
+ changePixel(pixel,"water");
+ }
+ else if (Math.random() < 0.75) {
changePixel(pixel,"meat");
}
+ else if (Math.random() < 0.75) {
+ changePixel(pixel,"quicklime");
+ }
else {
- changePixel(pixel,"blood");
+ changePixel(pixel,"calcium");
}
}
}
@@ -8810,11 +8950,6 @@ elements.real_bone_marrow = {
hitPixel.speed += 1
pixel.speed -= 1
}
- if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) {
- if (Math.random() > 0.9999 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen) / 2000))) {
- changePixel(hitPixel,"white_blood_cell");
- }
- }
}
}
if (!isEmpty(pixel.x, pixel.y+1, true)) {
@@ -8832,11 +8967,6 @@ elements.real_bone_marrow = {
hitPixel.speed += 1
pixel.speed -= 1
}
- if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) {
- if (Math.random() > 0.9999 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen) / 2000))) {
- changePixel(hitPixel,"white_blood_cell");
- }
- }
}
}
if (!isEmpty(pixel.x-1, pixel.y, true)) {
@@ -8854,11 +8984,6 @@ elements.real_bone_marrow = {
hitPixel.speed += 1
pixel.speed -= 1
}
- if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) {
- if (Math.random() > 0.9999 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen) / 2000))) {
- changePixel(hitPixel,"white_blood_cell");
- }
- }
}
}
if (!isEmpty(pixel.x+1, pixel.y, true)) {
@@ -8876,38 +9001,28 @@ elements.real_bone_marrow = {
hitPixel.speed += 1
pixel.speed -= 1
}
- if (elements[hitPixel.element].isBlood === true && Math.random() > 0.75) {
- if (Math.random() > 0.9999 && Math.random() < (1 - ((pixel.nutrition + pixel.oxygen) / 2000))) {
- changePixel(hitPixel,"white_blood_cell");
- }
- }
}
}
},
- density: 2710,
+ category:"structural",
+ tempHigh: 200,
+ stateHigh: ["calcium","glue","steam","steam","meat","steam",null],
+ tempLow: -36,
+ stateLow: ["calcium","calcium","meat","water","water","water",null],
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: {
+ density: 1900,
+ hardness: 0.05,
+ properties: {
oxygen: 1000,
nutrition: 1000,
speed: 0,
},
- isBio: true,
+ breakInto: ["quicklime","calcium","meat","meat","water","water",null],
movable: false,
+ isBio: true,
+ burn: 1,
+ burnTime: 100,
+ burnInto: ["bone","bone","bone","bone","quicklime"],
}
elements.cerebrospinal_fluid = {
@@ -9176,7 +9291,7 @@ elements.brain_jar_juice = {
pixel.clone = "salt_water";
}
}},
- "brain_jar_juice": { elem2:"bubble", color2:"#81cf63", attr2:{"clone":"brain_jar_juice"}, chance:0.0001 },
+ "brain_jar_juice": { elem2:"bubble", color2:"#81cf63", attr2:{"clone":"brain_jar_juice"}, chance:0.00005 },
},
state: "liquid",
density: 1026,
@@ -9814,6 +9929,168 @@ elements.bioplate = {
movable: false,
}
+elements.biocloner = {
+ color: ["#BE9247","#C09850"],
+ category: "nervous system",
+ behavior: behaviors.WALL,
+ behaviorOn: [
+ "XX|BCF|XX",
+ "BCF|XX|BCF",
+ "XX|BCF|XX",
+ ],
+ hoverStat: function(pixel) {
+ return "Ntr:"+pixel.nutrition+" O2:"+pixel.oxygen
+ },
+ tick: function(pixel) {
+ if ((Math.random() > 0.92 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.burning === true && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp > 43 && pixel.nutrition > 0 && pixel.oxygen > 0) || (pixel.temp < -10 && pixel.nutrition > 0 && pixel.oxygen > 0)) {
+ pixel.nutrition--
+ pixel.oxygen --
+ }
+ if (Math.random() > 0.5 && (pixel.nutrition < 1 || pixel.oxygen < 1 || pixel.speed < -100)) {
+ if (pixel.temp > 95) {
+ if (Math.random() < 0.75) {
+ changePixel(pixel,"meat");
+ }
+ else {
+ changePixel(pixel,"cooked_meat");
+ }
+ }
+ else if (pixel.temp < -15) {
+ if (Math.random() < 0.75) {
+ changePixel(pixel,"meat");
+ }
+ else {
+ changePixel(pixel,"frozen_meat");
+ }
+ }
+ else {
+ if (Math.random() < 0.999) {
+ changePixel(pixel,"meat");
+ }
+ else {
+ changePixel(pixel,"rotten_meat");
+ }
+ }
+ }
+ if (pixel.nutrition === null || isNaN(pixel.nutrition)) {
+ pixel.nutrition = 500
+ }
+ if (pixel.oxygen === null || isNaN(pixel.oxygen)) {
+ pixel.oxygen = 500
+ }
+ if (pixel.speed === null || isNaN(pixel.speed)) {
+ pixel.speed = 0
+ }
+ if (!isEmpty(pixel.x, pixel.y-1, true)) {
+ var hitPixel = pixelMap[pixel.x][pixel.y-1]
+ if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) {
+ if (hitPixel.oxygen < pixel.oxygen) {
+ hitPixel.oxygen += 10
+ pixel.oxygen -= 10
+ }
+ if (hitPixel.nutrition < pixel.nutrition) {
+ hitPixel.nutrition += 10
+ pixel.nutrition -= 10
+ }
+ if (hitPixel.speed < pixel.speed) {
+ hitPixel.speed += 1
+ pixel.speed -= 1
+ }
+ }
+ }
+ if (!isEmpty(pixel.x, pixel.y+1, true)) {
+ var hitPixel = pixelMap[pixel.x][pixel.y+1]
+ if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) {
+ if (hitPixel.oxygen < pixel.oxygen) {
+ hitPixel.oxygen += 10
+ pixel.oxygen -= 10
+ }
+ if (hitPixel.nutrition < pixel.nutrition) {
+ hitPixel.nutrition += 10
+ pixel.nutrition -= 10
+ }
+ if (hitPixel.speed < pixel.speed) {
+ hitPixel.speed += 1
+ pixel.speed -= 1
+ }
+ }
+ }
+ if (!isEmpty(pixel.x-1, pixel.y, true)) {
+ var hitPixel = pixelMap[pixel.x-1][pixel.y]
+ if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) {
+ if (hitPixel.oxygen < pixel.oxygen) {
+ hitPixel.oxygen += 10
+ pixel.oxygen -= 10
+ }
+ if (hitPixel.nutrition < pixel.nutrition) {
+ hitPixel.nutrition += 10
+ pixel.nutrition -= 10
+ }
+ if (hitPixel.speed < pixel.speed) {
+ hitPixel.speed += 1
+ pixel.speed -= 1
+ }
+ }
+ }
+ if (!isEmpty(pixel.x+1, pixel.y, true)) {
+ var hitPixel = pixelMap[pixel.x+1][pixel.y]
+ if (elements[hitPixel.element].isBio === true && Math.random() > 0.5) {
+ if (hitPixel.oxygen < pixel.oxygen) {
+ hitPixel.oxygen += 10
+ pixel.oxygen -= 10
+ }
+ if (hitPixel.nutrition < pixel.nutrition) {
+ hitPixel.nutrition += 10
+ pixel.nutrition -= 10
+ }
+ if (hitPixel.speed < pixel.speed) {
+ hitPixel.speed += 1
+ pixel.speed -= 1
+ }
+ }
+ }
+ doDefaults(pixel)
+ if (pixel.clone) { return }
+ for (var i = 0; i < adjacentCoords.length; i++) {
+ var coords = adjacentCoords[i];
+ var x = pixel.x + coords[0];
+ var y = pixel.y + coords[1];
+ if (!isEmpty(x,y,true)) {
+ pixel.temp = pixelMap[x][y].temp;
+ if (pixelMap[x][y].clone) { pixel.clone = pixelMap[x][y].clone; break }
+ var element = pixelMap[x][y].element;
+ if (element === pixel.element || elements[pixel.element].ignore.indexOf(element) !== -1 && element !== "fuse") { continue }
+ pixel.clone = element;
+ break;
+ }
+ }
+ },
+ ignore: ["cloner","slow_cloner","clone_powder","floating_cloner","wire","ewall","sensor","battery","fuse","nerve","flesh"],
+ ignoreConduct:["fuse"],
+ density: 2710,
+ state: "solid",
+ conduct: 1,
+ tempHigh: 200,
+ stateHigh: "cooked_meat",
+ tempLow: -25,
+ stateLow: "frozen_meat",
+ burn: 5,
+ burnTime: 350,
+ burnInto: "cooked_meat",
+ breakInto: ["blood","meat"],
+ reactions: {
+ "cancer": { elem1:"cancer", chance:0.0005 },
+ "radiation": { elem1:["ash","blood","fat","meat","rotten_meat","cooked_meat"], chance:0.4 },
+ },
+ properties: {
+ oxygen: 1000,
+ nutrition: 1000,
+ speed: 0,
+ },
+ isBio: true,
+ movable: false,
+}
+
elements.valve = {
color: ["#A9436A","#B64F71"],
category: "nervous system",
@@ -10143,26 +10420,23 @@ elements.revive = {
pixel.burning = false
}
}
- if (elements[pixel.element].id === elements.meat.id || elements[pixel.element].id === elements.rotten_meat.id || elements[pixel.element].id === elements.cured_meat.id || elements[pixel.element].id === elements.cooked_meat.id || elements[pixel.element].id === elements.cancer.id) {
+ if (elements[pixel.element].id === elements.rotten_meat.id || elements[pixel.element].id === elements.cancer.id) {
changePixel(pixel,"flesh");
}
- else if (elements[pixel.element].id === elements.bone.id || elements[pixel.element].id === elements.bone_marrow.id || elements[pixel.element].id === elements.quicklime.id) {
+ else if (elements[pixel.element].id === elements.bone.id) {
changePixel(pixel,"real_bone");
}
- else if (elements[pixel.element].id === elements.dust.id || elements[pixel.element].id === elements.skin.id) {
+ else if (elements[pixel.element].id === elements.bone_marrow.id) {
+ changePixel(pixel,"real_bone_marrow");
+ }
+ else if (elements[pixel.element].id === elements.skin.id) {
changePixel(pixel,"epidermis");
}
- else if (elements[pixel.element].id === elements.blood.id) {
- if (Math.random() < 0.65) {
- if (Math.random() < 0.95) {
- changePixel(pixel,"blood_vessel");
- }
- else {changePixel(pixel,"white_blood_cell"); }
+ else if (elements[pixel.element].id === elements.infected_vessel.id) {
+ if (Math.random() < 0.95) {
+ changePixel(pixel,"blood_vessel");
}
- else {changePixel(pixel,"flesh"); }
- }
- else if (elements[pixel.element].id === elements.infection.id || elements[pixel.element].id === elements.antibody.id) {
- changePixel(pixel,"white_blood_cell");
+ else {changePixel(pixel,"white_blood_cell"); }
}
},
canPlace: false,
@@ -10221,8 +10495,6 @@ elements.cancer.reactions.simple_lung = { "elem2": "cancer", chance:0.005 };
elements.cancer.reactions.gills = { "elem2": "cancer", chance:0.005 };
elements.cancer.reactions.brain = { "elem2": "cancer", chance:0.005 };
elements.cancer.reactions.nerve = { "elem2": "cancer", chance:0.005 };
-elements.cancer.reactions.eye_nerve = { "elem2": "cancer", chance:0.005 };
-elements.cancer.reactions.bulb_nerve = { "elem2": "cancer", chance:0.005 };
elements.cancer.reactions.olfactory_bulb = { "elem2": "cancer", chance:0.005 };
elements.cancer.reactions.eye = { "elem2": "cancer", chance:0.005 };
elements.cancer.reactions.sphincter = { "elem2": "cancer", chance:0.005 };
@@ -10269,8 +10541,6 @@ elements.uranium.reactions.simple_lung = { "elem2": ["ash","carbon_dioxide","mea
elements.uranium.reactions.brain = { "elem2": ["ash","steam","salt","meat","rotten_meat","cooked_meat","flesh","cerebrospinal_fluid"], chance:0.5 };
elements.uranium.reactions.amygdala = { "elem2": ["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 };
elements.uranium.reactions.nerve = { "elem2": ["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 };
-elements.uranium.reactions.eye_nerve = { "elem2": ["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 };
-elements.uranium.reactions.bulb_nerve = { "elem2": ["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 };
elements.uranium.reactions.olfactory_bulb = { "elem2": ["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 };
elements.uranium.reactions.eye = { "elem2": ["ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 };
elements.uranium.reactions.sphincter = { "elem2": ["ash","steam","poop","meat","rotten_meat","cooked_meat","flesh"], chance:0.5 };
@@ -10316,8 +10586,6 @@ elements.radiation.reactions.simple_lung = { "elem2": ["cancer","ash","carbon_di
elements.radiation.reactions.brain = { "elem2": ["cancer","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh","cerebrospinal_fluid"], chance:0.4 };
elements.radiation.reactions.amygdala = { "elem2": ["cancer","ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 };
elements.radiation.reactions.nerve = { "elem2": ["cancer","ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 };
-elements.radiation.reactions.eye_nerve = { "elem2": ["cancer","ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 };
-elements.radiation.reactions.bulb_nerve = { "elem2": ["cancer","ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 };
elements.radiation.reactions.olfactory_bulb = { "elem2": ["cancer","ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 };
elements.radiation.reactions.eye = { "elem2": ["cancer","ash","steam","salt","ash","steam","salt","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 };
elements.radiation.reactions.sphincter = { "elem2": ["cancer","ash","steam","poop","meat","rotten_meat","cooked_meat","flesh"], chance:0.4 };
@@ -10361,8 +10629,6 @@ elements.plague.reactions.simple_lung = { "elem2": ["infection","rotten_meat","c
elements.plague.reactions.brain = { "elem2": ["infection","rotten_meat","steam","salt","meat","rotten_meat","plague","flesh","cerebrospinal_fluid"], chance:0.04 };
elements.plague.reactions.amygdala = { "elem2": ["infection","rotten_meat","steam","salt","rotten_meat","steam","salt","meat","rotten_meat","plague","flesh"], chance:0.04 };
elements.plague.reactions.nerve = { "elem2": ["infection","rotten_meat","steam","salt","rotten_meat","steam","salt","meat","rotten_meat","plague","flesh"], chance:0.04 };
-elements.plague.reactions.eye_nerve = { "elem2": ["infection","rotten_meat","steam","salt","rotten_meat","steam","salt","meat","rotten_meat","plague","flesh"], chance:0.04 };
-elements.plague.reactions.bulb_nerve = { "elem2": ["infection","rotten_meat","steam","salt","rotten_meat","steam","salt","meat","rotten_meat","plague","flesh"], chance:0.04 };
elements.plague.reactions.olfactory_bulb = { "elem2": ["infection","rotten_meat","steam","salt","rotten_meat","steam","salt","meat","rotten_meat","plague","flesh"], chance:0.04 };
elements.plague.reactions.eye = { "elem2": ["infection","rotten_meat","steam","salt","rotten_meat","steam","salt","meat","rotten_meat","plague","flesh"], chance:0.04 };
elements.plague.reactions.sphincter = { "elem2": ["infection","rotten_meat","steam","poop","meat","rotten_meat","plague","flesh"], chance:0.04 };
@@ -10387,11 +10653,66 @@ if (!elements.fly.reactions) { elements.infection.reactions = {} }
elements.fly.reactions.poop = { elem2:[null,null,"stench"], chance:0.15, func:behaviors.FEEDPIXEL };
if (!elements.stench.reactions) { elements.infection.reactions = {} }
-elements.stench.reactions.intestines = { elem1:[null,null,null,null,null,null,"foam"], chance:0.015, };
-elements.stench.reactions.stomach_valve = { elem1:[null,null,null,null,null,null,"foam"], chance:0.05, };
+elements.stench.reactions.intestines = { elem1:[null,null,null,null,null,null,"foam"], chance:0.005, };
+elements.stench.reactions.stomach_valve = { elem1:[null,null,null,null,null,null,"foam"], chance:0.015, };
elements.bless.reactions.poop = { elem2:null }
elements.bless.reactions.excreted_poop = { elem2:null }
+elements.bless.reactions.infected_vessel = { elem2:["blood_vessel","blood_vessel","blood_vessel","blood_vessel","blood_vessel","blood_vessel","white_blood_cell"] }
+elements.bless.tool = function(pixel) {
+ if (elements.bless.ignore.indexOf(pixel.element) !== -1) { return; }
+ if (pixel.burning && !elements[pixel.element].burning) { // stop burning
+ delete pixel.burning;
+ delete pixel.burnStart;
+ }
+ if (!elements[pixel.element].insulate) {
+ if (pixel.temp > 100) {
+ pixel.temp = (pixel.temp+100)/2;
+ pixelTempCheck(pixel);
+ if (pixel.del) {return}
+ }
+ if (pixel.temp < -200) {
+ pixel.temp = (pixel.temp-200)/2;
+ pixelTempCheck(pixel);
+ if (pixel.del) {return}
+ }
+ }
+ if (pixel.origColor) {
+ pixel.color = "rgb("+pixel.origColor.join(",")+")";
+ delete pixel.origColor;
+ }
+ if (pixel.charge) {
+ delete pixel.charge;
+ pixel.chargeCD = 16;
+ }
+ if (elements.bless.reactions[pixel.element] && Math.random()<0.25) {
+ var r = elements.bless.reactions[pixel.element];
+ var elem2 = r.elem2;
+ if (elem2 !== undefined) {
+ if (Array.isArray(elem2)) { elem2 = elem2[Math.floor(Math.random()*elem2.length)]; }
+ if (elem2 === null) { deletePixel(pixel.x,pixel.y) }
+ else { changePixel(pixel, elem2); }
+ }
+ if (r.func) { r.func(pixel,pixel) }
+ if (r.color2) { pixel.color = pixelColorPick(pixel,r.color2) }
+ }
+ if (elements[pixel.element].isBio == true) {
+ if (pixel.nutrition < 2000 || pixel.oxygen < 2000) {
+ if (pixel.nutrition < 2000) {
+ pixel.nutrition += 100
+ }
+ if (pixel.oxygen < 2000) {
+ pixel.oxygen += 100
+ }
+ if (pixel.speed < 0) {
+ pixel.oxygen += 10
+ }
+ }
+ if (pixel.burning) {
+ pixel.burning = false
+ }
+ }
+}
elements.dna.reactions.juice = { "elem1": null, "elem2": "elixir", chance:0.01 };
diff --git a/mods/fractals.js b/mods/fractals.js
new file mode 100644
index 00000000..eec2964f
--- /dev/null
+++ b/mods/fractals.js
@@ -0,0 +1,156 @@
+let jmax = 2
+let jmin = -2
+let offsetx = 0
+let offsety = 0
+let mode = `mandelbrot`
+preCalculatedGrid = []
+runEveryTick(function(){
+ preCalculatedGrid = []
+ for (let x = 0; x < pixelMap.length; x++){
+ preCalculatedGrid.push([])
+ for (let y = 0; y < pixelMap[x].length; y++){
+ preCalculatedGrid[x].push({
+ x: x,
+ y: y,
+ iteration: 100,
+ })
+ }
+ }
+ for (let ix = 0; ix < preCalculatedGrid.length; ix++){
+ for (let iy = 0; iy < preCalculatedGrid[ix].length; iy++){
+ const range = jmax - jmin;
+ const scale = range / Math.min(width, height);
+ let x = (ix - width / 2) * scale + offsetx;
+ let y = (iy - height / 2) * scale + offsety;
+ let iteration = 0;
+ if (mode == `mandelbrot`){
+ let zx = 0;
+ let zy = 0;
+ let c = {x: x, y: y};
+ while (zx * zx + zy * zy < 4 && iteration < 100) {
+ let xtemp = zx * zx - zy * zy + c.x;
+ zy = 2 * zx * zy + c.y;
+ zx = xtemp;
+ iteration++;
+ }}
+ else { // burning ship
+ let zx = 0;
+ let zy = 0;
+ let c = {x: x, y: y};
+ while (zx * zx + zy * zy < 4 && iteration < 100) {
+ let xtemp = zx * zx - zy * zy + c.x;
+ zy = Math.abs(2 * zx * zy) + c.y;
+ zx = Math.abs(xtemp);
+ iteration++;
+ }
+ }
+ preCalculatedGrid[ix][iy].iteration = iteration
+ }
+ }
+})
+elements.mandelbrot = {
+ color: "#000000",
+ behavior: behaviors.WALL,
+ category: "mandelbrot tools",
+ onSelect: function(){
+ jmax = parseFloat(prompt("How far would you like it to extend in each direction?"))||2
+ jmin = -jmax
+ offsetx = parseFloat(prompt("How far would you like it to be offset in the x direction?"))||0
+ offsety = parseFloat(prompt("How far would you like it to be offset in the y direction?"))||0
+ mode = prompt("Mandelbrot or burning ship?")
+ },
+ tick: function(pixel){
+ // first, map canvas coord to a range of -2 to 2, but dont scale it, using width, height, and pixel.x and pixel.y
+ /*
+ const range = jmax - jmin;
+ const scale = range / Math.min(width, height);
+ const x = (pixel.x - width / 2) * scale + offsetx;
+ const y = -(pixel.y - height / 2) * scale + offsety;
+ let iteration = 0;
+ if (mode == `mandelbrot`){
+ let zx = 0;
+ let zy = 0;
+ let c = {x: x, y: y};
+ while (zx * zx + zy * zy < 4 && iteration < 100) {
+ let xtemp = zx * zx - zy * zy + c.x;
+ zy = 2 * zx * zy + c.y;
+ zx = xtemp;
+ iteration++;
+ }}
+ else { // burning ship
+ let zx = 0;
+ let zy = 0;
+ let c = {x: x, y: y};
+ while (zx * zx + zy * zy < 4 && iteration < 100) {
+ let xtemp = zx * zx - zy * zy + c.x;
+ zy = Math.abs(2 * zx * zy) + c.y;
+ zx = Math.abs(xtemp);
+ iteration++;
+ }
+ }
+ */
+ iteration = preCalculatedGrid[pixel.x][pixel.y].iteration
+ if (iteration >= 99.5) {
+ pixel.color = "rgb(255, 255, 255)"
+ } else {
+ pixel.color = `rgb(0, ${67.3684*Math.pow(1.01578, iteration)-67.3684}, ${67.3684*Math.pow(1.01578, iteration)-67.3684})`
+ //console.log(iteration)
+ }
+ }
+}
+elements.mandelbrot_zoom_in = {
+ color: elements.heater.color,
+ category: "mandelbrot tools",
+ canPlace: false,
+ tool: function(){},
+ onSelect: function(){
+ jmax *= 0.95
+ jmin = -jmax
+ }
+}
+elements.mandelbrot_zoom_out = {
+ color: elements.cooler.color,
+ category: "mandelbrot tools",
+ canPlace: false,
+ tool: function(){},
+ onSelect: function(){
+ jmax *= 1.05
+ jmin = -jmax
+ }
+}
+elements.mandelbrot_move_left = {
+ color: elements.grape.color,
+ category: "mandelbrot tools",
+ canPlace: false,
+ tool: function(){},
+ onSelect: function(){
+ offsetx -= 0.05*jmax
+ }
+}
+elements.mandelbrot_move_right = {
+ color: elements.tomato.color,
+ category: "mandelbrot tools",
+ canPlace: false,
+ tool: function(){},
+ onSelect: function(){
+ offsetx += 0.05*jmax
+ }
+}
+elements.mandelbrot_move_up = {
+ color: elements.mix.color,
+ category: "mandelbrot tools",
+ canPlace: false,
+ tool: function(){},
+ onSelect: function(){
+ offsety += 0.05*jmax
+ }
+}
+elements.mandelbrot_move_down = {
+ color: elements.drag.color,
+ category: "mandelbrot tools",
+ canPlace: false,
+ tool: function(){},
+ onSelect: function(){
+ offsety -= 0.05*jmax
+ }
+}
\ No newline at end of file
diff --git a/mods/lattice_filler.js b/mods/lattice_filler.js
new file mode 100644
index 00000000..e1c69f71
--- /dev/null
+++ b/mods/lattice_filler.js
@@ -0,0 +1,29 @@
+elements.lattice_filler = {
+ behavior: [
+ "XX|CL|XX",
+ "CL|DL|CL",
+ "XX|CL|XX",
+ ],
+ category: "special",
+ state: "solid",
+ density: 1834,
+ color: "#ff266e",
+ reactions: {
+ "lightning": {elem1: "destructive_lattice_filler", elem2: null}
+ }
+};
+
+elements.destructive_lattice_filler = {
+ behavior: [
+ "DL|CL|DL",
+ "CL|DL|CL",
+ "DL|CL|DL",
+ ],
+ category: "special",
+ state: "solid",
+ density: 1834,
+ color: "#ff0037",
+ hidden: true,
+};
+
+elements.filler.reactions.laser = { "elem1":"lattice_filler", "elem2": "lattice_filler" }
\ No newline at end of file
diff --git a/mods/nousersthings.js b/mods/nousersthings.js
index 7af6436b..5a94537c 100644
--- a/mods/nousersthings.js
+++ b/mods/nousersthings.js
@@ -358,14 +358,14 @@ elements.destroyable_pipe = {
var y = pixel.y+coord[1];
if (!isEmpty(x,y,true)) {
var newPixel = pixelMap[x][y];
- if (newPixel.element === "destroyable_pipe" || newPixel.element === "bridge_pipe") {
+ if (newPixel.element === "destroyable_pipe" || newPixel.element === "bridge_pipe" || newPixel.element === "pipe_transmitter") {
var nextStage;
switch (pixel.stage) {
case 2: nextStage = 4; break; //green
case 3: nextStage = 2; break; //red
case 4: nextStage = 3; break; //blue
}
- if (pixel.con && !newPixel.con && newPixel.stage === nextStage) { //transfer to adjacent pipe
+ if (pixel.con && !newPixel.con && (newPixel.stage === nextStage || newPixel.element === "pipe_transmitter")) { //transfer to adjacent pipe
newPixel.con = pixel.con;
newPixel.con.x = newPixel.x;
newPixel.con.y = newPixel.y;
@@ -669,14 +669,14 @@ elements.e_pipe = {
var y = pixel.y+coord[1];
if (!isEmpty(x,y,true)) {
var newPixel = pixelMap[x][y];
- if (newPixel.element === "e_pipe" || newPixel.element === "bridge_pipe") {
+ if (newPixel.element === "e_pipe" || newPixel.element === "bridge_pipe" || newPixel.element === "pipe_transmitter") {
var nextStage;
switch (pixel.stage) {
case 2: nextStage = 4; break; //green
case 3: nextStage = 2; break; //red
case 4: nextStage = 3; break; //blue
}
- if (pixel.con && !newPixel.con && newPixel.stage === nextStage && (pixel.charge || pixel.chargeCD)) { //transfer to adjacent pipe
+ if (pixel.con && !newPixel.con && (newPixel.stage === nextStage || newPixel.element === "pipe_transmitter") && (pixel.charge || pixel.chargeCD)) { //transfer to adjacent pipe
newPixel.con = pixel.con;
newPixel.con.x = newPixel.x;
newPixel.con.y = newPixel.y;
@@ -787,14 +787,14 @@ elements.destroyable_e_pipe = {
var y = pixel.y+coord[1];
if (!isEmpty(x,y,true)) {
var newPixel = pixelMap[x][y];
- if (newPixel.element === "destroyable_e_pipe" || newPixel.element === "bridge_pipe") {
+ if (newPixel.element === "destroyable_e_pipe" || newPixel.element === "bridge_pipe" || newPixel.element === "pipe_transmitter") {
var nextStage;
switch (pixel.stage) {
case 2: nextStage = 4; break; //green
case 3: nextStage = 2; break; //red
case 4: nextStage = 3; break; //blue
}
- if (pixel.con && !newPixel.con && newPixel.stage === nextStage && (pixel.charge || pixel.chargeCD)) { //transfer to adjacent pipe
+ if (pixel.con && !newPixel.con && (newPixel.stage === nextStage || newPixel.element === "pipe_transmitter") && (pixel.charge || pixel.chargeCD)) { //transfer to adjacent pipe
newPixel.con = pixel.con;
newPixel.con.x = newPixel.x;
newPixel.con.y = newPixel.y;
@@ -914,14 +914,14 @@ elements.channel_pipe = {
var y = pixel.y+coord[1];
if (!isEmpty(x,y,true)) {
var newPixel = pixelMap[x][y];
- if ((newPixel.element === "channel_pipe" && pixelMap[x][y].channel == pixel.channel || newPixel.element === "bridge_pipe")) {
+ if ((newPixel.element === "channel_pipe" && pixelMap[x][y].channel == pixel.channel || newPixel.element === "bridge_pipe" || (newPixel.element === "pipe_transmitter" && pixelMap[x][y].channel == pixel.channel))) {
var nextStage;
switch (pixel.stage) {
case 2: nextStage = 4; break; //green
case 3: nextStage = 2; break; //red
case 4: nextStage = 3; break; //blue
}
- if (pixel.con && !newPixel.con && newPixel.stage === nextStage) { //transfer to adjacent pipe
+ if (pixel.con && !newPixel.con && (newPixel.stage === nextStage || newPixel.element === "pipe_transmitter")) { //transfer to adjacent pipe
newPixel.con = pixel.con;
newPixel.con.x = newPixel.x;
newPixel.con.y = newPixel.y;
@@ -1037,14 +1037,14 @@ elements.destroyable_channel_pipe = {
var y = pixel.y+coord[1];
if (!isEmpty(x,y,true)) {
var newPixel = pixelMap[x][y];
- if ((newPixel.element === "destroyable_channel_pipe" && pixelMap[x][y].channel == pixel.channel) || newPixel.element === "bridge_pipe") {
+ if ((newPixel.element === "destroyable_channel_pipe" && pixelMap[x][y].channel == pixel.channel) || newPixel.element === "bridge_pipe" || (newPixel.element === "pipe_transmitter" && pixelMap[x][y].channel == pixel.channel)) {
var nextStage;
switch (pixel.stage) {
case 2: nextStage = 4; break; //green
case 3: nextStage = 2; break; //red
case 4: nextStage = 3; break; //blue
}
- if (pixel.con && !newPixel.con && newPixel.stage === nextStage) { //transfer to adjacent pipe
+ if (pixel.con && !newPixel.con && (newPixel.stage === nextStage || newPixel.element === "pipe_transmitter")) { //transfer to adjacent pipe
newPixel.con = pixel.con;
newPixel.con.x = newPixel.x;
newPixel.con.y = newPixel.y;
@@ -1097,7 +1097,7 @@ elements.destroyable_channel_pipe = {
movable: false,
canContain: true,
},
-listPipes = ["pipe", "destroyable_pipe", "destroyable_e_pipe","channel_pipe","destroyable_channel_pipe","bridge_pipe","e_pipe"];
+listPipes = ["pipe", "destroyable_pipe", "destroyable_e_pipe","channel_pipe","destroyable_channel_pipe","bridge_pipe","e_pipe","pipe_transmitter"];
elements.bridge_pipe = {
color: "#414c4f",
onSelect: function() {
@@ -1161,7 +1161,7 @@ elements.bridge_pipe = {
case 3: nextStage = 2; break; //red
case 4: nextStage = 3; break; //blue
}
- if (pixel.con && !newPixel.con && newPixel.stage === nextStage) { //transfer to adjacent pipe
+ if (pixel.con && !newPixel.con && (newPixel.stage === nextStage || newPixel.element === "pipe_transmitter")) { //transfer to adjacent pipe
newPixel.con = pixel.con;
newPixel.con.x = newPixel.x;
newPixel.con.y = newPixel.y;
@@ -1266,14 +1266,14 @@ elements.pipe.tick = function(pixel) {
var y = pixel.y+coord[1];
if (!isEmpty(x,y,true)) {
var newPixel = pixelMap[x][y];
- if (newPixel.element === "pipe" || newPixel.element === "bridge_pipe") {
+ if (newPixel.element === "pipe" || newPixel.element === "bridge_pipe" || newPixel.element === "pipe_transmitter") {
var nextStage;
switch (pixel.stage) {
case 2: nextStage = 4; break; //green
case 3: nextStage = 2; break; //red
case 4: nextStage = 3; break; //blue
}
- if (pixel.con && !newPixel.con && newPixel.stage === nextStage) { //transfer to adjacent pipe
+ if (pixel.con && !newPixel.con && (newPixel.stage === nextStage || newPixel.element === "pipe_transmitter")) { //transfer to adjacent pipe
newPixel.con = pixel.con;
newPixel.con.x = newPixel.x;
newPixel.con.y = newPixel.y;
@@ -3104,6 +3104,7 @@ elements.piston_ray_emitter = {
var lx = lcoord[0];
var ly = lcoord[1];
if (!isEmpty(lx, ly, true)){
+ if (pixelMap[lx][ly].element == "insulator"){break;}
tryMove(pixelMap[lx][ly], pCoord[0], pCoord[1], null, true)
}
pCoord[0] = lx;
@@ -3758,4 +3759,72 @@ elements.hotter_sensor = {
}
}
}
+}
+let pipe_transmitter_channelVar = 0;
+elements.pipe_transmitter = {
+ color: "#6e6250",
+ category: "machines",
+ movable: false,
+ canContain: true,
+ insulate: true,
+ onSelect: () => {
+ let newChannel = prompt("Enter the channel of this pipe transmitter. It will not work if you do multiple while paused.", pipe_transmitter_channelVar);
+ pipe_transmitter_channelVar = newChannel;
+ },
+ tick: (pixel) => {
+ if (!pixel.channel){
+ pixel.channel = pipe_transmitter_channelVar;
+ }
+ if (pixel.channel && pixel.con){
+ for (x in pixelMap){
+ for (y in pixelMap[x]){
+ if (!isEmpty(x, y, true)){
+ if (pixelMap[x][y].element == "pipe_receiver" && pixelMap[x][y].channel == pixel.channel){
+ pixelMap[x][y].con = pixel.con;
+ delete pixel.con;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+let pipe_receiver_channelVar = 0;
+elements.pipe_receiver = {
+ color: "#4d4b63",
+ category: "machines",
+ movable: false,
+ canContain: true,
+ insulate: true,
+ onSelect: () => {
+ let newChannel = prompt("Enter the channel of this pipe receiver. It will not work if you do multiple while paused.", pipe_receiver_channelVar);
+ pipe_receiver_channelVar = newChannel;
+ },
+ tick: (pixel) => {
+ if (!pixel.channel){
+ pixel.channel = pipe_receiver_channelVar;
+ }
+ if (pixel.channel && pixel.con){
+ // just scan neighbors for elements on the pipe list; transfer con to them. if its a type of channel pipe, also check if channel matches
+ for (i = 0; i < squareCoords.length; i++){
+ let x = squareCoords[i][0] + pixel.x;
+ let y = squareCoords[i][1] + pixel.y;
+ if (!isEmpty(x, y, true)){
+ if (listPipes.includes(pixelMap[x][y].element)){
+ if (["channel_pipe", "destroyable_channel_pipe"].includes(pixelMap[x][y].element)){
+ if (pixelMap[x][y].channel == pixel.channel){
+ pixelMap[x][y].con = pixel.con;
+ delete pixel.con;
+ }
+ } else {
+ pixel.con.x = x;
+ pixel.con.y = y;
+ pixelMap[x][y].con = pixel.con;
+ delete pixel.con;
+ }
+ }
+ }
+ }
+ }
+ }
}
\ No newline at end of file