class ProjectileShooter extends Actor;


var int charge;
Simulated Function PostBeginPlay()
{
	SetTimer(0.2,true);
}

Simulated Function Timer(){
	local Projectile GoBoom;
	if(charge<100)
	  charge++;
	if(charge>3){
	  foreach VisibleCollidingActors( class 'Projectile', GoBoom, 1024, Location ){
                if(!GoBoom.IsA('DefenceGrenade') &&(VSize(GoBoom.Location-Location)>VSize((GoBoom.Location+(GoBoom.Velocity*0.03))-Location))){
	        	Spawn(class'MiniLightningBolt',,,GoBoom.Location).mSpawnVecA = Location+Vect(0,0,128);
			GoBoom.Explode(GoBoom.Location,Vect(0,0,0));
			charge-=3;
	  		return;
                }
	  }
	}

}

event TakeDamage(int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType){
  if(Damage>60){
    Spawn(class'BrokenProjectileShooter',,,Location,Rotation);
    destroy();
  }
}

defaultproperties
{
     DrawType=DT_StaticMesh
     StaticMesh=StaticMesh'AW-2004Crystals.Crops.CrystalSpire1'
     Physics=PHYS_Falling
     RemoteRole=ROLE_SimulatedProxy
     CollisionRadius=32.000000
     CollisionHeight=4.000000
     bCollideActors=True
     bCollideWorld=True
     bAutoAlignToTerrain=True
}
