## XIDCine
Class NastyHelico

source: C:\XIII\XIDCine\Classes\NastyHelico.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Decoration
             |
             +--XIII.VehicleDeco
                |
                +--XIDCine.HelicoDeco
                   |
                   +--XIDCine.NastyHelico

Direct Known Subclasses:None

class NastyHelico
extends XIDCine.HelicoDeco

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

Variables
`Actor` | `Passengers[2]`

Function Summary
`void` | `PostBeginPlay()`

Source Code

    00001	//
    00002	//-----------------------------------------------------------
    00003	class NastyHelico extends HelicoDeco;
    00004
    00005	VAR()	Actor Passengers[2];
    00006	VAR		VECTOR PassengersRelativeLocation[2];
    00007	VAR		byte bPassengerDead[2];
    00008
    00009	FUNCTION PostBeginPlay()
    00010	{
    00011		LOCAL AttackPoint ap;
    00012
    00013		Super.PostBeginPlay();
    00014		if ( Passengers[0]!=none )
    00015		{
    00016			Passengers[0].Tag=LinkedTo.Tag;
    00017			PassengersRelativeLocation[0]=(Passengers[0].Location-Passengers[0].CollisionHeight*vect(0,0,1)-Location)<<Rotation;
    00018		}
    00019		if (Passengers[1]!=none)
    00020		{
    00021			Passengers[1].Tag=LinkedTo.Tag;
    00022			PassengersRelativeLocation[1]=(Passengers[1].Location-Passengers[1].CollisionHeight*vect(0,0,1)-Location)<<Rotation;
    00023
    00024		}
    00025	}
    00026	EVENT Tick( float dt )
    00027	{
    00028		LOCAL ROTATOR r;
    00029		LOCAL VECTOR vX, vY, vZ, vZ2;
    00030		LOCAL int i;
    00031
    00032		HelicoTick(dt);
    00033
    00034		GetAxes( Rotation, vX, vY, vZ );
    00035		for ( i=0; i<2; i++ )
    00036		{
    00037			if ( bPassengerDead[i]==0 && Passengers[i]!= none && Passengers[i].IsA( 'Pawn' ) )
    00038			{
    00039				Passengers[i].SetLocation(Location+(PassengersRelativeLocation[i]>>Rotation)+Passengers[i].CollisionHeight*vect(0,0,1));
    00040				if ( !Pawn(Passengers[i]).bIsDead )
    00041				{
    00042					vX = Pawn(Passengers[i]).Controller.Focus.Location - Passengers[i].Location;
    00043					vY= vZ cross vX;
    00044					r = OrthoRotation( vX, vY, vZ );
    00045					Passengers[i].SetRotation( r );
    00046				}
    00047				else
    00048				{
    00049					GetAxes( Passengers[i].Rotation, vX, vY, vZ2 );
    00050					r = OrthoRotation( vX, vY, vZ );
    00051					Passengers[i].SetRotation( r );
    00052					Passengers[i].SetPhysics( PHYS_None );
    00053					Passengers[i].SetBase( Self );
    00054					Passengers[i].bCollideWorld=false;
    00055					bPassengerDead[i] = 1;
    00056				}
    00057			}
    00058		}
    00059	}
    00060
    00061	EVENT Destroyed( )
    00062	{
    00063		LOCAL int i;
    00064
    00065		for ( i=0; i<2; i++ )
    00066		{
    00067			if ( Passengers[i]!= none && Passengers[i].IsA( 'Pawn' ) && Pawn(Passengers[i]).bIsDead)
    00068				Passengers[i].Destroy();
    00069		}
    00070		Super.Destroyed( );
    00071	}
    00072
    00073
    00074
    00075	defaultproperties
    00076	{
    00077	     bActorShadows=False
    00078	     InitialState="InvisibleUntilTriggered"
    00079	     StaticMesh=StaticMesh'Meshes_Vehicules.helicomangousteOpen'
    00080	}

End Source Code