## XIDMaps
Class Banque01

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

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Info
             |
             +--XIII.MapInfo
                |
                +--XIDMaps.Map02_Banque
                   |
                   +--XIDMaps.Banque01

Direct Known Subclasses:None

class Banque01
extends XIDMaps.Map02_Banque

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

Variables
`Keys` | `CleBanque`
`XIIIPlayerController` | `XPC`
`bool` | `bCleDonnee`
`bool` | `bCleRedonnee`
`vector` | `vPlayer_Banquier`

States
STA_DonneCle

Function Summary
`void` | `FirstFrame()`
    //______________________________________________________________________________
`void` | `SetGoalComplete(int N)`
    //_____________________________________________________________________________

State STA_DonneCle Function Summary

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class Banque01 extends Map02_Banque;
    00005
    00006	var(BankSetup) name SafeKeyEvent;
    00007	var(BankSetup) cine2 PersoBanquier;
    00008	var(BankSetup) float fDistanceBanquier;
    00009	var(BankSetup) name KeyEvent;
    00010	var(BankSetup) localized string KeyEventItemName;
    00011	var(BankSetup) XIIIPawn KeyKeeper;
    00012	var(BankSetup) Porte DoorToOpen;
    00013	var(BankSetup) name TagForGameOver;
    00014
    00015	var vector vPlayer_Banquier;
    00016	var XIIIPlayerController XPC;
    00017	var Keys CleBanque;
    00018	var bool bCleDonnee;
    00019	var bool bCleRedonnee;
    00020
    00021
    00022	//______________________________________________________________________________
    00023	function FirstFrame()
    00024	{
    00025	    local inventory Inv;
    00026
    00027	    Super.FirstFrame();
    00028
    00029	    if ( XIIIGameInfo(Level.Game).CheckPointNumber<2 && XIIIPawn != none )
    00030	    {
    00031	      Inv = GiveSomething(class'Keys', XIIIPawn);
    00032	      Inv.Event = SafeKeyEvent;
    00033	    }
    00034		else
    00035		{
    00036			if ( XIIIGameInfo(Level.Game).CheckPointNumber > 1 )
    00037			{
    00038				if ( TagForGameOver != '' )
    00039					Tag = TagForGameOver;
    00040			}
    00041		}
    00042	}
    00043
    00044	//_____________________________________________________________________________
    00045	event Trigger( actor Other,Pawn EventInstigator )
    00046	{
    00047		local inventory Inv;
    00048
    00049		// si le premier goal est rempli, on teste la mort de persos innoncents
    00050		if ( Objectif[0].bCompleted )
    00051		{
    00052			//log(self@"---> QUI ME TUE ?"@EventInstigator);
    00053			if ( XIIIPlayerPawn(EventInstigator) != none )
    00054			{
    00055				//log(self@"---> C'EST LE PERSO PRINCIPAL");
    00056				SetGoalComplete(2);
    00057			}
    00058		}
    00059		else
    00060		{
    00061			if ( bCleDonnee )
    00062			{
    00063				if ( bCleRedonnee )
    00064				{
    00065					// on retire l arme de la main du joueur
    00066					if ( XPC.bWeaponMode )
    00067					{
    00068						XPC.OldWeap = XPC.Pawn.Weapon.InventoryGroup;
    00069						XPC.Pawn.Weapon.PutDown();
    00070					}
    00071					else
    00072					{
    00073						XPC.OldItem = XIIIItems(XPC.Pawn.SelectedItem);
    00074						XPC.OldItem.PutDown();
    00075					}
    00076					XPC.bWeaponBlock = true;
    00077				}
    00078				else
    00079				{
    00080					// on redonne la cle au joueur
    00081					bCleRedonnee = true;
    00082					Inv = GiveSomething(class'Keys', XIIIPawn );
    00083					Inv.Event = KeyEvent;
    00084					Keys(Inv).KeyCodeName = DoorToOpen.UnlockItemCode;
    00085					Inv.ItemName = KeyEventItemName;
    00086				}
    00087			}
    00088			else
    00089			{
    00090				//on enleve la cle de l inventaire
    00091				bCleDonnee = true;
    00092				XPC = XIIIGameInfo(Level.Game).MapInfo.XIIIController;
    00093				GotoState('STA_DonneCle');
    00094			}
    00095		}
    00096	}
    00097
    00098
    00099	//_____________________________________________________________________________
    00100	function SetGoalComplete(int N)
    00101	{
    00102		Super.SetGoalComplete(N);
    00103		log("Banque01::SetGoalComplete"@n);
    00104		if (N==0)
    00105		{
    00106			if ( TagForGameOver != '' )
    00107				Tag = TagForGameOver;
    00108			SetPrimaryGoal(1);
    00109			SetPrimaryGoal(2);
    00110		}
    00111	}
    00112
    00113
    00114	//_____________________________________________________________________________
    00115	State STA_DonneCle
    00116	{
    00117		event Tick( float dt)
    00118		{
    00119			vPlayer_Banquier = PersoBanquier.Location - XPC.Pawn.Location;
    00120			vPlayer_Banquier.z = 0;
    00121			if (( vSize(vPlayer_Banquier) < fDistanceBanquier ) && ( XPC.CanSee(PersoBanquier) ))
    00122			{
    00123				SetTimer(0.1,false);
    00124				Disable('Tick');
    00125			}
    00126		}
    00127
    00128		event Timer()
    00129		{
    00130			TriggerEvent(event,none,none);
    00131			//*** on supprime la cle de l inventaire
    00132			CleBanque = Keys( XPC.Pawn.FindInventoryType( class'Keys' ) );
    00133			XPC.NextWeapon();
    00134			XPC.Pawn.ChangedWeapon();
    00135			CleBanque.PlayDown();
    00136			CleBanque.Destroy();
    00137			GotoState('');
    00138		}
    00139	}
    00140
    00141
    00142
    00143	defaultproperties
    00144	{
    00145	     SafeKeyEvent="SafeKeyEvent"
    00146	     KeyEventItemName="Key"
    00147	     checkTime=0.200000
    00148	     EndMapVideo="cine02"
    00149	}

End Source Code