extend("fiskheroes:hero_basic");
loadTextures({
    "layer1": "dc:batgirl_layer1",
    "layer2": "dc:batgirl_layer2",
    "cape": "dc:batgirl_cape"
});
var capes = implement("fiskheroes:external/capes");
var chest;
var cape;

function initEffects(renderer) {
    chest = renderer.createEffect("fiskheroes:chest");
    chest.setExtrude(1.43).setYOffset(1.1);

    var physics = renderer.createResource("CAPE_PHYSICS", null);
    physics.maxFlare = 0.4;
    physics.flareDegree = 1.5;
    physics.flareFactor = 1.2;
    physics.flareElasticity = 5;

cape = capes.createGlider(renderer, 19, "fiskheroes:cape_batman.mesh.json", physics);
cape.effect.texture.set("cape");
cape.effect.width = 12;

    renderer.bindProperty("fiskheroes:equipment_wheel").color.set(0x000000);
    renderer.bindProperty("fiskheroes:equipped_item").setItems([
        { "anchor": "body", "scale": 0.7, "offset": [4.5, 10.5, 0.4], "rotation": [110.0, 5.0, 0.0] }
    ]).slotIndex = 0;
}

function render(entity, renderLayer, isFirstPersonArm) {
    if (renderLayer == "CHESTPLATE") {
        if (!isFirstPersonArm) {
            cape.render(entity, entity.getInterpolatedData("fiskheroes:wing_animation_timer"));
        }
    }
    if (!isFirstPersonArm && renderLayer == "CHESTPLATE") {
        chest.render();
    }
}
