extend("fiskheroes:hero_basic");
loadTextures({
    "layer1": "pack:storm_bloodstorm_layer1",
    "layer2": "pack:storm_bloodstorm_layer2"
});

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



var chest;

var overlay;


  function initEffects(renderer) {


chest = renderer.createEffect("fiskheroes:chest");
    chest.setExtrude(0.75).setYOffset(1);
    // Charged Beam
    utils.bindBeam(renderer, "fiskheroes:charged_beam", "fiskheroes:mysterio_beam", "rightArm", 0x8EBBFF, [
	
        {  "firstPerson": [-3.75, 3.0, -8.0], "offset":  [0, 6.0, 0.0], "size": [1.5, 1.5] },
        {  "firstPerson": [3.75, 3.0, -8.0], "offset":  [0, 6.0, 0.0], "size": [1.5, 1.5], "anchor": "leftArm" }
       
    ]).setParticles(renderer.createResource("PARTICLE_EMITTER", "fiskheroes:impact_charged_beam"));

    // Energy Projection
    utils.bindBeam(renderer, "fiskheroes:energy_projection", "fiskheroes:charged_beam", "head", 0xFFFFFF, [
     { "offset": [0.0, 5.0, -22.0], "size": [15.0, 15.0] }
    ])
}

function initAnimations(renderer) {
    parent.initAnimations(renderer);
    utils.addFlightAnimation(renderer, "vision.FLIGHT", "fiskheroes:flight/default.anim.json");
    utils.addHoverAnimation(renderer, "vision.HOVER", "fiskheroes:flight/idle/neutral");
addAnimation(renderer, "basic.CHARGED_BEAM", "fiskheroes:dual_aiming").setData((entity, data) => data.load(Math.max(entity.getInterpolatedData("fiskheroes:beam_charge") * 5 - 4, 0)));

}

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