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

Gameplay.SpawnArray


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
//
// SpawnArray class.
//
// Triggers an effect event when a player spawns.
//
class SpawnArray extends BaseDevice;

var() Name spawnAnimation						"The name of the animation to play when a player spawns.";
var(Effectevents) Name spawnedEffectEvent		"The name of the effect event to trigger when a player spawns.";
var() float useableObjectCollisionHeight;
var() float useableObjectCollisionRadius;
var() class<SpawnArrayUseableObject>	accessClass		"Access class to use";
var() float minimumTimeBetweenSpawnEffects		"The number of seconds that must pass before repeated spawn effects will play.";

var bool bSpawnEffect;
var bool bLocalSpawnEffect;
var SpawnArrayUseableObject access;
var localized string cantUseSpawnTowerMessage;
var float lastSpawnEffectTime;

replication
{
	reliable if (Role == ROLE_Authority)
		bSpawnEffect;
}

function PostBeginPlay()
{
	access = Spawn(accessClass, self,, Location, Rotation);

	access.SetCollisionSize(useableObjectCollisionRadius, useableObjectCollisionHeight);

	// Update useable points array
	UseablePoints[0] = access.GetUseablePoint();
	UseablePointsValid[0] = UP_Valid;
}

function Destroyed()
{
	Super.Destroyed();

	if (access != None)
		access.Destroy();
}

//
// Called when a player spawns
//
function PlayerSpawned()
{
	bSpawnEffect = !bSpawnEffect;
	playSpawnEffects();
}

simulated function PostNetReceive()
{
	Super.PostNetReceive();

	if (bLocalSpawnEffect != bSpawnEffect)
	{
		bLocalSpawnEffect = bSpawnEffect;
		playSpawnEffects();
	}
}

simulated function playSpawnEffects()
{
	PlayAnim(spawnAnimation);
	TriggerEffectEvent(spawnedEffectEvent,,,,,,,,team().Class.Name);
}

function use(Pawn user)
{
	// Allow user to teleport to any other spawn array
	// Eventually this should allow you to keep your equipment.  For now, just display the
	// respawn screen.
	// Don't allow players who are carrying carryables to use the spawn array
	if (Character(user) != None && Character(user).numDroppableCarryables() == 0)
	{
		PlayerCharacterController(user.Controller).SelectTeleport();
	}
	else
	{
		// Should display a prompt message if the player can't use it.  This should be implemented the
		// same way as all other prompts (which aren't yet implemented?)
		// For now just send a message
		user.ClientMessage(cantUseSpawnTowerMessage);
	}
}

defaultproperties
{
	Mesh			= SkeletalMesh'BaseObjects.SpawnTower'
	DrawType		= DT_Mesh
	bNetNotify		= true
	useableObjectCollisionHeight	= 150
	useableObjectCollisionRadius	= 300
	accessClass	= class'Gameplay.SpawnArrayUseableObject'
	cantUseSpawnTowerMessage = "You can't use a spawn tower while carrying a game object."
	bAlwaysRelevant = true
	NetPriority		= 0.5

	spawnAnimation	 = SpawnTower
	spawnedEffectEvent = PlayerSpawned
	bCanBeDamaged	= false
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: ne 5.9.2004 15:53:24.000 - Creation time: st 23.5.2018 00:10:47.205 - Created with UnCodeX