extend("fiskheroes:hero_basic");
loadTextures({
	"layer1": "tgheroes:prowler/prowler_layer1",
    "layer2": "tgheroes:prowler/prowler_layer2",
	"cape": "tgheroes:prowler/prowler_cape",
    "claws": "tgheroes:white_tiger/whitetiger/white_tiger_claws"
});

var utils = implement("fiskheroes:external/utils");
var overlay;
var capes = implement("fiskheroes:external/capes");
var cape;

function initEffects(renderer) {
	var physics = renderer.createResource("CAPE_PHYSICS", null);
    physics.maxFlare = 0.4;
    physics.flareDegree = 1.5;
    physics.flareFactor = 1.2;
    physics.flareElasticity = 5;
    cape = capes.createGlider(renderer, 24, "fiskheroes:cape_batman.mesh.json", physics);
    cape.effect.texture.set("cape");
    cape.effect.width = 16;
    
	overlay = renderer.createEffect("fiskheroes:overlay");
    overlay.texture.set("claws");
	
	utils.bindBeam(renderer, "fiskheroes:repulsor_blast", "fiskheroes:repulsor_blast", "body", 0x00e600, [
        { "firstPerson": [-4.5, 3.75, -7.0], "offset": [-0.5, 9.0, 0.0], "size": [1.0, 1.0],  "anchor": "rightArm" }
    ]);
}

function render(entity, renderLayer, isFirstPersonArm) {
    if (renderLayer == "CHESTPLATE" && entity.getData("fiskheroes:blade")) {
        overlay.render(); 
    };
	if (!isFirstPersonArm && renderLayer == "CHESTPLATE") {
        cape.render(entity, entity.getInterpolatedData("fiskheroes:wing_animation_timer"));
    }
}

