Actor TerminatorItem : CustomInventory replaces Terminator
{
Mass 1
Gravity 1.0
+COUNTITEM
-FLOAT
+FLOATBOB
-NOGRAVITY
+NOTIMEFREEZE
+FORCEXYBILLBOARD
+INVENTORY.BIGPOWERUP
+INVENTORY.AUTOACTIVATE
Inventory.MaxAmount 0
Inventory.PickupSound "misc/p_pkup"
Inventory.PickupMessage "TERMINATOR!"
Tag "Terminator Artifact"
States
  {
  Spawn:
    TNT1 A 0 A_CustomMissile ("LegendaryOrangeSparkleSpawner", 0, 0, random(0,-360), 2, random(0,360)) 
    ARNO AABB 1 Bright A_SpawnItem("LegendaryRedSphereFlare",0,38)
    TNT1 A 0 A_CustomMissile ("LegendaryOrangeSparkleSpawner", 0, 0, random(0,-360), 2, random(0,360))
    ARNO CCDD 1 Bright A_SpawnItem("LegendaryRedSphereFlare",0,38)
	Loop
  Pickup:
	TNT1 A 0
	TNT1 A 0 A_JumpIfInventory("TerminatorDamage2",1,"FuckGoBack")
	TNT1 A 0 A_JumpIfInventory("TerminatorDamage",1,"Upgrade")
	TNT1 A 0 Healthing(670,670)
	TNT1 A 0 A_Print("TERMINATOR SPHERE! Double Damage to all your weapons!!")
	TNT1 A 0 A_GiveInventory("HellfireArmor",1)
	TNT1 A 0 A_GiveInventory("TerminatorCheck",1)
	TNT1 A 1 A_GiveInventory("TerminatorDamage",1)
	Stop
  Upgrade:
	TNT1 A 0
	TNT1 A 0 Healthing(777,777)
	TNT1 A 0 A_Print("UPGRADED TERMINATOR SPHERE! QUADRUPLE DAMAGE to all of your weapons!!")
	TNT1 A 0 A_GiveInventory("HellfireArmor",1)
	TNT1 A 0 A_TakeInventory("TerminatorDamage",1)
	TNT1 A 0 A_TakeInventory("TerminatorCheck",1)
	TNT1 A 0 A_GiveInventory("TerminatorCheck2",1)
	TNT1 A 1 A_GiveInventory("TerminatorDamage2",1)
	Stop
  FuckGoBack:
	TNT1 A 1
	Fail
  }
}
ACTOR TerminatorCheck : Weapon {
	Weapon.SelectionOrder 99999
	+WEAPON.NOALERT
	+INVENTORY.UNDROPPABLE
	+WEAPON.CHEATNOTWEAPON
	+WEAPON.NO_AUTO_SWITCH
    +NOTIMEFREEZE
	States {
	Spawn:
	TNT1 A 0
	Ready:
	TNT1 A 0
	Deselect:
	TNT1 A 0
	Select:
	TNT1 A 0
	Fire:
	TNT1 A 0
	Stop
	}
}
ACTOR TerminatorCheck2 : Weapon {
	Weapon.SelectionOrder 99999
	+WEAPON.NOALERT
	+INVENTORY.UNDROPPABLE
	+WEAPON.CHEATNOTWEAPON
	+WEAPON.NO_AUTO_SWITCH
    +NOTIMEFREEZE
	States {
	Spawn:
	TNT1 A 0
	Ready:
	TNT1 A 0
	Deselect:
	TNT1 A 0
	Select:
	TNT1 A 0
	Fire:
	TNT1 A 0
	Stop
	}
}


ACTOR "CWAmmoPack" : "AmmoPack " Replaces "AmmoPack "
{
Scale 0.8
Inventory.Amount 1
Inventory.MaxAmount 5
Inventory.InterHubAmount 5
Inventory.PickupSound "pickups/iammosatchel"
Inventory.UseSound "Null"
Inventory.PickupMessage "Ammo Satchel"
Inventory.Icon "INASA0"
+INVENTORY.INVBAR
+FLOORCLIP
States
  {
  Spawn:
      ASAT A -1
      Stop
  Use:
      //TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("AmmoFull", 0) == 2, "Full") Commented out until I can figure out how to fix the ACS script so it works with all the ammo types
	  TNT1 A 0 A_PlaySound("ammosatchel/use")
	  TNT1 A 0 A_GiveInventory("BulletMag",20)
	  TNT1 A 0 A_GiveInventory("LegendaryLMGBulletMag",10)
	  TNT1 A 0 A_GiveInventory("NewShell",8)
	  TNT1 A 0 A_GiveInventory("LegendaryShell",4)
	  TNT1 A 0 A_GiveInventory("Gas",20)
	  TNT1 A 0 A_GiveInventory("EnragedLegendaryShell",10)
	  TNT1 A 0 A_GiveInventory("ELegendaryLMGBulletMag",10)
	  TNT1 A 0 A_GiveInventory("ILDemonAmmo",10)
	  TNT1 A 0 A_GiveInventory("Missile",4)
	  TNT1 A 0 A_GiveInventory("NewCell",20)
	  TNT1 A 0 A_GiveInventory("DemonAmmo",20)
	  TNT1 A 0 A_GiveInventory("LDemonAmmo",10)
	  TNT1 A 0 A_GiveInventory("LegendaryBulletMag",10)
	  TNT1 A 0 A_GiveInventory("LegendaryCell",10)
	  TNT1 A 0 A_GiveInventory("HadesCrystal",10)
	  TNT1 A 0 A_GiveInventory("AcidAmmo",10)
	  TNT1 A 0 A_GiveInventory("DustMana",10)
	  TNT1 A 0 A_GiveInventory("ProxMines",5)
	  TNT1 A 0 A_GiveInventory("HandGrenadeAmmo",1)
	  TNT1 A 0 A_GiveInventory("MineAmmo",1)
	  TNT1 A 0 A_GiveInventory("DCell",1)
	  TNT1 A 0 A_GiveInventory("NemesisShell",4)
	  TNT1 A 0 A_GiveInventory("NLDemonAmmo",5)
	  TNT1 A 0 A_GiveInventory("VexNemDemonAmmo",2)
	  TNT1 A 0 A_GiveInventory("TrueLegendaryCell",5)
	  Stop
  Full:
      TNT1 A 0
	  Fail
  }
}

Actor AmmoRegenerate : PowerTargeter
{
-COUNTITEM
+NOTIMEFREEZE
+INVENTORY.PERSISTENTPOWER
Powerup.Duration -60
States
	{
	Targeter:
		TNT1 A 0
		TNT1 A 35
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("Hem_GetCurrentHealth") > 0,2)
		TNT1 A 0 A_Jump(256,9)
		TNT1 A 0 A_GiveInventory("BulletMag",1)
		TNT1 A 0 A_GiveInventory("LegendaryLMGBulletMag",1)
		TNT1 A 0 A_GiveInventory("NewShell",1)
		TNT1 A 0 A_GiveInventory("LegendaryShell",1)
		TNT1 A 0 A_GiveInventory("Gas",1)
		TNT1 A 0 A_GiveInventory("EnragedLegendaryShell",1)
		TNT1 A 0 A_GiveInventory("ELegendaryLMGBulletMag",1)
		TNT1 A 0 A_GiveInventory("ILDemonAmmo",1)
		TNT1 A 0 A_GiveInventory("Missile",1)
		TNT1 A 0 A_GiveInventory("NewCell",1)
		TNT1 A 0 A_GiveInventory("DemonAmmo",1)
		TNT1 A 0 A_GiveInventory("LDemonAmmo",1)
		TNT1 A 0 A_GiveInventory("LegendaryBulletMag",1)
		TNT1 A 0 A_GiveInventory("LegendaryCell",1)
		TNT1 A 0 A_GiveInventory("HadesCrystal",1)
		TNT1 A 0 A_GiveInventory("AcidAmmo",1)
		TNT1 A 0 A_GiveInventory("DustMana",1)
		TNT1 A 0 A_GiveInventory("ProxMines",1)
		TNT1 A 0 A_GiveInventory("HandGrenadeAmmo",1)
		TNT1 A 0 A_GiveInventory("MineAmmo",1)
		TNT1 A 0 A_GiveInventory("DCell",1)
		TNT1 A 0 A_GiveInventory("NLDemonAmmo",1)
		TNT1 A 0 A_GiveInventory("NemesisShell",1)
		TNT1 A 0 A_GiveInventory("NLDemonAmmo",1)
		TNT1 A 0 A_GiveInventory("VexNemDemonAmmo",1)
		TNT1 A 0 A_GiveInventory("TrueLegendaryCell",1)
		Loop
		TNT1 A 1
		Stop
	}
}

Actor FullCombatPackFIX : CustomInventory replaces FullCombatPack
{
Height 36
+INVENTORY.ALWAYSPICKUP
Inventory.PickupSound "items/pack"
Inventory.PickupMessage "You got a full combat pack."
States
	{
	Spawn:
		CFLT A -1
		Loop
	Pickup:
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteWithResult("MaxAmmoCapacity", 0)
	    TNT1 A 0 A_GiveInventory("BulletMag",200)
	    TNT1 A 0 A_GiveInventory("LegendaryLMGBulletMag",60)
		TNT1 A 0 A_GiveInventory("LegendaryBulletMag",60)
		TNT1 A 0 A_GiveInventory("ELegendaryLMGBulletMag",60)
		TNT1 A 0 A_GiveInventory("ELegendaryLMGBulletMag",60)
	    TNT1 A 0 A_GiveInventory("NewShell",50)
	    TNT1 A 0 A_GiveInventory("LegendaryShell",18)
		TNT1 A 0 A_GiveInventory("LegendaryCell",100)
	    TNT1 A 0 A_GiveInventory("EnragedLegendaryShell",18)
	    TNT1 A 0 A_GiveInventory("Missile",50)
	    TNT1 A 0 A_GiveInventory("Gas",300)
	    TNT1 A 0 A_GiveInventory("NewCell",300)
	    TNT1 A 0 A_GiveInventory("DemonAmmo",300)
	    TNT1 A 0 A_GiveInventory("LDemonAmmo",100)
	    TNT1 A 0 A_GiveInventory("ILDemonAmmo",100)
		TNT1 A 0 A_GiveInventory("HadesCrystal",300)
    	TNT1 A 0 A_GiveInventory("AcidAmmo",150)
		TNT1 A 0 A_GiveInventory("DustMana",150)
		TNT1 A 0 A_GiveInventory("ProxMines",5)
	    TNT1 A 0 A_GiveInventory("HandGrenadeAmmo",4)
	    TNT1 A 0 A_GiveInventory("MineAmmo",4)
		TNT1 A 0 A_GiveInventory("NLDemonAmmo",16)
		TNT1 A 0 A_GiveInventory("NemesisShell",5)
		TNT1 A 0 A_GiveInventory("DCell",10)
		TNT1 A 0 A_GiveInventory("BeaconArmorBonus")
		TNT1 A 0 A_GiveInventory("SpringMine",3)
		TNT1 A 0 A_GiveInventory("VexNemDemonAmmo",8)
		TNT1 A 0 A_GiveInventory("TrueLegendaryCell",25)
		TNT1 A 1 Healthing(10,200)
		Stop
	}
}

ACTOR FullBackpackFIX : FullBackpack Replaces FullBackpack
{
-INVENTORY.ALWAYSPICKUP
Height 36
Inventory.PickupMessage "You picked up a full reinforcement backpack!"
States
	{
	Spawn:
		TNT1 A 0
	SpawnLoop:
		FLPK ABCD 4
		Loop
    Remove:
		TNT1 A 0
		Stop
	Pickup:
		TNT1 A 0 ACS_NamedExecuteWithResult("MaxAmmoCapacity", 0)
	    TNT1 A 0 A_GiveInventory("BulletMag",200)
	    TNT1 A 0 A_GiveInventory("LegendaryLMGBulletMag",60)
		TNT1 A 0 A_GiveInventory("LegendaryBulletMag",60)
		TNT1 A 0 A_GiveInventory("ELegendaryLMGBulletMag",60)
		TNT1 A 0 A_GiveInventory("ELegendaryLMGBulletMag",60)
	    TNT1 A 0 A_GiveInventory("NewShell",50)
	    TNT1 A 0 A_GiveInventory("LegendaryShell",18)
		TNT1 A 0 A_GiveInventory("LegendaryCell",100)
	    TNT1 A 0 A_GiveInventory("EnragedLegendaryShell",18)
	    TNT1 A 0 A_GiveInventory("Missile",50)
		TNT1 A 0 A_GiveInventory("Gas",300)
	    TNT1 A 0 A_GiveInventory("NewCell",300)
	    TNT1 A 0 A_GiveInventory("DemonAmmo",300)
	    TNT1 A 0 A_GiveInventory("LDemonAmmo",100)
	    TNT1 A 0 A_GiveInventory("ILDemonAmmo",100)
	    TNT1 A 0 A_GiveInventory("HadesCrystal",300)
	    TNT1 A 0 A_GiveInventory("AcidAmmo",150)
		TNT1 A 0 A_GiveInventory("DustMana",150)
		TNT1 A 0 A_GiveInventory("ProxMines",5)
	    TNT1 A 0 A_GiveInventory("HandGrenadeAmmo",4)
	    TNT1 A 0 A_GiveInventory("MineAmmo",4)
		TNT1 A 0 A_GiveInventory("NLDemonAmmo",16)
		TNT1 A 0 A_GiveInventory("NemesisShell",5)
		TNT1 A 0 A_GiveInventory("DCell",10)
		TNT1 A 0 A_GiveInventory("SpringMine",3)
		TNT1 A 0 A_GiveInventory("VexNemDemonAmmo",8)
		TNT1 A 0 A_GiveInventory("TrueLegendaryCell",25)
		TNT1 A 0 A_GiveInventory("BeaconArmorBonus",1)
		TNT1 A 0 A_Jumpif(ACS_NamedExecuteWithResult("Supplybackpack") == 2, "Random")
		TNT1 A 0 A_GiveInventory("FullBeaconSupplyPickup",1)
	    TNT1 A 1 Healthing(100)
 	    TNT1 A 1 Healthing(15,200)
		Stop
    Random:
		TNT1 A 0 A_GiveInventory("RandomBeaconSupplyPickup",1)
	    TNT1 A 1 Healthing(100)
 	    TNT1 A 1 Healthing(10,200)
	}
}

ACTOR CWArkBackpack : ArkBackPack Replaces FakeArkBackpack
{
States
	{
	Spawn:
		ABPK ABCD 4
		Loop
	Pickup:
		TNT1 A 0
		TNT1 A 0 A_GiveInventory("BulletMag",200)
		TNT1 A 0 A_GiveInventory("LegendaryLMGBulletMag",100)
		TNT1 A 0 A_GiveInventory("NewShell",80)
		TNT1 A 0 A_GiveInventory("LegendaryShell",40)
		TNT1 A 0 A_GiveInventory("Gas",200)
		TNT1 A 0 A_GiveInventory("EnragedLegendaryShell",100)
		TNT1 A 0 A_GiveInventory("ELegendaryLMGBulletMag",100)
		TNT1 A 0 A_GiveInventory("ILDemonAmmo",100)
		TNT1 A 0 A_GiveInventory("Missile",40)
		TNT1 A 0 A_GiveInventory("NewCell",200)
		TNT1 A 0 A_GiveInventory("DemonAmmo",200)
		TNT1 A 0 A_GiveInventory("LDemonAmmo",100)
		TNT1 A 0 A_GiveInventory("LegendaryBulletMag",100)
		TNT1 A 0 A_GiveInventory("LegendaryCell",100)
		TNT1 A 0 A_GiveInventory("HadesCrystal",100)
		TNT1 A 0 A_GiveInventory("AcidAmmo",100)
		TNT1 A 0 A_GiveInventory("DustMana",100)
		TNT1 A 0 A_GiveInventory("ProxMines",50)
		TNT1 A 0 A_GiveInventory("HandGrenadeAmmo",1)
		TNT1 A 0 A_GiveInventory("MineAmmo",1)
		TNT1 A 0 A_GiveInventory("DCell",10)
		TNT1 A 0 A_GiveInventory("NemesisShell",40)
		TNT1 A 0 A_GiveInventory("NLDemonAmmo",50)
		TNT1 A 0 A_GiveInventory("VexNemDemonAmmo",20)
		TNT1 A 0 A_GiveInventory("TrueLegendaryCell",50)
		TNT1 A 0 A_GiveInventory("ArmorBoostGiver", 1)
		TNT1 A 1 Healthing(100)
		Stop
	}
}