## XIDMaps
Class Palace01b

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

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Info
             |
             +--XIII.MapInfo
                |
                +--XIDMaps.Map14_Palace
                   |
                   +--XIDMaps.Palace01b

Direct Known Subclasses:None

class Palace01b
extends XIDMaps.Map14_Palace

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

Variables
`Micro` | `Mic`

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

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class Palace01b extends Map14_Palace;
    00005
    00006	// 0 == ANTIGOAL, do not get spotted
    00007	// 1 == Reach chamber 41 (Activate 2)
    00008	// 2 == Spy the council using the microcannon (Deactivate 0, Activate 3 & 4)
    00009	// 3 == ANTIGOAL, do not let Willard & Winslow leave (Give chronometer)
    00010	// 4 == Deactivate the electrical generator (Deactivate 3, Activate 5)
    00011	// 5 == Goto fighting location (Activate 6)
    00012	// 6 == Get rid of Winslow (Activate 7)
    00013	// 7 == Get rid of Willard
    00014
    00015	// 99 == used by chronometer
    00016	// 98 == Train ended, now spy is real & serious
    00017	// 97 == Missed our target while in training
    00018	// 96 == make corpse reappear
    00019
    00020	var(Objectifs) float Goal3ChronoTime;
    00021
    00022	var(Palace01bSetUp) XIIIPawn PoolRoomKeyHolder;
    00023	var(Palace01bSetUp) localized string sPoolRoomKeyName;
    00024
    00025	var(Palace01bSetUp) Pawn MicroTarget;      // the target to assign the micro for the spying sequence
    00026	var(Palace01bSetUp) Pawn FinancialSupportDocumentOwner;
    00027	var(Palace01bSetUp) Pawn CatererBillDocumentOwner;
    00028
    00029	var(Palace01bSetUp) int SupportDoc_PersoNum;
    00030	var(Palace01bSetUp) localized string SupportDoc_Information;
    00031	var(Palace01bSetUp) texture SupportDoc_Photography;
    00032
    00033	var(Palace01bSetUp) int Bill_PersoNum;
    00034	var(Palace01bSetUp) localized string Bill_Information;
    00035	var(Palace01bSetUp) texture Bill_Photography;
    00036
    00037	var(Palace01bSetUp) float fTimeBeforeNotPlayingsAmos1DidacMiss;
    00038	var(Palace01bSetUp) DialogueManager AmosDDialogMngr;
    00039
    00040	var(Palace01bSetUp) array<XIIICorpse> GenCorpse;
    00041
    00042	var(Palace01bSetUp) name EventSupportDocPick;
    00043	var(Palace01bSetUp) name EventBillPick;
    00044	var(Palace01bSetUp) name EventKeyPick;
    00045
    00046	var Micro Mic;
    00047
    00048	event PostBeginPlay()
    00049	{
    00050	    local int i;
    00051
    00052	    Super.PostBeginPlay();
    00053	    for (i=0; i<GenCorpse.length; i++)
    00054	    {
    00055	      GenCorpse[i].SetDrawType(DT_none);
    00056	      GenCorpse[i].SetCollision(false,false,false);
    00057	      GenCorpse[i].bStasis=true;
    00058	    }
    00059	}
    00060
    00061	//_____________________________________________________________________________
    00062	FUNCTION FirstFrame()
    00063	{
    00064	    LOCAL inventory Inv;
    00065		LOCAL XIIIDocuments Doc;
    00066
    00067	    Super.FirstFrame();
    00068
    00069	    if ( PoolRoomKeyHolder != none )
    00070		{
    00071			Inv = GiveSomething(class'Keys', PoolRoomKeyHolder);
    00072			Inv.Event = 'billardroom';
    00073			Keys(Inv).KeyCodeName = "billardroom";
    00074			Inv.ItemName = sPoolRoomKeyName;
    00075			XIIIItems(Inv).EventCausedOnPick = EventKeyPick;
    00076		}
    00077
    00078	    Inv = GiveSomething(class'Silencer', XIIIPawn);
    00079
    00080	    Inv = GiveSomething(class'Micro', XIIIPawn);
    00081	    Mic = Micro(Inv);
    00082	    if ( Mic != none )
    00083	    {
    00084	      Mic.ListenTarget = MicroTarget;
    00085		  Mic.bCanCauseGameOver = false;
    00086	    }
    00087
    00088		if ( FinancialSupportDocumentOwner != none )
    00089		{
    00090			Doc = Spawn(class'XIIIDocuments');
    00091			if ( Doc != none )
    00092			{
    00093				Doc.GiveTo( FinancialSupportDocumentOwner );
    00094				Doc.EventCausedOnPick = EventSupportDocPick;
    00095			}
    00096		}
    00097
    00098		if ( CatererBillDocumentOwner != none )
    00099		{
    00100			Doc = Spawn(class'XIIIDocuments');
    00101			if ( Doc != none )
    00102			{
    00103				Doc.GiveTo( CatererBillDocumentOwner );
    00104				Doc.EventCausedOnPick = EventBillPick;
    00105			}
    00106		}
    00107	}
    00108
    00109	//_____________________________________________________________________________
    00110	FUNCTION SetGoalComplete(int N)
    00111	{
    00112		LOCAL inventory inv;
    00113		LOCAL Chronometre C;
    00114		LOCAL int i;
    00115		LOCAL DialogueManager dm;
    00116
    00117		switch ( N )
    00118		{
    00119		case 99:
    00120		// Chrono ended... too bad GameOver.
    00121			Level.Game.EndGame( XIIIController.PlayerReplicationInfo, "GoalIncomplete" );
    00122			return;
    00123		case 98:
    00124		// Training phase ended, let's play seriously
    00125			DebugLog("@@@ Palace01b Training ended, NOW IT IS SERIOUS");
    00126			Mic.bCanCauseGameOver = true;
    00127			Mic.Charge = Mic.Default.Charge;
    00128			if (AmosDDialogMngr.Tag != 'RealThingStart')
    00129			{
    00130				DebugLog("@@@ Palace01b Setting DialogManager to next line RealThingStart");
    00131				AmosDDialogMngr.LineIndex = 1;
    00132				AmosDDialogMngr.Tag = 'RealThingStart';
    00133			}
    00134			DebugLog("@@@ Palace01b TRIGGER RealThingStart");
    00135			TriggerEvent('RealThingStart', self, XIIIPawn);
    00136			break;
    00137		case 97:
    00138			Log("@@@ Palace01b we missed our target while training, Level.TimeSeconds="$Level.TimeSeconds);
    00139			if ( Level.TimeSeconds > fTimeBeforeNotPlayingsAmos1DidacMiss )
    00140			{ // set dialogmanager to wait for next sentence.
    00141	//			TriggerEvent('LoseTarget', self, XIIIPawn);
    00142	//			AmosDDialogMngr.StartDialogue(0);
    00143		        AmosDDialogMngr.LineIndex = 1;
    00144			    AmosDDialogMngr.Tag = 'RealThingStart';
    00145			}
    00146			else
    00147			{ // Play it
    00148				TriggerEvent('LoseTarget', self, XIIIPawn);
    00149			}
    00150			break;
    00151		case 96:
    00152			for (i=0; i<GenCorpse.length; i++)
    00153			{
    00154				GenCorpse[i].SetDrawType(DT_mesh);
    00155				GenCorpse[i].SetCollision(true,false,false);
    00156				GenCorpse[i].bStasis=false;
    00157			}
    00158			break;
    00159		}
    00160
    00161		super.SetGoalComplete(N);
    00162
    00163		if ( bLevelComplete )
    00164		{
    00165			C = Chronometre(XIIIPawn.FindInventoryType(class'Chronometre'));
    00166			if (C != none)
    00167			{
    00168				C.Destroy();
    00169			}
    00170		}
    00171
    00172		if ( N==1 )
    00173		{
    00174			Mic.bActivated = true;
    00175			Mic.bCanCauseGameOver = false;
    00176			fTimeBeforeNotPlayingsAmos1DidacMiss = default.fTimeBeforeNotPlayingsAmos1DidacMiss + Level.TimeSeconds;
    00177			DebugLog("@@@ Set up training phase, fTimeBeforeNotPlayingsAmos1DidacMiss="$fTimeBeforeNotPlayingsAmos1DidacMiss);
    00178			SetPrimaryGoal(2);
    00179		}
    00180		else if ( N == 2 )
    00181		{
    00182			SetPrimaryGoal(3);
    00183			SetPrimaryGoal(4);
    00184			SetSecondaryGoal(0);
    00185			Mic.bActivated = false;
    00186			Mic.bCanCauseGameOver = false;
    00187			inv = GiveSomething(class'Chronometre', XIIIPawn);
    00188			C = Chronometre(inv);
    00189			if (C != none)
    00190				C.ReSetTimer(Goal3ChronoTime);
    00191		}
    00192		else if ( N == 4 )
    00193		{
    00194			C = Chronometre(XIIIPawn.FindInventoryType(class'Chronometre'));
    00195			if (C != none)
    00196			{
    00197				C.Destroy();
    00198			}
    00199			SetPrimaryGoal(5);
    00200			SetSecondaryGoal(3);
    00201		}
    00202		else if ( N == 5 )
    00203		{
    00204			SetPrimaryGoal(6);
    00205		}
    00206		else if ( N == 6 )
    00207		{
    00208			SetPrimaryGoal(7);
    00209		}
    00210	}
    00211
    00212
    00213
    00214	defaultproperties
    00215	{
    00216	     Goal3ChronoTime=60.000000
    00217	     sPoolRoomKeyName="Pool Room Key"
    00218	     fTimeBeforeNotPlayingsAmos1DidacMiss=28.000000
    00219	     EndMapVideo="cine13"
    00220	}

End Source Code