class DefenceAssaultFire extends AssaultFire;

function zappawn(Pawn Victim, Vector HitLocation){
  local ProjectileShooter Shooter;
  ForEach Victim.RadiusActors( class 'ProjectileShooter', Shooter, 1024, Victim.Location ){
    if(Shooter.Charge>3){
      Spawn(class'MiniLightningBolt',,,HitLocation).mSpawnVecA = Shooter.Location+Vect(0,0,128);
      Victim.TakeDamage(15, Instigator, HitLocation, Vect(0,0,0), DamageType);
      Shooter.Charge-=3;
    }
  }


}

function DoTrace(Vector Start, Rotator Dir)
{
    local Vector X, End, HitLocation, HitNormal;
    local Actor Other;
    local int Damage;

	MaxRange();

//        bDoReflect = false;
        X = Vector(Dir);
        End = Start + TraceRange * X;

        Other = Weapon.Trace(HitLocation, HitNormal, End, Start, true);

        if (Other.IsA('Pawn')){
          zapPawn(Pawn(Other), HitLocation);
        }

        if ( Other != None && (Other != Instigator))
        {

            if ( !Other.bWorldGeometry )
            {
				Damage = DamageMin;
				if ( (DamageMin != DamageMax) && (FRand() > 0.5) )
					Damage += Rand(1 + DamageMax - DamageMin);
                Damage = Damage * DamageAtten;

				// Update hit effect except for pawns (blood) other than vehicles.
               	if ( Other.IsA('Vehicle') || (!Other.IsA('Pawn') && !Other.IsA('HitScanBlockingVolume')) )
					WeaponAttachment(Weapon.ThirdPersonActor).UpdateHit(Other, HitLocation, HitNormal);

               	Other.TakeDamage(Damage, Instigator, HitLocation, Momentum*X, DamageType);


                HitNormal = Vect(0,0,0);
            }
            else if ( WeaponAttachment(Weapon.ThirdPersonActor) != None )
				WeaponAttachment(Weapon.ThirdPersonActor).UpdateHit(Other,HitLocation,HitNormal);
        }
        else
        {
            HitLocation = End;
            HitNormal = Vect(0,0,0);
			WeaponAttachment(Weapon.ThirdPersonActor).UpdateHit(Other,HitLocation,HitNormal);
        }

//        SpawnBeamEffect(Start, Dir, HitLocation, HitNormal, ReflectNum);

}

defaultproperties
{
}
