home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Acao / Titans / raven.swf / scripts / frame_10 / DoAction.as
Text File  |  2006-01-05  |  4KB  |  178 lines

  1. call("pro");
  2. stopAllSounds();
  3. _global.r = this;
  4. _global.n = this.raven;
  5. Mouse.hide();
  6. r.attachmovie("cursor","cursor",65000);
  7. fadescreen();
  8. noshot = 0;
  9. crash = 0;
  10. grav = 0.1;
  11. grav2 = 0.7;
  12. energymax = 100;
  13. energy = energymax;
  14. energyless = 20;
  15. energymiss = 8;
  16. overloadenergy = 10;
  17. finish = 0;
  18. ontop = 0;
  19. score = 0;
  20. point = 100;
  21. totalfloor = 50;
  22. floornow = 0;
  23. scrollspeed = 3;
  24. stopscroll = 0;
  25. inv = 0;
  26. r.cheat1 = 0;
  27. invhitdelay = 50;
  28. bonus1delay = 80;
  29. rd = 1000;
  30. rd2 = 990;
  31. got = 0;
  32. hit = 0;
  33. rubspeed = 2.7;
  34. rubspeedmax = 5;
  35. rubdelay = 20;
  36. rubdelaymin = 16;
  37. d = rubdelay;
  38. level = 400;
  39. ld = level;
  40. toprubdelay = 90;
  41. td = toprubdelay;
  42. stoprubble = 0;
  43. rubtipe1 = [1,2,3,4,5,6,7,8,9,10];
  44. rubtipe1a = rubtipe1.copy();
  45. rubtipe1a.randomize();
  46. rubtipe2 = [11,12,13];
  47. rubtipe2a = rubtipe2.copy();
  48. rubtipe2a.randomize();
  49. rubpos = [100,150,200,250,300,350,400,450,500];
  50. rubpos2 = rubpos.copy();
  51. rubpos2.randomize();
  52. rubs = [];
  53. r.createEmptyMovieClip("sfx",60001);
  54. allsfx = ["zbonus","zhit","zrock","zspeaker","ztv","zwater","zsplash","zshrink"];
  55. var i = 0;
  56. while(i < allsfx.length)
  57. {
  58.    r[allsfx[i]] = new sound(sfx);
  59.    r[allsfx[i]].attachsound(allsfx[i]);
  60.    i++;
  61. }
  62. r.createEmptyMovieClip("sfx2",60002);
  63. r.zloop = new sound(sfx2);
  64. r.zloop.attachsound("zloop");
  65. r.createEmptyMovieClip("sfx3",60003);
  66. r.zboss = new sound(sfx3);
  67. r.zboss.attachsound("zboss");
  68. r.createEmptyMovieClip("sfx4",60004);
  69. r.zlose = new sound(sfx4);
  70. r.zlose.attachsound("zlose");
  71. r.createEmptyMovieClip("sfx5",60005);
  72. r.zwin = new sound(sfx5);
  73. r.zwin.attachsound("zwin");
  74. zloop.start(0,999999);
  75. var i = 0;
  76. while(i < 15)
  77. {
  78.    r.attachmovie("lill","rub" + r.rd,r.rd);
  79.    r["rub" + r.rd]._x = 50 + random(550);
  80.    r["rub" + r.rd]._y = -5 + random(350);
  81.    r.rd = r.rd + 1;
  82.    i++;
  83. }
  84. rockwait = 5;
  85. onenterframe = function()
  86. {
  87.    if(!r.stoprubble)
  88.    {
  89.       d--;
  90.       if(!d)
  91.       {
  92.          bonus1delay--;
  93.          if(bonus1delay == 0)
  94.          {
  95.             d = 2 * r.rubdelay;
  96.             r.attachmovie("bonus1","bonus1",r.rd);
  97.             r.rd = r.rd + 1;
  98.          }
  99.          else
  100.          {
  101.             d = r.rubdelay;
  102.             r.attachmovie("rub","rub" + r.rd,r.rd);
  103.             if(!rubpos2.length)
  104.             {
  105.                rubpos2 = rubpos.copy();
  106.                rubpos2.randomize();
  107.             }
  108.             r["rub" + r.rd]._x = rubpos2.pop();
  109.             r["rub" + r.rd]._y = -100;
  110.             if(rockwait > 0)
  111.             {
  112.                rockwait--;
  113.                next = 1;
  114.             }
  115.             else
  116.             {
  117.                next = 2;
  118.                rockwait = 1 + random(3);
  119.             }
  120.             if(next == 1)
  121.             {
  122.                if(!rubtipe1a.length)
  123.                {
  124.                   rubtipe1a = rubtipe1.copy();
  125.                   rubtipe1a.randomize();
  126.                }
  127.                r["rub" + r.rd].tipe = rubtipe1a.pop();
  128.             }
  129.             else
  130.             {
  131.                if(!rubtipe2a.length)
  132.                {
  133.                   rubtipe2a = rubtipe2.copy();
  134.                   rubtipe2a.randomize();
  135.                }
  136.                r["rub" + r.rd].tipe = rubtipe2a.pop();
  137.             }
  138.             r.rubs.push("rub" + r.rd);
  139.             r.rd = r.rd + 1;
  140.          }
  141.       }
  142.       ld--;
  143.       if(!ld)
  144.       {
  145.          ld = r.level;
  146.          if(r.rubdelay > r.rubdelaymin)
  147.          {
  148.             r.rubdelay--;
  149.          }
  150.          if(r.rubspeed < r.rubspeedmax)
  151.          {
  152.             r.rubspeed += 0.2;
  153.          }
  154.       }
  155.       if(random(100) > 70)
  156.       {
  157.          r.attachmovie("lill","rub" + r.rd,r.rd);
  158.          r["rub" + r.rd]._x = 50 + random(550);
  159.          r["rub" + r.rd]._y = -20;
  160.          r.rd = r.rd + 1;
  161.       }
  162.    }
  163.    if(r.ontop)
  164.    {
  165.       r.td--;
  166.       if(!r.td)
  167.       {
  168.          r.stoprubble = 1;
  169.          rockwait = 100000;
  170.       }
  171.    }
  172.    if(r.inv > 0)
  173.    {
  174.       r.inv--;
  175.    }
  176. };
  177. stop();
  178.