home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / FleshFighter.swf / scripts / frame_5 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  12.3 KB  |  506 lines

  1. if(c1 == "0")
  2. {
  3.    xpc1 = "1" + random("200");
  4.    setProperty("/c1", _X, xpc1);
  5.    ypc1 = - "10";
  6.    setProperty("/c1", _Y, ypc1);
  7.    setProperty("c1", _visible, "1");
  8.    axc1 = "1" + random("5");
  9.    ayc1 = "1" + random("20");
  10.    c1 = "1";
  11. }
  12. if("400" < ypc1 or "330" < xpc1)
  13. {
  14.    c1 = "0";
  15. }
  16. if(c2 == "0")
  17. {
  18.    xpc2 = "320" - random("200");
  19.    setProperty("/c2", _X, xpc2);
  20.    ypc2 = - "10";
  21.    setProperty("/c2", _Y, ypc2);
  22.    setProperty("c2", _visible, "1");
  23.    axc2 = - random("6");
  24.    ayc2 = "1" + random("20");
  25.    c2 = "1";
  26. }
  27. if("400" < ypc2 or xpc2 < - "10")
  28. {
  29.    c2 = "0";
  30. }
  31. xpc1 += axc1;
  32. ypc1 += ayc1;
  33. setProperty("/c1", _X, xpc1);
  34. setProperty("/c1", _Y, ypc1);
  35. xpc2 += axc2;
  36. ypc2 += ayc2;
  37. setProperty("/c2", _X, xpc2);
  38. setProperty("/c2", _Y, ypc2);
  39. a = "1";
  40. while(level >= a)
  41. {
  42.    if(eval("e" add a) == "0")
  43.    {
  44.       set("xpe" add a,"1" + random("300"));
  45.       setProperty("e" add a, _X, eval("xpe" add a));
  46.       set("ype" add a,- "10" - random("300"));
  47.       setProperty("e" add a, _Y, eval("ype" add a));
  48.       setProperty("e" add a, _visible, "1");
  49.       direction = random("2");
  50.       if(direction == "1")
  51.       {
  52.          set("axe" add a,random("4"));
  53.       }
  54.       else
  55.       {
  56.          set("axe" add a,- random("6"));
  57.       }
  58.       set("aye" add a,"5" + random("10"));
  59.       set("e" add a,"1");
  60.    }
  61.    if("400" < eval("ype" add a) or "330" < eval("xpe" add a) or eval("xpe" add a) < "10")
  62.    {
  63.       set("e" add a,"0");
  64.    }
  65.    set("xpe" add a,eval("xpe" add a) + eval("axe" add a));
  66.    set("ype" add a,eval("ype" add a) + eval("aye" add a));
  67.    setProperty("e" add a, _X, eval("xpe" add a));
  68.    setProperty("e" add a, _Y, eval("ype" add a));
  69.    a += "1";
  70. }
  71. if(shipx < getProperty("s", _X))
  72. {
  73.    tellTarget("/s")
  74.    {
  75.       gotoAndPlay(6);
  76.    }
  77. }
  78. if(getProperty("s", _X) < shipx)
  79. {
  80.    tellTarget("/s")
  81.    {
  82.       gotoAndPlay(3);
  83.    }
  84. }
  85. if(getProperty("s", _Y) < shipy)
  86. {
  87.    tellTarget("/s/flame")
  88.    {
  89.       gotoAndPlay(2);
  90.    }
  91. }
  92. shipx = getProperty("s", _X);
  93. shipy = getProperty("s", _Y);
  94. if(getProperty("s", _X) < xpc1 + "20" and xpc1 - "20" < getProperty("s", _X) and getProperty("s", _Y) < ypc1 + "25" and ypc1 - "10" < getProperty("s", _Y))
  95. {
  96.    c1 = "0";
  97.    tellTarget("/s/shield")
  98.    {
  99.       gotoAndPlay(2);
  100.    }
  101. }
  102. if(getProperty("s", _X) < xpc2 + "20" and xpc2 - "20" < getProperty("s", _X) and getProperty("s", _Y) < ypc2 + "25" and ypc2 - "10" < getProperty("s", _Y))
  103. {
  104.    c2 = "0";
  105.    tellTarget("/s/shield")
  106.    {
  107.       gotoAndPlay(2);
  108.    }
  109. }
  110. if("25" < score)
  111. {
  112.    level = "1";
  113. }
  114. if("150" < score)
  115. {
  116.    level = "2";
  117. }
  118. if("400" < score)
  119. {
  120.    level = "3";
  121. }
  122. if("20" >= shield)
  123. {
  124.    setProperty("/alert", _visible, "1");
  125. }
  126. if("0" >= shield)
  127. {
  128.    gotoAndPlay(7);
  129. }
  130. if(platon == "0")
  131. {
  132.    ypp = - "800";
  133.    xpp = random("800") - random("400");
  134.    ypa = "2";
  135.    setProperty("/p1", _X, xpp);
  136.    platon = "1";
  137. }
  138. setProperty("/p1", _Y, ypp);
  139. ypp += ypa;
  140. if("700" + random("200") < ypp)
  141. {
  142.    platon = "0";
  143. }
  144. if(platon2 == "0")
  145. {
  146.    ypp2 = - "300";
  147.    xpp2 = random("800") - random("300");
  148.    ypa2 = "0.8";
  149.    setProperty("/p2", _X, xpp2);
  150.    platon2 = "1";
  151. }
  152. setProperty("/p2", _Y, ypp2);
  153. ypp2 += ypa2;
  154. if("800" + random("200") < ypp2)
  155. {
  156.    platon2 = "0";
  157. }
  158. if(level >= "1")
  159. {
  160.    if(fireon == "0" and "10" < ype1)
  161.    {
  162.       f1x = getProperty("e1", _X);
  163.       f1y = getProperty("e1", _Y);
  164.       f1xa = axe1;
  165.       f1ya = aye1 + "10";
  166.       fireon = "1";
  167.       setProperty("/f1", _X, f1x);
  168.       setProperty("/f1", _Y, f1y);
  169.       setProperty("/f1", _visible, "1");
  170.       tellTarget("/f1")
  171.       {
  172.          gotoAndPlay(2);
  173.       }
  174.    }
  175.    f1x += f1xa;
  176.    f1y += f1ya;
  177.    setProperty("/f1", _X, f1x);
  178.    setProperty("/f1", _Y, f1y);
  179.    if(getProperty("s", _X) < f1x + "25" and f1x - "25" < getProperty("s", _X) and getProperty("s", _Y) < f1y + "20" and f1y - "20" < getProperty("s", _Y))
  180.    {
  181.       tellTarget("/s/shield")
  182.       {
  183.          gotoAndPlay(2);
  184.       }
  185.       fireon = "0";
  186.    }
  187. }
  188. if(level >= "2")
  189. {
  190.    if(fireon2 == "0" and "10" < ype2)
  191.    {
  192.       f2x = getProperty("e2", _X);
  193.       f2y = getProperty("e2", _Y);
  194.       f2xa = axe2 - random("20") + random("20");
  195.       f2ya = aye2 + "20";
  196.       fireon2 = "1";
  197.       setProperty("/f2", _X, f2x);
  198.       setProperty("/f2", _Y, f2y);
  199.       tellTarget("/f2")
  200.       {
  201.          gotoAndPlay(2);
  202.       }
  203.    }
  204.    f2x += f2xa;
  205.    f2y += f2ya;
  206.    setProperty("/f2", _X, f2x);
  207.    setProperty("/f2", _Y, f2y);
  208.    if(getProperty("s", _X) < f2x + "25" and f2x - "25" < getProperty("s", _X) and getProperty("s", _Y) < f2y + "10" and f2y - "10" < getProperty("s", _Y))
  209.    {
  210.       tellTarget("/s/shield")
  211.       {
  212.          gotoAndPlay(2);
  213.       }
  214.       fireon2 = "0";
  215.    }
  216. }
  217. if(level >= "3")
  218. {
  219.    if(fireon3a == "0" and "10" < ype3)
  220.    {
  221.       f3ax = getProperty("e3", _X);
  222.       f3ay = getProperty("e3", _Y);
  223.       f3axa = axe1 + random("11") - random("11");
  224.       f3aya = aye1 + "10";
  225.       fireon3a = "1";
  226.       setProperty("/f3a", _X, f3ax);
  227.       setProperty("/f3a", _Y, f3ay);
  228.       setProperty("/f3a", _visible, "1");
  229.       tellTarget("/f3a")
  230.       {
  231.          gotoAndPlay(2);
  232.       }
  233.    }
  234.    f3ax += f3axa;
  235.    f3ay += f3aya;
  236.    setProperty("/f3a", _X, f3ax);
  237.    setProperty("/f3a", _Y, f3ay);
  238.    if(getProperty("s", _X) < f3ax + "25" and f3ax - "25" < getProperty("s", _X) and getProperty("s", _Y) < f3ay + "10" and f3ay - "10" < getProperty("s", _Y))
  239.    {
  240.       tellTarget("/s/shield")
  241.       {
  242.          gotoAndPlay(2);
  243.       }
  244.       fireon3a = "0";
  245.    }
  246.    if(fireon3b == "0" and "10" < ype3)
  247.    {
  248.       f3bx = getProperty("e3", _X);
  249.       f3by = getProperty("e3", _Y);
  250.       f3bxa = axe1 + random("11") - random("11");
  251.       f3bya = aye1 + "10";
  252.       fireon3b = "1";
  253.       setProperty("/f3b", _X, f3bx);
  254.       setProperty("/f3b", _Y, f3by);
  255.       setProperty("/f3b", _visible, "1");
  256.       tellTarget("/f3b")
  257.       {
  258.          gotoAndPlay(2);
  259.       }
  260.    }
  261.    f3bx += f3bxa;
  262.    f3by += f3bya;
  263.    setProperty("/f3b", _X, f3bx);
  264.    setProperty("/f3b", _Y, f3by);
  265.    if(getProperty("s", _X) < f3bx + "25" and f3bx - "25" < getProperty("s", _X) and getProperty("s", _Y) < f3by + "10" and f3by - "10" < getProperty("s", _Y))
  266.    {
  267.       tellTarget("/s/shield")
  268.       {
  269.          gotoAndPlay(2);
  270.       }
  271.       fireon3b = "0";
  272.    }
  273. }
  274. if(playerfire == "1" and ball2 == "0")
  275. {
  276.    pf2x = getProperty("s", _X) - "10";
  277.    pf2y = getProperty("s", _Y);
  278.    pf2ya = - "40";
  279.    pf2xa = "0";
  280.    ball2 = "1";
  281.    setProperty("/pf2", _X, pf2x);
  282.    setProperty("/pf2", _Y, pf2y);
  283.    tellTarget("/pf2")
  284.    {
  285.       gotoAndPlay(2);
  286.    }
  287. }
  288. else if(playerfire == "1" and ball1 == "0")
  289. {
  290.    pf1x = getProperty("s", _X) + "10";
  291.    pf1y = getProperty("s", _Y);
  292.    pf1ya = - "40";
  293.    pf1xa = "0";
  294.    ball1 = "1";
  295.    setProperty("/pf1", _X, pf1x);
  296.    setProperty("/pf1", _Y, pf1y);
  297.    tellTarget("/pf1")
  298.    {
  299.       gotoAndPlay(2);
  300.    }
  301. }
  302. else if(playerfire == "1" and ball3 == "0")
  303. {
  304.    pf3x = getProperty("s", _X);
  305.    pf3y = getProperty("s", _Y);
  306.    pf3ya = - "40";
  307.    ball3 = "1";
  308.    setProperty("/pf3", _X, pf3x);
  309.    setProperty("/pf3", _Y, pf3y);
  310.    tellTarget("/pf3")
  311.    {
  312.       gotoAndPlay(2);
  313.    }
  314. }
  315. else if(playerfire == "1" and ball4 == "0")
  316. {
  317.    pf4x = getProperty("s", _X);
  318.    pf4y = getProperty("s", _Y) - "40";
  319.    pf4ya = - "1";
  320.    ball4 = "1";
  321.    setProperty("/pf4", _X, pf4x);
  322.    setProperty("/pf4", _Y, pf4y);
  323.    tellTarget("/pf4")
  324.    {
  325.       gotoAndPlay(2);
  326.    }
  327. }
  328. if(ball2 == "1")
  329. {
  330.    pf2y += pf2ya;
  331.    setProperty("/pf2", _Y, pf2y);
  332.    pf2x += pf2xa;
  333.    setProperty("/pf2", _X, pf2x);
  334.    if(c1 == "1" and getProperty("c1", _X) < pf2x + "30" and pf2x - "30" < getProperty("c1", _X) and getProperty("c1", _Y) < pf2y + "30" and pf2y - "30" < getProperty("c1", _Y))
  335.    {
  336.       ball2 = "0";
  337.       tellTarget("/pf2")
  338.       {
  339.          gotoAndStop(1);
  340.       }
  341.       tellTarget("/c1")
  342.       {
  343.          gotoAndPlay(2);
  344.       }
  345.    }
  346.    if(c2 == "1" and getProperty("c2", _X) < pf2x + "30" and pf2x - "30" < getProperty("c2", _X) and getProperty("c2", _Y) < pf2y + "30" and pf2y - "30" < getProperty("c2", _Y))
  347.    {
  348.       ball2 = "0";
  349.       tellTarget("/pf2")
  350.       {
  351.          gotoAndStop(1);
  352.       }
  353.       tellTarget("/c2")
  354.       {
  355.          gotoAndPlay(2);
  356.       }
  357.    }
  358.    a = "1";
  359.    while(eval("/:level") >= a)
  360.    {
  361.       if(eval("e" add a) == "1" and getProperty("e" add a, _X) < pf2x + "30" and pf2x - "30" < getProperty("e" add a, _X) and getProperty("e" add a, _Y) < pf2y + "30" and pf2y - "30" < getProperty("e" add a, _Y))
  362.       {
  363.          ball2 = "0";
  364.          tellTarget("/e" add a)
  365.          {
  366.             gotoAndPlay(2);
  367.          }
  368.       }
  369.       a += "1";
  370.    }
  371. }
  372. if(ball1 == "1")
  373. {
  374.    pf1y += pf1ya;
  375.    setProperty("/pf1", _Y, pf1y);
  376.    pf1x += pf1xa;
  377.    setProperty("/pf1", _X, pf1x);
  378.    if(c1 == "1" and getProperty("c1", _X) < pf1x + "30" and pf1x - "30" < getProperty("c1", _X) and getProperty("c1", _Y) < pf1y + "30" and pf1y - "30" < getProperty("c1", _Y))
  379.    {
  380.       ball1 = "0";
  381.       tellTarget("/pf1")
  382.       {
  383.          gotoAndStop(1);
  384.       }
  385.       tellTarget("/c1")
  386.       {
  387.          gotoAndPlay(2);
  388.       }
  389.    }
  390.    if(c2 == "1" and getProperty("c2", _X) < pf1x + "30" and pf1x - "30" < getProperty("c2", _X) and getProperty("c2", _Y) < pf1y + "30" and pf1y - "30" < getProperty("c2", _Y))
  391.    {
  392.       ball1 = "0";
  393.       tellTarget("/pf1")
  394.       {
  395.          gotoAndStop(1);
  396.       }
  397.       tellTarget("/c2")
  398.       {
  399.          gotoAndPlay(2);
  400.       }
  401.    }
  402.    a = "1";
  403.    while(eval("/:level") >= a)
  404.    {
  405.       if(eval("e" add a) == "1" and getProperty("e" add a, _X) < pf1x + "30" and pf1x - "30" < getProperty("e" add a, _X) and getProperty("e" add a, _Y) < pf1y + "30" and pf1y - "30" < getProperty("e" add a, _Y))
  406.       {
  407.          ball1 = "0";
  408.          tellTarget("/e" add a)
  409.          {
  410.             gotoAndPlay(2);
  411.          }
  412.       }
  413.       a += "1";
  414.    }
  415. }
  416. if(ball3 == "1")
  417. {
  418.    pf3y += pf3ya;
  419.    setProperty("/pf3", _Y, pf3y);
  420.    if(c1 == "1" and getProperty("c1", _X) < pf3x + "30" and pf3x - "30" < getProperty("c1", _X) and getProperty("c1", _Y) < pf3y + "30" and pf3y - "30" < getProperty("c1", _Y))
  421.    {
  422.       ball3 = "0";
  423.       tellTarget("/pf3")
  424.       {
  425.          gotoAndStop(1);
  426.       }
  427.       tellTarget("/c1")
  428.       {
  429.          gotoAndPlay(2);
  430.       }
  431.    }
  432.    if(c2 == "1" and getProperty("c2", _X) < pf3x + "30" and pf3x - "30" < getProperty("c2", _X) and getProperty("c2", _Y) < pf3y + "30" and pf3y - "30" < getProperty("c2", _Y))
  433.    {
  434.       ball3 = "0";
  435.       tellTarget("/pf3")
  436.       {
  437.          gotoAndStop(1);
  438.       }
  439.       tellTarget("/c2")
  440.       {
  441.          gotoAndPlay(2);
  442.       }
  443.    }
  444.    a = "1";
  445.    while(eval("/:level") >= a)
  446.    {
  447.       if(eval("e" add a) == "1" and getProperty("e" add a, _X) < pf3x + "30" and pf3x - "30" < getProperty("e" add a, _X) and getProperty("e" add a, _Y) < pf3y + "30" and pf3y - "30" < getProperty("e" add a, _Y))
  448.       {
  449.          ball3 = "0";
  450.          tellTarget("/e" add a)
  451.          {
  452.             gotoAndPlay(2);
  453.          }
  454.       }
  455.       a += "1";
  456.    }
  457. }
  458. if(ball4 == "1")
  459. {
  460.    pf4y += pf4ya;
  461.    setProperty("/pf4", _Y, pf4y);
  462.    pf4ya -= "3";
  463.    if(c1 == "1" and getProperty("c1", _X) < pf4x + "30" and pf4x - "30" < getProperty("c1", _X) and getProperty("c1", _Y) < pf4y + "30" and pf4y - "30" < getProperty("c1", _Y))
  464.    {
  465.       ball4 = "0";
  466.       tellTarget("/pf4")
  467.       {
  468.          gotoAndStop(1);
  469.       }
  470.       tellTarget("/c1")
  471.       {
  472.          gotoAndPlay(2);
  473.       }
  474.    }
  475.    if(c2 == "1" and getProperty("c2", _X) < pf4x + "30" and pf4x - "30" < getProperty("c2", _X) and getProperty("c2", _Y) < pf4y + "30" and pf4y - "30" < getProperty("c2", _Y))
  476.    {
  477.       ball4 = "0";
  478.       tellTarget("/pf4")
  479.       {
  480.          gotoAndStop(1);
  481.       }
  482.       tellTarget("/c2")
  483.       {
  484.          gotoAndPlay(2);
  485.       }
  486.    }
  487.    a = "1";
  488.    while(eval("/:level") >= a)
  489.    {
  490.       if(eval("e" add a) == "1" and getProperty("e" add a, _X) < pf4x + "35" and pf4x - "35" < getProperty("e" add a, _X) and getProperty("e" add a, _Y) < pf4y + "30" and pf4y - "30" < getProperty("e" add a, _Y))
  491.       {
  492.          tellTarget("/e" add a)
  493.          {
  494.             hitcounter -= "1";
  495.             gotoAndPlay(2);
  496.          }
  497.          ball4 = "0";
  498.          tellTarget("/pf4")
  499.          {
  500.             gotoAndStop(1);
  501.          }
  502.       }
  503.       a += "1";
  504.    }
  505. }
  506.