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

  1. _root.powerupmove = function()
  2. {
  3.    var pu = _root.poweruparray.length - 1;
  4.    while(pu >= 0)
  5.    {
  6.       _root.poweruparray[pu]._x += _root.powerupspeed;
  7.       if(_root.poweruparray[pu]._x < -50)
  8.       {
  9.          _root.poweruparray[pu].removeMovieClip();
  10.       }
  11.       if(_root.poweruparray[pu].poweruptype == "weapon")
  12.       {
  13.          if(_root.poweruparray[pu].needchange == true)
  14.          {
  15.             if(_root.poweruparray[pu].ticks2 < 20)
  16.             {
  17.                _root.poweruparray[pu].ticks2 = _root.poweruparray[pu].ticks2 + 1;
  18.             }
  19.             else
  20.             {
  21.                _root.poweruparray[pu].ticks2 = 0;
  22.                _root.poweruparray[pu].needchange = false;
  23.                _root.poweruparray[pu].play();
  24.             }
  25.          }
  26.       }
  27.       if(_root.poweruparray[pu].hitTest(_root.ship.shipmc))
  28.       {
  29.          if(_root.poweruparray[pu].poweruptype == "weapon")
  30.          {
  31.             _root.weaponpowersound.stop();
  32.             _root.weaponpowersound.start(0,0);
  33.             if(_root.weapontype == _root.poweruparray[pu].weaponpowercolor)
  34.             {
  35.                if(_root.levelnumber == 1)
  36.                {
  37.                   if(_root.weaponnumber < 2)
  38.                   {
  39.                      _root.weaponnumber = _root.weaponnumber + 1;
  40.                   }
  41.                   else if(_root.poweruparray[pu].weaponpowercolor == "red")
  42.                   {
  43.                      _root.sredx = _root.poweruparray[pu]._x;
  44.                      _root.sredy = _root.poweruparray[pu]._y;
  45.                      _root.sred();
  46.                   }
  47.                   else if(_root.poweruparray[pu].weaponpowercolor == "blue")
  48.                   {
  49.                      _root.sbluex = _root.poweruparray[pu]._x;
  50.                      _root.sbluey = _root.poweruparray[pu]._y;
  51.                      _root.sblue();
  52.                   }
  53.                   else if(_root.poweruparray[pu].weaponpowercolor == "green")
  54.                   {
  55.                      _root.sgreenfunction = true;
  56.                      _root.sgreentimer = 0;
  57.                   }
  58.                }
  59.                else if(_root.levelnumber == 2)
  60.                {
  61.                   if(_root.weaponnumber < 3)
  62.                   {
  63.                      _root.weaponnumber = _root.weaponnumber + 1;
  64.                   }
  65.                   else if(_root.poweruparray[pu].weaponpowercolor == "red")
  66.                   {
  67.                      _root.sredx = _root.poweruparray[pu]._x;
  68.                      _root.sredy = _root.poweruparray[pu]._y;
  69.                      _root.sred();
  70.                   }
  71.                   else if(_root.poweruparray[pu].weaponpowercolor == "blue")
  72.                   {
  73.                      _root.sbluex = _root.poweruparray[pu]._x;
  74.                      _root.sbluey = _root.poweruparray[pu]._y;
  75.                      _root.sblue();
  76.                   }
  77.                   else if(_root.poweruparray[pu].weaponpowercolor == "green")
  78.                   {
  79.                      _root.sgreenfunction = true;
  80.                      _root.sgreentimer = 0;
  81.                   }
  82.                }
  83.                else if(_root.levelnumber >= 3)
  84.                {
  85.                   if(_root.weaponnumber < 4)
  86.                   {
  87.                      _root.weaponnumber = _root.weaponnumber + 1;
  88.                   }
  89.                   else if(_root.poweruparray[pu].weaponpowercolor == "red")
  90.                   {
  91.                      _root.sredx = _root.poweruparray[pu]._x;
  92.                      _root.sredy = _root.poweruparray[pu]._y;
  93.                      _root.sred();
  94.                   }
  95.                   else if(_root.poweruparray[pu].weaponpowercolor == "blue")
  96.                   {
  97.                      _root.sbluex = _root.poweruparray[pu]._x;
  98.                      _root.sbluey = _root.poweruparray[pu]._y;
  99.                      _root.sblue();
  100.                   }
  101.                   else if(_root.poweruparray[pu].weaponpowercolor == "green")
  102.                   {
  103.                      _root.sgreenfunction = true;
  104.                      _root.sgreentimer = 0;
  105.                   }
  106.                }
  107.             }
  108.             else
  109.             {
  110.                _root.transform = true;
  111.             }
  112.             _root.weapontype = _root.poweruparray[pu].weaponpowercolor;
  113.             _root.poweruparray[pu].removeMovieClip();
  114.          }
  115.          else if(_root.poweruparray[pu].poweruptype == "missile")
  116.          {
  117.             _root.missilepowersound.stop();
  118.             _root.missilepowersound.start(0,0);
  119.             if(_root.mhlevel < 5)
  120.             {
  121.                _root.mhlevel = _root.mhlevel + 1;
  122.                _root.whichmissileframe = "level" + _root.mhlevel;
  123.                _root.status.mask.missile.gotoAndStop(_root.whichmissileframe);
  124.             }
  125.             else if(_root.mode == "mission")
  126.             {
  127.                _root.totalscore += 10;
  128.                _root.status.score = int(_root.totalscore);
  129.             }
  130.             else if(_root.mode == "survival")
  131.             {
  132.                _root.totalscore2 += 10;
  133.                _root.status.score = int(_root.totalscore2);
  134.             }
  135.          }
  136.          else if(_root.poweruparray[pu].poweruptype == "bomb")
  137.          {
  138.             _root.bombpowersound.stop();
  139.             _root.bombpowersound.start(0,0);
  140.             if(_root.numberofbombs < 15)
  141.             {
  142.                _root.numberofbombs = _root.numberofbombs + 1;
  143.                _root.status.bomb.gotoAndStop(_root.numberofbombs + 1);
  144.             }
  145.             else if(_root.mode == "stage")
  146.             {
  147.                _root.totalscore += 10;
  148.                _root.status.score = int(_root.totalscore);
  149.             }
  150.             else if(_root.mode == "survival")
  151.             {
  152.                _root.totalscore2 += 10;
  153.                _root.status.score = int(_root.totalscore2);
  154.             }
  155.          }
  156.          else if(_root.poweruparray[pu].poweruptype == "health")
  157.          {
  158.             _root.healthpowersound.stop();
  159.             _root.healthpowersound.start(0,0);
  160.             if(_root.shipshield > 35)
  161.             {
  162.                _root.shipshield = 50;
  163.             }
  164.             else
  165.             {
  166.                _root.shipshield += 15;
  167.             }
  168.             _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
  169.          }
  170.          else if(_root.poweruparray[pu].poweruptype == "minihealth")
  171.          {
  172.             _root.healthpowersound.stop();
  173.             _root.healthpowersound.start(0,0);
  174.             if(_root.shipshield > 45)
  175.             {
  176.                _root.shipshield = 50;
  177.             }
  178.             else
  179.             {
  180.                _root.shipshield += 5;
  181.             }
  182.             _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
  183.          }
  184.          else if(_root.poweruparray[pu].poweruptype == "protector")
  185.          {
  186.             _root.protectorpowersound.stop();
  187.             _root.protectorpowersound.start(0,0);
  188.             _root.protector1health = _root.protector2health = 15;
  189.             _root.ship.protector.sphere.gotoAndStop("full");
  190.             _root.ship.protector2.sphere.gotoAndStop("full");
  191.             if(_root.protectorlevel < 4)
  192.             {
  193.                _root.protectorlevel = _root.protectorlevel + 1;
  194.                if(_root.protectorlevel > 2)
  195.                {
  196.                   _root.ship.protector2.gotoAndStop("protector");
  197.                }
  198.                else if(_root.protectorlevel == 1)
  199.                {
  200.                   _root.ship.protector.gotoAndStop("protector");
  201.                }
  202.             }
  203.             else if(_root.mode == "stage")
  204.             {
  205.                _root.totalscore += 10;
  206.                _root.status.score = int(_root.totalscore);
  207.             }
  208.             else if(_root.mode == "survival")
  209.             {
  210.                _root.totalscore2 += 10;
  211.                _root.status.score = int(_root.totalscore2);
  212.             }
  213.          }
  214.          _root.poweruparray[pu].removeMovieClip();
  215.          _root.poweruparray.splice(pu,1);
  216.       }
  217.       pu--;
  218.    }
  219. };
  220.