Create AlchemyRandom.js

This commit is contained in:
MarbleTC3 2025-06-02 12:37:19 -07:00 committed by GitHub
parent e9a8c78e02
commit d9989f0a33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 18 additions and 0 deletions

18
mods/AlchemyRandom.js Normal file
View File

@ -0,0 +1,18 @@
elements.randomdiscovered = {
color: ["#ffffff", "#dddddd", "#eeeeee"],
tick: function(pixel) {
if (!pixel.start) {
const discovered = Object.keys(elements).filter(name => discoveredElements.includes(name));
if (discovered.length > 0) {
const randomElem = discovered[Math.floor(Math.random() * discovered.length)];
changePixel(pixel, randomElem);
}
pixel.start = true;
}
},
category: "random",
state: "solid",
density: 1000,
excludeRandom: true
};