extend("fiskheroes:hero_basic");
loadTextures({
    "layer1": "tgheroes:goblin/90's_goblin1",
    "layer2": "tgheroes:goblin/90's_goblin2",
    "glider": "tgheroes:goblin/90's_glider"
});

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

var boosters;
var goblin_booster = implement("tgheroes:external/goblin_booster");

function initEffects(renderer) {	
	var model_glider = renderer.createResource("MODEL", "tgheroes:goblin-90's");
    model_glider.texture.set("glider");
    glider = renderer.createEffect("fiskheroes:model").setModel(model_glider);
    glider.setScale(2.5);
    boosters = goblin_booster.create(renderer, "fiskheroes:repulsor_layer_%s", true);

}

function initAnimations(renderer) {
    utils.addFlightAnimation(renderer, "thor.FLIGHT", "tgheroes:goblin_glide");
    utils.addHoverAnimation(renderer, "thor.HOVER", "tgheroes:goblin_glide");
}

function render(entity, renderLayer, isFirstPersonArm) {
	    boosters.render(entity, renderLayer, isFirstPersonArm, false);

        if (entity.getData("tgheroes:dyn/oscorp_glider") > 0.5) {
            var glider_anchor = glider.anchor.set("body");
            var glider_offSet = glider.setOffset(3.0, 20.0, -18.0);    
            var glider_rot = glider.setRotation(-12, 0, 0);  			
            glider.anchor = glider_anchor, glider_rot, glider_offSet;
            glider.render();
        }
}