extend("fiskheroes:hero_basic");
loadTextures({
    "layer1": "wv:twin/billy_layer1",
    "layer2": "wv:twin/billy_layer2"
});
var utils = implement("fiskheroes:external/utils");


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

function initEffects(renderer) {
utils.bindCloud(renderer, "fiskheroes:telekinesis", "fiskheroes:telekinesis_monitor");
var hand = renderer.createResource("BEAM_RENDERER", "wv:hand");

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

}


function initAnimations(renderer){
   // parent.initAnimations(renderer);

   addAnimationWithData(renderer, "billy.TELEKINESIS", "fiskheroes:aiming", "fiskheroes:aiming_timer");

    addAnimation(renderer, "billy.HOLOSTAND", "wv:telekinesis")
    .setData((entity, data) => {
        var f = entity.getInterpolatedData("wv:dyn/holoanimation");
        data.load(4*f <= 0.95 ? 4*f : 0.95);
    });
}

function render(entity, renderLayer, isFirstPersonArm) {
    if (entity.isWearingFullSuit()) {
        if (entity.getData("fiskheroes:telekinesis") == 1  || entity.getInterpolatedData("wv:dyn/holoanimation") > 0) {
            hand_punch.render();
        }
    }
    }
