commit
806be30fd3
|
|
@ -1,3 +1,11 @@
|
||||||
|
/* changelog
|
||||||
|
v 0.1 added snake
|
||||||
|
v 0.11 "axolotl" eats fish
|
||||||
|
v 0.2 crocodiles scales and axolotls actually eat fish now
|
||||||
|
|
||||||
|
thats it for now
|
||||||
|
*/
|
||||||
|
|
||||||
// Only run this if the human, head, and body elements exist
|
// Only run this if the human, head, and body elements exist
|
||||||
if (elements.human && elements.head && elements.body) {
|
if (elements.human && elements.head && elements.body) {
|
||||||
// Human
|
// Human
|
||||||
|
|
@ -58,6 +66,9 @@ elements.human.reactions.snake =
|
||||||
elements.fish.reactions.toad_tadpole =
|
elements.fish.reactions.toad_tadpole =
|
||||||
{ elem2: null, chance: 0.25, func: behaviors.FEEDPIXEL },
|
{ elem2: null, chance: 0.25, func: behaviors.FEEDPIXEL },
|
||||||
|
|
||||||
|
elements.glue.reactions.scale =
|
||||||
|
{ elem1: null, elem2: "scale_plate" },
|
||||||
|
|
||||||
elements.lizard = {
|
elements.lizard = {
|
||||||
color: ["#00ff1a", "#038f11"],
|
color: ["#00ff1a", "#038f11"],
|
||||||
behavior: [
|
behavior: [
|
||||||
|
|
@ -78,7 +89,7 @@ elements.lizard = {
|
||||||
"oxygen": { elem2: "carbon_dioxide", chance: 0.5 },
|
"oxygen": { elem2: "carbon_dioxide", chance: 0.5 },
|
||||||
"pool_water": { chance: 0.001, elem1: "rotten_meat" },
|
"pool_water": { chance: 0.001, elem1: "rotten_meat" },
|
||||||
"dirty_water": { chance: 0.0001, elem1: "rotten_meat" },
|
"dirty_water": { chance: 0.0001, elem1: "rotten_meat" },
|
||||||
"radiation": {elem1:["ash", "meat", "cooked_meat", "rotten_meat", "snake", null], chance: 0.4 },
|
"radiation": { elem1: ["ash", "meat", "cooked_meat", "rotten_meat", "snake", "crocodile", null], chance: 0.4 },
|
||||||
"mercury": { elem1: "rotten_meat", chance: 0.1 },
|
"mercury": { elem1: "rotten_meat", chance: 0.1 },
|
||||||
"bleach": { elem1: "rotten_meat", chance: 0.1 },
|
"bleach": { elem1: "rotten_meat", chance: 0.1 },
|
||||||
"infection": { elem1: "rotten_meat", chance: 0.025 },
|
"infection": { elem1: "rotten_meat", chance: 0.025 },
|
||||||
|
|
@ -92,10 +103,10 @@ elements.lizard = {
|
||||||
foodNeed: 5,
|
foodNeed: 5,
|
||||||
temp: 20,
|
temp: 20,
|
||||||
tempHigh: 120,
|
tempHigh: 120,
|
||||||
stateHigh: "cooked_meat",
|
stateHigh: ["cooked_meat", "scale"],
|
||||||
tempLow: -20,
|
tempLow: -20,
|
||||||
stateLow: "frozen_meat",
|
stateLow: "frozen_meat",
|
||||||
breakInto: "blood",
|
breakInto: ["blood", "scale"],
|
||||||
density: 1050,
|
density: 1050,
|
||||||
eggColor: "#ffffff",
|
eggColor: "#ffffff",
|
||||||
tick: function (pixel) {
|
tick: function (pixel) {
|
||||||
|
|
@ -259,6 +270,7 @@ reactions: {
|
||||||
"worm": { elem2: null, func: behaviors.FEEDPIXEL },
|
"worm": { elem2: null, func: behaviors.FEEDPIXEL },
|
||||||
"slug": { elem2: null, func: behaviors.FEEDPIXEL },
|
"slug": { elem2: null, func: behaviors.FEEDPIXEL },
|
||||||
"snail": { elem2: "limestone", func: behaviors.FEEDPIXEL },
|
"snail": { elem2: "limestone", func: behaviors.FEEDPIXEL },
|
||||||
|
"fish": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.5 },
|
||||||
"pool_water": { chance: 0.70, elem1: null },
|
"pool_water": { chance: 0.70, elem1: null },
|
||||||
"dirty_water": { chance: 0.70, elem1: null },
|
"dirty_water": { chance: 0.70, elem1: null },
|
||||||
"radiation": { elem1: ["ash", "meat", "cooked_meat", "rotten_meat", "newt"], chance: 0.4 },
|
"radiation": { elem1: ["ash", "meat", "cooked_meat", "rotten_meat", "newt"], chance: 0.4 },
|
||||||
|
|
@ -293,8 +305,7 @@ let right = pixel.x < pixelMap.length - 1 ? pixelMap[pixel.x + 1][pixel.y] : nul
|
||||||
(up && up.element === "water") ||
|
(up && up.element === "water") ||
|
||||||
(down && down.element === "water") ||
|
(down && down.element === "water") ||
|
||||||
(left && left.element === "water") ||
|
(left && left.element === "water") ||
|
||||||
(right && right.element === "water"))
|
(right && right.element === "water")) {
|
||||||
{
|
|
||||||
pixel.lifetime = 900;
|
pixel.lifetime = 900;
|
||||||
} else {
|
} else {
|
||||||
pixel.lifetime--;
|
pixel.lifetime--;
|
||||||
|
|
@ -327,7 +338,7 @@ elements.snake = {
|
||||||
behaviors.FEEDPIXEL(pixel1, pixel2);
|
behaviors.FEEDPIXEL(pixel1, pixel2);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"radiation": {elem1:["ash", "meat", "cooked_meat", "rotten_meat", "lizard", null], chance: 0.4 },
|
"radiation": { elem1: ["ash", "meat", "cooked_meat", "rotten_meat", "lizard", "crocodile", null], chance: 0.4 },
|
||||||
"oxygen": { elem2: "carbon_dioxide", chance: 0.5 },
|
"oxygen": { elem2: "carbon_dioxide", chance: 0.5 },
|
||||||
"mercury": { elem1: "rotten_meat", chance: 0.1 },
|
"mercury": { elem1: "rotten_meat", chance: 0.1 },
|
||||||
"bleach": { elem1: "rotten_meat", chance: 0.1 },
|
"bleach": { elem1: "rotten_meat", chance: 0.1 },
|
||||||
|
|
@ -361,10 +372,94 @@ elements.snake = {
|
||||||
let y = pixel.y + dy;
|
let y = pixel.y + dy;
|
||||||
if (!isEmpty(x, y)) {
|
if (!isEmpty(x, y)) {
|
||||||
let other = pixelMap[x]?.[y];
|
let other = pixelMap[x]?.[y];
|
||||||
if (other && (other.element === "head" || other.element === "body")) {
|
if (other && (other.element === "head" || other.element === "body" || other.element === "crocodile") && Math.random() <= 0.5) {
|
||||||
poisonOther(pixel, other);
|
poisonOther(pixel, other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
elements.crocodile = {
|
||||||
|
color: ["#065e13", "#0c751c"],
|
||||||
|
behavior: [
|
||||||
|
["XX", "XX", "XX AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water%5"],
|
||||||
|
["XX", "FX%10", "M2%15 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water%5"],
|
||||||
|
["M2", "M1", "M1 AND SW:water,salt_water,sugar_water,dirty_water,seltzer,pool_water%5"],
|
||||||
|
],
|
||||||
|
category: 'life',
|
||||||
|
state: 'solid',
|
||||||
|
foodNeed: 10,
|
||||||
|
reactions: {
|
||||||
|
"fish": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.2 },
|
||||||
|
"bird": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.2 },
|
||||||
|
"rat": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.5 },
|
||||||
|
"frog": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.2 },
|
||||||
|
"toad": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.2 },
|
||||||
|
"snake": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.4 },
|
||||||
|
"axolotl": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.2 },
|
||||||
|
"lizard": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.2 },
|
||||||
|
"newt": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.2 },
|
||||||
|
"body": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.2 },
|
||||||
|
"head": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.2 },
|
||||||
|
"human": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.2 },
|
||||||
|
"slug": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.2 },
|
||||||
|
"snail": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.2 },
|
||||||
|
"bone": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.1 },
|
||||||
|
"bone_marrow": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.4 },
|
||||||
|
"homonculus": { elem2: null, func: behaviors.FEEDPIXEL, chance: 0.2 },
|
||||||
|
"radiation": { elem1: ["ash", "meat", "cooked_meat", "rotten_meat", "lizard", "snake", null], chance: 0.4 },
|
||||||
|
"oxygen": { elem2: "carbon_dioxide", chance: 0.5 },
|
||||||
|
"mercury": { elem1: "rotten_meat", chance: 0.1 },
|
||||||
|
"bleach": { elem1: "rotten_meat", chance: 0.1 },
|
||||||
|
"infection": { elem1: "rotten_meat", chance: 0.025 },
|
||||||
|
"uranium": { elem1: "rotten_meat", chance: 0.1 },
|
||||||
|
"cyanide": { elem1: "rotten_meat", chance: 0.1 },
|
||||||
|
"chlorine": { elem1: "meat", chance: 0.1 },
|
||||||
|
"alcohol": { elem1: "meat", chance: 0.025 },
|
||||||
|
"vinegar": { elem1: "rotten_meat", chance: 0.001 },
|
||||||
|
"poison": { elem1: null }
|
||||||
|
},
|
||||||
|
temp: 18,
|
||||||
|
tempHigh: 100,
|
||||||
|
stateHigh: ["cooked_meat", "scale"],
|
||||||
|
tempLow: -10,
|
||||||
|
stateLow: "frozen_meat",
|
||||||
|
breakInto: ["blood", "scale"],
|
||||||
|
density: 1100
|
||||||
|
}
|
||||||
|
|
||||||
|
elements.scale = {
|
||||||
|
category: "powders",
|
||||||
|
color: ['#076607', '#1cb01c', '#0ef00e'],
|
||||||
|
behavior: behaviors.POWDER,
|
||||||
|
tempHigh: 900,
|
||||||
|
stateHigh: ["ash", "ash", "ash", "smoke", "stench", "stench", "stench"],
|
||||||
|
breakInto: "dust",
|
||||||
|
hardness: 0.3,
|
||||||
|
reactions: {
|
||||||
|
"glue": {
|
||||||
|
elem1: "scale_plate", elem2: null,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
elements.scale_plate = {
|
||||||
|
category: "solids",
|
||||||
|
color: ['#044404', '#137a13', '#0aa00a'],
|
||||||
|
hardness: 0.8,
|
||||||
|
breakInto: "scale",
|
||||||
|
tick: function (pixel) {
|
||||||
|
// 2 temp highs
|
||||||
|
const hot = ["scale", "dioxin", "cyanide_gas"];
|
||||||
|
const hotter = ["ash", "ash", "ash", "smoke", "stench", "stench", "stench", "dioxin", "cyanide_gas"];
|
||||||
|
if (pixel.temp >= 475 && pixel.temp <= 900) {
|
||||||
|
let chosen = hot[Math.floor(Math.random() * hot.length)];
|
||||||
|
changePixel(pixel, chosen);
|
||||||
|
}
|
||||||
|
if (pixel.temp >= 900) {
|
||||||
|
let chosen = hotter[Math.floor(Math.random() * hotter.length)];
|
||||||
|
changePixel(pixel, chosen);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue