extend("wv:scarlet_witch");
loadTextures({
    "layer1": "wv:sw/scarlet_witch_noface_layer1",
    "layer2": "wv:sw/scarlet_witch_layer2"
});
var chest


function initEffects(renderer) {
    chest = renderer.createEffect("fiskheroes:chest");
    chest.setExtrude(0.75).setYOffset(1);

    var blank = renderer.createResource("BEAM_RENDERER", "wv:hand");

    blank_punch = utils.createLines(renderer, blank, "0x", [{
        "start": [0, -0.1, 0],
        "end": [0, 0.1, 0],
        "size": [3, 3]
    }
    ]);
    blank_punch.anchor.set("rightArm");
    blank_punch.setOffset(0.5, 9.0, 0.0).setRotation(0.0, 0.0, 0.0).setScale(16);
    blank_punch.mirror = true;
}


function init(renderer) {
    parent.init(renderer);
    renderer.showModel("CHESTPLATE", "head", "headwear", "body", "rightArm", "leftArm", "rightLeg", "leftLeg");
    renderer.fixHatLayer("CHESTPLATE");
}

function initAnimations(renderer) {
    addAnimation(renderer, "scarlet_witch.HOLOSTAND", "wv:blank")
    .setData((entity, data) => {
        var holo = entity.getInterpolatedData("wv:dyn/holoanimation");
        data.load(4*holo <= 0.95 ? 4*holo : 0.95);
    });
}

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