mod hotfixes
This commit is contained in:
parent
ec74def16a
commit
c6603aaff7
|
|
@ -9192,7 +9192,7 @@ color1 and color2 spread through striped paint like dye does with itself. <u>col
|
||||||
for(var i = 0; i < dyeColors.length; i++) {
|
for(var i = 0; i < dyeColors.length; i++) {
|
||||||
newLegacyFnmDye(dyeColors[i][0],dyeColors[i][1])
|
newLegacyFnmDye(dyeColors[i][0],dyeColors[i][1])
|
||||||
};
|
};
|
||||||
eLists.LED = ["led_r","led_g","led_b"];
|
eLists.LED = ["led_r","led_g","led_b","led"];
|
||||||
function newLED(abbrev,hexColor,baseColorOverrideHex=null) {
|
function newLED(abbrev,hexColor,baseColorOverrideHex=null) {
|
||||||
if(!(hexColor.startsWith("#"))) { hexColor = "#" + hexColor };
|
if(!(hexColor.startsWith("#"))) { hexColor = "#" + hexColor };
|
||||||
if(baseColorOverrideHex && !(baseColorOverrideHex.startsWith("#"))) { baseColorOverrideHex = "#" + baseColorOverrideHex };
|
if(baseColorOverrideHex && !(baseColorOverrideHex.startsWith("#"))) { baseColorOverrideHex = "#" + baseColorOverrideHex };
|
||||||
|
|
@ -44975,7 +44975,7 @@ maxPixels (default 1000): Maximum amount of pixels/changes (if xSpacing and ySpa
|
||||||
function editDistance(s1, s2) {s1 = s1.toLowerCase();s2 = s2.toLowerCase();var costs = new Array();for (var i = 0; i <= s1.length; i++) {var lastValue = i;for (var j = 0; j <= s2.length; j++) {if (i == 0)costs[j] = j;else {if (j > 0) {var newValue = costs[j - 1];if (s1.charAt(i - 1) != s2.charAt(j - 1))newValue = Math.min(Math.min(newValue, lastValue),costs[j]) + 1;costs[j - 1] = lastValue;lastValue = newValue;}}}if (i > 0)costs[s2.length] = lastValue;}return costs[s2.length];}
|
function editDistance(s1, s2) {s1 = s1.toLowerCase();s2 = s2.toLowerCase();var costs = new Array();for (var i = 0; i <= s1.length; i++) {var lastValue = i;for (var j = 0; j <= s2.length; j++) {if (i == 0)costs[j] = j;else {if (j > 0) {var newValue = costs[j - 1];if (s1.charAt(i - 1) != s2.charAt(j - 1))newValue = Math.min(Math.min(newValue, lastValue),costs[j]) + 1;costs[j - 1] = lastValue;lastValue = newValue;}}}if (i > 0)costs[s2.length] = lastValue;}return costs[s2.length];}
|
||||||
function similarity(s1, s2) {var longer = s1;var shorter = s2;if (s1.length < s2.length) {longer = s2;shorter = s1;}var longerLength = longer.length;if (longerLength == 0) {return 1.0;}return (longerLength - editDistance(longer, shorter)) / parseFloat(longerLength);}
|
function similarity(s1, s2) {var longer = s1;var shorter = s2;if (s1.length < s2.length) {longer = s2;shorter = s1;}var longerLength = longer.length;if (longerLength == 0) {return 1.0;}return (longerLength - editDistance(longer, shorter)) / parseFloat(longerLength);}
|
||||||
function mostSimilarElement(s) {
|
function mostSimilarElement(s) {
|
||||||
delete elements;
|
// delete elements;
|
||||||
var max = 0;
|
var max = 0;
|
||||||
var maxElement = "";
|
var maxElement = "";
|
||||||
for (var e in elements) {
|
for (var e in elements) {
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ elements.submitted_blueprint_2_creator = {
|
||||||
tick: function(pixel){
|
tick: function(pixel){
|
||||||
if(!pixel.done){
|
if(!pixel.done){
|
||||||
if (pixelTicks % 3 == 0){
|
if (pixelTicks % 3 == 0){
|
||||||
let randomcoord = getRandomPixelCoordinates(pixel, -1, -1, decaybp, {1: "led_r", 2:"porcelain", 3: "glass", 4: "tungsten", 5: "zinc", 6: "aluminum", 7: "copper", 8: "copper", 9: "steel", 10: "bronze", 11: "sterling"});
|
let randomcoord = getRandomPixelCoordinates(pixel, -1, -1, decaybp, {1: "led", 2:"porcelain", 3: "glass", 4: "tungsten", 5: "zinc", 6: "aluminum", 7: "copper", 8: "copper", 9: "steel", 10: "bronze", 11: "sterling"});
|
||||||
if (randomcoord == "terminated"){pixel.done = true; return;}
|
if (randomcoord == "terminated"){pixel.done = true; return;}
|
||||||
let rx = pixel.x + randomcoord.x+1;
|
let rx = pixel.x + randomcoord.x+1;
|
||||||
let ry = pixel.y + randomcoord.y+1;
|
let ry = pixel.y + randomcoord.y+1;
|
||||||
|
|
|
||||||
|
|
@ -394,6 +394,7 @@
|
||||||
"led_r": ["AlInGaP"],
|
"led_r": ["AlInGaP"],
|
||||||
"led_g": ["InGaN"],
|
"led_g": ["InGaN"],
|
||||||
"led_b": ["InGaN"],
|
"led_b": ["InGaN"],
|
||||||
|
"led": ["InGaN"],
|
||||||
"tesla_coil": ["Cu"],
|
"tesla_coil": ["Cu"],
|
||||||
"light_bulb": ["SiO<sub>2</sub>","Cu"],
|
"light_bulb": ["SiO<sub>2</sub>","Cu"],
|
||||||
"shocker": ["Cu"],
|
"shocker": ["Cu"],
|
||||||
|
|
|
||||||
|
|
@ -56,23 +56,7 @@ elements.smoke.renderer = function(pixel,ctx) {
|
||||||
elements.radiation.renderer = function(pixel,ctx) {
|
elements.radiation.renderer = function(pixel,ctx) {
|
||||||
shade(ctx, pixel.color, pixel.x, pixel.y, 2, 0.25)
|
shade(ctx, pixel.color, pixel.x, pixel.y, 2, 0.25)
|
||||||
}
|
}
|
||||||
elements.led_r.renderer = function(pixel,ctx) {
|
elements.led.renderer = function(pixel,ctx) {
|
||||||
if (pixel.charge) {
|
|
||||||
shade(ctx, pixel.color, pixel.x, pixel.y, 3, 0.5)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
shade(ctx, pixel.color, pixel.x, pixel.y, 0, 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elements.led_g.renderer = function(pixel,ctx) {
|
|
||||||
if (pixel.charge) {
|
|
||||||
shade(ctx, pixel.color, pixel.x, pixel.y, 3, 0.5)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
shade(ctx, pixel.color, pixel.x, pixel.y, 0, 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elements.led_b.renderer = function(pixel,ctx) {
|
|
||||||
if (pixel.charge) {
|
if (pixel.charge) {
|
||||||
shade(ctx, pixel.color, pixel.x, pixel.y, 3, 0.5)
|
shade(ctx, pixel.color, pixel.x, pixel.y, 3, 0.5)
|
||||||
}
|
}
|
||||||
|
|
@ -80,3 +64,27 @@ elements.led_b.renderer = function(pixel,ctx) {
|
||||||
shade(ctx, pixel.color, pixel.x, pixel.y, 0, 1)
|
shade(ctx, pixel.color, pixel.x, pixel.y, 0, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// elements.led_r.renderer = function(pixel,ctx) {
|
||||||
|
// if (pixel.charge) {
|
||||||
|
// shade(ctx, pixel.color, pixel.x, pixel.y, 3, 0.5)
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// shade(ctx, pixel.color, pixel.x, pixel.y, 0, 1)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// elements.led_g.renderer = function(pixel,ctx) {
|
||||||
|
// if (pixel.charge) {
|
||||||
|
// shade(ctx, pixel.color, pixel.x, pixel.y, 3, 0.5)
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// shade(ctx, pixel.color, pixel.x, pixel.y, 0, 1)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// elements.led_b.renderer = function(pixel,ctx) {
|
||||||
|
// if (pixel.charge) {
|
||||||
|
// shade(ctx, pixel.color, pixel.x, pixel.y, 3, 0.5)
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// shade(ctx, pixel.color, pixel.x, pixel.y, 0, 1)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,10 @@ elements.potato_seed.extraInfo = "Digs through dirt and creates potatoes.";
|
||||||
elements.grass_seed.extraInfo = "Plants grass of variable height.";
|
elements.grass_seed.extraInfo = "Plants grass of variable height.";
|
||||||
elements.electric.extraInfo = "Produces a brief electrical spark.";
|
elements.electric.extraInfo = "Produces a brief electrical spark.";
|
||||||
elements.neon.extraInfo = "Glows when powered.";
|
elements.neon.extraInfo = "Glows when powered.";
|
||||||
elements.led_r.extraInfo = "Lights up when powered.";
|
elements.led.extraInfo = "Lights up when powered.";
|
||||||
elements.led_g.extraInfo = "Lights up when powered.";
|
// elements.led_r.extraInfo = "Lights up when powered.";
|
||||||
elements.led_b.extraInfo = "Lights up when powered.";
|
// elements.led_g.extraInfo = "Lights up when powered.";
|
||||||
|
// elements.led_b.extraInfo = "Lights up when powered.";
|
||||||
elements.ecloner.extraInfo = "Clones the first pixel that touches it when powered.";
|
elements.ecloner.extraInfo = "Clones the first pixel that touches it when powered.";
|
||||||
elements.cloner.extraInfo = "Clones the first pixel that touches it.";
|
elements.cloner.extraInfo = "Clones the first pixel that touches it.";
|
||||||
elements.slow_cloner.extraInfo = "Clones the first pixel that touches it.";
|
elements.slow_cloner.extraInfo = "Clones the first pixel that touches it.";
|
||||||
|
|
@ -71,8 +72,8 @@ elements.static.extraInfo = "Flickers in grayscale.";
|
||||||
elements.gray_goo.extraInfo = "Duplicates itself when touching other pixels.";
|
elements.gray_goo.extraInfo = "Duplicates itself when touching other pixels.";
|
||||||
elements.virus.extraInfo = "Duplicates itself when touching other pixels.";
|
elements.virus.extraInfo = "Duplicates itself when touching other pixels.";
|
||||||
elements.snake.extraInfo = "Goes around in a snake-like pattern.";
|
elements.snake.extraInfo = "Goes around in a snake-like pattern.";
|
||||||
elements.shocker.extraInfo = "Produces sparks when powered.";
|
// elements.shocker.extraInfo = "Produces sparks when powered.";
|
||||||
elements.pressure_plate.extraInfo = "Produces electricity when something is above it.";
|
elements.pressure_plate.extraInfo = "Produces electricity when something is above it.";
|
||||||
elements.light_bulb.extraInfo = "Produces light when powered.";
|
elements.light_bulb.extraInfo = "Produces light when powered.";
|
||||||
elements.tesla_coil.extraInfo = "Produces plasma when powered.";
|
// elements.tesla_coil.extraInfo = "Produces plasma when powered.";
|
||||||
elements.border.extraInfo = "Produces a border effect.";
|
elements.border.extraInfo = "Produces a border effect.";
|
||||||
|
|
|
||||||
|
|
@ -306,9 +306,10 @@ elements.firefly.tick = function(pixel) {
|
||||||
elements.electric.tick = pixel => glowColor(pixel, scaleList(getRandomElement(sparkColors), 0.5));
|
elements.electric.tick = pixel => glowColor(pixel, scaleList(getRandomElement(sparkColors), 0.5));
|
||||||
|
|
||||||
elements.neon.tick = glowItsOwnColorIfPowered;
|
elements.neon.tick = glowItsOwnColorIfPowered;
|
||||||
elements.led_r.tick = glowItsOwnColorIfPowered;
|
elements.led.tick = glowItsOwnColorIfPowered;
|
||||||
elements.led_g.tick = glowItsOwnColorIfPowered;
|
// elements.led_r.tick = glowItsOwnColorIfPowered;
|
||||||
elements.led_b.tick = glowItsOwnColorIfPowered;
|
// elements.led_g.tick = glowItsOwnColorIfPowered;
|
||||||
|
// elements.led_b.tick = glowItsOwnColorIfPowered;
|
||||||
elements.light_bulb.behaviorOn = null;
|
elements.light_bulb.behaviorOn = null;
|
||||||
elements.light_bulb.tick = glowItsOwnColorIfPowered;
|
elements.light_bulb.tick = glowItsOwnColorIfPowered;
|
||||||
elements.sun.tick = glowItsOwnColor;
|
elements.sun.tick = glowItsOwnColor;
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,7 @@ elements.rock.breakInto.push("rock_dust")
|
||||||
|
|
||||||
lightArray = ["fire", "plasma", "cold_fire", "light", "laser", "electric", "radiation", "mystic_fire", "liquid_fire", "liquid_plasma", "liquid_cold_fire", "le_liquid_light", "liquid_laser", "liquid_electric", "liquid_radiation", "liquid_mystic_fire", "magma", "liquid_light", "solid_light"]
|
lightArray = ["fire", "plasma", "cold_fire", "light", "laser", "electric", "radiation", "mystic_fire", "liquid_fire", "liquid_plasma", "liquid_cold_fire", "le_liquid_light", "liquid_laser", "liquid_electric", "liquid_radiation", "liquid_mystic_fire", "magma", "liquid_light", "solid_light"]
|
||||||
|
|
||||||
ledArray = ["led_r", "led_g", "led_b"]
|
ledArray = ["led", "led_r", "led_g", "led_b"]
|
||||||
|
|
||||||
elements.iocalfaeus_gas = {
|
elements.iocalfaeus_gas = {
|
||||||
color: ["#562173", "#481b61"],
|
color: ["#562173", "#481b61"],
|
||||||
|
|
|
||||||
|
|
@ -353,9 +353,10 @@ elements.firefly.tick = function(pixel) {
|
||||||
elements.electric.tick = pixel => glowColor(pixel, scaleList(getRandomElement(sparkColors), 0.5));
|
elements.electric.tick = pixel => glowColor(pixel, scaleList(getRandomElement(sparkColors), 0.5));
|
||||||
|
|
||||||
elements.neon.tick = glowItsOwnColorIfPowered;
|
elements.neon.tick = glowItsOwnColorIfPowered;
|
||||||
elements.led_r.tick = glowItsOwnColorIfPowered;
|
elements.led.tick = glowItsOwnColorIfPowered;
|
||||||
elements.led_g.tick = glowItsOwnColorIfPowered;
|
// elements.led_r.tick = glowItsOwnColorIfPowered;
|
||||||
elements.led_b.tick = glowItsOwnColorIfPowered;
|
// elements.led_g.tick = glowItsOwnColorIfPowered;
|
||||||
|
// elements.led_b.tick = glowItsOwnColorIfPowered;
|
||||||
elements.light_bulb.behaviorOn = null;
|
elements.light_bulb.behaviorOn = null;
|
||||||
elements.light_bulb.tick = glowItsOwnColorIfPowered;
|
elements.light_bulb.tick = glowItsOwnColorIfPowered;
|
||||||
elements.sun.tick = glowItsOwnColor;
|
elements.sun.tick = glowItsOwnColor;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ const FOLLOWUP_COORDS_TO_CHECK = [
|
||||||
];
|
];
|
||||||
|
|
||||||
// Pre-initialize the list of transparent elements
|
// Pre-initialize the list of transparent elements
|
||||||
let transparentElementsTmp = "glass,stained_glass,glass_shard,solid_diamond,ice,led_r,led_g,led_b".split(",");
|
let transparentElementsTmp = "glass,stained_glass,glass_shard,solid_diamond,ice,led".split(",");
|
||||||
let transparentElements = [];
|
let transparentElements = [];
|
||||||
|
|
||||||
// Function to create the list of transparent elements based on their properties
|
// Function to create the list of transparent elements based on their properties
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,12 @@ elems = {
|
||||||
x: "wire",
|
x: "wire",
|
||||||
F: "fuse",
|
F: "fuse",
|
||||||
v: "void",
|
v: "void",
|
||||||
R: "led_r",
|
R: "led",
|
||||||
G: "led_g",
|
G: "led",
|
||||||
B: "led_b",
|
B: "led",
|
||||||
|
// R: "led_r",
|
||||||
|
// G: "led_g",
|
||||||
|
// B: "led_b",
|
||||||
}
|
}
|
||||||
|
|
||||||
schematics = {
|
schematics = {
|
||||||
|
|
|
||||||
|
|
@ -110,35 +110,7 @@ elements.radiation.renderer = function(pixel,ctx) {
|
||||||
drawSquare(ctx,pixel.color,x,y,1,0.25)
|
drawSquare(ctx,pixel.color,x,y,1,0.25)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elements.led_r.renderer = function(pixel,ctx) {
|
elements.led.renderer = function(pixel,ctx) {
|
||||||
var circlec = circleCoords(pixel.x, pixel.y, 3);
|
|
||||||
for (var i = 0; i < circlec.length; i++){
|
|
||||||
var coord = circlec[i];
|
|
||||||
var x = coord.x;
|
|
||||||
var y = coord.y;
|
|
||||||
if (pixel.charge) {
|
|
||||||
drawSquare(ctx,pixel.color,x,y,1,0.5)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
drawSquare(ctx,pixel.color,pixel.x,pixel.y,1,1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elements.led_g.renderer = function(pixel,ctx) {
|
|
||||||
var circlec = circleCoords(pixel.x, pixel.y, 3);
|
|
||||||
for (var i = 0; i < circlec.length; i++){
|
|
||||||
var coord = circlec[i];
|
|
||||||
var x = coord.x;
|
|
||||||
var y = coord.y;
|
|
||||||
if (pixel.charge) {
|
|
||||||
drawSquare(ctx,pixel.color,x,y,1,0.5)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
drawSquare(ctx,pixel.color,pixel.x,pixel.y,1,1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elements.led_b.renderer = function(pixel,ctx) {
|
|
||||||
var circlec = circleCoords(pixel.x, pixel.y, 3);
|
var circlec = circleCoords(pixel.x, pixel.y, 3);
|
||||||
for (var i = 0; i < circlec.length; i++){
|
for (var i = 0; i < circlec.length; i++){
|
||||||
var coord = circlec[i];
|
var coord = circlec[i];
|
||||||
|
|
@ -152,3 +124,45 @@ elements.led_b.renderer = function(pixel,ctx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// elements.led_r.renderer = function(pixel,ctx) {
|
||||||
|
// var circlec = circleCoords(pixel.x, pixel.y, 3);
|
||||||
|
// for (var i = 0; i < circlec.length; i++){
|
||||||
|
// var coord = circlec[i];
|
||||||
|
// var x = coord.x;
|
||||||
|
// var y = coord.y;
|
||||||
|
// if (pixel.charge) {
|
||||||
|
// drawSquare(ctx,pixel.color,x,y,1,0.5)
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// drawSquare(ctx,pixel.color,pixel.x,pixel.y,1,1)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// elements.led_g.renderer = function(pixel,ctx) {
|
||||||
|
// var circlec = circleCoords(pixel.x, pixel.y, 3);
|
||||||
|
// for (var i = 0; i < circlec.length; i++){
|
||||||
|
// var coord = circlec[i];
|
||||||
|
// var x = coord.x;
|
||||||
|
// var y = coord.y;
|
||||||
|
// if (pixel.charge) {
|
||||||
|
// drawSquare(ctx,pixel.color,x,y,1,0.5)
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// drawSquare(ctx,pixel.color,pixel.x,pixel.y,1,1)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// elements.led_b.renderer = function(pixel,ctx) {
|
||||||
|
// var circlec = circleCoords(pixel.x, pixel.y, 3);
|
||||||
|
// for (var i = 0; i < circlec.length; i++){
|
||||||
|
// var coord = circlec[i];
|
||||||
|
// var x = coord.x;
|
||||||
|
// var y = coord.y;
|
||||||
|
// if (pixel.charge) {
|
||||||
|
// drawSquare(ctx,pixel.color,x,y,1,0.5)
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// drawSquare(ctx,pixel.color,pixel.x,pixel.y,1,1)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,7 @@ elements.soul = {
|
||||||
},
|
},
|
||||||
reactions: {
|
reactions: {
|
||||||
"light_bulb": { charged:true, elem2:"explosion" },
|
"light_bulb": { charged:true, elem2:"explosion" },
|
||||||
"led_r": { charged:true, elem2:"explosion" },
|
"led": { charged:true, elem2:"explosion" },
|
||||||
"led_g": { charged:true, elem2:"explosion" },
|
|
||||||
"led_b": { charged:true, elem2:"explosion" },
|
|
||||||
"wire": { charge2:1, chance:0.05 },
|
"wire": { charge2:1, chance:0.05 },
|
||||||
"body": { attr2:{"panic":20} },
|
"body": { attr2:{"panic":20} },
|
||||||
"proton": { elem1:null },
|
"proton": { elem1:null },
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue