extend("fiskheroes:hero_basic");
loadTextures({
    "layer1": "tgheroes:fist/fist_layer1",
    "layer2": "tgheroes:fist/fist_layer2"
});

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

function initEffects(renderer) {
    var beam = renderer.createResource("BEAM_RENDERER", "tgheroes:chi_beam");
    chi = utils.createLines(renderer, beam, 0xe7dc12, [
        {"start": [0, 0.8, 0], "end": [0.0, -1.0, 0.0], "size": [3.0, 3.0, 3.0]},
    ]);
    chi.setOffset(-1.0, 8.0, 0.0).setScale(4.3);
    chi.anchor.set("leftArm");
    chi.mirror = true;
	
	chi2 = utils.createLines(renderer, beam, 0xe7dc12, [
    {"start": [0, 0.8, 0], "end": [0.0, -1.0, 0.0], "size": [3.0, 3.0, 3.0]},
    ]);
    chi2.setOffset(1.0, 8.0, 0.0).setScale(4.3);
    chi2.anchor.set("rightArm");
    chi2.mirror = true;

}

function render(entity, renderLayer, isFirstPersonArm) {
    if (renderLayer == "CHESTPLATE") {
	chi.progress = entity.getInterpolatedData("fiskheroes:blade");
	chi.render();
	chi2.progress = entity.getInterpolatedData("fiskheroes:blade");
	chi2.render();
    }
}