extend("fiskheroes:hero_basic");
loadTextures({
    "layer1": "pack:humantorch_modern_layer1",
    "layer2": "pack:humantorch_modern_layer2",
    "mask": "pack:humantorch_modern_fire",
    "mask_lights": "pack:humantorch_modern_fire",
    "lights": "pack:humantorch_modern_fire",
    "reactor_lights": "pack:layer2",
});

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


var hand_flames;
var head_flames;

function init(renderer) {
    parent.init(renderer);
    renderer.setLights((entity, renderLayer) => {
        if (entity.getData("fiskheroes:mask_open_timer2") ==0) {
            return "mask_lights";
        }
        return !entity.isDisplayStand() && entity.getInterpolatedData("fiskheroes:mask_open_timer2") < 1 ? "reactor_lights" : "reactor_lights";
    });
}


function initEffects(renderer) {

    var fire = renderer.createResource("ICON", "fiskheroes:fire_layer_%s");
    hand_flames = flames.createHands(renderer, fire, true);
    head_flames = flames.createHead(renderer, fire);


    utils.addCameraShake(renderer, 0.015, 1.5, "fiskheroes:flight_boost_timer");
    utils.bindParticles(renderer, "pack:torch").setCondition(entity => entity.getData("fiskheroes:flying"));
}

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

function render(entity, renderLayer, isFirstPersonArm) {
if (renderLayer == "CHESTPLATE" && !entity.isDisplayStand() && entity.isWearingFullSuit()) {
        hand_flames.render(1 - entity.getInterpolatedData("fiskheroes:mask_open_timer2"));
        if (!isFirstPersonArm) {
            head_flames.render(1 - entity.getInterpolatedData("fiskheroes:mask_open_timer2"));
			 
        }
    }
}







