extend("gowhp:kratos_ragnarok");
loadTextures({
    "layer1": "gowhp:kratos/kratos_ragnarok_armor_cloakoftheblackbear_layer1",
    "layer2": "gowhp:kratos/kratos_ragnarok_armor_cloakoftheblackbear_layer2",
    "cloak": "gowhp:kratos/kratos_ragnarok_cloakoftheblackbear"
});

var capes = implement("fiskheroes:external/capes");

function init(renderer) {
    parent.init(renderer);
}

function initAnimations(renderer) {
    parent.initAnimations(renderer);
}

function initEffects(renderer) {
    parent.initEffects(renderer);

    var physics = renderer.createResource("CAPE_PHYSICS", null);
    physics.weight = 5.0;
    physics.maxFlare = 0.1;
    physics.flareDegree = 0.1;
    physics.flareFactor = 0.1;
    physics.flareElasticity = 1;

    cape = capes.createDefault(renderer, 26, "gowhp:cloak.mesh.json", physics);
    cape.effect.texture.set("cloak");
    cape.effect.width = 16;
}

function render(entity, renderLayer, isFirstPersonArm) {
    parent.render(entity, renderLayer, isFirstPersonArm);
    if (!isFirstPersonArm && renderLayer == "CHESTPLATE") {
        cape.render(entity);
    }
}