Combined Code
movieClip 46 {
}
movieClip 51 tooltip {
}
movieClip 60 {
}
movieClip 62 {
}
movieClip 64 {
}
movieClip 65 tooltip2 {
}
movieClip 67 {
}
movieClip 68 spark2 {
frame 16 {
this.removeMovieClip();
}
}
movieClip 69 spark {
frame 16 {
this.removeMovieClip();
}
}
movieClip 72 e3 {
frame 1 {
stop();
}
frame 2 {
_parent.removeMovieClip();
}
}
movieClip 75 e2 {
frame 1 {
stop();
}
frame 2 {
_parent.removeMovieClip();
}
}
movieClip 78 e1 {
frame 1 {
stop();
}
frame 2 {
_parent.removeMovieClip();
}
}
movieClip 81 particle_smoke_clear {
}
movieClip 83 missile {
frame 1 {
addToPause(this);
}
}
movieClip 85 {
frame 15 {
removeMovieClip('');
}
}
movieClip 86 firesprite {
}
frame 1 {
var CPMStarContentSpotID = '2518Q91B78FDB';
System.security.allowDomain('server.cpmstar.com');
adBox.loadMovie('http://server.cpmstar.com/adviewas2.swf?contentspotid=' + CPMStarContentSpotID);
if (_root.getBytesLoaded() != _root.getBytesTotal()) {
this.stop();
this.display.owner = this;
play_btn._visible = false;
this.display.skipped = Number(_root.getBytesLoaded());
this.display.total = Number(_root.getBytesTotal() - this.display.skipped);
this.display.onEnterFrame = function () {
var v3 = Math.floor((_root.getBytesLoaded() - this.skipped) * 100 / this.total);
this.gotoAndStop(v3 + 1);
this.txt.text = v3 + '%';
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
this.onEnterFrame = null;
this.owner.onComplete();
}
};
} else {
this.onComplete();
}
this.onComplete = function () {
display._visible = false;
play_btn._visible = true;
};
play_btn.onRelease = function () {
delete eval(_root.onComplete());
_root.play();
};
if (_global.newggame11 == 1) {
this.gotoAndPlay(3);
}
}
movieClip 89 {
}
movieClip 91 {
}
// unknown tag 88 length 32
movieClip 96 {
}
// unknown tag 88 length 78
movieClip 101 {
frame 1 {
stop();
}
frame 2 {
play();
}
frame 5 {
stop();
}
frame 6 {
play();
}
}
movieClip 103 {
}
frame 2 {
function doneBD_Splash() {
_global.newggame11 = 1;
clearInterval(tID);
play();
}
stop();
var tID = setInterval(doneBD_Splash, 6500);
}
movieClip 107 {
}
movieClip 108 {
}
movieClip 114 {
}
movieClip 115 {
}
movieClip 120 {
}
movieClip 121 {
}
movieClip 122 {
}
movieClip 124 {
}
movieClip 125 {
}
movieClip 131 {
}
movieClip 132 {
}
movieClip 133 {
}
movieClip 135 {
}
movieClip 139 {
}
movieClip 140 {
}
movieClip 141 {
}
movieClip 144 {
}
movieClip 152 {
}
movieClip 153 {
}
movieClip 154 {
}
movieClip 157 {
frame 1 {
fire._visible = false;
i = 0;
}
frame 2 {
duplicateMovieClip(fire, 'fire' + i, i);
this['fire' + i]._x = Math.random() * 50;
this['fire' + i]._xscale = Math.random() * 50 + 20;
this['fire' + i]._yscale = Math.random() * 100;
this['fire' + i]._alpha = Math.random() * 60;
++i;
}
frame 3 {
gotoAndPlay(2);
}
}
movieClip 158 {
}
movieClip 159 {
}
movieClip 162 {
}
movieClip 165 {
}
// unknown tag 88 length 63
movieClip 168 {
}
movieClip 171 {
}
movieClip 172 {
}
movieClip 175 {
}
movieClip 176 {
}
movieClip 177 {
frame 1 {
function visitBD() {
getURL('http://www.bubbledevil.com/gamein.php?gameref=spitefulspace', '_blank');
}
VisitBubbleDevil.onRelease = visitBD;
}
frame 75 {
stop();
}
}
frame 3 {
function placeBoom(x, y) {
++lev;
var v1 = boom.duplicateMovieClip('b' + lev, lev);
v1._x = x;
v1._y = y;
}
var _mochiads_game_id = '30b529242e05db6e';
_lockroot = true;
stop();
_global.surv = false;
boom._visible = false;
aboutmc._visible = false;
aboutmc._alpha = 0;
var abo = false;
var pressed = 0;
var mmenu = new Sound(_root);
mmenu.attachSound('musmenu');
var msystem = new Sound(_root);
msystem.attachSound('mussystem');
var mbos = new Sound(_root);
mbos.attachSound('musbos');
var mpause = new Sound(_root);
mpause.attachSound('muspause');
var szelenie = new Sound(_root);
szelenie.attachSound('sfxzelenie');
var svolna = new Sound(_root);
svolna.attachSound('sfxvolna');
var svistrel2 = new Sound(_root);
svistrel2.attachSound('sfxvistrel2');
var supgraded = new Sound(_root);
supgraded.attachSound('sfxupgraded');
var sresp = new Sound(_root);
sresp.attachSound('sfxresp');
var sraketa = new Sound(_root);
sraketa.attachSound('sfxraketa');
var spanelmove = new Sound(_root);
spanelmove.attachSound('sfxpalelmove');
var sopenportal = new Sound(_root);
sopenportal.attachSound('sfxopenportal');
var snoroket = new Sound(_root);
snoroket.attachSound('sfxnoroket');
var snomoney = new Sound(_root);
snomoney.attachSound('sfxnomoney');
var smolniya = new Sound(_root);
smolniya.attachSound('sfxmolniya');
var slazer = new Sound(_root);
slazer.attachSound('sfxlazer');
var shittestmob = new Sound(_root);
shittestmob.attachSound('sfxhittestmob');
var shitme = new Sound(_root);
shitme.attachSound('sfxhitme');
var sexp1 = new Sound(_root);
sexp1.attachSound('sfxexpl1');
var sexp2 = new Sound(_root);
sexp2.attachSound('sfxexpl2');
var sexp3 = new Sound(_root);
sexp3.attachSound('sfxexpl3');
var scollected = new Sound(_root);
scollected.attachSound('sfxcollected');
var sbuttonrelease = new Sound(_root);
sbuttonrelease.attachSound('sfxbuttonrelease');
var shit1 = new Sound(_root);
shit1.attachSound('sfxhit1');
var shit2 = new Sound(_root);
shit2.attachSound('sfxhit2');
var shit3 = new Sound(_root);
shit3.attachSound('sfxhit3');
var shit4 = new Sound(_root);
shit4.attachSound('sfxhit4');
var shit5 = new Sound(_root);
shit5.attachSound('sfxhit5');
var shit6 = new Sound(_root);
shit6.attachSound('sfxhit6');
var sonroll = new Sound(_root);
sonroll.attachSound('sfxonroll');
var ssaready = new Sound(_root);
ssaready.attachSound('sfxsaready');
var ssastart = new Sound(_root);
ssastart.attachSound('sfxsastart');
_global.playsfx = function (namestr) {
if (_global.SoundM != false) {
switch (namestr) {
case 'zelenie':
szelenie.start();
break;
case 'volna':
svolna.start();
break;
case 'vistrel':
svistrel2.start();
break;
case 'upgraded':
supgraded.start();
break;
case 'sun':
ssun.start();
break;
case 'resp':
sresp.start();
break;
case 'raketa':
sraketa.start();
break;
case 'panelmove':
spanelmove.start();
break;
case 'openportal':
sopenportal.start();
break;
case 'noroket':
snoroket.start();
break;
case 'nomoney':
snomoney.start();
break;
case 'molniya':
smolniya.start();
break;
case 'lazer':
slazer.start();
break;
case 'hittestmob':
shittestmob.start();
break;
case 'hitme':
var v2 = Math.random();
if (v2 < 0.33) {
shit4.start();
} else {
if (v2 < 0.66) {
shit5.start();
} else {
shit6.start();
}
}
break;
case 'hit':
var v2 = Math.random();
if (v2 < 0.33) {
shit1.start();
} else {
if (v2 < 0.66) {
shit2.start();
} else {
shit3.start();
}
}
break;
case 'exp':
var v2 = Math.random();
if (v2 < 0.33) {
sexp1.start();
} else {
if (v2 < 0.66) {
sexp2.start();
} else {
sexp3.start();
}
}
break;
case 'collected':
scollected.start();
break;
case 'buttonrelease':
sbuttonrelease.start();
break;
case 'win':
sbuttonrelease.start();
mpause.start(0, 500);
break;
case 'saready':
ssaready.start();
break;
case 'onroll':
sonroll.start();
break;
case 'sastart':
ssastart.start(0, 6);
}
}
};
if (_global.SoundM != false) {
mpause.stop();
msystem.stop();
mmenu.stop();
mbos.stop();
mmenu.start(0, 500);
}
var lev = 0;
bhstarplay = function () {
++lev;
var v3 = bhstar.duplicateMovieClip('bh' + lev, lev);
if (Math.random() < 0.5) {
v3._x = fon._x + Math.random() * fon._width;
if (Math.random() < 0.5) {
v3._y = fon._y - v3._height / 2;
} else {
v3._y = fon._y + fon._height + v3._height / 2;
}
} else {
v3._y = fon._y + Math.random() * fon._height;
if (Math.random() < 0.5) {
v3._x = fon._x - v3._width / 2;
} else {
v3._x = fon._x + fon._width + v3._width / 2;
}
}
var v5 = root._xmouse - v3._x;
var v4 = root._ymouse - v3._y;
v3.a = Math.atan2(v4, v5);
v3.speed = Math.random() * 3 + 3;
v3._yscale = random(100);
v3._xscale = v3._yscale;
v3._alpha = random(100);
v3._rotation = (v3.a / Math.PI) * 180;
v3.onEnterFrame = function () {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
var v4 = _root._xmouse - this._x;
var v3 = _root._ymouse - this._y;
this.a = Math.atan2(v3, v4);
this._rotation = (this.a / Math.PI) * 180;
this._alpha -= 1;
var v5 = Math.sqrt(v4 * v4 + v3 * v3);
if (v5 < 5 || this._alpha <= 0) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
};
_global.Detal = 2;
var my_so = SharedObject.getLocal('spiteful_space_save', '/');
var te = my_so.data.Saved;
comc._visible = false;
if (te == 1) {
comc._visible = true;
}
var pla = false;
var sp = 0;
var fun = 0;
var timeb = 50;
var timebb = 0;
if (_global.SoundM == false) {
_root.sgs._alpha = 50;
} else {
_root.sgs._alpha = 100;
}
onEnterFrame = function () {
if (pressed == 4) {
++timebb;
if (timebb >= timeb) {
timebb = 0;
placeBoom(Math.random() * 500 + 100, Math.random() * 400 + 100);
}
if (timebb == 45) {
placeBoom(Math.random() * 500 + 100, Math.random() * 400 + 100);
}
}
bhstarplay();
if (pla) {
++sp;
if (pressed != 1) {
comc._x += sp * 2;
}
comc._alpha -= 5;
if (pressed != 2) {
ngmc._x -= sp * 2;
}
ngmc._alpha -= 5;
if (pressed != 3) {
sumc._x += sp * 2;
}
sumc._alpha -= 5;
if (pressed != 4) {
abmc._x -= sp * 2;
abmc._alpha -= 5;
}
sgs._x -= sp * 2;
sgs._alpha -= 5;
mgmc._alpha -= 5;
mgmc._y += sp * 2;
if (abo && aboutmc._alpha < 100) {
aboutmc._alpha += 5;
}
if (sumc._x > 750 || comc._x > 750) {
pla = false;
if (fun == 3) {
gotoAndPlay(4);
} else {
if (fun == 1) {
var v3 = SharedObject.getLocal('spiteful_space_save', '/');
v3.data.Saved = 1;
v3.flush();
gotoAndPlay(4);
} else {
if (fun == 2) {
var v3 = SharedObject.getLocal('spiteful_space_save', '/');
var v4 = v3.data.Saved;
if (v4 != undefined) {
v3.data.Saved = 1;
_global.system1stat = v3.data.syst1;
_global.system2stat = v3.data.syst2;
_global.system3stat = v3.data.syst3;
_global.system4stat = v3.data.syst4;
_global.system5stat = v3.data.syst5;
_global.system6stat = v3.data.syst6;
_global.system7stat = v3.data.syst7;
_global.system8stat = v3.data.syst8;
_global.system9stat = v3.data.syst9;
_global.system10stat = v3.data.syst10;
_global.system11stat = v3.data.syst11;
_global.system12stat = v3.data.syst12;
_global.system13stat = v3.data.syst13;
_global.system14stat = v3.data.syst14;
_global.system15stat = v3.data.syst15;
_global.system16stat = v3.data.syst16;
_global.system17stat = v3.data.syst17;
_global.system18stat = v3.data.syst18;
_global.system19stat = v3.data.syst19;
_global.system20stat = v3.data.syst20;
_global.system21stat = v3.data.syst21;
_global.arm = v3.data.arm;
_global.def = v3.data.def;
_global.spe = v3.data.spe;
_global.str = v3.data.str;
_global.rad = v3.data.rad;
_global.hername = v3.data.hername;
_global.herlvl = v3.data.herlvl;
_global.hertottime = v3.data.hertottime;
_global.herkill = v3.data.herkill;
_global.herdeath = v3.data.herdeath;
_global.perstype = v3.data.perstype;
_global.MIN = v3.data.MIN;
_global.GAS = v3.data.GAS;
_global.BIO = v3.data.BIO;
_global.systema = v3.data.systema;
_global.rokmax = v3.data.rokmax;
_global.uR = v3.data.uR;
_global.uG = v3.data.uG;
_global.uB = v3.data.uB;
_global.uRa = v3.data.uRa;
_global.uE = v3.data.uE;
_global.uS = v3.data.uS;
_global.uSt = v3.data.uSt;
v3.flush();
_root.gotoAndPlay(5);
}
}
}
}
}
}
};
_global.newG = 1;
}
button 182 {
on (release) {
_root.pla = true;
_root.fun = 1;
_root.ss.gotoAndPlay(2);
_global.playsfx('buttonrelease');
_root.pressed = 2;
}
on (rollOver) {
_global.playsfx('onroll');
}
}
movieClip 183 {
}
button 186 {
on (release) {
_root.pla = true;
_global.surv = true;
_root.fun = 3;
_root.ss.gotoAndPlay(2);
_global.playsfx('buttonrelease');
_root.pressed = 3;
}
on (rollOver) {
_global.playsfx('onroll');
}
}
movieClip 187 {
}
button 190 {
on (release) {
_global.playsfx('buttonrelease');
if (!_root.abo) {
_root.aboutmc._visible = true;
_root.pla = true;
_root.abo = true;
_root.pressed = 4;
} else {
_root.aboutmc._visible = false;
_root.aboutmc._alpha = 0;
_root.pla = false;
_root.abo = false;
_root.pressed = 0;
_root.sp = 0;
_root.comc._x = 251.8;
_root.comc._alpha = 100;
_root.ngmc._x = 238;
_root.ngmc._alpha = 100;
_root.sumc._x = 255;
_root.sumc._alpha = 100;
_root.mgmc._y = 522.2000000000001;
_root.mgmc._alpha = 100;
_root.sgs._x = 8;
if (_global.SoundM == false) {
_root.sgs._alpha = 50;
} else {
_root.sgs._alpha = 100;
}
}
}
on (rollOver) {
_global.playsfx('onroll');
}
}
movieClip 191 {
}
button 194 {
on (release) {
_root.pla = true;
_root.fun = 2;
_root.ss.gotoAndPlay(2);
_global.playsfx('buttonrelease');
_root.pressed = 1;
}
on (rollOver) {
_global.playsfx('onroll');
}
}
movieClip 195 {
}
// unknown tag 88 length 62
button 203 {
on (release) {
if (_global.SoundM == false) {
_global.SoundM = true;
sgs._alpha = 100;
_root.mmenu.start(1, 500);
} else {
_global.SoundM = false;
_root.msystem.stop();
_root.mpause.stop();
_root.mbos.stop();
_root.mmenu.stop();
sgs._alpha = 50;
}
}
}
button 206 {
on (release) {
getURL('http://www.bubbledevil.com/gamein.php?gameref=spitefulspace', '_blank');
}
on (rollOver) {
_global.playsfx('onroll');
}
}
movieClip 207 {
}
movieClip 209 {
}
movieClip 221 {
}
movieClip 222 {
}
movieClip 224 {
frame 1 {
stop();
}
frame 18 {
stop();
}
}
movieClip 225 {
}
movieClip 227 {
}
movieClip 229 {
}
movieClip 230 {
frame 36 {
_parent.removeMovieClip();
stop();
}
}
movieClip 231 {
frame 1 {
boomgo._visible = false;
i = 30;
while (i--) {
d = boomgo.duplicateMovieClip('p' + i, i);
d._rotation = Math.random() * 360;
d._yscale = Math.random() * 70 + 50;
d._xscale = d._yscale;
}
}
}
movieClip 234 {
}
movieClip 237 {
frame 1 {
ButtonMascot.onRelease = function () {
getURL('http://www.bubbledevil.com/gamein.php?gameref=spitefulspace', '_blank');
};
}
}
frame 4 {
stop();
_global.perstype = 1;
_global.herlvl = 0;
_global.hertottime = 0;
_global.herkill = 0;
_global.herdeath = 0;
_global.arm = 100;
_global.def = 50;
_global.spe = 5;
_global.str = 0.5;
_global.rad = 2;
_global.systema = 1;
_global.kill1 = 0;
_global.timeall = 0;
_global.MIN = 0;
_global.GAS = 0;
_global.BIO = 0;
var pan = 0;
panelko._alpha = 0;
textnah._alpha = 0;
bak._alpha = 0;
cont._alpha = 0;
var pla = false;
var sp = 0;
onEnterFrame = function () {
if (pan < 100) {
panelko._alpha = pan;
textnah._alpha = pan;
bak._alpha = pan;
cont._alpha = pan;
pan += 5;
}
if (pla) {
++sp;
panelko._x += sp * 2;
panelko._alpha -= 5;
textnah._x -= sp * 2;
textnah._alpha -= 5;
ss._alpha -= 5;
bak._alpha -= 5;
cont._alpha -= 5;
if (panelko._x > 750) {
pla = false;
if (_global.perstype == 1) {
_global.arm = 140;
_global.def = 120;
_global.spe = 5.3;
_global.str = 0.6800000000000001;
_global.rad = 2.2;
}
if (_global.perstype == 2) {
_global.arm = 120;
_global.def = 105;
_global.spe = 6;
_global.str = 0.58;
_global.rad = 2.1;
}
if (_global.perstype == 3) {
_global.arm = 140;
_global.def = 135;
_global.spe = 5.2;
_global.str = 0.5600000000000001;
_global.rad = 2.2;
}
if (_global.perstype == 4) {
_global.arm = 130;
_global.def = 115;
_global.spe = 5.4;
_global.str = 0.54;
_global.rad = 2.6;
}
if (_global.perstype == 5) {
_global.arm = 160;
_global.def = 130;
_global.spe = 5.1;
_global.str = 0.5600000000000001;
_global.rad = 2.2;
}
_global.sa1 = 1;
_global.sa2 = 1;
_global.sa3 = 1;
_global.rokmax = 5;
_global.system1stat = 2;
_global.system2stat = 1;
_global.system3stat = 1;
_global.system4stat = 1;
_global.system5stat = 1;
_global.system6stat = 1;
_global.system7stat = 1;
_global.system8stat = 1;
_global.system9stat = 1;
_global.system10stat = 1;
_global.system11stat = 1;
_global.system12stat = 1;
_global.system13stat = 1;
_global.system14stat = 1;
_global.system15stat = 1;
_global.system16stat = 1;
_global.system17stat = 1;
_global.system18stat = 1;
_global.system19stat = 1;
_global.system20stat = 1;
_global.system21stat = 1;
_global.hername = panelko.tname.text;
_global.uR = 1;
_global.uG = 1;
_global.uB = 1;
_global.uRa = 1;
_global.uE = 1;
_global.uS = 1;
_global.uSt = 1;
if (!_global.surv) {
gotoAndPlay(5);
} else {
gotoAndPlay(14);
}
}
}
};
}
movieClip 238 {
}
button 241 {
on (release) {
_root.pla = true;
_global.playsfx('buttonrelease');
}
on (rollOver) {
_global.playsfx('onroll');
}
}
button 243 {
on (release) {
_global.playsfx('buttonrelease');
gotoAndPlay(1);
}
on (rollOver) {
_global.playsfx('onroll');
}
}
button 249 {
on (release) {
_global.playsfx('buttonrelease');
if (_global.perstype == 2) {
_global.perstype = 1;
t1._width = 40;
t2._width = 40;
t3._width = 30;
t4._width = 90;
t5._width = 20;
ttype.text = 'warrior';
sel(Qwar);
spab.text = 'special ability - \'Eagle Eye\'';
} else {
if (_global.perstype == 1) {
_global.perstype = 5;
t1._width = 60;
t2._width = 60;
t3._width = 10;
t4._width = 30;
t5._width = 20;
ttype.text = 'defender';
sel(Qdef);
spab.text = 'special ability - \'Ultimate Defence\'';
} else {
if (_global.perstype == 5) {
_global.perstype = 4;
t1._width = 30;
t2._width = 30;
t3._width = 40;
t4._width = 20;
t5._width = 60;
ttype.text = 'assault';
sel(Qsht);
spab.text = 'special ability - \'Annihilating Flash\'';
} else {
if (_global.perstype == 4) {
_global.perstype = 3;
t1._width = 40;
t2._width = 70;
t3._width = 20;
t4._width = 30;
t5._width = 20;
ttype.text = 'tank';
sel(Qtan);
spab.text = 'special ability - \'Neutron Acceleration\'';
} else {
if (_global.perstype == 3) {
_global.perstype = 2;
t1._width = 20;
t2._width = 10;
t3._width = 100;
t4._width = 40;
t5._width = 10;
ttype.text = 'scout';
sel(Qsca);
spab.text = 'special ability - \'Time Bomb\'';
}
}
}
}
}
}
}
movieClip 347 {
}
button 350 {
on (release) {
_global.playsfx('buttonrelease');
if (_global.perstype == 5) {
_global.perstype = 1;
t1._width = 40;
t2._width = 40;
t3._width = 30;
t4._width = 90;
t5._width = 20;
ttype.text = 'warrior';
spab.text = 'special ability - \'Eagle Eye\'';
sel(Qwar);
} else {
if (_global.perstype == 4) {
_global.perstype = 5;
t1._width = 60;
t2._width = 60;
t3._width = 10;
t4._width = 30;
t5._width = 20;
ttype.text = 'defender';
spab.text = 'special ability - \'Ultimate Defence\'';
sel(Qdef);
} else {
if (_global.perstype == 3) {
_global.perstype = 4;
t1._width = 30;
t2._width = 30;
t3._width = 40;
t4._width = 20;
t5._width = 60;
ttype.text = 'assault';
spab.text = 'special ability - \'Annihilating Flash\'';
sel(Qsht);
} else {
if (_global.perstype == 2) {
_global.perstype = 3;
t1._width = 40;
t2._width = 70;
t3._width = 20;
t4._width = 30;
t5._width = 20;
ttype.text = 'tank';
sel(Qtan);
spab.text = 'special ability - \'Neutron Acceleration\'';
} else {
if (_global.perstype == 1) {
_global.perstype = 2;
t1._width = 20;
t2._width = 10;
t3._width = 100;
t4._width = 40;
t5._width = 10;
ttype.text = 'scout';
sel(Qsca);
spab.text = 'special ability - \'Time Bomb\'';
}
}
}
}
}
}
}
movieClip 357 {
}
movieClip 358 {
}
movieClip 359 {
}
movieClip 360 {
}
movieClip 361 {
}
movieClip 364 {
}
movieClip 367 {
}
movieClip 370 {
}
movieClip 373 {
}
movieClip 376 {
}
movieClip 378 {
frame 1 {
function showTooltip(_msg_head, _msg_body) {
++lev2;
tooltip_mc = pathToRoot.attachMovie('tooltip', 'tooltip' + lev2, lev2);
tooltip_mc.head_txt.text = _msg_head;
tooltip_mc.body_txt.text = _msg_body;
tooltip_mc.head_txt.autoSize = true;
tooltip_mc.body_txt.autoSize = true;
tooltip_mc.bg_mc._width = 200;
tooltip_mc.head_txt._width = 190;
tooltip_mc.body_txt._width = 190;
var v2 = tooltip_mc.head_txt._height + tooltip_mc.body_txt._height + 10;
var v3 = tooltip_mc.body_txt._width + 10;
tooltip_mc.bg_mc._height = v2;
tooltip_mc._x = -tooltip_mc._width;
tooltip_mc._y = -tooltip_mc._height;
tooltip_mc.onEnterFrame = function () {
this.tempX = pathToRoot._xmouse + paddingX;
this.tempY = pathToRoot._ymouse + paddingY;
if (this.tempX + tooltip_mc._width > gameWidth) {
this._x = this.tempX - tooltip_mc._width;
} else {
this._x = this.tempX;
}
if (this.tempY + tooltip_mc._height > gameHeight) {
this._y = this.tempY - tooltip_mc._height - paddingY;
} else {
this._y = this.tempY;
}
};
}
function hideTooltip() {
delete tooltip_mc.onEnterFrame;
removeMovieClip(tooltip_mc);
}
sel = function (A) {
var v1 = Qwar.filters;
v1[0].strength = 0.5;
Qwar.filters = v1;
Qdef.filters = v1;
Qsca.filters = v1;
Qsht.filters = v1;
Qtan.filters = v1;
v1 = A.filters;
v1[0].strength = 2;
A.filters = v1;
};
Qwar.onRelease = function () {
_global.perstype = 1;
t1._width = 40;
t2._width = 40;
t3._width = 30;
t4._width = 90;
t5._width = 20;
ttype.text = 'warrior';
sel(Qwar);
spab.text = 'special ability - \'Eagle Eye\'';
};
Qdef.onRelease = function () {
_global.perstype = 5;
t1._width = 60;
t2._width = 60;
t3._width = 10;
t4._width = 30;
t5._width = 20;
ttype.text = 'defender';
sel(Qdef);
spab.text = 'special ability - \'Ultimate Defence\'';
};
Qsht.onRelease = function () {
_global.perstype = 4;
t1._width = 30;
t2._width = 30;
t3._width = 40;
t4._width = 20;
t5._width = 60;
ttype.text = 'assault';
sel(Qsht);
spab.text = 'special ability - \'Annihilating Flash\'';
};
Qtan.onRelease = function () {
_global.perstype = 3;
t1._width = 40;
t2._width = 70;
t3._width = 20;
t4._width = 30;
t5._width = 20;
ttype.text = 'tank';
sel(Qtan);
spab.text = 'special ability - \'Neutron Acceleration\'';
};
Qsca.onRelease = function () {
_global.perstype = 2;
t1._width = 20;
t2._width = 10;
t3._width = 100;
t4._width = 40;
t5._width = 10;
ttype.text = 'scout';
sel(Qsca);
spab.text = 'special ability - \'Time Bomb\'';
};
Qwar.onRollOver = function () {
showTooltip('Warrior', 'Special ability - \'Eagle Eye\': Temporarily increases shot power in 3 times');
_global.playsfx('onroll');
};
Qdef.onRollOver = function () {
showTooltip('Defender', 'Special ability - \'Ultimate Defence\': Creates an impenetrable cover around the ship, protecting from any damages');
_global.playsfx('onroll');
};
Qsht.onRollOver = function () {
showTooltip('Assault', 'Special ability - \'Annihilating Flash\': Flash destroys all enemies around the ship');
_global.playsfx('onroll');
};
Qtan.onRollOver = function () {
showTooltip('Tank', 'Special ability - \'Neutron Acceleration\': Temporarily increases rate of fire');
_global.playsfx('onroll');
};
Qsca.onRollOver = function () {
showTooltip('Scout', 'Special ability - \'Time Bomb\': Slows down all objects in system except the hero, restores a shield');
_global.playsfx('onroll');
};
Qsca.onRollOut = function () {
hideTooltip();
};
Qtan.onRollOut = Qsca.onRollOut;
Qsht.onRollOut = Qsca.onRollOut;
Qdef.onRollOut = Qsca.onRollOut;
Qwar.onRollOut = Qsca.onRollOut;
var pathToRoot = _root;
var tooltip_mc;
var paddingX = 0;
var paddingY = 20;
var gameWidth = 650;
var gameHeight = 400;
}
}
movieClip 382 {
}
movieClip 384 {
}
frame 5 {
function showTooltip(_msg_head, _msg_body) {
++lev2;
tooltip_mc = pathToRoot.attachMovie('tooltip', 'tooltip' + lev2, lev2);
tooltip_mc.head_txt.text = _msg_head;
tooltip_mc.body_txt.text = _msg_body;
tooltip_mc.head_txt.autoSize = true;
tooltip_mc.body_txt.autoSize = true;
tooltip_mc.bg_mc._width = 200;
tooltip_mc.head_txt._width = 190;
tooltip_mc.body_txt._width = 190;
var v2 = tooltip_mc.head_txt._height + tooltip_mc.body_txt._height + 10;
var v3 = tooltip_mc.body_txt._width + 10;
tooltip_mc.bg_mc._height = v2;
tooltip_mc._x = -tooltip_mc._width;
tooltip_mc._y = -tooltip_mc._height;
tooltip_mc.onEnterFrame = function () {
this.tempX = pathToRoot._xmouse + paddingX;
this.tempY = pathToRoot._ymouse + paddingY;
if (this.tempX + tooltip_mc._width > gameWidth) {
this._x = this.tempX - tooltip_mc._width;
} else {
this._x = this.tempX;
}
if (this.tempY + tooltip_mc._height > gameHeight) {
this._y = this.tempY - tooltip_mc._height - paddingY;
} else {
this._y = this.tempY;
}
};
}
function hideTooltip() {
delete tooltip_mc.onEnterFrame;
removeMovieClip(tooltip_mc);
}
stop();
if (_global.system21stat == 0) {
herob._visible = false;
menub._visible = false;
allthere._visible = false;
konec_mc._visible = true;
} else {
herob._visible = true;
menub._visible = true;
allthere._visible = true;
konec_mc._visible = false;
}
_global.perehod = 0;
if (_global.SoundM != false) {
if (_global.systema != 1) {
msystem.stop();
mpause.stop();
mbos.stop();
mmenu.start(0, 500);
}
}
min1.text = _global.GAS + '/300';
min2.text = _global.MIN + '/150';
min3.text = _global.BIO + '/50';
_global.kill1 = 0;
_global.timeall = 0;
var ggoo = 0;
if (_global.systema == 1) {
allthere.ccuu._x = allthere.sys1._x;
allthere.ccuu._y = allthere.sys1._y;
allthere.cpmc.text = 'Adara Planetary System #1';
}
if (_global.systema == 2) {
allthere.ccuu._x = allthere.sys2._x;
allthere.ccuu._y = allthere.sys2._y;
allthere.cpmc.text = 'Leen Planetary System #2';
}
if (_global.systema == 3) {
allthere.ccuu._x = allthere.sys3._x;
allthere.ccuu._y = allthere.sys3._y;
allthere.cpmc.text = 'Dessa Planetary System #3';
}
if (_global.systema == 4) {
allthere.ccuu._x = allthere.sys4._x;
allthere.ccuu._y = allthere.sys4._y;
allthere.cpmc.text = 'Yvor Planetary System #4';
}
if (_global.systema == 5) {
allthere.ccuu._x = allthere.sys5._x;
allthere.ccuu._y = allthere.sys5._y;
allthere.cpmc.text = 'Procyon Planetary System #5';
}
if (_global.systema == 6) {
allthere.ccuu._x = allthere.sys6._x;
allthere.ccuu._y = allthere.sys6._y;
allthere.cpmc.text = 'Spire Planetary System #6';
}
if (_global.systema == 7) {
allthere.ccuu._x = allthere.sys7._x;
allthere.ccuu._y = allthere.sys7._y;
allthere.cpmc.text = 'Autares Planetary System #7';
}
if (_global.systema == 8) {
allthere.ccuu._x = allthere.sys8._x;
allthere.ccuu._y = allthere.sys8._y;
allthere.cpmc.text = 'Caph Planetary System #8';
}
if (_global.systema == 9) {
allthere.ccuu._x = allthere.sys9._x;
allthere.ccuu._y = allthere.sys9._y;
allthere.cpmc.text = 'Wei Planetary System #9';
}
if (_global.systema == 10) {
allthere.ccuu._x = allthere.sys10._x;
allthere.ccuu._y = allthere.sys10._y;
allthere.cpmc.text = 'Phecda Planetary System #10';
}
if (_global.systema == 11) {
allthere.ccuu._x = allthere.sys11._x;
allthere.ccuu._y = allthere.sys11._y;
allthere.cpmc.text = 'Avior Planetary System #11';
}
if (_global.systema == 12) {
allthere.ccuu._x = allthere.sys12._x;
allthere.ccuu._y = allthere.sys12._y;
allthere.cpmc.text = 'Doradus Planetary System #12';
}
if (_global.systema == 13) {
allthere.ccuu._x = allthere.sys13._x;
allthere.ccuu._y = allthere.sys13._y;
allthere.cpmc.text = 'Guilar Planetary System #13';
}
if (_global.systema == 14) {
allthere.ccuu._x = allthere.sys14._x;
allthere.ccuu._y = allthere.sys14._y;
allthere.cpmc.text = 'Naos Planetary System #14';
}
if (_global.systema == 15) {
allthere.ccuu._x = allthere.sys15._x;
allthere.ccuu._y = allthere.sys15._y;
allthere.cpmc.text = 'Saiph Planetary System #15';
}
if (_global.systema == 16) {
allthere.ccuu._x = allthere.sys16._x;
allthere.ccuu._y = allthere.sys16._y;
allthere.cpmc.text = 'Colonis Planetary System #16';
}
if (_global.systema == 17) {
allthere.ccuu._x = allthere.sys17._x;
allthere.ccuu._y = allthere.sys17._y;
allthere.cpmc.text = 'Teon Planetary System #17';
}
if (_global.systema == 18) {
allthere.ccuu._x = allthere.sys18._x;
allthere.ccuu._y = allthere.sys18._y;
allthere.cpmc.text = 'Saphire Planetary System #18';
}
if (_global.systema == 19) {
allthere.ccuu._x = allthere.sys19._x;
allthere.ccuu._y = allthere.sys19._y;
allthere.cpmc.text = 'Ortas Planetary System #19';
}
if (_global.systema == 20) {
allthere.ccuu._x = allthere.sys20._x;
allthere.ccuu._y = allthere.sys20._y;
allthere.cpmc.text = 'Enif Planetary System #20';
}
if (_global.systema == 21) {
allthere.ccuu._x = allthere.sys21._x;
allthere.ccuu._y = allthere.sys21._y;
allthere.cpmc.text = 'Xilar Planetary System #21';
}
if (_global.system2stat == 2) {
_global.system2stat == 1;
}
if (_global.system3stat == 2) {
_global.system3stat == 1;
}
if (_global.system4stat == 2) {
_global.system4stat == 1;
}
if (_global.system5stat == 2) {
_global.system5stat == 1;
}
if (_global.system6stat == 2) {
_global.system6stat == 1;
}
if (_global.system7stat == 2) {
_global.system7stat == 1;
}
if (_global.system8stat == 2) {
_global.system8stat == 1;
}
if (_global.system9stat == 2) {
_global.system9stat == 1;
}
if (_global.system10stat == 2) {
_global.system10stat == 1;
}
if (_global.system11stat == 2) {
_global.system11stat == 1;
}
if (_global.system12stat == 2) {
_global.system12stat == 1;
}
if (_global.system13stat == 2) {
_global.system13stat == 1;
}
if (_global.system14stat == 2) {
_global.system14stat == 1;
}
if (_global.system15stat == 2) {
_global.system15stat == 1;
}
if (_global.system16stat == 2) {
_global.system16stat == 1;
}
if (_global.system17stat == 2) {
_global.system17stat == 1;
}
if (_global.system18stat == 2) {
_global.system18stat == 1;
}
if (_global.system19stat == 2) {
_global.system19stat == 1;
}
if (_global.system20stat == 2) {
_global.system20stat == 1;
}
if (_global.system21stat == 2) {
_global.system21stat == 1;
}
save_so = function () {
var v2 = SharedObject.getLocal('spiteful_space_save', '/');
v2.data.Saved = 1;
v2.data.syst1 = _global.system1stat;
v2.data.syst2 = _global.system2stat;
v2.data.syst3 = _global.system3stat;
v2.data.syst4 = _global.system4stat;
v2.data.syst5 = _global.system5stat;
v2.data.syst6 = _global.system6stat;
v2.data.syst7 = _global.system7stat;
v2.data.syst8 = _global.system8stat;
v2.data.syst9 = _global.system9stat;
v2.data.syst10 = _global.system10stat;
v2.data.syst11 = _global.system11stat;
v2.data.syst12 = _global.system12stat;
v2.data.syst13 = _global.system13stat;
v2.data.syst14 = _global.system14stat;
v2.data.syst15 = _global.system15stat;
v2.data.syst16 = _global.system16stat;
v2.data.syst17 = _global.system17stat;
v2.data.syst18 = _global.system18stat;
v2.data.syst19 = _global.system19stat;
v2.data.syst20 = _global.system20stat;
v2.data.syst21 = _global.system21stat;
v2.data.arm = _global.arm;
v2.data.def = _global.def;
v2.data.spe = _global.spe;
v2.data.str = _global.str;
v2.data.rad = _global.rad;
v2.data.hername = _global.hername;
v2.data.herlvl = _global.herlvl;
v2.data.hertottime = _global.hertottime;
v2.data.herkill = _global.herkill;
v2.data.herdeath = _global.herdeath;
v2.data.perstype = _global.perstype;
v2.data.MIN = _global.MIN;
v2.data.GAS = _global.GAS;
v2.data.BIO = _global.BIO;
v2.data.systema = _global.systema;
v2.data.rokmax = _global.rokmax;
v2.data.uR = _global.uR;
v2.data.uG = _global.uG;
v2.data.uB = _global.uB;
v2.data.uRa = _global.uRa;
v2.data.uE = _global.uE;
v2.data.uS = _global.uS;
v2.data.uSt = _global.uSt;
v2.flush();
};
save_so();
if (_global.system2stat == 1) {
_global.system2stat = 2;
}
if (_global.system2stat == 0) {
if (_global.system1stat == 1) {
_global.system1stat = 2;
}
if (_global.system3stat == 1) {
_global.system3stat = 2;
}
if (_global.system4stat == 1) {
_global.system4stat = 2;
}
}
if (_global.system3stat == 0) {
if (_global.system2stat == 1) {
_global.system2stat = 2;
}
}
if (_global.system4stat == 0) {
if (_global.system2stat == 1) {
_global.system2stat = 2;
}
if (_global.system5stat == 1) {
_global.system5stat = 2;
}
}
if (_global.system5stat == 0) {
if (_global.system4stat == 1) {
_global.system4stat = 2;
}
if (_global.system6stat == 1) {
_global.system6stat = 2;
}
if (_global.system7stat == 1) {
_global.system7stat = 2;
}
}
if (_global.system6stat == 0) {
if (_global.system5stat == 1) {
_global.system5stat = 2;
}
}
if (_global.system7stat == 0) {
if (_global.system5stat == 1) {
_global.system5stat = 2;
}
if (_global.system8stat == 1) {
_global.system8stat = 2;
}
}
if (_global.system8stat == 0) {
if (_global.system7stat == 1) {
_global.system7stat = 2;
}
if (_global.system9stat == 1) {
_global.system9stat = 2;
}
}
if (_global.system9stat == 0) {
if (_global.system8stat == 1) {
_global.system8stat = 2;
}
if (_global.system10stat == 1) {
_global.system10stat = 2;
}
}
if (_global.system10stat == 0) {
if (_global.system9stat == 1) {
_global.system9stat = 2;
}
if (_global.system11stat == 1) {
_global.system11stat = 2;
}
if (_global.system12stat == 1) {
_global.system12stat = 2;
}
if (_global.system13stat == 1) {
_global.system13stat = 2;
}
}
if (_global.system11stat == 0) {
if (_global.system10stat == 1) {
_global.system10stat = 2;
}
}
if (_global.system12stat == 0) {
if (_global.system10stat == 1) {
_global.system10stat = 2;
}
if (_global.system14stat == 1) {
_global.system14stat = 2;
}
}
if (_global.system13stat == 0) {
if (_global.system10stat == 1) {
_global.system10stat = 2;
}
if (_global.system14stat == 1) {
_global.system14stat = 2;
}
}
if (_global.system14stat == 0) {
if (_global.system12stat == 1) {
_global.system12stat = 2;
}
if (_global.system13stat == 1) {
_global.system13stat = 2;
}
if (_global.system15stat == 1) {
_global.system15stat = 2;
}
if (_global.system16stat == 1) {
_global.system16stat = 2;
}
}
if (_global.system15stat == 0) {
if (_global.system14stat == 1) {
_global.system14stat = 2;
}
}
if (_global.system16stat == 0) {
if (_global.system14stat == 1) {
_global.system14stat = 2;
}
if (_global.system17stat == 1) {
_global.system17stat = 2;
}
}
if (_global.system17stat == 0) {
if (_global.system16stat == 1) {
_global.system16stat = 2;
}
if (_global.system18stat == 1) {
_global.system18stat = 2;
}
if (_global.system19stat == 1) {
_global.system19stat = 2;
}
if (_global.system20stat == 1) {
_global.system20stat = 2;
}
}
if (_global.system18stat == 0) {
if (_global.system17stat == 1) {
_global.system17stat = 2;
}
}
if (_global.system19stat == 0) {
if (_global.system17stat == 1) {
_global.system17stat = 2;
}
}
if (_global.system20stat == 0) {
if (_global.system17stat == 1) {
_global.system17stat = 2;
}
if (_global.system21stat == 1) {
_global.system21stat = 2;
}
}
if (_global.system21stat == 0) {
if (_global.system20stat == 1) {
_global.system20stat = 2;
}
}
var colorful = new Color(allthere.sys1.s1);
if (_global.system1stat == 0) {
colorful.setRGB(65280);
}
if (_global.system1stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system1stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys2.s2);
if (_global.system2stat == 0) {
colorful.setRGB(65280);
}
if (_global.system2stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system2stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys3.s3);
if (_global.system3stat == 0) {
colorful.setRGB(65280);
}
if (_global.system3stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system3stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys4.s4);
if (_global.system4stat == 0) {
colorful.setRGB(65280);
}
if (_global.system4stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system4stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys5.s5);
if (_global.system5stat == 0) {
colorful.setRGB(65280);
}
if (_global.system5stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system5stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys6.s6);
if (_global.system6stat == 0) {
colorful.setRGB(65280);
}
if (_global.system6stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system6stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys7.s7);
if (_global.system7stat == 0) {
colorful.setRGB(65280);
}
if (_global.system7stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system7stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys8.s8);
if (_global.system8stat == 0) {
colorful.setRGB(65280);
}
if (_global.system8stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system8stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys9.s9);
if (_global.system9stat == 0) {
colorful.setRGB(65280);
}
if (_global.system9stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system9stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys10.s10);
if (_global.system10stat == 0) {
colorful.setRGB(65280);
}
if (_global.system10stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system10stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys11.s11);
if (_global.system11stat == 0) {
colorful.setRGB(65280);
}
if (_global.system11stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system11stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys12.s12);
if (_global.system12stat == 0) {
colorful.setRGB(65280);
}
if (_global.system12stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system12stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys13.s13);
if (_global.system13stat == 0) {
colorful.setRGB(65280);
}
if (_global.system13stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system13stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys14.s14);
if (_global.system14stat == 0) {
colorful.setRGB(65280);
}
if (_global.system14stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system14stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys15.s15);
if (_global.system15stat == 0) {
colorful.setRGB(65280);
}
if (_global.system15stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system15stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys16.s16);
if (_global.system16stat == 0) {
colorful.setRGB(65280);
}
if (_global.system16stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system16stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys17.s17);
if (_global.system17stat == 0) {
colorful.setRGB(65280);
}
if (_global.system17stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system17stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys18.s18);
if (_global.system18stat == 0) {
colorful.setRGB(65280);
}
if (_global.system18stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system18stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys19.s19);
if (_global.system19stat == 0) {
colorful.setRGB(65280);
}
if (_global.system19stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system19stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys20.s20);
if (_global.system20stat == 0) {
colorful.setRGB(65280);
}
if (_global.system20stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system20stat == 2) {
colorful.setRGB(39167);
}
var colorful = new Color(allthere.sys21.s21);
if (_global.system21stat == 0) {
colorful.setRGB(65280);
}
if (_global.system21stat == 1) {
colorful.setRGB(16711680);
}
if (_global.system21stat == 2) {
colorful.setRGB(39167);
}
heroab._visible = false;
menuab._visible = false;
ti1 = 0;
allthere.r1mc.text = Math.floor(Math.random() * 100) / 10 + ' As/n';
ti2 = 0;
allthere.r2mc.text = Math.floor(Math.random() * 999) + ' K';
ti3 = 0;
allthere.r3mc.text = Math.floor(Math.random() * 10000) / 200 + ' ox';
ti4 = 0;
allthere.r4mc.text = Math.floor(Math.random() * 1000) + ' oyR';
ti5 = 0;
allthere.r5mc.text = Math.floor(Math.random() * 100) + ' na';
onMouseMove = function () {
allthere.xmc.text = _xmouse + ' x';
allthere.ymc.text = _ymouse + ' y';
allthere.zmc.text = Math.floor(Math.sqrt(_xmouse * _ymouse)) + ' z';
ti1 = 20;
ti2 = 20;
ti3 = 20;
ti4 = 20;
ti5 = 20;
};
var ti1 = 0;
var ti2 = 0;
var ti3 = 0;
var ti4 = 0;
var ti5 = 0;
if (_global.newG == 1) {
_global.newG = 2;
} else {
back._visible = false;
}
allthere._yscale = 0;
allthere._xscale = 0;
onEnterFrame = function () {
if (_global.perehod == 1) {
gotoAndPlay(5);
}
if (_global.perehod == 2) {
gotoAndPlay(1);
}
if (ti1++ > 30) {
ti1 = 0;
allthere.r1mc.text = Math.floor(Math.random() * 100) / 10 + ' As/n';
}
if (ti2++ > 20) {
ti2 = 0;
allthere.r2mc.text = Math.floor(Math.random() * 999) + ' K';
}
if (ti3++ > 40) {
ti3 = 0;
allthere.r3mc.text = Math.floor(Math.random() * 10000) / 200 + ' ox';
}
if (ti4++ > 15) {
ti4 = 0;
allthere.r4mc.text = Math.floor(Math.random() * 1000) + ' oyR';
}
if (ti5++ > 5) {
ti5 = 0;
allthere.r5mc.text = Math.floor(Math.random() * 100) + ' na';
}
if (back._alpha > 0 && back._visible) {
back._alpha -= 10;
} else {
back._visible = false;
}
if (allthere._xscale != 100 && ggoo == 0) {
allthere._yscale += 10;
allthere._xscale = allthere._yscale;
}
if (ggoo == 1) {
if (allthere._xscale != 0) {
allthere._yscale -= 10;
allthere._xscale = allthere._yscale;
} else {
ggoo = 2;
}
}
};
var pathToRoot = _root;
var tooltip_mc;
var paddingX = 0;
var paddingY = 20;
var gameWidth = 650;
var gameHeight = 400;
allthere.sys1.onRollOver = function () {
showTooltip('Adara Planetary System', 'Training System.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys1.onRollOut = box1_btn.onDragOut;
allthere.sys2.onRollOver = function () {
showTooltip('Leen Planetary System', 'Difficulty level 1.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys2.onRollOut = box1_btn.onDragOut;
allthere.sys3.onRollOver = function () {
showTooltip('Dessa Planetary System', 'Difficulty level 1.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys3.onRollOut = box1_btn.onDragOut;
allthere.sys4.onRollOver = function () {
showTooltip('Yvor Planetary System', 'Difficulty level 1.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys4.onRollOut = box1_btn.onDragOut;
allthere.sys5.onRollOver = function () {
showTooltip('Procyon Planetary System', 'Difficulty level 2.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys5.onRollOut = box1_btn.onDragOut;
allthere.sys6.onRollOver = function () {
showTooltip('Spire Planetary System', 'Difficulty level 2.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys6.onRollOut = box1_btn.onDragOut;
allthere.sys7.onRollOver = function () {
showTooltip('Autares Planetary System', 'Difficulty level 2.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys7.onRollOut = box1_btn.onDragOut;
allthere.sys8.onRollOver = function () {
showTooltip('Caph Planetary System', 'Difficulty level 3.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys8.onRollOut = box1_btn.onDragOut;
allthere.sys9.onRollOver = function () {
showTooltip('Wei Planetary System', 'Difficulty level 3. Boss System.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys9.onRollOut = box1_btn.onDragOut;
allthere.sys10.onRollOver = function () {
showTooltip('Phecda Planetary System', 'Difficulty level 4.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys10.onRollOut = box1_btn.onDragOut;
allthere.sys11.onRollOver = function () {
showTooltip('Avior Planetary System', 'Difficulty level 3.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys11.onRollOut = box1_btn.onDragOut;
allthere.sys12.onRollOver = function () {
showTooltip('Doradus Planetary System', 'Difficulty level 4.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys12.onRollOut = box1_btn.onDragOut;
allthere.sys13.onRollOver = function () {
showTooltip('Guilar Planetary System', 'Difficulty level 4.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys13.onRollOut = box1_btn.onDragOut;
allthere.sys14.onRollOver = function () {
showTooltip('Naos Planetary System', 'Difficulty level 5.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys14.onRollOut = box1_btn.onDragOut;
allthere.sys15.onRollOver = function () {
showTooltip('Saiph Planetary System', 'Difficulty level 5. Boss System.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys15.onRollOut = box1_btn.onDragOut;
allthere.sys16.onRollOver = function () {
showTooltip('Colonis Planetary System', 'Difficulty level 5.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys16.onRollOut = box1_btn.onDragOut;
allthere.sys17.onRollOver = function () {
showTooltip('Teon Planetary System', 'Difficulty level 6.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys17.onRollOut = box1_btn.onDragOut;
allthere.sys18.onRollOver = function () {
showTooltip('Saphire Planetary System', 'Difficulty level 6.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys18.onRollOut = box1_btn.onDragOut;
allthere.sys19.onRollOver = function () {
showTooltip('Ortas Planetary System', 'Difficulty level 6.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys19.onRollOut = box1_btn.onDragOut;
allthere.sys20.onRollOver = function () {
showTooltip('Enif Planetary System', 'Difficulty level 7.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys20.onRollOut = box1_btn.onDragOut;
allthere.sys21.onRollOver = function () {
showTooltip('Xilar Planetary System', 'Difficulty level 8. Final destination.');
};
box1_btn.onDragOut = function () {
hideTooltip();
};
allthere.sys21.onRollOut = box1_btn.onDragOut;
allthere.sys1.onRelease = function () {
if (_global.system1stat == 2) {
_global.systema = 1;
hideTooltip();
save_so();
gotoAndPlay(6);
}
};
allthere.sys2.onRelease = function () {
if (_global.system2stat == 2) {
_global.systema = 2;
hideTooltip();
save_so();
gotoAndPlay(6);
}
};
allthere.sys3.onRelease = function () {
if (_global.system3stat == 2) {
_global.systema = 3;
hideTooltip();
save_so();
gotoAndPlay(6);
}
};
allthere.sys4.onRelease = function () {
if (_global.system4stat == 2) {
_global.systema = 4;
hideTooltip();
save_so();
gotoAndPlay(6);
}
};
allthere.sys5.onRelease = function () {
if (_global.system5stat == 2) {
_global.systema = 5;
hideTooltip();
save_so();
gotoAndPlay(7);
}
};
allthere.sys6.onRelease = function () {
if (_global.system6stat == 2) {
_global.systema = 6;
hideTooltip();
save_so();
gotoAndPlay(7);
}
};
allthere.sys7.onRelease = function () {
if (_global.system7stat == 2) {
_global.systema = 7;
hideTooltip();
save_so();
gotoAndPlay(7);
}
};
allthere.sys8.onRelease = function () {
if (_global.system8stat == 2) {
_global.systema = 8;
hideTooltip();
save_so();
gotoAndPlay(8);
}
};
allthere.sys9.onRelease = function () {
if (_global.system9stat == 2) {
_global.systema = 9;
hideTooltip();
save_so();
gotoAndPlay(8);
}
};
allthere.sys10.onRelease = function () {
if (_global.system10stat == 2) {
_global.systema = 10;
hideTooltip();
save_so();
gotoAndPlay(9);
}
};
allthere.sys11.onRelease = function () {
if (_global.system11stat == 2) {
_global.systema = 11;
hideTooltip();
save_so();
gotoAndPlay(8);
}
};
allthere.sys12.onRelease = function () {
if (_global.system12stat == 2) {
_global.systema = 12;
hideTooltip();
save_so();
gotoAndPlay(9);
}
};
allthere.sys13.onRelease = function () {
if (_global.system13stat == 2) {
_global.systema = 13;
hideTooltip();
save_so();
gotoAndPlay(9);
}
};
allthere.sys14.onRelease = function () {
if (_global.system14stat == 2) {
_global.systema = 14;
hideTooltip();
save_so();
gotoAndPlay(10);
}
};
allthere.sys15.onRelease = function () {
if (_global.system15stat == 2) {
_global.systema = 15;
hideTooltip();
save_so();
gotoAndPlay(10);
}
};
allthere.sys16.onRelease = function () {
if (_global.system16stat == 2) {
_global.systema = 16;
hideTooltip();
save_so();
gotoAndPlay(10);
}
};
allthere.sys17.onRelease = function () {
if (_global.system17stat == 2) {
_global.systema = 17;
hideTooltip();
save_so();
gotoAndPlay(11);
}
};
allthere.sys18.onRelease = function () {
if (_global.system18stat == 2) {
_global.systema = 18;
hideTooltip();
save_so();
gotoAndPlay(11);
}
};
allthere.sys19.onRelease = function () {
if (_global.system19stat == 2) {
_global.systema = 19;
hideTooltip();
save_so();
gotoAndPlay(11);
}
};
allthere.sys20.onRelease = function () {
if (_global.system20stat == 2) {
_global.systema = 20;
hideTooltip();
save_so();
gotoAndPlay(12);
}
};
allthere.sys21.onRelease = function () {
if (_global.system21stat == 2) {
_global.systema = 21;
hideTooltip();
save_so();
gotoAndPlay(13);
}
};
}
movieClip 387 {
}
movieClip 388 {
}
movieClip 391 {
}
movieClip 393 {
}
movieClip 395 {
}
movieClip 396 {
}
movieClip 398 {
}
movieClip 399 {
}
movieClip 400 {
}
movieClip 401 {
}
movieClip 402 {
}
movieClip 403 {
}
movieClip 404 {
}
movieClip 405 {
}
movieClip 406 {
}
movieClip 407 {
}
movieClip 408 {
}
movieClip 409 {
}
movieClip 410 {
}
movieClip 411 {
}
movieClip 412 {
}
movieClip 413 {
}
movieClip 414 {
}
movieClip 415 {
}
movieClip 416 {
}
movieClip 417 {
}
movieClip 418 {
}
movieClip 419 {
}
movieClip 420 {
}
movieClip 421 {
}
movieClip 422 {
}
movieClip 423 {
}
movieClip 424 {
}
movieClip 425 {
}
movieClip 426 {
}
movieClip 427 {
}
movieClip 428 {
}
movieClip 429 {
}
movieClip 430 {
}
movieClip 431 {
}
movieClip 432 {
}
movieClip 433 {
}
movieClip 434 {
}
movieClip 435 {
}
movieClip 436 {
}
movieClip 437 {
}
movieClip 438 {
}
movieClip 439 {
}
movieClip 440 {
}
movieClip 441 {
}
movieClip 442 {
}
movieClip 443 {
}
movieClip 444 {
}
movieClip 445 {
}
movieClip 446 {
}
movieClip 447 {
}
movieClip 448 {
}
movieClip 450 {
}
movieClip 452 {
}
movieClip 453 {
}
movieClip 454 {
}
movieClip 455 {
}
movieClip 456 {
}
movieClip 457 {
}
movieClip 458 {
}
movieClip 459 {
}
// unknown tag 88 length 146
// unknown tag 88 length 151
movieClip 479 {
}
movieClip 481 {
}
movieClip 483 {
instance sys21 of movieClip 453 {
}
}
movieClip 486 {
}
// unknown tag 88 length 67
button 491 {
on (release) {
if (_global.SoundM != false) {
_global.playsfx('panelmove');
}
if (!_parent.menuab._visible) {
if (_global.pauseall) {
_global.pauseall = false;
setPause(false);
_global.step = _global.steptmp;
_parent.cap1.gotoAndPlay(80);
_parent.mpause.stop();
if (_global.SoundM != false) {
_parent.msystem.start(0, 500);
}
} else {
_global.pauseall = true;
setPause(true);
_global.steptmp = _global.step;
_global.step = 0;
_parent.cap1.cap11.cap111.text = 'PAUSED';
_parent.cap1.gotoAndPlay(1);
_parent.msystem.stop();
if (_global.SoundM != false) {
_parent.mpause.start(0, 500);
}
}
}
if (!_parent.heroab._visible) {
_parent.menuab._visible = false;
if (_global.SAE == 2 && _global.perstype == 1) {
_root.stren /= 3;
}
_parent.heroab._visible = true;
_parent.heroab.gotoAndPlay(1);
_parent.bokovuha._visible = false;
_root.ggoo = 1;
} else {
if (_global.SAE == 2 && _global.perstype == 1) {
_root.stren *= 3;
}
_parent.heroab._visible = false;
_parent.bokovuha._visible = true;
_parent.bokovuha.gotoAndPlay(1);
_root.ggoo = 0;
}
}
}
movieClip 494 {
}
movieClip 495 {
}
movieClip 504 {
}
movieClip 505 {
}
movieClip 508 {
}
movieClip 510 {
}
button 512 {
on (release) {
_global.playsfx('panelmove');
_root.heroab.gotoAndStop(3);
}
}
movieClip 515 {
}
movieClip 516 {
}
movieClip 519 {
}
movieClip 520 {
}
movieClip 521 {
}
movieClip 524 {
}
movieClip 525 {
}
movieClip 528 {
}
movieClip 529 {
}
movieClip 532 {
}
movieClip 533 {
}
movieClip 536 {
}
movieClip 537 {
}
movieClip 545 {
frame 1 {
this._yscale = 0;
onEnterFrame = function () {
if (this._yscale < 100) {
this._yscale += 20;
}
};
tttxt.text = 'total time ' + (_global.hertottime + _global.timeall) + ' s.';
tkilltxt.text = _global.herkill + _global.kill1 + ' kills';
tdeathtxt.text = _global.herdeath + ' death';
tlvltxt.text = _global.herlvl + ' score';
tnametxt.text = _global.hername;
switch (_global.uR) {
case 1:
var myList = rokmc.filters;
myList[0].strength = 0;
rokmc.filters = myList;
rokettxt.text = 'Missile 1lvl';
break;
case 2:
var myList = rokmc.filters;
myList[0].strength = 1;
rokmc.filters = myList;
rokettxt.text = 'Missile 2lvl';
break;
case 3:
var myList = rokmc.filters;
myList[0].strength = 2;
rokmc.filters = myList;
rokettxt.text = 'Missile 3lvl';
}
switch (_global.uG) {
case 1:
var myList = gunmc.filters;
myList[0].strength = 0;
gunmc.filters = myList;
guntxt.text = 'Gun 1lvl';
break;
case 2:
var myList = gunmc.filters;
myList[0].strength = 1;
gunmc.filters = myList;
guntxt.text = 'Gun 2lvl';
break;
case 3:
var myList = gunmc.filters;
myList[0].strength = 2;
gunmc.filters = myList;
guntxt.text = 'Gun 3lvl';
}
switch (_global.uB) {
case 1:
var myList = boomc.filters;
myList[0].strength = 0;
myList[0].blurY = 5;
myList[0].blurX = 5;
boomc.filters = myList;
boostertxt.text = 'Booster 1lvl';
break;
case 2:
var myList = boomc.filters;
myList[0].strength = 1;
myList[0].blurY = 5;
myList[0].blurX = 5;
boomc.filters = myList;
boostertxt.text = 'Booster 2lvl';
break;
case 3:
var myList = boomc.filters;
myList[0].strength = 2;
myList[0].blurY = 5;
myList[0].blurX = 5;
boomc.filters = myList;
boostertxt.text = 'Booster 3lvl';
break;
case 4:
var myList = boomc.filters;
myList[0].strength = 2;
myList[0].blurY = 7;
myList[0].blurX = 7;
boomc.filters = myList;
boostertxt.text = 'Booster 4lvl';
}
switch (_global.uRa) {
case 1:
var myList = radmc.filters;
myList[0].strength = 0;
myList[0].blurY = 5;
myList[0].blurX = 5;
radmc.filters = myList;
radartxt.text = 'Radar 1lvl';
break;
case 2:
var myList = radmc.filters;
myList[0].strength = 1;
myList[0].blurY = 5;
myList[0].blurX = 5;
radmc.filters = myList;
radartxt.text = 'Radar 2lvl';
break;
case 3:
var myList = radmc.filters;
myList[0].strength = 2;
myList[0].blurY = 5;
myList[0].blurX = 5;
radmc.filters = myList;
radartxt.text = 'Radar 3lvl';
break;
case 4:
var myList = radmc.filters;
myList[0].strength = 2;
myList[0].blurY = 7;
myList[0].blurX = 7;
radmc.filters = myList;
radartxt.text = 'Radar 4lvl';
}
switch (_global.uE) {
case 1:
var myList = engmc.filters;
myList[0].strength = 0;
myList[0].blurY = 5;
myList[0].blurX = 5;
engmc.filters = myList;
enginetxt.text = 'Engine 1lvl';
break;
case 2:
var myList = engmc.filters;
myList[0].strength = 1;
myList[0].blurY = 5;
myList[0].blurX = 5;
engmc.filters = myList;
enginetxt.text = 'Engine 2lvl';
break;
case 3:
var myList = engmc.filters;
myList[0].strength = 2;
myList[0].blurY = 5;
myList[0].blurX = 5;
engmc.filters = myList;
enginetxt.text = 'Engine 3lvl';
break;
case 4:
var myList = engmc.filters;
myList[0].strength = 2;
myList[0].blurY = 7;
myList[0].blurX = 7;
engmc.filters = myList;
enginetxt.text = 'Engine 4lvl';
}
switch (_global.uS) {
case 1:
var myList = shimc.filters;
myList[0].strength = 0;
myList[0].blurY = 5;
myList[0].blurX = 5;
shimc.filters = myList;
shildtxt.text = 'Shield 1lvl';
break;
case 2:
var myList = shimc.filters;
myList[0].strength = 1;
myList[0].blurY = 5;
myList[0].blurX = 5;
shimc.filters = myList;
shildtxt.text = 'Shield 2lvl';
break;
case 3:
var myList = shimc.filters;
myList[0].strength = 2;
myList[0].blurY = 5;
myList[0].blurX = 5;
shimc.filters = myList;
shildtxt.text = 'Shield 3lvl';
break;
case 4:
var myList = shimc.filters;
myList[0].strength = 2;
myList[0].blurY = 7;
myList[0].blurX = 7;
shimc.filters = myList;
shildtxt.text = 'Shield 4lvl';
break;
case 5:
var myList = shimc.filters;
myList[0].strength = 2;
myList[0].blurY = 10;
myList[0].blurX = 10;
shimc.filters = myList;
shildtxt.text = 'Shield 5lvl';
break;
case 6:
var myList = shimc.filters;
myList[0].strength = 2;
myList[0].blurY = 15;
myList[0].blurX = 15;
shimc.filters = myList;
shildtxt.text = 'Shield 6lvl';
}
switch (_global.uSt) {
case 1:
var myList = strumc.filters;
myList[0].strength = 0;
myList[0].blurY = 5;
myList[0].blurX = 5;
strumc.filters = myList;
structuretxt.text = 'Structure 1lvl';
break;
case 2:
var myList = strumc.filters;
myList[0].strength = 1;
myList[0].blurY = 5;
myList[0].blurX = 5;
strumc.filters = myList;
structuretxt.text = 'Structure 2lvl';
break;
case 3:
var myList = strumc.filters;
myList[0].strength = 2;
myList[0].blurY = 5;
myList[0].blurX = 5;
strumc.filters = myList;
structuretxt.text = 'Structure 3lvl';
break;
case 4:
var myList = strumc.filters;
myList[0].strength = 2;
myList[0].blurY = 7;
myList[0].blurX = 7;
strumc.filters = myList;
structuretxt.text = 'Structure 4lvl';
break;
case 5:
var myList = strumc.filters;
myList[0].strength = 2;
myList[0].blurY = 10;
myList[0].blurX = 10;
strumc.filters = myList;
structuretxt.text = 'Structure 5lvl';
break;
case 6:
var myList = strumc.filters;
myList[0].strength = 2;
myList[0].blurY = 15;
myList[0].blurX = 15;
strumc.filters = myList;
structuretxt.text = 'Structure 6lvl';
}
}
}
movieClip 555 {
}
button 556 {
on (release) {
_global.playsfx('panelmove');
_root.heroab.gotoAndStop(2);
}
}
movieClip 562 {
frame 1 {
function showTooltip(_msg_head, _msg_body, _msg_res1, _msg_res2, _msg_res3) {
tooltip_mc = pathToRoot.attachMovie('tooltip2', 'tooltip2' + pathToRoot.getNextHighestDepth(), pathToRoot.getNextHighestDepth());
tooltip_mc.head_txt.text = _msg_head;
tooltip_mc.body_txt.text = _msg_body;
tooltip_mc.res1_txt.text = _msg_res1;
tooltip_mc.res2_txt.text = _msg_res2;
tooltip_mc.res3_txt.text = _msg_res3;
tooltip_mc.head_txt.autoSize = true;
tooltip_mc.body_txt.autoSize = true;
tooltip_mc.bg_mc._width = 200;
tooltip_mc.head_txt._width = 190;
tooltip_mc.body_txt._width = 190;
var v2 = tooltip_mc.head_txt._height + tooltip_mc.body_txt._height + 40;
var v3 = tooltip_mc.body_txt._width + 10;
tooltip_mc.bg_mc._height = v2;
tooltip_mc._x = -tooltip_mc._width;
tooltip_mc._y = -tooltip_mc._height;
tooltip_mc.onEnterFrame = function () {
this.tempX = pathToRoot._xmouse + 20 + paddingX;
this.tempY = pathToRoot._ymouse - 20 + paddingY;
if (this.tempX + tooltip_mc._width > gameWidth) {
this._x = this.tempX - tooltip_mc._width;
} else {
this._x = this.tempX;
}
if (this.tempY + tooltip_mc._height > gameHeight) {
this._y = this.tempY - tooltip_mc._height - paddingY;
} else {
this._y = this.tempY;
}
};
}
function hideTooltip() {
delete tooltip_mc.onEnterFrame;
removeMovieClip(tooltip_mc);
}
function krasit(a) {
switch (a) {
case ro2mc:
if (_global.uR == 1) {
var v4 = 10;
var v3 = 40;
var v2 = 5;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uR = 2;
al = 100;
_global.rokmax = 10;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case ro3mc:
if (_global.uR == 2) {
var v4 = 10;
var v3 = 40;
var v2 = 5;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uR = 3;
al = 100;
_global.rokmax = 15;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case gu2mc:
if (_global.uG == 1) {
var v4 = 30;
var v3 = 50;
var v2 = 25;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uG = 2;
al = 100;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case gu3mc:
if (_global.uG == 2) {
var v4 = 30;
var v3 = 50;
var v2 = 25;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uG = 3;
al = 100;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case boo2mc:
if (_global.uB == 1) {
var v4 = 15;
var v3 = 15;
var v2 = 15;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uB = 2;
al = 100;
_global.str += 0.5;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case boo3mc:
if (_global.uB == 2) {
var v4 = 15;
var v3 = 15;
var v2 = 15;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uB = 3;
al = 100;
_global.str += 0.5;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case boo4mc:
if (_global.uB == 3) {
var v4 = 15;
var v3 = 15;
var v2 = 15;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uB = 4;
al = 100;
_global.str += 0.5;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case rad2mc:
if (_global.uRa == 1) {
var v4 = 25;
var v3 = 15;
var v2 = 8;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uRa = 2;
al = 100;
_global.rad += 0.2;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case rad3mc:
if (_global.uRa == 2) {
var v4 = 25;
var v3 = 15;
var v2 = 8;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uRa = 3;
al = 100;
_global.rad += 0.2;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case rad4mc:
if (_global.uRa == 3) {
var v4 = 25;
var v3 = 15;
var v2 = 8;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uRa = 4;
al = 100;
_global.rad += 0.2;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case eng2mc:
if (_global.uE == 1) {
var v4 = 20;
var v3 = 25;
var v2 = 0;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uE = 2;
al = 100;
_global.spe += 0.3;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case eng3mc:
if (_global.uE == 2) {
var v4 = 20;
var v3 = 25;
var v2 = 0;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uE = 3;
al = 100;
_global.spe += 0.3;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case eng4mc:
if (_global.uE == 3) {
var v4 = 20;
var v3 = 25;
var v2 = 0;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uE = 4;
al = 100;
_global.spe += 0.3;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case shi2mc:
if (_global.uS == 1) {
var v4 = 10;
var v3 = 15;
var v2 = 0;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uS = 2;
al = 100;
_global.def += 20;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case shi3mc:
if (_global.uS == 2) {
var v4 = 10;
var v3 = 15;
var v2 = 0;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uS = 3;
al = 100;
_global.def += 20;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case shi4mc:
if (_global.uS == 3) {
var v4 = 10;
var v3 = 15;
var v2 = 0;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uS = 4;
al = 100;
_global.def += 20;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case shi5mc:
if (_global.uS == 4) {
var v4 = 10;
var v3 = 15;
var v2 = 0;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uS = 5;
al = 100;
_global.def += 20;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case shi6mc:
if (_global.uS == 5) {
var v4 = 10;
var v3 = 15;
var v2 = 0;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uS = 6;
al = 100;
_global.def += 20;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case stru2mc:
if (_global.uSt == 1) {
var v4 = 10;
var v3 = 15;
var v2 = 0;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uSt = 2;
al = 100;
_global.arm += 20;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case stru3mc:
if (_global.uSt == 2) {
var v4 = 10;
var v3 = 15;
var v2 = 0;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uSt = 3;
al = 100;
_global.arm += 20;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case stru4mc:
if (_global.uSt == 3) {
var v4 = 10;
var v3 = 15;
var v2 = 0;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uSt = 4;
al = 100;
_global.arm += 20;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case stru5mc:
if (_global.uSt == 4) {
var v4 = 10;
var v3 = 15;
var v2 = 0;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uSt = 5;
al = 100;
_global.arm += 20;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
break;
case stru6mc:
if (_global.uSt == 5) {
var v4 = 10;
var v3 = 15;
var v2 = 0;
if (_global.MIN >= v4 && _global.GAS >= v3 && _global.BIO >= v2) {
_global.MIN -= v4;
_global.GAS -= v3;
_global.BIO -= v2;
_global.uSt = 6;
al = 100;
_global.arm += 20;
_global.playsfx('upgraded');
} else {
_global.playsfx('nomoney');
}
} else {
_global.playsfx('nomoney');
}
}
strengthmc.text = 'Strength ' + _global.str;
criticalmc.text = 'Critical x' + _global.rad;
speedmc.text = 'Speed ' + _global.spe;
maxshildmc.text = 'Max shield ' + _global.def;
maxhpmc.text = 'Max hp ' + _global.arm;
}
this._yscale = 0;
onEnterFrame = function () {
if (this._yscale < 100) {
this._yscale += 20;
}
};
strengthmc.text = 'Strength ' + _global.str;
criticalmc.text = 'Critical x' + _global.rad;
speedmc.text = 'Speed ' + _global.spe;
maxshildmc.text = 'Max shield ' + _global.def;
maxhpmc.text = 'Max hp ' + _global.arm;
switch (_global.uR) {
case 2:
ro2mc._alpha = 100;
break;
case 3:
ro2mc._alpha = 100;
ro3mc._alpha = 100;
}
switch (_global.uG) {
case 2:
gu2mc._alpha = 100;
break;
case 3:
gu2mc._alpha = 100;
gu3mc._alpha = 100;
}
switch (_global.uB) {
case 2:
boo2mc._alpha = 100;
break;
case 3:
boo2mc._alpha = 100;
boo3mc._alpha = 100;
break;
case 4:
boo2mc._alpha = 100;
boo3mc._alpha = 100;
boo4mc._alpha = 100;
}
switch (_global.uRa) {
case 2:
rad2mc._alpha = 100;
break;
case 3:
rad2mc._alpha = 100;
rad3mc._alpha = 100;
break;
case 4:
rad2mc._alpha = 100;
rad3mc._alpha = 100;
rad4mc._alpha = 100;
}
switch (_global.uE) {
case 2:
eng2mc._alpha = 100;
break;
case 3:
eng2mc._alpha = 100;
eng3mc._alpha = 100;
break;
case 4:
eng2mc._alpha = 100;
eng3mc._alpha = 100;
eng4mc._alpha = 100;
}
switch (_global.uS) {
case 2:
shi2mc._alpha = 100;
break;
case 3:
shi2mc._alpha = 100;
shi3mc._alpha = 100;
break;
case 4:
shi2mc._alpha = 100;
shi3mc._alpha = 100;
shi4mc._alpha = 100;
break;
case 5:
shi2mc._alpha = 100;
shi3mc._alpha = 100;
shi4mc._alpha = 100;
shi5mc._alpha = 100;
break;
case 6:
shi2mc._alpha = 100;
shi3mc._alpha = 100;
shi4mc._alpha = 100;
shi5mc._alpha = 100;
shi6mc._alpha = 100;
}
switch (_global.uSt) {
case 2:
stru2mc._alpha = 100;
break;
case 3:
stru2mc._alpha = 100;
stru3mc._alpha = 100;
break;
case 4:
stru2mc._alpha = 100;
stru3mc._alpha = 100;
stru4mc._alpha = 100;
break;
case 5:
stru2mc._alpha = 100;
stru3mc._alpha = 100;
stru4mc._alpha = 100;
stru5mc._alpha = 100;
break;
case 6:
stru2mc._alpha = 100;
stru3mc._alpha = 100;
stru4mc._alpha = 100;
stru5mc._alpha = 100;
stru6mc._alpha = 100;
}
var pathToRoot = _root;
var tooltip_mc;
var paddingX = 0;
var paddingY = 20;
var gameWidth = 650;
var gameHeight = 400;
stru6mc.onRelease = function () {
krasit(this);
_root.min1.text = _global.GAS + '/300';
_root.min2.text = _global.MIN + '/150';
_root.min3.text = _global.BIO + '/50';
_root.roketi.ro.text = _root.rok + '/' + _global.rokmax;
_root.stren = _global.str;
};
stru5mc.onRelease = stru6mc.onRelease;
stru4mc.onRelease = stru6mc.onRelease;
stru3mc.onRelease = stru6mc.onRelease;
stru2mc.onRelease = stru6mc.onRelease;
stru1mc.onRelease = stru6mc.onRelease;
shi6mc.onRelease = stru6mc.onRelease;
shi5mc.onRelease = stru6mc.onRelease;
shi4mc.onRelease = stru6mc.onRelease;
shi3mc.onRelease = stru6mc.onRelease;
shi2mc.onRelease = stru6mc.onRelease;
shi1mc.onRelease = stru6mc.onRelease;
eng4mc.onRelease = stru6mc.onRelease;
eng3mc.onRelease = stru6mc.onRelease;
eng2mc.onRelease = stru6mc.onRelease;
eng1mc.onRelease = stru6mc.onRelease;
rad4mc.onRelease = stru6mc.onRelease;
rad3mc.onRelease = stru6mc.onRelease;
rad2mc.onRelease = stru6mc.onRelease;
rad1mc.onRelease = stru6mc.onRelease;
boo4mc.onRelease = stru6mc.onRelease;
boo3mc.onRelease = stru6mc.onRelease;
boo2mc.onRelease = stru6mc.onRelease;
boo1mc.onRelease = stru6mc.onRelease;
gu3mc.onRelease = stru6mc.onRelease;
gu2mc.onRelease = stru6mc.onRelease;
gu1mc.onRelease = stru6mc.onRelease;
ro3mc.onRelease = stru6mc.onRelease;
ro2mc.onRelease = stru6mc.onRelease;
ro1mc.onRelease = stru6mc.onRelease;
var al = 0;
stru6mc.onRollOver = function () {
this._yscale += 40;
this._xscale = this._yscale;
this._x -= 10;
this._y -= 10;
al = this._alpha;
this._alpha = 100;
switch (this) {
case ro1mc:
showTooltip('Missile lvl1 ', 'Gear for launching trilonian missiles with tandem fusion head. 5 missiles.', '40', '10', '5');
break;
case ro2mc:
showTooltip('Missile lvl2 ', 'Gear for launching trilonian missiles with tandem fusion head. 10 missiles.', '40', '10', '5');
break;
case ro3mc:
showTooltip('Missile lvl3 ', 'Gear for launching trilonian missiles with tandem fusion head. 15 missiles.', '40', '10', '5');
break;
case gu1mc:
showTooltip('Gun lvl1 ', 'Rail electric plasmatic cannon that produces beams of multi-dimensional sub-space particles. ', '50', '30', '25');
break;
case gu2mc:
showTooltip('Gun lvl2 ', 'Two rail electric plasmatic cannons that produce beams of multi-dimensional sub-space particles. ', '50', '30', '25');
break;
case gu3mc:
showTooltip('Gun lvl3 ', 'Three rail electric plasmatic cannons that produce beams of multi-dimensional sub-space particles. ', '50', '30', '25');
break;
case boo1mc:
showTooltip('Booster lvl1 ', 'Accumulating dispersed psi-field energy, increases ballistic properties of plasma charges. +0.5 to Strength ', '15', '15', '15');
break;
case boo2mc:
showTooltip('Booster lvl2 ', 'Accumulating dispersed psi-field energy, increases ballistic properties of plasma charges. +0.5 to Strength ', '15', '15', '15');
break;
case boo3mc:
showTooltip('Booster lvl3 ', 'Accumulating dispersed psi-field energy, increases ballistic properties of plasma charges. +0.5 to Strength ', '15', '15', '15');
break;
case boo4mc:
showTooltip('Booster lvl4 ', 'Accumulating dispersed psi-field energy, increases ballistic properties of plasma charges. +0.5 to Strength ', '15', '15', '15');
break;
case rad1mc:
showTooltip('Radar lvl1 ', 'Establishes a dual link with a target, increasing the accuracy of the charges on vulnerable sites of the enemy. +0.2 to Critical ', '15', '25', '8');
break;
case rad2mc:
showTooltip('Radar lvl2 ', 'Establishes a dual link with a target, increasing the accuracy of the charges on vulnerable sites of the enemy. +0.2 to Critical ', '15', '25', '8');
break;
case rad3mc:
showTooltip('Radar lvl3 ', 'Establishes a dual link with a target, increasing the accuracy of the charges on vulnerable sites of the enemy. +0.2 to Critical ', '15', '25', '8');
break;
case rad4mc:
showTooltip('Radar lvl4 ', 'Establishes a dual link with a target, increasing the accuracy of the charges on vulnerable sites of the enemy. +0.2 to Critical ', '15', '25', '8');
break;
case eng1mc:
showTooltip('Engine lvl1 ', 'Delta phase poly-reactor working on a synthetic Obolon. +0.3 to Speed ', '25', '20', '0');
break;
case eng2mc:
showTooltip('Engine lvl2 ', 'Delta phase poly-reactor working on a synthetic Obolon. +0.3 to Speed ', '25', '20', '0');
break;
case eng3mc:
showTooltip('Engine lvl3 ', 'Delta phase poly-reactor working on a synthetic Obolon. +0.3 to Speed ', '25', '20', '0');
break;
case eng4mc:
showTooltip('Engine lvl4 ', 'Delta phase poly-reactor working on a synthetic Obolon. +0.3 to Speed ', '25', '20', '0');
break;
case shi1mc:
showTooltip('Shield lvl1 ', 'Generating krizon Tesla-flows, creates dense electro-membrane shield around the ship. +20 to Max shield ', '15', '10', '0');
break;
case shi2mc:
showTooltip('Shield lvl2 ', 'Generating krizon Tesla-flows, creates dense electro-membrane shield around the ship. +20 to Max shield ', '15', '10', '0');
break;
case shi3mc:
showTooltip('Shield lvl3 ', 'Generating krizon Tesla-flows, creates dense electro-membrane shield around the ship. +20 to Max shield ', '15', '10', '0');
break;
case shi4mc:
showTooltip('Shield lvl4 ', 'Generating krizon Tesla-flows, creates dense electro-membrane shield around the ship. +20 to Max shield ', '15', '10', '0');
break;
case shi5mc:
showTooltip('Shield lvl5 ', 'Generating krizon Tesla-flows, creates dense electro-membrane shield around the ship. +20 to Max shield ', '15', '10', '0');
break;
case shi6mc:
showTooltip('Shield lvl6 ', 'Generating krizon Tesla-flows, creates dense electro-membrane shield around the ship. +20 to Max shield ', '15', '10', '0');
break;
case stru1mc:
showTooltip('Structure lvl1 ', 'Cellular coverage of ultralight nano-polymer with 8% containing of heavy latitan isotopes. +20 to Max Health ', '15', '10', '0');
break;
case stru2mc:
showTooltip('Structure lvl2 ', 'Cellular coverage of ultralight nano-polymer with 8% containing of heavy latitan isotopes. +20 to Max Health ', '15', '10', '0');
break;
case stru3mc:
showTooltip('Structure lvl3 ', 'Cellular coverage of ultralight nano-polymer with 8% containing of heavy latitan isotopes. +20 to Max Health ', '15', '10', '0');
break;
case stru4mc:
showTooltip('Structure lvl4 ', 'Cellular coverage of ultralight nano-polymer with 8% containing of heavy latitan isotopes. +20 to Max Health ', '15', '10', '0');
break;
case stru5mc:
showTooltip('Structure lvl5 ', 'Cellular coverage of ultralight nano-polymer with 8% containing of heavy latitan isotopes. +20 to Max Health ', '15', '10', '0');
break;
case stru6mc:
showTooltip('Structure lvl6 ', 'Cellular coverage of ultralight nano-polymer with 8% containing of heavy latitan isotopes. +20 to Max Health ', '15', '10', '0');
}
};
stru5mc.onRollOver = stru6mc.onRollOver;
stru4mc.onRollOver = stru6mc.onRollOver;
stru3mc.onRollOver = stru6mc.onRollOver;
stru2mc.onRollOver = stru6mc.onRollOver;
stru1mc.onRollOver = stru6mc.onRollOver;
shi6mc.onRollOver = stru6mc.onRollOver;
shi5mc.onRollOver = stru6mc.onRollOver;
shi4mc.onRollOver = stru6mc.onRollOver;
shi3mc.onRollOver = stru6mc.onRollOver;
shi2mc.onRollOver = stru6mc.onRollOver;
shi1mc.onRollOver = stru6mc.onRollOver;
eng4mc.onRollOver = stru6mc.onRollOver;
eng3mc.onRollOver = stru6mc.onRollOver;
eng2mc.onRollOver = stru6mc.onRollOver;
eng1mc.onRollOver = stru6mc.onRollOver;
rad4mc.onRollOver = stru6mc.onRollOver;
rad3mc.onRollOver = stru6mc.onRollOver;
rad2mc.onRollOver = stru6mc.onRollOver;
rad1mc.onRollOver = stru6mc.onRollOver;
boo4mc.onRollOver = stru6mc.onRollOver;
boo3mc.onRollOver = stru6mc.onRollOver;
boo2mc.onRollOver = stru6mc.onRollOver;
boo1mc.onRollOver = stru6mc.onRollOver;
gu3mc.onRollOver = stru6mc.onRollOver;
gu2mc.onRollOver = stru6mc.onRollOver;
gu1mc.onRollOver = stru6mc.onRollOver;
ro3mc.onRollOver = stru6mc.onRollOver;
ro2mc.onRollOver = stru6mc.onRollOver;
ro1mc.onRollOver = stru6mc.onRollOver;
stru6mc.onDragOut = function () {
this._yscale -= 40;
this._xscale = this._yscale;
this._x += 10;
this._y += 10;
this._alpha = al;
hideTooltip();
};
stru5mc.onDragOut = stru6mc.onDragOut;
stru4mc.onDragOut = stru6mc.onDragOut;
stru3mc.onDragOut = stru6mc.onDragOut;
stru2mc.onDragOut = stru6mc.onDragOut;
stru1mc.onDragOut = stru6mc.onDragOut;
shi6mc.onDragOut = stru6mc.onDragOut;
shi5mc.onDragOut = stru6mc.onDragOut;
shi4mc.onDragOut = stru6mc.onDragOut;
shi3mc.onDragOut = stru6mc.onDragOut;
shi2mc.onDragOut = stru6mc.onDragOut;
shi1mc.onDragOut = stru6mc.onDragOut;
eng4mc.onDragOut = stru6mc.onDragOut;
eng3mc.onDragOut = stru6mc.onDragOut;
eng2mc.onDragOut = stru6mc.onDragOut;
eng1mc.onDragOut = stru6mc.onDragOut;
rad4mc.onDragOut = stru6mc.onDragOut;
rad3mc.onDragOut = stru6mc.onDragOut;
rad2mc.onDragOut = stru6mc.onDragOut;
rad1mc.onDragOut = stru6mc.onDragOut;
boo4mc.onDragOut = stru6mc.onDragOut;
boo3mc.onDragOut = stru6mc.onDragOut;
boo2mc.onDragOut = stru6mc.onDragOut;
boo1mc.onDragOut = stru6mc.onDragOut;
gu3mc.onDragOut = stru6mc.onDragOut;
gu2mc.onDragOut = stru6mc.onDragOut;
gu1mc.onDragOut = stru6mc.onDragOut;
ro3mc.onDragOut = stru6mc.onDragOut;
ro2mc.onDragOut = stru6mc.onDragOut;
ro1mc.onDragOut = stru6mc.onDragOut;
stru6mc.onRollOut = stru6mc.onDragOut;
stru5mc.onRollOut = stru6mc.onDragOut;
stru4mc.onRollOut = stru6mc.onDragOut;
stru3mc.onRollOut = stru6mc.onDragOut;
stru2mc.onRollOut = stru6mc.onDragOut;
stru1mc.onRollOut = stru6mc.onDragOut;
shi6mc.onRollOut = stru6mc.onDragOut;
shi5mc.onRollOut = stru6mc.onDragOut;
shi4mc.onRollOut = stru6mc.onDragOut;
shi3mc.onRollOut = stru6mc.onDragOut;
shi2mc.onRollOut = stru6mc.onDragOut;
shi1mc.onRollOut = stru6mc.onDragOut;
eng4mc.onRollOut = stru6mc.onDragOut;
eng3mc.onRollOut = stru6mc.onDragOut;
eng2mc.onRollOut = stru6mc.onDragOut;
eng1mc.onRollOut = stru6mc.onDragOut;
rad4mc.onRollOut = stru6mc.onDragOut;
rad3mc.onRollOut = stru6mc.onDragOut;
rad2mc.onRollOut = stru6mc.onDragOut;
rad1mc.onRollOut = stru6mc.onDragOut;
boo4mc.onRollOut = stru6mc.onDragOut;
boo3mc.onRollOut = stru6mc.onDragOut;
boo2mc.onRollOut = stru6mc.onDragOut;
boo1mc.onRollOut = stru6mc.onDragOut;
gu3mc.onRollOut = stru6mc.onDragOut;
gu2mc.onRollOut = stru6mc.onDragOut;
gu1mc.onRollOut = stru6mc.onDragOut;
ro3mc.onRollOut = stru6mc.onDragOut;
ro2mc.onRollOut = stru6mc.onDragOut;
ro1mc.onRollOut = stru6mc.onDragOut;
}
}
movieClip 563 {
frame 2 {
stop();
}
frame 3 {
stop();
}
}
movieClip 566 {
}
button 570 {
on (release) {
_global.restartlvl = true;
_global.MIN -= _global.min1;
_global.GAS -= _global.gas1;
_global.BIO -= _global.bio1;
_global.hertottime += _global.timeall;
_global.timeall = 0;
_global.herkill += _global.kill1;
_global.kill1 = 0;
}
}
button 572 {
on (release) {
_global.perehod = 2;
}
}
button 574 {
on (release) {
_global.SoundM = true;
if (_global.SoundM == true) {
ofmc._yscale = 66;
ofmc._xscale = 66;
onmc._yscale = 100;
onmc._xscale = 100;
} else {
ofmc._yscale = 100;
ofmc._xscale = 100;
onmc._yscale = 66;
onmc._xscale = 66;
}
}
}
button 576 {
on (release) {
_global.SoundM = false;
_root.msystem.stop();
_root.mpause.stop();
_root.mbos.stop();
_root.mmenu.stop();
if (_global.SoundM == true) {
ofmc._yscale = 66;
ofmc._xscale = 66;
onmc._yscale = 100;
onmc._xscale = 100;
} else {
ofmc._yscale = 100;
ofmc._xscale = 100;
onmc._yscale = 66;
onmc._xscale = 66;
}
}
}
button 578 {
on (release) {
_global.Detal = 1;
if (_global.Detal == 1) {
himc._yscale = 66;
himc._xscale = 66;
lomc._yscale = 100;
lomc._xscale = 100;
}
if (_global.Detal == 2) {
himc._yscale = 100;
himc._xscale = 100;
lomc._yscale = 66;
lomc._xscale = 66;
}
}
}
button 580 {
on (release) {
_global.Detal = 2;
if (_global.Detal == 1) {
himc._yscale = 66;
himc._xscale = 66;
lomc._yscale = 100;
lomc._xscale = 100;
}
if (_global.Detal == 2) {
himc._yscale = 100;
himc._xscale = 100;
lomc._yscale = 66;
lomc._xscale = 66;
}
}
}
movieClip 582 {
frame 1 {
if (_global.Detal == 1) {
himc._yscale = 66;
himc._xscale = 66;
lomc._yscale = 100;
lomc._xscale = 100;
}
if (_global.Detal == 2) {
himc._yscale = 100;
himc._xscale = 100;
lomc._yscale = 66;
lomc._xscale = 66;
}
if (_global.SoundM == false) {
ofmc._yscale = 100;
ofmc._xscale = 100;
onmc._yscale = 66;
onmc._xscale = 66;
} else {
ofmc._yscale = 66;
ofmc._xscale = 66;
onmc._yscale = 100;
onmc._xscale = 100;
}
this._yscale = 0;
onEnterFrame = function () {
if (this._yscale < 100) {
this._yscale += 20;
}
};
}
}
movieClip 583 {
frame 2 {
stop();
}
}
button 598 {
on (release) {
_global.perehod = 2;
}
on (rollOver) {
_global.playsfx('onroll');
}
}
movieClip 599 {
frame 1 {
stop();
Qwar._visible = false;
Qdef._visible = false;
Qsca._visible = false;
Qsht._visible = false;
Qtan._visible = false;
switch (_global.perstype) {
case 1:
Qwar._visible = true;
break;
case 2:
Qsca._visible = true;
break;
case 3:
Qtan._visible = true;
break;
case 4:
Qsht._visible = true;
break;
case 5:
Qdef._visible = true;
}
var kill2 = 0;
var time2 = 0;
var score2 = 0;
onEnterFrame = function () {
if (_global.pauseall) {
if (kill2 < _global.herkill) {
++kill2;
killstxt.text = kill2;
}
if (time2 < _global.hertottime) {
++time2;
timetxt.text = time2;
}
if (score2 < _global.herlvl) {
++score2;
scoretxt.text = score2;
}
}
};
}
}
button 601 {
on (release) {
if (_global.SoundM != false) {
_global.playsfx('panelmove');
}
if (!heroab._visible) {
if (_global.pauseall) {
_global.pauseall = false;
setPause(false);
_global.step = _global.steptmp;
cap1.gotoAndPlay(80);
} else {
_global.pauseall = true;
setPause(true);
_global.steptmp = _global.step;
_global.step = 0;
cap1.cap11.cap111.text = 'PAUSED';
cap1.gotoAndPlay(1);
}
}
if (!menuab._visible) {
heroab._visible = false;
menuab._visible = true;
menuab.gotoAndPlay(1);
if (_global.SAE == 2 && _global.perstype == 1) {
_global.str /= 3;
}
bokovuha._visible = false;
_root.ggoo = 1;
} else {
menuab._visible = false;
bokovuha._visible = true;
if (_global.SAE == 2 && _global.perstype == 1) {
_global.str *= 3;
}
bokovuha.gotoAndPlay(1);
_root.ggoo = 0;
}
}
}
button 603 {
on (release) {
if (_global.SoundM != false) {
_global.playsfx('panelmove');
}
if (!menuab._visible) {
if (_global.pauseall) {
_global.pauseall = false;
setPause(false);
_global.step = _global.steptmp;
cap1.gotoAndPlay(80);
} else {
_global.pauseall = true;
setPause(true);
_global.steptmp = _global.step;
_global.step = 0;
cap1.cap11.cap111.text = 'PAUSED';
cap1.gotoAndPlay(1);
}
}
if (!heroab._visible) {
menuab._visible = false;
if (_global.SAE == 2 && _global.perstype == 1) {
_global.str /= 3;
}
heroab._visible = true;
heroab.gotoAndPlay(1);
bokovuha._visible = false;
_root.ggoo = 1;
} else {
if (_global.SAE == 2 && _global.perstype == 1) {
_global.str *= 3;
}
heroab._visible = false;
bokovuha._visible = true;
bokovuha.gotoAndPlay(1);
_root.ggoo = 0;
}
}
}
frame 6 {
function placeFire(tgt) {
var v3 = 0;
while (v3 < 3) {
++lev;
if (lev > 1000000) {
lev = 0;
}
var v2 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v2);
globalToLocal(v2);
var v1 = fafa.duplicateMovieClip('f' + lev, lev);
if (Math.random() > 0.5) {
v1._x = v2.x + Math.random() * 2 - 1;
} else {
v1._x = v2.x - Math.random() * 2 - 1;
}
if (Math.random() > 0.5) {
v1._y = v2.y + Math.random() * 2 - 1;
} else {
v1._y = v2.y - Math.random() * 2 - 1;
}
v1._alpha = Math.random() * 50 + 50;
v1._yscale = Math.random() * 50 + 70;
v1._xscale = v1._yscale;
++v3;
}
}
function placeBoom(x, y) {
++lev;
var v3 = boom.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom1(x, y) {
++lev;
var v3 = boom1.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom2(x, y) {
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function createExplosion(targetX, targetY, targetPath, explosionParticleAmount, explosionParticleRange, particleSize, speed, speedAlpha) {
var v7 = 0;
while (v7 < explosionParticleAmount) {
var v8 = bitmapsArray[random(bitmapsArray.length)];
var v4 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder' + lev, lev);
++lev;
var v3 = v2.createEmptyMovieClip('internal_holder', lev);
v3._x = -v4.width / 2;
v3._y = -v4.height / 2;
++lev;
v3.attachBitmap(v4, lev, 'never');
v2._x = targetX + random(explosionParticleRange) - explosionParticleRange / 2;
v2._y = targetY + random(explosionParticleRange) - explosionParticleRange / 2;
var v6 = random(particleSize);
v2._xscale = v6;
v2._yscale = v6;
v2.speed = random(speed) + speed;
v2.speedAlpha = random(speedAlpha) + speedAlpha;
v2.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speedAlpha;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
++v7;
}
}
function createParticles(targetX, targetY, targetPath, tempParticle_mcAmount, tempParticle_mcRange, particleSize, tempParticle_mcMaxSpeed, tempParticle_mcMaxFadeSpeed) {
var v7 = 0;
while (v7 < tempParticle_mcAmount) {
var v8 = particleBitmapsArray[random(particleBitmapsArray.length)];
var v5 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder', lev);
++lev;
var v4 = v2.createEmptyMovieClip('internal_holder', lev);
v4._x = -v5.width / 2;
v4._y = -v5.height / 2;
++lev;
v4.attachBitmap(v5, lev, 'never');
v2._x = targetX;
v2._y = targetY;
v2._rotation = random(360);
v2._alpha = random(50) + 50;
v2._xscale = particleSize;
v2._yscale = particleSize;
v2.boundyLeft = targetX - tempParticle_mcRange;
v2.boundyTop = targetY - tempParticle_mcRange;
v2.boundyRight = targetX + tempParticle_mcRange;
v2.boundyBottom = targetY + tempParticle_mcRange;
v2.speedX = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedY = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedX *= tempParticle_mcMaxSpeed;
v2.speedY *= tempParticle_mcMaxSpeed;
v2.fadeSpeed = Math.random(tempParticle_mcMaxFadeSpeed) * tempParticle_mcMaxFadeSpeed;
v2.onEnterFrame = function () {
this._alpha -= this.fadeSpeed;
this._x += this.speedX;
this._y += this.speedY;
if (this._alpha <= 0 || this._x < this.boundyLeft || this._x > this.boundyRight || this._y < this.boundyTop || this._y > this.boundyBottom) {
this.removeMovieClip();
}
};
++v7;
}
}
function fireWeapon(target) {
if (reloadComplete == true && rok > 0) {
++lev;
_global.playsfx('raketa');
var v3 = missile.duplicateMovieClip('missile' + lev, lev);
v3._x = hero._x;
v3._y = hero._y;
v3._rotation = hero._rotation;
v3.targetX = target._x;
v3.targetY = target._y;
v3.tar = target;
v3.moveX = 0;
v3.moveY = 0;
v3.onEnterFrame = function () {
doFollow(this, this.tar);
};
roketi._alpha = 30;
rok -= 1;
roketi.ro.text = rok + '/' + _global.rokmax;
startReloading();
} else {
_global.playsfx('noroket');
}
}
function startReloading() {
reloadComplete = false;
reloadTimer = setInterval(this, 'gunReloaded', reloadSpeed);
}
function gunReloaded() {
clearInterval(reloadTimer);
if (rok > 0) {
roketi._alpha = 75;
}
reloadComplete = true;
}
function doFollow(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
follower.moveDistanceX = turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = missileSpeed * follower.moveX / follower.totalmove;
follower.moveY = missileSpeed * follower.moveY / follower.totalmove;
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = 180 * Math.atan2(follower.moveY, follower.moveX) / Math.PI;
doTrail(follower._x, follower._y, 'particle_smoke_clear');
var v7 = follower._x - target._x;
var v6 = follower._y - target._y;
var v8 = Math.sqrt(v7 * v7 + v6 * v6);
if (v8 < 10) {
placeBoom(target._x, target._y);
var v4 = spiders.length;
while (v4--) {
var v3 = spiders[v4];
if (v3 == target) {
removeSpider(v3);
++_global.kill1;
}
}
v4 = Sspiders.length;
while (v4--) {
v3 = Sspiders[v4];
if (v3 == target) {
removeSSpider(v3);
++_global.kill1;
}
}
removeMovieClip(target);
removeMovieClip(follower);
}
if (follower.hitTest(sun)) {
_global.playsfx('hit');
placeBoom1(follower._x, follower._y);
removeMovieClip(follower);
}
if (!target._x) {
removeMovieClip(follower);
delete follower.onEnterFrame;
}
}
function doTrail(targetX, targetY, type) {
++lev;
var v3 = _root.attachMovie(type, type + lev, lev);
v3._x = targetX;
v3._y = targetY;
v3._rotation = random(360);
randomScale = random(75) + 25;
v3._xscale = randomScale;
randomScale = random(75) + 25;
v3._yscale = randomScale;
v3.speed = random(10) + 5;
updateAfterEvent();
v3.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speed;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
}
function placeSpider(A, B) {
++lev;
var d = spider.duplicateMovieClip('z' + lev, lev);
if (A == 0 && B == 0) {
d._y = fon._y + Math.random() * fon._height;
if (Math.random() < 0.5) {
d._x = fon._x - d._width / 2;
} else {
d._x = fon._x + fon._width + d._width / 2;
}
} else {
d._x = A;
d._y = B;
}
var v6 = hero._x - d._x;
var v5 = hero._y - d._y;
d.a = Math.atan2(v5, v6);
d._rotation = (d.a / Math.PI) * 180;
d.speed = Math.random() * 2 + 2;
d.onEnterFrame = function () {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
this.a = Math.atan2(v5, v6);
this._rotation = (this.a / Math.PI) * 180;
var v8 = Math.sqrt(v6 * v6 + v5 * v5);
if (v8 < 25 && !placed) {
_global.playsfx('hittestmob');
placeBoom2(hero._x, hero._y);
if (!ud) {
var v7 = shild - 10;
if (v7 < 0) {
life += v7;
shild = 0;
} else {
shild -= 10;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = spiders.length;
while (v3--) {
var v4 = spiders[v3];
if (v4 == d) {
spiders.splice(v3, 1);
}
}
v3 = needBePaused.length;
while (v3--) {
v4 = needBePaused[v3];
if (v4 == d) {
needBePaused.splice(v3, 1);
}
}
}
};
d.onRollOver = function () {
_global.trgt = d;
};
spiders.push(d);
d.lif = 3;
}
function removeSpider(s) {
var v4 = spiders.length;
while (v4--) {
var v2 = spiders[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
spiders.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function placeSSpider(A, B) {
++lev;
var Sd = Sspider.duplicateMovieClip('Sz' + lev, lev);
if (A == 0 && B == 0) {
Sd._y = fon._y + Math.random() * fon._height;
if (Math.random() < 0.5) {
Sd._x = fon._x - Sd._width / 2;
} else {
Sd._x = fon._x + fon._width + Sd._width / 2;
}
} else {
Sd._x = A;
Sd._y = B;
}
var v6 = hero._x - Sd._x;
var v7 = hero._y - Sd._y;
Sd.a = Math.atan2(v7, v6);
Sd._rotation = (Sd.a / Math.PI) * 180;
Sd.speed = Math.random() + 0.5;
var timeS = 0;
var TtimeS = Math.floor(Math.random() * 20) + 14;
var back = 0;
Sd.onEnterFrame = function () {
if (back == 0) {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
}
if (back == 2) {
this._x += -this.speed * Math.cos(this.a);
this._y += -this.speed * Math.sin(this.a);
}
var v6 = hero._x - this._x;
var v7 = hero._y - this._y;
this.a = Math.atan2(v7, v6);
this._rotation = (this.a / Math.PI) * 180;
if (timeS++ > TtimeS) {
timeS = 0;
placeEbul(Sd);
}
var v5 = Math.sqrt(v6 * v6 + v7 * v7);
if (v5 < 180) {
if (back == 0) {
back = 1;
}
}
if (v5 < 120) {
back = 2;
}
if (v5 >= 180) {
back = 0;
}
if (v5 < 25 && !Splaced) {
placeBoom2(hero._x, hero._y);
_global.playsfx('hittestmob');
if (!ud) {
var v8 = shild - 15;
if (v8 < 0) {
life += v8;
shild = 0;
} else {
shild -= 15;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Sspiders.length;
while (v3--) {
var v4 = Sspiders[v3];
if (v4 == Sd) {
Sspiders.splice(v3, 1);
}
}
v3 = needBePaused.length;
while (v3--) {
v4 = needBePaused[v3];
if (v4 == Sd) {
needBePaused.splice(v3, 1);
}
}
}
};
Sd.onRollOver = function () {
_global.trgt = Sd;
};
Sspiders.push(Sd);
Sd.Slif = 5;
}
function removeSSpider(s) {
var v4 = Sspiders.length;
while (v4--) {
var v2 = Sspiders[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
Sspiders.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
stop();
var my_so = SharedObject.getLocal('spiteful_space_save', '/');
_global.MIN = my_so.data.MIN;
_global.GAS = my_so.data.GAS;
_global.BIO = my_so.data.BIO;
_global.rokmax = my_so.data.rokmax;
_global.uR = my_so.data.uR;
_global.uG = my_so.data.uG;
_global.uB = my_so.data.uB;
_global.uRa = my_so.data.uRa;
_global.uE = my_so.data.uE;
_global.uS = my_so.data.uS;
_global.uSt = my_so.data.uSt;
my_so.flush();
_global.perehod = 0;
if (_global.SoundM != false) {
mpause.stop();
msystem.stop();
mmenu.stop();
mbos.stop();
msystem.start(0, 500);
}
_global.sa1 = 1;
_global.sa2 = 1;
_global.sa3 = 1;
var stren = _global.str;
heroab.swapDepths(1000002);
menuab.swapDepths(1000003);
con.swapDepths(1000004);
_global.bio1 = 0;
_global.min1 = 0;
_global.gas1 = 0;
_global.kill1 = 0;
_global.restartlvl = false;
if (_global.systema != 1) {
cap1.cap11.cap111.text = 'SURVIVE FOR 60 SECONDS';
} else {
cap1.cap11.cap111.text = 'TRAINING SYSTEM';
}
cap1.gotoAndPlay(1);
_global.pauseall = false;
_global.steptmp = 0;
_global.pausetimestart = 0;
_global.pausetimestop = 0;
_global.pausetimeall = 0;
needBePaused = new Array();
_global.addToPause = function (obj) {
if (!obj._inPause) {
needBePaused.push(obj);
obj._inPause = true;
}
};
var koff = 1;
var finangle = Math.random() * 100;
finplay = function () {
finangle += 10;
if (koff < 30) {
koff += 0.5;
}
finr_ang = finangle / 57.29577951308232;
finmc._x = 500 + koff * Math.cos(finr_ang);
finmc._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc._x, finmc._y, 'particle_smoke_clear');
finr_ang = (finangle + 180) / 57.29577951308232;
finmc1._x = 500 + koff * Math.cos(finr_ang);
finmc1._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc1._x, finmc1._y, 'particle_smoke_clear');
};
_global.setPause = function (flag) {
isPause = flag;
var v3 = needBePaused.length;
while (v3--) {
var v2 = needBePaused[v3];
if (flag) {
v2.stop();
v2.oef = v2.onEnterFrame;
v2.onEnterFrame = null;
} else {
v2.onEnterFrame = v2.oef;
v2.play();
}
}
if (flag) {
_global.pausetimestart = int(getTimer() / 1000);
} else {
_global.pausetimestop = int(getTimer() / 1000);
_global.pausetimeall += _global.pausetimestart - _global.pausetimestop;
}
};
min1.text = _global.GAS + '/300';
min2.text = _global.MIN + '/150';
min3.text = _global.BIO + '/50';
samc._width = 0;
samc._x = 350;
var angl = 0;
var Xx = mob1c._x - sun._x;
var Yy = mob1c._y - sun._y;
if (Xx == 0) {
if (Yy >= 0) {
angl = 270;
} else {
angl = 90;
}
} else {
if (Xx > 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433;
} else {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 - 180;
}
}
}
var myList = mob1c.mob1cc.filters;
myList[1].angle = angl;
myList[0].color = 16762823;
mob1c.mob1cc.filters = myList;
_global.SAE = 0;
var SAc = 0;
var ud = false;
var radiu = _global.rad;
var life = _global.arm;
var shild = _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
var rok = _global.rokmax;
roketi.ro.text = rok + '/' + _global.rokmax;
_global.step = _global.spe;
var checkup = 1;
var checkup1 = 1;
var rotDirSpeed = 5;
var angle = Math.random() * 100;
var spiderCount = 0;
var SspiderCount = 0;
var lev = 0;
var timeb = int(getTimer() / 100);
var timenasys = int(getTimer() / 1000);
_global.timeall = 0;
var fire = false;
heroab._visible = false;
menuab._visible = false;
con._visible = false;
tutor._visible = false;
boom._visible = false;
boom1._visible = false;
boom2._visible = false;
mob1c.thp = 100;
var resp = true;
var end = false;
var end1 = 0;
fafa._visible = false;
var bitmapsArray;
var particleBitmapsArray;
bitmapsArray = ['effect-fire5.png', 'effect-fire6.png', 'effect-fire7.png', 'effect-fire8.png', 'effect-fire9.png'];
particleBitmapsArray = ['particle.jpg', 'particle1.png', 'particle5.png'];
var Gass = new Array();
placeGas = function (A, B) {
++lev;
var d = gas.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.GAS < 300) {
removeMovieClip(this);
_global.playsfx('collected');
delete this.onEnterFrame;
var v3 = Gass.length;
while (v3--) {
var v4 = Gass[v3];
if (v4 == d) {
Gass.splice(v3, 1);
}
}
_global.GAS += 1;
++_global.gas1;
min1.text = _global.GAS + '/300';
}
};
Gass.push(d);
};
var Minerals = new Array();
placeMineral = function (A, B) {
++lev;
var d = mineral.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.MIN < 150) {
removeMovieClip(this);
_global.playsfx('collected');
delete this.onEnterFrame;
var v3 = Minerals.length;
while (v3--) {
var v4 = Minerals[v3];
if (v4 == d) {
Minerals.splice(v3, 1);
}
}
_global.MIN += 1;
++_global.min1;
min2.text = _global.MIN + '/150';
}
};
Minerals.push(d);
};
var Bios = new Array();
placeBio = function (A, B) {
++lev;
var d = bio.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.BIO < 50) {
removeMovieClip(this);
_global.playsfx('collected');
delete this.onEnterFrame;
var v3 = Bios.length;
while (v3--) {
var v4 = Bios[v3];
if (v4 == d) {
Bios.splice(v3, 1);
}
}
_global.BIO += 1;
++_global.bio1;
min3.text = _global.BIO + '/50';
}
};
Bios.push(d);
};
var reloadSpeed = 1000;
var missileSpeed = 7;
var turnRate = 0.7;
var reloadTimer;
var reloadComplete = true;
bulletSpeed = 18;
placeBullet = function (tgt) {
++lev;
var v9 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v9);
globalToLocal(v9);
_global.playsfx('vistrel');
var v8 = bullet.duplicateMovieClip('b' + lev, lev);
v8._x = v9.x;
v8._y = v9.y;
v8._rotation = hero._rotation + hero.body._rotation;
v8.a = (v8._rotation / 180) * Math.PI;
v8.onEnterFrame = function () {
this._x += bulletSpeed * Math.cos(this.a);
this._y += bulletSpeed * Math.sin(this.a);
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.hitTest(sun)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
_global.playsfx('hit');
}
if (this.hitTest(pl1)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
_global.playsfx('hit');
}
if (this.hitTest(pl2)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
_global.playsfx('hit');
}
if (this.hitTest(pl3)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
_global.playsfx('hit');
}
var v7 = spiders.length;
while (v7--) {
var v3 = spiders[v7];
if (v3.hit.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 5 <= 220) {
SAc += 5;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v3.lif -= _global.rad * stren;
v3._yscale -= 20 * stren;
v3._xscale = v3._yscale;
if (SAE != 2) {
v3.speed -= 0.5 * stren;
}
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v5 = 0;
if (_global.timeall <= 60) {
v5 = 0;
} else {
if (_global.timeall <= 120) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeSpider(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
} else {
v3.lif -= stren;
v3._yscale -= 10 * stren;
v3._xscale = v3._yscale;
if (SAE != 2) {
v3.speed -= 0.5 * stren;
}
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v5 = 0;
if (_global.timeall <= 60) {
v5 = 0;
} else {
if (_global.timeall <= 120) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeSpider(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
}
}
}
var v6 = Sspiders.length;
while (v6--) {
var v4 = Sspiders[v6];
if (v4.Shit.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 3 <= 220) {
SAc += 3;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v4._x) < 128.5 && Math.abs(hero._y - v4._y) < 128.5) {
v4.Slif -= _global.rad * stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.Slif <= 0) {
v4.gotoAndStop(2);
v5 = 0;
if (_global.timeall <= 60) {
v5 = 0;
} else {
if (_global.timeall <= 120) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeSSpider(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
} else {
v4.Slif -= stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.Slif <= 0) {
v4.gotoAndStop(2);
v5 = 0;
if (_global.timeall <= 60) {
v5 = 0;
} else {
if (_global.timeall <= 120) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeSSpider(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
}
}
}
};
};
placeEbul = function (tgt) {
++lev;
var v4 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v4);
globalToLocal(v4);
_global.playsfx('zelenie');
var v3 = ebul.duplicateMovieClip('b' + lev, lev);
v3._x = v4.x;
v3._y = v4.y;
if (Math.floor(Math.random() * 2) == 1) {
v3._rotation = tgt._rotation + Math.random() * 10;
} else {
v3._rotation = tgt._rotation - Math.random() * 10;
}
v3.a = (v3._rotation / 180) * Math.PI;
v3.onEnterFrame = function () {
this._x += (bulletSpeed - 8) * _global.sa2 * Math.cos(this.a);
this._y += (bulletSpeed - 8) * _global.sa2 * Math.sin(this.a);
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.hitTest(sun)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl1)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl2)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl3)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (hero.foot.hitTest(this)) {
_global.playsfx('hitme');
if (!ud) {
var v3 = shild - 5;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 5;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
placeBoom1(hero._x, hero._y);
this.removeMovieClip();
}
};
};
var spiders = new Array();
var Sspiders = new Array();
if (_global.systema != 1) {
i = 5;
if (_global.systema == 3 || _global.systema == 4) {
i = 10;
}
while (i--) {
placeSpider(Math.floor(Math.random() * 200) + 500, Math.floor(Math.random() * 200) + 200);
}
i = 3;
if (_global.systema == 3 || _global.systema == 4) {
i = 6;
}
while (i--) {
placeSSpider(Math.floor(Math.random() * 200) + 500, Math.floor(Math.random() * 200) + 200);
}
}
onEnterFrame = function () {
var v11 = 0;
var v12 = hero.foot._x - sun._x;
var v14 = hero.foot._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
var v16 = hero.foot.filters;
v16[1].angle = v11;
hero.foot.filters = v16;
v11 = 0;
v12 = pl2._x - sun._x;
v14 = pl2._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = pl2.filters;
v16[1].angle = v11;
pl2.filters = v16;
v11 = 0;
v12 = pl1._x - sun._x;
v14 = pl1._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = pl1.filters;
v16[1].angle = v11;
pl1.filters = v16;
v11 = 0;
v12 = pl3._x - sun._x;
v14 = pl3._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = pl3.filters;
v16[1].angle = v11;
pl3.filters = v16;
if (Key.isDown(16) && !_global.pauseall) {
if (_global.trgt._width) {
fireWeapon(_global.trgt);
}
}
if (Key.isDown(32) && _global.SAE == 1 && !_global.pauseall) {
sap._alpha = 100;
_global.SAE = 2;
_global.playsfx('sastart');
if (_global.perstype == 1) {
stren *= 3;
cap1.cap11.cap111.text = 'EAGLE EYE!';
cap1.gotoAndPlay(1);
var v13 = hero.foot.filters;
v13[1].color = 16711680;
hero.foot.filters = v13;
}
if (_global.perstype == 3) {
_global.sa3 = 0.5;
_global.rad = 1;
cap1.cap11.cap111.text = 'NEUTRON ACCELERATION!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 2) {
var v8 = spiders.length;
while (v8--) {
var v6 = spiders[v8];
v6.speed *= 0.2;
}
v8 = Sspiders.length;
while (v8--) {
v6 = Sspiders[v8];
v6.speed *= 0.2;
}
_global.sa2 = 0.2;
cap1.cap11.cap111.text = 'TIME BOMB!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 5) {
ud = true;
cap1.cap11.cap111.text = 'ULTIMATE DEFENCE!';
cap1.gotoAndPlay(1);
v13 = hero.foot.filters;
v13[2].strength = 2;
hero.foot.filters = v13;
}
if (_global.perstype == 4) {
var v7 = enemiesArray.length;
while (v7--) {
var v3 = enemiesArray[v7];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
var v5 = 0.5;
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeEnemy(v3);
}
}
v7 = spiders.length;
while (v7--) {
v3 = spiders[v7];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v5 = 0.5;
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeSpider(v3);
++_global.kill1;
}
}
v7 = Sspiders.length;
while (v7--) {
v3 = Sspiders[v7];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v5 = 0.5;
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeSSpider(v3);
++_global.kill1;
}
}
hero.zone._alpha = 85;
SAc = 32;
cap1.cap11.cap111.text = 'ANNIHILATING FLASH!';
cap1.gotoAndPlay(1);
}
}
if ((Key.isDown(37) || Key.isDown(65)) && !_global.pauseall) {
hero._rotation -= rotDirSpeed;
} else {
if ((Key.isDown(39) || Key.isDown(68)) && !_global.pauseall) {
hero._rotation += rotDirSpeed;
}
}
var v19 = _xmouse - hero._x;
var v17 = _ymouse - hero._y;
var v18 = Math.atan2(v17, v19);
hero.body._rotation = -hero._rotation + (v18 / Math.PI) * 180;
var v10 = (hero._rotation / 180) * Math.PI;
if ((Key.isDown(38) || Key.isDown(87)) && !_global.pauseall) {
if (_global.step < 5) {
_global.step += 0.1;
}
if (checkup1 == 2) {
_global.step = 2;
checkup1 = 1;
}
hero.foot.play();
checkup = 1;
hero._x += _global.step * Math.cos(v10);
hero._y += _global.step * Math.sin(v10);
} else {
if (checkup == 1 && _global.step > 0) {
hero._x += _global.step * Math.cos(v10);
hero._y += _global.step * Math.sin(v10);
_global.step -= 0.1;
} else {
if (checkup == 2 && _global.step > 0) {
hero._x -= _global.step * Math.cos(v10);
hero._y -= _global.step * Math.sin(v10);
_global.step -= 0.1;
} else {
hero.foot.stop;
}
}
}
if (hero._x < 0) {
hero._x = 0;
}
if (hero._x > 700) {
hero._x = 700;
}
if (hero._y < 0) {
hero._y = 0;
}
if (hero._y > 600) {
hero._y = 600;
}
if (!_global.pauseall) {
angle += 0.2;
}
r_ang = angle / 57.29577951308232;
pl1._x = 317 + 100 * Math.cos(r_ang * 3);
pl1._y = 245 + 100 * Math.sin(r_ang * 3);
pl2._x = 317 + 200 * Math.cos(r_ang * 2);
pl2._y = 245 + 200 * Math.sin(r_ang * 2);
pl3._x = 317 + 300 * Math.cos(r_ang);
pl3._y = 245 + 200 * Math.sin(r_ang);
if (hero.foot.hitTest(sun) && !_global.pauseall) {
if (ud) {
if (shild + 1 > _global.def) {
shild = _global.def;
} else {
shild += 1;
}
} else {
if (shild + 5 > _global.def) {
shild = _global.def;
} else {
shild += 5;
}
life -= 1;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
if (_global.systema != 1) {
if (spiderCount++ > 75 && resp && _global.SAE != 2 && !_global.pauseall) {
spiderCount = 0;
placeSpider(0, 0);
if (_global.systema == 4) {
placeSpider(0, 0);
}
}
if (SspiderCount++ > 300 && resp && _global.SAE != 2 && !_global.pauseall) {
SspiderCount = 0;
placeSSpider(0, 0);
if (_global.systema == 4) {
placeSSpider(0, 0);
}
}
}
timebb = int(getTimer() / 100) - timeb;
if (fire && timebb >= 2 * _global.sa3) {
if (_global.uG == 1) {
placeBullet(hero.body.dot);
}
if (_global.uG == 2) {
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
if (_global.uG == 3) {
placeBullet(hero.body.dot);
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
timeb = int(getTimer() / 100);
}
if (_global.SAE == 2) {
if (SAc - 2 <= 0) {
SAc = 0;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 0;
sap._alpha = 0;
if (_global.perstype == 5) {
ud = false;
v13 = hero.foot.filters;
v13[2].strength = 0;
hero.foot.filters = v13;
}
if (_global.perstype == 1) {
stren /= 3;
v13 = hero.foot.filters;
v13[1].color = 16777215;
hero.foot.filters = v13;
}
if (_global.perstype == 3) {
_global.sa3 = 1;
_global.rad = radiu;
}
if (_global.perstype == 2) {
v8 = spiders.length;
while (v8--) {
v6 = spiders[v8];
v6.speed *= 5;
}
v8 = Sspiders.length;
while (v8--) {
v6 = Sspiders[v8];
v6.speed *= 5;
}
_global.sa2 = 1;
}
if (_global.perstype == 4) {
hero.zone._alpha = 5;
}
} else {
if (!_global.pauseall) {
SAc -= 2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
if (_global.perstype == 4) {
hero.zone._alpha -= 5;
}
if (_global.perstype == 2) {
if (shild + 2 > _global.def) {
shild = _global.def;
} else {
shild += 2;
}
shilds._width = 183 * shild / _global.def;
teshi.text = 'shield ' + shild + '%';
}
}
}
}
if (_global.step > 0) {
placeFire(hero.sop);
}
if (resp == false && !end) {
if (spiders.length == 0 && Sspiders.length == 0) {
if (_global.systema != 1) {
cap1.cap11.cap111.text = 'SYSTEM NOW FREE, GOOD JOB!';
cap1.gotoAndPlay(1);
}
_global.playsfx('openportal');
_global.trgt = null;
fin._x = 500;
fin._y = 430;
fin.gotoAndPlay(1);
var v15 = new flash.filters.GlowFilter();
var v4 = pl1.filters;
v4.push(v15);
v4[2].blurY = 0;
v4[2].blurX = 0;
v4[2].quality = 100;
v4[2].color = 3329279;
pl1.filters = v4;
v4 = pl2.filters;
v4.push(v15);
v4[2].blurY = 0;
v4[2].blurX = 0;
pl2.filters = v4;
v4 = pl3.filters;
v4.push(v15);
v4[2].blurY = 0;
v4[2].blurX = 0;
pl3.filters = v4;
end1 = 8;
end = true;
}
}
if (end1 > 0) {
end1 -= 0.1;
v4 = pl1.filters;
v4[2].blurY = 8 - end1;
v4[2].blurX = v4[2].blurY;
v4[2].strength = (8 - end1) / 5;
pl1.filters = v4;
v4 = pl2.filters;
v4[2].blurY = 8 - end1;
v4[2].blurX = v4[2].blurY;
v4[2].strength = (8 - end1) / 5;
pl2.filters = v4;
v4 = pl3.filters;
v4[2].blurY = 8 - end1;
v4[2].blurX = v4[2].blurY;
v4[2].strength = (8 - end1) / 5;
pl3.filters = v4;
}
if (!end && !_global.pauseall) {
_global.timeall = int(getTimer() / 1000) - timenasys + _global.pausetimeall;
systime.text = _global.timeall;
}
if (end) {
finplay();
}
if (_global.timeall > 60) {
resp = false;
}
if (hero.foot.hitTest(fin.endss.ends) && !_global.pauseall) {
msystem.stop();
_global.playsfx('win');
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
tutor._visible = false;
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.SAE == 0 && !_global.pauseall) {
if (SAc + 0.2 <= 220) {
SAc += 0.2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
_global.playsfx(saready);
}
}
if (_global.trgt._width && !_global.pauseall) {
trg._x = _global.trgt._x;
trg._y = _global.trgt._y;
} else {
trg._x = 1000;
trg._y = 1000;
}
if (_global.restartlvl) {
var v9 = lev + 1;
while (v9--) {
removeMovieClip(_root.getInstanceAtDepth(v9));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(6);
}
if (life < 0 && !_global.pauseall) {
_global.playsfx('exp');
msystem.stop();
mbos.stop();
_global.playsfx('win');
lifes._width = 0;
_global.pauseall = true;
setPause(true);
_global.playsfx('exp');
hero._visible = false;
_global.step = 0;
placeBoom(hero._x, hero._y);
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.perehod == 1) {
gotoAndPlay(5);
}
if (_global.perehod == 2) {
v9 = lev + 1;
while (v9--) {
removeMovieClip(_root.getInstanceAtDepth(v9));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(1);
}
};
onMouseDown = function () {
if (!_global.pauseall) {
fire = true;
}
};
onMouseUp = function () {
fire = false;
};
}
movieClip 606 {
}
movieClip 609 {
}
movieClip 612 {
}
movieClip 614 {
}
movieClip 615 {
frame 24 {
stop();
}
}
movieClip 618 {
}
movieClip 621 {
}
movieClip 622 {
frame 50 {
_root.star._x = Math.random() * 700;
_root.star._y = Math.random() * 600;
}
}
movieClip 625 {
}
movieClip 626 {
frame 1 {
stop();
addToPause(this);
}
frame 2 {
_parent.removeMovieClip();
}
}
movieClip 627 {
frame 1 {
addToPause(this);
}
}
movieClip 630 {
}
movieClip 631 {
frame 1 {
stop();
addToPause(this);
}
frame 2 {
_parent.removeMovieClip();
}
}
movieClip 633 {
frame 1 {
addToPause(this);
}
}
movieClip 635 {
}
movieClip 636 {
}
movieClip 638 {
}
movieClip 639 {
}
movieClip 641 {
}
movieClip 642 {
}
movieClip 739 {
}
movieClip 836 {
}
movieClip 933 {
}
movieClip 935 {
}
movieClip 938 {
}
movieClip 941 {
}
movieClip 944 {
}
movieClip 947 {
frame 1 {
stop();
}
frame 2 {
placeBullet();
}
}
movieClip 948 {
}
movieClip 949 {
}
movieClip 952 {
}
movieClip 954 {
}
movieClip 955 {
}
button 956 {
on (release) {
if (_global.SoundM != false) {
_global.playsfx('panelmove');
}
if (!heroab._visible) {
if (_global.pauseall) {
_global.pauseall = false;
setPause(false);
_global.step = _global.steptmp;
cap1.gotoAndPlay(80);
mpause.stop();
if (_global.SoundM != false) {
msystem.start(0, 500);
}
} else {
_global.pauseall = true;
setPause(true);
_global.steptmp = _global.step;
_global.step = 0;
cap1.cap11.cap111.text = 'PAUSED';
cap1.gotoAndPlay(1);
msystem.stop();
if (_global.SoundM != false) {
mpause.start(0, 500);
}
}
}
if (!menuab._visible) {
heroab._visible = false;
menuab._visible = true;
menuab.gotoAndPlay(1);
if (_global.SAE == 2 && _global.perstype == 1) {
_global.str /= 3;
}
bokovuha._visible = false;
_root.ggoo = 1;
} else {
menuab._visible = false;
bokovuha._visible = true;
if (_global.SAE == 2 && _global.perstype == 1) {
_global.str *= 3;
}
bokovuha.gotoAndPlay(1);
_root.ggoo = 0;
}
}
}
movieClip 960 {
}
button 961 {
on (release) {
if (_global.SoundM != false) {
_global.playsfx('panelmove');
}
if (!menuab._visible) {
if (_global.pauseall) {
_global.pauseall = false;
setPause(false);
_global.step = _global.steptmp;
cap1.gotoAndPlay(80);
mpause.stop();
if (_global.SoundM != false) {
msystem.start(0, 500);
}
} else {
_global.pauseall = true;
setPause(true);
_global.steptmp = _global.step;
_global.step = 0;
cap1.cap11.cap111.text = 'PAUSED';
cap1.gotoAndPlay(1);
msystem.stop();
if (_global.SoundM != false) {
mpause.start(0, 500);
}
}
}
if (!heroab._visible) {
menuab._visible = false;
if (_global.SAE == 2 && _global.perstype == 1) {
_root.stren /= 3;
}
heroab._visible = true;
heroab.gotoAndPlay(1);
bokovuha._visible = false;
_root.ggoo = 1;
} else {
if (_global.SAE == 2 && _global.perstype == 1) {
_root.stren *= 3;
}
heroab._visible = false;
bokovuha._visible = true;
bokovuha.gotoAndPlay(1);
_root.ggoo = 0;
}
trace(cap1);
}
}
movieClip 963 {
}
movieClip 964 {
frame 16 {
_parent.removeMovieClip();
stop();
}
}
movieClip 965 {
frame 1 {
partGo._visible = false;
i = 30;
while (i--) {
d = partGo.duplicateMovieClip('p' + i, i);
d._rotation = Math.random() * 360;
d._yscale = Math.random() * 70 + 50;
d._xscale = d._yscale;
}
}
}
movieClip 966 {
}
movieClip 967 {
frame 12 {
_parent.removeMovieClip();
stop();
}
}
movieClip 968 {
frame 1 {
part1Go._visible = false;
i = 10;
while (i--) {
d = part1Go.duplicateMovieClip('p' + i, i);
d._rotation = Math.random() * 360;
d._yscale = Math.random() * 70 + 50;
d._xscale = d._yscale;
}
}
}
movieClip 970 {
}
movieClip 971 {
frame 14 {
_parent.removeMovieClip();
stop();
}
}
movieClip 972 {
frame 1 {
part2Go._visible = false;
i = 10;
while (i--) {
d = part2Go.duplicateMovieClip('p' + i, i);
d._rotation = Math.random() * 360;
d._yscale = Math.random() * 70 + 50;
d._xscale = d._yscale;
}
}
}
movieClip 977 {
}
movieClip 979 {
}
movieClip 983 {
}
movieClip 985 {
}
movieClip 987 {
}
movieClip 988 {
frame 11 {
if (_global.SAE != 1) {
stop();
}
}
}
movieClip 990 {
}
movieClip 991 {
frame 7 {
this.removeMovieClip();
}
}
movieClip 993 {
}
movieClip 995 {
}
movieClip 997 {
}
movieClip 1000 {
}
movieClip 1001 {
frame 99 {
stop();
}
}
movieClip 1003 {
}
movieClip 1004 {
frame 24 {
if (_global.pauseall) {
stop();
}
}
frame 106 {
stop();
if (_global.systema == 1) {
if (_root.resp) {
_root.tutor._visible = true;
}
}
}
}
movieClip 1006 {
}
movieClip 1007 {
}
movieClip 1008 {
}
movieClip 1012 {
}
button 1021 {
on (release) {
_global.playsfx('buttonrelease');
var mmm = _root.lev + 1;
while (mmm--) {
removeMovieClip(_root.getInstanceAtDepth(mmm));
}
removeMovieClip(_root.heroab);
removeMovieClip(_root.menuab);
removeMovieClip(_root.con);
switch (_global.systema) {
case 1:
_global.system1stat = 0;
break;
case 2:
_global.system2stat = 0;
break;
case 3:
_global.system3stat = 0;
break;
case 4:
_global.system4stat = 0;
break;
case 5:
_global.system5stat = 0;
break;
case 6:
_global.system6stat = 0;
break;
case 7:
_global.system7stat = 0;
break;
case 8:
_global.system8stat = 0;
break;
case 9:
_global.system9stat = 0;
break;
case 10:
_global.system10stat = 0;
break;
case 11:
_global.system11stat = 0;
break;
case 12:
_global.system12stat = 0;
break;
case 13:
_global.system13stat = 0;
break;
case 14:
_global.system14stat = 0;
break;
case 15:
_global.system15stat = 0;
break;
case 16:
_global.system16stat = 0;
break;
case 17:
_global.system17stat = 0;
break;
case 18:
_global.system18stat = 0;
break;
case 19:
_global.system19stat = 0;
break;
case 20:
_global.system20stat = 0;
break;
case 21:
_global.system21stat = 0;
}
_global.hertottime += _global.timeall;
_global.timeall = 0;
_global.herkill += _global.kill1;
_global.kill1 = 0;
_global.herlvl += _global.score;
if (!_global.surv) {
_global.perehod = 1;
} else {
_global.perehod = 2;
}
}
on (rollOver) {
_global.playsfx('onroll');
}
}
button 1023 {
on (release) {
_global.playsfx('onroll');
_global.restartlvl = true;
con._visible = false;
_global.pauseall = false;
_global.MIN -= _global.min1;
_global.GAS -= _global.gas1;
_global.BIO -= _global.bio1;
_global.hertottime += _global.timeall;
_global.timeall = 0;
_global.herkill += _global.kill1;
_global.kill1 = 0;
}
on (rollOver) {
_global.playsfx('onroll');
}
}
button 1025 {
on (release) {
_global.playsfx('buttonrelease');
var mmm = _root.lev + 1;
while (mmm--) {
removeMovieClip(_root.getInstanceAtDepth(mmm));
}
removeMovieClip(_root.heroab);
removeMovieClip(_root.menuab);
removeMovieClip(_root.con);
_global.hertottime += _global.timeall;
_global.timeall = 0;
_global.herkill += _global.kill1;
_global.kill1 = 0;
_global.perehod = 1;
}
on (rollOver) {
_global.playsfx('onroll');
}
}
button 1026 {
on (release) {
_global.playsfx('buttonrelease');
_global.restartlvl = true;
con._visible = false;
_global.pauseall = false;
_global.MIN -= _global.min1;
_global.GAS -= _global.gas1;
_global.BIO -= _global.bio1;
_global.hertottime += _global.timeall;
_global.timeall = 0;
_global.herkill += _global.kill1;
_global.kill1 = 0;
}
on (rollOver) {
_global.playsfx('onroll');
}
}
movieClip 1031 {
frame 2 {
stop();
Qwar._visible = false;
Qdef._visible = false;
Qsca._visible = false;
Qsht._visible = false;
Qtan._visible = false;
switch (_global.perstype) {
case 1:
Qwar._visible = true;
break;
case 2:
Qsca._visible = true;
break;
case 3:
Qtan._visible = true;
break;
case 4:
Qsht._visible = true;
break;
case 5:
Qdef._visible = true;
}
var kill2 = 0;
var res12 = 0;
var res22 = 0;
var res32 = 0;
var time2 = 0;
if (!_global.surv) {
_global.score = Math.floor(_global.kill1 * (_global.gas1 + _global.min1 * 2 + _global.bio1 * 3) * _global.systema / _global.timeall);
} else {
_global.score = _global.kill1 + _global.timeall;
}
if (_global.systema == 9) {
score = Math.floor(620 / _global.timeall);
}
var score2 = 0;
this._yscale = 0;
if (_root.life < 0 && !_global.surv) {
gotoAndPlay(3);
}
onEnterFrame = function () {
if (_global.pauseall) {
if (this._yscale < 100) {
this._yscale += 10;
} else {
if (kill2 < _global.kill1) {
++kill2;
killstxt.text = kill2;
}
if (res12 < _global.gas1) {
++res12;
res1txt.text = res12;
}
if (res22 < _global.min1) {
++res22;
res2txt.text = res22;
}
if (res32 < _global.bio1) {
++res32;
res3txt.text = res32;
}
if (time2 < _global.timeall) {
++time2;
timetxt.text = time2;
}
if (score2 < _global.score) {
++score2;
scoretxt.text = score2;
}
}
}
};
}
frame 3 {
stop();
Qwar._visible = false;
Qdef._visible = false;
Qsca._visible = false;
Qsht._visible = false;
Qtan._visible = false;
switch (_global.perstype) {
case 1:
Qwar._visible = true;
break;
case 2:
Qsca._visible = true;
break;
case 3:
Qtan._visible = true;
break;
case 4:
Qsht._visible = true;
break;
case 5:
Qdef._visible = true;
}
var kill2 = 0;
var death2 = 0;
var time2 = 0;
_global.herdeath += 1;
this._yscale = 0;
onEnterFrame = function () {
if (this._yscale < 100) {
this._yscale += 10;
} else {
if (kill2 < _global.kill1) {
++kill2;
killstxt.text = kill2;
}
if (death2 < _global.herdeath) {
++death2;
deathtxt.text = death2;
}
if (time2 < _global.timeall) {
++time2;
timetxt.text = time2;
}
}
};
}
}
movieClip 1032 {
}
button 1036 {
on (release) {
play();
_global.playsfx('buttonrelease');
}
on (rollOver) {
_global.playsfx('onroll');
}
}
movieClip 1038 {
}
movieClip 1045 {
frame 1 {
this._yscale = 0;
onEnterFrame = function () {
if (this._yscale < 100) {
this._yscale += 20;
}
};
}
}
movieClip 1049 {
}
movieClip 1051 {
}
movieClip 1053 {
}
movieClip 1058 {
frame 1 {
this._yscale = 0;
onEnterFrame = function () {
if (this._yscale < 100) {
this._yscale += 20;
}
};
}
}
movieClip 1064 {
}
movieClip 1065 {
}
movieClip 1067 {
frame 1 {
this._yscale = 0;
onEnterFrame = function () {
if (this._yscale < 100) {
this._yscale += 20;
}
};
}
}
movieClip 1071 {
frame 1 {
this._yscale = 0;
onEnterFrame = function () {
if (this._yscale < 100) {
this._yscale += 20;
}
};
}
}
movieClip 1074 {
frame 1 {
this._yscale = 0;
onEnterFrame = function () {
if (this._yscale < 100) {
this._yscale += 20;
}
};
}
}
button 1077 {
on (release) {
_global.playsfx('buttonrelease');
_root.tutor.gotoAndPlay(1);
}
on (rollOver) {
_global.playsfx('onroll');
}
}
button 1080 {
on (release) {
_global.playsfx('buttonrelease');
_root.tutor._visible = false;
}
on (rollOver) {
_global.playsfx('onroll');
}
}
movieClip 1081 {
frame 2 {
stop();
}
frame 3 {
stop();
}
frame 4 {
stop();
}
frame 5 {
stop();
}
frame 6 {
stop();
}
frame 7 {
stop();
}
frame 8 {
stop();
_root.resp = false;
}
}
frame 7 {
function placeFire(tgt) {
var v3 = 0;
while (v3 < 3) {
++lev;
if (lev > 1000000) {
lev = 0;
}
var v2 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v2);
globalToLocal(v2);
var v1 = fafa.duplicateMovieClip('f' + lev, lev);
if (Math.random() > 0.5) {
v1._x = v2.x + Math.random() * 2 - 1;
} else {
v1._x = v2.x - Math.random() * 2 - 1;
}
if (Math.random() > 0.5) {
v1._y = v2.y + Math.random() * 2 - 1;
} else {
v1._y = v2.y - Math.random() * 2 - 1;
}
v1._alpha = Math.random() * 50 + 50;
v1._yscale = Math.random() * 50 + 70;
v1._xscale = v1._yscale;
++v3;
}
}
function placeBoom(x, y) {
++lev;
var v3 = boom.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom1(x, y) {
++lev;
var v3 = boom1.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom2(x, y) {
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function createExplosion(targetX, targetY, targetPath, explosionParticleAmount, explosionParticleRange, particleSize, speed, speedAlpha) {
var v7 = 0;
while (v7 < explosionParticleAmount) {
var v8 = bitmapsArray[random(bitmapsArray.length)];
var v4 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder' + lev, lev);
++lev;
var v3 = v2.createEmptyMovieClip('internal_holder', lev);
v3._x = -v4.width / 2;
v3._y = -v4.height / 2;
++lev;
v3.attachBitmap(v4, lev, 'never');
v2._x = targetX + random(explosionParticleRange) - explosionParticleRange / 2;
v2._y = targetY + random(explosionParticleRange) - explosionParticleRange / 2;
var v6 = random(particleSize);
v2._xscale = v6;
v2._yscale = v6;
v2.speed = random(speed) + speed;
v2.speedAlpha = random(speedAlpha) + speedAlpha;
v2.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speedAlpha;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
++v7;
}
}
function createParticles(targetX, targetY, targetPath, tempParticle_mcAmount, tempParticle_mcRange, particleSize, tempParticle_mcMaxSpeed, tempParticle_mcMaxFadeSpeed) {
var v7 = 0;
while (v7 < tempParticle_mcAmount) {
var v8 = particleBitmapsArray[random(particleBitmapsArray.length)];
var v5 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder', lev);
++lev;
var v4 = v2.createEmptyMovieClip('internal_holder', lev);
v4._x = -v5.width / 2;
v4._y = -v5.height / 2;
++lev;
v4.attachBitmap(v5, lev, 'never');
v2._x = targetX;
v2._y = targetY;
v2._rotation = random(360);
v2._alpha = random(50) + 50;
v2._xscale = particleSize;
v2._yscale = particleSize;
v2.boundyLeft = targetX - tempParticle_mcRange;
v2.boundyTop = targetY - tempParticle_mcRange;
v2.boundyRight = targetX + tempParticle_mcRange;
v2.boundyBottom = targetY + tempParticle_mcRange;
v2.speedX = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedY = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedX *= tempParticle_mcMaxSpeed;
v2.speedY *= tempParticle_mcMaxSpeed;
v2.fadeSpeed = Math.random(tempParticle_mcMaxFadeSpeed) * tempParticle_mcMaxFadeSpeed;
v2.onEnterFrame = function () {
this._alpha -= this.fadeSpeed;
this._x += this.speedX;
this._y += this.speedY;
if (this._alpha <= 0 || this._x < this.boundyLeft || this._x > this.boundyRight || this._y < this.boundyTop || this._y > this.boundyBottom) {
this.removeMovieClip();
}
};
++v7;
}
}
function fireWeapon(target) {
if (reloadComplete == true && rok > 0) {
++lev;
_global.playsfx('raketa');
var v3 = missile.duplicateMovieClip('missile' + lev, lev);
v3._x = hero._x;
v3._y = hero._y;
v3._rotation = hero._rotation;
v3.targetX = target._x;
v3.targetY = target._y;
v3.tar = target;
v3.moveX = 0;
v3.moveY = 0;
v3.onEnterFrame = function () {
doFollow(this, this.tar);
};
roketi._alpha = 30;
rok -= 1;
roketi.ro.text = rok + '/' + _global.rokmax;
startReloading();
} else {
_global.playsfx('noroket');
}
}
function startReloading() {
reloadComplete = false;
reloadTimer = setInterval(this, 'gunReloaded', reloadSpeed);
}
function gunReloaded() {
clearInterval(reloadTimer);
if (rok > 0) {
roketi._alpha = 75;
}
reloadComplete = true;
}
function doFollow(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
follower.moveDistanceX = turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = missileSpeed * follower.moveX / follower.totalmove;
follower.moveY = missileSpeed * follower.moveY / follower.totalmove;
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = 180 * Math.atan2(follower.moveY, follower.moveX) / Math.PI;
doTrail(follower._x, follower._y, 'particle_smoke_clear');
var v7 = follower._x - target._x;
var v6 = follower._y - target._y;
var v8 = Math.sqrt(v7 * v7 + v6 * v6);
if (v8 < 10) {
placeBoom(target._x, target._y);
var v4 = spiders.length;
while (v4--) {
var v3 = spiders[v4];
if (v3 == target) {
removeSpider(v3);
++_global.kill1;
}
}
v4 = Sspiders.length;
while (v4--) {
v3 = Sspiders[v4];
if (v3 == target) {
removeSSpider(v3);
++_global.kill1;
}
}
if (target == mob1c) {
_global.playsfx('hit');
mob1c.thp -= 10;
mob1c.hp._width -= 3;
if (mob1c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob1c._x, mob1c._y);
mob1c._x += 1000;
resp = false;
}
}
removeMovieClip(target);
removeMovieClip(follower);
}
if (follower.hitTest(sun)) {
_global.playsfx('hit');
placeBoom1(follower._x, follower._y);
removeMovieClip(follower);
}
if (!target._x) {
removeMovieClip(follower);
delete follower.onEnterFrame;
}
}
function doTrail(targetX, targetY, type) {
++lev;
var v3 = _root.attachMovie(type, type + lev, lev);
v3._x = targetX;
v3._y = targetY;
v3._rotation = random(360);
randomScale = random(75) + 25;
v3._xscale = randomScale;
randomScale = random(75) + 25;
v3._yscale = randomScale;
v3.speed = random(10) + 5;
updateAfterEvent();
v3.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speed;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
}
function placeSpider(A, B) {
++lev;
var d = spider.duplicateMovieClip('z' + lev, lev);
if (A == 0 && B == 0) {
d._y = fon._y + Math.random() * fon._height;
if (Math.random() < 0.5) {
d._x = fon._x - d._width / 2;
} else {
d._x = fon._x + fon._width + d._width / 2;
}
} else {
d._x = A;
d._y = B;
}
var v6 = hero._x - d._x;
var v5 = hero._y - d._y;
d.a = Math.atan2(v5, v6);
d._rotation = (d.a / Math.PI) * 180;
d.speed = Math.random() * 2 + 2;
d.onEnterFrame = function () {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
this.a = Math.atan2(v5, v6);
this._rotation = (this.a / Math.PI) * 180;
var v8 = Math.sqrt(v6 * v6 + v5 * v5);
if (v8 < 25 && !placed) {
placeBoom2(hero._x, hero._y);
_global.playsfx('hittestmob');
if (!ud) {
var v7 = shild - 10;
if (v7 < 0) {
life += v7;
shild = 0;
} else {
shild -= 10;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = spiders.length;
while (v3--) {
var v4 = spiders[v3];
if (v4 == d) {
spiders.splice(v3, 1);
}
}
v3 = needBePaused.length;
while (v3--) {
v4 = needBePaused[v3];
if (v4 == d) {
needBePaused.splice(v3, 1);
}
}
}
};
d.onRollOver = function () {
_global.trgt = d;
};
spiders.push(d);
d.lif = 3;
}
function removeSpider(s) {
var v4 = spiders.length;
while (v4--) {
var v2 = spiders[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
spiders.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function placeSSpider(A, B) {
++lev;
var Sd = Sspider.duplicateMovieClip('Sz' + lev, lev);
if (A == 0 && B == 0) {
Sd._y = fon._y + Math.random() * fon._height;
if (Math.random() < 0.5) {
Sd._x = fon._x - Sd._width / 2;
} else {
Sd._x = fon._x + fon._width + Sd._width / 2;
}
} else {
Sd._x = A;
Sd._y = B;
}
var v6 = hero._x - Sd._x;
var v7 = hero._y - Sd._y;
Sd.a = Math.atan2(v7, v6);
Sd._rotation = (Sd.a / Math.PI) * 180;
Sd.speed = Math.random() + 0.5;
var timeS = 0;
var TtimeS = Math.floor(Math.random() * 20) + 14;
var back = 0;
Sd.onEnterFrame = function () {
if (back == 0) {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
}
if (back == 2) {
this._x += -this.speed * Math.cos(this.a);
this._y += -this.speed * Math.sin(this.a);
}
var v6 = hero._x - this._x;
var v7 = hero._y - this._y;
this.a = Math.atan2(v7, v6);
this._rotation = (this.a / Math.PI) * 180;
if (timeS++ > TtimeS) {
timeS = 0;
placeEbul(Sd);
}
var v5 = Math.sqrt(v6 * v6 + v7 * v7);
if (v5 < 180) {
if (back == 0) {
back = 1;
}
}
if (v5 < 120) {
back = 2;
}
if (v5 >= 180) {
back = 0;
}
if (v5 < 25 && !Splaced) {
placeBoom2(hero._x, hero._y);
_global.playsfx('hittestmob');
if (!ud) {
var v8 = shild - 15;
if (v8 < 0) {
life += v8;
shild = 0;
} else {
shild -= 15;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Sspiders.length;
while (v3--) {
var v4 = Sspiders[v3];
if (v4 == Sd) {
Sspiders.splice(v3, 1);
}
}
v3 = needBePaused.length;
while (v3--) {
v4 = needBePaused[v3];
if (v4 == Sd) {
needBePaused.splice(v3, 1);
}
}
}
};
Sd.onRollOver = function () {
_global.trgt = Sd;
};
Sspiders.push(Sd);
Sd.Slif = 5;
}
function removeSSpider(s) {
var v4 = Sspiders.length;
while (v4--) {
var v2 = Sspiders[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
Sspiders.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function createAster(X, Y, OX, OY, D, A, SP, TYP) {
++lev;
if (TYP == 0) {
var v2 = aster.duplicateMovieClip('asteroid' + lev, lev);
} else {
if (TYP == 1) {
var v2 = aster1.duplicateMovieClip('asteroid' + lev, lev);
} else {
var v2 = aster2.duplicateMovieClip('asteroid' + lev, lev);
}
}
v2.xx = X + Math.random() * 5;
v2.yy = Y + Math.random() * 5;
v2.ox = OX;
v2.oy = OY;
v2.ang = A;
v2.sca = D;
v2.typ = TYP;
v2._yscale = D;
v2._xscale = v2._yscale;
v2.spe = SP;
v2.onEnterFrame = function () {
this.ang -= this.spe;
var v6 = this.ang / 57.29577951308232;
this._x = this.xx + this.ox * Math.cos(v6);
this._y = this.yy + this.oy * Math.sin(v6);
this._rotation += 5;
var v2 = 0;
var v3 = this._x - sun._x;
var v5 = this._y - sun._y;
if (v3 == 0) {
if (v5 >= 0) {
v2 = 270;
} else {
v2 = 90;
}
} else {
if (v3 > 0) {
v2 = Math.atan(v5 / v3) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v2 = Math.atan(v5 / v3) / 0.0174532925199433;
} else {
v2 = Math.atan(v5 / v3) / 0.0174532925199433 - 180;
}
}
}
var v4 = this.filters;
v4[0].angle = v2;
v4[0].distance = 11 * (this._xscale / 100);
v4[0].blurY = 11 * (this._xscale / 100);
v4[0].blurX = v4[0].blurY;
this.filters = v4;
};
asteroids.push(v2);
}
function removeAster(s) {
var v3 = asteroids.length;
while (v3--) {
var v1 = asteroids[v3];
if (v1 == s) {
if (v1._width > 10) {
createAster(v1.xx + 5, v1.yy + 5, v1.ox, v1.oy, v1.sca / 1.5, v1.ang, v1.spe + 0.2, v1.typ);
createAster(v1.xx - 5, v1.yy - 5, v1.ox, v1.oy, v1.sca / 1.5, v1.ang, v1.spe, v1.typ);
}
v1.gotoAndStop(2);
delete v1.onEnterFrame;
asteroids.splice(v3, 1);
}
}
var v2 = needBePaused.length;
while (v2--) {
var v4 = needBePaused[v2];
if (v4 == s) {
needBePaused.splice(v2, 1);
}
}
}
stop();
var my_so = SharedObject.getLocal('spiteful_space_save', '/');
_global.MIN = my_so.data.MIN;
_global.GAS = my_so.data.GAS;
_global.BIO = my_so.data.BIO;
_global.rokmax = my_so.data.rokmax;
_global.uR = my_so.data.uR;
_global.uG = my_so.data.uG;
_global.uB = my_so.data.uB;
_global.uRa = my_so.data.uRa;
_global.uE = my_so.data.uE;
_global.uS = my_so.data.uS;
_global.uSt = my_so.data.uSt;
my_so.flush();
_global.perehod = 0;
if (_global.SoundM != false) {
mpause.stop();
msystem.stop();
mmenu.stop();
mbos.stop();
msystem.start(0, 500);
}
_global.sa1 = 1;
_global.sa2 = 1;
_global.sa3 = 1;
var stren = _global.str;
heroab.swapDepths(1000002);
menuab.swapDepths(1000003);
con.swapDepths(1000004);
_global.bio1 = 0;
_global.min1 = 0;
_global.gas1 = 0;
_global.kill1 = 0;
_global.restartlvl = false;
_global.pauseall = false;
_global.steptmp = 0;
_global.pausetimestart = 0;
_global.pausetimestop = 0;
_global.pausetimeall = 0;
needBePaused = new Array();
_global.addToPause = function (obj) {
if (!obj._inPause) {
needBePaused.push(obj);
obj._inPause = true;
}
};
var koff = 1;
var finangle = Math.random() * 100;
finplay = function () {
finangle += 10;
if (koff < 30) {
koff += 0.5;
}
finr_ang = finangle / 57.29577951308232;
finmc._x = 500 + koff * Math.cos(finr_ang);
finmc._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc._x, finmc._y, 'particle_smoke_clear');
finr_ang = (finangle + 180) / 57.29577951308232;
finmc1._x = 500 + koff * Math.cos(finr_ang);
finmc1._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc1._x, finmc1._y, 'particle_smoke_clear');
};
_global.setPause = function (flag) {
isPause = flag;
var v3 = needBePaused.length;
while (v3--) {
var v2 = needBePaused[v3];
if (flag) {
v2.stop();
v2.oef = v2.onEnterFrame;
v2.onEnterFrame = null;
} else {
v2.onEnterFrame = v2.oef;
v2.play();
}
}
if (flag) {
_global.pausetimestart = int(getTimer() / 1000);
} else {
_global.pausetimestop = int(getTimer() / 1000);
_global.pausetimeall += _global.pausetimestart - _global.pausetimestop;
}
};
min1.text = _global.GAS + '/300';
min2.text = _global.MIN + '/150';
min3.text = _global.BIO + '/50';
samc._width = 0;
samc._x = 350;
var angl = 0;
var Xx = mob1c._x - sun._x;
var Yy = mob1c._y - sun._y;
if (Xx == 0) {
if (Yy >= 0) {
angl = 270;
} else {
angl = 90;
}
} else {
if (Xx > 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433;
} else {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 - 180;
}
}
}
var myList = mob1c.mob1cc.filters;
myList[1].angle = angl;
myList[0].color = 16762823;
mob1c.mob1cc.filters = myList;
_global.SAE = 0;
var SAc = 0;
var ud = false;
var radiu = _global.rad;
var life = _global.arm;
var shild = _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
heroab.h1._width = 50 * _global.arm / 300;
heroab.h2._width = 50 * _global.def / 200;
heroab.h3._width = 50 * _global.spe / 7;
heroab.h4._width = 50 * stren / 2.2;
heroab.h5._width = 50 * _global.rad / 4;
var rok = _global.rokmax;
roketi.ro.text = rok + '/' + _global.rokmax;
_global.step = _global.spe;
var checkup = 1;
var checkup1 = 1;
var rotDirSpeed = 5;
var angle = Math.random() * 100;
var spiderCount = 0;
var SspiderCount = 0;
var lev = 0;
var timeb = int(getTimer() / 100);
var timenasys = int(getTimer() / 1000);
_global.timeall = 0;
var fire = false;
heroab._visible = false;
menuab._visible = false;
con._visible = false;
boom._visible = false;
boom1._visible = false;
boom2._visible = false;
mob1c.thp = 100;
var resp = true;
var end = false;
var end1 = 0;
fafa._visible = false;
var bitmapsArray;
var particleBitmapsArray;
bitmapsArray = ['effect-fire5.png', 'effect-fire6.png', 'effect-fire7.png', 'effect-fire8.png', 'effect-fire9.png'];
particleBitmapsArray = ['particle.jpg', 'particle1.png', 'particle5.png'];
var Gass = new Array();
placeGas = function (A, B) {
++lev;
var d = gas.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.GAS < 300) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Gass.length;
while (v3--) {
var v4 = Gass[v3];
if (v4 == d) {
Gass.splice(v3, 1);
}
}
_global.GAS += 1;
++_global.gas1;
_global.playsfx('collected');
min1.text = _global.GAS + '/300';
}
};
Gass.push(d);
};
var Minerals = new Array();
placeMineral = function (A, B) {
++lev;
var d = mineral.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.MIN < 150) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Minerals.length;
while (v3--) {
var v4 = Minerals[v3];
if (v4 == d) {
Minerals.splice(v3, 1);
}
}
_global.MIN += 1;
++_global.min1;
_global.playsfx('collected');
min2.text = _global.MIN + '/150';
}
};
Minerals.push(d);
};
var Bios = new Array();
placeBio = function (A, B) {
++lev;
var d = bio.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.BIO < 50) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Bios.length;
while (v3--) {
var v4 = Bios[v3];
if (v4 == d) {
Bios.splice(v3, 1);
}
}
_global.BIO += 1;
++_global.bio1;
_global.playsfx('collected');
min3.text = _global.BIO + '/50';
}
};
Bios.push(d);
};
var reloadSpeed = 1000;
var missileSpeed = 7;
var turnRate = 0.7;
var reloadTimer;
var reloadComplete = true;
bulletSpeed = 18;
placeBullet = function (tgt) {
++lev;
var v10 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v10);
globalToLocal(v10);
_global.playsfx('vistrel');
var v9 = bullet.duplicateMovieClip('b' + lev, lev);
v9._x = v10.x;
v9._y = v10.y;
v9._rotation = hero._rotation + hero.body._rotation;
v9.a = (v9._rotation / 180) * Math.PI;
v9.onEnterFrame = function () {
this._x += bulletSpeed * Math.cos(this.a);
this._y += bulletSpeed * Math.sin(this.a);
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.hitTest(sun)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
_global.playsfx('hit');
}
if (this.hitTest(pl1)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
_global.playsfx('hit');
}
if (this.hitTest(pl2)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
_global.playsfx('hit');
}
if (this.hitTest(pl3)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
_global.playsfx('hit');
}
var v8 = asteroids.length;
while (v8--) {
var v6 = asteroids[v8];
if (v6.hitTest(this)) {
_global.playsfx('hit');
this.removeMovieClip();
removeAster(v6);
placeBoom1(v6._x, v6._y);
}
}
v8 = spiders.length;
while (v8--) {
var v3 = spiders[v8];
if (v3.hit.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 5 <= 220) {
SAc += 5;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v3.lif -= _global.rad * stren;
v3._yscale -= 20 * stren;
v3._xscale = v3._yscale;
if (SAE != 2) {
v3.speed -= 0.5 * stren;
}
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v5 = 0;
if (_global.timeall <= 60) {
v5 = 0;
} else {
if (_global.timeall <= 120) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeSpider(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
} else {
v3.lif -= stren;
v3._yscale -= 10 * stren;
v3._xscale = v3._yscale;
if (SAE != 2) {
v3.speed -= 0.5 * stren;
}
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v5 = 0;
if (_global.timeall <= 60) {
v5 = 0;
} else {
if (_global.timeall <= 120) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeSpider(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
}
}
}
if (mob1c.hitTest(this)) {
_global.playsfx('hit');
if (Math.abs(hero._x - mob1c._x) < 128.5 && Math.abs(hero._y - mob1c._y) < 128.5) {
mob1c.thp -= _global.rad;
mob1c.hp._width -= 0.3 * _global.rad;
} else {
mob1c.thp -= 1;
mob1c.hp._width -= 0.3;
}
if (mob1c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob1c._x, mob1c._y);
mob1c._x += 1000;
resp = false;
}
if (Math.random() < 0.2) {
placeBoom(mob1c._x, mob1c._y);
}
placeBoom1(mob1c._x, mob1c._y);
this.removeMovieClip();
}
var v7 = Sspiders.length;
while (v7--) {
var v4 = Sspiders[v7];
if (v4.Shit.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 3 <= 220) {
SAc += 3;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v4._x) < 128.5 && Math.abs(hero._y - v4._y) < 128.5) {
v4.Slif -= _global.rad * stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.Slif <= 0) {
v4.gotoAndStop(2);
v5 = 0;
if (_global.timeall <= 60) {
v5 = 0;
} else {
if (_global.timeall <= 120) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeSSpider(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
} else {
v4.Slif -= stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.Slif <= 0) {
v4.gotoAndStop(2);
v5 = 0;
if (_global.timeall <= 60) {
v5 = 0;
} else {
if (_global.timeall <= 120) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeSSpider(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
}
}
}
};
};
placeEbul = function (tgt) {
++lev;
var v6 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v6);
globalToLocal(v6);
_global.playsfx('zelenie');
var v5 = ebul.duplicateMovieClip('b' + lev, lev);
v5._x = v6.x;
v5._y = v6.y;
if (Math.floor(Math.random() * 2) == 1) {
v5._rotation = tgt._rotation + Math.random() * 10;
} else {
v5._rotation = tgt._rotation - Math.random() * 10;
}
v5.a = (v5._rotation / 180) * Math.PI;
v5.onEnterFrame = function () {
this._x += (bulletSpeed - 8) * _global.sa2 * Math.cos(this.a);
this._y += (bulletSpeed - 8) * _global.sa2 * Math.sin(this.a);
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.hitTest(sun)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl1)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl2)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl3)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
var v4 = asteroids.length;
while (v4--) {
var v3 = asteroids[v4];
if (v3.hitTest(this)) {
this.removeMovieClip();
removeAster(v3);
placeBoom1(v3._x, v3._y);
}
}
if (hero.foot.hitTest(this)) {
_global.playsfx('hitme');
if (!ud) {
var v5 = shild - 5;
if (v5 < 0) {
life += v5;
shild = 0;
} else {
shild -= 5;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
placeBoom1(hero._x, hero._y);
this.removeMovieClip();
}
};
};
var spiders = new Array();
var Sspiders = new Array();
var asteroids = new Array();
i = random(10) + 10;
while (i--) {
createAster(sun._x + 35, sun._y + 35, 275, 235, Math.random() * 60 + 20, Math.random() * 360, Math.random() + 0.1, random(3));
}
i = 10;
if (_global.systema == 6 || _global.systema == 7) {
i = 15;
}
while (i--) {
placeSpider(Math.floor(Math.random() * 200) + 500, Math.floor(Math.random() * 200) + 200);
}
i = 5;
if (_global.systema == 6 || _global.systema == 7) {
i = 8;
}
while (i--) {
placeSSpider(Math.floor(Math.random() * 200) + 500, Math.floor(Math.random() * 200) + 200);
}
onEnterFrame = function () {
var v11 = 0;
var v12 = hero.foot._x - sun._x;
var v14 = hero.foot._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
var v15 = hero.foot.filters;
v15[1].angle = v11;
hero.foot.filters = v15;
v11 = 0;
v12 = pl1._x - sun._x;
v14 = pl1._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v15 = pl1.filters;
v15[1].angle = v11;
pl1.filters = v15;
if (Key.isDown(16) && !_global.pauseall) {
if (_global.trgt._width) {
fireWeapon(_global.trgt);
}
}
if (Key.isDown(32) && _global.SAE == 1 && !_global.pauseall) {
sap._alpha = 100;
_global.SAE = 2;
_global.playsfx('sastart');
if (_global.perstype == 1) {
stren *= 3;
cap1.cap11.cap111.text = 'EAGLE EYE!';
cap1.gotoAndPlay(1);
var v13 = hero.foot.filters;
v13[1].color = 16711680;
hero.foot.filters = v13;
}
if (_global.perstype == 3) {
_global.sa3 = 0.5;
_global.rad = 1;
cap1.cap11.cap111.text = 'NEUTRON ACCELERATION!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 2) {
var v7 = spiders.length;
while (v7--) {
var v5 = spiders[v7];
v5.speed *= 0.2;
}
v7 = Sspiders.length;
while (v7--) {
v5 = Sspiders[v7];
v5.speed *= 0.2;
}
_global.sa2 = 0.2;
cap1.cap11.cap111.text = 'TIME BOMB!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 5) {
ud = true;
cap1.cap11.cap111.text = 'ULTIMATE DEFENCE!';
cap1.gotoAndPlay(1);
v13 = hero.foot.filters;
v13[2].strength = 2;
hero.foot.filters = v13;
}
if (_global.perstype == 4) {
var v6 = enemiesArray.length;
while (v6--) {
var v3 = enemiesArray[v6];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
var v4 = 0.5;
++_global.kill1;
if (Math.random() > 0.5 + 0.5 * v4) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v4) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v4) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeEnemy(v3);
}
}
v6 = spiders.length;
while (v6--) {
v3 = spiders[v6];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v4 = 0.5;
++_global.kill1;
if (Math.random() > 0.5 + 0.5 * v4) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v4) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v4) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeSpider(v3);
}
}
v6 = Sspiders.length;
while (v6--) {
v3 = Sspiders[v6];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v4 = 0.5;
++_global.kill1;
if (Math.random() > 0.5 + 0.5 * v4) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v4) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v4) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeSSpider(v3);
}
}
hero.zone._alpha = 85;
SAc = 32;
cap1.cap11.cap111.text = 'ANNIHILATING FLASH!';
cap1.gotoAndPlay(1);
}
}
if ((Key.isDown(37) || Key.isDown(65)) && !_global.pauseall) {
hero._rotation -= rotDirSpeed;
} else {
if ((Key.isDown(39) || Key.isDown(68)) && !_global.pauseall) {
hero._rotation += rotDirSpeed;
}
}
var v19 = _xmouse - hero._x;
var v17 = _ymouse - hero._y;
var v18 = Math.atan2(v17, v19);
hero.body._rotation = -hero._rotation + (v18 / Math.PI) * 180;
var v10 = (hero._rotation / 180) * Math.PI;
if ((Key.isDown(38) || Key.isDown(87)) && !_global.pauseall) {
if (_global.step < 5) {
_global.step += 0.1;
}
if (checkup1 == 2) {
_global.step = 2;
checkup1 = 1;
}
hero.foot.play();
checkup = 1;
hero._x += _global.step * Math.cos(v10);
hero._y += _global.step * Math.sin(v10);
} else {
if (checkup == 1 && _global.step > 0) {
hero._x += _global.step * Math.cos(v10);
hero._y += _global.step * Math.sin(v10);
_global.step -= 0.1;
} else {
if (checkup == 2 && _global.step > 0) {
hero._x -= _global.step * Math.cos(v10);
hero._y -= _global.step * Math.sin(v10);
_global.step -= 0.1;
} else {
hero.foot.stop;
}
}
}
if (hero._x < 0) {
hero._x = 0;
}
if (hero._x > 700) {
hero._x = 700;
}
if (hero._y < 0) {
hero._y = 0;
}
if (hero._y > 600) {
hero._y = 600;
}
if (!_global.pauseall) {
angle += 0.2;
}
r_ang = angle / 57.29577951308232;
pl1._x = 317 + 150 * Math.cos(r_ang);
pl1._y = 245 + 150 * Math.sin(r_ang);
if (hero.foot.hitTest(sun) && !_global.pauseall) {
if (ud) {
if (shild + 1 > _global.def) {
shild = _global.def;
} else {
shild += 1;
}
} else {
if (shild + 5 > _global.def) {
shild = _global.def;
} else {
shild += 5;
}
life -= 1;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
if (spiderCount++ > 60 && resp && _global.SAE != 2 && !_global.pauseall) {
spiderCount = 0;
placeSpider(566, 180);
_global.playsfx('resp');
if (_global.systema == 6) {
placeSpider(0, 0);
}
}
if (SspiderCount++ > 300 && resp && _global.SAE != 2 && !_global.pauseall) {
SspiderCount = 0;
placeSSpider(0, 0);
if (_global.systema == 7) {
placeSSpider(0, 0);
}
}
timebb = int(getTimer() / 100) - timeb;
if (fire && timebb >= 2 * _global.sa3) {
if (_global.uG == 1) {
placeBullet(hero.body.dot);
}
if (_global.uG == 2) {
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
if (_global.uG == 3) {
placeBullet(hero.body.dot);
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
timeb = int(getTimer() / 100);
}
if (_global.SAE == 2) {
if (SAc - 2 <= 0) {
SAc = 0;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 0;
sap._alpha = 0;
if (_global.perstype == 5) {
ud = false;
v13 = hero.foot.filters;
v13[2].strength = 0;
hero.foot.filters = v13;
}
if (_global.perstype == 1) {
stren /= 3;
v13 = hero.foot.filters;
v13[1].color = 16777215;
hero.foot.filters = v13;
}
if (_global.perstype == 3) {
_global.sa3 = 1;
_global.rad = radiu;
}
if (_global.perstype == 2) {
v7 = spiders.length;
while (v7--) {
v5 = spiders[v7];
v5.speed *= 5;
}
v7 = Sspiders.length;
while (v7--) {
v5 = Sspiders[v7];
v5.speed *= 5;
}
_global.sa2 = 1;
}
if (_global.perstype == 4) {
hero.zone._alpha = 5;
}
} else {
if (!_global.pauseall) {
SAc -= 2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
if (_global.perstype == 4) {
hero.zone._alpha -= 5;
}
if (_global.perstype == 2) {
if (shild + 2 > _global.def) {
shild = _global.def;
} else {
shild += 2;
}
shilds._width = 183 * shild / _global.def;
teshi.text = 'shield ' + shild + '%';
}
}
}
}
if (_global.step > 0) {
placeFire(hero.sop);
}
if (resp == false && !end) {
if (spiders.length == 0 && Sspiders.length == 0) {
cap1.cap11.cap111.text = 'SYSTEM NOW FREE, GOOD JOB!';
cap1.gotoAndPlay(1);
_global.playsfx('openportal');
_global.trgt = null;
fin._x = 500;
fin._y = 430;
fin.gotoAndPlay(1);
var v16 = new flash.filters.GlowFilter();
var v9 = pl1.filters;
v9.push(v16);
v9[2].blurY = 0;
v9[2].blurX = 0;
v9[2].quality = 100;
v9[2].color = 3329279;
pl1.filters = v9;
end1 = 8;
end = true;
}
}
if (end1 > 0) {
end1 -= 0.1;
v9 = pl1.filters;
v9[2].blurY = 8 - end1;
v9[2].blurX = v9[2].blurY;
v9[2].strength = (8 - end1) / 5;
pl1.filters = v9;
}
if (!end && !_global.pauseall) {
_global.timeall = int(getTimer() / 1000) - timenasys + _global.pausetimeall;
systime.text = _global.timeall;
}
if (end) {
finplay();
}
if (hero.foot.hitTest(fin.endss.ends) && !_global.pauseall) {
msystem.stop();
_global.playsfx('win');
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.SAE == 0 && !_global.pauseall) {
if (SAc + 0.2 <= 220) {
SAc += 0.2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
_global.playsfx(saready);
}
}
if (_global.trgt._width && !_global.pauseall) {
trg._x = _global.trgt._x;
trg._y = _global.trgt._y;
} else {
trg._x = 1000;
trg._y = 1000;
}
if (_global.restartlvl) {
var v8 = lev + 1;
while (v8--) {
removeMovieClip(_root.getInstanceAtDepth(v8));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(7);
}
if (life < 0 && !_global.pauseall) {
_global.playsfx('exp');
msystem.stop();
mbos.stop();
_global.playsfx('win');
lifes._width = 0;
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
placeBoom(hero._x, hero._y);
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.perehod == 1) {
gotoAndPlay(5);
}
if (_global.perehod == 2) {
v8 = lev + 1;
while (v8--) {
removeMovieClip(_root.getInstanceAtDepth(v8));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(1);
}
};
onMouseDown = function () {
if (!_global.pauseall) {
fire = true;
}
};
onMouseUp = function () {
fire = false;
};
}
movieClip 1084 {
}
button 1091 {
on (release) {
if (_global.SoundM != false) {
_global.playsfx('panelmove');
}
if (!menuab._visible) {
if (_global.pauseall) {
_global.pauseall = false;
setPause(false);
_global.step = _global.steptmp;
cap1.gotoAndPlay(80);
mpause.stop();
if (_global.SoundM != false) {
msystem.start(0, 500);
}
} else {
_global.pauseall = true;
setPause(true);
_global.steptmp = _global.step;
_global.step = 0;
cap1.cap11.cap111.text = 'PAUSED';
cap1.gotoAndPlay(1);
msystem.stop();
if (_global.SoundM != false) {
mpause.start(0, 500);
}
}
}
if (!heroab._visible) {
menuab._visible = false;
if (_global.SAE == 2 && _global.perstype == 1) {
_root.stren /= 3;
}
heroab._visible = true;
heroab.gotoAndPlay(1);
bokovuha._visible = false;
_root.ggoo = 1;
} else {
if (_global.SAE == 2 && _global.perstype == 1) {
_root.stren *= 3;
}
heroab._visible = false;
bokovuha._visible = true;
bokovuha.gotoAndPlay(1);
_root.ggoo = 0;
}
}
}
movieClip 1094 {
frame 1 {
stop();
addToPause(this);
}
frame 2 {
_parent.removeMovieClip();
}
}
movieClip 1097 {
frame 1 {
stop();
addToPause(this);
}
frame 2 {
_parent.removeMovieClip();
}
}
movieClip 1100 {
frame 1 {
stop();
addToPause(this);
}
frame 2 {
_parent.removeMovieClip();
}
}
movieClip 1102 {
}
movieClip 1105 {
}
movieClip 1106 {
}
instance mob1c of movieClip 1106 {
onClipEvent (rollOver) {
_global.trgt = this;
}
}
frame 8 {
function placeFire(tgt) {
var v3 = 0;
while (v3 < 3) {
++lev;
if (lev > 1000000) {
lev = 0;
}
var v2 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v2);
globalToLocal(v2);
var v1 = fafa.duplicateMovieClip('f' + lev, lev);
if (Math.random() > 0.5) {
v1._x = v2.x + Math.random() * 2 - 1;
} else {
v1._x = v2.x - Math.random() * 2 - 1;
}
if (Math.random() > 0.5) {
v1._y = v2.y + Math.random() * 2 - 1;
} else {
v1._y = v2.y - Math.random() * 2 - 1;
}
v1._alpha = Math.random() * 50 + 50;
v1._yscale = Math.random() * 50 + 70;
v1._xscale = v1._yscale;
++v3;
}
}
function placeBoom(x, y) {
++lev;
var v3 = boom.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom1(x, y) {
++lev;
var v3 = boom1.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom2(x, y) {
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function createExplosion(targetX, targetY, targetPath, explosionParticleAmount, explosionParticleRange, particleSize, speed, speedAlpha) {
var v7 = 0;
while (v7 < explosionParticleAmount) {
var v8 = bitmapsArray[random(bitmapsArray.length)];
var v4 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder' + lev, lev);
++lev;
var v3 = v2.createEmptyMovieClip('internal_holder', lev);
v3._x = -v4.width / 2;
v3._y = -v4.height / 2;
++lev;
v3.attachBitmap(v4, lev, 'never');
v2._x = targetX + random(explosionParticleRange) - explosionParticleRange / 2;
v2._y = targetY + random(explosionParticleRange) - explosionParticleRange / 2;
var v6 = random(particleSize);
v2._xscale = v6;
v2._yscale = v6;
v2.speed = random(speed) + speed;
v2.speedAlpha = random(speedAlpha) + speedAlpha;
v2.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speedAlpha;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
++v7;
}
}
function createParticles(targetX, targetY, targetPath, tempParticle_mcAmount, tempParticle_mcRange, particleSize, tempParticle_mcMaxSpeed, tempParticle_mcMaxFadeSpeed) {
var v7 = 0;
while (v7 < tempParticle_mcAmount) {
var v8 = particleBitmapsArray[random(particleBitmapsArray.length)];
var v5 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder', lev);
++lev;
var v4 = v2.createEmptyMovieClip('internal_holder', lev);
v4._x = -v5.width / 2;
v4._y = -v5.height / 2;
++lev;
v4.attachBitmap(v5, lev, 'never');
v2._x = targetX;
v2._y = targetY;
v2._rotation = random(360);
v2._alpha = random(50) + 50;
v2._xscale = particleSize;
v2._yscale = particleSize;
v2.boundyLeft = targetX - tempParticle_mcRange;
v2.boundyTop = targetY - tempParticle_mcRange;
v2.boundyRight = targetX + tempParticle_mcRange;
v2.boundyBottom = targetY + tempParticle_mcRange;
v2.speedX = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedY = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedX *= tempParticle_mcMaxSpeed;
v2.speedY *= tempParticle_mcMaxSpeed;
v2.fadeSpeed = Math.random(tempParticle_mcMaxFadeSpeed) * tempParticle_mcMaxFadeSpeed;
v2.onEnterFrame = function () {
this._alpha -= this.fadeSpeed;
this._x += this.speedX;
this._y += this.speedY;
if (this._alpha <= 0 || this._x < this.boundyLeft || this._x > this.boundyRight || this._y < this.boundyTop || this._y > this.boundyBottom) {
this.removeMovieClip();
}
};
++v7;
}
}
function placeVolnaboom(x, y) {
++lev;
var v1 = volnaboom.duplicateMovieClip('b' + lev, lev);
v1._x = x;
v1._y = y;
}
function fireWeapon(target) {
if (reloadComplete == true && rok > 0) {
++lev;
_global.playsfx('raketa');
var v3 = missile.duplicateMovieClip('missile' + lev, lev);
v3._x = hero._x;
v3._y = hero._y;
v3._rotation = hero._rotation;
v3.targetX = target._x;
v3.targetY = target._y;
v3.tar = target;
v3.moveX = 0;
v3.moveY = 0;
v3.onEnterFrame = function () {
doFollow(this, this.tar);
};
roketi._alpha = 30;
rok -= 1;
roketi.ro.text = rok + '/' + _global.rokmax;
startReloading();
} else {
_global.playsfx('noroket');
}
}
function startReloading() {
reloadComplete = false;
reloadTimer = setInterval(this, 'gunReloaded', reloadSpeed);
}
function gunReloaded() {
clearInterval(reloadTimer);
if (rok > 0) {
roketi._alpha = 75;
}
reloadComplete = true;
}
function doFollow(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
follower.moveDistanceX = turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = missileSpeed * follower.moveX / follower.totalmove;
follower.moveY = missileSpeed * follower.moveY / follower.totalmove;
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = 180 * Math.atan2(follower.moveY, follower.moveX) / Math.PI;
doTrail(follower._x, follower._y, 'particle_smoke_clear');
var v7 = follower._x - target._x;
var v6 = follower._y - target._y;
var v8 = Math.sqrt(v7 * v7 + v6 * v6);
if (v8 < 10) {
placeBoom(target._x, target._y);
var v4 = spiders.length;
while (v4--) {
var v2 = spiders[v4];
if (v2 == target) {
removeSpider(v2);
++_global.kill1;
}
}
v4 = Sspiders.length;
while (v4--) {
v2 = Sspiders[v4];
if (v2 == target) {
removeSSpider(v2);
++_global.kill1;
}
}
v4 = enemiesArray.length;
while (v4--) {
v2 = enemiesArray[v4];
if (v2 == target) {
removeEnemy(v2);
++_global.kill1;
}
}
if (target == mob1c) {
_global.playsfx('hit');
mob1c.thp -= 10;
mob1c.hp._width -= 3;
if (mob1c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob1c._x, mob1c._y);
placeBoom(mob1c._x, mob1c._y);
placeBoom(mob1c._x, mob1c._y);
mob1c._x += 1000;
resp = false;
}
}
if (target == rb1) {
_global.playsfx('hit');
rb1.thp -= 10;
rb1.hp._width -= 3;
if (rb1.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(rb1._x, rb1._y);
placeBoom(rb1._x, rb1._y);
placeBoom(rb1._x, rb1._y);
rb1._x += 1000;
resp = false;
++_global.kill1;
}
}
removeMovieClip(target);
removeMovieClip(follower);
}
if (follower.hitTest(sun)) {
_global.playsfx('hit');
placeBoom1(follower._x, follower._y);
removeMovieClip(follower);
}
if (!target._x) {
removeMovieClip(follower);
delete follower.onEnterFrame;
}
}
function doTrail(targetX, targetY, type) {
++lev;
var v3 = _root.attachMovie(type, type + lev, lev);
v3._x = targetX;
v3._y = targetY;
v3._rotation = random(360);
randomScale = random(75) + 25;
v3._xscale = randomScale;
randomScale = random(75) + 25;
v3._yscale = randomScale;
v3.speed = random(10) + 5;
updateAfterEvent();
v3.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speed;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
}
function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip) {
var v4 = 0;
while (v4 < enemyAmount) {
++lev;
if (enemyLibraryClip == 'e1') {
var v3 = enemA.duplicateMovieClip('ee' + lev, lev);
}
if (enemyLibraryClip == 'e2') {
v3 = enemB.duplicateMovieClip('ee' + lev, lev);
}
if (enemyLibraryClip == 'e3') {
v3 = enemC.duplicateMovieClip('ee' + lev, lev);
}
v3._x = random(Stage.width);
v3._y = random(Stage.height);
v3._rotation = random(360);
if (enemyBehavior == 'typeA') {
v3.speed = Math.random() + 1;
v3.turnRate = 0.1;
v3.agroRange = 300;
v3.mode = 'follow';
v3.lif = 10;
v3.tt = 1;
v3.TtimeS = Math.floor(Math.random() * 20) + 60;
} else {
if (enemyBehavior == 'typeB') {
v3.speed = Math.random() * 2 + 6;
v3.turnRate = 1;
v3.agroRange = 500;
v3.mode = 'follow';
v3.lif = 20;
v3.tt = 2;
v3.TtimeS = Math.floor(Math.random() * 10) + 10;
} else {
if (enemyBehavior == 'typeC') {
v3.speed = Math.random() + 1;
v3.turnRate = 0.2;
v3.agroRange = 100;
v3.mode = 'run';
v3._x = random(Stage.width - 400) + 200;
v3._y = random(Stage.height - 300) + 150;
v3.lif = 15;
v3.tt = 3;
v3.TtimeS = Math.floor(Math.random() * 20) + 20;
}
}
}
v3.distanceX = 0;
v3.distanceY = 0;
v3.distanceTotal = 0;
v3.moveDistanceX = 0;
v3.moveDistanceY = 0;
v3.moveX = 0;
v3.moveY = 0;
v3.totalmove = 0;
v3.timeS = 0;
v3.onRollOver = function () {
_global.trgt = this;
};
enemiesArray.push(v3);
++v4;
}
}
function updateEnemies() {
var v3 = 0;
while (v3 < enemiesArray.length) {
var v2 = enemiesArray[v3];
updatePosition(v2, hero);
if (v2.tt == 1) {
if (v2.timeS++ > v2.TtimeS) {
v2.timeS = 0;
placeVolna(v2);
if (_global.Detal == 2) {
placeVolnaboom(v2._x, v2._y);
}
}
}
if (v2.tt == 3) {
if (v2.timeS++ > v2.TtimeS) {
v2.timeS = 0;
_global.playsfx('lazer');
var v4 = 4;
while (v4--) {
placeEbul(v2, 2);
v2._rotation += 90;
}
}
}
if (v2.tt == 2) {
if (v2.timeS++ > v2.TtimeS) {
v2.timeS = 0;
placeEbul(v2, 3);
}
}
++v3;
}
}
function updatePosition(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
if (follower.distanceTotal <= follower.agroRange) {
follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = follower.speed * follower.moveX / follower.totalmove;
follower.moveY = follower.speed * follower.moveY / follower.totalmove;
if (follower.mode == 'follow') {
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians;
} else {
if (follower.mode == 'run') {
if (follower._x - follower.moveX >= 0 && follower._x - follower.moveX <= 700) {
follower._x -= follower.moveX;
}
if (follower._y - follower.moveY >= 0 && follower._y - follower.moveY <= 600) {
follower._y -= follower.moveY;
}
follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180;
}
}
}
if (follower._x < 0) {
follower._x = 0;
}
if (follower._x > 700) {
follower._x = 700;
}
if (follower._y < 0) {
follower._y = 0;
}
if (follower._y > 600) {
follower._y = 600;
}
}
function removeEnemy(s) {
var v4 = enemiesArray.length;
while (v4--) {
var v2 = enemiesArray[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
enemiesArray.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function placeSpider(A, B) {
++lev;
var d = spider.duplicateMovieClip('z' + lev, lev);
d._x = A;
d._y = B;
var v6 = hero._x - d._x;
var v5 = hero._y - d._y;
d.a = Math.atan2(v5, v6);
d._rotation = (d.a / Math.PI) * 180;
d.speed = Math.random() * 2 + 2;
d.onEnterFrame = function () {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
this.a = Math.atan2(v5, v6);
this._rotation = (this.a / Math.PI) * 180;
var v8 = Math.sqrt(v6 * v6 + v5 * v5);
if (v8 < 25 && !placed) {
_global.playsfx('hittestmob');
placeBoom2(hero._x, hero._y);
if (!ud) {
var v7 = shild - 10;
if (v7 < 0) {
life += v7;
shild = 0;
} else {
shild -= 10;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = spiders.length;
while (v3--) {
var v4 = spiders[v3];
if (v4 == d) {
spiders.splice(v3, 1);
}
}
v3 = needBePaused.length;
while (v3--) {
v4 = needBePaused[v3];
if (v4 == d) {
needBePaused.splice(v3, 1);
}
}
}
};
d.onRollOver = function () {
_global.trgt = this;
};
spiders.push(d);
d.lif = 3;
}
function removeSpider(s) {
var v4 = spiders.length;
while (v4--) {
var v2 = spiders[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
spiders.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function placeSSpider(A, B) {
++lev;
var Sd = Sspider.duplicateMovieClip('Sz' + lev, lev);
if (A == 0 && B == 0) {
Sd._y = fon._y + Math.random() * fon._height;
if (Math.random() < 0.5) {
Sd._x = fon._x - Sd._width / 2;
} else {
Sd._x = fon._x + fon._width + Sd._width / 2;
}
} else {
Sd._x = A;
Sd._y = B;
}
var v6 = hero._x - Sd._x;
var v7 = hero._y - Sd._y;
Sd.a = Math.atan2(v7, v6);
Sd._rotation = (Sd.a / Math.PI) * 180;
Sd.speed = Math.random() + 0.5;
Sd.timeS = 0;
Sd.TtimeS = Math.floor(Math.random() * 20) + 14;
var back = 0;
Sd.onEnterFrame = function () {
if (back == 0) {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
}
if (back == 2) {
this._x += -this.speed * Math.cos(this.a);
this._y += -this.speed * Math.sin(this.a);
}
var v6 = hero._x - this._x;
var v7 = hero._y - this._y;
this.a = Math.atan2(v7, v6);
this._rotation = (this.a / Math.PI) * 180;
if (this.timeS++ > this.TtimeS) {
this.timeS = 0;
placeEbul(Sd, 1);
}
var v5 = Math.sqrt(v6 * v6 + v7 * v7);
if (v5 < 180) {
if (back == 0) {
back = 1;
}
}
if (v5 < 120) {
back = 2;
}
if (v5 >= 180) {
back = 0;
}
if (v5 < 25 && !Splaced) {
_global.playsfx('hittestmob');
placeBoom2(hero._x, hero._y);
if (!ud) {
var v8 = shild - 15;
if (v8 < 0) {
life += v8;
shild = 0;
} else {
shild -= 15;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Sspiders.length;
while (v3--) {
var v4 = Sspiders[v3];
if (v4 == Sd) {
Sspiders.splice(v3, 1);
}
}
v3 = needBePaused.length;
while (v3--) {
v4 = needBePaused[v3];
if (v4 == Sd) {
needBePaused.splice(v3, 1);
}
}
}
};
Sd.onRollOver = function () {
_global.trgt = this;
};
Sspiders.push(Sd);
Sd.Slif = 5;
}
function removeSSpider(s) {
var v4 = Sspiders.length;
while (v4--) {
var v2 = Sspiders[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
Sspiders.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function createAster(X, Y, OX, OY, D, A, SP, TYP) {
++lev;
if (TYP == 0) {
var v2 = aster.duplicateMovieClip('asteroid' + lev, lev);
} else {
if (TYP == 1) {
var v2 = aster1.duplicateMovieClip('asteroid' + lev, lev);
} else {
var v2 = aster2.duplicateMovieClip('asteroid' + lev, lev);
}
}
v2.xx = X + Math.random() * 5;
v2.yy = Y + Math.random() * 5;
v2.ox = OX;
v2.oy = OY;
v2.ang = A;
v2.sca = D;
v2.typ = TYP;
v2._yscale = D;
v2._xscale = v2._yscale;
v2.spe = SP;
v2.onEnterFrame = function () {
this.ang -= this.spe;
var v5 = this.ang / 57.29577951308232;
this._x = this.xx + this.ox * Math.cos(v5);
this._y = this.yy + this.oy * Math.sin(v5);
this._rotation += 5;
var v3 = 0;
var v2 = this._x - sun._x;
var v4 = this._y - sun._y;
if (v2 == 0) {
if (v4 >= 0) {
v3 = 270;
} else {
v3 = 90;
}
} else {
if (v2 > 0) {
v3 = Math.atan(v4 / v2) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v3 = Math.atan(v4 / v2) / 0.0174532925199433;
} else {
v3 = Math.atan(v4 / v2) / 0.0174532925199433 - 180;
}
}
}
};
asteroids.push(v2);
}
function removeAster(s) {
var v3 = asteroids.length;
while (v3--) {
var v1 = asteroids[v3];
if (v1 == s) {
if (v1._width > 10) {
createAster(v1.xx + 5, v1.yy + 5, v1.ox, v1.oy, v1.sca / 1.5, v1.ang, v1.spe + 0.2, v1.typ);
createAster(v1.xx - 5, v1.yy - 5, v1.ox, v1.oy, v1.sca / 1.5, v1.ang, v1.spe, v1.typ);
}
v1.gotoAndStop(2);
delete v1.onEnterFrame;
asteroids.splice(v3, 1);
}
}
var v2 = needBePaused.length;
while (v2--) {
var v4 = needBePaused[v2];
if (v4 == s) {
needBePaused.splice(v2, 1);
}
}
}
stop();
var my_so = SharedObject.getLocal('spiteful_space_save', '/');
_global.MIN = my_so.data.MIN;
_global.GAS = my_so.data.GAS;
_global.BIO = my_so.data.BIO;
_global.rokmax = my_so.data.rokmax;
_global.uR = my_so.data.uR;
_global.uG = my_so.data.uG;
_global.uB = my_so.data.uB;
_global.uRa = my_so.data.uRa;
_global.uE = my_so.data.uE;
_global.uS = my_so.data.uS;
_global.uSt = my_so.data.uSt;
my_so.flush();
_global.perehod = 0;
heroab.swapDepths(1000002);
menuab.swapDepths(1000003);
con.swapDepths(1000004);
_global.bio1 = 0;
_global.min1 = 0;
_global.gas1 = 0;
_global.kill1 = 0;
_global.restartlvl = false;
mpause.stop();
msystem.stop();
mmenu.stop();
mbos.stop();
_global.sa1 = 1;
_global.sa2 = 1;
_global.sa3 = 1;
var stren = _global.str;
if (_global.systema == 9) {
cap1.cap11.cap111.text = 'KILL THE BOSS!';
cap1.gotoAndPlay(1);
if (_global.SoundM != false) {
mbos.start(0, 500);
}
} else {
if (_global.SoundM != false) {
msystem.start(0, 500);
}
}
_global.pauseall = false;
_global.steptmp = 0;
_global.pausetimestart = 0;
_global.pausetimestop = 0;
_global.pausetimeall = 0;
needBePaused = new Array();
_global.addToPause = function (obj) {
if (!obj._inPause) {
needBePaused.push(obj);
obj._inPause = true;
}
};
var koff = 1;
var finangle = Math.random() * 100;
finplay = function () {
finangle += 10;
if (koff < 30) {
koff += 0.5;
}
finr_ang = finangle / 57.29577951308232;
finmc._x = 500 + koff * Math.cos(finr_ang);
finmc._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc._x, finmc._y, 'particle_smoke_clear');
finr_ang = (finangle + 180) / 57.29577951308232;
finmc1._x = 500 + koff * Math.cos(finr_ang);
finmc1._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc1._x, finmc1._y, 'particle_smoke_clear');
};
_global.setPause = function (flag) {
isPause = flag;
var v3 = needBePaused.length;
while (v3--) {
var v2 = needBePaused[v3];
if (flag) {
v2.stop();
v2.oef = v2.onEnterFrame;
v2.onEnterFrame = null;
} else {
v2.onEnterFrame = v2.oef;
v2.play();
}
}
if (flag) {
_global.pausetimestart = int(getTimer() / 1000);
} else {
_global.pausetimestop = int(getTimer() / 1000);
_global.pausetimeall += _global.pausetimestart - _global.pausetimestop;
}
};
min1.text = _global.GAS + '/300';
min2.text = _global.MIN + '/150';
min3.text = _global.BIO + '/50';
samc._width = 0;
samc._x = 350;
var angl = 0;
var Xx = mob1c._x - sun._x;
var Yy = mob1c._y - sun._y;
if (Xx == 0) {
if (Yy >= 0) {
angl = 270;
} else {
angl = 90;
}
} else {
if (Xx > 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433;
} else {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 - 180;
}
}
}
var myList = mob1c.mob1cc.filters;
myList[1].angle = angl;
myList[0].color = 11132159;
mob1c.mob1cc.filters = myList;
_global.SAE = 0;
var SAc = 0;
var ud = false;
var radiu = _global.rad;
var life = _global.arm;
var shild = _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
heroab.h1._width = 50 * _global.arm / 300;
heroab.h2._width = 50 * _global.def / 200;
heroab.h3._width = 50 * _global.spe / 7;
heroab.h4._width = 50 * stren / 2.2;
heroab.h5._width = 50 * _global.rad / 4;
var rok = _global.rokmax;
roketi.ro.text = rok + '/' + _global.rokmax;
_global.step = _global.spe;
var checkup = 1;
var checkup1 = 1;
var rotDirSpeed = 5;
var angle = Math.random() * 100;
var spiderCount = 0;
var SspiderCount = 0;
var lev = 0;
var timeb = int(getTimer() / 100);
var timenasys = int(getTimer() / 1000);
_global.timeall = 0;
var fire = false;
heroab._visible = false;
menuab._visible = false;
con._visible = false;
boom._visible = false;
boom1._visible = false;
boom2._visible = false;
mob1c.thp = 100;
rb1.thp = 300;
var resp = true;
var end = false;
var end1 = 0;
fafa._visible = false;
var bitmapsArray;
var particleBitmapsArray;
bitmapsArray = ['effect-fire5.png', 'effect-fire6.png', 'effect-fire7.png', 'effect-fire8.png', 'effect-fire9.png'];
particleBitmapsArray = ['particle.jpg', 'particle1.png', 'particle5.png'];
var Gass = new Array();
placeGas = function (A, B) {
++lev;
var d = gas.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.GAS < 300) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Gass.length;
while (v3--) {
var v4 = Gass[v3];
if (v4 == d) {
Gass.splice(v3, 1);
}
}
_global.GAS += 1;
++_global.gas1;
_global.playsfx('collected');
min1.text = _global.GAS + '/300';
}
};
Gass.push(d);
};
var Minerals = new Array();
placeMineral = function (A, B) {
++lev;
var d = mineral.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.MIN < 150) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Minerals.length;
while (v3--) {
var v4 = Minerals[v3];
if (v4 == d) {
Minerals.splice(v3, 1);
}
}
_global.MIN += 1;
++_global.min1;
_global.playsfx('collected');
min2.text = _global.MIN + '/150';
}
};
Minerals.push(d);
};
var Bios = new Array();
placeBio = function (A, B) {
++lev;
var d = bio.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.BIO < 50) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Bios.length;
while (v3--) {
var v4 = Bios[v3];
if (v4 == d) {
Bios.splice(v3, 1);
}
}
_global.BIO += 1;
++_global.bio1;
_global.playsfx('collected');
min3.text = _global.BIO + '/50';
}
};
Bios.push(d);
};
var reloadSpeed = 1000;
var missileSpeed = 7;
var turnRate = 0.7;
var reloadTimer;
var reloadComplete = true;
bulletSpeed = 18;
placeBullet = function (tgt) {
++lev;
var v11 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v11);
globalToLocal(v11);
_global.playsfx('vistrel');
var v10 = bullet.duplicateMovieClip('b' + lev, lev);
v10._x = v11.x;
v10._y = v11.y;
v10._rotation = hero._rotation + hero.body._rotation;
v10.a = (v10._rotation / 180) * Math.PI;
v10.onEnterFrame = function () {
this._x += bulletSpeed * Math.cos(this.a);
this._y += bulletSpeed * Math.sin(this.a);
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.hitTest(sun) && _global.systema != 9) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
var v9 = asteroids.length;
while (v9--) {
var v4 = asteroids[v9];
if (v4.hitTest(this)) {
_global.playsfx('hit');
this.removeMovieClip();
removeAster(v4);
placeBoom1(v4._x, v4._y);
}
}
v9 = spiders.length;
while (v9--) {
var v3 = spiders[v9];
if (v3.hit.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 5 <= 220) {
SAc += 5;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v3.lif -= _global.rad * stren;
v3._yscale -= 20 * stren;
v3._xscale = v3._yscale;
if (SAE != 2) {
v3.speed -= 0.5 * stren;
}
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeSpider(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
} else {
v3.lif -= stren;
v3._yscale -= 10 * stren;
v3._xscale = v3._yscale;
if (SAE != 2) {
v3.speed -= 0.5 * stren;
}
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeSpider(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
}
}
}
if (mob1c.hitTest(this)) {
_global.playsfx('hit');
if (Math.abs(hero._x - mob1c._x) < 128.5 && Math.abs(hero._y - mob1c._y) < 128.5) {
mob1c.thp -= _global.rad;
mob1c.hp._width -= 0.3 * _global.rad;
} else {
mob1c.thp -= 1;
mob1c.hp._width -= 0.3;
}
if (mob1c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob1c._x, mob1c._y);
mob1c._x += 1000;
resp = false;
}
if (Math.random() < 0.2) {
placeBoom(mob1c._x, mob1c._y);
}
placeBoom1(mob1c._x, mob1c._y);
this.removeMovieClip();
}
if (rb1.hitTest(this)) {
_global.playsfx('hit');
if (Math.abs(hero._x - rb1._x) < 128.5 && Math.abs(hero._y - rb1._y) < 128.5) {
rb1.thp -= _global.rad;
rb1.hp._width -= 0.3 * _global.rad;
} else {
rb1.thp -= 1;
rb1.hp._width -= 0.3;
}
if (rb1.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
++_global.kill1;
placeBoom(rb1._x, rb1._y);
rb1._x += 1000;
resp = false;
}
if (Math.random() < 0.2) {
placeBoom(rb1._x, rb1._y);
}
placeBoom1(rb1._x, rb1._y);
this.removeMovieClip();
}
var v7 = enemiesArray.length;
while (v7--) {
v4 = enemiesArray[v7];
if (v4.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 3 <= 220) {
SAc += 3;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v4._x) < 128.5 && Math.abs(hero._y - v4._y) < 128.5) {
v4.lif -= _global.rad * stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.lif <= 0) {
v4.gotoAndStop(2);
v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeEnemy(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
} else {
v4.lif -= stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.lif <= 0) {
v4.gotoAndStop(2);
v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeEnemy(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
}
}
}
var v8 = Sspiders.length;
while (v8--) {
var v5 = Sspiders[v8];
if (v5.Shit.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 3 <= 220) {
SAc += 3;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v5._x) < 128.5 && Math.abs(hero._y - v5._y) < 128.5) {
v5.Slif -= _global.rad * stren;
this.removeMovieClip();
placeBoom1(v5._x, v5._y);
if (v5.Slif <= 0) {
v5.gotoAndStop(2);
v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
removeSSpider(v5);
++_global.kill1;
placeBoom(v5._x, v5._y);
}
} else {
v5.Slif -= stren;
this.removeMovieClip();
placeBoom1(v5._x, v5._y);
if (v5.Slif <= 0) {
v5.gotoAndStop(2);
v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
removeSSpider(v5);
++_global.kill1;
placeBoom(v5._x, v5._y);
}
}
}
}
};
};
placeVolna = function (tgt, ty) {
++lev;
var v3 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v3);
globalToLocal(v3);
_global.playsfx('volna');
var v4 = volna.duplicateMovieClip('b' + lev, lev);
v4._x = v3.x;
v4._y = v3.y;
v4.onEnterFrame = function () {
if (hero.foot.hitTest(this)) {
if (!ud) {
var v3 = shild - 1;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 1;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
placeBoom1(hero._x, hero._y);
}
};
};
placeEbul = function (tgt, ty) {
++lev;
var v6 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v6);
globalToLocal(v6);
if (ty == 1) {
_global.playsfx('zelenie');
var v4 = ebul.duplicateMovieClip('b' + lev, lev);
if (Math.floor(Math.random() * 2) == 1) {
v4._rotation = tgt._rotation + Math.random() * 10;
} else {
v4._rotation = tgt._rotation - Math.random() * 10;
}
v4.tt = 1;
v4.bsp = 10;
}
if (ty == 2) {
v4 = lazer.duplicateMovieClip('b' + lev, lev);
v4._rotation = tgt._rotation;
v4.tt = 3;
v4.bsp = 5;
}
if (ty == 3) {
_global.playsfx('zalenie');
v4 = little.duplicateMovieClip('b' + lev, lev);
v4._x = v6.x;
v4._y = v6.y;
v4._rotation = Math.atan2(hero._y - v4._y, hero._x - v4._x) * 57.29577951308232;
v4.tt = 2;
v4.bsp = 16;
}
v4._x = v6.x;
v4._y = v6.y;
v4.a = (v4._rotation / 180) * Math.PI;
v4.onEnterFrame = function () {
if (this.tt == 1) {
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this.tt == 3) {
this.bsp += 0.3;
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this.bsp += 0.3;
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this.tt == 2) {
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.tt != 3) {
if (this.hitTest(sun)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl1)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl2)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl3)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
var v4 = asteroids.length;
while (v4--) {
var v3 = asteroids[v4];
if (v3.hitTest(this)) {
this.removeMovieClip();
removeAster(v3);
placeBoom1(v3._x, v3._y);
}
}
}
if (hero.foot.hitTest(this)) {
_global.playsfx('hitme');
if (!ud) {
if (this.tt == 1 || this.tt == 3) {
if (_global.systema == 9) {
placeVolna(this);
if (_global.Detal == 2) {
placeVolnaboom(this._x, this._y);
}
}
var v5 = shild - 5;
if (v5 < 0) {
life += v5;
shild = 0;
} else {
shild -= 5;
}
}
if (this.tt == 2) {
v5 = shild - 1;
if (v5 < 0) {
life += v5;
shild = 0;
} else {
shild -= 1;
}
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
placeBoom1(hero._x, hero._y);
this.removeMovieClip();
}
};
};
var enemiesArray = new Array();
var radians = 57.29577951308232;
var spiders = new Array();
var Sspiders = new Array();
var asteroids = new Array();
i = random(10) + 5;
while (i--) {
createAster(sun._x + 35, sun._y + 35, 75, 75, Math.random() * 60 + 20, Math.random() * 360, Math.random() + 0.1, random(3));
}
i = random(10) + 10;
while (i--) {
createAster(sun._x + 35, sun._y + 35, 185, 185, Math.random() * 60 + 20, Math.random() * 360, Math.random() + 0.1, random(3));
}
i = random(10) + 15;
while (i--) {
createAster(sun._x + 35, sun._y + 35, 280, 280, Math.random() * 60 + 20, Math.random() * 360, Math.random() + 0.1, random(3));
}
if (_global.systema != 9) {
i = 10;
while (i--) {
placeSSpider(Math.floor(Math.random() * 200) + 500, Math.floor(Math.random() * 200) + 200);
}
createEnemies(3, 'typeA', 'e1');
createEnemies(2, 'typeC', 'e3');
}
onEnterFrame = function () {
var v10 = 0;
var v11 = hero.foot._x - sun._x;
var v13 = hero.foot._y - sun._y;
if (v11 == 0) {
if (v13 >= 0) {
v10 = 270;
} else {
v10 = 90;
}
} else {
if (v11 > 0) {
v10 = Math.atan(v13 / v11) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v10 = Math.atan(v13 / v11) / 0.0174532925199433;
} else {
v10 = Math.atan(v13 / v11) / 0.0174532925199433 - 180;
}
}
}
var v14 = hero.foot.filters;
v14[1].angle = v10;
hero.foot.filters = v14;
if (Key.isDown(16) && !_global.pauseall) {
if (_global.trgt._width) {
fireWeapon(_global.trgt);
}
}
if (Key.isDown(32) && _global.SAE == 1 && !_global.pauseall) {
sap._alpha = 100;
_global.SAE = 2;
_global.playsfx('sastart');
if (_global.perstype == 1) {
stren *= 3;
cap1.cap11.cap111.text = 'EAGLE EYE!';
cap1.gotoAndPlay(1);
var v12 = hero.foot.filters;
v12[1].color = 16711680;
hero.foot.filters = v12;
}
if (_global.perstype == 3) {
_global.sa3 = 0.5;
_global.rad = 1;
cap1.cap11.cap111.text = 'NEUTRON ACCELERATION!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 2) {
var v7 = spiders.length;
while (v7--) {
var v5 = spiders[v7];
v5.speed *= 0.2;
}
v7 = Sspiders.length;
while (v7--) {
v5 = Sspiders[v7];
v5.speed *= 0.2;
}
v7 = enemiesArray.length;
while (v7--) {
v5 = enemiesArray[v7];
v5.speed *= 0.2;
}
_global.sa2 = 0.2;
cap1.cap11.cap111.text = 'TIME BOMB!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 5) {
ud = true;
cap1.cap11.cap111.text = 'ULTIMATE DEFENCE!';
cap1.gotoAndPlay(1);
v12 = hero.foot.filters;
v12[2].strength = 2;
hero.foot.filters = v12;
}
if (_global.perstype == 4) {
var v6 = enemiesArray.length;
while (v6--) {
var v3 = enemiesArray[v6];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
var v4 = 0.5;
++_global.kill1;
if (Math.random() > 0.5 + 0.5 * v4) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v4) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v4) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeEnemy(v3);
}
}
v6 = spiders.length;
while (v6--) {
v3 = spiders[v6];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v4 = 0.5;
++_global.kill1;
if (Math.random() > 0.5 + 0.5 * v4) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v4) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v4) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeSpider(v3);
}
}
v6 = Sspiders.length;
while (v6--) {
v3 = Sspiders[v6];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v4 = 0.5;
++_global.kill1;
if (Math.random() > 0.5 + 0.5 * v4) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v4) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v4) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeSSpider(v3);
}
}
hero.zone._alpha = 85;
SAc = 32;
cap1.cap11.cap111.text = 'ANNIHILATING FLASH!';
cap1.gotoAndPlay(1);
}
}
if ((Key.isDown(37) || Key.isDown(65)) && !_global.pauseall) {
hero._rotation -= rotDirSpeed;
} else {
if ((Key.isDown(39) || Key.isDown(68)) && !_global.pauseall) {
hero._rotation += rotDirSpeed;
}
}
var v17 = _xmouse - hero._x;
var v15 = _ymouse - hero._y;
var v16 = Math.atan2(v15, v17);
hero.body._rotation = -hero._rotation + (v16 / Math.PI) * 180;
var v9 = (hero._rotation / 180) * Math.PI;
if ((Key.isDown(38) || Key.isDown(87)) && !_global.pauseall) {
if (_global.step < 5) {
_global.step += 0.1;
}
if (checkup1 == 2) {
_global.step = 2;
checkup1 = 1;
}
hero.foot.play();
checkup = 1;
hero._x += _global.step * Math.cos(v9);
hero._y += _global.step * Math.sin(v9);
} else {
if (checkup == 1 && _global.step > 0) {
hero._x += _global.step * Math.cos(v9);
hero._y += _global.step * Math.sin(v9);
_global.step -= 0.1;
} else {
if (checkup == 2 && _global.step > 0) {
hero._x -= _global.step * Math.cos(v9);
hero._y -= _global.step * Math.sin(v9);
_global.step -= 0.1;
} else {
hero.foot.stop;
}
}
}
if (hero._x < 0) {
hero._x = 0;
}
if (hero._x > 700) {
hero._x = 700;
}
if (hero._y < 0) {
hero._y = 0;
}
if (hero._y > 600) {
hero._y = 600;
}
if (hero.foot.hitTest(sun) && !_global.pauseall) {
if (ud) {
if (shild + 1 > _global.def) {
shild = _global.def;
} else {
shild += 1;
}
} else {
if (shild + 5 > _global.def) {
shild = _global.def;
} else {
shild += 5;
}
life -= 1;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
if (spiderCount++ > 50 && resp && _global.SAE != 2 && !_global.pauseall && _global.systema != 9) {
spiderCount = 0;
placeSpider(487, 383);
_global.playsfx('resp');
}
if (SspiderCount++ > 150 && resp && _global.SAE != 2 && !_global.pauseall && _global.systema != 9) {
SspiderCount = 0;
placeSSpider(0, 0);
if (_global.systema == 11) {
placeSSpider(487, 383);
_global.playsfx('resp');
}
}
timebb = int(getTimer() / 100) - timeb;
if (fire && timebb >= 2 * _global.sa3) {
if (_global.uG == 1) {
placeBullet(hero.body.dot);
}
if (_global.uG == 2) {
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
if (_global.uG == 3) {
placeBullet(hero.body.dot);
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
timeb = int(getTimer() / 100);
}
if (_global.SAE == 2) {
if (SAc - 2 <= 0) {
SAc = 0;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 0;
sap._alpha = 0;
if (_global.perstype == 5) {
ud = false;
v12 = hero.foot.filters;
v12[2].strength = 0;
hero.foot.filters = v12;
}
if (_global.perstype == 1) {
stren /= 3;
v12 = hero.foot.filters;
v12[1].color = 16777215;
hero.foot.filters = v12;
}
if (_global.perstype == 3) {
_global.sa3 = 1;
_global.rad = radiu;
}
if (_global.perstype == 2) {
v7 = spiders.length;
while (v7--) {
v5 = spiders[v7];
v5.speed *= 5;
}
v7 = Sspiders.length;
while (v7--) {
v5 = Sspiders[v7];
v5.speed *= 5;
}
v7 = enemiesArray.length;
while (v7--) {
v5 = enemiesArray[v7];
v5.speed *= 5;
}
_global.sa2 = 1;
}
if (_global.perstype == 4) {
hero.zone._alpha = 5;
}
} else {
if (!_global.pauseall) {
SAc -= 2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
if (_global.perstype == 4) {
hero.zone._alpha -= 5;
}
if (_global.perstype == 2) {
if (shild + 2 > _global.def) {
shild = _global.def;
} else {
shild += 2;
}
shilds._width = 183 * shild / _global.def;
teshi.text = 'shield ' + shild + '%';
}
}
}
}
if (_global.step > 0) {
placeFire(hero.sop);
}
if (resp == false && !end) {
if (spiders.length == 0 && Sspiders.length == 0 && enemiesArray.length == 0) {
cap1.cap11.cap111.text = 'SYSTEM NOW FREE, GOOD JOB!';
cap1.gotoAndPlay(1);
_global.playsfx('openportal');
_global.trgt = null;
fin._x = 500;
fin._y = 430;
fin.gotoAndPlay(1);
end = true;
}
}
if (!end && !_global.pauseall) {
_global.timeall = int(getTimer() / 1000) - timenasys + _global.pausetimeall;
systime.text = _global.timeall;
}
if (end) {
finplay();
}
if (hero.foot.hitTest(fin.endss.ends) && !_global.pauseall) {
msystem.stop();
mbos.stop();
_global.playsfx('win');
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.SAE == 0 && !_global.pauseall) {
if (SAc + 0.2 <= 220) {
SAc += 0.2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
_global.playsfx(saready);
}
}
if (_global.trgt._width && !_global.pauseall) {
trg._x = _global.trgt._x;
trg._y = _global.trgt._y;
} else {
trg._x = 1000;
trg._y = 1000;
}
if (!_global.pauseall) {
updateEnemies();
}
if (_global.restartlvl) {
var v8 = lev + 1;
while (v8--) {
removeMovieClip(_root.getInstanceAtDepth(v8));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(8);
}
if (life < 0 && !_global.pauseall) {
_global.playsfx('exp');
msystem.stop();
mbos.stop();
_global.playsfx('win');
lifes._width = 0;
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
placeBoom(hero._x, hero._y);
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.perehod == 1) {
gotoAndPlay(5);
}
if (_global.perehod == 2) {
v8 = lev + 1;
while (v8--) {
removeMovieClip(_root.getInstanceAtDepth(v8));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(1);
}
};
onMouseDown = function () {
if (!_global.pauseall) {
fire = true;
}
};
onMouseUp = function () {
fire = false;
};
rb1.timeS = 0;
rb1.TtimeS = 25;
if (_global.systema == 9) {
rb1._x = sun._x + 35;
rb1._y = sun._y + 35;
mob1c._x += 1000;
}
rb1.onEnterFrame = function () {
if (_global.systema == 9 && !_global.pauseall) {
this.body._rotation += 1;
if (this.timeS++ > this.TtimeS && resp) {
this.timeS = 0;
_global.playsfx('lazer');
var v3 = 8;
while (v3--) {
placeEbul(this.body, 2);
this.body._rotation += 45;
}
}
}
};
}
movieClip 1109 {
}
movieClip 1117 {
frame 1 {
addToPause(this);
}
}
movieClip 1119 {
frame 1 {
addToPause(this);
}
}
movieClip 1121 {
}
movieClip 1122 {
frame 1 {
addToPause(this);
}
frame 19 {
this.removeMovieClip();
}
}
movieClip 1125 {
}
movieClip 1127 {
}
movieClip 1128 {
}
instance rb1 of movieClip 1128 {
onClipEvent (rollOver) {
_global.trgt = this;
}
}
instance mob1c of movieClip 1106 {
onClipEvent (rollOver) {
_global.trgt = this;
}
}
movieClip 1130 {
}
movieClip 1131 {
frame 16 {
_parent.removeMovieClip();
stop();
}
}
movieClip 1132 {
frame 1 {
volnaboomgo._visible = false;
i = 50;
while (i--) {
d = volnaboomgo.duplicateMovieClip('p' + i, i);
d._rotation = Math.random() * 360;
}
}
}
frame 9 {
function placeFire(tgt) {
var v3 = 0;
while (v3 < 3) {
++lev;
if (lev > 1000000) {
lev = 0;
}
var v2 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v2);
globalToLocal(v2);
var v1 = fafa.duplicateMovieClip('f' + lev, lev);
if (Math.random() > 0.5) {
v1._x = v2.x + Math.random() * 2 - 1;
} else {
v1._x = v2.x - Math.random() * 2 - 1;
}
if (Math.random() > 0.5) {
v1._y = v2.y + Math.random() * 2 - 1;
} else {
v1._y = v2.y - Math.random() * 2 - 1;
}
v1._alpha = Math.random() * 50 + 50;
v1._yscale = Math.random() * 50 + 70;
v1._xscale = v1._yscale;
++v3;
}
}
function placeBoom(x, y) {
++lev;
var v3 = boom.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom1(x, y) {
++lev;
var v3 = boom1.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom2(x, y) {
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function createExplosion(targetX, targetY, targetPath, explosionParticleAmount, explosionParticleRange, particleSize, speed, speedAlpha) {
var v7 = 0;
while (v7 < explosionParticleAmount) {
var v8 = bitmapsArray[random(bitmapsArray.length)];
var v4 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder' + lev, lev);
++lev;
var v3 = v2.createEmptyMovieClip('internal_holder', lev);
v3._x = -v4.width / 2;
v3._y = -v4.height / 2;
++lev;
v3.attachBitmap(v4, lev, 'never');
v2._x = targetX + random(explosionParticleRange) - explosionParticleRange / 2;
v2._y = targetY + random(explosionParticleRange) - explosionParticleRange / 2;
var v6 = random(particleSize);
v2._xscale = v6;
v2._yscale = v6;
v2.speed = random(speed) + speed;
v2.speedAlpha = random(speedAlpha) + speedAlpha;
v2.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speedAlpha;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
++v7;
}
}
function createParticles(targetX, targetY, targetPath, tempParticle_mcAmount, tempParticle_mcRange, particleSize, tempParticle_mcMaxSpeed, tempParticle_mcMaxFadeSpeed) {
var v7 = 0;
while (v7 < tempParticle_mcAmount) {
var v8 = particleBitmapsArray[random(particleBitmapsArray.length)];
var v5 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder', lev);
++lev;
var v4 = v2.createEmptyMovieClip('internal_holder', lev);
v4._x = -v5.width / 2;
v4._y = -v5.height / 2;
++lev;
v4.attachBitmap(v5, lev, 'never');
v2._x = targetX;
v2._y = targetY;
v2._rotation = random(360);
v2._alpha = random(50) + 50;
v2._xscale = particleSize;
v2._yscale = particleSize;
v2.boundyLeft = targetX - tempParticle_mcRange;
v2.boundyTop = targetY - tempParticle_mcRange;
v2.boundyRight = targetX + tempParticle_mcRange;
v2.boundyBottom = targetY + tempParticle_mcRange;
v2.speedX = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedY = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedX *= tempParticle_mcMaxSpeed;
v2.speedY *= tempParticle_mcMaxSpeed;
v2.fadeSpeed = Math.random(tempParticle_mcMaxFadeSpeed) * tempParticle_mcMaxFadeSpeed;
v2.onEnterFrame = function () {
this._alpha -= this.fadeSpeed;
this._x += this.speedX;
this._y += this.speedY;
if (this._alpha <= 0 || this._x < this.boundyLeft || this._x > this.boundyRight || this._y < this.boundyTop || this._y > this.boundyBottom) {
this.removeMovieClip();
}
};
++v7;
}
}
function fireLight(xStart, yStart, xEnd, yEnd) {
++lev;
_global.playsfx('molniya');
var temp = effectHolder.duplicateMovieClip('efho' + lev, lev);
temp.time = 5;
temp.onEnterFrame = function () {
temp.clear();
temp.lineStyle(lightningWidth, lightningColor, lightningAlpha, true);
var v13 = xStart - xEnd;
var v11 = yStart - yEnd;
var v12 = Math.sqrt(v13 * v13 + v11 * v11);
var v9 = v12 / lightningFrequency;
var v3 = Math.atan2(yStart - yEnd, xStart - xEnd);
var v10 = v12 / v9;
var v8 = 0;
while (v8 < lightningBranches) {
temp.moveTo(xStart, yStart);
var v2 = 1;
while (v2 < v9 + 1) {
var v5 = v10 * v2;
var v4 = random(lightningOffset - lightningOffset / 2);
var v6 = xStart - Math.cos(v3) * v5 + Math.cos(v3 + 1.55) * v4;
var v7 = yStart - Math.sin(v3) * v5 + Math.sin(v3 + 1.55) * v4;
temp.lineTo(v6, v7);
++v2;
}
++v8;
}
if (this.time-- <= 0) {
temp.removeMovieClip();
}
};
temp.lineTo(xEnd, yEnd);
addSparkles(xEnd, yEnd, sparkNumber, sparkDistance, sparkSize);
}
function startLReloading(a) {
reloadLComplete = false;
reloadLTimer = setInterval(this, 'gunLReloaded', reloadLSpeed);
screenLTimer = setInterval(this, 'clearScreen', clearSpeed);
}
function clearScreen() {
clearInterval(screenTimer);
delete effectHolder.onEnterFrame;
effectHolder.clear();
}
function gunLReloaded() {
clearInterval(reloadLTimer);
reloadLComplete = true;
}
function addSparkles(_targetX, _targetY, _sparkNumber, _distance, _sparkSize) {
var v6 = 0;
while (v6 < _sparkNumber) {
var v4 = _root.attachMovie('spark', 'spark_' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
var v3 = _root.attachMovie('spark2', 'spark2_' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v4._x = _targetX + random(_distance) - _distance / 2;
v4._y = _targetY + random(_distance) - _distance / 2;
v3._x = _targetX + random(_distance) - _distance / 2;
v3._y = _targetY + random(_distance) - _distance / 2;
var v5 = random(_sparkSize) + _sparkSize / 4;
v4._xscale = v5;
v4._yscale = v5;
v5 = random(_sparkSize) + _sparkSize / 4;
v3._xscale = v5;
v3._yscale = v5;
v3._rotation = random(359);
v4._alpha = lightningAlpha;
v3._alpha = lightningAlpha;
++v6;
}
}
function fireWeapon(target) {
if (reloadComplete == true && rok > 0) {
++lev;
_global.playsfx('raketa');
var v3 = missile.duplicateMovieClip('missile' + lev, lev);
v3._x = hero._x;
v3._y = hero._y;
v3._rotation = hero._rotation;
v3.targetX = target._x;
v3.targetY = target._y;
v3.tar = target;
v3.moveX = 0;
v3.moveY = 0;
v3.onEnterFrame = function () {
doFollow(this, this.tar);
};
roketi._alpha = 30;
rok -= 1;
roketi.ro.text = rok + '/' + _global.rokmax;
startReloading();
}
}
function startReloading() {
reloadComplete = false;
reloadTimer = setInterval(this, 'gunReloaded', reloadSpeed);
}
function gunReloaded() {
clearInterval(reloadTimer);
if (rok > 0) {
roketi._alpha = 75;
}
reloadComplete = true;
}
function doFollow(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
follower.moveDistanceX = turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = missileSpeed * follower.moveX / follower.totalmove;
follower.moveY = missileSpeed * follower.moveY / follower.totalmove;
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = 180 * Math.atan2(follower.moveY, follower.moveX) / Math.PI;
doTrail(follower._x, follower._y, 'particle_smoke_clear');
var v7 = follower._x - target._x;
var v6 = follower._y - target._y;
var v8 = Math.sqrt(v7 * v7 + v6 * v6);
if (v8 < 10) {
placeBoom(target._x, target._y);
var v4 = spiders.length;
while (v4--) {
var v3 = spiders[v4];
if (v3 == target) {
removeSpider(v3);
++_global.kill1;
}
}
v4 = enemiesArray.length;
while (v4--) {
v3 = enemiesArray[v4];
if (v3 == target) {
removeEnemy(v3);
++_global.kill1;
}
}
if (target == mob1c) {
_global.playsfx('hit');
mob1c.thp -= 10;
mob1c.hp._width -= 3;
if (mob1c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob1c._x, mob1c._y);
placeBoom(mob1c._x, mob1c._y);
placeBoom(mob1c._x, mob1c._y);
mob1c._x += 1000;
resp = false;
}
}
if (target == mob2c) {
_global.playsfx('hit');
mob2c.thp -= 10;
mob2c.hp._width -= 3;
if (mob2c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob2c._x, mob2c._y);
placeBoom(mob2c._x, mob2c._y);
placeBoom(mob2c._x, mob2c._y);
mob2c._x += 1000;
resp2 = false;
}
}
removeMovieClip(target);
removeMovieClip(follower);
}
if (follower.hitTest(sun)) {
_global.playsfx('hit');
placeBoom1(follower._x, follower._y);
removeMovieClip(follower);
}
if (!target._x) {
removeMovieClip(follower);
delete follower.onEnterFrame;
}
}
function doTrail(targetX, targetY, type) {
++lev;
var v3 = _root.attachMovie(type, type + lev, lev);
v3._x = targetX;
v3._y = targetY;
v3._rotation = random(360);
randomScale = random(75) + 25;
v3._xscale = randomScale;
randomScale = random(75) + 25;
v3._yscale = randomScale;
v3.speed = random(10) + 5;
updateAfterEvent();
v3.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speed;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
}
function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip, Q, W) {
var v4 = 0;
while (v4 < enemyAmount) {
++lev;
if (enemyLibraryClip == 'e3') {
var v3 = enemC.duplicateMovieClip('ee' + lev, lev);
}
if (enemyLibraryClip == 'e4') {
v3 = enemD.duplicateMovieClip('ee' + lev, lev);
}
if (Q == 0 && W == 0) {
v3._x = random(Stage.width);
v3._y = random(Stage.height);
} else {
v3._x = Q;
v3._y = W;
}
v3._rotation = random(360);
if (enemyBehavior == 'typeD') {
v3.speed = Math.random() * 4 + 1;
v3.turnRate = 0.5;
v3.agroRange = 300;
v3.mode = 'follow';
v3.lif = 20;
v3.tt = 4;
v3.TtimeS = Math.floor(Math.random() * 20) + 20;
} else {
if (enemyBehavior == 'typeC') {
v3.speed = Math.random() + 1;
v3.turnRate = 0.2;
v3.agroRange = 100;
v3.mode = 'run';
v3._x = random(Stage.width - 400) + 200;
v3._y = random(Stage.height - 300) + 150;
v3.lif = 15;
v3.tt = 3;
v3.TtimeS = Math.floor(Math.random() * 20) + 20;
}
}
v3.distanceX = 0;
v3.distanceY = 0;
v3.distanceTotal = 0;
v3.moveDistanceX = 0;
v3.moveDistanceY = 0;
v3.moveX = 0;
v3.moveY = 0;
v3.totalmove = 0;
v3.timeS = 0;
v3.onRollOver = function () {
_global.trgt = this;
};
enemiesArray.push(v3);
++v4;
}
}
function updateEnemies() {
var v3 = 0;
while (v3 < enemiesArray.length) {
var v2 = enemiesArray[v3];
updatePosition(v2, hero);
if (v2.tt == 3) {
if (v2.timeS++ > v2.TtimeS) {
v2.timeS = 0;
_global.playsfx('lazer');
var v5 = 4;
while (v5--) {
placeEbul(v2, 2);
v2._rotation += 90;
}
}
}
if (v2.tt == 4) {
if (v2.timeS++ > v2.TtimeS) {
if (Math.abs(hero._x - v2._x) < 150 && Math.abs(hero._y - v2._y) < 150) {
v2.timeS = 0;
fireLight(v2._x, v2._y, hero._x, hero._y);
if (!ud) {
var v4 = shild - 3;
if (v4 < 0) {
life += v4;
shild = 0;
} else {
shild -= 3;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
}
}
}
++v3;
}
}
function updatePosition(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
if (follower.distanceTotal <= follower.agroRange) {
follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = follower.speed * follower.moveX / follower.totalmove;
follower.moveY = follower.speed * follower.moveY / follower.totalmove;
if (follower.mode == 'follow') {
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians;
} else {
if (follower.mode == 'run') {
if (follower._x - follower.moveX >= 0 && follower._x - follower.moveX <= 700) {
follower._x -= follower.moveX;
}
if (follower._y - follower.moveY >= 0 && follower._y - follower.moveY <= 600) {
follower._y -= follower.moveY;
}
follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180;
}
}
}
if (follower._x < 0) {
follower._x = 0;
}
if (follower._x > 700) {
follower._x = 700;
}
if (follower._y < 0) {
follower._y = 0;
}
if (follower._y > 600) {
follower._y = 600;
}
}
function removeEnemy(s) {
var v4 = enemiesArray.length;
while (v4--) {
var v2 = enemiesArray[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
enemiesArray.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function placeSpider(A, B) {
++lev;
var d = spider.duplicateMovieClip('z' + lev, lev);
if (A == 0 && B == 0) {
d._y = fon._y + Math.random() * fon._height;
if (Math.random() < 0.5) {
d._x = fon._x - d._width / 2;
} else {
d._x = fon._x + fon._width + d._width / 2;
}
} else {
d._x = A;
d._y = B;
}
var v6 = hero._x - d._x;
var v5 = hero._y - d._y;
d.a = Math.atan2(v5, v6);
d._rotation = (d.a / Math.PI) * 180;
d.speed = Math.random() * 2 + 2;
d.onEnterFrame = function () {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
this.a = Math.atan2(v5, v6);
this._rotation = (this.a / Math.PI) * 180;
var v8 = Math.sqrt(v6 * v6 + v5 * v5);
if (v8 < 25 && !placed) {
_global.playsfx('hittestmob');
placeBoom2(hero._x, hero._y);
if (!ud) {
var v7 = shild - 10;
if (v7 < 0) {
life += v7;
shild = 0;
} else {
shild -= 10;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = spiders.length;
while (v3--) {
var v4 = spiders[v3];
if (v4 == d) {
spiders.splice(v3, 1);
}
}
v3 = needBePaused.length;
while (v3--) {
v4 = needBePaused[v3];
if (v4 == d) {
needBePaused.splice(v3, 1);
}
}
}
};
d.onRollOver = function () {
_global.trgt = this;
};
spiders.push(d);
d.lif = 3;
}
function removeSpider(s) {
var v4 = spiders.length;
while (v4--) {
var v2 = spiders[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
spiders.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
stop();
var my_so = SharedObject.getLocal('spiteful_space_save', '/');
_global.MIN = my_so.data.MIN;
_global.GAS = my_so.data.GAS;
_global.BIO = my_so.data.BIO;
_global.rokmax = my_so.data.rokmax;
_global.uR = my_so.data.uR;
_global.uG = my_so.data.uG;
_global.uB = my_so.data.uB;
_global.uRa = my_so.data.uRa;
_global.uE = my_so.data.uE;
_global.uS = my_so.data.uS;
_global.uSt = my_so.data.uSt;
my_so.flush();
_global.perehod = 0;
if (_global.SoundM != false) {
mpause.stop();
msystem.stop();
mmenu.stop();
mbos.stop();
msystem.start(0, 500);
}
_global.sa1 = 1;
_global.sa2 = 1;
_global.sa3 = 1;
var stren = _global.str;
heroab.swapDepths(1000002);
menuab.swapDepths(1000003);
con.swapDepths(1000004);
_global.bio1 = 0;
_global.min1 = 0;
_global.gas1 = 0;
_global.kill1 = 0;
_global.restartlvl = false;
_global.pauseall = false;
_global.steptmp = 0;
_global.pausetimestart = 0;
_global.pausetimestop = 0;
_global.pausetimeall = 0;
needBePaused = new Array();
_global.addToPause = function (obj) {
if (!obj._inPause) {
needBePaused.push(obj);
obj._inPause = true;
}
};
var koff = 1;
var finangle = Math.random() * 100;
finplay = function () {
finangle += 10;
if (koff < 30) {
koff += 0.5;
}
finr_ang = finangle / 57.29577951308232;
finmc._x = 500 + koff * Math.cos(finr_ang);
finmc._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc._x, finmc._y, 'particle_smoke_clear');
finr_ang = (finangle + 180) / 57.29577951308232;
finmc1._x = 500 + koff * Math.cos(finr_ang);
finmc1._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc1._x, finmc1._y, 'particle_smoke_clear');
};
_global.setPause = function (flag) {
isPause = flag;
var v3 = needBePaused.length;
while (v3--) {
var v2 = needBePaused[v3];
if (flag) {
v2.stop();
v2.oef = v2.onEnterFrame;
v2.onEnterFrame = null;
} else {
v2.onEnterFrame = v2.oef;
v2.play();
}
}
if (flag) {
_global.pausetimestart = int(getTimer() / 1000);
} else {
_global.pausetimestop = int(getTimer() / 1000);
_global.pausetimeall += _global.pausetimestart - _global.pausetimestop;
}
};
_global.planet = 0;
min1.text = _global.GAS + '/300';
min2.text = _global.MIN + '/150';
min3.text = _global.BIO + '/50';
samc._width = 0;
samc._x = 350;
var angl = 0;
var Xx = mob1c._x - sun._x;
var Yy = mob1c._y - sun._y;
if (Xx == 0) {
if (Yy >= 0) {
angl = 270;
} else {
angl = 90;
}
} else {
if (Xx > 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433;
} else {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 - 180;
}
}
}
var myList = mob1c.mob1cc.filters;
myList[1].angle = angl;
myList[0].color = 10485694;
mob1c.mob1cc.filters = myList;
var angl = 0;
var Xx = mob2c._x - sun._x;
var Yy = mob2c._y - sun._y;
if (Xx == 0) {
if (Yy >= 0) {
angl = 270;
} else {
angl = 90;
}
} else {
if (Xx > 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433;
} else {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 - 180;
}
}
}
var myList = mob2c.mob1cc.filters;
myList[1].angle = angl;
myList[0].color = 10485694;
mob2c.mob1cc.filters = myList;
_global.SAE = 0;
var SAc = 0;
var ud = false;
var radiu = _global.rad;
var life = _global.arm;
var shild = _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
heroab.h1._width = 50 * _global.arm / 300;
heroab.h2._width = 50 * _global.def / 200;
heroab.h3._width = 50 * _global.spe / 7;
heroab.h4._width = 50 * stren / 2.2;
heroab.h5._width = 50 * _global.rad / 4;
var rok = _global.rokmax;
roketi.ro.text = rok + '/' + _global.rokmax;
_global.step = _global.spe;
var checkup = 1;
var checkup1 = 1;
var rotDirSpeed = 5;
var angle = Math.random() * 100;
var spiderCount = 0;
var eneCount = 0;
var lev = 0;
var timeb = int(getTimer() / 100);
var timenasys = int(getTimer() / 1000);
_global.timeall = 0;
var fire = false;
heroab._visible = false;
menuab._visible = false;
con._visible = false;
boom._visible = false;
boom1._visible = false;
boom2._visible = false;
mob1c.thp = 100;
mob2c.thp = 100;
var resp = true;
var resp2 = true;
var end = false;
var end1 = 0;
fafa._visible = false;
var bitmapsArray;
var particleBitmapsArray;
bitmapsArray = ['effect-fire5.png', 'effect-fire6.png', 'effect-fire7.png', 'effect-fire8.png', 'effect-fire9.png'];
particleBitmapsArray = ['particle.jpg', 'particle1.png', 'particle5.png'];
var Gass = new Array();
placeGas = function (A, B) {
++lev;
var d = gas.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.GAS < 300) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Gass.length;
while (v3--) {
var v4 = Gass[v3];
if (v4 == d) {
Gass.splice(v3, 1);
}
}
_global.GAS += 1;
++_global.gas1;
_global.playsfx('collected');
min1.text = _global.GAS + '/300';
}
};
Gass.push(d);
};
var Minerals = new Array();
placeMineral = function (A, B) {
++lev;
var d = mineral.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.MIN < 150) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Minerals.length;
while (v3--) {
var v4 = Minerals[v3];
if (v4 == d) {
Minerals.splice(v3, 1);
}
}
_global.MIN += 1;
++_global.min1;
_global.playsfx('collected');
min2.text = _global.MIN + '/150';
}
};
Minerals.push(d);
};
var Bios = new Array();
placeBio = function (A, B) {
++lev;
var d = bio.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.BIO < 50) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Bios.length;
while (v3--) {
var v4 = Bios[v3];
if (v4 == d) {
Bios.splice(v3, 1);
}
}
_global.BIO += 1;
++_global.bio1;
_global.playsfx('collected');
min3.text = _global.BIO + '/50';
}
};
Bios.push(d);
};
var lightningOffset = 12;
var lightningFrequency = 12;
var lightningWidth = 1;
var lightningColor = '0x5C98EF';
var lightningAlpha = 75;
var lightningBranches = 3;
var sparkNumber = 10;
var sparkDistance = 20;
var sparkSize = 100;
var reloadLSpeed = 200;
var clearSpeed = 200;
var glow_color = lightningColor;
var glow_alpha = 0.6;
var glow_blurX = 5;
var glow_blurY = 5;
var glow_strength = 2;
var glow_quality = 3;
var reloadLTimer;
var screenTimer;
var reloadLComplete = true;
var rotationLDirection;
var filter_glow = new flash.filters.GlowFilter(glow_color, glow_alpha, glow_blurX, glow_blurY, glow_strength, glow_quality);
effectHolder.filters = [filter_glow];
var reloadSpeed = 1000;
var missileSpeed = 7;
var turnRate = 0.7;
var reloadTimer;
var reloadComplete = true;
bulletSpeed = 18;
placeBullet = function (tgt) {
++lev;
_global.playsfx('vistrel');
var v9 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v9);
globalToLocal(v9);
var v8 = bullet.duplicateMovieClip('b' + lev, lev);
v8._x = v9.x;
v8._y = v9.y;
v8._rotation = hero._rotation + hero.body._rotation;
v8.a = (v8._rotation / 180) * Math.PI;
v8.onEnterFrame = function () {
this._x += bulletSpeed * Math.cos(this.a);
this._y += bulletSpeed * Math.sin(this.a);
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.hitTest(sun)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl1)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl2)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl3)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
var v7 = spiders.length;
while (v7--) {
var v3 = spiders[v7];
if (v3.hit.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 5 <= 220) {
SAc += 5;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v3.lif -= _global.rad * stren;
v3._yscale -= 20 * stren;
v3._xscale = v3._yscale;
if (SAE != 2) {
v3.speed -= 0.5 * stren;
}
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v5 = 0;
if (_global.timeall <= 120) {
v5 = 0;
} else {
if (_global.timeall <= 200) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeSpider(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
} else {
v3.lif -= stren;
v3._yscale -= 10 * stren;
v3._xscale = v3._yscale;
if (SAE != 2) {
v3.speed -= 0.5 * stren;
}
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v5 = 0;
if (_global.timeall <= 120) {
v5 = 0;
} else {
if (_global.timeall <= 200) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeSpider(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
}
}
}
if (mob1c.hitTest(this)) {
_global.playsfx('hit');
if (Math.abs(hero._x - mob1c._x) < 128.5 && Math.abs(hero._y - mob1c._y) < 128.5) {
mob1c.thp -= _global.rad;
mob1c.hp._width -= 0.3 * _global.rad;
} else {
mob1c.thp -= 1;
mob1c.hp._width -= 0.3;
}
if (mob1c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob1c._x, mob1c._y);
mob1c._x += 1000;
resp = false;
}
if (Math.random() < 0.2) {
placeBoom(mob1c._x, mob1c._y);
}
placeBoom1(mob1c._x, mob1c._y);
this.removeMovieClip();
}
if (mob2c.hitTest(this)) {
_global.playsfx('hit');
if (Math.abs(hero._x - mob2c._x) < 128.5 && Math.abs(hero._y - mob2c._y) < 128.5) {
mob2c.thp -= _global.rad;
mob2c.hp._width -= 0.3 * _global.rad;
} else {
mob2c.thp -= 1;
mob2c.hp._width -= 0.3;
}
if (mob2c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob2c._x, mob2c._y);
mob2c._x += 1000;
resp2 = false;
}
if (Math.random() < 0.2) {
placeBoom(mob2c._x, mob2c._y);
}
placeBoom1(mob2c._x, mob2c._y);
this.removeMovieClip();
}
var v6 = enemiesArray.length;
while (v6--) {
var v4 = enemiesArray[v6];
if (v4.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 3 <= 220) {
SAc += 3;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v4._x) < 128.5 && Math.abs(hero._y - v4._y) < 128.5) {
v4.lif -= _global.rad * stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.lif <= 0) {
v4.gotoAndStop(2);
v5 = 0;
if (_global.timeall <= 120) {
v5 = 0;
} else {
if (_global.timeall <= 200) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeEnemy(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
} else {
v4.lif -= stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.lif <= 0) {
v4.gotoAndStop(2);
v5 = 0;
if (_global.timeall <= 120) {
v5 = 0;
} else {
if (_global.timeall <= 200) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeEnemy(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
}
}
}
};
};
placeEbul = function (tgt, ty) {
++lev;
var v4 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v4);
globalToLocal(v4);
if (ty == 1) {
var v3 = ebul.duplicateMovieClip('b' + lev, lev);
_global.playsfx('zelenie');
if (Math.floor(Math.random() * 2) == 1) {
v3._rotation = tgt._rotation + Math.random() * 10;
} else {
v3._rotation = tgt._rotation - Math.random() * 10;
}
v3.tt = 1;
v3.bsp = 10;
}
if (ty == 2) {
v3 = lazer.duplicateMovieClip('b' + lev, lev);
v3._rotation = tgt._rotation;
v3.tt = 3;
v3.bsp = 5;
}
if (ty == 3) {
_global.playsfx('zelenie');
v3 = little.duplicateMovieClip('b' + lev, lev);
v3._x = v4.x;
v3._y = v4.y;
v3._rotation = Math.atan2(hero._y - v3._y, hero._x - v3._x) * 57.29577951308232;
v3.tt = 2;
v3.bsp = 16;
}
v3._x = v4.x;
v3._y = v4.y;
v3.a = (v3._rotation / 180) * Math.PI;
v3.onEnterFrame = function () {
if (this.tt == 1) {
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this.tt == 3) {
this.bsp += 0.3;
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this.bsp += 0.3;
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this.tt == 2) {
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.tt != 3) {
if (this.hitTest(sun)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl1)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl2)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl3)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
}
if (hero.foot.hitTest(this)) {
_global.playsfx('hitme');
if (!ud) {
if (this.tt == 1 || this.tt == 3) {
var v3 = shild - 5;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 5;
}
}
if (this.tt == 2) {
v3 = shild - 1;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 1;
}
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
placeBoom1(hero._x, hero._y);
this.removeMovieClip();
}
};
};
var enemiesArray = new Array();
var radians = 57.29577951308232;
createEnemies(3, 'typeC', 'e3', 0, 0);
createEnemies(3, 'typeD', 'e4', 0, 0);
var spiders = new Array();
i = 15;
while (i--) {
placeSpider(Math.floor(Math.random() * 200) + 500, Math.floor(Math.random() * 200) + 200);
}
onEnterFrame = function () {
var v11 = 0;
var v12 = hero.foot._x - sun._x;
var v14 = hero.foot._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
var v16 = hero.foot.filters;
v16[1].angle = v11;
hero.foot.filters = v16;
v11 = 0;
v12 = pl2._x - sun._x;
v14 = pl2._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = pl2.filters;
v16[1].angle = v11;
pl2.filters = v16;
v11 = 0;
v12 = pl1._x - sun._x;
v14 = pl1._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = pl1.filters;
v16[1].angle = v11;
pl1.filters = v16;
v11 = 0;
v12 = pl3._x - sun._x;
v14 = pl3._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = pl3.filters;
v16[1].angle = v11;
pl3.filters = v16;
if (Key.isDown(16) && !_global.pauseall) {
if (_global.trgt._width) {
fireWeapon(_global.trgt);
}
}
if (Key.isDown(32) && _global.SAE == 1 && !_global.pauseall) {
sap._alpha = 100;
_global.SAE = 2;
_global.playsfx('sastart');
if (_global.perstype == 1) {
stren *= 3;
cap1.cap11.cap111.text = 'EAGLE EYE!';
cap1.gotoAndPlay(1);
var v13 = hero.foot.filters;
v13[1].color = 16711680;
hero.foot.filters = v13;
}
if (_global.perstype == 3) {
_global.sa3 = 0.5;
_global.rad = 1;
cap1.cap11.cap111.text = 'NEUTRON ACCELERATION!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 2) {
var v8 = spiders.length;
while (v8--) {
var v6 = spiders[v8];
v6.speed *= 0.2;
}
v8 = enemiesArray.length;
while (v8--) {
v6 = enemiesArray[v8];
v6.speed *= 0.2;
}
_global.sa2 = 0.2;
cap1.cap11.cap111.text = 'TIME BOMB!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 5) {
ud = true;
cap1.cap11.cap111.text = 'ULTIMATE DEFENCE!';
cap1.gotoAndPlay(1);
v13 = hero.foot.filters;
v13[2].strength = 2;
hero.foot.filters = v13;
}
if (_global.perstype == 4) {
var v7 = enemiesArray.length;
while (v7--) {
var v3 = enemiesArray[v7];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
var v5 = 0.5;
++_global.kill1;
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeEnemy(v3);
}
}
v7 = spiders.length;
while (v7--) {
v3 = spiders[v7];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v5 = 0.5;
++_global.kill1;
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeSpider(v3);
}
}
hero.zone._alpha = 85;
SAc = 32;
cap1.cap11.cap111.text = 'ANNIHILATING FLASH!';
cap1.gotoAndPlay(1);
}
}
if ((Key.isDown(37) || Key.isDown(65)) && !_global.pauseall) {
hero._rotation -= rotDirSpeed;
} else {
if ((Key.isDown(39) || Key.isDown(68)) && !_global.pauseall) {
hero._rotation += rotDirSpeed;
}
}
var v19 = _xmouse - hero._x;
var v17 = _ymouse - hero._y;
var v18 = Math.atan2(v17, v19);
hero.body._rotation = -hero._rotation + (v18 / Math.PI) * 180;
var v10 = (hero._rotation / 180) * Math.PI;
if ((Key.isDown(38) || Key.isDown(87)) && !_global.pauseall) {
if (_global.step < 5) {
_global.step += 0.1;
}
if (checkup1 == 2) {
_global.step = 2;
checkup1 = 1;
}
hero.foot.play();
checkup = 1;
hero._x += _global.step * Math.cos(v10);
hero._y += _global.step * Math.sin(v10);
} else {
if (checkup == 1 && _global.step > 0) {
hero._x += _global.step * Math.cos(v10);
hero._y += _global.step * Math.sin(v10);
_global.step -= 0.1;
} else {
if (checkup == 2 && _global.step > 0) {
hero._x -= _global.step * Math.cos(v10);
hero._y -= _global.step * Math.sin(v10);
_global.step -= 0.1;
} else {
hero.foot.stop;
}
}
}
if (hero._x < 0) {
hero._x = 0;
}
if (hero._x > 700) {
hero._x = 700;
}
if (hero._y < 0) {
hero._y = 0;
}
if (hero._y > 600) {
hero._y = 600;
}
if (!_global.pauseall) {
angle += 0.2;
}
r_ang = angle / 57.29577951308232;
pl1._x = 317 + 100 * Math.cos(r_ang * 3);
pl1._y = 245 + 100 * Math.sin(r_ang * 3);
pl2._x = 317 + 200 * Math.cos(r_ang * 2);
pl2._y = 245 + 200 * Math.sin(r_ang * 2);
pl3._x = 317 + 300 * Math.cos(r_ang);
pl3._y = 245 + 200 * Math.sin(r_ang);
if (hero.foot.hitTest(sun) && !_global.pauseall) {
if (ud) {
if (shild + 1 > _global.def) {
shild = _global.def;
} else {
shild += 1;
}
} else {
if (shild + 5 > _global.def) {
shild = _global.def;
} else {
shild += 5;
}
life -= 1;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
if (spiderCount++ > 50 && resp && _global.SAE != 2 && !_global.pauseall) {
spiderCount = 0;
placeSpider(318, 478);
_global.playsfx('resp');
if (_global.systema == 12) {
placeSpider(0, 0);
}
if (_global.systema == 13 && Math.random() < 0.18) {
createEnemies(1, 'typeD', 'e4', 318, 478);
_global.playsfx('resp');
}
}
if (eneCount++ > 350 && resp2 && _global.SAE != 2 && !_global.pauseall) {
eneCount = 0;
createEnemies(1, 'typeD', 'e4', 415, 139);
_global.playsfx('resp');
}
timebb = int(getTimer() / 100) - timeb;
if (fire && timebb >= 2 * _global.sa3) {
if (_global.uG == 1) {
placeBullet(hero.body.dot);
}
if (_global.uG == 2) {
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
if (_global.uG == 3) {
placeBullet(hero.body.dot);
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
timeb = int(getTimer() / 100);
}
if (_global.SAE == 2) {
if (SAc - 2 <= 0) {
SAc = 0;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 0;
sap._alpha = 0;
if (_global.perstype == 5) {
ud = false;
v13 = hero.foot.filters;
v13[2].strength = 0;
hero.foot.filters = v13;
}
if (_global.perstype == 1) {
stren /= 3;
v13 = hero.foot.filters;
v13[1].color = 16777215;
hero.foot.filters = v13;
}
if (_global.perstype == 3) {
_global.sa3 = 1;
_global.rad = radiu;
}
if (_global.perstype == 2) {
v8 = spiders.length;
while (v8--) {
v6 = spiders[v8];
v6.speed *= 5;
}
v8 = enemiesArray.length;
while (v8--) {
v6 = enemiesArray[v8];
v6.speed *= 5;
}
_global.sa2 = 1;
}
if (_global.perstype == 4) {
hero.zone._alpha = 5;
}
} else {
if (!_global.pauseall) {
SAc -= 2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
if (_global.perstype == 4) {
hero.zone._alpha -= 5;
}
if (_global.perstype == 2) {
if (shild + 2 > _global.def) {
shild = _global.def;
} else {
shild += 2;
}
shilds._width = 183 * shild / _global.def;
teshi.text = 'shield ' + shild + '%';
}
}
}
}
if (_global.step > 0) {
placeFire(hero.sop);
}
if (resp == false && !resp2 && !end) {
if (spiders.length == 0 && enemiesArray.length == 0) {
cap1.cap11.cap111.text = 'SYSTEM NOW FREE, GOOD JOB!';
cap1.gotoAndPlay(1);
_global.playsfx('openportal');
_global.trgt = null;
fin._x = 500;
fin._y = 430;
fin.gotoAndPlay(1);
var v15 = new flash.filters.GlowFilter();
var v4 = pl1.filters;
v4.push(v15);
v4[2].blurY = 0;
v4[2].blurX = 0;
v4[2].quality = 100;
v4[2].color = 3329279;
pl1.filters = v4;
v4 = pl2.filters;
v4.push(v15);
v4[2].blurY = 0;
v4[2].blurX = 0;
pl2.filters = v4;
v4 = pl3.filters;
v4.push(v15);
v4[2].blurY = 0;
v4[2].blurX = 0;
pl3.filters = v4;
end1 = 8;
end = true;
}
}
if (end1 > 0) {
end1 -= 0.1;
v4 = pl1.filters;
v4[2].blurY = 8 - end1;
v4[2].blurX = v4[2].blurY;
v4[2].strength = (8 - end1) / 5;
pl1.filters = v4;
v4 = pl2.filters;
v4[2].blurY = 8 - end1;
v4[2].blurX = v4[2].blurY;
v4[2].strength = (8 - end1) / 5;
pl2.filters = v4;
v4 = pl3.filters;
v4[2].blurY = 8 - end1;
v4[2].blurX = v4[2].blurY;
v4[2].strength = (8 - end1) / 5;
pl3.filters = v4;
}
if (!end && !_global.pauseall) {
_global.timeall = int(getTimer() / 1000) - timenasys + _global.pausetimeall;
systime.text = _global.timeall;
}
if (end) {
finplay();
}
if (hero.foot.hitTest(fin.endss.ends) && !_global.pauseall) {
msystem.stop();
_global.playsfx('win');
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.SAE == 0 && !_global.pauseall) {
if (SAc + 0.2 <= 220) {
SAc += 0.2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
_global.playsfx(saready);
}
}
if (_global.trgt._width && !_global.pauseall) {
trg._x = _global.trgt._x;
trg._y = _global.trgt._y;
} else {
trg._x = 1000;
trg._y = 1000;
}
if (!_global.pauseall) {
updateEnemies();
}
if (_global.restartlvl) {
var v9 = lev + 1;
while (v9--) {
removeMovieClip(_root.getInstanceAtDepth(v9));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(9);
}
if (life < 0 && !_global.pauseall) {
_global.playsfx('exp');
msystem.stop();
mbos.stop();
_global.playsfx('win');
lifes._width = 0;
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
placeBoom(hero._x, hero._y);
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.perehod == 1) {
gotoAndPlay(5);
}
if (_global.perehod == 2) {
v9 = lev + 1;
while (v9--) {
removeMovieClip(_root.getInstanceAtDepth(v9));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(1);
}
};
onMouseDown = function () {
if (!_global.pauseall) {
fire = true;
}
};
onMouseUp = function () {
fire = false;
};
}
movieClip 1135 {
}
movieClip 1144 {
frame 1 {
stop();
}
frame 2 {
_parent.removeMovieClip();
}
}
movieClip 1145 {
}
instance mob1c of movieClip 1106 {
onClipEvent (rollOver) {
_global.trgt = this;
}
}
instance mob2c of movieClip 1106 {
onClipEvent (rollOver) {
_global.trgt = this;
}
}
frame 10 {
function placeFire(tgt) {
var v3 = 0;
while (v3 < 3) {
++lev;
if (lev > 1000000) {
lev = 0;
}
var v2 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v2);
globalToLocal(v2);
var v1 = fafa.duplicateMovieClip('f' + lev, lev);
if (Math.random() > 0.5) {
v1._x = v2.x + Math.random() * 2 - 1;
} else {
v1._x = v2.x - Math.random() * 2 - 1;
}
if (Math.random() > 0.5) {
v1._y = v2.y + Math.random() * 2 - 1;
} else {
v1._y = v2.y - Math.random() * 2 - 1;
}
v1._alpha = Math.random() * 50 + 50;
v1._yscale = Math.random() * 50 + 70;
v1._xscale = v1._yscale;
++v3;
}
}
function placeBoom(x, y) {
++lev;
var v3 = boom.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom1(x, y) {
++lev;
var v3 = boom1.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom2(x, y) {
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function createExplosion(targetX, targetY, targetPath, explosionParticleAmount, explosionParticleRange, particleSize, speed, speedAlpha) {
var v7 = 0;
while (v7 < explosionParticleAmount) {
var v8 = bitmapsArray[random(bitmapsArray.length)];
var v4 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder' + lev, lev);
++lev;
var v3 = v2.createEmptyMovieClip('internal_holder', lev);
v3._x = -v4.width / 2;
v3._y = -v4.height / 2;
++lev;
v3.attachBitmap(v4, lev, 'never');
v2._x = targetX + random(explosionParticleRange) - explosionParticleRange / 2;
v2._y = targetY + random(explosionParticleRange) - explosionParticleRange / 2;
var v6 = random(particleSize);
v2._xscale = v6;
v2._yscale = v6;
v2.speed = random(speed) + speed;
v2.speedAlpha = random(speedAlpha) + speedAlpha;
v2.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speedAlpha;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
++v7;
}
}
function createParticles(targetX, targetY, targetPath, tempParticle_mcAmount, tempParticle_mcRange, particleSize, tempParticle_mcMaxSpeed, tempParticle_mcMaxFadeSpeed) {
var v7 = 0;
while (v7 < tempParticle_mcAmount) {
var v8 = particleBitmapsArray[random(particleBitmapsArray.length)];
var v5 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder', lev);
++lev;
var v4 = v2.createEmptyMovieClip('internal_holder', lev);
v4._x = -v5.width / 2;
v4._y = -v5.height / 2;
++lev;
v4.attachBitmap(v5, lev, 'never');
v2._x = targetX;
v2._y = targetY;
v2._rotation = random(360);
v2._alpha = random(50) + 50;
v2._xscale = particleSize;
v2._yscale = particleSize;
v2.boundyLeft = targetX - tempParticle_mcRange;
v2.boundyTop = targetY - tempParticle_mcRange;
v2.boundyRight = targetX + tempParticle_mcRange;
v2.boundyBottom = targetY + tempParticle_mcRange;
v2.speedX = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedY = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedX *= tempParticle_mcMaxSpeed;
v2.speedY *= tempParticle_mcMaxSpeed;
v2.fadeSpeed = Math.random(tempParticle_mcMaxFadeSpeed) * tempParticle_mcMaxFadeSpeed;
v2.onEnterFrame = function () {
this._alpha -= this.fadeSpeed;
this._x += this.speedX;
this._y += this.speedY;
if (this._alpha <= 0 || this._x < this.boundyLeft || this._x > this.boundyRight || this._y < this.boundyTop || this._y > this.boundyBottom) {
this.removeMovieClip();
}
};
++v7;
}
}
function placeVolnaboom(x, y) {
++lev;
var v1 = volnaboom.duplicateMovieClip('b' + lev, lev);
v1._x = x;
v1._y = y;
}
function fireWeapon(target) {
if (reloadComplete == true && rok > 0) {
++lev;
_global.playsfx('raketa');
var v3 = missile.duplicateMovieClip('missile' + lev, lev);
v3._x = hero._x;
v3._y = hero._y;
v3._rotation = hero._rotation;
v3.targetX = target._x;
v3.targetY = target._y;
v3.tar = target;
v3.moveX = 0;
v3.moveY = 0;
v3.onEnterFrame = function () {
doFollow(this, this.tar);
};
roketi._alpha = 30;
rok -= 1;
roketi.ro.text = rok + '/' + _global.rokmax;
startReloading();
} else {
_global.playsfx('noroket');
}
}
function startReloading() {
reloadComplete = false;
reloadTimer = setInterval(this, 'gunReloaded', reloadSpeed);
}
function gunReloaded() {
clearInterval(reloadTimer);
if (rok > 0) {
roketi._alpha = 75;
}
reloadComplete = true;
}
function doFollow(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
follower.moveDistanceX = turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = missileSpeed * follower.moveX / follower.totalmove;
follower.moveY = missileSpeed * follower.moveY / follower.totalmove;
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = 180 * Math.atan2(follower.moveY, follower.moveX) / Math.PI;
doTrail(follower._x, follower._y, 'particle_smoke_clear');
var v5 = follower._x - target._x;
var v4 = follower._y - target._y;
var v6 = Math.sqrt(v5 * v5 + v4 * v4);
if (v6 < 10) {
placeBoom(target._x, target._y);
i = enemiesArray.length;
while (i--) {
c = enemiesArray[i];
if (c == target) {
removeEnemy(c);
++_global.kill1;
}
}
if (target == mob1c) {
_global.playsfx('hit');
mob1c.thp -= 10;
mob1c.hp._width -= 3;
if (mob1c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob1c._x, mob1c._y);
placeBoom(mob1c._x, mob1c._y);
placeBoom(mob1c._x, mob1c._y);
mob1c._x += 1000;
resp = false;
}
}
if (target == rb2) {
_global.playsfx('hit');
rb2.thp -= 10;
rb2.hp._width -= 3;
if (rb2.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
++_global.kill1;
placeBoom(rb2._x, rb2._y);
placeBoom(rb2._x, rb2._y);
placeBoom(rb2._x, rb2._y);
rb2._x += 1000;
resp = false;
}
}
removeMovieClip(target);
removeMovieClip(follower);
}
if (follower.hitTest(sun)) {
_global.playsfx('hit');
placeBoom1(follower._x, follower._y);
removeMovieClip(follower);
}
if (!target._x) {
removeMovieClip(follower);
delete follower.onEnterFrame;
}
}
function doTrail(targetX, targetY, type) {
++lev;
var v3 = _root.attachMovie(type, type + lev, lev);
v3._x = targetX;
v3._y = targetY;
v3._rotation = random(360);
randomScale = random(75) + 25;
v3._xscale = randomScale;
randomScale = random(75) + 25;
v3._yscale = randomScale;
v3.speed = random(10) + 5;
updateAfterEvent();
v3.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speed;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
}
function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip, Q, W) {
var v4 = 0;
while (v4 < enemyAmount) {
++lev;
if (enemyLibraryClip == 'e1') {
var v3 = enemA.duplicateMovieClip('ee' + lev, lev);
}
if (enemyLibraryClip == 'e2') {
v3 = enemB.duplicateMovieClip('ee' + lev, lev);
}
if (enemyLibraryClip == 'e5') {
v3 = enemE.duplicateMovieClip('ee' + lev, lev);
}
if (Q == 0 && W == 0) {
v3._x = random(Stage.width);
v3._y = random(Stage.height);
} else {
v3._x = Q;
v3._y = W;
}
v3._rotation = random(360);
if (enemyBehavior == 'typeA') {
v3.speed = Math.random() + 1;
v3.turnRate = 0.1;
v3.agroRange = 300;
v3.mode = 'follow';
v3.lif = 10;
v3.tt = 1;
v3.TtimeS = Math.floor(Math.random() * 20) + 60;
} else {
if (enemyBehavior == 'typeB') {
v3.speed = Math.random() * 2 + 6;
v3.turnRate = 1;
v3.agroRange = 500;
v3.mode = 'follow';
v3.lif = 20;
v3.tt = 2;
v3.TtimeS = Math.floor(Math.random() * 10) + 10;
} else {
if (enemyBehavior == 'typeE') {
v3.speed = 0;
v3.turnRate = 0.2;
v3.agroRange = 0;
v3.mode = 'run';
v3.lif = 40;
v3.tt = 5;
v3._x = random(Stage.width - 200) + 100;
v3._y = random(Stage.height - 150) + 75;
}
}
}
v3.distanceX = 0;
v3.distanceY = 0;
v3.distanceTotal = 0;
v3.moveDistanceX = 0;
v3.moveDistanceY = 0;
v3.moveX = 0;
v3.moveY = 0;
v3.totalmove = 0;
v3.timeS = 0;
v3.onRollOver = function () {
_global.trgt = this;
};
enemiesArray.push(v3);
++v4;
}
}
function updateEnemies() {
var v3 = 0;
while (v3 < enemiesArray.length) {
var v2 = enemiesArray[v3];
updatePosition(v2, hero);
if (v2.tt == 1) {
if (v2.timeS++ > v2.TtimeS) {
v2.timeS = 0;
placeVolna(v2);
if (_global.Detal == 2) {
placeVolnaboom(v2._x, v2._y);
}
}
}
if (v2.tt == 3) {
if (v2.timeS++ > v2.TtimeS) {
v2.timeS = 0;
_global.playsfx('lazer');
var v5 = 4;
while (v5--) {
placeEbul(v2, 2);
v2._rotation += 90;
}
}
}
if (v2.tt == 2) {
if (v2.timeS++ > v2.TtimeS) {
v2.timeS = 0;
placeEbul(v2, 3);
}
}
if (v2.tt == 5) {
if (Math.abs(hero._x - v2._x) < 25 && Math.abs(hero._y - v2._y) < 25) {
placeBoom(v2._x, v2._y);
v2.gotoAndStop(2);
removeEnemy(v2);
if (!ud) {
var v4 = shild - 40;
if (v4 < 0) {
life += v4;
shild = 0;
} else {
shild -= 40;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
}
}
++v3;
}
}
function updatePosition(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
if (follower.distanceTotal <= follower.agroRange) {
follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = follower.speed * follower.moveX / follower.totalmove;
follower.moveY = follower.speed * follower.moveY / follower.totalmove;
if (follower.mode == 'follow') {
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians;
} else {
if (follower.mode == 'run') {
if (follower._x - follower.moveX >= 0 && follower._x - follower.moveX <= 700) {
follower._x -= follower.moveX;
}
if (follower._y - follower.moveY >= 0 && follower._y - follower.moveY <= 600) {
follower._y -= follower.moveY;
}
follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180;
}
}
}
if (follower._x < 0) {
follower._x = 0;
}
if (follower._x > 700) {
follower._x = 700;
}
if (follower._y < 0) {
follower._y = 0;
}
if (follower._y > 600) {
follower._y = 600;
}
}
function removeEnemy(s) {
var v4 = enemiesArray.length;
while (v4--) {
var v2 = enemiesArray[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
enemiesArray.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function fireLight(xStart, yStart, xEnd, yEnd) {
++lev;
_global.playsfx('molniya');
var temp = effectHolder.duplicateMovieClip('efho' + lev, lev);
temp.time = 5;
temp.onEnterFrame = function () {
temp.clear();
temp.lineStyle(lightningWidth, lightningColor, lightningAlpha, true);
var v13 = xStart - xEnd;
var v11 = yStart - yEnd;
var v12 = Math.sqrt(v13 * v13 + v11 * v11);
var v9 = v12 / lightningFrequency;
var v3 = Math.atan2(yStart - yEnd, xStart - xEnd);
var v10 = v12 / v9;
var v8 = 0;
while (v8 < lightningBranches) {
temp.moveTo(xStart, yStart);
var v2 = 1;
while (v2 < v9 + 1) {
var v5 = v10 * v2;
var v4 = random(lightningOffset - lightningOffset / 2);
var v6 = xStart - Math.cos(v3) * v5 + Math.cos(v3 + 1.55) * v4;
var v7 = yStart - Math.sin(v3) * v5 + Math.sin(v3 + 1.55) * v4;
temp.lineTo(v6, v7);
++v2;
}
++v8;
}
if (this.time-- <= 0) {
temp.removeMovieClip();
}
};
temp.lineTo(xEnd, yEnd);
addSparkles(xEnd, yEnd, sparkNumber, sparkDistance, sparkSize);
}
function startLReloading(a) {
reloadLComplete = false;
reloadLTimer = setInterval(this, 'gunLReloaded', reloadLSpeed);
screenLTimer = setInterval(this, 'clearScreen', clearSpeed);
}
function clearScreen() {
clearInterval(screenTimer);
delete effectHolder.onEnterFrame;
effectHolder.clear();
}
function gunLReloaded() {
clearInterval(reloadLTimer);
reloadLComplete = true;
}
function addSparkles(_targetX, _targetY, _sparkNumber, _distance, _sparkSize) {
var v6 = 0;
while (v6 < _sparkNumber) {
var v4 = _root.attachMovie('spark', 'spark_' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
var v3 = _root.attachMovie('spark2', 'spark2_' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v4._x = _targetX + random(_distance) - _distance / 2;
v4._y = _targetY + random(_distance) - _distance / 2;
v3._x = _targetX + random(_distance) - _distance / 2;
v3._y = _targetY + random(_distance) - _distance / 2;
var v5 = random(_sparkSize) + _sparkSize / 4;
v4._xscale = v5;
v4._yscale = v5;
v5 = random(_sparkSize) + _sparkSize / 4;
v3._xscale = v5;
v3._yscale = v5;
v3._rotation = random(359);
v4._alpha = lightningAlpha;
v3._alpha = lightningAlpha;
++v6;
}
}
stop();
var my_so = SharedObject.getLocal('spiteful_space_save', '/');
_global.MIN = my_so.data.MIN;
_global.GAS = my_so.data.GAS;
_global.BIO = my_so.data.BIO;
_global.rokmax = my_so.data.rokmax;
_global.uR = my_so.data.uR;
_global.uG = my_so.data.uG;
_global.uB = my_so.data.uB;
_global.uRa = my_so.data.uRa;
_global.uE = my_so.data.uE;
_global.uS = my_so.data.uS;
_global.uSt = my_so.data.uSt;
my_so.flush();
_global.perehod = 0;
heroab.swapDepths(1000002);
menuab.swapDepths(1000003);
con.swapDepths(1000004);
_global.bio1 = 0;
_global.min1 = 0;
_global.gas1 = 0;
_global.kill1 = 0;
_global.restartlvl = false;
mpause.stop();
msystem.stop();
mmenu.stop();
mbos.stop();
_global.sa1 = 1;
_global.sa2 = 1;
_global.sa3 = 1;
var stren = _global.str;
if (_global.systema == 15) {
cap1.cap11.cap111.text = 'KILL THE BOSS!';
cap1.gotoAndPlay(1);
if (_global.SoundM != false) {
mbos.start(0, 500);
}
} else {
if (_global.SoundM != false) {
msystem.start(0, 500);
}
}
_global.pauseall = false;
_global.steptmp = 0;
_global.pausetimestart = 0;
_global.pausetimestop = 0;
_global.pausetimeall = 0;
needBePaused = new Array();
_global.addToPause = function (obj) {
if (!obj._inPause) {
needBePaused.push(obj);
obj._inPause = true;
}
};
var koff = 1;
var finangle = Math.random() * 100;
finplay = function () {
finangle += 10;
if (koff < 30) {
koff += 0.5;
}
finr_ang = finangle / 57.29577951308232;
finmc._x = 500 + koff * Math.cos(finr_ang);
finmc._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc._x, finmc._y, 'particle_smoke_clear');
finr_ang = (finangle + 180) / 57.29577951308232;
finmc1._x = 500 + koff * Math.cos(finr_ang);
finmc1._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc1._x, finmc1._y, 'particle_smoke_clear');
};
_global.setPause = function (flag) {
isPause = flag;
var v3 = needBePaused.length;
while (v3--) {
var v2 = needBePaused[v3];
if (flag) {
v2.stop();
v2.oef = v2.onEnterFrame;
v2.onEnterFrame = null;
} else {
v2.onEnterFrame = v2.oef;
v2.play();
}
}
if (flag) {
_global.pausetimestart = int(getTimer() / 1000);
} else {
_global.pausetimestop = int(getTimer() / 1000);
_global.pausetimeall += _global.pausetimestart - _global.pausetimestop;
}
};
_global.planet = 0;
min1.text = _global.GAS + '/300';
min2.text = _global.MIN + '/150';
min3.text = _global.BIO + '/50';
samc._width = 0;
samc._x = 350;
var angl = 0;
var Xx = mob1c._x - sun._x;
var Yy = mob1c._y - sun._y;
if (Xx == 0) {
if (Yy >= 0) {
angl = 270;
} else {
angl = 90;
}
} else {
if (Xx > 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433;
} else {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 - 180;
}
}
}
var myList = mob1c.mob1cc.filters;
myList[1].angle = angl;
myList[0].color = 11517695;
mob1c.mob1cc.filters = myList;
_global.SAE = 0;
var SAc = 0;
var ud = false;
var radiu = _global.rad;
var life = _global.arm;
var shild = _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
heroab.h1._width = 50 * _global.arm / 300;
heroab.h2._width = 50 * _global.def / 200;
heroab.h3._width = 50 * _global.spe / 7;
heroab.h4._width = 50 * stren / 2.2;
heroab.h5._width = 50 * _global.rad / 4;
var rok = _global.rokmax;
roketi.ro.text = rok + '/' + _global.rokmax;
_global.step = _global.spe;
var checkup = 1;
var checkup1 = 1;
var rotDirSpeed = 5;
var angle = Math.random() * 100;
var eneCount = 0;
var lev = 0;
var timeb = int(getTimer() / 100);
var timenasys = int(getTimer() / 1000);
_global.timeall = 0;
var fire = false;
heroab._visible = false;
menuab._visible = false;
con._visible = false;
boom._visible = false;
boom1._visible = false;
boom2._visible = false;
mob1c.thp = 100;
var resp = true;
var end = false;
var end1 = 0;
fafa._visible = false;
var bitmapsArray;
var particleBitmapsArray;
bitmapsArray = ['effect-fire5.png', 'effect-fire6.png', 'effect-fire7.png', 'effect-fire8.png', 'effect-fire9.png'];
particleBitmapsArray = ['particle.jpg', 'particle1.png', 'particle5.png'];
var Gass = new Array();
placeGas = function (A, B) {
++lev;
var d = gas.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.GAS < 300) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Gass.length;
while (v3--) {
var v4 = Gass[v3];
if (v4 == d) {
Gass.splice(v3, 1);
}
}
_global.GAS += 1;
++_global.gas1;
_global.playsfx('collected');
min1.text = _global.GAS + '/300';
}
};
Gass.push(d);
};
var Minerals = new Array();
placeMineral = function (A, B) {
++lev;
var d = mineral.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.MIN < 150) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Minerals.length;
while (v3--) {
var v4 = Minerals[v3];
if (v4 == d) {
Minerals.splice(v3, 1);
}
}
_global.MIN += 1;
++_global.min1;
_global.playsfx('collected');
min2.text = _global.MIN + '/150';
}
};
Minerals.push(d);
};
var Bios = new Array();
placeBio = function (A, B) {
++lev;
var d = bio.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.BIO < 50) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Bios.length;
while (v3--) {
var v4 = Bios[v3];
if (v4 == d) {
Bios.splice(v3, 1);
}
}
_global.BIO += 1;
++_global.bio1;
_global.playsfx('collected');
min3.text = _global.BIO + '/50';
}
};
Bios.push(d);
};
var reloadSpeed = 1000;
var missileSpeed = 7;
var turnRate = 0.7;
var reloadTimer;
var reloadComplete = true;
bulletSpeed = 18;
placeBullet = function (tgt) {
++lev;
_global.playsfx('vistrel');
var v7 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v7);
globalToLocal(v7);
var v6 = bullet.duplicateMovieClip('b' + lev, lev);
v6._x = v7.x;
v6._y = v7.y;
v6._rotation = hero._rotation + hero.body._rotation;
v6.a = (v6._rotation / 180) * Math.PI;
v6.onEnterFrame = function () {
this._x += bulletSpeed * Math.cos(this.a);
this._y += bulletSpeed * Math.sin(this.a);
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.hitTest(sun)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl1)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl2)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl3)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (rb2.hitTest(this)) {
_global.playsfx('hit');
if (Math.abs(hero._x - rb2._x) < 128.5 && Math.abs(hero._y - rb2._y) < 128.5) {
rb2.thp -= _global.rad;
rb2.hp._width -= 0.3 * _global.rad;
} else {
rb2.thp -= 1;
rb2.hp._width -= 0.3;
}
if (rb2.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
++_global.kill1;
placeBoom(rb2._x, rb2._y);
rb2._x += 1000;
resp = false;
}
if (Math.random() < 0.2) {
placeBoom(rb2._x, rb2._y);
}
placeBoom1(rb2._x, rb2._y);
this.removeMovieClip();
}
if (mob1c.hitTest(this)) {
_global.playsfx('hit');
if (Math.abs(hero._x - mob1c._x) < 128.5 && Math.abs(hero._y - mob1c._y) < 128.5) {
mob1c.thp -= _global.rad;
mob1c.hp._width -= 0.3 * _global.rad;
} else {
mob1c.thp -= 1;
mob1c.hp._width -= 0.3;
}
if (mob1c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob1c._x, mob1c._y);
mob1c._x += 1000;
resp = false;
}
if (Math.random() < 0.2) {
placeBoom(mob1c._x, mob1c._y);
}
placeBoom1(mob1c._x, mob1c._y);
this.removeMovieClip();
}
var v5 = enemiesArray.length;
while (v5--) {
var v3 = enemiesArray[v5];
if (v3.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 3 <= 220) {
SAc += 3;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v3.lif -= _global.rad * stren;
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v4 = 0;
if (_global.timeall <= 120) {
v4 = 0;
} else {
if (_global.timeall <= 200) {
v4 = 0.5;
} else {
v4 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v4) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v4) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v4) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeEnemy(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
} else {
v3.lif -= stren;
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v4 = 0;
if (_global.timeall <= 120) {
v4 = 0;
} else {
if (_global.timeall <= 200) {
v4 = 0.5;
} else {
v4 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v4) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v4) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v4) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeEnemy(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
}
}
}
};
};
placeVolna = function (tgt, ty) {
++lev;
var v3 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v3);
globalToLocal(v3);
_global.playsfx('volna');
var v4 = volna.duplicateMovieClip('b' + lev, lev);
v4._x = v3.x;
v4._y = v3.y;
v4.onEnterFrame = function () {
if (hero.foot.hitTest(this)) {
if (!ud) {
var v3 = shild - 1;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 1;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
placeBoom1(hero._x, hero._y);
}
};
};
placeEbul = function (tgt, ty) {
++lev;
var v4 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v4);
globalToLocal(v4);
if (ty == 1) {
_global.playsfx('zelenie');
var v3 = ebul.duplicateMovieClip('b' + lev, lev);
if (Math.floor(Math.random() * 2) == 1) {
v3._rotation = tgt._rotation + Math.random() * 10;
} else {
v3._rotation = tgt._rotation - Math.random() * 10;
}
v3.tt = 1;
v3.bsp = 10;
}
if (ty == 2) {
v3 = lazer.duplicateMovieClip('b' + lev, lev);
v3._rotation = tgt._rotation;
v3.tt = 3;
v3.bsp = 5;
}
if (ty == 3) {
_global.playsfx('zelenie');
v3 = little.duplicateMovieClip('b' + lev, lev);
v3._x = v4.x;
v3._y = v4.y;
v3._rotation = Math.atan2(hero._y - v3._y, hero._x - v3._x) * 57.29577951308232;
v3.tt = 2;
v3.bsp = 16;
}
v3._x = v4.x;
v3._y = v4.y;
v3.a = (v3._rotation / 180) * Math.PI;
v3.onEnterFrame = function () {
if (this.tt == 1) {
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this.tt == 3) {
this.bsp += 0.3;
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this.bsp += 0.3;
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this.tt == 2) {
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.tt != 3) {
if (this.hitTest(sun)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl1)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl2)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl3)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
}
if (hero.foot.hitTest(this)) {
_global.playsfx('hitme');
if (!ud) {
if (this.tt == 1 || this.tt == 3) {
var v3 = shild - 5;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 5;
}
}
if (this.tt == 2) {
v3 = shild - 1;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 1;
}
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
placeBoom1(hero._x, hero._y);
this.removeMovieClip();
}
};
};
var enemiesArray = new Array();
var radians = 57.29577951308232;
if (_global.systema != 15) {
createEnemies(6, 'typeA', 'e1', 0, 0);
createEnemies(3, 'typeB', 'e2', 0, 0);
createEnemies(14, 'typeE', 'e5', 0, 0);
}
if (_global.systema == 15) {
createEnemies(6, 'typeA', 'e1', 0, 0);
createEnemies(5, 'typeE', 'e5', 0, 0);
}
onEnterFrame = function () {
var v11 = 0;
var v12 = hero.foot._x - sun._x;
var v14 = hero.foot._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
var v16 = hero.foot.filters;
v16[1].angle = v11;
hero.foot.filters = v16;
v11 = 0;
v12 = pl2._x - sun._x;
v14 = pl2._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = pl2.filters;
v16[1].angle = v11;
pl2.filters = v16;
v11 = 0;
v12 = pl1._x - sun._x;
v14 = pl1._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = pl1.filters;
v16[1].angle = v11;
pl1.filters = v16;
v11 = 0;
v12 = pl3._x - sun._x;
v14 = pl3._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = pl3.filters;
v16[1].angle = v11;
pl3.filters = v16;
if (_global.systema == 15) {
v11 = 0;
v12 = rb2._x - sun._x;
v14 = rb2._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = rb2.filters;
v16[1].angle = v11;
rb2.filters = v16;
}
if (Key.isDown(16) && !_global.pauseall) {
if (_global.trgt._width) {
fireWeapon(_global.trgt);
}
}
if (Key.isDown(32) && _global.SAE == 1 && !_global.pauseall) {
sap._alpha = 100;
_global.SAE = 2;
_global.playsfx('sastart');
if (_global.perstype == 1) {
stren *= 3;
cap1.cap11.cap111.text = 'EAGLE EYE!';
cap1.gotoAndPlay(1);
var v13 = hero.foot.filters;
v13[1].color = 16711680;
hero.foot.filters = v13;
}
if (_global.perstype == 3) {
_global.sa3 = 0.5;
_global.rad = 1;
cap1.cap11.cap111.text = 'NEUTRON ACCELERATION!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 2) {
var v8 = enemiesArray.length;
while (v8--) {
var v6 = enemiesArray[v8];
v6.speed *= 0.2;
}
_global.sa2 = 0.2;
cap1.cap11.cap111.text = 'TIME BOMB!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 5) {
ud = true;
cap1.cap11.cap111.text = 'ULTIMATE DEFENCE!';
cap1.gotoAndPlay(1);
v13 = hero.foot.filters;
v13[2].strength = 2;
hero.foot.filters = v13;
}
if (_global.perstype == 4) {
var v7 = enemiesArray.length;
while (v7--) {
var v3 = enemiesArray[v7];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
var v5 = 0.5;
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeEnemy(v3);
++_global.kill1;
}
}
hero.zone._alpha = 85;
SAc = 32;
cap1.cap11.cap111.text = 'ANNIHILATING FLASH!';
cap1.gotoAndPlay(1);
}
}
if ((Key.isDown(37) || Key.isDown(65)) && !_global.pauseall) {
hero._rotation -= rotDirSpeed;
} else {
if ((Key.isDown(39) || Key.isDown(68)) && !_global.pauseall) {
hero._rotation += rotDirSpeed;
}
}
var v19 = _xmouse - hero._x;
var v17 = _ymouse - hero._y;
var v18 = Math.atan2(v17, v19);
hero.body._rotation = -hero._rotation + (v18 / Math.PI) * 180;
var v10 = (hero._rotation / 180) * Math.PI;
if ((Key.isDown(38) || Key.isDown(87)) && !_global.pauseall) {
if (_global.step < 5) {
_global.step += 0.1;
}
if (checkup1 == 2) {
_global.step = 2;
checkup1 = 1;
}
hero.foot.play();
checkup = 1;
hero._x += _global.step * Math.cos(v10);
hero._y += _global.step * Math.sin(v10);
} else {
if (checkup == 1 && _global.step > 0) {
hero._x += _global.step * Math.cos(v10);
hero._y += _global.step * Math.sin(v10);
_global.step -= 0.1;
} else {
if (checkup == 2 && _global.step > 0) {
hero._x -= _global.step * Math.cos(v10);
hero._y -= _global.step * Math.sin(v10);
_global.step -= 0.1;
} else {
hero.foot.stop;
}
}
}
if (hero._x < 0) {
hero._x = 0;
}
if (hero._x > 700) {
hero._x = 700;
}
if (hero._y < 0) {
hero._y = 0;
}
if (hero._y > 600) {
hero._y = 600;
}
if (!_global.pauseall) {
angle += 0.2;
}
r_ang = angle / 57.29577951308232;
pl1._x = 317 + 100 * Math.cos(r_ang * 3);
pl1._y = 245 + 100 * Math.sin(r_ang * 3);
pl2._x = 317 + 200 * Math.cos(r_ang * 2);
pl2._y = 245 + 200 * Math.sin(r_ang * 2);
pl3._x = 317 + 300 * Math.cos(r_ang);
pl3._y = 245 + 200 * Math.sin(r_ang);
if (hero.foot.hitTest(sun) && !_global.pauseall) {
if (ud) {
if (shild + 1 > _global.def) {
shild = _global.def;
} else {
shild += 1;
}
} else {
if (shild + 5 > _global.def) {
shild = _global.def;
} else {
shild += 5;
}
life -= 1;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
if (eneCount++ > 100 && resp && _global.SAE != 2 && !_global.pauseall && _global.systema != 15) {
eneCount = 0;
createEnemies(1, 'typeB', 'e2', 158, 316);
_global.playsfx('resp');
if (_global.systema == 16 && Math.random() < 0.33) {
createEnemies(1, 'typeA', 'e1', 158, 316);
_global.playsfx('resp');
}
}
if (_global.systema == 15) {
if (eneCount++ > 400 && resp && _global.SAE != 2 && !_global.pauseall) {
eneCount = 0;
createEnemies(1, 'typeB', 'e2', rb2._x, rb2._y);
_global.playsfx('resp');
}
}
timebb = int(getTimer() / 100) - timeb;
if (fire && timebb >= 2 * _global.sa3) {
if (_global.uG == 1) {
placeBullet(hero.body.dot);
}
if (_global.uG == 2) {
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
if (_global.uG == 3) {
placeBullet(hero.body.dot);
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
timeb = int(getTimer() / 100);
}
if (_global.SAE == 2) {
if (SAc - 2 <= 0) {
SAc = 0;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 0;
sap._alpha = 0;
if (_global.perstype == 5) {
ud = false;
v13 = hero.foot.filters;
v13[2].strength = 0;
hero.foot.filters = v13;
}
if (_global.perstype == 1) {
stren /= 3;
v13 = hero.foot.filters;
v13[1].color = 16777215;
hero.foot.filters = v13;
}
if (_global.perstype == 3) {
_global.sa3 = 1;
_global.rad = radiu;
}
if (_global.perstype == 2) {
v8 = enemiesArray.length;
while (v8--) {
v6 = enemiesArray[v8];
v6.speed *= 5;
}
_global.sa2 = 1;
}
if (_global.perstype == 4) {
hero.zone._alpha = 5;
}
} else {
if (!_global.pauseall) {
SAc -= 2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
if (_global.perstype == 4) {
hero.zone._alpha -= 5;
}
if (_global.perstype == 2) {
if (shild + 2 > _global.def) {
shild = _global.def;
} else {
shild += 2;
}
shilds._width = 183 * shild / _global.def;
teshi.text = 'shield ' + shild + '%';
}
}
}
}
if (_global.step > 0) {
placeFire(hero.sop);
}
if (resp == false && !end) {
if (enemiesArray.length == 0) {
cap1.cap11.cap111.text = 'SYSTEM NOW FREE, GOOD JOB!';
cap1.gotoAndPlay(1);
_global.playsfx('openportal');
_global.trgt = null;
fin._x = 500;
fin._y = 430;
fin.gotoAndPlay(1);
var v15 = new flash.filters.GlowFilter();
var v4 = pl1.filters;
v4.push(v15);
v4[2].blurY = 0;
v4[2].blurX = 0;
v4[2].quality = 100;
v4[2].color = 3329279;
pl1.filters = v4;
v4 = pl2.filters;
v4.push(v15);
v4[2].blurY = 0;
v4[2].blurX = 0;
pl2.filters = v4;
v4 = pl3.filters;
v4.push(v15);
v4[2].blurY = 0;
v4[2].blurX = 0;
pl3.filters = v4;
end1 = 8;
end = true;
}
}
if (end1 > 0) {
end1 -= 0.1;
v4 = pl1.filters;
v4[2].blurY = 8 - end1;
v4[2].blurX = v4[2].blurY;
v4[2].strength = (8 - end1) / 5;
pl1.filters = v4;
v4 = pl2.filters;
v4[2].blurY = 8 - end1;
v4[2].blurX = v4[2].blurY;
v4[2].strength = (8 - end1) / 5;
pl2.filters = v4;
v4 = pl3.filters;
v4[2].blurY = 8 - end1;
v4[2].blurX = v4[2].blurY;
v4[2].strength = (8 - end1) / 5;
pl3.filters = v4;
}
if (!end && !_global.pauseall) {
_global.timeall = int(getTimer() / 1000) - timenasys + _global.pausetimeall;
systime.text = _global.timeall;
}
if (end) {
finplay();
}
if (hero.foot.hitTest(fin.endss.ends) && !_global.pauseall) {
msystem.stop();
mbos.stop();
_global.playsfx('win');
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.SAE == 0 && !_global.pauseall) {
if (SAc + 0.2 <= 220) {
SAc += 0.2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
_global.playsfx(saready);
}
}
if (_global.trgt._width && !_global.pauseall) {
trg._x = _global.trgt._x;
trg._y = _global.trgt._y;
} else {
trg._x = 1000;
trg._y = 1000;
}
if (!_global.pauseall) {
updateEnemies();
}
if (_global.restartlvl) {
var v9 = lev + 1;
while (v9--) {
removeMovieClip(_root.getInstanceAtDepth(v9));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(10);
}
if (life < 0 && !_global.pauseall) {
_global.playsfx('exp');
msystem.stop();
mbos.stop();
_global.playsfx('win');
lifes._width = 0;
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
placeBoom(hero._x, hero._y);
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.perehod == 1) {
gotoAndPlay(5);
}
if (_global.perehod == 2) {
v9 = lev + 1;
while (v9--) {
removeMovieClip(_root.getInstanceAtDepth(v9));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(1);
}
};
onMouseDown = function () {
if (!_global.pauseall) {
fire = true;
}
};
onMouseUp = function () {
fire = false;
};
var lightningOffset = 12;
var lightningFrequency = 12;
var lightningWidth = 1;
var lightningColor = '0x5C98EF';
var lightningAlpha = 75;
var lightningBranches = 3;
var sparkNumber = 10;
var sparkDistance = 20;
var sparkSize = 100;
var reloadLSpeed = 200;
var clearSpeed = 200;
var glow_color = lightningColor;
var glow_alpha = 0.6;
var glow_blurX = 5;
var glow_blurY = 5;
var glow_strength = 2;
var glow_quality = 3;
var reloadLTimer;
var screenTimer;
var reloadLComplete = true;
var rotationLDirection;
var filter_glow = new flash.filters.GlowFilter(glow_color, glow_alpha, glow_blurX, glow_blurY, glow_strength, glow_quality);
effectHolder.filters = [filter_glow];
if (_global.systema == 15) {
rb2._x = Math.floor(Math.random() * 200) + 500;
rb2._y = Math.floor(Math.random() * 200) + 200;
mob1c._x = 1000;
var dSx = hero._x - rb2._x;
var dSy = hero._y - rb2._y;
rb2.a = Math.atan2(dSy, dSx);
rb2._rotation = (rb2.a / Math.PI) * 180;
rb2.speed = Math.random() + 0.5;
rb2.timeS = 0;
rb2.TtimeS = 15;
rb2.back = 0;
rb2.thp = 300;
}
rb2.onEnterFrame = function () {
if (_global.systema == 15 && !_global.pauseall) {
if (this.back == 0) {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
}
if (this.back == 2) {
this._x += -this.speed * Math.cos(this.a);
this._y += -this.speed * Math.sin(this.a);
}
var v3 = hero._x - this._x;
var v5 = hero._y - this._y;
this.a = Math.atan2(v5, v3);
this._rotation = (this.a / Math.PI) * 180;
if (this.timeS++ > this.TtimeS && resp) {
this.timeS = 0;
iii = 6;
while (iii--) {
placeEbul(this, 1);
}
if (Math.abs(hero._x - this._x) < 150 && Math.abs(hero._y - this._y) < 150) {
this.timeS = 0;
fireLight(this._x, this._y, hero._x, hero._y);
if (!ud) {
var v6 = shild - 3;
if (v6 < 0) {
life += v6;
shild = 0;
} else {
shild -= 3;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
}
}
var v4 = Math.sqrt(v3 * v3 + v5 * v5);
if (v4 < 130) {
if (this.back == 0) {
this.back = 1;
}
}
if (v4 < 60) {
this.back = 2;
}
if (v4 >= 130) {
this.back = 0;
}
}
};
rb2.onRollOver = function () {
_global.trgt = this;
};
}
movieClip 1148 {
}
movieClip 1157 {
}
movieClip 1158 {
}
movieClip 1159 {
frame 1 {
stop();
}
frame 2 {
_parent.removeMovieClip();
}
}
movieClip 1162 {
}
movieClip 1164 {
frame 1 {
addToPause(this);
}
}
instance mob1c of movieClip 1106 {
onClipEvent (rollOver) {
_global.trgt = this;
}
}
frame 11 {
function placeFire(tgt) {
var v3 = 0;
while (v3 < 3) {
++lev;
if (lev > 1000000) {
lev = 0;
}
var v2 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v2);
globalToLocal(v2);
var v1 = fafa.duplicateMovieClip('f' + lev, lev);
if (Math.random() > 0.5) {
v1._x = v2.x + Math.random() * 2 - 1;
} else {
v1._x = v2.x - Math.random() * 2 - 1;
}
if (Math.random() > 0.5) {
v1._y = v2.y + Math.random() * 2 - 1;
} else {
v1._y = v2.y - Math.random() * 2 - 1;
}
v1._alpha = Math.random() * 50 + 50;
v1._yscale = Math.random() * 50 + 70;
v1._xscale = v1._yscale;
++v3;
}
}
function placeBoom(x, y) {
++lev;
var v3 = boom.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom1(x, y) {
++lev;
var v3 = boom1.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom2(x, y) {
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function createExplosion(targetX, targetY, targetPath, explosionParticleAmount, explosionParticleRange, particleSize, speed, speedAlpha) {
var v7 = 0;
while (v7 < explosionParticleAmount) {
var v8 = bitmapsArray[random(bitmapsArray.length)];
var v4 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder' + lev, lev);
++lev;
var v3 = v2.createEmptyMovieClip('internal_holder', lev);
v3._x = -v4.width / 2;
v3._y = -v4.height / 2;
++lev;
v3.attachBitmap(v4, lev, 'never');
v2._x = targetX + random(explosionParticleRange) - explosionParticleRange / 2;
v2._y = targetY + random(explosionParticleRange) - explosionParticleRange / 2;
var v6 = random(particleSize);
v2._xscale = v6;
v2._yscale = v6;
v2.speed = random(speed) + speed;
v2.speedAlpha = random(speedAlpha) + speedAlpha;
v2.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speedAlpha;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
++v7;
}
}
function createParticles(targetX, targetY, targetPath, tempParticle_mcAmount, tempParticle_mcRange, particleSize, tempParticle_mcMaxSpeed, tempParticle_mcMaxFadeSpeed) {
var v7 = 0;
while (v7 < tempParticle_mcAmount) {
var v8 = particleBitmapsArray[random(particleBitmapsArray.length)];
var v5 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder', lev);
++lev;
var v4 = v2.createEmptyMovieClip('internal_holder', lev);
v4._x = -v5.width / 2;
v4._y = -v5.height / 2;
++lev;
v4.attachBitmap(v5, lev, 'never');
v2._x = targetX;
v2._y = targetY;
v2._rotation = random(360);
v2._alpha = random(50) + 50;
v2._xscale = particleSize;
v2._yscale = particleSize;
v2.boundyLeft = targetX - tempParticle_mcRange;
v2.boundyTop = targetY - tempParticle_mcRange;
v2.boundyRight = targetX + tempParticle_mcRange;
v2.boundyBottom = targetY + tempParticle_mcRange;
v2.speedX = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedY = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedX *= tempParticle_mcMaxSpeed;
v2.speedY *= tempParticle_mcMaxSpeed;
v2.fadeSpeed = Math.random(tempParticle_mcMaxFadeSpeed) * tempParticle_mcMaxFadeSpeed;
v2.onEnterFrame = function () {
this._alpha -= this.fadeSpeed;
this._x += this.speedX;
this._y += this.speedY;
if (this._alpha <= 0 || this._x < this.boundyLeft || this._x > this.boundyRight || this._y < this.boundyTop || this._y > this.boundyBottom) {
this.removeMovieClip();
}
};
++v7;
}
}
function placeVolnaboom(x, y) {
++lev;
var v1 = volnaboom.duplicateMovieClip('b' + lev, lev);
v1._x = x;
v1._y = y;
}
function fireWeapon(target) {
if (reloadComplete == true && rok > 0) {
++lev;
_global.playsfx('raketa');
var v3 = missile.duplicateMovieClip('missile' + lev, lev);
v3._x = hero._x;
v3._y = hero._y;
v3._rotation = hero._rotation;
v3.targetX = target._x;
v3.targetY = target._y;
v3.tar = target;
v3.moveX = 0;
v3.moveY = 0;
v3.onEnterFrame = function () {
doFollow(this, this.tar);
};
roketi._alpha = 30;
rok -= 1;
roketi.ro.text = rok + '/' + _global.rokmax;
startReloading();
} else {
_global.playsfx('noroket');
}
}
function startReloading() {
reloadComplete = false;
reloadTimer = setInterval(this, 'gunReloaded', reloadSpeed);
}
function gunReloaded() {
clearInterval(reloadTimer);
if (rok > 0) {
roketi._alpha = 75;
}
reloadComplete = true;
}
function doFollow(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
follower.moveDistanceX = turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = missileSpeed * follower.moveX / follower.totalmove;
follower.moveY = missileSpeed * follower.moveY / follower.totalmove;
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = 180 * Math.atan2(follower.moveY, follower.moveX) / Math.PI;
doTrail(follower._x, follower._y, 'particle_smoke_clear');
var v7 = follower._x - target._x;
var v6 = follower._y - target._y;
var v8 = Math.sqrt(v7 * v7 + v6 * v6);
if (v8 < 10) {
placeBoom(target._x, target._y);
var v4 = spiders.length;
while (v4--) {
var v2 = spiders[v4];
if (v2 == target) {
removeSpider(v2);
++_global.kill1;
}
}
v4 = Sspiders.length;
while (v4--) {
v2 = Sspiders[v4];
if (v2 == target) {
removeSSpider(v2);
++_global.kill1;
}
}
v4 = enemiesArray.length;
while (v4--) {
v2 = enemiesArray[v4];
if (v2 == target) {
removeEnemy(v2);
++_global.kill1;
}
}
if (target == mob1c) {
_global.playsfx('hit');
mob1c.thp -= 10;
mob1c.hp._width -= 3;
if (mob1c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob1c._x, mob1c._y);
placeBoom(mob1c._x, mob1c._y);
placeBoom(mob1c._x, mob1c._y);
mob1c._x += 1000;
resp = false;
}
}
removeMovieClip(target);
removeMovieClip(follower);
}
if (follower.hitTest(sun)) {
_global.playsfx('hit');
placeBoom1(follower._x, follower._y);
removeMovieClip(follower);
}
if (!target._x) {
removeMovieClip(follower);
delete follower.onEnterFrame;
}
}
function doTrail(targetX, targetY, type) {
++lev;
var v3 = _root.attachMovie(type, type + lev, lev);
v3._x = targetX;
v3._y = targetY;
v3._rotation = random(360);
randomScale = random(75) + 25;
v3._xscale = randomScale;
randomScale = random(75) + 25;
v3._yscale = randomScale;
v3.speed = random(10) + 5;
updateAfterEvent();
v3.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speed;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
}
function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip) {
var v4 = 0;
while (v4 < enemyAmount) {
++lev;
if (enemyLibraryClip == 'e1') {
var v3 = enemA.duplicateMovieClip('ee' + lev, lev);
}
v3._x = random(Stage.width);
v3._y = random(Stage.height);
v3._rotation = random(360);
if (enemyBehavior == 'typeA') {
v3.speed = Math.random() + 1;
v3.turnRate = 0.1;
v3.agroRange = 300;
v3.mode = 'follow';
v3.lif = 10;
v3.tt = 1;
v3.TtimeS = Math.floor(Math.random() * 20) + 60;
}
v3.distanceX = 0;
v3.distanceY = 0;
v3.distanceTotal = 0;
v3.moveDistanceX = 0;
v3.moveDistanceY = 0;
v3.moveX = 0;
v3.moveY = 0;
v3.totalmove = 0;
v3.timeS = 0;
v3.onRollOver = function () {
_global.trgt = this;
};
enemiesArray.push(v3);
++v4;
}
}
function updateEnemies() {
var v3 = 0;
while (v3 < enemiesArray.length) {
var v2 = enemiesArray[v3];
updatePosition(v2, hero);
if (v2.tt == 1) {
if (v2.timeS++ > v2.TtimeS) {
v2.timeS = 0;
placeVolna(v2);
if (_global.Detal == 2) {
placeVolnaboom(v2._x, v2._y);
}
}
}
++v3;
}
}
function updatePosition(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
if (follower.distanceTotal <= follower.agroRange) {
follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = follower.speed * follower.moveX / follower.totalmove;
follower.moveY = follower.speed * follower.moveY / follower.totalmove;
if (follower.mode == 'follow') {
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians;
} else {
if (follower.mode == 'run') {
if (follower._x - follower.moveX >= 0 && follower._x - follower.moveX <= 700) {
follower._x -= follower.moveX;
}
if (follower._y - follower.moveY >= 0 && follower._y - follower.moveY <= 600) {
follower._y -= follower.moveY;
}
follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180;
}
}
}
if (follower._x < 0) {
follower._x = 0;
}
if (follower._x > 700) {
follower._x = 700;
}
if (follower._y < 0) {
follower._y = 0;
}
if (follower._y > 600) {
follower._y = 600;
}
}
function removeEnemy(s) {
var v4 = enemiesArray.length;
while (v4--) {
var v2 = enemiesArray[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
enemiesArray.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function placeSpider(A, B) {
++lev;
var d = spider.duplicateMovieClip('z' + lev, lev);
if (A == 0 && B == 0) {
d._y = fon._y + Math.random() * fon._height;
if (Math.random() < 0.5) {
d._x = fon._x - d._width / 2;
} else {
d._x = fon._x + fon._width + d._width / 2;
}
} else {
d._x = A;
d._y = B;
}
var v6 = hero._x - d._x;
var v5 = hero._y - d._y;
d.a = Math.atan2(v5, v6);
d._rotation = (d.a / Math.PI) * 180;
d.speed = Math.random() * 2 + 2;
d.onEnterFrame = function () {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
this.a = Math.atan2(v5, v6);
this._rotation = (this.a / Math.PI) * 180;
var v8 = Math.sqrt(v6 * v6 + v5 * v5);
if (v8 < 25 && !placed) {
_global.playsfx('hittestmob');
placeBoom2(hero._x, hero._y);
if (!ud) {
var v7 = shild - 10;
if (v7 < 0) {
life += v7;
shild = 0;
} else {
shild -= 10;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = spiders.length;
while (v3--) {
var v4 = spiders[v3];
if (v4 == d) {
spiders.splice(v3, 1);
}
}
v3 = needBePaused.length;
while (v3--) {
v4 = needBePaused[v3];
if (v4 == d) {
needBePaused.splice(v3, 1);
}
}
}
};
d.onRollOver = function () {
_global.trgt = this;
};
spiders.push(d);
d.lif = 3;
}
function removeSpider(s) {
var v4 = spiders.length;
while (v4--) {
var v2 = spiders[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
spiders.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function placeSSpider(A, B) {
++lev;
var Sd = Sspider.duplicateMovieClip('Sz' + lev, lev);
if (A == 0 && B == 0) {
Sd._y = fon._y + Math.random() * fon._height;
if (Math.random() < 0.5) {
Sd._x = fon._x - Sd._width / 2;
} else {
Sd._x = fon._x + fon._width + Sd._width / 2;
}
} else {
Sd._x = A;
Sd._y = B;
}
var v6 = hero._x - Sd._x;
var v7 = hero._y - Sd._y;
Sd.a = Math.atan2(v7, v6);
Sd._rotation = (Sd.a / Math.PI) * 180;
Sd.speed = Math.random() + 0.5;
Sd.timeS = 0;
Sd.TtimeS = Math.floor(Math.random() * 20) + 14;
var back = 0;
Sd.onEnterFrame = function () {
if (back == 0) {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
}
if (back == 2) {
this._x += -this.speed * Math.cos(this.a);
this._y += -this.speed * Math.sin(this.a);
}
var v6 = hero._x - this._x;
var v7 = hero._y - this._y;
this.a = Math.atan2(v7, v6);
this._rotation = (this.a / Math.PI) * 180;
if (this.timeS++ > this.TtimeS) {
this.timeS = 0;
placeEbul(Sd, 1);
}
var v5 = Math.sqrt(v6 * v6 + v7 * v7);
if (v5 < 180) {
if (back == 0) {
back = 1;
}
}
if (v5 < 120) {
back = 2;
}
if (v5 >= 180) {
back = 0;
}
if (v5 < 25 && !Splaced) {
_global.playsfx('hittestmob');
placeBoom2(hero._x, hero._y);
if (!ud) {
var v8 = shild - 15;
if (v8 < 0) {
life += v8;
shild = 0;
} else {
shild -= 15;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Sspiders.length;
while (v3--) {
var v4 = Sspiders[v3];
if (v4 == Sd) {
Sspiders.splice(v3, 1);
}
}
v3 = needBePaused.length;
while (v3--) {
v4 = needBePaused[v3];
if (v4 == Sd) {
needBePaused.splice(v3, 1);
}
}
}
};
Sd.onRollOver = function () {
_global.trgt = this;
};
Sspiders.push(Sd);
Sd.Slif = 5;
}
function removeSSpider(s) {
var v4 = Sspiders.length;
while (v4--) {
var v2 = Sspiders[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
Sspiders.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
stop();
var my_so = SharedObject.getLocal('spiteful_space_save', '/');
_global.MIN = my_so.data.MIN;
_global.GAS = my_so.data.GAS;
_global.BIO = my_so.data.BIO;
_global.rokmax = my_so.data.rokmax;
_global.uR = my_so.data.uR;
_global.uG = my_so.data.uG;
_global.uB = my_so.data.uB;
_global.uRa = my_so.data.uRa;
_global.uE = my_so.data.uE;
_global.uS = my_so.data.uS;
_global.uSt = my_so.data.uSt;
my_so.flush();
_global.perehod = 0;
if (_global.SoundM != false) {
mpause.stop();
msystem.stop();
mmenu.stop();
mbos.stop();
msystem.start(0, 500);
}
_global.sa1 = 1;
_global.sa2 = 1;
_global.sa3 = 1;
var stren = _global.str;
heroab.swapDepths(1000002);
menuab.swapDepths(1000003);
con.swapDepths(1000004);
_global.bio1 = 0;
_global.min1 = 0;
_global.gas1 = 0;
_global.kill1 = 0;
_global.restartlvl = false;
if (_global.systema == 17) {
cap1.cap11.cap111.text = 'SURVIVE FOR 120 SECONDS';
}
if (_global.systema == 18) {
cap1.cap11.cap111.text = 'SURVIVE FOR 140 SECONDS';
}
if (_global.systema == 19) {
cap1.cap11.cap111.text = 'SURVIVE FOR 160 SECONDS';
}
cap1.gotoAndPlay(1);
_global.pauseall = false;
_global.steptmp = 0;
_global.pausetimestart = 0;
_global.pausetimestop = 0;
_global.pausetimeall = 0;
needBePaused = new Array();
_global.addToPause = function (obj) {
if (!obj._inPause) {
needBePaused.push(obj);
obj._inPause = true;
}
};
var koff = 1;
finplay = function () {
finangle += 10;
if (koff < 30) {
koff += 0.5;
}
finr_ang = finangle / 57.29577951308232;
finmc._x = 500 + koff * Math.cos(finr_ang);
finmc._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc._x, finmc._y, 'particle_smoke_clear');
finr_ang = (finangle + 180) / 57.29577951308232;
finmc1._x = 500 + koff * Math.cos(finr_ang);
finmc1._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc1._x, finmc1._y, 'particle_smoke_clear');
};
_global.setPause = function (flag) {
isPause = flag;
var v3 = needBePaused.length;
while (v3--) {
var v2 = needBePaused[v3];
if (flag) {
v2.stop();
v2.oef = v2.onEnterFrame;
v2.onEnterFrame = null;
} else {
v2.onEnterFrame = v2.oef;
v2.play();
}
}
if (flag) {
_global.pausetimestart = int(getTimer() / 1000);
} else {
_global.pausetimestop = int(getTimer() / 1000);
_global.pausetimeall += _global.pausetimestart - _global.pausetimestop;
}
};
min1.text = _global.GAS + '/300';
min2.text = _global.MIN + '/150';
min3.text = _global.BIO + '/50';
samc._width = 0;
samc._x = 350;
var angl = 0;
var Xx = mob1c._x - sun._x;
var Yy = mob1c._y - sun._y;
if (Xx == 0) {
if (Yy >= 0) {
angl = 270;
} else {
angl = 90;
}
} else {
if (Xx > 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433;
} else {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 - 180;
}
}
}
var myList = mob1c.mob1cc.filters;
myList[1].angle = angl;
myList[0].color = 11132159;
mob1c.mob1cc.filters = myList;
_global.SAE = 0;
var SAc = 0;
var ud = false;
var radiu = _global.rad;
var life = _global.arm;
var shild = _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
heroab.h1._width = 50 * _global.arm / 300;
heroab.h2._width = 50 * _global.def / 200;
heroab.h3._width = 50 * _global.spe / 7;
heroab.h4._width = 50 * stren / 2.2;
heroab.h5._width = 50 * _global.rad / 4;
var rok = _global.rokmax;
roketi.ro.text = rok + '/' + _global.rokmax;
_global.step = _global.spe;
var checkup = 1;
var checkup1 = 1;
var rotDirSpeed = 5;
var angle = Math.random() * 100;
var finangle = Math.random() * 100;
var spiderCount = 0;
var SspiderCount = 0;
var lev = 0;
var timeb = int(getTimer() / 100);
var timenasys = int(getTimer() / 1000);
_global.timeall = 0;
var fire = false;
heroab._visible = false;
menuab._visible = false;
con._visible = false;
boom._visible = false;
boom1._visible = false;
boom2._visible = false;
mob1c.thp = 100;
var resp = true;
var respt1 = 35;
var respt2 = 120;
var respt = false;
var end = false;
var end1 = 0;
fafa._visible = false;
var bitmapsArray;
var particleBitmapsArray;
bitmapsArray = ['effect-fire5.png', 'effect-fire6.png', 'effect-fire7.png', 'effect-fire8.png', 'effect-fire9.png'];
particleBitmapsArray = ['particle.jpg', 'particle1.png', 'particle5.png'];
var Gass = new Array();
placeGas = function (A, B) {
++lev;
var d = gas.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.GAS < 300) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Gass.length;
while (v3--) {
var v4 = Gass[v3];
if (v4 == d) {
Gass.splice(v3, 1);
}
}
_global.GAS += 1;
++_global.gas1;
_global.playsfx('collected');
min1.text = _global.GAS + '/300';
}
};
Gass.push(d);
};
var Minerals = new Array();
placeMineral = function (A, B) {
++lev;
var d = mineral.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.MIN < 150) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Minerals.length;
while (v3--) {
var v4 = Minerals[v3];
if (v4 == d) {
Minerals.splice(v3, 1);
}
}
_global.MIN += 1;
++_global.min1;
_global.playsfx('collected');
min2.text = _global.MIN + '/150';
}
};
Minerals.push(d);
};
var Bios = new Array();
placeBio = function (A, B) {
++lev;
var d = bio.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.BIO < 50) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Bios.length;
while (v3--) {
var v4 = Bios[v3];
if (v4 == d) {
Bios.splice(v3, 1);
}
}
_global.BIO += 1;
++_global.bio1;
_global.playsfx('collected');
min3.text = _global.BIO + '/50';
}
};
Bios.push(d);
};
var reloadSpeed = 1000;
var missileSpeed = 7;
var turnRate = 0.7;
var reloadTimer;
var reloadComplete = true;
bulletSpeed = 18;
placeBullet = function (tgt) {
++lev;
_global.playsfx('vistrel');
var v11 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v11);
globalToLocal(v11);
var v10 = bullet.duplicateMovieClip('b' + lev, lev);
v10._x = v11.x;
v10._y = v11.y;
v10._rotation = hero._rotation + hero.body._rotation;
v10.a = (v10._rotation / 180) * Math.PI;
v10.onEnterFrame = function () {
this._x += bulletSpeed * Math.cos(this.a);
this._y += bulletSpeed * Math.sin(this.a);
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.hitTest(sun)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl1)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl2)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl3)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
var v9 = spiders.length;
while (v9--) {
var v3 = spiders[v9];
if (v3.hit.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 5 <= 220) {
SAc += 5;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v3.lif -= _global.rad * stren;
v3._yscale -= 20 * stren;
v3._xscale = v3._yscale;
if (SAE != 2) {
v3.speed -= 0.5 * stren;
}
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeSpider(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
} else {
v3.lif -= stren;
v3._yscale -= 10 * stren;
v3._xscale = v3._yscale;
if (SAE != 2) {
v3.speed -= 0.5 * stren;
}
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeSpider(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
}
}
}
if (mob1c.hitTest(this)) {
_global.playsfx('hit');
if (Math.abs(hero._x - mob1c._x) < 128.5 && Math.abs(hero._y - mob1c._y) < 128.5) {
mob1c.thp -= _global.rad;
mob1c.hp._width -= 0.3 * _global.rad;
} else {
mob1c.thp -= 1;
mob1c.hp._width -= 0.3;
}
if (mob1c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob1c._x, mob1c._y);
placeBoom(mob1c._x, mob1c._y);
placeBoom(mob1c._x, mob1c._y);
mob1c._x += 1000;
resp = false;
}
if (Math.random() < 0.2) {
placeBoom(mob1c._x, mob1c._y);
}
placeBoom1(mob1c._x, mob1c._y);
placeBoom2(mob1c._x, mob1c._y);
this.removeMovieClip();
}
var v7 = enemiesArray.length;
while (v7--) {
var v4 = enemiesArray[v7];
if (v4.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 3 <= 220) {
SAc += 3;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v4._x) < 128.5 && Math.abs(hero._y - v4._y) < 128.5) {
v4.lif -= _global.rad * stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.lif <= 0) {
v4.gotoAndStop(2);
v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeEnemy(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
} else {
v4.lif -= stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.lif <= 0) {
v4.gotoAndStop(2);
v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeEnemy(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
}
}
}
var v8 = Sspiders.length;
while (v8--) {
var v5 = Sspiders[v8];
if (v5.Shit.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 3 <= 220) {
SAc += 3;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v5._x) < 128.5 && Math.abs(hero._y - v5._y) < 128.5) {
v5.Slif -= _global.rad * stren;
this.removeMovieClip();
placeBoom1(v5._x, v5._y);
if (v5.Slif <= 0) {
v5.gotoAndStop(2);
v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
removeSSpider(v5);
++_global.kill1;
placeBoom(v5._x, v5._y);
}
} else {
v5.Slif -= stren;
this.removeMovieClip();
placeBoom1(v5._x, v5._y);
if (v5.Slif <= 0) {
v5.gotoAndStop(2);
v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
removeSSpider(v5);
++_global.kill1;
placeBoom(v5._x, v5._y);
}
}
}
}
};
};
placeVolna = function (tgt, ty) {
++lev;
var v3 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v3);
globalToLocal(v3);
_global.playsfx('volna');
var v4 = volna.duplicateMovieClip('b' + lev, lev);
v4._x = v3.x;
v4._y = v3.y;
v4.onEnterFrame = function () {
if (hero.foot.hitTest(this)) {
if (!ud) {
var v3 = shild - 1;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 1;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
placeBoom1(hero._x, hero._y);
}
};
};
placeEbul = function (tgt, ty) {
++lev;
var v4 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v4);
globalToLocal(v4);
if (ty == 1) {
_global.playsfx('zelenie');
var v3 = ebul.duplicateMovieClip('b' + lev, lev);
if (Math.floor(Math.random() * 2) == 1) {
v3._rotation = tgt._rotation + Math.random() * 10;
} else {
v3._rotation = tgt._rotation - Math.random() * 10;
}
v3.tt = 1;
v3.bsp = 10;
}
if (ty == 2) {
v3 = lazer.duplicateMovieClip('b' + lev, lev);
v3._rotation = tgt._rotation;
v3.tt = 3;
v3.bsp = 5;
}
if (ty == 3) {
v3 = little.duplicateMovieClip('b' + lev, lev);
v3._x = v4.x;
v3._y = v4.y;
v3._rotation = Math.atan2(hero._y - v3._y, hero._x - v3._x) * 57.29577951308232;
v3.tt = 2;
v3.bsp = 16;
}
v3._x = v4.x;
v3._y = v4.y;
v3.a = (v3._rotation / 180) * Math.PI;
v3.onEnterFrame = function () {
if (this.tt == 1) {
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this.tt == 3) {
this.bsp += 0.3;
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this.bsp += 0.3;
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this.tt == 2) {
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.tt != 3) {
if (this.hitTest(sun)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl1)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl2)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl3)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
}
if (hero.foot.hitTest(this)) {
_global.playsfx('hitme');
if (!ud) {
if (this.tt == 1 || this.tt == 3) {
var v3 = shild - 5;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 5;
}
}
if (this.tt == 2) {
v3 = shild - 1;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 1;
}
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
placeBoom1(hero._x, hero._y);
this.removeMovieClip();
}
};
};
var enemiesArray = new Array();
var radians = 57.29577951308232;
createEnemies(3, 'typeA', 'e1');
var spiders = new Array();
var Sspiders = new Array();
i = 5;
while (i--) {
placeSSpider(Math.floor(Math.random() * 200) + 500, Math.floor(Math.random() * 200) + 200);
}
i = 10;
while (i--) {
placeSpider(Math.floor(Math.random() * 200) + 500, Math.floor(Math.random() * 200) + 200);
}
onEnterFrame = function () {
var v11 = 0;
var v12 = hero.foot._x - sun._x;
var v14 = hero.foot._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
var v16 = hero.foot.filters;
v16[1].angle = v11;
hero.foot.filters = v16;
v11 = 0;
v12 = pl2._x - sun._x;
v14 = pl2._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = pl2.filters;
v16[1].angle = v11;
pl2.filters = v16;
v11 = 0;
v12 = pl1._x - sun._x;
v14 = pl1._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = pl1.filters;
v16[1].angle = v11;
pl1.filters = v16;
v11 = 0;
v12 = pl3._x - sun._x;
v14 = pl3._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = pl3.filters;
v16[1].angle = v11;
pl3.filters = v16;
if (Key.isDown(16) && !_global.pauseall) {
if (_global.trgt._width) {
fireWeapon(_global.trgt);
}
}
if (Key.isDown(32) && _global.SAE == 1 && !_global.pauseall) {
sap._alpha = 100;
_global.SAE = 2;
_global.playsfx('sastart');
if (_global.perstype == 1) {
stren *= 3;
cap1.cap11.cap111.text = 'EAGLE EYE!';
cap1.gotoAndPlay(1);
var v13 = hero.foot.filters;
v13[1].color = 16711680;
hero.foot.filters = v13;
}
if (_global.perstype == 3) {
_global.sa3 = 0.5;
_global.rad = 1;
cap1.cap11.cap111.text = 'NEUTRON ACCELERATION!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 2) {
var v8 = spiders.length;
while (v8--) {
var v6 = spiders[v8];
v6.speed *= 0.2;
}
v8 = Sspiders.length;
while (v8--) {
v6 = Sspiders[v8];
v6.speed *= 0.2;
}
v8 = enemiesArray.length;
while (v8--) {
v6 = enemiesArray[v8];
v6.speed *= 0.2;
}
_global.sa2 = 0.2;
cap1.cap11.cap111.text = 'TIME BOMB!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 5) {
ud = true;
cap1.cap11.cap111.text = 'ULTIMATE DEFENCE!';
cap1.gotoAndPlay(1);
v13 = hero.foot.filters;
v13[2].strength = 2;
hero.foot.filters = v13;
}
if (_global.perstype == 4) {
var v7 = enemiesArray.length;
while (v7--) {
var v3 = enemiesArray[v7];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
var v5 = 0.5;
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeEnemy(v3);
++_global.kill1;
}
}
v7 = spiders.length;
while (v7--) {
v3 = spiders[v7];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v5 = 0.5;
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeSpider(v3);
++_global.kill1;
}
}
v7 = Sspiders.length;
while (v7--) {
v3 = Sspiders[v7];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v5 = 0.5;
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeSSpider(v3);
++_global.kill1;
}
}
hero.zone._alpha = 85;
SAc = 32;
cap1.cap11.cap111.text = 'ANNIHILATING FLASH!';
cap1.gotoAndPlay(1);
}
}
if ((Key.isDown(37) || Key.isDown(65)) && !_global.pauseall) {
hero._rotation -= rotDirSpeed;
} else {
if ((Key.isDown(39) || Key.isDown(68)) && !_global.pauseall) {
hero._rotation += rotDirSpeed;
}
}
var v19 = _xmouse - hero._x;
var v17 = _ymouse - hero._y;
var v18 = Math.atan2(v17, v19);
hero.body._rotation = -hero._rotation + (v18 / Math.PI) * 180;
var v10 = (hero._rotation / 180) * Math.PI;
if ((Key.isDown(38) || Key.isDown(87)) && !_global.pauseall) {
if (_global.step < 5) {
_global.step += 0.1;
}
if (checkup1 == 2) {
_global.step = 2;
checkup1 = 1;
}
hero.foot.play();
checkup = 1;
hero._x += _global.step * Math.cos(v10);
hero._y += _global.step * Math.sin(v10);
} else {
if (checkup == 1 && _global.step > 0) {
hero._x += _global.step * Math.cos(v10);
hero._y += _global.step * Math.sin(v10);
_global.step -= 0.1;
} else {
if (checkup == 2 && _global.step > 0) {
hero._x -= _global.step * Math.cos(v10);
hero._y -= _global.step * Math.sin(v10);
_global.step -= 0.1;
} else {
hero.foot.stop;
}
}
}
if (hero._x < 0) {
hero._x = 0;
}
if (hero._x > 700) {
hero._x = 700;
}
if (hero._y < 0) {
hero._y = 0;
}
if (hero._y > 600) {
hero._y = 600;
}
if (!_global.pauseall) {
angle += 0.2;
}
r_ang = angle / 57.29577951308232;
pl1._x = 317 + 100 * Math.cos(r_ang * 3);
pl1._y = 245 + 100 * Math.sin(r_ang * 3);
pl2._x = 317 + 200 * Math.cos(r_ang * 2);
pl2._y = 245 + 200 * Math.sin(r_ang * 2);
pl3._x = 317 + 300 * Math.cos(r_ang);
pl3._y = 245 + 200 * Math.sin(r_ang);
if (hero.foot.hitTest(sun) && !_global.pauseall) {
if (ud) {
if (shild + 1 > _global.def) {
shild = _global.def;
} else {
shild += 1;
}
} else {
if (shild + 5 > _global.def) {
shild = _global.def;
} else {
shild += 5;
}
life -= 1;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
if (spiderCount++ > respt1 && resp && _global.SAE != 2 && !_global.pauseall) {
spiderCount = 0;
placeSpider(0, 0);
}
if (SspiderCount++ > respt2 && resp && _global.SAE != 2 && !_global.pauseall) {
SspiderCount = 0;
placeSSpider(0, 0);
}
timebb = int(getTimer() / 100) - timeb;
if (fire && timebb >= 2 * _global.sa3) {
if (_global.uG == 1) {
placeBullet(hero.body.dot);
}
if (_global.uG == 2) {
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
if (_global.uG == 3) {
placeBullet(hero.body.dot);
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
timeb = int(getTimer() / 100);
}
if (_global.SAE == 2) {
if (SAc - 2 <= 0) {
SAc = 0;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 0;
sap._alpha = 0;
if (_global.perstype == 5) {
ud = false;
v13 = hero.foot.filters;
v13[2].strength = 0;
hero.foot.filters = v13;
}
if (_global.perstype == 1) {
stren /= 3;
v13 = hero.foot.filters;
v13[1].color = 16777215;
hero.foot.filters = v13;
}
if (_global.perstype == 3) {
_global.sa3 = 1;
_global.rad = radiu;
}
if (_global.perstype == 2) {
v8 = spiders.length;
while (v8--) {
v6 = spiders[v8];
v6.speed *= 5;
}
v8 = Sspiders.length;
while (v8--) {
v6 = Sspiders[v8];
v6.speed *= 5;
}
v8 = enemiesArray.length;
while (v8--) {
v6 = enemiesArray[v8];
v6.speed *= 5;
}
_global.sa2 = 1;
}
if (_global.perstype == 4) {
hero.zone._alpha = 5;
}
} else {
if (!_global.pauseall) {
SAc -= 2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
if (_global.perstype == 4) {
hero.zone._alpha -= 5;
}
if (_global.perstype == 2) {
if (shild + 2 > _global.def) {
shild = _global.def;
} else {
shild += 2;
}
shilds._width = 183 * shild / _global.def;
teshi.text = 'shield ' + shild + '%';
}
}
}
}
if (_global.step > 0) {
placeFire(hero.sop);
}
if (resp == false && !end) {
if (spiders.length == 0 && Sspiders.length == 0 && enemiesArray.length == 0) {
cap1.cap11.cap111.text = 'SYSTEM NOW FREE, GOOD JOB!';
cap1.gotoAndPlay(1);
_global.playsfx('openportal');
_global.trgt = null;
fin._x = 500;
fin._y = 430;
fin.gotoAndPlay(1);
var v15 = new flash.filters.GlowFilter();
var v4 = pl1.filters;
v4.push(v15);
v4[2].blurY = 0;
v4[2].blurX = 0;
v4[2].quality = 100;
v4[2].color = 3329279;
pl1.filters = v4;
v4 = pl2.filters;
v4.push(v15);
v4[2].blurY = 0;
v4[2].blurX = 0;
pl2.filters = v4;
v4 = pl3.filters;
v4.push(v15);
v4[2].blurY = 0;
v4[2].blurX = 0;
pl3.filters = v4;
end1 = 8;
end = true;
}
}
if (end1 > 0) {
end1 -= 0.1;
v4 = pl1.filters;
v4[2].blurY = 8 - end1;
v4[2].blurX = v4[2].blurY;
v4[2].strength = (8 - end1) / 5;
pl1.filters = v4;
v4 = pl2.filters;
v4[2].blurY = 8 - end1;
v4[2].blurX = v4[2].blurY;
v4[2].strength = (8 - end1) / 5;
pl2.filters = v4;
v4 = pl3.filters;
v4[2].blurY = 8 - end1;
v4[2].blurX = v4[2].blurY;
v4[2].strength = (8 - end1) / 5;
pl3.filters = v4;
}
if (end) {
finplay();
}
if (!end && !_global.pauseall) {
_global.timeall = int(getTimer() / 1000) - timenasys + _global.pausetimeall;
systime.text = _global.timeall;
}
if (hero.foot.hitTest(fin.endss.ends) && !_global.pauseall) {
msystem.stop();
_global.playsfx('win');
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.SAE == 0 && !_global.pauseall) {
if (SAc + 0.2 <= 220) {
SAc += 0.2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
_global.playsfx(saready);
}
}
if (_global.trgt._width && !_global.pauseall) {
trg._x = _global.trgt._x;
trg._y = _global.trgt._y;
} else {
trg._x = 1000;
trg._y = 1000;
}
if (!_global.pauseall) {
updateEnemies();
}
if (_global.timeall == 30) {
respt1 = 25;
respt2 = 100;
}
if (_global.timeall == 60) {
respt1 = 20;
respt2 = 90;
}
if (_global.timeall == 100) {
respt1 = 15;
respt2 = 70;
}
if (_global.timeall == 116 && !respt) {
respt = true;
i = 20;
if (_global.systema == 18 || _global.systema == 19) {
i = 8;
}
while (i--) {
placeSpider(0, 0);
}
i = 10;
if (_global.systema == 18 || _global.systema == 19) {
i = 4;
}
while (i--) {
placeSSpider(0, 0);
}
}
if (_global.timeall == 120) {
if (_global.systema == 17) {
resp = false;
} else {
respt = false;
}
}
if (_global.systema != 17) {
if (_global.timeall == 136 && !respt) {
respt = true;
i = 20;
if (_global.systema == 19) {
i = 8;
}
while (i--) {
placeSpider(0, 0);
}
i = 10;
if (_global.systema == 19) {
i = 4;
}
while (i--) {
placeSSpider(0, 0);
}
}
if (_global.timeall == 140) {
if (_global.systema == 18) {
resp = false;
} else {
respt = false;
}
}
}
if (_global.systema == 19) {
if (_global.timeall == 156 && !respt) {
respt = true;
i = 20;
while (i--) {
placeSpider(0, 0);
}
i = 10;
while (i--) {
placeSSpider(0, 0);
}
}
if (_global.timeall == 160) {
resp = false;
}
}
if (_global.restartlvl) {
var v9 = lev + 1;
while (v9--) {
removeMovieClip(_root.getInstanceAtDepth(v9));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(11);
}
if (life < 0 && !_global.pauseall) {
_global.playsfx('exp');
msystem.stop();
mbos.stop();
_global.playsfx('win');
lifes._width = 0;
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
placeBoom(hero._x, hero._y);
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.perehod == 1) {
gotoAndPlay(5);
}
if (_global.perehod == 2) {
v9 = lev + 1;
while (v9--) {
removeMovieClip(_root.getInstanceAtDepth(v9));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(1);
}
};
onMouseDown = function () {
if (!_global.pauseall) {
fire = true;
}
};
onMouseUp = function () {
fire = false;
};
}
movieClip 1167 {
}
frame 12 {
function placeFire(tgt) {
var v3 = 0;
while (v3 < 3) {
++lev;
if (lev > 1000000) {
lev = 0;
}
var v2 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v2);
globalToLocal(v2);
var v1 = fafa.duplicateMovieClip('f' + lev, lev);
if (Math.random() > 0.5) {
v1._x = v2.x + Math.random() * 2 - 1;
} else {
v1._x = v2.x - Math.random() * 2 - 1;
}
if (Math.random() > 0.5) {
v1._y = v2.y + Math.random() * 2 - 1;
} else {
v1._y = v2.y - Math.random() * 2 - 1;
}
v1._alpha = Math.random() * 50 + 50;
v1._yscale = Math.random() * 50 + 70;
v1._xscale = v1._yscale;
++v3;
}
}
function placeBoom(x, y) {
++lev;
var v3 = boom.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom1(x, y) {
++lev;
var v3 = boom1.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom2(x, y) {
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function createExplosion(targetX, targetY, targetPath, explosionParticleAmount, explosionParticleRange, particleSize, speed, speedAlpha) {
var v7 = 0;
while (v7 < explosionParticleAmount) {
var v8 = bitmapsArray[random(bitmapsArray.length)];
var v4 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder' + lev, lev);
++lev;
var v3 = v2.createEmptyMovieClip('internal_holder', lev);
v3._x = -v4.width / 2;
v3._y = -v4.height / 2;
++lev;
v3.attachBitmap(v4, lev, 'never');
v2._x = targetX + random(explosionParticleRange) - explosionParticleRange / 2;
v2._y = targetY + random(explosionParticleRange) - explosionParticleRange / 2;
var v6 = random(particleSize);
v2._xscale = v6;
v2._yscale = v6;
v2.speed = random(speed) + speed;
v2.speedAlpha = random(speedAlpha) + speedAlpha;
v2.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speedAlpha;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
++v7;
}
}
function createParticles(targetX, targetY, targetPath, tempParticle_mcAmount, tempParticle_mcRange, particleSize, tempParticle_mcMaxSpeed, tempParticle_mcMaxFadeSpeed) {
var v7 = 0;
while (v7 < tempParticle_mcAmount) {
var v8 = particleBitmapsArray[random(particleBitmapsArray.length)];
var v5 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder', lev);
++lev;
var v4 = v2.createEmptyMovieClip('internal_holder', lev);
v4._x = -v5.width / 2;
v4._y = -v5.height / 2;
++lev;
v4.attachBitmap(v5, lev, 'never');
v2._x = targetX;
v2._y = targetY;
v2._rotation = random(360);
v2._alpha = random(50) + 50;
v2._xscale = particleSize;
v2._yscale = particleSize;
v2.boundyLeft = targetX - tempParticle_mcRange;
v2.boundyTop = targetY - tempParticle_mcRange;
v2.boundyRight = targetX + tempParticle_mcRange;
v2.boundyBottom = targetY + tempParticle_mcRange;
v2.speedX = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedY = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedX *= tempParticle_mcMaxSpeed;
v2.speedY *= tempParticle_mcMaxSpeed;
v2.fadeSpeed = Math.random(tempParticle_mcMaxFadeSpeed) * tempParticle_mcMaxFadeSpeed;
v2.onEnterFrame = function () {
this._alpha -= this.fadeSpeed;
this._x += this.speedX;
this._y += this.speedY;
if (this._alpha <= 0 || this._x < this.boundyLeft || this._x > this.boundyRight || this._y < this.boundyTop || this._y > this.boundyBottom) {
this.removeMovieClip();
}
};
++v7;
}
}
function placeVolnaboom(x, y) {
++lev;
var v1 = volnaboom.duplicateMovieClip('b' + lev, lev);
v1._x = x;
v1._y = y;
}
function fireLight(xStart, yStart, xEnd, yEnd) {
++lev;
_global.playsfx('molniya');
var temp = effectHolder.duplicateMovieClip('efho' + lev, lev);
temp.time = 5;
temp.onEnterFrame = function () {
temp.clear();
temp.lineStyle(lightningWidth, lightningColor, lightningAlpha, true);
var v13 = xStart - xEnd;
var v11 = yStart - yEnd;
var v12 = Math.sqrt(v13 * v13 + v11 * v11);
var v9 = v12 / lightningFrequency;
var v3 = Math.atan2(yStart - yEnd, xStart - xEnd);
var v10 = v12 / v9;
var v8 = 0;
while (v8 < lightningBranches) {
temp.moveTo(xStart, yStart);
var v2 = 1;
while (v2 < v9 + 1) {
var v5 = v10 * v2;
var v4 = random(lightningOffset - lightningOffset / 2);
var v6 = xStart - Math.cos(v3) * v5 + Math.cos(v3 + 1.55) * v4;
var v7 = yStart - Math.sin(v3) * v5 + Math.sin(v3 + 1.55) * v4;
temp.lineTo(v6, v7);
++v2;
}
++v8;
}
if (this.time-- <= 0) {
temp.removeMovieClip();
}
};
temp.lineTo(xEnd, yEnd);
addSparkles(xEnd, yEnd, sparkNumber, sparkDistance, sparkSize);
}
function startLReloading(a) {
reloadLComplete = false;
reloadLTimer = setInterval(this, 'gunLReloaded', reloadLSpeed);
screenLTimer = setInterval(this, 'clearScreen', clearSpeed);
}
function clearScreen() {
clearInterval(screenTimer);
delete effectHolder.onEnterFrame;
effectHolder.clear();
}
function gunLReloaded() {
clearInterval(reloadLTimer);
reloadLComplete = true;
}
function addSparkles(_targetX, _targetY, _sparkNumber, _distance, _sparkSize) {
var v6 = 0;
while (v6 < _sparkNumber) {
var v4 = _root.attachMovie('spark', 'spark_' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
var v3 = _root.attachMovie('spark2', 'spark2_' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v4._x = _targetX + random(_distance) - _distance / 2;
v4._y = _targetY + random(_distance) - _distance / 2;
v3._x = _targetX + random(_distance) - _distance / 2;
v3._y = _targetY + random(_distance) - _distance / 2;
var v5 = random(_sparkSize) + _sparkSize / 4;
v4._xscale = v5;
v4._yscale = v5;
v5 = random(_sparkSize) + _sparkSize / 4;
v3._xscale = v5;
v3._yscale = v5;
v3._rotation = random(359);
v4._alpha = lightningAlpha;
v3._alpha = lightningAlpha;
++v6;
}
}
function fireWeapon(target, who) {
if (reloadComplete == true && rok > 0 || who != hero) {
++lev;
_global.playsfx('raketa');
if (who == hero) {
var v3 = missile.duplicateMovieClip('missile' + lev, lev);
} else {
var v3 = miss.duplicateMovieClip('miss' + lev, lev);
}
v3._x = who._x;
v3._y = who._y;
v3._rotation = who._rotation;
v3.targetX = target._x;
v3.targetY = target._y;
v3.tar = target;
v3.moveX = 0;
v3.moveY = 0;
v3.onEnterFrame = function () {
doFollow(this, this.tar);
};
if (who == hero) {
roketi._alpha = 30;
rok -= 1;
roketi.ro.text = rok + '/' + _global.rokmax;
startReloading();
}
} else {
_global.playsfx('noroket');
}
}
function startReloading() {
reloadComplete = false;
reloadTimer = setInterval(this, 'gunReloaded', reloadSpeed);
}
function gunReloaded() {
clearInterval(reloadTimer);
if (rok > 0) {
roketi._alpha = 75;
}
reloadComplete = true;
}
function doFollow(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
follower.moveDistanceX = turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = missileSpeed * follower.moveX / follower.totalmove;
follower.moveY = missileSpeed * follower.moveY / follower.totalmove;
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = 180 * Math.atan2(follower.moveY, follower.moveX) / Math.PI;
doTrail(follower._x, follower._y, 'particle_smoke_clear');
var v5 = follower._x - target._x;
var v4 = follower._y - target._y;
var v7 = Math.sqrt(v5 * v5 + v4 * v4);
if (v7 < 15 && target != hero) {
placeBoom(target._x, target._y);
i = Sspiders.length;
while (i--) {
c = Sspiders[i];
if (c == target) {
removeSSpider(c);
++_global.kill1;
}
}
i = enemiesArray.length;
while (i--) {
c = enemiesArray[i];
if (c == target) {
removeEnemy(c);
++_global.kill1;
}
}
if (target == mob1c) {
_global.playsfx('hit');
mob1c.thp -= 10;
mob1c.hp._width -= 3;
if (mob1c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob1c._x, mob1c._y);
placeBoom(mob1c._x, mob1c._y);
placeBoom(mob1c._x, mob1c._y);
mob1c._x += 1000;
resp = false;
}
}
if (target == mob2c) {
_global.playsfx('hit');
mob2c.thp -= 10;
mob2c.hp._width -= 3;
if (mob2c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob2c._x, mob2c._y);
placeBoom(mob2c._x, mob2c._y);
placeBoom(mob2c._x, mob2c._y);
mob2c._x += 1000;
resp2 = false;
}
}
removeMovieClip(target);
removeMovieClip(follower);
}
if (v7 < 15 && target) {
_global.playsfx('hitme');
if (!ud) {
var v6 = shild - 3;
if (v6 < 0) {
life += v6;
shild = 0;
} else {
shild -= 3;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
removeMovieClip(follower);
}
if (follower.hitTest(sun)) {
_global.playsfx('hit');
placeBoom1(follower._x, follower._y);
removeMovieClip(follower);
}
if (!target._x) {
removeMovieClip(follower);
delete follower.onEnterFrame;
}
}
function doTrail(targetX, targetY, type) {
++lev;
var v3 = _root.attachMovie(type, type + lev, lev);
v3._x = targetX;
v3._y = targetY;
v3._rotation = random(360);
randomScale = random(75) + 25;
v3._xscale = randomScale;
randomScale = random(75) + 25;
v3._yscale = randomScale;
v3.speed = random(10) + 5;
updateAfterEvent();
v3.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speed;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
}
function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip, Q, W) {
var v4 = 0;
while (v4 < enemyAmount) {
++lev;
if (enemyLibraryClip == 'e1') {
var v3 = enemA.duplicateMovieClip('ee' + lev, lev);
}
if (enemyLibraryClip == 'e4') {
v3 = enemD.duplicateMovieClip('ee' + lev, lev);
}
if (Q == 0 && W == 0) {
v3._x = random(Stage.width);
v3._y = random(Stage.height);
} else {
v3._x = Q;
v3._y = W;
}
v3._rotation = random(360);
if (enemyBehavior == 'typeA') {
v3.speed = Math.random() + 1;
v3.turnRate = 0.1;
v3.agroRange = 300;
v3.mode = 'follow';
v3.lif = 10;
v3.tt = 1;
v3.TtimeS = Math.floor(Math.random() * 20) + 60;
} else {
if (enemyBehavior == 'typeD') {
v3.speed = Math.random() * 4 + 1;
v3.turnRate = 0.5;
v3.agroRange = 300;
v3.mode = 'follow';
v3.lif = 20;
v3.tt = 4;
v3.TtimeS = Math.floor(Math.random() * 20) + 20;
}
}
v3.distanceX = 0;
v3.distanceY = 0;
v3.distanceTotal = 0;
v3.moveDistanceX = 0;
v3.moveDistanceY = 0;
v3.moveX = 0;
v3.moveY = 0;
v3.totalmove = 0;
v3.timeS = 0;
v3.onRollOver = function () {
_global.trgt = this;
};
enemiesArray.push(v3);
++v4;
}
}
function updateEnemies() {
var v3 = 0;
while (v3 < enemiesArray.length) {
var v2 = enemiesArray[v3];
updatePosition(v2, hero);
if (v2.tt == 1) {
if (v2.timeS++ > v2.TtimeS) {
v2.timeS = 0;
placeVolna(v2);
if (_global.Detal == 2) {
placeVolnaboom(v2._x, v2._y);
}
}
}
if (v2.tt == 4) {
if (v2.timeS++ > v2.TtimeS) {
if (Math.abs(hero._x - v2._x) < 150 && Math.abs(hero._y - v2._y) < 150) {
v2.timeS = 0;
fireLight(v2._x, v2._y, hero._x, hero._y);
if (!ud) {
var v4 = shild - 3;
if (v4 < 0) {
life += v4;
shild = 0;
} else {
shild -= 3;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
}
}
}
++v3;
}
}
function updatePosition(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
if (follower.distanceTotal <= follower.agroRange) {
follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = follower.speed * follower.moveX / follower.totalmove;
follower.moveY = follower.speed * follower.moveY / follower.totalmove;
if (follower.mode == 'follow') {
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians;
} else {
if (follower.mode == 'run') {
if (follower._x - follower.moveX >= 0 && follower._x - follower.moveX <= 700) {
follower._x -= follower.moveX;
}
if (follower._y - follower.moveY >= 0 && follower._y - follower.moveY <= 600) {
follower._y -= follower.moveY;
}
follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180;
}
}
}
if (follower._x < 0) {
follower._x = 0;
}
if (follower._x > 700) {
follower._x = 700;
}
if (follower._y < 0) {
follower._y = 0;
}
if (follower._y > 600) {
follower._y = 600;
}
}
function removeEnemy(s) {
var v4 = enemiesArray.length;
while (v4--) {
var v2 = enemiesArray[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
enemiesArray.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function placeSSpider(A, B, TT) {
++lev;
if (TT == 2) {
var Sd = Sspider2.duplicateMovieClip('Sz' + lev, lev);
} else {
var Sd = Sspider.duplicateMovieClip('Sz' + lev, lev);
}
if (A == 0 && B == 0) {
Sd._y = fon._y + Math.random() * fon._height;
if (Math.random() < 0.5) {
Sd._x = fon._x - Sd._width / 2;
} else {
Sd._x = fon._x + fon._width + Sd._width / 2;
}
} else {
Sd._x = A;
Sd._y = B;
}
var v6 = hero._x - Sd._x;
var v7 = hero._y - Sd._y;
Sd.a = Math.atan2(v7, v6);
Sd._rotation = (Sd.a / Math.PI) * 180;
Sd.speed = Math.random() + 0.5;
Sd.TY = TT;
Sd.timeS = 0;
if (TT == 1) {
Sd.TtimeS = Math.floor(Math.random() * 20) + 14;
} else {
Sd.TtimeS = Math.floor(Math.random() * 40) + 40;
}
var back = 0;
Sd.onEnterFrame = function () {
if (back == 0) {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
}
if (back == 2) {
this._x += -this.speed * Math.cos(this.a);
this._y += -this.speed * Math.sin(this.a);
}
var v6 = hero._x - this._x;
var v7 = hero._y - this._y;
this.a = Math.atan2(v7, v6);
this._rotation = (this.a / Math.PI) * 180;
if (this.timeS++ > this.TtimeS) {
this.timeS = 0;
if (this.TY == 1) {
placeEbul(Sd, 1);
} else {
fireWeapon(hero, this);
}
}
var v5 = Math.sqrt(v6 * v6 + v7 * v7);
if (v5 < 180) {
if (back == 0) {
back = 1;
}
}
if (v5 < 120) {
back = 2;
}
if (v5 >= 180) {
back = 0;
}
if (v5 < 25 && !Splaced) {
_global.playsfx('hittestmob');
placeBoom2(hero._x, hero._y);
if (!ud) {
var v8 = shild - 15;
if (v8 < 0) {
life += v8;
shild = 0;
} else {
shild -= 15;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Sspiders.length;
while (v3--) {
var v4 = Sspiders[v3];
if (v4 == Sd) {
Sspiders.splice(v3, 1);
}
}
v3 = needBePaused.length;
while (v3--) {
v4 = needBePaused[v3];
if (v4 == Sd) {
needBePaused.splice(v3, 1);
}
}
}
};
Sd.onRollOver = function () {
_global.trgt = this;
};
Sspiders.push(Sd);
Sd.Slif = 5;
}
function removeSSpider(s) {
var v4 = Sspiders.length;
while (v4--) {
var v2 = Sspiders[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
Sspiders.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
stop();
var my_so = SharedObject.getLocal('spiteful_space_save', '/');
_global.MIN = my_so.data.MIN;
_global.GAS = my_so.data.GAS;
_global.BIO = my_so.data.BIO;
_global.rokmax = my_so.data.rokmax;
_global.uR = my_so.data.uR;
_global.uG = my_so.data.uG;
_global.uB = my_so.data.uB;
_global.uRa = my_so.data.uRa;
_global.uE = my_so.data.uE;
_global.uS = my_so.data.uS;
_global.uSt = my_so.data.uSt;
my_so.flush();
_global.perehod = 0;
if (_global.SoundM != false) {
mpause.stop();
msystem.stop();
mmenu.stop();
mbos.stop();
msystem.start(0, 500);
}
_global.sa1 = 1;
_global.sa2 = 1;
_global.sa3 = 1;
var stren = _global.str;
heroab.swapDepths(1000002);
menuab.swapDepths(1000003);
con.swapDepths(1000004);
_global.bio1 = 0;
_global.min1 = 0;
_global.gas1 = 0;
_global.kill1 = 0;
_global.restartlvl = false;
_global.pauseall = false;
_global.steptmp = 0;
_global.pausetimestart = 0;
_global.pausetimestop = 0;
_global.pausetimeall = 0;
needBePaused = new Array();
_global.addToPause = function (obj) {
if (!obj._inPause) {
needBePaused.push(obj);
obj._inPause = true;
}
};
var koff = 1;
var finangle = Math.random() * 100;
finplay = function () {
finangle += 10;
if (koff < 30) {
koff += 0.5;
}
finr_ang = finangle / 57.29577951308232;
finmc._x = 500 + koff * Math.cos(finr_ang);
finmc._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc._x, finmc._y, 'particle_smoke_clear');
finr_ang = (finangle + 180) / 57.29577951308232;
finmc1._x = 500 + koff * Math.cos(finr_ang);
finmc1._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc1._x, finmc1._y, 'particle_smoke_clear');
};
_global.setPause = function (flag) {
isPause = flag;
var v3 = needBePaused.length;
while (v3--) {
var v2 = needBePaused[v3];
if (flag) {
v2.stop();
v2.oef = v2.onEnterFrame;
v2.onEnterFrame = null;
} else {
v2.onEnterFrame = v2.oef;
v2.play();
}
}
if (flag) {
_global.pausetimestart = int(getTimer() / 1000);
} else {
_global.pausetimestop = int(getTimer() / 1000);
_global.pausetimeall += _global.pausetimestart - _global.pausetimestop;
}
};
_global.planet = 0;
min1.text = _global.GAS + '/300';
min2.text = _global.MIN + '/150';
min3.text = _global.BIO + '/50';
samc._width = 0;
samc._x = 350;
var angl = 0;
var Xx = mob1c._x - sun._x;
var Yy = mob1c._y - sun._y;
if (Xx == 0) {
if (Yy >= 0) {
angl = 270;
} else {
angl = 90;
}
} else {
if (Xx > 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433;
} else {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 - 180;
}
}
}
var myList = mob1c.mob1cc.filters;
myList[1].angle = angl;
myList[0].color = 16777137;
mob1c.mob1cc.filters = myList;
var angl = 0;
var Xx = mob2c._x - sun._x;
var Yy = mob2c._y - sun._y;
if (Xx == 0) {
if (Yy >= 0) {
angl = 270;
} else {
angl = 90;
}
} else {
if (Xx > 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433;
} else {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 - 180;
}
}
}
var myList = mob2c.mob1cc.filters;
myList[1].angle = angl;
myList[0].color = 16777137;
mob2c.mob1cc.filters = myList;
_global.SAE = 0;
var SAc = 0;
var ud = false;
var radiu = _global.rad;
var life = _global.arm;
var shild = _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
heroab.h1._width = 50 * _global.arm / 300;
heroab.h2._width = 50 * _global.def / 200;
heroab.h3._width = 50 * _global.spe / 7;
heroab.h4._width = 50 * stren / 2.2;
heroab.h5._width = 50 * _global.rad / 4;
var rok = _global.rokmax;
roketi.ro.text = rok + '/' + _global.rokmax;
_global.step = _global.spe;
var checkup = 1;
var checkup1 = 1;
var rotDirSpeed = 5;
var angle = Math.random() * 100;
var sCount = 0;
var eneCount = 0;
var lev = 0;
var timeb = int(getTimer() / 100);
var timenasys = int(getTimer() / 1000);
_global.timeall = 0;
var fire = false;
heroab._visible = false;
menuab._visible = false;
con._visible = false;
boom._visible = false;
boom1._visible = false;
boom2._visible = false;
mob1c.thp = 100;
mob2c.thp = 100;
var resp = true;
var resp2 = true;
var end = false;
var end1 = 0;
fafa._visible = false;
var bitmapsArray;
var particleBitmapsArray;
bitmapsArray = ['effect-fire5.png', 'effect-fire6.png', 'effect-fire7.png', 'effect-fire8.png', 'effect-fire9.png'];
particleBitmapsArray = ['particle.jpg', 'particle1.png', 'particle5.png'];
var Gass = new Array();
placeGas = function (A, B) {
++lev;
var d = gas.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.GAS < 300) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Gass.length;
while (v3--) {
var v4 = Gass[v3];
if (v4 == d) {
Gass.splice(v3, 1);
}
}
_global.GAS += 1;
++_global.gas1;
_global.playsfx('collected');
min1.text = _global.GAS + '/300';
}
};
Gass.push(d);
};
var Minerals = new Array();
placeMineral = function (A, B) {
++lev;
var d = mineral.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.MIN < 150) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Minerals.length;
while (v3--) {
var v4 = Minerals[v3];
if (v4 == d) {
Minerals.splice(v3, 1);
}
}
_global.MIN += 1;
++_global.min1;
_global.playsfx('collected');
min2.text = _global.MIN + '/150';
}
};
Minerals.push(d);
};
var Bios = new Array();
placeBio = function (A, B) {
++lev;
var d = bio.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.BIO < 50) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Bios.length;
while (v3--) {
var v4 = Bios[v3];
if (v4 == d) {
Bios.splice(v3, 1);
}
}
_global.BIO += 1;
++_global.bio1;
_global.playsfx('collected');
min3.text = _global.BIO + '/50';
}
};
Bios.push(d);
};
var lightningOffset = 12;
var lightningFrequency = 12;
var lightningWidth = 1;
var lightningColor = '0x5C98EF';
var lightningAlpha = 75;
var lightningBranches = 3;
var sparkNumber = 10;
var sparkDistance = 20;
var sparkSize = 100;
var reloadLSpeed = 200;
var clearSpeed = 200;
var glow_color = lightningColor;
var glow_alpha = 0.6;
var glow_blurX = 5;
var glow_blurY = 5;
var glow_strength = 2;
var glow_quality = 3;
var reloadLTimer;
var screenTimer;
var reloadLComplete = true;
var rotationLDirection;
var filter_glow = new flash.filters.GlowFilter(glow_color, glow_alpha, glow_blurX, glow_blurY, glow_strength, glow_quality);
effectHolder.filters = [filter_glow];
var reloadSpeed = 1000;
var missileSpeed = 7;
var turnRate = 0.7;
var reloadTimer;
var reloadComplete = true;
bulletSpeed = 18;
placeBullet = function (tgt) {
++lev;
_global.playsfx('vistrel');
var v9 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v9);
globalToLocal(v9);
var v8 = bullet.duplicateMovieClip('b' + lev, lev);
v8._x = v9.x;
v8._y = v9.y;
v8._rotation = hero._rotation + hero.body._rotation;
v8.a = (v8._rotation / 180) * Math.PI;
v8.onEnterFrame = function () {
this._x += bulletSpeed * Math.cos(this.a);
this._y += bulletSpeed * Math.sin(this.a);
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.hitTest(sun)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl1)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl2)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl3)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (mob1c.hitTest(this)) {
_global.playsfx('hit');
if (Math.abs(hero._x - mob1c._x) < 128.5 && Math.abs(hero._y - mob1c._y) < 128.5) {
mob1c.thp -= _global.rad;
mob1c.hp._width -= 0.3 * _global.rad;
} else {
mob1c.thp -= 1;
mob1c.hp._width -= 0.3;
}
if (mob1c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob1c._x, mob1c._y);
mob1c._x += 1000;
resp = false;
}
if (Math.random() < 0.2) {
placeBoom(mob1c._x, mob1c._y);
}
placeBoom1(mob1c._x, mob1c._y);
this.removeMovieClip();
}
if (mob2c.hitTest(this)) {
_global.playsfx('hit');
if (Math.abs(hero._x - mob2c._x) < 128.5 && Math.abs(hero._y - mob2c._y) < 128.5) {
mob2c.thp -= _global.rad;
mob2c.hp._width -= 0.3 * _global.rad;
} else {
mob2c.thp -= 1;
mob2c.hp._width -= 0.3;
}
if (mob2c.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(mob2c._x, mob2c._y);
mob2c._x += 1000;
resp2 = false;
}
if (Math.random() < 0.2) {
placeBoom(mob2c._x, mob2c._y);
}
placeBoom1(mob2c._x, mob2c._y);
this.removeMovieClip();
}
var v6 = enemiesArray.length;
while (v6--) {
var v3 = enemiesArray[v6];
if (v3.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 3 <= 220) {
SAc += 3;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v3.lif -= _global.rad * stren;
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v5 = 0;
if (_global.timeall <= 120) {
v5 = 0;
} else {
if (_global.timeall <= 200) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeEnemy(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
} else {
v3.lif -= stren;
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v5 = 0;
if (_global.timeall <= 120) {
v5 = 0;
} else {
if (_global.timeall <= 200) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeEnemy(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
}
}
}
var v7 = Sspiders.length;
while (v7--) {
var v4 = Sspiders[v7];
if (v4.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 3 <= 220) {
SAc += 3;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v4._x) < 128.5 && Math.abs(hero._y - v4._y) < 128.5) {
v4.Slif -= _global.rad * stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.Slif <= 0) {
v4.gotoAndStop(2);
v5 = 0;
if (_global.timeall <= 120) {
v5 = 0;
} else {
if (_global.timeall <= 200) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeSSpider(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
} else {
v4.Slif -= stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.Slif <= 0) {
v4.gotoAndStop(2);
v5 = 0;
if (_global.timeall <= 120) {
v5 = 0;
} else {
if (_global.timeall <= 200) {
v5 = 0.5;
} else {
v5 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeSSpider(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
}
}
}
};
};
placeVolna = function (tgt, ty) {
++lev;
var v3 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v3);
globalToLocal(v3);
_global.playsfx('volna');
var v4 = volna.duplicateMovieClip('b' + lev, lev);
v4._x = v3.x;
v4._y = v3.y;
v4.onEnterFrame = function () {
if (hero.foot.hitTest(this)) {
if (!ud) {
var v3 = shild - 1;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 1;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
placeBoom1(hero._x, hero._y);
}
};
};
placeEbul = function (tgt, ty) {
++lev;
var v4 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v4);
globalToLocal(v4);
if (ty == 1) {
_global.playsfx('zelenie');
var v3 = ebul.duplicateMovieClip('b' + lev, lev);
if (Math.floor(Math.random() * 2) == 1) {
v3._rotation = tgt._rotation + Math.random() * 10;
} else {
v3._rotation = tgt._rotation - Math.random() * 10;
}
v3.tt = 1;
v3.bsp = 10;
}
if (ty == 2) {
v3 = lazer.duplicateMovieClip('b' + lev, lev);
v3._rotation = tgt._rotation;
v3.tt = 3;
v3.bsp = 5;
}
if (ty == 3) {
_global.playsfx('zelenie');
v3 = little.duplicateMovieClip('b' + lev, lev);
v3._x = v4.x;
v3._y = v4.y;
v3._rotation = Math.atan2(hero._y - v3._y, hero._x - v3._x) * 57.29577951308232;
v3.tt = 2;
v3.bsp = 16;
}
v3._x = v4.x;
v3._y = v4.y;
v3.a = (v3._rotation / 180) * Math.PI;
v3.onEnterFrame = function () {
if (this.tt == 1) {
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this.tt == 3) {
this.bsp += 0.3;
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this.bsp += 0.3;
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this.tt == 2) {
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.tt != 3) {
if (this.hitTest(sun)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl1)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl2)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl3)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
}
if (hero.foot.hitTest(this)) {
_global.playsfx('hitme');
if (!ud) {
if (this.tt == 1 || this.tt == 3) {
var v3 = shild - 5;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 5;
}
}
if (this.tt == 2) {
v3 = shild - 1;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 1;
}
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
placeBoom1(hero._x, hero._y);
this.removeMovieClip();
}
};
};
var enemiesArray = new Array();
var radians = 57.29577951308232;
createEnemies(6, 'typeA', 'e1', 0, 0);
createEnemies(6, 'typeD', 'e4', 0, 0);
var Sspiders = new Array();
i = 4;
while (i--) {
if (Math.random() < 0.5) {
placeSSpider(Math.floor(Math.random() * 200) + 500, Math.floor(Math.random() * 200) + 200, 1);
} else {
placeSSpider(Math.floor(Math.random() * 200) + 500, Math.floor(Math.random() * 200) + 200, 2);
}
}
onEnterFrame = function () {
var v11 = 0;
var v12 = hero.foot._x - sun._x;
var v14 = hero.foot._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
var v16 = hero.foot.filters;
v16[1].angle = v11;
hero.foot.filters = v16;
v11 = 0;
v12 = pl2._x - sun._x;
v14 = pl2._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = pl2.filters;
v16[1].angle = v11;
pl2.filters = v16;
v11 = 0;
v12 = pl1._x - sun._x;
v14 = pl1._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = pl1.filters;
v16[1].angle = v11;
pl1.filters = v16;
v11 = 0;
v12 = pl3._x - sun._x;
v14 = pl3._y - sun._y;
if (v12 == 0) {
if (v14 >= 0) {
v11 = 270;
} else {
v11 = 90;
}
} else {
if (v12 > 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v11 = Math.atan(v14 / v12) / 0.0174532925199433;
} else {
v11 = Math.atan(v14 / v12) / 0.0174532925199433 - 180;
}
}
}
v16 = pl3.filters;
v16[1].angle = v11;
pl3.filters = v16;
if (Key.isDown(16) && !_global.pauseall) {
if (_global.trgt._width) {
fireWeapon(_global.trgt, hero);
}
}
if (Key.isDown(32) && _global.SAE == 1 && !_global.pauseall) {
sap._alpha = 100;
_global.SAE = 2;
_global.playsfx('sastart');
if (_global.perstype == 1) {
stren *= 3;
cap1.cap11.cap111.text = 'EAGLE EYE!';
cap1.gotoAndPlay(1);
var v13 = hero.foot.filters;
v13[1].color = 16711680;
hero.foot.filters = v13;
}
if (_global.perstype == 3) {
_global.sa3 = 0.5;
_global.rad = 1;
cap1.cap11.cap111.text = 'NEUTRON ACCELERATION!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 2) {
var v8 = Sspiders.length;
while (v8--) {
var v6 = Sspiders[v8];
v6.speed *= 0.2;
}
v8 = enemiesArray.length;
while (v8--) {
v6 = enemiesArray[v8];
v6.speed *= 0.2;
}
_global.sa2 = 0.2;
cap1.cap11.cap111.text = 'TIME BOMB!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 5) {
ud = true;
cap1.cap11.cap111.text = 'ULTIMATE DEFENCE!';
cap1.gotoAndPlay(1);
v13 = hero.foot.filters;
v13[2].strength = 2;
hero.foot.filters = v13;
}
if (_global.perstype == 4) {
var v7 = enemiesArray.length;
while (v7--) {
var v3 = enemiesArray[v7];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
var v5 = 0.5;
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeEnemy(v3);
++_global.kill1;
}
}
v7 = Sspiders.length;
while (v7--) {
v3 = Sspiders[v7];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v5 = 0.5;
if (Math.random() > 0.5 + 0.5 * v5) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v5) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v5) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeSSpider(v3);
++_global.kill1;
}
}
hero.zone._alpha = 85;
SAc = 32;
cap1.cap11.cap111.text = 'ANNIHILATING FLASH!';
cap1.gotoAndPlay(1);
}
}
if ((Key.isDown(37) || Key.isDown(65)) && !_global.pauseall) {
hero._rotation -= rotDirSpeed;
} else {
if ((Key.isDown(39) || Key.isDown(68)) && !_global.pauseall) {
hero._rotation += rotDirSpeed;
}
}
var v19 = _xmouse - hero._x;
var v17 = _ymouse - hero._y;
var v18 = Math.atan2(v17, v19);
hero.body._rotation = -hero._rotation + (v18 / Math.PI) * 180;
var v10 = (hero._rotation / 180) * Math.PI;
if ((Key.isDown(38) || Key.isDown(87)) && !_global.pauseall) {
if (_global.step < 5) {
_global.step += 0.1;
}
if (checkup1 == 2) {
_global.step = 2;
checkup1 = 1;
}
hero.foot.play();
checkup = 1;
hero._x += _global.step * Math.cos(v10);
hero._y += _global.step * Math.sin(v10);
} else {
if (checkup == 1 && _global.step > 0) {
hero._x += _global.step * Math.cos(v10);
hero._y += _global.step * Math.sin(v10);
_global.step -= 0.1;
} else {
if (checkup == 2 && _global.step > 0) {
hero._x -= _global.step * Math.cos(v10);
hero._y -= _global.step * Math.sin(v10);
_global.step -= 0.1;
} else {
hero.foot.stop;
}
}
}
if (hero._x < 0) {
hero._x = 0;
}
if (hero._x > 700) {
hero._x = 700;
}
if (hero._y < 0) {
hero._y = 0;
}
if (hero._y > 600) {
hero._y = 600;
}
if (!_global.pauseall) {
angle += 0.2;
}
r_ang = angle / 57.29577951308232;
pl1._x = 317 + 100 * Math.cos(r_ang * 3);
pl1._y = 245 + 100 * Math.sin(r_ang * 3);
pl2._x = 317 + 200 * Math.cos(r_ang * 2);
pl2._y = 245 + 200 * Math.sin(r_ang * 2);
pl3._x = 317 + 300 * Math.cos(r_ang);
pl3._y = 245 + 200 * Math.sin(r_ang);
if (hero.foot.hitTest(sun) && !_global.pauseall) {
if (ud) {
if (shild + 1 > _global.def) {
shild = _global.def;
} else {
shild += 1;
}
} else {
if (shild + 5 > _global.def) {
shild = _global.def;
} else {
shild += 5;
}
life -= 1;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
if (sCount++ > 100 && resp && _global.SAE != 2 && !_global.pauseall) {
sCount = 0;
if (Math.random() < 0.5) {
_global.playsfx('resp');
placeSSpider(318, 126, 1);
} else {
_global.playsfx('resp');
placeSSpider(318, 126, 2);
}
}
if (eneCount++ > 300 && resp2 && _global.SAE != 2 && !_global.pauseall) {
eneCount = 0;
createEnemies(1, 'typeD', 'e4', 631, 166);
_global.playsfx('resp');
}
timebb = int(getTimer() / 100) - timeb;
if (fire && timebb >= 2 * _global.sa3) {
if (_global.uG == 1) {
placeBullet(hero.body.dot);
}
if (_global.uG == 2) {
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
if (_global.uG == 3) {
placeBullet(hero.body.dot);
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
timeb = int(getTimer() / 100);
}
if (_global.SAE == 2) {
if (SAc - 2 <= 0) {
SAc = 0;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 0;
sap._alpha = 0;
if (_global.perstype == 5) {
ud = false;
v13 = hero.foot.filters;
v13[2].strength = 0;
hero.foot.filters = v13;
}
if (_global.perstype == 1) {
stren /= 3;
v13 = hero.foot.filters;
v13[1].color = 16777215;
hero.foot.filters = v13;
}
if (_global.perstype == 3) {
_global.sa3 = 1;
_global.rad = radiu;
}
if (_global.perstype == 2) {
v8 = Sspiders.length;
while (v8--) {
v6 = Sspiders[v8];
v6.speed *= 5;
}
v8 = enemiesArray.length;
while (v8--) {
v6 = enemiesArray[v8];
v6.speed *= 5;
}
_global.sa2 = 1;
}
if (_global.perstype == 4) {
hero.zone._alpha = 5;
}
} else {
if (!_global.pauseall) {
SAc -= 2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
if (_global.perstype == 4) {
hero.zone._alpha -= 5;
}
if (_global.perstype == 2) {
if (shild + 2 > _global.def) {
shild = _global.def;
} else {
shild += 2;
}
shilds._width = 183 * shild / _global.def;
teshi.text = 'shield ' + shild + '%';
}
}
}
}
if (_global.step > 0) {
placeFire(hero.sop);
}
if (resp == false && !resp2 && !end) {
if (Sspiders.length == 0 && enemiesArray.length == 0) {
cap1.cap11.cap111.text = 'SYSTEM NOW FREE, GOOD JOB!';
cap1.gotoAndPlay(1);
_global.playsfx('openportal');
_global.trgt = null;
fin._x = 500;
fin._y = 430;
fin.gotoAndPlay(1);
var v15 = new flash.filters.GlowFilter();
var v4 = pl1.filters;
v4.push(v15);
v4[2].blurY = 0;
v4[2].blurX = 0;
v4[2].quality = 100;
v4[2].color = 3329279;
pl1.filters = v4;
v4 = pl2.filters;
v4.push(v15);
v4[2].blurY = 0;
v4[2].blurX = 0;
pl2.filters = v4;
v4 = pl3.filters;
v4.push(v15);
v4[2].blurY = 0;
v4[2].blurX = 0;
pl3.filters = v4;
end1 = 8;
end = true;
}
}
if (end1 > 0) {
end1 -= 0.1;
v4 = pl1.filters;
v4[2].blurY = 8 - end1;
v4[2].blurX = v4[2].blurY;
v4[2].strength = (8 - end1) / 5;
pl1.filters = v4;
v4 = pl2.filters;
v4[2].blurY = 8 - end1;
v4[2].blurX = v4[2].blurY;
v4[2].strength = (8 - end1) / 5;
pl2.filters = v4;
v4 = pl3.filters;
v4[2].blurY = 8 - end1;
v4[2].blurX = v4[2].blurY;
v4[2].strength = (8 - end1) / 5;
pl3.filters = v4;
}
if (!end && !_global.pauseall) {
_global.timeall = int(getTimer() / 1000) - timenasys + _global.pausetimeall;
systime.text = _global.timeall;
}
if (end) {
finplay();
}
if (hero.foot.hitTest(fin.endss.ends) && !_global.pauseall) {
msystem.stop();
_global.playsfx('win');
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.SAE == 0 && !_global.pauseall) {
if (SAc + 0.2 <= 220) {
SAc += 0.2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
_global.playsfx(saready);
}
}
if (_global.trgt._width && !_global.pauseall) {
trg._x = _global.trgt._x;
trg._y = _global.trgt._y;
} else {
trg._x = 1000;
trg._y = 1000;
}
if (!_global.pauseall) {
updateEnemies();
}
if (_global.restartlvl) {
var v9 = lev + 1;
while (v9--) {
removeMovieClip(_root.getInstanceAtDepth(v9));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(12);
}
if (life < 0 && !_global.pauseall) {
_global.playsfx('exp');
msystem.stop();
mbos.stop();
_global.playsfx('win');
lifes._width = 0;
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
placeBoom(hero._x, hero._y);
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.perehod == 1) {
gotoAndPlay(5);
}
if (_global.perehod == 2) {
v9 = lev + 1;
while (v9--) {
removeMovieClip(_root.getInstanceAtDepth(v9));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(1);
}
};
onMouseDown = function () {
if (!_global.pauseall) {
fire = true;
}
};
onMouseUp = function () {
fire = false;
};
}
movieClip 1176 {
}
movieClip 1185 {
frame 1 {
stop();
addToPause(this);
}
frame 2 {
_parent.removeMovieClip();
}
}
movieClip 1187 {
frame 1 {
addToPause(this);
}
}
instance mob1c of movieClip 1106 {
onClipEvent (rollOver) {
_global.trgt = this;
}
}
instance mob2c of movieClip 1106 {
onClipEvent (rollOver) {
_global.trgt = this;
}
}
frame 13 {
function placeFire(tgt) {
var v3 = 0;
while (v3 < 3) {
++lev;
if (lev > 1000000) {
lev = 0;
}
var v2 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v2);
globalToLocal(v2);
var v1 = fafa.duplicateMovieClip('f' + lev, lev);
if (Math.random() > 0.5) {
v1._x = v2.x + Math.random() * 2 - 1;
} else {
v1._x = v2.x - Math.random() * 2 - 1;
}
if (Math.random() > 0.5) {
v1._y = v2.y + Math.random() * 2 - 1;
} else {
v1._y = v2.y - Math.random() * 2 - 1;
}
v1._alpha = Math.random() * 50 + 50;
v1._yscale = Math.random() * 50 + 70;
v1._xscale = v1._yscale;
++v3;
}
}
function placeBoom(x, y) {
++lev;
var v3 = boom.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom1(x, y) {
++lev;
var v3 = boom1.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom2(x, y) {
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function createExplosion(targetX, targetY, targetPath, explosionParticleAmount, explosionParticleRange, particleSize, speed, speedAlpha) {
var v7 = 0;
while (v7 < explosionParticleAmount) {
var v8 = bitmapsArray[random(bitmapsArray.length)];
var v4 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder' + lev, lev);
++lev;
var v3 = v2.createEmptyMovieClip('internal_holder', lev);
v3._x = -v4.width / 2;
v3._y = -v4.height / 2;
++lev;
v3.attachBitmap(v4, lev, 'never');
v2._x = targetX + random(explosionParticleRange) - explosionParticleRange / 2;
v2._y = targetY + random(explosionParticleRange) - explosionParticleRange / 2;
var v6 = random(particleSize);
v2._xscale = v6;
v2._yscale = v6;
v2.speed = random(speed) + speed;
v2.speedAlpha = random(speedAlpha) + speedAlpha;
v2.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speedAlpha;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
++v7;
}
}
function createParticles(targetX, targetY, targetPath, tempParticle_mcAmount, tempParticle_mcRange, particleSize, tempParticle_mcMaxSpeed, tempParticle_mcMaxFadeSpeed) {
var v7 = 0;
while (v7 < tempParticle_mcAmount) {
var v8 = particleBitmapsArray[random(particleBitmapsArray.length)];
var v5 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder', lev);
++lev;
var v4 = v2.createEmptyMovieClip('internal_holder', lev);
v4._x = -v5.width / 2;
v4._y = -v5.height / 2;
++lev;
v4.attachBitmap(v5, lev, 'never');
v2._x = targetX;
v2._y = targetY;
v2._rotation = random(360);
v2._alpha = random(50) + 50;
v2._xscale = particleSize;
v2._yscale = particleSize;
v2.boundyLeft = targetX - tempParticle_mcRange;
v2.boundyTop = targetY - tempParticle_mcRange;
v2.boundyRight = targetX + tempParticle_mcRange;
v2.boundyBottom = targetY + tempParticle_mcRange;
v2.speedX = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedY = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedX *= tempParticle_mcMaxSpeed;
v2.speedY *= tempParticle_mcMaxSpeed;
v2.fadeSpeed = Math.random(tempParticle_mcMaxFadeSpeed) * tempParticle_mcMaxFadeSpeed;
v2.onEnterFrame = function () {
this._alpha -= this.fadeSpeed;
this._x += this.speedX;
this._y += this.speedY;
if (this._alpha <= 0 || this._x < this.boundyLeft || this._x > this.boundyRight || this._y < this.boundyTop || this._y > this.boundyBottom) {
this.removeMovieClip();
}
};
++v7;
}
}
function placeVolnaboom(x, y) {
++lev;
var v1 = volnaboom.duplicateMovieClip('b' + lev, lev);
v1._x = x;
v1._y = y;
}
function fireLight(xStart, yStart, xEnd, yEnd) {
++lev;
_global.playsfx('molniya');
var temp = effectHolder.duplicateMovieClip('efho' + lev, lev);
temp.time = 5;
temp.onEnterFrame = function () {
temp.clear();
temp.lineStyle(lightningWidth, lightningColor, lightningAlpha, true);
var v13 = xStart - xEnd;
var v11 = yStart - yEnd;
var v12 = Math.sqrt(v13 * v13 + v11 * v11);
var v9 = v12 / lightningFrequency;
var v3 = Math.atan2(yStart - yEnd, xStart - xEnd);
var v10 = v12 / v9;
var v8 = 0;
while (v8 < lightningBranches) {
temp.moveTo(xStart, yStart);
var v2 = 1;
while (v2 < v9 + 1) {
var v5 = v10 * v2;
var v4 = random(lightningOffset - lightningOffset / 2);
var v6 = xStart - Math.cos(v3) * v5 + Math.cos(v3 + 1.55) * v4;
var v7 = yStart - Math.sin(v3) * v5 + Math.sin(v3 + 1.55) * v4;
temp.lineTo(v6, v7);
++v2;
}
++v8;
}
if (this.time-- <= 0) {
temp.removeMovieClip();
}
};
temp.lineTo(xEnd, yEnd);
addSparkles(xEnd, yEnd, sparkNumber, sparkDistance, sparkSize);
}
function startLReloading(a) {
reloadLComplete = false;
reloadLTimer = setInterval(this, 'gunLReloaded', reloadLSpeed);
screenLTimer = setInterval(this, 'clearScreen', clearSpeed);
}
function clearScreen() {
clearInterval(screenTimer);
delete effectHolder.onEnterFrame;
effectHolder.clear();
}
function gunLReloaded() {
clearInterval(reloadLTimer);
reloadLComplete = true;
}
function addSparkles(_targetX, _targetY, _sparkNumber, _distance, _sparkSize) {
var v6 = 0;
while (v6 < _sparkNumber) {
var v4 = _root.attachMovie('spark', 'spark_' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
var v3 = _root.attachMovie('spark2', 'spark2_' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v4._x = _targetX + random(_distance) - _distance / 2;
v4._y = _targetY + random(_distance) - _distance / 2;
v3._x = _targetX + random(_distance) - _distance / 2;
v3._y = _targetY + random(_distance) - _distance / 2;
var v5 = random(_sparkSize) + _sparkSize / 4;
v4._xscale = v5;
v4._yscale = v5;
v5 = random(_sparkSize) + _sparkSize / 4;
v3._xscale = v5;
v3._yscale = v5;
v3._rotation = random(359);
v4._alpha = lightningAlpha;
v3._alpha = lightningAlpha;
++v6;
}
}
function fireWeapon(target, who) {
if (reloadComplete == true && rok > 0 || who != hero) {
++lev;
_global.playsfx('raketa');
if (who == hero) {
var v3 = missile.duplicateMovieClip('missile' + lev, lev);
} else {
var v3 = miss.duplicateMovieClip('miss' + lev, lev);
}
v3._x = who._x;
v3._y = who._y;
v3._rotation = who._rotation;
v3.targetX = target._x;
v3.targetY = target._y;
v3.tar = target;
v3.moveX = 0;
v3.moveY = 0;
v3.onEnterFrame = function () {
doFollow(this, this.tar);
};
if (who == hero) {
roketi._alpha = 30;
rok -= 1;
roketi.ro.text = rok + '/' + _global.rokmax;
startReloading();
}
} else {
_global.playsfx('noroket');
}
}
function startReloading() {
reloadComplete = false;
reloadTimer = setInterval(this, 'gunReloaded', reloadSpeed);
}
function gunReloaded() {
clearInterval(reloadTimer);
if (rok > 0) {
roketi._alpha = 75;
}
reloadComplete = true;
}
function doFollow(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
follower.moveDistanceX = turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = missileSpeed * follower.moveX / follower.totalmove;
follower.moveY = missileSpeed * follower.moveY / follower.totalmove;
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = 180 * Math.atan2(follower.moveY, follower.moveX) / Math.PI;
doTrail(follower._x, follower._y, 'particle_smoke_clear');
var v5 = follower._x - target._x;
var v4 = follower._y - target._y;
var v7 = Math.sqrt(v5 * v5 + v4 * v4);
if (v7 < 15 && target != hero) {
placeBoom(target._x, target._y);
i = Sspiders.length;
while (i--) {
c = Sspiders[i];
if (c == target) {
removeSSpider(c);
++_global.kill1;
}
}
i = enemiesArray.length;
while (i--) {
c = enemiesArray[i];
if (c == target) {
removeEnemy(c);
++_global.kill1;
}
}
if (target == tower1) {
_global.playsfx('hit');
tower1.thp -= 10;
if (tower1.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(tower1._x, tower1._y);
placeBoom(tower1._x, tower1._y);
placeBoom(tower1._x, tower1._y);
tower1._x += 1000;
resp = false;
}
}
if (target == tower2) {
_global.playsfx('hit');
tower2.thp -= 10;
if (tower2.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(tower2._x, tower2._y);
placeBoom(tower2._x, tower2._y);
placeBoom(tower2._x, tower2._y);
tower2._x += 1000;
resp2 = false;
}
}
if (target == tower3) {
_global.playsfx('hit');
tower3.thp -= 10;
if (tower3.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(tower3._x, tower3._y);
placeBoom(tower3._x, tower3._y);
placeBoom(tower3._x, tower3._y);
tower3._x += 1000;
resp3 = false;
}
}
if (target == tower4) {
_global.playsfx('hit');
tower4.thp -= 10;
if (tower4.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(tower4._x, tower4._y);
placeBoom(tower4._x, tower4._y);
placeBoom(tower4._x, tower4._y);
tower4._x += 1000;
resp4 = false;
}
}
removeMovieClip(target);
removeMovieClip(follower);
}
if (v7 < 15 && target) {
_global.playsfx('hitme');
if (!ud) {
var v6 = shild - 3;
if (v6 < 0) {
life += v6;
shild = 0;
} else {
shild -= 3;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
removeMovieClip(follower);
}
if (!target._x) {
removeMovieClip(follower);
delete follower.onEnterFrame;
}
}
function doTrail(targetX, targetY, type) {
++lev;
var v3 = _root.attachMovie(type, type + lev, lev);
v3._x = targetX;
v3._y = targetY;
v3._rotation = random(360);
randomScale = random(75) + 25;
v3._xscale = randomScale;
randomScale = random(75) + 25;
v3._yscale = randomScale;
v3.speed = random(10) + 5;
updateAfterEvent();
v3.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speed;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
}
function placeSpider(A, B) {
++lev;
var d = spider.duplicateMovieClip('z' + lev, lev);
if (A == 0 && B == 0) {
d._y = fon._y + Math.random() * fon._height;
if (Math.random() < 0.5) {
d._x = fon._x - d._width / 2;
} else {
d._x = fon._x + fon._width + d._width / 2;
}
} else {
d._x = A;
d._y = B;
}
var v6 = hero._x - d._x;
var v5 = hero._y - d._y;
d.a = Math.atan2(v5, v6);
d._rotation = (d.a / Math.PI) * 180;
d.speed = Math.random() * 2 + 2;
d.onEnterFrame = function () {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
this.a = Math.atan2(v5, v6);
this._rotation = (this.a / Math.PI) * 180;
var v8 = Math.sqrt(v6 * v6 + v5 * v5);
if (v8 < 25 && !placed) {
_global.playsfx('hittestmob');
placeBoom2(hero._x, hero._y);
if (!ud) {
var v7 = shild - 10;
if (v7 < 0) {
life += v7;
shild = 0;
} else {
shild -= 10;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = spiders.length;
while (v3--) {
var v4 = spiders[v3];
if (v4 == d) {
spiders.splice(v3, 1);
}
}
v3 = needBePaused.length;
while (v3--) {
v4 = needBePaused[v3];
if (v4 == d) {
needBePaused.splice(v3, 1);
}
}
}
};
d.onRollOver = function () {
_global.trgt = d;
};
spiders.push(d);
d.lif = 3;
}
function removeSpider(s) {
var v4 = spiders.length;
while (v4--) {
var v2 = spiders[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
spiders.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip, Q, W) {
var v4 = 0;
while (v4 < enemyAmount) {
++lev;
if (enemyLibraryClip == 'e3') {
var v3 = enemC.duplicateMovieClip('ee' + lev, lev);
}
if (enemyLibraryClip == 'e4') {
v3 = enemD.duplicateMovieClip('ee' + lev, lev);
}
if (enemyLibraryClip == 'e2') {
v3 = enemB.duplicateMovieClip('ee' + lev, lev);
}
if (Q == 0 && W == 0) {
v3._x = random(Stage.width);
v3._y = random(Stage.height);
} else {
v3._x = Q;
v3._y = W;
}
v3._rotation = random(360);
if (enemyBehavior == 'typeB') {
v3.speed = Math.random() * 2 + 6;
v3.turnRate = 1;
v3.agroRange = 500;
v3.mode = 'follow';
v3.lif = 20;
v3.tt = 2;
v3.TtimeS = Math.floor(Math.random() * 10) + 10;
} else {
if (enemyBehavior == 'typeD') {
v3.speed = Math.random() * 4 + 1;
v3.turnRate = 0.5;
v3.agroRange = 300;
v3.mode = 'follow';
v3.lif = 20;
v3.tt = 4;
v3.TtimeS = Math.floor(Math.random() * 20) + 20;
} else {
if (enemyBehavior == 'typeC') {
v3.speed = Math.random() + 1;
v3.turnRate = 0.2;
v3.agroRange = 100;
v3.mode = 'run';
v3.lif = 15;
v3.tt = 3;
v3.TtimeS = Math.floor(Math.random() * 20) + 20;
}
}
}
v3.distanceX = 0;
v3.distanceY = 0;
v3.distanceTotal = 0;
v3.moveDistanceX = 0;
v3.moveDistanceY = 0;
v3.moveX = 0;
v3.moveY = 0;
v3.totalmove = 0;
v3.timeS = 0;
v3.onRollOver = function () {
_global.trgt = this;
};
enemiesArray.push(v3);
++v4;
}
}
function updateEnemies() {
var v3 = 0;
while (v3 < enemiesArray.length) {
var v2 = enemiesArray[v3];
updatePosition(v2, hero);
if (v2.tt == 3) {
if (v2.timeS++ > v2.TtimeS) {
v2.timeS = 0;
_global.playsfx('lazer');
var v5 = 4;
while (v5--) {
placeEbul(v2, 2);
v2._rotation += 90;
}
}
}
if (v2.tt == 2) {
if (v2.timeS++ > v2.TtimeS) {
v2.timeS = 0;
placeEbul(v2, 3);
}
}
if (v2.tt == 4) {
if (v2.timeS++ > v2.TtimeS) {
if (Math.abs(hero._x - v2._x) < 150 && Math.abs(hero._y - v2._y) < 150) {
v2.timeS = 0;
fireLight(v2._x, v2._y, hero._x, hero._y);
if (!ud) {
var v4 = shild - 3;
if (v4 < 0) {
life += v4;
shild = 0;
} else {
shild -= 3;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
}
}
}
++v3;
}
}
function updatePosition(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
if (follower.distanceTotal <= follower.agroRange) {
follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = follower.speed * follower.moveX / follower.totalmove;
follower.moveY = follower.speed * follower.moveY / follower.totalmove;
if (follower.mode == 'follow') {
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians;
} else {
if (follower.mode == 'run') {
if (follower._x - follower.moveX >= 0 && follower._x - follower.moveX <= 700) {
follower._x -= follower.moveX;
}
if (follower._y - follower.moveY >= 0 && follower._y - follower.moveY <= 600) {
follower._y -= follower.moveY;
}
follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180;
}
}
}
if (follower._x < 0) {
follower._x = 0;
}
if (follower._x > 700) {
follower._x = 700;
}
if (follower._y < 0) {
follower._y = 0;
}
if (follower._y > 600) {
follower._y = 600;
}
}
function removeEnemy(s) {
var v4 = enemiesArray.length;
while (v4--) {
var v2 = enemiesArray[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
enemiesArray.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function placeSSpider(A, B, TT) {
++lev;
if (TT == 2) {
var Sd = Sspider2.duplicateMovieClip('Sz' + lev, lev);
} else {
var Sd = Sspider.duplicateMovieClip('Sz' + lev, lev);
}
if (A == 0 && B == 0) {
Sd._y = fon._y + Math.random() * fon._height;
if (Math.random() < 0.5) {
Sd._x = fon._x - Sd._width / 2;
} else {
Sd._x = fon._x + fon._width + Sd._width / 2;
}
} else {
Sd._x = A;
Sd._y = B;
}
var v6 = hero._x - Sd._x;
var v7 = hero._y - Sd._y;
Sd.a = Math.atan2(v7, v6);
Sd._rotation = (Sd.a / Math.PI) * 180;
Sd.speed = Math.random() + 0.5;
Sd.TY = TT;
Sd.timeS = 0;
if (TT == 1) {
Sd.TtimeS = Math.floor(Math.random() * 20) + 14;
} else {
Sd.TtimeS = Math.floor(Math.random() * 40) + 40;
}
var back = 0;
Sd.onEnterFrame = function () {
if (back == 0) {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
}
if (back == 2) {
this._x += -this.speed * Math.cos(this.a);
this._y += -this.speed * Math.sin(this.a);
}
var v6 = hero._x - this._x;
var v7 = hero._y - this._y;
this.a = Math.atan2(v7, v6);
this._rotation = (this.a / Math.PI) * 180;
if (this.timeS++ > this.TtimeS) {
this.timeS = 0;
if (this.TY == 1) {
placeEbul(Sd, 1);
} else {
fireWeapon(hero, this);
}
}
var v5 = Math.sqrt(v6 * v6 + v7 * v7);
if (v5 < 180) {
if (back == 0) {
back = 1;
}
}
if (v5 < 120) {
back = 2;
}
if (v5 >= 180) {
back = 0;
}
if (v5 < 25 && !Splaced) {
_global.playsfx('hittestmob');
placeBoom2(hero._x, hero._y);
if (!ud) {
var v8 = shild - 15;
if (v8 < 0) {
life += v8;
shild = 0;
} else {
shild -= 15;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Sspiders.length;
while (v3--) {
var v4 = Sspiders[v3];
if (v4 == Sd) {
Sspiders.splice(v3, 1);
}
}
v3 = needBePaused.length;
while (v3--) {
v4 = needBePaused[v3];
if (v4 == Sd) {
needBePaused.splice(v3, 1);
}
}
}
};
Sd.onRollOver = function () {
_global.trgt = this;
};
Sspiders.push(Sd);
Sd.Slif = 5;
}
function removeSSpider(s) {
var v4 = Sspiders.length;
while (v4--) {
var v2 = Sspiders[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
Sspiders.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
stop();
var my_so = SharedObject.getLocal('spiteful_space_save', '/');
_global.MIN = my_so.data.MIN;
_global.GAS = my_so.data.GAS;
_global.BIO = my_so.data.BIO;
_global.rokmax = my_so.data.rokmax;
_global.uR = my_so.data.uR;
_global.uG = my_so.data.uG;
_global.uB = my_so.data.uB;
_global.uRa = my_so.data.uRa;
_global.uE = my_so.data.uE;
_global.uS = my_so.data.uS;
_global.uSt = my_so.data.uSt;
my_so.flush();
_global.perehod = 0;
if (_global.SoundM != false) {
mpause.stop();
msystem.stop();
mmenu.stop();
mbos.stop();
mbos.start(0, 500);
}
cap1.cap11.cap111.text = 'DESTROY ENERGY TOWERS';
cap1.gotoAndPlay(1);
_global.sa1 = 1;
_global.sa2 = 1;
_global.sa3 = 1;
var stren = _global.str;
heroab.swapDepths(1000002);
menuab.swapDepths(1000003);
con.swapDepths(1000004);
_global.bio1 = 0;
_global.min1 = 0;
_global.gas1 = 0;
_global.kill1 = 0;
_global.restartlvl = false;
_global.pauseall = false;
_global.steptmp = 0;
_global.pausetimestart = 0;
_global.pausetimestop = 0;
_global.pausetimeall = 0;
needBePaused = new Array();
_global.addToPause = function (obj) {
if (!obj._inPause) {
needBePaused.push(obj);
obj._inPause = true;
}
};
bhstarplay = function () {
++lev;
var v2 = bhstar.duplicateMovieClip('bh' + lev, lev);
if (Math.random() < 0.5) {
v2._x = fon._x + Math.random() * fon._width;
if (Math.random() < 0.5) {
v2._y = fon._y - v2._height / 2;
} else {
v2._y = fon._y + fon._height + v2._height / 2;
}
} else {
v2._y = fon._y + Math.random() * fon._height;
if (Math.random() < 0.5) {
v2._x = fon._x - v2._width / 2;
} else {
v2._x = fon._x + fon._width + v2._width / 2;
}
}
var v4 = blackhole._x - v2._x;
var v3 = blackhole._y - v2._y;
v2.a = Math.atan2(v3, v4);
v2.speed = Math.random() * 2 + 2;
v2._yscale = random(100);
v2._xscale = v2._yscale;
v2._alpha = random(100);
v2._rotation = (v2.a / Math.PI) * 180;
v2.onEnterFrame = function () {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
if (this.hitTest(blackhole)) {
removeMovieClip(this);
delete this.onEnterFrame;
}
};
};
var koff = 1;
var finangle = Math.random() * 100;
finplay = function () {
finangle += 10;
if (koff < 30) {
koff += 0.5;
}
finr_ang = finangle / 57.29577951308232;
finmc._x = 500 + koff * Math.cos(finr_ang);
finmc._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc._x, finmc._y, 'particle_smoke_clear');
finr_ang = (finangle + 180) / 57.29577951308232;
finmc1._x = 500 + koff * Math.cos(finr_ang);
finmc1._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc1._x, finmc1._y, 'particle_smoke_clear');
};
_global.setPause = function (flag) {
isPause = flag;
var v3 = needBePaused.length;
while (v3--) {
var v2 = needBePaused[v3];
if (flag) {
v2.stop();
v2.oef = v2.onEnterFrame;
v2.onEnterFrame = null;
} else {
v2.onEnterFrame = v2.oef;
v2.play();
}
}
if (flag) {
_global.pausetimestart = int(getTimer() / 1000);
} else {
_global.pausetimestop = int(getTimer() / 1000);
_global.pausetimeall += _global.pausetimestart - _global.pausetimestop;
}
};
min1.text = _global.GAS + '/300';
min2.text = _global.MIN + '/150';
min3.text = _global.BIO + '/50';
samc._width = 0;
samc._x = 350;
_global.SAE = 0;
var SAc = 0;
var ud = false;
var radiu = _global.rad;
var life = _global.arm;
var shild = _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
var rok = _global.rokmax;
roketi.ro.text = rok + '/' + _global.rokmax;
_global.step = _global.spe;
var checkup = 1;
var checkup1 = 1;
var rotDirSpeed = 5;
var angle = Math.random() * 100;
var sCount = 0;
var eneCount = 0;
var lev = 0;
var timeb = int(getTimer() / 100);
var timenasys = int(getTimer() / 1000);
var timevspishka = 0;
var Ttimevspishka = 40;
_global.timeall = 0;
var fire = false;
heroab._visible = false;
menuab._visible = false;
con._visible = false;
boom._visible = false;
boom1._visible = false;
boom2._visible = false;
tower1.thp = 200;
tower2.thp = 200;
tower3.thp = 200;
tower4.thp = 200;
var resp = true;
var resp2 = true;
var resp3 = true;
var resp4 = true;
var end = false;
var end1 = 0;
fafa._visible = false;
var bitmapsArray;
var particleBitmapsArray;
bitmapsArray = ['effect-fire5.png', 'effect-fire6.png', 'effect-fire7.png', 'effect-fire8.png', 'effect-fire9.png'];
particleBitmapsArray = ['particle.jpg', 'particle1.png', 'particle5.png'];
var Gass = new Array();
placeGas = function (A, B) {
++lev;
var d = gas.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.GAS < 300) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Gass.length;
while (v3--) {
var v4 = Gass[v3];
if (v4 == d) {
Gass.splice(v3, 1);
}
}
_global.GAS += 1;
++_global.gas1;
_global.playsfx('collected');
min1.text = _global.GAS + '/300';
}
};
Gass.push(d);
};
var Minerals = new Array();
placeMineral = function (A, B) {
++lev;
var d = mineral.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.MIN < 150) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Minerals.length;
while (v3--) {
var v4 = Minerals[v3];
if (v4 == d) {
Minerals.splice(v3, 1);
}
}
_global.MIN += 1;
++_global.min1;
_global.playsfx('collected');
min2.text = _global.MIN + '/150';
}
};
Minerals.push(d);
};
var Bios = new Array();
placeBio = function (A, B) {
++lev;
var d = bio.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.BIO < 50) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Bios.length;
while (v3--) {
var v4 = Bios[v3];
if (v4 == d) {
Bios.splice(v3, 1);
}
}
_global.BIO += 1;
++_global.bio1;
_global.playsfx('collected');
min3.text = _global.BIO + '/50';
}
};
Bios.push(d);
};
var lightningOffset = 12;
var lightningFrequency = 12;
var lightningWidth = 1;
var lightningColor = '0x5C98EF';
var lightningAlpha = 75;
var lightningBranches = 3;
var sparkNumber = 10;
var sparkDistance = 20;
var sparkSize = 100;
var reloadLSpeed = 200;
var clearSpeed = 200;
var glow_color = lightningColor;
var glow_alpha = 0.6;
var glow_blurX = 5;
var glow_blurY = 5;
var glow_strength = 2;
var glow_quality = 3;
var reloadLTimer;
var screenTimer;
var reloadLComplete = true;
var rotationLDirection;
var filter_glow = new flash.filters.GlowFilter(glow_color, glow_alpha, glow_blurX, glow_blurY, glow_strength, glow_quality);
effectHolder.filters = [filter_glow];
var reloadSpeed = 1000;
var missileSpeed = 7;
var turnRate = 0.7;
var reloadTimer;
var reloadComplete = true;
bulletSpeed = 18;
placeBullet = function (tgt) {
++lev;
_global.playsfx('vistrel');
var v11 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v11);
globalToLocal(v11);
var v10 = bullet.duplicateMovieClip('b' + lev, lev);
v10._x = v11.x;
v10._y = v11.y;
v10._rotation = hero._rotation + hero.body._rotation;
v10.a = (v10._rotation / 180) * Math.PI;
v10.onEnterFrame = function () {
this._x += bulletSpeed * Math.cos(this.a);
this._y += bulletSpeed * Math.sin(this.a);
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (tower1.hitTest(this)) {
_global.playsfx('hit');
if (Math.abs(hero._x - tower1._x) < 128.5 && Math.abs(hero._y - tower1._y) < 128.5) {
tower1.thp -= _global.rad;
} else {
tower1.thp -= 1;
}
if (tower1.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(tower1._x, tower1._y);
tower1._x += 1000;
resp = false;
}
if (Math.random() < 0.2) {
placeBoom(tower1._x, tower1._y);
}
placeBoom1(tower1._x, tower1._y);
this.removeMovieClip();
}
if (tower2.hitTest(this)) {
_global.playsfx('hit');
if (Math.abs(hero._x - tower2._x) < 128.5 && Math.abs(hero._y - tower2._y) < 128.5) {
tower2.thp -= _global.rad;
} else {
tower2.thp -= 1;
}
if (tower2.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(tower2._x, tower2._y);
tower2._x += 1000;
resp2 = false;
}
if (Math.random() < 0.2) {
placeBoom(tower2._x, tower2._y);
}
placeBoom1(tower2._x, tower2._y);
this.removeMovieClip();
}
if (tower3.hitTest(this)) {
_global.playsfx('hit');
if (Math.abs(hero._x - tower3._x) < 128.5 && Math.abs(hero._y - tower3._y) < 128.5) {
tower3.thp -= _global.rad;
} else {
tower3.thp -= 1;
}
if (tower3.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(tower3._x, tower3._y);
tower3._x += 1000;
resp3 = false;
}
if (Math.random() < 0.2) {
placeBoom(tower3._x, tower3._y);
}
placeBoom1(tower3._x, tower3._y);
this.removeMovieClip();
}
if (tower4.hitTest(this)) {
_global.playsfx('hit');
if (Math.abs(hero._x - tower4._x) < 128.5 && Math.abs(hero._y - tower4._y) < 128.5) {
tower4.thp -= _global.rad;
} else {
tower4.thp -= 1;
}
if (tower4.thp <= 0) {
_global.playsfx('exp');
_global.playsfx('exp');
_global.playsfx('exp');
placeBoom(tower4._x, tower4._y);
tower4._x += 1000;
resp4 = false;
}
if (Math.random() < 0.2) {
placeBoom(tower4._x, tower4._y);
}
placeBoom1(tower4._x, tower4._y);
this.removeMovieClip();
}
var v9 = spiders.length;
while (v9--) {
var v3 = spiders[v9];
if (v3.hit.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 5 <= 220) {
SAc += 5;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v3.lif -= _global.rad * stren;
v3._yscale -= 20 * stren;
v3._xscale = v3._yscale;
if (SAE != 2) {
v3.speed -= 0.5 * stren;
}
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v6 = 0;
if (_global.timeall <= 60) {
v6 = 0;
} else {
if (_global.timeall <= 120) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeSpider(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
} else {
v3.lif -= stren;
v3._yscale -= 10 * stren;
v3._xscale = v3._yscale;
if (SAE != 2) {
v3.speed -= 0.5 * stren;
}
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v6 = 0;
if (_global.timeall <= 60) {
v6 = 0;
} else {
if (_global.timeall <= 120) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeSpider(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
}
}
}
var v7 = enemiesArray.length;
while (v7--) {
var v4 = enemiesArray[v7];
if (v4.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 3 <= 220) {
SAc += 3;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v4._x) < 128.5 && Math.abs(hero._y - v4._y) < 128.5) {
v4.lif -= _global.rad * stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.lif <= 0) {
v4.gotoAndStop(2);
v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeEnemy(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
} else {
v4.lif -= stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.lif <= 0) {
v4.gotoAndStop(2);
v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeEnemy(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
}
}
}
var v8 = Sspiders.length;
while (v8--) {
var v5 = Sspiders[v8];
if (v5.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 3 <= 220) {
SAc += 3;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v5._x) < 128.5 && Math.abs(hero._y - v5._y) < 128.5) {
v5.Slif -= _global.rad * stren;
this.removeMovieClip();
placeBoom1(v5._x, v5._y);
if (v5.Slif <= 0) {
v5.gotoAndStop(2);
v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
removeSSpider(v5);
++_global.kill1;
placeBoom(v5._x, v5._y);
}
} else {
v5.Slif -= stren;
this.removeMovieClip();
placeBoom1(v5._x, v5._y);
if (v5.Slif <= 0) {
v5.gotoAndStop(2);
v6 = 0;
if (_global.timeall <= 120) {
v6 = 0;
} else {
if (_global.timeall <= 200) {
v6 = 0.5;
} else {
v6 = 1;
}
}
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
removeSSpider(v5);
++_global.kill1;
placeBoom(v5._x, v5._y);
}
}
}
}
};
};
placeVolna = function (tgt, ty) {
++lev;
var v3 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v3);
globalToLocal(v3);
_global.playsfx('volna');
var v4 = volna.duplicateMovieClip('b' + lev, lev);
v4._x = v3.x;
v4._y = v3.y;
v4.onEnterFrame = function () {
if (hero.foot.hitTest(this)) {
if (!ud) {
var v3 = shild - 1;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 1;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
placeBoom1(hero._x, hero._y);
}
};
};
placeEbul = function (tgt, ty) {
++lev;
var v4 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v4);
globalToLocal(v4);
if (ty == 1) {
_global.playsfx('zelenie');
var v3 = ebul.duplicateMovieClip('b' + lev, lev);
if (Math.floor(Math.random() * 2) == 1) {
v3._rotation = tgt._rotation + Math.random() * 10;
} else {
v3._rotation = tgt._rotation - Math.random() * 10;
}
v3.tt = 1;
v3.bsp = 10;
}
if (ty == 2) {
v3 = lazer.duplicateMovieClip('b' + lev, lev);
v3._rotation = tgt._rotation;
v3.tt = 3;
v3.bsp = 5;
}
if (ty == 3) {
_global.playsfx('zelenie');
v3 = little.duplicateMovieClip('b' + lev, lev);
v3._x = v4.x;
v3._y = v4.y;
v3._rotation = Math.atan2(hero._y - v3._y, hero._x - v3._x) * 57.29577951308232;
v3.tt = 2;
v3.bsp = 16;
}
v3._x = v4.x;
v3._y = v4.y;
v3.a = (v3._rotation / 180) * Math.PI;
v3.onEnterFrame = function () {
if (this.tt == 1) {
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this.tt == 3) {
this.bsp += 0.3;
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this.bsp += 0.3;
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this.tt == 2) {
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (hero.foot.hitTest(this)) {
_global.playsfx('hitme');
if (!ud) {
if (this.tt == 1 || this.tt == 3) {
var v3 = shild - 5;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 5;
}
}
if (this.tt == 2) {
v3 = shild - 1;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 1;
}
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
placeBoom1(hero._x, hero._y);
this.removeMovieClip();
}
};
};
var enemiesArray = new Array();
var radians = 57.29577951308232;
var spiders = new Array();
var Sspiders = new Array();
onEnterFrame = function () {
var v10 = 0;
var v11 = hero.foot._x - sun._x;
var v13 = hero.foot._y - sun._y;
if (v11 == 0) {
if (v13 >= 0) {
v10 = 270;
} else {
v10 = 90;
}
} else {
if (v11 > 0) {
v10 = Math.atan(v13 / v11) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v10 = Math.atan(v13 / v11) / 0.0174532925199433;
} else {
v10 = Math.atan(v13 / v11) / 0.0174532925199433 - 180;
}
}
}
var v14 = hero.foot.filters;
v14[1].angle = v10;
hero.foot.filters = v14;
if (Key.isDown(16) && !_global.pauseall) {
if (_global.trgt._width) {
fireWeapon(_global.trgt, hero);
}
}
if (Key.isDown(32) && _global.SAE == 1 && !_global.pauseall) {
sap._alpha = 100;
_global.SAE = 2;
_global.playsfx('sastart');
if (_global.perstype == 1) {
stren *= 3;
cap1.cap11.cap111.text = 'EAGLE EYE!';
cap1.gotoAndPlay(1);
var v12 = hero.foot.filters;
v12[1].color = 16711680;
hero.foot.filters = v12;
}
if (_global.perstype == 3) {
_global.sa3 = 0.5;
_global.rad = 1;
cap1.cap11.cap111.text = 'NEUTRON ACCELERATION!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 2) {
var v7 = spiders.length;
while (v7--) {
var v5 = spiders[v7];
v5.speed *= 0.2;
}
v7 = Sspiders.length;
while (v7--) {
v5 = Sspiders[v7];
v5.speed *= 0.2;
}
v7 = enemiesArray.length;
while (v7--) {
v5 = enemiesArray[v7];
v5.speed *= 0.2;
}
_global.sa2 = 0.2;
cap1.cap11.cap111.text = 'TIME BOMB!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 5) {
ud = true;
cap1.cap11.cap111.text = 'ULTIMATE DEFENCE!';
cap1.gotoAndPlay(1);
v12 = hero.foot.filters;
v12[2].strength = 2;
hero.foot.filters = v12;
}
if (_global.perstype == 4) {
var v6 = spiders.length;
while (v6--) {
var v3 = spiders[v6];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
var v4 = 0.5;
if (Math.random() > 0.5 + 0.5 * v4) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v4) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v4) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeSpider(v3);
++_global.kill1;
}
}
v6 = enemiesArray.length;
while (v6--) {
v3 = enemiesArray[v6];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v4 = 0.5;
if (Math.random() > 0.5 + 0.5 * v4) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v4) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v4) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeEnemy(v3);
++_global.kill1;
}
}
v6 = Sspiders.length;
while (v6--) {
v3 = Sspiders[v6];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v4 = 0.5;
if (Math.random() > 0.5 + 0.5 * v4) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v4) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v4) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeSSpider(v3);
++_global.kill1;
}
}
hero.zone._alpha = 85;
SAc = 32;
cap1.cap11.cap111.text = 'ANNIHILATING FLASH!';
cap1.gotoAndPlay(1);
}
}
if ((Key.isDown(37) || Key.isDown(65)) && !_global.pauseall) {
hero._rotation -= rotDirSpeed;
} else {
if ((Key.isDown(39) || Key.isDown(68)) && !_global.pauseall) {
hero._rotation += rotDirSpeed;
}
}
var v17 = _xmouse - hero._x;
var v15 = _ymouse - hero._y;
var v16 = Math.atan2(v15, v17);
hero.body._rotation = -hero._rotation + (v16 / Math.PI) * 180;
var v9 = (hero._rotation / 180) * Math.PI;
if ((Key.isDown(38) || Key.isDown(87)) && !_global.pauseall) {
if (_global.step < 5) {
_global.step += 0.1;
}
if (checkup1 == 2) {
_global.step = 2;
checkup1 = 1;
}
hero.foot.play();
checkup = 1;
hero._x += _global.step * Math.cos(v9);
hero._y += _global.step * Math.sin(v9);
} else {
if (checkup == 1 && _global.step > 0) {
hero._x += _global.step * Math.cos(v9);
hero._y += _global.step * Math.sin(v9);
_global.step -= 0.1;
} else {
if (checkup == 2 && _global.step > 0) {
hero._x -= _global.step * Math.cos(v9);
hero._y -= _global.step * Math.sin(v9);
_global.step -= 0.1;
} else {
hero.foot.stop;
}
}
}
if (hero._x < 0) {
hero._x = 0;
}
if (hero._x > 700) {
hero._x = 700;
}
if (hero._y < 0) {
hero._y = 0;
}
if (hero._y > 600) {
hero._y = 600;
}
if (!_global.pauseall) {
angle += 0.5;
}
r_ang = angle / 57.29577951308232;
if (resp) {
tower1._x = blackhole._x + 80 * Math.cos(r_ang);
tower1._y = blackhole._y + 80 * Math.sin(r_ang);
}
if (resp2) {
tower2._x = blackhole._x + 120 * Math.cos(-r_ang + 1.570796326794897);
tower2._y = blackhole._y + 120 * Math.sin(-r_ang + 1.570796326794897);
}
if (resp3) {
tower3._x = blackhole._x + 120 * Math.cos(-r_ang - 1.570796326794897);
tower3._y = blackhole._y + 120 * Math.sin(-r_ang - 1.570796326794897);
}
if (resp4) {
tower4._x = blackhole._x + 80 * Math.cos(r_ang + Math.PI);
tower4._y = blackhole._y + 80 * Math.sin(r_ang + Math.PI);
}
timebb = int(getTimer() / 100) - timeb;
if (fire && timebb >= 2 * _global.sa3) {
if (_global.uG == 1) {
placeBullet(hero.body.dot);
}
if (_global.uG == 2) {
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
if (_global.uG == 3) {
placeBullet(hero.body.dot);
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
timeb = int(getTimer() / 100);
}
if (_global.SAE == 2) {
if (SAc - 2 <= 0) {
SAc = 0;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 0;
sap._alpha = 0;
if (_global.perstype == 5) {
ud = false;
v12 = hero.foot.filters;
v12[2].strength = 0;
hero.foot.filters = v12;
}
if (_global.perstype == 1) {
stren /= 3;
v12 = hero.foot.filters;
v12[1].color = 16777215;
hero.foot.filters = v12;
}
if (_global.perstype == 3) {
_global.sa3 = 1;
_global.rad = radiu;
}
if (_global.perstype == 2) {
v7 = spiders.length;
while (v7--) {
v5 = spiders[v7];
v5.speed *= 5;
}
v7 = Sspiders.length;
while (v7--) {
v5 = Sspiders[v7];
v5.speed *= 5;
}
v7 = enemiesArray.length;
while (v7--) {
v5 = enemiesArray[v7];
v5.speed *= 5;
}
_global.sa2 = 1;
}
if (_global.perstype == 4) {
hero.zone._alpha = 5;
}
} else {
if (!_global.pauseall) {
SAc -= 2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
if (_global.perstype == 4) {
hero.zone._alpha -= 5;
}
if (_global.perstype == 2) {
if (shild + 2 > _global.def) {
shild = _global.def;
} else {
shild += 2;
}
shilds._width = 183 * shild / _global.def;
teshi.text = 'shield ' + shild + '%';
}
}
}
}
if (_global.step > 0) {
placeFire(hero.sop);
}
trace(spiders.length);
trace(Sspiders.length);
trace(enemiesArray.length);
if (resp == false && !resp2 && !resp3 && !resp4 && !end) {
if (spiders.length == 0 && Sspiders.length == 0 && enemiesArray.length == 0) {
cap1.cap11.cap111.text = 'MISSION COMPLETE!!!';
cap1.gotoAndPlay(1);
_global.playsfx('openportal');
_global.trgt = null;
fin._x = 500;
fin._y = 430;
fin.gotoAndPlay(1);
end = true;
}
}
if (!end && !_global.pauseall) {
_global.timeall = int(getTimer() / 1000) - timenasys + _global.pausetimeall;
systime.text = _global.timeall;
}
if (end) {
finplay();
}
if (hero.foot.hitTest(fin.endss.ends) && !_global.pauseall) {
mbos.stop();
_global.playsfx('win');
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.SAE == 0 && !_global.pauseall) {
if (SAc + 0.2 <= 220) {
SAc += 0.2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
_global.playsfx(saready);
}
}
if (_global.trgt._width && !_global.pauseall) {
trg._x = _global.trgt._x;
trg._y = _global.trgt._y;
} else {
trg._x = 1000;
trg._y = 1000;
}
if (!_global.pauseall) {
updateEnemies();
}
if (_global.restartlvl) {
var v8 = lev + 1;
while (v8--) {
removeMovieClip(_root.getInstanceAtDepth(v8));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(13);
}
if (life < 0 && !_global.pauseall) {
_global.playsfx('exp');
msystem.stop();
mbos.stop();
_global.playsfx('win');
lifes._width = 0;
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
placeBoom(hero._x, hero._y);
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.Detal == 2) {
bhstarplay();
}
if (timevspishka == Ttimevspishka / 2 && _global.SAE != 2 && !_global.pauseall) {
var v18 = Math.random();
if (v18 < 0.5) {
if (resp) {
fireLight(tower1._x, tower1._y, blackhole._x, blackhole._y);
}
if (resp4) {
fireLight(tower4._x, tower4._y, blackhole._x, blackhole._y);
}
} else {
if (resp2) {
fireLight(tower2._x, tower2._y, blackhole._x, blackhole._y);
}
if (resp3) {
fireLight(tower3._x, tower3._y, blackhole._x, blackhole._y);
}
}
}
if (timevspishka == Ttimevspishka / 4 && _global.SAE != 2 && !_global.pauseall) {
v18 = Math.random();
if (v18 < 0.5) {
if (resp) {
fireLight(tower1._x, tower1._y, blackhole._x, blackhole._y);
}
if (resp4) {
fireLight(tower4._x, tower4._y, blackhole._x, blackhole._y);
}
} else {
if (resp2) {
fireLight(tower2._x, tower2._y, blackhole._x, blackhole._y);
}
if (resp3) {
fireLight(tower3._x, tower3._y, blackhole._x, blackhole._y);
}
}
}
if (timevspishka == Ttimevspishka * 3 / 4 && _global.SAE != 2 && !_global.pauseall) {
v18 = Math.random();
if (v18 < 0.5) {
if (resp) {
fireLight(tower1._x, tower1._y, blackhole._x, blackhole._y);
}
if (resp4) {
fireLight(tower4._x, tower4._y, blackhole._x, blackhole._y);
}
} else {
if (resp2) {
fireLight(tower2._x, tower2._y, blackhole._x, blackhole._y);
}
if (resp3) {
fireLight(tower3._x, tower3._y, blackhole._x, blackhole._y);
}
}
}
if (timevspishka++ > Ttimevspishka && (resp || resp2 || resp3 || resp4) && _global.SAE != 2 && !_global.pauseall) {
timevspishka = 0;
_global.playsfx('resp');
placeVolna(blackhole);
if (_global.Detal == 2) {
placeVolnaboom(blackhole._x, blackhole._y);
}
placeSpider(0, 0);
if (Math.random() < 0.5) {
placeSSpider(blackhole._x, blackhole._y, 1);
} else {
placeSpider(blackhole._x, blackhole._y);
}
if (Math.random() < 0.2) {
placeSSpider(blackhole._x, blackhole._y, 2);
}
if (Math.random() < 0.2) {
createEnemies(1, 'typeB', 'e2', blackhole._x, blackhole._y);
}
if (Math.random() < 0.2) {
createEnemies(1, 'typeC', 'e3', blackhole._x, blackhole._y);
}
if (Math.random() < 0.2) {
createEnemies(1, 'typeD', 'e4', blackhole._x, blackhole._y);
}
v18 = Math.random();
if (v18 < 0.5) {
if (resp) {
fireLight(tower1._x, tower1._y, blackhole._x, blackhole._y);
}
if (resp4) {
fireLight(tower4._x, tower4._y, blackhole._x, blackhole._y);
}
} else {
if (resp2) {
fireLight(tower2._x, tower2._y, blackhole._x, blackhole._y);
}
if (resp3) {
fireLight(tower3._x, tower3._y, blackhole._x, blackhole._y);
}
}
}
if (!_global.pauseall) {
blackhole._rotation += 0.5;
}
if (_global.perehod == 1) {
gotoAndPlay(5);
}
if (_global.perehod == 2) {
v8 = lev + 1;
while (v8--) {
removeMovieClip(_root.getInstanceAtDepth(v8));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(1);
}
};
onMouseDown = function () {
if (!_global.pauseall) {
fire = true;
}
};
onMouseUp = function () {
fire = false;
};
}
movieClip 1190 {
}
movieClip 1199 {
}
movieClip 1202 {
}
instance tower4 of movieClip 1202 {
onClipEvent (rollOver) {
_global.trgt = this;
}
}
instance tower2 of movieClip 1202 {
onClipEvent (rollOver) {
_global.trgt = this;
}
}
instance tower3 of movieClip 1202 {
onClipEvent (rollOver) {
_global.trgt = this;
}
}
instance tower1 of movieClip 1202 {
onClipEvent (rollOver) {
_global.trgt = this;
}
}
frame 14 {
function placeFire(tgt) {
var v3 = 0;
while (v3 < 3) {
++lev;
if (lev > 1000000) {
lev = 0;
}
var v2 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v2);
globalToLocal(v2);
var v1 = fafa.duplicateMovieClip('f' + lev, lev);
if (Math.random() > 0.5) {
v1._x = v2.x + Math.random() * 2 - 1;
} else {
v1._x = v2.x - Math.random() * 2 - 1;
}
if (Math.random() > 0.5) {
v1._y = v2.y + Math.random() * 2 - 1;
} else {
v1._y = v2.y - Math.random() * 2 - 1;
}
v1._alpha = Math.random() * 50 + 50;
v1._yscale = Math.random() * 50 + 70;
v1._xscale = v1._yscale;
++v3;
}
}
function placeBoom(x, y) {
++lev;
var v3 = boom.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom1(x, y) {
++lev;
var v3 = boom1.duplicateMovieClip('b' + lev, lev);
v3._x = x;
v3._y = y;
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function placeBoom2(x, y) {
createExplosion(x, y, _root, 5, 15, 100, 3, 5);
if (_global.Detal == 2) {
createParticles(x, y, _root, 3, 50, 50, 5, 5);
}
}
function createExplosion(targetX, targetY, targetPath, explosionParticleAmount, explosionParticleRange, particleSize, speed, speedAlpha) {
var v7 = 0;
while (v7 < explosionParticleAmount) {
var v8 = bitmapsArray[random(bitmapsArray.length)];
var v4 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder' + lev, lev);
++lev;
var v3 = v2.createEmptyMovieClip('internal_holder', lev);
v3._x = -v4.width / 2;
v3._y = -v4.height / 2;
++lev;
v3.attachBitmap(v4, lev, 'never');
v2._x = targetX + random(explosionParticleRange) - explosionParticleRange / 2;
v2._y = targetY + random(explosionParticleRange) - explosionParticleRange / 2;
var v6 = random(particleSize);
v2._xscale = v6;
v2._yscale = v6;
v2.speed = random(speed) + speed;
v2.speedAlpha = random(speedAlpha) + speedAlpha;
v2.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speedAlpha;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
++v7;
}
}
function createParticles(targetX, targetY, targetPath, tempParticle_mcAmount, tempParticle_mcRange, particleSize, tempParticle_mcMaxSpeed, tempParticle_mcMaxFadeSpeed) {
var v7 = 0;
while (v7 < tempParticle_mcAmount) {
var v8 = particleBitmapsArray[random(particleBitmapsArray.length)];
var v5 = flash.display.BitmapData.loadBitmap(v8);
++lev;
var v2 = targetPath.createEmptyMovieClip('main_holder', lev);
++lev;
var v4 = v2.createEmptyMovieClip('internal_holder', lev);
v4._x = -v5.width / 2;
v4._y = -v5.height / 2;
++lev;
v4.attachBitmap(v5, lev, 'never');
v2._x = targetX;
v2._y = targetY;
v2._rotation = random(360);
v2._alpha = random(50) + 50;
v2._xscale = particleSize;
v2._yscale = particleSize;
v2.boundyLeft = targetX - tempParticle_mcRange;
v2.boundyTop = targetY - tempParticle_mcRange;
v2.boundyRight = targetX + tempParticle_mcRange;
v2.boundyBottom = targetY + tempParticle_mcRange;
v2.speedX = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedY = Math.random(tempParticle_mcMaxSpeed) - Math.random(tempParticle_mcMaxSpeed);
v2.speedX *= tempParticle_mcMaxSpeed;
v2.speedY *= tempParticle_mcMaxSpeed;
v2.fadeSpeed = Math.random(tempParticle_mcMaxFadeSpeed) * tempParticle_mcMaxFadeSpeed;
v2.onEnterFrame = function () {
this._alpha -= this.fadeSpeed;
this._x += this.speedX;
this._y += this.speedY;
if (this._alpha <= 0 || this._x < this.boundyLeft || this._x > this.boundyRight || this._y < this.boundyTop || this._y > this.boundyBottom) {
this.removeMovieClip();
}
};
++v7;
}
}
function placeVolnaboom(x, y) {
++lev;
var v1 = volnaboom.duplicateMovieClip('b' + lev, lev);
v1._x = x;
v1._y = y;
}
function fireWeapon(target) {
if (reloadComplete == true && rok > 0) {
++lev;
_global.playsfx('raketa');
var v3 = missile.duplicateMovieClip('missile' + lev, lev);
v3._x = hero._x;
v3._y = hero._y;
v3._rotation = hero._rotation;
v3.targetX = target._x;
v3.targetY = target._y;
v3.tar = target;
v3.moveX = 0;
v3.moveY = 0;
v3.onEnterFrame = function () {
doFollow(this, this.tar);
};
roketi._alpha = 30;
rok -= 1;
roketi.ro.text = rok + '/' + _global.rokmax;
startReloading();
} else {
_global.playsfx('noroket');
}
}
function startReloading() {
reloadComplete = false;
reloadTimer = setInterval(this, 'gunReloaded', reloadSpeed);
}
function gunReloaded() {
clearInterval(reloadTimer);
if (rok > 0) {
roketi._alpha = 75;
}
reloadComplete = true;
}
function doFollow(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
follower.moveDistanceX = turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = missileSpeed * follower.moveX / follower.totalmove;
follower.moveY = missileSpeed * follower.moveY / follower.totalmove;
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = 180 * Math.atan2(follower.moveY, follower.moveX) / Math.PI;
doTrail(follower._x, follower._y, 'particle_smoke_clear');
var v7 = follower._x - target._x;
var v6 = follower._y - target._y;
var v8 = Math.sqrt(v7 * v7 + v6 * v6);
if (v8 < 10) {
placeBoom(target._x, target._y);
var v4 = spiders.length;
while (v4--) {
var v2 = spiders[v4];
if (v2 == target) {
removeSpider(v2);
++_global.kill1;
}
}
v4 = Sspiders.length;
while (v4--) {
v2 = Sspiders[v4];
if (v2 == target) {
removeSSpider(v2);
++_global.kill1;
}
}
v4 = enemiesArray.length;
while (v4--) {
v2 = enemiesArray[v4];
if (v2 == target) {
removeEnemy(v2);
++_global.kill1;
}
}
removeMovieClip(target);
removeMovieClip(follower);
}
if (follower.hitTest(sun)) {
_global.playsfx('hit');
placeBoom1(follower._x, follower._y);
removeMovieClip(follower);
}
if (!target._x) {
removeMovieClip(follower);
delete follower.onEnterFrame;
}
}
function doTrail(targetX, targetY, type) {
++lev;
var v3 = _root.attachMovie(type, type + lev, lev);
v3._x = targetX;
v3._y = targetY;
v3._rotation = random(360);
randomScale = random(75) + 25;
v3._xscale = randomScale;
randomScale = random(75) + 25;
v3._yscale = randomScale;
v3.speed = random(10) + 5;
updateAfterEvent();
v3.onEnterFrame = function () {
this._xscale += this.speed;
this._yscale += this.speed;
this._alpha -= this.speed;
if (this._alpha <= 0) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
}
function createEnemies(enemyAmount, enemyBehavior, enemyLibraryClip, Q, W) {
var v4 = 0;
while (v4 < enemyAmount) {
++lev;
if (enemyLibraryClip == 'e1') {
var v3 = enemA.duplicateMovieClip('ee' + lev, lev);
}
if (enemyLibraryClip == 'e4') {
v3 = enemD.duplicateMovieClip('ee' + lev, lev);
}
if (Q == 0 && W == 0) {
v3._x = random(Stage.width);
v3._y = random(Stage.height);
} else {
v3._x = Q;
v3._y = W;
}
v3._rotation = random(360);
if (enemyBehavior == 'typeA') {
v3.speed = Math.random() + 1;
v3.turnRate = 0.1;
v3.agroRange = 300;
v3.mode = 'follow';
v3.lif = 10 + respkof3;
v3.tt = 1;
v3.TtimeS = Math.floor(Math.random() * 20) + 60;
} else {
if (enemyBehavior == 'typeD') {
v3.speed = Math.random() * 4 + 1;
v3.turnRate = 0.5;
v3.agroRange = 300;
v3.mode = 'follow';
v3.lif = 20;
v3.tt = 4;
v3.TtimeS = Math.floor(Math.random() * 20) + 20;
}
}
v3.distanceX = 0;
v3.distanceY = 0;
v3.distanceTotal = 0;
v3.moveDistanceX = 0;
v3.moveDistanceY = 0;
v3.moveX = 0;
v3.moveY = 0;
v3.totalmove = 0;
v3.timeS = 0;
v3.onRollOver = function () {
_global.trgt = this;
};
enemiesArray.push(v3);
++v4;
}
}
function updateEnemies() {
var v3 = 0;
while (v3 < enemiesArray.length) {
var v2 = enemiesArray[v3];
updatePosition(v2, hero);
if (v2.tt == 1) {
if (v2.timeS++ > v2.TtimeS) {
v2.timeS = 0;
placeVolna(v2);
if (_global.Detal == 2) {
placeVolnaboom(v2._x, v2._y);
}
}
}
if (v2.tt == 4) {
if (v2.timeS++ > v2.TtimeS) {
if (Math.abs(hero._x - v2._x) < 150 && Math.abs(hero._y - v2._y) < 150) {
v2.timeS = 0;
fireLight(v2._x, v2._y, hero._x, hero._y);
if (!ud) {
var v4 = shild - 3;
if (v4 < 0) {
life += v4;
shild = 0;
} else {
shild -= 3;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
}
}
}
++v3;
}
}
function updatePosition(follower, target) {
follower.distanceX = target._x - follower._x;
follower.distanceY = target._y - follower._y;
follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
if (follower.distanceTotal <= follower.agroRange) {
follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal;
follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal;
follower.moveX += follower.moveDistanceX;
follower.moveY += follower.moveDistanceY;
follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
follower.moveX = follower.speed * follower.moveX / follower.totalmove;
follower.moveY = follower.speed * follower.moveY / follower.totalmove;
if (follower.mode == 'follow') {
follower._x += follower.moveX;
follower._y += follower.moveY;
follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians;
} else {
if (follower.mode == 'run') {
if (follower._x - follower.moveX >= 0 && follower._x - follower.moveX <= 700) {
follower._x -= follower.moveX;
}
if (follower._y - follower.moveY >= 0 && follower._y - follower.moveY <= 600) {
follower._y -= follower.moveY;
}
follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians + 180;
}
}
}
if (follower._x < 0) {
follower._x = 0;
}
if (follower._x > 700) {
follower._x = 700;
}
if (follower._y < 0) {
follower._y = 0;
}
if (follower._y > 600) {
follower._y = 600;
}
}
function removeEnemy(s) {
var v4 = enemiesArray.length;
while (v4--) {
var v2 = enemiesArray[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
enemiesArray.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function placeSpider(A, B) {
++lev;
var d = spider.duplicateMovieClip('z' + lev, lev);
if (A == 0 && B == 0) {
d._y = fon._y + Math.random() * fon._height;
if (Math.random() < 0.5) {
d._x = fon._x - d._width / 2;
} else {
d._x = fon._x + fon._width + d._width / 2;
}
} else {
d._x = A;
d._y = B;
}
var v6 = hero._x - d._x;
var v5 = hero._y - d._y;
d.a = Math.atan2(v5, v6);
d._rotation = (d.a / Math.PI) * 180;
d.speed = Math.random() * 2 + 2;
d.onEnterFrame = function () {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
this.a = Math.atan2(v5, v6);
this._rotation = (this.a / Math.PI) * 180;
var v8 = Math.sqrt(v6 * v6 + v5 * v5);
if (v8 < 25 && !placed) {
_global.playsfx('hittestmob');
placeBoom2(hero._x, hero._y);
if (!ud) {
var v7 = shild - 10;
if (v7 < 0) {
life += v7;
shild = 0;
} else {
shild -= 10;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = spiders.length;
while (v3--) {
var v4 = spiders[v3];
if (v4 == d) {
spiders.splice(v3, 1);
}
}
v3 = needBePaused.length;
while (v3--) {
v4 = needBePaused[v3];
if (v4 == d) {
needBePaused.splice(v3, 1);
}
}
}
};
d.onRollOver = function () {
_global.trgt = this;
};
spiders.push(d);
d.lif = 3 + respkof1;
}
function removeSpider(s) {
var v4 = spiders.length;
while (v4--) {
var v2 = spiders[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
spiders.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function placeSSpider(A, B) {
++lev;
var Sd = Sspider.duplicateMovieClip('Sz' + lev, lev);
if (A == 0 && B == 0) {
Sd._y = fon._y + Math.random() * fon._height;
if (Math.random() < 0.5) {
Sd._x = fon._x - Sd._width / 2;
} else {
Sd._x = fon._x + fon._width + Sd._width / 2;
}
} else {
Sd._x = A;
Sd._y = B;
}
var v6 = hero._x - Sd._x;
var v7 = hero._y - Sd._y;
Sd.a = Math.atan2(v7, v6);
Sd._rotation = (Sd.a / Math.PI) * 180;
Sd.speed = Math.random() + 0.5;
Sd.timeS = 0;
Sd.TtimeS = Math.floor(Math.random() * 20) + 14;
var back = 0;
Sd.onEnterFrame = function () {
if (back == 0) {
this._x += this.speed * Math.cos(this.a);
this._y += this.speed * Math.sin(this.a);
}
if (back == 2) {
this._x += -this.speed * Math.cos(this.a);
this._y += -this.speed * Math.sin(this.a);
}
var v6 = hero._x - this._x;
var v7 = hero._y - this._y;
this.a = Math.atan2(v7, v6);
this._rotation = (this.a / Math.PI) * 180;
if (this.timeS++ > this.TtimeS) {
this.timeS = 0;
placeEbul(Sd, 1);
}
var v5 = Math.sqrt(v6 * v6 + v7 * v7);
if (v5 < 180) {
if (back == 0) {
back = 1;
}
}
if (v5 < 120) {
back = 2;
}
if (v5 >= 180) {
back = 0;
}
if (v5 < 25 && !Splaced) {
_global.playsfx('hittestmob');
placeBoom2(hero._x, hero._y);
if (!ud) {
var v8 = shild - 15;
if (v8 < 0) {
life += v8;
shild = 0;
} else {
shild -= 15;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Sspiders.length;
while (v3--) {
var v4 = Sspiders[v3];
if (v4 == Sd) {
Sspiders.splice(v3, 1);
}
}
v3 = needBePaused.length;
while (v3--) {
v4 = needBePaused[v3];
if (v4 == Sd) {
needBePaused.splice(v3, 1);
}
}
}
};
Sd.onRollOver = function () {
_global.trgt = this;
};
Sspiders.push(Sd);
Sd.Slif = 5 + respkof2;
}
function removeSSpider(s) {
var v4 = Sspiders.length;
while (v4--) {
var v2 = Sspiders[v4];
if (v2 == s) {
delete v2.onEnterFrame;
_global.playsfx('exp');
Sspiders.splice(v4, 1);
}
}
var v3 = needBePaused.length;
while (v3--) {
var v5 = needBePaused[v3];
if (v5 == s) {
needBePaused.splice(v3, 1);
}
}
}
function fireLight(xStart, yStart, xEnd, yEnd) {
++lev;
_global.playsfx('molniya');
var temp = effectHolder.duplicateMovieClip('efho' + lev, lev);
temp.time = 5;
temp.onEnterFrame = function () {
temp.clear();
temp.lineStyle(lightningWidth, lightningColor, lightningAlpha, true);
var v13 = xStart - xEnd;
var v11 = yStart - yEnd;
var v12 = Math.sqrt(v13 * v13 + v11 * v11);
var v9 = v12 / lightningFrequency;
var v3 = Math.atan2(yStart - yEnd, xStart - xEnd);
var v10 = v12 / v9;
var v8 = 0;
while (v8 < lightningBranches) {
temp.moveTo(xStart, yStart);
var v2 = 1;
while (v2 < v9 + 1) {
var v5 = v10 * v2;
var v4 = random(lightningOffset - lightningOffset / 2);
var v6 = xStart - Math.cos(v3) * v5 + Math.cos(v3 + 1.55) * v4;
var v7 = yStart - Math.sin(v3) * v5 + Math.sin(v3 + 1.55) * v4;
temp.lineTo(v6, v7);
++v2;
}
++v8;
}
if (this.time-- <= 0) {
temp.removeMovieClip();
}
};
temp.lineTo(xEnd, yEnd);
addSparkles(xEnd, yEnd, sparkNumber, sparkDistance, sparkSize);
}
function startLReloading(a) {
reloadLComplete = false;
reloadLTimer = setInterval(this, 'gunLReloaded', reloadLSpeed);
screenLTimer = setInterval(this, 'clearScreen', clearSpeed);
}
function clearScreen() {
clearInterval(screenTimer);
delete effectHolder.onEnterFrame;
effectHolder.clear();
}
function gunLReloaded() {
clearInterval(reloadLTimer);
reloadLComplete = true;
}
function addSparkles(_targetX, _targetY, _sparkNumber, _distance, _sparkSize) {
var v6 = 0;
while (v6 < _sparkNumber) {
var v4 = _root.attachMovie('spark', 'spark_' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
var v3 = _root.attachMovie('spark2', 'spark2_' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v4._x = _targetX + random(_distance) - _distance / 2;
v4._y = _targetY + random(_distance) - _distance / 2;
v3._x = _targetX + random(_distance) - _distance / 2;
v3._y = _targetY + random(_distance) - _distance / 2;
var v5 = random(_sparkSize) + _sparkSize / 4;
v4._xscale = v5;
v4._yscale = v5;
v5 = random(_sparkSize) + _sparkSize / 4;
v3._xscale = v5;
v3._yscale = v5;
v3._rotation = random(359);
v4._alpha = lightningAlpha;
v3._alpha = lightningAlpha;
++v6;
}
}
stop();
_global.perehod = 0;
if (_global.SoundM != false) {
mpause.stop();
msystem.stop();
mmenu.stop();
mbos.stop();
mbos.start(0, 500);
}
_global.sa1 = 1;
_global.sa2 = 1;
_global.sa3 = 1;
var stren = _global.str;
heroab.swapDepths(1000002);
menuab.swapDepths(1000003);
con.swapDepths(1000004);
_global.bio1 = 0;
_global.min1 = 0;
_global.gas1 = 0;
_global.kill1 = 0;
_global.restartlvl = false;
_global.kill1 = 0;
_global.timeall = 0;
cap1.cap11.cap111.text = 'SURVIVE AS LONG AS YOU CAN';
cap1.gotoAndPlay(1);
_global.pauseall = false;
_global.steptmp = 0;
_global.pausetimestart = 0;
_global.pausetimestop = 0;
_global.pausetimeall = 0;
needBePaused = new Array();
_global.addToPause = function (obj) {
if (!obj._inPause) {
needBePaused.push(obj);
obj._inPause = true;
}
};
var koff = 1;
finplay = function () {
finangle += 10;
if (koff < 30) {
koff += 0.5;
}
finr_ang = finangle / 57.29577951308232;
finmc._x = 500 + koff * Math.cos(finr_ang);
finmc._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc._x, finmc._y, 'particle_smoke_clear');
finr_ang = (finangle + 180) / 57.29577951308232;
finmc1._x = 500 + koff * Math.cos(finr_ang);
finmc1._y = 430 + koff * Math.sin(finr_ang);
doTrail(finmc1._x, finmc1._y, 'particle_smoke_clear');
};
_global.setPause = function (flag) {
isPause = flag;
var v3 = needBePaused.length;
while (v3--) {
var v2 = needBePaused[v3];
if (flag) {
v2.stop();
v2.oef = v2.onEnterFrame;
v2.onEnterFrame = null;
} else {
v2.onEnterFrame = v2.oef;
v2.play();
}
}
if (flag) {
_global.pausetimestart = int(getTimer() / 1000);
} else {
_global.pausetimestop = int(getTimer() / 1000);
_global.pausetimeall += _global.pausetimestart - _global.pausetimestop;
}
};
min1.text = _global.GAS + '/300';
min2.text = _global.MIN + '/150';
min3.text = _global.BIO + '/50';
samc._width = 0;
samc._x = 350;
var angl = 0;
var Xx = mob1c._x - sun._x;
var Yy = mob1c._y - sun._y;
if (Xx == 0) {
if (Yy >= 0) {
angl = 270;
} else {
angl = 90;
}
} else {
if (Xx > 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
angl = Math.atan(Yy / Xx) / 0.0174532925199433;
} else {
angl = Math.atan(Yy / Xx) / 0.0174532925199433 - 180;
}
}
}
var myList = mob1c.mob1cc.filters;
myList[1].angle = angl;
myList[0].color = 11132159;
mob1c.mob1cc.filters = myList;
_global.SAE = 0;
var SAc = 0;
var ud = false;
var radiu = _global.rad;
var life = _global.arm;
var shild = _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
heroab.h1._width = 50 * _global.arm / 300;
heroab.h2._width = 50 * _global.def / 200;
heroab.h3._width = 50 * _global.spe / 7;
heroab.h4._width = 50 * stren / 2.2;
heroab.h5._width = 50 * _global.rad / 4;
var rok = _global.rokmax;
roketi.ro.text = rok + '/' + _global.rokmax;
_global.step = _global.spe;
var checkup = 1;
var checkup1 = 1;
var rotDirSpeed = 5;
var angle = Math.random() * 100;
var finangle = Math.random() * 100;
var spiderCount = 0;
var SspiderCount = 0;
var lev = 0;
var timeb = int(getTimer() / 100);
var timenasys = int(getTimer() / 1000);
_global.timeall = 0;
var fire = false;
heroab._visible = false;
menuab._visible = false;
con._visible = false;
boom._visible = false;
boom1._visible = false;
boom2._visible = false;
var resp1Ttime = 120;
var resptime1 = 0;
var respkof1 = 0;
var resp2Ttime = 180;
var resptime2 = 0;
var respkof2 = 0;
var resp3Ttime = 260;
var resptime3 = 0;
var respkof3 = 0;
fafa._visible = false;
var bitmapsArray;
var particleBitmapsArray;
bitmapsArray = ['effect-fire5.png', 'effect-fire6.png', 'effect-fire7.png', 'effect-fire8.png', 'effect-fire9.png'];
particleBitmapsArray = ['particle.jpg', 'particle1.png', 'particle5.png'];
var Gass = new Array();
placeGas = function (A, B) {
++lev;
var d = gas.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.GAS < 300) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Gass.length;
while (v3--) {
var v4 = Gass[v3];
if (v4 == d) {
Gass.splice(v3, 1);
}
}
_global.GAS += 1;
++_global.gas1;
_global.playsfx('collected');
min1.text = _global.GAS + '/300';
}
};
Gass.push(d);
};
var Minerals = new Array();
placeMineral = function (A, B) {
++lev;
var d = mineral.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.MIN < 150) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Minerals.length;
while (v3--) {
var v4 = Minerals[v3];
if (v4 == d) {
Minerals.splice(v3, 1);
}
}
_global.MIN += 1;
++_global.min1;
_global.playsfx('collected');
min2.text = _global.MIN + '/150';
}
};
Minerals.push(d);
};
var Bios = new Array();
placeBio = function (A, B) {
++lev;
var d = bio.duplicateMovieClip('b' + lev, lev);
d._x = A;
d._y = B;
d.onEnterFrame = function () {
var v6 = hero._x - this._x;
var v5 = hero._y - this._y;
var v7 = Math.sqrt(v6 * v6 + v5 * v5);
if (v7 < 25 && _global.BIO < 50) {
removeMovieClip(this);
delete this.onEnterFrame;
var v3 = Bios.length;
while (v3--) {
var v4 = Bios[v3];
if (v4 == d) {
Bios.splice(v3, 1);
}
}
_global.BIO += 1;
++_global.bio1;
_global.playsfx('collected');
min3.text = _global.BIO + '/50';
}
};
Bios.push(d);
};
var reloadSpeed = 1000;
var missileSpeed = 7;
var turnRate = 0.7;
var reloadTimer;
var reloadComplete = true;
bulletSpeed = 18;
placeBullet = function (tgt) {
++lev;
_global.playsfx('vistrel');
var v11 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v11);
globalToLocal(v11);
var v10 = bullet.duplicateMovieClip('b' + lev, lev);
v10._x = v11.x;
v10._y = v11.y;
v10._rotation = hero._rotation + hero.body._rotation;
v10.a = (v10._rotation / 180) * Math.PI;
v10.onEnterFrame = function () {
this._x += bulletSpeed * Math.cos(this.a);
this._y += bulletSpeed * Math.sin(this.a);
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.hitTest(sun)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl1)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl2)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl3)) {
_global.playsfx('hit');
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
var v9 = spiders.length;
while (v9--) {
var v3 = spiders[v9];
if (v3.hit.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 5 <= 220) {
SAc += 5;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v3.lif -= _global.rad * stren;
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v6 = 0;
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeSpider(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
} else {
v3.lif -= stren;
v3._yscale -= 10 * stren;
v3._xscale = v3._yscale;
if (SAE != 2) {
v3.speed -= 0.5 * stren;
}
this.removeMovieClip();
placeBoom1(v3._x, v3._y);
if (v3.lif <= 0) {
v3.gotoAndStop(2);
var v6 = 0;
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
removeSpider(v3);
++_global.kill1;
placeBoom(v3._x, v3._y);
}
}
}
}
var v7 = enemiesArray.length;
while (v7--) {
var v4 = enemiesArray[v7];
if (v4.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 3 <= 220) {
SAc += 3;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v4._x) < 128.5 && Math.abs(hero._y - v4._y) < 128.5) {
v4.lif -= _global.rad * stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.lif <= 0) {
v4.gotoAndStop(2);
v6 = 0;
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeEnemy(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
} else {
v4.lif -= stren;
this.removeMovieClip();
placeBoom1(v4._x, v4._y);
if (v4.lif <= 0) {
v4.gotoAndStop(2);
v6 = 0;
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v4._x - 10 + Math.random() * 20, v4._y - 10 + Math.random() * 20);
}
removeEnemy(v4);
++_global.kill1;
placeBoom(v4._x, v4._y);
}
}
}
}
var v8 = Sspiders.length;
while (v8--) {
var v5 = Sspiders[v8];
if (v5.Shit.hitTest(this)) {
_global.playsfx('hit');
if (_global.SAE == 0) {
if (SAc + 3 <= 220) {
SAc += 3;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
}
}
if (Math.abs(hero._x - v5._x) < 128.5 && Math.abs(hero._y - v5._y) < 128.5) {
v5.Slif -= _global.rad * stren;
this.removeMovieClip();
placeBoom1(v5._x, v5._y);
if (v5.Slif <= 0) {
v5.gotoAndStop(2);
v6 = 0;
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
removeSSpider(v5);
++_global.kill1;
placeBoom(v5._x, v5._y);
}
} else {
v5.Slif -= stren;
this.removeMovieClip();
placeBoom1(v5._x, v5._y);
if (v5.Slif <= 0) {
v5.gotoAndStop(2);
v6 = 0;
if (Math.random() > 0.5 + 0.5 * v6) {
placeGas(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v6) {
placeMineral(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v6) {
placeBio(v5._x - 10 + Math.random() * 20, v5._y - 10 + Math.random() * 20);
}
removeSSpider(v5);
++_global.kill1;
placeBoom(v5._x, v5._y);
}
}
}
}
};
};
placeVolna = function (tgt, ty) {
++lev;
var v3 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v3);
globalToLocal(v3);
_global.playsfx('volna');
var v4 = volna.duplicateMovieClip('b' + lev, lev);
v4._x = v3.x;
v4._y = v3.y;
v4.onEnterFrame = function () {
if (hero.foot.hitTest(this)) {
if (!ud) {
var v3 = shild - 1;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 1;
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
placeBoom1(hero._x, hero._y);
}
};
};
placeEbul = function (tgt, ty) {
++lev;
var v4 = {'x': tgt._x, 'y': tgt._y};
tgt._parent.localToGlobal(v4);
globalToLocal(v4);
if (ty == 1) {
_global.playsfx('zelenie');
var v3 = ebul.duplicateMovieClip('b' + lev, lev);
if (Math.floor(Math.random() * 2) == 1) {
v3._rotation = tgt._rotation + Math.random() * 10;
} else {
v3._rotation = tgt._rotation - Math.random() * 10;
}
v3.tt = 1;
v3.bsp = 10;
}
if (ty == 2) {
v3 = lazer.duplicateMovieClip('b' + lev, lev);
v3._rotation = tgt._rotation;
v3.tt = 3;
v3.bsp = 5;
}
if (ty == 3) {
v3 = little.duplicateMovieClip('b' + lev, lev);
v3._x = v4.x;
v3._y = v4.y;
v3._rotation = Math.atan2(hero._y - v3._y, hero._x - v3._x) * 57.29577951308232;
v3.tt = 2;
v3.bsp = 16;
}
v3._x = v4.x;
v3._y = v4.y;
v3.a = (v3._rotation / 180) * Math.PI;
v3.onEnterFrame = function () {
if (this.tt == 1) {
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this.tt == 3) {
this.bsp += 0.3;
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this.bsp += 0.3;
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this.tt == 2) {
this._x += this.bsp * _global.sa2 * Math.cos(this.a);
this._y += this.bsp * _global.sa2 * Math.sin(this.a);
}
if (this._x < fon._x - this._width || this._x > fon._x + fon._width + this._width || this._y < fon._y - this._height || this._y > fon._y + fon._height + this._height) {
this.removeMovieClip();
}
if (this.tt != 3) {
if (this.hitTest(sun)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl1)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl2)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
if (this.hitTest(pl3)) {
placeBoom1(this._x, this._y);
this.removeMovieClip();
}
}
if (hero.foot.hitTest(this)) {
_global.playsfx('hitme');
if (!ud) {
if (this.tt == 1 || this.tt == 3) {
var v3 = shild - 5;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 5;
}
}
if (this.tt == 2) {
v3 = shild - 1;
if (v3 < 0) {
life += v3;
shild = 0;
} else {
shild -= 1;
}
}
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
placeBoom1(hero._x, hero._y);
this.removeMovieClip();
}
};
};
var enemiesArray = new Array();
var radians = 57.29577951308232;
createEnemies(3, 'typeA', 'e1', 0, 0);
var spiders = new Array();
var Sspiders = new Array();
i = 3;
while (i--) {
placeSSpider(Math.floor(Math.random() * 200) + 500, Math.floor(Math.random() * 200) + 200);
}
i = 5;
while (i--) {
placeSpider(Math.floor(Math.random() * 200) + 500, Math.floor(Math.random() * 200) + 200);
}
onEnterFrame = function () {
var v10 = 0;
var v11 = hero.foot._x - sun._x;
var v13 = hero.foot._y - sun._y;
if (v11 == 0) {
if (v13 >= 0) {
v10 = 270;
} else {
v10 = 90;
}
} else {
if (v11 > 0) {
v10 = Math.atan(v13 / v11) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v10 = Math.atan(v13 / v11) / 0.0174532925199433;
} else {
v10 = Math.atan(v13 / v11) / 0.0174532925199433 - 180;
}
}
}
var v14 = hero.foot.filters;
v14[1].angle = v10;
hero.foot.filters = v14;
v10 = 0;
v11 = pl2._x - sun._x;
v13 = pl2._y - sun._y;
if (v11 == 0) {
if (v13 >= 0) {
v10 = 270;
} else {
v10 = 90;
}
} else {
if (v11 > 0) {
v10 = Math.atan(v13 / v11) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v10 = Math.atan(v13 / v11) / 0.0174532925199433;
} else {
v10 = Math.atan(v13 / v11) / 0.0174532925199433 - 180;
}
}
}
v14 = pl2.filters;
v14[1].angle = v10;
pl2.filters = v14;
v10 = 0;
v11 = pl1._x - sun._x;
v13 = pl1._y - sun._y;
if (v11 == 0) {
if (v13 >= 0) {
v10 = 270;
} else {
v10 = 90;
}
} else {
if (v11 > 0) {
v10 = Math.atan(v13 / v11) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v10 = Math.atan(v13 / v11) / 0.0174532925199433;
} else {
v10 = Math.atan(v13 / v11) / 0.0174532925199433 - 180;
}
}
}
v14 = pl1.filters;
v14[1].angle = v10;
pl1.filters = v14;
v10 = 0;
v11 = pl3._x - sun._x;
v13 = pl3._y - sun._y;
if (v11 == 0) {
if (v13 >= 0) {
v10 = 270;
} else {
v10 = 90;
}
} else {
if (v11 > 0) {
v10 = Math.atan(v13 / v11) / 0.0174532925199433 + 180;
} else {
if (Y >= 0) {
v10 = Math.atan(v13 / v11) / 0.0174532925199433;
} else {
v10 = Math.atan(v13 / v11) / 0.0174532925199433 - 180;
}
}
}
v14 = pl3.filters;
v14[1].angle = v10;
pl3.filters = v14;
if (Key.isDown(16) && !_global.pauseall) {
if (_global.trgt._width) {
fireWeapon(_global.trgt);
}
}
if (Key.isDown(32) && _global.SAE == 1 && !_global.pauseall) {
sap._alpha = 100;
_global.SAE = 2;
_global.playsfx('sastart');
if (_global.perstype == 1) {
stren *= 3;
cap1.cap11.cap111.text = 'EAGLE EYE!';
cap1.gotoAndPlay(1);
var v12 = hero.foot.filters;
v12[1].color = 16711680;
hero.foot.filters = v12;
}
if (_global.perstype == 3) {
_global.sa3 = 0.5;
_global.rad = 1;
cap1.cap11.cap111.text = 'NEUTRON ACCELERATION!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 2) {
var v7 = spiders.length;
while (v7--) {
var v5 = spiders[v7];
v5.speed *= 0.2;
}
v7 = Sspiders.length;
while (v7--) {
v5 = Sspiders[v7];
v5.speed *= 0.2;
}
v7 = enemiesArray.length;
while (v7--) {
v5 = enemiesArray[v7];
v5.speed *= 0.2;
}
_global.sa2 = 0.2;
cap1.cap11.cap111.text = 'TIME BOMB!';
cap1.gotoAndPlay(1);
}
if (_global.perstype == 5) {
ud = true;
cap1.cap11.cap111.text = 'ULTIMATE DEFENCE!';
cap1.gotoAndPlay(1);
v12 = hero.foot.filters;
v12[2].strength = 2;
hero.foot.filters = v12;
}
if (_global.perstype == 4) {
var v6 = enemiesArray.length;
while (v6--) {
var v3 = enemiesArray[v6];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
var v4 = 0.5;
if (Math.random() > 0.5 + 0.5 * v4) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v4) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v4) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeEnemy(v3);
++_global.kill1;
}
}
v6 = spiders.length;
while (v6--) {
v3 = spiders[v6];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v4 = 0.5;
if (Math.random() > 0.5 + 0.5 * v4) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v4) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v4) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeSpider(v3);
++_global.kill1;
}
}
v6 = Sspiders.length;
while (v6--) {
v3 = Sspiders[v6];
if (Math.abs(hero._x - v3._x) < 128.5 && Math.abs(hero._y - v3._y) < 128.5) {
v4 = 0.5;
if (Math.random() > 0.5 + 0.5 * v4) {
placeGas(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.7 + 0.3 * v4) {
placeMineral(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
if (Math.random() > 0.9 + 0.1 * v4) {
placeBio(v3._x - 10 + Math.random() * 20, v3._y - 10 + Math.random() * 20);
}
placeBoom(v3._x, v3._y);
v3.removeMovieClip();
removeSSpider(v3);
++_global.kill1;
}
}
hero.zone._alpha = 85;
SAc = 32;
cap1.cap11.cap111.text = 'ANNIHILATING FLASH!';
cap1.gotoAndPlay(1);
}
}
if ((Key.isDown(37) || Key.isDown(65)) && !_global.pauseall) {
hero._rotation -= rotDirSpeed;
} else {
if ((Key.isDown(39) || Key.isDown(68)) && !_global.pauseall) {
hero._rotation += rotDirSpeed;
}
}
var v17 = _xmouse - hero._x;
var v15 = _ymouse - hero._y;
var v16 = Math.atan2(v15, v17);
hero.body._rotation = -hero._rotation + (v16 / Math.PI) * 180;
var v9 = (hero._rotation / 180) * Math.PI;
if ((Key.isDown(38) || Key.isDown(87)) && !_global.pauseall) {
if (_global.step < 5) {
_global.step += 0.1;
}
if (checkup1 == 2) {
_global.step = 2;
checkup1 = 1;
}
hero.foot.play();
checkup = 1;
hero._x += _global.step * Math.cos(v9);
hero._y += _global.step * Math.sin(v9);
} else {
if (checkup == 1 && _global.step > 0) {
hero._x += _global.step * Math.cos(v9);
hero._y += _global.step * Math.sin(v9);
_global.step -= 0.1;
} else {
if (checkup == 2 && _global.step > 0) {
hero._x -= _global.step * Math.cos(v9);
hero._y -= _global.step * Math.sin(v9);
_global.step -= 0.1;
} else {
hero.foot.stop;
}
}
}
if (hero._x < 0) {
hero._x = 0;
}
if (hero._x > 700) {
hero._x = 700;
}
if (hero._y < 0) {
hero._y = 0;
}
if (hero._y > 600) {
hero._y = 600;
}
if (!_global.pauseall) {
angle += 0.2;
}
r_ang = angle / 57.29577951308232;
pl1._x = 317 + 100 * Math.cos(r_ang * 3);
pl1._y = 245 + 100 * Math.sin(r_ang * 3);
pl2._x = 317 + 200 * Math.cos(r_ang * 2);
pl2._y = 245 + 200 * Math.sin(r_ang * 2);
pl3._x = 317 + 300 * Math.cos(r_ang);
pl3._y = 245 + 200 * Math.sin(r_ang);
if (hero.foot.hitTest(sun) && !_global.pauseall) {
if (ud) {
if (shild + 1 > _global.def) {
shild = _global.def;
} else {
shild += 1;
}
} else {
if (shild + 5 > _global.def) {
shild = _global.def;
} else {
shild += 5;
}
life -= 1;
}
lifes._width = 200 * life / _global.arm;
shilds._width = 183 * shild / _global.def;
tehp.text = life + '% health';
teshi.text = 'shield ' + shild + '%';
}
if (spiderCount++ > respt1 && resp && _global.SAE != 2 && !_global.pauseall) {
spiderCount = 0;
placeSpider(0, 0);
}
if (SspiderCount++ > respt2 && resp && _global.SAE != 2 && !_global.pauseall) {
SspiderCount = 0;
placeSSpider(0, 0);
}
timebb = int(getTimer() / 100) - timeb;
if (fire && timebb >= 2 * _global.sa3) {
if (_global.uG == 1) {
placeBullet(hero.body.dot);
}
if (_global.uG == 2) {
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
if (_global.uG == 3) {
placeBullet(hero.body.dot);
placeBullet(hero.body1.dot);
placeBullet(hero.body2.dot);
}
timeb = int(getTimer() / 100);
}
if (_global.SAE == 2) {
if (SAc - 2 <= 0) {
SAc = 0;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 0;
sap._alpha = 0;
if (_global.perstype == 5) {
ud = false;
v12 = hero.foot.filters;
v12[2].strength = 0;
hero.foot.filters = v12;
}
if (_global.perstype == 1) {
stren /= 3;
v12 = hero.foot.filters;
v12[1].color = 16777215;
hero.foot.filters = v12;
}
if (_global.perstype == 3) {
_global.sa3 = 1;
_global.rad = radiu;
}
if (_global.perstype == 2) {
v7 = spiders.length;
while (v7--) {
v5 = spiders[v7];
v5.speed *= 5;
}
v7 = Sspiders.length;
while (v7--) {
v5 = Sspiders[v7];
v5.speed *= 5;
}
v7 = enemiesArray.length;
while (v7--) {
v5 = enemiesArray[v7];
v5.speed *= 5;
}
_global.sa2 = 1;
}
if (_global.perstype == 4) {
hero.zone._alpha = 5;
}
} else {
if (!_global.pauseall) {
SAc -= 2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
if (_global.perstype == 4) {
hero.zone._alpha -= 5;
}
if (_global.perstype == 2) {
if (shild + 2 > _global.def) {
shild = _global.def;
} else {
shild += 2;
}
shilds._width = 183 * shild / _global.def;
teshi.text = 'shield ' + shild + '%';
}
}
}
}
if (_global.step > 0) {
placeFire(hero.sop);
}
if (_global.SAE == 0 && !_global.pauseall) {
if (SAc + 0.2 <= 220) {
SAc += 0.2;
samc._x = 350 - SAc / 2;
samc._width = SAc;
} else {
SAc = 220;
samc._x = 350 - SAc / 2;
samc._width = SAc;
_global.SAE = 1;
sap._alpha = 75;
sap.gotoAndPlay(1);
_global.playsfx(saready);
}
}
if (_global.trgt._width && !_global.pauseall) {
trg._x = _global.trgt._x;
trg._y = _global.trgt._y;
} else {
trg._x = 1000;
trg._y = 1000;
}
if (!_global.pauseall) {
updateEnemies();
}
if (!_global.pauseall) {
_global.timeall = int(getTimer() / 1000) - timenasys + _global.pausetimeall;
systime.text = _global.timeall;
}
++resptime1;
if (resptime1 >= resp1Ttime && _global.SAE != 2 && !_global.pauseall) {
resptime1 = 0;
placeSpider(0, 0);
}
++resptime2;
if (resptime2 >= resp2Ttime && _global.SAE != 2 && !_global.pauseall) {
resptime2 = 0;
placeSSpider(0, 0);
}
++resptime3;
if (resptime3 >= resp3Ttime && _global.SAE != 2 && !_global.pauseall) {
resptime3 = 0;
_global.playsfx('resp');
createEnemies(1, 'typeD', 'e4', pl3._x, pl3._y);
}
switch (_global.timeall) {
case 20:
resp1Ttime = 100;
resp2Ttime = 160;
respkof1 = 0;
respkof2 = 0;
respkof3 = 0;
break;
case 40:
resp1Ttime = 70;
resp2Ttime = 150;
respkof1 = 0;
respkof2 = 0;
respkof3 = 0;
break;
case 80:
resp1Ttime = 60;
resp2Ttime = 140;
resp3Ttime = 200;
respkof1 = 1;
respkof2 = 1;
respkof3 = 1;
break;
case 120:
resp1Ttime = 40;
resp2Ttime = 130;
respkof1 = 2;
respkof2 = 3;
respkof3 = 4;
break;
case 160:
resp1Ttime = 30;
resp2Ttime = 120;
respkof1 = 4;
respkof2 = 6;
respkof3 = 10;
break;
case 220:
resp1Ttime = 30;
resp2Ttime = 110;
resp3Ttime = 160;
respkof1 = 5;
respkof2 = 8;
respkof3 = 12;
break;
case 260:
resp1Ttime = 30;
resp2Ttime = 100;
respkof1 = 8;
respkof2 = 12;
respkof3 = 15;
break;
case 360:
resp1Ttime = 30;
resp2Ttime = 90;
respkof1 = 10;
respkof2 = 15;
respkof3 = 20;
break;
case 460:
resp1Ttime = 30;
resp2Ttime = 80;
resp3Ttime = 120;
respkof1 = 15;
respkof2 = 20;
respkof3 = 30;
break;
case 500:
resp1Ttime = 30;
resp2Ttime = 60;
respkof1 = 20;
respkof2 = 30;
respkof3 = 40;
}
if (_global.restartlvl) {
var v8 = lev + 1;
while (v8--) {
removeMovieClip(_root.getInstanceAtDepth(v8));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(14);
}
if (life < 0 && !_global.pauseall) {
_global.playsfx('exp');
msystem.stop();
mbos.stop();
_global.playsfx('win');
lifes._width = 0;
_global.pauseall = true;
setPause(true);
hero._visible = false;
_global.step = 0;
placeBoom(hero._x, hero._y);
herob.enabled = false;
menub.enabled = false;
con._visible = true;
con.gotoAndPlay(1);
sap._visible = false;
}
if (_global.perehod == 1) {
gotoAndPlay(5);
}
if (_global.perehod == 2) {
v8 = lev + 1;
while (v8--) {
removeMovieClip(_root.getInstanceAtDepth(v8));
}
removeMovieClip(heroab);
removeMovieClip(menuab);
removeMovieClip(con);
gotoAndPlay(1);
}
};
onMouseDown = function () {
if (!_global.pauseall) {
fire = true;
}
};
onMouseUp = function () {
fire = false;
};
var lightningOffset = 12;
var lightningFrequency = 12;
var lightningWidth = 1;
var lightningColor = '0x5C98EF';
var lightningAlpha = 75;
var lightningBranches = 3;
var sparkNumber = 10;
var sparkDistance = 20;
var sparkSize = 100;
var reloadLSpeed = 200;
var clearSpeed = 200;
var glow_color = lightningColor;
var glow_alpha = 0.6;
var glow_blurX = 5;
var glow_blurY = 5;
var glow_strength = 2;
var glow_quality = 3;
var reloadLTimer;
var screenTimer;
var reloadLComplete = true;
var rotationLDirection;
var filter_glow = new flash.filters.GlowFilter(glow_color, glow_alpha, glow_blurX, glow_blurY, glow_strength, glow_quality);
effectHolder.filters = [filter_glow];
}
movieClip 1205 {
}
frame 15 {
stop();
}
instance tutor of movieClip 1081 {
onClipEvent (rollOver) {
_root.fire = false;
}
}