extend("fiskheroes:hero_basic");
loadTextures({
    "hair": "tgheroes:hawkeye/kate/kate_hair",
	"suit": "tgheroes:hawkeye/kate/kate_suit",
    "leggings": "tgheroes:hawkeye/kate/kate_legs",
    "boots": "tgheroes:hawkeye/kate/kate_boots",
    "arrow": "tgheroes:hawkeye/series/hawkeye_series",
    "quiver": "tgheroes:hawkeye/series/quiver_series"
});

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

function init(renderer) {
    parent.init(renderer);
    renderer.setTexture((entity, renderLayer) => {
        if (renderLayer == "CHESTPLATE") {
            return entity.getWornHelmet().suitType() == $SUIT_NAME ? "suit" : "suit";
        }
	    else if (renderLayer == "LEGGINGS") {
            return entity.getWornChestplate().suitType() == $SUIT_NAME ? "leggings" : "leggings";
		}
        return renderLayer == "HELMET" ? "hair" : "boots" 
    });

    renderer.showModel("HELMET", "head", "headwear", "body");
    renderer.showModel("CHESTPLATE", "body", "rightArm", "leftArm", "rightLeg", "leftLeg");
}

function initEffects(renderer) {
    utils.addLivery(renderer, "ARROW", "arrow");
    utils.addLivery(renderer, "QUIVER", "quiver");
	chest = renderer.createEffect("fiskheroes:chest");
    chest.setExtrude(0.9).setYOffset(1);
}

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