extend("fiskheroes:hero_basic");
loadTextures({
	"hair": "tgheroes:white_tiger/whitetiger/whitetiger_mask",
	"suit": "tgheroes:white_tiger/whitetiger/whitetiger_suit",
    "leggings": "tgheroes:white_tiger/whitetiger/whitetiger_leggings",
    "boots": "tgheroes:white_tiger/whitetiger/whitetiger_boots",
    "claws": "tgheroes:white_tiger/whitetiger/white_tiger_claws"
});

var overlay;

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" : "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) {
    overlay = renderer.createEffect("fiskheroes:overlay");
    overlay.texture.set("claws");
	
    chest = renderer.createEffect("fiskheroes:chest");
    chest.setExtrude(1).setYOffset(1); 
}

function render(entity, renderLayer, isFirstPersonArm) {
    if (renderLayer == "CHESTPLATE" && entity.getData("fiskheroes:blade")) {
        overlay.render(); chest.render();

    };
	if (!isFirstPersonArm) {
            chest.render();
        }
	
}

