extend("fiskheroes:hero_basic");
loadTextures({
    "layer1": "tgheroes:gwen_pool/gwenpoolnoskin/gwenpool_noskin_layer1",
    "layer2": "tgheroes:gwen_pool/gwenpoolnoskin/gwenpool_noskin_layer2",
    "scabbard": "fiskheroes:deadpool_xmen_scabbard",
    "katana": "tgheroes:gwen_pool/gwenpool/gwenpool_katana",
    "gun": "fiskheroes:deadpool_xmen_gun"
});

var utils = implement("fiskheroes:external/utils");

var scabbard;

var chest;

function init(renderer) {
    parent.init(renderer);
}

function initEffects(renderer) {
    scabbard = renderer.createEffect("fiskheroes:model");
    scabbard.setModel(utils.createModel(renderer, "fiskheroes:deadpool_scabbard", "scabbard"));
    scabbard.anchor.set("body");

    chest = renderer.createEffect("fiskheroes:chest");
    chest.setExtrude(1).setYOffset(1);
	
    utils.addLivery(renderer, "KATANA", "katana");
    utils.addLivery(renderer, "DESERT_EAGLE", "gun");

    renderer.bindProperty("fiskheroes:equipped_item").setItems([
        { "anchor": "body", "scale": 0.535, "offset": [-3.05, 0.52, 3.0], "rotation": [-148.0, 90.0, 0.0] },
        { "anchor": "body", "scale": 0.535, "offset": [3.05, 0.52, 3.0], "rotation": [-148.0, -90.0, 0.0] }
    ]).slotIndex = 0;
    renderer.bindProperty("fiskheroes:equipped_item").setItems([
        { "anchor": "rightLeg", "scale": 0.7, "offset": [-2.4, 0.5, 1.25], "rotation": [90.0, 0.0, 0.0] },
        { "anchor": "leftLeg", "scale": 0.7, "offset": [2.4, 0.5, 1.25], "rotation": [90.0, 0.0, 0.0] }
    ]).slotIndex = 1;
}

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

}