extend("fiskheroes:hero_basic");
loadTextures({
    "layer1": "tgheroes:stature/stature_layer1",
    "layer2": "tgheroes:stature/stature_layer2"
});

var chest;

function init(renderer) {
    parent.init(renderer);
	renderer.setTexture((entity, renderLayer) => renderLayer == "LEGGINGS" ? "layer2" : renderLayer == "HELMET" && entity.getData("fiskheroes:mask_open_timer") > 0 ? "mask" : "layer1");
}

function initEffects(renderer) {
    chest = renderer.createEffect("fiskheroes:chest");
    chest.setExtrude(0.8).setYOffset(1);

}

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