SpatialFear.SFSplashTrigger

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
//=============================================================================
// Spatial Fear
// Class: SFSplashTrigger
// Descripton: Subclasses of SFTrigger, spawns a configurable splash effect upon
//				touching. Defaults to water effect.
//				Use the ReTriggerDelay and TriggerOnlyOnece wisely, to not make it
//				splash continuously.
//
//
// Author: Markus Nuebel
//=============================================================================

class SFSplashTrigger extends SFTrigger;

var (SpatialFear) class<Actor> SplashActor; // Actor to spawn near the players feet, upon touch. Default: class'unrealshare.WaterImpact'
var (SpatialFear) Sound SplashSound; // Sound to play during impact. Default: Sound'UnrealShare.Generic.LSplash'
var (SpatialFear) float fSplashSize; // DrawScale for spawned SplashActor. Default: 1.0


// Overwritten, to add the special health setting here
function Touch( actor Other )
{
	local SFPlayer	oPlayer;
	local Actor		oSplash;

	if( IsRelevant( Other ) )
	{
		if(Other.IsA('SFPlayer'))
		{
			oPlayer = SFPlayer(Other);

			oSplash = Spawn(SplashActor,,,oPlayer.Location - oPlayer.CollisionHeight * vect(0,0,1));
			if ( oSplash  != None )
			{
					oSplash .DrawScale = fSplashSize;
					PlaySound(SplashSound, SLOT_Misc, 1.5 + 0.5 * fSplashSize);
			}
		}

	}
	// Call to base class
	Super.Touch(Other);
}

defaultproperties
{
     SplashActor=Class'UnrealShare.WaterImpact'
     SplashSound=Sound'UnrealShare.Generic.LSplash'
     fSplashSize=1.000000
}

class file time: 12/7/2003 3:58:24 PM - creation time: 12/7/2003 4:03:45 PM
Created with UnCodeX