ACTOR "LegendaryMinigun" : Weapon
{
   Weapon.Selectionorder 690
   Weapon.KickBack 50
   Weapon.PreferredSkin "ExplosiveMinigun-Marine"
   Weapon.AmmoType "LegendaryLMGBulletMag"
   Weapon.AmmoGive 60
   Weapon.AmmoUse 1
   Weapon.UpSound "EnrLegMinigun/up"
   Inventory.PickupSound "EnrLegMiniPickup/pickup"
   Inventory.PickupMessage "Legendary Minigun"
   Obituary "%o was ripped to bloody chunks by %k's Legendary Minigun."
   AttackSound "EnrLegMinigun/despacito"
   Tag "Legendary Minigun"
   +INVENTORY.UNDROPPABLE
   +WEAPON.NOAUTOAIM
   States 
   {
   Spawn:
      LMIC X -1
      Stop
   Ready:
      LMIC A 1 A_WeaponReady
      Loop
   ReadySpin:
      TNT1 A 0 A_PlaySound("weapons/expmgunspin", 5)
      LMIC ABCDEFGHABCDEFGHABCDEFGH 1 A_WeaponReady
      Loop
   Deselect:
      TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
	  TNT1 A 0 A_TakeInventory("MineAction",1)
	  TNT1 A 0 A_TakeInventory("RailgunAction",1)
	  TNT1 A 0 A_PlayWeaponSound("weapons/weapondown")
      TNT1 A 0 A_TakeInventory("ExpLegendaryMinigunActive2",1)
      TNT1 A 0 A_TakeInventory("ExpLegendaryMinigunActive",1)
      TNT1 A 0 A_PlaySound("weapons/weapondown", 5)
   Deselecting:
      LMIC A 1 A_Lower
      TNT1 A 0 A_Lower
      Loop
   Select:
      TNT1 A 0 A_TakeInventory("ExpLegendaryMinigunActive2",1)
      TNT1 A 0 A_TakeInventory("ExpLegendaryMinigunActive",1)
   Selecting:
      LMIC A 1 A_Raise
      TNT1 A 0 A_Raise
      Loop
   Fire:
      TNT1 A 0 A_JumpIfNoAmmo("EmptySpinDown")   
      TNT1 A 0 A_JumpIfInventory("ExpLegendaryMinigunActive2",1,"Firing")
      TNT1 A 0 A_JumpIfInventory("ExpLegendaryMinigunActive",1,"Firing")
      TNT1 A 0 A_PlaySound("weapons/expmgunspinstart", 5)
      LMIC ABC 2
      LMIC DABCDABC 1
   Firing:
      TNT1 A 0 A_GiveInventory("ExpLegendaryMinigunActive",1)
      TNT1 A 0 A_PlaySound("weapons/expmgunspin", 5)
      TNT1 A 0 Radius_Quake(2,2,0,1,0)
      TNT1 A 0 A_SpawnItemEx("BlueShellCasing",25,-8,25,Random(2,4),Random(-3,-6),Random(3,6),0)
      TNT1 A 0 A_PlaySound("sentient/fire", CHAN_WEAPON)
      TNT1 A 0 A_FireCustomMissile("PlayerLegMinigunBullet",Random(4,-4),0,0,Random(4,-4))
	  TNT1 A 0 A_TakeInventory("LegendaryLMGBulletMag",1)
      LMIF A 1 Bright 
      TNT1 A 0 A_JumpIfNoAmmo("EmptySpinDown")   
      LMIF IJ 1 Bright
      TNT1 A 0 Radius_Quake(2,2,0,1,0)
      TNT1 A 0 A_SpawnItemEx("BlueShellCasing",25,-8,25,Random(2,4),Random(-3,-6),Random(3,6),0)
      TNT1 A 0 A_PlaySound("sentient/fire", CHAN_WEAPON)   
      TNT1 A 0 A_FireCustomMissile("PlayerLegMinigunBullet",Random(4,-4),0,0,Random(4,-4))
      LMIF L 1 Bright A_FireCustomMissile("PlayerLegMinigunBullet",Random(4,-4),0,0,Random(4,-4))
	  TNT1 A 0 A_TakeInventory("LegendaryLMGBulletMag",2)
      LMIF I 1 Bright
   Hold:
      TNT1 A 0 A_GiveInventory("ExpLegendaryMinigunActive",1)
      TNT1 A 0 A_PlaySound("weapons/expmgunspin", 5)
      TNT1 A 0 Radius_Quake(2,2,0,1,0)
      TNT1 A 0 A_SpawnItemEx("BlueShellCasing",25,-8,25,Random(2,4),Random(-3,-6),Random(3,6),0)
      TNT1 A 0 A_PlaySound("sentient/fire", CHAN_WEAPON)
      TNT1 A 0 A_FireCustomMissile("PlayerLegMinigunBullet",Random(4,-4),0,0,Random(4,-4))
      LMIF J 1 Bright 
      TNT1 A 0 A_JumpIfNoAmmo("EmptySpinDown")
      LMIF L 1 Bright
      LMIF HI 1 Bright
      TNT1 A 0 Radius_Quake(2,2,0,1,0)
      TNT1 A 0 A_SpawnItemEx("BlueShellCasing",25,-8,25,Random(2,4),Random(-3,-6),Random(3,6),0)
      TNT1 A 0 A_PlaySound("sentient/fire", CHAN_WEAPON)   
      TNT1 A 0 A_FireCustomMissile("PlayerLegMinigunBullet",Random(4,-4),0,0,Random(4,-4))
	  TNT1 A 0 A_TakeInventory("LegendaryLMGBulletMag",1)
      LMIF J 1 Bright 
      TNT1 A 0 A_JumpIfNoAmmo("EmptySpinDown")   
      LMIF KL 1 Bright
      TNT1 A 0 Radius_Quake(2,2,0,1,0)
      TNT1 A 0 A_SpawnItemEx("BlueShellCasing",25,-8,25,Random(2,3),Random(-3,-5),Random(3,5),0)
      TNT1 A 0 A_PlaySound("sentient/fire", CHAN_WEAPON)   
      TNT1 A 0 A_FireCustomMissile("PlayerLegMinigunBullet",Random(4,-4),0,0,Random(4,-4))
	  TNT1 A 0 A_TakeInventory("LegendaryLMGBulletMag",1)
      LMIF I 1 Bright 
      TNT1 A 0 A_JumpIfNoAmmo("EmptySpinDown")   
      TNT1 A 0 A_ReFire
      TNT1 A 0 A_JumpIfInventory("ExpLegendaryMinigunActive2",1,"ReadySpin")
      TNT1 A 0 A_PlaySound("weapons/expmgunspinstop", 5)
      TNT1 A 0 A_TakeInventory("ExpLegendaryMinigunActive",1)
      LMIC ABCDABCD 1
      LMIC ABCD 2
      LMIC ABCD 3
      Goto Ready
   AltFire:
      TNT1 A 0
      TNT1 A 0 A_JumpIfInventory("ExpLegendaryMinigunActive2",1,"EmptySpinDown")
      TNT1 A 0 A_PlaySound("weapons/expmgunspinstart", 5)
      LMIC ABC 2
      LMIC DCBADCBA 1
      TNT1 A 0 A_GiveInventory("ExpLegendaryMinigunActive2",1)
      Goto ReadySpin
   EmptySpinDown:
      TNT1 A 0 A_TakeInventory("ExpLegendaryMinigunActive",1)
      TNT1 A 0 A_TakeInventory("ExpLegendaryMinigunActive2",1)
      TNT1 A 0 A_PlaySound("weapons/expmgunspinstop", 5)
      LMIC ABCDABCD 1
      LMIC ABCD 2
      LMIC ABCD 3
      Goto Ready
   }
}

ACTOR ExpLegendaryMinigunActive : Ammo
{
   Inventory.MaxAmount 1
}
ACTOR ExpLegendaryMinigunActive2 : Ammo
{
   Inventory.MaxAmount 1
}

ACTOR PlayerLegMinigunBullet : ExplosiveBullet
{
height 4
radius 2
Scale 0.5
Speed 380
Renderstyle Add
Alpha 0.85
Decal "bulletchip"
Damage (random(60,65))
+DONTREFLECT
+FORCERADIUSDMG
+EXTREMEDEATH
//+DONTHURTSPECIES
+DONTHARMSPECIES
+THRUSPECIES
+MTHRUSPECIES
Damagetype "Legendary"
Seesound ""
Deathsound ""
Species "Player"
States
{
  Spawn:
	TNT1 A 1 Bright
	Loop
  SpawnLoop:	
	TNT1 A 1 Bright
	Loop
  Death:
	TNT1 A 1 Bright
	TNT1 A 0 A_Playsound("PulseNail/hit",CHAN_AUTO,1.0,0)
	TNT1 AAA 0 A_SpawnItemEX("Kaboom9",0,0,0,random(-2,2),random(-2,2),random(-2,2),random(0,360),SXF_CLIENTSIDE,0)
	TNT1 AAA 0 A_SpawnItemEX("SmokeFX4",0,0,0,random(-2,2),random(-2,2),random(-2,2),random(0,360),SXF_CLIENTSIDE,0)
	TNT1 A 0 A_SpawnItemEx("OrangeParticleSpawner",0,0,1,0,0,0,0,SXF_CLIENTSIDE,0)
	TNT1 A 0 A_SetTranslucent(0.85,1)
	MISL BBBBCC 1 
	MISL CDE 3 
	Stop
	}
}

ACTOR PlayerLegSentientExplosiveTracer : SentientExplosiveTracer //unused
{
   Species "Player"
   DamageType "Legendary"
   +THRUSPECIES
   Scale 0.7
   States
   {
   Spawn:
      LRAC A 1 Bright
      Loop
   }
}