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

U2XMP.EnergyRelayDeployable


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
//=============================================================================
// $Workfile: EnergyRelayDeployable.uc $
// Created By: Mark Poesch
// Created On: 6/22/2001
// $Author: Sbrown $
// $Date: 9/04/02 13:27 $
// $Revision: 6 $
//=============================================================================
class EnergyRelayDeployable extends DeployableInventory;

var EnergySource Source;	// EnergySource tapped by this Relay
var float MaxTapDistance;	// maximum distance at which the EnergyRelay can be deployed from an EnergySource (32 feet)

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

function bool CanDeploy()
{
	local EnergySource S;
	local float Distance;
	local float SourceDistance;
	local int	i;

	Source = None;
	// don't deploy unless an energy source is within MaxTapRadius
	foreach AllActors( class'EnergySource', S )
	{
		Distance = VSize( S.Location - Owner.Location );
DM( "Considering "$ S @ Distance );
		if( Distance < MaxTapDistance )
		{
DM( "  ...withing range..." );
			if(  Source == None || Distance < SourceDistance  )
			{
DM( "  Source="$ Source @ Distance @ SourceDistance );
				Source = S;
				SourceDistance = Distance;
			}
		}
	}
DM( "Selected "$ Source );

	return Source != None;
}

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

function UpdateDeployedActor( DeployedUnit A )
{
	assert( Pawn(Owner) != None );
	EnergyRelay(A).TeamNumber = Pawn(Owner).GetTeam();

	assert( Source != None );
	EnergyRelay(A).SetSource( Source );
}

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

defaultproperties
{
	MaxTapDistance=512.000000
	DeployClass=Class'U2XMP.EnergyRelay'
	ActivateSound=Sound'U2XMPA.EnergyRelay.EnergyRelayActivate'
     GunButtSounds(0)=Sound'U2WeaponsA.GunButt.GunButt01'
     GunButtSounds(1)=Sound'U2WeaponsA.GunButt.GunButt02'
     GunButtSounds(2)=Sound'U2WeaponsA.GunButt.GunButt03'
     GunButtSounds(3)=Sound'U2WeaponsA.GunButt.GunButt04'
     TargetableTypes(0)='Pawn'
	ProjectileClass=Class'U2XMP.projectileEnergyRelay'
	PickupClass=Class'U2XMP.EnergyRelayPickup'
	ItemName="Energy Relay"
	DrawType=DT_Sprite
	DrawScale=0.200000
     UseReticleOnEvents(0)="UseReticleText"
     UseReticleOnEvents(1)="UseReticleCorners"
     UseReticleOnEvents(2)="UseReticleTopBars"
     ProximityReticleOnEvents(0)="ProximityReticleCorners"
     ProximityReticleOnEvents(1)="ProximityReticleTopBars"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: sk 3-1-2016 10:38:44.000 - Creation time: sk 3-1-2016 10:48:38.728 - Created with UnCodeX