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

UnrealShare.UTranslocatorTarget


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
//=============================================================================
// UTranslocator Target.
//=============================================================================
Class UTranslocatorTarget extends Projectile;

#exec MESH IMPORT MESH=TeleportProj ANIVFILE=Models\telemo_a.3D DATAFILE=Models\telemo_d.3D X=0 Y=0 Z=0 mlod=0
#exec MESH ORIGIN MESH=TeleportProj X=0 Y=0 Z=0 YAW=64 PITCH=0
#exec MESH SEQUENCE MESH=TeleportProj SEQ=All  STARTFRAME=0  NUMFRAMES=1
#exec TEXTURE IMPORT NAME=Ahand1 FILE=Models\hand.PCX
#exec MESHMAP SCALE MESHMAP=TeleportProj X=0.03 Y=0.03 Z=0.06
#exec MESHMAP SETTEXTURE MESHMAP=TeleportProj NUM=0 TEXTURE=Ahand1

var UTranslocator MyTranslocator;
var bool bCantPickup;
var vector RepLandedPosition;

replication
{
	// Variables the server should send to the client.
	reliable if ( Role==ROLE_Authority )
		RepLandedPosition;
}

simulated function ProcessTouch(Actor Other, Vector HitLocation)
{
	if ( MyTranslocator==None || Other!=MyTranslocator.Owner )
	{
		if( Level.NetMode==NM_Client && Other==Instigator )
			return;
		if ( Level.NetMode!=NM_Client && MyTranslocator!=None && Other.bIsPawn && PlayerPawn(MyTranslocator.Owner)==None
				&& !MyTranslocator.IsTeamMate(Pawn(Other)) )
		{
			MyTranslocator.BotPausingTime = 0;
			MyTranslocator.AltFire(0); // Try to telefrag.
		}
		else HitWall(Normal(Other.Location - Location), Other);
	}
	else if ( !bCantPickup )
	{
		PlaySound(Sound'AmmoSnd');
		Destroy();
	}
}
simulated function Landed( vector HitNormal )
{
	HitWall( HitNormal, None );
}
simulated function HitWall( vector HitNormal, actor Wall )
{
	local rotator R;

	bCantPickup = false;
	SetPhysics(PHYS_Falling);
	MakeNoise(0.6);
	Velocity = 0.8*MirrorVectorByNormal(Velocity,HitNormal); // Reflect off Wall w/damping
	if ( Wall!=None && Wall.Physics!=PHYS_None )
		Velocity+=Wall.Velocity;
	if ( VSize(Velocity)<40 )
	{
		R = Rotation;
		R.Pitch = 0;
		SetRotation(R);
		bFixedRotationDir = false;
		SetPhysics(PHYS_None);
		if ( Level.NetMode!=NM_Client )
			RepLandedPosition = Location;
	}
	else if ( Level.NetMode!=NM_DedicatedServer )
	{
		PlaySound(ImpactSound);
		RandSpin(60000);
	}
}
simulated function PostBeginPlay()
{
	local vector X,Y,Z;

	if ( Level.NetMode!=NM_DedicatedServer )
		RandSpin(100000);
	if ( Level.NetMode==NM_Client || Instigator==None )
		return;
	GetAxes(Instigator.ViewRotation,X,Y,Z);
	Velocity = (X dot Instigator.Velocity) * X +    // Impart ONLY forward
			   Vector(Rotation) * Speed; 			// Velocity
	Velocity.Z += 250;
	RandSpin(100000);
}
function Destroyed()
{
	if ( MyTranslocator!=None )
	{
		MyTranslocator.TargetDestroyed();
		MyTranslocator = None;
	}
}
simulated function PostNetReceive()
{
	local rotator R;

	if ( RepLandedPosition!=vect(0,0,0) )
	{
		SetLocation(RepLandedPosition);
		if ( Physics!=PHYS_None )
		{
			R = Rotation;
			R.Pitch = 0;
			SetRotation(R);
			bFixedRotationDir = false;
			SetPhysics(PHYS_None);
		}
		RepLandedPosition = vect(0,0,0);
	}
}

defaultproperties
{
				bCantPickup=True
				speed=900.000000
				MyDamageType="Gibbed"
				ImpactSound=Sound'UnrealShare.Eightball.GrenadeFloor'
				bNetNotify=True
				bNetTemporary=False
				Physics=PHYS_Falling
				RemoteRole=ROLE_SimulatedProxy
				LifeSpan=0.000000
				Mesh=Mesh'UnrealShare.TeleportProj'
				CollisionRadius=4.000000
				CollisionHeight=4.000000
				bBounce=True
				bFixedRotationDir=True
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: zo 11-11-2012 21:10:28.000 - Creation time: zo 11-11-2012 21:14:22.569 - Created with UnCodeX