extend("fiskheroes:hero_basic");
loadTextures({
	"hair": "tgheroes:jessica_jones/jess_wig",
	"jacket": "tgheroes:jessica_jones/jess_suit2",
    "jeans": "tgheroes:jessica_jones/jess_jeans2",
    "boots": "tgheroes:jessica_jones/jess_boots",
	"jacket_hair": "tgheroes:jessica_jones/jess_suit_hair2"
});

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();
    }
}