extend("fiskheroes:hero_basic");
loadTextures({
	"hair": "tgheroes:kitty/kitty_hair",
	"suit": "tgheroes:kitty/kitty_suit",
    "leggings": "tgheroes:kitty/kitty_legs",
    "boots": "tgheroes:kitty/kitty_boots",
	"suit_hair": "tgheroes:kitty/kitty_suit_hair"
});
var chest;
var utils = implement("fiskheroes:external/utils");

function init(renderer) {
    parent.init(renderer);
    renderer.setTexture((entity, renderLayer) => {
        if (renderLayer == "CHESTPLATE") {
            return entity.getWornHelmet().suitType() == $SUIT_NAME ? "suit_hair" : "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.setOpacityWithData(renderer, 0.5, 1.0, "fiskheroes:intangibility_timer");
    chest = renderer.createEffect("fiskheroes:chest");
    chest.setExtrude(0.9).setYOffset(1);
}

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