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

UTGameContent.UTDeployableShapedCharge


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
/**
 *
 * Copyright 1998-2007 Epic Games, Inc. All Rights Reserved.
 */
class UTDeployableShapedCharge extends UTDeployable;

var array< class<UTShapedCharge> > TeamShapedChargeClasses;

static function class<Actor> GetTeamDeployable(int TeamNum)
{
	if (TeamNum >= default.TeamShapedChargeClasses.length)
	{
		TeamNum = 0;
	}
	return default.TeamShapedChargeClasses[TeamNum];
}

function bool Deploy()
{
	local UTPlayerController PC;

	DeployedActorClass = class<UTShapedCharge>(GetTeamDeployable(Instigator.GetTeamNum()));
	if ( Super.Deploy() )
	{
		PC = UTPlayerController(Instigator.Controller);
		if ( PC != None )
		{
			 PC.CheckAutoObjective(true);
		}
		return true;
	}
	else
	{
		return false;
	}
}

/** Recommend an objective for player carrying this deployable */
function UTGameObjective RecommendObjective(Controller C)
{
	local UTWarfareBarricade B, Best;
	local float NewDist, BestDist;

	if ( AmmoCount <= 0 )
	{
		return None;
	}

	// if you've got a shaped charge, you're going to want to find a barricade
	ForEach WorldInfo.AllNavigationPoints(class'UTWarfareBarricade', B)
	{
		if ( ((Best == None) || (Best.DefensePriority <= B.DefensePriority))
				&& (B.ValidTargetFor(C)) )
		{
			// prioritize by defensepriority, then proximity
			NewDist = VSize(C.Pawn.Location - B.Location);
			if ( (Best == None) || (Best.DefensePriority < B.DefensePriority) || (NewDist < BestDist) )
			{
				Best = B;
				BestDist = NewDist;
			}
		}
	}
	return Best;
}

function bool ShouldDeploy(UTBot B)
{
	return ( B.Squad != None && B.Squad.SquadObjective != None && !WorldInfo.GRI.OnSameTeam(B.Squad.SquadObjective, B) &&
		CanAttack(B.Squad.SquadObjective) );
}

function bool CanAttack(Actor Other)
{
	local float OtherRadius, OtherHeight;

	if (Instigator == None || Instigator.Controller == None)
	{
		return false;
	}

	// check that target is within range
	Other.GetBoundingCylinder(OtherRadius, OtherHeight);
	if (VSize(Instigator.Location - Other.Location) > OtherRadius + 100.0)
	{
		return false;
	}

	// check that can see target
	return Instigator.Controller.LineOfSightTo(Other);
}

defaultproperties
{
   TeamShapedChargeClasses(0)=Class'UTGameContent.UTShapedCharge_Red'
   TeamShapedChargeClasses(1)=Class'UTGameContent.UTShapedCharge_Blue'
   DeployedActorClass=Class'UTGameContent.UTShapedCharge'
   bDelayRespawn=False
   DeployFailedSoundCue=SoundCue'A_Gameplay.ONS.A_GamePlay_ONS_CoreImpactShieldedCue'
   bCanDestroyBarricades=True
   bHasLocationSpeech=True
   AttachmentClass=Class'UTGameContent.UTAttachment_ShapedCharge'
   ArmsAnimSet=AnimSet'PICKUPS.Deployables.Anims.K_Deployables_ShapeCharge_1P_Arms'
   NeedToPickUpAnnouncement=(AnnouncementSound=SoundNodeWave'A_Announcer_Status.Status.A_StatusAnnouncer_GrabTheShapedCharge',AnnouncementText="Grab the Shaped Charge!")
   LocationSpeech(0)=SoundNodeWave'A_Character_IGMale.BotStatus.A_BotStatus_IGMale_HeadingForTheShapedCharge'
   LocationSpeech(1)=SoundNodeWave'A_Character_Jester.BotStatus.A_BotStatus_Jester_HeadingForTheShapedCharge'
   LocationSpeech(2)=SoundNodeWave'A_Character_Othello.BotStatus.A_BotStatus_Othello_HeadingForTheShapedCharge'
   FireOffset=(X=20.000000,Y=0.000000,Z=0.000000)
   Begin Object Class=UTSkeletalMeshComponent Name=FirstPersonMesh ObjName=FirstPersonMesh Archetype=UTSkeletalMeshComponent'UTGame.Default__UTDeployable:FirstPersonMesh'
      FOV=60.000000
      SkeletalMesh=SkeletalMesh'PICKUPS.Deployables.Mesh.SK_Deployables_ShapeCharge_1P'
      Begin Object Class=AnimNodeSequence Name=MeshSequenceA ObjName=MeshSequenceA Archetype=AnimNodeSequence'Engine.Default__AnimNodeSequence'
         Name="MeshSequenceA"
         ObjectArchetype=AnimNodeSequence'Engine.Default__AnimNodeSequence'
      End Object
      Animations=AnimNodeSequence'UTGameContent.Default__UTDeployableShapedCharge:MeshSequenceA'
      AnimSets(0)=AnimSet'PICKUPS.Deployables.Anims.K_Deployables_ShapeCharge_1P'
      bUseAsOccluder=False
      bForceDirectLightMap=True
      bCastDynamicShadow=False
      Scale=0.500000
      ObjectArchetype=UTSkeletalMeshComponent'UTGame.Default__UTDeployable:FirstPersonMesh'
   End Object
   Mesh=FirstPersonMesh
   ItemName="Shaped Charge Det Pack"
   RespawnTime=60.000000
   PickupMessage="Shaped Charge Det Pack"
   Begin Object Class=SkeletalMeshComponent Name=PickupMesh ObjName=PickupMesh Archetype=SkeletalMeshComponent'UTGame.Default__UTDeployable:PickupMesh'
      SkeletalMesh=SkeletalMesh'PICKUPS.Deployables.Mesh.SK_Deployables_ShapeCharge_1P'
      Translation=(X=0.000000,Y=0.000000,Z=-30.000000)
      ObjectArchetype=SkeletalMeshComponent'UTGame.Default__UTDeployable:PickupMesh'
   End Object
   DroppedPickupMesh=PickupMesh
   PickupFactoryMesh=PickupMesh
   Name="Default__UTDeployableShapedCharge"
   ObjectArchetype=UTDeployable'UTGame.Default__UTDeployable'
}

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