class TXEnergy expands XEnergy;

#exec TEXTURE IMPORT NAME=TXEnergy FILE=CORONAS\TXEnergy.bmp GROUP=Coronas FLAGS=2

var() texture ProjFX01[4], ProjFX02[4];

simulated function Timer()
{
local Pawn P;

	Super.Timer();

	ForEach VisibleCollidingActors(Class'Pawn', P, 2048.0)
		CheckPawn(P);
}

function CheckPawn( pawn P)
{
local ZY_Proj zyp;

	if (Level.Game.IsA('DeathMatchPlus'))
	{
		If (TeamGamePlus(Level.Game)!= None && !Level.Game.IsA('MonsterHunt'))
		{
			If (P.PlayerReplicationInfo.Team == Instigator.PlayerReplicationInfo.Team || P==Instigator)
				return;
		}
		else if (!P.IsA('ScriptedPawn') && Level.Game.IsA('MonsterHunt'))
			return;
		else if (P == Instigator)
			return;
	}
	else
	{
		if (P == Instigator)
			return;
		else if (P.IsA('ScriptedPawn') && Instigator.IsA('ScriptedPawn'))
		{
			if (ScriptedPawn(P).TeamTag == ScriptedPawn(Instigator).TeamTag && ScriptedPawn(P).TeamTag != '')
				return;
		}
		else if (Instigator.IsA('PlayerPawn') && (P.AttitudeToPlayer == ATTITUDE_Friendly || P.AttitudeToPlayer == ATTITUDE_Follow))
			return;
	}

	zyp = Spawn(Class'ZY_Proj',,,, rotator(P.Location - Location));

	if (Class'NWMutator'.default.bCybotID_InTeamGames && Level.Game.IsA('TeamGamePlus') && !Level.Game.IsA('MonsterHunt'))
	{
		zyp.MultiSkins[0] = ProjFX01[Instigator.PlayerReplicationInfo.Team];
		zyp.MultiSkins[1] = ProjFX02[Instigator.PlayerReplicationInfo.Team];
	}
		
	MakeSound();
}


defaultproperties
{
	Texture=TXEnergy
	EffectRefreshTime=0.200000
	bTimedEffect=True
	EffectSound=Cybot_ZYFire
	EnergyParticlesType=Class'YellowRParticles'
	ProjFX01(0)=Texture'UnrealShare.Effect1.FireEffect1p'
	ProjFX01(1)=Texture'UnrealShare.Effect1.FireEffect1u'
	ProjFX01(2)=Texture'UnrealShare.Effect1.FireEffect1a'
	ProjFX01(3)=Texture'UnrealShare.Effect1.FireEffect1e'
	ProjFX02(0)=Texture'UnrealShare.Effect1.FireEffect1ob'
	ProjFX02(1)=Texture'UnrealShare.Effect1.FireEffect1t'
	ProjFX02(2)=Texture'UnrealShare.Effect1.FireEffect1'
	ProjFX02(3)=Texture'UnrealShare.Effect1.FireEffect1d'
}
