ACTOR Longinus : Weapon replaces RocketLauncher 25006
{
   Inventory.PickupMessage "You got the FY-2014m 'Longinus' Sniper Rifle!"
   Inventory.PickupSound "misc/w_pkup"
   Weapon.UpSound "Weapons/SniperUp"
   Tag "FY-2014m Longinus"
   Weapon.AmmoGive 0
   Weapon.AmmoGive2 6 //Comes with six rounds :D go fuck shit up!
   Weapon.Slotnumber 5
   weapon.ammotype "SniperShells"
   Weapon.AmmoType2 "Sniper_Reserve"
   Weapon.AmmoUse 1
   Weapon.Kickback 70
   weapon.bobstyle inversesmooth
   weapon.bobrangeX 0.4
   weapon.bobrangeY 0.6
   weapon.bobspeed 2.5
   obituary "%o got %p head removed by %k's FY-2014m"
   decal None
   +WEAPON.AMMO_OPTIONAL
   +WEAPON.ALT_AMMO_OPTIONAL
   +WEAPON.Alt_Uses_Both
   +NOAUTOFIRE
   +NOALERT
   +NOAUTOAIM
   States
   {
   Spawn:
      LONG X -1
      LOOP
   Ready:
      LONG A 0 A_JumpIfInventory("Zoomed",1,"ReadyZoomed")
      SNPG A 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_AllowZoom)
      Goto Ready  
   ReadyZoomed:
      RSCP A 1 bright A_WeaponReady(WRF_NOBOB)
      Loop
   Deselect:
      TNT1 A 0 SetPlayerProperty(0,1,2)
	  TNT1 A 0 A_ZoomFactor(1.00)
	  TNT1 A 0 A_SetCrosshair(1)
      TNT1 A 0 A_TakeInventory("Zoomed",3)
	  TNT1 A 0 A_PlaySound("Weapons/SniperPull",26,1.0)
	  SNPS ABCDE 1
	  Goto DeselectLoop
   DeselectLoop:
      TNT1 A 1 A_Lower
      Loop
  Select:
      D3SG A 0 A_JumpIfInventory("LonginusFirstTime",1,1)
	  goto Select2
	  TNT1 A 0 A_PlaySoundEx("Weapons/LonginusFirst","WeaponPickedUp",0,0)
      TNT1 A 0 SetPlayerProperty(0,0,2)
	  TNT1 A 0 A_SetCrosshair(8)
	  SNPS EDCBA 1
	  TNT1 A 0 A_TakeInventory("LonginusFirstTime",1)
      Goto SelectLoop
	Select2:
      TNT1 A 0 SetPlayerProperty(0,0,2)
	  TNT1 A 0 A_SetCrosshair(8)
      SNPS EDCBA 1
      Goto SelectLoop
   SelectLoop:
      SNPG A 1 A_Raise
	  loop
   Fire:
	  TNT1 A 0 A_JumpIfInventory("SniperToken", 1, "FireExp")
   FireNorm: //Primary : 14.5x118mm A.P. Shell
	  TNT1 A 0 A_JumpIfInventory("SniperShells",1,1)
	  goto Dryfire
      TNT1 A 0 A_AlertMonsters
      TNT1 A 0 A_JumpIfInventory("Zoomed",1,"FireZoomedNorm")
	  TNT1 A 0 A_PlaySound("Weapons/SniperFire",95,0.99,0,1)
      TNT1 A 0 A_PlaySound("Weapons/SniperAdd",96,0.88,0,1)
	  TNT1 A 0 A_SpawnItem("Lightprojectile",0,0,0,0)
	  TNT1 A 0 A_RailAttack(0, 4, 1, none, none, RGF_FULLBRIGHT|RGF_SILENT|RGF_NOPIERCING, 0, none, 0, 0, 32767, 0, 1.0, 0,"gausssmoke_spawner")
      TNT1 AAAAAAAAAA 0 A_FireCustomMissile("gausssmoke_spawner2",0,0,3,4,0)		
	  LONF A 0 A_FireCustomMissile("P_Longinus_Tracer", 0, 0, 0, 4)
	  SNPF AB 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  TNT1 A 0 A_SetPitch(pitch - 6.0)
      SNPF C 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  TNT1 A 0 A_SetPitch(pitch - 6.0)
	  SNPF D 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  SNPF E 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  SNPG A 17 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
      Goto Ready
   FireExp: //Primary : 14.5x118mm H.E.A.P. Shell
      TNT1 A 0 A_JumpIfInventory("SniperShells",1,1)
	  goto Dryfire
	  TNT1 A 0 A_TakeInventory("SniperToken",1)
      TNT1 A 0 A_AlertMonsters
      TNT1 A 0 A_JumpIfInventory("Zoomed",1,"FireZoomedExp")
	  TNT1 A 0 A_PlaySound("Weapons/SniperFire",95,0.99,0,1)
      TNT1 A 0 A_PlaySound("Weapons/SniperAdd",96,0.88,0,1)
	  TNT1 A 0 A_SpawnItem("Lightprojectile",0,0,0,0)
	  TNT1 A 0 A_RailAttack(0, 4, 1, none, none, RGF_FULLBRIGHT|RGF_SILENT|RGF_NOPIERCING, 0, none, 0, 0, 32767, 0, 1.0, 0,"gausssmoke_spawner")
      TNT1 AAAAAAAAAA 0 A_FireCustomMissile("gausssmoke_spawner2",0,0,3,4,0)		
	  LONF A 0 A_FireCustomMissile("Tank_Shot", 0, 0, 0, 4)
	  SNPF AB 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  TNT1 A 0 A_SetPitch(pitch - 6.0)
      SNPF C 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  TNT1 A 0 A_SetPitch(pitch - 6.0)
	  SNPF D 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  SNPF E 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  SNPG A 17 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
      Goto Ready
   FireZoomedNorm: //Secondary : Scoped 14.5x118mm A.P. Shell
	  TNT1 A 0 A_JumpIfInventory("SniperShells",1,1)
	  goto Dryfire
      TNT1 A 0 A_AlertMonsters
	  TNT1 A 0 A_PlaySound("Weapons/SniperFire",95,0.99,0,1)
      TNT1 A 0 A_PlaySound("Weapons/SniperAdd",96,0.88,0,1)
	  RSCP A 0 A_SpawnItem("Lightprojectile",0,0,0,0)
	  RSCP A 0 A_RailAttack(0, 0, 1, none, none, RGF_FULLBRIGHT|RGF_SILENT|RGF_NOPIERCING, 0, none, 0, 0, 32767, 0, 1.0, 0,"gausssmoke_spawner")
      TNT1 AAAAAAAAAA 0 A_FireCustomMissile("gausssmoke_spawner2",0,0,0,4,0)
	  RSCP A 0 A_FireCustomMissile("P_Longinus_Tracer", 0, 0, 0, 4)
	  RSCP AA 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  TNT1 A 0 A_SetPitch(pitch - 2.5)
      RSCP A 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  TNT1 A 0 A_SetPitch(pitch - 1.5)
	  RSCP A 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  RSCP A 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  RSCP A 17 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
      Goto ReadyZoomed
   FireZoomedExp: //Secondary : Scoped 14.5x118mm H.E.A.P. Shell
	  TNT1 A 0 A_JumpIfInventory("SniperShells",1,1)
	  goto Dryfire
      TNT1 A 0 A_AlertMonsters
	  TNT1 A 0 A_PlaySound("Weapons/SniperFire",95,0.99,0,1)
      TNT1 A 0 A_PlaySound("Weapons/SniperAdd",96,0.88,0,1)
	  RSCP A 0 A_SpawnItem("Lightprojectile",0,0,0,0)
	  RSCP A 0 A_RailAttack(0, 0, 1, none, none, RGF_FULLBRIGHT|RGF_SILENT|RGF_NOPIERCING, 0, none, 0, 0, 32767, 0, 1.0, 0,"gausssmoke_spawner")
      TNT1 AAAAAAAAAA 0 A_FireCustomMissile("gausssmoke_spawner2",0,0,0,4,0)
	  RSCP A 0 A_FireCustomMissile("Tank_Shot", 0, 0, 0, 4)
	  RSCP AA 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  TNT1 A 0 A_SetPitch(pitch - 2.5)
      RSCP A 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  TNT1 A 0 A_SetPitch(pitch - 1.5)
	  RSCP A 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  RSCP A 1 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
	  RSCP A 17 bright A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
      Goto ReadyZoomed
   DryFire:
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"DryFireZoomed")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_PlaySound("Sniper/Empty",199,1.0,0,1)
		SNPG A 5 A_WeaponReady(WRF_NOFIRE)
		Goto Ready
   DryFireZoomed:
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_PlaySound("Sniper/Empty",199,1.0,0,1)
		RSCP A 5 bright A_WeaponReady(WRF_NOFIRE)
		Goto ReadyZoomed
  AltFire: //Zoom In/Out
	  SGZI A 0 A_JumpIfInventory("Zoomed",1,"ZoomOut") // If we're at zoom level 1, go to zoom level 2.
	  SNPG A 1 A_WeaponReady(WRF_NOBOB)
	  SNPX ABCDE 1 A_WeaponReady(WRF_NOBOB)
	  Goto ZoomIn1
  ZoomIn1: //4x Zoom
      TNT1 A 0 A_SetCrosshair(1)
      TNT1 A 0 A_PlaySound("ZOOMIN",97,1.0,0,1)
      TNT1 A 0 A_ZoomFactor(6.0)
	  TNT1 A 0 A_GiveInventory("Zoomed",1) // Increase the "zoom level".
	Goto ReadyZoomed
  ZoomOut:
      SGZI A 0 A_PlaySound("ZOOMOUT",98,1.0,0,1)
      SGZI A 0 A_ZoomFactor(1.0)
	  SGZI A 0 A_TakeInventory("Zoomed",3) // Take all three of our "zoom levels".
	  Goto PreReady
  PreReady:
      TNT1 A 0 A_SetCrosshair(8)
	  SNPX EDCBA 1 A_WeaponReady(WRF_NOBOB)
	  SNPG A 1 A_WeaponReady(WRF_NOFIRE)
	  Goto Ready
  Reload:
	ReloadBegin:
		TNT1 A 0 A_JumpIfInventory("SniperShells",1,"Ready")
		TNT1 A 0 A_JumpIfInventory("Sniper_Reserve",1,1)
		Goto DryFire
		TNT1 A 0 A_PlaySound("Weapons/SniperSequence1",99,1.0,0,1)
		SNPG ABCDEF 1 A_WeaponReady(WRF_NOFIRE)
		//TNT1 A 0 A_PlaySound("Weapons/SniperMagOut1",95,0.75,0,0)
		SNPG GHIJKL 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_FireCustomMissile("TRifle_CasingSpawner", -5, 0, 0, 0)
		SNPG MNOPQR 2 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_PlaySound("Weapons/SniperSequence2",100,1.0,0,1)
		SNPG S 2 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_PlaySound("Weapons/SniperSequence3",101,1.0,0,1)
		SNPR AB 2 A_WeaponReady(WRF_NOFIRE)
		//TNT1 A 0 A_PlaySound("Weapons/SniperMagOut2",97,0.75,0,0)
		SNPR CDEF 1 A_WeaponReady(WRF_NOFIRE)
		SNPR GHI 1 A_WeaponReady(WRF_NOFIRE)
	ReloadWork:
		ATPR G 0 A_TakeInventory("Sniper_Reserve",1)
		ATPR G 0 A_GiveInventory("SniperShells",1)
		ATPR G 0 A_JumpIfInventory("SniperShells",1,"ReloadFinish")
		ATPR G 0 A_JumpIfInventory("Sniper_Reserve",1,"ReloadWork")
	ReloadFinish:
		SNPR JKLMNOPQ 1 A_WeaponReady(WRF_NOFIRE)
		SNPC ABC 2 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_PlaySound("Weapons/SniperSequence4",102,1.0,0,1)
		SNPC DEFG 1 A_WeaponReady(WRF_NOFIRE)
		SNPC HIJKL 1 A_WeaponReady(WRF_NOFIRE)
		SNPG FEDCB 1 A_WeaponReady(WRF_NOFIRE)
		SNPG A 5 A_WeaponReady(WRF_NOFIRE)
		Goto Ready
	Zoom:
	ReloadBegin_Exp:
		TNT1 A 0 A_JumpIfInventory("SniperShells",1,"Ready")
		TNT1 A 0 A_JumpIfInventory("Sniper_Reserve",1,1)
		Goto DryFire
		TNT1 A 0 A_PlaySound("Weapons/SniperSequence1",99,1.0,0,1)
		SNPG ABCDEF 1 A_WeaponReady(WRF_NOFIRE)
		//TNT1 A 0 A_PlaySound("Weapons/SniperMagOut1",95,0.75,0,0)
		SNPG GHIJKL 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_FireCustomMissile("TRifle_CasingSpawner", -5, 0, 0, 0)
		SNPG MNOPQR 2 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_PlaySound("Weapons/SniperSequence2",100,1.0,0,1)
		SNPG S 2 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_PlaySound("Weapons/SniperSequence3",101,1.0,0,1)
		SNPR AB 2 A_WeaponReady(WRF_NOFIRE)
		//TNT1 A 0 A_PlaySound("Weapons/SniperMagOut2",97,0.75,0,0)
		SNPR CDEF 1 A_WeaponReady(WRF_NOFIRE)
		SNPR GHI 1 A_WeaponReady(WRF_NOFIRE)
	ReloadWork_Exp:
		ATPR G 0 A_TakeInventory("Sniper_Reserve",1)
		ATPR G 0 A_GiveInventory("SniperShells",1)
		ATPR G 0 A_JumpIfInventory("SniperShells",1,"ReloadFinish_Exp")
		ATPR G 0 A_JumpIfInventory("Sniper_Reserve",1,"ReloadWork_Exp")
	ReloadFinish_Exp:
		SNPR JKLMNOPQ 1 A_WeaponReady(WRF_NOFIRE)
		SNPC ABC 2 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_PlaySound("Weapons/SniperSequence4",102,1.0,0,1)
		SNPC DEFG 1 A_WeaponReady(WRF_NOFIRE)
		SNPC HIJKL 1 A_WeaponReady(WRF_NOFIRE)
		SNPG FEDCB 1 A_WeaponReady(WRF_NOFIRE)
		SNPG A 5 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_GiveInventory("SniperToken",1)
		Goto Ready
  }
}

ACTOR SniperToken : Inventory {Inventory.MaxAmount 1}

ACTOR LonginusFirstTime : Inventory {Inventory.MaxAmount 1 Inventory.InterHubAmount 1}

ACTOR Zoomed : Inventory
{
Inventory.MaxAmount 1 // 3, since the gun has 3 zoom levels.
}

ACTOR SniperShells : Ammo
{
  Inventory.PickupMessage "You shouldn't see this!"
  Inventory.Amount 0
  Inventory.MaxAmount 1
  Ammo.BackpackAmount 0
  Ammo.BackpackMaxAmount 1
  States
  {
  Spawn:
    TNT1 A -1
    Stop
  }
}

actor Sniper_Reserve : ammo 26104 {
  radius 16
  height 8
  scale 0.055
  inventory.pickupmessage "Picked up a 14.5x118mm H.E.A.P Cartridge for the FY-2014m 'Longinus'"
  inventory.pickupsound "Weapons/SniperMagOut2"
  inventory.amount 1
  inventory.maxamount 10
  ammo.backpackamount 6
  ammo.backpackmaxamount 20
  states
  {
  Spawn:
    GSLX A -1
    stop
  }
}

actor Sniper_Box : Sniper_Reserve 26105 {
  radius 16
  height 8
  scale 0.093
  inventory.pickupmessage "Picked up a supply case of six 14.5x118mm H.E.A.P. Cartridges for the FY-2014m 'Longinus'"
  inventory.pickupsound "Weapons/SniperMagIn1"
  inventory.amount 6

  states
  {
  Spawn:
    GSLB A -1
    stop
  }
}

ACTOR TRifle_CasingSpawner
{
    Radius 1
    Height 1
    Speed 18
    PROJECTILE
    States
    {
    Spawn:
        TNT1 A 1
        TNT1 A 0 A_Die
        Goto Death
    Death:
        TNT1 A 0 A_CustomMissile("trifle_casing",-2,10,random(-110,-130),2,random(8,-8)) 
        Stop
    }
}

ACTOR TRifle_Casing
{
   Radius 2
   Height 4
   Speed 8
   Scale 0.28
   BounceSound "Weapons/HeavyCasing"
   PROJECTILE
   -NOGRAVITY
   +BOUNCEONACTORS
   +BOUNCEONCEILINGS
   +DONTSPLASH
   +CLIENTSIDEONLY
   Gravity 0.75
   BounceType Doom
   BounceCount 6
   BounceFactor 0.6
   DamageType Nope
   States
   {
   Spawn:
	  ARBC A 0
      ARBC ABCDEF 1
      Goto Roflcopter
   Roflcopter:
      ARBC A 0 A_Jump(128,1,3,5,7)
      ARBC ABCDEF 1
      Loop
   Death:
      ARBC A 0 A_SpawnItemEx("TRifle_Casing_Liedown")
      stop
   }
}

actor TRifle_Casing_Liedown
{
	-NOGRAVITY
    Scale 0.28
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 0 A_Jump(255,"Spawn1","Spawn2","Spawn3")
	  stop
	Spawn1:
	  ARBC A 1
	  Goto Ded
	Spawn2:
	  ARBC D 1
	  Goto Ded
	Spawn3:
	  ARBC C 1
	  Goto Ded
	Ded:
	  "####" "#" 210 A_CheckSight("Fadying")
	  Loop
	Fadying:
	  "####" "#" 1 A_FadeOut(0.1)
	  Wait
   }
}

actor Tank_Shot : fastprojectile{
	radius 2
	height 2
	scale 0.22
	mass 20
	PROJECTILE
	speed 4000 //practically hitscan...
	Damage (250+(10*random(0,10)))
	+EXTREMEDEATH
	+NOTIMEFREEZE
	renderstyle add
	damagetype "Boss"
	MissileHeight 8
	deathsound "sfx/sboom1"
	decal "Scorch"
	
	states {
		spawn:
			LEYS O 1
			loop
		death:
		    TNT1 AA 0 A_PlaySound("sfx/sboom")
		    TNT1 A 0 A_Explode (255 ,128) //sv_crowdcontrollweap 0
			TNT1 A 1 A_SpawnItemEx("gshot_impactspawner",0,0,0,0,0,0)
			TNT1 A 0 
			stop					 
	}
}

actor gshot_impactspawner {
	+NOINTERACTION
	+NOTIMEFREEZE
	states{
		spawn:
		    TNT1 AA 0 A_PlaySound("sfx/sboom")
			TNT1 A 0 A_SpawnItemEx("gshot_flash",0,0,0, 0,0,0)
			TNT1 AA 0 A_SpawnItemEx("gshot_puff",0,0,0, 0,frandom(-0.6,0.6),frandom(-0.6,0.6))
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx ("gshot_spark", 0, 0, 0, random(1,3), random(4,6) , random(0,6) , random(180,360), 0)
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx ("gshot_spark2", 0, 0, 0, random(1,3), random(4,6) , random(0,6) , random(180,360), 0)
			TNT1 AAA 0 A_SpawnItemEx ("gpuff_smoke", 0, 0, 0, 0, random(1,1) , random(-1,1) , random(180,360), 0)
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx ("gshot_firespark", 0, 0, 0, random(6,8), random(6,8) , random(1,6) , random(180,360), 0)
			stop
	}
}

actor tormentor_impactspawner {
	+NOINTERACTION
	+NOTIMEFREEZE
	states{
		spawn:
		    TNT1 AA 0 A_PlaySound("sfx/sboom")
			TNT1 A 0 A_SpawnItemEx("gshot_flash",0,0,0, 0,0,0)
			TNT1 AA 0 A_SpawnItemEx("gshot_puff",0,0,0, 0,frandom(-0.6,0.6),frandom(-0.6,0.6))
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx ("gshot_spark", 0, 0, 0, random(1,3), random(4,6) , random(0,6) , random(180,360), 0)
			TNT1 AAAAAAAAAA 0 A_SpawnItemEx ("gshot_spark2", 0, 0, 0, random(1,3), random(4,6) , random(0,6) , random(180,360), 0)
			TNT1 AAA 0 A_SpawnItemEx ("gpuff_smoke", 0, 0, 0, 0, random(1,1) , random(-1,1) , random(180,360), 0)
			stop
	}
}

actor gshot_puff {
	radius 1
	height 1
	alpha 1
	renderstyle add
	scale 0.85
	+FORCEXYBILLBOARD
	+NOTIMEFREEZE
	+NOINTERACTION
	states{
		spawn:
			TNT1 A 0 A_PlaySound("sfx/sboom")
			TNT1 A 0 A_Jump(255, "puff1","puff2","puff3","puff4","puff5")
		puff1:
			SX02 AAAABBBCDEFGHIJK 1 bright
			SX02 LMNOPQRSTU 1 bright A_Fadeout(0.1)
			stop
		puff2:
			SX03 AAAABBBCDEFGHIJKLMNOP 1 bright
			SX03 QRSTUVWXYZ 1 bright A_Fadeout(0.1)
			stop
		puff3:
			SX04 AAAABBBCDEFG 1 bright
			SX04 HIJKLMNOPQ 1 bright A_Fadeout(0.1)
			stop
		puff4:
			SX06 AAAABBBCDEFGHIJKLMN 1 bright
			SX06 OPQRSTUVWX 1 bright A_Fadeout(0.1)
			stop
		puff5:
			SX07 AAAABBBCDEF 1 bright
			SX07 GHIJKLMNOP 1 bright A_Fadeout(0.1)
			stop
			
	}
}


actor gshot_spark {
	radius 2
	height 2
	scale 0.05
	gravity 0.3
	renderstyle add
	+NOTELEPORT
	+NOTIMEFREEZE
	+FLOORCLIP
	+FORCEXYBILLBOARD
	+DONTSPLASH
	+CLIENTSIDEONLY
	bouncetype "doom"
	bouncefactor 0.2
	states{
		spawn:
			SPKO A 40 bright
		spawnloop:
			SPKO A 1 bright A_FadeOut(0.1)
			loop
	}
}

actor gshot_spark2 : gshot_spark {
	scale 0.07
	gravity 0.32
	+CLIENTSIDEONLY
	+NOTIMEFREEZE
	states{
		spawn:
			SPKO C 50 bright
		spawnloop:
			SPKO C 1 bright A_FadeOut(0.1)
			loop
	}
}

actor gshot_flash {
	renderstyle add
	alpha 0.64
	scale 0.54
	+FORCEXYBILLBOARD
	+NOINTERACTION
	+NOTIMEFREEZE
	+CLIENTSIDEONLY
	states{
		spawn:
			BFSH A 6 bright
			stop
	}
}

actor gshot_firespark {
	radius 1
	height 1
	speed  4
	damage 0
	RenderStyle add
	Alpha 1
	Scale 0.3
	Mass 0
	+MISSILE
	+FLOORCLIP
	+DONTSPLASH
	+NOTELEPORT
	+FORCEXYBILLBOARD
	+NOTIMEFREEZE
	BounceType "doom"
	gravity 0.45
	BounceFactor 0.2
	var int user_i;
	States
	{
		spawn:
			TNT1 A 0
			TNT1 A 0 A_SetUserVar("user_i", 1)
		sploop:	
			TNT1 A 0 A_JumpIf(user_i>=70, "death")
			SPRK A 1 A_SpawnItemEx ("gSpark_trail", 0, 0, 2, 0 , 0 , 0 , 0)
			TNT1 A 0 A_SpawnItemEx ("gSpark_smoke1", 0, 0, 0, frandom(-0.1,0.1) , frandom(-0.1,0.1) , frandom(0.1,0.3) , 0)
			TNT1 A 0 A_SetUserVar("user_i",user_i+1)
			loop
		death:
			TNT1 A 0
			stop
	}
}
 
actor gSpark_trail {
	radius 1
	height 1
	alpha 1.0
	+FLOORCLIP
	+NOTELEPORT
	+FORCEXYBILLBOARD
	+NOTIMEFREEZE
	+CLIENTSIDEONLY
	renderstyle add
	scale 0.35
	gravity 0
	states {
		spawn:
			TNT1 A 0
			TNT1 A 0 A_Jump (255,"trail1","trail2","trail3","trail4","trail5")
		trail1:
			EXP6 AABCDEFGH 2 bright
			stop
		trail2:
			EXP7 AABCDEFGH 2 bright
			stop
		trail3:
			EXP8 AABCDEFGH 2 bright
			stop
		trail4:
			EXP9 AABCDEFGH 2 bright
			stop
		trail5:
			EXP0 AABCDEFGH 2 bright
			stop
	}
}

actor gSpark_smoke1 {
	scale 0.15
	alpha 1.0
	renderstyle add
	+NOINTERACTION
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOTIMEFREEZE
	+NOTELEPORT
	+CLIENTSIDEONLY
	states {
		spawn:
			TNT1 A 4
			TNT1 A 0 A_Jump(255, "Smok1","Smok2","Smok3","Smok4")
		Smok1:
			SMO1 A 2 A_FadeOut(0.04)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop
		Smok2:
			SMO1 B 2 A_FadeOut(0.04)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop
		Smok3:
			SMO1 C 2 A_FadeOut(0.04)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop
		Smok4:
			SMO1 D 2 A_FadeOut(0.04)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop

	}
}


actor gshot_shockwave {
	//scale 0.27
	var int user_scale;
	renderstyle add
	+NOTELEPORT
	+NOCLIP
	+FLOORCLIP
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOTIMEFREEZE
	+NOINTERACTION
	+CLIENTSIDEONLY
	alpha 0.75
	states{
		spawn:
			TNT1 A 0
			TNT1 A 0 A_SetUserVar("user_scale",1) 
		scaledown:			   
			TNT1 A 0 A_SetScale((user_scale*0.02)) //Start scale
			TNT1 A 0 A_JumpIf(user_scale>=40,"LoopEnd") //Maximum Scale
			BSW0 A 1 bright A_FadeOut(0.05)
			TNT1 A 0 A_SetUserVar("user_scale",user_scale+4) //Speed
			loop
		loopend:
			BSW0 A 1 Bright A_FadeOut(0.05)
			wait
	}
}

actor general_smoke1 {
	radius 4
	height 4
	scale 1
	alpha 1
	renderstyle translucent
	+NOTELEPORT
	+FLOORCLIP
	+NOTIMEFREEZE
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOINTERACTION
	+CLIENTSIDEONLY
	states{
		spawn:
			TNT1 A 0
			goto selectjump
		selectjump:
			TNT1 A 0 A_Jump(255, "s1","s2","s3","s4","s5","s6","s7","s8","s9","s10","s11","s12","s13","s14","s15","s16","s17","s18","s19","s20","s21","s22","s23","s24")
		s1:
			SMK5 A 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s2:
			SMK5 B 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s3:
			SMK5 C 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s4:
			SMK5 D 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s5:
			SMK5 E 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s6:
			SMK5 F 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s7:
			SMK5 G 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s8:
			SMK5 H 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s9:
			SMK5 I 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s10:
			SMK5 J 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s11:
			SMK5 K 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s12:
			SMK5 L 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s13:
			SMK5 M 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s14:
			SMK5 N 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s15:
			SMK5 O 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s16:
			SMK5 P 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s17:
			SMK5 Q 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s18:
			SMK5 R 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s19:
			SMK5 S 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s20:
			SMK5 T 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s21:
			SMK5 U 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s22:
			SMK5 V 4 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s23:
			SMK5 W 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
		s24:
			SMK5 X 3 A_ScaleVelocity(0.9)
			TNT1 A 0 A_FadeOut(0.05)
			loop
			
	}
}

//gauss rifle smokes
actor gpuff_smoke : general_smoke1 {
	scale 0.3
	alpha 1.0
	renderstyle add
}

actor gauss_smoke {
	scale 0.08
	alpha 0.8
	renderstyle add
	+NOINTERACTION
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOTIMEFREEZE
	+NOTELEPORT
	+CLIENTSIDEONLY
	states {
		spawn:
			TNT1 A 0
			TNT1 A 0 A_Jump(255, "Smok1","Smok2","Smok3","Smok4")
		Smok1:
			SMO1 A 2 A_FadeOut(0.05)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop
		Smok2:
			SMO1 B 2 A_FadeOut(0.05)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop
		Smok3:
			SMO1 C 2 A_FadeOut(0.05)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop
		Smok4:
			SMO1 D 2 A_FadeOut(0.05)
			TNT1 A 0 A_ScaleVelocity(0.9)
			loop

	}
}

ACTOR gunsmoke_spawner
{
    Radius 1
    Height 1
    Speed 25
    PROJECTILE
    States
    {
    Spawn:
        TNT1 A 1
        TNT1 A 0 A_Die
        Goto Death
    Death:
        TNT1 A 0 A_CustomMissile("gun_smoke",-2,3,0)
        Stop
    }
}

actor gun_smoke {
	scale 0.1
	alpha 0.8
	renderstyle add
	+NOINTERACTION
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOTIMEFREEZE
	+NOTELEPORT
	+CLIENTSIDEONLY
	states {
		Spawn:
		SMOK ABCDEFGHIJKLMNOPQ 1 
		Stop
	}
}

actor gauss_smoke2 : gauss_smoke {
	scale 0.22
	+CLIENTSIDEONLY
	+NOTIMEFREEZE
	alpha 1.0
}

actor gauss_smoke3 : gauss_smoke {
	scale 0.05
	+NOTIMEFREEZE
	alpha 1.0
}

actor gausssmoke_spawner {
	+NOINTERACTION
	+NOGRAVITY
	+NOTELEPORT
	+NOTIMEFREEZE
	+NOCLIP
	states{
		spawn:
			NULL A 0
			NULL A 0 A_SpawnItemEx("gauss_smoke", 20, 0, 0, 0, frandom(-0.5,0.5), frandom(0.1,0.6), 0, SXF_TRANSFERPOINTERS, SXF_CLIENTSIDE)
			stop
	}

}

actor gausssmoke_spawner {
	+NOINTERACTION
	+NOGRAVITY
	+NOTELEPORT
	+NOTIMEFREEZE
	+NOCLIP
	states{
		spawn:
			NULL A 0
			NULL A 0 A_SpawnItemEx("gauss_smoke", 20, 0, 0, 0, frandom(-0.5,0.5), frandom(0.1,0.6), 0, SXF_TRANSFERPOINTERS, SXF_CLIENTSIDE)
			stop
	}

}actor gausssmoke_spawner_typhoon {
	+NOINTERACTION
	+NOGRAVITY
	+NOTELEPORT
	+NOTIMEFREEZE
	+NOCLIP
	states{
		spawn:
			NULL A 0
			NULL A 0 A_SpawnItemEx("gauss_smoke", 20, 0, 0, 0, frandom(-0.5,0.5), frandom(0.1,0.6), 0, SXF_TRANSFERPOINTERS, SXF_CLIENTSIDE)
			stop
	}

}

actor gausssmoke_spawner2 : gausssmoke_spawner {
	states{
		spawn:
			NULL A 0
			NULL A 0 A_SpawnItemEx("gauss_smoke2", 20, 0, 0, frandom(0.8,1.6), frandom(-0.9,0.9), frandom(0.2,0.7), 0, SXF_TRANSFERPOINTERS,SXF_CLIENTSIDE)
			stop
	}
}

actor gausssmoke_spawner3 {
	+NOINTERACTION
	+NOGRAVITY
	+NOTELEPORT
	+NOCLIP
	+CLIENTSIDEONLY
	states{
		spawn:
			NULL A 0
			NULL A 0 A_SpawnItemEx("gauss_smoke3", 20, 0, 5, 0, frandom(-0.15,0.15), frandom(-0.35,0.35), 0, SXF_TRANSFERPOINTERS, SXF_CLIENTSIDE)
			stop
	}

}
