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

U2Weapons.projectileAssaultExplosion


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
//=============================================================================
// projectileAssaultExplosion.uc
// $Author: Mfox $
// $Date: 4/30/02 3:39p $
// $Revision: 5 $
//=============================================================================
class projectileAssaultExplosion extends U2Projectile;

#exec OBJ LOAD File=..\System\ParticleRes\AssaultFX.u

var float<0.00,5.00,0.01> TimePassed;
var bool bGotRotation, bGotTimePassed;

/*networking:
this projectile is spawned on all clients

since particlesystems have no replication, we must ensure it is spawned correctly on all the clients
since particlesystems cannot easily be adjusted to any point in their lifetime, we must spawn it when it really starts
balwaysrelevant lets us spawn it on all the clients, and TimePassed gives us a judge for how much time to push-it-in, since it's not replicated instantaneously
*/

event Replication()
{
	Super.Replication();
	//force these to replicate on bnetinitial, even if rot(0,0,0), for the purposes of the bGotRotation bool
	if( bNetInitial )
	{
		FORCEREP('Rotation');
		FORCEREP('TimePassed');
	}
}

simulated function PostRecvRotation()
{
	bGotRotation = true;
	CheckExplode();
}

simulated function PostRecvTimePassed()
{
	bGotTimePassed = true;
	CheckExplode();
}

//check if we have the data we need to spawn the effect
simulated function CheckExplode()
{
	local CheckResult Hit;
	if( bGotRotation && bGotTimePassed )
	{
		Explode( Location, vector(Rotation) );
	}
}


simulated function ExplodeEx( CheckResult Hit )
{
	local ParticleGenerator P;

	// ** Restrict angle of reflection (2 -> 1.8 or so ... so particles never go into the ground)
	// ** Invert angle of reflection based on incidence (so particle never reflect <45 degrees... if V dot Hit.Normal < 0.5 ... DrawScale3D.X = -CS.X)

	// Fix ARL: Move to impact handler?
	P = class'ParticleGenerator'.static.CreateNew( self, ParticleRadiator'AssaultFX.ParticleRadiator0', Hit.Location + Hit.Normal * 5 );
	P.SetRotation( rotator(Hit.Normal)	 );
	P.Trigger( self, Instigator );
	P.ParticleLifeSpan = P.GetMaxLifeSpan() + P.TimerDuration;

	//start counting
	if( Role == ROLE_Authority )
		Enable('Tick');

	P.PrimeTime = TimePassed;

	//don't destroy ourselves
	//Super.ExplodeEx(Hit);
}


event Tick( float DeltaTime )
{
	Super.Tick(DeltaTime);
	TimePassed += DeltaTime;
}

defaultproperties
{
	bAlwaysRelevant=true
	LifeSpan=5.000000
     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:42.000 - Creation time: sk 3-1-2016 10:48:41.118 - Created with UnCodeX