//Bonuses
/*ACTOR DoshRandomizer : RandomSpawner
{
	DropItem Dosh5 255 10
	DropItem Dosh10 255 6
	DropItem Dosh25 255 4
	DropItem Dosh35 255 1
}
	
ACTOR Bonus1_Giver : DoshRandomizer replaces HealthBonus {}
ACTOR Bonus2_Giver : DoshRandomizer replaces ArmorBonus {}*/

ACTOR BlackBonus : Health replaces HealthBonus
{
  Radius 20
  Height 16
  Inventory.Amount 2
  Inventory.MaxAmount 300
  Inventory.PickupMessage "Obtained a black flame sigil."
  Inventory.PickupSound "Bonus/Pickup"
  +COUNTITEM
  +INVENTORY.ALWAYSPICKUP
  Scale 0.8
  States
  {
  Spawn:
    BONB A -1 Bright
    Stop
  }
}

ACTOR PurpleBonus : BasicArmorBonus replaces ArmorBonus
{
  Radius 20
  Height 16
  Inventory.PickupMessage "Obtained a purple scale sigil."
  Inventory.PickupSound "Bonus/Pickup"
  Inventory.Icon "BONAA0"
  Armor.SavePercent 33.335
  Armor.SaveAmount 2
  Armor.MaxSaveAmount 400
  +COUNTITEM
  +INVENTORY.ALWAYSPICKUP
  Scale 0.8
  States
  {
  Spawn:
    BONA A -1
    Stop
  }
}

//Healing Items
ACTOR Stimpack_Giver : RandomSpawner replaces Stimpack
{
	DropItem "MediCaps"
}

ACTOR Medikit_Giver : RandomSpawner replaces Medikit
{
	DropItem "MediPod"
}

//Soulsphere
ACTOR Soulsphere_Giver : RandomSpawner replaces Soulsphere
{
	DropItem "Soulsphere2" 255 20
	DropItem "Medbag" 255 20
	
	DropItem "SurgeBringer" 255 1
	DropItem "BoosterBringer" 255 1
	DropItem "StimulantBringer" 255 1
	DropItem "LifterBringer" 255 1
}

ACTOR Soulsphere2 : Soulsphere
{
  Inventory.MaxAmount 300
  Inventory.PickupMessage "Soulsphere!"
  Inventory.PickupSound "Soulsphere/Pickup"
  Renderstyle Add
  +FLOATBOB
  States
  {
  Spawn:
    //Defining your own, joint functions made of bunch of others would come soooo handy...
	SOUL AA 0 A_SpawnItemEx("SoulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    SOUL AAAA 1 Bright A_SpawnItemEx("SoulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	SOUL B 0 A_SpawnItemEx("SoulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    SOUL BBBB 1 Bright A_SpawnItemEx("SoulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	SOUL A 0 A_SpawnItemEx("SoulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    SOUL CCCC 1 Bright A_SpawnItemEx("SoulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	SOUL A 0 A_SpawnItemEx("SoulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    SOUL DDDD 1 Bright A_SpawnItemEx("SoulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	SOUL E 0 A_SpawnItemEx("SoulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    SOUL EEEE 1 Bright A_SpawnItemEx("SoulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	SOUL F 0 A_SpawnItemEx("SoulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    SOUL FFFF 1 Bright A_SpawnItemEx("SoulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	SOUL E 0 A_SpawnItemEx("SoulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    SOUL EEEE 1 Bright A_SpawnItemEx("SoulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	SOUL D 0 A_SpawnItemEx("SoulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    SOUL DDDD 1 Bright A_SpawnItemEx("SoulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	SOUL C 0 A_SpawnItemEx("SoulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    SOUL CCCC 1 Bright A_SpawnItemEx("SoulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	SOUL B 0 A_SpawnItemEx("SoulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    SOUL BBBB 1 Bright A_SpawnItemEx("SoulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	Loop
  }
}

ACTOR SoulFade
{
  +NOGRAVITY
  +NOINTERACTION
  +NOTONAUTOMAP
  Renderstyle Add
  States
  {
  Spawn:
	SOUL C 1 A_FadeOut(0.12)
	SOUL C 0 A_SetScale(ScaleX+0.02,ScaleX)
	Loop
  }
}

ACTOR MediCaps : Stimpack
{
   inventory.pickupsound "Capsule/Pickup"
   inventory.pickupmessage "Obtained a stimpack."
   States
   {
   Spawn:
		STIM A 1 A_SpawnItemEx("RedParticle",frandom(3.0,-3.0),frandom(3.0,-3.0),7+frandom(10.0,0.0),frandom(0.2,-0.2),frandom(0.2,-0.2),frandom(1.6,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,128)
		Loop
   }
}

ACTOR MediPod : Medikit
{
   Inventory.PickupSound "Capsule/Pickup"
   Inventory.PickupMessage "Obtained a medpack."
   Health.LowMessage 25, "That was a life-saving medpack!"
   Scale 0.9
   States
   {
   Spawn:
		MEDI A 1 A_SpawnItemEx("RedParticle",frandom(5.0,-5.0),frandom(5.0,-5.0),15+frandom(25.0,0.0),frandom(0.2,-0.2),frandom(0.2,-0.2),frandom(1.6,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
		Loop
   } 
}

ACTOR ManaCaps : CustomInventory
{
  Tag "Mana Capsule"
  Inventory.Amount 1
  Inventory.MaxAmount 10
  Inventory.InterHubAmount 10
  Inventory.Icon ARTIMPOD
  Inventory.PickupSound "Capsule/Pickup"
  Inventory.UseSound "Capsule/Use"
  Inventory.PickupMessage "Obtained a mana capsule."
  +INVBAR
  States
  {
  Spawn:
    MPOD A 1 A_SpawnItemEx("BlueParticle",frandom(3.0,-3.0),frandom(3.0,-3.0),7+frandom(10.0,0.0),frandom(0.2,-0.2),frandom(0.2,-0.2),frandom(1.6,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,128)
    Loop
  Use:
	TNT1 A 0 A_JumpIfInventory("Mana",0,"Lolnope")
	TNT1 A 0 A_GiveInventory("Mana",400)
	TNT1 A 0 ACS_NamedExecuteAlways("ManaRegen")
	Stop
  Lolnope:
	TNT1 A 0
	Fail
  }
}

//Armors
ACTOR Armor_Giver : BasicArmorSpawner replaces GreenArmor
{
}

ACTOR Armor_Giver2 : AdvancedArmorSpawner replaces BlueArmor
{
}

//Megasphere
ACTOR Megasphere_Giver : RandomSpawner replaces Megasphere
{
	DropItem "Megasphere2" 255 20
	
	DropItem "SurgeBringer" 255 1
	DropItem "BoosterBringer" 255 1
	DropItem "StimulantBringer" 255 1
	DropItem "LifterBringer" 255 1
}

ACTOR Megasphere2 : Megasphere
{
  Inventory.PickupMessage "Megasphere!"
  Inventory.PickupSound "Megasphere/Pickup"
  Renderstyle Add
  +FLOATBOB
  States
  {
  Spawn:
    MEGA AA 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    MEGA AAAA 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	MEGA B 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    MEGA BBBB 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	MEGA A 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    MEGA CCCC 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	MEGA A 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    MEGA DDDD 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	MEGA E 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    MEGA EEEE 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	MEGA F 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    MEGA FFFF 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	MEGA E 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    MEGA EEEE 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	MEGA D 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    MEGA DDDD 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	MEGA C 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    MEGA CCCC 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	MEGA B 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    MEGA BBBB 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	Loop
  Pickup:
    TNT1 A 0 A_GiveInventory("MegasphereArmor2", 1)
    TNT1 A 0 A_GiveInventory("ArmorPoints", 400)
    TNT1 A 0 A_GiveInventory("MegasphereHealth2", 1)
    Stop
  }
}

ACTOR MegasphereHealth2 : MegasphereHealth
{
  Inventory.Amount 200
  Inventory.MaxAmount 300
}

Actor MegasphereArmor2 : TankArmor
{
	armor.saveamount 200
}

ACTOR MegaFade
{
  +NOGRAVITY
  +NOINTERACTION
  +NOTONAUTOMAP
  Renderstyle Add
  States
  {
  Spawn:
	MEGA C 1 A_FadeOut(0.12)
	MEGA C 0 A_SetScale(ScaleX+0.02,ScaleX)
	Loop
  }
}

//Backpack
ACTOR Backpack_Giver : RandomSpawner replaces Backpack
{
	DropItem "HBackpack"
}

//Light-amp
ACTOR Infrared_Giver : RandomSpawner replaces Infrared
{
	DropItem "WizardsEye" 255 20
	
	DropItem "SurgeBringer" 255 1
	DropItem "BoosterBringer" 255 1
	DropItem "StimulantBringer" 255 1
	DropItem "LifterBringer" 255 1
}

//Blursphere
ACTOR Blursphere_Giver : RandomSpawner replaces Blursphere
{
	DropItem "Reaversphere" 255 20

	DropItem "SurgeBringer" 255 1
	DropItem "BoosterBringer" 255 1
	DropItem "StimulantBringer" 255 1
	DropItem "LifterBringer" 255 1
}

//Radsuit
ACTOR Envirosuit : CustomInventory replaces Radsuit
{
  Inventory.Icon ARTISUIT
  Inventory.PickupMessage "You've got the asbestos suit! Doesn't seem to itch so badly."
  Inventory.MaxAmount 100
  Inventory.Amount 100
  Inventory.InterHubAmount 100
  Inventory.PickupSound "Suit/Pickup"
  Inventory.UseSound ""
  Tag "Asbestos Suit"
  Scale 0.9
  +INVBAR
  +INVENTORY.UNDROPPABLE
  States
  {
  Spawn:
    SUIT A -1
    Stop
  Use:
    TNT1 A 0 A_JumpIfInventory("PowerSuitProtect", 1, "Deactivate")
    TNT1 A 0 A_PlaySound("Suit/In",3)
    TNT1 A 0 A_GiveInventory("EnviroSet")
	TNT1 A 0 ACS_NamedExecuteAlways("ARadsuitThing")
    Fail
  Deactivate:
    TNT1 A 0 A_TakeInventory("PowerSuitProtect",1)
    TNT1 A 0 A_PlaySound("Suit/Out",3)
    Fail
  }
}

ACTOR EnviroSet : PowerupGiver
{
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  Inventory.MaxAmount 0
  Powerup.Type "SuitProtect"
}

ACTOR PowerSuitProtect : PowerProtection
{
  Powerup.Duration 0x7FFFFFFF
  Powerup.Color Orange, 0.05
  Inventory.Icon "ENVMASK0"

  DamageFactor "Normal", 0.85
  DamageFactor "Fire", 0.25
  DamageFactor "Fire2", 0.25
  DamageFactor "Fire3", 0.6
  DamageFactor "Acid", 0.25
  DamageFactor "Ice", 0.6
  DamageFactor "Slime", 0.0
  DamageFactor "Poison", 0.0
  DamageFactor "Sovereign", 0.1
  DamageFactor "Drowning", 0.0
  DamageFactor "PoisonCloud", 0.0
  DamageFactor "InstantDeath", 0.0 //Yes.
  DamageFactor "Lightning", 0.75
}

//The makeshift shop actor
ACTOR EnvirosuitGiver : CustomInventory
{
  Inventory.MaxAmount 0
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  States
  {
  Spawn:
    TNT1 A -1
    Stop
  Pickup:
    TNT1 A 0 A_GiveInventory("Envirosuit",100)
    Stop
  }
}

//Old item left in case I'd figure out something else with it
ACTOR ProtBoots : CustomInventory
{
	 Inventory.PickupMessage "Got yourself a brand-spanking new pair of boots!"
	 Inventory.PickupSound "Boots/Pickup"
	 Inventory.Amount 1
	 +INVENTORY.AUTOACTIVATE
	 +INVENTORY.ALWAYSPICKUP
	 States
	 {
	 Spawn:
	 BOOT A -1
	 Loop
	 Pickup:
	 BOOT A 0 A_GiveInventory("BootProtect")
	 BOOT A 0 A_GiveInventory("BootDamage")
	 Stop
	 }
}

ACTOR BootProtect : Radsuit
{
	 Powerup.Type "IronFoot" //DIS FOOT IS MAED OF LEAD!
	 Inventory.PickupMessage "Got yourself a brand-spanking new pair of boots!"
	 Inventory.PickupSound "Boots/Pickup"
	 Inventory.Amount 1
	 States
	 {
	 Spawn:
	 BOOT A -1
	 Loop
	 }
}

ACTOR PowerIronFoot : PowerIronFeet
{
  Powerup.Duration -60
  Powerup.Color 0, 0, 0, 0.0
  Inventory.Icon "BOOTS0"
}

ACTOR BootDamage : PowerupGiver
{
	 Powerup.Type "BootBlasting" //DIS FOOT BLASTS PEOPL INTO GEEBS!
	 Inventory.PickupMessage "Got yourself a brand-spanking new pair of boots!"
	 Inventory.PickupSound "Boots/Pickup"
	 Inventory.Amount 0
	 +INVENTORY.AUTOACTIVATE
	 +INVENTORY.ALWAYSPICKUP
	 States
	 {
	 Spawn:
	 BOOT A -1
	 Loop
	 }
}

ACTOR PowerBootBlasting : PowerDamage
{
  Powerup.Duration -60
  DamageFactor "Shoelaces", 2.0
  DamageFactor "SuperShoelaces", 2.0
}

ACTOR PowerLifter : SyringePowerup
{
  Inventory.MaxAmount 8
  Inventory.PickupMessage "Obtained Power Lifter! Flight capacity increased!"
  States
  {
  Spawn:
    SYRG D 1 Bright A_SpawnItemEx("YellowParticle",frandom(2.0,-2.0),frandom(2.0,-2.0),30+frandom(20.0,0.0),frandom(0.2,-0.2),frandom(0.2,-0.2),frandom(1.6,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
    Loop
  }
}

ACTOR LifterBringer : SyringeBringer
{
	Inventory.PickupMessage "Obtained Power Lifter! Flight capacity increased!"
	States
	{
	Spawn:
    SYRG D 1 Bright A_SpawnItemEx("YellowParticle",frandom(2.0,-2.0),frandom(2.0,-2.0),30+frandom(20.0,0.0),frandom(0.2,-0.2),frandom(0.2,-0.2),frandom(1.6,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
    Loop
	Pickup:
	TNT1 A 0 A_JumpIfInventory("PowerLifter",0,"Dosh")
	TNT1 A 0 A_GiveInventory("PowerLifter",1)
	Stop
	Dosh:
	TNT1 A 0 A_JumpIfInventory("Dosh",0,"Nope")
	TNT1 A 0 A_GiveInventory("Dosh",500)
	Stop
	Nope:
	TNT1 A 0
	Fail
	}
}

//Berserk
ACTOR Berserk_Giver : RandomSpawner replaces Berserk
{
	DropItem "Gunzerk"
	DropItem "Berserk2"
}

ACTOR Gunzerk : CustomInventory
{
  Inventory.Icon ARTIPSTR
  Inventory.PickupMessage "You've got the Gunzerker pack!"
  Inventory.Amount 1
  Inventory.MaxAmount 5
  Inventory.InterHubAmount 5
  Inventory.PickupSound "Gunzerk/Pickup"
  Inventory.UseSound "Gunzerk/Use"
  Tag "Gunzerker Pack"
  Scale 0.9
  +INVBAR
  +COUNTITEM
  States
  {
  Spawn:
    PSTR A 1 A_SpawnItemEx("PurpleParticle",frandom(5.0,-5.0),frandom(5.0,-5.0),15+frandom(25.0,0.0),frandom(0.2,-0.2),frandom(0.2,-0.2),frandom(1.6,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
    Loop
  Use:
	//TNT1 A 0 A_JumpIfInventory("PowerGunzerking",1,"Nope")
    TNT1 A 0 A_GiveInventory("PowerGunzerking")
	TNT1 A 0 A_GiveInventory("PowerGunzerkingResist")
	TNT1 A 0 A_GiveInventory("GunzerkIcon")
    TNT1 A 0 ACS_NamedExecute("GC Ammo Regen")	
    TNT1 A 0 HealThing(200, 0)
    Stop
  Nope:
	TNT1 A 0
	Fail
  }
}

ACTOR Berserk2 : CustomInventory
{
  Inventory.Icon ARTIBERZ
  Inventory.PickupMessage "You've got the Berserker pack!"
  Inventory.Amount 1
  Inventory.MaxAmount 5
  Inventory.InterHubAmount 5
  Inventory.PickupSound "Berserk/Pickup"
  Inventory.UseSound "Berserk/Use"
  Tag "Berserker Pack"
  Scale 0.9
  +INVBAR
  +COUNTITEM
  States
  {
  Spawn:
    BERZ A 1 A_SpawnItemEx("ZerkParticle",frandom(5.0,-5.0),frandom(5.0,-5.0),15+frandom(25.0,0.0),frandom(0.2,-0.2),frandom(0.2,-0.2),frandom(1.6,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
    Loop
  Use:
	//TNT1 A 0 A_JumpIfInventory("PowerBerserkDamage",1,"Nope")
    TNT1 A 0 A_GiveInventory("PowerBerserking")
	TNT1 A 0 A_GiveInventory("PowerJumping")
	TNT1 A 0 A_GiveInventory("PowerSpeeding")
	TNT1 A 0 A_GiveInventory("PowerBerserkingResist")
	TNT1 A 0 A_GiveInventory("BerserkIcon")
    TNT1 A 0 HealThing(200, 0)
    Stop
  Nope:
	TNT1 A 0
	Fail
  }
}

ACTOR Amplifier : CustomInventory
{
  Inventory.Icon ARTIAMPF
  Inventory.Amount 1
  Inventory.MaxAmount 5
  Inventory.InterHubAmount 5
  Inventory.PickupSound "Amplifier/Pickup"
  Inventory.UseSound "Amplifier/Use"
  Inventory.PickupMessage "You've got an Ancient Amplifier!"
  +COUNTITEM
  +FLOATBOB
  +INVBAR
  States
  {
  Spawn:
    AMPF AAAABBBBCCCCDDDDEEEE 1 Bright A_SpawnItemEx("AmplifierSpark",frandom(3.0,-3.0),frandom(3.0,-3.0),21+frandom(23.0,0.0),frandom(0.05,-0.05),frandom(0.05,-0.05),frandom(0.05,-0.05),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
    Loop
  Use:
  	TNT1 A 0 A_GiveInventory("Amplify")
	TNT1 A 0 A_GiveInventory("AmplifyIcon")
	Stop
  }
}

//Allmap
ACTOR Fullmap : Allmap replaces Allmap
{
  Inventory.MaxAmount 0
  Inventory.PickupSound "Fullmap/Pickup"
  Inventory.PickupMessage "Got a PDA chock-full of vertices!"
  States
  {
  Spawn:
    PMAP ABCDCB 5
    Loop
  }
}

//Invulnerability
ACTOR Invulnerability_Giver : RandomSpawner replaces InvulnerabilitySphere
{
	DropItem "InvulnerabilitySphere2" 255 20
	
	DropItem "SurgeBringer" 255 1
	DropItem "BoosterBringer" 255 1
	DropItem "StimulantBringer" 255 1
	DropItem "LifterBringer" 255 1
}

ACTOR InvulnerabilitySphere2 : InvulnerabilitySphere
{
  Powerup.Type "GodMode"
  Powerup.Color Yellow, 0.05
  Inventory.PickupSound "Invulnerability/Pickup"
  Renderstyle Add
  +FLOATBOB
  +INVENTORY.ADDITIVETIME
  States
  {
  Spawn:
    PINV A 0 A_SpawnItemEx("InvulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    PINV AAAA 1 Bright A_SpawnItemEx("InvulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	PINV B 0 A_SpawnItemEx("InvulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    PINV BBBB 1 Bright A_SpawnItemEx("InvulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	PINV A 0 A_SpawnItemEx("InvulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    PINV CCCC 1 Bright A_SpawnItemEx("InvulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	PINV A 0 A_SpawnItemEx("InvulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    PINV DDDD 1 Bright A_SpawnItemEx("InvulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	PINV E 0 A_SpawnItemEx("InvulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    PINV EEEE 1 Bright A_SpawnItemEx("InvulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	PINV F 0 A_SpawnItemEx("InvulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    PINV FFFF 1 Bright A_SpawnItemEx("InvulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	PINV E 0 A_SpawnItemEx("InvulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    PINV EEEE 1 Bright A_SpawnItemEx("InvulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	PINV D 0 A_SpawnItemEx("InvulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    PINV DDDD 1 Bright A_SpawnItemEx("InvulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	PINV C 0 A_SpawnItemEx("InvulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    PINV CCCC 1 Bright A_SpawnItemEx("InvulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	PINV B 0 A_SpawnItemEx("InvulFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    PINV BBBB 1 Bright A_SpawnItemEx("InvulsphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	Loop
  }
}

ACTOR PowerGodMode : PowerInvulnerable
{
  Powerup.Duration -30
  Inventory.Icon "GDMOD0"
}

ACTOR InvulFade
{
  +NOGRAVITY
  +NOINTERACTION
  +NOTONAUTOMAP
  Renderstyle Add
  States
  {
  Spawn:
	PINV C 1 A_FadeOut(0.12)
	PINV C 0 A_SetScale(ScaleX+0.02,ScaleX)
	Loop
  }
}