Actor HackroidASGGiver : CustomInventory
{
  Scale 0.9
  Inventory.Amount 1
  Inventory.MaxAmount 0
  Inventory.InterHubAmount 0
	Inventory.PickupSound "LShotgun/Cock"
	Inventory.PickupMessage "Behold... Hackroid A.S.G."
	Obituary "%o was wrecked even infernally pieces by %k's unknown bullets from a ASG."
	Tag "Hackroid Assault Shotgun"
  States
  {
  Spawn:
	HMAP A 0 NoDelay ACS_NamedExecuteWithResult("WeaponListCheck",3,1)
  SpawnLoop:
	HMAP A -1
	Loop
  Pickup:
	TNT1 A 0 A_JumpIfInventory("HackroidASG",1,"JustAmmo")
  All:
	TNT1 A 0 A_GiveInventory("HackroidASG",1)
	TNT1 A 0 A_JumpIfInventory("HackroidASGGiverCheck",1,"HoldAndDestroy")
	TNT1 A 0 A_GiveInventory("HackroidASGGiverCheck",1)
	TNT1 A 0 A_GiveInventory("HCKShell",40)
	Stop
  JustAmmo:
    TNT1 A 0 A_JumpIfInventory("HackroidASGGiverCheck",1,"Null")
	TNT1 A 0 A_GiveInventory("HackroidASGGiverCheck",1)
	TNT1 A 0 A_GiveInventory("HCKShell",40)
	TNT1 A 0 A_SpawnItemEx("HackroidASG")
	Stop
  }
}

Actor HackroidASGSpawnerGiver : HackroidASGGiver
{
  States
  {
  JustAmmo:
    TNT1 A 0 A_JumpIfInventory("HackroidASGGiverCheck",1,"Null")
	TNT1 A 0 A_GiveInventory("HackroidASGGiverCheck",1)
	TNT1 A 0 A_GiveInventory("HCKShell",40)
	Stop
  }
}

Actor HackroidASGGiverCheck : Inventory { Inventory.Amount 1 Inventory.MaxAmount 1 Inventory.InterHubAmount 0 }



ACTOR "HackroidASG" : Weapon 
{
 Scale 0.85
 Weapon.PreferredSkin "LegendaryASG-Marine"
 Weapon.SelectionOrder 4500
 Weapon.KickBack 160
 Weapon.AmmoUse 0
 Weapon.AmmoGive 12
 Weapon.AmmoGive2 12
 Weapon.AmmoType "HCKASGDrum"
 Weapon.AmmoType2 "HCKShell"
 Weapon.SlotNumber 3
 Weapon.SlotPriority 15.0
 Inventory.PickupSound "LShotgun/Cock"
 Inventory.PickupMessage "Behold... Hackroid A.S.G."
 Obituary "%o was wrecked even infernally pieces by %k's unknown bullets from a ASG."
 Decal ELegBulletChip
 Tag "Hackroid Assault Shotgun"
 +WEAPON.AMMO_OPTIONAL
 +WEAPON.NOALERT
 States
 {
  Ready:
	TNT1 A 0 A_PlayWeaponSound("LShotgun/Cock")
	HGSG VWXYZ 1
  ReadyLoop:
	TNT1 A 0 A_JumpIfInventory("HandGrenadeAction",1,"GrenadeCheck")
	TNT1 A 0 A_JumpIfInventory("MineAction",1,"MineCheck")
	HGSG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
	Loop
   Deselect:
	TNT1 A 0 A_PlaySound("weapons/weapondown")
	TNT1 A 0 A_Lower
	HGSG A 1 A_Lower
	Goto Deselect+1
   Select:
	TNT1 A 1 A_Raise
	TNT1 A 0 A_Raise
	Wait
  Fire:
	TNT1 A 0 A_JumpIfInventory("PowerSpreadRune",1,"FireSpread")
	TNT1 A 0 A_JumpIfInventory("HCKASGDrum",1,1)
	Goto Empty
	TNT1 A 0 A_PlaySound("1337ASG/Fire", 1)
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 Radius_Quake(3,3,0,1,0)
	TNT1 A 0 A_SpawnItemEx("1337ShellCasing",30,5,25,frandom(2,4),frandom(3,6),frandom(3,6),0)
	TNT1 AAAAAA 0 A_FireCustomMissile("1337SGTracer",frandom(5,-5),0,0,frandom(5,-5))
	TNT1 A 0 A_TakeInventory("HCKASGDrum",1)
	HGSG B 2 Bright A_FireBullets(6.2,3.4,7,Random(40,50),"1337ModdedBulletPuff")
	HGSG C 2 Bright
	HGSG DEFG 1
	HGSG HI 4
	Goto ReadyLoop
  FireSpread:
	TNT1 A 0 A_JumpIfInventory("HCKASGDrum",1,1)
	Goto Empty
	TNT1 A 0 A_PlaySound("1337ASG/Fire", 1)
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 Radius_Quake(3,3,0,1,0)
	TNT1 A 0 A_SpawnItemEx("1337ShellCasing",30,5,25,frandom(2,4),frandom(3,6),frandom(3,6),0)
	TNT1 AAAAAA 0 A_FireCustomMissile("1337SGTracer",frandom(5,-5),0,0,frandom(5,-5))
	TNT1 AAAAAA 0 A_FireCustomMissile("1337SGTracer",frandom(5,-5)+15.0,0,0,frandom(5,-5))
	TNT1 AAAAAA 0 A_FireCustomMissile("1337SGTracer",frandom(5,-5)-15.0,0,0,frandom(5,-5))
	TNT1 A 0 A_TakeInventory("HCKASGDrum",1)
	HGSG B 2 Bright A_FireBullets(6.2+15.0,3.4,7*3,Random(40,50),"1337ModdedBulletPuff")
	HGSG C 2 Bright 
	HGSG DEFG 1
	HGSG HI 4
	Goto ReadyLoop
  Empty:
	HGSG A 10 A_PlaySound("weapons/click")
  Reload:
  	TNT1 A 0 A_JumpIfInventory("HCKASGDrum",0,"ReadyLoop")
	HGSG JKLMN 1
	HGSG O 2
	HGSR A 2 A_PlaySound("lasgguy/asgout")
  	HGSR B 3
	HGSG U 40 A_FireCustomMissile("1337EmptyDrumSpawner", 0, 0, 10, 1) 
	HGSG TSR 1
	HGSG Q 2
	TNT1 A 0 ACS_NamedExecuteAlways("HackroidReload",0,2)
	HGSG P 3
	HGSG O 6 A_PlaySound("lasgguy/asgin")
	HGSG NMLKJ 1
	Goto ReadyLoop
  GrenadeCheck:
	TNT1 A 0 A_JumpIfInventory("HandGrenadeAmmo",1,"GrenadeToss")
	TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
	Goto ReadyLoop
  GrenadeToss:
  	TNT1 A 0 A_PlayWeaponSound("weapons/weapondown") 
	HGSG ZYXWV 1
	TNT1 A 6
	HGRN ABC 1
	HGRN D 3
	HGRN EFGHI 2
	TNT1 A 14 A_PlayWeaponSound("weapons/hgrenadepin")
	TNT1 A 0 A_PlayWeaponSound("weapons/hgrenadethrow")
	TNT1 A 0 A_TakeInventory("HandGrenadeAmmo",1)
	HGRN J 1 A_FireCustomMissile("ThrownGrenade",0,0,0,0)
	HGRN KLM 2
	TNT1 A 6
	TNT1 A 0 A_JumpIfInventory("HandGrenadeAmmo",1,2)
	TNT1 A 0 A_TakeInventory("Hand Grenade",1)
	TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
	TNT1 A 0
	HGSG VWXYZ 1
	Goto ReadyLoop
  MineCheck:
	TNT1 A 0 A_JumpIfInventory("MineAmmo",1,"MineToss")
	TNT1 A 0 A_TakeInventory("MineAction",1)
	Goto ReadyLoop
  MineToss:
  	TNT1 A 0 A_PlayWeaponSound("weapons/weapondown") 
	HGSG ZYXWV 1
	TNT1 A 10
	TNT1 A 0 A_PlayWeaponSound("weapons/hgrenadethrow")
	MINE ABCDEF 1		
	TNT1 A 0 A_TakeInventory("MineAmmo",1)	  
	MINE G 1 A_FireCustomMissile("ThrownMine",0,0,0,0)
	MINE HI 1
	MINE JK 2
	TNT1 A 0 A_JumpIfInventory("MineAmmo",1,2)
	TNT1 A 0 A_TakeInventory("Land Mine",1)
	TNT1 A 0 A_TakeInventory("MineAction",1)
	TNT1 A 0
	TNT1 A 5
	Goto Ready+1
  Spawn:
  	HMAP A 0 NoDelay ACS_NamedExecuteWithResult("WeaponListCheck",3,1)
  SpawnLoop:
	HMAP A -1
	Stop
 }
}

ACTOR HCKASGDrum : Ammo
{
 Inventory.Amount 12
 Inventory.MaxAmount 12
 Ammo.BackpackAmount 0
 Ammo.BackpackMaxAmount 12
 Inventory.Icon "HMAPA0"
 +IGNORESKILL
 +NOTIMEFREEZE
}

ACTOR 1337EmptyDrumSpawner : CasingSpawner
{
 +NOTIMEFREEZE
 States
 {
  Spawn:
	TNT1 A 0
	TNT1 A 1 A_SpawnItemEx("1337EmptyDrum", 2, 0, -12, 1, 0, 0, Random(-100, -110), 128)
	Stop
 }
}

ACTOR 1337EmptyDrum : BulletCasing
{
 Scale 0.2
 Seesound "weapons/emptydrum"
 +NOTIMEFREEZE
 States
 {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("CheckVanilla") == 1, "Vanilla")
	45GD ABCD 3 
	Loop
  Death:
	TNT1 A 0 A_Jump(128,3)
	45GD A 100
	45GD A 5 A_FadeOut(0.10)
	Goto Death+2
	45GD C 100
	45GD C 5 A_FadeOut(0.10)
	Goto Death+4
 }
}

ACTOR 1337ShellCasing : BulletCasing
{
 Scale 0.24
 Seesound "weapons/casing2"
 +NOTIMEFREEZE
 States
 {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("CheckVanilla") == 1, "Vanilla")
	45GC ABCDEFGH 2
	Loop
  Death:
	TNT1 A 0 A_Jump(128,3)
	45GC C 100
	45GC C 5 A_FadeOut(0.10)
	Goto Death+2
	45GC G 100
	45GC G 5 A_FadeOut(0.10)
	Goto Death+4
 }
}

ACTOR HCKShell : Ammo
{
 Scale 0.3
 Inventory.PickupMessage "Hackroid Shells"
 Inventory.PickupSound "1337/Shell"
 Inventory.Amount 4
 Inventory.MaxAmount 30
 Ammo.BackpackAmount 0
 Ammo.BackpackMaxAmount 60
 Inventory.Icon "45GAC0"
 +NOTIMEFREEZE
 States
 {
  Spawn:
	45GA B -1
	Stop
 }
}

ACTOR HCKShellBox : HCKShell
{
 Scale 0.75
 Inventory.Amount 8
 Inventory.PickupMessage "Hackroid Shell Box"
 Inventory.PickupSound "1337/ShellBox"
 Inventory.Icon "45GAA0"
 +NOTIMEFREEZE
 States
 {
  Spawn:
	45GA A -1
	Stop
 }
}

ACTOR 1337ModdedBulletPuff : LegendaryASGBulletPuff
{
 DamageType "Hackroid"
 Decal "ELegBulletChip"
 +NOTIMEFREEZE
 +NOINTERACTION
 +DONTSPLASH
}

ACTOR 1337SGTracer : SentientExplosiveTracer
{
 Species "Player"
 DamageType "Hackroid"
 +NOTIMEFREEZE
 +THRUSPECIES
 +FOILINVUL
 +NOINTERACTION
 +DONTSPLASH
 Scale 0.5
 States
 {
  Spawn:
	45GT A 1 Bright
  Death:
	TNT1 A 0 A_SetTranslucent(0.75,1)
	TNT1 A 0 A_SpawnItem("EKaboomLN2")
	EISL B 4 Bright A_Explode(Random(18,72),25)
	EISL CD 3 Bright
	Stop
 }
}