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

Legend.SpecialEvent


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
//=============================================================================
// SpecialEvent: Receives trigger messages and does some "special event"
// some combination of a message, sound playing, damage, and/or death to the instigator
// if the event of this actor is set, will try to send player on the interpolation path
// with tag matching this event.
//=============================================================================
class SpecialEvent extends Triggers;

#exec Texture Import File=Textures\TrigSpcl.pcx Name=S_SpecialEvent Mips=Off MASKED=1

//-----------------------------------------------------------------------------
// Variables.

var() int        Damage;         // how much to damage triggering actor
var() class<DamageType>		 DamageType;
var() sound      Sound;          // if not none, this sound effect will be played
var() localized  string Message; // message to display
var() bool       bBroadcast;     // To broadcast the message to all players.
var() bool		 bPlayerJumpToInterpolation;	// if true, player is teleported to start of interpolation path
var() bool		 bPlayersPlaySoundEffect;		// if true, have sound effect played at players' location
var() bool		 bKillInstigator;	// if true, kill the instigator
var() bool		 bViewTargetInterpolatedActor;	// if true, playercontroller viewtargets the interpolated actor
var() bool		 bThirdPersonViewTarget;		// if true, playercontroller third person views the interpolated actor
var() name		 InterpolatedActorTag;	// tag of actor to send on interpolation path (if none, then instigator is used)

//-----------------------------------------------------------------------------
// Functions.

function Trigger( Actor Other, Pawn EventInstigator, optional name EventName )
{
	local PlayerController P;
	local InterpolationPoint i;
	local Actor A;

	if ( Len(Message) != 0 )
	{
		if( bBroadcast )
			Level.Game.Broadcast(EventInstigator, Message, 'CriticalEvent'); // Broadcast message to all players.
		else if( (len(Message)!=0) && (EventInstigator != None) )
			EventInstigator.ClientMessage( Message ); // Send message to instigator only.
	}

	if ( Sound != None )
	{
		if ( bPlayersPlaySoundEffect )
		{
			ForEach DynamicActors(class'PlayerController', P)
				P.ClientPlaySound(Sound);
		}
		else
			PlaySound( Sound );
	}

	if ( Damage > 0 )
		Other.TakeDamage( Damage, EventInstigator, EventInstigator.Location, Vect(0,0,0), DamageType);

	if ( EventInstigator == None )
		return;

	if ( AmbientSound != None )
		EventInstigator.AmbientSound = AmbientSound;

	if ( bKillInstigator && !EventInstigator.PreventDeath( 0, EventInstigator, DamageType, EventInstigator.Location ) )
		EventInstigator.Died( None, DamageType, EventInstigator.Location, vect(0,0,0) );

	if( (Event != 'None') && (Event != '') && (Level.NetMode == NM_Standalone) )
	{
		if ( (InterpolatedActorTag == 'None') || (InterpolatedActorTag == '') )
		{
			if ( EventInstigator.IsPlayerPawn() )
			{
				A = EventInstigator;
				if ( A.bInterpolating )
					return;
			}
			else
				return;
		}
		else
		{
			ForEach DynamicActors( class'Actor', A, InterpolatedActorTag )
				break;
			if ( (A == None) || A.bInterpolating )
				return;
			if ( bViewTargetInterpolatedActor && EventInstigator.IsHumanControlled() )
			{
				PlayerController(EventInstigator.Controller).SetViewTarget(A);
				PlayerController(EventInstigator.Controller).bBehindView = bThirdPersonViewTarget;
			}				
		}
	}
}

defaultproperties
{
	bPlayerJumpToInterpolation=true
	Texture=Texture'Legend.S_SpecialEvent'
     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:40.000 - Creation time: sk 3-1-2016 10:48:41.800 - Created with UnCodeX