extend("fiskheroes:hero_basic");
loadTextures({
    "layer1": "pack:jubilee_layer1",
    "layer2": "pack:jubilee_layer2"
});

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


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

	var laser = renderer.createResource("BEAM_RENDERER", "fiskheroes:mysterio_beam");


    utils.bindBeam(renderer, "fiskheroes:charged_beam", "fiskheroes:mysterio_beam", "rightArm", 0xfafc7e, [
	       {  "firstPerson": [-3.75, 3.0, -8.0], "offset":  [0.5, 6.0, 0.0],  "size": [2.5, 2.5]},
        {  "firstPerson": [3.75, 3.0, -8.0], "offset":  [0.5, 6.0, 0.0], "size": [2.5, 2.5], "anchor": "leftArm" } 
       
    ]).setParticles(renderer.createResource("PARTICLE_EMITTER", "fiskheroes:impact_charged_beam"));

    utils.bindBeam(renderer, "fiskheroes:charged_beam", "fiskheroes:charged_beam", "rightArm", 0xdb03fc, [
	         {  "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"));





   chest = renderer.createEffect("fiskheroes:chest");
    chest.setExtrude(0.5).setYOffset(1);


  
}
function initAnimations(renderer) {
    parent.initAnimations(renderer);
    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();
        }       
    }
}  
