extend("fiskheroes:hero_basic");
loadTextures({
    "layer1": "tgheroes:guardians/rocket_comics1",
    "layer2": "tgheroes:guardians/rocket_comics2",
    "tail": "tgheroes:guardians/raccon_tail"
});

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

function initEffects(renderer) {
	tail = renderer.createEffect("fiskheroes:model");
    tail.setModel(utils.createModel(renderer, "tgheroes:raccontail", null, "tail"));
    tail.anchor.set("body");
	tail.setScale(2.0);
	tail.setOffset(2.0, 9.0, 0.0);
	initEquipped(renderer);	
}

function initEquipped(renderer) {
	utils.addLivery(renderer, "BERETTA_93", "gun");

    
	renderer.bindProperty("fiskheroes:equipped_item").setItems([
        { "anchor": "body", "scale": 0.7, "offset": [-3.5, 2.0, 3.0], "rotation": [0.0, -90.0, 60.0] }
    ]).addOffset("QUIVER", 0.0, 0.0, 3.0).slotIndex = 1;
	
	renderer.bindProperty("fiskheroes:equipped_item").setItems([
        { "anchor": "rightLeg", "scale": 0.3, "offset": [-1.0, -1.0, 2.0], "rotation": [90.0, -90.0, 0.0] }
    ]).slotIndex = 0;
}

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