Merge branch 'main' into main

This commit is contained in:
slweeb 2025-03-31 13:35:32 -04:00 committed by GitHub
commit eee75bdb40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 1341 additions and 80 deletions

1
lang/xem.json Normal file

File diff suppressed because one or more lines are too long

View File

@ -158,6 +158,7 @@
<tr><td>extra_element_info.js</td><td>Adds descriptions to various vanilla elements. Used to provide the functionality that desc now does before it was added to vanilla</td><td>Melecie</td></tr>
<tr><td>extrasaveslots.js</td><td>Adds extra saves slots !SAVE IMPORTANT SAVES AS FILES!</td><td>Jayd</td></tr>
<tr><td>find.js</td><td>Adds a find mode that highlights a chosen element as pulsating red and yellow <a href="https://github.com/R74nCom/sandboxels/commit/de0dc088ab4d928c77587b9d0e3a7d7663e3f94a">(read commit description)</a></td><td>Alice</td></tr>
<tr><td>human_friendly_design.js</td><td>Makes the drag and mix tools not kill humans.</td><td>Nekonico</td></tr>
<tr><td>insane_random_events.js</td><td>Massively buffs random events</td><td>Alice</td></tr>
<tr><td>jaydsfunctions.js</td><td>Adds extra tools</td><td>Jayd</td></tr>
<tr><td>moretools.js</td><td>Adds more temperature-modifying tools (±10/tick, ±50/tick, and absolute zero tools)</td><td>Sightnado</td></tr>
@ -237,6 +238,7 @@
<tr><td>fueled_generators.js</td><td>Fuel powered generators.</td></tr>
<tr><td>gameOfLife.js</td><td>Conway's Game of Life on a screen</td><td>ggod</td></tr>
<tr><td>heatshield.js</td><td>adds heatshields, makes plasma cooler</td></td><td>Taterbob</td></tr>
<tr><td>human_friendly_design.js</td><td>Makes pipes and portals not kill humans, as well as making drag and mix not kill humans.</td><td>Nekonico</td></tr>
<tr><td>logicgates.js</td><td>Adds predictable electricity and logic gates</td><td>nousernamefound</td></tr>
<tr><td>note_block.js</td><td>Adds musical Note Blocks</td><td>Alice</td></tr>
<tr><td>nousersthings.js</td><td>Destroyable machines, pipe variants, filters, and more</td><td>nousernamefound</td></tr>
@ -353,7 +355,7 @@
<tr><td>minecraft.js</td><td>Adds several things from Minecraft</td><td>StellarX20, nousernamefound</td></tr>
<tr><td>minesweeper.js</td><td>A subpar implementation of Minesweeper</td><td>Alice</td></tr>
<tr><td>musicalfruit.js</td><td>Humans get gas from eating Beans</td><td>mollthecoder</td></tr>
<tr><td>nekonicos_stuff.js</td><td>Some random stuff like graphite, oobleck, and red ice</td><td>Nekonico</td></tr>
<tr><td>nekonicos_stuff.js</td><td>Random stuff like graphite, oobleck, and red ice, as well as many machines.</td><td>Nekonico</td></tr>
<tr><td>prideflags.js</td><td>Adds some pride flags to the game</td><td>Adora</td></tr>
<tr><td>random_elems.js</td><td>Curated randomly generated elements</td><td>Alice</td></tr>
<tr><td>random_liquids.js</td><td>Randomly generates liquids on game load</td><td>Alice</td></tr>

334
mods/MarkusFoodMod.js Normal file
View File

@ -0,0 +1,334 @@
elements.paprika = {
color: "#b22222",
category: "Markus Foods",
behavior: behaviors.POWDER,
state: "solid",
tempHigh: 200,
stateHigh: "ash",
density: 0.4,
isFood: true,
};
elements.spicy_sauce = {
color: "#a52a2a",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
density: 1.0,
tempHigh: 150,
stateHigh: "smoke",
isFood: true,
};
elements.black_pepper = {
color: "#2f1b0c",
category: "Markus Foods",
behavior: behaviors.POWDER,
state: "solid",
density: 0.7,
tempHigh: 200,
stateHigh: "ash",
isFood: true,
};
elements.chicken_meat = {
color: "#e8a07c",
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 75,
stateHigh: "cooked_chicken",
tempLow: -5,
stateLow: "frozen_chicken",
isFood: true,
};
elements.cooked_chicken = {
color: "#c18251",
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 200,
stateHigh: "ash",
isFood: true,
};
elements.frozen_chicken = {
color: "#d1e1ed",
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 0,
stateHigh: "chicken_meat",
isFood: true,
};
elements.pork_meat = {
color: "#e89a8b",
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 75,
stateHigh: "cooked_pork",
tempLow: -5,
stateLow: "frozen_pork",
isFood: true,
};
elements.cooked_pork = {
color: "#af7f5d",
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 200,
stateHigh: "ash",
isFood: true,
};
elements.frozen_pork = {
color: "#c0d4e1",
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 0,
stateHigh: "pork_meat",
isFood: true,
};
elements.breadcrumbs = {
color: "#e6c27a",
category: "Markus Foods",
behavior: behaviors.POWDER,
state: "solid",
density: 0.4,
tempHigh: 250,
stateHigh: "ash",
isFood: true,
};
elements.fried_chicken = {
color: ["#c0894f", "#a86a3a", "#d19b52"],
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 350,
stateHigh: "ash",
isFood: true,
};
elements.breaded_chicken = {
color: "#deb887",
category: "Markus Foods",
behavior: behaviors.STURDYPOWDER,
state: "solid",
tempHigh: 180,
stateHigh: "fried_chicken",
isFood: true,
};
elements.chicken_meat.reactions = {
breadcrumbs: { elem1: "breaded_chicken" }
};
const newFoods = {
cinnamon: "#8B5A2B",
garlic: "#FFF5E1",
onion: "#D4A76A",
tomato: "#FF6347",
lettuce: "#32CD32",
potato: "#D2B48C",
cooked_potato: "#E3C16F",
chili_powder: "#FF4500",
carrot: "#FFA500",
cucumber: "#4CAF50",
salt: "#FFFFFF",
sugar: "#FFF5EE",
honey: "#FFD700",
cheese: "#FFD700",
butter: "#FFDD44",
egg: "#FFF5C3",
cooked_egg: "#F4C542",
banana: "#FFE135",
apple: "#FF0000",
blueberry: "#4B0082",
strawberry: "#FF4D4D",
watermelon: "#FF6666",
grapes: "#6A0DAD",
avocado: "#568203",
basil: "#228B22",
oregano: "#6B8E23",
ginger: "#D2691E",
turmeric: "#E49B0F",
nutmeg: "#8B4513",
clove: "#5C4033",
cabbage: "#4CBB17",
cauliflower: "#FFFAF0",
mushroom: "#8B4513",
spinach: "#2E8B57",
radish: "#F5A9B8",
broccoli: "#228B22",
green_peas: "#7CFC00",
bell_pepper: "#32CD32",
sweet_potato: "#FF7F50",
coconut: "#FFF8DC",
lemon: "#FFFACD",
lime: "#98FB98",
kiwi: "#32CD32",
pear: "#9ACD32",
peach: "#FFDAB9",
plum: "#8E4585",
pomegranate: "#8B0000",
fig: "#8B4513",
date: "#A52A2A",
raisin: "#6B4226",
apricot: "#FBCEB1",
coconut_milk: "#FFF0F5",
yogurt: "#F5FFFA",
cream: "#FFF8DC",
peanut_butter: "#C8A2A8",
sesame_seeds: "#FFF5EE",
tahini: "#F4A460",
almond: "#D2691E",
walnut: "#8B4513",
pistachio: "#4B8A3D",
cashew: "#D2B48C",
hazelnut: "#8B5A2B",
macadamia: "#E1C699",
pine_nuts: "#FFDDC1",
sunflower_seeds: "#FFF8DC",
chia_seeds: "#D2691E",
flaxseeds: "#8B4513",
};
for (const [name, color] of Object.entries(newFoods)) {
elements[name] = {
color,
category: "Markus Foods",
behavior: behaviors.POWDER,
state: "solid",
isFood: true,
};
}
const newLiquids = {
water: "#00BFFF",
milk: "#FFFFFF",
orange_juice: "#FFA500",
apple_juice: "#FF4500",
grape_juice: "#6A0DAD",
lemon_juice: "#FFFACD",
coconut_water: "#BFD8B8",
tomato_juice: "#FF6347",
coffee: "#6F4F1F",
tea: "#D3D3D3",
cola: "#6B3F2F",
wine: "#800000",
beer: "#F4A300",
whiskey: "#B86B38",
rum: "#C39A6E",
vodka: "#F0F8FF",
fruit_punch: "#FF69B4",
smoothie: "#FFB6C1",
soy_milk: "#F5F5DC",
coconut_milk: "#FFF0F5",
};
for (const [name, color] of Object.entries(newLiquids)) {
elements[name] = {
color,
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
isFood: true,
};
}
elements.carbonated_water = {
color: "#B0E0E6",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
isFood: true,
density: 1.0,
};
elements.fanta_syrup = {
color: "#FF7F00",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
tempHigh: 100,
stateHigh: "steam",
isFood: true,
};
elements.cola_syrup = {
color: "#301a10",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
tempHigh: 100,
stateHigh: "steam",
isFood: true,
};
elements.sprite_syrup = {
color: "#A8F0A5",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
tempHigh: 100,
stateHigh: "steam",
isFood: true,
};
elements.soda = {
color: "#FFD700",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
isFood: true,
};
elements.fanta = {
color: "#FF7F00",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
isFood: true,
};
elements.cola = {
color: "#261710",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
isFood: true,
};
elements.sprite = {
color: "#A8F0A5",
category: "Markus Foods",
behavior: behaviors.LIQUID,
state: "liquid",
isFood: true,
};
elements.soda.reactions = {
fanta_syrup: { elem1: "fanta" },
cola_syrup: { elem1: "cola" },
sprite_syrup: { elem1: "sprite" },
};
// Adding the recipes for sodas
elements.fanta_syrup.reactions = {
carbonated_water: { elem1: "fanta" },
};
elements.cola_syrup.reactions = {
carbonated_water: { elem1: "cola" },
};
elements.sprite_syrup.reactions = {
carbonated_water: { elem1: "sprite" },
};

View File

@ -10,17 +10,14 @@ clouds_settingsTab.registerSettings("Real time", cloud_count_setting);
settingsManager.registerTab(clouds_settingsTab);
// Biased random
function randomGaussian(A, B, biasFactor=2) {
let u = Math.random();
let v = Math.random();
let num = Math.sqrt(-2.0 * Math.log(u)) * Math.cos(2.0 * Math.PI * v);
function biasedRandom(A, B, samples) {
var sum = 0;
for (var i = 0;i < samples;i++) {
sum += Math.random();
}
var average = sum / samples;
let mean = (A + B) / 2;
let stdDev = (B - A) / biasFactor;
let result = mean + num * stdDev;
return Math.min(Math.max(result, A), B);
return A + average * (B - A);
}
function randomBetween(A, B) {
@ -32,7 +29,7 @@ function initClouds(amount) {
var w = randomBetween(6, 17);
var h = randomBetween(4, 10);
var x = randomBetween(0, width - w);
var y = randomGaussian(0, height * 0.75, 4);
var y = biasedRandom(0, height * 0.75, 4);
// Higher clouds move faster
var speedBoost = 1 - (y / (height * 0.75));

View File

@ -1,12 +1,11 @@
elements.iron_drill = {
color: ["#474747","#2b2b2b","#808080"],
color: ["#474747","#2b2b2b","#636363"],
behavior: [
"DL AND MX|CR:drill_base|DL AND MX",
"MX:true|XX|MX:true",
"MX:true|M1 AND SM%10 AND MX:true|MX:true",
"DL%5 AND MX|CR:drill_base|DL%5 AND MX",
"MX|LB:drill_base|MX",
"MX|M1 AND SM%10 AND MX|MX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
@ -15,11 +14,11 @@ elements.iron_drill = {
};
elements.drill_base = {
color: "#595959",
color: "#808080",
behavior: [
"XX|CR:drill_support AND CH:drill_support|XX",
"XX|XX|XX",
"XX|M1|XX",
"XX|XX|XX",
],
category: "machines",
breakInto: "metal_scrap",
@ -32,9 +31,9 @@ elements.drill_base = {
};
elements.drill_support = {
color: "#242424",
color: "#323232",
behavior: [
"XX|CH:drill_support|XX",
"XX|CR:drill_top|XX",
"XX|XX|XX",
"XX|XX|XX",
],
@ -48,12 +47,130 @@ elements.drill_support = {
hidden: true,
};
elements.drill_top = {
color: "#323232",
behavior: [
"XX|XX|XX",
"XX|XX|CR:drill_side1",
"XX|XX|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.drill_side1 = {
color: "#323232",
behavior: [
"XX|XX|XX",
"XX|XX|CR:drill_side2",
"XX|XX|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.drill_side2 = {
color: "#323232",
behavior: [
"XX|XX|XX",
"XX|XX|CR:drill_side3",
"XX|XX|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.drill_side3 = {
color: "#323232",
behavior: [
"XX|XX|XX",
"XX|XX|CR:drill_side4",
"XX|XX|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.drill_side4 = {
color: "#323232",
behavior: [
"XX|XX|XX",
"XX|XX|CR:drill_side5%35 AND CR:drill_side4%65",
"XX|XX|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.drill_side5 = {
color: "#323232",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"XX|CR:drill_support_down|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.drill_support_down = {
color: "#323232",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"XX|CR:drill_support_down|XX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 1538,
stateHigh: "molten_iron",
density: 7860,
noMix: true,
hidden: true,
};
elements.gold_drill = {
color: ["#f7c736","#ffe596","#d1a41d"],
behavior: [
"DL AND MX|CR:drill_base|DL AND MX",
"MX:true|XX|MX:true",
"MX:true|M1 AND SM%25 AND MX:true|MX:true",
"DL%7 AND MX|CR:drill_base|DL%7 AND MX",
"MX|LB:drill_base|MX",
"MX|M1 AND SM%25 AND MX|MX",
],
category: "machines",
breakInto: "gold_coin",
@ -68,12 +185,11 @@ elements.gold_drill = {
elements.brass_drill = {
color: ["#ad7f47","#874a00"],
behavior: [
"DL AND MX|CR:drill_base|DL AND MX",
"MX:true|XX|MX:true",
"MX:true|M1 AND SM%8 AND MX:true|MX:true",
"DL%6 AND MX|CR:drill_base|DL%6 AND MX",
"MX|LB:drill_base|MX",
"MX|M1 AND SM%15 AND MX|MX",
],
category: "machines",
breakInto: "metal_scrap",
state: "solid",
tempHigh: 927,
stateHigh: "molten_brass",
@ -85,9 +201,9 @@ elements.brass_drill = {
elements.egg_drill = {
color: "#ffe69c",
behavior: [
"DL AND MX|CR:drill_base|DL AND MX",
"MX:true|XX|MX:true",
"MX:true|M1 AND SM%1 AND MX:true|MX:true",
"DL%1 AND MX|CR:drill_base|DL%1 AND MX",
"MX|LB:drill_base|MX",
"MX|M1 AND SM%1 AND MX|MX",
],
category: "machines",
breakInto: "yolk",
@ -99,11 +215,28 @@ elements.egg_drill = {
darkText: true,
};
elements.glass_drill = {
color: "#5e807d",
behavior: [
"DL%10 AND MX|CR:drill_base|DL%10 AND MX",
"MX|LB:drill_base AND SM%1|MX",
"MX|M1 AND SM%40 AND MX|MX",
],
category: "machines",
breakInto: "glass_shard",
state: "solid",
tempHigh: 1500,
stateHigh: "molten_glass",
density: 2500,
noMix: true,
darkText: false,
};
elements.void_drill = {
color: "#000000",
behavior: [
"DL|CR:drill_base|DL",
"DL|XX|DL",
"DL|LB:drill_base|DL",
"DL|M1 AND DL|DL",
],
category: "machines",
@ -111,4 +244,4 @@ elements.void_drill = {
density: 999999999999999,
noMix: true,
darkText: false,
};
};

View File

@ -5,38 +5,6 @@ behaviors.SOLIDIFY = function(pixel) {
var colorOne = "#ffffff"
var colorTwo = "#000000"
viewInfo[8] = { // Neon View
name: "neon",
pixel: function(pixel,ctx) {
if (elements[pixel.element].isColor === true) {
var color = pixel.gradient;
if (color < 0) {color = 0}
if (color > 60) {color = 60}
// logarithmic scale, with coldest being 225 (-50 degrees) and hottest being 0 (6000 degrees)
var hue = Math.round(225 - (Math.log(color)/Math.log(60))*225);
if (hue < 0) {hue = 0}
if (hue > 225) {hue = 225}
drawSquare(ctx,"hsl("+hue+",50%,50%)",pixel.x,pixel.y)
}
}
}
elements.red = {
color: "#AD1300",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"XX|XX|XX",
],
tool: function(pixel) {
if (elements[pixel.element].isColor == true) {
pixel.gradient += 1
}
},
canPlace: false,
category: "tools",
}
elements.colorOne = {
tick: function(pixel) {
if (pixel.color != colorOne) {
@ -190,9 +158,6 @@ elements.desand = {
changePixel(pixel,"water")
}
}
else if ([pixel.element].startsWith("sand_")) {
deletePixel(pixel.x,pixel.y)
}
},
category: "tools",
}
@ -284,6 +249,16 @@ elements.red_ice = {
"XX|M1|XX",
],
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice", chance:0.25},
"steam":{elem2:"red_ice", chance:0.15},
"blood":{elem2:"red_ice", chance:0.25},
@ -313,6 +288,7 @@ elements.red_ice = {
"frog":{elem2:"red_ice_meat", chance:0.15},
"tadpole":{elem2:"red_ice_meat", chance:0.15},
},
breakInto: "red_snow",
tempLow: 0,
stateLow: "red_water",
category: "solids",
@ -320,14 +296,132 @@ elements.red_ice = {
density: 917,
}
elements.red_snow = {
color: "#D64765",
behavior: behaviors.POWDER,
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice", chance:0.25},
"steam":{elem2:"red_ice", chance:0.15},
"blood":{elem2:"red_ice", chance:0.25},
"blood_ice":{elem2:"red_ice", chance:0.25},
"antibody":{elem2:"red_ice", chance:0.25},
"salt_water":{elem2:"red_ice", chance:0.25},
"sugar_water":{elem2:"red_ice", chance:0.25},
"dirty_water":{elem2:"red_ice", chance:0.25},
"pool_water":{elem2:"red_ice", chance:0.25},
"slush":{elem2:"red_ice", chance:0.25},
"seltzer":{elem2:"red_ice", chance:0.25},
"juice":{elem2:"red_ice", chance:0.25},
"soda":{elem2:"red_ice", chance:0.25},
"milk":{elem2:"red_ice", chance:0.25},
"slime":{elem2:"red_ice", chance:0.25},
"tea":{elem2:"red_ice", chance:0.25},
"coffee":{elem2:"red_ice", chance:0.25},
"neutral_acid":{elem2:"red_ice", chance:0.25},
"infection":{elem2:"red_ice", chance:0.25},
"meat":{elem2:"red_ice_meat", chance:0.15},
"skin":{elem2:"red_ice_meat", chance:0.075},
"body":{elem2:"red_ice_meat", chance:0.04},
"head":{elem2:"red_ice_meat", chance:0.05},
"frozen_meat":{elem2:"red_ice_meat", chance:0.15},
"fish":{elem2:"red_ice_meat", chance:0.15},
"bird":{elem2:"red_ice_meat", chance:0.15},
"frog":{elem2:"red_ice_meat", chance:0.15},
"tadpole":{elem2:"red_ice_meat", chance:0.15},
},
temp: 5,
tempLow: -18,
tempHigh: 100,
stateHigh: "packed_red_snow",
stateLow: "red_water",
category: "land",
state: "solid",
density: 100
}
elements.packed_red_snow = {
color: "#CC3F5F",
behavior: behaviors.SUPPORTPOWDER,
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice", chance:0.25},
"steam":{elem2:"red_ice", chance:0.15},
"blood":{elem2:"red_ice", chance:0.25},
"blood_ice":{elem2:"red_ice", chance:0.25},
"antibody":{elem2:"red_ice", chance:0.25},
"salt_water":{elem2:"red_ice", chance:0.25},
"sugar_water":{elem2:"red_ice", chance:0.25},
"dirty_water":{elem2:"red_ice", chance:0.25},
"pool_water":{elem2:"red_ice", chance:0.25},
"slush":{elem2:"red_ice", chance:0.25},
"seltzer":{elem2:"red_ice", chance:0.25},
"juice":{elem2:"red_ice", chance:0.25},
"soda":{elem2:"red_ice", chance:0.25},
"milk":{elem2:"red_ice", chance:0.25},
"slime":{elem2:"red_ice", chance:0.25},
"tea":{elem2:"red_ice", chance:0.25},
"coffee":{elem2:"red_ice", chance:0.25},
"neutral_acid":{elem2:"red_ice", chance:0.25},
"infection":{elem2:"red_ice", chance:0.25},
"meat":{elem2:"red_ice_meat", chance:0.15},
"skin":{elem2:"red_ice_meat", chance:0.075},
"body":{elem2:"red_ice_meat", chance:0.04},
"head":{elem2:"red_ice_meat", chance:0.05},
"frozen_meat":{elem2:"red_ice_meat", chance:0.15},
"fish":{elem2:"red_ice_meat", chance:0.15},
"bird":{elem2:"red_ice_meat", chance:0.15},
"frog":{elem2:"red_ice_meat", chance:0.15},
"tadpole":{elem2:"red_ice_meat", chance:0.15},
},
temp: 5,
tempLow: -20,
tempHigh: 200,
stateHigh: "red_ice",
stateLow: "red_water",
breakInto: "red_snow",
category: "land",
state: "solid",
density: 400,
hidden: true
}
elements.red_ice_meat = {
color: "#AC3536",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"XX|M1|XX",
"XX|CH:frozen_meat,meat>red_ice_meat%1|XX",
"CH:frozen_meat,meat>red_ice_meat%1|XX|CH:frozen_meat,meat>red_ice_meat%1",
"XX|M1 AND CH:frozen_meat,meat>red_ice_meat%1|XX",
],
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice", chance:0.025},
"steam":{elem2:"red_ice", chance:0.015},
"blood":{elem2:"red_ice", chance:0.025},
@ -357,8 +451,8 @@ elements.red_ice_meat = {
"frog":{elem2:"red_ice_meat", chance:0.015},
"tadpole":{elem2:"red_ice_meat", chance:0.015},
},
tempHigh: 0,
stateHigh: "meat",
tempLow: -100,
stateLow: "meat",
category:"food",
hidden:true,
state: "solid",
@ -366,10 +460,131 @@ elements.red_ice_meat = {
isFood: true
}
elements.red_ice_plant = {
color: "#735958",
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice", chance:0.025},
"steam":{elem2:"red_ice", chance:0.015},
"blood":{elem2:"red_ice", chance:0.025},
"blood_ice":{elem2:"red_ice", chance:0.25},
"antibody":{elem2:"red_ice", chance:0.025},
"salt_water":{elem2:"red_ice", chance:0.025},
"sugar_water":{elem2:"red_ice", chance:0.025},
"dirty_water":{elem2:"red_ice", chance:0.025},
"pool_water":{elem2:"red_ice", chance:0.025},
"slush":{elem2:"red_ice", chance:0.025},
"seltzer":{elem2:"red_ice", chance:0.025},
"juice":{elem2:"red_ice", chance:0.025},
"soda":{elem2:"red_ice", chance:0.025},
"milk":{elem2:"red_ice", chance:0.025},
"slime":{elem2:"red_ice", chance:0.025},
"tea":{elem2:"red_ice", chance:0.025},
"coffee":{elem2:"red_ice", chance:0.025},
"neutral_acid":{elem2:"red_ice", chance:0.025},
"infection":{elem2:"red_ice", chance:0.025},
"meat":{elem2:"red_ice_meat", chance:0.015},
"skin":{elem2:"red_ice_meat", chance:0.0075},
"body":{elem2:"red_ice_meat", chance:0.004},
"head":{elem2:"red_ice_meat", chance:0.005},
"frozen_meat":{elem2:"red_ice_meat", chance:0.015},
"fish":{elem2:"red_ice_meat", chance:0.015},
"bird":{elem2:"red_ice_meat", chance:0.015},
"frog":{elem2:"red_ice_meat", chance:0.015},
"tadpole":{elem2:"red_ice_meat", chance:0.015},
},
behavior: behaviors.WALL,
category:"life",
tempHigh: 300,
stateHigh: "fire",
burn:85,
burnTime:45,
temp: 2.66,
tempLow: -7,
stateLow: "red_plant",
state: "solid",
density: 1050,
hidden: true
}
elements.red_plant = {
color: ["#AA3527","#AA3227","#AA2C27","#A11D1D"],
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice", chance:0.025},
"steam":{elem2:"red_ice", chance:0.015},
"blood":{elem2:"red_ice", chance:0.025},
"blood_ice":{elem2:"red_ice", chance:0.25},
"antibody":{elem2:"red_ice", chance:0.025},
"salt_water":{elem2:"red_ice", chance:0.025},
"sugar_water":{elem2:"red_ice", chance:0.025},
"dirty_water":{elem2:"red_ice", chance:0.025},
"pool_water":{elem2:"red_ice", chance:0.025},
"slush":{elem2:"red_ice", chance:0.025},
"seltzer":{elem2:"red_ice", chance:0.025},
"juice":{elem2:"red_ice", chance:0.025},
"soda":{elem2:"red_ice", chance:0.025},
"milk":{elem2:"red_ice", chance:0.025},
"slime":{elem2:"red_ice", chance:0.025},
"tea":{elem2:"red_ice", chance:0.025},
"coffee":{elem2:"red_ice", chance:0.025},
"neutral_acid":{elem2:"red_ice", chance:0.025},
"infection":{elem2:"red_ice", chance:0.025},
"meat":{elem2:"red_ice_meat", chance:0.015},
"skin":{elem2:"red_ice_meat", chance:0.0075},
"body":{elem2:"red_ice_meat", chance:0.004},
"head":{elem2:"red_ice_meat", chance:0.005},
"frozen_meat":{elem2:"red_ice_meat", chance:0.015},
"fish":{elem2:"red_ice_meat", chance:0.015},
"bird":{elem2:"red_ice_meat", chance:0.015},
"frog":{elem2:"red_ice_meat", chance:0.015},
"tadpole":{elem2:"red_ice_meat", chance:0.015},
},
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"M2|M1|M2",
],
category:"life",
tempHigh: 2,
stateHigh: "red_ice_plant",
state: "solid",
density: 1050,
hidden: true
}
elements.red_water = {
color: "#880808",
behavior: behaviors.LIQUID,
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice"},
"blood":{elem2:"red_ice"},
"blood_ice":{elem2:"red_ice", chance:0.25},
@ -398,20 +613,37 @@ elements.red_water = {
"frog":{elem2:"red_ice_meat", chance:0.015},
"tadpole":{elem2:"red_ice_meat", chance:0.015},
},
temp: -20,
tempHigh: 0,
stateHigh: "red_ice",
tempLow: -100,
stateLow: "red_steam",
tempHigh: 0,
stateHigh: "red_ice",
category: "liquids",
state: "liquid",
density: 997,
conduct: 0.02,
temp: -20,
stain: -0.5,
extinguish: true
}
elements.red_steam = {
color: "#F88379",
behavior: behaviors.GAS,
reactions: {
"red_steam": { elem1: "red_cloud", elem2: "red_cloud", chance:0.05, "y":[0,15], "setting":"clouds" },
"red_rain": { elem1: "red_rain", chance:0.4, "y":[0,12], "setting":"clouds" },
"red_cloud": { elem1: "red_cloud", chance:0.4, "y":[0,12], "setting":"clouds" },
"red_snow_cloud": { elem1: "red_rain_cloud", chance:0.4, "y":[0,12], "setting":"clouds" },
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"salt_ice":{elem2:"red_ice", chance:0.25},
"sugar_ice":{elem2:"red_ice", chance:0.25},
"juice_ice":{elem2:"red_ice", chance:0.25},
"dirty_ice":{elem2:"red_ice", chance:0.25},
"ice":{elem2:"red_ice", chance:0.25},
"water":{elem2:"red_ice"},
"blood":{elem2:"red_ice"},
"blood_ice":{elem2:"red_ice", chance:0.25},
@ -448,6 +680,165 @@ elements.red_steam = {
density: 0.6,
}
elements.red_cloud = {
color: "#E8ABAB",
behavior: [
"XX|XX|XX",
"XX|CO:1%5|M1%2.5 AND BO",
"XX|XX|XX",
],
reactions: {
"red_rain": { elem1:"red_rain", temp1: 20 },
"red_cloud": { elem1:"red_rain", elem2:"red_rain", temp1:20, temp2:20, charged:true },
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"water":{elem2:"red_ice"},
"blood":{elem2:"red_ice"},
"blood_ice":{elem2:"red_ice", chance:0.25},
"antibody":{elem2:"red_ice"},
"salt_water":{elem2:"red_ice"},
"sugar_water":{elem2:"red_ice"},
"dirty_water":{elem2:"red_ice"},
"pool_water":{elem2:"red_ice"},
"slush":{elem2:"red_ice"},
"seltzer":{elem2:"red_ice"},
"juice":{elem2:"red_ice"},
"soda":{elem2:"red_ice"},
"milk":{elem2:"red_ice"},
"slime":{elem2:"red_ice"},
"tea":{elem2:"red_ice"},
"coffee":{elem2:"red_ice"},
"neutral_acid":{elem2:"red_ice"},
"infection":{elem2:"red_ice"},
"meat":{elem2:"red_ice_meat", chance:0.015},
"skin":{elem2:"red_ice_meat", chance:0.0075},
"body":{elem2:"red_ice_meat", chance:0.004},
"head":{elem2:"red_ice_meat", chance:0.005},
"frozen_meat":{elem2:"red_ice_meat", chance:0.015},
"fish":{elem2:"red_ice_meat", chance:0.015},
"bird":{elem2:"red_ice_meat", chance:0.015},
"frog":{elem2:"red_ice_meat", chance:0.015},
"tadpole":{elem2:"red_ice_meat", chance:0.015},
},
category:"gases",
temp: -110,
tempHigh: -100,
stateHigh: "red_rain",
state: "gas",
breakInto: "red_rain",
density: 0.4,
ignoreAir: true,
conduct: 0.03
}
elements.red_rain = {
color: "#C27A79",
behavior: [
"XX|XX|XX",
"XX|CH:red_water%0.05|M1%2.5 AND BO",
"CR:electric%0.05|CR:electric%0.05|CR:electric%0.05",
],
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"water":{elem2:"red_ice"},
"blood":{elem2:"red_ice"},
"blood_ice":{elem2:"red_ice", chance:0.25},
"antibody":{elem2:"red_ice"},
"salt_water":{elem2:"red_ice"},
"sugar_water":{elem2:"red_ice"},
"dirty_water":{elem2:"red_ice"},
"pool_water":{elem2:"red_ice"},
"slush":{elem2:"red_ice"},
"seltzer":{elem2:"red_ice"},
"juice":{elem2:"red_ice"},
"soda":{elem2:"red_ice"},
"milk":{elem2:"red_ice"},
"slime":{elem2:"red_ice"},
"tea":{elem2:"red_ice"},
"coffee":{elem2:"red_ice"},
"neutral_acid":{elem2:"red_ice"},
"infection":{elem2:"red_ice"},
"meat":{elem2:"red_ice_meat", chance:0.015},
"skin":{elem2:"red_ice_meat", chance:0.0075},
"body":{elem2:"red_ice_meat", chance:0.004},
"head":{elem2:"red_ice_meat", chance:0.005},
"frozen_meat":{elem2:"red_ice_meat", chance:0.015},
"fish":{elem2:"red_ice_meat", chance:0.015},
"bird":{elem2:"red_ice_meat", chance:0.015},
"frog":{elem2:"red_ice_meat", chance:0.015},
"tadpole":{elem2:"red_ice_meat", chance:0.015},
},
category:"gases",
temp: -70,
tempLow: -100,
stateLow: "red_cloud",
breakInto: "water",
tempHigh: 0,
stateHigh: "red_snow_cloud",
state: "gas",
density: 0.5,
ignoreAir: true,
conduct: 0.03
}
elements.red_snow_cloud = {
color: "#CC8482",
behavior: [
"XX|XX|XX",
"XX|CH:red_snow%0.05|M1%2.5 AND BO",
"XX|XX|XX",
],
category:"gases",
temp: 10,
tempLow: -30,
stateLow: "red_rain",
state: "gas",
density: 0.55,
ignoreAir: true,
conduct: 0.01,
reactions: {
"rain_cloud": { elem2: "red_rain", chance:0.4 },
"cloud": { elem2: "red_cloud", chance:0.4, chance:0.4 },
"snow_cloud": { elem2: "red_snow_cloud", chance:0.4 },
"frozen_plant":{elem2:"red_ice_plant", chance:0.025},
"dead_plant":{elem2:"red_plant", chance:0.025},
"water":{elem2:"red_ice"},
"blood":{elem2:"red_ice"},
"blood_ice":{elem2:"red_ice", chance:0.25},
"antibody":{elem2:"red_ice"},
"salt_water":{elem2:"red_ice"},
"sugar_water":{elem2:"red_ice"},
"dirty_water":{elem2:"red_ice"},
"pool_water":{elem2:"red_ice"},
"slush":{elem2:"red_ice"},
"seltzer":{elem2:"red_ice"},
"juice":{elem2:"red_ice"},
"soda":{elem2:"red_ice"},
"milk":{elem2:"red_ice"},
"slime":{elem2:"red_ice"},
"tea":{elem2:"red_ice"},
"coffee":{elem2:"red_ice"},
"neutral_acid":{elem2:"red_ice"},
"infection":{elem2:"red_ice"},
"meat":{elem2:"red_ice_meat", chance:0.015},
"skin":{elem2:"red_ice_meat", chance:0.0075},
"body":{elem2:"red_ice_meat", chance:0.004},
"head":{elem2:"red_ice_meat", chance:0.005},
"frozen_meat":{elem2:"red_ice_meat", chance:0.015},
"fish":{elem2:"red_ice_meat", chance:0.015},
"bird":{elem2:"red_ice_meat", chance:0.015},
"frog":{elem2:"red_ice_meat", chance:0.015},
"tadpole":{elem2:"red_ice_meat", chance:0.015},
},
}
elements.graphite = {
color: "#2F2F33",
colorKey: {
@ -763,3 +1154,406 @@ elements.graphite_dust = {
density: 1830,
stain: 0.6
}
scaleLimit = 0
elements.pixel_scale = {
color: "#89796C",
category: "machines",
behavior: behaviors.WALL,
tempHigh: 3000,
stateHigh: "molten_steel",
density: 7850,
movable: false,
onSelect: function() {
var answer1 = prompt("Input the desired pixel limit of this scale. It will not work if you place multiple limits while paused.",(scaleLimit||undefined));
if (!answer1) { return }
scaleLimit = (answer1);
},
tick: function(pixel){
if (pixel.start === pixelTicks) {
pixel.scaleLimit = scaleLimit
}
if (isEmpty(pixel.x-1,pixel.y) || pixelMap[pixel.x-1][pixel.y].element !== pixel.element) {
pixel.scaleList = []
for (let i = 1; i < width; i++){
if (!isEmpty(pixel.x+i, pixel.y, true)) {
if (pixelMap[pixel.x+i][pixel.y].element === pixel.element){
let distance2 = grabPixels(pixelMap[pixel.x+i][pixel.y]);
pixel.scaleList.push((distance2.top - 1));
}
}
}
pixel.scaleSum = 0
for (let i = 0; i < pixel.scaleList.length; i++){
if (pixel.scaleList[i]){
pixel.scaleSum += (pixel.scaleList[i])
}
}
let distance = grabPixels(pixel);
pixel.scaleSum += (distance.top - 1)
if (pixel.scaleSum > (pixel.scaleLimit - 1)) {
if (!isEmpty(pixel.x, pixel.y-1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y-1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x, pixel.y+1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y+1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x-1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x-1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x+1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x+1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
}
}
}
}
kiloLimit = 0
elements.weight_scale = {
color: "#7A7977",
category: "machines",
behavior: behaviors.WALL,
tempHigh: 3000,
stateHigh: "molten_steel",
movable: false,
onSelect: function() {
var answer1 = prompt("Input the desired kilogram limit of this scale. It will not work if you place multiple limits while paused.",(kiloLimit||1602));
if (!answer1) { return }
kiloLimit = (answer1);
},
tick: function(pixel){
if (pixel.start === pixelTicks) {
pixel.scaleLimit = kiloLimit
}
if (isEmpty(pixel.x-1,pixel.y) || !outOfBounds(pixel.x-1,pixel.y) || pixelMap[pixel.x-1][pixel.y].element !== pixel.element) {
pixel.scaleList = []
for (let i = 1; i < width; i++){
if (!isEmpty(pixel.x+i, pixel.y, true)) {
if (pixelMap[pixel.x+i][pixel.y].element === pixel.element){
let distance2 = grabWeights(pixelMap[pixel.x+i][pixel.y]);
pixel.scaleList.push((distance2.weight));
}
}
}
pixel.scaleSum = 0
for (let i = 0; i < pixel.scaleList.length; i++){
if (pixel.scaleList[i]){
pixel.scaleSum += (pixel.scaleList[i])
}
}
let distance = grabWeights(pixel);
pixel.scaleSum += (distance.weight)
if (pixel.scaleSum > (pixel.scaleLimit - 1)) {
if (!isEmpty(pixel.x, pixel.y-1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y-1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x, pixel.y+1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y+1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x-1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x-1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x+1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x+1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
}
}
}
}
scanLimit = 0
scanningLimit = 0
elements.pixel_scanner = {
color: "#799187",
category: "machines",
behavior: behaviors.WALL,
tempHigh: 3000,
stateHigh: ["molten_steel","molten_steel","molten_steel","flash"],
density: 7850,
movable: false,
onSelect: function() {
var answer1 = prompt("Input the desired pixel limit of this scanner. It will not work if you place multiple limits while paused.",(scanLimit||5));
if (!answer1) { return }
scanLimit = (answer1);
var answer2 = prompt("Input the desired scanning limit of this scanner. It will not work if you place multiple limits while paused.",(scanningLimit||10));
if (!answer2) { return }
scanningLimit = (answer2);
},
tick: function(pixel){
if (pixel.start === pixelTicks) {
pixel.scaleLimit = scanLimit
pixel.scanningLimit = scanningLimit
}
if (isEmpty(pixel.x-1,pixel.y) || pixelMap[pixel.x-1][pixel.y].element !== pixel.element) {
pixel.scaleList = []
for (let i = 1; i < width; i++){
if (!isEmpty(pixel.x+i, pixel.y, true)) {
if (pixelMap[pixel.x+i][pixel.y].element === pixel.element){
let distance2 = grabAllPixels(pixelMap[pixel.x+i][pixel.y]);
pixel.scaleList.push((distance2.pixels - 1));
}
}
}
pixel.scaleSum = 0
for (let i = 0; i < pixel.scaleList.length; i++){
if (pixel.scaleList[i]){
pixel.scaleSum += (pixel.scaleList[i])
}
}
let distance = grabAllPixels(pixel);
pixel.scaleSum += (distance.pixels - 1)
if (pixel.scaleSum > (pixel.scaleLimit - 1)) {
if (!isEmpty(pixel.x, pixel.y-1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y-1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x, pixel.y+1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y+1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x-1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x-1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x+1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x+1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
}
}
}
}
kiloScanLimit = 0
kiloScanningLimit = 0
elements.weight_scanner = {
color: "#6D9190",
category: "machines",
behavior: behaviors.WALL,
tempHigh: 3000,
stateHigh: "molten_steel",
movable: false,
onSelect: function() {
var answer1 = prompt("Input the desired kilogram limit of this scanner. It will not work if you place multiple limits while paused.",(kiloScanLimit||1602));
if (!answer1) { return }
kiloScanLimit = (answer1);
var answer2 = prompt("Input the desired scanning limit of this scanner. It will not work if you place multiple limits while paused.",(kiloScanningLimit||10));
if (!answer2) { return }
kiloScanningLimit = (answer2);
},
tick: function(pixel){
if (pixel.start === pixelTicks) {
pixel.scaleLimit = kiloScanLimit
pixel.scanningLimit = kiloScanningLimit
}
if (isEmpty(pixel.x-1,pixel.y) || pixelMap[pixel.x-1][pixel.y].element !== pixel.element) {
pixel.scaleList = []
for (let i = 1; i < width; i++){
if (!isEmpty(pixel.x+i, pixel.y, true)) {
if (pixelMap[pixel.x+i][pixel.y].element === pixel.element){
let distance2 = grabAllWeights(pixelMap[pixel.x+i][pixel.y]);
pixel.scaleList.push((distance2.weight));
}
}
}
pixel.scaleSum = 0
for (let i = 0; i < pixel.scaleList.length; i++){
if (pixel.scaleList[i]){
pixel.scaleSum += (pixel.scaleList[i])
}
}
let distance = grabAllWeights(pixel);
pixel.scaleSum += (distance.weight)
if (pixel.scaleSum > (pixel.scaleLimit - 1)) {
if (!isEmpty(pixel.x, pixel.y-1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y-1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x, pixel.y+1, true)) {
var hitPixel = pixelMap[pixel.x][pixel.y+1]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x-1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x-1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
if (!isEmpty(pixel.x+1, pixel.y, true)) {
var hitPixel = pixelMap[pixel.x+1][pixel.y]
doElectricity(hitPixel);
if (elements[hitPixel.element].conduct) {
hitPixel.charge = 0.5
}
}
}
}
}
}
grabPixels = function(pixel){
let element = pixel.element
let results = {}
for (let i = 0; i < height; i++) {
if (isEmpty(pixel.x, pixel.y-i, true)){
results.top = i
break;
}
}
return results
}
grabAllPixels = function(pixel){
let element = pixel.element
let results = {}
results.pixels = 0
for (let i = 0; i < height; i++) {
if (!isEmpty(pixel.x, pixel.y-i, true)){
results.pixels += 1
}
if (i > (pixel.scanningLimit - 1)){
break;
}
}
return results
}
grabWeights = function(pixel){
let element = pixel.element
let results = {}
let weight = 0
for (let i = 0; i < height; i++){
if (!isEmpty(pixel.x, pixel.y-i, true)){
if (elements[pixelMap[pixel.x][pixel.y-i].element].density && !weight) {
weight += elements[pixelMap[pixel.x][pixel.y-i].element].density
}
else if (elements[pixelMap[pixel.x][pixel.y-i].element].density && weight) {
weight += elements[pixelMap[pixel.x][pixel.y-i].element].density
}
else if (!elements[pixelMap[pixel.x][pixel.y-i].element].density) {
let result;
if (elements[pixelMap[pixel.x][pixel.y-i].element].breakInto !== undefined) {
if (Array.isArray(elements[pixelMap[pixel.x][pixel.y-i].element].breakInto)) {
result = elements[pixelMap[pixel.x][pixel.y-i].element].breakInto[Math.floor(Math.random() * elements[pixel.element].breakInto.length)];
weight += elements.result.density
}
else {
result = elements[pixelMap[pixel.x][pixel.y-i].element].breakInto;
weight += elements.result.density
}
}
}
}
if (isEmpty(pixel.x, pixel.y-i, true)){
results.top = i
if (isEmpty(pixel.x, pixel.y-i, true)){
results.topelement = "air"
} else {
results.topelement = pixelMap[pixel.x][pixel.y-i].element
}
break;
}
}
results.weight = weight
return results
}
grabAllWeights = function(pixel){
let element = pixel.element
let results = {}
let weight = 0
for (let i = 0; i < height; i++){
if (!isEmpty(pixel.x, pixel.y-i, true)){
if (elements[pixelMap[pixel.x][pixel.y-i].element].density && !weight) {
weight = elements[pixelMap[pixel.x][pixel.y-i].element].density
}
else if (elements[pixelMap[pixel.x][pixel.y-i].element].density && weight) {
weight += elements[pixelMap[pixel.x][pixel.y-i].element].density
}
else if (!elements[pixelMap[pixel.x][pixel.y-i].element].density) {
let result;
if (elements[pixelMap[pixel.x][pixel.y-i].element].breakInto !== undefined) {
if (Array.isArray(elements[pixelMap[pixel.x][pixel.y-i].element].breakInto)) {
result = elements[pixelMap[pixel.x][pixel.y-i].element].breakInto[Math.floor(Math.random() * elements[pixel.element].breakInto.length)];
weight += elements.result.density
}
else {
result = elements[pixelMap[pixel.x][pixel.y-i].element].breakInto;
weight += elements.result.density
}
}
}
}
if (i > (pixel.scanningLimit - 1)){
break;
}
}
results.weight = weight
return results
}
/*elements.Cherries_Ceri_Moji = {
color: "#fcd1d7",
category: Student,
state: High_School,
behavior: [Shy, Introverted, Easily_Excited, Kind],
pronouns: [She,Her,Herself],
sexuality: [Panromantic, Asexual],
desc: "Ceri is a 16 year old high school student who loves cats"
}*/

View File

@ -62,8 +62,8 @@ elements.volleyball = {
};
elements.deodorant = {
color: "#def2fc",
behavior: behaviors.DGAS,
category: "gases",
state: "gas",
color: "#def2fc",
behavior: behaviors.DGAS,
category: "gases",
state: "gas",
};