dfdao / dfdao.github.io

Public Utils and Plugins from dfdao
2 stars 3 forks source link

Find Artifact metadata to add Mythic Artifacts to the gallery #17

Open Velorum6 opened 2 years ago

Velorum6 commented 2 years ago

there are some empty boxes in the gallery design, there was planned to have there some Mythic artifacts but we don't know how to get the metadata / media files of it

Bulmenisaurus commented 2 years ago

Here is how to get the image files (you can paste this into an empty tab or whatever)


const base = `https://d2wspbczt15cqu.cloudfront.net/v0.6.0-artifacts`;
const artifactImage = (
    artifactName, // one of  "Unknown", "Monolith", "Colossus", "Spaceship", "Pyramid", "Wormhole", "Planetary Shield", "Black Domain", "Photoid Cannon", "Bloom Filter",
    artifactRarity, // one of "Unknown", "Common", "Rare", "Epic", "Legendary", "Mythic"
    biome, // one of "Unknown", "Ocean", "Forest", "Grassland", "Tundra", "Swamp", "Desert", "Ice", "Wasteland", "Lava", "Corrupted";
    big = true,
    ancient = false
) => {
    const biomeLabels = [
        'Unknown',
        'Ocean',
        'Forest',
        'Grassland',
        'Tundra',
        'Swamp',
        'Desert',
        'Ice',
        'Wasteland',
        'Lava',
        'Corrupted',
    ];

    const size = big ? 64 : 16;
    const biomeText = ancient ? `ancient` : `${biomeLabels.indexOf(biome)}${biome}`;

    return `${base}/${size}-${artifactName}-${artifactRarity}-${biomeText}.webm`;
};

so for example if I wanted to get a rare forest monolith, I would do:

console.log(artifactImage('Monolith', 'Rare', 'Forest'))

source: @darkforest_eth/gamelogic

Velorum6 commented 2 years ago

This is so helpful, we can add artifacts to the gallery with this