home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Corrida / 5Miles2Go.swf / scripts / frame_384 / DoAction.as
Encoding:
Text File  |  2001-07-07  |  3.3 KB  |  90 lines

  1. FrontLink = ThisCar add "/:FrontLink";
  2. FrontLink1 = ThisCar add "/:FrontLink1";
  3. RearLink = ThisCar add "/:RearLink";
  4. RearLink1 = ThisCar add "/:RearLink1";
  5. TotalDraft = ThisCar add "/:TotalDraft";
  6. FrontDraft = ThisCar add "/:FrontDraft";
  7. RearDraft = ThisCar add "/:RearDraft";
  8. DraftAmount = ThisCar add "/:DraftAmount";
  9. set(FrontLink,"0");
  10. set(FrontLink1,"0");
  11. set(RearLink,"0");
  12. set(RearLink1,"0");
  13. set(TotalDraft,"0");
  14. set(FrontDraft,"0");
  15. set(RearDraft,"0");
  16. set(DraftAmount,"0");
  17. CountCars = "1";
  18. while("5" >= CountCars)
  19. {
  20.    CarNum = "/car" add CountCars;
  21.    CarPositionCount = "0";
  22.    if(getProperty(ThisCar, _X) - "200" < getProperty(CarNum, _X) and getProperty(CarNum, _X) < getProperty(ThisCar, _X) - "175")
  23.    {
  24.       CarPositionCount += "1";
  25.    }
  26.    else if(getProperty(CarNum, _X) >= getProperty(ThisCar, _X) - "175" and getProperty(CarNum, _X) < getProperty(ThisCar, _X) - "150")
  27.    {
  28.       CarPositionCount += "2";
  29.    }
  30.    else if(getProperty(CarNum, _X) >= getProperty(ThisCar, _X) - "150" and getProperty(CarNum, _X) < getProperty(ThisCar, _X) - "125")
  31.    {
  32.       CarPositionCount += "3";
  33.    }
  34.    else if(getProperty(CarNum, _X) >= getProperty(ThisCar, _X) - "125" and getProperty(CarNum, _X) < getProperty(ThisCar, _X))
  35.    {
  36.       CarPositionCount += "4";
  37.    }
  38.    if("7" >= getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) and getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) >= - "7")
  39.    {
  40.       CarPositionCount += "4";
  41.    }
  42.    else if("14" >= getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) and "7" < getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) or getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) >= - "14" and getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) < - "7")
  43.    {
  44.       CarPositionCount += "3";
  45.    }
  46.    else if("21" >= getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) and "14" < getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) or getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) >= - "21" and getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) < - "14")
  47.    {
  48.       CarPositionCount += "2";
  49.    }
  50.    else if("28" >= getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) and "21" < getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) or getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) >= - "28" and getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) < - "21")
  51.    {
  52.       CarPositionCount += "1";
  53.    }
  54.    if(CarPositionCount == "5")
  55.    {
  56.       set(FrontLink,CarNum);
  57.       set(DraftAmount,"1");
  58.    }
  59.    else if(CarPositionCount == "6")
  60.    {
  61.       set(FrontLink,CarNum);
  62.       set(DraftAmount,"2");
  63.    }
  64.    else if(CarPositionCount == "7")
  65.    {
  66.       set(FrontLink,CarNum);
  67.       set(DraftAmount,"3");
  68.    }
  69.    else if(CarPositionCount == "8")
  70.    {
  71.       set(FrontLink,CarNum);
  72.       set(DraftAmount,"4");
  73.    }
  74.    CountCars += "1";
  75. }
  76. CountCars = "1";
  77. while("5" >= CountCars)
  78. {
  79.    CarNum = "/car" add CountCars;
  80.    if(getProperty(CarNum, _Y) >= getProperty(ThisCar, _Y) - "35" and getProperty(ThisCar, _Y) + "35" >= getProperty(CarNum, _Y) and getProperty(ThisCar, _X) - "180" < getProperty(CarNum, _X) and getProperty(CarNum, _X) < getProperty(ThisCar, _X))
  81.    {
  82.       TempLink = CarNum;
  83.       if(TempLink ne eval(FrontLink))
  84.       {
  85.          set(FrontLink1,CarNum);
  86.       }
  87.    }
  88.    CountCars += "1";
  89. }
  90.