extend("fiskheroes:hero_basic");
loadTextures({
    "layer1": "tgheroes:scarlet_scarab/scarletscarabnoskin/scarletscarab_noskin_layer1",
    "layer2": "tgheroes:scarlet_scarab/scarletscarab/scarletscarab_layer2",
    "wings": "tgheroes:scarlet_scarab/scarletscarab/scarletscarab_wings"
});

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


function initEffects(renderer) {
    chest = renderer.createEffect("fiskheroes:chest");
    chest.setExtrude(1).setYOffset(1);
    
	wings = renderer.createEffect("fiskheroes:wings").setYOffset(-1);
    wings.texture.set("wings");
    wings.anchor.set("body");
}


function render(entity, renderLayer, isFirstPersonArm) {
    if (!isFirstPersonArm && renderLayer == "CHESTPLATE") {
        chest.render();
    }
	if (renderLayer == "CHESTPLATE") {
        wings.unfold = entity.getInterpolatedData("fiskheroes:wing_animation_timer");
		wings.shieldUnfold = entity.getInterpolatedData("fiskheroes:shield_blocking_timer");
        wings.render();
	}
}

