////////////////////////////////////////////////////////////////////////////////
//                             NEW GLOBAL DEFS                                //
////////////////////////////////////////////////////////////////////////////////
Actor PlayerNum : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 32
}

Actor ClassID : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 255
}

Actor HumanTeam : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
}

Actor GhoulTeam : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
}

Actor Timer : PowerDamage
{
	DamageFactor "Nothing", 1.0
	Powerup.Duration 35
}

Actor OpenedAchieves : Inventory
{
	inventory.amount 1
	inventory.maxamount 1
}

Actor TeamCounts : Inventory {
	inventory.maxamount 2
}

Actor ClassSwitcher : CustomInventory {
	+AUTOACTIVATE
	+ALWAYSPICKUP
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("ClassCooldown", 1, "Failed")
			TNT1 A 0 A_GiveInventory("ClassCooldown", 1)
			TNT1 A 0 ACS_ExecuteAlways(728)
		Stop
		Failed:
			TNT1 A 0
		Stop
	}
}

Actor ClassCooldown : Powerdamage {
	damagefactor "normal", 1.0
	powerup.duration -1
}

Actor NoTips : HumanTeam { }

Actor IsSjas : GhoulTeam { }
Actor IsJitterskull : GhoulTeam { }
Actor IsCreeper : GhoulTeam { }
Actor IsChoke : GhoulTeam { }
Actor IsFrostbite : GhoulTeam { }
Actor IsDefiler : GhoulTeam { }
Actor IsIcefiend : GhoulTeam { }

Actor MenuCloserEraser : CustomInventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	+INVBAR
	+INVENTORY.UNDROPPABLE
	+INVENTORY.ALWAYSPICKUP
	States
	{
	Spawn:
		TNT1 A 0
		Stop
	Pickup:
	Use:
		TNT1 A 1 ACS_ExecuteAlways(760, 0, tid)
		Stop
	}
}

Actor GBUpgrader : CustomInventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	+INVENTORY.ALWAYSPICKUP
	States
	{
	Spawn:
		TNT1 A 1
		Stop
	Pickup:
		TNT1 A 1
		Stop
	}
}

Actor GBSjasUpgrade : GBUpgrader
{
	States
	{
	Pickup:
		TNT1 A 0 A_GiveInventory("GBSjasUpgradeToken", 1)
		TNT1 A 0 ACS_ExecuteAlways (710, 0, 1)
		Stop
	}
}

Actor GBJitterskullUpgrade : GBUpgrader
{
	States
	{
	Pickup:
		TNT1 A 0 A_GiveInventory("GBJitterskullUpgradeToken", 1)
		TNT1 A 0 ACS_ExecuteAlways (710, 0, 2)
		Stop
	}
}

Actor GBCreeperUpgrade : GBUpgrader
{
	States
	{
	Pickup:
		TNT1 A 0 A_GiveInventory("GBCreeperUpgradeToken", 1)
		TNT1 A 0 ACS_ExecuteAlways (710, 0, 3)
		Stop
	}
}

Actor GBChokeUpgrade : GBUpgrader
{
	States
	{
	Pickup:
		TNT1 A 0 A_GiveInventory("GBChokeUpgradeToken", 1)
		TNT1 A 0 ACS_ExecuteAlways (710, 0, 4)
		Stop
	}
}

Actor GBFrostbiteUpgrade : GBUpgrader
{
	States
	{
	Pickup:
		TNT1 A 0 A_GiveInventory("GBFrostbiteUpgradeToken", 1)
		TNT1 A 0 ACS_ExecuteAlways (710, 0, 5)
		Stop
	}
}

Actor GBDefilerUpgrade : GBUpgrader
{
	States
	{
	Pickup:
		TNT1 A 0 A_GiveInventory("GBDefilerUpgradeToken", 1)
		TNT1 A 0 ACS_ExecuteAlways (710, 0, 6)
		Stop
	}
}

Actor GBIcefiendUpgrade : GBUpgrader
{
	States
	{
	Pickup:
		TNT1 A 0 A_GiveInventory("GBIcefiendUpgradeToken", 1)
		TNT1 A 0 ACS_ExecuteAlways (710, 0, 7)
		Stop
	}
}

Actor GBMohophUpgrade : GBUpgrader
{
	States
	{
	Pickup:
		TNT1 A 0 A_GiveInventory("GBMohophUpgradeToken", 1)
		TNT1 A 0 ACS_ExecuteAlways (710, 0, 8)
		Stop
	}
}

Actor GBMorgwyrUpgrade : GBUpgrader
{
	States
	{
	Pickup:
		TNT1 A 0 A_GiveInventory("GBMorgwyrUpgradeToken", 1)
		TNT1 A 0 ACS_ExecuteAlways (710, 0, 9)
		Stop
	}
}

Actor GBUpgradeToken : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
}

Actor GBSjasUpgradeToken : GBUpgradeToken
{
}

Actor GBJitterskullUpgradeToken : GBUpgradeToken
{
}

Actor GBCreeperUpgradeToken : GBUpgradeToken
{
}

Actor GBChokeUpgradeToken : GBUpgradeToken
{
}

Actor GBFrostbiteUpgradeToken : GBUpgradeToken
{
}

Actor GBDefilerUpgradeToken : GBUpgradeToken
{
}

Actor GBIcefiendUpgradeToken : GBUpgradeToken
{
}

Actor GBMohophUpgradeToken : GBUpgradeToken
{
}

Actor GBMorgwyrUpgradeToken : GBUpgradeToken
{
}

Actor ChokeHealPause : PowerDamage
{
	Powerup.Duration 5
	DamageFactor "Nothing", 1.0
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	States
	{
	Spawn:
		TNT1 A 1
		Stop
	}
}

Actor ChokePainHealer : CustomInventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.AUTOACTIVATE
	States
	{
	Spawn:
		CLIP A -1
		Stop
	Pickup:
	Use:
		TNT1 A 1 ACS_ExecuteAlways(726, 0, 3, 0)
		Stop
	}
}

Actor ChokeDeathHealer : CustomInventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	+INVENTORY.AUTOACTIVATE
	states
	{
	Spawn:
		CLIP A -1
		Stop
	Pickup:
	Use:
		TNT1 A 1 ACS_ExecuteAlways(726, 0, 20, 1)
		Stop
	}
}

Actor CreeperHealBallHealer : CustomInventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.AUTOACTIVATE
	States
	{
	Spawn:
		TNT1 A -1
		Stop
	Pickup:
	Use:
		TNT1 A 1 ACS_ExecuteAlways(737, 0)
		Stop
	}
}

Actor ReflectionKill : CustomInventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	+INVENTORY.AUTOACTIVATE
	States
	{
	Spawn:
		TNT1 A -1
		Stop
	Pickup:
	Use:
		TNT1 A 1 ACS_ExecuteAlways(738, 0)
		Stop
	}
}

Actor DispenserUseCooldown : Timer
{
	Powerup.Duration 35
}

Actor JitterskullPoints : Ammo
{
	Inventory.Amount 1
	Inventory.MaxAmount 5
	+IGNORESKILL
}

Actor ForceReload : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
}

Actor ForceReloadItem : CustomInventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	Inventory.Icon "RLCLA0"
	+INVBAR
	+INVENTORY.UNDROPPABLE
	States
	{
	Spawn:
		TNT1 A -1
		Stop
	Use:
		TNT1 A 1 ACS_ExecuteAlways(745, 0)
		Fail
	}
}

Actor ForceReloadItemEngy : ForceReloadItem
{
	Inventory.Icon "NBOXA0"
}

Actor CyborgPulseGainCooldown : Timer
{
	Powerup.Duration 2
}

Actor DispenserMedKit : CustomInventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 6
	Inventory.Icon "RHO1A0"
	+ALWAYSPICKUP
	+AUTOACTIVATE
	States
	{
	Spawn:
		RHO1 A 1
		Loop
	Use:
		TNT1 A 1 A_GiveInventory("HealthBonus", 10)
		Stop
	}
}

// Sjas Rage effects [Thanks to R667]
// UNUSED I THINK
Actor SjasRageOrb
{
	+MISSILE
	+NOGRAVITY
	+NOBLOCKMAP
	+NOSECTOR 
	+NOINTERACTION 
	+NOCLIP
	+CLIENTSIDEONLY
	-SOLID
	Radius 1
	Height 1
	RenderStyle Add
	Alpha 0.5
	YScale 0.1
	XScale 1.1
	Translation "112:127=176:191"
	States
	{
	Spawn:
		LRFX AAAAAA 1 Bright A_FadeOut(0.25)
		Stop
	}
}

////////////////////////////////////////////////////////////////////////////////
//                             OLD GLOBAL DEFS                                //
////////////////////////////////////////////////////////////////////////////////
Actor ChokeDist : Inventory
{
	inventory.amount 1
	inventory.maxamount 99999
}

Actor Crunched : Inventory
{
	inventory.amount 1
	inventory.maxamount 999
}

actor DontAlterBot : Inventory
{
	inventory.amount 1
	inventory.maxamount 1
	States
	{
	Spawn:
	TNT1 A 1
	loop
	}
}

actor GhoulAmmo : Ammo
{
  inventory.pickupmessage ""
  inventory.amount 3
  inventory.maxamount 3
  inventory.icon "GHOULAMM"
  ammo.backpackamount 3
  ammo.backpackmaxamount 3
  +INVENTORY.IGNORESKILL
  states
  {
  Spawn:
    TNT1 A -1
    stop
  }
}

actor ChokeHealer : CustomInventory
{
	inventory.amount 1
	inventory.maxamount 1
	+INVENTORY.AUTOACTIVATE
	states
	{
	Spawn:
	TNT1 A -1
	stop
	Pickup:
	Use:
	TNT1 A 0 ACS_ExecuteAlways(613,0)//3
	stop
	}
}

actor HealDelay : PowerDamage
{
	damagefactor "nothing", 1.0
	powerup.duration 17
}

actor CreepGotya : CustomInventory
{
	inventory.amount 1
	inventory.maxamount 1
	States
	{
	Spawn:
	TNT1 A 1
	loop
	Pickup:
	ANT1 A 0 A_PlaySoundEx("creepgotya", "SoundSlot5")
	stop
	}
}

actor CreeperStunCheck : Inventory
{
	inventory.amount 1
	inventory.maxamount 1
	States
	{
	Spawn:
	TNT1 A 1
	loop
	}
}

actor Cheapcheck : Inventory // Used to prevent R_Drawtrans false and any other BS settings to cheat.
{
	inventory.amount 1
	inventory.maxamount 1
	States
	{
	Spawn:
	TNT1 A 1
	Loop
	}
}

actor Creeperheal : CustomInventory
{
	inventory.amount 1
	inventory.maxamount 1
	states
	{
	Spawn:
	TNT1 A -1
	stop
	Pickup:
	TNT1 A 0 ACS_ExecuteAlways(979,0,3)
	stop
	}
}

actor Creeperhealth : Health
{
  inventory.amount 70
  inventory.maxamount 70
  states
  {
  Spawn:
    TNT1 A -1
    stop
  }
}

Actor ChokeHealth : Health
{				 
	Inventory.Amount 1
	Inventory.MaxAmount 150
	States
	{
	Spawn:
		TNT1 A 1
		Stop
	}
}

actor Cyborgstomp
{
PROJECTILE
+NOBLOOD
damage 0
radius 10
Speed 20
+CLIENTSIDEONLY
deathsound "CyborgStomp"
States
{
Spawn:
TNT1 A 1
Stop
Death:
TNT1 A 0
TNT1 A 1 //A_PlaySound("CyborgStomp")
Stop
}
}

ACTOR ArchvileFirex : ArchvileFire
{
	Speed 5
	+NOINTERACTION
        +NOBLOCKMAP
        +NOCLIP
		+CLIENTSIDEONLY
}

ACTOR ArchvileFirex2 : ArchvileFirex
{
	Speed 2
}

ACTOR ArchvileFirex3 : ArchvileFirex
{
	translation "160:167=96:111"
}

ACTOR ArchvileFirex4 : SpawnFire replaces TeleportFog
{
+NOINTERACTION
+CLIENTSIDEONLY
renderstyle none // No more giving away spawn spots
translation "160:167=192:207"
States
{
Spawn:
FIRE A 0
FIRE A 0 A_PlaySoundEx("newteleportfog","Voice")
FIRE ABCDEFGH 4 Bright
Stop
}
}

ACTOR TelFire : ArchvileFirex4
{
+NOINTERACTION
+CLIENTSIDEONLY
renderstyle translucent
translation "160:167=192:207"
alpha 0.7
States
{
Spawn:
FIRE A 0
FIRE A 0 A_PlaySoundEx("newteleportfog","Voice")
FIRE ABCDEFGH 4 Bright
Stop
}
}

ACTOR Cuthead replaces Hissy
{
- SOLID
+NOBLOCKMAP
Scale 0.1
States
{
Spawn:
DECR A -1
Loop
}
}

/*
THE NEW TEAMBALANCE STUFF
*/

actor Power15Defense : PowerProtection
{
	damagefactor "normal", 0.85
	Powerup.Duration 0x7FFFFFFF
}

actor Power15Damage : PowerDamage
{
	damagefactor "normal", 1.15
	Powerup.Duration 0x7FFFFFFF
}

actor Power20Damage : PowerDamage
{
	damagefactor "normal", 1.2
	Powerup.Duration 0x7FFFFFFF
}

actor Power25Damage : PowerDamage
{
	damagefactor "normal", 1.25
	Powerup.Duration 0x7FFFFFFF
}

actor Power30Damage : PowerDamage
{
	damagefactor "normal", 1.3
	Powerup.Duration 0x7FFFFFFF
}

Actor DisableHP : Inventory
{
	inventory.maxamount 1
}

Actor NoMore : Inventory
{
	inventory.maxamount 1
}

Actor Lvl2DroneUpgrade : Inventory
{
	inventory.maxamount 1
}

Actor VisionDimmer : Inventory
{
	inventory.amount 1
	inventory.maxamount 10
	+IGNORESKILL
}

Actor DimDurationEffect : Inventory
{
	inventory.amount 1
	inventory.maxamount 10
	+IGNORESKILL
}

Actor VisionDimEffect : CustomInventory
{
	inventory.maxamount 1
	+AUTOACTIVATE
	+ALWAYSPICKUP
	States
	{
		Pickup:
		Use:
			TNT1 A 0 A_SetBlend("70 70 70", 0.9, 105)
		Stop
	}
}

Actor VisionDimEffectLess : CustomInventory
{
	inventory.maxamount 1
	+AUTOACTIVATE
	+ALWAYSPICKUP
	States
	{
		Pickup:
		Use:
			TNT1 A 0 A_SetBlend("70 70 70", 0.9, 50)
		Stop
	}
}

Actor MakeThruSpecies : CustomInventory {
    inventory.maxamount 1
	+AUTOACTIVATE
	+ALWAYSPICKUP
	States {
	    Pickup:
		    TNT1 A 0 A_ChangeFlag("THRUSPECIES", 1)
		Stop
	}
}

Actor ClearThruSpecies : MakeThruSpecies {
	States {
	    Pickup:
		    TNT1 A 0 A_ChangeFlag("THRUSPECIES", 0)
		Stop
	}
}

actor NightmareCloakChargeCooldown : PowerDamage
{
	damagefactor "normal", 1.0
	Powerup.Duration 60
}

Actor NightmareHealer : HealthBonus {
	inventory.amount 25
	inventory.maxamount 300
}