SpatialFear.SFGoalTrigger

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
//=============================================================================
// Spatial Fear
// Class: SFGoalTrigger
// Description: Trigger subclass, that allows to set or reset an entry in the
//		goaltable. The trigger functions as a normal trigger, so can
//		use the normal event if you like to.
//
//
// Author: Markus Nuebel
//=============================================================================

class SFGoalTrigger extends Trigger;

// Flag for set reset
var enum EnuGTAction
{
	ACTION_SET,
	ACTION_RESET,
} GoaltableAction;


var (SpatialFear) EnuGTAction	Action; // Flag to indicate if the specified goal has to be set or reset upon a trigger action. Default: ACTION_SET
var (SpatialFear) int			Index;  // Index into goaltable. Specifies which goal to set or to reset. Please contact Doug to get a range of goaltable indices assigned to you.

// Called when something touches the trigger.
function Touch( actor Other )
{
	local SFPlayer	oPlayer;
	
	// Call to base class
	Super.Touch(Other);
	
	// Check if trigger was hit be SFPlayer
	oPlayer	= SFPlayer(Other);
	if(None != oPlayer)
	{
		// Set or Reset ?
		switch(Action)
		{
			case ACTION_SET:
			oPlayer.SFSetGoal(Index);
			break;
			case ACTION_RESET:
			oPlayer.SFResetGoal(Index);
			break;
		}
	}
	
}

defaultproperties
{
}

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