From fa4c8bf814cb6640590788900ae5011023ec71ce Mon Sep 17 00:00:00 2001 From: jakob3797 <167775393+jakob3797@users.noreply.github.com> Date: Thu, 3 Oct 2024 14:46:52 -0500 Subject: [PATCH 01/28] Update Quicksand_one.js Full update --- mods/Quicksand_one.js | 373 +++++++++++++++++++++++++++++++++++------- 1 file changed, 311 insertions(+), 62 deletions(-) diff --git a/mods/Quicksand_one.js b/mods/Quicksand_one.js index 7f601977..367aabcd 100644 --- a/mods/Quicksand_one.js +++ b/mods/Quicksand_one.js @@ -467,18 +467,7 @@ elements.mushy_mud = { density: 1200, stain: 0.3 }; -elements.mud = { - color: "#8B4513", - behavior: elements.slime.behavior, - viscosity: 1050, - tempHigh: 58, - stateHigh: "liquid", - tempLow: 0, - category: "liquids", - state: "liquid", - density: 1000, - stain: 0.3 -}; + elements.quicksand_mud = { color: "#DAA520", behavior: elements.slime.behavior, @@ -515,7 +504,7 @@ elements.sticky_quicksand = { density: 1100, stain: 0.25 }; -elements.fluff_mud = { +elements.pluff_mud = { color: "#964B00", behavior: elements.slime.behavior, viscosity: 10000, @@ -527,55 +516,6 @@ elements.fluff_mud = { density: 1300, stain: 0.2 }; -elements.bog = { - color: "#556B2F", - behavior: elements.slime.behavior, - viscosity: 10000, - tempHigh: 45, - stateHigh: "liquid", - tempLow: 0, - category: "liquids", - state: "liquid", - density: 1400, - stain: 0.25 -}; -elements.mire = { - color: "#2E8B57", - behavior: elements.slime.behavior, - viscosity: 10000, - tempHigh: 50, - stateHigh: "liquid", - tempLow: 0, - category: "liquids", - state: "liquid", - density: 1500, - stain: 0.3 -}; -elements.oobleck = { - color: "#008000", - behavior: elements.slime.behavior, - viscosity: 10000, - tempHigh: 25, - stateHigh: "liquid", - tempLow: 0, - category: "liquids", - state: "liquid", - density: 1600, - stain: 0.15 -}; -elements.spiderwebs = { - color: "#D3D3D3", - behavior: elements.slime.behavior, - viscosity: 10000, - tempHigh: 20, - stateHigh: "liquid", - tempLow: 0, - category: "liquids", - state: "liquid", - density: 1700, - stain: 0.1 -}; - elements.silt_quicksand = { color: "#DAA520", behavior: elements.slime.behavior, @@ -1104,3 +1044,312 @@ elements.murky_marsh_mixture = { density: 1900, stain: 0.2 }; + + + +elements.mud = { + color: "#8B4513", + reactions: { + "water": { "elem1": "wet_mud" }, + "mire": { "elem1": "mire_mud" }, + "dirt": { "elem1": "thick_mud" }, + "plant": { "elem1": "pluff_mud" }, + "bog": { "elem1": "boggy_mud" }, + "sand": { "elem1": "sandy_mud" }, + }, + behavior: elements.slime.behavior, + viscosity: 1050, + tempHigh: 58, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 1000, + stain: 0.3 +}; +elements.marsh = { + color: "#556B2F", + behavior: elements.slime.behavior, + reactions: { + "slime": { "elem1": "marshy_slime" }, + }, + viscosity: 13500, + tempHigh: 75, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 1900, + stain: 0.2 +}; +elements.peat = { + color: "#556B2F", + behavior: elements.slime.behavior, + viscosity: 13500, + tempHigh: 75, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 1900, + stain: 0.2 +}; +elements.goo = { + color: "#556B2F", + behavior: behavior.POWDER, + viscosity: 13500, + tempHigh: 75, + stateHigh: "powder", + tempLow: 0, + category: "powders", + state: "powder", + density: 1900, + stain: 0.2 +}; +elements.ooze = { + color: "#556B2F", + behavior: elements.slime.behavior, + viscosity: 13500, + tempHigh: 75, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 1900, + stain: 0.2 +}; +elements.spiderwebs = { + color: "#D3D3D3", + behavior: elements.slime.behavior, + viscosity: 10000, + tempHigh: 20, + stateHigh: "liquid", + reactions: { + "ooze": { "elem1": "sticky_spider_ooze" }, + "goo": { "elem1": "sticky_spider_goo" }, + }, + tempLow: 0, + category: "liquids", + state: "liquid", + density: 1700, + stain: 0.1 +}; +elements.bog = { + color: "#556B2F", + behavior: elements.slime.behavior, + viscosity: 10000, + tempHigh: 45, + stateHigh: "liquid", + tempLow: 0, + reactions: { + "quicksand": { "elem1": "bog_quicksand" }, + }, + category: "liquids", + state: "liquid", + density: 1400, + stain: 0.25 +}; +elements.mire = { + color: "#2E8B57", + behavior: elements.slime.behavior, + viscosity: 10000, + tempHigh: 50, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 1500, + stain: 0.3 +}; +elements.oobleck = { + color: "#008000", + behavior: elements.slime.behavior, + viscosity: 10000, + tempHigh: 25, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 1600, + stain: 0.15 +}; +elements.quicksand = { + color: "#8B4513", + behavior: elements.slime.behavior, + viscosity: 1050, + tempHigh: 58, + stateHigh: "liquid", + reactions: { + "water": { "elem1": "wet_quicksand" }, + "peat": { "elem1": "peat_quicksand" }, + "mud": { "elem1": "quicksand_mud" }, + }, + tempLow: 0, + category: "liquids", + state: "liquid", + density: 1574, + stain: 0.3 +}; +elements.gel = { + color: "#008000", + behavior: elements.slime.behavior, + viscosity: 10000, + tempHigh: 25, + reactions: { + "spider_webbing": { "elem1": "webbing_gel" }, + }, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 1600, + stain: 0.15 +}; +elements.silly_putty = { + color: "#FFD700", + behavior: behaviors.LIQUID, + viscosity: 4000, + tempHigh: 50, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 900, // Adjusted density + stain: 0.1 +}; + +elements.kinetic_sand = { + color: "#FFD700", + behavior: behaviors.LIQUID, + viscosity: 5000, + tempHigh: 55, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 1200, // Adjusted density + stain: 0.15 +}; + +elements.gak = { + color: "#FF69B4", + behavior: behaviors.LIQUID, + viscosity: 6000, + tempHigh: 60, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 950, + stain: 0.2 +}; + +elements.flubber = { + color: "#FF4500", + behavior: behaviors.LIQUID, + viscosity: 3000, + tempHigh: 65, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 800, + stain: 0.1 +}; + +elements.play_doh = { + color: "#FFC0CB", + behavior: behaviors.LIQUID, + viscosity: 5000, + tempHigh: 55, + reactions: { + "sand": { "elem1": "sandy_play_doh" }, + }, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 950, + stain: 0.2 +}; + +elements.floam = { + color: "#98FB98", + behavior: behaviors.LIQUID, + viscosity: 4000, + tempHigh: 60, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 1000, + stain: 0.15 +}; + +elements.moon_sand = { + color: "#D3D3D3", + behavior: behaviors.LIQUID, + viscosity: 4500, + tempHigh: 60, + reactions: { + "water": { "elem1": "moon_quicksand" }, + "kinetic_sand": { "elem1": "moon_kinetic_sand" }, + }, + stateHigh: "liquid", + tempLow: 0, + category: "powders", + state: "powder", + density: 950, + stain: 0.1 +}; +elements.moon_quicksand = { + color: "#98FB98", + behavior: behaviors.LIQUID, + viscosity: 4000, + tempHigh: 60, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 1000, + stain: 0.15 +}; +elements.moon_kinetic_sand = { + color: "#D3D3D3", + behavior: behaviors.LIQUID, + viscosity: 4500, + tempHigh: 60, + reactions: { + "water": { "elem1": "kinetic_moon_quicksand" }, + }, + stateHigh: "liquid", + tempLow: 0, + category: "powders", + state: "powder", + density: 950, + stain: 0.1 +}; +elements.kinetic_moon_quicksand = { + color: "#98FB98", + behavior: behaviors.LIQUID, + viscosity: 4000, + tempHigh: 60, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 1000, + stain: 0.15 +}; +elements.sandy_play_doh = { + color: "#FFC0CB", + behavior: behaviors.LIQUID, + viscosity: 5000, + tempHigh: 55, + stateHigh: "liquid", + tempLow: 0, + category: "liquids", + state: "liquid", + density: 950, + stain: 0.2 +}; From dc5b824a63bf8b867c4542620ab54f98c7c72e2f Mon Sep 17 00:00:00 2001 From: GGod <46885632+GGodPL@users.noreply.github.com> Date: Sat, 5 Oct 2024 21:02:56 +0200 Subject: [PATCH 02/28] chem formula mod --- mods/chemFormula.js | 43 ++++++++ mods/chemFormulas.json | 241 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 284 insertions(+) create mode 100644 mods/chemFormula.js create mode 100644 mods/chemFormulas.json diff --git a/mods/chemFormula.js b/mods/chemFormula.js new file mode 100644 index 00000000..eaff0b48 --- /dev/null +++ b/mods/chemFormula.js @@ -0,0 +1,43 @@ +const styleElement = document.createElement('style'); +styleElement.innerHTML = ` +.tooltip { + z-index: 1000; + position: relative; +} + +.tooltip .tooltiptext { + visibility: hidden; + background-color: rgba(0, 0, 0, 0.8); + color: #fff; + text-align: center; + padding: 0.5em; + border-radius: 0.5em; + position: absolute; + z-index: 1000; + bottom: 100%; + left: 50%; + transform: translateX(-50%); + pointer-events: none; + text-shadow: none; +} + +.tooltip:hover .tooltiptext { + visibility: visible; +} +` + +document.head.appendChild(styleElement); + +runAfterLoad(async () => { + const data = await fetch('mods/chemFormulas.json').then((res) => res.json()); + for (const element in data) { + if (elements[element]) { + elements[element].hoverStat = () => data[element].length > 1 ? "Multiple compounds" : data[element][0].replace(/\<\/?su[bp]\>/g, ""); + document.querySelector(`button[element='${element}']`)?.classList.add('tooltip'); + const span = document.createElement('span'); + span.classList.add('tooltiptext'); + span.innerHTML = data[element].join("
"); + document.querySelector(`button[element='${element}']`)?.appendChild(span); + } + } +}); \ No newline at end of file diff --git a/mods/chemFormulas.json b/mods/chemFormulas.json new file mode 100644 index 00000000..74aab89c --- /dev/null +++ b/mods/chemFormulas.json @@ -0,0 +1,241 @@ +{ + "sand": ["SiO2"], + "dirt": ["Organic matter"], + "mud": ["H2O", "Organic matter"], + "wet_sand": ["SiO2", "H2O"], + "rock": ["SiO2"], + "rock_wall": ["SiO2"], + "mudstone": ["SiO2", "H2O", "Organic matter"], + "packed_sand": ["SiO2"], + "snow": ["H2O"], + "packed_snow": ["H2O"], + "gravel": ["SiO2"], + "clay": ["Al2Si2O5(OH)4", "H2O"], + "clay_soil": ["Al2Si2O5(OH)4", "H2O", "Organic matter"], + "permafrost": ["Organic matter", "SiO2", "H2O"], + "mycelium": ["Organic matter"], + "mulch": ["Organic matter"], + "basalt": ["SiO2", "FeO", "CaO"], + "tuff": ["SiO2", "Al2O3", "CaO", "K2O"], + "limestone": ["CaCO3"], + "quicklime": ["CaO"], + "slaked_lime": ["Ca(OH)2"], + "water": ["H2O"], + "salt_water": ["H2O", "NaCl"], + "sugar_water": ["H2O", "C12H22O11"], + "seltzer": ["H2O", "CO2"], + "dirty_water": ["H2O", "Impurities"], + "pool_water": ["H2O", "Cl2"], + "slush": ["H2O"], + "magma": ["SiO2", "FeO", "CaO"], + "slime": ["H2O", "Organic matter"], + "cement": ["CaO", "SiO2", "Al2O3"], + "oil": ["C5H12", "C6H14", "C7H16", "C8H18", "C9H20", "C10H22", "C11H24", "C12H26"], + "lamp_oil": ["C12H26", "C13H28", "C14H30", "C15H32", "C16H34"], + "acid": ["HCl"], + "neutral_acid": ["H2O", "HCl"], + "glue": ["C4H6O2"], + "soda": ["H2O", "C6H12O6", "CO2"], + "melted_wax": ["C25H52"], + "vinegar": ["H2O", "C2H4O2"], + "alcohol": ["C2H5OH"], + "soap": ["C17H35COONa"], + "bleach": ["NaClO"], + "mercury": ["Hg"], + "tea": ["H2O", "C8H10N4O2"], + "coffee": ["H2O", "C8H10N4O2"], + "honey": ["C12H22O11"], + "sap": ["C12H22O11"], + "caramel": ["C12H22O11"], + "molasses": ["C12H22O11"], + "liquid_oxygen": ["O2"], + "liquid_nitrogen": ["N2"], + "cyanide": ["CN"], + "concrete": ["CaO", "SiO2", "Al2O3"], + "ash": ["SiO2", "CaO", "K2O"], + "charcoal": ["C"], + "hail": ["H2O"], + "wax": ["C25H52"], + "sodium": ["Na"], + "calcium": ["Ca"], + "potassium": ["K"], + "magnesium": ["Mg"], + "thermite": ["Al", "Fe2O3"], + "slag": ["CaSiO3"], + "amalgam": ["Hg", "Ag"], + "sulfur": ["S"], + "copper_sulfate": ["CuSO4"], + "uranium": ["U"], + "diamond": ["C"], + "gold coin": ["Au"], + "rust": ["Fe2O3"], + "oxidized_copper": ["CuO"], + "alga": ["AlGa"], + "glass_shard": ["SiO2"], + "rad_shard": ["SiO2", "U"], + "color_sand": ["SiO2", "Fe2O3"], + "borax": ["Na2B4O7"], + "epsom_salt": ["MgSO4"], + "potassium_salt": ["KCl"], + "caustic_potash": ["KOH"], + "sodium_acetate": ["NaC2H3O2"], + "ice": ["H2O"], + "rime": ["H2O"], + "glass": ["SiO2"], + "rad_glass": ["SiO2", "U"], + "stained_glass": ["SiO2", "Metal oxides"], + "plastic": ["(C8H8)n", "(C4H6)n", "(C3H3N)n"], + "iron": ["Fe"], + "copper": ["Cu"], + "gold": ["Au"], + "steel": ["Fe", "C"], + "galvanized_steel": ["Fe", "Zn"], + "zinc": ["Zn"], + "silver": ["Ag"], + "tin": ["Sn"], + "lead": ["Pb"], + "nickel": ["Ni"], + "aluminum": ["Al"], + "tungsten": ["W"], + "brass": ["Cu", "Zn"], + "bronze": ["Cu", "Sn"], + "sterling": ["Ag", "Cu"], + "gallium": ["Ga"], + "rose_gold": ["Au", "Cu"], + "purple_gold": ["Au", "Al"], + "blue_gold": ["Au", "Ga"], + "electrum": ["Au", "Ag"], + "pyrite": ["FeS2"], + "solder": ["Sn", "Pb"], + "dry ice": ["CO2"], + "nitrogen_ice": ["N2"], + "light": ["γ"], + "liquid_light": ["γ"], + "laser": ["γ"], + "radiation": ["α", "β", "γ"], + "neutron": ["n"], + "proton": ["p"], + "electric": ["e-"], + "lightning": ["e-"], + "positron": ["e+"], + "flash": ["γ"], + "tnt": ["C7H5N3O6"], + "c4": ["C3H6N6O6"], + "dynamite": ["C3H5N3O9"], + "gunpowder": ["KNO3", "S", "C"], + "nitro": ["C3H5N3O9"], + "steam": ["H2O"], + "hydrogen": ["H2"], + "oxygen": ["O2"], + "nitrogen": ["N2"], + "helium": ["He"], + "anesthesia": ["N2O"], + "carbon_dioxide": ["CO2"], + "bubble": ["CO2"], + "ammonia": ["NH3"], + "propane": ["C3H8"], + "methane": ["CH4"], + "acid_gas": ["HCl"], + "dioxin": ["C4H4O2"], + "chlorine": ["Cl2"], + "neon": ["Ne"], + "smog": ["CO2", "CO", "NO2", "O3"], + "cyanide_gas": ["HCN"], + "ozone": ["O3"], + "rad_steam": ["H2O", "U"], + "salt": ["NaCl"], + "sugar": ["C12H22O11"], + "chocolate": ["C12H22O11", "C7H8N4O2", "C8H10N4O2", "C18H36O2", "C16H32O2"], + "baking_soda": ["NaHCO3"], + "antipowder": ["Ry2O3"], + "antimolten": ["Ry2O3"], + "antiice": ["Ry7O12"], + "antifluid": ["Ry7O12"], + "antigas": ["Ry7O12"], + "molten_glass": ["SiO2"], + "molten_rad_glass": ["SiO2", "U"], + "molten_salt": ["NaCl"], + "molten_ash": ["SiO2", "CaO", "K2O"], + "liquid_ammonia": ["NH3"], + "liquid_propane": ["C3H8"], + "liquid_methane": ["CH4"], + "molten_stained_glass": ["SiO2", "Metal oxides"], + "molten_plastic": ["(C8H8)n", "(C4H6)n", "(C3H3N)n"], + "molten_tungsten": ["W"], + "molten_gallium": ["Ga"], + "gallium_gas": ["Ga"], + "molten_copper": ["Cu"], + "molten_copper_sulfate": ["CuSO4"], + "molten_gold": ["Au"], + "molten_silver": ["Ag"], + "molten_iron": ["Fe"], + "molten_nickel": ["Ni"], + "molten_tin": ["Sn"], + "molent_lead": ["Pb"], + "molten_solder": ["Sn", "Pb"], + "alcohol_gas": ["C2H5OH"], + "molten_tuff": ["SiO2", "Al2O3", "CaO", "K2O"], + "liquid_chlorine": ["Cl2"], + "mercury_gas": ["Hg"], + "solid_mercury": ["Hg"], + "fat": ["C55H98O6"], + "molten_chocolate": ["C12H22O11", "C7H8N4O2", "C8H10N4O2", "C18H36O2", "C16H32O2"], + "liquid_hydrogen": ["H2"], + "liquid_helium": ["He"], + "molten_sodium": ["Na"], + "sodium_gas": ["Na"], + "molten_calcium": ["Ca"], + "molten_potassium": ["K"], + "potassium_gas": ["K"], + "molten_magnesium": ["Mg"], + "molten_thermite": ["Al", "Fe2O3"], + "molten_aluminum": ["Al"], + "molten_zinc": ["Zn"], + "liquid_neon": ["Ne"], + "liquid_ozone": ["O3"], + "molten_sulfur": ["S"], + "sulfur_gas": ["S"], + "molten_uranium": ["U"], + "molten_slag": ["CaSiO3"], + "molten_dirt": ["Organic matter"], + "salt_ice": ["NaCl", "H2O"], + "sugar_ice": ["C12H22O11", "H2O"], + "seltzer_ice": ["H2O", "CO2"], + "dirty_ice": ["H2O", "Impurities"], + "pool_ice": ["H2O", "Cl2"], + "antiice_ice": ["Ry2O"], + "ammonia_ice": ["NH3"], + "propane_ice": ["C3H8"], + "methane_ice": ["CH4"], + "acid_ice": ["HCl"], + "soda_ice": ["H2O", "C6H12O6", "CO2"], + "molten_steel": ["Fe", "C"], + "molten_galvanized_steel": ["Fe", "Zn"], + "molten_brass": ["Cu", "Zn"], + "molten_bronze": ["Cu", "Sn"], + "molten_sterling": ["Ag", "Cu"], + "molten_rose_gold": ["Au", "Cu"], + "molten_purple_gold": ["Au", "Al"], + "molten_blue_gold": ["Au", "Ga"], + "molten_electrum": ["Au", "Ag"], + "molten_pyrite": ["FeS2"], + "frozen_vinegar": ["H2O", "C2H4O2"], + "alcohol_ice": ["C2H5OH"], + "bleach_ice": ["NaClO"], + "chlorine_ice": ["Cl2"], + "tea_ice": ["H2O", "C8H10N4O2"], + "coffee_ice": ["H2O", "C8H10N4O2"], + "hydrogen_ice": ["H2"], + "oxygen_ice": ["O2"], + "molten_amalgam": ["Hg", "Ag"], + "neon_ice": ["Ne"], + "cyanide_ice": ["CN"], + "slime_ice": ["H2O", "Organic matter"], + "molten_alga": ["AlGa"], + "molten_borax": ["Na2B4O7"], + "molten_epsom_salt": ["MgSO4"], + "molten_potassium_salt": ["KCl"], + "molten_caustic_potash": ["KOH"], + "molten_sodium_acetate": ["NaC2H3O2"], + "frozen_nitro": ["C3H5N3O9"] +} From 80e3af2acca74fa34ca6ae8577da0d4b45b72fbb Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Sat, 5 Oct 2024 18:54:04 -0400 Subject: [PATCH 03/28] Update betterStats.js --- mods/betterStats.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/betterStats.js b/mods/betterStats.js index 3c043b10..2cb49bdb 100644 --- a/mods/betterStats.js +++ b/mods/betterStats.js @@ -26,7 +26,7 @@ function updateStatsNew() { if (pixelMap[mousePos.x] != undefined) { var currentPixel = pixelMap[mousePos.x][mousePos.y]; if (currentPixel != undefined) { - stats += "Elem:" + (elements[currentPixel.element].name || currentPixel.element).toUpperCase() + ""; + stats += "Elem:" + (elements[currentPixel.element].name || currentPixel.element).toString().toUpperCase() + ""; stats += "Temp:" + formatTemp(currentPixel.temp) + ""; if (currentPixel.charge) { stats += "C" + currentPixel.charge + ""; @@ -49,7 +49,7 @@ function updateStatsNew() { } // If the view is not null, show the view in all caps if (view != null) { - stats += "" + viewKey[view].toUpperCase() + ""; + stats += "" + viewKey[view].toString().toUpperCase() + ""; } statsDiv.innerHTML = stats; } From 3a4d719f23983143693cdcd1a730225336e7c3e2 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Sat, 5 Oct 2024 19:05:32 -0400 Subject: [PATCH 04/28] hotfix --- index.html | 11 +++++++---- mods/souls.js | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index b7417e35..5f5f9386 100644 --- a/index.html +++ b/index.html @@ -3251,13 +3251,14 @@ DO_TICK: function(pixel) { onPlace: function(pixel) { if (isEmpty(pixel.x, pixel.y+1)) { createPixel("body", pixel.x, pixel.y+1); - pixel.element = "head"; + var color = pixel.color; + changePixel(pixel,"head"); + pixel.color = color; } else if (isEmpty(pixel.x, pixel.y-1)) { createPixel("head", pixel.x, pixel.y-1); pixelMap[pixel.x][pixel.y-1].color = pixel.color; - pixel.element = "body"; - pixel.color = pixelColorPick(pixel) + changePixel(pixel,"body"); } else { deletePixel(pixel.x, pixel.y); @@ -12749,7 +12750,9 @@ if (langCode) { } delete pixel.origColor; // remove stain delete pixel.clone; - delete pixel.glow; + if (pixel.glow !== undefined) { + delete pixel.glow; + } if (pixel.r && !elementInfo.rotatable) { delete pixel.r; } diff --git a/mods/souls.js b/mods/souls.js index 1690cb9b..bebe40ea 100644 --- a/mods/souls.js +++ b/mods/souls.js @@ -47,6 +47,7 @@ elements.soul = { } else if (Math.random() < 0.01) { pixel.glow = false; + delete pixel.glow; } if (Math.random() < 0.0002 && isEmpty(pixel.x,pixel.y+1)) { createPixel("ectoplasm",pixel.x,pixel.y+1); From 528a036db044eed2743cb6a92604d306b7bcd74b Mon Sep 17 00:00:00 2001 From: Jayd-Rubies <155784127+Jayd-Rubies@users.noreply.github.com> Date: Sat, 5 Oct 2024 19:09:59 -0400 Subject: [PATCH 05/28] Update mod-list.html --- mod-list.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mod-list.html b/mod-list.html index 8394f817..a32861f9 100644 --- a/mod-list.html +++ b/mod-list.html @@ -340,6 +340,7 @@ Visual Effects acid_and_shapes.jsWeird visual effects. Enable in SettingsAlice +customBackground.jsSet your own background(using and image link)Jayd heatglow.jsRed glowing effect for hot metalsnousernamefound invisible_dye.jsAdds elements like Dye and Spray Paint that take the color of the backgroundAlice invisible_wall.jsAdds an element like Wall that takes the color of the backgroundAlice @@ -351,6 +352,9 @@ shader_by_jayd.jsAdds a glow around light elementsJayd Shroomboxels.jsA variant of acid_and_shapes.js that uses a different trigonometric functionAlice singleColor.jsMakes all elements pick one color each time they're drawnstefanblox +texture_pack_by_jayd.jsGives sandboxels a cool backgroundJayd +UwUify.jsGives sandboxels an "UwU" backgroundJayd + Compilations a_mod_by_alice.jsA mod combining most of Alice’s mods, and some other thingsAlice From 39daafbf9d68ed57e6a31305ba356d958e4e8efe Mon Sep 17 00:00:00 2001 From: Salmonfishyy <160120816+Salmonfishyy@users.noreply.github.com> Date: Sun, 6 Oct 2024 20:30:47 +0700 Subject: [PATCH 06/28] =?UTF-8?q?1.10.1=20Halloween=20Update=20Translation?= =?UTF-8?q?=20(H=CC=B5=CD=92=CD=8A=CC=9A=CC=87=CD=82=CD=84=CC=84=CD=8C?= =?UTF-8?q?=CC=91=CC=8F=CD=81=CC=9B=CC=9A=CC=9A=CD=97=CC=BE=CD=80=CC=82?= =?UTF-8?q?=CD=81=CC=89=CC=88=CD=84=CC=90=CC=84=CD=91=CD=91=CC=8B=CC=8A?= =?UTF-8?q?=CC=86=CC=88=CD=91=CC=87=CD=8B=CD=9D=CC=9B=CD=9B=CC=8A=CD=82?= =?UTF-8?q?=CC=BE=CD=81=CC=8F=CC=8C=CD=83=CD=9D=CC=86=CC=BF=CD=9D=CD=82?= =?UTF-8?q?=CC=80=CC=95=CD=91=CD=83=CD=A0=CC=85=CC=8E=CC=81=CD=80=CC=82?= =?UTF-8?q?=CD=84=CD=8B=CD=84=CC=81=CC=8A=CC=92=CD=83=CD=84=CC=84=CC=92?= =?UTF-8?q?=CD=8B=CD=83=CD=A0=CC=80=CC=95=CC=BD=CC=8B=CD=9D=CC=82=CC=9A?= =?UTF-8?q?=CD=98=CC=92=CD=98=CD=97=CD=A0=CC=80=CC=83=CD=97=CC=8D=CD=86?= =?UTF-8?q?=CC=85=CC=94=CC=85=CC=BF=CC=95=CD=91=CC=81=CC=89=CC=BD=CC=80?= =?UTF-8?q?=CC=95=CD=84=CC=92=CC=84=CC=BE=CD=9D=CD=98=CC=85=CD=81=CD=8C?= =?UTF-8?q?=CD=98=CD=92=CC=95=CC=90=CD=9B=CD=86=CD=81=CC=9A=CC=8D=CC=8D?= =?UTF-8?q?=CC=8B=CD=98=CD=8C=CC=90=CC=83=CC=BF=CD=9B=CC=8D=CD=97=CC=91?= =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CD=84=CD=86=CC=9B=CC=95=CC=95?= =?UTF-8?q?=CD=80=CC=87=CC=9A=CD=9D=CC=8E=CD=9B=CD=8A=CD=8B=CD=90=CD=90?= =?UTF-8?q?=CC=83=CC=8B=CC=84=CD=8C=CD=86=CD=A0=CC=86=CD=98=CD=8B=CD=9D?= =?UTF-8?q?=CC=83=CD=92=CC=83=CC=88=CD=92=CC=8D=CD=90=CC=8F=CC=8C=CC=8C?= =?UTF-8?q?=CD=86=CC=85=CD=8A=CC=8D=CC=86=CD=83=CC=8D=CC=87=CD=97=CD=82?= =?UTF-8?q?=CC=8B=CC=92=CD=8B=CD=84=CC=82=CC=83=CC=9A=CC=90=CC=88=CC=94?= =?UTF-8?q?=CC=8F=CD=8A=CC=8A=CD=84=CC=83=CC=8A=CC=89=CC=8C=CD=8B=CD=98?= =?UTF-8?q?=CC=8B=CC=94=CD=84=CC=95=CC=8F=CD=82=CC=8C=CD=83=CD=84=CC=81?= =?UTF-8?q?=CC=82=CC=BD=CD=81=CC=8B=CC=8E=CD=9D=CD=9D=CC=80=CC=85=CC=BF?= =?UTF-8?q?=CD=80=CD=92=CD=9D=CC=9B=CD=98=CC=85=CC=81=CC=93=CC=BD=CC=94?= =?UTF-8?q?=CC=86=CD=8A=CC=9B=CD=97=CD=83=CC=92=CC=BD=CC=88=CD=92=CC=86?= =?UTF-8?q?=CD=80=CC=80=CD=80=CC=90=CC=8D=CC=82=CD=A0=CC=94=CD=9D=CD=82?= =?UTF-8?q?=CC=87=CD=84=CC=8E=CC=9B=CC=9F=CD=94=CC=98=CC=AD=CD=88=CC=A7?= =?UTF-8?q?=CD=94=CC=97=CC=9C=CD=88=CD=8E=CC=A8=CC=B2=CD=95=CC=BA=CC=9F?= =?UTF-8?q?=CC=9C=CD=87=CC=A3=CC=BC=CC=96=CC=96=CD=96=CC=99=CC=A4=CC=96?= =?UTF-8?q?=CC=A2=CD=96=CD=9AP=CC=B7=CC=BF=CC=92=CC=84=CC=8D=CC=9A=CD=97?=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=?UTF-8?q?=CC=AF=CC=B0=CD=89=CC=A6=CC=B1=CC=A0=CC=98=CC=96=CC=A5=CC=BB?= =?UTF-8?q?=CC=A0=CC=A1=CD=88=CC=9C=CC=BCe=CC=B7=CD=81=CD=91=CD=91=CC=92?= =?UTF-8?q?=CC=8A=CD=A0=CC=84=CC=88=CD=9D=CC=8F=CD=8B=CD=80=CC=9A=CD=90?= =?UTF-8?q?=CC=83=CD=8C=CD=86=CC=8F=CD=80=CC=8D=CC=9B=CC=BD=CC=9B=CC=91?= =?UTF-8?q?=CC=8B=CD=84=CD=84=CD=86=CC=83=CC=93=CC=81=CD=81=CC=8B=CD=81?= =?UTF-8?q?=CC=80=CC=82=CC=90=CD=8A=CD=90=CD=83=CC=BE=CC=BF=CC=92=CC=88?= =?UTF-8?q?=CC=8D=CC=89=CC=8B=CD=84=CC=BD=CC=8C=CC=91=CC=93=CC=BD=CD=92?= =?UTF-8?q?=CD=84=CC=89=CC=93=CD=84=CD=84=CC=8E=CC=8C=CC=93=CC=BD=CC=87?= =?UTF-8?q?=CC=85=CD=8B=CD=98=CC=91=CC=91=CC=82=CC=86=CD=8C=CC=85=CD=82?= =?UTF-8?q?=CD=81=CD=80=CD=A0=CC=BF=CD=86=CD=84=CC=80=CD=80=CD=84=CD=A0?= =?UTF-8?q?=CC=8E=CC=8C=CD=91=CC=95=CC=9B=CC=8A=CD=83=CD=82=CD=8A=CD=A0?= =?UTF-8?q?=CD=81=CC=BE=CC=93=CC=89=CD=8C=CD=98=CC=91=CD=98=CD=80=CD=84?= =?UTF-8?q?=CD=83=CD=8C=CC=92=CD=97=CC=87=CD=86=CC=9A=CD=91=CD=9D=CD=84?= =?UTF-8?q?=CD=9D=CD=84=CC=9B=CD=8C=CD=9D=CC=BF=CD=8A=CC=80=CD=9D=CD=86?= =?UTF-8?q?=CC=90=CC=89=CC=93=CC=8E=CD=80=CD=81=CD=97=CD=82=CC=8E=CC=95?= =?UTF-8?q?=CD=9D=CC=95=CC=8C=CC=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9C=CC=A4=CC=99=CC=BA=CD=87=CD=96=CC=B9=CC=A6=CC=A7=CC=99?= =?UTF-8?q?=CC=B0=CC=AA=CC=98=CC=B9=CC=B2=CC=AA=CC=AA=CC=98=CC=AB=CC=9F?= =?UTF-8?q?=CC=A7=CC=96=CC=A1=CC=AE=CC=99=CC=AD=CC=A4=CC=98=CD=89=CC=9F?= =?UTF-8?q?=CC=B0=CC=AC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/vi.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lang/vi.json b/lang/vi.json index 4b1cf5d6..541fee53 100644 --- a/lang/vi.json +++ b/lang/vi.json @@ -549,5 +549,10 @@ "galvanized_steel": "Thép mạ kẽm", "rice": "Gạo", "midas_touch": "Bàn tay của Midas", -"liquid_ozone": "Ozone lỏng" +"liquid_ozone": "Ozone lỏng", +"web": "Tơ Nhện", +"soul": "Linh hồn", +"spider": "Nhện", +"ectoplasm": "Ngoại chất", +"tombstone": "Bia mộ" } From 8a09621e39f5916b89b8ccf8c070a963ac2edccc Mon Sep 17 00:00:00 2001 From: Salmonfishyy <160120816+Salmonfishyy@users.noreply.github.com> Date: Sun, 6 Oct 2024 20:57:53 +0700 Subject: [PATCH 07/28] 1.10.1 France Halloween Update (Lutti Arlequin) --- lang/fr.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lang/fr.json b/lang/fr.json index 835ae068..c1219216 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -548,5 +548,10 @@ "galvanized_steel": "Acier galvanisé", "rice": "Le riz", "midas_touch": "Touche de Midas", -"liquid_ozone": "Ozone liquide" +"liquid_ozone": "Ozone liquide", +"web": "Toile", +"soul": "Âme", +"spider": "Araignée", +"ectoplasm": "Ectoplasme", +"tombstone": "Pierre tombale" } From 5b9f2610224100a5a51c78e0fedf53c4e2f5317d Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Tue, 8 Oct 2024 10:11:02 -0700 Subject: [PATCH 08/28] Color --- mods/genetics.js | 71 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/mods/genetics.js b/mods/genetics.js index a6d633cd..dc2d8257 100644 --- a/mods/genetics.js +++ b/mods/genetics.js @@ -9,6 +9,77 @@ elements.organism = { age: 0 }, tick: function(pixel) { + if (pixel.vore === 0) { + if (Math.random() > 0.2) { + pixel.color = "#997457" + } + else if (Math.random() > 0.2) { + pixel.color = "#c4b270" + } + else if (Math.random() > 0.2) { + pixel.color = "#9c916a" + } + else if (Math.random() > 0.2) { + pixel.color = "#9e8955" + } + else { + pixel.color = "#a89a76" + } + } + else if (pixel.vore === 1) { + pixel.color = "#9E6954" + } + else if (pixel.vore === 2) { + pixel.color = "#A25F50" + } + else if (pixel.vore === 3) { + pixel.color = "#A7544D" + } + else if (pixel.vore === 4) { + pixel.color = "#A7544D" + } + else if (pixel.vore === 5) { + pixel.color = "#AC4A4A" + } + else if (pixel.vore === 6) { + pixel.color = "#B03F47" + } + else if (pixel.vore === 7) { + pixel.color = "#B53543" + } + else if (pixel.vore === 8) { + pixel.color = "#B92A40" + } + else if (pixel.vore > 8) { + pixel.color = "#BE203D" + } + else if (pixel.vore === -1) { + pixel.color = "#8B7C4F" + } + else if (pixel.vore === -2) { + pixel.color = "#7D8447" + } + else if (pixel.vore === -3) { + pixel.color = "#6F8C3F" + } + else if (pixel.vore === -4) { + pixel.color = "#619437" + } + else if (pixel.vore === -5) { + pixel.color = "#539C2F" + } + else if (pixel.vore === -6) { + pixel.color = "#46A428" + } + else if (pixel.vore === -7) { + pixel.color = "#38AC20" + } + else if (pixel.vore === -8) { + pixel.color = "#2AB418" + } + else if (pixel.vore < -8) { + pixel.color = "#1CBC10" + } if (pixel.geneticCode < 11) { if (isEmpty(pixel.x, pixel.y+1)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); From fe310a09a0e1fb1d6b8b7a3bbd3b2ffced91fb3f Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:51:29 -0400 Subject: [PATCH 09/28] Update mod-list.html --- mod-list.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mod-list.html b/mod-list.html index a32861f9..c36d8f69 100644 --- a/mod-list.html +++ b/mod-list.html @@ -340,7 +340,7 @@ Visual Effects acid_and_shapes.jsWeird visual effects. Enable in SettingsAlice -customBackground.jsSet your own background(using and image link)Jayd +customBackground.jsSet your background to an image linkJayd heatglow.jsRed glowing effect for hot metalsnousernamefound invisible_dye.jsAdds elements like Dye and Spray Paint that take the color of the backgroundAlice invisible_wall.jsAdds an element like Wall that takes the color of the backgroundAlice @@ -352,8 +352,8 @@ shader_by_jayd.jsAdds a glow around light elementsJayd Shroomboxels.jsA variant of acid_and_shapes.js that uses a different trigonometric functionAlice singleColor.jsMakes all elements pick one color each time they're drawnstefanblox -texture_pack_by_jayd.jsGives sandboxels a cool backgroundJayd -UwUify.jsGives sandboxels an "UwU" backgroundJayd +texture_pack_by_jayd.jsAdds a cool backgroundJayd +UwUify.jsAdds an "UwU" backgroundJayd Compilations From a2195e66bf9c17940f166385904f30b7ece25371 Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:37:16 -0700 Subject: [PATCH 10/28] color bugfix --- mods/genetics.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mods/genetics.js b/mods/genetics.js index dc2d8257..fab89c27 100644 --- a/mods/genetics.js +++ b/mods/genetics.js @@ -4,22 +4,24 @@ elements.organism = { color: ["#997457","#c4b270","#9c916a","#9e8955","#a89a76"], properties: { geneticCode: 0, + oldvore: 0, vore: 0, food: 0, age: 0 }, tick: function(pixel) { + if (pixel.vore != pixel.oldvore) { if (pixel.vore === 0) { - if (Math.random() > 0.2) { + if (Math.random() > 0.5) { pixel.color = "#997457" } - else if (Math.random() > 0.2) { + else if (Math.random() > 0.5) { pixel.color = "#c4b270" } - else if (Math.random() > 0.2) { + else if (Math.random() > 0.5) { pixel.color = "#9c916a" } - else if (Math.random() > 0.2) { + else if (Math.random() > 0.5) { pixel.color = "#9e8955" } else { @@ -80,6 +82,8 @@ elements.organism = { else if (pixel.vore < -8) { pixel.color = "#1CBC10" } + pixel.oldvore = pixel.vore + } if (pixel.geneticCode < 11) { if (isEmpty(pixel.x, pixel.y+1)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); From 4537cc4d7d1f4c87db348eddfad18c4a103ee70f Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:45:54 -0700 Subject: [PATCH 11/28] Update genetics.js --- mods/genetics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/genetics.js b/mods/genetics.js index fab89c27..ae95fc73 100644 --- a/mods/genetics.js +++ b/mods/genetics.js @@ -82,7 +82,6 @@ elements.organism = { else if (pixel.vore < -8) { pixel.color = "#1CBC10" } - pixel.oldvore = pixel.vore } if (pixel.geneticCode < 11) { if (isEmpty(pixel.x, pixel.y+1)) { @@ -1101,6 +1100,7 @@ elements.organism = { } pixel.age += 1 } + pixel.oldvore = pixel.vore }, tempHigh: 150, stateHigh: "cooked_meat", From a63f0de0839e28bc96998da478c069e1070de856 Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Tue, 8 Oct 2024 17:34:14 -0700 Subject: [PATCH 12/28] HUGE GENETICS OVERHAUL --- mods/genetics.js | 1854 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 1737 insertions(+), 117 deletions(-) diff --git a/mods/genetics.js b/mods/genetics.js index ae95fc73..55e46e69 100644 --- a/mods/genetics.js +++ b/mods/genetics.js @@ -1,88 +1,176 @@ /* by nekonico, do not steal!!!!!! >:3*/ elements.organism = { - color: ["#997457","#c4b270","#9c916a","#9e8955","#a89a76"], + color: ["#997457","#a89a76"], properties: { geneticCode: 0, oldvore: 0, vore: 0, food: 0, - age: 0 + age: 0, + dead: false }, tick: function(pixel) { if (pixel.vore != pixel.oldvore) { if (pixel.vore === 0) { if (Math.random() > 0.5) { - pixel.color = "#997457" - } - else if (Math.random() > 0.5) { - pixel.color = "#c4b270" - } - else if (Math.random() > 0.5) { - pixel.color = "#9c916a" - } - else if (Math.random() > 0.5) { - pixel.color = "#9e8955" + pixel.color = "#997457" } else { - pixel.color = "#a89a76" + pixel.color = "#a89a76" } } else if (pixel.vore === 1) { - pixel.color = "#9E6954" + if (Math.random() > 0.5) { + pixel.color = "#9E6954" + } + else { + pixel.color = "#AB8C6B" + } } else if (pixel.vore === 2) { - pixel.color = "#A25F50" + if (Math.random() > 0.5) { + pixel.color = "#A25F50" + } + else { + pixel.color = "#AF7E61" + } } else if (pixel.vore === 3) { - pixel.color = "#A7544D" + if (Math.random() > 0.5) { + pixel.color = "#A7544D" + } + else { + pixel.color = "#B27056" + } } else if (pixel.vore === 4) { - pixel.color = "#A7544D" + if (Math.random() > 0.5) { + pixel.color = "#A7544D" + } + else { + pixel.color = "#B5624B" + } } else if (pixel.vore === 5) { - pixel.color = "#AC4A4A" + if (Math.random() > 0.5) { + pixel.color = "#AC4A4A" + } + else { + pixel.color = "#B85440" + } } else if (pixel.vore === 6) { - pixel.color = "#B03F47" + if (Math.random() > 0.5) { + pixel.color = "#B03F47" + } + else { + pixel.color = "#BC4636" + } } else if (pixel.vore === 7) { - pixel.color = "#B53543" + if (Math.random() > 0.5) { + pixel.color = "#B53543" + } + else { + pixel.color = "#BF382B" + } } else if (pixel.vore === 8) { - pixel.color = "#B92A40" + if (Math.random() > 0.5) { + pixel.color = "#B92A40" + } + else { + pixel.color = "#C22A20" + } } else if (pixel.vore > 8) { - pixel.color = "#BE203D" + if (Math.random() > 0.5) { + pixel.color = "#BE203D" + } + else { + pixel.color = "#C51C15" + } } else if (pixel.vore === -1) { - pixel.color = "#8B7C4F" + if (Math.random() > 0.5) { + pixel.color = "#8B7C4F" + } + else { + pixel.color = "#9D9A6B" + } } else if (pixel.vore === -2) { - pixel.color = "#7D8447" + if (Math.random() > 0.5) { + pixel.color = "#7D8447" + } + else { + pixel.color = "#939A61" + } } else if (pixel.vore === -3) { - pixel.color = "#6F8C3F" + if (Math.random() > 0.5) { + pixel.color = "#6F8C3F" + } + else { + pixel.color = "#889A56" + } } else if (pixel.vore === -4) { - pixel.color = "#619437" + if (Math.random() > 0.5) { + pixel.color = "#619437" + } + else { + pixel.color = "#7D9A4B" + } } else if (pixel.vore === -5) { - pixel.color = "#539C2F" + if (Math.random() > 0.5) { + pixel.color = "#539C2F" + } + else { + pixel.color = "#739A40" + } } else if (pixel.vore === -6) { - pixel.color = "#46A428" + if (Math.random() > 0.5) { + pixel.color = "#46A428" + } + else { + pixel.color = "#689936" + } } else if (pixel.vore === -7) { - pixel.color = "#38AC20" + if (Math.random() > 0.5) { + pixel.color = "#38AC20" + } + else { + pixel.color = "#5E992B" + } } else if (pixel.vore === -8) { - pixel.color = "#2AB418" + if (Math.random() > 0.5) { + pixel.color = "#2AB418" + } + else { + pixel.color = "#539920" + } } else if (pixel.vore < -8) { - pixel.color = "#1CBC10" + if (Math.random() > 0.5) { + pixel.color = "#1CBC10" + } + else { + pixel.color = "#489915" + } } } + if (pixel.food > 0 && Math.random() > 0.99) { + pixel.food -= 1; + } + else if (pixel.food < 1 && pixel.age > 1000 && Math.random() > 0.99) { + pixel.dead = true; + } if (pixel.geneticCode < 11) { if (isEmpty(pixel.x, pixel.y+1)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); @@ -135,7 +223,7 @@ elements.organism = { pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode; } } - if (pixel.age > 2000) { + if (pixel.age > 10000 || pixel.dead === true) { if (Math.random() > 0.3) { changePixel(pixel,"sugar"); } @@ -210,9 +298,17 @@ elements.organism = { pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode; } } - if (pixel.age > 2000) { + if (pixel.age > 10000 || pixel.dead === true) { if (Math.random() > 0.3) { - changePixel(pixel,"meat"); + if (pixel.vore > 0) { + changePixel(pixel,"meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"grass"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } } else if (Math.random() > 0.5) { changePixel(pixel,"sugar"); @@ -230,23 +326,23 @@ elements.organism = { else if (Math.random() > 0.99 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } - if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { - deletePixel(pixel.x, pixel.y-1); - pixel.food += 1 - } - if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") { - deletePixel(pixel.x, pixel.y+1); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") { - deletePixel(pixel.x+1, pixel.y); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") { - deletePixel(pixel.x-1, pixel.y); - pixel.food += 1 - } if (pixel.vore === 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -382,9 +478,17 @@ elements.organism = { pixelMap[pixel.x-1][pixel.y].vore = pixel.vore; } } - if (pixel.age > 2000) { + if (pixel.age > 10000 || pixel.dead === true) { if (Math.random() > 0.3) { - changePixel(pixel,"meat"); + if (pixel.vore > 0) { + changePixel(pixel,"meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"grass"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } } else if (Math.random() > 0.5) { changePixel(pixel,"sugar"); @@ -403,6 +507,22 @@ elements.organism = { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } if (pixel.vore === 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -538,12 +658,28 @@ elements.organism = { pixelMap[pixel.x-1][pixel.y].vore = pixel.vore; } } - if (pixel.age > 2000) { + if (pixel.age > 10000 || pixel.dead === true) { if (Math.random() > 0.3) { - changePixel(pixel,"rotten_meat"); + if (pixel.vore > 0) { + changePixel(pixel,"rotten_meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"dead_plant"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } } else if (Math.random() > 0.5) { - changePixel(pixel,"meat"); + if (pixel.vore > 0) { + changePixel(pixel,"meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"grass"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } } } pixel.age += 1 @@ -559,6 +695,22 @@ elements.organism = { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } if (pixel.vore === 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -607,19 +759,19 @@ elements.organism = { deletePixel(pixel.x-1, pixel.y); pixel.food += 1 } - if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") { deletePixel(pixel.x, pixel.y+1); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") { deletePixel(pixel.x+1, pixel.y); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") { deletePixel(pixel.x-1, pixel.y); pixel.food += 1 } @@ -675,35 +827,19 @@ elements.organism = { deletePixel(pixel.x-1, pixel.y); pixel.food += 1 } - if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") { deletePixel(pixel.x, pixel.y+1); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") { deletePixel(pixel.x+1, pixel.y); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") { - deletePixel(pixel.x-1, pixel.y); - pixel.food += 1 - } - if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") { - deletePixel(pixel.x, pixel.y-1); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") { - deletePixel(pixel.x, pixel.y+1); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") { - deletePixel(pixel.x+1, pixel.y); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") { deletePixel(pixel.x-1, pixel.y); pixel.food += 1 } @@ -774,19 +910,35 @@ elements.organism = { pixelMap[pixel.x-1][pixel.y].vore = pixel.vore; } } - if (pixel.age > 2000) { + if (pixel.age > 10000 || pixel.dead === true) { if (Math.random() > 0.3) { - changePixel(pixel,"rotten_meat"); + if (pixel.vore > 0) { + changePixel(pixel,"rotten_meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"dead_plant"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } } else if (Math.random() > 0.5) { - changePixel(pixel,"meat"); + if (pixel.vore > 0) { + changePixel(pixel,"meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"grass"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } } } pixel.age += 1 } - else if (pixel.geneticCode > 50) { + else if (pixel.geneticCode > 50 && pixel.geneticCode < 61) { if (isEmpty(pixel.x, pixel.y+1)) { - /* by nekonico, do not steal!!!!!! >:3*/ movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); + movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); } else if (Math.random() > 0.99 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); @@ -795,6 +947,22 @@ elements.organism = { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } if (pixel.vore === 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -843,19 +1011,19 @@ elements.organism = { deletePixel(pixel.x-1, pixel.y); pixel.food += 1 } - if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") { deletePixel(pixel.x, pixel.y+1); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") { deletePixel(pixel.x+1, pixel.y); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") { deletePixel(pixel.x-1, pixel.y); pixel.food += 1 } @@ -959,6 +1127,22 @@ elements.organism = { deletePixel(pixel.x-1, pixel.y); pixel.food += 1 } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -975,51 +1159,35 @@ elements.organism = { deletePixel(pixel.x-1, pixel.y); pixel.food += 1 } - if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "vine") { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "vine") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") { deletePixel(pixel.x, pixel.y+1); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "vine") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") { deletePixel(pixel.x+1, pixel.y); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "vine") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") { deletePixel(pixel.x-1, pixel.y); pixel.food += 1 } - if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "vine") { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "tree_branch") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "vine") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "tree_branch") { deletePixel(pixel.x, pixel.y+1); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "vine") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "tree_branch") { deletePixel(pixel.x+1, pixel.y); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "vine") { - deletePixel(pixel.x-1, pixel.y); - pixel.food += 1 - } - if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "algae") { - deletePixel(pixel.x, pixel.y-1); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "algae") { - deletePixel(pixel.x, pixel.y+1); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "algae") { - deletePixel(pixel.x+1, pixel.y); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "algae") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "tree_branch") { deletePixel(pixel.x-1, pixel.y); pixel.food += 1 } @@ -1090,22 +1258,1474 @@ elements.organism = { pixelMap[pixel.x-1][pixel.y].vore = pixel.vore; } } - if (pixel.age > 2000) { + if (pixel.age > 10000 || pixel.dead === true) { if (Math.random() > 0.3) { - changePixel(pixel,"rotten_meat"); + if (pixel.vore > 0) { + changePixel(pixel,"rotten_meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"dead_plant"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } } else if (Math.random() > 0.5) { - changePixel(pixel,"meat"); + if (pixel.vore > 0) { + changePixel(pixel,"meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"grass"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } + } + } + pixel.age += 1 + } + else if (pixel.geneticCode > 60 && pixel.geneticCode < 71) { + if (isEmpty(pixel.x, pixel.y+1)) { + /* by nekonico, do not steal!!!!!! >:3*/ movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); + } + else if (Math.random() > 0.99 && isEmpty(pixel.x-1, pixel.y)) { + movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); + } + else if (Math.random() > 0.99 && isEmpty(pixel.x+1, pixel.y)) { + movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); + } + if (pixel.vore === 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + } + else if (pixel.vore > 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fly") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fly") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fly") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fly") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "ant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "ant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "ant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "ant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "egg") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "egg") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "egg") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "egg") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + } + else if (pixel.vore < 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "tree_branch") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "tree_branch") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "tree_branch") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "tree_branch") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "wood") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "wood") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "wood") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "wood") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bamboo") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bamboo") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bamboo") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bamboo") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + } + if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) { + createPixel("organism", pixel.x, pixel.y-1); + pixel.food -= 5; + if (Math.random() > 0.8) { + pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode -= 1; + } + else { + pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode; + } + if (Math.random() > 0.8) { + pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1; + } + else { + pixelMap[pixel.x][pixel.y-1].vore = pixel.vore; + } + } + else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) { + createPixel("organism", pixel.x+1, pixel.y); + pixel.food -= 5; + if (Math.random() > 0.8) { + pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode -= 1; + } + else { + pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode; + } + if (Math.random() > 0.8) { + pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1; + } + else { + pixelMap[pixel.x+1][pixel.y].vore = pixel.vore; + } + } + else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) { + createPixel("organism", pixel.x-1, pixel.y); + pixel.food -= 5; + if (Math.random() > 0.8) { + pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode -= 1; + } + else { + pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode; + } + if (Math.random() > 0.8) { + pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1; + } + else { + pixelMap[pixel.x-1][pixel.y].vore = pixel.vore; + } + } + if (pixel.age > 10000 || pixel.dead === true) { + if (Math.random() > 0.3) { + if (pixel.vore > 0) { + changePixel(pixel,"rotten_meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"dead_plant"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } + } + else if (Math.random() > 0.5) { + if (pixel.vore > 0) { + changePixel(pixel,"meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"grass"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } + } + } + pixel.age += 1 + } + else if (pixel.geneticCode > 70 && pixel.geneticCode < 81) { + if (isEmpty(pixel.x, pixel.y+1)) { + movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); + } + else if (Math.random() > 0.99 && isEmpty(pixel.x-1, pixel.y)) { + movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); + } + else if (Math.random() > 0.99 && isEmpty(pixel.x+1, pixel.y)) { + movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); + } + if (pixel.vore === 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + } + else if (pixel.vore > 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fly") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fly") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fly") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fly") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "ant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "ant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "ant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "ant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "egg") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "egg") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "egg") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "egg") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bird") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bird") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bird") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bird") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fish") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fish") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fish") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fish") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + } + else if (pixel.vore < 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "tree_branch") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "tree_branch") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "tree_branch") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "tree_branch") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "wood") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "wood") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "wood") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "wood") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bamboo") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bamboo") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bamboo") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bamboo") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "vine") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "vine") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "vine") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "vine") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "cactus") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "cactus") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "cactus") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "cactus") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + } + if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) { + createPixel("organism", pixel.x, pixel.y-1); + pixel.food -= 5; + if (Math.random() > 0.8) { + pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode -= 1; + } + else { + pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode; + } + if (Math.random() > 0.8) { + pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1; + } + else { + pixelMap[pixel.x][pixel.y-1].vore = pixel.vore; + } + } + else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) { + createPixel("organism", pixel.x+1, pixel.y); + pixel.food -= 5; + if (Math.random() > 0.8) { + pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode -= 1; + } + else { + pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode; + } + if (Math.random() > 0.8) { + pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1; + } + else { + pixelMap[pixel.x+1][pixel.y].vore = pixel.vore; + } + } + else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) { + createPixel("organism", pixel.x-1, pixel.y); + pixel.food -= 5; + if (Math.random() > 0.8) { + pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode -= 1; + } + else { + pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode; + } + if (Math.random() > 0.8) { + pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1; + } + else { + pixelMap[pixel.x-1][pixel.y].vore = pixel.vore; + } + } + if (pixel.age > 10000 || pixel.dead === true) { + if (Math.random() > 0.3) { + if (pixel.vore > 0) { + changePixel(pixel,"rotten_meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"dead_plant"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } + } + else if (Math.random() > 0.5) { + if (pixel.vore > 0) { + changePixel(pixel,"meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"grass"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } + } + } + pixel.age += 1 + } + else if (pixel.geneticCode > 80) { + if (isEmpty(pixel.x, pixel.y+1)) { + movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); + } + else if (Math.random() > 0.99 && isEmpty(pixel.x-1, pixel.y)) { + movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); + } + else if (Math.random() > 0.99 && isEmpty(pixel.x+1, pixel.y)) { + movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); + } + if (pixel.vore === 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + } + else if (pixel.vore > 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fly") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fly") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fly") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fly") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "ant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "ant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "ant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "ant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "egg") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "egg") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "egg") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "egg") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bird") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bird") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bird") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bird") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fish") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fish") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fish") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fish") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "head") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "head") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "head") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "head") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "body") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "body") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "body") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "body") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + } + else if (pixel.vore < 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "tree_branch") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "tree_branch") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "tree_branch") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "tree_branch") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "wood") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "wood") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "wood") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "wood") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bamboo") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bamboo") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bamboo") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bamboo") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "vine") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "vine") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "vine") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "vine") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "cactus") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "cactus") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "cactus") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "cactus") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "petal") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "petal") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "petal") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "petal") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "pistil") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "pistil") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "pistil") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "pistil") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + } + if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) { + createPixel("organism", pixel.x, pixel.y-1); + pixel.food -= 5; + if (Math.random() > 0.8) { + pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode -= 1; + } + else { + pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode; + } + if (Math.random() > 0.8) { + pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1; + } + else { + pixelMap[pixel.x][pixel.y-1].vore = pixel.vore; + } + } + else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) { + createPixel("organism", pixel.x+1, pixel.y); + pixel.food -= 5; + if (Math.random() > 0.8) { + pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode -= 1; + } + else { + pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode; + } + if (Math.random() > 0.8) { + pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1; + } + else { + pixelMap[pixel.x+1][pixel.y].vore = pixel.vore; + } + } + else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) { + createPixel("organism", pixel.x-1, pixel.y); + pixel.food -= 5; + if (Math.random() > 0.8) { + pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode -= 1; + } + else { + pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode; + } + if (Math.random() > 0.8) { + pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1; + } + else { + pixelMap[pixel.x-1][pixel.y].vore = pixel.vore; + } + } + if (pixel.age > 10000 || pixel.dead === true) { + if (Math.random() > 0.3) { + if (pixel.vore > 0) { + changePixel(pixel,"rotten_meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"dead_plant"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } + } + else if (Math.random() > 0.5) { + if (pixel.vore > 0) { + changePixel(pixel,"meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"grass"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } } } pixel.age += 1 } pixel.oldvore = pixel.vore }, + reactions: { + "cancer": { "elem1":"cancer", "chance":0.005 }, + "radiation": { "elem1":["ash","grass","meat","cooked_meat","dead_plant","dna","sugar"], "chance":0.4 }, + }, + burn: 10, + burnTime: 250, + burnInto: ["cooked_meat","dead_plant","dna","sugar"], tempHigh: 150, - stateHigh: "cooked_meat", + stateHigh: ["cooked_meat","dead_plant","dna","sugar"], tempLow: -50, - stateLow: "frozen_meat", + stateLow: ["frozen_meat","frozen_plant","dna","sugar"], + breakInto: ["rotten_meat","dead_plant","dna","sugar"], category: "organism", state: "solid", density: 1050 From 7c34cd30e6a9e26eda3722bd143359e2a7b5ca9d Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:31:52 -0700 Subject: [PATCH 13/28] Working flashbang mod Actually makes your screen flash (DO not use if you have epilepsy, mod has proper warnings.) --- mods/true_flashbang.js | 61 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 mods/true_flashbang.js diff --git a/mods/true_flashbang.js b/mods/true_flashbang.js new file mode 100644 index 00000000..d30dff31 --- /dev/null +++ b/mods/true_flashbang.js @@ -0,0 +1,61 @@ +// by nekonico + +elements.true_flashbang = { + color: "#65665c", + onSelect: function() { + logMessage("Caution: If you have epilepsy or any similar vision issues, do not place this element for your own safety."); + }, + behavior: [ + "XX|EX:20>flashbang_flash%1|XX", + "XX|XX|XX", + "M2|M1 AND EX:20>flashbang_flash%1|M2", + ], + category: "weapons", + state: "solid", + density: 1300, + tempHigh: 1455.5, + stateHigh: "molten_steel", + excludeRandom: true, + cooldown: defaultCooldown +} + +elements.flashbang_flash = { + color: "#ffffff", + properties: { + delay: 100 + }, + tick: function(pixel) { + settings.bg = pixel.color; + let hex = Math.round(255 * pixel.alpha).toString(16); + pixel.color = `#${hex}${hex}${hex}` // credits to therazzler in the R74n discord for this code :3 + var done = true; + if (pixel.delay) { + var delayR = pixel.delay % 1; + var delay = pixel.delay - delayR; + if (!(pixelTicks - pixel.start > (pixel.delay||1) && Math.random() < 1-delayR)) { + done = false; + } + } + if ((Math.random() < 0.75 && done) || pixel.alpha < 0.05) { + deletePixel(pixel.x, pixel.y) + settings.bg = "#000000"; + } + if (pixel.delay) { + pixel.alpha = Math.max(0,1-(pixelTicks - pixel.start)/pixel.delay) + } + doHeat(pixel); + + }, + category: "energy", + temp: 40, + tempLow: -270, + stateLow: ["liquid_light",null], + state: "gas", + category: "energy", + density: 0.00001, + ignoreAir: true, + insulate: true, + hidden: true, + noMix: true, + excludeRandom: true +} \ No newline at end of file From 5eef4ecf82ae03003478159829c5502aed5f365c Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Wed, 9 Oct 2024 13:42:29 -0700 Subject: [PATCH 14/28] They evolve into humans now --- mods/genetics.js | 1229 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 1131 insertions(+), 98 deletions(-) diff --git a/mods/genetics.js b/mods/genetics.js index 55e46e69..2309d2ab 100644 --- a/mods/genetics.js +++ b/mods/genetics.js @@ -320,10 +320,10 @@ elements.organism = { if (isEmpty(pixel.x, pixel.y+1)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); } - else if (Math.random() > 0.99 && isEmpty(pixel.x-1, pixel.y)) { + else if (Math.random() > 0.95 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } - else if (Math.random() > 0.99 && isEmpty(pixel.x+1, pixel.y)) { + else if (Math.random() > 0.95 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } if (pixel.vore === 0) { @@ -500,10 +500,10 @@ elements.organism = { if (isEmpty(pixel.x, pixel.y+1)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); } - else if (Math.random() > 0.99 && isEmpty(pixel.x-1, pixel.y)) { + else if (Math.random() > 0.9 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } - else if (Math.random() > 0.99 && isEmpty(pixel.x+1, pixel.y)) { + else if (Math.random() > 0.9 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } if (pixel.vore === 0) { @@ -688,10 +688,10 @@ elements.organism = { if (isEmpty(pixel.x, pixel.y+1)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); } - else if (Math.random() > 0.99 && isEmpty(pixel.x-1, pixel.y)) { + else if (Math.random() > 0.9 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } - else if (Math.random() > 0.99 && isEmpty(pixel.x+1, pixel.y)) { + else if (Math.random() > 0.9 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } if (pixel.vore === 0) { @@ -940,10 +940,10 @@ elements.organism = { if (isEmpty(pixel.x, pixel.y+1)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); } - else if (Math.random() > 0.99 && isEmpty(pixel.x-1, pixel.y)) { + else if (Math.random() > 0.8 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } - else if (Math.random() > 0.99 && isEmpty(pixel.x+1, pixel.y)) { + else if (Math.random() > 0.8 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } if (pixel.vore === 0) { @@ -1288,10 +1288,10 @@ elements.organism = { if (isEmpty(pixel.x, pixel.y+1)) { /* by nekonico, do not steal!!!!!! >:3*/ movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); } - else if (Math.random() > 0.99 && isEmpty(pixel.x-1, pixel.y)) { + else if (Math.random() > 0.8 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } - else if (Math.random() > 0.99 && isEmpty(pixel.x+1, pixel.y)) { + else if (Math.random() > 0.8 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } if (pixel.vore === 0) { @@ -1700,58 +1700,26 @@ elements.organism = { if (isEmpty(pixel.x, pixel.y+1)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); } - else if (Math.random() > 0.99 && isEmpty(pixel.x-1, pixel.y)) { + else if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } - else if (Math.random() > 0.99 && isEmpty(pixel.x+1, pixel.y)) { + else if (Math.random() > 0.75 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } if (pixel.vore === 0) { - if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && elements[pixelMap[pixel.x][pixel.y-1].element].isFood) { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && elements[pixelMap[pixel.x][pixel.y+1].element].isFood) { deletePixel(pixel.x, pixel.y+1); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && elements[pixelMap[pixel.x+1][pixel.y].element].isFood) { deletePixel(pixel.x+1, pixel.y); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") { - deletePixel(pixel.x-1, pixel.y); - pixel.food += 1 - } - if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { - deletePixel(pixel.x, pixel.y-1); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") { - deletePixel(pixel.x, pixel.y+1); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") { - deletePixel(pixel.x+1, pixel.y); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") { - deletePixel(pixel.x-1, pixel.y); - pixel.food += 1 - } - if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") { - deletePixel(pixel.x, pixel.y-1); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") { - deletePixel(pixel.x, pixel.y+1); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") { - deletePixel(pixel.x+1, pixel.y); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && elements[pixelMap[pixel.x-1][pixel.y].element].isFood) { deletePixel(pixel.x-1, pixel.y); pixel.food += 1 } @@ -2092,10 +2060,10 @@ elements.organism = { else { pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode; } - if (Math.random() > 0.8) { + if (Math.random() > 0.95) { pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1; } - if (Math.random() < 0.2) { + if (Math.random() < 0.05) { pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1; } else { @@ -2114,10 +2082,10 @@ elements.organism = { else { pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode; } - if (Math.random() > 0.8) { + if (Math.random() > 0.95) { pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1; } - if (Math.random() < 0.2) { + if (Math.random() < 0.05) { pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1; } else { @@ -2136,10 +2104,10 @@ elements.organism = { else { pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode; } - if (Math.random() > 0.8) { + if (Math.random() > 0.95) { pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1; } - if (Math.random() < 0.2) { + if (Math.random() < 0.05) { pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1; } else { @@ -2172,62 +2140,30 @@ elements.organism = { } pixel.age += 1 } - else if (pixel.geneticCode > 80) { + else if (pixel.geneticCode > 80 && pixel.geneticCode < 91) { if (isEmpty(pixel.x, pixel.y+1)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); } - else if (Math.random() > 0.99 && isEmpty(pixel.x-1, pixel.y)) { + else if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } - else if (Math.random() > 0.99 && isEmpty(pixel.x+1, pixel.y)) { + else if (Math.random() > 0.75 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } if (pixel.vore === 0) { - if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && elements[pixelMap[pixel.x][pixel.y-1].element].isFood) { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sugar") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && elements[pixelMap[pixel.x][pixel.y+1].element].isFood) { deletePixel(pixel.x, pixel.y+1); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sugar") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && elements[pixelMap[pixel.x+1][pixel.y].element].isFood) { deletePixel(pixel.x+1, pixel.y); pixel.food += 1 } - else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sugar") { - deletePixel(pixel.x-1, pixel.y); - pixel.food += 1 - } - if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { - deletePixel(pixel.x, pixel.y-1); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") { - deletePixel(pixel.x, pixel.y+1); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") { - deletePixel(pixel.x+1, pixel.y); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") { - deletePixel(pixel.x-1, pixel.y); - pixel.food += 1 - } - if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") { - deletePixel(pixel.x, pixel.y-1); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") { - deletePixel(pixel.x, pixel.y+1); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") { - deletePixel(pixel.x+1, pixel.y); - pixel.food += 1 - } - else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") { + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && elements[pixelMap[pixel.x-1][pixel.y].element].isFood) { deletePixel(pixel.x-1, pixel.y); pixel.food += 1 } @@ -2632,10 +2568,10 @@ elements.organism = { else { pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode; } - if (Math.random() > 0.8) { + if (Math.random() > 0.95) { pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1; } - if (Math.random() < 0.2) { + if (Math.random() < 0.05) { pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1; } else { @@ -2654,10 +2590,10 @@ elements.organism = { else { pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode; } - if (Math.random() > 0.8) { + if (Math.random() > 0.95) { pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1; } - if (Math.random() < 0.2) { + if (Math.random() < 0.05) { pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1; } else { @@ -2676,10 +2612,1107 @@ elements.organism = { else { pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode; } - if (Math.random() > 0.8) { + if (Math.random() > 0.95) { pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1; } + if (Math.random() < 0.05) { + pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1; + } + else { + pixelMap[pixel.x-1][pixel.y].vore = pixel.vore; + } + } + if (pixel.age > 10000 || pixel.dead === true) { + if (Math.random() > 0.3) { + if (pixel.vore > 0) { + changePixel(pixel,"rotten_meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"dead_plant"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } + } + else if (Math.random() > 0.5) { + if (pixel.vore > 0) { + changePixel(pixel,"meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"grass"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } + } + } + pixel.age += 1 + } + else if (pixel.geneticCode > 90 && pixel.geneticCode < 101) { + if (isEmpty(pixel.x, pixel.y+1)) { + movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); + } + else if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) { + movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); + } + else if (Math.random() > 0.75 && isEmpty(pixel.x+1, pixel.y)) { + movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); + } + if (pixel.vore === 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && elements[pixelMap[pixel.x][pixel.y-1].element].isFood) { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && elements[pixelMap[pixel.x][pixel.y+1].element].isFood) { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && elements[pixelMap[pixel.x+1][pixel.y].element].isFood) { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && elements[pixelMap[pixel.x-1][pixel.y].element].isFood) { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + } + else if (pixel.vore > 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fly") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fly") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fly") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fly") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "ant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "ant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "ant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "ant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "egg") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "egg") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "egg") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "egg") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bird") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bird") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bird") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bird") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fish") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fish") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fish") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fish") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "head") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "head") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "head") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "head") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "body") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "body") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "body") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "body") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bone") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bone") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bone") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bone") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "blood") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "blood") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "blood") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "blood") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + } + else if (pixel.vore < 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "tree_branch") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "tree_branch") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "tree_branch") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "tree_branch") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "wood") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "wood") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "wood") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "wood") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bamboo") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bamboo") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bamboo") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bamboo") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "vine") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "vine") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "vine") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "vine") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "cactus") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "cactus") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "cactus") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "cactus") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "petal") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "petal") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "petal") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "petal") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "pistil") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "pistil") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "pistil") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "pistil") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sapling") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sapling") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sapling") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sapling") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "pinecone") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "pinecone") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "pinecone") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "pinecone") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + } + if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) { + createPixel("organism", pixel.x, pixel.y-1); + pixel.food -= 5; + if (Math.random() > 0.8) { + pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1; + } if (Math.random() < 0.2) { + pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode -= 1; + } + else { + pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode; + } + if (Math.random() > 0.995) { + pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1; + } + if (Math.random() < 0.005) { + pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1; + } + else { + pixelMap[pixel.x][pixel.y-1].vore = pixel.vore; + } + } + else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) { + createPixel("organism", pixel.x+1, pixel.y); + pixel.food -= 5; + if (Math.random() > 0.8) { + pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode -= 1; + } + else { + pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode; + } + if (Math.random() > 0.995) { + pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1; + } + if (Math.random() < 0.005) { + pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1; + } + else { + pixelMap[pixel.x+1][pixel.y].vore = pixel.vore; + } + } + else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) { + createPixel("organism", pixel.x-1, pixel.y); + pixel.food -= 5; + if (Math.random() > 0.8) { + pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode -= 1; + } + else { + pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode; + } + if (Math.random() > 0.995) { + pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1; + } + if (Math.random() < 0.005) { + pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1; + } + else { + pixelMap[pixel.x-1][pixel.y].vore = pixel.vore; + } + } + if (pixel.age > 10000 || pixel.dead === true) { + if (Math.random() > 0.3) { + if (pixel.vore > 0) { + changePixel(pixel,"rotten_meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"dead_plant"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } + } + else if (Math.random() > 0.5) { + if (pixel.vore > 0) { + changePixel(pixel,"meat"); + } + else if (pixel.vore < 0) { + changePixel(pixel,"grass"); + } + else if (pixel.vore === 0) { + changePixel(pixel,"sugar"); + } + } + } + pixel.age += 1 + } + else if (pixel.geneticCode > 100) { + if (isEmpty(pixel.x, pixel.y+1)) { + movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); + } + else if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) { + movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); + } + else if (Math.random() > 0.75 && isEmpty(pixel.x+1, pixel.y)) { + movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); + } + if (pixel.vore === 0) { + changePixel(pixel,"human"); + } + else if (pixel.vore > 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rotten_meat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rotten_meat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fly") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fly") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fly") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fly") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "ant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "ant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "ant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "ant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "egg") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "egg") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "egg") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "egg") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "rat") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "rat") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "rat") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "rat") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bird") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bird") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bird") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bird") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "fish") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "fish") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "fish") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "fish") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "head") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "head") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "head") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "head") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "body") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "body") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "body") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "body") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bone") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bone") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bone") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bone") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "blood") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "blood") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "blood") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "blood") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + } + else if (pixel.vore < 0) { + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "grass") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "grass") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "grass") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "dead_plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "dead_plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "plant") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "plant") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "plant") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "plant") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "tree_branch") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "tree_branch") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "tree_branch") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "tree_branch") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "wood") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "wood") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "wood") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "wood") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "bamboo") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "bamboo") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "bamboo") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "bamboo") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "vine") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "vine") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "vine") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "vine") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "cactus") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "cactus") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "cactus") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "cactus") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "petal") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "petal") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "petal") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "petal") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "pistil") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "pistil") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "pistil") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "pistil") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sapling") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "sapling") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "sapling") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "sapling") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "pinecone") { + deletePixel(pixel.x, pixel.y-1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y+1, true) && pixelMap[pixel.x][pixel.y+1].element == "pinecone") { + deletePixel(pixel.x, pixel.y+1); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x+1, pixel.y, true) && pixelMap[pixel.x+1][pixel.y].element == "pinecone") { + deletePixel(pixel.x+1, pixel.y); + pixel.food += 1 + } + else if (Math.random() < 0.1 && !isEmpty(pixel.x-1, pixel.y, true) && pixelMap[pixel.x-1][pixel.y].element == "pinecone") { + deletePixel(pixel.x-1, pixel.y); + pixel.food += 1 + } + } + if (isEmpty(pixel.x, pixel.y-1) && pixel.food > 10) { + createPixel("organism", pixel.x, pixel.y-1); + pixel.food -= 5; + if (Math.random() > 0.8) { + pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode -= 1; + } + else { + pixelMap[pixel.x][pixel.y-1].geneticCode = pixel.geneticCode; + } + if (Math.random() > 0.995) { + pixelMap[pixel.x][pixel.y-1].vore = pixel.vore += 1; + } + if (Math.random() < 0.005) { + pixelMap[pixel.x][pixel.y-1].vore = pixel.vore -= 1; + } + else { + pixelMap[pixel.x][pixel.y-1].vore = pixel.vore; + } + } + else if (isEmpty(pixel.x+1, pixel.y) && pixel.food > 10) { + createPixel("organism", pixel.x+1, pixel.y); + pixel.food -= 5; + if (Math.random() > 0.8) { + pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode -= 1; + } + else { + pixelMap[pixel.x+1][pixel.y].geneticCode = pixel.geneticCode; + } + if (Math.random() > 0.995) { + pixelMap[pixel.x+1][pixel.y].vore = pixel.vore += 1; + } + if (Math.random() < 0.005) { + pixelMap[pixel.x+1][pixel.y].vore = pixel.vore -= 1; + } + else { + pixelMap[pixel.x+1][pixel.y].vore = pixel.vore; + } + } + else if (isEmpty(pixel.x-1, pixel.y) && pixel.food > 10) { + createPixel("organism", pixel.x-1, pixel.y); + pixel.food -= 5; + if (Math.random() > 0.8) { + pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode += 1; + } + if (Math.random() < 0.2) { + pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode -= 1; + } + else { + pixelMap[pixel.x-1][pixel.y].geneticCode = pixel.geneticCode; + } + if (Math.random() > 0.995) { + pixelMap[pixel.x-1][pixel.y].vore = pixel.vore += 1; + } + if (Math.random() < 0.005) { pixelMap[pixel.x-1][pixel.y].vore = pixel.vore -= 1; } else { From 8d8186bb0bff5a8c967ece058669db08515f6849 Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Wed, 9 Oct 2024 22:12:04 -0700 Subject: [PATCH 15/28] Pills! --- mods/genetics.js | 378 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 303 insertions(+), 75 deletions(-) diff --git a/mods/genetics.js b/mods/genetics.js index 2309d2ab..be89639c 100644 --- a/mods/genetics.js +++ b/mods/genetics.js @@ -1,6 +1,11 @@ /* by nekonico, do not steal!!!!!! >:3*/ elements.organism = { + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "M2%10|M1|M2%10", + ], color: ["#997457","#a89a76"], properties: { geneticCode: 0, @@ -172,15 +177,6 @@ elements.organism = { pixel.dead = true; } if (pixel.geneticCode < 11) { - if (isEmpty(pixel.x, pixel.y+1)) { - movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); - } - else if (Math.random() > 0.9 && isEmpty(pixel.x-1, pixel.y+1)) { - movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y+1); - } - else if (Math.random() > 0.9 && isEmpty(pixel.x+1, pixel.y+1)) { - movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y+1); - } if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -317,16 +313,13 @@ elements.organism = { pixel.age += 1 } else if (pixel.geneticCode > 20 && pixel.geneticCode < 31) { - if (isEmpty(pixel.x, pixel.y+1)) { - movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); - } - else if (Math.random() > 0.95 && isEmpty(pixel.x-1, pixel.y)) { + if (Math.random() > 0.95 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } else if (Math.random() > 0.95 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } - if (pixel.vore === 0) { + if (pixel.vore > -3 && pixel.vore < 3) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -376,7 +369,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore > 0) { + else if (pixel.vore > 2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -394,7 +387,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore < 0) { + else if (pixel.vore < -2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -497,16 +490,13 @@ elements.organism = { pixel.age += 1 } else if (pixel.geneticCode > 30 && pixel.geneticCode < 41) { - if (isEmpty(pixel.x, pixel.y+1)) { - movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); - } - else if (Math.random() > 0.9 && isEmpty(pixel.x-1, pixel.y)) { + if (Math.random() > 0.9 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } else if (Math.random() > 0.9 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } - if (pixel.vore === 0) { + if (pixel.vore > -3 && pixel.vore < 3) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -556,7 +546,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore > 0) { + else if (pixel.vore > 2) { /* by nekonico, do not steal!!!!!! >:3*/ if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -574,7 +564,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore < 0) { + else if (pixel.vore < -2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -685,16 +675,13 @@ elements.organism = { pixel.age += 1 } else if (pixel.geneticCode > 40 && pixel.geneticCode < 51) { - if (isEmpty(pixel.x, pixel.y+1)) { - movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); - } - else if (Math.random() > 0.9 && isEmpty(pixel.x-1, pixel.y)) { + if (Math.random() > 0.9 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } else if (Math.random() > 0.9 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } - if (pixel.vore === 0) { + if (pixel.vore > -3 && pixel.vore < 3) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -776,7 +763,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore > 0) { + else if (pixel.vore > 2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -810,7 +797,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore < 0) { + else if (pixel.vore < -2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -937,16 +924,13 @@ elements.organism = { pixel.age += 1 } else if (pixel.geneticCode > 50 && pixel.geneticCode < 61) { - if (isEmpty(pixel.x, pixel.y+1)) { - movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); - } - else if (Math.random() > 0.8 && isEmpty(pixel.x-1, pixel.y)) { + if (Math.random() > 0.8 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } else if (Math.random() > 0.8 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } - if (pixel.vore === 0) { + if (pixel.vore > -3 && pixel.vore < 3) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -1028,7 +1012,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore > 0) { + else if (pixel.vore > 2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -1094,7 +1078,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore < 0) { + else if (pixel.vore < -2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -1285,16 +1269,13 @@ elements.organism = { pixel.age += 1 } else if (pixel.geneticCode > 60 && pixel.geneticCode < 71) { - if (isEmpty(pixel.x, pixel.y+1)) { - /* by nekonico, do not steal!!!!!! >:3*/ movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); - } - else if (Math.random() > 0.8 && isEmpty(pixel.x-1, pixel.y)) { + if (Math.random() > 0.8 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } else if (Math.random() > 0.8 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } - if (pixel.vore === 0) { + if (pixel.vore > -3 && pixel.vore < 3) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "sugar") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -1376,7 +1357,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore > 0) { + else if (pixel.vore > 2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -1474,7 +1455,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore < 0) { + else if (pixel.vore < -2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -1697,16 +1678,13 @@ elements.organism = { pixel.age += 1 } else if (pixel.geneticCode > 70 && pixel.geneticCode < 81) { - if (isEmpty(pixel.x, pixel.y+1)) { - movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); - } - else if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) { + if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } else if (Math.random() > 0.75 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } - if (pixel.vore === 0) { + if (pixel.vore > -3 && pixel.vore < 3) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && elements[pixelMap[pixel.x][pixel.y-1].element].isFood) { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -1756,7 +1734,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore > 0) { + else if (pixel.vore > 2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -1886,7 +1864,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore < 0) { + else if (pixel.vore < -2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -2141,16 +2119,13 @@ elements.organism = { pixel.age += 1 } else if (pixel.geneticCode > 80 && pixel.geneticCode < 91) { - if (isEmpty(pixel.x, pixel.y+1)) { - movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); - } - else if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) { + if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } else if (Math.random() > 0.75 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } - if (pixel.vore === 0) { + if (pixel.vore > -3 && pixel.vore < 3) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && elements[pixelMap[pixel.x][pixel.y-1].element].isFood) { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -2200,7 +2175,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore > 0) { + else if (pixel.vore > 2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -2362,7 +2337,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore < 0) { + else if (pixel.vore < -2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -2649,16 +2624,13 @@ elements.organism = { pixel.age += 1 } else if (pixel.geneticCode > 90 && pixel.geneticCode < 101) { - if (isEmpty(pixel.x, pixel.y+1)) { - movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); - } - else if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) { + if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } else if (Math.random() > 0.75 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } - if (pixel.vore === 0) { + if (pixel.vore > -3 && pixel.vore < 3) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && elements[pixelMap[pixel.x][pixel.y-1].element].isFood) { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -2708,7 +2680,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore > 0) { + else if (pixel.vore > 2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -2902,7 +2874,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore < 0) { + else if (pixel.vore < -2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -3221,19 +3193,16 @@ elements.organism = { pixel.age += 1 } else if (pixel.geneticCode > 100) { - if (isEmpty(pixel.x, pixel.y+1)) { - movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1); - } - else if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) { + if (Math.random() > 0.75 && isEmpty(pixel.x-1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x-1, pixel.y); } else if (Math.random() > 0.75 && isEmpty(pixel.x+1, pixel.y)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x+1, pixel.y); } - if (pixel.vore === 0) { + if (pixel.vore > -3 && pixel.vore < 3) { changePixel(pixel,"human"); } - else if (pixel.vore > 0) { + else if (pixel.vore > 2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "meat") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -3427,7 +3396,7 @@ elements.organism = { pixel.food += 1 } } - else if (pixel.vore < 0) { + else if (pixel.vore < -2) { if (Math.random() < 0.1 && !isEmpty(pixel.x, pixel.y-1, true) && pixelMap[pixel.x][pixel.y-1].element == "grass") { deletePixel(pixel.x, pixel.y-1); pixel.food += 1 @@ -3748,8 +3717,18 @@ elements.organism = { pixel.oldvore = pixel.vore }, reactions: { - "cancer": { "elem1":"cancer", "chance":0.005 }, - "radiation": { "elem1":["ash","grass","meat","cooked_meat","dead_plant","dna","sugar"], "chance":0.4 }, + "cancer": { elem1:"cancer", chance:0.005 }, + "radiation": { elem1:["ash","grass","meat","cooked_meat","dead_plant","dna","sugar"], chance:0.4, func:function(pixel) { + if (pixel1.vore > 2) { + changePixel(pixel,"cooked_meat"); + } + else if (pixel1.vore < -2) { + changePixel(pixel,"dead_plant"); + } + else if (pixel1.vore > -3 && pixel1.vore < 3) { + changePixel(pixel,"ash"); + } + }}, }, burn: 10, burnTime: 250, @@ -3762,6 +3741,255 @@ elements.organism = { category: "organism", state: "solid", density: 1050 - } +} + +elements.food_pill = { + behavior: behaviors.POWDER, + reactions: { + "organism": { elem1: null, chance:0.1, func:function(pixel1,pixel2) { + if (pixel2.vore > 2) { + pixel2.food += 2 + if (Math.random() > 0.9) { + pixel2.geneticCode += 1 + }; + } + else if (pixel2.vore < -2) { + pixel2.food += 2 + if (Math.random() > 0.9) { + pixel2.geneticCode += 1 + }; + } + else if (pixel2.vore > -3 && pixel2.vore < 3) { + pixel2.food += 5 + if (Math.random() > 0.9) { + pixel2.geneticCode += 1 + }; + } + }}, + }, + category: "organism", + state: "solid", + color: ["#2b1107","#5c3322","#2b1107","#5c3322","#2b1107","#5c3322"], + tempHigh: 250, + stateHigh: ["sugar","cooked_meat","smoke","smoke","smoke","dead_plant","smoke","smoke","smoke","stench"], + burn: 10, + burnTime: 200, + burnInto: ["sugar","cooked_meat","smoke","smoke","smoke","dead_plant","smoke","smoke","smoke","stench"], + breakInto: ["sugar","cooked_meat","dead_plant","dust","dust","dust","dust","dust","dust","dust","dust","dust","dust","dust","dust","dust"], + breakIntoColor: ["#2b1107","#5c3322","#5c3322","#5c3322","#5c3322","#5c3322","#5c3322","#5c3322","#41770B","#774C35"], + isFood: true +} + +elements.pacifism_pill = { + behavior: behaviors.POWDER, + reactions: { + "organism": { elem1: null, chance:0.1, func:function(pixel1,pixel2) { + if (pixel2.vore > 0) { + pixel2.vore -= 1 + if (Math.random() > 0.9) { + pixel2.food += 1 + }; + if (Math.random() > 0.9) { + pixel2.geneticCode += 1 + }; + } + else if (pixel2.vore < 0) { + pixel2.vore -= 1 + pixel2.food += 1 + if (Math.random() > 0.9) { + pixel2.geneticCode += 1 + }; + } + else if (pixel2.vore === 0) { + pixel2.vore -= 1 + if (Math.random() > 0.9) { + pixel2.food += 1 + }; + if (Math.random() > 0.9) { + pixel2.geneticCode += 1 + }; + } + }}, + }, + category: "organism", + state: "solid", + color: ["#58AA38","#58AA38","#3D6D4B","#316232","#6CA65A","#58AA38","#3D6D4B","#316232","#58AA38","#58AA38","#3D6D4B","#316232"], + tempHigh: 250, + stateHigh: ["molten_plastic","dead_plant","smoke","smoke","smoke","dead_plant","smoke","smoke","smoke","stench","stench"], + burn: 10, + burnTime: 200, + burnInto: ["molten_plastic","dead_plant","smoke","smoke","smoke","dead_plant","smoke","smoke","smoke","stench","stench"], + breakInto: ["dead_plant","dust","dust","dust","dust","dust","dust"], + breakIntoColor: ["#6CA65A","#58AA38","#6CA65A","#6CA65A"], + isFood: true +} + +elements.neutrality_pill = { + behavior: behaviors.POWDER, + reactions: { + "organism": { elem1: null, chance:0.1, func:function(pixel1,pixel2) { + if (pixel2.vore > 0) { + pixel2.vore -= 1 + if (Math.random() > 0.9) { + pixel2.food += 1 + }; + if (Math.random() > 0.9) { + pixel2.geneticCode += 1 + }; + } + else if (pixel2.vore < 0) { + pixel2.vore += 1 + if (Math.random() > 0.9) { + pixel2.food += 1 + }; + if (Math.random() > 0.9) { + pixel2.geneticCode += 1 + }; + } + else if (pixel2.vore === 0) { + pixel2.food += 1 + if (Math.random() > 0.9) { + pixel2.geneticCode += 1 + }; + } + }}, + }, + category: "organism", + state: "solid", + color: ["#c5dede","#c5dede","#464196","#2E2B64","#a4b3b3","#c5dede","#464196","#2E2B64","#c5dede","#c5dede","#464196","#2E2B64"], + tempHigh: 250, + stateHigh: ["molten_plastic","sugar","smoke","smoke","smoke","sugar","smoke","smoke","smoke","stench","stench"], + burn: 10, + burnTime: 200, + burnInto: ["molten_plastic","sugar","smoke","smoke","smoke","sugar","smoke","smoke","smoke","stench","stench"], + breakInto: ["sugar","dust","dust","dust","dust","dust","dust"], + breakIntoColor: ["#a4b3b3","#c5dede","#a4b3b3","#a4b3b3"], + isFood: true +} + +elements.aggression_pill = { + behavior: behaviors.POWDER, + reactions: { + "organism": { elem1: null, chance:0.1, func:function(pixel1,pixel2) { + if (pixel2.vore > 0) { + pixel2.vore += 1 + pixel2.food += 1 + if (Math.random() > 0.9) { + pixel2.geneticCode += 1 + }; + } + else if (pixel2.vore < 0) { + pixel2.vore += 1 + if (Math.random() > 0.9) { + pixel2.food += 1 + }; + if (Math.random() > 0.9) { + pixel2.geneticCode += 1 + }; + } + else if (pixel2.vore === 0) { + pixel2.vore += 1 + if (Math.random() > 0.9) { + pixel2.food += 1 + }; + if (Math.random() > 0.9) { + pixel2.geneticCode += 1 + }; + } + }}, + }, + category: "organism", + state: "solid", + color: ["#B13E3E","#B13E3E","#8E122A","#870C1C","#A83232","#B13E3E","#8E122A","#870C1C","#B13E3E","#B13E3E","#8E122A","#870C1C"], + tempHigh: 250, + stateHigh: ["molten_plastic","cooked_meat","smoke","smoke","smoke","cooked_meat","smoke","smoke","smoke","stench","stench"], + burn: 10, + burnTime: 200, + burnInto: ["molten_plastic","cooked_meat","smoke","smoke","smoke","cooked_meat","smoke","smoke","smoke","stench","stench"], + breakInto: ["cooked_meat","dust","dust","dust","dust","dust","dust"], + breakIntoColor: ["#A83232","#B13E3E","#A83232","#A83232"], + isFood: true +} + +elements.growth_pill = { + behavior: behaviors.POWDER, + reactions: { + "organism": { elem1: null, chance:0.1, func:function(pixel1,pixel2) { + if (pixel2.vore > 0) { + if (Math.random() > 0.9) { + pixel2.food += 1 + }; + if (Math.random() > 0.99) { + pixel2.vore += 1 + }; + pixel2.geneticCode += 1 + } + else if (pixel2.vore < 0) { + if (Math.random() > 0.8) { + pixel2.food += 1 + }; + if (Math.random() > 0.99) { + pixel2.vore -= 1 + }; + pixel2.geneticCode += 1 + } + else if (pixel2.vore === 0) { + if (Math.random() > 0.75) { + pixel2.food += 1 + }; + pixel2.geneticCode += 1 + } + }}, + }, + category: "organism", + state: "solid", + color: ["#ECF4B0","#ECF4B0","#D1D099","#CBCA8C","#D2D9A6","#ECF4B0","#D1D099","#CBCA8C","#ECF4B0","#ECF4B0","#D1D099","#CBCA8C"], + tempHigh: 250, + stateHigh: ["molten_plastic","sugar","smoke","smoke","smoke","herb","smoke","smoke","smoke","stench"], + burn: 10, + burnTime: 200, + burnInto: ["molten_plastic","sugar","smoke","smoke","smoke","herb","smoke","smoke","smoke","stench"], + breakInto: ["sugar","dust","dust","dust","dust","dust","dust","herb","dust","dust","dust","dust","dust","dust"], + breakIntoColor: ["#D2D9A6","#ECF4B0","#D2D9A6","#D2D9A6"], + isFood: true +} + +elements.antiaging_pill = { + name: "anti-aging_pill", + behavior: behaviors.POWDER, + reactions: { + "organism": { elem1: null, chance:0.1, func:function(pixel1,pixel2) { + if (pixel2.age > 99) { + pixel2.age -= 100; + if (Math.random() > 0.999) { + pixel2.food += 1 + }; + if (Math.random() > 0.995) { + pixel2.geneticCode += 1 + }; + } + else if (pixel2.age < 100) { + pixel2.age = 100; + if (Math.random() > 0.999) { + pixel2.food += 1 + }; + if (Math.random() > 0.995) { + pixel2.geneticCode += 1 + }; + } + }}, + }, + category: "organism", + state: "solid", + color: ["#B8C5C5","#B8C5C5","#9291A6","#8C8B99","#A8AFAF","#B8C5C5","#9291A6","#8C8B99","#B8C5C5","#B8C5C5","#9291A6","#8C8B99"], + tempHigh: 250, + stateHigh: ["molten_plastic","magnesium","smoke","smoke","smoke","sugar","smoke","smoke","smoke","stench","stench","stench"], + burn: 10, + burnTime: 200, + burnInto: ["molten_plastic","magnesium","smoke","smoke","smoke","sugar","smoke","smoke","smoke","stench","stench","stench"], + breakInto: ["magnesium","dust","dust","dust","dust","dust","dust","sugar","dust","dust","dust","dust","dust","dust"], + breakIntoColor: ["#A8AFAF","#B8C5C5","#A8AFAF","#A8AFAF"], + isFood: true +} /* by nekonico, do not steal!!!!!! >:3*/ From a460eff03c2a667933d38d003489bf8dbf114a61 Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Fri, 11 Oct 2024 08:46:54 -0700 Subject: [PATCH 16/28] regression pill --- mods/genetics.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/mods/genetics.js b/mods/genetics.js index be89639c..f8b58098 100644 --- a/mods/genetics.js +++ b/mods/genetics.js @@ -3992,4 +3992,47 @@ elements.antiaging_pill = { isFood: true } +elements.regression_pill = { + behavior: behaviors.POWDER, + reactions: { + "organism": { elem1: null, chance:0.1, func:function(pixel1,pixel2) { + if (pixel2.vore > 0) { + if (Math.random() > 0.9) { + pixel2.food += 1 + }; + if (Math.random() > 0.99) { + pixel2.vore -= 1 + }; + pixel2.geneticCode -= 1 + } + else if (pixel2.vore < 0) { + if (Math.random() > 0.8) { + pixel2.food += 1 + }; + if (Math.random() > 0.99) { + pixel2.vore += 1 + }; + pixel2.geneticCode -= 1 + } + else if (pixel2.vore === 0) { + if (Math.random() > 0.75) { + pixel2.food += 1 + }; + pixel2.geneticCode -= 1 + } + }}, + }, + category: "organism", + state: "solid", + color: ["#c5dede","#c5dede","#D1D099","#CBCA8C","#a4b3b3","#c5dede","#D1D099","#CBCA8C","#c5dede","#c5dede","#D1D099","#CBCA8C"], + tempHigh: 250, + stateHigh: ["molten_plastic","sugar","smoke","smoke","smoke","herb","smoke","smoke","smoke","stench"], + burn: 10, + burnTime: 200, + burnInto: ["molten_plastic","sugar","smoke","smoke","smoke","herb","smoke","smoke","smoke","stench"], + breakInto: ["sugar","dust","dust","dust","dust","dust","dust","herb","dust","dust","dust","dust","dust","dust"], + breakIntoColor: ["#a4b3b3","#ECF4B0","#a4b3b3","#a4b3b3"], + isFood: true +} + /* by nekonico, do not steal!!!!!! >:3*/ From 0fdb01fc82c77a5c2803c7807f77f25967213d75 Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Mon, 14 Oct 2024 08:00:46 -0700 Subject: [PATCH 17/28] Flesh infection mod --- mods/flesh_infection.js | 439 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 439 insertions(+) create mode 100644 mods/flesh_infection.js diff --git a/mods/flesh_infection.js b/mods/flesh_infection.js new file mode 100644 index 00000000..2755d0b9 --- /dev/null +++ b/mods/flesh_infection.js @@ -0,0 +1,439 @@ +eLists.FESTER = ["dirt","rock","rock_wall","basalt","limestone","steel","iron","dead_bug","mud","sand","wet_sand","clay_soil","clay","mycelium","skin","meat","rotten_meat","wood","ant_wall","dead_plant","plant","hair","bone","cancer","straw","cloth","brick","bamboo","sponge","paper","plastic","concrete"], + +elements.jaws = { + color: "#d9d9d9", + behavior: [ + "XX|ST:flesh_mound AND SM%0.75|XX", + "ST:flesh_mound|XX|ST:flesh_mound", + "XX|ST:flesh_mound AND M1|XX", + ], + reactions: { + "sugar": { "elem1": "quicklime", "elem2": null, "chance": 0.003 }, + "acid": { "elem1": "quicklime", "elem2": null }, + }, + category:"flesh", + tempHigh: 1000, + stateHigh: ["steam","salt","meat","quicklime"], + state: "solid", + density: 2000, + hardness: 0.5, + breakInto: ["flesh_mound","quicklime"], + hidden: true, + ignore: ["jaws","flesh_mound","flesh_beast","solid_flesh","flesh_wood"] +}, + +elements.flesh_mound = { + color: ["#9e4839","#ba6449","#d2856c","#a14940","#E94336"], + behavior: [ + "XX|CR:mucus%0.005|XX", + "CR:mucus%0.005|XX|CR:mucus%0.005", + "XX|CR:mucus%0.005|XX", + ], + tick: function(pixel) { + if (pixel.start === pixelTicks && pixel.fruit === undefined && !pixel.stop) { + if (Math.random() < 0.95) { + pixel.fruit = Math.random() < 0.75 ? "flesh_beast" : "jaw"; + } + else { pixel.fruit = null } + } + if (!isEmpty(pixel.x-1,pixel.y,true)) { + if (pixelMap[pixel.x-1][pixel.y].fruit === undefined && pixelMap[pixel.x-1][pixel.y].element === "flesh_mound") { + pixelMap[pixel.x-1][pixel.y].fruit = pixel.fruit; + } + } + else if (!isEmpty(pixel.x+1,pixel.y,true)) { + if (pixelMap[pixel.x+1][pixel.y].fruit === undefined && pixelMap[pixel.x+1][pixel.y].element === "flesh_mound") { + pixelMap[pixel.x+1][pixel.y].fruit = pixel.fruit; + } + } + else if (!isEmpty(pixel.x,pixel.y+1,true)) { + if (pixelMap[pixel.x][pixel.y+1].fruit === undefined && pixelMap[pixel.x][pixel.y+1].element === "flesh_mound") { + pixelMap[pixel.x][pixel.y+1].fruit = pixel.fruit; + } + } + else if (!isEmpty(pixel.x,pixel.y-1,true)) { + if (pixelMap[pixel.x][pixel.y-1].fruit === undefined && pixelMap[pixel.x][pixel.y-1].element === "flesh_mound") { + pixelMap[pixel.x][pixel.y-1].fruit = pixel.fruit; + } + } + if (isEmpty(pixel.x,pixel.y-1)) { + pixel.sp = 0; //not supported + } + else if (!outOfBounds(pixel.x,pixel.y-1) && pixelMap[pixel.x][pixel.y-1].element === "flesh_mound" && pixelMap[pixel.x][pixel.y-1].sp === 0) { + pixel.sp = 0; + } + else { pixel.sp = 1 } //supported + if (pixel.stop) { + if (pixel.sp === 0) { tryMove(pixel, pixel.x, pixel.y+1); } + return; + } + if (pixel.sp === 0) { tryMove(pixel, pixel.x, pixel.y+1); } + else { + if (pixel.fert && pixel.stage && Math.random() < 0.01 && isEmpty(pixel.x,pixel.y+1)) { + clonePixel(pixel,pixel.x,pixel.y+1); + pixelMap[pixel.x][pixel.y+1].fert = true; + pixelMap[pixel.x][pixel.y+1].stage = pixel.stage-1; + } + } + if (pixel.fert===undefined) { // able to grow down + pixel.fert = Math.random() < 0.50; + } + if (pixel.stage===undefined) { + pixel.stage = Math.floor(Math.random()*20)+10; + } + if (Math.random() < 0.03 && isEmpty(pixel.x-1,pixel.y) && !isEmpty(pixel.x-1,pixel.y-1) && (outOfBounds(pixel.x-1,pixel.y-1) || pixelMap[pixel.x-1][pixel.y-1].element !== "flesh_mound")) { + createPixel("flesh_mound",pixel.x-1,pixel.y); + pixelMap[pixel.x-1][pixel.y].fruit = pixel.fruit; + } + if (Math.random() < 0.03 && isEmpty(pixel.x+1,pixel.y) && !isEmpty(pixel.x+1,pixel.y-1) && (outOfBounds(pixel.x+1,pixel.y-1) || pixelMap[pixel.x+1][pixel.y-1].element !== "flesh_mound")) { + createPixel("flesh_mound",pixel.x+1,pixel.y); + pixelMap[pixel.x+1][pixel.y].fruit = pixel.fruit; + } + if (Math.random() < 0.03 && isEmpty(pixel.x,pixel.y-1) && ( + (!isEmpty(pixel.x-1,pixel.y-1) && (outOfBounds(pixel.x-1,pixel.y-1) || pixelMap[pixel.x-1][pixel.y-1].element !== "flesh_mound")) || + (!isEmpty(pixel.x+1,pixel.y-1) && (outOfBounds(pixel.x+1,pixel.y-1) || pixelMap[pixel.x+1][pixel.y-1].element !== "flesh_mound"))) + ) { + createPixel("flesh_mound",pixel.x,pixel.y-1); + pixelMap[pixel.x][pixel.y-1].fruit = pixel.fruit; + } + if (pixel.fruit && Math.random() < 0.0001) { + for (var i = 0; i < adjacentCoords.length; i++) { + var coords = adjacentCoords[i]; + var x = pixel.x + coords[0]; + var y = pixel.y + coords[1]; + if (isEmpty(x,y)) { + createPixel(pixel.fruit,x,y) + break; + } + } + } + if (pixel.h < 2 && Math.random() < 0.0005 && isEmpty(pixel.x,pixel.y-1)) { + createPixel(pixel.element,pixel.x,pixel.y-1); + pixelMap[pixel.x][pixel.y-1].h = pixel.h+1; + } + var coords = [ + [pixel.x+1,pixel.y], + [pixel.x-1,pixel.y], + [pixel.x+1,pixel.y+1], + [pixel.x-1,pixel.y+1], + ]; + for (var i = 0; i < coords.length; i++) { + if (Math.random() < 0.005 && isEmpty(coords[i][0],coords[i][1])) { + if (!isEmpty(coords[i][0],coords[i][1]+1,true)) { + var soil = pixelMap[coords[i][0]][coords[i][1]+1]; + if (eLists.FESTER.indexOf(soil.element) !== -1) { + createPixel(pixel.element,coords[i][0],coords[i][1]); + } + } + } + } + if (Math.random() < 0.0002 && pixel.age > 500 && pixel.temp < 90 && pixel.rooting === false) { + pixel.rooting = true; + } + if (Math.random() < 0.002 && pixel.age > 500 && pixel.temp < 90 && pixel.rooting === true) { + if (!outOfBounds(pixel.x,pixel.y+1)) { + var dirtPixel = pixelMap[pixel.x][pixel.y+1]; + if (dirtPixel && (eLists.FESTER.indexOf(dirtPixel.element) !== -1 || dirtPixel.element === "grass")) { + changePixel(dirtPixel,"vein_root"); + } + } + } + pixel.age++; + doDefaults(pixel); + }, + renderer: renderPresets.PLANTCHAR, + properties: { + "h": 0, + "age": 0, + "rooting": false, + "fruit": undefined, + }, + reactions: { + "cell": { elem2:"flesh_mound", chance:0.005 }, + "sugar_water": { elem2:"flesh_mound", chance:0.05 }, + "mucus": { elem2:null, chance:0.005 }, + "plant": { elem2:["dead_plant","flesh_mound"], chance:0.005 }, + "grass": { elem2:["dead_plant","flesh_mound"], chance:0.005 }, + }, + tempHigh: 100, + stateHigh: "meat", + tempLow: -2, + stateLow: "frozen_meat", + burn:3, + burnTime:20, + breakInto: "meat", + category:"flesh", + state: "solid", + density: 1400, +} + +elements.vein_root = { + color: ["#c72114","#8d3728","#a95338","#c72114","#d83225","#c1745b","#903830", "#c72114",], + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand,skin,meat,rotten_meat,concrete,dead_plant,dead_bug,root>vein_root,fibrous_flesh%0.5 AND CR:vein_root%0.005|CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand,skin,meat,rotten_meat,concrete,dead_plant,dead_bug,root>vein_root,fibrous_flesh,fibrous_flesh%0.5|CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand,skin,meat,rotten_meat,concrete,dead_plant,dead_bug,root>vein_root,fibrous_flesh%0.5 AND CR:vein_root%0.005", + ], + reactions: { + "rock": { elem2:"sand", chance:0.0008 }, + "mud": { elem2:"dirt", chance:0.01 }, + "wet_sand": { elem2:"sand", chance:0.01 }, + "water": { elem2:null, chance:0.001 }, + "blood": { elem2:null, chance:0.01 }, + "sugar_water": { elem2:null, chance:0.0025 }, + "mucus": { elem2:null, chance:0.0025 } + }, + tempHigh: 175, + stateHigh: "meat", + tempLow: -50, + stateLow: "frozen_meat", + burn: 20, + burnTime: 60, + burnInto: "meat", + breakInto: "blood", + category: "flesh", + state: "solid", + density: 1250, + conduct: 0.1, + hidden: true +} + +elements.fibrous_flesh = { + color: ["#c72114","#7c2617","#984227","#c72114","#b0634a","#802720","#c72114"], + behavior: behaviors.STURDYPOWDER, + tempHigh:175, + stateHigh: "meat", + tempLow: -50, + stateLow: "frozen_meat", + burn: 20, + burnTime: 60, + burnInto: "meat", + category:"flesh", + hidden: true, + breakInto: "blood", + state: "solid", + density: 462 +} + +elements.solid_flesh = { + color: ["#7c2617","#984227","#c72114","#b0634a","#802720"], + behavior: behaviors.WALL, + tempHigh:175, + stateHigh: "meat", + tempLow: -50, + stateLow: "frozen_meat", + burn: 20, + burnTime: 60, + burnInto: "meat", + category:"flesh", + hidden: true, + breakInto: ["blood","meat","meat"], + state: "solid", + density: 462 +} + +elements.flesh_beast = { + color: ["#9e4839","#ba6449","#a14940"], + behavior: [ + "XX|CR:mucus%0.05 AND M2%1.5|M2%5 AND SW:mucus%14", + "XX|FX%2|M2 AND BO", + "XX|M1|M2 AND SW:mucus%14", + ], + reactions: { + "cell": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, + "head": { elem2:"flesh_mound", chance:0.001, func:behaviors.FEEDPIXEL }, + "body": { elem2:"flesh_mound", chance:0.001, func:behaviors.FEEDPIXEL }, + "frog": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, + "tadpole": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, + "fish": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, + "rat": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, + "bird": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, + "bone": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, + "bone_marrow": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, + "skin": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, + "sugar": { elem2:"flesh_mound", chance:0.04, func:behaviors.FEEDPIXEL }, + "sugar_water": { elem2:"flesh_mound", chance:0.05, func:behaviors.FEEDPIXEL }, + "plant": { elem2:["dead_plant","flesh_mound",null], chance:0.005, func:behaviors.FEEDPIXEL }, + "grass": { elem2:["dead_plant","flesh_mound",null], chance:0.005, func:behaviors.FEEDPIXEL }, + "oxygen": { elem2:"carbon_dioxide", chance:0.5 }, + "meat": { elem2:"flesh_mound", chance:0.1, func:behaviors.FEEDPIXEL }, + "cooked_meat": { elem2:"flesh_mound", chance:0.1, func:behaviors.FEEDPIXEL }, + "cured_meat": { elem2:"flesh_mound", chance:0.1, func:behaviors.FEEDPIXEL }, + "cheese": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "rotten_cheese": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "melted_cheese": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "tomato": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "sauce": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "vine": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "evergreen": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "algae": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "grass_seed": { elem2:null, chance:0.3 , func:behaviors.FEEDPIXEL}, + "wheat_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "wheat": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "potato_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "potato": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "corn_seed": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "corn": { elem2:null, chance:0.1 , func:behaviors.FEEDPIXEL}, + "lichen": { elem2:null, chance:0.04, func:behaviors.FEEDPIXEL }, + "flower_seed": { elem2:null, chance:0.4 , func:behaviors.FEEDPIXEL}, + "flour": { elem2:null, chance:0.1 , func:behaviors.FEEDPIXEL}, + "dough": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "bread": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "toast": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "gingerbread": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "rice": { elem2:null, chance:0.1 , func:behaviors.FEEDPIXEL}, + "yogurt": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "beans": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "salt": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "sugar": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "crumb": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "herb": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "popcorn": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "candy": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "caramel": { elem2:null, chance:0.4, func:behaviors.FEEDPIXEL }, + "lichen": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "egg": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "yolk": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "eggnog": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "milk": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "grape": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "batter": { elem2:null, chance:0.25, func:behaviors.FEEDPIXEL }, + "baked_batter": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "butter": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "melted_butter": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "lettuce": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "baked_potato": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "ice_cream": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "cream": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "pumpkin": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "pumpkin_seed": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "coffee_bean": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "coffee_ground": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut_meat": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut_butter": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "jelly": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "worm": { elem2:"flesh_mound", chance:0.1, func:behaviors.FEEDPIXEL }, + "ant": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "frog": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, + "snail": { elem2:"flesh_mound", chance:0.1, func:behaviors.FEEDPIXEL }, + "slug": { elem2:"flesh_mound", chance:0.1, func:behaviors.FEEDPIXEL } + }, + egg: "flesh_beast", + category: "flesh", + temp: 37.6, + tempHigh: 120, + stateHigh: "rotten_meat", + tempLow: -18, + stateLow: "frozen_meat", + breakInto: ["mucus","rotten_meat"], + burn:80, + burnTime:150, + state: "solid", + density: 1450, + conduct: 0.25 +} + +elements.flesh_wood = { + color: ["#9e4839","#ba6449","#a14940"], + tick: function(pixel) { + if (!pixel.burning) { + if (!pixel.lc) { pixel.lc = "#7c2617" } + if (!pixel.wc) { pixel.wc = "#ba6449" } + if (isEmpty(pixel.x-1,pixel.y-1) && Math.random() < 0.02) { + if (Math.random() < 0.55) { + createPixel("solid_flesh",pixel.x-1,pixel.y-1); + pixelMap[pixel.x-1][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x-1][pixel.y-1], pixel.lc); + } + else { + createPixel("flesh_wood",pixel.x-1,pixel.y-1); + pixelMap[pixel.x-1][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x-1][pixel.y-1], pixel.wc); + pixelMap[pixel.x-1][pixel.y-1].wc = pixel.wc; + pixelMap[pixel.x-1][pixel.y-1].lc = pixel.lc; + } + } + if (isEmpty(pixel.x+1,pixel.y-1) && Math.random() < 0.02) { + if (Math.random() < 0.55) { + createPixel("solid_flesh",pixel.x+1,pixel.y-1); + pixelMap[pixel.x+1][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x+1][pixel.y-1], pixel.lc); + } + else { + createPixel("flesh_wood",pixel.x+1,pixel.y-1); + pixelMap[pixel.x+1][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x+1][pixel.y-1], pixel.wc); + pixelMap[pixel.x+1][pixel.y-1].wc = pixel.wc; + pixelMap[pixel.x+1][pixel.y-1].lc = pixel.lc; + } + } + if (isEmpty(pixel.x,pixel.y-1) && Math.random() < 0.02) { + if (Math.random() < 0.8) { + createPixel("solid_flesh",pixel.x,pixel.y-1); + pixelMap[pixel.x][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x][pixel.y-1], pixel.lc); + } + else { + createPixel("flesh_wood",pixel.x,pixel.y-1); + pixelMap[pixel.x][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x][pixel.y-1], pixel.wc); + pixelMap[pixel.x][pixel.y-1].wc = pixel.wc; + pixelMap[pixel.x][pixel.y-1].lc = pixel.lc; + } + } + } + doDefaults(pixel); + }, + renderer: renderPresets.WOODCHAR, + movable: false, + tempHigh: 175, + stateHigh: "meat", + tempLow: -30, + stateLow: "meat", + category: "flesh", + burn: 2, + burnTime: 300, + burnInto: ["blood","ash","cooked_meat","ash"], + hidden: true, + state: "solid", + density: 1500, + hardness: 0.15, + breakInto: ["blood","meat"], + forceSaveColor: true +} + +elements.mucus = { + color: ["#81cf63","#81cf63","#81cf63","#81cf63","#81cf63","#81cf63","#439809","#258b08","#118511","#127b12","#136d14"], + behavior: [ + "XX|DB%1 AND SW:flesh_mound%90|XX", + "DB%1 AND M2%25|DL%0.001|DB%1 AND M2%25", + "DB%1 AND M2%25|DB%2 AND M1|DB%1 AND M2%25", + ], + ignore: ["flesh_beast","flesh_mound","vein_root","glass","rad_glass","glass_shard","rad_shard","stained_glass","baked_clay","acid","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: { + "ash": { elem1:null, elem2:null }, + "limestone": { elem1:null, elem2:["calcium","carbon_dioxide"] }, + "quicklime": { elem1:null, elem2:null }, + "slaked_lime": { elem1:null, elem2:null }, + "borax": { elem1:null, elem2:null }, + "ammonia": { elem1:null, elem2:null }, + "bleach": { elem1:null, elem2:null }, + "cement": { elem1:null, elem2:null }, + "caustic_potash": { elem1:"water", elem2:"potassium_salt" }, + "bone": { elem2:"flesh_mound", chance:0.01 }, + "water": { elem1:null, elem2:"dirty_water" }, + "salt_water": { elem1:null, elem2:"water" }, + "sugar_water": { elem1:null, elem2:"water" }, + "plant": { elem2:["dead_plant","flesh_mound"], chance:0.005 }, + "grass": { elem2:["dead_plant","flesh_mound"], chance:0.005 }, + "tree_branch": { elem1:null, elem2:["wood","wood","dead_plant","flesh_mound"] }, + "charcoal": { elem1:null, elem2:"carbon_dioxide" }, + "rock": { elem1:null, elem2:"sand", chance:0.05 }, + "baking_soda": { elem1:"salt_water", elem2:["carbon_dioxide","foam"] }, + "calcium": { elem1:"chlorine", elem2:"hydrogen", chance:0.01 }, + "zinc": { elem1:"hydrogen", elem2:null, chance:0.03 }, + "sugar": { elem1:"steam", elem2:"carbon_dioxide" }, + }, + tempHigh: 120, + stateHigh: ["steam","steam","salt"], + tempLow: 0, + category:"liquids", + state: "liquid", + density: 1450, + stain: 0.05 +} \ No newline at end of file From e59ed7cf6c6b0e66992b24f5638f3d6b599e3c2d Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Mon, 14 Oct 2024 20:21:29 -0700 Subject: [PATCH 18/28] Bugfixes and more flesh content --- mods/flesh_infection.js | 307 +++++++++++++++++++++++++++++++++------- 1 file changed, 256 insertions(+), 51 deletions(-) diff --git a/mods/flesh_infection.js b/mods/flesh_infection.js index 2755d0b9..8ee771aa 100644 --- a/mods/flesh_infection.js +++ b/mods/flesh_infection.js @@ -1,15 +1,110 @@ -eLists.FESTER = ["dirt","rock","rock_wall","basalt","limestone","steel","iron","dead_bug","mud","sand","wet_sand","clay_soil","clay","mycelium","skin","meat","rotten_meat","wood","ant_wall","dead_plant","plant","hair","bone","cancer","straw","cloth","brick","bamboo","sponge","paper","plastic","concrete"], +// by Nekonico -elements.jaws = { +eLists.FESTER = ["fleshy_dirt","dirt","rock","rock_wall","basalt","limestone","steel","iron","dead_bug","mud","sand","wet_sand","clay_soil","clay","mycelium","skin","meat","rotten_meat","wood","ant_wall","dead_plant","plant","hair","bone","cancer","straw","cloth","brick","bamboo","sponge","paper","plastic","concrete"], + +elements.fleshy_dirt = { + color: ["#81512F","#895933","#825231","#906159"], + behavior: [ + "CH:dirt,mud>fleshy_dirt%1|CH:grass>flesh_mound%0.5 AND CH:root>vein_root%0.5 AND CH:fiber>fibrous_flesh%0.5|CH:dirt,mud>fleshy_dirt%1", + "XX|XX|XX", + "M2 AND CH:dirt,mud>fleshy_dirt%1|M1 AND CH:dirt,mud>fleshy_dirt%0.5|M2 AND CH:dirt,mud>fleshy_dirt%1", + ], + category: "flesh", + state: "solid", + density: 2000, + tempHigh: 225, + stateHigh: "dirt", + tempLow: -50, + stateLow: "permafrost", + burn: 20, + burnTime: 40, + burnInto: "dirt", +}; + +elements.teeth = { color: "#d9d9d9", behavior: [ - "XX|ST:flesh_mound AND SM%0.75|XX", + "XX|SM%0.75|XX", "ST:flesh_mound|XX|ST:flesh_mound", "XX|ST:flesh_mound AND M1|XX", ], reactions: { - "sugar": { "elem1": "quicklime", "elem2": null, "chance": 0.003 }, - "acid": { "elem1": "quicklime", "elem2": null }, + "acid": { elem1: "quicklime", elem2: null }, + "head": { elem2:["flesh_mound",null,null,null], chance:0.01 }, + "body": { elem2:["flesh_mound",null,null,null], chance:0.01 }, + "frog": { elem2:["flesh_mound",null,null,null], chance:0.05 }, + "tadpole": { elem2:["flesh_mound",null,null,null], chance:0.05 }, + "fish": { elem2:["flesh_mound",null,null,null], chance:0.05 }, + "rat": { elem2:["flesh_mound",null,null,null], chance:0.05 }, + "bird": { elem2:["flesh_mound",null,null,null], chance:0.05 }, + "worm": { elem2:["flesh_mound",null], chance:0.1 }, + "fly": { elem2:["flesh_mound",null], chance:0.1 }, + "ant": { elem2:["flesh_mound",null], chance:0.1 }, + "frog": { elem2:["flesh_mound",null], chance:0.05 }, + "snail": { elem2:["flesh_mound","quicklime"] }, + "slug": { elem2:["flesh_mound",null], chance:0.1 }, + "meat": { elem2:["flesh_mound",null,null,null], chance:0.1 }, + "blood": { elem2:null, chance:0.05 }, + "infection": { elem2:null, chance:0.04 }, + "bone": { elem2:null, chance:0.1 }, + "cooked_meat": { elem2:null, chance:0.1 }, + "rotten_meat": { elem2:null, chance:0.1 }, + "sugar": { elem2:null, chance:0.1 }, + "broth": { elem2:null, chance:0.2 }, + "yolk": { elem2:null, chance:0.1 }, + "hard_yolk": { elem2:null, chance:0.1 }, + "dough": { elem2:null, chance:0.1 }, + "batter": { elem2:null, chance:0.2 }, + "butter": { elem2:null, chance:0.1 }, + "melted_butter": { elem2:null, chance:0.2 }, + "chocolate": { elem2:null, chance:0.2 }, + "melted_chocolate": { elem2:null, chance:0.3 }, + "grape": { elem2:null, chance:0.1 }, + "tomato": { elem2:null, chance:0.1 }, + "herb": { elem2:null, chance:0.1 }, + "lettuce": { elem2:null, chance:0.1 }, + "corn": { elem2:null, chance:0.1 }, + "popcorn": { elem2:null, chance:0.15 }, + "potato": { elem2:null, chance:0.1 }, + "baked_potato": { elem2:null, chance:0.15 }, + "bread": { elem2:null, chance:0.1 }, + "toast": { elem2:null, chance:0.1 }, + "gingerbread": { elem2:null, chance:0.1 }, + "baked_batter": { elem2:null, chance:0.2 }, + "wheat": { elem2:null, chance:0.1 }, + "candy": { elem2:null, chance:0.1 }, + "yogurt": { elem2:null, chance:0.2 }, + "frozen_yogurt": { elem2:null, chance:0.1 }, + "ice_cream": { elem2:null, chance:0.2 }, + "beans": { elem2:null, chance:0.2 }, + "tea": { elem2:null, chance:0.2 }, + "coffee": { elem2:null, chance:0.2 }, + "milk": { elem2:null, chance:0.2 }, + "cream": { elem2:null, chance:0.2 }, + "soda": { elem2:null, chance:0.2 }, + "chocolate_milk": { elem2:null, chance:0.2 }, + "fruit_milk": { elem2:null, chance:0.2 }, + "pilk": { elem2:null, chance:0.2 }, + "eggnog": { elem2:null, chance:0.2 }, + "juice": { elem2:null, chance:0.2 }, + "cheese": { elem2:null, chance:0.1 }, + "melted_cheese": { elem2:null, chance:0.2 }, + "alcohol": { elem2:null, chance:0.2 }, + "antidote": { elem2:null, chance:0.2 }, + "honey": { elem2:null, chance:0.2 }, + "caramel": { elem2:null, chance:0.2 }, + "molasses": { elem2:null, chance:0.05 }, + "ketchup": { elem2:null, chance:0.1 }, + "pumpkin_seed": { elem2:null, chance:0.1 }, + "nut": { elem2:null, chance:0.1 }, + "nut_meat": { elem2:null, chance:0.1 }, + "nut_butter": { elem2:null, chance:0.1 }, + "nut_milk": { elem2:null, chance:0.2 }, + "jelly": { elem2:null, chance:0.2 }, + "mayo": { elem2:null, chance:0.2 }, + "mashed_potato": { elem2:null, chance:0.2 }, + "sauce": { elem2:null, chance:0.2 }, + "pickle": { elem2:null, chance:0.1 }, }, category:"flesh", tempHigh: 1000, @@ -19,39 +114,39 @@ elements.jaws = { hardness: 0.5, breakInto: ["flesh_mound","quicklime"], hidden: true, - ignore: ["jaws","flesh_mound","flesh_beast","solid_flesh","flesh_wood"] + excludeRandom: true, }, elements.flesh_mound = { color: ["#9e4839","#ba6449","#d2856c","#a14940","#E94336"], behavior: [ - "XX|CR:mucus%0.005|XX", - "CR:mucus%0.005|XX|CR:mucus%0.005", - "XX|CR:mucus%0.005|XX", + "XX|CR:acidic_bile%0.005 AND CH:grass>flesh_mound%0.5 AND CR:fleshwood_sapling%0.0001|XX", + "CR:acidic_bile%0.005 AND CH:grass>flesh_mound%0.5|XX|CR:acidic_bile%0.005 AND CH:grass>flesh_mound%0.5", + "XX|CR:acidic_bile%0.005 AND CH:grass>flesh_mound%0.5 AND CH:dirt>fleshy_dirt%0.5|XX", ], tick: function(pixel) { if (pixel.start === pixelTicks && pixel.fruit === undefined && !pixel.stop) { if (Math.random() < 0.95) { - pixel.fruit = Math.random() < 0.75 ? "flesh_beast" : "jaw"; + pixel.fruit = Math.random() < 0.75 ? "flesh_beast" : "teeth"; } - else { pixel.fruit = null } + else { pixel.fruit = "acidic_bile" } } if (!isEmpty(pixel.x-1,pixel.y,true)) { if (pixelMap[pixel.x-1][pixel.y].fruit === undefined && pixelMap[pixel.x-1][pixel.y].element === "flesh_mound") { pixelMap[pixel.x-1][pixel.y].fruit = pixel.fruit; } } - else if (!isEmpty(pixel.x+1,pixel.y,true)) { + if (!isEmpty(pixel.x+1,pixel.y,true)) { if (pixelMap[pixel.x+1][pixel.y].fruit === undefined && pixelMap[pixel.x+1][pixel.y].element === "flesh_mound") { pixelMap[pixel.x+1][pixel.y].fruit = pixel.fruit; } } - else if (!isEmpty(pixel.x,pixel.y+1,true)) { + if (!isEmpty(pixel.x,pixel.y+1,true)) { if (pixelMap[pixel.x][pixel.y+1].fruit === undefined && pixelMap[pixel.x][pixel.y+1].element === "flesh_mound") { pixelMap[pixel.x][pixel.y+1].fruit = pixel.fruit; } } - else if (!isEmpty(pixel.x,pixel.y-1,true)) { + if (!isEmpty(pixel.x,pixel.y-1,true)) { if (pixelMap[pixel.x][pixel.y-1].fruit === undefined && pixelMap[pixel.x][pixel.y-1].element === "flesh_mound") { pixelMap[pixel.x][pixel.y-1].fruit = pixel.fruit; } @@ -141,6 +236,7 @@ elements.flesh_mound = { pixel.age++; doDefaults(pixel); }, + ignore: ["teeth","flesh_mound","flesh_beast"], renderer: renderPresets.PLANTCHAR, properties: { "h": 0, @@ -150,10 +246,21 @@ elements.flesh_mound = { }, reactions: { "cell": { elem2:"flesh_mound", chance:0.005 }, + "skin": { elem2:"flesh_mound", chance:0.005 }, "sugar_water": { elem2:"flesh_mound", chance:0.05 }, - "mucus": { elem2:null, chance:0.005 }, - "plant": { elem2:["dead_plant","flesh_mound"], chance:0.005 }, - "grass": { elem2:["dead_plant","flesh_mound"], chance:0.005 }, + "acidic_bile": { elem2:null, chance:0.005 }, + "plant": { elem2:["dead_plant","solid_flesh"], chance:0.005 }, + "dead_plant": { elem2:"flesh_mound", chance:0.005 }, + "sapling": { elem2:"fleshwood_sapling", chance:0.005 }, + "wood": { elem2:"dry_fleshwood", chance:0.005 }, + "tree_branch": { elem2:"fleshwood", chance:0.005 }, + "head": { elem2:"flesh_mound", chance:0.001}, + "body": { elem2:"flesh_mound", chance:0.001 }, + "frog": { elem2:"flesh_mound", chance:0.005 }, + "tadpole": { elem2:"flesh_mound", chance:0.005 }, + "fish": { elem2:"flesh_mound", chance:0.005 }, + "rat": { elem2:"flesh_mound", chance:0.005 }, + "bird": { elem2:"flesh_mound", chance:0.005 }, }, tempHigh: 100, stateHigh: "meat", @@ -172,7 +279,7 @@ elements.vein_root = { behavior: [ "XX|XX|XX", "XX|XX|XX", - "CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand,skin,meat,rotten_meat,concrete,dead_plant,dead_bug,root>vein_root,fibrous_flesh%0.5 AND CR:vein_root%0.005|CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand,skin,meat,rotten_meat,concrete,dead_plant,dead_bug,root>vein_root,fibrous_flesh,fibrous_flesh%0.5|CH:dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand,skin,meat,rotten_meat,concrete,dead_plant,dead_bug,root>vein_root,fibrous_flesh%0.5 AND CR:vein_root%0.005", + "CH:fleshy_dirt,dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand,skin,meat,rotten_meat,concrete,dead_plant,dead_bug,root>vein_root,fibrous_flesh%0.5 AND CR:vein_root%0.005|CH:fleshy_dirt,dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand,skin,meat,rotten_meat,concrete,dead_plant,dead_bug,root>vein_root,fibrous_flesh,fibrous_flesh%0.5|CH:fleshy_dirt,dirt,mud,sand,wet_sand,clay_soil,clay,mycelium,grass,color_sand,skin,meat,rotten_meat,concrete,dead_plant,dead_bug,root>vein_root,fibrous_flesh%0.5 AND CR:vein_root%0.005", ], reactions: { "rock": { elem2:"sand", chance:0.0008 }, @@ -181,7 +288,7 @@ elements.vein_root = { "water": { elem2:null, chance:0.001 }, "blood": { elem2:null, chance:0.01 }, "sugar_water": { elem2:null, chance:0.0025 }, - "mucus": { elem2:null, chance:0.0025 } + "acidic_bile": { elem2:null, chance:0.0025 } }, tempHigh: 175, stateHigh: "meat", @@ -218,6 +325,12 @@ elements.fibrous_flesh = { elements.solid_flesh = { color: ["#7c2617","#984227","#c72114","#b0634a","#802720"], behavior: behaviors.WALL, + reactions: { + "plant": { elem2:["dead_plant","solid_flesh"], chance:0.005 }, + "grass": { elem2:["dead_plant","flesh_mound"], chance:0.005 }, + "tree_branch": { elem1:null, elem2:"fleshwood" }, + "sapling": { elem2:"fleshwood_sapling", chance:0.005 }, + }, tempHigh:175, stateHigh: "meat", tempLow: -50, @@ -235,30 +348,30 @@ elements.solid_flesh = { elements.flesh_beast = { color: ["#9e4839","#ba6449","#a14940"], behavior: [ - "XX|CR:mucus%0.05 AND M2%1.5|M2%5 AND SW:mucus%14", - "XX|FX%2|M2 AND BO", - "XX|M1|M2 AND SW:mucus%14", + "XX|CR:acidic_bile%0.05 AND M2%0.5|M2%5 AND SW:acidic_bile,meat,rotten_meat,blood%14", + "XX|FX%2|M2%50 AND BO", + "XX|M1|M2%50 AND SW:acidic_bile,meat,rotten_meat,blood%14", ], reactions: { - "cell": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, - "head": { elem2:"flesh_mound", chance:0.001, func:behaviors.FEEDPIXEL }, - "body": { elem2:"flesh_mound", chance:0.001, func:behaviors.FEEDPIXEL }, - "frog": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, - "tadpole": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, - "fish": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, - "rat": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, - "bird": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, - "bone": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, - "bone_marrow": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, + "cell": { elem2:"flesh_mound", chance:0.05, func:behaviors.FEEDPIXEL }, + "head": { elem2:["flesh_mound",null], chance:0.01, func:behaviors.FEEDPIXEL }, + "body": { elem2:["flesh_mound",null], chance:0.01, func:behaviors.FEEDPIXEL }, + "frog": { elem2:["flesh_mound",null], chance:0.05, func:behaviors.FEEDPIXEL }, + "tadpole": { elem2:["flesh_mound",null], chance:0.05, func:behaviors.FEEDPIXEL }, + "fish": { elem2:["flesh_mound",null], chance:0.05, func:behaviors.FEEDPIXEL }, + "rat": { elem2:["flesh_mound",null], chance:0.05, func:behaviors.FEEDPIXEL }, + "bird": { elem2:["flesh_mound",null], chance:0.05, func:behaviors.FEEDPIXEL }, + "bone": { elem2:"quicklime", chance:0.005, func:behaviors.FEEDPIXEL }, + "bone_marrow": { elem2:["flesh_mound","quicklime"], chance:0.005, func:behaviors.FEEDPIXEL }, "skin": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, - "sugar": { elem2:"flesh_mound", chance:0.04, func:behaviors.FEEDPIXEL }, - "sugar_water": { elem2:"flesh_mound", chance:0.05, func:behaviors.FEEDPIXEL }, + "sugar": { elem2:null, chance:0.04, func:behaviors.FEEDPIXEL }, + "sugar_water": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, "plant": { elem2:["dead_plant","flesh_mound",null], chance:0.005, func:behaviors.FEEDPIXEL }, "grass": { elem2:["dead_plant","flesh_mound",null], chance:0.005, func:behaviors.FEEDPIXEL }, "oxygen": { elem2:"carbon_dioxide", chance:0.5 }, - "meat": { elem2:"flesh_mound", chance:0.1, func:behaviors.FEEDPIXEL }, - "cooked_meat": { elem2:"flesh_mound", chance:0.1, func:behaviors.FEEDPIXEL }, - "cured_meat": { elem2:"flesh_mound", chance:0.1, func:behaviors.FEEDPIXEL }, + "meat": { elem2:["flesh_mound",null], chance:0.01, func:behaviors.FEEDPIXEL }, + "cooked_meat": { elem2:["flesh_mound",null,null,null], chance:0.1, func:behaviors.FEEDPIXEL }, + "rotten_meat": { elem2:["flesh_mound","plague",null,null], chance:0.1, func:behaviors.FEEDPIXEL }, "cheese": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, "rotten_cheese": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, "melted_cheese": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, @@ -313,12 +426,17 @@ elements.flesh_beast = { "nut_meat": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, "nut_butter": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, "jelly": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "worm": { elem2:"flesh_mound", chance:0.1, func:behaviors.FEEDPIXEL }, - "ant": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, - "frog": { elem2:"flesh_mound", chance:0.005, func:behaviors.FEEDPIXEL }, - "snail": { elem2:"flesh_mound", chance:0.1, func:behaviors.FEEDPIXEL }, - "slug": { elem2:"flesh_mound", chance:0.1, func:behaviors.FEEDPIXEL } + "worm": { elem2:["flesh_mound",null], chance:0.1, func:behaviors.FEEDPIXEL }, + "fly": { elem2:["flesh_mound",null], chance:0.1, func:behaviors.FEEDPIXEL }, + "ant": { elem2:["flesh_mound",null], chance:0.1, func:behaviors.FEEDPIXEL }, + "frog": { elem2:["flesh_mound",null], chance:0.05, func:behaviors.FEEDPIXEL }, + "snail": { elem2:["flesh_mound","quicklime"], chance:0.1, func:behaviors.FEEDPIXEL }, + "slug": { elem2:["flesh_mound",null], chance:0.1, func:behaviors.FEEDPIXEL }, + "sapling": { elem2:"fleshwood_sapling", chance:0.005 }, + "wood": { elem2:"dry_fleshwood", chance:0.005 }, + "tree_branch": { elem2:"fleshwood", chance:0.005 }, }, + foodNeed: 2, egg: "flesh_beast", category: "flesh", temp: 37.6, @@ -326,7 +444,7 @@ elements.flesh_beast = { stateHigh: "rotten_meat", tempLow: -18, stateLow: "frozen_meat", - breakInto: ["mucus","rotten_meat"], + breakInto: ["acidic_bile","rotten_meat"], burn:80, burnTime:150, state: "solid", @@ -334,7 +452,63 @@ elements.flesh_beast = { conduct: 0.25 } -elements.flesh_wood = { +elements.fleshwood_sapling = { + color: ["#7c2617","#984227","#c72114","#b0634a","#802720"], + tick: function(pixel) { + if (!tryMove(pixel,pixel.x,pixel.y+1)) { + if (Math.random() < 0.02 && pixel.age > 50 && pixel.temp < 100) { + if (!outOfBounds(pixel.x,pixel.y+1)) { + var dirtPixel = pixelMap[pixel.x][pixel.y+1]; + if (dirtPixel && (eLists.FESTER.indexOf(dirtPixel.element) !== -1 || dirtPixel.element === "grass")) { + changePixel(dirtPixel,"vein_root"); + } + } + if (isEmpty(pixel.x,pixel.y-1)) { + if (!pixel.wc) { + var c = Math.random(); + if (c < 0.01) { pixel.wc="#632e1f"; pixel.lc="#7c2617" } + else if (c < 0.05) { pixel.wc="#9e4839"; pixel.lc="#7c2617" } + else if (c < 0.1) { pixel.wc="#9e4839"; pixel.lc="#984227" } + else if (c < 0.2) { pixel.wc="#a14940"; pixel.lc="#984227" } + else if (c < 0.3) { pixel.wc="#ba6449"; pixel.lc="#c72114" } + else if (c < 0.4) { pixel.wc="#a14940"; pixel.lc="#c72114" } + else if (c < 0.45) { pixel.wc="#ba6449"; pixel.lc="#b0634a" } + else if (c < 0.5) { pixel.wc="#a14940"; pixel.lc="#b0634a" } + else { pixel.wc="#9e4839"; pixel.lc="#802720" } + pixel.color = pixelColorPick(pixel, pixel.lc); + } + movePixel(pixel,pixel.x,pixel.y-1); + createPixel(Math.random() > 0.5 ? "dry_fleshwood" : "fleshwood",pixel.x,pixel.y+1); + pixelMap[pixel.x][pixel.y+1].wc = pixel.wc; + pixelMap[pixel.x][pixel.y+1].lc = pixel.lc; + pixelMap[pixel.x][pixel.y+1].color = pixelColorPick(pixelMap[pixel.x][pixel.y+1], pixel.wc); + } + } + else if (pixel.age > 1000 && Math.random() < 0.05) { + changePixel(pixel,"dry_fleshwood"); + pixel.color = pixelColorPick(pixel, pixel.wc); + } + pixel.age++; + } + doDefaults(pixel); + }, + properties: { + "age":0 + }, + tempHigh: 100, + stateHigh: "meat", + tempLow: -25, + stateLow: "meat", + burn: 65, + burnTime: 15, + category: "flesh", + state: "solid", + density: 1500, + cooldown: defaultCooldown, + seed: true +} + +elements.fleshwood = { color: ["#9e4839","#ba6449","#a14940"], tick: function(pixel) { if (!pixel.burning) { @@ -346,7 +520,7 @@ elements.flesh_wood = { pixelMap[pixel.x-1][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x-1][pixel.y-1], pixel.lc); } else { - createPixel("flesh_wood",pixel.x-1,pixel.y-1); + createPixel("fleshwood",pixel.x-1,pixel.y-1); pixelMap[pixel.x-1][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x-1][pixel.y-1], pixel.wc); pixelMap[pixel.x-1][pixel.y-1].wc = pixel.wc; pixelMap[pixel.x-1][pixel.y-1].lc = pixel.lc; @@ -358,7 +532,7 @@ elements.flesh_wood = { pixelMap[pixel.x+1][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x+1][pixel.y-1], pixel.lc); } else { - createPixel("flesh_wood",pixel.x+1,pixel.y-1); + createPixel("fleshwood",pixel.x+1,pixel.y-1); pixelMap[pixel.x+1][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x+1][pixel.y-1], pixel.wc); pixelMap[pixel.x+1][pixel.y-1].wc = pixel.wc; pixelMap[pixel.x+1][pixel.y-1].lc = pixel.lc; @@ -370,7 +544,7 @@ elements.flesh_wood = { pixelMap[pixel.x][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x][pixel.y-1], pixel.lc); } else { - createPixel("flesh_wood",pixel.x,pixel.y-1); + createPixel("fleshwood",pixel.x,pixel.y-1); pixelMap[pixel.x][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x][pixel.y-1], pixel.wc); pixelMap[pixel.x][pixel.y-1].wc = pixel.wc; pixelMap[pixel.x][pixel.y-1].lc = pixel.lc; @@ -380,6 +554,12 @@ elements.flesh_wood = { doDefaults(pixel); }, renderer: renderPresets.WOODCHAR, + reactions: { + "plant": { elem2:["dead_plant","solid_flesh"], chance:0.005 }, + "grass": { elem2:["dead_plant","flesh_mound"], chance:0.005 }, + "tree_branch": { elem1:null, elem2:"fleshwood" }, + "sapling": { elem2:"fleshwood_sapling", chance:0.005 }, + }, movable: false, tempHigh: 175, stateHigh: "meat", @@ -397,7 +577,31 @@ elements.flesh_wood = { forceSaveColor: true } -elements.mucus = { +elements.dry_fleshwood = { + color: ["#9e4839","#ba6449","#a14940"], + behavior: behaviors.WALL, + renderer: renderPresets.WOODCHAR, + reactions: { + "plant": { elem2:["dead_plant","solid_flesh"], chance:0.005 }, + "grass": { elem2:["dead_plant","flesh_mound"], chance:0.005 }, + "tree_branch": { elem1:null, elem2:"fleshwood" }, + "sapling": { elem2:"fleshwood_sapling", chance:0.005 }, + }, + tempHigh: 400, + stateHigh: ["ash","cooked_meat","fire","fire","fire"], + tempLow: -30, + stateLow: "meat", + category: "solids", + burn: 5, + burnTime: 300, + burnInto: ["ash","cooked_meat","fire"], + state: "solid", + hardness: 0.15, + breakInto: ["blood","meat"], + forceSaveColor: true +} + +elements.acidic_bile = { color: ["#81cf63","#81cf63","#81cf63","#81cf63","#81cf63","#81cf63","#439809","#258b08","#118511","#127b12","#136d14"], behavior: [ "XX|DB%1 AND SW:flesh_mound%90|XX", @@ -421,19 +625,20 @@ elements.mucus = { "sugar_water": { elem1:null, elem2:"water" }, "plant": { elem2:["dead_plant","flesh_mound"], chance:0.005 }, "grass": { elem2:["dead_plant","flesh_mound"], chance:0.005 }, - "tree_branch": { elem1:null, elem2:["wood","wood","dead_plant","flesh_mound"] }, + "tree_branch": { elem1:null, elem2:["dry_fleshwood","dry_fleshwood","dead_plant","fleshwood"] }, "charcoal": { elem1:null, elem2:"carbon_dioxide" }, "rock": { elem1:null, elem2:"sand", chance:0.05 }, "baking_soda": { elem1:"salt_water", elem2:["carbon_dioxide","foam"] }, "calcium": { elem1:"chlorine", elem2:"hydrogen", chance:0.01 }, "zinc": { elem1:"hydrogen", elem2:null, chance:0.03 }, "sugar": { elem1:"steam", elem2:"carbon_dioxide" }, + "sapling": { elem2:"fleshwood_sapling", chance:0.005 }, }, tempHigh: 120, stateHigh: ["steam","steam","salt"], tempLow: 0, - category:"liquids", + category:"flesh", state: "liquid", density: 1450, stain: 0.05 -} \ No newline at end of file +} From 927376734e7a24167f6e3be9d0251d2411160a10 Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Tue, 15 Oct 2024 19:21:29 -0700 Subject: [PATCH 19/28] Moveable cubes --- mods/moveable_cubes.js | 258 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 258 insertions(+) create mode 100644 mods/moveable_cubes.js diff --git a/mods/moveable_cubes.js b/mods/moveable_cubes.js new file mode 100644 index 00000000..139d7ac2 --- /dev/null +++ b/mods/moveable_cubes.js @@ -0,0 +1,258 @@ +elements.steel_cube = { + color: "#71797e", + colorKey: { + "L":"#888f94", + "B":"#71797e" + }, + colorPattern: [ + "BBLB", + "BBBL", + "BLBB", + "LBBB" + ], + reactions: { + "water": { elem1:"rust", chance:0.002 }, + "salt_water": { elem1:"rust", chance:0.004 }, + "dirty_water": { elem1:"rust", chance:0.03 }, + "pool_water": { elem1:"rust", chance:0.03 }, + "sugar_water": { elem1:"rust", chance:0.003 }, + "seltzer": { elem1:"rust", chance:0.005 }, + "salt": { elem1:"rust", chance:0.003 }, + "blood": { elem1:"rust", chance:0.002 }, + "infection": { elem1:"rust", chance:0.002 }, + "antibody": { elem1:"rust", chance:0.002 }, + "coffee": { elem1:"rust", chance:0.0002 }, + "tea": { elem1:"rust", chance:0.0002 }, + "broth": { elem1:"rust", chance:0.0002 }, + "juice": { elem1:"rust", chance:0.0002 }, + "nut_milk": { elem1:"rust", chance:0.0002 }, + }, + tempHigh: 1455.5, + stateHigh: "molten_steel", + category: "cubes", + density: 7850, + conduct: 0.42, + hardness: 0.8, + tick: function(pixel) { + if (tryMove(pixel, pixel.x, pixel.y+1)) { // Fall + if (!isEmpty(pixel.x, pixel.y-2, true)) { + var cube2 = pixelMap[pixel.x][pixel.y-2]; + if (cube2.element == "steel") { + if (isEmpty(pixel.x, pixel.y-1)) { + movePixel(pixelMap[pixel.x][pixel.y-2], pixel.x, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x][pixel.y-2], pixelMap[pixel.x][pixel.y-1]); + } + } + } + if (!isEmpty(pixel.x+1, pixel.y-1, true)) { + var cube2 = pixelMap[pixel.x+1][pixel.y-1]; + if (cube2.element == "steel") { + if (isEmpty(pixel.x+1, pixel.y)) { + movePixel(pixelMap[pixel.x+1][pixel.y-1], pixel.x+1, pixel.y); + } + else { + swapPixels(pixelMap[pixel.x+1][pixel.y-1], pixelMap[pixel.x+1][pixel.y]); + } + } + } + if (!isEmpty(pixel.x+2, pixel.y-1, true)) { + var cube2 = pixelMap[pixel.x+2][pixel.y-1]; + if (cube2.element == "steel") { + if (isEmpty(pixel.x+2, pixel.y)) { + movePixel(pixelMap[pixel.x+2][pixel.y-1], pixel.x+2, pixel.y); + } + else { + swapPixels(pixelMap[pixel.x+2][pixel.y-1], pixelMap[pixel.x+2][pixel.y]); + } + } + } + if (!isEmpty(pixel.x-1, pixel.y-1, true)) { + var cube2 = pixelMap[pixel.x-1][pixel.y-1]; + if (cube2.element == "steel") { + if (isEmpty(pixel.x-1, pixel.y)) { + movePixel(pixelMap[pixel.x-1][pixel.y-1], pixel.x-1, pixel.y); + } + else { + swapPixels(pixelMap[pixel.x-1][pixel.y-1], pixelMap[pixel.x-1][pixel.y]); + } + } + } + if (!isEmpty(pixel.x-2, pixel.y-1, true)) { + var cube2 = pixelMap[pixel.x-2][pixel.y-1]; + if (cube2.element == "steel") { + if (isEmpty(pixel.x-2, pixel.y)) { + movePixel(pixelMap[pixel.x-2][pixel.y-1], pixel.x-2, pixel.y); + } + else { + swapPixels(pixelMap[pixel.x-2][pixel.y-1], pixelMap[pixel.x-2][pixel.y]); + } + } + } + if (!isEmpty(pixel.x+1, pixel.y-2, true)) { + var cube2 = pixelMap[pixel.x+1][pixel.y-2]; + if (cube2.element == "steel") { + if (isEmpty(pixel.x+1, pixel.y-1)) { + movePixel(pixelMap[pixel.x+1][pixel.y-2], pixel.x+1, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x+1][pixel.y-2], pixelMap[pixel.x+1][pixel.y-1]); + } + } + } + if (!isEmpty(pixel.x+2, pixel.y-2, true)) { + var cube2 = pixelMap[pixel.x+2][pixel.y-2]; + if (cube2.element == "steel") { + if (isEmpty(pixel.x+2, pixel.y-1)) { + movePixel(pixelMap[pixel.x+2][pixel.y-2], pixel.x+2, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x+2][pixel.y-2], pixelMap[pixel.x+2][pixel.y-1]); + } + } + } + if (!isEmpty(pixel.x-1, pixel.y-2, true)) { + var cube2 = pixelMap[pixel.x-1][pixel.y-2]; + if (cube2.element == "steel") { + if (isEmpty(pixel.x-1, pixel.y-1)) { + movePixel(pixelMap[pixel.x-1][pixel.y-2], pixel.x-1, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x-1][pixel.y-2], pixelMap[pixel.x-1][pixel.y-1]); + } + } + } + if (!isEmpty(pixel.x-2, pixel.y-2, true)) { + var cube2 = pixelMap[pixel.x-2][pixel.y-2]; + if (cube2.element == "steel") { + if (isEmpty(pixel.x-2, pixel.y-1)) { + movePixel(pixelMap[pixel.x-2][pixel.y-2], pixel.x-2, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x-2][pixel.y-2], pixelMap[pixel.x-2][pixel.y-1]); + } + } + } + } + } +} + +elements.wood_cube = { + color: "#a0522d", + behavior: behaviors.WALL, + renderer: renderPresets.WOODCHAR, + tempHigh: 400, + stateHigh: ["ember","charcoal","fire","fire","fire"], + category: "cubes", + burn: 5, + burnTime: 300, + burnInto: ["ember","charcoal","fire"], + state: "solid", + hardness: 0.15, + breakInto: "sawdust", + forceSaveColor: true, + tick: function(pixel) { + if (tryMove(pixel, pixel.x, pixel.y+1)) { // Fall + if (!isEmpty(pixel.x, pixel.y-2, true)) { + var cube2 = pixelMap[pixel.x][pixel.y-2]; + if (cube2.element == "wood") { + if (isEmpty(pixel.x, pixel.y-1)) { + movePixel(pixelMap[pixel.x][pixel.y-2], pixel.x, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x][pixel.y-2], pixelMap[pixel.x][pixel.y-1]); + } + } + } + if (!isEmpty(pixel.x+1, pixel.y-1, true)) { + var cube2 = pixelMap[pixel.x+1][pixel.y-1]; + if (cube2.element == "wood") { + if (isEmpty(pixel.x+1, pixel.y)) { + movePixel(pixelMap[pixel.x+1][pixel.y-1], pixel.x+1, pixel.y); + } + else { + swapPixels(pixelMap[pixel.x+1][pixel.y-1], pixelMap[pixel.x+1][pixel.y]); + } + } + } + if (!isEmpty(pixel.x+2, pixel.y-1, true)) { + var cube2 = pixelMap[pixel.x+2][pixel.y-1]; + if (cube2.element == "wood") { + if (isEmpty(pixel.x+2, pixel.y)) { + movePixel(pixelMap[pixel.x+2][pixel.y-1], pixel.x+2, pixel.y); + } + else { + swapPixels(pixelMap[pixel.x+2][pixel.y-1], pixelMap[pixel.x+2][pixel.y]); + } + } + } + if (!isEmpty(pixel.x-1, pixel.y-1, true)) { + var cube2 = pixelMap[pixel.x-1][pixel.y-1]; + if (cube2.element == "wood") { + if (isEmpty(pixel.x-1, pixel.y)) { + movePixel(pixelMap[pixel.x-1][pixel.y-1], pixel.x-1, pixel.y); + } + else { + swapPixels(pixelMap[pixel.x-1][pixel.y-1], pixelMap[pixel.x-1][pixel.y]); + } + } + } + if (!isEmpty(pixel.x-2, pixel.y-1, true)) { + var cube2 = pixelMap[pixel.x-2][pixel.y-1]; + if (cube2.element == "wood") { + if (isEmpty(pixel.x-2, pixel.y)) { + movePixel(pixelMap[pixel.x-2][pixel.y-1], pixel.x-2, pixel.y); + } + else { + swapPixels(pixelMap[pixel.x-2][pixel.y-1], pixelMap[pixel.x-2][pixel.y]); + } + } + } + if (!isEmpty(pixel.x+1, pixel.y-2, true)) { + var cube2 = pixelMap[pixel.x+1][pixel.y-2]; + if (cube2.element == "wood") { + if (isEmpty(pixel.x+1, pixel.y-1)) { + movePixel(pixelMap[pixel.x+1][pixel.y-2], pixel.x+1, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x+1][pixel.y-2], pixelMap[pixel.x+1][pixel.y-1]); + } + } + } + if (!isEmpty(pixel.x+2, pixel.y-2, true)) { + var cube2 = pixelMap[pixel.x+2][pixel.y-2]; + if (cube2.element == "wood") { + if (isEmpty(pixel.x+2, pixel.y-1)) { + movePixel(pixelMap[pixel.x+2][pixel.y-2], pixel.x+2, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x+2][pixel.y-2], pixelMap[pixel.x+2][pixel.y-1]); + } + } + } + if (!isEmpty(pixel.x-1, pixel.y-2, true)) { + var cube2 = pixelMap[pixel.x-1][pixel.y-2]; + if (cube2.element == "wood") { + if (isEmpty(pixel.x-1, pixel.y-1)) { + movePixel(pixelMap[pixel.x-1][pixel.y-2], pixel.x-1, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x-1][pixel.y-2], pixelMap[pixel.x-1][pixel.y-1]); + } + } + } + if (!isEmpty(pixel.x-2, pixel.y-2, true)) { + var cube2 = pixelMap[pixel.x-2][pixel.y-2]; + if (cube2.element == "wood") { + if (isEmpty(pixel.x-2, pixel.y-1)) { + movePixel(pixelMap[pixel.x-2][pixel.y-2], pixel.x-2, pixel.y-1); + } + else { + swapPixels(pixelMap[pixel.x-2][pixel.y-2], pixelMap[pixel.x-2][pixel.y-1]); + } + } + } + } + } +} \ No newline at end of file From 50a2ff0ed87c339c63d638faba2dc03b7117c250 Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Wed, 16 Oct 2024 19:56:47 -0700 Subject: [PATCH 20/28] Single Pixel Humans --- mods/single_humans.js | 147 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 mods/single_humans.js diff --git a/mods/single_humans.js b/mods/single_humans.js new file mode 100644 index 00000000..eebdb809 --- /dev/null +++ b/mods/single_humans.js @@ -0,0 +1,147 @@ +elements.single_human = { + color: ["#f3e7db","#f7ead0","#eadaba","#d7bd96","#a07e56","#825c43","#604134","#3a312a"], + category: "life", + tick: function(pixel) { + if (tryMove(pixel, pixel.x, pixel.y+1)) {} // Fall + doHeat(pixel); + doBurning(pixel); + doElectricity(pixel); + if (pixel.dead) { + // Turn into rotten_meat if pixelTicks-dead > 500 + if (pixelTicks-pixel.dead > 200 && Math.random() < 0.1) { + changePixel(pixel,"rotten_meat"); + } + return + } + + if (pixel.panic > 0) { + pixel.panic -= 0.1; + if (pixel.panic < 0) { pixel.panic = 0; } + } + + if (Math.random() < 0.1*(isEmpty(pixel.x, pixel.y+1) ? 1 : pixel.panic+1)) { // Move 10% chance + var movesToTry = [ + [1*pixel.dir,0], + [1*pixel.dir,-1], + ]; + // While movesToTry is not empty, tryMove(pixel, x, y) with a random move, then remove it. if tryMove returns true, break. + while (movesToTry.length > 0) { + var move = movesToTry.splice(Math.floor(Math.random() * movesToTry.length), 1)[0]; + if (isEmpty(pixel.x+move[0], pixel.y+move[1]-1)) { + var origx = pixel.x+move[0]; + var origy = pixel.y+move[1]; + if (tryMove(pixel, pixel.x+move[0], pixel.y+move[1]) && pixel.x===origx && pixel.y===origy) { + break; + } + } + else if (!isEmpty(pixel.x+move[0], pixel.y+move[1], true)) { + var hitPixel = pixelMap[pixel.x+move[0]][pixel.y+move[1]]; + if (hitPixel.element === "single_human") { + // interact with other humans + hitPixel.panic = pixel.panic; + } + } + } + // 15% chance to change direction + if (Math.random() < 0.15) { + pixel.dir *= -1; + } + // homeostasis + if (pixel.temp > 37) { pixel.temp -= 1; } + else if (pixel.temp < 37) { pixel.temp += 1; } + } + + }, + hidden: true, + density: 1080, + state: "solid", + conduct: .05, + temp: 37, + tempHigh: 200, + stateHigh: "cooked_meat", + tempLow: -30, + stateLow: "frozen_meat", + burn: 10, + burnTime: 250, + burnInto: "cooked_meat", + breakInto: ["blood","meat","bone"], + forceSaveColor: true, + reactions: { + "cancer": { elem1:"cancer", chance:0.005 }, + "radiation": { elem1:["ash","meat","rotten_meat","cooked_meat"], chance:0.4 }, + "neutron": { elem1:["ash","meat","rotten_meat","cooked_meat"], chance:0.03 }, + "fallout": { elem1:["ash","meat","rotten_meat","cooked_meat"], chance:0.03 }, + "plague": { elem1:"plague", chance:0.05 }, + "oxygen": { elem2:"carbon_dioxide", chance:0.5 }, + "meat": { elem2:null, chance:0.1 }, + "cooked_meat": { elem2:null, chance:0.1 }, + "cured_meat": { elem2:null, chance:0.1 }, + "sugar": { elem2:null, chance:0.1 }, + "broth": { elem2:null, chance:0.2 }, + "yolk": { elem2:null, chance:0.1 }, + "hard_yolk": { elem2:null, chance:0.1 }, + "dough": { elem2:null, chance:0.1 }, + "batter": { elem2:null, chance:0.2 }, + "butter": { elem2:null, chance:0.1 }, + "melted_butter": { elem2:null, chance:0.2 }, + "chocolate": { elem2:null, chance:0.2 }, + "melted_chocolate": { elem2:null, chance:0.3 }, + "grape": { elem2:null, chance:0.1 }, + "tomato": { elem2:null, chance:0.1 }, + "herb": { elem2:null, chance:0.1 }, + "lettuce": { elem2:null, chance:0.1 }, + "corn": { elem2:null, chance:0.1 }, + "popcorn": { elem2:null, chance:0.15 }, + "potato": { elem2:null, chance:0.1 }, + "baked_potato": { elem2:null, chance:0.15 }, + "bread": { elem2:null, chance:0.1 }, + "toast": { elem2:null, chance:0.1 }, + "gingerbread": { elem2:null, chance:0.1 }, + "baked_batter": { elem2:null, chance:0.2 }, + "wheat": { elem2:null, chance:0.1 }, + "candy": { elem2:null, chance:0.1 }, + "yogurt": { elem2:null, chance:0.2 }, + "frozen_yogurt": { elem2:null, chance:0.1 }, + "ice_cream": { elem2:null, chance:0.2 }, + "beans": { elem2:[null,null,null,null,null,null,null,null,"stench"], chance:0.2 }, + "tea": { elem2:null, chance:0.2 }, + "coffee": { elem2:null, chance:0.2 }, + "milk": { elem2:null, chance:0.2 }, + "cream": { elem2:null, chance:0.2 }, + "soda": { elem2:null, chance:0.2 }, + "chocolate_milk": { elem2:null, chance:0.2 }, + "fruit_milk": { elem2:null, chance:0.2 }, + "pilk": { elem2:null, chance:0.2 }, + "eggnog": { elem2:null, chance:0.2 }, + "juice": { elem2:null, chance:0.2 }, + "cheese": { elem2:null, chance:0.1 }, + "melted_cheese": { elem2:null, chance:0.2 }, + "alcohol": { elem2:null, chance:0.2 }, + "antidote": { elem2:null, chance:0.2 }, + "honey": { elem2:null, chance:0.2 }, + "caramel": { elem2:null, chance:0.2 }, + "molasses": { elem2:null, chance:0.05 }, + "ketchup": { elem2:null, chance:0.1 }, + "pumpkin_seed": { elem2:null, chance:0.1 }, + "nut": { elem2:null, chance:0.1 }, + "nut_meat": { elem2:null, chance:0.1 }, + "nut_butter": { elem2:null, chance:0.1 }, + "nut_milk": { elem2:null, chance:0.2 }, + "jelly": { elem2:null, chance:0.2 }, + "mayo": { elem2:null, chance:0.2 }, + "mashed_potato": { elem2:null, chance:0.2 }, + "sauce": { elem2:null, chance:0.2 }, + "pickle": { elem2:null, chance:0.1 }, + "sun": { elem1:"cooked_meat" }, + "light": { stain1:"#825043" }, + "bee": { stain1:"#cc564b", chance:0.2 }, + "water": { elem2:"bubble", attr2:{"clone":"water"}, chance:0.001 }, + "salt_water": { elem2:"bubble", attr2:{"clone":"salt_water"}, chance:0.001 }, + "pool_water": { elem2:"bubble", attr2:{"clone":"pool_water"}, chance:0.001 }, + }, + properties: { + dead: false, + dir: 1, + panic: 0 + }, +} From 7c55b22f5d582bcc0568d6346f45d464aee45361 Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Fri, 18 Oct 2024 08:42:27 -0700 Subject: [PATCH 21/28] important bugfix --- mods/flesh_infection.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/flesh_infection.js b/mods/flesh_infection.js index 8ee771aa..155ceced 100644 --- a/mods/flesh_infection.js +++ b/mods/flesh_infection.js @@ -1,6 +1,6 @@ // by Nekonico -eLists.FESTER = ["fleshy_dirt","dirt","rock","rock_wall","basalt","limestone","steel","iron","dead_bug","mud","sand","wet_sand","clay_soil","clay","mycelium","skin","meat","rotten_meat","wood","ant_wall","dead_plant","plant","hair","bone","cancer","straw","cloth","brick","bamboo","sponge","paper","plastic","concrete"], +eLists.FESTER = ["fleshy_dirt","dirt","rock","rock_wall","basalt","limestone","steel","iron","glass_shard","dead_bug","mud","sand","wet_sand","clay_soil","clay","mycelium","skin","meat","rotten_meat","wood","ant_wall","dead_plant","plant","hair","bone","cancer","straw","cloth","brick","bamboo","sponge","paper","plastic","concrete"], elements.fleshy_dirt = { color: ["#81512F","#895933","#825231","#906159"], @@ -604,7 +604,7 @@ elements.dry_fleshwood = { elements.acidic_bile = { color: ["#81cf63","#81cf63","#81cf63","#81cf63","#81cf63","#81cf63","#439809","#258b08","#118511","#127b12","#136d14"], behavior: [ - "XX|DB%1 AND SW:flesh_mound%90|XX", + "XX|DB%1|XX", "DB%1 AND M2%25|DL%0.001|DB%1 AND M2%25", "DB%1 AND M2%25|DB%2 AND M1|DB%1 AND M2%25", ], @@ -618,6 +618,7 @@ elements.acidic_bile = { "ammonia": { elem1:null, elem2:null }, "bleach": { elem1:null, elem2:null }, "cement": { elem1:null, elem2:null }, + "glass": { elem1:null, elem2:"glass_shard", chance:0.05 }, "caustic_potash": { elem1:"water", elem2:"potassium_salt" }, "bone": { elem2:"flesh_mound", chance:0.01 }, "water": { elem1:null, elem2:"dirty_water" }, From 9c162d0ef01ce756bee06ae3d85b30ad83ff3d95 Mon Sep 17 00:00:00 2001 From: Jayd-Rubies <155784127+Jayd-Rubies@users.noreply.github.com> Date: Sat, 19 Oct 2024 20:11:28 -0400 Subject: [PATCH 22/28] Update UwUify.js --- mods/UwUify.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/UwUify.js b/mods/UwUify.js index 5f64ca53..6f3ef9b8 100644 --- a/mods/UwUify.js +++ b/mods/UwUify.js @@ -1,4 +1,4 @@ -document.body.style.backgroundImage = 'url("https://jayd-rubies.github.io/uwuify.png")'; +document.body.style.backgroundImage = 'url("https://jayd-rubies.github.io/image/uwuify.png")'; document.body.style.backgroundSize = 'cover'; gameDiv.style.border = "1px solid #ffffff00"; window.addEventListener("load",function(){ @@ -80,4 +80,4 @@ function pixelColorPick(pixel,customColor=null) { } }*/ return color; -} \ No newline at end of file +} From 6e616aedca648e0ebcc2292eb767054856110ae7 Mon Sep 17 00:00:00 2001 From: Jayd-Rubies <155784127+Jayd-Rubies@users.noreply.github.com> Date: Sat, 19 Oct 2024 20:13:03 -0400 Subject: [PATCH 23/28] Update texture_pack_by_jayd.js --- mods/texture_pack_by_jayd.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/texture_pack_by_jayd.js b/mods/texture_pack_by_jayd.js index 9f8ee49e..46434ed1 100644 --- a/mods/texture_pack_by_jayd.js +++ b/mods/texture_pack_by_jayd.js @@ -1,5 +1,5 @@ //texture_pack_by_jayd -document.body.style.backgroundImage = 'url("https://jayd-rubies.github.io/1236951076024877107.png")'; +document.body.style.backgroundImage = 'url("https://jayd-rubies.github.io/image/1236951076024877107.png")'; gameDiv.style.border = "1px solid #ffffff00"; window.addEventListener("load",function(){ document.querySelectorAll(".categoryButton").forEach(e => { @@ -113,4 +113,4 @@ viewInfo[4] = { // Small Pixels } else{renderBall(ctx,pixel.color,pixel.x,pixel.y,0,1);} } -} \ No newline at end of file +} From 0f132052054ccf925cf87d0ccd72288246bb4f40 Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Sun, 20 Oct 2024 09:41:19 -0700 Subject: [PATCH 24/28] Exoplanet mod --- mods/exoplanet.js | 220 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 mods/exoplanet.js diff --git a/mods/exoplanet.js b/mods/exoplanet.js new file mode 100644 index 00000000..1045d9ad --- /dev/null +++ b/mods/exoplanet.js @@ -0,0 +1,220 @@ +elements.dusty_water = { + color: "#7C7C95", + behavior: behaviors.LIQUID, + tempHigh: 105, + stateHigh: ["steam","dust_cloud"], + tempLow: 0, + stateLowName: "dusty_ice", + viscosity: 10, + reactions: { + "rock": { elem2: "wet_sand", chance: 0.0004 }, + "exoplanetary_rock": { elem2: "exoplanetary_sand", chance: 0.0004 }, + "limestone": { elem2: "wet_sand", chance: 0.0004 }, + "plant": { elem1:"water", chance:0.05 }, + "algae": { elem1:"water", chance:0.05 }, + "kelp": { elem1:"water", chance:0.05 }, + "charcoal": { elem1:"water", chance:0.02 }, + "gravel": { elem1:"water", chance:0.01 }, + "fly": { elem2:"dead_bug", chance:0.1, oneway:true }, + "firefly": { elem2:"dead_bug", chance:0.1, oneway:true }, + "bee": { elem2:"dead_bug", chance:0.05, oneway:true }, + "stink_bug": { elem2:"dead_bug", chance:0.1, oneway:true }, + }, + hidden: true, + state: "liquid", + density: 1005, + conduct: 0.01, + extinguish: true, + category: "exoplanet", +} + +elements.exoplanetary_sand = { + color: ["#A29C7D","#c0c0c0","#808080","#4f4f4f","#808080","#949494","#A29C7D"], + behavior: behaviors.POWDER, + reactions: { + "tornado":{elem1:"sandstorm", oneway:true}, + }, + tempHigh: 1700, + stateHigh: "molten_exoplanetary_glass", + category: "exoplanet", + state: "solid", + density: 1602 +} + +elements.exoplanetary_glass = { + color: ["#6F807F","#6F807F","#748F8D","#6F807F","#6F807F"], + colorPattern: textures.GLASS, + colorKey: { + "g": "#6F807F", + "s": "#728886", + "S": "#748F8D"}, + behavior: behaviors.WALL, + reactions: { + "radiation": { elem1:"rad_glass", chance:0.33 }, + "rad_steam": { elem1:"rad_glass", elem2:null, chance:0.33 }, + "fallout": { elem1:"rad_glass", elem2:"radiation", chance:0.1 } + }, + tempHigh: 1500, + category: "exoplanet", + state: "solid", + density: 2500, + breakInto: "exoplanetary_sand", + noMix: true, + hidden: true, +} + +elements.molten_exoplanetary_glass = { + reactions: { + "radiation": { elem1:"molten_rad_glass", chance:0.66 }, + "rad_steam": { elem1:"molten_rad_glass", elem2:null, chance:0.33 }, + "molten_uranium": { elem1:"molten_rad_glass", elem2:null }, + "fallout": { elem1:"molten_rad_glass", elem2:"radiation" } + }, + hidden: true, + category: "exoplanet", +} + +elements.dust_cloud = { + color: ["#808080","#2e2e2e","#2e2e2e"], + behavior: [ + "XX|M1%0.5|M2%0.5", + "XX|CH:exoplanetary_dust%0.075|M1%2.5 AND BO", + "XX|M1%0.5|M2%0.5", + ], + reactions: { + "fireball": { elem1:null, elem2:"fire_cloud", chance:0.25 } + }, + category: "exoplanet", + tempHigh: 825, + stateHigh: ["exoplanetary_rock","exoplanetary_rock","fire",], + hidden: true, + state: "gas", + density: 0.7, + ignoreAir: true +} + +elements.exoplanetary_dust = { + color: "#808080", + behavior: [ + "XX|XX|XX", + "XX|XX|XX", + "M2|M1|M2", + ], + reactions: { + "water": { elem2: "dusty_water", elem1: null }, + }, + category: "exoplanet", + breakInto: ["exoplanetary_dust","exoplanetary_dust","exoplanetary_dust","dust_cloud"], + burn: 10, + burnTime: 1, + tempHigh: 700, + burnInto:"exoplanetary_rock", + stateHigh: "exoplanetary_rock", + state: "solid", + density: 1490 +} + +elements.exoplanetary_rock = { + color: ["#c0c0c0","#4f4f4f","#949494"], + behavior: behaviors.POWDER, + reactions: { + "fly": { elem2:"dead_bug", chance:0.25, oneway:true }, + "firefly": { elem2:"dead_bug", chance:0.2, oneway:true }, + "stink_bug": { elem2:"dead_bug", chance:0.15, oneway:true }, + "bee": { elem2:"dead_bug", chance:0.1, oneway:true }, + "bird": { elem2:"feather", chance:0.025, oneway:true }, + "egg": { elem2:"yolk", oneway:true }, + "grass": { elem2:null, chance:0.005, oneway:true }, + "bone": { elem2:"oil", tempMin:300, chance:0.005, oneway:true }, + "dead_plant": { elem2:"charcoal", tempMin:200, chance:0.005, oneway:true }, + "charcoal": { elem2:"diamond", tempMin:800, tempMax:900, chance:0.005, oneway:true }, + "sand": { elem2:"packed_sand", tempMin:500, chance:0.005, oneway:true }, + "wet_sand": { elem2:"packed_sand", chance:0.005, oneway:true }, + }, + tempHigh: 950, + stateHigh: "exoplanetary_magma", + category: "exoplanet", + state: "solid", + density: 2550, + hardness: 0.5, + breakInto: ["exoplanetary_sand","exoplanetary_sand","exoplanetary_dust","dust_cloud"] +} + +elements.exoplanetary_magma = { + color: ["#ff6f00","#ff8c00","#ff4d00"], + behavior: behaviors.MOLTEN, + reactions: { + "ice": { elem1: "basalt" }, + "ash": { elem1: "molten_tuff", "elem2":null }, + "molten_ash": { elem1: "molten_tuff", "elem2":null }, + "charcoal": { elem2:"diamond", tempMin:800, tempMax:900, chance:0.005, oneway:true }, + }, + temp: 1200, + tempLow: 800, + stateLow: ["basalt","exoplanetary_rock","exoplanetary_rock","exoplanetary_rock"], + viscosity: 10000, + state: "liquid", + density: 2725, + alias: "alien lava", + category: "exoplanet", + hidden: true, +} + +elements.exoplanetary_rock = { + color: ["#c0c0c0","#4f4f4f","#949494"], + behavior: behaviors.POWDER, + reactions: { + "fly": { elem2:"dead_bug", chance:0.25, oneway:true }, + "firefly": { elem2:"dead_bug", chance:0.2, oneway:true }, + "stink_bug": { elem2:"dead_bug", chance:0.15, oneway:true }, + "bee": { elem2:"dead_bug", chance:0.1, oneway:true }, + "bird": { elem2:"feather", chance:0.025, oneway:true }, + "egg": { elem2:"yolk", oneway:true }, + "grass": { elem2:null, chance:0.005, oneway:true }, + "bone": { elem2:"oil", tempMin:300, chance:0.005, oneway:true }, + "dead_plant": { elem2:"charcoal", tempMin:200, chance:0.005, oneway:true }, + "charcoal": { elem2:"diamond", tempMin:800, tempMax:900, chance:0.005, oneway:true }, + "sand": { elem2:"packed_sand", tempMin:500, chance:0.005, oneway:true }, + "wet_sand": { elem2:"packed_sand", chance:0.005, oneway:true }, + }, + tempHigh: 950, + stateHigh: "exoplanetary_magma", + category: "exoplanet", + state: "solid", + density: 2550, + hardness: 0.5, + breakInto: ["exoplanetary_sand","exoplanetary_sand","exoplanetary_dust","dust_cloud"] +} + +worldgentypes.exoplanet = { + layers: [ + [0.9, "exoplanetary_dust"], + [0.1, "exoplanetary_sand", 0.15], + [0.2, "dusty_ice", 0.075], + [0.05, "exoplanetary_rock"], + [0, "basalt"], + ], + decor: [ + ["exoplanetary_dust", 0.05], + ["dust_cloud", 0.25] + ], + baseHeight: 0.5, + temperature: -7 +} + +worldgentypes.exo_ocean = { + layers: [ + [0.99, "exoplanetary_dust"], + [0.40, "dusty_ice"], + [0.25, "bone", 0.01], + [0.25, "dusty_ice"], + [0.1, "exoplanetary_sand"], + [0.03, "exoplanetary_rock", 0.5], + [0.03, "exoplanetary_rock"], + [0, "basalt"], + ], + decor: [ + ["dust_cloud", 0.1, 10], + ], + temperature: -7 +} \ No newline at end of file From 7f21d20cc2dfe0244dcd7367bb854a2310d70dbe Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:09:52 -0700 Subject: [PATCH 25/28] NEW COLONIZATION MOD --- mods/exoplanet.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/exoplanet.js b/mods/exoplanet.js index 1045d9ad..564cf57b 100644 --- a/mods/exoplanet.js +++ b/mods/exoplanet.js @@ -199,7 +199,7 @@ worldgentypes.exoplanet = { ["dust_cloud", 0.25] ], baseHeight: 0.5, - temperature: -7 + temperature: -15 } worldgentypes.exo_ocean = { @@ -216,5 +216,5 @@ worldgentypes.exo_ocean = { decor: [ ["dust_cloud", 0.1, 10], ], - temperature: -7 + temperature: -15 } \ No newline at end of file From b6fd47e6635832ad1f927f7cbd3bc78edf62e7d4 Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:11:34 -0700 Subject: [PATCH 26/28] Update mod-list.html --- mod-list.html | 1 + 1 file changed, 1 insertion(+) diff --git a/mod-list.html b/mod-list.html index c36d8f69..65ecc76e 100644 --- a/mod-list.html +++ b/mod-list.html @@ -277,6 +277,7 @@ bananas.jsAdds bananas and banana plantsAlice cat.jsAdds cats and cat foodSquareScreamYT cells.jsAdds several experimental edits of the Cell elementAlice +colonies.jsAdds rockets that contain settlers to terraform a planet.Nekonico crimson.jsAdds elements relating to the Crimson from TerrariaAlice dogs.jsAdds a simple dog and dog foodhedera-ivy fairy_chain.jsAdds way too many fairies to fey_and_more.jsAlice From 27f24a751de85d86e71f79fd6b89da74d2ae3bbc Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:52:38 -0700 Subject: [PATCH 27/28] Colonies.js --- mods/colonies.js | 574 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 574 insertions(+) create mode 100644 mods/colonies.js diff --git a/mods/colonies.js b/mods/colonies.js new file mode 100644 index 00000000..215cb3d0 --- /dev/null +++ b/mods/colonies.js @@ -0,0 +1,574 @@ +var modName = "mods/colonies.js"; +var exoplanetMod = "mods/exoplanet.js"; + +if(enabledMods.includes(exoplanetMod)) { + + window.addEventListener("load", () => { + document.getElementById("elementButton-base")?.remove() + }) + + window.addEventListener("load", () => { + document.getElementById("elementButton-empty_room")?.remove() + }) + + window.addEventListener("load", () => { + document.getElementById("elementButton-cafeteria")?.remove() + }) + + window.addEventListener("load", () => { + document.getElementById("elementButton-terraformer_room")?.remove() + }) + + window.addEventListener("load", () => { + document.getElementById("elementButton-base_door_left")?.remove() + }) + + window.addEventListener("load", () => { + document.getElementById("elementButton-base_door_right")?.remove() + }) + + elements.base = { + hidden: true, + color: "#ff0000", + behavior: [ + "XX|XX|CR:glass|CR:glass|CR:rocket_gate|CR:rocket_gate|CR:rocket_gate|CR:glass|CR:glass|XX|XX", + "XX|CR:glass|CR:glass|CR:air_filter|XX|XX|XX|XX|CR:glass|CR:glass|XX", + "XX|CR:glass|XX|XX|XX|XX|XX|XX|XX|CR:glass|XX", + "CR:glass|CR:glass|XX|XX|XX|XX|XX|XX|XX|CR:glass|CR:glass", + "CR:glass AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>glass|XX|XX|XX|XX|XX|XX|XX|XX|XX|CR:glass AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>glass", + "CR:base_door_left,base_door,base_door AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>base_door_left,base_door,base_door|XX|XX|XX|XX|CH:leaving_rocket%25|XX|XX|XX|XX|CR:base_door_right,base_door AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>base_door_right,base_door", + "CR:concrete|CR:glass AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>glass|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:glass AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>glass|CR:concrete", + "CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete", + "XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX", + "XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX", + "XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX", + ], + category: "colonies", + state: "solid", + } + + elements.empty_room = { + hidden: true, + color: "#ff0000", + behavior: [ + "XX|XX|CR:glass|CR:glass|CR:glass|CR:glass|CR:glass|XX|XX", + "XX|CR:glass|CR:glass|XX|XX|XX|CR:glass|CR:glass|XX", + "CR:glass|CR:glass|CR:air_filter|XX|XX|XX|XX|CR:glass|CR:glass", + "CR:glass|XX|XX|XX|XX|XX|XX|XX|CR:glass", + "CR:base_door|XX|XX|XX|DL|XX|XX|XX|CR:base_door", + "CR:concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete", + "CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete", + "XX|XX|XX|XX|XX|XX|XX|XX|XX", + "XX|XX|XX|XX|XX|XX|XX|XX|XX", + ], + category: "colonies", + state: "solid", + } + + elements.cafeteria = { + hidden: true, + color: "#ff0000", + behavior: [ + "XX|CR:glass|CR:glass|CR:glass|CR:glass|CR:glass|CR:glass|CR:glass|XX", + "CR:glass|CR:glass|CR:food_dispenser|CR:food_dispenser|CR:air_filter|CR:food_dispenser|CR:food_dispenser|CR:glass|CR:glass", + "CR:glass|XX|XX|XX|XX|XX|XX|XX|CR:glass", + "CR:glass|XX|XX|XX|XX|XX|XX|XX|CR:glass", + "CR:base_door|XX|XX|XX|DL|XX|XX|XX|CR:base_door", + "CR:concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|DL:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass,concrete,mulch|DL:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass,concrete,mulch|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|DL:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass,concrete,mulch|DL:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass,concrete,mulch|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete", + "CR:concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete", + "XX|XX|XX|XX|XX|XX|XX|XX|XX", + "XX|XX|XX|XX|XX|XX|XX|XX|XX", + ], + category: "colonies", + state: "solid", + } + + elements.terraformer_room = { + hidden: true, + color: "#ff0000", + behavior: [ + "XX|XX|CR:glass|CR:glass|CR:glass|CR:glass|CR:glass|XX|XX", + "XX|CR:glass|CR:glass|XX|XX|XX|CR:glass|CR:glass|XX", + "CR:glass|CR:glass|CR:air_filter|XX|XX|XX|XX|CR:glass|CR:glass", + "CR:glass|XX|XX|XX|XX|XX|XX|XX|CR:glass", + "CR:base_door|XX|XX|XX|DL|XX|XX|XX|CR:base_door", + "CR:concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:room_temper AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>room_temper|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:nanobot_terraformers AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>nanobot_terraformers|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:room_temper AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>room_temper|CR:concrete AND CH:dirt,exoplanetary_dust,exoplanetary_rock,exoplanetary_sand,sand,mud,grass>concrete|CR:concrete", + "CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete|CR:concrete", + "XX|XX|XX|XX|XX|XX|XX|XX|XX", + "XX|XX|XX|XX|XX|XX|XX|XX|XX", + ], + category: "colonies", + state: "solid", + } + + elements.air_filter = { + hidden: true, + color: ["#d1c6be","#b5c0ad","#b9b8bc"], + reactions: { + "carbon_dioxide": { elem2:"oxygen" }, + "dust_cloud": { elem2:["oxygen",null], }, + "exoplanetary_dust": { elem2:null, }, + "dust": { elem2:null, }, + "radiation": { elem2:"electric", temp1:200 } + }, + behavior: [ + "XX|ST|XX", + "ST AND CR:oxygen%1|XX|ST AND CR:oxygen%1", + "XX|CR:oxygen%1|XX", + ], + tempHigh: 500, + stateHigh: "molten_aluminum", + category: "colonies", + density: 2710, + conduct: 0.73, + hardness: 0.01, + breakInto: "metal_scrap", + fireColor: "#A7B3BF", + superconductAt: -271.95, + state: "solid", + } + + elements.rocket_gate = { + hidden: true, + color: ["#d1c6be","#b5c0ad","#b9b8bc"], + behavior: behaviors.WALL, + tempHigh: 500, + stateHigh: "molten_aluminum", + category: "colonies", + density: 2710, + conduct: 0.73, + hardness: 0.05, + breakInto: "metal_scrap", + fireColor: "#A7B3BF", + superconductAt: -271.95, + state: "solid", + } + + elements.base_door = { + hidden: true, + color: ["#d1c6be","#b5c0ad","#b9b8bc"], + behavior: behaviors.WALL, + tempHigh: 500, + stateHigh: "molten_aluminum", + category: "colonies", + density: 2710, + conduct: 0.73, + hardness: 0.04, + breakInto: "metal_scrap", + fireColor: "#A7B3BF", + superconductAt: -271.95, + state: "solid", + } + + elements.base_door_left = { + hidden: true, + color: "#ff0000", + behavior: [ + "XX|XX|XX|XX|XX|XX|XX|XX|XX", + "XX|XX|XX|XX|XX|XX|XX|XX|XX", + "CR:empty_room,cafeteria,cafeteria,terraformer_room,terraformer_room|XX|XX|XX|CH:base_door|XX|XX|XX|XX", + "XX|XX|XX|XX|XX|XX|XX|XX|XX", + "XX|XX|XX|XX|XX|XX|XX|XX|XX", + ], + category: "colonies", + state: "solid", + } + + elements.base_door_right = { + hidden: true, + color: "#ff0000", + behavior: [ + "XX|XX|XX|XX|XX|XX|XX|XX|XX", + "XX|XX|XX|XX|XX|XX|XX|XX|XX", + "XX|XX|XX|XX|CH:base_door|XX|XX|XX|CR:empty_room,cafeteria,cafeteria,cafeteria,terraformer_room,terraformer_room,terraformer_room", + "XX|XX|XX|XX|XX|XX|XX|XX|XX", + "XX|XX|XX|XX|XX|XX|XX|XX|XX", + ], + category: "colonies", + state: "solid", + } + +elements.settler = { + color: ["#A8A7AB","#878689"], + category: "colonies", + tick: function(pixel) { + if (tryMove(pixel, pixel.x, pixel.y+1)) {} // Fall + doHeat(pixel); + doBurning(pixel); + doElectricity(pixel); + if (pixel.oxygen > 0.1 && Math.random() < 0.025) { pixel.oxygen -= 0.5 } // consume oxygen + else if (pixel.oxygen < 0.1) { pixel.dead = true } + + if (pixel.dead) { + // Turn into rotten_meat if pixelTicks-dead > 500 + if (pixelTicks-pixel.dead > 200 && Math.random() < 0.1) { + if (Math.random() < 0.5) { + changePixel(pixel,"metal_scrap"); + } + else { + changePixel(pixel,"rotten_meat"); + } + } + return + } + + if (pixel.burning) { + pixel.panic += 0.1; + } + else if (pixel.oxygen < 25.1) { + pixel.panic += 0.1; + } + else if (pixel.panic > 0) { + pixel.panic -= 0.1; + if (pixel.panic < 0) { pixel.panic = 0; } + } + + if (Math.random() < 0.1*(isEmpty(pixel.x, pixel.y+1) ? 1 : pixel.panic+1)) { // Move 10% chance + var movesToTry = [ + [1*pixel.dir,0], + [1*pixel.dir,-1], + ]; + // While movesToTry is not empty, tryMove(pixel, x, y) with a random move, then remove it. if tryMove returns true, break. + while (movesToTry.length > 0) { + var move = movesToTry.splice(Math.floor(Math.random() * movesToTry.length), 1)[0]; + if (isEmpty(pixel.x+move[0], pixel.y+move[1]-1)) { + var origx = pixel.x+move[0]; + var origy = pixel.y+move[1]; + if (tryMove(pixel, pixel.x+move[0], pixel.y+move[1]) && pixel.x===origx && pixel.y===origy) { + break; + } + } + else if (!isEmpty(pixel.x+move[0], pixel.y+move[1], true)) { + var hitPixel = pixelMap[pixel.x+move[0]][pixel.y+move[1]]; + if (hitPixel.element === "settler") { + // interact with other settlers + hitPixel.panic = pixel.panic; + } + else if (hitPixel.element === "base_door") { + if (pixel.dir === -1 && Math.random() > 0.5) { + tryMove(pixel,pixel.x-2,pixel.y); + } + else if (pixel.dir === 1 && Math.random() > 0.5) { + tryMove(pixel,pixel.x+2,pixel.y); + } + } + else if (hitPixel.element === "leaving_rocket" && pixel.ogcrew === false) { + if (Math.random() > 0.75) { + deletePixel(pixel.x,pixel.y); + hitPixel.passengers += 1; + } + } + else if (elements[hitPixel.element].state === "gas") { + swapPixels(pixel,hitPixel); + } + else if (elements[hitPixel.element].state === "liquid") { + swapPixels(pixel,pixelMap[hitPixel.x][hitPixel.y-1]); + } + } + } + // 15% chance to change direction + if (Math.random() < 0.15) { + pixel.dir *= -1; + } + // spacesuit A/C + if (pixel.temp > 40) { pixel.temp -= 3; } + else if (pixel.temp < 32) { pixel.temp += 3; } + } + + }, + foodNeed: 50, + egg: "settler", + density: 2710, + state: "solid", + conduct: .05, + temp: 37, + tempHigh: 300, + stateHigh: ["cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","molten_aluminum","smoke","dioxin","smoke","stench","ash","melted_plastic"], + tempLow: -75, + stateLow: "frozen_meat", + burn: 10, + burnTime: 250, + burnInto: ["cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","molten_aluminum","smoke","dioxin","smoke","stench","ash","melted_plastic"], + hardness: 0.02, + breakInto: ["blood","meat","bone","blood","meat","bone","metal_scrap"], + forceSaveColor: true, + reactions: { + "cancer": { elem1:"cancer", chance:0.0005 }, + "radiation": { elem1:["ash","meat","rotten_meat","cooked_meat"], chance:0.04 }, + "neutron": { elem1:["ash","meat","rotten_meat","cooked_meat"], chance:0.003 }, + "fallout": { elem1:["ash","meat","rotten_meat","cooked_meat"], chance:0.003 }, + "plague": { elem1:"plague", chance:0.005 }, + "oxygen": { func:function(pixel,air){pixel.oxygen += 5}, elem2:"carbon_dioxide", chance:0.5 }, + "carbon_dioxide": { func:function(pixel,air){pixel.oxygen -= 1}, chance:0.05 }, + "dust_cloud": { func:function(pixel,air){pixel.oxygen -= 5}, elem2:null, chance:0.05 }, + "exoplanetary_dust": { elem2:"dust_cloud", chance:0.001 }, + "meat": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "cooked_meat": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "cured_meat": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "sugar": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "broth": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "yolk": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "hard_yolk": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "dough": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "batter": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "butter": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "melted_butter": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "chocolate": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "melted_chocolate": { elem2:null, chance:0.3, func:behaviors.FEEDPIXEL }, + "grape": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "tomato": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "herb": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "lettuce": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "corn": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "popcorn": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "potato": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "baked_potato": { elem2:null, chance:0.15, func:behaviors.FEEDPIXEL }, + "bread": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "toast": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "gingerbread": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "baked_batter": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "wheat": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "candy": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "yogurt": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "frozen_yogurt": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "ice_cream": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "beans": { elem2:[null,null,null,null,null,null,null,null,null,null,null,null,null,null,"stench"], chance:0.2, func:behaviors.FEEDPIXEL }, + "tea": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "coffee": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "milk": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "cream": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "soda": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "chocolate_milk": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "fruit_milk": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "pilk": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "eggnog": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "juice": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "cheese": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "melted_cheese": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "alcohol": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "antidote": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "honey": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "caramel": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "molasses": { elem2:null, chance:0.05, func:behaviors.FEEDPIXEL }, + "ketchup": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "pumpkin_seed": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut_meat": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut_butter": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "nut_milk": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "jelly": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "mayo": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "mashed_potato": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "sauce": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "pickle": { elem2:null, chance:0.1, func:behaviors.FEEDPIXEL }, + "food_container": { elem2:null, chance:0.2, func:behaviors.FEEDPIXEL }, + "sun": { elem1:["cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","cooked_meat","molten_aluminum","smoke","dioxin","smoke","stench","ash","melted_plastic"] }, + "water": { func:function(pixel,water){pixel.oxygen -= 1}, elem2:"bubble", attr2:{"clone":"water"}, chance:0.0002 }, + "salt_water": { func:function(pixel,water){pixel.oxygen -= 2}, elem2:"bubble", attr2:{"clone":"salt_water"}, chance:0.0002 }, + "sugar_water": { func:function(pixel,water){pixel.oxygen -= 2}, elem2:"bubble", attr2:{"clone":"sugar_water"}, chance:0.0002 }, + "seltzer": { func:function(pixel,water){pixel.oxygen -= 4}, elem2:"bubble", attr2:{"clone":["seltzer","seltzer","carbon_dioxide"]}, chance:0.0002 }, + "pool_water": { func:function(pixel,water){pixel.oxygen -= 1}, elem2:"bubble", attr2:{"clone":"pool_water"}, chance:0.0002 }, + "dirty_water": { func:function(pixel,water){pixel.oxygen -= 4}, elem2:"bubble", color2:["#0e824e","#07755a","#0c6934"], attr2:{"clone":"dirty_water"}, chance:0.0003 }, + "blood": { func:function(pixel,water){pixel.oxygen -= 5}, elem2:"bubble", color2:["#ff0000","#ee0000","#ff4040"], attr2:{"clone":"blood"}, chance:0.0003 }, + }, + properties: { + dead: false, + dir: 1, + panic: 0, + oxygen: 100, + ogcrew: false, + }, +} + +elements.nanobot_terraformers = { + color: "#c0c0c0", + hidden: true, + behavior: [ + "CH:exoplanetary_dust>nanobot_terraformers%50|CH:exoplanetary_dust>nanobot_terraformers%50 AND CR:oxygen%5|CH:exoplanetary_dust>nanobot_terraformers%50", + "CH:exoplanetary_dust>nanobot_terraformers%50|XX|CH:exoplanetary_dust>nanobot_terraformers%50", + "CH:exoplanetary_dust,exoplanetary_rock>nanobot_terraformers%50 AND M2|CH:exoplanetary_dust>nanobot_terraformers%50 AND M1|CH:exoplanetary_dust>nanobot_terraformers%50 AND M2", + ], + reactions: { + "exoplanetary_rock": { elem2:"nanobot_terraformers", attr2:{"clone":"rock"}}, + "dusty_water": { elem2:"nanobot_terraformers", attr2:{"clone":"water"}}, + "dusty_ice": { elem2:"nanobot_terraformers", attr2:{"clone":"ice"}}, + "exoplanetary_sand": { elem2:"nanobot_terraformers", attr2:{"clone":"sand"} }, + }, + tick: function(pixel) { + if (pixel.age > 25 || (pixel.clone && isEmpty(pixel.x,pixel.y-1))) { + if (pixel.clone) { + changePixel(pixel,pixel.clone); + return; + } + changePixel(pixel,"dirt"); + } + pixel.age ++; + }, + properties: { + "age": 0, + }, + category: "colonies", + state: "solid", + density: 21450, + excludeRandom: true, + conduct: 0.25, + darkText: true, + tempHigh: 1456, + stateHigh: "molten_steel" +} + +elements.room_temper = { + color: "#29632f", + behavior: behaviors.WALL, + tick: function(pixel) { + // from nouserthings.js <3 + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y, true)) { + if(pixelMap[x][y].temp < -230) { + pixelMap[x][y].temp = (pixelMap[x][y].temp + 7) + } else if(pixelMap[x][y].temp > 270) { + pixelMap[x][y].temp = (pixelMap[x][y].temp - 7) + } else if (pixelMap[x][y].temp < 20) { + pixelMap[x][y].temp = (pixelMap[x][y].temp + 2) + } else if (pixelMap[x][y].temp > 20) { + pixelMap[x][y].temp = (pixelMap[x][y].temp - 2) + } + } + } + }, + category:"colonies", + state:"solid", + insulate: true, + noMix: true, + movable: false, +}; + +elements.food_dispenser = { + color: "#606378", + behavior: [ + "XX|ST|XX", + "ST|XX|ST", + "XX|XX|XX", + ], + tick: function(pixel) { + if (isEmpty(pixel.x, pixel.y+4) && isEmpty(pixel.x, pixel.y+1) && Math.random() > 0.95) { + createPixel("food_container",pixel.x,pixel.y+1); + } + }, + category:"colonies", + tempHigh: 1455.5, + stateHigh: "molten_steel", + conduct: 0.42 +} + +elements.food_container = { + behavior: behaviors.STURDYPOWDER, + category: "colonies", + hidden: true, + state: "solid", + color: ["#2b1107","#5c3322","#2b1107","#5c3322","#2b1107","#5c3322"], + tempHigh: 250, + stateHigh: ["sugar","cooked_meat","dead_plant","ash","ash","charcoal"], + burn: 10, + burnTime: 200, + burnInto: ["sugar","cooked_meat","dead_plant","ash","ash","charcoal"], + breakInto: ["sugar","cooked_meat","dead_plant","sugar","cooked_meat","dead_plant","sugar","cooked_meat","dead_plant","sawdust","sawdust","sawdust","sawdust"], + breakIntoColor: ["#2b1107","#5c3322","#5c3322","#5c3322","#5c3322","#5c3322","#5c3322","#5c3322","#41770B","#774C35"], + isFood: true +} + +elements.leaving_rocket = { + name: "rocket", + hidden: true, + color: "#ff6f47", + tick: function(pixel) { + if (pixel.passengers > 14) { + if (!tryMove(pixel, pixel.x, pixel.y-1)) { + if (outOfBounds(pixel.x,pixel.y-1)) { + deletePixel(pixel.x,pixel.y); + } + else if (pixelMap[pixel.x][pixel.y-1].element === "rocket_gate") { + tryMove(pixel, pixel.x, pixel.y-2); + } + else { + // tryMove again to the top left or top right + tryMove(pixel, pixel.x+(Math.random() < 0.5 ? -1 : 1), pixel.y-1); + } + } + if (Math.random() > 0.5 && isEmpty(pixel.x,pixel.y+1)) { + createPixel("smoke", pixel.x, pixel.y+1); + } + } + else { + if (!tryMove(pixel, pixel.x, pixel.y+1)) { + // tryMove again to the bottom left or bottom right + tryMove(pixel, pixel.x+(Math.random() < 0.5 ? -1 : 1), pixel.y+1); + } + } + doDefaults(pixel) + }, + properties: { + "passengers": 0, + }, + conduct: 0.5, + ignore: ["cloner","ecloner","slow_cloner","clone_powder","floating_cloner"], + category: "colonies", + state: "solid", + density: 7300, + cooldown: defaultCooldown +} + +elements.arriving_rocket = { + name: "rocket", + color: "#ff6f47", + tick: function(pixel) { + if (!tryMove(pixel, pixel.x, pixel.y+1)) { + tryMove(pixel, pixel.x+(Math.random() < 0.5 ? -1 : 1), pixel.y+1); + pixel.age++; + } + if (Math.random() > 0.5 && pixel.age < 10) { + createPixel("smoke", pixel.x, pixel.y-1); + } + if (pixel.age > 250 && pixel.base_established === false) { + if (isEmpty(pixel.x, pixel.y-1)) { + createPixel("base",pixel.x, pixel.y-1); + pixel.base_established = true; + } + } + if (pixel.age > 500 && pixel.passengers > 0) { + if (isEmpty(pixel.x+1, pixel.y-1)) { + createPixel("settler",pixel.x+1, pixel.y-1); + pixelMap[pixel.x+1][pixel.y-1].ogcrew = true; + pixel.passengers -= 1; + } + else if (isEmpty(pixel.x-1, pixel.y-1)) { + createPixel("settler",pixel.x-1, pixel.y-1); + pixelMap[pixel.x-1][pixel.y-1].ogcrew = true; + pixel.passengers -= 1; + } + } + if (pixel.passengers < 1) { + changePixel(pixel,"concrete"); + } + }, + properties: { + "passengers": 5, + "age": 0, + "base_established": false, + }, + conduct: 0.5, + ignore: ["cloner","ecloner","slow_cloner","clone_powder","floating_cloner"], + category: "colonies", + state: "solid", + density: 7300, + cooldown: defaultCooldown +} + +} else { + enabledMods.splice(enabledMods.indexOf(modName),0,exoplanetMod) + localStorage.setItem("enabledMods", JSON.stringify(enabledMods)); + alert(`The ${exoplanetMod} mod is required and has been automatically inserted (reload for this to take effect).`) +}; From 73a500e27ebad7b91a58b79473b5cc533ab1358d Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Tue, 29 Oct 2024 13:50:24 -0400 Subject: [PATCH 28/28] Update 10kelements.js - crash fix --- mods/10kelements.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/10kelements.js b/mods/10kelements.js index fed58606..f22387d6 100644 --- a/mods/10kelements.js +++ b/mods/10kelements.js @@ -24,7 +24,7 @@ elements.change_count = { var choosebehaviors = behaviors delete choosebehaviors.KILLPIXEL2 delete choosebehaviors.KILLPIXEL1 -if (!settings.randomcount){settings.randomcount = 10000; saveSettings()} +if (!settings.randomcount || settings.randomcount > 50000){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"] @@ -162,4 +162,4 @@ document.getElementById("extraInfo").querySelectorAll("small")[1].replaceChildre } } }) -} \ No newline at end of file +}