extend("fiskheroes:hero_basic");
loadTextures({
	"layer1": "tgheroes:joker/bwl_layer1",
	"layer2": "tgheroes:joker/bwl_layer2",
	"helmet": "tgheroes:joker/cowl",
	"knife": "tgheroes:joker/knife"
});

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

function initEffects(renderer) {
	helmet = renderer.createEffect("fiskheroes:model");
    helmet.setModel(utils.createModel(renderer, "tgheroes:bwl_cowl", null, "helmet"));
    helmet.anchor.set("head");
	helmet.setScale(1.0);
	helmet.setOffset(0.0, 0.0, 0.0);
	
	var model_knife = renderer.createResource("MODEL", "tgheroes:knife");
    model_knife.texture.set("knife");
    knife = renderer.createEffect("fiskheroes:model").setModel(model_knife);
    knife.anchor.set("rightArm");
    knife.setScale(1);
}

function render(entity, renderLayer, isFirstPersonArm) {
    if (renderLayer == "HELMET") {
        helmet.render();
    }
	if (entity.getData("fiskheroes:blade_timer") > 0.5) {
            var blade_anchor = knife.anchor.set("rightArm");
            var blade_offSet = knife.setOffset(1.0, 8.0, -3.5);
            var blade_rot = knife.setRotation(90, 90, 0);
        			
            knife.anchor = blade_anchor, blade_offSet, blade_rot;
            knife.render();
        }
}