Merge pull request #831 from DBNekonico/main

NEW COLONIZATION MOD
This commit is contained in:
slweeb 2024-10-28 17:25:03 -04:00 committed by GitHub
commit 50acec04c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 370 additions and 2 deletions

220
mods/exoplanet.js Normal file
View File

@ -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: -15
}
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: -15
}

View File

@ -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" },

147
mods/single_humans.js Normal file
View File

@ -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
},
}