XIDMaps
Class Hual04c

source: C:\XIII\XIDMaps\Classes\Hual04c.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Info
         |
         +--XIII.MapInfo
            |
            +--XIDMaps.Map06_HualparBase
               |
               +--XIDMaps.Hual04c
Direct Known Subclasses:None

class Hual04c
extends XIDMaps.Map06_HualparBase

//----------------------------------------------------------- // //-----------------------------------------------------------
Variables
 int WarningCount

States
CheckPlayerPause, TheEnd, CheckPlayerDistance

Function Summary
 void FirstFrame()
     
//_____________________________________________________________________________
 void SetGoalComplete(int N)
     
//_____________________________________________________________________________


State CheckPlayerPause Function Summary


State TheEnd Function Summary


State CheckPlayerDistance Function Summary



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class Hual04c extends Map06_HualparBase;
00005	
00006	VAR(Hual04Setup) float CheckDistance;
00007	VAR(Hual04Setup) float WarningInterval;
00008	VAR(Hual04Setup) Pawn Carrington;
00009	//VAR(Hual04Setup) Sound WarningSentences[5];
00010	VAR(Hual04Setup) float CheckInterval;
00011	VAR(Hual04Setup) int LethalWarning;
00012	VAR(Hual04Setup) DialogueManager WarningDialMan;
00013	VAR(Hual04Setup) name CarringtonDeathEvent;
00014	VAR(Hual04Setup) float CarringtonDeathMessageDelay;
00015	
00016	VAR int WarningCount;
00017	
00018	// 0 - Rejoindre Jones à l'helico
00019	// 1 - Ne pas s'éloigner de Carrington
00020	// 2 - Ralentir les ennemis pe
00021	
00022	//_____________________________________________________________________________
00023	
00024	function SetGoalComplete(int N)
00025	{
00026		LOG("HUAL04C SetGoalComplete"@N);
00027	
00028		if ( N < Objectif.Length )
00029			Super.SetGoalComplete(N);
00030	
00031		if ( N == 99 )
00032		{
00033			SetPrimaryGoal(1);
00034			GotoState('CheckPlayerDistance');
00035		}
00036		else if ( N == 0 )
00037		{
00038			SetPrimaryGoal( 2 );
00039			GotoState('');
00040		}
00041		else if ( N == 2 )
00042			SetPrimaryGoal(3);
00043		else if ( N == 3 )
00044			SetPrimaryGoal(4);
00045	}
00046	
00047	//_____________________________________________________________________________
00048	
00049	function FirstFrame()
00050	{
00051	    Super.FirstFrame();
00052		Level.SetInjuredEffect( false, 0.01 );
00053		
00054	}
00055	/*
00056	EVENT Trigger(actor a,pawn p)
00057	{
00058		GotoState('CheckPlayerDistance');
00059	}
00060	*/
00061	//_____________________________________________________________________________
00062	
00063	STATE CheckPlayerDistance
00064	{
00065		EVENT BeginState( )
00066		{
00067			SetTimer( CheckInterval, true );
00068		}
00069		EVENT Timer( )
00070		{
00071			LOCAL Vector v;
00072			v.X = XIIIPawn.Location.X - Carrington.Location.X;
00073			v.Y = XIIIPawn.Location.Y - Carrington.Location.Y;
00074			v.Z = 0;
00075			if ( vSize( v ) > CheckDistance )
00076			{
00077				if (WarningDialMan.IsInState('STA_PlayingDialogue'))
00078					WarningDialMan.ForceLine( WarningCount );
00079				else
00080					WarningDialMan.StartDialogue( );
00081	
00082	//			WarningDialMan.Trigger(self,none);
00083				WarningCount++;
00084				if ( WarningCount==LethalWarning )
00085				{
00086					TriggerEvent( CarringtonDeathEvent, none, none );
00087	//				Level.Game.EndGame( XIIIPlayercontroller(EventInstigator.controller).PlayerReplicationInfo, "GoalIncomplete");//GoalIncomplete" );
00088					GotoState('TheEnd');
00089					return;
00090				}
00091				else
00092					GotoState('CheckPlayerPause');
00093			}
00094			else
00095			{
00096				WarningCount = 0;
00097			}
00098	
00099		}
00100	}
00101	
00102	STATE TheEnd
00103	{
00104		EVENT BeginState( )
00105		{
00106	//		XIIIController.GotoState('NoControl');
00107			Carrington.Controller.GotoState('');
00108			Carrington.PlayAnim('DeathTete',,0.1);
00109			SetTimer( CarringtonDeathMessageDelay, false );
00110			if ( CarringtonDeathMessageDelay==0 )
00111				Timer();
00112		}
00113		EVENT Timer( )
00114		{
00115			SetGoalComplete( 1 );
00116		}
00117	}
00118	
00119	STATE CheckPlayerPause
00120	{
00121	begin:
00122		Sleep( WarningInterval );
00123		GotoState('CheckPlayerDistance');
00124	}
00125	
00126	
00127	
00128	defaultproperties
00129	{
00130	     CheckDistance=2500.000000
00131	     WarningInterval=5.000000
00132	     CheckInterval=1.000000
00133	     LethalWarning=3
00134	     CarringtonDeathMessageDelay=3.000000
00135	     EndMapVideo="cine06"
00136	}

End Source Code