## XIDMaps
Class PRock01a

source: C:\XIII\XIDMaps\Classes\PRock01a.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Info
             |
             +--XIII.MapInfo
                |
                +--XIDMaps.Map08_PlainRock
                   |
                   +--XIDMaps.PRock01a

Direct Known Subclasses:None

class PRock01a
extends XIDMaps.Map08_PlainRock

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

Variables
`DialogueManager` | `DialDuParleur`
`Pawn` | `PersoParleur`
`name` | `TagTemp`
`bool` | `bAlarm`
`bool` | `bPremierDialogue`
`bool` | `bPremierGenNMI`

States
STA_TestMortParleur, STA_Blur

Function Summary
`void` | `FirstFrame()`
    //_____________________________________________________________________________
`void` | `SetGoalComplete(int N)`
    //_____________________________________________________________________________
`void` | `Trigger(Actor Other, Pawn EventInstigator)`
    //_____________________________________________________________________________

State STA_TestMortParleur Function Summary

State STA_Blur Function Summary

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class PRock01a extends Map08_PlainRock;
    00005
    00006	var(PRock01aSetUp) XIIIPawn GardeLocal;
    00007	var(PRock01aSetUp) XIIIPawn Tabasseur1;
    00008	var(PRock01aSetUp) XIIIPawn Tabasseur2;
    00009	var(PRock01aSetUp) XIIIPawn Gardien1;
    00010	var(PRock01aSetUp) XIIIPawn Gardien2;
    00011
    00012	var(PRock01aSetUp) GenNMI GenNMI_GardeCouloir;
    00013	var(PRock01aSetUp) GenNMI GenNMI_GardeRotonde1;
    00014	var(PRock01aSetUp) GenNMI GenNMI_GardeRotonde2;
    00015
    00016	var(PRock01aSetUp) localized string sClefPorteLocal;
    00017	var(PRock01aSetUp) localized string sClefEscaliers;
    00018	var(PRock01aSetUp) localized string sClefCouloir;
    00019	var(PRock01aSetUp) localized string sClefEntreeRotonde;
    00020	var(PRock01aSetUp) localized string sClefSortieRotonde;
    00021	var(PRock01aSetUp) localized string sClefDebarrasLingerie;
    00022
    00023	var(PRock01aSetUp) DialogueManager DialManagerBas;
    00024	var(PRock01aSetUp) DialogueManager DialManagerHaut;
    00025
    00026	var(PRock01aSetUp) float fBlurDelay;
    00027
    00028	var(PRock01aSetUp) name EventClefPorteLocal;
    00029	var(PRock01aSetUp) name EventClefDebarrasLingerie;
    00030	var(PRock01aSetUp) name EventClefCouloir;
    00031	var(PRock01aSetUp) name EventClefEscaliers;
    00032	var(PRock01aSetUp) name EventClefEntreeRotonde;
    00033	var(PRock01aSetUp) name EventClefSortieRotonde;
    00034
    00035	var bool bAlarm;
    00036
    00037	var bool bPremierGenNMI;
    00038	var bool bPremierDialogue;
    00039
    00040	var Pawn PersoParleur;
    00041	var DialogueManager DialDuParleur;
    00042	var name TagTemp;
    00043
    00044
    00045
    00046	// Keys
    00047	/*
    00048	ClefPorteLocal          -> GardeLocal
    00049	ClefEscaliers          -> GardeLingerie1
    00050	ClefCouloir          -> GardeLingerie2
    00051	ClefEntreeRotonde      -> GardeCouloir
    00052	ClefSortieRotonde     -> GardeRotonde1 & GardeRotonde2
    00053	*/
    00054
    00055	//_____________________________________________________________________________
    00056	event PostBeginPlay()
    00057	{
    00058		local mutator m;
    00059
    00060		Super.PostBeginPlay();
    00061
    00062		// prise en compte d un mutator qui retire les poings au joueur
    00063		m = Spawn( class'PRock01aMutator' );
    00064		m.NextMutator = Level.Game.BaseMutator.NextMutator;
    00065		Level.Game.BaseMutator = m; //.AddMutator(m);
    00066
    00067	}
    00068
    00069
    00070	//_____________________________________________________________________________
    00071	function FirstFrame()
    00072	{
    00073	    local inventory Inv;
    00074
    00075	    Super.FirstFrame();
    00076
    00077	    Inv = GiveSomething(class'Keys', GardeLocal);
    00078	    Inv.Event = 'ClefPorteLocal';
    00079	    Keys(Inv).KeyCodeName = "ClefPorteLocal";
    00080	    Inv.ItemName = sClefPorteLocal;
    00081		XIIIItems(Inv).EventCausedOnPick = EventClefPorteLocal;
    00082
    00083	   Inv = GiveSomething(class'PRock01aCorridorKey', Gardien1);
    00084		Inv.Event = 'ClefCouloir';
    00085		//Keys(Inv).InventoryGroup = 6;
    00086		Keys(Inv).KeyCodeName = "ClefCouloir";
    00087		Inv.ItemName = sClefCouloir;
    00088		XIIIItems(Inv).EventCausedOnPick = EventClefCouloir;
    00089
    00090	    Inv = GiveSomething(class'PRock01aStairsKey', Gardien2);
    00091	    Inv.Event = 'ClefEscaliers';
    00092		//Keys(Inv).InventoryGroup = 7;
    00093	    Keys(Inv).KeyCodeName = "ClefEscaliers";
    00094	    Inv.ItemName = sClefEscaliers;
    00095		XIIIItems(Inv).EventCausedOnPick = EventClefEscaliers;
    00096
    00097		if ( XIIIGameInfo(Level.Game).CheckPointNumber<2 ) // ( !Objectif[0].bCompleted ) || ( !Objectif[0].bPrimary ) )
    00098			GotoState( 'STA_Blur' );
    00099	}
    00100
    00101
    00102	//_____________________________________________________________________________
    00103	function Trigger( actor Other, pawn EventInstigator )
    00104	{
    00105
    00106		// premier cas : au bas de la rotonde
    00107		if ( !bPremierDialogue )
    00108		{
    00109			if ( bAlarm )
    00110			{
    00111				// on renseigne le maton dans le premier dialogue manager
    00112				if ( DialManagerBas != none )
    00113				{
    00114					log(self@"---> PREMIER : REPERE PAR MATON"@EventInstigator);
    00115					DialManagerBas.Speakers[0].Pawn = EventInstigator;
    00116					TriggerEvent( DialManagerBas.tag, none, none );
    00117					PersoParleur = EventInstigator;
    00118					DialDuParleur = DialManagerBas;
    00119					TagTemp = Tag;
    00120					Tag = DialManagerBas.event;
    00121					GotoState( 'STA_TestMortParleur' );
    00122				}
    00123			}
    00124		}
    00125		else
    00126		{
    00127			// on renseigne le maton dans le second dialogue manager
    00128			if ( DialManagerHaut != none )
    00129			{
    00130				log(self@"---> SECOND : REPERE PAR MATON"@EventInstigator);
    00131				DialManagerHaut.Speakers[0].Pawn = EventInstigator;
    00132				DialManagerHaut.Speakers[1].Pawn = EventInstigator;
    00133				TriggerEvent( DialManagerHaut.tag, none, none );
    00134				PersoParleur = EventInstigator;
    00135				DialDuParleur = DialManagerHaut;
    00136				TagTemp = Tag;
    00137				Tag = DialManagerHaut.event;
    00138				GotoState( 'STA_TestMortParleur' );
    00139			}
    00140		}
    00141	}
    00142
    00143
    00144	//_____________________________________________________________________________
    00145	function SetGoalComplete(int N)
    00146	{
    00147
    00148		local inventory Inv;
    00149
    00150		if ( N == 91 )
    00151		{
    00152			SetPrimaryGoal(0);
    00153			return;
    00154		}
    00155
    00156		if ( N == 92 )
    00157		{
    00158			Super.SetGoalComplete(0) ;
    00159			SetPrimaryGoal(1);
    00160			return;
    00161		}
    00162
    00163		if ( N == 93 )
    00164		{
    00165			bAlarm=true;
    00166			return;
    00167		}
    00168
    00169		if ( N == 94 )
    00170		{
    00171			bPremierDialogue = true;
    00172			Enable('Trigger');
    00173		}
    00174
    00175		if ( N == 95 )
    00176		{
    00177			// on donne la cle au garde du couloir
    00178			if ( GenNMI_GardeCouloir.SpawnActor != none )
    00179			{
    00180				Inv = GiveSomething(class'PRock01aRotondeKey', GenNMI_GardeCouloir.SpawnActor);
    00181				Inv.Event = 'ClefEntreeRotonde';
    00182				Keys(Inv).KeyCodeName = "ClefEntreeRotonde";
    00183				Inv.ItemName = sClefEntreeRotonde;
    00184				XIIIItems(Inv).EventCausedOnPick = EventClefEntreeRotonde;
    00185			}
    00186
    00187			// on donne la cle au deuxième des gardes de la rotonde
    00188	/*		if (( GenNMI_GardeRotonde1.SpawnActor != none ) && ( GenNMI_GardeRotonde2.SpawnActor != none ))
    00189			{
    00190				if ( fRand() < 0.5 )
    00191				{
    00192					Inv = GiveSomething(class'PRock01aRotondeExitKey', GenNMI_GardeRotonde1.SpawnActor);
    00193					Inv.Event = 'ClefSortieRotonde';
    00194					Keys(Inv).KeyCodeName = "ClefSortieRotonde";
    00195					Inv.ItemName = sClefSortieRotonde;
    00196					XIIIItems(Inv).EventCausedOnPick = EventClefSortieRotonde;
    00197				}
    00198				else
    00199				{*/
    00200					Inv = GiveSomething(class'PRock01aRotondeExitKey', GenNMI_GardeRotonde2.SpawnActor);
    00201					Inv.Event = 'ClefSortieRotonde';
    00202					Keys(Inv).KeyCodeName = "ClefSortieRotonde";
    00203					Inv.ItemName = sClefSortieRotonde;
    00204					XIIIItems(Inv).EventCausedOnPick = EventClefSortieRotonde;
    00205	//			}
    00206	//		}
    00207		}
    00208		if ( N == 96 ) // Activated when a tabasseur2 was killed
    00209		{
    00210		    if (!Tabasseur1.bIsDead)
    00211			 {
    00212				 Inv = GiveSomething(class'Keys', Tabasseur1);
    00213				 Inv.Event = 'ClefDebarrasLingerie';
    00214				 Keys(Inv).KeyCodeName = "ClefDebarrasLingerie";
    00215				 Inv.ItemName = sClefDebarrasLingerie;
    00216				 XIIIItems(Inv).EventCausedOnPick = EventClefDebarrasLingerie;
    00217			}
    00218			else
    00219				TriggerEvent( 'garde1mort', Tabasseur2, Tabasseur2);
    00220		}
    00221		if ( N == 97 ) // Activated when a tabasseur1 was killed
    00222		{
    00223			 if (!Tabasseur2.bIsDead)
    00224			 {
    00225				 Inv = GiveSomething(class'Keys', Tabasseur2);
    00226				 Inv.Event = 'ClefDebarrasLingerie';
    00227				 Keys(Inv).KeyCodeName = "ClefDebarrasLingerie";
    00228				 Inv.ItemName = sClefDebarrasLingerie;
    00229				 XIIIItems(Inv).EventCausedOnPick = EventClefDebarrasLingerie;
    00230			}
    00231			else
    00232				TriggerEvent( 'garde2mort', Tabasseur1, Tabasseur1);
    00233
    00234		}
    00235
    00236		Super.SetGoalComplete(N);
    00237	}
    00238
    00239
//_____________________________________________________________________________ 00240 STATE STA_Blur 00241 { 00242 begin: 00243 Level.SetInjuredEffect(true,0.01); 00244 sleep(0.01); 00245 Level.SetInjuredEffect(false,fBlurDelay); 00246 GotoState(''); 00247 } 00248 00249 00250 //_____________________________________________________________________________ 00251 STATE STA_TestMortParleur 00252 { 00253 event Trigger( actor Other, pawn EventInstigator ) 00254 { 00255 Tag = TagTemp; 00256 Disable( 'Trigger' ); 00257 GotoState(''); 00258 } 00259 00260 event Tick( float dt ) 00261 { 00262 if ( PersoParleur.bIsDead ) 00263 { 00264 // on interrompt le dialogue 00265 DialDuParleur.Destroy(); 00266 Tag = TagTemp; 00267 Disable( 'Trigger' ); 00268 GotoState(''); 00269 } 00270 } 00271 } 00272 00273 00274 //_____________________________________________________________________________ 00275 00276 00277 defaultproperties 00278 { 00279 fBlurDelay=10.000000 00280 iLoadSpecificValue=55 00281 }

End Source Code