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

  1. class DropZone extends HitItem
  2. {
  3.    var missionId = new Number();
  4.    var picked = new Boolean();
  5.    function DropZone(l_mcRef, l_missionId)
  6.    {
  7.       super(l_mcRef,"pk_drop");
  8.       this.missionId = l_missionId;
  9.       this.mcEtat = "PasLa";
  10.       this.picked = false;
  11.    }
  12.    function GetMissionId()
  13.    {
  14.       return this.missionId;
  15.    }
  16.    function GetName()
  17.    {
  18.       return this.nom;
  19.    }
  20.    function GetPropCoord()
  21.    {
  22.       var _loc2_ = new Object();
  23.       _loc2_.x = this.mcRef._x;
  24.       _loc2_.y = this.mcRef._y;
  25.       return _loc2_;
  26.    }
  27.    function GetStageCoord()
  28.    {
  29.       var _loc2_ = this.GetPropCoord();
  30.       this.mcRef._parent.localToGlobal(_loc2_);
  31.       return _loc2_;
  32.    }
  33.    function GetZone()
  34.    {
  35.       var _loc3_ = this.GetPropCoord();
  36.       this.mcRef._parent.localToGlobal(_loc3_);
  37.       return _global.C.utils.GetHitZone(_loc3_);
  38.    }
  39.    function LightZone()
  40.    {
  41.       this.mcRef.gotoAndPlay("Appear");
  42.       this.mcEtat = "Idle";
  43.    }
  44.    function OnDropZone(l_collisionResp)
  45.    {
  46.       var _loc3_ = new Number();
  47.       if(_global.C[_global.C.G_package].GetAttachedTo() == this.nom && !this.picked)
  48.       {
  49.          this.picked = true;
  50.          this.ShutZone();
  51.          _global.C[_global.C.G_interface].DeliveredPackage(_global.C[_global.C.packageTimer].GetCurrentTime(),_global.C[_global.C.G_package].GetTimeBonus());
  52.          _loc3_ = _global.C[_global.C.G_packageTimer].GetCurrentTime();
  53.          if(_global.C.G_nbPackagesDone < _global.C.G_nbPackagesToDo)
  54.          {
  55.             _global.S.PlaySound("dropZone",100,1);
  56.             l_collisionResp.Jump(true);
  57.             _global.C[_global.C.G_vanAi].Pause();
  58.             _global.C[_global.C.G_van].Pause();
  59.             _global.C[_global.C.G_package].ChooseDropZone();
  60.             if(_loc3_ <= 10)
  61.             {
  62.                _global.C._parent.Overlays.gotoAndPlay("ExtraPts1");
  63.             }
  64.             else if(_loc3_ > 10 && _loc3_ <= 15)
  65.             {
  66.                _global.C._parent.Overlays.gotoAndPlay("ExtraPts2");
  67.             }
  68.             else if(_loc3_ > 15 && _loc3_ <= 20)
  69.             {
  70.                _global.C._parent.Overlays.gotoAndPlay("ExtraPts3");
  71.             }
  72.             else
  73.             {
  74.                _global.C._parent.Overlays.gotoAndPlay("pack" + String(_global.C.G_nbPackagesDone));
  75.             }
  76.          }
  77.       }
  78.    }
  79.    function ShutZone()
  80.    {
  81.       this.mcRef.gotoAndPlay("Disappear");
  82.       this.mcEtat = "PasLa";
  83.    }
  84. }
  85.