class GSSALGun extends Weapon;

//This gun charges by proximity: To gain ammo, just be near another player. This is intended to encourage team play: Those who go off on their own will soon run out, but fighting in formation keeps the charge going.


#exec TEXTURE IMPORT FILE="Textures\GSSALSkin.dds" NAME="GSSALSkin"

var float timecount;

simulated function Tick(float Deltatime){
	local GSSALGun OtherGun;
if(Level.NetMode!=NM_CLIENT){
  timecount+=deltatime;
    if(timecount>=1){
      timecount=timecount-1;
      if(AmmoCharge[0]<989)
        foreach AllActors(Class'GSSALGun', OtherGun)
          if((OtherGun != Self) && (VSize(Owner.Location - OtherGun.Owner.Location) < 1024)
          && pawn(othergun.owner).getteamnum() == pawn(owner).getteamnum() && pawn(othergun.owner).getteamnum() != 255){
            AmmoCharge[0]+=5;
            spawn(class'ChargeLightningBolt',Owner,,OtherGun.Owner.Location);
          }
    }
  }
  Super.Tick(DeltaTime);
}

function byte BestMode()
{
	return 0;
}

defaultproperties
{
     FireModeClass(0)=Class'GSSAL.GSSALFire'
     FireModeClass(1)=Class'GSSAL.GSSALAltFire'
     SelectAnim="Pickup"
     PutDownAnim="PutDown"
     SelectAnimRate=1.250000
     BringUpTime=0.360000
     SelectSound=Sound'WeaponSounds.LightningGun.SwitchToLightningGun'
     SelectForce="SwitchToLightningGun"
     CurrentRating=0.690000
     Description="At last, the dream is realised: The GS-SAL, or Gun That Shots Shurikens and Lightning! This gun is insanely powerful, intended for use only in Invasion mode or as a superweapon. Primary for a short-range burst of lightning, secondary for spinning discs of metal. Charging is by cooperative regeneration: Stand near to an ally with the gun and both will charge."
     EffectOffset=(X=100.000000,Y=28.000000,Z=-26.000000)
     DisplayFOV=60.000000
     Priority=7
     HudColor=(B=255,G=170,R=185)
     SmallViewOffset=(X=8.000000,Y=6.300000,Z=-4.000000)
     SmallEffectOffset=(X=92.000000,Y=32.000000,Z=-35.000000)
     CenteredOffsetY=0.000000
     CenteredYaw=-500
     CustomCrossHairColor=(G=170,R=185)
     MinReloadPct=0.250000
     InventoryGroup=4
     PlayerViewOffset=(Y=2.300000)
     BobDamping=2.300000
     AttachmentClass=Class'XWeapons.SniperAttachment'
     IconMaterial=Texture'HUDContent.Generic.HUD'
     IconCoords=(X1=246,Y1=182,X2=331,Y2=210)
     ItemName="GS-SAL"
     Mesh=SkeletalMesh'Weapons.Sniper_1st'
     DrawScale=0.400000
     Skins(0)=Texture'GSSAL.GSSALSkin'
}
