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

ROEngine.ROSpawnArea


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
00123
00124
00125
00126
00127
00128
00129
//=============================================================================
// ROSpawnArea
//=============================================================================
// Defines an area where players can spawn
//=============================================================================
// Red Orchestra Source
// Copyright (C) 2003-2004 Erik Christensen
//=============================================================================

class ROSpawnArea extends Actor
	placeable;

//=============================================================================
// Variables
//=============================================================================

var()	bool		bInitiallyActive;          // True if the spawn is enabled when play starts
var()	bool		bAxisSpawn;			       // Axiss can use this spawn
var()	bool		bAlliesSpawn;			   // Soviets can use this spawn
var()	int		AxisPrecedence;			       // Used to decide which spawn area gets priority over the others (Larger numbers increase precendence, 0 = starting spawn area)
var()	int		AlliesPrecedence;
var()	array<int>	AxisRequiredObjectives;    // A list of the objective numbers for each objective that must be complete to use this spawn area
var()	array<int>	AlliesRequiredObjectives;
var()	array<int>	NeutralRequiredObjectives;

var()	name		VolumeTag;			       // Volume that defines the shape of this spawn area
var()	int		SpawnProtectionTime;		   // Time in seconds that players inside here are invincible after spawning
var()   bool	bTankCrewSpawnArea;            // This spawn area is used exclusively for tank crewmen
var()   bool	bIncludeNeutralObjectives;     // Used in conjunction with TeamMustLoseAllRequired. Will check to see if there are any neutral objectives in the NeutralRequiredObjectives array for spawning not just owned objectives

var	Volume		AttachedVolume;
var	bool		bEnabled;

enum ETeamMustLoseAllRequired
{
	SPN_Neutral,
	SPN_Axis,
	SPN_Allies,
};

var()	ETeamMustLoseAllRequired	TeamMustLoseAllRequired;  // This team must lose all required obj to be moved back

//=============================================================================
// Functions
//=============================================================================

//-----------------------------------------------------------------------------
// PostBeginPlay - Tell the game info about this spawn area and find the volume
//-----------------------------------------------------------------------------

function PostBeginPlay()
{
	if (ROTeamGame(Level.Game) != None)
	{
		if (bTankCrewSpawnArea)
			ROTeamGame(Level.Game).TankCrewSpawnAreas[ROTeamGame(Level.Game).TankCrewSpawnAreas.Length] = self;
		else
			ROTeamGame(Level.Game).SpawnAreas[ROTeamGame(Level.Game).SpawnAreas.Length] = self;
	}

	if (VolumeTag != '')
	{
		foreach AllActors(class'Volume', AttachedVolume, VolumeTag)
		{
			AttachedVolume.AssociatedActor = self;
			break;
		}
	}

	Disable('Trigger');
}

//-----------------------------------------------------------------------------
// PreventDamage - Returns true if this player should not be damaged at all
//-----------------------------------------------------------------------------

function bool PreventDamage(Pawn Other)
{
	if( ((Level.TimeSeconds - Other.SpawnTime) < SpawnProtectionTime) && AttachedVolume != none && AttachedVolume.Encompasses(Other) )
	{
		return true;
	}

	return false;
}

//-----------------------------------------------------------------------------
// Trigger - Allows a disabled spawn area to become enabled
//-----------------------------------------------------------------------------

function Trigger(Actor Other, Pawn EventInstigator)
{
    bEnabled = true;
	Disable('Trigger');

	if (ROTeamGame(Level.Game) != None)
	{
		if (bTankCrewSpawnArea)
			ROTeamGame(Level.Game).CheckTankCrewSpawnAreas();
		else
			ROTeamGame(Level.Game).CheckSpawnAreas();

		ROTeamGame(Level.Game).CheckVehicleFactories();
	}
}

//-----------------------------------------------------------------------------
// Reset - Set enabled state to default
//-----------------------------------------------------------------------------

function Reset()
{
	bEnabled = bInitiallyActive;

	if (!bEnabled)
		Enable('Trigger');
}

//=============================================================================
// defaultpropeties
//=============================================================================

defaultproperties
{
     bInitiallyActive=True
     bHidden=True
     RemoteRole=ROLE_None
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fri 13-10-2023 03:17:28.000 - Creation time: Fri 13-10-2023 03:19:07.431 - Created with UnCodeX