extend("fiskheroes:hero_basic");
loadTextures({
	"hair": "tgheroes:gambit/gambit_hair",
	"coat": "tgheroes:gambit/gambit_coat",
    "leggings": "tgheroes:gambit/gambit_layer2",
    "boots": "tgheroes:gambit/gambit_boots"
});

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 ? "coat" : "coat";
        }
	    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.bindBeam(renderer, "fiskheroes:energy_manipulation", "fiskheroes:energy_discharge", "rightArm", 0x9400d3, [
        { "firstPerson": [-2.5, 0.0, -7.0], "offset": [-0.5, 19.0, -12.0], "size": [1.5, 1.5] }
    ]);

    renderer.bindProperty("fiskheroes:equipped_item").setItems([
        { "anchor": "body", "scale": 0.55, "offset": [0.5, 4.5, 3.0], "rotation": [0.0, -90.0, 35.0] }
    ]);
}

