stop(); MovieClip.prototype.enabled=true;Button.prototype.useHandCursor=false; MovieClip.prototype.rand=function(num){return Math.floor(Math.random(num)*num);}; MovieClip.prototype.Pos=function(x){return (100-(indexA(cx,x)*10));};pla=_root.plancia; MovieClip.prototype.pl=function(nome,value){pla[nome]=value;} MovieClip.prototype.setSound=function(sound,vol,pan){this[sound].setVolume(vol-_root.volS);this[sound].setPan(pan);this[sound].start(0,1);}; MovieClip.prototype.pres=function(nome,x,y){pla.rota.Vno();_root[nome].oldx=(x);_root[nome].oldy=(y);_root[nome].useHandCursor=1;messaggi(0);}; MovieClip.prototype.mouse=function(nome){_root[nome]._x=_root._xmouse; _root[nome]._y=_root._ymouse;_root[nome].ax=Math.round(Math.round(_root[nome]._x)/30);if(_root[nome].ruo){_root[nome].ay=(Math.round((Math.round(_root[nome]._y)-30)/30))}else{_root[nome].ay=Math.round(Math.round(_root[nome]._y)/30);};}; MovieClip.prototype.indexA=function(nome,find){if(nome.length>0){for (var c=0;c10){_root[nome].ay=10;}if( _root[nome].ay<1){_root[nome].ay=1;};aby=-60;abx=_root[nome].xy-15}else{aby=_root[nome].xy;abx=5;}; if((x>15)&&(x<600-abx)&&(y>15+abx)&&(y<(300-aby))){ _root[nome]._x=_root.coor[1][_root[nome].ax];_root[nome]._y=_root.coor[2][_root[nome].ay]; if(_root[nome].ruo){ _root[nome]._y+=30};if(!flap){Dflotta=myflotta}else{Dflotta=pcflotta}; _root.tripflotta[indexA(Dflotta,nome)]=1;_root[nome].useHandCursor=0;setSound("cl",100,-(Pos(_root[nome]._x))); }else{ _root[nome]._x=_root[nome].oldx;_root[nome]._y=_root[nome].oldy;_root[nome].useHandCursor=1;setSound("bl",100,0);messaggi(5); } _root.detectnear(nome);pl("inb",_root.tripflotta.length); if(_root.tripflotta[indexA(Dflotta,nome)]){newb=[Dflotta[(indexA(Dflotta,nome))+1]];_root[newb].Vsi();}; if(_root.tripflotta[3]){pla.rota.Vsi();}if(_root.tripflotta[8]){pla.rota.Vno();pla.fine.Vsi();if(!flap){pla.sistema.Vsi();}}; pla.rota.onPress=function(){if((_root[newb].xy>0)&&(_root[newb]._x>610)){if(!_root[newb].ruo){_root[newb]._rotation-=90;_root[newb]._y+=_root[newb].xy;_root[newb]._x-=_root[newb].xy/2;_root[newb].ruo=1;}else{_root[newb]._rotation+=90;_root[newb]._y-=_root[newb].xy;_root[newb]._x+=_root[newb].xy/2;_root[newb].ruo=0};}}; delete _root[nome].onMouseMove; };if(SOS){_global.DUAL=this.SO.data.ini[1]}; function StartGames(){ cx=[];cy=[];idc=[];cxi=[];cyi=[];ida=[];pcidc=[];pcida=[];tipnavi=[];posnavi=[];nomnavi=[];cloneflotta=[];killboat=[];clonecolp=[];sdram=[];pcram=[]; coor=[idc,cx,cy,cxi,cyi];pccoor=[pcidc,cx,cy,cxi,cyi];flotta=[tipnavi,posnavi,nomnavi]; pcfloty=[];pcflopos=[];pcfloname=[];pcfloclo=[];pcstatusflo=[pcfloty,pcflopos,pcfloname];navella=[];killpcboat=[];navcolpc=[];navcolmy=[]; _root.finepartita=0;if((!HP)&&(!SOS)){_root.help.Vsi();}else{_root.help.Vno();};pl("nick",nick);if(!DUAL){pl("nick1","PC")}else{pl("nick1",nick1)}; for (i=1; i<=20; i++) { for (j=1; j<=10; j++) { n++; nc = chr(64+i)+j; nca=new Object();nca._x = 30*i;cx[i]=nca._x; cxi[n]=nca._x;nca._y = 30*j;cy[j]=nca._y;cyi[n]=nca._y;idc[n]=nc;pcidc[n]=nc;ida[n]=nc;pcida[n]=nc; _root.avv.cella.duplicateMovieClip(nc, 100+n, nca);_root.cpu.cella.duplicateMovieClip(nc, 500+n, nca); } } with(_root){avv.cella.Vno();cpu.cella.Vno();cpu.Vno();no.Vno();ue.Vno();re.Vno();pno.Vno();pue.Vno();pre.Vno();}; if(DUAL){with(_root){puno1._name="a";puno2._name="b";puno3._name="c";puno4._name="d";pdue1._name="e";pdue2._name="f";pdue3._name="g";ptre1._name="h";ptre2._name="i";}}; };StartGames(); function getFlotta(){ pl("inb",0);tripflotta=[];myflotta=[];myflottatype=[];pccloflotta=[];mypctypeclo=[];pcflotta=[];mysflotta=[]; for(m=1;m<5;m++){nau=new Object();pnau=new Object(); n1="uno"+m; pn1="puno"+m;nau.xy=0; nau._visible=0; myflotta.push(n1); mysflotta.push(n1);pccloflotta.push(pn1);pcflotta.push(pn1);myflottatype.push(1);mypctypeclo.push(1); no.duplicateMovieClip(n1,1000+m,nau);if(DUAL){pnau.xy=0;pnau._visible=0;pnau.clo=1;no.duplicateMovieClip(pn1,1100+m,pnau)}; _root[n1].onPress=function(){pres(this._name,this._x,this._y);this.onMouseMove =function(){mouse(this._name);}}; _root[n1].onRelease=_root[n1].onReleaseOutside=function(){boatrip(this._name,this._x,this._y);}; if(DUAL){_root[pn1].onPress=function(){pres(this._name,this._x,this._y);this.onMouseMove =function(){mouse(this._name);}}; _root[pn1].onRelease=_root[pn1].onReleaseOutside=function(){boatrip(this._name,this._x,this._y);};}; }; for(m=1;m<4;m++){nua=new Object();pnua=new Object(); n2="due"+m;pn2="pdue"+m; nua.xy=30; nua._visible=0; myflotta.push(n2); mysflotta.push(n2);pccloflotta.push(pn2);pcflotta.push(pn2);myflottatype.push(2);mypctypeclo.push(2); ue.duplicateMovieClip(n2,1010+m,nua);if(DUAL){pnua.xy=30;pnua.clo=1;pnua._visible=0;ue.duplicateMovieClip(pn2,1110+m,pnua);}; _root[n2].onPress=function(){pres(this._name,this._x,this._y);this.onMouseMove =function(){mouse(this._name);}}; _root[n2].onRelease=_root[n2].onReleaseOutside=function(){boatrip(this._name,this._x,this._y);}; if(DUAL){_root[pn2].onPress=function(){pres(this._name,this._x,this._y);this.onMouseMove =function(){mouse(this._name);}}; _root[pn2].onRelease=_root[pn2].onReleaseOutside=function(){boatrip(this._name,this._x,this._y);};} }; for(m=1;m<3;m++){tua=new Object();ptua=new Object(); n3="tre"+m;pn3="ptre"+m; tua.xy=60; tua._visible=0; myflotta.push(n3); mysflotta.push(n3); pccloflotta.push(pn3);pcflotta.push(pn3);myflottatype.push(3);mypctypeclo.push(3); re.duplicateMovieClip(n3,1020+m,tua);if(DUAL){ptua.xy=60;ptua.clo=1;ptua._visible=0;re.duplicateMovieClip(pn3,1120+m,ptua);} _root[n3].onPress=function(){pres(this._name,this._x,this._y);this.onMouseMove =function(){mouse(this._name);}}; _root[n3].onRelease=_root[n3].onReleaseOutside=function(){boatrip(this._name,this._x,this._y);}; if(DUAL){_root[pn3].onPress=function(){pres(this._name,this._x,this._y);this.onMouseMove =function(){mouse(this._name);}}; _root[pn3].onRelease=_root[pn3].onReleaseOutside=function(){boatrip(this._name,this._x,this._y);};}; };_root.uno1.Vsi();_root.uno1.onRollOver=function(){_root.help.Vno();}; };getFlotta(); function detectnear(test){ iddu=test;tat=0;if(!flap){Tflotta=myflotta}else{Tflotta=pcflotta}; for (name in Tflotta) { if(_root[test]._x<650){ if(Tflotta[name]!=iddu){ if(_root[test].hitTest(_root[Tflotta[name]])){_root[test]._x=_root[test].oldx;_root[test]._y=_root[test].oldy;tat=1;}}}; }if(tat){setSound("bl",100,0);messaggi(4);_root.tripflotta[indexA(Tflotta,test)]=0}; }; function FloatPc(){ tokkato=1;if(!ms){setSound("bl",30,-100);messaggi(6)}else{messaggi(0);setSound("bl",30,100)};ms=!ms; if(pccloflotta.length>0){ if(pccloflotta[0]!=pippetto){ira=rand(2);};pippetto=pccloflotta[0];proto=mypctypeclo[indexA(pcflotta,pippetto)]; nx=rand(_root.cx.length-1);ny=rand(_root.cy.length-1);px=_root.cx[nx+1];py=_root.cy[ny+1]; switch (proto) { case 2 : if(!ira){if(py>=270){py=240};}else{if(px>=570){px=240};if(py<=30){py=60};_root[pccloflotta[0]]._rotation=-90;_root[pccloflotta[0]].ruo=1;};break; case 3 : if(!ira){if(py>=240){py=210};}else{if(px>=540){px=510};if(py<=30){py=60};_root[pccloflotta[0]]._rotation=-90;_root[pccloflotta[0]].ruo=1;};break; default: break; } _root[pccloflotta[0]]._x=px;_root[pccloflotta[0]]._y=py;_root[pippetto].ax=indexA(cx,_root[pippetto]._x); if(!_root[pippetto].ruo){_root[pippetto].ay=indexA(cy,_root[pippetto]._y);}else{_root[pippetto].ay=(indexA(cy,_root[pippetto]._y))-1}; for (name in pcflotta) {if(pcflotta[name]!=pippetto){if(_root[pippetto].hitTest(_root[pcflotta[name]])){tokkato=0;};};}; if(tokkato){pcg=pccloflotta.shift();pl("inb",pccloflotta.length);}; }else{ getPosition(2); _root.radar.gotoAndStop("pc");reversePlay(0);pl("out","TOCCA A TE ! USA LE FRECCE PER MIRARE E LA BARRA PER SPARARE"); pla.pcvie.Vno();pla.coco(5);clearInterval(pccon);if((!HP)&&(!HP2)){_root.help.Vsi();_root.help.gotoAndStop("h3");pla.revu.enabled=0;}_global.HP=1;_global.SOS=1;_root.sfo.gotoAndStop("sfo"); } }; function setPC(){pccon=setInterval(FloatPc,500);}; function getPosition(jo){ if(jo==1){Mnomnavi=[];Mdirnavi=[];Mynavi=[];Mxnavi=[];MeFloat=[Mnomnavi,Mdirnavi,Mxnavi,Mynavi];}; if((jo==2)&&(!joks)){Mpcdirnavi=[];Mxpcnavi=[];Mypcnavi=[];Mnompcnavi=[];MepcFloat=[Mnompcnavi,Mpcdirnavi,Mxpcnavi,Mypcnavi];joks=1;}; if(jo==1){flottax=myflotta;flottaxt=myflottatype;navit=tipnavi;navina=nomnavi;posna=posnavi;flottaclo=cloneflotta;ornavi=Mdirnavi;mnom=Mnomnavi;Xnavi=Mxnavi;Ynavi=Mynavi;} else if(jo==2){flottax=pcflotta;flottaxt=mypctypeclo;navit=pcfloty;navina=pcfloname;posna=pcflopos;flottaclo=pcfloclo;ornavi=Mpcdirnavi;mnom=Mnompcnavi;Xnavi=Mxpcnavi;Ynavi=Mypcnavi;}; for (a=0;a0)&&(killjoin[n]<201)){killaz.push(laz);};}; }else{return logica();};}; nokill=1;kilnow=killaz.shift();magik=indexA(idc,kilnow); if((magik!=undefined)&&(magik!=NaN)&&(magik>0)&&(magik<201)){return magik;}else{return logica();} }; function proiettile(){ numbo=idc.length; if((idc.length>0)&&(!_root.finepartita)){ if(navcol!=undefined){bombu=killer(kilpos);}else{killato=1;killjoin=[];killaz=[];bombu=logica();};rom=idc[bombu]; if((numbo<_root.numlev)&&(navcol==undefined)){ raid = rand(_root.ranlev); if(raid==1){rimflotta=cloneflotta.length;jolly=rand(rimflotta);rid=cloneflotta[jolly];bombu=indexA(idc,rid);rom =idc[bombu];}; } controlbomba(rom,0);ram=idc.splice(bombu,1);}; }; function logica(){ bomber=(rand(numbo-7)+7);near=ida[indexA(ida,idc[bomber])]; if(killboat.length>0){ for (ki=0;ki0){h--;rdm._x=(cx[h+1])+15;setSound("pi",100,sopan);}}; if(Key.isDown(Key.UP)){if(v>0){v--; rdm._y=(cx[v+1])+15;setSound("pi",100,sopan);}}; if(Key.isDown(Key.DOWN)){if(v1){pla.vol.vol._y=volMem[0];pl("vvv",volMem[1]);_root.volS=volMem[2];}if(speMem.length>1){pla.spe.spe._y=speMem[0];pl("spi",speMem[1]);_root.speedmissile=speMem[1];_root.speed=speMem[2];}clearInterval(sbor);}; if(SOS){ReBoat();var radtim=setInterval(gora,300);var sbor=setInterval(bora,800);};