home *** CD-ROM | disk | FTP | other *** search
- class DropZone extends HitItem
- {
- var missionId = new Number();
- var picked = new Boolean();
- function DropZone(l_mcRef, l_missionId)
- {
- super(l_mcRef,"pk_drop");
- this.missionId = l_missionId;
- this.mcEtat = "PasLa";
- this.picked = false;
- }
- function GetMissionId()
- {
- return this.missionId;
- }
- function GetName()
- {
- return this.nom;
- }
- function GetPropCoord()
- {
- var _loc2_ = new Object();
- _loc2_.x = this.mcRef._x;
- _loc2_.y = this.mcRef._y;
- return _loc2_;
- }
- function GetStageCoord()
- {
- var _loc2_ = this.GetPropCoord();
- this.mcRef._parent.localToGlobal(_loc2_);
- return _loc2_;
- }
- function GetZone()
- {
- var _loc3_ = this.GetPropCoord();
- this.mcRef._parent.localToGlobal(_loc3_);
- return _global.C.utils.GetHitZone(_loc3_);
- }
- function LightZone()
- {
- this.mcRef.gotoAndPlay("Appear");
- this.mcEtat = "Idle";
- }
- function OnDropZone(l_collisionResp)
- {
- var _loc3_ = new Number();
- if(_global.C[_global.C.G_package].GetAttachedTo() == this.nom && !this.picked)
- {
- this.picked = true;
- this.ShutZone();
- _global.C[_global.C.G_interface].DeliveredPackage(_global.C[_global.C.packageTimer].GetCurrentTime(),_global.C[_global.C.G_package].GetTimeBonus());
- _loc3_ = _global.C[_global.C.G_packageTimer].GetCurrentTime();
- if(_global.C.G_nbPackagesDone < _global.C.G_nbPackagesToDo)
- {
- _global.S.PlaySound("dropZone",100,1);
- l_collisionResp.Jump(true);
- _global.C[_global.C.G_vanAi].Pause();
- _global.C[_global.C.G_van].Pause();
- _global.C[_global.C.G_package].ChooseDropZone();
- if(_loc3_ <= 10)
- {
- _global.C._parent.Overlays.gotoAndPlay("ExtraPts1");
- }
- else if(_loc3_ > 10 && _loc3_ <= 15)
- {
- _global.C._parent.Overlays.gotoAndPlay("ExtraPts2");
- }
- else if(_loc3_ > 15 && _loc3_ <= 20)
- {
- _global.C._parent.Overlays.gotoAndPlay("ExtraPts3");
- }
- else
- {
- _global.C._parent.Overlays.gotoAndPlay("pack" + String(_global.C.G_nbPackagesDone));
- }
- }
- }
- }
- function ShutZone()
- {
- this.mcRef.gotoAndPlay("Disappear");
- this.mcEtat = "PasLa";
- }
- }
-