   extend("fiskheroes:hero_basic");
loadTextures({
    "layer1": "mk:raiden_layer1",
    "layer2": "mk:raiden_layer2",
    "lights": "mk:raiden_lights",
    "hat": "mk:raiden_hat",
    "staff": "mk:raiden_staff"
});

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

var glow;
var spell;

function initEffects(renderer) {
    //Trail... Like lightning thing behind
    utils.bindTrail(renderer, "tr:raiden_no_flicker").setCondition(entity => entity.getData("fiskheroes:flying"));
    glow = renderer.createEffect("fiskheroes:glowerlay");
    glow.color.set(0x2EBAEC);
    //Electric Beam (Charged)
    utils.setOpacityWithData;
    utils.bindBeam(renderer, "fiskheroes:energy_manipulation", "fiskheroes:energy_discharge", "rightArm",0x2EBAEC, [
        { "firstPerson": [-2.5, 0.0, -7.0], "offset": [0.0, 0.0, 0.0], "size": [0.5, 0.5] }
    ]);

//Lightning
    utils.bindBeam(renderer, "fiskheroes:lightning_cast", "fiskheroes:lightning_cast", "rightArm",0x2EBAEC, [
        { "firstPerson": [-8.0, 4.5, -10.0], "offset": [-0.5, 9.0, 0.0], "size": [0.75, 0.75] }
    ]);

    //Raiden's staff

    var livery = renderer.bindProperty("fiskheroes:livery");
    livery.texture.set("staff");
    livery.weaponType = "BO_STAFF";


    //Hat
    renderer.setTexture((_entity, renderLayer) => renderLayer == "HELMET" ? "hat": renderLayer == "LEGGINGS" ? "layer2" : "layer1");

    //Lightning Power
    var magic = renderer.bindProperty("fiskheroes:spellcasting");
    magic.colorEarthCrack.set(0x2EBAEC);
    magic.colorWhip.set(0x2EBAEC);
} 
    
    function init(renderer) {
        parent.init(renderer);
    renderer.setLights((_entity, renderLayer) => renderLayer == "HELMET" ? "lights" : null);
    }
    //Glow Teleport and render things
    function render(entity, _renderLayer, _isFirstPersonArm) {
        var teleport = entity.getInterpolatedData("fiskheroes:teleport_timer");
    
        glow.opacity = teleport;
        glow.render();
    }

    function initAnimations(renderer) {
        parent.initAnimations(renderer);
        utils.addFlightAnimation(renderer, "lightning.FLIGHT", "fiskheroes:flight/propelled_hands.anim.json");
        utils.addHoverAnimation(renderer, "lightning.HOVER", "fiskheroes:flight/idle/propelled_hands");
    }
    
