extend("fiskheroes:spider_man_base");
loadTextures({
    "layer1": "skarredheroes:2099/2099_layer1",
    "layer2": "skarredheroes:2099/2099_layer2",
    "layer1_lights": "skarredheroes:2099/2099_layer1_lights",
    "layer2_lights": "skarredheroes:2099/2099_layer2_lights",
    "claws": "skarredheroes:2099/2099_claws",
    "web_wings": "fiskheroes:spider_man_wings"
});

var overlay;
var web_wings;

function init(renderer) {
    parent.init(renderer);
    renderer.setLights((entity, renderLayer) => renderLayer == "LEGGINGS" ? "layer2_lights" : "layer1_lights");
}

function initEffects(renderer) {
    web_wings = renderer.createEffect("fiskheroes:wingsuit");
    web_wings.texture.set("web_wings");
    web_wings.opacity = 0.99;
    overlay = renderer.createEffect("fiskheroes:overlay");
    overlay.texture.set(null, "claws");

    renderer.bindProperty("fiskheroes:equipment_wheel").color.set(0x00DAFF);
}

function render(entity, renderLayer, isFirstPersonArm) {
    if (!isFirstPersonArm && renderLayer == "CHESTPLATE") {
        web_wings.unfold = entity.getInterpolatedData("fiskheroes:wing_animation_timer");
        web_wings.render();
    }
    if (renderLayer == "CHESTPLATE" && entity.getData("fiskheroes:blade")) {
        overlay.render();
    }
}
