extend("skarlet:ultron_comics_base");
loadTextures({
    "base": "skarlet:ultron/ultron_conquest_base",
    "lights": "skarlet:ultron/ultron_conquest_lights",
    "cape": "skarlet:ultron/ultron_cape",
    "null": "skarlet:null"
});

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

var cape;

function initEffects(renderer) {
    parent.initEffects(renderer);

    var physics = renderer.createResource("CAPE_PHYSICS", null);
    physics.maxFlare = 0.3;
    physics.flareDegree = 1.5;
    physics.flareFactor = 1.2;
    physics.flareElasticity = 5;
    cape = capes.createDefault(renderer, 24, "fiskheroes:cape_default.mesh.json", physics);
    cape.effect.texture.set("cape");
    cape.effect.width = 16;

    utils.bindParticles(renderer, "skarlet:ultron_mouth");

    utils.bindBeam(renderer, "fiskheroes:charged_beam", "skarlet:encephalo_beam", "head", 0xFF2227, [
        { "firstPerson": [0.0, 3.15, 0.0], "offset": [0.0, -2.75, 0.0], "size": [7.0, 4.0] }
    ]).setParticles(renderer.createResource("PARTICLE_EMITTER", "fiskheroes:impact_heat_vision"));
}

function render(entity, renderLayer, isFirstPersonArm) {
    parent.render(entity, renderLayer, isFirstPersonArm);
    if (!isFirstPersonArm && renderLayer == "HELMET") {
        cape.render(entity);
    }
}