Merge branch 'R74nCom:main' into main
This commit is contained in:
commit
ff4ea410a8
File diff suppressed because it is too large
Load Diff
104
mods/heatglow.js
104
mods/heatglow.js
|
|
@ -52,53 +52,57 @@ elements.color_baker = {
|
||||||
excludeRandom: true,
|
excludeRandom: true,
|
||||||
desc: "Use to bake a metals paint color into its 'true' color, for heating purposes.",
|
desc: "Use to bake a metals paint color into its 'true' color, for heating purposes.",
|
||||||
}
|
}
|
||||||
//const plantfunc = function(pixel){
|
/*
|
||||||
// if (pixel.ogR == null || pixel.ogG == null || pixel.ogB == null){
|
function weightedAverage(num1, num2, weight){
|
||||||
// pixel.ogR = parseInt(pixel.color.slice(4, pixel.color.indexOf(',')), 10)
|
return ((weight * num1)+((1-weight)*num2))
|
||||||
// pixel.ogG = parseInt(pixel.color.slice(pixel.color.indexOf(',') + 1, pixel.color.lastIndexOf(',')), 10)
|
}
|
||||||
// pixel.ogB = parseInt(pixel.color.slice(pixel.color.lastIndexOf(',') + 1, -1), 10)
|
const plantfunc = function(pixel){
|
||||||
// pixel.deadR = 130;
|
if (pixel.ogR == null || pixel.ogG == null || pixel.ogB == null){
|
||||||
// pixel.deadG = 103;
|
pixel.ogR = parseInt(pixel.color.slice(4, pixel.color.indexOf(',')), 10)
|
||||||
// pixel.deadB = 40;
|
pixel.ogG = parseInt(pixel.color.slice(pixel.color.indexOf(',') + 1, pixel.color.lastIndexOf(',')), 10)
|
||||||
// pixel.burnR = 30;
|
pixel.ogB = parseInt(pixel.color.slice(pixel.color.lastIndexOf(',') + 1, -1), 10)
|
||||||
// pixel.burnG = 30;
|
var deadR = 130;
|
||||||
// pixel.burnB = 30;
|
var deadG = 103;
|
||||||
// }else{
|
var deadB = 40;
|
||||||
// pixel.gethigh = (elements[pixel.element].tempHigh)
|
var burnR = 30;
|
||||||
// pixel.halftemp = ((20+pixel.gethigh)/2)
|
var burnG = 30;
|
||||||
// if (pixel.temp <= (pixel.gethigh) - pixel.halftemp){
|
var burnB = 30;
|
||||||
// pixel.ctemp = 0;
|
var newR = pixel.ogR;
|
||||||
// pixel.twoctemp = 0,
|
var newG = pixel.ogG;
|
||||||
// pixel.littlectemp = 1;
|
var newB = pixel.ogB;
|
||||||
// } else if (pixel.temp > (pixel.gethigh)-pixel.halftemp && pixel.temp <= pixel.gethigh){
|
}else{
|
||||||
// pixel.ctemp = ((1/pixel.halftemp)*pixel.temp)-(((pixel.gethigh)-pixel.halftemp)/pixel.halftemp);
|
var gethigh = (elements[pixel.element].tempHigh)
|
||||||
// pixel.twoctemp = pixel.ctemp*2;
|
var halftemp = ((20+gethigh)/2)
|
||||||
// pixel.littlectemp = 2*(1-(pixel.ctemp));
|
if (pixel.temp > halftemp){
|
||||||
// }
|
var ctemp = ((1/halftemp)*pixel.temp)-(((gethigh)-halftemp)/halftemp);
|
||||||
// if (pixel.ctemp <= 0.5){
|
} else (ctemp = 0)
|
||||||
// pixel.newR = ((pixel.twoctemp*pixel.deadR)+(pixel.littlectemp*pixel.ogR)/(pixel.twoctemp+pixel.littlectemp));
|
if (ctemp <= 0.5 && ctemp > 0){
|
||||||
// pixel.newG = ((pixel.twoctemp*pixel.deadG)+(pixel.littlectemp*pixel.ogG)/(pixel.twoctemp+pixel.littlectemp));
|
newR = weightedAverage(deadR, pixel.ogR, 2*ctemp);
|
||||||
// pixel.newB = ((pixel.twoctemp*pixel.deadB)+(pixel.littlectemp*pixel.ogB)/(pixel.twoctemp+pixel.littlectemp));
|
newG = weightedAverage(deadG, pixel.ogG, 2*ctemp);
|
||||||
// }else if (pixel.ctemp > 0.5){
|
newB = weightedAverage(deadB, pixel.ogB, 2*ctemp);
|
||||||
// pixel.newR = (((pixel.twoctemp*pixel.deadR)+(pixel.littlectemp*pixel.burnR))/(pixel.twoctemp*pixel.littlectemp));
|
}else if (ctemp > 0.5){
|
||||||
// pixel.newG = (((pixel.twoctemp*pixel.deadG)+(pixel.littlectemp*pixel.burnG))/(pixel.twoctemp*pixel.littlectemp));
|
var modctemp = 2*(ctemp%0.5)
|
||||||
// pixel.newB= (((pixel.twoctemp*pixel.deadB)+(pixel.littlectemp*pixel.burnB))/(pixel.twoctemp*pixel.littlectemp));
|
newR = weightedAverage(burnR, deadR, 2*modctemp);
|
||||||
// }
|
newG = weightedAverage(burnG, deadG, 2*modctemp);
|
||||||
// pixel.color = "rgb(" + pixel.newR + "," + pixel.newG + "," + pixel.newB + ")";
|
newB = weightedAverage(burnB, deadB, 2*modctemp);
|
||||||
// }
|
}
|
||||||
// };
|
if (!ctemp == 0){
|
||||||
// if (!eLists.burnplants) { eLists.burnplants = [] }
|
pixel.color = "rgb(" + newR + "," + newG + "," + newB + ")";
|
||||||
// eLists.burnplants = eLists.burnplants.concat(["plant","dead_plant","grass","algae","sapling","evergreen","cactus","seeds","grass_seed","wheat_seed","flower_seed","pistil","petal","tree_branch","bamboo_plant","mushroom_spore","mushroom_stalk","mushroom_gill","mushroom_cap","hyphae","pumpkin_seed","pumpkin","corn","corn_seed","potato","potato_seed","root"])
|
} else {pixel.color = "rgb(" + pixel.ogR + "," + pixel.ogG + "," + pixel.ogB + ")"}
|
||||||
//eLists.burnplants.forEach(plant => {
|
}
|
||||||
// const prefunc = elements[plant].tick;
|
};
|
||||||
// if (!prefunc){
|
if (!eLists.burnplants) { eLists.burnplants = [] }
|
||||||
// elements[plant].tick = plantfunc;
|
eLists.burnplants = eLists.burnplants.concat(["plant","dead_plant","grass","algae","sapling","evergreen","cactus","seeds","grass_seed","wheat_seed","flower_seed","pistil","petal","tree_branch","bamboo_plant","mushroom_spore","mushroom_stalk","mushroom_gill","mushroom_cap","hyphae","pumpkin_seed","pumpkin","corn","corn_seed","potato","potato_seed","root"])
|
||||||
// }else{
|
eLists.burnplants.forEach(plant => {
|
||||||
// const modfunc = function(pixel){
|
const prefunc = elements[plant].tick;
|
||||||
// prefunc(pixel);
|
if (!prefunc){
|
||||||
// plantfunc(pixel);
|
elements[plant].tick = plantfunc;
|
||||||
// };
|
}else{
|
||||||
// elements[plant].tick = modfunc;
|
const modfunc = function(pixel){
|
||||||
// }
|
prefunc(pixel);
|
||||||
//});
|
plantfunc(pixel);
|
||||||
|
};
|
||||||
|
elements[plant].tick = modfunc;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
|
@ -1613,11 +1613,7 @@ elements.molten_bismuth = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
changePixel(pixel, "bismuth")
|
changePixel(pixel, "bismuth")
|
||||||
if (1 == 1){
|
var rgbResult = HSVtoRGB(pixel.tHue + 0.08, 0.5, 0.9);
|
||||||
var rgbResult = HSVtoRGB(pixel.tHue + 0.02, 0.8, 0.8);
|
|
||||||
} else {
|
|
||||||
var rgbResult = HSVtoRGB(pixel.tHue, 0.8, 0.8);
|
|
||||||
}
|
|
||||||
const hexR = rgbResult.r.toString(16).padStart(2, '0');
|
const hexR = rgbResult.r.toString(16).padStart(2, '0');
|
||||||
const hexG = rgbResult.g.toString(16).padStart(2, '0');
|
const hexG = rgbResult.g.toString(16).padStart(2, '0');
|
||||||
const hexB = rgbResult.b.toString(16).padStart(2, '0');
|
const hexB = rgbResult.b.toString(16).padStart(2, '0');
|
||||||
|
|
@ -2040,3 +2036,38 @@ elements.element_filler = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var outlinerVar = 0
|
||||||
|
elements.outliner = {
|
||||||
|
color: elements.filler.color,
|
||||||
|
category: elements.filler.category,
|
||||||
|
onSelect: function() {
|
||||||
|
var answerot = prompt("Please input the desired element of this outliner. It will not work if you do multiple filter types while paused.",(outlinerVar||undefined));
|
||||||
|
if (!answerot) { return }
|
||||||
|
outlinerVar = mostSimilarElement(answerot);
|
||||||
|
},
|
||||||
|
tick: function(pixel){
|
||||||
|
var neighbors = 0;
|
||||||
|
if(!pixel.changeElem){
|
||||||
|
pixel.changeElem = outlinerVar;
|
||||||
|
if (pixel.nDelete == undefined){
|
||||||
|
pixel.nDelete = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pixel.nDelete){
|
||||||
|
deletePixel(pixel.x, pixel.y)
|
||||||
|
}
|
||||||
|
for (var i = 0; i < squareCoords.length; i++) {
|
||||||
|
var coord = squareCoords[i];
|
||||||
|
var x = pixel.x+coord[0];
|
||||||
|
var y = pixel.y+coord[1];
|
||||||
|
if (!isEmpty(x,y, true)) {
|
||||||
|
neighbors = neighbors + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (neighbors >= 8){
|
||||||
|
pixel.nDelete = true
|
||||||
|
} else {
|
||||||
|
changePixel(pixel, pixel.changeElem)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue