home *** CD-ROM | disk | FTP | other *** search
- class HitItem
- {
- var nom = new String();
- var hitType = new String();
- var mcRef = null;
- var mcEtat = null;
- var missionId = new Number();
- function HitItem(l_mcRef, l_type, l_missionId)
- {
- this.nom = l_mcRef._name;
- this.mcRef = l_mcRef;
- this.hitType = l_type;
- this.mcEtat = "Idle";
- this.mcRef.gotoAndStop("PasLa");
- if(l_missionId != undefined)
- {
- this.missionId = l_missionId;
- }
- else
- {
- this.missionId = 1;
- }
- if(l_type != "fireBarrier")
- {
- this.mcRef._visible = false;
- this.mcRef.gotoAndStop("PasLa");
- }
- }
- function GetMissionId()
- {
- return this.missionId;
- }
- function CollisionHappen(l_collisionResp)
- {
- switch(this.hitType)
- {
- case "ob_hole":
- l_collisionResp.Fall();
- break;
- case "burnInsigna":
- if(this.mcEtat == "Idle")
- {
- var _loc3_ = _global.C[_global.C.G_vehPers].GetStageCoord();
- if(this.mcRef.Etat.pu.hitTest(_loc3_.x,_loc3_.y,true))
- {
- _global.S.PlaySound("powerUp",75,1);
- this.mcEtat = "Over";
- _global.C[_global.C.G_interface].ActivateBurnInsigna();
- this.mcRef.gotoAndStop("Over");
- }
- }
- break;
- case "deetsInsigna":
- if(this.mcEtat == "Idle")
- {
- _loc3_ = _global.C[_global.C.G_vehPers].GetStageCoord();
- if(this.mcRef.Etat.pu.hitTest(_loc3_.x,_loc3_.y,true))
- {
- _global.S.PlaySound("powerUp",75,1);
- this.mcEtat = "Over";
- _global.C[_global.C.G_interface].ActivateDeetsInsigna();
- this.mcRef.gotoAndStop("Over");
- }
- }
- break;
- case "fizzInsigna":
- if(this.mcEtat == "Idle")
- {
- _loc3_ = _global.C[_global.C.G_vehPers].GetStageCoord();
- if(this.mcRef.Etat.pu.hitTest(_loc3_.x,_loc3_.y,true))
- {
- _global.S.PlaySound("powerUp",75,1);
- this.mcEtat = "Over";
- _global.C[_global.C.G_interface].UpdatePoints(1000);
- _global.C._parent.Overlays.gotoAndPlay("1000Cred");
- this.mcRef.gotoAndStop("Over");
- }
- }
- break;
- case "edInsigna":
- if(this.mcEtat == "Idle")
- {
- _loc3_ = _global.C[_global.C.G_vehPers].GetStageCoord();
- if(this.mcRef.Etat.pu.hitTest(_loc3_.x,_loc3_.y,true))
- {
- _global.S.PlaySound("powerUp",75,1);
- this.mcEtat = "Over";
- _global.C.G_nbLife = _global.C.G_nbLife + 1;
- _global.C[_global.C.G_interface].UpdateNbLife();
- _global.C[_global.C.G_interface].UpdateEdFace("Happy");
- this.mcRef.gotoAndStop("Over");
- _global.C._parent.Overlays.gotoAndPlay("1up");
- }
- }
- break;
- case "loogieInsigna":
- if(this.mcEtat == "Idle")
- {
- _loc3_ = _global.C[_global.C.G_vehPers].GetStageCoord();
- if(this.mcRef.Etat.pu.hitTest(_loc3_.x,_loc3_.y,true))
- {
- _global.S.PlaySound("powerUp",75,1);
- this.mcEtat = "Over";
- _global.C[_global.C.G_interface].ActivateLoogieInsigna();
- this.mcRef.gotoAndStop("Over");
- }
- }
- break;
- case "powerSpike":
- _global.C[_global.C.G_interface].ActivatePowerSpike();
- this.mcRef.gotoAndStop("Over");
- break;
- case "gravityWell":
- _global.C[_global.C.G_interface].ActivateGravityWell(this.mcRef);
- this.mcRef.gotoAndStop("Over");
- break;
- case "fireBarrier":
- if(!_global.C[_global.C.G_interface].IsBurnInsigna())
- {
- _global.C[_global.C.G_vehPers].CheckColliders(this.mcRef);
- _global.S.PlaySound("fireBarrier",50,1);
- this.mcRef.gotoAndStop("Hit");
- }
- break;
- case "pk_drop":
- this.OnDropZone(l_collisionResp);
- }
- }
- function GetMcState()
- {
- return this.mcEtat;
- }
- function GetPropCoord()
- {
- var _loc2_ = new Object();
- _loc2_.x = this.mcRef._x;
- _loc2_.y = this.mcRef._y;
- return _loc2_;
- }
- function GetZone()
- {
- var _loc3_ = this.GetPropCoord();
- this.mcRef._parent.localToGlobal(_loc3_);
- return _global.C.utils.GetHitZone(_loc3_);
- }
- function OnDropZone()
- {
- }
- function SetMcState(l_state)
- {
- this.mcEtat = l_state;
- }
- function GotoMcState(l_state, l_visible)
- {
- if(this.hitType != "fireBarrier")
- {
- if(l_state == "PasLa")
- {
- this.mcRef.gotoAndStop(l_state);
- }
- else
- {
- this.mcRef.gotoAndStop(l_state);
- }
- this.mcRef._visible = l_visible;
- }
- }
- }
-