extend("fiskheroes:hero_basic");
loadTextures({
    "layer1": "soulhp:adamwarlock_layer1",
    "layer2": "soulhp:adamwarlock_layer2",
});

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

function initEffects(renderer) {

    utils.bindCloud(renderer, "fiskheroes:teleportation", "soulhp:adamwarlock");
    utils.bindCloud(renderer, "fiskheroes:telekinesis", "soulhp:telekinesis_adamwarlock");
    utils.bindBeam(renderer, "fiskheroes:energy_manipulation", "fiskheroes:energy_discharge", "rightArm", 0xFFF1A8, [
        { "firstPerson": [-2.5, 0.0, -7.0], "offset": [0.0, 0.0, 0.0], "size": [0.5, 0.5] }
    ]);


renderer.setItemIcons("%s_0", "%s_1", "%s_2", "%s_3");
renderer.showModel("CHESTPLATE", "body", "rightArm", "leftArm");
renderer.showModel("LEGGINGS", "rightLeg", "leftLeg");
renderer.showModel("BOOTS", "rightLeg", "leftLeg");

utils.bindParticles(renderer, "fiskheroes:impact_antimatter").setCondition(entity => entity.getData("fiskheroes:flight_boost_timer") == 0.5);


}


function initAnimations(renderer) {
    parent.initAnimations(renderer);
    addAnimation(renderer, "iron_man.FLIGHT", "soulhp:blackadamflight")
        .setData((entity, data) => {
            data.load(0, entity.getInterpolatedData("fiskheroes:flight_timer") * (1 - entity.getInterpolatedData("fiskheroes:dyn/superhero_landing_timer")));
            data.load(1, entity.getInterpolatedData("fiskheroes:flight_boost_timer"));
        })
        .priority = -10;
    
    addAnimationWithData(renderer, "iron_man.LAND", "soulhp:supermanland", "fiskheroes:dyn/superhero_landing_timer")
        .priority = -8;
    
    renderer.reprioritizeDefaultAnimation("PUNCH", -9);
    renderer.reprioritizeDefaultAnimation("AIM_BOW", -9);
}
