home *** CD-ROM | disk | FTP | other *** search
- class Package
- {
- var MAXI_DIST_NEXT_DROP_ZONE = 8000;
- var attachedTo = new Object();
- var currentDropZone = new String();
- var nom = new String();
- var distance = new Number();
- var timeBonus = new Number();
- var attachedToVan = new Boolean();
- function Package(l_nom)
- {
- this.nom = l_nom;
- this.attachedToVan = false;
- }
- function AttachToDropZone()
- {
- this.attachedTo = _global.C[this.currentDropZone];
- _global.C[this.currentDropZone].LightZone();
- _global.C[_global.C.G_miniMap].refreshDropDot = true;
- this.attachedToVan = false;
- }
- function AttachToVan()
- {
- this.attachedTo = _global.C[_global.C.G_van];
- _global.C[this.currentDropZone].ShutZone();
- _global.C[_global.C.G_miniMap].refreshDropDot = true;
- _global.C[_global.C.G_van].GotPackage();
- this.attachedToVan = true;
- }
- function AttachedToVan()
- {
- return this.attachedToVan;
- }
- function GetAttachedTo()
- {
- return this.attachedTo.nom;
- }
- function GetTimeBonus()
- {
- return this.timeBonus;
- }
- function GetDropZone()
- {
- return this.currentDropZone;
- }
- function GetName()
- {
- return this.nom;
- }
- function ChooseDropZone()
- {
- var _loc5_ = 0;
- var _loc3_ = this.currentDropZone;
- var _loc7_ = 0;
- var _loc6_ = false;
- do
- {
- var _loc4_ = _global.C.utils.GetRandomB(0,_global.C.G_DropZoneTab.length - 1);
- _loc3_ = _global.C.G_DropZoneTab[_loc4_];
- if(!_global.C[_loc3_].picked && _global.C[_loc3_].GetMissionId() <= _global.C.G_missionId)
- {
- _loc7_ = _global.C.utils.GetAbsDistBetweenObj(_global.C[_loc3_],_global.C[_global.C.G_vehPers]);
- _loc6_ = true;
- }
- _loc5_ = _loc5_ + 1;
- }
- while(!_loc6_ && _loc5_ < 75);
-
- this.currentDropZone = _loc3_;
- this.attachedTo = _global.C[this.currentDropZone];
- this.distance = _loc7_;
- if(this.distance <= 1000)
- {
- this.timeBonus = 5;
- }
- else if(this.distance > 1000 && this.distance <= 2000)
- {
- this.timeBonus = 10;
- }
- else if(this.distance > 2000 && this.distance <= 3000)
- {
- this.timeBonus = 15;
- }
- else
- {
- this.timeBonus = 25;
- }
- _global.C[this.currentDropZone].LightZone();
- _global.C[_global.C.G_miniMap].refreshDropDot = true;
- _global.C[_global.C.G_packageTimer].StartTimer(9999999);
- }
- }
-