Actor NemesisDarkGaussCannon : Weapon
{
	Weapon.BobRangeX 0.2
	Weapon.BobRangeY 0.4
	Weapon.SelectionOrder 100
	Weapon.AmmoUse 20
	Weapon.AmmoGive 375
	Weapon.KickBack 400
	Weapon.PreferredSkin "LegendaryCannon-Marine"
	Weapon.AmmoType "NLDemonAmmo"
	Weapon.AmmoType2 "NLDemonAmmo"
	Inventory.PickupMessage "Nemesis Dark Gauss Cannon!"
	Inventory.PickupSound "GaussCannonGet"
	Inventory.UseSound "GaussCannonGet"
	Tag "Nemesis Dark Gauss Cannon / uses 80 ammo"
	+WEAPON.NOALERT
	+WEAPON.AMMO_OPTIONAL
	+INVENTORY.UNDROPPABLE
	States
	{
	Ready:
		TNT1 A 0 A_JumpIfInventory("NemesisRuneWorksWithWeapons",1,"ReadyVexedNemesis")
		TNT1 A 0 A_PlaySound("GaussCannonReadyLoop")
		N981 E 45 A_WeaponReady
		Loop
	ReadyVexedNemesis:
		TNT1 A 0 A_PlaySound("GaussCannonReadyLoop")
		V981 E 45 A_WeaponReady
		Loop
	Select:
		TNT1 A 0 A_JumpIfInventory("NemesisRuneWorksWithWeapons",1,"SelectVexedNemesis")
		TNT1 A 0 A_PlaySound("GaussCannonSelect")
		TNT1 A 0 A_ZoomFactor(1)
		N981 BCD 1 A_WeaponReady(WRF_NOFIRE)
		Goto Ready
	SelectVexedNemesis:
		TNT1 A 0 A_PlaySound("GaussCannonSelect")
		TNT1 A 0 A_ZoomFactor(1)
		V981 BCD 1 A_WeaponReady(WRF_NOFIRE)
		Goto ReadyVexedNemesis
	Deselect:
		TNT1 A 0 A_JumpIfInventory("NemesisRuneWorksWithWeapons",1,"DeselectVexedNemesis")
		TNT1 A 0 A_ZoomFactor(1)
		TNT1 A 0 A_StopSound
		N981 DCB 1 Offset(0,32)
		TNT1 A 0 A_Lower
		Wait
	DeselectVexedNemesis:
		TNT1 A 0 A_ZoomFactor(1)
		TNT1 A 0 A_StopSound
		V981 DCB 1 Offset(0,32)
		TNT1 A 0 A_Lower
		Wait
	Fire:
		TNT1 A 0 A_JumpIfInventory("NemesisRuneWorksWithWeapons",1,"FireVexedNemesis")
		TNT1 A 0 A_JumpIfNoAmmo("ClickClickNoShot")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_PlaySound("GaussCannonFire")
		TNT1 A 0 A_PlaySound("GaussCannonAdd")
		TNT1 A 0 A_SetBlend("White",0.5,3,"Black")
		TNT1 A 0 A_FireBullets(0,0,0,0,"NemesisGaussBulletPuff",FBF_NOFLASH)
		TNT1 A 0 A_RailAttack(150*(random(1,3)),0,true,"","",RGF_NOPIERCING|RGF_SILENT,0,"",0,0,0,0,0.4,1.0,"NemesisGaussCannonTrail")
		TNT1 A 0 A_RailAttack(300,0,0,none,"",RGF_SILENT | RGF_FULLBRIGHT,0,"",0,0,0,35,0,0,"NemGaussProj1")
		TNT1 A 0 A_RailAttack(0,0,0,none,"",RGF_SILENT | RGF_FULLBRIGHT,0,"",0,0,0,35,0,0,"NemGaussExplosionFlare")
		TNT1 A 0 A_RailAttack(0,0,0,none,"",RGF_SILENT | RGF_FULLBRIGHT,0,"",0,0,0,35,0,0,"NemGaussExplosionFlare2")
		N981 F 1 A_Zoomfactor(0.90)
		N981 G 1 A_Zoomfactor(0.91)
		N981 H 1 A_Zoomfactor(0.91)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		TNT1 A 0 A_PlaySound("GaussCannonClose")
		N981 L 1 A_Zoomfactor(0.92)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 L 1 A_Zoomfactor(0.92)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 L 1 A_Zoomfactor(0.93)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 L 1 A_Zoomfactor(0.93)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 L 1 A_Zoomfactor(0.93)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 L 1 A_Zoomfactor(0.94)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 L 1 A_Zoomfactor(0.94)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 L 1 A_Zoomfactor(0.94)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 L 1 A_Zoomfactor(0.94)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 L 1 A_Zoomfactor(0.95)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 I 1 A_Zoomfactor(0.95)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 J 1 A_Zoomfactor(0.95)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 J 1 A_Zoomfactor(0.95)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 K 1 A_Zoomfactor(0.95)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 K 1 A_Zoomfactor(0.96)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 L 1 A_Zoomfactor(0.96)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 M 1 A_Zoomfactor(0.97)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 M 1 A_Zoomfactor(0.97)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 E 1 A_Zoomfactor(0.98)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 E 1 A_Zoomfactor(0.99)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 E 1 A_Zoomfactor(1)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		N981 EE 1
		Goto Ready
	ClickClickNoShot:
		TNT1 A 0 A_Print("Out of ammo!",5)
		N981 E 5
		Goto Ready
	FireVexedNemesis:
		TNT1 A 0 A_JumpIfNoAmmo("ClickClickNoShotVexedNemesis")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_PlaySound("GaussCannonSiegeFire")
		TNT1 A 0 A_PlaySound("GaussCannonSiegeAdd")
		TNT1 A 0 A_SetBlend("White",0.5,3,"Black")
		TNT1 A 0 A_FireBullets(0,0,1,0,"AlternativeNemesisGaussBulletPuff",FBF_NOFLASH)
		TNT1 A 0 A_RailAttack(150*(random(1,3)),0,true,"","",RGF_NOPIERCING|RGF_SILENT,0,"",0,0,0,0,0.4,1.0,"NemesisGaussCannonTrail")
		TNT1 A 0 A_RailAttack(300,0,1,none,"",RGF_SILENT | RGF_FULLBRIGHT,0,"",0,0,0,35,0,0,"NemGaussProj1")
		TNT1 A 0 A_RailAttack(0,0,1,none,"",RGF_SILENT | RGF_FULLBRIGHT,0,"",0,0,0,35,0,0,"NemGaussExplosionFlare")
		TNT1 A 0 A_RailAttack(0,0,1,none,"",RGF_SILENT | RGF_FULLBRIGHT,0,"",0,0,0,35,0,0,"NemGaussExplosionFlare2")
		//TNT1 A 0 A_RailAttack(0,0,1,none,"",RGF_SILENT | RGF_FULLBRIGHT,0,"",0,0,0,35,0,0,"NemGaussExplosionShowcase")
		V981 F 1 A_Zoomfactor(0.90)
		V981 G 1 A_Zoomfactor(0.91)
		V981 H 1 A_Zoomfactor(0.91)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		TNT1 A 0 A_PlaySound("GaussCannonClose")
		V981 L 1 A_Zoomfactor(0.92)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 L 1 A_Zoomfactor(0.92)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 L 1 A_Zoomfactor(0.93)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 L 1 A_Zoomfactor(0.93)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 L 1 A_Zoomfactor(0.93)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 L 1 A_Zoomfactor(0.94)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 L 1 A_Zoomfactor(0.94)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 L 1 A_Zoomfactor(0.94)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 L 1 A_Zoomfactor(0.94)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 L 1 A_Zoomfactor(0.95)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 I 1 A_Zoomfactor(0.95)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 J 1 A_Zoomfactor(0.95)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 J 1 A_Zoomfactor(0.95)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 K 1 A_Zoomfactor(0.95)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 K 1 A_Zoomfactor(0.96)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 L 1 A_Zoomfactor(0.96)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 M 1 A_Zoomfactor(0.97)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 M 1 A_Zoomfactor(0.97)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 E 1 A_Zoomfactor(0.98)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 E 1 A_Zoomfactor(0.99)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 E 1 A_Zoomfactor(1)
		TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_NOBOB)
		V981 EE 1
		Goto Ready
	ClickClickNoShotVexedNemesis:
		TNT1 A 0 A_Print("Out of ammo!",5)
		V981 E 5
		Goto Ready
	Spawn:
		N981 A -1
		Stop
  }
}

ACTOR NemGaussProj1
{
  Radius 10
  Height 10
  RenderStyle Add
  Scale 0.30
  Alpha 0.7
  //ActiveSound "GaussCannonLoopProjectile"
  DeathSound "GaussCannonHit"
  +THRUSPECIES
  +NOINTERACTION
  +NOTIMEFREEZE
  +BRIGHT
  States
  {
    Spawn:
	  TNT1 A 0 //A_LoopActiveSound
	  N983 C 3 Bright
	  N983 C 3 Bright  
	  N983 C 3 Bright
	  N984 A 2 A_SetScale(0.22)
	  N984 A 2 A_SetScale(0.20)
	  N984 B 2 A_SetScale(0.17)
	  N984 B 2 A_SetScale(0.15)
	  N984 C 2 A_SetScale(0.12)
	  N984 C 2 A_SetScale(0.10)
	  N984 D 1 A_SetScale(0.07)
	  N984 D 1 A_SetScale(0.05)
	  N984 E 1 A_SetScale(0.02)
	  N984 E 1 A_SetScale(0.0)
      Stop
  }
}

ACTOR NemGaussExplosionFlare
{
+NOTIMEFREEZE
+NOGRAVITY
+FLOAT
+BRIGHT
+THRUSPECIES
Alpha 0.4
Scale 0.04
DeathType "NemGaussExplosion2"
RenderStyle Add
States
{
Spawn:
N987 ABCDEFGHIJKLMNOPQRSTU 2 Bright A_FadeOut
Stop
}
}

ACTOR NemGaussExplosionFlare2
{
+NOTIMEFREEZE
+NOGRAVITY
+FLOAT
+BRIGHT
+THRUSPECIES
Alpha 0.25
Scale 0.05
RenderStyle Add
States
{
Spawn:
N988 ABCDEFGHIJKLMNOPQRS 2 Bright A_FadeOut
Stop
}
}

/*ACTOR NemGaussExplosionShowcase
{
+NOTIMEFREEZE
+NOGRAVITY
+FLOAT
+BRIGHT
+THRUSPECIES
Alpha 0.4
Scale 1.5
RenderStyle Add
States
{
Spawn:
TNT1 A 0 A_SpawnItemEx("NemesisGaussPlasmaFX",0,0,0,frandom(-10,10),frandom(-10,10),frandom(-10,10))
NHOG ABCDEFGHIJKLMNOPQR 2 Bright A_FadeOut
TNT1 A 0 A_SpawnItemEx("NemesisGaussPlasmaFX",0,0,0,frandom(-10,10),frandom(-10,10),frandom(-10,10))
Stop
}
}*/

Actor NemesisGaussCannonTrail
{
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("NemesisGaussSmokeTrail",0,0,0,frandom(-7,7),frandom(-7,7),frandom(-7,7))
		TNT1 A 0 A_SpawnItemEx("NemesisGaussSparkle",0,0,0,frandom(-1,1),frandom(-1,1),frandom(-1,1))
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("NemesisGaussPlasmaFX",0,0,0,frandom(-10,10),frandom(-10,10),frandom(-10,10))
		Stop
		
	}
}

Actor NemesisGaussPlasmaFX 
{
	Radius 13
	Height 8
	Speed 35
	Damage 10
	RenderStyle "Add"
	Alpha 0.75
	+NOBLOCKMAP
	+NOGRAVITY
	+DONTSPLASH
	+NOTELEPORT
	+FORCEXYBILLBOARD
	+RANDOMIZE
	States
	{
 	Spawn:
		TNT1 A 0
	Fly:
		N985 A 1 Bright A_SetScale(0.075)
		N985 A 0 Bright A_FadeOut(0.075)
		N985 A 1 Bright A_SetScale(0.075)
		N985 A 0 Bright A_FadeOut(0.075)
		N985 A 1 Bright A_SetScale(0.075)
		N985 A 0 Bright A_FadeOut(0.075)
		N985 B 1 Bright A_SetScale(0.075)
		N985 B 0 Bright A_FadeOut(0.075)
		N985 B 1 Bright A_SetScale(0.075)
		N985 B 0 Bright A_FadeOut(0.075)
		N985 B 1 Bright A_SetScale(0.075)
		N985 B 0 Bright A_FadeOut(0.075)
		Loop
	}
}


Actor NemesisGaussSmokeTrail
{
  RenderStyle "Shaded"
  Alpha 0.4
  VSpeed 1
  +NOBLOCKMAP
  +NOCLIP
  +NOGRAVITY
  +DONTSPLASH
  +NOTELEPORT
  +FORCEXYBILLBOARD
  States
  {
  Spawn:
    N984 ABCDE 5
    Stop
  }
}

Actor NemesisGaussSparkle
{
+NOGRAVITY
RenderStyle "Add"
States
{
Spawn:
TNT1 A 0
N983 C random(1,3) BRIGHT
N983 D random(1,3) BRIGHT
N983 E random(1,3) BRIGHT
Stop}}

ACTOR NemesisGaussBulletPuff : ModdedBulletPuff
{
DamageType "PlayerNemesisPlasma"
Damage 140
+NOTIMEFREEZE
Scale 0.75
States
{
Spawn:
	PUFF A 2 Bright
	TNT1 AA 0 A_SpawnItemEx("NemesisWhiteParticleSpawner",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0) 
	TNT1 AAA 0 A_CustomMissile("NemesisKaboom7",0,0,random(0,360),2,random(0,360))
	TNT1 AAA 0 A_CustomMissile("LegendarySmokeFX4",0,0,random(0,360),2,random(0,360))
	TNT1 A 0 Bright A_SpawnItemEx("NemesisADemonTechExButLowerOpacity",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	PUFF CDEF 1
    Stop
    }
}

ACTOR AlternativeNemesisGaussBulletPuff : ModdedBulletPuff
{
DamageType "PlayerNemesisPlasma"
Damage 200
+NOTIMEFREEZE
Scale 0.75
States
{
Spawn:
	PUFF A 2 Bright
	TNT1 AA 0 A_SpawnItemEx("NemesisWhiteParticleSpawner",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0) 
	TNT1 AAA 0 A_CustomMissile("WhiteNemesisKaboom",0,0,random(0,360),2,random(0,360))
	TNT1 AAA 0 A_CustomMissile("LegendarySmokeFX4",0,0,random(0,360),2,random(0,360))
	TNT1 A 0 Bright A_SpawnItemEx("NemesisADemonTechExButLowerOpacity",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	PUFF CDEF 1
    Stop
    }
}