extend("skarlet:green_goblin");
loadTextures({
    "layer1": "skarlet:green_goblin/green_goblin_upgraded_layer1",
    "mask": "skarlet:green_goblin/green_goblin_upgraded_mask",
    "layer2": "skarlet:green_goblin/green_goblin_upgraded_layer2",
    "glider": "skarlet:green_goblin/goblin_glider_upgraded",
    "glider_lights": "skarlet:green_goblin/goblin_glider_upgraded_lights",
    "glider_booster": "skarlet:green_goblin/goblin_glider_boosters.tx.json"
});

function init(renderer) {
    parent.init(renderer);
    renderer.setTexture((entity, renderLayer) => {
        if ((renderLayer == "HELMET" || renderLayer == "CHESTPLATE") && (entity.isDisplayStand() || entity.isBookPlayer() ? entity.getData("fiskheroes:mask_open") : entity.getData("fiskheroes:mask_open_timer2") > 0.35)) {
            return "mask";
        }
        return renderLayer == "LEGGINGS" ? "layer2" : "layer1";
    });
}

function initAnimations(renderer) {
    parent.initAnimations(renderer);
	
    addAnimation(renderer, "spiderman.MASK", "fiskheroes:remove_cowl")
        .setData((entity, data) => {
            var f = entity.getInterpolatedData("fiskheroes:mask_open_timer2");
            data.load(f < 1 ? f : 0);
        }).priority = 10;
}

function getGliderModel() {
    return "skarlet:goblin_glider_upgraded";
}

function hasEyesMask() {
    return false;
}

function hasEars() {
    return false;
}