extend("fiskheroes:hero_basic");
loadTextures({
    "layer1": "knights:failsafe_layer1",
    "layer2": "knights:failsafe_layer2"
});
var utils = implement("fiskheroes:external/utils");

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

function initEffects(renderer) {
    var color = 0x880808;
    utils.bindCloud(renderer, "fiskheroes:telekinesis", "knights:telekinesis_death");
    var beam = renderer.createResource("BEAM_RENDERER", "fiskheroes:mysterio_beam");
    utils.bindBeam(renderer, "fiskheroes:energy_projection", beam, "body", 0x880808, [{
                "firstPerson": [0.2, 4, -4.0],
                "offset": [0.2, 2, -4.0],
                "size": [5, 1.5]
            },
        ]).setParticles(renderer.createResource("PARTICLE_EMITTER", "fiskheroes:impact_energy_projection"));

        renderer.bindProperty("fiskheroes:opacity").setOpacity((entity, renderLayer) => 0.999);
}
function initAnimations(renderer) {
    parent.initAnimations(renderer);
    utils.addHoverAnimation(renderer, "falcon.HOVER", "fiskheroes:flight/idle/falcon");
    utils.addFlightAnimation(renderer, "falcon.FLIGHT", getFlightAnimation(), (entity, data) => {
        data.load(0, entity.getInterpolatedData("fiskheroes:flight_timer"));
        data.load(1, entity.getInterpolatedData("fiskheroes:flight_boost_timer"));
        data.load(3, entity.getInterpolatedData("fiskheroes:dyn/flight_super_boost_timer"));
    });
    utils.addAnimationEvent(renderer, "FLIGHT_DIVE", "fiskheroes:iron_man_dive");
    utils.addAnimationEvent(renderer, "FLIGHT_DIVE_ROLL", "fiskheroes:falcon_dive_roll");

    addAnimationWithData(renderer, "falcon.ROLL", "fiskheroes:flight/barrel_roll", "fiskheroes:barrel_roll_timer")
    .priority = 10;
}

function getFlightAnimation() {
    return "fiskheroes:flight/falcon.anim.json";
}
