// Invulnerability Sphere ---------------------------------------------------

ACTOR InvulnerabilitySphere_  : PowerupGiver Replaces InvulnerabilitySphere
{
	Game Doom
	SpawnID 133
	+COUNTITEM
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.BIGPOWERUP
	Inventory.MaxAmount 0
	Powerup.Type Invulnerable
	//Powerup.Color White //InverseMap
	Powerup.Colormap 0.0, 0.0, 0.0, 1.0,1.0,1.0
	Inventory.PickupMessage "$GOTINVUL"
	Tag "Invulnerability"
	States
	{
	Spawn:
		PINV AAABBBCCCDDD 2 Bright A_SpawnItem("GreenFlareMedium",0,20)
		Loop
	}
}




// Soulsphere --------------------------------------------------------------

ACTOR LifeSphere : CustomInventory Replaces SoulSphere
{
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	Inventory.PickupMessage "SoulSphere!"
	Inventory.PickupSound "misc/p_pkup"
	Tag "Soulsphere"
	Inventory.MaxAmount 300
	States
	{
	Spawn:
		TNT1 A 0 A_CheckSight("Spawn2")
		SOUL AAABBBCCCDDDCCCBBB 2 Bright A_SpawnItem("BlueFlareMedium2",0,20)
		Loop
	Spawn2:
		SOUL ABCDCB 2 BRIGHT
		Goto Spawn
	Pickup:
        TNT1 AAAAAAAAAAAAA 0 A_CustomMissile ("ShinnySmoke", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 A_GiveInventory("SoulSphereHealth", 1)
		Stop
	}
}

ACTOR SoulSphereHealth : Health	
{
	Inventory.Amount 100
	Inventory.MaxAmount 300
	+INVENTORY.ALWAYSPICKUP
}

ACTOR EnergySphere : CustomInventory Replaces Megasphere
{
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	Inventory.PickupMessage "$GOTMSPHERE"
	Inventory.PickupSound "misc/p_pkup"
	Tag "Megasphere"
	States
	{
	Spawn:
		TNT1 A 0 A_CheckSight("Spawn2")
		MEGA AABBCCDD 2 BRIGHT A_SpawnItem("LensFlare",0,35)
		Loop
	Spawn2:	
		MEGA AABBCCDD 2 BRIGHT
		Goto Spawn
	Pickup:
        TNT1 AAAAAAAAAAAAA 0 A_CustomMissile ("ShinnySmoke", 0, 0, random (0, 360), 2, random (0, 360))
		//TNT1 A 0 A_GiveInventory("HeavyArmor", 1) 
		TNT1 A 0 A_GiveInventory("CoDArmor_6A", 1)
		TNT1 AA 0 A_GiveInventory("SoulsphereHealth", 1)
		Stop
	}
}	


// infrared -----------------------------------------------------------------

ACTOR NightVision : CustomInventory
{
	Game Doom
	SpawnID 138
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	Inventory.PickupMessage "You got the Infrared Vision Googles."
	States
	{
	Spawn:
		TNT1 A 0 A_CheckSight("Spawn2")
		SVIS E 7
		SVIS D 3 Bright A_SpawnItem("RedFlareVerySmall",0,10)
		SVIS C 2 Bright A_SpawnItem("RedFlareVerySmall",0,10)
		SVIS BAB 1 Bright A_SpawnItem("RedFlareVerySmall",0,10)
		SVIS C 2 Bright A_SpawnItem("RedFlareVerySmall",0,10)
		SVIS D 3 Bright A_SpawnItem("RedFlareVerySmall",0,10)
		Loop
	Spawn2:
		SVIS E 4
		SVIS DCBACD 2 BRIGHT
		Goto Spawn
		
	Pickup:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("HasInfrared", 1)
		TNT1 A 0 A_GiveInventory("NightVisionGiver", 1)
		TNT1 A 0 A_GiveInventory("HasInfraRed", 1)
		TNT1 A 0 ACS_ExecuteAlways(398, 0, 0, 0, 0)
		TNT1 A 1
		Stop
		
	}
}


ACTOR NightVisionGiver : PowerupGiver
{
	Game Doom
	SpawnID 138
	+COUNTITEM
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	Inventory.MaxAmount 0
	Powerup.Type Torch
	Powerup.Color 99 99 99
	Inventory.PickupMessage "$GOTVISOR"
	//Powerup.Colormap 0.0, 0.0, 0.0, 1.0,0.5,0.5
	Powerup.Duration 4200
	States
	{
	Spawn:
		SVIS E 7
		SVIS D 3 Bright A_SpawnItem("RedFlareVerySmall",0,10)
		SVIS C 2 Bright A_SpawnItem("RedFlareVerySmall",0,10)
		SVIS BAB 1 Bright A_SpawnItem("RedFlareVerySmall",0,10)
		SVIS C 2 Bright A_SpawnItem("RedFlareVerySmall",0,10)
		SVIS D 3 Bright A_SpawnItem("RedFlareVerySmall",0,10)
		Loop
		
	
	}
}



// Berserk ------------------------------------------------------------------

ACTOR BerserkPack : CustomInventory Replaces Berserk
{
	Game Doom
    Scale 1.2
	SpawnID 134
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	Inventory.PickupMessage "$GOTBERSERK"
	Inventory.PickupSound "misc/p_pkup"
    Inventory.PickupSound "BERSPKUP"
	+Inventory.NEVERRESPAWN
	Tag "Berserk Pack"
	States
	{
	Spawn:
		MEDK C 0
		MEDK C 0 A_SpawnItemEx("EvidenceCheckerbERSERk", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	Spawn1:	
		TNT1 A 0 A_CheckSight("Spawn2")	
		MEDK C 2 A_SpawnItem("RedFlareVerySmall",0,10)
		Loop
	Spawn2:
		MEDK C 14
		Goto Spawn1
	Pickup:
		TNT1 A 0 A_GiveInventory("PowerStrength")
		TNT1 A 0 HealThing(100, 0)
		//TNT1 A 0 ACS_NamedExecuteAlways("GetBerserkEffect")
		//TNT1 A 0 A_SelectWeapon("Melee_Attacks")
		TNT1 A 20
		TNT1 A 0 A_Print ("Press Reload (R) to alternate execution modes")
		Stop
	}
}

ACTOR SuperBlurSphere : CustomInventory //Replaces BlurSphere
{
  +COUNTITEM
  +VISIBILITYPULSE
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  +INVENTORY.BIGPOWERUP
  RenderStyle Translucent
  Inventory.PickupMessage "$GOTINVIS" // "Partial Invisibility"
  States
  {
  Spawn:
     PINS AABBCCDDCCBB 2 Bright A_SpawnItem("RedFlare", 0, 24)
     Loop
  Pickup:
	 TNT1 A 1
     TNT1 A 0 A_GiveInventory("IsInvisible", 1)
	 TNT1 A 0 A_GiveInventory("Blursphere", 1)
	 TNT1 A 0 ACS_ExecuteAlways(397, 0, 0, 0, 0)
	 TNT1 A 1
	 Stop
  }
}


ACTOR DemonStrengthRune : BerserkPack
{
	Game Doom
    Scale 1.0
	SpawnID 134
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	Inventory.PickupMessage "You got the Demon Strength Rune. RIP AND TEAR!"
	Inventory.PickupSound "misc/p_pkup"
	States
	{
	Spawn:
		DPRF AABBCCBB 2 A_SpawnItem("RedFlareSmall",0,20)
		Loop
	Pickup:
		TNT1 A 0 A_GiveInventory("PowerStrength", 1)
		TNT1 A 0 HealThing(10, 0)
		TNT1 A 20
		TNT1 A 0 A_Print ("You got the Demon Strength Rune. RIP AND TEAR!")
		Stop
	}
}


ACTOR RadSuits : CustomInventory Replaces Radsuit
{
  Height 46
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  Inventory.MaxAmount 0
  Inventory.PickupMessage "$GOTSUIT" // "Radiation Shielding Suit"
  States
  {
  Spawn:
    SUIT A 10
	SUIT A 10 BRIGHT
	Loop
  Pickup:
		TNT1 A 0
		TNT1 A 0 A_GiveInventory("Radsuit3", 1)
		TNT1 A 0 A_GiveInventory("Radsuit2", 1)
		Stop	
  }
}

ACTOR RadSuit2 : PowerupGiver
{
  Height 46
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  Inventory.MaxAmount 0
  Inventory.PickupMessage "$GOTSUIT" // "Radiation Shielding Suit"
  Powerup.Type "Mask"
  Powerup.Duration -60
  States
  {
  Spawn:
    SUIT A 10
	SUIT A 10 BRIGHT
	Loop
  }
}



ACTOR RadSuit3 : PowerupGiver
{
  Height 46
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  Inventory.MaxAmount 0
  
  Inventory.PickupMessage "$GOTSUIT" // "Radiation Shielding Suit"
  Powerup.Type "IronFeet"
  States
  {
  Spawn:
    SUIT A 10
	SUIT A 10 BRIGHT
	Loop
  }
}
		
//A randomizer for Demon Runes
ACTOR DemonRuneMix: CustomInventory
{
 scale 1.0
 radius 16
 height 16
 +INVENTORY.BIGPOWERUP
 +THRUGHOST
 damage 0
   Mass 1
   Inventory.PickupMessage "You got the Demon Sphere!"
    States
    {

	 Spawn:
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("DemonRuneCheck")
		TNT1 A 4
	Live:	
		DMRU AABBCCDD 2 Bright A_SpawnItem("RedFlareMedium",0,20)
		Loop
	Pickup:
	    TNT1 A 1
		TNT1 A 0 A_TakeInventory("PowerInvulnerable", 1)
		TNT1 A 0 A_Jump(128, "Pickup2")
		TNT1 A 0 A_GiveInventory("DemonRuneBaron", 1)
		Stop
	Pickup2:
		TNT1 A 1
	    TNT1 A 0 A_GiveInventory("DemonRuneRevenant", 1)
		Stop
	Cancels:
		TNT1 A 0
		Stop
    }
}


actor NightVisionSpawner : RandomSpawner  Replaces InfraRed
{
    DropItem "DemonRuneMix"
    DropItem "NIghtvision"
	DropItem "Flamethrower2"
	Tag "Nightvision/Demon Rune/Flamethrower"
}