Merge branch 'R74nCom:main' into main
This commit is contained in:
commit
3771e133ee
|
|
@ -196,7 +196,7 @@
|
|||
<tr><td>texturepack.js</td><td>Tools that let you create and share custom texture packs</td><td>nousernamefound</td></tr>
|
||||
<tr><td>the_ground.js</td><td>Several rock types, worldgen settings, and gemstones</td><td>Alice</td></tr>
|
||||
<tr><td>worldEdit.js</td><td>Selection and editing tools</td><td>RedBirdly</td></tr>
|
||||
<tr><td>worldgenlibrary.js</td><td>World generation library</td><td>Adora</td></tr>
|
||||
<tr><td>worldgenlibrary.js</td><td>World generation library</td><td>Orchid</td></tr>
|
||||
|
||||
<!----><tr><td class="modCat" colspan="3">Science & Chemistry</td></tr><!---->
|
||||
<tr><td>alcohol.js</td><td>Methanol, (iso-)propanol, and butanol</td><td>Alice</td></tr>
|
||||
|
|
@ -234,7 +234,7 @@
|
|||
<tr><td>metals.js</td><td>Several metals</td><td>Alice</td></tr>
|
||||
<tr><td>mixture.js</td><td>Many chemicals can be mixed</td><td>lllllllllwith10ls</td></tr>
|
||||
<tr><td>more_gold.js</td><td>Green Gold</td><td>pixelegend4</td></tr>
|
||||
<tr><td>morechemistry.js</td><td>New chemicals, compounds, and machines</td><td>Adora</td></tr>
|
||||
<tr><td>morechemistry.js</td><td>New chemicals, compounds, and machines</td><td>Orchid</td></tr>
|
||||
<tr><td>moreliquids.js</td><td>Various liquids</td><td>te-agma-at</td></tr>
|
||||
<tr><td>neutronium_compressor.js</td><td>Compressor from Minecraft's Avaritia mod that compresses 10,000 pixels of an element into a singularity</td><td>Alice</td></tr>
|
||||
<tr><td>noblegas.js</td><td>The missing noble gases</td><td>nousernamefound</td></tr>
|
||||
|
|
@ -253,6 +253,7 @@
|
|||
<tr><td>colored_lightbulbs.js</td><td>Light bulb that can be painted</td><td>guzzo86, ggod</td></tr>
|
||||
<tr><td>combustion.js</td><td>Components necessary for combustion engines</td><td>uptzik</td></tr>
|
||||
<tr><td>conveyance.js</td><td>Conveyors, operated with and without electricity</td><td>Melecie</td></tr>
|
||||
<tr><td>datawire.js</td><td>Adds a wire that transfers data and other operators and machines for it</td><td>Orchid</td></tr>
|
||||
<tr><td>drill.js</td><td>Drills made out of several materials</td><td>Suss</td></tr>
|
||||
<tr><td>ExtraMachines.js</td><td>Sensors, energy resources, materials, and more</td><td>Mecoolnotcool</td></tr>
|
||||
<tr><td>fans.js</td><td>Fans</td><td>Cube14yt</td></tr>
|
||||
|
|
@ -271,6 +272,7 @@
|
|||
<tr><td>pushers.js</td><td>Pixels that push elements away from them</td><td>Alice</td></tr>
|
||||
<tr><td>sandboxels.js</td><td>Digital screen to play a mini version of Sandboxels</td><td>Nekonico</td></tr>
|
||||
<tr><td>schematics.js</td><td>Schematics for logic gates</td><td>SquareScreamYT</td></tr>
|
||||
<tr><td>scp.js</td><td>Mod for the SCP Foundation, a secretive organization that contains anomalous objects away from the public, from a collaborative writing website.</td><td>Nekonico</td></tr>
|
||||
<tr><td>spouts.js</td><td>Spouts for all liquids</td><td>kaeud</td></tr>
|
||||
<tr><td>state_voids.js</td><td>Several elements that delete specific states of matter</td><td>Alice</td></tr>
|
||||
<tr><td>switches.js</td><td>Electrical switches that can be toggled</td><td>Alice</td></tr>
|
||||
|
|
@ -292,6 +294,7 @@
|
|||
<tr><td>more_breaking.js</td><td>More elements can be broken</td><td>Alice</td></tr>
|
||||
<tr><td>rays.js</td><td>More Ray types</td><td>Alice</td></tr>
|
||||
<tr><td>rays++.js</td><td>Couple more rays</td><td>uptzik</td></tr>
|
||||
<tr><td>scp.js</td><td>Creatures and items from the SCP Wiki</td><td>Nekonico</td></tr>
|
||||
<tr><td>subspace.js</td><td>The Subspace Tripmine from Roblox</td><td>nousernamefound</td></tr>
|
||||
<tr><td>war_crimes.js</td><td>Tear gas and more</td><td>voidapex11</td></tr>
|
||||
<tr><td>weapons.js</td><td>Variety of different weapons</td><td>Jayd</td></tr>
|
||||
|
|
@ -350,8 +353,9 @@
|
|||
<tr><td>ocean.js</td><td>Marine life</td><td>SquareScreamYT</td></tr>
|
||||
<tr><td>ores.js</td><td>Ore generation along with tools to mine them</td><td>nousernamefound</td></tr>
|
||||
<tr><td>petal_dye.js</td><td>Boil petals to make dye</td><td>Suss</td></tr>
|
||||
<tr><td>plants.js</td><td>Wide variety of new plants and fruits</td><td>Adora</td></tr>
|
||||
<tr><td>plants.js</td><td>Wide variety of new plants and fruits</td><td>Orchid</td></tr>
|
||||
<tr><td>primordial_birthpool.js</td><td>Cross between Primordial Soup and Birthpool. Requires fey_and_more.js</td><td>Alice</td></tr>
|
||||
<tr><td>scp.js</td><td>Creatures and items from the SCP Wiki</td><td>Nekonico</td></tr>
|
||||
<tr><td>spring.js</td><td>Many nature elements, like sakura trees, butterflies, beehives, and more</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
|
||||
<tr><td>the_ground_og.js</td><td>Simplified and more stable version of the_ground.js</td><td>Alice</td></tr>
|
||||
<tr><td>the_ground.js</td><td>Several rock types, worldgen settings, and gemstones</td><td>Alice</td></tr>
|
||||
|
|
@ -361,7 +365,7 @@
|
|||
<!----><tr><td class="modCat" colspan="3">Fun & Games</td></tr><!---->
|
||||
<tr><td>10kelements.js</td><td>Customizable amount of randomly generated elements</td><td>nousernamefound</td></tr>
|
||||
<tr><td>all_around_fillers.js</td><td>Directional Filler variants</td><td>idk73248</td></tr>
|
||||
<tr><td>allliquids.js</td><td>Made all elements liquids</td><td>Adora</td></tr>
|
||||
<tr><td>allliquids.js</td><td>Made all elements liquids</td><td>Orchid</td></tr>
|
||||
<tr><td>amogus.js</td><td>Small Among Us structure</td><td>Alice</td></tr>
|
||||
<tr><td>bfdi.js</td><td>Several references to Battle for Dream Island</td><td>Taterbob</td></tr>
|
||||
<tr><td>citybuilding.js</td><td>Seeds that create miniature buildings and other city-related items</td><td>SquareScreamYT</td></tr>
|
||||
|
|
@ -391,6 +395,7 @@
|
|||
<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>
|
||||
<tr><td>sbmixup.js</td><td>Silly elements from a <a href="https://R74n.com/mix/" target="_blank">Mix-Up!</a> game</td><td>stefanblox</td>
|
||||
<tr><td>scp.js</td><td>Creatures and items from the SCP Wiki</td><td>Nekonico</td></tr>
|
||||
<tr><td>sports_beta.js</td><td>Several sports items</td><td>BluBun5193</td></tr>
|
||||
<tr><td>star_wars.js</td><td>Various items from Star Wars by Disney</td><td>SeaPickle754</td>
|
||||
<tr><td>sus.js</td><td>Among Us crewmate</td><td>Nv7</td></tr>
|
||||
|
|
@ -440,7 +445,7 @@
|
|||
<tr><td>changeTempReactionParameter.js</td><td>The changeTemp property to modded reactions</td><td>Alice</td></tr>
|
||||
<tr><td>code_library.js</td><td>Functions and variables common to some other mods</td><td>Alice</td></tr>
|
||||
<tr><td>controllable_pixel_test.js</td><td>Pixel that can be controlled with the keyboard keys <a href="https://github.com/R74nCom/sandboxels/commit/58dfa9477f2ed7ec9c44b00a35162e7c63bc129c">[More Info]</a> [PC ONLY]</td><td>Alice</td></tr>
|
||||
<tr><td>customexplosion.js</td><td>Added a custom explosion element and interface for it. check out its <a href="https://sandboxels-mods.the-enchanteden.repl.co/Mods/customexplosion.js">source code</a> for how modders can use it</td><td>Alex</td></tr>
|
||||
<tr><td>customexplosion.js</td><td>Added a custom explosion element and interface for it.</td><td>Orchid</td></tr>
|
||||
<tr><td>date_test.js</td><td>K-pop idol birthday testing stuff</td><td>Alice</td></tr>
|
||||
<tr><td>drawPixels_change_test.js</td><td>Test of altering drawPixels(). Gives burning pixels a red overlay similar to the yellow overlay for charged pixels</td><td>Alice</td></tr>
|
||||
<tr><td>example_mod.js</td><td>Example mod for new modders</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
|
||||
|
|
@ -455,7 +460,9 @@
|
|||
<tr><td>modlangs.js</td><td>Customisable property in an element to allow for translations in mods. See the file for instructions on how to implement</td><td>SquareScreamYT</td></tr>
|
||||
<tr><td>nested_for_reaction_example.js</td><td>Example of using a nested for loop to add reactions. It makes various things kill plants</td><td>Alice</td></tr>
|
||||
<tr><td>nv7.js</td><td>Giant Nv7 image [Large]</td><td>Nv7</td></tr>
|
||||
<tr><td>orchidslibrary.js</td><td>Library used by morechemistry.js, plants.js, and datawire.js</td><td>Orchid</td></tr>
|
||||
<tr><td>place_all_elements.js</td><td>Experimental function that places every pixel</td><td>Alice</td></tr>
|
||||
<tr><td>PRNGworldgenlib.js</td><td>World generation library with seeded randomness</td><td>Orchid</td></tr>
|
||||
<tr><td>randomness_but_tick.js</td><td>Random experimental elements using the tick function feature</td><td>Alice</td></tr>
|
||||
<tr><td>randomness_but_tool.js</td><td>Random experimental elements using the tool function feature</td><td>Alice</td></tr>
|
||||
<tr><td>randomness.js</td><td>Random experimental elements</td><td>Alice</td></tr>
|
||||
|
|
@ -464,7 +471,7 @@
|
|||
<tr><td>structure_test.js</td><td>Test for implementing structures into Sandboxels</td><td>Alice</td></tr>
|
||||
<tr><td>test.js</td><td>Test that adds mayo :)</td><td><a href="https://R74n.com" class="R74nLink">R74n</a></td></tr>
|
||||
<tr><td>tool_pixel_behavior.js</td><td>Gives unique behaviors to tools if placed with cheats</td><td>Alice</td></tr>
|
||||
<tr><td>worldgenlibrary.js</td><td>World generation library</td><td>Adora</td></tr>
|
||||
<tr><td>worldgenlibrary.js</td><td>World generation library</td><td>Orchid</td></tr>
|
||||
<tr><td>worldgen_test.js</td><td>Element that generates a save with a grass layer, dirt layer, rock layer, and a pond</td><td>Alice</td></tr>
|
||||
|
||||
<!----><tr><td class="modCat" colspan="3">Broken or Deprecated</td></tr><!---->
|
||||
|
|
|
|||
|
|
@ -0,0 +1,161 @@
|
|||
/*Version 1.0.0 Pseudorandom world generator*/
|
||||
function pseudorandom(key, max = 10){
|
||||
let num = max;
|
||||
for(let i = 0; i < key; i++){
|
||||
num = ((num+(max*0.6))**1.8312312-2) % (max+1);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
eLists.STONEELEMS = ["rock", "gravel", "tuff", "basalt", "rock_wall"];
|
||||
let oreChances = {
|
||||
diamond: 0.045,
|
||||
gold: 0.1,
|
||||
silver: 0.2,
|
||||
tungsten: 0.3,
|
||||
iron: 0.4,
|
||||
copper: 0.6,
|
||||
charcoal: 0.8,
|
||||
uranium: 0.805,
|
||||
aluminum: 1
|
||||
}
|
||||
class biome {
|
||||
constructor(layersArr, yLevels, properties, afterFunc = false){
|
||||
this.layers = layersArr;
|
||||
this.yLevels = yLevels;
|
||||
this.vMulti = 1;
|
||||
for(let item in properties){
|
||||
this[item] = properties[item];
|
||||
}
|
||||
this.generate = function(seed){
|
||||
autoResizeCanvas();
|
||||
if(!paused){togglePause();}
|
||||
let fraction = seed/(2**32);
|
||||
for(let level of this.yLevels){
|
||||
for(let x = 0; x <= width; x++){
|
||||
let heightIncrease = (fraction < 0.5) ? -3*(pseudorandom(((1-fraction)*x)*100)/11) : 3*(pseudorandom((fraction*x)*100)/11);
|
||||
let h = level + heightIncrease;
|
||||
for(let y = 0; y <= h; y++){
|
||||
let elementsArr = this.layers[this.yLevels.indexOf(level)];
|
||||
let elem = elementsArr[Math.floor(((fraction < 0.5) ? elementsArr.length*pseudorandom(((1-fraction)*((x*y)*13))/11) : elementsArr.length*(pseudorandom((fraction*(x*y*17)))/11))%elementsArr.length)];
|
||||
let placed = tryCreate(elem, x, height-y);
|
||||
if(placed != null && this.temp != null){
|
||||
placed.temp = this.temp;
|
||||
}
|
||||
if(elem == "sapling" && placed){
|
||||
if(this.wc != null){
|
||||
if(Array.isArray(this.wc)){
|
||||
let c = this.wc[Math.round(Math.random()*this.wc.length)];
|
||||
while(c == undefined){
|
||||
c = this.wc[Math.round(Math.random()*this.wc.length)];
|
||||
}
|
||||
placed.wc = c;
|
||||
} else {
|
||||
placed.wc = this.wc;
|
||||
}
|
||||
}
|
||||
if(this.lc != null){
|
||||
if(Array.isArray(this.lc)){
|
||||
let c = this.lc[Math.round(Math.random()*this.lc.length)];
|
||||
while(c == undefined){
|
||||
c = this.lc[Math.round(Math.random()*this.lc.length)];
|
||||
}
|
||||
placed.lc = c;
|
||||
} else {
|
||||
placed.lc = this.lc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.generateOreVeins(seed, this.vMulti);
|
||||
};
|
||||
}
|
||||
|
||||
generateOreVeins(seed, multi = 1){
|
||||
for(let x = 0; x <= width; x++){
|
||||
for(let y = 0; y <= height; y++){
|
||||
let c = pseudorandom((seed/2**32)*x*y)/11;
|
||||
if(c <= 0.3){
|
||||
let c2 = pseudorandom((seed/2**32)*(x*y)*3)/11;
|
||||
let ore;
|
||||
for(let e in oreChances){
|
||||
if(c2 <= oreChances[e]){
|
||||
ore = e;
|
||||
break;
|
||||
}
|
||||
}
|
||||
let p = getPixel(x,y);
|
||||
if(p != null && eLists.STONEELEMS.includes(p.element)){
|
||||
tryCreate(ore, x, y, true);
|
||||
let a = true;
|
||||
let x2 = x, y2 = y;
|
||||
while(a){
|
||||
let hasStone = false;
|
||||
for(let coords of squareCoords){
|
||||
x2 += coords[0];
|
||||
y2 += coords[1];
|
||||
let p2 = getPixel(x2,y2);
|
||||
if(p2 != null && eLists.STONEELEMS.includes(p2.element) && (pseudorandom((seed/2**32)*x2*y2)/11) < (0.35*multi)){
|
||||
hasStone = true;
|
||||
tryCreate(ore, x2, y2, true);
|
||||
}
|
||||
if((pseudorandom((seed/2**32)*(x2*y2)*8)/11) < 0.15){
|
||||
a = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
a = (hasStone) ? a : false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this.afterFunc != null){
|
||||
this.afterFunc(seed);
|
||||
}
|
||||
}
|
||||
}
|
||||
let biomes = {
|
||||
plains: new biome([["rock", "rock", "rock", "gravel"], ["dirt", "dirt", "dirt", "dirt", "mud", "gravel"], ["grass","flower_seed","grass","grass","grass","grass","sapling","grass","grass","grass","grass","grass","grass","grass","grass"]], [25, 38, 40]),
|
||||
desert: new biome([["rock", "rock", "rock", "gravel"], ["rock", "packed_sand","rock", "packed_sand", "sand"], ["sand"], [null, null, null, null, null, null, null, null, null, "cactus"]], [17, 26, 40, 42]),
|
||||
savanna: new biome([["rock", "rock", "rock", "gravel"], ["dirt", "dirt", "clay_soil", "dirt", "dirt"], ["grass",null,null, null, null, null, "sapling",null,null,null,null]], [25, 38, 40], {lc: ["#6fde26", "#8eed34", "#8cdb42", "#7bd12a", "#96e81c", "#a9e64e", "#a0d94c", "#a9d63e"], wc: ["#bdab7e", "#b09c6a", "#ab996d", "#998a63", "#917959", "#877051"]}),
|
||||
tundra: new biome([["rock", "rock", "rock", "gravel"], ["dirt", "dirt", "rock", "permafrost"], ["permafrost", "permafrost", "permafrost", "permafrost", "permafrost", "permafrost", "ice", "snow"], [null,null,null,null,null,"pinecone",null,null,null,null,null,null]], [25, 30, 38, 40], {temp: -15}),
|
||||
}
|
||||
let seed = Math.random()*(2**32);
|
||||
enabledMods.forEach((item)=>{
|
||||
if(item.includes("plants.js")){
|
||||
biomes.orchard = new biome([["rock","rock","rock","gravel"], ["dirt", "dirt", "dirt", "rock", "gravel"], ["dirt", "dirt", "dirt", "dirt", "mud", "clay_soil", "gravel"]], [25, 30, 38], {afterFunc: (seed)=>{
|
||||
for(let i = 0; i < width; i++){
|
||||
console.log(i, width);
|
||||
let elem = ((pseudorandom((seed/2**32)*i)/11) < 0.15) ? plants.tree[(Math.round(Math.random()*plants.tree.length)) % plants.tree.length] : "grass";
|
||||
if(elem != undefined && elem != "grass"){elem += "_seed"};
|
||||
elem = (elem == undefined) ? "apple_seed" : elem;
|
||||
tryCreate(elem, i, 42);
|
||||
}
|
||||
}});
|
||||
}
|
||||
});
|
||||
elements.PRNGgenerate = {
|
||||
category: "tools",
|
||||
onSelect: function(){
|
||||
let arr = [];
|
||||
Object.keys(biomes).forEach(function(b){arr.push(b);})
|
||||
promptInput("Leave blank to generate new seed. Your current seed is: " + seed, function(i){
|
||||
seed = parseInt(i) || Math.random()*(2**32);
|
||||
seed = seed % (2**32);
|
||||
promptChoose("", arr, (choice)=>{
|
||||
biomes[choice].generate(seed);
|
||||
promptText("World generation complete.");
|
||||
selectElement('dirt');
|
||||
}, "Select a biome to generate: ");
|
||||
}, "Enter seed:");
|
||||
}
|
||||
}
|
||||
elements.view_seed = {
|
||||
category: "tools",
|
||||
onSelect: function(){
|
||||
alert(seed);
|
||||
selectElement("dirt");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,283 @@
|
|||
async function _modprompt(message, defaultValue = "") { // thanks to ggod for this prompt function. Taken from nousersthings.js
|
||||
return new Promise(resolve => {
|
||||
promptInput(message, (result) => {
|
||||
resolve(result);
|
||||
}, "bf.js is asking you...", defaultValue);
|
||||
})
|
||||
}
|
||||
|
||||
class Interpreter {
|
||||
constructor() {
|
||||
this.map = new Array(64).fill(0)
|
||||
this.index = 0
|
||||
this.ci = 0
|
||||
this.loops = []
|
||||
this.code = ""
|
||||
this.tsay = ""
|
||||
}
|
||||
|
||||
async run(px) {
|
||||
while (this.ci < this.code.length) {
|
||||
const token = this.code[this.ci]
|
||||
|
||||
switch (token) {
|
||||
case ">":
|
||||
if (this.index + 1 == this.map.length) {
|
||||
this.map.push(0)
|
||||
}
|
||||
this.index++
|
||||
break
|
||||
|
||||
case "<":
|
||||
if (this.index - 1 != -1) {
|
||||
this.index--
|
||||
}
|
||||
break
|
||||
|
||||
case "+":
|
||||
this.map[this.index]++
|
||||
break
|
||||
|
||||
case "-":
|
||||
this.map[this.index]--
|
||||
break
|
||||
|
||||
case ".":
|
||||
this.tsay += String.fromCharCode(this.map[this.index])
|
||||
break
|
||||
|
||||
case "!":
|
||||
promptText(this.tsay, () => { }, "bf.js")
|
||||
break
|
||||
|
||||
case "/":
|
||||
this.tsay = ""
|
||||
break
|
||||
|
||||
case ",":
|
||||
const ans = await _modprompt("")
|
||||
if (ans.trim().length > 0) {
|
||||
this.map[this.index] = ans[0].charCodeAt(0)
|
||||
}
|
||||
break
|
||||
|
||||
case "[":
|
||||
if (this.map[this.index] === 0) {
|
||||
let open = 1
|
||||
while (open > 0) {
|
||||
this.ci++
|
||||
if (this.code[this.ci] === "[") open++
|
||||
else if (this.code[this.ci] === "]") open--
|
||||
}
|
||||
} else {
|
||||
this.loops.push(this.ci)
|
||||
}
|
||||
break
|
||||
|
||||
case "]":
|
||||
if (this.map[this.index] !== 0) {
|
||||
this.ci = this.loops[this.loops.length - 1]
|
||||
} else {
|
||||
this.loops.pop()
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
this.ci++
|
||||
}
|
||||
|
||||
px.running = false
|
||||
}
|
||||
}
|
||||
|
||||
const bftokens = {
|
||||
bf_base: "#00ff00",
|
||||
bf_remote_base: "#008600",
|
||||
">": "#ff7f00",
|
||||
"<": "#ff00ff",
|
||||
"+": "#00ffff",
|
||||
"-": "#800080",
|
||||
"[": "#ff1493",
|
||||
"]": "#1e90ff",
|
||||
".": "#ffd700",
|
||||
",": "#ff4500",
|
||||
"!": "#ff69b4",
|
||||
"split": "#565656",
|
||||
"act": "#ffc400",
|
||||
}
|
||||
const bftokenslist = Object.keys(bftokens)
|
||||
|
||||
elements.bf_base = {
|
||||
category: "bf",
|
||||
color: "#00ff00",
|
||||
state: "solid",
|
||||
behavior: behaviors.WALL,
|
||||
conduct: 1,
|
||||
tick: (px) => {
|
||||
if (pixelTicks == px.start) {
|
||||
px.act = false
|
||||
px.interpreter = new Interpreter()
|
||||
px.base = [px.x, px.y]
|
||||
px.running = false
|
||||
}
|
||||
|
||||
if (!(px.interpreter instanceof Interpreter)) {
|
||||
px.interpreter = new Interpreter()
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
let remotebase1 = undefined
|
||||
let bfreader = undefined
|
||||
let bfreader2 = undefined
|
||||
|
||||
elements.bf_remote_base = {
|
||||
category: "bf",
|
||||
color: "#008600",
|
||||
state: "solid",
|
||||
behavior: behaviors.WALL,
|
||||
onSelect: async function () {
|
||||
var bfans1 = await _modprompt("Please input in the coordinates of the desired pixel. When it activates, this activates. (X,Y)", "0,0");
|
||||
if (!bfans1) { return }
|
||||
let [x, y] = bfans1.split(",")
|
||||
remotebase1 = [Number(x), Number(y)]
|
||||
},
|
||||
tick: (px) => {
|
||||
if (pixelTicks == px.start) {
|
||||
px.act = false
|
||||
px.base = pixelMap[remotebase1[0]][remotebase1[1]].base
|
||||
if (!pixelMap[remotebase1[0]][remotebase1[1]].remotes) {
|
||||
pixelMap[remotebase1[0]][remotebase1[1]].remotes = []
|
||||
}
|
||||
pixelMap[remotebase1[0]][remotebase1[1]].remotes.push([px.x, px.y])
|
||||
px.cd = false
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
elements.reader = {
|
||||
category: "bf",
|
||||
color: "#008600",
|
||||
state: "solid",
|
||||
behavior: behaviors.WALL,
|
||||
conduct: 1,
|
||||
onSelect: async function () {
|
||||
var bfans2 = await _modprompt("Please input in the desired value to activate when read.", "0");
|
||||
if (!bfans2) { return }
|
||||
bfreader = Number(bfans2)
|
||||
},
|
||||
tick: (px) => {
|
||||
if (pixelTicks == px.start) {
|
||||
px.tread = bfreader
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
elements.pointer_reader = {
|
||||
category: "bf",
|
||||
color: "#008600",
|
||||
state: "solid",
|
||||
behavior: behaviors.WALL,
|
||||
conduct: 1,
|
||||
onSelect: async function () {
|
||||
var bfans3 = await _modprompt("Please input in the desired pointer and value to activate when read. (pointer,value)", "0,0");
|
||||
if (!bfans3) { return }
|
||||
let [x, y] = bfans3.split(",")
|
||||
bfreader2 = [Number(x), Number(y)]
|
||||
},
|
||||
tick: (px) => {
|
||||
if (pixelTicks == px.start) {
|
||||
px.tread = bfreader2
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
elements.bf_runner = {
|
||||
category: "bf",
|
||||
color: "#ababab",
|
||||
tool: (px) => {
|
||||
if (px.element == "bf_base" && !px.running) {
|
||||
px.running = true
|
||||
px.act = true
|
||||
px.interpreter.map.fill(0)
|
||||
px.interpreter.code = ""
|
||||
px.interpreter.index = 0
|
||||
px.interpreter.ci = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let token of bftokenslist) {
|
||||
if (token == "bf_base" || token == "bf_remote_base") { continue }
|
||||
elements[token] = {
|
||||
category: "bf",
|
||||
color: bftokens[token],
|
||||
state: "solid",
|
||||
behavior: behaviors.WALL,
|
||||
tick: (px) => {
|
||||
if (!px.base) {
|
||||
px.way = "l"
|
||||
px.act = false
|
||||
const ns = getNeighbors(px)
|
||||
if (ns.length > 0) {
|
||||
if (!isEmpty(px.x - 1, px.y)) {
|
||||
const left = ns[0]
|
||||
if (bftokenslist.includes(left.element) && left.base) {
|
||||
px.base = left.base
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (px.act) {
|
||||
px.color = "#00ff00"
|
||||
} else {
|
||||
px.color = bftokens[token]
|
||||
}
|
||||
const ns = getNeighbors(px)
|
||||
if (ns.length > 0) {
|
||||
const left = ns[0]
|
||||
if (bftokenslist.includes(left.element) && left.base) {
|
||||
if (left.act && !px.act) {
|
||||
left.act = false
|
||||
px.act = true
|
||||
pixelMap[px.base[0]][px.base[1]].interpreter.code += token
|
||||
if (isEmpty(px.x + 1, px.y)) {
|
||||
if (px.remotes) {
|
||||
px.remotes.forEach(remote => {
|
||||
pixelMap[remote[0]][remote[1]].act = true
|
||||
})
|
||||
} else {
|
||||
pixelMap[px.base[0]][px.base[1]].interpreter.run(pixelMap[px.base[0]][px.base[1]])
|
||||
}
|
||||
px.act = false
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ns.length >= 2) {
|
||||
ns.forEach(n => {
|
||||
if (n.element == "reader" && pixelMap[px.base[0]][px.base[1]].interpreter.map[pixelMap[px.base[0]][px.base[1]].interpreter.index] == n.tread) {
|
||||
n.charge = 1
|
||||
} else if (n.element == "pointer_reader" && pixelMap[px.base[0]][px.base[1]].interpreter.map[n.tread[0]] == n.tread[1]) {
|
||||
n.charge = 1
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
elements.act.conduct = 0.1
|
||||
const oldact = elements.act.tick
|
||||
elements.act.tick = (px) => {
|
||||
oldact(px)
|
||||
|
||||
if (px.charge && !px.act) {
|
||||
px.act = true
|
||||
px.charge = 0
|
||||
} else {
|
||||
px.charge = 0
|
||||
}
|
||||
}
|
||||
965
mods/biology.js
965
mods/biology.js
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,377 @@
|
|||
runAfterLoad(function() {
|
||||
console.log("Thanks for using bojithekings_mod.js! This is 1.0v")
|
||||
})
|
||||
|
||||
elements.ultronium = {
|
||||
color: ["#3a293a", "#77337c"],
|
||||
behavior: [
|
||||
"XX|CR:radiation%20 AND CR:neutron%10|XX",
|
||||
"CR:radiation%20 AND CR:neutron%10|XX|CR:radiation%20 AND CR:neutron%10",
|
||||
"XX|CR:radiation%20 AND CR:neutron%10|XX"
|
||||
],
|
||||
state: "solid",
|
||||
reactions: {
|
||||
"neutron": {elem1: "n_explosion", elem2: null, chance: 0.01, tempMin: 600 }
|
||||
},
|
||||
temp: 500,
|
||||
tempHigh: 10000,
|
||||
stateHigh: "ultronium_gas",
|
||||
renderer: renderPresets.HEATGLOW,
|
||||
tick: function(pixel) {
|
||||
if (Math.random()<0.01 && pixel.temp < 500) {
|
||||
changePixel(pixel, "stable_ultronium")
|
||||
}
|
||||
},
|
||||
category: "solids",
|
||||
density: 25000, //in kg/m³
|
||||
hardness: 0.80
|
||||
|
||||
}
|
||||
|
||||
elements.ultronium_gas = {
|
||||
color: ["#b45bb4", "#722478"],
|
||||
behavior: [
|
||||
"M2|CR:radiation%20 AND CR:neutron%10 AND M1|M2",
|
||||
"CR:radiation%20 AND CR:neutron%10 AND M1|XX|CR:radiation%20 AND CR:neutron%10 AND M1",
|
||||
"M2|CR:radiation%20 AND CR:neutron%10 AND M1|M2"
|
||||
],
|
||||
state: "gas",
|
||||
reactions: {
|
||||
"neutron": {elem1: "n_explosion", elem2: null, chance: 0.05}
|
||||
},
|
||||
temp: 12500,
|
||||
tempLow: 9000,
|
||||
stateLow: "ultronium",
|
||||
category: "gases",
|
||||
density: 12000
|
||||
|
||||
}
|
||||
|
||||
elements.stable_ultronium = {
|
||||
color: ["#362236", "#492a4c"],
|
||||
behavior: [
|
||||
"XX|CR:radiation%10|XX",
|
||||
"CR:radiation%10|XX|CR:radiation%10",
|
||||
"XX|CR:radiation%10|XX"
|
||||
],
|
||||
state: "solid",
|
||||
tempHigh: 1200,
|
||||
stateHigh: "ultronium",
|
||||
reactions: {
|
||||
"neutron": {elem1: "depleted_ultronium", elem2: null, chance: 0.05, tempMin: 400}
|
||||
},
|
||||
category: "solids",
|
||||
density: 22550, //in kg/m³,
|
||||
hardness: 0.80
|
||||
|
||||
}
|
||||
|
||||
elements.depleted_ultronium = {
|
||||
color: ["#464646", "#b1a4b5"],
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX"
|
||||
],
|
||||
state: "solid",
|
||||
tempHigh: 4000,
|
||||
renderer: renderPresets.HEATGLOW,
|
||||
stateHigh: "depleted_gas_ultronium",
|
||||
category: "solids",
|
||||
density: 22300, //in kg/m³
|
||||
hardness: 0.80
|
||||
}
|
||||
|
||||
elements.depleted_gas_ultronium = {
|
||||
color: ["#3a293a", "#837c84"],
|
||||
behavior: behaviors.GAS,
|
||||
state: "gas",
|
||||
tempLow: 3990,
|
||||
stateLow: "depleted_ultronium",
|
||||
temp: 4250,
|
||||
category: "gases",
|
||||
density: 13000
|
||||
}
|
||||
|
||||
elements.supernova.hidden = false
|
||||
elements.supernova.category = "energy"
|
||||
elements.n_explosion.hidden = false
|
||||
elements.n_explosion.category = "energy"
|
||||
|
||||
elements.steam.reactions["oxygen"] = {elem1: "humid_air", elem2: null}
|
||||
|
||||
elements.humid_air = {
|
||||
color: "#9cb8c9",
|
||||
behavior: behaviors.GAS,
|
||||
state: "gas",
|
||||
temp: 40,
|
||||
tempLow: 20,
|
||||
stateLow: ["water", "oxygen"],
|
||||
category: "gases",
|
||||
density: 1.4
|
||||
}
|
||||
|
||||
|
||||
elements.heat_to_infinity = {
|
||||
color: "#000000",
|
||||
tool: function(pixel) {
|
||||
pixel.temp += 1e309
|
||||
},
|
||||
category: "tools"
|
||||
}
|
||||
|
||||
elements.super_heat = {
|
||||
color: "#9c1717",
|
||||
tool: function(pixel) {
|
||||
pixel.temp += 100000
|
||||
},
|
||||
category: "tools"
|
||||
}
|
||||
elements.super_cool = {
|
||||
color: "#9c1717",
|
||||
tool: function(pixel) {
|
||||
pixel.temp -= 100000
|
||||
},
|
||||
category: "tools"
|
||||
}
|
||||
|
||||
elements.diamond.tempHigh = 3550
|
||||
elements.diamond.stateHigh = "carbon_dioxide"
|
||||
|
||||
elements.sulfur_gas.reactions["oxygen"] = {elem1: "sulfur_dioxide", elem2: null}
|
||||
|
||||
elements.sulfur_dioxide = {
|
||||
color: ["#cfd5d8","#d5dbde","#c9d0d3"],
|
||||
behavior: behaviors.GAS,
|
||||
category: "gases",
|
||||
state: "gas",
|
||||
density: 2.6,
|
||||
stateLow: "liquid_sulfur_dioxide",
|
||||
tempLow: -10,
|
||||
}
|
||||
|
||||
elements.liquid_sulfur_dioxide = {
|
||||
color: ["#bfc7cb","#b9c2c7"],
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1.4,
|
||||
stateHigh: "sulfur_dioxide",
|
||||
tempHigh: -10
|
||||
}
|
||||
|
||||
elements.magma.tempHigh = 2500
|
||||
elements.magma.stateHigh = ["sulfur_dioxide", "carbon_dioxide"]
|
||||
|
||||
elements.molten_glass.tempHigh = 2500
|
||||
elements.molten_glass.stateHigh = ["silicon_gas", "oxygen"]
|
||||
|
||||
elements.molten_dirt.tempHigh = 2500
|
||||
elements.molten_dirt.stateHigh = ["silicon_gas", "carbon_dioxide"]
|
||||
|
||||
elements.molten_salt.tempHigh = 2500
|
||||
elements.molten_salt.stateHigh = ["sodium_gas", "chlorine"]
|
||||
|
||||
elements.silicon_gas = {
|
||||
color: "#c0c0c0",
|
||||
behavior: behaviors.GAS,
|
||||
state: "gas",
|
||||
category: "gases",
|
||||
density: 0.5,
|
||||
temp: 1500
|
||||
}
|
||||
|
||||
elements.firebal = {
|
||||
color: "#fff200",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|EX:30>plasma|XX",
|
||||
"XX|XX|XX"
|
||||
],
|
||||
state: "gas",
|
||||
temp: 100000
|
||||
}
|
||||
|
||||
elements.chromium = {
|
||||
color: ["#beebf0", "#87c0cc"],
|
||||
behavior: behaviors.SOLID,
|
||||
category: "solids",
|
||||
state: "solid",
|
||||
density: 7140,
|
||||
conduct: 0.6,
|
||||
hardness: 0.85,
|
||||
tempHigh: 1907,
|
||||
stateHigh: "molten_chromium"
|
||||
}
|
||||
|
||||
elements.molten_chromium = {
|
||||
color: ["#ffd500", "#ffae00", "#ff0000"],
|
||||
behavior: behaviors.MOLTEN,
|
||||
hidden: true,
|
||||
state: "liquid",
|
||||
density: 6500,
|
||||
tempLow: 1907,
|
||||
stateLow: "chromium",
|
||||
viscosity: 100,
|
||||
reactions: {
|
||||
"molten_steel": {elem1: "molten_stainless_steel", elem2: null}
|
||||
}
|
||||
}
|
||||
|
||||
elements.stainless_steel = {
|
||||
color: "#c0c0c0",
|
||||
colorKey: {
|
||||
"L":"#bababa",
|
||||
"B":"#6c6c6c"
|
||||
},
|
||||
colorPattern: [
|
||||
"BBLB",
|
||||
"BBBL",
|
||||
"BLBB",
|
||||
"LBBB"
|
||||
],
|
||||
behavior: behaviors.SOLID,
|
||||
category: "solids",
|
||||
state: "solid",
|
||||
density: 8000,
|
||||
conduct: 0.42,
|
||||
hardness: 0.85,
|
||||
tempHigh: 1450,
|
||||
stateHigh: "molten_stainless_steel",
|
||||
breakInto: "stainless_steel_dust",
|
||||
}
|
||||
|
||||
elements.molten_stainless_steel = {
|
||||
color: ["#fff942", "#f49e1d", "#ff4400"],
|
||||
behavior: behaviors.MOLTEN,
|
||||
hidden: true,
|
||||
state: "liquid",
|
||||
density: 8000,
|
||||
tempLow: 1450,
|
||||
stateLow: "stainless_steel",
|
||||
viscosity: 120,
|
||||
conduct: 1,
|
||||
}
|
||||
|
||||
elements.infinite_burn = {
|
||||
color: "#a16868",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
burn: 100,
|
||||
burnTime: 1e9, //more then one irl year
|
||||
fireColor: "#eaff00"
|
||||
}
|
||||
|
||||
|
||||
elements.h_bomb.behavior = [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:90>plasma,plasma,plasma,plasma,fire,neutron,helium|M2",
|
||||
]
|
||||
|
||||
elements.hydrogen.reactions["hydrogen"] = {
|
||||
elem1: "h_explosion" , elem2: null, tempMin: 70000
|
||||
}
|
||||
|
||||
elements.h_explosion = {
|
||||
color: "#aeff00",
|
||||
state: "gas",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|EX:90>plasma,plasma,plasma,plasma,fire,neutron,helium|XX",
|
||||
"XX|XX|XX"
|
||||
],
|
||||
alias: "thermonuclear explosion",
|
||||
category: "fusion_explsosion"
|
||||
}
|
||||
|
||||
elements.short_super_heater = {
|
||||
color: "#c14a4a",
|
||||
behavior: [
|
||||
"XX|HT:5000|XX",
|
||||
"HT:5000|DL%10|HT:5000",
|
||||
"XX|HT:5000|XX"
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
elements.cluster_bomb = {
|
||||
color: "#9b9b9b",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:10>bomb|M2",
|
||||
],
|
||||
category: "weapons"
|
||||
}
|
||||
|
||||
elements.cluster_bomb_squared = {
|
||||
color: "#6f6f6f",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:25>cluster_bomb|M2",
|
||||
],
|
||||
category: "weapons"
|
||||
}
|
||||
|
||||
elements.cluster_bomb_cubed = {
|
||||
color: "#737373",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:50>cluster_bomb_squared|M2",
|
||||
],
|
||||
category: "weapons"
|
||||
}
|
||||
|
||||
elements.cluster_bomb_fourth = {
|
||||
color: "#525252",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:100>cluster_bomb_cubed|M2",
|
||||
],
|
||||
category: "weapons"
|
||||
}
|
||||
|
||||
elements.cluster_bomb_final = {
|
||||
color: "#525252",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1 AND EX:250>cluster_bomb_fourth|M2",
|
||||
],
|
||||
category: "weapons"
|
||||
}
|
||||
|
||||
elements.compress_to_a_star = {
|
||||
color: "#e5ff00",
|
||||
tool: function(pixel) {
|
||||
if (pixel.element=="hydrogen" && pixel.temp >= 10000) {
|
||||
changePixel(pixel, "sun")
|
||||
}
|
||||
},
|
||||
category: "tools"
|
||||
}
|
||||
|
||||
elements.brown_dwarf = {
|
||||
color: "#502606",
|
||||
state: "gas",
|
||||
behavior: behaviors.WALL,
|
||||
temp: 2226,
|
||||
tempHigh: 2726,
|
||||
stateHigh: "sun",
|
||||
tempLow: -23,
|
||||
stateLow: "hydrogen",
|
||||
category: "special"
|
||||
}
|
||||
|
||||
elements.sun.tempLow = 2225
|
||||
elements.sun.stateLow = "brown_dwarf"
|
||||
|
||||
//to make it more realistic and hoping it doesn't ruin gameplay
|
||||
elements.plasma.behavior = behaviors.GAS
|
||||
elements.plasma.temp = 12500
|
||||
|
||||
// ISOTOPES category is gonna come next in 1.1v
|
||||
1087
mods/cubesstuff.js
1087
mods/cubesstuff.js
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,238 @@
|
|||
/*
|
||||
*Version 1.0.0
|
||||
*/
|
||||
dependOn("orchidslibrary.js", ()=>{
|
||||
elements.data_wire = {
|
||||
desc: "Transfers data.",
|
||||
color: ["#6b1502", "#631402", "#6e1400", "#631200"],
|
||||
properties: {cd: 0, value: null},
|
||||
tick: function(pixel){
|
||||
for(let coords of adjacentCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1];
|
||||
let p2 = getPixel(x,y);
|
||||
if(p2 != null){
|
||||
if(p2.value != null && pixel.cd == 0){
|
||||
pixel.value = p2.value;
|
||||
pixel.cd = 15;
|
||||
};
|
||||
pixel.value = (pixel.cd == 3) ? null : pixel.value;
|
||||
if(elements[p2.element].dataInFunc != undefined && pixel.value != null){
|
||||
elements[p2.element].dataInFunc(p2, pixel.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
pixel.cd -= (pixel.cd == 0) ? 0 : 1;
|
||||
},
|
||||
category: "data",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
};
|
||||
elements.data_input = {
|
||||
desc: "Holds a data value that can be outputted to any nearby data wire.",
|
||||
color: ["#e06500", "#f57105", "#f06f05", "#e66c09"],
|
||||
value: null,
|
||||
onSelect: function(){
|
||||
promptInput("Enter data info", (input)=>{elements.data_input.value = input;}, "Data Input", elements.data_input.value);
|
||||
},
|
||||
category: "data",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
properties: {
|
||||
value:null,
|
||||
},
|
||||
tick: function(pixel){
|
||||
if(pixel.value == null){
|
||||
pixel.value = elements.data_input.value;
|
||||
}
|
||||
for(let coords of adjacentCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1];
|
||||
let p2 = getPixel(x,y);
|
||||
if(p2 != null && elements[p2.element].dataInFunc != undefined && pixel.value != null){
|
||||
elements[p2.element].dataInFunc(p2, pixel.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.toggle_data_input = {
|
||||
desc: "Holds a data value that can be outputted to any nearby data wire when toggled on.",
|
||||
color: ["#6e3302", "#783905", "#823c03", "#7d3a02"],
|
||||
value: null,
|
||||
onSelect: function(){
|
||||
promptInput("Enter data info", (input)=>{elements.data_input.value = input;}, "Data Input", elements.data_input.value);
|
||||
},
|
||||
category: "data",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
properties: {
|
||||
value:null,
|
||||
val: null,
|
||||
toggle: false,
|
||||
clickCd: 0,
|
||||
},
|
||||
tick: function(pixel){
|
||||
if(pixel.val == null){
|
||||
pixel.val = elements.data_input.value;
|
||||
}
|
||||
pixel.value = (pixel.toggle) ? pixel.val : null;
|
||||
for(let coords of adjacentCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1];
|
||||
let p2 = getPixel(x,y);
|
||||
if(p2 != null && elements[p2.element].dataInFunc != undefined && pixel.value != null){
|
||||
elements[p2.element].dataInFunc(p2, pixel.value);
|
||||
}
|
||||
}
|
||||
pixel.clickCd -= (pixel.clickCd == 0) ? 0 : 1;
|
||||
},
|
||||
onClicked: function(pixel){
|
||||
if(pixel.clickCd == 0){
|
||||
pixel.clickCd = 20;
|
||||
pixel.toggle = !pixel.toggle;
|
||||
if(pixel.toggle){
|
||||
pixel.color = noiseify("#edba00", 8);
|
||||
} else {
|
||||
pixel.color = noiseify("#6e3302", 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.join = {
|
||||
desc: "Combines multiple data inputs. Click to reset value.",
|
||||
color: ["#046e00", "#067a02", "#097006", "#065904", "#056602"],
|
||||
properties: {val: null, clickCd: 0},
|
||||
dataInFunc: function(pixel, value){
|
||||
if(pixel.val != null && !pixel.val.includes(value)){
|
||||
pixel.val += value;
|
||||
}
|
||||
if(pixel.val == null){
|
||||
pixel.val = value;
|
||||
}
|
||||
},
|
||||
category: "data",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
tick: function(pixel){
|
||||
let p2 = getPixel(pixel.x+1, pixel.y);
|
||||
if(p2 != null && p2.element == "data_wire"){
|
||||
p2.value = pixel.val;
|
||||
}
|
||||
pixel.clickCd -= (pixel.clickCd == 0) ? 0 : 1;
|
||||
},
|
||||
onClicked: function(pixel){
|
||||
if(pixel.clickCd == 0){
|
||||
pixel.clickCd = 20;
|
||||
pixel.val = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.data_sensor = {
|
||||
desc: "Scans adjacent pixels for a target property and outputs them, uses \"element\" by default. Click on pixel to change properties.",
|
||||
color: ["#3d3c28", "#4d4b32", "#4a482f", "#403e28"],
|
||||
properties: {
|
||||
value: null,
|
||||
property: "element",
|
||||
clickCd: 0,
|
||||
},
|
||||
tick: function(pixel){
|
||||
for(let coords of adjacentCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1];
|
||||
let p2 = getPixel(x,y);
|
||||
if(p2 != null && !["data_wire"].includes(p2.element)){
|
||||
pixel.value = p2[pixel.property];
|
||||
}
|
||||
};
|
||||
pixel.clickCd -= (pixel.clickCd == 0) ? 0 : 1;
|
||||
},
|
||||
onClicked: function(pixel){
|
||||
let propertyArr = [];
|
||||
for(let coords of adjacentCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1];
|
||||
let p2 = getPixel(x,y);
|
||||
if(p2 != null){
|
||||
for(let property in p2){
|
||||
if(typeof p2[property] != "function" && !propertyArr.includes(property)){
|
||||
propertyArr.push(property);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
promptChoose("Choose property this data sensor detects:", propertyArr, (input)=>{pixel.property = input || pixel.property;}, "Property to Detect");
|
||||
},
|
||||
category: "data",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
}
|
||||
elements.if = {
|
||||
desc: "Takes 3 inputs, conditon (1 (true) or 0 (false), x-1), ifTrue (output if true, y-1 (pixel above)), and ifFalse (output if false, y+1 (pixel below)).",
|
||||
color: ["#00574b", "#005247", "#02594e", "#025c50"],
|
||||
category: "data",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
tick: function(pixel){
|
||||
let conditionPixel = getPixel(pixel.x-1, pixel.y), truePixel = getPixel(pixel.x, pixel.y-1), falsePixel = getPixel(pixel.x, pixel.y+1);
|
||||
let condition = (conditionPixel != null &&conditionPixel.value != undefined) ? parseInt(conditionPixel.value) : false;
|
||||
let trueOut = (truePixel != null && truePixel.value != undefined) ? truePixel.value : 1;
|
||||
let falseOut = (falsePixel != null && falsePixel.value != undefined) ? falsePixel.value : 0;
|
||||
let outPixel = getPixel(pixel.x+1, pixel.y);
|
||||
if(outPixel != null && outPixel.value !== undefined){
|
||||
outPixel.value = (condition) ? trueOut : falseOut;
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.equals = {
|
||||
desc: "Takes 2 inputs, A (y-1 (pixel above)) and B (y+1 (pixel below), returns 1 if they are equal and 0 if they are not.",
|
||||
color: ["#12ccb3", "#15ebce", "#0bd6bb", "#14dec3"],
|
||||
category: "data",
|
||||
behavior: behaviors.WALL,
|
||||
state: "solid",
|
||||
tick: function(pixel){
|
||||
let a = getPixel(pixel.x, pixel.y-1), b = getPixel(pixel.x, pixel.y+1);
|
||||
if(a != null && b != null){
|
||||
let aVal = (a.value != undefined) ? a.value : 1;
|
||||
let bVal = (b.value != undefined) ? b.value : 0;
|
||||
let outPixel = getPixel(pixel.x+1, pixel.y);
|
||||
if(outPixel != null && outPixel.value !== undefined){
|
||||
outPixel.value = (aVal == bVal) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elements.prop_setter = {
|
||||
category: "data",
|
||||
properties: {
|
||||
val: null,
|
||||
},
|
||||
dataInFunc: function(pixel, value){
|
||||
pixel.val = value;
|
||||
},
|
||||
color: ["#deb150", "#ebba52", "#ebba52", "#e3b44d", "#dbab44"],
|
||||
state: "solid",
|
||||
behavior: behaviors.WALL,
|
||||
tick: function(pixel){
|
||||
if(pixel.val != null){
|
||||
let valArr = pixel.val.split(":");
|
||||
let prop = valArr[0], value = valArr[1];
|
||||
for(let coords of adjacentCoords){
|
||||
let x = pixel.x+coords[0], y = pixel.y+coords[1];
|
||||
let p2 = getPixel(x,y);
|
||||
if(p2 != null && p2[prop] != undefined && elements[p2.element].category != "data"){
|
||||
if(prop == "element"){
|
||||
changePixel(p2, value);
|
||||
} else if (prop == "x" || prop == "y"){
|
||||
let x = (prop == "x") ? value : p2.x, y = (prop == "y") ? value : p2.y;
|
||||
tryMove(p2, parseInt(x), parseInt(y), null, true);
|
||||
} else {
|
||||
if(typeof p2[prop] == "number"){
|
||||
p2[prop] = parseInt(value);
|
||||
} else if(typeof p2[prop] == "boolean"){
|
||||
p2[prop] = value.includes("true");
|
||||
} else if(typeof p2[prop] == "string"){
|
||||
p2[prop] = value;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}, true);
|
||||
|
|
@ -0,0 +1,218 @@
|
|||
elements.light.insulate = false;
|
||||
elements.light.tempLow = -200;
|
||||
elements.liquid_light.tempHigh = -200;
|
||||
elements.light.tempHigh = 2500;
|
||||
elements.light.stateHigh = "photonic_steam";
|
||||
elements.laser.stateHigh = "photonic_steam";
|
||||
elements.laser.tempHigh = 2500;
|
||||
elements.dirty_water.density=1600
|
||||
|
||||
if (!elements.zinc.reactions) elements.zinc.reactions = {};
|
||||
elements.zinc.reactions["sulfur"] = { elem1:"zinc_sulfide", elem2:null };
|
||||
|
||||
|
||||
elements.photonic_steam = {
|
||||
color: ["#fffccc", "#fff9aa"],
|
||||
behavior: [
|
||||
"M2|M1|M2",
|
||||
"M2|XX|M2",
|
||||
"XX|XX|XX"
|
||||
],
|
||||
category: "energy",
|
||||
state: "gas",
|
||||
density: 0.08,
|
||||
temp: 2500,
|
||||
emit: 4,
|
||||
emitColor: "#fff8aa",
|
||||
tick: function(pixel) {
|
||||
|
||||
if (Math.random() < 0.08) {
|
||||
let x = pixel.x + (Math.floor(Math.random() * 3) - 1);
|
||||
let y = pixel.y + (Math.floor(Math.random() * 3) - 1);
|
||||
if (!outOfBounds(x, y) && isEmpty(x, y, true)) {
|
||||
createPixel("cherenkov_radiation", x, y);
|
||||
}
|
||||
}
|
||||
|
||||
if (Math.random() < 0.01) {
|
||||
deletePixel(pixel.x, pixel.y);
|
||||
return;
|
||||
}
|
||||
|
||||
doHeat(pixel);
|
||||
doBurning(pixel);
|
||||
doDefaults(pixel);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
elements.cherenkov_radiation = {
|
||||
color: ["#66ccff", "#99ddff", "#44aaff"],
|
||||
behavior: behaviors.SUPERDFLUID,
|
||||
category: "energy",
|
||||
state: "gas",
|
||||
density: 0.05,
|
||||
temp: 500,
|
||||
emit: 3,
|
||||
emitColor: "#66ccff",
|
||||
tick: function(pixel) {
|
||||
for (let [dx, dy] of [[1,0], [-1,0], [0,1], [0,-1]]) {
|
||||
let x = pixel.x + dx, y = pixel.y + dy;
|
||||
if (outOfBounds(x, y)) continue;
|
||||
let other = pixelMap[x]?.[y];
|
||||
if (!other) continue;
|
||||
|
||||
let def = elements[other.element];
|
||||
if (def?.category === "life") {
|
||||
if (Math.random() < 0.35) changePixel(other, "ash");
|
||||
else other.color = "#88ccff";
|
||||
}
|
||||
}
|
||||
if (Math.random() < 0.25) {
|
||||
changePixel(pixel, "light");
|
||||
pixel.color = "#66ccff"
|
||||
return;
|
||||
}
|
||||
|
||||
doDefaults(pixel);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
elements.charged_phosphor = {
|
||||
color: ["#d0ff7f", "#e6ff99", "#f0ffa6"],
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
density: 3980,
|
||||
tick: function(pixel) {
|
||||
pixel.charged = true;
|
||||
|
||||
let dirs = [[0,-1],[1,0],[-1,0],[0,1],[1,1],[1,-1],[-1,1],[-1,-1]];
|
||||
let dir = dirs[Math.floor(Math.random() * dirs.length)];
|
||||
let nx = pixel.x + dir[0];
|
||||
let ny = pixel.y + dir[1];
|
||||
|
||||
if (!outOfBounds(nx, ny) && isEmpty(nx, ny)) {
|
||||
createPixel("light", nx, ny);
|
||||
pixel.charged=false;
|
||||
}
|
||||
|
||||
if (pixel.charged==false) {
|
||||
changePixel(pixel, "phosphor");
|
||||
}
|
||||
|
||||
doDefaults(pixel);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
elements.phosphor = {
|
||||
color: ["#66ff88", "#88ffaa", "#aaffcc"],
|
||||
behavior: behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
density: 3980,
|
||||
reactions: {
|
||||
"light": { elem1:"charged_phosphor", elem2:null },
|
||||
"liquid_light": { elem1:"charged_phosphor", elem2:null },
|
||||
"laser": { elem1:"charged_phosphor", elem2:null },
|
||||
"photonic_steam": { elem1:"charged_phosphor", elem2:null },
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
elements.zinc_sulfide= {
|
||||
color: ["#f8f8f8","#ffffff","#eeeeee"],
|
||||
behavior:behaviors.POWDER,
|
||||
category: "powders",
|
||||
state: "solid",
|
||||
density: 3980,
|
||||
reactions: {
|
||||
"copper": { elem1:"phosphor", elem2:null}
|
||||
},
|
||||
};
|
||||
|
||||
elements.bioluminescent_cell = {
|
||||
behavior: behaviors.SUPPORT,
|
||||
color: ["#81ec75","#5fec87","#3ca365"],
|
||||
category: "life",
|
||||
state: "solid",
|
||||
density: 1000.1,
|
||||
tempHigh: 102,
|
||||
stateHigh: ["steam","steam","steam","sugar"],
|
||||
tempLow: -2,
|
||||
stateLow: ["ice","ice","ice","sugar_ice"],
|
||||
breakInto: ["water","dna","phosphor"],
|
||||
reactions: {
|
||||
"sugar_water": { elem2:["bio_seed","dirty_water"], chance:0.06, temp2:30, elem1:"bioluminescent_cell"},
|
||||
"sugar":{ elem2:["bio_seed","dirty_water"], chance:0.08, temp2:30, elem1:"bioluminescent_cell"},
|
||||
"water":{ elem2:["bio_seed","dirty_water"], chance:0.04, temp2:30, elem1:"bioluminescent_cell"},
|
||||
"salt_water": { elem2:["bio_seed","dirty_water"], chance:0.02, temp2:30, elem1:"bioluminescent_cell"},
|
||||
"oxygen": { elem1:"bioluminescent_cell", elem2:"light" },
|
||||
"infection": { elem1:"infection", chance:0.015 },
|
||||
"blood": { elem1:"blood", chance:0.01 },
|
||||
"antibody": { elem1:"antibody", chance:0.01 },
|
||||
"alcohol": { elem1:[null,"dna"], chance:0.02 },
|
||||
"poison": { elem1:null, chance:0.02 },
|
||||
"plague": { elem1:null, chance:0.02 },
|
||||
"mercury": { elem1:null, chance:0.02 },
|
||||
"chlorine": { elem1:null, chance:0.02 },
|
||||
"cyanide": { elem1:null, chance:0.02 },
|
||||
"soap": { elem1:null, chance:0.015 },
|
||||
"ammonia": { elem2:"nitrogen", chance:0.05 },
|
||||
"oil": { elem2:"methane", chance:0.001 },
|
||||
"milk": { elem2:"yogurt", chance:0.01 },
|
||||
"cream": { elem2:"yogurt", chance:0.01 },
|
||||
"chocolate_milk": { elem2:"yogurt", chance:0.01, color2:"#4c392c" },
|
||||
"fruit_milk": { elem2:"yogurt", chance:0.01, color2:"#977871" },
|
||||
"pilk": { elem2:"yogurt", chance:0.01, color2:"#bba789" },
|
||||
"eggnog": { elem2:"yogurt", chance:0.01, color2:"#ae9a7e" }
|
||||
}
|
||||
};
|
||||
|
||||
elements.bio_seed = {
|
||||
color: "#55cc77",
|
||||
category: "life",
|
||||
state: "solid",
|
||||
density: 900,
|
||||
hidden:1,
|
||||
behavior: behaviors.POWDER,
|
||||
tick: function(pixel) {
|
||||
if (Math.random() < 0.1) {
|
||||
changePixel(pixel,"bioluminescent_cell");
|
||||
}
|
||||
doDefaults(pixel);
|
||||
},
|
||||
};
|
||||
|
||||
elements.solar_panel = {
|
||||
behavior:behaviors.WALL,
|
||||
color:["#2b6fb0","#2f73bd","#1f4f86"],
|
||||
tick:function(pixel){
|
||||
var adj = [[1,0],[-1,0],[0,1],[0,-1],[1,1],[-1,-1],[-1,1],[1,-1]];
|
||||
for(var i=0;i<adj.length;i++){
|
||||
var x = pixel.x+adj[i][0], y = pixel.y+adj[i][1];
|
||||
if(outOfBounds(x,y)) continue;
|
||||
var sensed = pixelMap[x]?.[y];
|
||||
if(!sensed) continue;
|
||||
if(["light","liquid_light","photonic_steam","laser"].includes(sensed.element)){
|
||||
deletePixel(x,y);
|
||||
pixel.charge = 5;
|
||||
break;
|
||||
}
|
||||
}
|
||||
doDefaults(pixel);
|
||||
},
|
||||
conduct:1,
|
||||
movable:false,
|
||||
category:"machines",
|
||||
darkText:true,
|
||||
hardness:2,
|
||||
material:"steel"
|
||||
};
|
||||
|
||||
elements.wire = elements.wire || {};
|
||||
elements.wire.reactions = elements.wire.reactions || {};
|
||||
elements.wire.reactions.solar_panel = { elem1:"wire", charge1:1 };
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
runAfterLoad(function() {
|
||||
console.log("Liquefier Mod loaded!")
|
||||
console.log("Created by Hitochi — turns elements into liquid forms.")
|
||||
})
|
||||
|
||||
elements.liquefier = {
|
||||
color: "#33ccff",
|
||||
behavior: behaviors.POWDER, // sits in place
|
||||
category: "machines",
|
||||
state: "solid",
|
||||
density: 2000,
|
||||
tick: function(pixel) {
|
||||
const dirs = [
|
||||
[0,1], [0,-1], [1,0], [-1,0],
|
||||
[1,1], [-1,1], [1,-1], [-1,-1]
|
||||
];
|
||||
for (const [dx,dy] of dirs) {
|
||||
const x = pixel.x+dx;
|
||||
const y = pixel.y+dy;
|
||||
if (outOfBounds(x,y)) continue;
|
||||
|
||||
const target = pixelMap[x][y];
|
||||
if (!target) continue;
|
||||
if (target.element === "liquefier") continue;
|
||||
|
||||
const liquidName = target.element + "_liquid";
|
||||
|
||||
// Define the liquid version if missing
|
||||
if (!elements[liquidName]) {
|
||||
let baseColor = elements[target.element]?.color || "#654321";
|
||||
if (Array.isArray(baseColor)) baseColor = baseColor[0];
|
||||
|
||||
// check if original is food
|
||||
const isEdible =
|
||||
elements[target.element]?.isFood === true ||
|
||||
elements[target.element]?.category === "food";
|
||||
|
||||
elements[liquidName] = {
|
||||
color: [baseColor, "#3399ff"], // tinted version
|
||||
behavior: behaviors.LIQUID,
|
||||
category: "liquids",
|
||||
state: "liquid",
|
||||
density: 1050,
|
||||
viscosity: 8,
|
||||
isFood: isEdible, // only food is edible
|
||||
desc: "Liquefied form of " + target.element
|
||||
};
|
||||
}
|
||||
|
||||
// Turn neighbor into its liquid version
|
||||
changePixel(target, liquidName);
|
||||
}
|
||||
},
|
||||
desc: "Liquefies nearby pixels into their liquid versions. Food becomes drinkable."
|
||||
};
|
||||
|
|
@ -0,0 +1,278 @@
|
|||
elements.explorder = {
|
||||
color: "#ff6600",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|CH:water>explosion|XX",
|
||||
"M2|M1|M2"
|
||||
],
|
||||
category: "evilness",
|
||||
state: "solid",
|
||||
reactions: {
|
||||
"water": { elem1: "supernova", elem2: null }
|
||||
},
|
||||
desc: 'Unstable element that creates a massive explosion when it comes into contact with water.'
|
||||
};
|
||||
|
||||
elements.netrinth = {
|
||||
color: "#0066ff",
|
||||
behavior: behaviors.WALL,
|
||||
category: 'evilness',
|
||||
state: 'solid',
|
||||
desc: 'Highly radioactive element that twists structure of atom particles, making them part of radiation, energy can be extracted from it.',
|
||||
tick: function(pixel) {
|
||||
if (Math.floor(Math.random() * 900) + 1 === 1) {
|
||||
tryCreate('radiation', pixel.x, pixel.y+1)
|
||||
}
|
||||
},
|
||||
reactions: {
|
||||
"proton": { elem1: "radiation", elem2: null},
|
||||
"neutron": { elem1: "radiation", elem2: null},
|
||||
"electric": { elem1: "radiation", elem2: null}
|
||||
},
|
||||
tempHigh: 1000,
|
||||
stateHigh: "liquid_netrinth"
|
||||
};
|
||||
|
||||
elements.liquid_netrinth = {
|
||||
color: "#0066ff",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"M3%15|XX|M3%15",
|
||||
"M2%15|M1|M2%15"
|
||||
],
|
||||
category: 'states',
|
||||
state: 'liquid',
|
||||
desc: 'ok nub did you expect liquid netrinth be billion times dangerous and more evil? this damages the atom structure of this element, making it less radioactive, harder to extract energy.',
|
||||
tick: function(pixel) {
|
||||
if (Math.floor(Math.random() * 1800) + 1 === 1) {
|
||||
tryCreate('radiation', pixel.x, pixel.y+1)
|
||||
}
|
||||
},
|
||||
reactions: {
|
||||
"proton": { elem1: "radiation", elem2: null},
|
||||
"neutron": { elem1: "radiation", elem2: null},
|
||||
"electric": { elem1: "radiation", elem2: null}
|
||||
},
|
||||
tempLow:500,
|
||||
stateLow: "netrinth",
|
||||
tempHigh: 6000,
|
||||
stateHigh: "gas_netrinth",
|
||||
temp: 1001
|
||||
};
|
||||
|
||||
elements.gas_netrinth = {
|
||||
color: "#76adff",
|
||||
behavior: behaviors.GAS,
|
||||
category: 'states',
|
||||
state: 'gas',
|
||||
desc: 'the element atom structure is completely destroyed, making it non radioactive, even after solidifying, no longer extractable energy, and giving it brigher color, also now completely safe.',
|
||||
tempLow: 6000,
|
||||
stateLow: "safe_liquid_nentrinth",
|
||||
temp: 6001
|
||||
}
|
||||
|
||||
elements.safe_liquid_netrinth = {
|
||||
color: "#76adff",
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"M3%15|XX|M3%15",
|
||||
"M2%15|M1|M2%15"
|
||||
],
|
||||
category: 'states',
|
||||
state: 'liquid',
|
||||
desc: 'what do you expect this to be',
|
||||
tempLow:500,
|
||||
stateLow: "safe_netrinth",
|
||||
tempHigh: 6000,
|
||||
stateHigh: "gas_netrinth",
|
||||
temp: 1001
|
||||
};
|
||||
|
||||
elements.safe_netrinth = {
|
||||
color: "#76adff",
|
||||
behavior: behaviors.WALL,
|
||||
category: 'evilness',
|
||||
state: 'solid',
|
||||
desc: ':/',
|
||||
tempHigh: 1000,
|
||||
stateHigh: "safe_liquid_netrinth"
|
||||
};
|
||||
|
||||
elements.mercurium = {
|
||||
color: ["#740000","#2e2e2e","#1b0047"],
|
||||
behavior: behaviors.SUPPORT,
|
||||
category: 'evilness',
|
||||
state: 'solid',
|
||||
desc: 'Very rare and sticky element, DO NOT MISTAKE WITH MERCURY, will explode on high temperatures',
|
||||
tick: function(pixel) {
|
||||
if (Math.floor(Math.random() * 1000) + 1 === 1) {
|
||||
tryCreate('electric', pixel.x, pixel.y-1)
|
||||
}
|
||||
},
|
||||
tempHigh: 4000,
|
||||
stateHigh: "supernova"
|
||||
};
|
||||
|
||||
elements.magnetite = {
|
||||
color: ["#3a3a3a", "#535353", "#a200d3"],
|
||||
behavior: behaviors.WALL,
|
||||
category: 'evilness',
|
||||
state: 'solid',
|
||||
desc: 'A very dense and heavy magnetic element, it can attract and repel other metals.',
|
||||
reactions: {
|
||||
"iron": { elem1: "magnetite", elem2: null },
|
||||
"steel": { elem1: "magnetite", elem2: null },
|
||||
"gold": { elem1: "magnetite", elem2: null },
|
||||
"copper": { elem1: "magnetite", elem2: null },
|
||||
"aluminum": { elem1: "magnetite", elem2: null },
|
||||
"lead": { elem1: "magnetite", elem2: null },
|
||||
"tungsten": { elem1: "magnetite", elem2: null },
|
||||
},
|
||||
tick: function(pixel) {
|
||||
if (Math.floor(Math.random() * 1000) + 1 === 1) {
|
||||
tryCreate('electric', pixel.x, pixel.y-1)
|
||||
}
|
||||
},
|
||||
tempHigh: 3000,
|
||||
stateHigh: "molten_magnetite",
|
||||
breakInto: "magnetite_powder"
|
||||
}
|
||||
|
||||
elements.molten_magnetite = {
|
||||
color: ["#e4e4e4", "#535353", "#e180ff"],
|
||||
behavior: behaviors.LIQUID,
|
||||
category: 'states',
|
||||
state: 'liquid',
|
||||
desc: 'magnetite but liquid, and also explodes in electricity during high temperatures',
|
||||
tempLow: 3000,
|
||||
stateLow: "magnetite",
|
||||
temp: 3000,
|
||||
tempHigh: 6000,
|
||||
stateHigh: 'lightning',
|
||||
}
|
||||
|
||||
elements.netrinth_receiver = {
|
||||
color: "#00ffcc",
|
||||
behavior: behaviors.WALL,
|
||||
category: 'machines',
|
||||
state: 'solid',
|
||||
desc: 'A device that absorbs radiation from netrinth and converts it into electricity, hoewer destroys the netrinth in the process.',
|
||||
conduct: 1,
|
||||
tick: function(pixel) {
|
||||
// Check adjacent pixels for netrinth or liquid_netrinth
|
||||
let dirs = [
|
||||
[0, -1], [1, 0], [0, 1], [-1, 0]
|
||||
];
|
||||
for (let d = 0; d < dirs.length; d++) {
|
||||
let nx = pixel.x + dirs[d][0];
|
||||
let ny = pixel.y + dirs[d][1];
|
||||
if (isEmpty(nx, ny)) continue;
|
||||
let np = pixelMap[nx][ny];
|
||||
if (!np) continue;
|
||||
if (np.element === "netrinth" || np.element === "liquid_netrinth") {
|
||||
// Remove netrinth and create electric
|
||||
changePixel(np, "electric");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
elements.magnetite_powder = {
|
||||
color: ["#3a3a3a", "#535353", "#a200d3"],
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"XX|XX|XX",
|
||||
"M2|M1|M2"
|
||||
],
|
||||
category: 'evilness',
|
||||
state: 'solid',
|
||||
desc: 'tottaly not the same magnetite as the previous one',
|
||||
reactions: {
|
||||
"iron": { elem1: "magnetite_powder", elem2: null },
|
||||
"steel": { elem1: "magnetite_powder", elem2: null },
|
||||
"gold": { elem1: "magnetite_powder", elem2: null },
|
||||
"copper": { elem1: "magnetite_powder", elem2: null },
|
||||
"aluminum": { elem1: "magnetite_powder", elem2: null },
|
||||
"lead": { elem1: "magnetite_powder", elem2: null },
|
||||
"tungsten": { elem1: "magnetite_powder", elem2: null },
|
||||
},
|
||||
tempHigh: 3000,
|
||||
stateHigh: "molten_magnetite",
|
||||
tick: function(pixel) {
|
||||
if (Math.floor(Math.random() * 1000) + 1 === 1) {
|
||||
tryCreate('electric', pixel.x, pixel.y-1)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
elements.side_gravity_powder = {
|
||||
color: ["#ff0000", "#ff8800", "#fffb00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff"],
|
||||
fireColor: ["#ff0000", "#ff8800", "#fffb00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff"],
|
||||
behavior: [
|
||||
"M2|XX|XX",
|
||||
"M1|XX|XX",
|
||||
"M2|XX|XX"
|
||||
],
|
||||
desc: "Powder that falls sideways, isnt that cool?, NO PLEASE DONT THROW TOMATOES AT ME I DONT SUPPORT LGBTQ+",
|
||||
category: "evilness",
|
||||
state: "solid",
|
||||
burn: 20,
|
||||
}
|
||||
|
||||
elements.side_gravity_powder_but_not_directly_sideways = {
|
||||
color: ["#ff0000", "#ff8800", "#fffb00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff"],
|
||||
fireColor: ["#ff0000", "#ff8800", "#fffb00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff"],
|
||||
behavior: [
|
||||
"XX|XX|XX",
|
||||
"M2|XX|XX",
|
||||
"M1|M2|XX"
|
||||
],
|
||||
desc: "Powder that falls sideways, isnt that cool?, NO PLEASE DONT THROW TOMATOES AT ME I DONT SUPPORT LGBTQ+",
|
||||
category: "evilness",
|
||||
state: "solid",
|
||||
burn: 20,
|
||||
}
|
||||
|
||||
elements.explosive_gas = {
|
||||
color: "#ff0000",
|
||||
behavior: behaviors.GAS,
|
||||
category: "evilness",
|
||||
state: "gas",
|
||||
reactions: {
|
||||
"fire": { elem1: "explosion", elem2: null },
|
||||
"plasma": { elem1: "supernova", elem2: null},
|
||||
"laser": { elem1: "explosion", elem2: null },
|
||||
"flash": { elem1: "explosion", elem2: null },
|
||||
},
|
||||
desc: "boom",
|
||||
tempHigh: 21,
|
||||
stateHigh: "explosion",
|
||||
tempLow: 19,
|
||||
stateLow: "explosion",
|
||||
}
|
||||
|
||||
elements.neutronium = {
|
||||
color: ["#00ffdd", "#00098b", "rgba(71, 71, 71, 1)"],
|
||||
behavior: behaviors.POWDER,
|
||||
category: 'evilness',
|
||||
glow: true,
|
||||
state: 'solid',
|
||||
desc: 'A very dense and heavy element, made entirely out of neutrons, it is incredibly rare and valuable, but also very unstable.',
|
||||
tempHigh: 1000,
|
||||
stateHigh: "neutron",
|
||||
density: 10000,
|
||||
tick: function(pixel) {
|
||||
if (Math.floor(Math.random() * 600) + 1 === 1) {
|
||||
tryCreate('neutron', pixel.x, pixel.y-1)
|
||||
};
|
||||
if (Math.floor(Math.random() * 800) + 1 === 1) {
|
||||
tryCreate('electric', pixel.x, pixel.y-1)
|
||||
};
|
||||
},
|
||||
unbreakable: true,
|
||||
reactions: {
|
||||
"proton": { elem1: "neutron", elem2: null},
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
*Version 1.0.0
|
||||
*/
|
||||
function noiseify(color, range){
|
||||
if(color.startsWith("#")){
|
||||
color = hexToRGB(color);
|
||||
} else {
|
||||
color = getRGB(color);
|
||||
}
|
||||
let num = Math.round(Math.random()*(range*2))-range;
|
||||
for(let value in color){
|
||||
color[value] += num;
|
||||
}
|
||||
return `rgb(${color.r},${color.g},${color.b})`;
|
||||
}
|
||||
|
||||
function is2d(arr){
|
||||
return arr.some(item => Array.isArray(item));
|
||||
}
|
||||
|
||||
function colorMix(p1, p2, bias = 0.5){
|
||||
c1 = p1.color;
|
||||
p1.color = interpolateRgb(getRGB(p1.color), getRGB(p2.color), bias);
|
||||
p2.color = interpolateRgb(getRGB(c1), getRGB(p2.color), bias);
|
||||
}
|
||||
|
||||
function interpolateRgb(rgb1, rgb2, ratio = 0.5) {
|
||||
const interpolatedRgb = {
|
||||
r: Math.round(rgb1.r + (rgb2.r - rgb1.r) * ratio),
|
||||
g: Math.round(rgb1.g + (rgb2.g - rgb1.g) * ratio),
|
||||
b: Math.round(rgb1.b + (rgb2.b - rgb1.b) * ratio),
|
||||
};
|
||||
return normalize(interpolatedRgb);
|
||||
}
|
||||
|
||||
function getRGB(rgb){
|
||||
if(rgb.startsWith("rgb(")){
|
||||
let rgb2 = rgb.replace(")", "").replace("rgb(", "").replace(/,/g, "r").split("r")
|
||||
return { r: parseInt(rgb2[0]), g: parseInt(rgb2[1]), b: parseInt(rgb2[2]) };
|
||||
} else {
|
||||
return hexToRGB(rgb2);
|
||||
}
|
||||
}
|
||||
function pixelToggle(pixel, multi = {r:1,g:1,b:1}){
|
||||
if(pixel.toggle != undefined){
|
||||
pixel.toggle = !pixel.toggle;
|
||||
let rgb;
|
||||
if(Array.isArray(elements[pixel.element].color)){
|
||||
let elemColor = elements[pixel.element].color[Math.round(Math.random()*elements[pixel.element].color.length)];
|
||||
rgb = hexToRGB(elemColor) || getRGB(elemColor);
|
||||
} else {
|
||||
let elemColor = elements[pixel.element].color;
|
||||
rgb = hexToRGB(elemColor) || getRGB(elemColor);
|
||||
}
|
||||
let num = 5 - Math.round(Math.random()*10);
|
||||
if(pixel.toggle){
|
||||
for(let key in rgb){
|
||||
rgb[key] += (100*multi[key]);
|
||||
rgb[key] = Math.round(Math.max(Math.min(rgb[key], 255), 0));
|
||||
}
|
||||
pixel.color = `rgb(${rgb.r+num},${rgb.g+num},${rgb.b+num})`;
|
||||
}
|
||||
else {
|
||||
pixel.color = `rgb(${rgb.r+num},${rgb.g+num},${rgb.b+num})`;
|
||||
}
|
||||
}
|
||||
}
|
||||
function normalize(obj){
|
||||
return `rgb(${obj.r},${obj.g},${obj.b})`;
|
||||
}
|
||||
2882
mods/plants.js
2882
mods/plants.js
File diff suppressed because it is too large
Load Diff
6935
mods/scp.js
6935
mods/scp.js
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,20 @@
|
|||
// Makes all elements EXTREAMLY sensitive to air or anything else.
|
||||
|
||||
|
||||
runAfterLoad(function() {
|
||||
for (const elem in elements) {
|
||||
if (["fire", "explosion", "smoke"].includes(elem)) continue;
|
||||
if (!elements[elem].onPlace) {
|
||||
elements[elem].onPlace = function(pixel) {
|
||||
changePixel(pixel, "explosion");
|
||||
};
|
||||
} else {
|
||||
|
||||
const oldOnPlace = elements[elem].onPlace;
|
||||
elements[elem].onPlace = function(pixel) {
|
||||
oldOnPlace(pixel);
|
||||
changePixel(pixel, "explosion");
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
Reference in New Issue