Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

UTGame.UTAirVehicle


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
/**
 *
 * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
 */


/** base class for vehicles that fly or hover */
class UTAirVehicle extends UTHoverVehicle
	native(Vehicle)
	abstract;

/** indices into VehicleEffects array of contrail effects that have their 'ContrailColor' parameter set via C++ */
var array<int> ContrailEffectIndices;

/** parameter name for contrail color (determined by speed) */
var name ContrailColorParameterName;

var bool bAutoLand;
var float PushForce;	// for AI when landing;

var localized string RadarLockMessage;				/** Displayed when enemy raptor fires locked missile at you */

var float LastRadarLockWarnTime;

// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)

native function float GetGravityZ();

simulated event LockOnWarning(UTProjectile IncomingMissile)
{
	if ( UTProj_AvrilRocketBase(IncomingMissile) != None )
	{
		SendLockOnMessage(2);
	}
	else if ( IncomingMissile.IsA('UTProj_RaptorRocket') ) //@hack: FIXME: need a flag or something
	{
		SendLockOnMessage(4);
	}
	else
	{
		SendLockOnMessage(1);
	}
}

/** JumpOutCheck()
Check if bot wants to jump out of vehicle, which is currently descending towards its destination
*/
event JumpOutCheck()
{
	local UTBot B;

	B = UTBot(Controller);
	if ( (B != None) && (UTOnslaughtObjective(B.Movetarget) != None) && UTOnslaughtObjective(B.MoveTarget).IsNeutral() && ((B.Enemy == None) || !B.LineOfSightTo(B.Enemy)) )
	{
		DriverLeave(false);
		if ( Controller == None )
		{
			Mesh.AddImpulse( PushForce*Vector(Rotation), Location );
			if ( (B.Pawn.Physics == PHYS_Falling) && B.DoWaitForLanding() )
				B.Pawn.Velocity.Z = 0;
		}
	}
}

simulated function SetDriving(bool bNewDriving)
{
	if (bAutoLand && !bNewDriving && !bChassisTouchingGround && Health > 0)
	{
		if (Role == ROLE_Authority)
		{
			GotoState('AutoLanding');
		}
	}
	else
	{
		Super.SetDriving(bNewDriving);
	}
}

/** state to automatically land when player jumps out while high above land */
state AutoLanding
{
	simulated function SetDriving(bool bNewDriving)
	{
		if ( bNewDriving )
		{
			GotoState('Auto');
			Global.SetDriving(bNewDriving);
		}
	}

	function bool Died(Controller Killer, class<DamageType> DamageType, vector HitLocation)
	{
		if (Global.Died(Killer, DamageType, HitLocation))
		{
			SetDriving(false);
			return true;
		}
		else
		{
			return false;
		}
	}

	function Tick(float DeltaTime)
	{
		local actor HitActor;
		local vector HitNormal, HitLocation;

		if (bChassisTouchingGround)
		{
			GotoState('Auto');
			SetDriving(false);
		}
		else
		{
			HitActor = Trace(HitLocation, HitNormal, Location - vect(0,0,2500), Location, false);
			if ( Velocity.Z < -1200 )
				OutputRise = 1.0;
			else if ( HitActor == None )
				OutputRise = -1.0;
			else if ( VSize(HitLocation - Location) < -2*Velocity.Z )
			{
				if ( Velocity.Z > -100 )
					OutputRise = 0;
				else
					OutputRise = 1.0;
			}
			else if ( Velocity.Z > -500 )
				OutputRise = -0.4;
			else
				OutputRise = -0.1;
		}
	}
}

//==============================
// AI interface
function bool RecommendLongRangedAttack()
{
	return true;
}

function bool FastVehicle()
{
	return true;
}

function bool Dodge(eDoubleClickDir DoubleClickMove)
{
	if ( FRand() < 0.7 )
	{
		VehicleMovingTime = WorldInfo.TimeSeconds + 1;
		Rise = 1;
	}
	return false;
}

defaultproperties
{
   ContrailColorParameterName="ContrailColor"
   bAutoLand=True
   bUseAlternatePaths=False
   bEjectPassengersWhenFlipped=False
   bMustBeUpright=False
   bDropDetailWhenDriving=True
   bFindGroundExit=False
   bHomingTarget=True
   bReducedFallingCollisionDamage=True
   bNoZDampingInAir=False
   Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment ObjName=MyLightEnvironment Archetype=DynamicLightEnvironmentComponent'UTGame.Default__UTHoverVehicle:MyLightEnvironment'
      ObjectArchetype=DynamicLightEnvironmentComponent'UTGame.Default__UTHoverVehicle:MyLightEnvironment'
   End Object
   LightEnvironment=MyLightEnvironment
   UpsideDownDamagePerSec=0.000000
   IconCoords=(U=989.000000,V=24.000000,UL=43.000000,VL=48.000000)
   LookForwardDist=100.000000
   Begin Object Class=RB_StayUprightSetup Name=MyStayUprightSetup ObjName=MyStayUprightSetup Archetype=RB_StayUprightSetup'UTGame.Default__UTHoverVehicle:MyStayUprightSetup'
      ObjectArchetype=RB_StayUprightSetup'UTGame.Default__UTHoverVehicle:MyStayUprightSetup'
   End Object
   StayUprightConstraintSetup=RB_StayUprightSetup'UTGame.Default__UTAirVehicle:MyStayUprightSetup'
   Begin Object Class=RB_ConstraintInstance Name=MyStayUprightConstraintInstance ObjName=MyStayUprightConstraintInstance Archetype=RB_ConstraintInstance'UTGame.Default__UTHoverVehicle:MyStayUprightConstraintInstance'
      ObjectArchetype=RB_ConstraintInstance'UTGame.Default__UTHoverVehicle:MyStayUprightConstraintInstance'
   End Object
   StayUprightConstraintInstance=RB_ConstraintInstance'UTGame.Default__UTAirVehicle:MyStayUprightConstraintInstance'
   bTurnInPlace=True
   bFollowLookDir=True
   bCanFly=True
   bCanStrafe=True
   Begin Object Class=SkeletalMeshComponent Name=SVehicleMesh ObjName=SVehicleMesh Archetype=SkeletalMeshComponent'UTGame.Default__UTHoverVehicle:SVehicleMesh'
      ObjectArchetype=SkeletalMeshComponent'UTGame.Default__UTHoverVehicle:SVehicleMesh'
   End Object
   Mesh=SVehicleMesh
   Begin Object Class=CylinderComponent Name=CollisionCylinder ObjName=CollisionCylinder Archetype=CylinderComponent'UTGame.Default__UTHoverVehicle:CollisionCylinder'
      ObjectArchetype=CylinderComponent'UTGame.Default__UTHoverVehicle:CollisionCylinder'
   End Object
   CylinderComponent=CollisionCylinder
   Components(0)=CollisionCylinder
   Components(1)=SVehicleMesh
   Components(2)=MyLightEnvironment
   CollisionComponent=SVehicleMesh
   Name="Default__UTAirVehicle"
   ObjectArchetype=UTHoverVehicle'UTGame.Default__UTHoverVehicle'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: tr 31-1-2018 17:18:28.000 - Creation time: sk 18-3-2018 10:01:18.461 - Created with UnCodeX