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

UTGame.UTWaterVolume


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
/**
 *
 * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
 */

class UTWaterVolume extends WaterVolume
	placeable;

/** effects to play based on what type of Actor you are **/
var ParticleSystem PS_EnterWaterEffect_Pawn;
var ParticleSystem PS_EnterWaterEffect_Vehicle;

var ParticleSystem ProjectileEntryEffect;

/**
 * We override this so we can play some water splash effects when a pawn enters the water
 *
 * NOTE: we don't differentiate between GroundSpeed and FallSpeed / AirSpeed
 **/
simulated event Touch( Actor Other, PrimitiveComponent OtherComp, vector HitLocation, vector HitNormal )
{
	local ParticleSystem PS_WaterEffect;
	local ParticleSystemComponent PSC_WaterEffect;
	local float MaxSpeed;
	local float Vel;
	local float ParamValue;
	local EMoveDir MoveDir;
	local vector ParticleVect;
	local UTPawn UTP;

	Super.Touch( Other, OtherComp, HitLocation, HitNormal );

	if (WorldInfo.NetMode != NM_DedicatedServer && (WorldInfo.TimeSeconds - Other.LastRenderTime < 0.2) && Pawn(Other) != None)
	{
		//DrawDebugCoordinateSystem( HitLocation, Rotator(HitNormal), 64.f );

		UTP = UTPawn(Other);

		if( UTP != none )
		{
			if ( (UTP.Physics == PHYS_Walking) || (UTP.Physics == PHYS_Swimming) )
			{
				// no splash when walking or swimming
				return;
			}
			PS_WaterEffect = PS_EnterWaterEffect_Pawn;
			ParamValue = 1.0;
			MaxSpeed = UTP.GroundSpeed;
		}
		else if( UTVehicle(Other) != none )
		{
			PS_WaterEffect = PS_EnterWaterEffect_Vehicle;
			MaxSpeed = UTVehicle(Other).GroundSpeed;
		}
		else
		{
			PS_WaterEffect = PS_EnterWaterEffect_Vehicle;
			ParamValue = 1.0;
			MaxSpeed = class'Pawn'.default.GroundSpeed;
		}

		PSC_WaterEffect = WorldInfo.MyEmitterPool.SpawnEmitter( PS_WaterEffect, HitLocation, Rotator(HitNormal), self );

		if( PSC_WaterEffect != none )
		{
			MoveDir = Other.MovingWhichWay( Vel );
			if ( ParamValue == 0.0 )
			{
				ParamValue = 5.0 * Vel/MaxSpeed;
			}

			// this is the value between 0 and 5 which the PS desires
			//`log( "MoveDir: " $ MoveDir $ " Vel: " $ Vel $ " ParamValue: " $ ParamValue );
			switch( MoveDir )
			{
			case MD_Forward: ParticleVect = vect(1,0,0) * ParamValue; break;
			case MD_Backward: ParticleVect = vect(-1,0,0) * ParamValue; break;
			case MD_Left: ParticleVect = vect(0,-1,0) * ParamValue; break;
			case MD_Right: ParticleVect = vect(0,1,0) * ParamValue; break;
			case MD_Down: ParticleVect = vect(1,0,0) * ParamValue; break;
			case MD_Up: ParticleVect = vect(1,0,0) * ParamValue; break;
			default:  break;
			}

			PSC_WaterEffect.SetVectorParameter( 'Direction', ParticleVect );
		}
	}
}

simulated function PlayEntrySplash(Actor Other)
{
	if( EntrySound != None )
	{
		Other.PlaySound(EntrySound);
		if ( Other.Instigator != None )
			Other.MakeNoise(1.0);
	}
	if ( !WorldInfo.bDropDetail && WorldInfo.NetMode != NM_DedicatedServer && Other.IsA('Projectile')
		&& (Other.Instigator != None) && Other.Instigator.IsPlayerPawn() && Other.Instigator.IsLocallyControlled() )
	{
		WorldInfo.MyEmitterPool.SpawnEmitter(ProjectileEntryEffect, Other.Location, rotator(vect(0,0,1)));
	}
}

defaultproperties
{
   PS_EnterWaterEffect_Pawn=ParticleSystem'Envy_Level_Effects_2.Vehicle_Water_Effects.P_Player_Water_Impact'
   PS_EnterWaterEffect_Vehicle=ParticleSystem'Envy_Level_Effects_2.Vehicle_Water_Effects.P_General_VH_Water_Impact'
   ProjectileEntryEffect=ParticleSystem'Envy_Effects.Particles.P_WP_Water_Splash_Small'
   EntrySound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterDeepLandCue'
   ExitSound=SoundCue'A_Character_Footsteps.FootSteps.A_Character_Footstep_WaterDeepCue'
   TerminalVelocity=1500.000000
   Begin Object Class=BrushComponent Name=BrushComponent0 ObjName=BrushComponent0 Archetype=BrushComponent'Engine.Default__WaterVolume:BrushComponent0'
      ObjectArchetype=BrushComponent'Engine.Default__WaterVolume:BrushComponent0'
   End Object
   BrushComponent=BrushComponent0
   Components(0)=BrushComponent0
   CollisionComponent=BrushComponent0
   Name="Default__UTWaterVolume"
   ObjectArchetype=WaterVolume'Engine.Default__WaterVolume'
}

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