extend("fiskheroes:hero_basic");
loadTextures({
	"hair": "tgheroes:jessica_jones/jess_hair",
	"jacket": "tgheroes:jessica_jones/jess_suit",
    "jeans": "tgheroes:jessica_jones/jess_jeans",
    "boots": "tgheroes:jessica_jones/jess_boots",
	"jacket_hair": "tgheroes:jessica_jones/jess_suit_hair"
});

var chest;

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

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

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

}

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