home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / dragonforce.swf / scripts / frame_2 / DoAction_7.as < prev    next >
Encoding:
Text File  |  2006-06-13  |  38.6 KB  |  762 lines

  1. _root.bulletmovement = function()
  2. {
  3.    if(_root.bulletarray.length > 0)
  4.    {
  5.       var bc = _root.bulletarray.length - 1;
  6.       while(bc >= 0)
  7.       {
  8.          if(_root.bulletarray[bc]._name eq "")
  9.          {
  10.             _root.bulletarray.splice(bc,1);
  11.          }
  12.          if(_root.bulletarray[bc].enemyshottype == "fbossgun")
  13.          {
  14.             if(Math.abs(_root.bulletarray[bc]._y - _root.bulletarray[bc].desty) > 5)
  15.             {
  16.                if(_root.bulletarray[bc]._y > _root.bulletarray[bc].desty)
  17.                {
  18.                   _root.bulletarray[bc]._y -= 10;
  19.                }
  20.                else
  21.                {
  22.                   _root.bulletarray[bc]._y += 10;
  23.                }
  24.             }
  25.             else
  26.             {
  27.                _root.bulletarray[bc].desty = _root.bulletarray[bc].starty + (_root.bulletarray[bc].starty - _root.bulletarray[bc].desty);
  28.             }
  29.          }
  30.          if(_root.bulletarray[bc].enemyshottype != "boss2laser1" and _root.bulletarray[bc].enemyshottype != "boss2laser2" and _root.bulletarray[bc].enemyshottype != "enemymissilet" and _root.bulletarray[bc].enemyshottype != "enemymissileb" and _root.bulletarray[bc].shottype != "homingmissile" and _root.bulletarray[bc].shottype != "bomb")
  31.          {
  32.             _root.bulletarray[bc]._x += _root.bulletarray[bc].xvalue;
  33.             _root.bulletarray[bc]._y += _root.bulletarray[bc].yvalue;
  34.             if(_root.bulletarray[bc].shottype == "sred")
  35.             {
  36.                if(Math.abs(_root.bulletarray[bc]._x - _root.bulletarray[bc].destx) < 15 and Math.abs(_root.bulletarray[bc]._y - _root.bulletarray[bc].desty) < 15)
  37.                {
  38.                   if(_root.bulletarray[bc].exploding == false)
  39.                   {
  40.                      _root.bulletarray[bc].bomb.gotoAndStop(2);
  41.                      _root.bombexplodesound.stop();
  42.                      _root.bombexplodesound.start(0,0);
  43.                      _root.bulletarray[bc].xvalue = 0;
  44.                      _root.bulletarray[bc].yvalue = 0;
  45.                      _root.bulletarray[bc].exploding = true;
  46.                   }
  47.                }
  48.             }
  49.          }
  50.          else if(_root.bulletarray[bc].enemyshottype == "boss2laser1")
  51.          {
  52.             _root.bulletarray[bc]._x = _root.enemyarray[_root.enemyarray.length - 1]._x + _root.enemyarray[_root.enemyarray.length - 1].enemytype._x + _root.enemyarray[_root.enemyarray.length - 1].enemytype.lasergun._x;
  53.             _root.bulletarray[bc]._y = _root.enemyarray[_root.enemyarray.length - 1]._y + _root.enemyarray[_root.enemyarray.length - 1].enemytype._y + _root.enemyarray[_root.enemyarray.length - 1].enemytype.lasergun._y;
  54.          }
  55.          else if(_root.bulletarray[bc].enemyshottype == "boss2laser2")
  56.          {
  57.             _root.bulletarray[bc]._x = _root.enemyarray[_root.enemyarray.length - 1]._x + _root.enemyarray[_root.enemyarray.length - 1].enemytype._x + _root.enemyarray[_root.enemyarray.length - 1].enemytype.lasergun2._x;
  58.             _root.bulletarray[bc]._y = _root.enemyarray[_root.enemyarray.length - 1]._y + _root.enemyarray[_root.enemyarray.length - 1].enemytype._y + _root.enemyarray[_root.enemyarray.length - 1].enemytype.lasergun2._y;
  59.          }
  60.          else if(_root.bulletarray[bc].shottype == "homingmissile")
  61.          {
  62.             if(_root.bulletarray[bc]._x > 730 or _root.bulletarray[bc]._x < -30)
  63.             {
  64.                _root.bulletarray[bc].removeMovieClip();
  65.                _root.bulletarray.splice(bc,1);
  66.             }
  67.             if(_root.bulletarray[bc].deploy == true)
  68.             {
  69.                _root.bulletarray[bc]._y += _root.bulletarray[bc].deployrate;
  70.                _root.bulletarray[bc].deployrate -= 0.5;
  71.                if(_root.bulletarray[bc].deployrate <= 0)
  72.                {
  73.                   _root.bulletarray[bc].deployrate = false;
  74.                }
  75.             }
  76.             if(_root.bulletarray[bc].deployrate <= 3)
  77.             {
  78.                _root.bulletarray[bc].gotoAndStop("boost");
  79.                if(_root[_root.bulletarray[bc].targetname]._visible == true)
  80.                {
  81.                   diffx = int(_root[_root.bulletarray[bc].targetname]._x + _root[_root.bulletarray[bc].targetname].enemytype._x - _root.bulletarray[bc]._x);
  82.                   diffy = int(_root[_root.bulletarray[bc].targetname]._y + _root[_root.bulletarray[bc].targetname].enemytype._y - _root.bulletarray[bc]._y);
  83.                   if(diffx > 0 && diffy > 0)
  84.                   {
  85.                      quad = Number(4);
  86.                   }
  87.                   if(diffx < 0 && diffy > 0)
  88.                   {
  89.                      quad = Number(1);
  90.                   }
  91.                   if(diffx < 0 && diffy < 0)
  92.                   {
  93.                      quad = Number(2);
  94.                   }
  95.                   if(diffx > 0 && diffy < 0)
  96.                   {
  97.                      quad = Number(3);
  98.                   }
  99.                   abs_x = Math.abs(diffx);
  100.                   abs_y = Math.abs(diffy);
  101.                   tg = abs_y / abs_x;
  102.                   _root.maths = Math.atan(tg) * Number(180) / 3.141592653589793;
  103.                   distance = Math.sqrt(_root.bulletarray[bc]._x - _root.bulletarray[bc].targetx ^ 2 + (_root.bulletarray[bc]._y - _root.bulletarray[bc].targety) ^ 2);
  104.                   if(quad == 1)
  105.                   {
  106.                      angle = Number(180) - Number(_root.maths);
  107.                   }
  108.                   if(quad == 2)
  109.                   {
  110.                      angle = Number(180) + Number(_root.maths);
  111.                   }
  112.                   if(quad == 3)
  113.                   {
  114.                      angle = Number(360) - Number(_root.maths);
  115.                   }
  116.                   if(quad == 4)
  117.                   {
  118.                      angle = Number(_root.maths);
  119.                   }
  120.                   xmove = _root.bulletarray[bc].speedx * Math.cos(0.017453292519943295 * angle);
  121.                   ymove = _root.bulletarray[bc].speedy * Math.sin(0.017453292519943295 * angle);
  122.                   _root.bulletarray[bc].speedx += 2;
  123.                   _root.bulletarray[bc].speedy += 2;
  124.                   if(angle <= 180)
  125.                   {
  126.                      if(_root.bulletarray[bc]._rotation + 180 >= angle)
  127.                      {
  128.                         _root.bulletarray[bc]._rotation += (angle - _root.bulletarray[bc]._rotation) / _root.bulletarray[bc].megahomingturndelay;
  129.                      }
  130.                      else if(angle >= _root.bulletarray[bc]._rotation)
  131.                      {
  132.                         _root.bulletarray[bc]._rotation += (angle - _root.bulletarray[bc]._rotation) / _root.bulletarray[bc].megahomingturndelay;
  133.                      }
  134.                      else
  135.                      {
  136.                         _root.bulletarray[bc]._rotation -= (_root.bulletarray[bc]._rotation - angle) / _root.bulletarray[bc].megahomingturndelay;
  137.                      }
  138.                   }
  139.                   else if(angle > 180)
  140.                   {
  141.                      if(angle - 180 < _root.bulletarray[bc]._rotation)
  142.                      {
  143.                         if(_root.bulletarray[bc]._rotation < angle)
  144.                         {
  145.                            _root.bulletarray[bc]._rotation += (angle - _root.bulletarray[bc]._rotation) / _root.bulletarray[bc].megahomingturndelay;
  146.                         }
  147.                         else
  148.                         {
  149.                            _root.bulletarray[bc]._rotation -= (_root.bulletarray[bc]._rotation - angle) / _root.bulletarray[bc].megahomingturndelay;
  150.                         }
  151.                      }
  152.                      else
  153.                      {
  154.                         _root.bulletarray[bc]._rotation -= (360 - (angle - _root.bulletarray[bc]._rotation)) / _root.bulletarray[bc].megahomingturndelay;
  155.                      }
  156.                   }
  157.                   _root.bulletarray[bc]._x += xmove;
  158.                   _root.bulletarray[bc]._y += ymove;
  159.                }
  160.                else
  161.                {
  162.                   if(_root.bulletarray[bc]._rotation != 0)
  163.                   {
  164.                      _root.bulletarray[bc]._rotation -= _root.bulletarray[bc]._rotation / megahomingturndelay;
  165.                   }
  166.                   _root.bulletarray[bc]._x += _root.bulletarray[bc].megahomingacceleratex;
  167.                   _root.bulletarray[bc].megahomingacceleratex += 2;
  168.                }
  169.             }
  170.          }
  171.          else if(_root.bulletarray[bc].shottype == "bomb")
  172.          {
  173.             if(_root.bombexplode != true)
  174.             {
  175.                _root.bulletarray[bc]._x += _root.bulletarray[bc].xvalue;
  176.             }
  177.          }
  178.          else if(_root.bulletarray[bc].enemyshottype == "enemymissilet")
  179.          {
  180.             if(_root.bulletarray[bc].deploy != false)
  181.             {
  182.                _root.bulletarray[bc]._y -= _root.bulletarray[bc].deployrate;
  183.                _root.bulletarray[bc].deployrate--;
  184.                if(_root.bulletarray[bc].angle2 > _root.bulletarray[bc]._rotation)
  185.                {
  186.                   if(_root.bulletarray[bc].angle2 - _root.bulletarray[bc]._rotation > 20)
  187.                   {
  188.                      _root.bulletarray[bc]._rotation += 20;
  189.                   }
  190.                   else
  191.                   {
  192.                      _root.bulletarray[bc]._rotation = _root.bulletarray[bc].angle2;
  193.                   }
  194.                }
  195.                else if(_root.bulletarray[bc]._rotation - _root.bulletarray[bc].angle2 > 50)
  196.                {
  197.                   _root.bulletarray[bc]._rotation -= 50;
  198.                }
  199.                else
  200.                {
  201.                   _root.bulletarray[bc]._rotation = _root.bulletarray[bc].angle2;
  202.                }
  203.                if(_root.bulletarray[bc].deployrate <= 0)
  204.                {
  205.                   _root.bulletarray[bc].speed = 5;
  206.                   _root.bulletarray[bc].xvalue = Math.cos(_root.bulletarray[bc].angle);
  207.                   _root.bulletarray[bc].yvalue = Math.sin(_root.bulletarray[bc].angle);
  208.                   _root.bulletarray[bc].deploy = false;
  209.                }
  210.             }
  211.             else
  212.             {
  213.                _root.bulletarray[bc]._x -= _root.bulletarray[bc].speed * _root.bulletarray[bc].xvalue;
  214.                _root.bulletarray[bc]._y -= _root.bulletarray[bc].speed * _root.bulletarray[bc].yvalue;
  215.                _root.bulletarray[bc].speed += 2;
  216.             }
  217.          }
  218.          else if(_root.bulletarray[bc].enemyshottype == "enemymissileb")
  219.          {
  220.             if(_root.bulletarray[bc].deploy != false)
  221.             {
  222.                _root.bulletarray[bc]._y += _root.bulletarray[bc].deployrate;
  223.                _root.bulletarray[bc].deployrate--;
  224.                if(_root.bulletarray[bc].angle2 > _root.bulletarray[bc]._rotation)
  225.                {
  226.                   if(_root.bulletarray[bc].angle2 - _root.bulletarray[bc]._rotation > 50)
  227.                   {
  228.                      _root.bulletarray[bc]._rotation += 50;
  229.                   }
  230.                   else
  231.                   {
  232.                      _root.bulletarray[bc]._rotation = _root.bulletarray[bc].angle2;
  233.                   }
  234.                }
  235.                else if(_root.bulletarray[bc]._rotation - _root.bulletarray[bc].angle2 > 50)
  236.                {
  237.                   _root.bulletarray[bc]._rotation -= 50;
  238.                }
  239.                else
  240.                {
  241.                   _root.bulletarray[bc]._rotation = _root.bulletarray[bc].angle2;
  242.                }
  243.                if(_root.bulletarray[bc].deployrate <= 0)
  244.                {
  245.                   _root.bulletarray[bc].speed = 5;
  246.                   _root.bulletarray[bc].xvalue = Math.cos(_root.bulletarray[bc].angle);
  247.                   _root.bulletarray[bc].yvalue = Math.sin(_root.bulletarray[bc].angle);
  248.                   _root.bulletarray[bc].deploy = false;
  249.                }
  250.             }
  251.             else
  252.             {
  253.                _root.bulletarray[bc]._x -= _root.bulletarray[bc].speed * _root.bulletarray[bc].xvalue;
  254.                _root.bulletarray[bc]._y -= _root.bulletarray[bc].speed * _root.bulletarray[bc].yvalue;
  255.                _root.bulletarray[bc].speed += 2;
  256.             }
  257.          }
  258.          if(_root.bulletarray[bc].enemyshottype == "boss3")
  259.          {
  260.             if(_root.bulletarray[bc].follow < 25)
  261.             {
  262.                _root.bulletarray[bc].follow = _root.bulletarray[bc].follow + 1;
  263.                _root.bulletarray[bc].diffx = _root.bulletarray[bc]._x - (_root.ship._x + _root.ship.shipmc._x);
  264.                _root.bulletarray[bc].diffy = _root.bulletarray[bc]._y - (_root.ship._y + _root.ship.shipmc._y);
  265.                _root.bulletarray[bc].angle = Math.atan2(_root.bulletarray[bc].diffy,_root.bulletarray[bc].diffx);
  266.                _root.bulletarray[bc].xvalue = -7 * Math.cos(_root.bulletarray[bc].angle);
  267.                _root.bulletarray[bc].yvalue = -7 * Math.sin(_root.bulletarray[bc].angle);
  268.             }
  269.          }
  270.          if(_root.bulletarray[bc].shottype == "enemy")
  271.          {
  272.             if(_root.bulletarray[bc].hitTest(_root.ship.protector.sphere) or _root.bulletarray[bc].hitTest(_root.ship.protector2.sphere) or _root.bulletarray[bc].hitTest(_root.bomb1))
  273.             {
  274.                if(_root.bulletarray[bc].enemyshottype != "boss2laser1" and _root.bulletarray[bc].enemyshottype != "boss2laser2" and _root.bulletarray[bc].enemyshottype != "fbosslaser")
  275.                {
  276.                   if(_root.bulletarray[bc].hitTest(_root.ship.protector.sphere))
  277.                   {
  278.                      _root.protector1health -= 1;
  279.                      if(_root.protector1health < 7 and _root.protector1health > 2)
  280.                      {
  281.                         _root.ship.protector.sphere.gotoAndStop("half");
  282.                      }
  283.                      else if(_root.protector1health <= 2 and _root.protector1health >= 0)
  284.                      {
  285.                         _root.ship.protector.sphere.gotoAndStop("critical");
  286.                      }
  287.                      else if(_root.protector1health < 0)
  288.                      {
  289.                         trace("Protector1 Gone");
  290.                         if(_root.protectorlevel > 2)
  291.                         {
  292.                            _root.protectorframe = _root.ship.protector2._currentframe - 19;
  293.                            if(_root.protectorframe < 3)
  294.                            {
  295.                               _root.protectorframe = 41 + _root.protectorframe;
  296.                            }
  297.                            _root.protectorlevel = 2;
  298.                            if(_root.autorotate == true)
  299.                            {
  300.                               _root.ship.protector.gotoAndPlay(_root.protectorframe);
  301.                            }
  302.                            else
  303.                            {
  304.                               _root.ship.protector.gotoAndStop(_root.protectorframe);
  305.                            }
  306.                            _root.protector1health = _root.protector2health;
  307.                            if(_root.protector1health < 7 and _root.protector1health > 2)
  308.                            {
  309.                               _root.ship.protector.sphere.gotoAndStop("half");
  310.                            }
  311.                            else if(_root.protector1health <= 2 and _root.protector1health >= 0)
  312.                            {
  313.                               _root.ship.protector.sphere.gotoAndStop("critical");
  314.                            }
  315.                         }
  316.                         else
  317.                         {
  318.                            _root.protectorlevel = 0;
  319.                         }
  320.                         _root.enemyexplodesound.stop();
  321.                         _root.enemyexplodesound.start(0,0);
  322.                         duplicateMovieClip(_root.shipexplosion,"shipexplosion" + _root.depth,16384 + _root.depth);
  323.                         _root["shipexplosion" + _root.depth]._x = _root.ship._x + _root.ship.protector._x + _root.ship.protector.sphere._x;
  324.                         _root["shipexplosion" + _root.depth]._y = _root.ship._y + _root.ship.protector._y + _root.ship.protector.sphere._y;
  325.                         _root["shipexplosion" + _root.depth]._xscale = _root["shipexplosion" + _root.depth]._yscale = 50;
  326.                         if(_root.depth < 100000)
  327.                         {
  328.                            _root.depth = _root.depth + 1;
  329.                         }
  330.                         else
  331.                         {
  332.                            _root.depth = 100;
  333.                         }
  334.                      }
  335.                   }
  336.                   if(_root.bulletarray[bc].hitTest(_root.ship.protector2.sphere))
  337.                   {
  338.                      _root.protector2health -= 1;
  339.                      if(_root.protector2health < 7 and _root.protector2health > 2)
  340.                      {
  341.                         _root.ship.protector2.sphere.gotoAndStop("half");
  342.                      }
  343.                      else if(_root.protector2health <= 2 and _root.protector2health >= 0)
  344.                      {
  345.                         _root.ship.protector2.sphere.gotoAndStop("critical");
  346.                      }
  347.                      else if(_root.protector2health < 0)
  348.                      {
  349.                         trace("Protector2 Gone");
  350.                         _root.protectorlevel = 2;
  351.                         _root.enemyexplodesound.stop();
  352.                         _root.enemyexplodesound.start(0,0);
  353.                         duplicateMovieClip(_root.shipexplosion,"shipexplosion" + _root.depth,16384 + _root.depth);
  354.                         _root["shipexplosion" + _root.depth]._x = _root.ship._x + _root.ship.protector2._x + _root.ship.protector2.sphere._x;
  355.                         _root["shipexplosion" + _root.depth]._y = _root.ship._y + _root.ship.protector2._y + _root.ship.protector2.sphere._y;
  356.                         _root["shipexplosion" + _root.depth]._xscale = _root["shipexplosion" + _root.depth]._yscale = 50;
  357.                         if(_root.depth < 100000)
  358.                         {
  359.                            _root.depth = _root.depth + 1;
  360.                         }
  361.                         else
  362.                         {
  363.                            _root.depth = 100;
  364.                         }
  365.                      }
  366.                   }
  367.                   _root.bulletarray[bc].removeMovieClip();
  368.                   _root.bulletarray.splice(bc,1);
  369.                }
  370.             }
  371.             if(_root.boss2stoplaser == true)
  372.             {
  373.                if(_root.bulletarray[bc].enemyshottype == "boss2laser1" or _root.bulletarray[bc].enemyshottype == "boss2laser2")
  374.                {
  375.                   _root.bulletarray[bc].removeMovieClip();
  376.                   _root.bulletarray.splice(bc,1);
  377.                }
  378.             }
  379.             if(_root.bulletarray[bc].hitTest(_root.ship.shipmc))
  380.             {
  381.                _root.hitship = true;
  382.                _root.shieldfadein = true;
  383.                _root.checkhealth = true;
  384.                if(_root.difficulty == "expert")
  385.                {
  386.                   _root.hitshipcounter = _root.hitshipcounter + 1;
  387.                   if(_root.hitshipcounter == 6)
  388.                   {
  389.                      if(_root.weaponnumber > 1)
  390.                      {
  391.                         _root.weaponnumber--;
  392.                      }
  393.                      _root.hitshipcounter = 0;
  394.                   }
  395.                }
  396.                if(_root.bulletarray[bc].enemyshottype == "shot1")
  397.                {
  398.                   _root.shipshield -= 5;
  399.                   _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
  400.                   _root.bulletarray[bc].removeMovieClip();
  401.                   _root.bulletarray.splice(bc,1);
  402.                }
  403.                else if(_root.bulletarray[bc].enemyshottype == "enemymissilet" or _root.bulletarray[bc].enemyshottype == "enemymissileb")
  404.                {
  405.                   _root.shipshield -= 7;
  406.                   _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
  407.                   _root.bulletarray[bc].removeMovieClip();
  408.                   _root.bulletarray.splice(bc,1);
  409.                }
  410.                else if(_root.bulletarray[bc].enemyshottype == "enemy7")
  411.                {
  412.                   _root.shipshield -= 8;
  413.                   _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
  414.                   _root.bulletarray[bc].removeMovieClip();
  415.                   _root.bulletarray.splice(bc,1);
  416.                }
  417.                else if(_root.bulletarray[bc].enemyshottype == "boss1electric")
  418.                {
  419.                   _root.shipshield -= 8;
  420.                   _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
  421.                   _root.bulletarray[bc].removeMovieClip();
  422.                   _root.bulletarray.splice(bc,1);
  423.                }
  424.                else if(_root.bulletarray[bc].enemyshottype == "boss1canon")
  425.                {
  426.                   _root.mhexplosion.stop();
  427.                   _root.mhexplosion.start(0,0);
  428.                   _root.mhexplosionmc.duplicateMovieClip("mhexplode" + _root.depth,_root.depth);
  429.                   _root["mhexplode" + _root.depth]._x = _root.bulletarray[bc]._x;
  430.                   _root["mhexplode" + _root.depth]._y = _root.bulletarray[bc]._y;
  431.                   _root["mhexplode" + _root.depth]._xscale = _root["mhexplode" + _root.depth]._yscale = 300;
  432.                   if(_root.depth < 100000)
  433.                   {
  434.                      _root.depth = _root.depth + 1;
  435.                   }
  436.                   else
  437.                   {
  438.                      _root.depth = 100;
  439.                   }
  440.                   _root.shipshield -= 15;
  441.                   _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
  442.                   _root.bulletarray[bc].removeMovieClip();
  443.                   _root.bulletarray.splice(bc,1);
  444.                }
  445.                else if(_root.bulletarray[bc].enemyshottype == "boss2laser1" or _root.bulletarray[bc].enemyshottype == "boss2laser2")
  446.                {
  447.                   _root.shipshield -= 2;
  448.                   _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
  449.                }
  450.                else if(_root.bulletarray[bc].enemyshottype == "boss2gun")
  451.                {
  452.                   _root.shipshield -= 6;
  453.                   _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
  454.                   _root.bulletarray[bc].removeMovieClip();
  455.                   _root.bulletarray.splice(bc,1);
  456.                }
  457.                else if(_root.bulletarray[bc].enemyshottype == "boss2big")
  458.                {
  459.                   _root.shipshield -= 10;
  460.                   _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
  461.                   _root.bulletarray[bc].removeMovieClip();
  462.                   _root.bulletarray.splice(bc,1);
  463.                }
  464.                else if(_root.bulletarray[bc].enemyshottype == "boss3")
  465.                {
  466.                   _root.shipshield -= 4;
  467.                   _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
  468.                   _root.bulletarray[bc].removeMovieClip();
  469.                   _root.bulletarray.splice(bc,1);
  470.                }
  471.                else if(_root.bulletarray[bc].enemyshottype == "fbossgun")
  472.                {
  473.                   _root.shipshield -= 6;
  474.                   _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
  475.                   _root.bulletarray[bc].removeMovieClip();
  476.                   _root.bulletarray.splice(bc,1);
  477.                }
  478.                else if(_root.bulletarray[bc].enemyshottype == "fbosslaser" or _root.bulletarray[bc].enemyshottype == "boss2laser2")
  479.                {
  480.                   _root.shipshield -= 1;
  481.                   _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
  482.                }
  483.             }
  484.          }
  485.          else if(_root.bulletarray[bc].shottype != "enemy")
  486.          {
  487.             if(_root.bulletarray[bc].shottype == "airmine" and _root.bulletarray[bc].hitTest(_root.ship.shipmc))
  488.             {
  489.                _root.shipshield -= 0.3;
  490.                _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
  491.             }
  492.             i = 0;
  493.             while(i < _root.enemyarray.length)
  494.             {
  495.                if(_root.bulletarray[bc].hitTest(_root.enemyarray[i].enemytype))
  496.                {
  497.                   _root.hitenemy = _root.enemyarray[i]._name;
  498.                   if(_root.bulletarray[bc].shottype != "blue1" and _root.bulletarray[bc].shottype != "blue4" and _root.bulletarray[bc].shottype != "blue3" and _root.bulletarray[bc].shottype != "blue2" and _root.bulletarray[bc].shottype != "sblue" and _root.bulletarray[bc].shottype != "bomb" and _root.bulletarray[bc].shottype != "sred" and _root.bulletarray[bc].shottype != "sgreen")
  499.                   {
  500.                      if(_root.bulletarray[bc].xvalue >= 0)
  501.                      {
  502.                         _root.mhexplosionmc.duplicateMovieClip("mhexplode" + _root.depth,_root.depth);
  503.                         _root["mhexplode" + _root.depth]._x = _root.bulletarray[bc]._x + 20;
  504.                         _root["mhexplode" + _root.depth]._y = _root.bulletarray[bc]._y;
  505.                         _root["mhexplode" + _root.depth]._xscale = _root["mhexplode" + _root.depth]._yscale = 50;
  506.                         if(_root.depth < 100000)
  507.                         {
  508.                            _root.depth = _root.depth + 1;
  509.                         }
  510.                         else
  511.                         {
  512.                            _root.depth = 100;
  513.                         }
  514.                      }
  515.                      else
  516.                      {
  517.                         _root.mhexplosionmc.duplicateMovieClip("mhexplode" + _root.depth,_root.depth);
  518.                         _root["mhexplode" + _root.depth]._x = _root.bulletarray[bc]._x - 20;
  519.                         _root["mhexplode" + _root.depth]._y = _root.bulletarray[bc]._y;
  520.                         _root["mhexplode" + _root.depth]._xscale = _root["mhexplode" + _root.depth]._yscale = 50;
  521.                         if(_root.depth < 100000)
  522.                         {
  523.                            _root.depth = _root.depth + 1;
  524.                         }
  525.                         else
  526.                         {
  527.                            _root.depth = 100;
  528.                         }
  529.                      }
  530.                   }
  531.                   else if(_root.bulletarray[bc].shottype != "sblue" and _root.bulletarray[bc].shottype != "bomb" and _root.bulletarray[bc].shottype != "sred" and _root.bulletarray[bc].shottype != "sgreen")
  532.                   {
  533.                      _root.bulletarray[bc].explodedelay = _root.bulletarray[bc].explodedelay + 1;
  534.                      if(_root.bulletarray[bc].explodedelay == 3)
  535.                      {
  536.                         _root.mhexplosionmc.duplicateMovieClip("mhexplode" + _root.depth,_root.depth);
  537.                         _root["mhexplode" + _root.depth]._x = _root.bulletarray[bc]._x + 30;
  538.                         _root["mhexplode" + _root.depth]._y = _root.enemyarray[i]._y + _root.enemyarray[i].enemytype._y + (random(30) - 15);
  539.                         _root["mhexplode" + _root.depth]._xscale = _root["mhexplode" + _root.depth]._yscale = 50;
  540.                         if(_root.depth < 100000)
  541.                         {
  542.                            _root.depth = _root.depth + 1;
  543.                         }
  544.                         else
  545.                         {
  546.                            _root.depth = 100;
  547.                         }
  548.                         _root.bulletarray[bc].explodedelay = 0;
  549.                      }
  550.                   }
  551.                   if(_root.bulletarray[bc].shottype == "homingmissile")
  552.                   {
  553.                      _root.mhexplosion.stop();
  554.                      _root.mhexplosion.start(0,0);
  555.                      _root.enemyarray[i].health -= 2;
  556.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  557.                      {
  558.                         _root.boss3health -= 2;
  559.                      }
  560.                      _root.bulletarray[bc].removeMovieClip();
  561.                      _root.bulletarray.splice(bc,1);
  562.                   }
  563.                   else if(_root.bulletarray[bc].shottype == "red1")
  564.                   {
  565.                      _root.enemyarray[i].health -= 1.5;
  566.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  567.                      {
  568.                         _root.boss3health -= 1.5;
  569.                      }
  570.                      _root.bulletarray[bc].removeMovieClip();
  571.                      _root.bulletarray.splice(bc,1);
  572.                   }
  573.                   else if(_root.bulletarray[bc].shottype == "red2")
  574.                   {
  575.                      _root.enemyarray[i].health -= 1.9;
  576.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  577.                      {
  578.                         _root.boss3health -= 1.9;
  579.                      }
  580.                      _root.bulletarray[bc].removeMovieClip();
  581.                      _root.bulletarray.splice(bc,1);
  582.                   }
  583.                   else if(_root.bulletarray[bc].shottype == "red3")
  584.                   {
  585.                      _root.enemyarray[i].health -= 2.3;
  586.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  587.                      {
  588.                         _root.boss3health -= 2.3;
  589.                      }
  590.                      _root.bulletarray[bc].removeMovieClip();
  591.                      _root.bulletarray.splice(bc,1);
  592.                   }
  593.                   else if(_root.bulletarray[bc].shottype == "red4")
  594.                   {
  595.                      _root.enemyarray[i].health -= 2.7;
  596.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  597.                      {
  598.                         _root.boss3health -= 2.7;
  599.                      }
  600.                      _root.bulletarray[bc].removeMovieClip();
  601.                      _root.bulletarray.splice(bc,1);
  602.                   }
  603.                   else if(_root.bulletarray[bc].shottype == "sred")
  604.                   {
  605.                      if(_root.bulletarray[bc].exploding == true)
  606.                      {
  607.                         _root.enemyarray[i].health -= 1;
  608.                         if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  609.                         {
  610.                            _root.boss3health -= 0.2;
  611.                         }
  612.                      }
  613.                   }
  614.                   else if(_root.bulletarray[bc].shottype == "blue1")
  615.                   {
  616.                      _root.enemyarray[i].health -= 0.3;
  617.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  618.                      {
  619.                         _root.boss3health -= 0.3;
  620.                      }
  621.                   }
  622.                   else if(_root.bulletarray[bc].shottype == "blue2")
  623.                   {
  624.                      _root.enemyarray[i].health -= 0.34;
  625.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  626.                      {
  627.                         _root.boss3health -= 0.36;
  628.                      }
  629.                   }
  630.                   else if(_root.bulletarray[bc].shottype == "blue3")
  631.                   {
  632.                      _root.enemyarray[i].health -= 0.48;
  633.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  634.                      {
  635.                         _root.boss3health -= 0.42;
  636.                      }
  637.                   }
  638.                   else if(_root.bulletarray[bc].shottype == "blue4")
  639.                   {
  640.                      _root.enemyarray[i].health -= 0.42;
  641.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  642.                      {
  643.                         _root.boss3health -= 0.47;
  644.                      }
  645.                   }
  646.                   else if(_root.bulletarray[bc].shottype == "sblue")
  647.                   {
  648.                      _root.enemyarray[i].health -= 2;
  649.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  650.                      {
  651.                         _root.boss3health -= 0.4;
  652.                      }
  653.                   }
  654.                   else if(_root.bulletarray[bc].shottype == "green1")
  655.                   {
  656.                      _root.enemyarray[i].health -= 1.8;
  657.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  658.                      {
  659.                         _root.boss3health -= 1.8;
  660.                      }
  661.                      _root.bulletarray[bc].removeMovieClip();
  662.                      _root.bulletarray.splice(bc,1);
  663.                   }
  664.                   else if(_root.bulletarray[bc].shottype == "green2")
  665.                   {
  666.                      _root.enemyarray[i].health -= 2;
  667.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  668.                      {
  669.                         _root.boss3health -= 2;
  670.                      }
  671.                      _root.bulletarray[bc].removeMovieClip();
  672.                      _root.bulletarray.splice(bc,1);
  673.                   }
  674.                   else if(_root.bulletarray[bc].shottype == "green3")
  675.                   {
  676.                      _root.enemyarray[i].health -= 2.2;
  677.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  678.                      {
  679.                         _root.boss3health -= 2.4;
  680.                      }
  681.                      _root.bulletarray[bc].removeMovieClip();
  682.                      _root.bulletarray.splice(bc,1);
  683.                   }
  684.                   else if(_root.bulletarray[bc].shottype == "green4")
  685.                   {
  686.                      _root.enemyarray[i].health -= 2.5;
  687.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  688.                      {
  689.                         _root.boss3health -= 2.5;
  690.                      }
  691.                      _root.bulletarray[bc].removeMovieClip();
  692.                      _root.bulletarray.splice(bc,1);
  693.                   }
  694.                   else if(_root.bulletarray[bc].shottype == "sgreen")
  695.                   {
  696.                      _root.enemyarray[i].health -= 2;
  697.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  698.                      {
  699.                         _root.boss3health -= 0.4;
  700.                      }
  701.                   }
  702.                   else if(_root.bulletarray[bc].shottype == "laser")
  703.                   {
  704.                      _root.enemyarray[i].health -= 3.5;
  705.                      if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  706.                      {
  707.                         _root.boss3health -= 1.17;
  708.                      }
  709.                   }
  710.                   else if(_root.bulletarray[bc].shottype == "bomb")
  711.                   {
  712.                      if(_root.bombexplode == true)
  713.                      {
  714.                         _root.enemyarray[i].health -= 2;
  715.                         if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  716.                         {
  717.                            _root.boss3health -= 0.4;
  718.                         }
  719.                      }
  720.                   }
  721.                   _root.enemyarray[i].gotoAndPlay("hit");
  722.                   if(_root.enemyarray[i].enemytypevar == "boss3head" or _root.enemyarray[i].enemytypevar == "boss3body" or _root.enemyarray[i].enemytypevar == "boss3tail")
  723.                   {
  724.                      _root.enemyarray[_root.enemyarray.length - 1].gotoAndPlay("hit");
  725.                      _root.enemyarray[_root.enemyarray.length - 2].gotoAndPlay("hit");
  726.                      _root.enemyarray[_root.enemyarray.length - 3].gotoAndPlay("hit");
  727.                      _root.enemyarray[_root.enemyarray.length - 4].gotoAndPlay("hit");
  728.                      _root.enemyarray[_root.enemyarray.length - 5].gotoAndPlay("hit");
  729.                   }
  730.                }
  731.                i++;
  732.             }
  733.          }
  734.          if(_root.bulletarray[bc].xvalue > 0)
  735.          {
  736.             if(_root.bulletarray[bc]._x > 730 or _root.bulletarray[bc]._y < -50 or _root.bulletarray[bc]._y > 550)
  737.             {
  738.                if(_root.bulletarray[bc].shottype == "bomb")
  739.                {
  740.                   _root.bombfire = false;
  741.                }
  742.                _root.bulletarray[bc].removeMovieClip();
  743.                _root.bulletarray.splice(bc,1);
  744.             }
  745.          }
  746.          else if(_root.bulletarray[bc].xvalue < 0)
  747.          {
  748.             if(_root.bulletarray[bc]._x < -30 or _root.bulletarray[bc]._y < -50 or _root.bulletarray[bc]._y > 550)
  749.             {
  750.                if(_root.bulletarray[bc].shottype == "bomb")
  751.                {
  752.                   _root.bombfire = false;
  753.                }
  754.                _root.bulletarray[bc].removeMovieClip();
  755.                _root.bulletarray.splice(bc,1);
  756.             }
  757.          }
  758.          bc--;
  759.       }
  760.    }
  761. };
  762.