XIDCine
Class BeachFinalFall

source: C:\XIII\XIDCine\Classes\BeachFinalFall.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Triggers
         |
         +--XIDCine.BeachFinalFall
Direct Known Subclasses:None

class BeachFinalFall
extends Engine.Triggers

//----------------------------------------------------------- // BeachFinalFall // Created by iKi // Last Modification by iKi //-----------------------------------------------------------
Variables
 Vector Loc
 XIIIPlayerController PC
 Rotator Rotat
 bool bTheEnd
 clBlack, clGrey

States
LetsSwing_02, LetsSwing_01, Waiting, Init
State LetsSwing_02 Function Summary


State LetsSwing_01 Function Summary


State Waiting Function Summary


State Init Function Summary



Source Code


00001	//-----------------------------------------------------------
00002	// BeachFinalFall
00003	// Created by iKi
00004	// Last Modification by iKi
00005	//-----------------------------------------------------------
00006	class BeachFinalFall extends Triggers;
00007	//	ShowCategories( Collision,
00008	//	placeable;
00009	
00010	#exec Texture Import File=Textures\Rock_ico.pcx Name=Rock_ico Mips=Off
00011	
00012	VAR Color clBlack, clGrey;
00013	VAR bool bTheEnd;
00014	VAR TRANSIENT Vector Loc;
00015	VAR TRANSIENT Rotator Rotat;
00016	VAR TRANSIENT XIIIPlayerController PC;
00017	
00018	AUTO STATE Init
00019	{
00020		EVENT BeginState()
00021		{
00022			SetTimer(0.1,true);
00023		}
00024		
00025		EVENT Timer()
00026		{
00027			if (XIIIGameInfo(Level.Game).MapInfo!=none && XIIIGameInfo(Level.Game).MapInfo.XIIIController!=none)
00028			{
00029				PC=XIIIGameInfo(Level.Game).MapInfo.XIIIController;
00030				SetTimer( 0, false );
00031				GotoState( 'Waiting' );
00032			}
00033	
00034		}
00035	}
00036	
00037	STATE Waiting
00038	{
00039		EVENT Trigger( actor Other, Pawn EventInstigator )
00040		{
00041			GotoState( 'LetsSwing_01' );
00042		}
00043	}
00044	
00045	STATE LetsSwing_01
00046	{
00047		EVENT BeginState()
00048		{
00049			PC.GotoState( 'NoControl' );
00050			Level.bCineFrame=false;
00051			Loc=  PC.Pawn.Location-vect(0,0,60);//-PC.Pawn.CollisionHeight;
00052			Rotat.Yaw = PC.Rotation.Yaw;
00053			Rotat.Pitch= 3000;
00054			Rotat.Roll= 12000;
00055			PC.FilterColorWanted=clBlack;
00056		}
00057	
00058		EVENT Tick( float dt )
00059		{
00060			LOCAL Rotator r;
00061			LOCAL Vector v;
00062	//		LOCAL float f;
00063			if ( PC.Pawn.Physics!=PHYS_None )
00064			{
00065				PC.Pawn.SetPhysics( PHYS_None );
00066				PC.Pawn.bCollideWorld=false;
00067			}
00068			if ( !PC.IsInState( 'NoControl' ) )
00069				GotoState( 'NoControl' );
00070	
00071	//		TimeStamp+=dt;
00072			r=Rotat;
00073			r-=PC.Rotation;
00074			r.Yaw= ((r.Yaw+32768)&65535)-32768;
00075			r.Roll= ((r.Roll+32768)&65535)-32768;
00076			r.Pitch= ((r.Pitch+32768)&65535)-32768;
00077	
00078			PC.SetRotation(r*0.005+PC.Rotation);
00079	
00080			v = Loc-PC.Pawn.Location;
00081			PC.Pawn.SetLocation( PC.Pawn.Location+ 0.005*v );
00082	
00083			if ( bTheEnd )
00084			{
00085				GotoState( 'LetsSwing_02' );
00086			}
00087	
00088		}
00089	Begin:
00090		PC.FilterColorSpeed=4;
00091		PC.FilterColorWanted=clBlack;
00092		Sleep( 0.25 );
00093		PC.FilterColorSpeed=5;
00094		PC.FilterColorWanted=clGrey;
00095		Sleep( 0.2+0.5 );
00096		PC.FilterColorSpeed=4;
00097		PC.FilterColorWanted=clBlack;
00098		Sleep( 0.25 );
00099		PC.FilterColorSpeed=5;
00100		PC.FilterColorWanted=clGrey;
00101		Sleep( 0.2+0.5 );
00102		PC.FilterColorSpeed=0.25;
00103		PC.FilterColorWanted=clBlack;
00104		Sleep( 4 );
00105		bTheEnd=true;
00106	}
00107	
00108	STATE LetsSwing_02
00109	{
00110	Begin:
00111		Sleep(2.0);
00112		TriggerEvent( event, Self, PC.Pawn );
00113	
00114	}
00115	
00116	
00117	
00118	defaultproperties
00119	{
00120	     clGrey=(B=128,G=128,R=128)
00121	     InitialState="Init"
00122	     Texture=Texture'XIDCine.Rock_ico'
00123	     bDirectional=True
00124	}

End Source Code