home *** CD-ROM | disk | FTP | other *** search
/ One Click 21 (Special) / OC021.iso / Juegos / 05-11-10-1.swf / scripts / __Packages / Package.as < prev    next >
Encoding:
Text File  |  2005-11-18  |  2.5 KB  |  93 lines

  1. class Package
  2. {
  3.    var MAXI_DIST_NEXT_DROP_ZONE = 8000;
  4.    var attachedTo = new Object();
  5.    var currentDropZone = new String();
  6.    var nom = new String();
  7.    var distance = new Number();
  8.    var timeBonus = new Number();
  9.    var attachedToVan = new Boolean();
  10.    function Package(l_nom)
  11.    {
  12.       this.nom = l_nom;
  13.       this.attachedToVan = false;
  14.    }
  15.    function AttachToDropZone()
  16.    {
  17.       this.attachedTo = _global.C[this.currentDropZone];
  18.       _global.C[this.currentDropZone].LightZone();
  19.       _global.C[_global.C.G_miniMap].refreshDropDot = true;
  20.       this.attachedToVan = false;
  21.    }
  22.    function AttachToVan()
  23.    {
  24.       this.attachedTo = _global.C[_global.C.G_van];
  25.       _global.C[this.currentDropZone].ShutZone();
  26.       _global.C[_global.C.G_miniMap].refreshDropDot = true;
  27.       _global.C[_global.C.G_van].GotPackage();
  28.       this.attachedToVan = true;
  29.    }
  30.    function AttachedToVan()
  31.    {
  32.       return this.attachedToVan;
  33.    }
  34.    function GetAttachedTo()
  35.    {
  36.       return this.attachedTo.nom;
  37.    }
  38.    function GetTimeBonus()
  39.    {
  40.       return this.timeBonus;
  41.    }
  42.    function GetDropZone()
  43.    {
  44.       return this.currentDropZone;
  45.    }
  46.    function GetName()
  47.    {
  48.       return this.nom;
  49.    }
  50.    function ChooseDropZone()
  51.    {
  52.       var _loc5_ = 0;
  53.       var _loc3_ = this.currentDropZone;
  54.       var _loc7_ = 0;
  55.       var _loc6_ = false;
  56.       do
  57.       {
  58.          var _loc4_ = _global.C.utils.GetRandomB(0,_global.C.G_DropZoneTab.length - 1);
  59.          _loc3_ = _global.C.G_DropZoneTab[_loc4_];
  60.          if(!_global.C[_loc3_].picked && _global.C[_loc3_].GetMissionId() <= _global.C.G_missionId)
  61.          {
  62.             _loc7_ = _global.C.utils.GetAbsDistBetweenObj(_global.C[_loc3_],_global.C[_global.C.G_vehPers]);
  63.             _loc6_ = true;
  64.          }
  65.          _loc5_ = _loc5_ + 1;
  66.       }
  67.       while(!_loc6_ && _loc5_ < 75);
  68.       
  69.       this.currentDropZone = _loc3_;
  70.       this.attachedTo = _global.C[this.currentDropZone];
  71.       this.distance = _loc7_;
  72.       if(this.distance <= 1000)
  73.       {
  74.          this.timeBonus = 5;
  75.       }
  76.       else if(this.distance > 1000 && this.distance <= 2000)
  77.       {
  78.          this.timeBonus = 10;
  79.       }
  80.       else if(this.distance > 2000 && this.distance <= 3000)
  81.       {
  82.          this.timeBonus = 15;
  83.       }
  84.       else
  85.       {
  86.          this.timeBonus = 25;
  87.       }
  88.       _global.C[this.currentDropZone].LightZone();
  89.       _global.C[_global.C.G_miniMap].refreshDropDot = true;
  90.       _global.C[_global.C.G_packageTimer].StartTimer(9999999);
  91.    }
  92. }
  93.