loadTextures({
    "base": "gowhp:kratos/bladesofchaos",
    "base_lights": "gowhp:kratos/bladesofchaos_lights"
});

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

var model;
var cancelAnimations = false;

function init(renderer) {
    model = utils.createModel(renderer, "gowhp:bladesofchaosweapon", "base", "base_lights");
    renderer.setModel(model);

    utils.addPlayerAnimationWithData(renderer, "fisktag:dual_hand", "fiskheroes:aiming_timer");

    utils.addPlayerAnimation(renderer, "gowhp:sprint_kratos")
        .setData((entity, data) => data.load(1.0))
        .setCondition(entity => (entity.isSprinting()));

    utils.addPlayerAnimation(renderer, "gowhp:dualwield")
        .setData((entity, data) => data.load(1.0))
        .setCondition(entity => (entity.isPunching() && !entity.getInterpolatedData("fiskheroes:shield_blocking_timer")));
}

function render(renderer, entity, glProxy, renderType, isLeftSide) {
    cancelAnimations = false;
    if (renderType === "EQUIPPED_FIRST_PERSON") {
        glProxy.translate(0.0, 0.1, 0.0);
    }
    if (renderType === "ENTITY") {
        glProxy.translate(0.0, -0.7, 0.00);
        glProxy.scale(1.0);
        cancelAnimations = true;
    }
    if (renderType === "INVENTORY") {
        glProxy.translate(0.0, 0.0, -0.05);
        glProxy.scale(1.0);
        cancelAnimations = true;
    }
    if (isLeftSide) {
        glProxy.translate(0.0, -0.5, 1.0);
        glProxy.rotate(-90.0, 0.0, 1.0, 0.0);
        glProxy.scale(1.0);
    }
    else {
        glProxy.translate(0.0, -0.5, 1.0);
        glProxy.rotate(270.0, 1.0, 0.0, 0.0);
        glProxy.scale(1.0);
    }
}
