home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / gammabros.swf / scripts / __Packages / classes / enemy / DeathHead.as < prev    next >
Encoding:
Text File  |  2007-03-28  |  41.9 KB  |  1,242 lines

  1. class classes.enemy.DeathHead
  2. {
  3.    var x;
  4.    var y;
  5.    var clip;
  6.    var fire;
  7.    var transL;
  8.    var transR;
  9.    var colorTrans;
  10.    var eyes;
  11.    var f2;
  12.    var dir;
  13.    var moveScript;
  14.    var axis;
  15.    var xDest;
  16.    var yDest;
  17.    var wallDir;
  18.    var wallC;
  19.    var wallEP;
  20.    var ep;
  21.    var enemyType;
  22.    var darkL;
  23.    var oldF;
  24.    var oldDir;
  25.    var xMov = 0;
  26.    var yMov = 0;
  27.    var xMovT = 0;
  28.    var yMovT = 0;
  29.    var speedOrig = 6;
  30.    var speed = 6;
  31.    var xDestMet = false;
  32.    var yDestMet = false;
  33.    var c = 0;
  34.    var life = 3500;
  35.    var lifeOrig = 3500;
  36.    var nc = 0;
  37.    var xA = 0;
  38.    var yA = 0;
  39.    var nudging = false;
  40.    var hc = 0;
  41.    var power = 30;
  42.    var permitHit = false;
  43.    var phase = 1;
  44.    var cv = 0.25;
  45.    var dark = false;
  46.    var centered = false;
  47.    var cc = 0;
  48.    var Name = "deathHead";
  49.    function DeathHead()
  50.    {
  51.       this.x = 500;
  52.       this.y = 300;
  53.       _root.d = _root.d + 1;
  54.       this.clip = _root.attachMovie("deathHead","deathHeadClip",_root.d + 690000);
  55.       this.clip._x = this.x;
  56.       this.clip._y = this.y;
  57.       this.clip.gotoAndPlay("intro");
  58.       this.fire = new Object();
  59.       this.speedOrig = this.speed;
  60.       this.transL = new flash.geom.Transform(this.clip.eyeClip.eyeL);
  61.       this.transR = new flash.geom.Transform(this.clip.eyeClip.eyeR);
  62.       this.colorTrans = new flash.geom.ColorTransform(1,0,0,1,255,0,0,0);
  63.       this.eyes = new Object();
  64.       this.eyes.lO = 0;
  65.       this.eyes.rO = 14;
  66.       this.eyes.c = 0;
  67.       this.eyes.x = 0;
  68.       _root.stats.created = _root.stats.created + 1;
  69.       this.clip.teeth.gotoAndPlay("go");
  70.       this.f2 = "intro";
  71.       _root.lastBoss = true;
  72.    }
  73.    function intro()
  74.    {
  75.       this.c = this.c + 1;
  76.       if(Math.round(this.c / 10) == this.c / 10)
  77.       {
  78.          var _loc3_ = this.c / 10;
  79.          if(_loc3_ > 13)
  80.          {
  81.             _loc3_ = 13;
  82.          }
  83.          this.clip.eyeClip.eyeL.gotoAndStop(_loc3_ + this.eyes.lO);
  84.          this.clip.eyeClip.eyeR.gotoAndStop(_loc3_ + this.eyes.rO);
  85.       }
  86.       if(this.c == 150)
  87.       {
  88.          _root.audio.playLevel2("deathIntro",_root.randRange(20,25));
  89.          _root.audio.playLevel3("deathDrain",_root.randRange(15,20));
  90.          _root.powerUpDrain = new classes.fx.PowerUpDrain(_root[_root.char].x + 3,_root[_root.char].y + 3);
  91.          _root.addFX("powerUpDrain");
  92.          _root[_root.char].weapon = _root.bro1Weapon = _root.bro2Weapon = "laserA";
  93.          _root[_root.char].fireFreq = 11;
  94.          _root[_root.char].fireFreqOrig = 11;
  95.          _root.rapidVar = 4;
  96.       }
  97.       if(this.c > 150 && this.c < 170)
  98.       {
  99.          if(Math.round(this.c / 2) == this.c / 2)
  100.          {
  101.             this.clip.eyeClip.eyeL.blast.gotoAndStop(2);
  102.             this.clip.eyeClip.eyeR.blast.gotoAndStop(2);
  103.             _root[_root.char].colorFlash(255,255,255,2);
  104.          }
  105.          else
  106.          {
  107.             this.clip.eyeClip.eyeL.blast.gotoAndStop(1);
  108.             this.clip.eyeClip.eyeR.blast.gotoAndStop(1);
  109.          }
  110.       }
  111.       if(this.c == 170)
  112.       {
  113.          this.clip.eyeClip.eyeL.blast.gotoAndPlay(2);
  114.          this.clip.eyeClip.eyeR.blast.gotoAndPlay(2);
  115.          this.f2 = "wander";
  116.       }
  117.    }
  118.    function nudge(pxA, pyA, pscale)
  119.    {
  120.       this.nc = 0;
  121.       this.nudging = true;
  122.       var _loc2_ = pscale / 100;
  123.       this.xA = pxA * _loc2_;
  124.       this.yA = pyA * _loc2_;
  125.    }
  126.    function speedVar()
  127.    {
  128.       if(random(3) == 1)
  129.       {
  130.          this.speed *= _root.randRange2(0.9,1.1);
  131.       }
  132.       if(this.speed >= this.speedOrig * 1.3)
  133.       {
  134.          this.speed = this.speedOrig;
  135.       }
  136.    }
  137.    function parseMoveScript()
  138.    {
  139.       this.dir = this.moveScript[0];
  140.       if(this.dir == "break")
  141.       {
  142.          delete this.moveScript;
  143.       }
  144.       else
  145.       {
  146.          this[this.axis + "MovT"] = 0;
  147.          this.f2 = "gotoXYDest";
  148.          this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  149.          this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  150.          this.speedVar();
  151.          if(this.dir == "L" || this.dir == "U")
  152.          {
  153.             this[this.axis + "Dest"] = this[this.axis] - this.moveScript[1];
  154.          }
  155.          else
  156.          {
  157.             this[this.axis + "Dest"] = this[this.axis] + this.moveScript[1];
  158.          }
  159.          this.moveScript.splice(0,2);
  160.       }
  161.    }
  162.    function gotoXYDest()
  163.    {
  164.       if(Math.abs(this[this.axis + "Dest"] - this[this.axis]) < this.speed + 1)
  165.       {
  166.          if(this.axis == "x")
  167.          {
  168.             this.x = this.xDest;
  169.          }
  170.          else
  171.          {
  172.             this.y = this.yDest;
  173.          }
  174.          this.parseMoveScript();
  175.       }
  176.    }
  177.    function getDirString()
  178.    {
  179.       if(this.xMovT < -1)
  180.       {
  181.          this.dir = "L";
  182.       }
  183.       else if(this.xMovT > 1)
  184.       {
  185.          this.dir = "R";
  186.       }
  187.       else if(this.yMovT > 1)
  188.       {
  189.          this.dir = "D";
  190.       }
  191.       else if(this.yMovT < -1)
  192.       {
  193.          this.dir = "U";
  194.       }
  195.    }
  196.    function wander()
  197.    {
  198.       if(random(100) > 70 || (this.x > 950 || this.x < 50 || this.y < 50 || this.y > 550))
  199.       {
  200.          if(random(50) > 48)
  201.          {
  202.             this.wait();
  203.          }
  204.          else if(random(10) > 1)
  205.          {
  206.             this.dir = _root.getDir(this.x,this.y);
  207.             this[this.axis + "MovT"] = 0;
  208.             this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  209.             this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  210.             this.speedVar();
  211.          }
  212.          else
  213.          {
  214.             this[this.axis + "MovT"] = 0;
  215.             this.axis = random(10) <= 4 ? "y" : "x";
  216.             this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  217.             this.getDirString();
  218.          }
  219.       }
  220.       if(this.phase < 6)
  221.       {
  222.          if(random(200) > 197 + _root.dif.wait)
  223.          {
  224.             if(random(7) == 0 && !this.dark)
  225.             {
  226.                this.darkness();
  227.             }
  228.             else if(random(5) > 0)
  229.             {
  230.                this.fireLaser();
  231.             }
  232.             else if(!this.dark)
  233.             {
  234.                this.astroAttack();
  235.             }
  236.          }
  237.       }
  238.       else if(random(200) > 196 + _root.dif.wait)
  239.       {
  240.          if(random(2) > 0 && _root.chars.length < 4)
  241.          {
  242.             this.blackEnemies();
  243.          }
  244.          else if(random(3) > 0)
  245.          {
  246.             this.deathBallAttack();
  247.          }
  248.          else if(random(2) > 0)
  249.          {
  250.             this.fireLaser();
  251.          }
  252.          else if(this.x > 200 && this.x < 800)
  253.          {
  254.             this.wall();
  255.          }
  256.       }
  257.    }
  258.    function wall()
  259.    {
  260.       this.permitHit = false;
  261.       this.wallDir = random(2) != 0 ? "D" : "U";
  262.       this.xMovT = 0;
  263.       this.yMovT = 0;
  264.       this.f2 = "walling";
  265.       this.c = 0;
  266.       this.wallC = 0;
  267.       this.wallEP = _root.randRange(3,7);
  268.       this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,255,160,0,0);
  269.       this.transL.colorTransform = this.colorTrans;
  270.       this.transR.colorTransform = this.colorTrans;
  271.       this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  272.       this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  273.       _root.audio.playLevel2("deathWall",_root.randRange(15,20));
  274.    }
  275.    function walling()
  276.    {
  277.       this.c = this.c + 1;
  278.       if(this.c < 150)
  279.       {
  280.          var _loc5_ = this.wallDir != "U" ? 0.5 : -0.5;
  281.       }
  282.       else
  283.       {
  284.          _loc5_ = this.wallDir != "U" ? -0.5 : 0.5;
  285.       }
  286.       this.yMov = this.yMovT += _loc5_;
  287.       if(this.c == 300)
  288.       {
  289.          this.permitHit = true;
  290.          this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
  291.          this.transL.colorTransform = this.colorTrans;
  292.          this.transR.colorTransform = this.colorTrans;
  293.          this.f2 = "wander";
  294.          if(this.y > 650)
  295.          {
  296.             this.y = -40;
  297.          }
  298.          if(this.y < -50)
  299.          {
  300.             this.y = 620;
  301.          }
  302.       }
  303.       this.wallC = this.wallC + 1;
  304.       if(this.wallC >= this.wallEP)
  305.       {
  306.          var _loc3_ = this.x <= _root[_root.char].x ? "R" : "L";
  307.          var _loc6_ = _loc3_ != "R" ? -21 : 21;
  308.          _root.enemyShotID = _root.enemyShotID + 1;
  309.          _root["bugASwitchBlast" + _root.enemyShotID] = new classes.shots.BugASwitchBlast(this.x + _loc6_,this.y + 21,_loc3_,_root.enemyShotID,true);
  310.          _root.addEnemyShot("bugASwitchBlast" + _root.enemyShotID);
  311.          _root.audio.playLevel3("deathWallFire" + (random(3) + 1),_root.randRange(12,16));
  312.          this.wallEP = _root.randRange(3,7);
  313.          this.wallC = 0;
  314.       }
  315.       if(this.c > 45 && this.c < 245)
  316.       {
  317.          if(random(4) == 0)
  318.          {
  319.             var _loc4_ = this.x <= _root[_root.char].x ? 2 : 1;
  320.             _root.fxID = _root.fxID + 1;
  321.             _root["deathWallFX" + _root.fxID] = new classes.fx.DeathWallFX(this.x,this.y,this.wallDir,_loc4_,_root.fxID);
  322.             _root.addFX("deathWallFX" + _root.fxID);
  323.          }
  324.       }
  325.    }
  326.    function blackEnemies()
  327.    {
  328.       this.cc = 0;
  329.       this.ep = _root.randRange(8,30);
  330.       this.f2 = "creatingEnemies";
  331.       this.enemyType = _root.randRange(1,4);
  332.       _root.audio.playLevel2("deathEnemyLaunch",_root.randRange(20,25));
  333.    }
  334.    function creatingEnemies()
  335.    {
  336.       this.cc = this.cc + 1;
  337.       this.xA = _root.randRange2(-3,3);
  338.       this.yA = _root.randRange2(-3,3);
  339.       var _loc3_ = ["L","R","U","D"];
  340.       if(Math.round(this.cc / 2) == this.cc / 2)
  341.       {
  342.          this["createEnemy" + this.enemyType](_loc3_[random(4)]);
  343.       }
  344.       if(this.cc >= this.ep)
  345.       {
  346.          this.f2 = "wander";
  347.          this.xA = this.yA = 0;
  348.       }
  349.    }
  350.    function deathBallAttack()
  351.    {
  352.       _root.audio.playLevel2("deathBallLaunch",_root.randRange(12,18));
  353.       this.cc = 0;
  354.       this.ep = _root.randRange(10,26);
  355.       this.f2 = "deathBallAttacking";
  356.       this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  357.       this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  358.    }
  359.    function deathBallAttacking()
  360.    {
  361.       this.cc = this.cc + 1;
  362.       if(Math.round(this.cc / 2) == this.cc / 2)
  363.       {
  364.          this.deathBall();
  365.          this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,_root.randRange(-150,150),_root.randRange(-10,10),_root.randRange(-10,10),0);
  366.          this.transL.colorTransform = this.colorTrans;
  367.          this.transR.colorTransform = this.colorTrans;
  368.       }
  369.       if(this.cc >= this.ep)
  370.       {
  371.          this.f2 = "wander";
  372.          this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
  373.          this.transL.colorTransform = this.colorTrans;
  374.          this.transR.colorTransform = this.colorTrans;
  375.       }
  376.    }
  377.    function deathBall()
  378.    {
  379.       _root.enemyShotID = _root.enemyShotID + 1;
  380.       _root["deathBall" + _root.enemyShotID] = new classes.shots.DeathBall(this.x,this.y,this.xMov * -1,this.yMov * -1,_root.enemyShotID);
  381.       _root.addEnemyShot("deathBall" + _root.enemyShotID);
  382.    }
  383.    function darkness()
  384.    {
  385.       this.f2 = "darkening";
  386.       this.dark = true;
  387.       this.c = 0;
  388.       _root.attachMovie("deathDark","deathDarkClip",25);
  389.       _root.deathDarkClip._x = 0;
  390.       _root.deathDarkClip._y = 0;
  391.       this.darkL = _root.randRange(150,240);
  392.       this.speed *= 1.5;
  393.       _root.audio.playLevel2("deathDark2",_root.randRange(20,25));
  394.    }
  395.    function darkening()
  396.    {
  397.       this.c = this.c + 1;
  398.       if(random(100) > 50 || (this.x > 950 || this.x < 50 || this.y < 50 || this.y > 550))
  399.       {
  400.          if(random(10) > 1)
  401.          {
  402.             this.dir = _root.getDir(this.x,this.y);
  403.             this[this.axis + "MovT"] = 0;
  404.             this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  405.             this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  406.             this.speedVar();
  407.          }
  408.          else
  409.          {
  410.             this[this.axis + "MovT"] = 0;
  411.             this.axis = random(10) <= 4 ? "y" : "x";
  412.             this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  413.             this.getDirString();
  414.          }
  415.       }
  416.       if(this.c < 26)
  417.       {
  418.          if(Math.round(this.c / 2) == this.c / 2)
  419.          {
  420.             var _loc3_ = this.c / 2;
  421.             if(_loc3_ > 13)
  422.             {
  423.                _loc3_ = 13;
  424.             }
  425.             this.clip.eyeClip.eyeL.gotoAndStop(_loc3_ + this.eyes.lO);
  426.             this.clip.eyeClip.eyeR.gotoAndStop(_loc3_ + this.eyes.rO);
  427.          }
  428.          this.clip.cover._alpha = 100 - this.c * 4;
  429.       }
  430.       if(this.c > 25)
  431.       {
  432.          this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  433.          this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  434.       }
  435.       if(this.c == 30)
  436.       {
  437.          _root.deathDarkClip.play();
  438.          this.clip.cover._alpha = 0;
  439.       }
  440.       if(this.c > 30 && this.c < 60)
  441.       {
  442.          var _loc5_ = 1 - (this.c - 30) / 30;
  443.          var _loc4_ = - (this.c - 30) * 8.5;
  444.          this.colorTrans = new flash.geom.ColorTransform(_loc5_,_loc5_,_loc5_,1,_loc4_,_loc4_,_loc4_,0);
  445.          this.transL.colorTransform = this.colorTrans;
  446.          this.transR.colorTransform = this.colorTrans;
  447.       }
  448.       if(this.c > 60 && this.c < 90)
  449.       {
  450.          _loc5_ = (this.c - 60) / 30;
  451.          _loc4_ = -255 + (this.c - 60) * 8.5;
  452.          this.colorTrans = new flash.geom.ColorTransform(_loc5_,_loc5_,_loc5_,1,_loc4_,_loc4_,_loc4_,0);
  453.          this.transL.colorTransform = this.colorTrans;
  454.          this.transR.colorTransform = this.colorTrans;
  455.       }
  456.       if(_root.deathDarkClip.end)
  457.       {
  458.          _root.deathDarkClip.removeMovieClip();
  459.          this.clip.cover._alpha = 100;
  460.          this.dark = false;
  461.          this.f2 = "wander";
  462.          this.speed = this.speedOrig;
  463.       }
  464.    }
  465.    function astroAttack()
  466.    {
  467.       this.f2 = "astroAttacking";
  468.       this.c = 0;
  469.       this.xMovT = 0;
  470.       this.yMovT = 0;
  471.       var _loc4_ = 0;
  472.       var _loc5_ = _root.randRange(5,9);
  473.       while(_loc4_ < _loc5_)
  474.       {
  475.          var _loc3_ = random(4);
  476.          _root.fxID = _root.fxID + 1;
  477.          _root["asteroidD" + _root.fxID] = new classes.fx.AsteroidD(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),_root.randRange(4,5),_root.dirArray[_loc3_],_root.fxID);
  478.          _root.addFX("asteroidD" + _root.fxID);
  479.          _loc4_ = _loc4_ + 1;
  480.       }
  481.    }
  482.    function astroAttacking()
  483.    {
  484.       this.c = this.c + 1;
  485.       if(this.c < 30)
  486.       {
  487.          if(Math.round(this.c / 2) == this.c / 2)
  488.          {
  489.             var _loc5_ = this.c / 2;
  490.             if(_loc5_ > 13)
  491.             {
  492.                _loc5_ = 13;
  493.             }
  494.             this.clip.eyeClip.eyeL.gotoAndStop(_loc5_ + this.eyes.lO);
  495.             this.clip.eyeClip.eyeR.gotoAndStop(_loc5_ + this.eyes.rO);
  496.          }
  497.       }
  498.       if(this.c > 45 && this.c < 65)
  499.       {
  500.          var _loc6_ = this.c >= 55 ? 1 - (this.c - 54) / 10 : (this.c - 45) / 10;
  501.          this.xA = _root.randRange2(-6,6) * _loc6_;
  502.          this.yA = _root.randRange2(-6,6) * _loc6_;
  503.       }
  504.       if(this.c == 55)
  505.       {
  506.          _root.audio.playLevel2("deathAstCrush",_root.randRange(40,50));
  507.          var _loc3_ = 0;
  508.          var _loc4_ = _root.FX.length;
  509.          while(_loc3_ < _loc4_)
  510.          {
  511.             _root[_root.FX[_loc3_]].explode();
  512.             _loc3_ = _loc3_ + 1;
  513.          }
  514.       }
  515.       if(this.c == 65)
  516.       {
  517.          this.xA = this.yA = 0;
  518.       }
  519.       if(this.c == 68)
  520.       {
  521.          _root.audio.playLevel2("deathAstGuide",_root.randRange(24,29));
  522.          _loc3_ = 0;
  523.          _loc4_ = _root.FX.length;
  524.          while(_loc3_ < _loc4_)
  525.          {
  526.             _root[_root.FX[_loc3_]].stopMov();
  527.             _loc3_ = _loc3_ + 1;
  528.          }
  529.       }
  530.       if(this.c == 78)
  531.       {
  532.          _loc3_ = 0;
  533.          _loc4_ = _root.FX.length;
  534.          while(_loc3_ < _loc4_)
  535.          {
  536.             _root[_root.FX[_loc3_]].attack();
  537.             _loc3_ = _loc3_ + 1;
  538.          }
  539.       }
  540.       if(this.c == 90)
  541.       {
  542.          this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  543.          this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  544.          this.oldF = this.clip.eyeClip.eyeL._currentframe - this.eyes.lO;
  545.          this.f2 = "wander";
  546.       }
  547.    }
  548.    function wait()
  549.    {
  550.       this[this.axis + "MovT"] = 0;
  551.       this.f2 = "waiting";
  552.       this.c = 0;
  553.       this.ep = _root.randRange(30,120);
  554.       this.clip.teeth.gotoAndStop("stop");
  555.    }
  556.    function waiting()
  557.    {
  558.       this.c = this.c + 1;
  559.       if(this.c >= this.ep)
  560.       {
  561.          this.f2 = "wander";
  562.          this.clip.teeth.gotoAndPlay("go");
  563.          if(random(10) > 2)
  564.          {
  565.             this.dir = _root.getDir(this.x,this.y);
  566.             this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  567.             this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  568.             this.speedVar();
  569.          }
  570.          else
  571.          {
  572.             this.axis = random(10) <= 4 ? "y" : "x";
  573.             this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  574.             this.getDirString();
  575.          }
  576.       }
  577.    }
  578.    function fireLaser()
  579.    {
  580.       this.xMovT = 0;
  581.       this.yMovT = 0;
  582.       this.fire.c = 0;
  583.       this.f2 = "firing";
  584.       _root.audio.playLevel3("deathLaserFire",_root.randRange(15,20));
  585.       this.fire.eyesA = 100;
  586.       this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  587.       this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  588.       this.colorTrans = new flash.geom.ColorTransform(0,0,0,1,-255,-255,-255,0);
  589.       this.transL.colorTransform = this.colorTrans;
  590.       this.transR.colorTransform = this.colorTrans;
  591.    }
  592.    function firing()
  593.    {
  594.       this.fire.c = this.fire.c + 1;
  595.       if(this.fire.c < 15)
  596.       {
  597.          if(this.fire.eyesA == 0)
  598.          {
  599.             this.fire.eyesA = 100;
  600.             this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
  601.          }
  602.          else
  603.          {
  604.             this.colorTrans = new flash.geom.ColorTransform(0,0,0,1,-255,-255,-255,0);
  605.             this.fire.eyesA = 0;
  606.          }
  607.          this.transL.colorTransform = this.colorTrans;
  608.          this.transR.colorTransform = this.colorTrans;
  609.       }
  610.       if(this.fire.c == 15)
  611.       {
  612.          this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
  613.          this.transL.colorTransform = this.colorTrans;
  614.          this.transR.colorTransform = this.colorTrans;
  615.          this.clip.eyeClip.eyeL.blast.play();
  616.          this.clip.eyeClip.eyeR.blast.play();
  617.          var _loc3_ = _root.getDir(this.x,this.y);
  618.          if(_loc3_ == "L")
  619.          {
  620.             var _loc4_ = this.x - 51;
  621.             var _loc5_ = this.y + 6;
  622.          }
  623.          else if(_loc3_ == "R")
  624.          {
  625.             _loc4_ = this.x + 21;
  626.             _loc5_ = this.y + 6;
  627.          }
  628.          else if(_loc3_ == "U")
  629.          {
  630.             _loc4_ = this.x + 12;
  631.             _loc5_ = this.y - 51;
  632.          }
  633.          else
  634.          {
  635.             _loc4_ = this.x + 12;
  636.             _loc5_ = this.y + 15;
  637.          }
  638.          _root.enemyShotID = _root.enemyShotID + 1;
  639.          _root["deathLaser" + _root.enemyShotID] = new classes.shots.DeathLaser(_loc4_,_loc5_,_loc3_,true,_root.enemyShotID);
  640.          _root.addEnemyShot("deathLaser" + _root.enemyShotID);
  641.       }
  642.       if(this.fire.c == 16)
  643.       {
  644.          this.f2 = "wander";
  645.          if(random(10) > 2)
  646.          {
  647.             this.dir = _root.getDir(this.x,this.y);
  648.             this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  649.             this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  650.             this.speedVar();
  651.          }
  652.          else
  653.          {
  654.             this.axis = random(10) <= 4 ? "y" : "x";
  655.             this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  656.             this.getDirString();
  657.          }
  658.       }
  659.    }
  660.    function death()
  661.    {
  662.       this.phase = 7;
  663.       _root.playBGSound(["deathLoop",0,6,0.05]);
  664.       _root[_root.char].xA = _root[_root.char].yA = 0;
  665.       _root.stats.destroyed = _root.stats.destroyed + 1;
  666.       _root.stats.score += 100000;
  667.       var _loc3_ = 1;
  668.       var _loc5_ = _root.chars.length;
  669.       while(_loc3_ < _loc5_)
  670.       {
  671.          _root[_root.chars[_loc3_]].bombed(100);
  672.          _loc3_ = _loc3_ + 1;
  673.       }
  674.       var _loc4_ = _root.enemyShots.slice();
  675.       _loc3_ = 0;
  676.       _loc5_ = _loc4_.length;
  677.       while(_loc3_ < _loc5_)
  678.       {
  679.          _root.removeEnemyShot(_loc4_[_loc3_]);
  680.          _loc3_ = _loc3_ + 1;
  681.       }
  682.       this.f2 = "dying";
  683.       this.c = 0;
  684.       this.speed = this.speedOrig = 3;
  685.       this.cv = 1;
  686.       this.clip.eyeClip.gotoAndPlay(20);
  687.       this.clip.gotoAndPlay("spin");
  688.       this.clip.swapDepths(_root.d + 9999);
  689.    }
  690.    function dying()
  691.    {
  692.       this.c = this.c + 1;
  693.       if(this.c == 1)
  694.       {
  695.          var _loc9_ = _root.getAngleRad2(this.x,this.y,500,300);
  696.          var _loc10_ = _root.getDist2(this.x,this.y,500,300);
  697.          var _loc8_ = _loc10_ >= 100 ? (_loc10_ + 200) / 300 : 1;
  698.          this.xMovT = Math.cos(_loc9_) * this.speed * _loc8_;
  699.          this.yMovT = Math.sin(_loc9_) * this.speed * _loc8_;
  700.       }
  701.       if(this.c == 15)
  702.       {
  703.          var _loc4_ = _root.powerUps.slice();
  704.          var _loc3_ = 0;
  705.          var _loc5_ = _loc4_.length;
  706.          while(_loc3_ < _loc5_)
  707.          {
  708.             _root.removePowerUp(_loc4_[_loc3_]);
  709.             _loc3_ = _loc3_ + 1;
  710.          }
  711.          _loc9_ = _root.getAngleRad2(this.x,this.y,500,300);
  712.          _loc10_ = _root.getDist2(this.x,this.y,500,300);
  713.          _loc8_ = _loc10_ >= 100 ? (_loc10_ + 200) / 300 : 1;
  714.          this.xMovT = Math.cos(_loc9_) * this.speed * _loc8_;
  715.          this.yMovT = Math.sin(_loc9_) * this.speed * _loc8_;
  716.       }
  717.       if(this.x > 400 && this.x < 600 && (this.y > 200 && this.y < 400) && !this.centered && this.c > 15)
  718.       {
  719.          this.centered = true;
  720.          var _loc6_ = this.x <= _root[_root.char].x ? "R" : "L";
  721.          var _loc7_ = _loc6_ != "L" ? -40 : 1020;
  722.          if(_root[_root.char2].tagTeaming)
  723.          {
  724.             _loc6_ = _root[_root.char2].x >= 500 ? "L" : "R";
  725.             _root[_root.char2].endSeq(_loc6_);
  726.          }
  727.          else if(_root.char2 == "bro1")
  728.          {
  729.             _root.bro1 = new classes.bro.Bro1(_loc7_,150);
  730.             _root.addChar("bro1");
  731.             _root.bro1.endSeq(_loc6_);
  732.          }
  733.          else if(_root.char2 == "bro2")
  734.          {
  735.             _root.bro2 = new classes.bro.Bro2(_loc7_,250);
  736.             _root.addChar("bro2");
  737.             _root.bro2.endSeq(_loc6_);
  738.          }
  739.          else if(_root.char2 == "broShip1")
  740.          {
  741.             _root.bro1ShipLevel = 3;
  742.             _root.broShip1 = new classes.bro.BroShip1(_loc7_,350);
  743.             _root.addChar("broShip1");
  744.             _root.broShip1.endSeq(_loc6_);
  745.          }
  746.          else if(_root.char2 == "broShip2")
  747.          {
  748.             _root.bro2ShipLevel = 3;
  749.             _root.broShip2 = new classes.bro.BroShip2(_loc7_,450);
  750.             _root.addChar("broShip2");
  751.             _root.broShip2.endSeq(_loc6_);
  752.          }
  753.          if(this.xMov > 10 || this.yMov > 10)
  754.          {
  755.             this.cv = 5;
  756.          }
  757.          else
  758.          {
  759.             this.cv = 0.5;
  760.          }
  761.          this.xMovT = 0;
  762.          this.yMovT = 0;
  763.       }
  764.       if(Math.round(this.c / 30) == this.c / 30 && this.c > 90 && this.c < 300)
  765.       {
  766.          _root[_root.char2].endSeqB();
  767.       }
  768.       if(this.c == 240)
  769.       {
  770.          _root[_root.char2].fireDir = "";
  771.       }
  772.       if(this.c == 280)
  773.       {
  774.          this.clip.gotoAndStop("F");
  775.          this.clip.eyeClip.gotoAndStop(60);
  776.          this.clip.eyeClip._visible = true;
  777.       }
  778.       if(this.c == 300)
  779.       {
  780.          _root.createExploA([this.x + this.clip.eyeClip._x + _root.randRange(0,40),this.y + this.clip.eyeClip._y + _root.randRange(-10,10),_root.randRange(50,100),_root.randRange(90,100),"Red"]);
  781.          _root.createExploA([this.x + this.clip.eyeClip._x + _root.randRange(0,40),this.y + this.clip.eyeClip._y + _root.randRange(-10,10),_root.randRange(50,80),_root.randRange(90,100),"Yellow"]);
  782.          _root.createExploA([this.x + this.clip.eyeClip._x + _root.randRange(-20,40),this.y + this.clip.eyeClip._y + _root.randRange(-10,10),_root.randRange(40,80),_root.randRange(50,80),"Yellow"]);
  783.          _root.createExploA([this.x + this.clip.eyeClip._x + _root.randRange(-20,40),this.y + this.clip.eyeClip._y + _root.randRange(-10,10),_root.randRange(40,70),_root.randRange(50,80),"Red"]);
  784.          _root.createExploA([this.x + this.clip.eyeClip._x + _root.randRange(0,40),this.y + this.clip.eyeClip._y + _root.randRange(-10,10),_root.randRange(50,100),_root.randRange(90,100),"Red"]);
  785.          _root.createExploA([this.x + this.clip.eyeClip._x + _root.randRange(0,40),this.y + this.clip.eyeClip._y + _root.randRange(-10,10),_root.randRange(50,80),_root.randRange(90,100),"Yellow"]);
  786.          this.clip.eyeClip._visible = false;
  787.          this.clip.gotoAndStop("F");
  788.          this.clip.skull._visible = false;
  789.          _root.audio.playLevel2("deathEyeX",_root.randRange(15,25));
  790.       }
  791.       if(this.c == 360)
  792.       {
  793.          _root.audio.playLevel2("deathHeadX",30);
  794.          _root.createExploD([this.x + _root.randRange(-80,80),this.y + this.clip._height / 3 + _root.randRange(-80,80),_root.randRange(50,150),_root.randRange(60,100)]);
  795.          _root.createExploD([this.x + _root.randRange(-80,80),this.y + this.clip._height / 3 + _root.randRange(-80,80),_root.randRange(50,150),_root.randRange(60,100)]);
  796.          _root.createExploD([this.x + _root.randRange(-80,80),this.y + this.clip._height / 3 + _root.randRange(-80,80),_root.randRange(50,150),_root.randRange(60,100)]);
  797.          _root.createExploD([this.x + _root.randRange(-80,80),this.y + this.clip._height / 3 + _root.randRange(-80,80),_root.randRange(50,150),_root.randRange(60,100)]);
  798.          _root.createExploD([this.x + _root.randRange(-80,80),this.y + this.clip._height / 3 + _root.randRange(-80,80),_root.randRange(50,150),_root.randRange(60,100)]);
  799.          _root.createExploD([this.x + _root.randRange(-80,80),this.y + this.clip._height / 3 + _root.randRange(-80,80),_root.randRange(50,150),_root.randRange(60,100)]);
  800.          _root.createExploD([this.x + _root.randRange(-80,80),this.y + this.clip._height / 3 + _root.randRange(-80,80),_root.randRange(50,150),_root.randRange(60,100)]);
  801.          _root.createExploD([this.x + 18,this.y + 18,_root.randRange(180,250),_root.randRange(90,100)]);
  802.          _loc3_ = 0;
  803.          _loc5_ = _root.randRange(6,10);
  804.          while(_loc3_ < _loc5_)
  805.          {
  806.             _root.createShrapnel([this.x + this.clip._width / 2,this.y + this.clip._height / 2,"bugA","red",true,true]);
  807.             _loc3_ = _loc3_ + 1;
  808.          }
  809.          _loc3_ = 0;
  810.          _loc5_ = _root.randRange(6,10);
  811.          while(_loc3_ < _loc5_)
  812.          {
  813.             _root.createShrapnel([this.x + this.clip._width / 2,this.y + this.clip._height / 2,"batB","green",true,true]);
  814.             _loc3_ = _loc3_ + 1;
  815.          }
  816.          _loc3_ = 0;
  817.          _loc5_ = _root.randRange(6,10);
  818.          while(_loc3_ < _loc5_)
  819.          {
  820.             _root.createShrapnel([this.x + this.clip._width / 2,this.y + this.clip._height / 2,"droidA","blue",true,true]);
  821.             _loc3_ = _loc3_ + 1;
  822.          }
  823.          _root.audio.playLevel4("deathHeadX",_root.randRange(15,25));
  824.          this.clip.skull._visible = true;
  825.          this.clip.skull.gotoAndPlay("end");
  826.          this.clip.head._visible = false;
  827.          this.clip.teeth._visible = false;
  828.          this.clip.cover._visible = false;
  829.       }
  830.       if(this.c > 360)
  831.       {
  832.          _root.bgDecoClip._alpha--;
  833.          this.clip.skull._alpha -= 1;
  834.          this.clip._y -= 0.5;
  835.       }
  836.       if(this.c > 360 && this.c < 420)
  837.       {
  838.          _root[_root.char].xA = _root.randRange2(-5,5) * ((420 - this.c) / 60);
  839.          _root[_root.char2].xA = _root.randRange2(-5,5) * ((420 - this.c) / 60);
  840.          _root[_root.char].yA = _root.randRange2(-5,5) * ((420 - this.c) / 60);
  841.          _root[_root.char2].yA = _root.randRange2(-5,5) * ((420 - this.c) / 60);
  842.       }
  843.       if(this.c == 450)
  844.       {
  845.          _root.bgDecoClip.removeMovieClip();
  846.          _root.endSeq();
  847.       }
  848.       if(this.c == 560)
  849.       {
  850.          _root.removeChar("deathHead");
  851.       }
  852.    }
  853.    function createEnemy1(dir)
  854.    {
  855.       _root.charID = _root.charID + 1;
  856.       _root["droidD" + _root.charID] = new classes.enemy.DroidD(this.x + 6,this.y + 6,[dir,100,"break"],_root.charID);
  857.       _root.addChar("droidD" + _root.charID);
  858.    }
  859.    function createEnemy2(dir)
  860.    {
  861.       _root.charID = _root.charID + 1;
  862.       _root["batD" + _root.charID] = new classes.enemy.BatD(this.x + 6,this.y + 6,[dir,100,"break"],_root.charID);
  863.       _root.addChar("batD" + _root.charID);
  864.    }
  865.    function createEnemy3(dir)
  866.    {
  867.       _root.charID = _root.charID + 1;
  868.       _root["headD" + _root.charID] = new classes.enemy.HeadD(this.x + 12,this.y + 12,[dir,100,"break"],_root.charID);
  869.       _root.addChar("headD" + _root.charID);
  870.    }
  871.    function createEnemy4(dir)
  872.    {
  873.       _root.charID = _root.charID + 1;
  874.       _root["bugD" + _root.charID] = new classes.enemy.BugD(this.x + 6,this.y + 6,[dir,100,"break"],_root.charID);
  875.       _root.addChar("bugD" + _root.charID);
  876.    }
  877.    function changePhase(pphase)
  878.    {
  879.       this.phase = pphase;
  880.       if(this.phase == 5)
  881.       {
  882.          this.fury();
  883.       }
  884.    }
  885.    function fury2()
  886.    {
  887.       _root.audio.playLevel2("deathFury" + (random(2) + 2),_root.randRange(30,35));
  888.       this.f2 = "furious2";
  889.       this.c = 0;
  890.       this.ep = _root.randRange(20,60);
  891.       this.speed = this.speedOrig * 4;
  892.       this.colorTrans = new flash.geom.ColorTransform(1,0,0,1,255,0,0,0);
  893.       this.transL.colorTransform = this.colorTrans;
  894.       this.transR.colorTransform = this.colorTrans;
  895.       _root.audio.playLevel2("deathFury2",_root.randRange(30,35));
  896.       if(random(2) == 0)
  897.       {
  898.          this.dir = _root.getDir(this.x,this.y);
  899.          this[this.axis + "MovT"] = 0;
  900.          this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  901.          this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  902.       }
  903.    }
  904.    function furious2()
  905.    {
  906.       this.colorTrans = new flash.geom.ColorTransform(1,_root.randRange2(0,0.2),0,1,_root.randRange(150,255),_root.randRange(0,30),0,0);
  907.       this.transL.colorTransform = this.colorTrans;
  908.       this.transR.colorTransform = this.colorTrans;
  909.       if(random(25 + _root.dif.wait * 2) == 0)
  910.       {
  911.          _root.enemyShotID = _root.enemyShotID + 1;
  912.          _root["deathFizzle" + _root.enemyShotID] = new classes.shots.DeathFizzle(this.x,this.y,_root.enemyShotID);
  913.          _root.addEnemyShot("deathFizzle" + _root.enemyShotID);
  914.          _root.audio.playLevel3("deathFizzle" + (random(3) + 1),_root.randRange(10,18));
  915.       }
  916.       this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  917.       this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  918.       if(random(5) == 0)
  919.       {
  920.          this.dir = _root.getDir(this.x,this.y);
  921.          this[this.axis + "MovT"] = 0;
  922.          this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  923.          this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  924.       }
  925.       this.cv = 0.75 + _root.getDist(this.x,this.y) / 750;
  926.       this.c = this.c + 1;
  927.       if(this.c >= this.ep)
  928.       {
  929.          this.f2 = "wander";
  930.          this.cv = 0.3;
  931.          this.speed = this.speedOrig;
  932.          this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
  933.          this.transL.colorTransform = this.colorTrans;
  934.          this.transR.colorTransform = this.colorTrans;
  935.       }
  936.    }
  937.    function fury()
  938.    {
  939.       this.f2 = "furious";
  940.       this.c = 0;
  941.       this.ep = _root.randRange(450,750);
  942.       this.speed = this.speedOrig * 4;
  943.       this.colorTrans = new flash.geom.ColorTransform(1,0,0,1,255,0,0,0);
  944.       this.transL.colorTransform = this.colorTrans;
  945.       this.transR.colorTransform = this.colorTrans;
  946.       _root.audio.playLevel2("deathFury",_root.randRange(39,45));
  947.       _root.playBGSound(["deathTheme",50,3,0.05]);
  948.    }
  949.    function furious()
  950.    {
  951.       this.colorTrans = new flash.geom.ColorTransform(1,_root.randRange2(0,0.2),0,1,_root.randRange(150,255),_root.randRange(0,30),0,0);
  952.       this.transL.colorTransform = this.colorTrans;
  953.       this.transR.colorTransform = this.colorTrans;
  954.       if(random(25 + _root.dif.wait * 2) == 0)
  955.       {
  956.          _root.enemyShotID = _root.enemyShotID + 1;
  957.          _root["deathFizzle" + _root.enemyShotID] = new classes.shots.DeathFizzle(this.x,this.y,_root.enemyShotID);
  958.          _root.addEnemyShot("deathFizzle" + _root.enemyShotID);
  959.          _root.audio.playLevel3("deathFizzle" + (random(3) + 1),_root.randRange(10,18));
  960.       }
  961.       this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  962.       this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  963.       if(random(6) == 0)
  964.       {
  965.          this.dir = _root.getDir(this.x,this.y);
  966.          this[this.axis + "MovT"] = 0;
  967.          this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  968.          this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  969.       }
  970.       this.cv = 0.75 + _root.getDist(this.x,this.y) / 750;
  971.       this.c = this.c + 1;
  972.       if(this.c >= this.ep)
  973.       {
  974.          this.permitHit = true;
  975.          _root.level = 5;
  976.          this.f2 = "wander";
  977.          this.phase = 6;
  978.          this.cv = 0.3;
  979.          this.speed = this.speedOrig;
  980.          this.speed += 1;
  981.          this.speedOrig = this.speed;
  982.          this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
  983.          this.transL.colorTransform = this.colorTrans;
  984.          this.transR.colorTransform = this.colorTrans;
  985.       }
  986.       if(_root.deathDarkClip.end)
  987.       {
  988.          _root.deathDarkClip.removeMovieClip();
  989.          this.clip.cover._alpha = 100;
  990.          this.dark = false;
  991.       }
  992.    }
  993.    function main()
  994.    {
  995.       this[this.f2]();
  996.       if(this.oldDir != this.dir && this.f2 != "intro")
  997.       {
  998.          this.clip.gotoAndStop(this.dir);
  999.       }
  1000.       this.oldDir = this.dir;
  1001.       if(this.phase == 6)
  1002.       {
  1003.          var _loc12_ = _root.getAngleRad(this.x,this.y);
  1004.          _root[_root.char].xA = Math.cos(_loc12_) * (-1 * this.speed / 8);
  1005.          _root[_root.char].yA = Math.sin(_loc12_) * (-1 * this.speed / 8);
  1006.       }
  1007.       if(this.f2 != "dying")
  1008.       {
  1009.          if(this.f2 == "wander" || this.f2 == "waiting" && this.phase != 6)
  1010.          {
  1011.             var _loc11_ = _root.getDist(this.x,this.y);
  1012.             var _loc8_ = 0;
  1013.             if(_loc11_ >= 400)
  1014.             {
  1015.                _loc8_ = 1;
  1016.             }
  1017.             else if(_loc11_ <= 100)
  1018.             {
  1019.                _loc8_ = 13;
  1020.             }
  1021.             else
  1022.             {
  1023.                _loc8_ = Math.ceil((400 - _loc11_) / 23);
  1024.                if(random(4) == 0)
  1025.                {
  1026.                   _loc8_ += _root.randRange(-1,1);
  1027.                }
  1028.             }
  1029.             if(_loc8_ + 1 < this.oldF)
  1030.             {
  1031.                _loc8_ = this.oldF - 1;
  1032.             }
  1033.             else if(this.oldF + 1 < _loc8_)
  1034.             {
  1035.                _loc8_ = this.oldF + 1;
  1036.             }
  1037.             this.clip.eyeClip.eyeL.gotoAndStop(_loc8_ + this.eyes.lO);
  1038.             this.clip.eyeClip.eyeR.gotoAndStop(_loc8_ + this.eyes.rO);
  1039.          }
  1040.          if(this.phase == 6)
  1041.          {
  1042.             this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  1043.             this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  1044.          }
  1045.          this.oldF = this.clip.eyeClip.eyeL._currentframe - this.eyes.lO;
  1046.          var _loc5_ = Math.round((_root[_root.char].x - this.x + 100) / 20) + 1;
  1047.          if(_loc5_ < 1)
  1048.          {
  1049.             _loc5_ = 1;
  1050.          }
  1051.          if(_loc5_ > 11)
  1052.          {
  1053.             _loc5_ = 11;
  1054.          }
  1055.          this.eyes.lO = _loc5_ > 4 ? 14 : 0;
  1056.          this.eyes.rO = _loc5_ < 8 ? 14 : 29;
  1057.          if(_loc5_ <= 5)
  1058.          {
  1059.             this.dir = "L";
  1060.          }
  1061.          else if(_loc5_ >= 7)
  1062.          {
  1063.             this.dir = "R";
  1064.          }
  1065.          else
  1066.          {
  1067.             this.dir = "F";
  1068.          }
  1069.          if(this.f2 == "astroAttacking" && this.c > 50 && this.c < 90)
  1070.          {
  1071.             if(this.eyes.lO == 0)
  1072.             {
  1073.                this.clip.eyeClip.eyeL.gotoAndStop(this.c);
  1074.             }
  1075.             else
  1076.             {
  1077.                this.clip.eyeClip.eyeL.gotoAndStop(this.c + 40);
  1078.             }
  1079.             if(this.eyes.rO == 29)
  1080.             {
  1081.                this.clip.eyeClip.eyeR.gotoAndStop(this.c + 80);
  1082.             }
  1083.             else
  1084.             {
  1085.                this.clip.eyeClip.eyeR.gotoAndStop(this.c + 40);
  1086.             }
  1087.          }
  1088.          this.clip.eyeClip.gotoAndStop(_loc5_);
  1089.       }
  1090.       if(this.nudging)
  1091.       {
  1092.          this.xA *= 0.5;
  1093.          this.yA *= 0.5;
  1094.          this.nc = this.nc + 1;
  1095.          if(this.nc == 15)
  1096.          {
  1097.             this.xA = this.yA = 0;
  1098.             this.nudging = false;
  1099.          }
  1100.       }
  1101.       var _loc4_ = 0;
  1102.       var _loc9_ = _root.broShots.length;
  1103.       while(_loc4_ < _loc9_)
  1104.       {
  1105.          var _loc7_ = _root.broShots[_loc4_] + "Clip";
  1106.          if(this.clip.head.hitTest(_root[_loc7_]) && this.f2 != "intro")
  1107.          {
  1108.             var _loc3_ = _root.broShots[_loc4_];
  1109.             var _loc6_ = this.life;
  1110.             if(this.f2 != "dying")
  1111.             {
  1112.                if(this.permitHit)
  1113.                {
  1114.                   this.life -= _root[_loc3_].power;
  1115.                   if(this.life < 1)
  1116.                   {
  1117.                      this.f2 = "death";
  1118.                   }
  1119.                   else
  1120.                   {
  1121.                      this.nudge(_root[_loc3_].xMov,_root[_loc3_].yMov,10);
  1122.                      _root.audio.playLevel4("deathHit" + (random(3) + 1),_root.randRange(14,22));
  1123.                      if(this.f2 != "furious" && this.f2 != "walling" && this.f2 != "furious2" && this.f2 != "deathBallAttacking" && this.f2 != "creatingEnemies")
  1124.                      {
  1125.                         if(random(10) == 0)
  1126.                         {
  1127.                            this.fury2();
  1128.                         }
  1129.                         else
  1130.                         {
  1131.                            this[this.axis + "MovT"] = 0;
  1132.                            this.axis = random(10) <= 4 ? "y" : "x";
  1133.                            this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  1134.                            this.getDirString();
  1135.                         }
  1136.                      }
  1137.                      this.speed = this.speedOrig = 20 - Math.round(this.life / (this.lifeOrig / 10));
  1138.                      this.cv = 0.25 + (this.lifeOrig - this.life) / 10000;
  1139.                      _loc5_ = Math.round(100 * ((this.lifeOrig - this.life) / this.lifeOrig));
  1140.                      this.clip.eyeClip.eyeL.pulse._alpha = _loc5_;
  1141.                      this.clip.eyeClip.eyeR.pulse._alpha = _loc5_;
  1142.                      this.clip.skull.gotoAndPlay("f" + (random(3) + 1));
  1143.                   }
  1144.                }
  1145.                else
  1146.                {
  1147.                   _root.audio.playLevel4("deathHitNull" + (random(3) + 1),_root.randRange(32,38));
  1148.                   if(_root.chars.length < 20)
  1149.                   {
  1150.                      this["createEnemy" + this.phase](_root[_loc3_].dir);
  1151.                   }
  1152.                }
  1153.             }
  1154.             else
  1155.             {
  1156.                _root.audio.playLevel4("deathHit" + (random(3) + 1),_root.randRange(14,22));
  1157.             }
  1158.             _root[_root.char].fc = _root[_root.char].fireFreq - _root.rapidVar;
  1159.             _root[_loc3_].exploX = this.x + this.clip._width / 2;
  1160.             _root[_loc3_].exploY = this.y + this.clip._height / 2;
  1161.             _root[_loc3_].hit(_loc6_);
  1162.             break;
  1163.          }
  1164.          _loc4_ = _loc4_ + 1;
  1165.       }
  1166.       if(this.clip.head.hitTest(_root[_root.char + "Clip"]) && this.f2 != "intro" && this.f2 != "dying")
  1167.       {
  1168.          _root[_root.char].hit(this.xMov,this.yMov,100,this.power);
  1169.       }
  1170.       if(this.f2 != "walling" && this.f2 != "dying")
  1171.       {
  1172.          var _loc10_ = false;
  1173.          if(this.x > 950)
  1174.          {
  1175.             _loc10_ = true;
  1176.             this.dir = "L";
  1177.          }
  1178.          else if(this.x < 50)
  1179.          {
  1180.             _loc10_ = true;
  1181.             this.dir = "R";
  1182.          }
  1183.          else if(this.y < 50)
  1184.          {
  1185.             _loc10_ = true;
  1186.             this.dir = "D";
  1187.          }
  1188.          else if(this.y > 550)
  1189.          {
  1190.             _loc10_ = true;
  1191.             this.dir = "U";
  1192.          }
  1193.          if(_loc10_)
  1194.          {
  1195.             this.xMovT = 0;
  1196.             this.yMovT = 0;
  1197.             this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  1198.             this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  1199.          }
  1200.       }
  1201.       else
  1202.       {
  1203.          if(this.y < -50)
  1204.          {
  1205.             this.y = 620;
  1206.          }
  1207.          if(this.y > 650)
  1208.          {
  1209.             this.y = -40;
  1210.          }
  1211.       }
  1212.       if(this.xMovT < this.xMov)
  1213.       {
  1214.          this.xMov -= this.cv;
  1215.       }
  1216.       else if(this.xMovT > this.xMov)
  1217.       {
  1218.          this.xMov += this.cv;
  1219.       }
  1220.       else
  1221.       {
  1222.          this.xMov = this.xMovT;
  1223.       }
  1224.       if(this.yMovT < this.yMov)
  1225.       {
  1226.          this.yMov -= this.cv;
  1227.       }
  1228.       else if(this.yMovT > this.yMov)
  1229.       {
  1230.          this.yMov += this.cv;
  1231.       }
  1232.       else
  1233.       {
  1234.          this.yMov = this.yMovT;
  1235.       }
  1236.       this.x += this.xMov + this.xA;
  1237.       this.y += this.yMov + this.yA + 1 * Math.sin(this.hc += 0.05);
  1238.       this.clip._x = this.x;
  1239.       this.clip._y = this.y;
  1240.    }
  1241. }
  1242.