////////////////////
//PLASMA         //
//////////////////
function part18() {
    this.vbl = 0 ;
    this.canvaspart;
    this.initdone = 0 ;

    var pos4=0 ;
    var pos3=0 ;
    var pos2=0 ;
    var pos1=0 ;
    var index=0;
    var x=0;  
    var colors = [] ;
    var aSin = [] ;
    var imageData ;
    var frameBuffer ;
    var fBuff8 ;
    var imgData32 ;

    function color() {
        this.r ;
        this.g ;
        this.b ;
        this.a ;

        return this;
    }

  function dist(b,a,c,f){return Math.sqrt((b-c)*(b-c)+(a-f)*(a-f))}
this.init=function(b){for(var a=0;512>a;a++)rad=0.703125*a*0.0174532,aSin[a]=Math.sin(rad);for(a=0;256>a;a++)colors[a]=new color;for(a=0;256>a;++a)colors[a].r=~~(128+128*Math.sin(3.1415*a/32)),colors[a].g=~~(128+128*Math.sin(3.1415*a/64)),colors[a].b=~~(128+128*Math.sin(3.1415*a/128));imageData=b.contex.getImageData(0,0,b.width,b.height);frameBuffer=imageData.data;fBuff=new ArrayBuffer(frameBuffer.length);fBuff8=new Uint8ClampedArray(fBuff);imgData32=new Uint32Array(fBuff);this.initdone=1};
this.render=function(b){0==this.initdone&&(this.canvaspart=new canvas(600,400),this.init(this.canvaspart));for(var a=pos4,c=pos3,f=0,g=0;g<this.canvaspart.height;++g){for(var d=pos1+3,e=pos2+4,c=c&511,a=a&511,h=0;h<this.canvaspart.width;++h)d&=511,e&=511,index=~~((128*aSin[d+g&511]+256+128*aSin[2*e&511]+128+128*aSin[c]+128+128*aSin[a+h&511])/4),index%=256,imgData32[f++]=4278190080|colors[index].b<<16|colors[index].g<<8|colors[index].r,d+=3,e+=4;a+=3;c+=2}frameBuffer.set(fBuff8);this.canvaspart.contex.putImageData(imageData,
0,0,0,0,this.canvaspart.width,this.canvaspart.height);pos1+=10;pos3+=8;this.canvaspart.draw(b,60,88);100>this.vbl&&mycanvasblack.draw(b,60,88,1-this.vbl/100);this.vbl>intro_parts[part_running].part_duration-100&&mycanvasblack.draw(b,60,88,1-(intro_parts[part_running].part_duration-this.vbl)/100);this.vbl++};
    return this ;
}

///////////////
//END PART18//
/////////////
