XIDPawn
Class FBi_Helico01_Controller

source: C:\XIII\XIDPawn\Classes\FBi_Helico01_Controller.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Controller
         |
         +--Engine.AIController
            |
            +--XIDPawn.IAController
               |
               +--XIDPawn.FBi_Helico01_Controller
Direct Known Subclasses:None

class FBi_Helico01_Controller
extends XIDPawn.IAController

//----------------------------------------------------------- // //-----------------------------------------------------------
Variables
 FBI_Helico01a FBI
 bool bGoToCallTalkie

States
Chasse, ResteSurPlace, VaVers, Investigation, Acquisition, Mort

Function Summary
 bool ChercheTalkiePoint()
     
// ----------------------------------------------------------------------
// CherchePointPourCamper  // pour appeler a l'aide
//
// ----------------------------------------------------------------------
 bool SetMonster(XIIIPawn NewEnemy, bool bEnemyPasVu)
     
// ----------------------------------------------------------------------
// SetMonster
// ----------------------------------------------------------------------


State Chasse Function Summary


State ResteSurPlace Function Summary
 void Endstate()


State VaVers Function Summary
 void endstate()
 void beginstate()


State Investigation Function Summary


State Acquisition Function Summary


State Mort Function Summary
 void Endstate()
 void BeginState()
 void Trigger(Actor Other, Pawn EventInstigator)
 void DamageAttitudeTo(Pawn Other, float Damage)
 bool NearWall(float walldist)



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class FBi_Helico01_Controller extends IAController;
00005	
00006	var FBI_Helico01a FBI;
00007	var bool bGoToCallTalkie;
00008	
00009	
00010	// ----------------------------------------------------------------------
00011	// CherchePointPourCamper  // pour appeler a l'aide
00012	//
00013	// ----------------------------------------------------------------------
00014	function bool ChercheTalkiePoint()  //cherche 2 SPs les plus proches et atteignable pour campage a moins de 10m
00015	{
00016	   local SafePoint Safe,BestSafe,secondsafe;
00017		local actor SecondPathRouteCache[16];
00018	   local int i,j,temp_num;
00019		local int SecondPathNbPoint;
00020	
00021		NbPointChemin=1000;
00022		For(i=0;i<level.game.SafePointList.Length;i++)
00023		{
00024			safe=safepoint(level.game.SafePointList[i]);
00025	      if (!Safe.bAlreadyTargeted && VSize(safe.location-pawn.location)<2000)
00026			{
00027				if (FindBestPathToward(safe))
00028				{
00029					for (j=0;j<16;j++)
00030					{
00031					   if (routecache[j]==none)
00032					     break;
00033					}
00034					temp_num=j;
00035					if (temp_num<NbPointChemin)
00036					{
00037						if (NbPointChemin<1000)
00038						{
00039							SecondSafe=BestSafe;
00040							SecondPathNbPoint=NbPointChemin;
00041							for (j=0;j<16;j++)
00042						 	{
00043						      if (routecache[j]==none)
00044						         break;
00045								SecondPathRouteCache[j]=PointChemin[j];
00046						 	}
00047						}
00048						NbPointChemin=temp_num;
00049						bestsafe=safe;
00050						for (j=0;j<16;j++)
00051					 	{
00052					      if (routecache[j]==none)
00053					         break;
00054							PointChemin[j]=routecache[j];
00055					 	}
00056					}
00057				}
00058	 		}
00059		}
00060		if (secondsafe!=none /*&& rand(2)!=0 */&& (XIII.location - pawn.location) dot (bestsafe.location-pawn.location)>0 && (XIII.location - pawn.location) dot (SecondSafe.location-pawn.location)<0)
00061		{
00062			bestsafe = secondsafe;
00063			for (j=0;j<16;j++)
00064			{
00065				if (routecache[j]==none)
00066					 break;
00067				PointChemin[j]=SecondPathRouteCache[j];
00068			}
00069			NbPointChemin=SecondPathNbPoint;
00070		}
00071	   if (bestsafe==none || (Vsize(bestsafe.location-xiii.location)<600 && rand(3)!=0))
00072		{
00073			NbPointChemin=0;
00074	        return false;
00075		}
00076		MoveActor.MoveActor=bestsafe;
00077		MoveActor.bReachable=false;
00078		Nextstate='ResteSurPlace';
00079		bestsafe.Occupe();
00080		return true;
00081	}
00082	
00083	// ----------------------------------------------------------------------
00084	// SetMonster
00085	// ----------------------------------------------------------------------
00086	Function bool SetMonster(XIIIPawn NewEnemy,bool bEnemyPasVu)
00087	{
00088	    local bool result;
00089	
00090	    if (NewEnemy==Pawn || NewEnemy==None || NewEnemy.bisdead || AllianceLevel(Newenemy)<0)
00091	        return false;
00092	    if (newenemy.controller.isinstate('restesurplace')|| (newenemy.controller.isinstate('vavers') &&  Iacontroller(newenemy.controller).bCampeversSafePoint))
00093	    {
00094	        enemy=xiii;
00095	        gotostate('acquisition','attaque');
00096	    }
00097	    return true;
00098	}
00099	
00100	State Mort
00101	{
00102	    ignores seeplayer,seemonster,hearnoise,notifybump;
00103	
00104	    function bool NearWall(float walldist)
00105	    {
00106	        return false;
00107	    }
00108	    event Tick(float DeltaTime)
00109	    {
00110	    }
00111	    singular function DamageAttitudeTo(pawn Other, float Damage)
00112	    {
00113	    }
00114	    function Trigger(actor Other, pawn EventInstigator)
00115	    {
00116	    }
00117	   function BeginState()
00118	   {
00119			if (CHARGE_LES_LOGS) log(pawn@"dead man"@self);
00120	      HalteAuFeu();
00121	      settimer(0,false);
00122	      settimer2(0,false);
00123	      if (Interrogation!=none)
00124	      {
00125	          Interrogation.destroy();
00126	          Interrogation=none;
00127	      }
00128			if (bGoToCallTalkie && moveactor.moveactor!=none && moveactor.moveactor.isa('safepoint'))
00129			{
00130				moveactor.moveactor.timer(); //pour liberer
00131				bGoToCallTalkie=false;
00132			}
00133	    }
00134	    function Endstate()
00135	    {
00136	    }
00137	begin:
00138	    if (Interrogation!=none)
00139	    {
00140	        interrogation.Destroy();
00141	        interrogation=none;
00142	    }
00143	Dead:
00144	}
00145	
00146	//-----------------------------------------------------
00147	// Acquisition reecrit pour talkie
00148	//-----------------------------------------------------
00149	State Acquisition
00150	{
00151		 event SeeDeadPawn(pawn other)
00152	    {
00153	        local basesoldier soldier;
00154	
00155	        soldier=basesoldier(other);
00156	
00157	        if (bases.BNeVoitPascadavre || bCadavreVu || bdejavu || Soldier.DrawType == DT_NONE ||  soldier==none || soldier.bMonCadavreEstDejaVu || AllianceLevel(Soldier)!=1)
00158	            return;
00159	        bStepNoise=false;
00160	        bCadavreVu=true;
00161	        instigator=other;
00162	        enemy=none;
00163	        InitReactions();
00164	        Soldier.bMonCadavreEstDejaVu=true;
00165	        gotostate('acquisition','CadavreVu');
00166	    }
00167		event Seeplayer(pawn other)
00168		{
00169			if (!bGoToCallTalkie) //cheat pour savoir si a deja sorti talkie
00170			{
00171				if (!bDejaVu && enemy!=none && enemy==other)
00172				{
00173	            	SeeEnemy();
00174				}
00175				else
00176					setenemy(XIII);
00177			}
00178			else
00179				setenemy(XIII);
00180		}
00181	Begin:
00182	    InitReactions();
00183	    if (!bcadavrevu && xiiipawn(enemy).bisdead)
00184	    {
00185	        ChangeEtat();
00186	    }
00187	    Pawn.Acceleration = vect(0,0,0);
00188	    Pawn.Velocity = vect(0,0,0);
00189	Init:
00190	    if (!bDejaVu)
00191	    {
00192	        //pawn.SetAnimStatus('alert');
00193			  //son
00194	   	  pawn.PlaySndPNJOno(pnjono'Onomatopees.hPNJDetect',bases.CodeMesh,bases.NumeroTimbre);//se retourne vers bruit et reste sur place
00195	        Interrogation=Spawn(class'exclamation',self,,bases.location+(vector(bases.rotation) cross vect(0,0,1))*6 + 120*vect(0,0,1));
00196	        interrogation.setbase(pawn);
00197	        if (bStepNoise)
00198	            goto('BruitPas');
00199	        else if (bImpactNoise)
00200	            goto('BruitImpact');
00201	        else if (bCadavreVu)
00202	            goto('CadavreVu');
00203	        else if (bPaffe)
00204	            goto('Paffe');
00205	        else if (bWeaponNoise)
00206	            goto('BruitArme');
00207	    }
00208	    else
00209	        goto('Vu');
00210	BruitPas:
00211	    //se retourne vers bruit, (va vers bruit de pas ??)et reste sur place
00212	    ChercheNMIDuRegard();
00213	    FinishRotation();
00214	    sleep(2);
00215	    Changeetat();
00216	CadavreVu:
00217	    //va vers cadavre, alarme, investigation (???)
00218	    Pawn.Acceleration = vect(0,0,0);
00219	    Pawn.Velocity = vect(0,0,0);
00220	    Focalpoint=instigator.location;
00221	    FinishRotation();
00222	    sleep(0.5);
00223	    if (Vsize(instigator.location-pawn.location)<800)   //vavers cadavre
00224	        temp_vect=0.2*(instigator.location-pawn.location) + pawn.location;
00225	    else
00226	        temp_vect=(Vsize(instigator.location-pawn.location)-800)*normal(instigator.location-pawn.location)+pawn.location;
00227		 TriggerEvent('surprise_corps_decouvert', self, pawn);
00228	    MoveTo(instigator.location,instigator);
00229	 	 pawn.pendingweapon=XIIIWeapon(pawn.FindInventoryType(class'fists'));
00230	    if (Pawn.Weapon!=Pawn.PendingWeapon)
00231	        Pawn.Weapon.PutDown();
00232	    sleep(0.4);
00233		//sort talkie
00234	    FBI.PlayTakeTalkie();
00235	    sleep(0.3); //attente anim
00236	    FBI.Talkie.AttachToWalkie(pawn,true); //talkie dans la main
00237	    sleep(1);
00238		 TriggerEvent('alerte_corps_decouvert', pawn, pawn);
00239		 bases.ReleaseAnimControl();
00240		// TriggerEvent('cadavrevu', self, pawn);
00241	    gotostate('ResteSurPlace');
00242	BruitImpact:
00243	    //se retourne vers bruit, alarme, cherche safepoint sinon investigation
00244	    ChercheNMIDuRegard();
00245	    FinishRotation();
00246	    CherchePointPourCamper(); //interruption possible vers vavers
00247	    gotostate('investigation');
00248	Paffe:
00249	    //se retourne vers tireur (60d), alarme, cherche safepoint sinon investigation
00250	    ChercheNMIDuRegard();
00251	    FinishRotation();
00252	    CherchePointPourCamper();
00253	    gotostate('investigation');
00254	BruitArme:
00255	    //se retourne vers bruit, alarme, va vers bruit,investigation
00256	    ChercheNMIDuRegard();
00257	    FinishRotation();
00258	    if (Fasttrace(instigator.location-vect(0,0,30),pawn.location-vect(0,0,30)))
00259	    {
00260	        MoveActor.MoveActor=none;
00261	        MovePoint.MovePoint=instigator.location;
00262	        Nextstate='Investigation';
00263	        MovePoint.bTraceable=true;
00264	        gotostate('vavers');
00265	    }
00266	    else if (FindbestPathToward(instigator))
00267	    {
00268	        MovePoint.MovePoint=instigator.location;
00269	        Nextstate='Investigation';
00270	        for (iCompteur=0;iCompteur<16;iCompteur++)
00271	        {
00272	            if (routecache[iCompteur]==none)
00273	                break;
00274	            PointChemin[iCompteur]=routecache[iCompteur];
00275	        }
00276	        NbPointChemin=iCompteur;
00277	        MovePoint.bTraceable=false;
00278	        gotostate('vavers');
00279	    }
00280	    gotostate('investigation');
00281	Vu:
00282	    if (bases.bAlerte)
00283	        goto('attaque');
00284		 else if (bARienVu)
00285				goto('Identification');
00286	    enable('enemynotvisible');
00287	PointInterro:
00288	    Interrogation=Spawn(class'interro',self,,bases.location+110*vect(0,0,1));  // INTERRO
00289	    interrogation.SetDrawScale3D(vect(1,0.7,0.7));
00290	    interrogation.setbase(pawn);
00291	    sleep(FMin(2.5,bases.TempsPasVu*Vsize(pawn.location-enemy.location)*0.00025));
00292		 if (Vsize(pawn.location-enemy.location)>320)
00293	    {
00294		 	  sleep(FMin(2.5,bases.TempsPasVu*Vsize(pawn.location-enemy.location)*0.00025));
00295		 }
00296	Identification:
00297	    bAVuQuelquechose=true;
00298		 if (bARienVu)
00299		 {
00300			  enable('enemynotvisible');
00301			  bARienVu=false;
00302			  Settimer3(0,false);
00303		 }
00304	    focus=enemy;
00305		 if (enemy==xiii) Playercontroller(XIII.controller).MyHud.LocalizedMessage(class'XIIIDialogMessage', 3, none, none, pawn, "?!! ");
00306	    //    pawn.SetAnimStatus('alert');
00307		 pawn.PlaySndPNJOno(pnjono'Onomatopees.hPNJDetect',bases.CodeMesh,bases.NumeroTimbre);//se retourne vers bruit et reste sur place
00308	    if (interrogation!=none)
00309	    {
00310	       interrogation.destroy();
00311	       interrogation=none;
00312	    }
00313	    if (Vsize(pawn.location-enemy.location)>320)
00314	    {
00315	        Interrogation=Spawn(class'exclamation',self,,bases.location+(vector(bases.rotation) cross vect(0,0,1))*6 + 120*vect(0,0,1));
00316	        interrogation.setbase(pawn);
00317	        sleep(fmin(2.5,(Vsize(pawn.location-enemy.location)*bases.TempsIdentification)*0.00025));
00318			  if (Vsize(pawn.location-enemy.location)>320)
00319					sleep(fmin(2.5,(Vsize(pawn.location-enemy.location)*bases.TempsIdentification)*0.00025));
00320	    }
00321		 disable('enemynotvisible');
00322	    bAVuQuelquechose=false;
00323	attaque:
00324		 bDisableDamageattitudeto=true;
00325	    disable('seeplayer');
00326	    disable('seemonster');
00327		 disable('hearnoise');
00328		 pawn.velocity=vect(0,0,0);
00329		 pawn.acceleration=vect(0,0,0);
00330	    pawn.rotationrate.yaw=46000;
00331	    focus=enemy;
00332		 genalerte.PoteBeugle(pawn);
00333		 TriggerEvent('surprise_xiii_apercu', Self, pawn);  //trigger
00334	    if (ChercheTalkiePoint())
00335		 {
00336				//log(pawn@"attaque cherche taloijotjt");
00337	    		//vire gun courant
00338				if (!FBI.Talkie.bTalkieDansLaMain)
00339				{
00340					sleep(1);
00341					pawn.pendingweapon=XIIIWeapon(pawn.FindInventoryType(class'fists'));
00342	   	 		if (Pawn.Weapon!=Pawn.PendingWeapon)
00343	      	  		Pawn.Weapon.PutDown();
00344	    			sleep(0.4);
00345					//sort talkie
00346	   	 		FBI.PlayTakeTalkie();
00347	    			sleep(0.3); //attente anim
00348	    			FBI.Talkie.AttachToWalkie(pawn,true); //talkie dans la main
00349	    			sleep(0.4);
00350					bases.ReleaseAnimControl();
00351				}
00352				bGoToCallTalkie=true;
00353	    		gotostate('vavers');
00354		 }
00355		 else
00356		{
00357			//log(pawn@"jai pas de point je tir dans le tas !!!!!!!!!!!!");
00358			if (FBI.talkie!=none) FBI.talkie.destroy();
00359			ChangetoBestWeapon();
00360			sleep(0.04);
00361			gotostate('attaque');
00362		}
00363	}
00364	
00365	// ----------------------------------------------------------------------
00366	//     Investigation    (enemy!=none)
00367	//
00368	//      Se deplace vers enemy pendnat tempsrecherchenmi
00369	//
00370	// ----------------------------------------------------------------------
00371	state Investigation    //temps d'investigation depend du comportement ???
00372	{
00373	    ignores hearnoise;
00374	
00375		 event SeeDeadPawn(pawn other)
00376	    {
00377	        local basesoldier Soldier;
00378	
00379	        Soldier=basesoldier(other);
00380	        if (bases.BNeVoitPascadavre || Soldier==none || Soldier.DrawType == DT_NONE || Soldier.bMonCadavreEstDejaVu || AllianceLevel(Soldier)!=1)
00381	            return;
00382	        instigator=other;
00383	        bCadavreVu=true;
00384	        Soldier.bMonCadavreEstDejaVu=true;
00385			  gotostate('acquisition','cadavrevu');
00386	        return;
00387	    }
00388	    event enemyacquired()
00389	    {
00390	        Gotostate('Investigation','ContinueUnPeuEtAttaque');
00391	    }
00392	
00393	
00394	begin:
00395	    if (CHARGE_LES_LOGS) log(pawn@"ETAT Investigation"@enemy);
00396	    if (enemy==none)
00397	    {
00398	        log(pawn@"ENEMY==none ** ENEMY==none ** ENEMY==none ** ENEMY==none ** ENEMY==none **");
00399	        //enemy=xiii;
00400	    }
00401	
00402	investigation:
00403	    if (fasttrace(enemy.location-vect(0,0,30),pawn.location-vect(0,0,30)))
00404	    {
00405	        //log("je vais directement vers perso");
00406	        temp_vect=enemy.location-pawn.location;
00407	        temp_vect=(vsize(temp_vect)*0.5)*normal(temp_vect)+pawn.location;
00408	        if (fasttrace(temp_vect))
00409	        {
00410	            focus=none;
00411	            focalpoint= 10000*(temp_vect-pawn.location)+pawn.location;
00412	            if (vsize(temp_vect)>800)
00413	            {
00414	                Moveto(temp_vect,none);
00415	            }
00416	            else
00417	            {
00418	                Moveto(temp_vect,none,bases.walkingspeed);
00419	            }
00420					stop;
00421	        }
00422	    }
00423	    else if (EnregistrePointsVersEnemy())
00424	    {
00425	        //log("je prend les points d'investigation");
00426	        NombreDePointsSkippes=0;
00427	        for (NumeroProchainPoint=0;NumeroProchainPoint<3;NumeroProchainPoint++)
00428	        {
00429	            if (PointsInvestigation[NumeroProchainPoint]==none)
00430	                break;
00431	            temp_vect=enemy.location-PointsInvestigation[NumeroProchainPoint].location;
00432	            if (vsize(temp_vect)>800)      //y va en courant
00433	                btemp_bool=true;
00434	            else
00435	                btemp_bool=false;
00436	            for (temp_int=NombreDePointsSkippes;temp_int<16;temp_int++)
00437	            {
00438	                if (btemp_bool)
00439	                {
00440	                    focalpoint=10000*(routecache[temp_int].location-pawn.location)+pawn.location;
00441	                    Movetoward(routecache[temp_int],none);
00442	                }
00443	                else
00444	                {
00445	                    focalpoint=10000*(routecache[temp_int].location-pawn.location)+pawn.location;
00446	                    Movetoward(routecache[temp_int],none,bases.walkingspeed);
00447	                }
00448						 sleep(1.5+frand());
00449	                if (routecache[temp_int]==PointsInvestigation[NumeroProchainPoint])
00450	                {
00451	                    NombreDePointsSkippes=temp_int+1;
00452	                    break;
00453	                }
00454	            }
00455	        }
00456	        stop;
00457	    }
00458	    else
00459	    {
00460	        log(pawn@"trouve pas de ligne d'investigation ni reseau");
00461	        stop;
00462	    }
00463	ChercheSurPlace:
00464	    Focus=enemy;
00465	    sleep(1+frand());
00466	    goto('investigation');
00467	ContinueUnPeuEtAttaque:
00468	    Focus=enemy;
00469		 pawn.velocity=vect(0,0,0);
00470		 pawn.acceleration=vect(0,0,0);
00471		FinishRotation();
00472	    gotostate('acquisition','attaque');
00473	}
00474	
00475	// ----------------------------------------------------------------------
00476	//     VaVers
00477	//
00478	//      Se deplace vers MoveActor ou MovePoint
00479	//
00480	// ----------------------------------------------------------------------
00481	
00482	//pas de detection de cadavre
00483	state VaVers
00484	{
00485	    ignores EnemyNotVisible;
00486	singular event bool NotifyBump(actor Other)
00487	    {
00488	        return false;
00489	    }
00490		 event timer2()
00491		 {
00492			  genalerte.PoteBeugle(pawn);
00493		 }
00494	    event SeeMonster(pawn other)
00495	    {
00496		}
00497		event SeeDeadPawn(pawn other)
00498	    {
00499	        local basesoldier soldier;
00500	
00501			soldier=basesoldier(other);
00502	
00503	       if (bases.BNeVoitPascadavre || bCadavreVu || bDejaVu || Soldier.DrawType == DT_NONE || soldier==none || soldier.bMonCadavreEstDejaVu || AllianceLevel(Soldier)!=1)
00504	            return;
00505	        bStepNoise=false;
00506			  bWeaponNoise=false;
00507	        bCadavreVu=true;
00508	        instigator=other;
00509	        enemy=none;
00510	        Soldier.bMonCadavreEstDejaVu=true;
00511	        gotostate('acquisition','CadavreVu');
00512	    }
00513	    event UpdateTactics()
00514	    {
00515	    }
00516	    event enemyacquired()
00517	    {
00518	        if (!bDejaVu)
00519			  {
00520					bDejaVu=true;
00521					//log(pawn@"repasse en attaque   Gotostate('Investigation','ContinueUnPeuEtAttaque');");
00522	        		Gotostate('Investigation','ContinueUnPeuEtAttaque');
00523				}
00524	    }
00525	    event Trigger(actor Other, pawn EventInstigator)
00526	    {
00527	    }
00528	    function beginstate()
00529	    {
00530	        if (NiveauALerte==0)
00531	        {
00532	            s_decAttente();
00533	            s_incAttaque();
00534	        }
00535	        else if (NiveauALerte==1)
00536	        {
00537	            s_decAlerte();
00538	            s_incAttaque();
00539	        }
00540	        NiveauALerte=2;
00541			  if (bGoToCallTalkie && moveactor.moveactor!=none && MoveActor.MoveActor.isa('SAFEPOINT'))
00542			  {
00543					timer2();
00544					settimer2(2,true);
00545					disable('hearnoise');
00546					disable('seeplayer');
00547					TriggerEvent('CoursVersAlarme', Self, pawn);  //trigger de debut de course vers alarme
00548			  }
00549	    }
00550	    function endstate()
00551	    {
00552			  settimer2(0,false);
00553	    }
00554	
00555	    //ca de vavers: cadavre, bruit pas, bruit arme, alarme, pote en fight, pote paffe
00556	begin:
00557	    if (CHARGE_LES_LOGS) log(pawn@"ETAT VaVers"@MoveActor.MoveActor@MovePoint.MovePoint@enemy);
00558	Deplacement:
00559	    if (MoveActor.MoveActor!=none)
00560	    {
00561	        If (MoveActor.bReachable)
00562	            MoveToward(MoveActor.MoveActor,MoveActor.MoveActor);
00563	        else
00564	        {
00565	            for (iCompteur=0;iCompteur<NbPointChemin;iCompteur++)
00566	            {
00567	                focus=none;
00568	                focalpoint=PointChemin[iCompteur].location;
00569	                Movetoward(PointChemin[iCompteur],none);
00570	            }
00571	        }
00572	    }
00573	    else
00574	    {
00575	        If (MovePoint.bTraceable)
00576	        {
00577	            focalpoint=MovePoint.MovePoint+pawn.location;
00578	            MoveTo(MovePoint.MovePoint,none);
00579	        }
00580	        else
00581	        {
00582	            for (iCompteur=0;iCompteur<NbPointChemin;iCompteur++)
00583	            {
00584	                focus=none;
00585	                focalpoint=10000*(PointChemin[iCompteur].location-pawn.location)+pawn.location;
00586	                Moveto(PointChemin[iCompteur].location,none);
00587	            }
00588	            focus=none;
00589	            focalpoint=10000*(MovePoint.movepoint-pawn.location)+pawn.location;
00590	            Moveto(MovePoint.movepoint,none);
00591	        }
00592	    }
00593	    if (SAFEPOINT(MoveActor.MoveActor)!=none && SAFEPOINT(MoveActor.MoveActor).baccroupi)
00594	    {
00595	        pawn.shouldcrouch(true);
00596	    }
00597	    Gotostate(nextstate);
00598	ContinueUnPeuEtAttaque:
00599	    Focus=enemy;
00600	    gotostate('acquisition','attaque');
00601	}
00602	
00603	// ----------------------------------------------------------------------
00604	// Etat de ResteSurPlace    //revu pour talkie
00605	//
00606	//
00607	// ----------------------------------------------------------------------
00608	state ResteSurPlace
00609	{
00610	    event Seeplayer(pawn other)
00611	    {
00612	  	   if (bGoToCallTalkie)
00613					return;
00614				if (enemy==none || !bdejavu)
00615				{
00616					if (setenemy(XIII))
00617	                bDejaVu=true;
00618				}
00619				else
00620				{
00621				  if (enemy!=none && enemy==other)
00622	            	SeeEnemy();
00623			  }
00624	    }
00625	    event EnemyAcquired()
00626	    {
00627				if (bGoToCallTalkie)
00628					return;
00629	        gotostate('acquisition','attaque');
00630	    }
00631	    event SeeDeadPawn(pawn other)
00632	    {
00633	    }
00634	    function Endstate()
00635	    {
00636			  super.endstate();
00637	        bases.AnimBlendParams(bases.FIRINGCHANNEL+1,0,0,0);
00638		 }
00639	
00640	begin:
00641	    pawn.velocity=vect(0,0,0);
00642	    pawn.acceleration=vect(0,0,0);
00643	    if (CHARGE_LES_LOGS) log(pawn@"ETAT Reste SUr Place");
00644	    if (enemy!=none)
00645	    {
00646	        focus=enemy;
00647	        finishrotation();
00648	    }
00649		 if (!bGoToCallTalkie && !bCadavreVu)
00650		 {
00651	       sleep(1+4*frand());
00652			 gotostate('investigation');
00653		 }
00654	TalkInTalkie:
00655		// log(pawn@"TalkInTalkie"@bGoToCallTalkie@FBI);
00656		 enemy=xiii;
00657	    Pawn.Acceleration = vect(0,0,0);
00658	    Pawn.Velocity = vect(0,0,0);
00659	    focus=none;
00660		 FBI.PlayCallTalkie();
00661	    sleep(0.4);
00662		 if (!bCadavreVu)
00663		 {
00664				TriggerEvent('alerte_xiii_apercu', Self, pawn);  //trigger
00665		     sleep(FBI.TempsDegainageTalkie);
00666		}
00667		else
00668		{
00669			sleep(FBI.TempsDegainageTalkie*0.5);
00670			disable('Seeplayer');
00671			sleep(FBI.TempsDegainageTalkie*0.5);
00672		}
00673	//log(pawn@"temps degainage");
00674	    bases.ReleaseAnimControl();
00675		 bases.PlayWaiting();
00676	    sleep(0.6);
00677		 TriggerEvent('XIIIVuFBI', Self, pawn);  //trigger
00678	PutDownTalkie:
00679		//log(pawn@"PutDownTalkie");
00680		 Pawn.Acceleration = vect(0,0,0);
00681	    Pawn.Velocity = vect(0,0,0);
00682		 enemy=XIII;
00683		 focus=enemy;
00684	    finishrotation();
00685		 ChangeToBestWeapon();
00686		 sleep(0.3);
00687	    if (FBI.talkie!=none) FBI.talkie.destroy();
00688		 gotostate('attaque');
00689	}
00690	
00691	
00692	
00693	// ----------------------------------------------------------------------
00694	//  Chasse         (enemy!=none)
00695	//
00696	//
00697	// ----------------------------------------------------------------------
00698	state Chasse
00699	{
00700	    ignores EnemyNotVisible;
00701	
00702	    event EnemyAcquired()
00703	    {
00704	        focus=enemy;
00705	        gotostate('acquisition','attaque');
00706	    }
00707	}
00708	
00709	
00710	
00711	defaultproperties
00712	{
00713	}

End Source Code