## XIDPawn
Class FBI_Helico01a

source: C:\XIII\XIDPawn\Classes\FBI_Helico01a.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Pawn
             |
             +--XIII.XIIIPawn
                |
                +--XIDPawn.BaseSoldier
                   |
                   +--XIDPawn.FBI_Helico01a

Direct Known Subclasses:None

class FBI_Helico01a
extends XIDPawn.BaseSoldier

    //-----------------------------------------------------------
    //
    //-----------------------------------------------------------

Variables
`TalkieWalkie` | `Talkie`
`float` | `TempsDegainageTalkie`
`bool` | `bBlocked`

States
Dying

Function Summary
`void` | `PlayCallTalkie()`
`void` | `PlayTakeTalkie()`
`void` | `SpawnCadavre()`

State Dying Function Summary

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class FBI_Helico01a extends BaseSoldier;
    00005
    00006	var TalkieWalkie Talkie;
    00007	var() float TempsDegainageTalkie;
    00008	var bool bBlocked;
    00009
    00010	event timer2()
    00011	{
    00012		bBlocked=false;
    00013	}
    00014
    00015	event PostBeginPlay()
    00016	{
    00017			local FBI_Helico01_Controller FBI_Controller;
    00018
    00019	      super.PostBeginPlay();
    00020
    00021			FBI_Controller=FBI_Helico01_Controller(controller);
    00022
    00023		//	FBI_Controller.CHARGE_LES_LOGS=true;
    00024			FBI_Controller.FBI=self;
    00025
    00026			 Switch(Level.Game.Difficulty)
    00027			 {
    00028				 case 0: FBI_Controller.FBI.TempsDegainageTalkie*=1.2; break;
    00029				 case 2: FBI_Controller.FBI.TempsDegainageTalkie*=0.8;break;
    00030				 case 3: FBI_Controller.FBI.TempsDegainageTalkie*=0.6; break;
    00031			 }
    00032	     Talkie = Spawn(class'TalkieWalkie',self);
    00033	     Talkie.AttachToWalkie(self,false);
    00034			talkie.bhidden=true;
    00035		  	talkie.RefreshDisplaying();
    00036
    00037			 LinkSkelAnim (MeshAnimation'XIIIPersosG.MigA');
    00038			 LinkSkelAnim (MeshAnimation'XIIIPersos.SpadsSPeA');
    00039	}
    00040
    00041
    00042	event bump(actor other)
    00043	{
    00044		local FBI_Helico01_Controller FBIController,monFBIController;
    00045		local FBI_Helico01a FBIPawn;
    00046		local safepoint PointSafeVise;
    00047
    00048	   if (bBlocked)
    00049			return;
    00050
    00051		if (other.isa('xiiiplayerpawn')) // je me crampe sur XIII
    00052		{
    00053			if (controller!=none &&  bmoving && (velocity dot (other.location-location)>0))
    00054			{
    00055				if (Talkie!=none) Talkie.AttachToWalkie(self,false); //remet talkie ceinture
    00056				log(self@"je suis crampe sur xiii je repasse en attaque"@other);
    00057				controller.gotostate('restesurplace','PutDownTalkie');
    00058			}
    00059		}
    00060		else
    00061		{
    00062			FBIPawn=FBI_Helico01a(other);
    00063			if (FBIPawn!=none)
    00064			{
    00065				FBIController=FBI_Helico01_Controller(FBIPawn.controller);
    00066				monFBIController=FBI_Helico01_Controller(controller);
    00067				if (FBIController!=none && monFBIController!=none) // je me crampe sur un pote
    00068				{
    00069					if (Vsize(monFBIController.xiii.location-self.location)<Vsize(monFBIController.xiii.location-other.location) )
    00070					{
    00071						log(self@"je suis en face de XIII et je suis bloque par mon mon pote je repasse en attaque");
    00072						bBlocked=true;
    00073						settimer2(2,false);
    00074						FBIPawn.bBlocked=true;
    00075						FBIPawn.settimer2(10,false);
    00076						PointSafeVise=none;
    00077						if (velocity dot (monFBIController.xiii.location-location)<0 && FBIPAWN.velocity dot (monFBIController.xiii.location-location)>=0 ) //je fuis et pas l'autre
    00078					   {
    00079							if (monFBIController.isinstate('vavers') && monFBIController.bGoToCallTalkie &&  safepoint(monFBIController.moveactor.moveactor)!=none)  //j'allais vesr talkie point
    00080							{
    00081								PointSafeVise=safepoint(monFBIController.moveactor.moveactor);
    00082								PointSafeVise.timer(); //pour liberer point
    00083								monFBIController.gotostate('restesurplace','PutDownTalkie');
    00084							}
    00085							if (FBIController.NiveauAlerte!=2) FBIController.gotostate('investigation','ContinueUnPeuEtAttaque');   //je suis pas en attaque
    00086						}
    00087						else
    00088						{
    00089							if (FBIController.isinstate('vavers') && FBIController.bGoToCallTalkie && safepoint(FBIController.moveactor.moveactor)!=none)    //j'allais vers point
    00090							{
    00091								PointSafeVise=safepoint(FBIController.moveactor.moveactor);
    00092								PointSafeVise.timer(); //pour liberer point
    00093								FBIController.gotostate('restesurplace','PutDownTalkie');
    00094							}
    00095						}
    00096					}
    00097				}
    00098			}
    00099		}
    00100	}
    00101
    00102	function PlayTakeTalkie()
    00103	{
    00104		 TakeAnimControl(false);
    00105	    playAnim('talkie1',2,0.5,FIRINGCHANNEL+1);
    00106		 AnimBlendToAlpha(FIRINGCHANNEL+1,1,0.05);
    00107	}
    00108	function PlayCallTalkie()
    00109	{
    00110		 TakeAnimControl(false);
    00111	    loopAnim('Talkie2',1,0.1,FIRINGChannel+1);
    00112		 AnimBlendToAlpha(FIRINGCHANNEL+1,1,0.05);
    00113	}
    00114
    00115	function SpawnCadavre()
    00116	{
    00117	    Controller.gotostate('mort');
    00118	}
    00119
    00120	//state dying du xiii pawn
    00121	state Dying
    00122	{
    00123	    event Tick (float delta)
    00124	    {
    00125	//      super(XIIIPawn).Tick(delta);
    00126	    }
    00127	    event Landed(vector HitNormal)
    00128	    {
    00129	      LandedSpecial();
    00130	      PlaySound(hBodyFallSound);
    00131	    }
    00132	    event Touch(actor other)
    00133	    {
    00134	//      super(XIIIPawn).Touch(other);
    00135	    }
    00136	    event BeginState()
    00137	    {
    00138	//      Log("Dying BeginState, should be setting timer to 2.0");
    00139
    00140	      enable('tick');
    00141	      bForceInUniverse = false;
    00142	      RefreshDisplaying();
    00143
    00144	      if ( bTearOff && (Level.NetMode == NM_DedicatedServer) )
    00145	        LifeSpan = 1.0;
    00146	      SetTimer(2.0, false);
    00147
    00148	      SetPhysics(PHYS_Falling);
    00149	      bInvulnerableBody = true;
    00150
    00151	      if ( Controller != None )
    00152	      {
    00153	        if( Controller.bIsPlayer )
    00154	          Controller.PawnDied();
    00155	        else
    00156	          SpawnCadavre();
    00157	        if (controller != none)
    00158	          Controller.bControlAnimations = true;
    00159	      }
    00160			bmoving=false;
    00161	    }
    00162	Begin:
    00163	  Sleep(0.5);
    00164	  bInvulnerableBody=false;
    00165	  if (talkie!=none) talkie.destroy();
    00166	  genalerte(level.game.genalerte).potemeurt(self);   //genalerte doit etre present dans toute map solo
    00167	  // ELR Added LieStill there 0.5 seconds after state beginning because we don't want the col cyl staying big a long time
    00168	  LieStill();
    00169	}
    00170
    00171
    00172
    00173
    00174	defaultproperties
    00175	{
    00176	     TempsDegainageTalkie=3.000000
    00177	     bCanBeGrabbed=False
    00178	     GroundSpeed=356.000000
    00179	     ControllerClass=Class'XIDPawn.FBi_Helico01_Controller'
    00180	     Mesh=SkeletalMesh'XIIIPersos.GardienM'
    00181	}

End Source Code