2025-05-09 21:22:23 -04:00
//Main version. Still in WIP
2025-03-10 06:32:45 -04:00
//reminder for creator: human code is on index.html line 3242.
2025-05-09 21:22:23 -04:00
//Ini adalah aScientistsWish.js, mod dari Sandboxels yang diciptakan oleh Carbon Monoxide dengan bantuan startup oleh Salmonfishy, bertema sains dan semi fiktif dengan adanya zombie, mod ini masih dalam tahap pengembangan.
2024-04-03 02:56:15 -04:00
elements . carbon _monoxide = {
2025-03-10 06:32:45 -04:00
color : [ "#b5b5b5" , "#404040" , "#2b2b2b" , ] ,
2024-07-30 06:10:32 -04:00
behavior : behaviors . GAS ,
behaviorOn : [
"XX|XX|XX" ,
"XX|CH:fire|XX" ,
"XX|XX|XX" ,
] ,
category : "gases" ,
state : "gas" ,
density : 1.14 ,
burn : 75 ,
tempHigh : 609 ,
stateHigh : "fire" ,
tempLow : - 192 ,
stateLow : "liquid_carbon_monoxide" ,
burntime : 5 ,
2025-03-10 06:32:45 -04:00
fireColor : [ "#ff8833" , "#ffad33" , "#ffbe26" , "#26baff" , "#26e9ff" , ] ,
burnInto : "carbon_dioxide" , chance : 0.3 ,
2024-07-30 06:10:32 -04:00
darkText : true ,
reactions : {
2025-03-10 06:32:45 -04:00
"head" : { elem2 : "rotten_meat" , chance : 0.5 , } ,
"body" : { elem2 : "rotten_meat" , chance : 0.5 } ,
"human" : { elem2 : "rotten_meat" , chance : 0.5 } ,
"worm" : { elem2 : "rotten_meat" , chance : 0.5 } ,
"bee" : { elem2 : "dead_bug" , chance : 0.5 } ,
"ant" : { elem2 : "dead_bug" , chance : 0.5 } ,
"flea" : { elem2 : "dead_bug" , chance : 0.5 } ,
"spider" : { elem2 : "dead_bug" , chance : 0.5 } ,
"fly" : { elem2 : "dead_bug" , chance : 0.5 } ,
"stink_bug" : { elem2 : "dead_bug" , chance : 0.5 } ,
"bird" : { elem2 : "rotten_meat" , chance : 0.5 } ,
"frog" : { elem2 : "slime" , chance : 0.5 } ,
"rat" : { elem2 : [ "rotten_meat" , "plague" ] , chance : 0.5 } ,
"fish" : { elem2 : "rotten_meat" , chance : 0.5 } ,
"tadpole" : { elem2 : "rotten_meat" , chance : 0.5 } ,
"slug" : { elem2 : "slime" , chance : 0.5 } ,
"snail" : { elem2 : "slime" , chance : 0.5 } ,
"grass" : { elem2 : "dead_plant" , chance : 0.5 } ,
"plant" : { elem2 : "dead_plant" , chance : 0.5 } ,
"cactus" : { elem2 : "dead_plant" , chance : 0.5 } ,
"petal" : { elem2 : "dead_plant" , chance : 0.5 } ,
}
2024-04-03 02:56:15 -04:00
} ;
elements . liquid _carbon _monoxide = {
2025-03-10 06:32:45 -04:00
color : [ "#b5b5b5" , "#404040" , "#2b2b2b" , ] ,
2024-07-30 06:10:32 -04:00
behavior : behaviors . LIQUID ,
category : "liquids" ,
state : "liquid" ,
density : 1.14 ,
darkText : true ,
tempHigh : - 190 ,
temp : - 192 ,
tempLow : - 199 ,
hidden : true ,
stateLow : "ice_carbon_monoxide" ,
stateHigh : "carbon_monoxide" ,
2024-04-03 02:56:15 -04:00
} ;
elements . ice _carbon _monoxide = {
2025-03-10 06:32:45 -04:00
color : [ "#b5b5b5" , "#404040" , "#2b2b2b" , ] ,
2024-07-30 06:10:32 -04:00
behavior : behaviors . WALL ,
category : "solids" ,
state : "solid" ,
temp : - 199 ,
density : 1.14 ,
tempHigh : - 192 ,
darkText : true ,
stateHigh : "liquid_carbon_monoxide" ,
2024-04-03 02:56:15 -04:00
} ;
elements . carbon _monoxide _detector = {
2024-07-30 06:10:32 -04:00
behavior : behaviors . WALL ,
2025-03-10 06:32:45 -04:00
color : [ "#ffffff" , "#e0e0e0" , "#cccbca" , ] ,
2024-07-30 06:10:32 -04:00
reactions : {
"carbon_monoxide" : { "charge1" : 1 } ,
} ,
conduct : 1 ,
tempHigh : 1550 ,
stateHigh : [ "molten_metal_scrap" , "electric" , "molten_plastic" ] ,
colorOn : "#ff0000" ,
movable : false ,
insulate : true ,
noMix : true ,
category : "machines" ,
darkText : true ,
hardness : 1 ,
2024-04-03 02:56:15 -04:00
} ;
elements . gelatin = {
2024-07-30 06:10:32 -04:00
behavior : behaviors . SOLID ,
category : "food" ,
2025-03-10 06:32:45 -04:00
state : "powder" ,
density : 1.2 ,
color : [ "#ffe7b8" , "#fce2ac" , "#fcf2dc" ] ,
2024-07-30 06:10:32 -04:00
breakInto : "gelatin_powder" ,
ignoreAir : true ,
isFood : true ,
2025-03-10 06:32:45 -04:00
reactions : {
"water" : { elem2 : "jelly" , } ,
"pool_water" : { elem2 : "jelly" , } ,
"salt_water" : { elem2 : "jelly" , }
}
2024-04-03 02:56:15 -04:00
} ;
elements . gelatin _powder = {
2024-07-30 06:10:32 -04:00
behavior : behaviors . POWDER ,
category : "food" ,
2025-03-10 06:32:45 -04:00
density : 1.2 ,
state : [ "#ffe7b8" , "#fce2ac" , "#fcf2dc" ] ,
2024-07-30 06:10:32 -04:00
color : "#edeb9f" ,
hidden : true ,
ignoreAir : true ,
isFood : true ,
2025-03-10 06:32:45 -04:00
reactions : {
"water" : { elem2 : "jelly" , } ,
"pool_water" : { elem2 : "jelly" , } ,
"salt_water" : { elem2 : "jelly" , }
}
} ;
2024-04-03 02:56:15 -04:00
elements . fallout _drum = {
2025-03-10 06:32:45 -04:00
behavior : [
[ "XX" , "CR:radiation%25" , "XX" ] ,
[ "CR:radiation%25" , "XX" , "CR:radiation%25" ] ,
[ "XX" , "CR:radiation%25" , "XX" ]
] ,
2024-07-30 06:10:32 -04:00
category : "radiated" ,
state : "solid" ,
density : 9000 ,
color : "#e3cc34" ,
2025-03-10 06:32:45 -04:00
conduct : 1 ,
2024-07-30 06:10:32 -04:00
tempHigh : 2500 ,
stateHigh : [ "aluminum" , "radiated_water" , "radiated_water" , "fallout" ] ,
breakInto : [ "fallout" , "fallout" ] ,
reactions : {
2025-03-10 06:32:45 -04:00
"water" : { elem1 : "fallout_drum" , elem2 : "radiated_water" } ,
"dna" : { elem2 : "cancer" , } ,
"cell" : { elem2 : "cancer" , } ,
2024-07-30 06:10:32 -04:00
}
2024-04-03 02:56:15 -04:00
} ;
elements . radiated _water = {
2025-03-10 06:32:45 -04:00
behavior : [
"XX|CR:radiation%2.5|XX" ,
"M2 AND CR:radiation%2.5|CH:radiation%0.2|M2 AND CR:radiation%2.5" ,
"M1|M1|M1" ,
] ,
2024-07-30 06:10:32 -04:00
category : "radiated" ,
state : "liquid" ,
density : 1300 ,
color : [ "#23d959" , "#29d65d" ] ,
hidden : true ,
tempHigh : 140 ,
2025-03-10 06:32:45 -04:00
conduct : 1 ,
stateHigh : "radiated_air" ,
2024-07-30 06:10:32 -04:00
tempLow : - 6 ,
stateLow : "rad_ice" ,
reactions : {
2025-03-10 06:32:45 -04:00
"head" : { elem2 : [ "rotten_meat" , "ash" , "plague" ] , } ,
"body" : { elem2 : "rotten_meat" , } ,
"human" : { elem2 : "rotten_meat" , } ,
"worm" : { elem2 : "rotten_meat" , } ,
"bee" : { elem2 : "dead_bug" , } ,
"ant" : { elem2 : "dead_bug" , } ,
"flea" : { elem2 : "dead_bug" , } ,
"spider" : { elem2 : "dead_bug" , } ,
"fly" : { elem2 : "dead_bug" , } ,
"stink_bug" : { elem2 : "dead_bug" , } ,
"bird" : { elem2 : "rotten_meat" , } ,
"frog" : { elem2 : "slime" , } ,
"rat" : { elem2 : [ "rotten_meat" , "plague" ] , } ,
"fish" : { elem2 : "rotten_meat" , } ,
"tadpole" : { elem2 : "rotten_meat" , } ,
"slug" : { elem2 : "slime" , } ,
"snail" : { elem2 : "slime" , } ,
"grass" : { elem2 : "dead_plant" , } ,
"plant" : { elem2 : "dead_plant" , } ,
"cactus" : { elem2 : "dead_plant" , } ,
"petal" : { elem2 : "dead_plant" , } ,
"cell" : { elem2 : "cancer" , } ,
"dna" : { elem2 : null , } ,
2024-07-30 06:10:32 -04:00
}
2024-04-03 02:56:15 -04:00
} ;
2025-03-10 06:32:45 -04:00
elements . radiated _air = {
2024-07-30 06:10:32 -04:00
behavior : behaviors . DGAS ,
category : "radiated" ,
state : "gas" ,
density : 10 ,
color : [ "#60f53b" , "#65ba50" ] ,
reactions : {
2025-03-10 06:32:45 -04:00
"head" : { elem2 : [ "rotten_meat" , "ash" , "plague" ] , } ,
"body" : { elem2 : "rotten_meat" , } ,
"human" : { elem2 : "rotten_meat" , } ,
"worm" : { elem2 : "rotten_meat" , } ,
"bee" : { elem2 : "dead_bug" , } ,
"ant" : { elem2 : "dead_bug" , } ,
"flea" : { elem2 : "dead_bug" , } ,
"spider" : { elem2 : "dead_bug" , } ,
"fly" : { elem2 : "dead_bug" , } ,
"stink_bug" : { elem2 : "dead_bug" , } ,
"bird" : { elem2 : "rotten_meat" , } ,
"frog" : { elem2 : "slime" , } ,
"rat" : { elem2 : [ "rotten_meat" , "plague" ] , } ,
"fish" : { elem2 : "rotten_meat" , } ,
"tadpole" : { elem2 : "rotten_meat" , } ,
"slug" : { elem2 : "slime" , } ,
"snail" : { elem2 : "slime" , } ,
"grass" : { elem2 : "dead_plant" , } ,
"plant" : { elem2 : "dead_plant" , } ,
"cactus" : { elem2 : "dead_plant" , } ,
"petal" : { elem2 : "dead_plant" , } ,
"cell" : { elem2 : "cancer" , } ,
"dna" : { elem2 : null , } ,
2024-07-30 06:10:32 -04:00
} ,
2024-04-03 02:56:15 -04:00
} ;
elements . siren = {
2024-07-30 06:10:32 -04:00
desc : "Detecting Nuclear Radiation Residues" ,
behavior : behaviors . WALL ,
category : "machines" ,
state : "solid" ,
density : 500 ,
color : "#808080" ,
reactions : {
"fallout" : { "charge1" : 1 } ,
"radiated_water" : { "charge1" : 1 } ,
2025-03-10 06:32:45 -04:00
"radiated_air" : { "charge1" : 1 } ,
2024-07-30 06:10:32 -04:00
"radiation" : { "charge1" : 1 } ,
"rad_snow" : { "charge1" : 1 } ,
"rad_rock" : { "charge1" : 1 } ,
}
2024-04-08 19:11:09 -04:00
} ;
2025-05-09 21:22:23 -04:00
elements . radiated _metal = {
2025-03-10 06:32:45 -04:00
behavior : [
[ "XX" , "CR:radiation%25" , "XX" ] ,
[ "CR:radiation%25" , "XX" , "CR:radiation%25" ] ,
[ "XX" , "CR:radiation%25" , "XX" ]
] ,
2024-07-30 06:10:32 -04:00
category : "radiated" ,
state : "solid" ,
density : 2045 ,
2025-03-10 06:32:45 -04:00
conduct : 1 ,
2024-07-30 06:10:32 -04:00
color : [ "#5e705a" , "#83ab7b" , "#474747" ] ,
tempHigh : 1440 ,
stateHigh : [ "molten_nickel" , "molten_iron" , "molten_tin" , "fallout" ] ,
reactions : {
"water" : { elem2 : "radiated_water" , chance : 0.7 } ,
"foam" : { elem1 : [ "tin" , "nickel" , "iron" ] } ,
}
2024-04-08 19:11:09 -04:00
} ;
elements . rad _ice = {
2025-03-10 06:32:45 -04:00
behavior : [
[ "XX" , "CR:radiation%25" , "XX" ] ,
[ "CR:radiation%25" , "XX" , "CR:radiation%25" ] ,
[ "XX" , "CR:radiation%25" , "XX" ]
] ,
2024-07-30 06:10:32 -04:00
category : "radiated" ,
state : "solid" ,
density : 1905 ,
color : [ "#81d79c" , "#68b899" , "#68abb8" ] ,
hidden : true ,
temp : - 6 ,
tempHigh : 5 ,
stateHigh : [ "radiated_water" , "water" ] ,
reactions : {
"snow" : { elem2 : "dirty_water" } ,
"water" : { elem2 : "radiated_water" } ,
}
2024-04-18 06:13:50 -04:00
}
elements . rad _snow = {
2025-03-10 06:32:45 -04:00
behavior : [
"XX|CR:radiation%2|XX" ,
"CR:radiation%2|XX|CR:radiation%2" ,
"M2|M1|M2" , ] ,
2024-07-30 06:10:32 -04:00
category : "radiated" ,
state : "powder" ,
density : 1500 ,
color : [ "#9effe4" , "#b5fffd" , "#d4fff1" ] ,
temp : - 2 ,
tempHigh : 21 ,
stateHigh : "radiated_water" ,
2024-04-18 06:13:50 -04:00
} ;
elements . rad _rock = {
2025-03-10 06:32:45 -04:00
behavior : [
"XX|CR:radiation%2|XX" ,
"CR:radiation%2|XX|CR:radiation%2" ,
"M2|M1|M2" , ] ,
2024-07-30 06:10:32 -04:00
category : "land" ,
state : "powder" ,
density : 2790 ,
color : [ "#34382d" , "#3f4633" , "#595a4d" ] ,
tempHigh : 1200 ,
stateHigh : [ "magma" , "fallout" ] ,
reactions : {
"water" : { elem2 : "dirty_water" } ,
"salt_water" : { elem2 : "dirty_water" } ,
"sugar_water" : { elem2 : "dirty_water" } ,
"seltzer" : { elem2 : "dirty_water" } ,
"bleach" : { elem2 : "rock" , chance : 0.1 } ,
"rad_cleaner" : { elem1 : "rock" } ,
"foam" : { elem1 : "rock" } ,
"juice" : { elem2 : null } ,
"blood" : { elem2 : "infection" } ,
"grass" : { elem2 : "dead_plant" } ,
"plant" : { elem2 : "dead_plant" } ,
"cell" : { elem2 : "cancer" } ,
"worm" : { elem2 : "ash" } ,
"glass" : { elem2 : "rad_glass" } ,
"glass_shard" : { elem2 : "rad_shard" } ,
}
2024-04-18 06:13:50 -04:00
} ;
elements . rad _cleaner = {
2024-07-30 06:10:32 -04:00
behavior : behaviors . WALL ,
category : "machines" ,
state : "solid" ,
density : 2500 ,
color : [ "#383838" , "#212220" ] ,
desc : "clean radiated elements" ,
tempHigh : 1250 ,
stateHigh : [ "fallout" , "molten_plastic" , "steam" ] ,
reactions : {
"radiated_water" : { elem2 : "water" } ,
2025-03-10 06:32:45 -04:00
"radiated_air" : { elem2 : "oxygen" } ,
2024-07-30 06:10:32 -04:00
"rad_snow" : { elem2 : "snow" } ,
"rad_rock" : { elem2 : "rock" } ,
"radiated_metal" : { elem2 : [ "nickel" , "tin" , "iron" ] , } ,
"fallout" : { elem2 : "rock" , } ,
2025-03-10 06:32:45 -04:00
"radiation" : { elem2 : null , } ,
2024-07-30 06:10:32 -04:00
}
} ;
elements . hazmat _head = {
color : [ "#404040" , "#1a1a1a" , "#737373" ] ,
category : "life" ,
hidden : true ,
2024-09-13 22:58:13 -04:00
density : 1380 ,
2024-07-30 06:10:32 -04:00
state : "solid" ,
conduct : . 05 ,
2024-09-13 22:58:13 -04:00
temp : 39 ,
2025-03-10 06:32:45 -04:00
tempHigh : 3500 ,
2024-07-30 06:10:32 -04:00
stateHigh : [ "ash" , "iron" , ] ,
tempLow : - 180 ,
stateLow : "frozen_meat" ,
breakInto : [ "blood" , "meat" , "bone" , "metal_scrap" ] ,
forceSaveColor : true ,
reactions : {
"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 } ,
2024-09-13 22:58:13 -04:00
"sun" : { elem1 : "cooked_meat" } ,
"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 } ,
2024-07-30 06:10:32 -04:00
} ,
properties : {
dead : false
} ,
tick : function ( pixel ) {
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
}
}
// Find the body
if ( ! isEmpty ( pixel . x , pixel . y + 1 , true ) && pixelMap [ pixel . x ] [ pixel . y + 1 ] . element == "hazmat_body" ) {
var body = pixelMap [ pixel . x ] [ pixel . y + 1 ] ;
if ( body . dead ) { // If body is dead, kill head
pixel . dead = body . dead ;
}
}
else { var body = null }
if ( tryMove ( pixel , pixel . x , pixel . y + 1 ) ) {
// create blood if severed 10% chance
if ( isEmpty ( pixel . x , pixel . y + 1 ) && ! pixel . dead && Math . random ( ) < 0.1 && ! pixel . charge ) {
createPixel ( "blood" , pixel . x , pixel . y + 1 ) ;
// set dead to true 15% chance
if ( Math . random ( ) < 0.15 ) {
pixel . dead = pixelTicks ;
}
}
}
// homeostasis
if ( pixel . temp > 40 ) { pixel . temp -= 1 ; }
else if ( pixel . temp < 40 ) { pixel . temp += 1 ; }
}
} ;
elements . hazmat _body = {
2024-09-13 22:58:13 -04:00
color : [ "#2c7328" , "#2db526" , "#ffc42e" , "#f5c345" , "#cf9502" , ] ,
2024-07-30 06:10:32 -04:00
category : "life" ,
hidden : true ,
2024-09-13 22:58:13 -04:00
density : 1370 ,
2024-07-30 06:10:32 -04:00
state : "solid" ,
conduct : . 25 ,
temp : 39 ,
2025-03-10 06:32:45 -04:00
tempHigh : 3500 ,
2024-07-30 06:10:32 -04:00
stateHigh : [ "metal_scrap" , "ash" ] ,
tempLow : - 180 ,
stateLow : "frozen_meat" ,
breakInto : [ "blood" , "meat" , "bone" , "metal_scrap" , "radiation" , "fallout" , ] ,
forceSaveColor : true ,
reactions : {
"egg" : { elem2 : "yolk" , chance : 0.5 , oneway : true } ,
"grape" : { elem2 : "juice" , chance : 0.5 , color2 : "#291824" , oneway : true } ,
"ant" : { elem2 : "dead_bug" , chance : 0.05 , oneway : true } ,
"fly" : { elem2 : "dead_bug" , oneway : true } ,
"firefly" : { elem2 : "dead_bug" , oneway : true } ,
"bee" : { elem2 : "dead_bug" , oneway : true } ,
"flea" : { elem2 : "dead_bug" , oneway : true } ,
"termite" : { elem2 : "dead_bug" , oneway : true } ,
"worm" : { elem2 : "slime" , chance : 0.05 , oneway : true } ,
"stink_bug" : { elem2 : "stench" , oneway : true } ,
"grass_seed" : { elem2 : null , chance : 0.05 } ,
"gold_coin" : { elem2 : null , chance : 0.05 } ,
"diamond" : { elem2 : null , chance : 0.05 } ,
} ,
properties : {
dead : false ,
dir : 1 ,
panic : 0
} ,
tick : function ( pixel ) {
if ( tryMove ( pixel , pixel . x , pixel . y + 1 ) ) { // Fall
if ( ! isEmpty ( pixel . x , pixel . y - 2 , true ) ) { // Drag head down
var headpixel = pixelMap [ pixel . x ] [ pixel . y - 2 ] ;
if ( headpixel . element == "hazmat_head" ) {
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 ] ) ;
}
}
}
}
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
}
// Find the head
if ( ! isEmpty ( pixel . x , pixel . y - 1 , true ) && pixelMap [ pixel . x ] [ pixel . y - 1 ] . element == "hazmat_head" ) {
var head = pixelMap [ pixel . x ] [ pixel . y - 1 ] ;
if ( head . dead ) { // If head is dead, kill body
pixel . dead = head . dead ;
}
}
else { var head = null }
if ( pixel . burning ) {
pixel . panic += 0.1 ;
if ( head && pixelTicks - pixel . burnStart > 240 ) {
pixel . color = head . color ;
}
}
else if ( pixel . panic > 0 ) {
pixel . panic -= 0.1 ;
}
if ( isEmpty ( pixel . x , pixel . y - 1 ) ) {
// create blood if decapitated 10% chance
if ( Math . random ( ) < 0.1 && ! pixel . charge ) {
createPixel ( "blood" , pixel . x , pixel . y - 1 ) ;
// set dead to true 15% chance
if ( Math . random ( ) < 0.15 ) {
pixel . dead = pixelTicks ;
}
}
}
else if ( head == null ) { return }
else 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 ) {
movePixel ( head , head . x + move [ 0 ] , head . y + move [ 1 ] ) ;
break ;
}
}
}
// 15% chance to change direction
if ( Math . random ( ) < 0.15 ) {
pixel . dir *= - 1 ;
}
// homeostasis
if ( pixel . temp > 39 ) { pixel . temp -= 1 ; }
else if ( pixel . temp < 39 ) { pixel . temp += 1 ; }
}
}
} ;
elements . hazmat _human = {
color : [ "#404040" , "#1a1a1a" , "#737373" ] ,
category : "life" ,
properties : {
dead : false ,
dir : 1 ,
panic : 0
} ,
tick : function ( pixel ) {
if ( isEmpty ( pixel . x , pixel . y + 1 ) ) {
createPixel ( "hazmat_body" , pixel . x , pixel . y + 1 ) ;
pixel . element = "hazmat_head" ;
}
else if ( isEmpty ( pixel . x , pixel . y - 1 ) ) {
createPixel ( "hazmat_head" , pixel . x , pixel . y - 1 ) ;
pixelMap [ pixel . x ] [ pixel . y - 1 ] . color = pixel . color ;
pixel . element = "hazmat_body" ;
pixel . color = pixelColorPick ( pixel )
}
else {
deletePixel ( pixel . x , pixel . y ) ;
}
} ,
related : [ "hazmat_body" , "hazmat_head" ] ,
cooldown : defaultCooldown ,
forceSaveColor : true ,
} ;
elements . zombie _head = {
color : [ "#57f542" , "#43de2f" , "#46c435" ] ,
category : "life" ,
hidden : true ,
density : 1025 ,
state : "solid" ,
conduct : . 07 ,
temp : 28 ,
tempHigh : 320 ,
stateHigh : [ "ash" , "zombie_virus" , ] ,
tempLow : - 45 ,
stateLow : [ "frozen_meat" , "zombie_virus" , ] ,
breakInto : [ "infection" , "rotten_meat" , "bone" , "zombie_virus" , ] ,
forceSaveColor : true ,
reactions : {
"head" : { elem2 : [ "rotten_meat" , "zombie" , ] , chance : 0.8 , } ,
"body" : { elem2 : [ "rotten_meat" , "zombie" , ] , chance : 0.5 , } ,
"oxygen" : { elem2 : "carbon_dioxide" , chance : 0.5 } ,
"rotten_meat" : { elem2 : null , chance : 0.5 } ,
"meat" : { elem2 : null , chance : 0.1 } ,
"cooked_meat" : { elem2 : null , chance : 0.1 } ,
"cured_meat" : { elem2 : null , chance : 0.1 } ,
} ,
properties : {
dead : false
} ,
tick : function ( pixel ) {
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
}
}
// Find the body
if ( ! isEmpty ( pixel . x , pixel . y + 1 , true ) && pixelMap [ pixel . x ] [ pixel . y + 1 ] . element == "zombie_body" ) {
var body = pixelMap [ pixel . x ] [ pixel . y + 1 ] ;
if ( body . dead ) { // If body is dead, kill head
pixel . dead = body . dead ;
}
}
else { var body = null }
if ( tryMove ( pixel , pixel . x , pixel . y + 1 ) ) {
// create blood if severed 10% chance
if ( isEmpty ( pixel . x , pixel . y + 1 ) && ! pixel . dead && Math . random ( ) < 0.1 && ! pixel . charge ) {
createPixel ( "blood" , pixel . x , pixel . y + 1 ) ;
// set dead to true 15% chance
if ( Math . random ( ) < 0.15 ) {
pixel . dead = pixelTicks ;
}
}
}
// homeostasis
if ( pixel . temp > 28 ) { pixel . temp -= 1 ; }
else if ( pixel . temp < 28 ) { pixel . temp += 1 ; }
}
} ;
elements . zombie _body = {
color : [ "#2d7ecf" , "#4d94db" , "#65a175" , ] ,
category : "life" ,
hidden : true ,
density : 1520 ,
state : "solid" ,
conduct : . 29 ,
temp : 29 ,
tempHigh : 350 ,
stateHigh : [ "zombie_virus" , "ash" ] ,
tempLow : - 180 ,
stateLow : [ "frozen_meat" , "zombie_virus" , ] ,
breakInto : [ "infection" , "rotten_meat" , "bone" , "zombie_virus" , ] ,
forceSaveColor : true ,
reactions : {
2024-09-13 22:58:13 -04:00
"head" : { elem2 : [ "rotten_meat" , "zombie" , ] , chance : 0.8 , } ,
"body" : { elem2 : [ "rotten_meat" , "zombie" , ] , chance : 0.5 , } ,
"oxygen" : { elem2 : "carbon_dioxide" , chance : 0.5 } ,
"rotten_meat" : { elem2 : null , chance : 0.5 } ,
"meat" : { elem2 : null , chance : 0.1 } ,
"cooked_meat" : { elem2 : null , chance : 0.1 } ,
"cured_meat" : { elem2 : null , chance : 0.1 } ,
2024-07-30 06:10:32 -04:00
} ,
properties : {
dead : false ,
dir : 1 ,
panic : 0
} ,
tick : function ( pixel ) {
if ( tryMove ( pixel , pixel . x , pixel . y + 1 ) ) { // Fall
if ( ! isEmpty ( pixel . x , pixel . y - 2 , true ) ) { // Drag head down
var headpixel = pixelMap [ pixel . x ] [ pixel . y - 2 ] ;
if ( headpixel . element == "zombie_head" ) {
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 ] ) ;
}
}
}
}
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
}
// Find the head
if ( ! isEmpty ( pixel . x , pixel . y - 1 , true ) && pixelMap [ pixel . x ] [ pixel . y - 1 ] . element == "zombie_head" ) {
var head = pixelMap [ pixel . x ] [ pixel . y - 1 ] ;
if ( head . dead ) { // If head is dead, kill body
pixel . dead = head . dead ;
}
}
else { var head = null }
if ( pixel . burning ) {
pixel . panic += 0.1 ;
if ( head && pixelTicks - pixel . burnStart > 240 ) {
pixel . color = head . color ;
}
}
else if ( pixel . panic > 0 ) {
pixel . panic -= 0.1 ;
}
if ( isEmpty ( pixel . x , pixel . y - 1 ) ) {
// create blood if decapitated 10% chance
if ( Math . random ( ) < 0.1 && ! pixel . charge ) {
createPixel ( "blood" , pixel . x , pixel . y - 1 ) ;
// set dead to true 15% chance
if ( Math . random ( ) < 0.15 ) {
pixel . dead = pixelTicks ;
}
}
}
else if ( head == null ) { return }
else 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 ) {
movePixel ( head , head . x + move [ 0 ] , head . y + move [ 1 ] ) ;
break ;
}
}
}
// 15% chance to change direction
if ( Math . random ( ) < 0.15 ) {
pixel . dir *= - 1 ;
}
// homeostasis
if ( pixel . temp > 29 ) { pixel . temp -= 1 ; }
else if ( pixel . temp < 29 ) { pixel . temp += 1 ; }
}
}
} ;
elements . zombie = {
// color: ["#404040","#1a1a1a","#737373"],
color : [ "#57f542" , "#43de2f" , "#46c435" ] ,
category : "life" ,
properties : {
dead : false ,
dir : 1 ,
panic : 0 ,
} ,
tick : function ( pixel ) {
if ( isEmpty ( pixel . x , pixel . y + 1 ) ) {
createPixel ( "zombie_body" , pixel . x , pixel . y + 1 ) ;
pixel . element = "zombie_head" ;
}
else if ( isEmpty ( pixel . x , pixel . y - 1 ) ) {
createPixel ( "zombie_head" , pixel . x , pixel . y - 1 ) ;
pixelMap [ pixel . x ] [ pixel . y - 1 ] . color = pixel . color ;
pixel . element = "zombie_body" ;
pixel . color = pixelColorPick ( pixel )
}
else {
deletePixel ( pixel . x , pixel . y ) ;
}
} ,
related : [ "zombie_body" , "zombie_head" ] ,
cooldown : defaultCooldown ,
forceSaveColor : true ,
} ;
elements . zombie _virus = {
behavior : behaviors . DGAS ,
color : [ "#660266" , "#bd06bd" , "#f041f0" , ] ,
category : "special" ,
density : 30 ,
state : "gas" ,
reactions : {
2024-09-13 22:58:13 -04:00
"head" : { elem2 : [ "zombie" , "rotten_meat" , ] , chance : 0.5 , } ,
"body" : { elem2 : [ "zombie" , "rotten_meat" , ] , chance : 0.5 , } ,
2024-07-30 06:10:32 -04:00
}
2024-04-03 02:56:15 -04:00
}
2024-07-30 06:10:32 -04:00
elements . matter = {
behavior : behaviors . GAS ,
color : [ "#c4f8ff" , "#b0f6ff" , "#9ccfd6" , ] ,
darkText : true ,
category : "energy" ,
density : 2.20 ,
state : "gas" ,
reactions : {
"antimatter" : { elem1 : "explosion" , } ,
"positron" : { elem1 : "explosion" , } ,
"electron" : { elem1 : "explosion" , } ,
}
} ;
elements . particle _accelerator _left = {
behavior : behaviors . SOLID ,
color : [ "#363aa3" , "#858585" , "#d1d1d1" ] ,
2024-09-13 22:58:13 -04:00
density : 8200 ,
2024-07-30 06:10:32 -04:00
category : "machines" ,
state : "solid" ,
reactions : {
"matter" : { elem2 : [ "accelerated_matter_left" , ] } ,
}
} ;
elements . particle _accelerator _right = {
behavior : behaviors . SOLID ,
color : [ "#363aa3" , "#858585" , "#d1d1d1" ] ,
2024-09-13 22:58:13 -04:00
density : 8200 ,
2024-07-30 06:10:32 -04:00
category : "machines" ,
state : "solid" ,
reactions : {
"matter" : { elem2 : [ "accelerated_matter_right" , ] } ,
}
} ;
elements . accelerated _matter _left = {
color : [ "#c0ecf0" , "#a8f8ff" , ] ,
behavior : [
2025-03-10 06:32:45 -04:00
"M2|EX:10|XX" ,
"M1 AND EX:10|XX|EX:10" ,
"M2|EX:10|XX" ,
2024-07-30 06:10:32 -04:00
] ,
hidden : true ,
state : "gas" ,
category : "energy" ,
density : 2.20 ,
reactions : {
2024-09-13 22:58:13 -04:00
"accelerated_matter_right" : { elem1 : [ "antimatter" , "pop" , null , ] , chance : 0.3 , } ,
"accelerated_matter_left" : { elem1 : [ "antimatter" , "pop" , null , ] , chance : 0.3 , } ,
2024-07-30 06:10:32 -04:00
"antimatter" : { elem1 : "pop" , chance : 0.01 , } ,
}
} ;
elements . accelerated _matter _right = {
color : [ "#c0ecf0" , "#a8f8ff" , ] ,
behavior : [
2025-03-10 06:32:45 -04:00
"XX|EX:10|M2" ,
"EX:10|XX|M1 AND EX:10" ,
"XX|EX:10|M2" ,
2024-07-30 06:10:32 -04:00
] ,
hidden : true ,
state : "gas" ,
category : "energy" ,
density : 2.20 ,
reactions : {
2024-09-13 22:58:13 -04:00
"accelerated_matter_left" : { elem1 : [ "antimatter" , "pop" , null , ] , chance : 0.3 , } ,
"accelerated_matter_right" : { elem1 : [ "antimatter" , "pop" , null , ] , chance : 0.3 , } ,
2024-07-30 06:10:32 -04:00
"antimatter" : { elem1 : "pop" , chance : 0.01 , } ,
}
} ;
2025-03-10 06:32:45 -04:00
elements . phosgene = {
color : [ "#dbdbdb" , "#f2f2f2" , "#c2c2c2" , ] ,
behavior : behaviors . GAS ,
state : "gas" ,
category : "gases" ,
density : 4.25 ,
tempLow : 7 ,
stateLow : "liquid_phosgene" ,
tempHigh : 300 ,
stateHigh : [ "carbon_monoxide" , "chlorine" , ] ,
reactions : {
"head" : { elem2 : "rotten_meat" , chance : 0.5 , } ,
"body" : { elem2 : "rotten_meat" , chance : 0.5 } ,
"human" : { elem2 : "rotten_meat" , chance : 0.5 } ,
"worm" : { elem2 : "rotten_meat" , chance : 0.5 } ,
"bee" : { elem2 : "dead_bug" , chance : 0.5 } ,
"ant" : { elem2 : "dead_bug" , chance : 0.5 } ,
"flea" : { elem2 : "dead_bug" , chance : 0.5 } ,
"spider" : { elem2 : "dead_bug" , chance : 0.5 } ,
"fly" : { elem2 : "dead_bug" , chance : 0.5 } ,
"stink_bug" : { elem2 : "dead_bug" , chance : 0.5 } ,
"bird" : { elem2 : "rotten_meat" , chance : 0.5 } ,
"frog" : { elem2 : "slime" , chance : 0.5 } ,
"rat" : { elem2 : [ "rotten_meat" , "plague" ] , chance : 0.5 } ,
"fish" : { elem2 : "rotten_meat" , chance : 0.5 } ,
"tadpole" : { elem2 : "rotten_meat" , chance : 0.5 } ,
"slug" : { elem2 : "slime" , chance : 0.5 } ,
"snail" : { elem2 : "slime" , chance : 0.5 } ,
"grass" : { elem2 : "dead_plant" , chance : 0.5 } ,
"plant" : { elem2 : "dead_plant" , chance : 0.5 } ,
"cactus" : { elem2 : "dead_plant" , chance : 0.5 } ,
"petal" : { elem2 : "dead_plant" , chance : 0.5 } ,
"water" : { elem2 : [ "acid" , "carbon_dioxide" , ] } ,
"salt_water" : { elem2 : [ "acid" , "carbon_dioxide" , ] } ,
}
}
elements . liquid _phosgene = {
color : [ "#dbdbdb" , "#f2f2f2" , "#c2c2c2" , ] ,
behavior : behaviors . LIQUID ,
state : "liquid" ,
category : "states" ,
density : 7.50 ,
tempLow : - 118 ,
2025-05-09 21:22:23 -04:00
hidden : true ,
2025-03-10 06:32:45 -04:00
temp : - 10 ,
stateLow : "solid_phosgene" ,
tempHigh : 8 ,
stateHigh : "phosgene" ,
}
elements . solid _phosgene = {
color : [ "#dbdbdb" , "#f2f2f2" , "#c2c2c2" , ] ,
behavior : behaviors . WALL ,
state : "solid" ,
category : "states" ,
2025-05-09 21:22:23 -04:00
hidden : true ,
2025-03-10 06:32:45 -04:00
density : 12.45 ,
temp : - 150 ,
tempHigh : - 117 ,
stateHigh : "liquid_phosgene" ,
}
elements . chlorophyll = {
color : [ "#208556" , "#2fa16b" ] ,
behavior : behaviors . POWDER ,
state : "powder" ,
category : "powders" ,
density : 1.1 ,
tempHigh : 250 ,
stateHigh : "carbon_dioxide" ,
burn : 10 ,
burnTime : 500 ,
burnInto : "carbon_dioxide" ,
tempLow : - 114 ,
stateLow : "dead_plant" ,
reactions : {
"light" : { elem1 : null , chance : 0.2 , elem2 : null , chance : 0.2 , } ,
"acid" : { elem1 : [ "magnesium" ] , }
}
}
2025-05-09 21:22:23 -04:00
elements . lithium = { //Unsur lithium, buat versi baru, masih WIP.
color : [ "#928c96" , "#9c9c9c" , ] ,
state : "powder" ,
category : "powders" ,
behavior : behaviors . POWDER ,
density : 0.5 ,
tempHigh : 180 ,
stateHigh : "molten_lithium" ,
conduct : 0.2 ,
burn : 85 ,
burnTime : 500 ,
reactions : {
"water" : { elem1 : [ "pop" , "explosion" , "hydrogen" , "lithium_hydroxide" ] } ,
"salt_water" : { elem1 : [ "pop" , "explosion" , "hydrogen" , "lithium_hydroxide" ] } ,
"pool_water" : { elem1 : [ "pop" , "explosion" , "hydrogen" , "lithium_hydroxide" ] } ,
"dirty_water" : { elem1 : [ "pop" , "explosion" , "hydrogen" , "lithium_hydroxide" ] } ,
"sugar_water" : { elem1 : [ "pop" , "explosion" , "hydrogen" , "lithium_hydroxide" ] } ,
"steam" : { elem1 : [ "pop" , "explosion" , "hydrogen" , "lithium_hydroxide" ] } ,
"oxygen" : { elem1 : "lithium_oxide" } ,
"chlorine" : { elem1 : "lithium_chloride" } ,
"acid" : { elem1 : [ "lithium_chloride" , "hydrogen" ] , chance : 0.2 } ,
"carbon_dioxide" : { elem1 : "lithium_carbonate" } ,
"carbon_monoxide" : { elem1 : "lithium_carbonate" } ,
"nitrogen" : { elem1 : "lithium_nitride" , chance : 0.1 }
}
}
elements . molten _lithium = {
color : [ "#c0c0c0" , "#d0d0d0" , "#b0b0b0" ] ,
behavior : behaviors . LIQUID ,
temp : 250 , // temperatur normal
density : 0.5 ,
conduct : 0.5 ,
state : "liquid" ,
category : "states" ,
hidden : true ,
tempLow : 180 ,
stateLow : "lithium" ,
burn : 50 ,
burnTime : 300 ,
burnInto : "lithium_oxide" ,
}
elements . lithium _hydroxide = {
color : "#c8e4d8" ,
behavior : behaviors . POWDER ,
category : "powders" ,
state : "solid" ,
density : 1500 ,
tempHigh : 462 , // titik leleh LiOH
stateHigh : "molten_lithium_hydroxide" ,
reactions : { } ,
} ;
// Molten Lithium Hydroxide
elements . molten _lithium _hydroxide = {
color : "#dff7f2" ,
behavior : behaviors . LIQUID ,
category : "states" ,
state : "liquid" ,
density : 1400 ,
hidden : true ,
temp : 463 ,
tempHigh : 924 , // perkiraan titik didih
stateHigh : "lithium_hydroxide_gas" , // opsional
reactions : { } ,
} ;
// Lithium Oxide (hasil reaksi lithium dengan oksigen)
elements . lithium _oxide = {
color : "#d0d0d0" ,
behavior : behaviors . POWDER ,
category : "powders" ,
state : "solid" ,
density : 2013 ,
tempHigh : 1438 ,
stateHigh : "molten_lithium_oxide" ,
reactions : { } ,
} ;
// Molten Lithium Oxide
elements . molten _lithium _oxide = {
color : "#e8e8e8" ,
behavior : behaviors . LIQUID ,
category : "states" ,
state : "liquid" ,
density : 1800 ,
hidden : true ,
temp : 1440 ,
reactions : { } ,
} ;
// Lithium Carbonate (hasil reaksi lithium dengan karbon dioksida)
elements . lithium _carbonate = {
color : "#f0f0f0" ,
behavior : behaviors . POWDER ,
category : "powders" ,
state : "solid" ,
density : 2110 ,
tempHigh : 723 ,
stateHigh : "molten_lithium_carbonate" ,
reactions : { } ,
} ;
// Molten Lithium Carbonate
elements . molten _lithium _carbonate = {
color : "#fafafa" ,
behavior : behaviors . LIQUID ,
category : "states" ,
state : "liquid" ,
density : 1900 ,
hidden : true ,
temp : 725 ,
reactions : { } ,
} ;
// Lithium Chloride (hasil reaksi lithium dengan klorin atau asam)
elements . lithium _chloride = {
color : "#e0e0f8" ,
behavior : behaviors . POWDER ,
category : "powders" ,
state : "solid" ,
density : 2068 ,
tempHigh : 614 ,
stateHigh : "molten_lithium_chloride" ,
reactions : { } ,
} ;
// Molten Lithium Chloride
elements . molten _lithium _chloride = {
color : "#f0f0ff" ,
behavior : behaviors . LIQUID ,
category : "states" ,
state : "liquid" ,
hidden : true ,
density : 1900 ,
temp : 615 ,
reactions : { } ,
} ;
// Lithium Nitride (hasil reaksi lithium dengan nitrogen)
elements . lithium _nitride = {
color : "#b8b8b8" ,
behavior : behaviors . POWDER ,
category : "powders" ,
state : "solid" ,
density : 1270 ,
tempHigh : 813 ,
stateHigh : "molten_lithium_nitride" ,
reactions : { } ,
} ;
// Molten Lithium Nitride
elements . molten _lithium _nitride = {
color : "#c8c8c8" ,
behavior : behaviors . LIQUID ,
category : "states" ,
state : "liquid" ,
hidden : true ,
density : 1100 ,
temp : 815 ,
reactions : { } ,
} ;
elements . phosphorus = {
color : [ "#ffffcc" , "#ffff99" , "#ffff66" ] ,
behavior : behaviors . POWDER ,
category : "powders" ,
state : "solid" ,
density : 1820 ,
burn : 100 ,
burnTime : 100 ,
burnInto : "fire" ,
reactions : {
"oxygen" : { elem1 : "fire" , chance : 0.5 } ,
"water" : { elem1 : "explosion" , } ,
} ,
tempHigh : 44 ,
stateHigh : "molten_phosphorus" ,
hidden : false ,
} ;
elements . molten _phosphorus = {
color : [ "#ffcc00" , "#ff9900" ] ,
behavior : behaviors . LIQUID ,
category : "states" ,
state : "liquid" ,
density : 1600 ,
hidden : true ,
burning : true ,
burnTime : 2000 ,
burnInto : "fire" ,
reactions : {
"oxygen" : { elem1 : "fire" , chance : 1 } ,
} ,
temp : 100 ,
tempLow : 43 ,
stateLow : "phosphorus" ,
viscosity : 20 ,
} ;
elements . phosphorus _bomb = {
color : "#ffdd66" ,
behavior : behaviors . POWDER ,
category : "weapons" ,
state : "solid" ,
density : 1200 ,
2025-05-10 20:57:45 -04:00
desc : "Don't let UN see this..." ,
2025-05-09 21:22:23 -04:00
tick : function ( pixel ) {
// Periksa apakah ada elemen lain di sekitarnya
for ( let dx = - 1 ; dx <= 1 ; dx ++ ) {
for ( let dy = - 1 ; dy <= 1 ; dy ++ ) {
if ( dx === 0 && dy === 0 ) continue ;
let x = pixel . x + dx ;
let y = pixel . y + dy ;
if ( ! isEmpty ( x , y ) ) {
// Meledak: ubah area sekitar jadi molten_phosphorus
for ( let ex = - 3 ; ex <= 3 ; ex ++ ) {
for ( let ey = - 3 ; ey <= 3 ; ey ++ ) {
let nx = pixel . x + ex ;
let ny = pixel . y + ey ;
if ( isEmpty ( nx , ny ) && Math . random ( ) < 0.6 ) {
createPixel ( "molten_phosphorus" , nx , ny ) ;
}
}
}
deletePixel ( pixel . x , pixel . y ) ; // Hancurkan bomb setelah meledak
return ;
}
}
}
}
} ;