class HXEnergy expands XEnergy;

#exec TEXTURE IMPORT NAME=HXEnergy FILE=CORONAS\HXEnergy.bmp GROUP=Coronas FLAGS=2
#exec AUDIO IMPORT NAME="Cybot_HX_Special" FILE=SOUNDS\Cybot_HX_Special.wav GROUP="Cybot"

simulated function Timer()
{
local Pawn P;

	Super.Timer();

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

function CheckPawn( pawn P)
{

	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 && TeamGamePlus(Level.Game) == None)
			return;

	if ((Level.Game.IsA('MonsterHunt') && Class'NWMutator'.Default.EnableMonsterHuntMode && Class'NWMutator'.Default.MonsterHuntOnly) || (Class'NWMutator'.Default.EnableMonsterHuntMode && !Class'NWMutator'.Default.MonsterHuntOnly))
	{
		if (P.Health > 0 && P.Health < Class'NWMutator'.default.MaxHealth)
		{
			P.Health += 60;
			MakeSound();
		}
		if (P.Health > Class'NWMutator'.default.MaxHealth)
			P.Health = Class'NWMutator'.default.MaxHealth;
	}
	else
	{
		if (P.Health > 0 && P.Health < 350)
		{
			P.Health += 30;
			MakeSound();
		}
		if (P.Health > 350)
			P.Health = 350;
	}
}


defaultproperties
{
	Texture=HXEnergy
	EffectRefreshTime=1.000000
	bTimedEffect=True
	EffectSound=Cybot_HX_Special
	EnergyParticlesType=Class'BlueRParticles'
}
