Wet concrete color change, less water use
This commit is contained in:
parent
7dd1e9dbd2
commit
0513aade3a
|
|
@ -2414,6 +2414,7 @@ if(!enabledMods.includes(libraryMod)) {
|
|||
elements.concrete.tick = function(pixel) {
|
||||
pixel.composition ??= "mafic";
|
||||
pixel.wet ??= (Math.random() < 0.03);
|
||||
pixel.didWetColorChange ??= false;
|
||||
pixel.didColorChange ??= 0;
|
||||
pixel.lastTemperatures ??= [];
|
||||
|
||||
|
|
@ -2428,6 +2429,12 @@ if(!enabledMods.includes(libraryMod)) {
|
|||
var magmaName = (pixel.composition == "mafic") ? "magma" : pixel.composition + "_magma";
|
||||
var magmaTempHigh = Math.max(...Object.values(elements[magmaName]._magmaCoolingPassToElement.meltingPoints));
|
||||
|
||||
if(pixel.wet && !pixel.didWetColorChange) {
|
||||
var colorWasHSL = pixel.color.startsWith("hsl");
|
||||
pixel.color = changeLuminance(pixel.color,11,"-",colorWasHSL ? "hsl" : "rgb");
|
||||
pixel.didWetColorChange = true;
|
||||
};
|
||||
|
||||
//console.log(pixel.temp,pixel.didColorChange);
|
||||
if(pixel.temp > 300 && pixel.didColorChange < 1) {
|
||||
if(Math.random() < 0.02) { breakPixel(pixel) };
|
||||
|
|
@ -2527,7 +2534,7 @@ if(!enabledMods.includes(libraryMod)) {
|
|||
if(newPixel?.element) {
|
||||
if(newPixel.element == "water") {
|
||||
pixel.wet = true;
|
||||
deletePixel(newPixel.x,newPixel.y);
|
||||
if(Math.random() < 1/4) { deletePixel(newPixel.x,newPixel.y) };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue