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

ACTOR InvulnerabilitySphere_  : PowerupGiver Replaces InvulnerabilitySphere
{
	Game Doom
	SpawnID 133
	+COUNTITEM
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.BIGPOWERUP
	+INVENTORY.NOSCREENFLASH
	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"
	Inventory.PickupSound "misc/p_pkup"
	Tag "Invulnerability"
	States
	{
	Spawn:
		PINV ABCD 6 Bright
		Loop
	}
}

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

ACTOR LifeSphere : CustomInventory Replaces SoulSphere
{
	SpawnID 25
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.NOSCREENFLASH
	Inventory.PickupMessage "Soulsphere"
	Inventory.PickupSound "misc/p_pkup"
	Tag "Soulsphere"
	States
	{
	Spawn:
		SOUL ABCDCB 6 Bright
		Loop
	Pickup:
        TNT1 AAAA 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 200
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.NOSCREENFLASH
}

ACTOR EnergySphere : CustomInventory Replaces Megasphere
{
	SpawnID 132
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.NOSCREENFLASH
	Inventory.PickupMessage "Megasphere"
	Inventory.PickupSound "misc/p_pkup"
	Tag "Megasphere"
	States
	{
	Spawn:
		MEGA ABCD 6 BRIGHT
		Loop
	Pickup:
        TNT1 AAAA 0 A_CustomMissile ("ShinnySmoke", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 A_GiveInventory("HeavyArmor", 1)
		TNT1 AA 0 A_GiveInventory("SoulsphereHealth", 1)
		Stop
	}
}

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

ACTOR NightVision : CustomInventory Replaces InfraRed
{
	Game Doom
	SpawnID 138
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.NOSCREENFLASH
	Inventory.PickupMessage "You got the Infrared Googles."
	Inventory.PickupSound "misc/p_pkup"
	States
	{
	Spawn:
		SVIS ABC 3 BRIGHT
		SVIS DE 3
		Loop

	Pickup:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("HasInfrared", 1)
		TNT1 A 0 A_GiveInventory("NightVisionGiver", 1)
		TNT1 A 0 ACS_NamedExecuteAlways("BDTakeInfraRed", 0, 0, 0, 0)
		TNT1 A 1
		Stop
	}
}

ACTOR NightVisionGiver : PowerupGiver
{
	Game Doom
	+COUNTITEM
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.NOSCREENFLASH
	Inventory.MaxAmount 0
	Powerup.Type Torch
	Powerup.Color 99 99 99
	Inventory.PickupMessage "$GOTVISOR"
	Powerup.Duration -120
	States
	{
	Spawn:
		SVIS ABC 3 BRIGHT
		SVIS DE 3
		Loop
	}
}

ACTOR VehicleInfraredGiver : PowerupGiver
{
	Game Doom
	+COUNTITEM
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.NOSCREENFLASH
	Inventory.MaxAmount 0
	Powerup.Type PowerLightAmp
	Powerup.Color 99 99 99
	Inventory.PickupMessage "$GOTVISOR"
	Powerup.Duration 0x7FFFFFFD
	States
	{
	Spawn:
		SVIS ABC 3 BRIGHT
		SVIS DE 3
		Loop
	}
}

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

ACTOR BerserkPack : CustomInventory Replaces Berserk
{
	Game Doom
    Scale 1.2
	SpawnID 134
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.NOSCREENFLASH
	Inventory.PickupMessage "$GOTBERSERK"
    Inventory.PickupSound "BERSPKUP"
	Tag "Berserk Pack"
	States
	{
	Spawn:
		MEDK C 0
		MEDK C 0 A_SpawnItemEx("EvidenceCheckerBerserk", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	Spawn1:
		MEDK C -1 BRIGHT
		Stop
	Pickup:
		TNT1 A 0 A_GiveInventory("PowerStrength")
		TNT1 A 0 HealThing(100, 0)
		TNT1 A 20
		TNT1 A 0 A_Print ("Press Reload to change execution modes")
		Stop
	}
}

ACTOR SuperBlurSphere : CustomInventory 2054
{
	+COUNTITEM
	+VISIBILITYPULSE
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.BIGPOWERUP
	+INVENTORY.NOSCREENFLASH
	RenderStyle Translucent
	Inventory.PickupMessage "$GOTINVIS" // "Partial Invisibility"
	//$Category BD Power-Ups
	//$Icon "powerup"
	//$Colour rgb(220, 100, 220)
	//$Sprite PINSA0
	//$NotAngled
	States
	{
	Spawn:
		PINS ABCD 6 Bright
		Loop
	Pickup:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("Blursphere", 1)
		TNT1 A 1
		Stop
	}
}

ACTOR DemonStrengthRune : BerserkPack 2053
{
	Game Doom
    Scale 0.6
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.NOSCREENFLASH
	+FLOATBOB
	Inventory.PickupMessage "You got the Demon Strength Rune. RIP AND TEAR!"
	Inventory.PickupSound "misc/p_pkup"
	//$Category BD Power-Ups
	//$Icon "powerup"
	//$Colour rgb(220, 100, 220)
	//$Sprite DPRFA0
	//$NotAngled
	States
	{
	Spawn:
		DPRF ABCB 6 BRIGHT
		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
  SpawnID 136
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  +INVENTORY.NOSCREENFLASH
  Inventory.MaxAmount 0
  Inventory.PickupMessage "$GOTSUIT" // "Radiation Shielding Suit"
  States
  {
  Spawn:
	SUIT A -1 BRIGHT
	Stop
  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.NOSCREENFLASH
  Inventory.MaxAmount 0
  Inventory.PickupMessage "$GOTSUIT" // "Radiation Shielding Suit"
  Powerup.Type "Mask"
  Powerup.Duration -60
  States
  {
  Spawn:
    SUIT A -1 BRIGHT
	Stop
  }
}

ACTOR RadSuit3 : PowerupGiver
{
  Height 46
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  +INVENTORY.NOSCREENFLASH
  Inventory.MaxAmount 0
  Inventory.PickupMessage "$GOTSUIT" // "Radiation Shielding Suit"
  Powerup.Type "IronFeet"
  Powerup.Duration -60
  States
  {
  Spawn:
    SUIT A -1 BRIGHT
	Stop
  }
}

//A randomizer for Demon Runes
ACTOR DemonRuneMix: CustomInventory 2063
{
	Game Doom
	scale 1.0
	radius 20
	height 16
	+INVENTORY.BIGPOWERUP
	+INVENTORY.NOSCREENFLASH
	damage 0
	Mass 1
	Inventory.PickupMessage "You got the Demon Sphere"
	Inventory.PickupSound "misc/p_pkup"
	//$Category BD Power-Ups
	//$Icon "powerup"
	//$Colour rgb(220, 100, 220)
	//$Sprite DMRUA0
	//$NotAngled
    States
    {
	 Spawn:
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("DemonRuneCheck")
		TNT1 A 6
	Live:
		DMRU ABCD 6 BRIGHT
		Loop
	Pickup:
	    TNT1 A 1
		TNT1 A 0 A_TakeInventory("PowerInvulnerable", 1)
		TNT1 A 0 A_Jump(128, "Pickup2")
		TNT1 A 0 ACS_NamedExecute("BaronMorph")
		Stop
	Pickup2:
		TNT1 A 1
	    TNT1 A 0 ACS_NamedExecute("RevenantMorph")
		Stop
	Cancels:
		TNT1 A 1
		TNT1 A 0 A_SpawnItem("DemonStrengthRune")
		Stop
    }
}

ACTOR BaronRune: CustomInventory
{
	Game Doom
	scale 1.0
	radius 20
	height 16
	+INVENTORY.BIGPOWERUP
	+INVENTORY.NOSCREENFLASH
	damage 0
	Mass 1
	Inventory.PickupMessage "You got the Baron Rune"
	Inventory.PickupSound "misc/p_pkup"
	//$Category BD Power-Ups
	//$Icon "powerup"
	//$Colour rgb(220, 100, 220)
	//$Sprite DMRUA0
	//$NotAngled
    States
    {
	 Spawn:
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("DemonRuneCheck")
		TNT1 A 6
	Live:
		DMRU ABCD 6 BRIGHT
		Loop
	Pickup:
	    TNT1 A 1
		TNT1 A 0 A_TakeInventory("PowerInvulnerable", 1)
		TNT1 A 0 ACS_NamedExecute("BaronMorph")
		Stop
	Cancels:
		TNT1 A 1
		TNT1 A 0 A_SpawnItem("DemonStrengthRune")
		Stop
    }
}

ACTOR RevenantRune: CustomInventory
{
	Game Doom
	scale 1.0
	radius 20
	height 16
	+INVENTORY.BIGPOWERUP
	+INVENTORY.NOSCREENFLASH
	damage 0
	Mass 1
	Inventory.PickupMessage "You got the Revenant Rune"
	Inventory.PickupSound "misc/p_pkup"
	//$Category BD Power-Ups
	//$Icon "powerup"
	//$Colour rgb(220, 100, 220)
	//$Sprite DMRUA0
	//$NotAngled
    States
    {
	 Spawn:
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("DemonRuneCheck")
		TNT1 A 6
	Live:
		DMRU ABCD 6 BRIGHT
		Loop
	Pickup:
	    TNT1 A 1
		TNT1 A 0 A_TakeInventory("PowerInvulnerable", 1)
		TNT1 A 0 ACS_NamedExecute("RevenantMorph")
		Stop
	Cancels:
		TNT1 A 1
		TNT1 A 0 A_SpawnItem("DemonStrengthRune")
		Stop
    }
}

/* --- UNMAKER UPGRADES ----------------------------------------------------- */
ACTOR UnmakerUpgrade1Icon : Inventory
{
	Game Doom
	+UNDROPPABLE
	Inventory.MaxAmount 1
}

ACTOR UnmakerUpgrade2Icon : Inventory
{
	Game Doom
	+UNDROPPABLE
	Inventory.MaxAmount 1
}

ACTOR UnmakerUpgrade3Icon : Inventory
{
	Game Doom
	+UNDROPPABLE
	Inventory.MaxAmount 1
}

ACTOR UnmakerUpgrades : Inventory
{
	Game Doom
	+UNDROPPABLE
	Inventory.MaxAmount 3
}

ACTOR 64UnmakerUpgradeSpawner : RandomSpawner
{
	DropItem "64UnmakerUpgrade1"
	DropItem "64UnmakerUpgrade2"
	DropItem "64UnmakerUpgrade3"
}

ACTOR 64UnmakerUpgrade1 : CustomInventory 1042
{
	//Orange Artifact (First Upgrade)
	//$Color 19
	//$Category Doom 64 Retribution
	//$Icon "powerup"
	//$Colour rgb(220,100,220)
	//$Sprite ART1A0
	//$NotAngled
	Game Doom
	Scale 0.6
	Inventory.Amount 1
	Inventory.MaxAmount 1
	Inventory.InterHubAmount 1
	Inventory.Icon "ART1A0"
	Inventory.PickupMessage "$GOTARTIFACT1"
	Inventory.PickupSound "misc/p_pkup"
	+INVENTORY.NOSCREENFLASH
	+DONTGIB
	+COUNTITEM
	-INTERHUBSTRIP
	+FLOATBOB
	States
	{
		Spawn:
			ART1 ABCDEDCB 6 BRIGHT
			Loop
		Pickup:
			TNT1 A 0
			TNT1 A 0 A_JumpIfInventory("IsPlayingAsPurist",1,1)
			Goto Berserk
			TNT1 A 0 A_JumpIfInventory("UnmakerUpgrade1Icon", 1, "AlreadyTaken")
			TNT1 A 0 A_GiveInventory("UnmakerUpgrades", 1)
			TNT1 A 0 A_GiveInventory("UnmakerUpgrade1Icon", 1)
			Stop
		Berserk:
			TNT1 A 0 A_GiveInventory("PowerStrength", 1)
			TNT1 A 0 HealThing(100, 0)
			TNT1 A 20
			TNT1 A 0 A_Print ("You got the Demon Strength Rune. RIP AND TEAR!")
			Stop
		AlreadyTaken:
			TNT1 A 0
			Fail
	}
}

ACTOR 64UnmakerUpgrade2 : CustomInventory 1043
{
	// Purple Artifact (Second Upgrade)
	//$Color 5
	//$Category Doom 64 Retribution
	//$Icon "powerup"
	//$Colour rgb(220,100,220)
	//$Sprite ART2A0
	//$NotAngled
	Game Doom
	Scale 0.6
	Inventory.Amount 1
	Inventory.MaxAmount 1
	Inventory.InterHubAmount 1
	Inventory.Icon "ART2A0"
	Inventory.PickupMessage "$GOTARTIFACT2"
	Inventory.PickupSound "misc/p_pkup"
	+INVENTORY.NOSCREENFLASH
	+DONTGIB
	+COUNTITEM
	-INTERHUBSTRIP
	+FLOATBOB
	States
	{
		Spawn:
			ART2 ABCDEDCB 6 BRIGHT
			Loop
		Pickup:
			TNT1 A 0
			TNT1 A 0 A_JumpIfInventory("IsPlayingAsPurist",1,1)
			Goto Berserk
			TNT1 A 0 A_JumpIfInventory("UnmakerUpgrade2Icon", 1, "AlreadyTaken")
			TNT1 A 0 A_GiveInventory("UnmakerUpgrades", 1)
			TNT1 A 0 A_GiveInventory("UnmakerUpgrade2Icon", 1)
			Stop
		Berserk:
			TNT1 A 0 A_GiveInventory("PowerStrength", 1)
			TNT1 A 0 HealThing(100, 0)
			TNT1 A 20
			TNT1 A 0 A_Print ("You got the Demon Strength Rune. RIP AND TEAR!")
			Stop
		AlreadyTaken:
			TNT1 A 0
			Fail
	}
}

ACTOR 64UnmakerUpgrade3 : CustomInventory 1044
{
	// Cyan Artifact (Third Upgrade)
	//$Color 3
	//$Category Doom 64 Retribution
	//$Icon "powerup"
	//$Colour rgb(220,100,220)
	//$Sprite ART3A0
	//$NotAngled
	Game Doom
	Scale 0.6
	Inventory.Amount 1
	Inventory.MaxAmount 1
	Inventory.InterHubAmount 1
	Inventory.Icon "ART3A0"
	Inventory.PickupMessage "$GOTARTIFACT3"
	Inventory.PickupSound "misc/p_pkup"
	+INVENTORY.NOSCREENFLASH
	+DONTGIB
	+COUNTITEM
	-INTERHUBSTRIP
	+FLOATBOB
	States
	{
		Spawn:
			ART3 ABCDEDCB 6 BRIGHT
			Loop
		Pickup:
			TNT1 A 0
			TNT1 A 0 A_JumpIfInventory("IsPlayingAsPurist",1,1)
			Goto Berserk
			TNT1 A 0 A_JumpIfInventory("UnmakerUpgrade3Icon", 1, "AlreadyTaken")
			TNT1 A 0 A_GiveInventory("UnmakerUpgrades", 1)
			TNT1 A 0 A_GiveInventory("UnmakerUpgrade3Icon", 1)
			Stop
		Berserk:
			TNT1 A 0 A_GiveInventory("PowerStrength", 1)
			TNT1 A 0 HealThing(100, 0)
			TNT1 A 20
			TNT1 A 0 A_Print ("You got the Demon Strength Rune. RIP AND TEAR!")
			Stop
		AlreadyTaken:
			TNT1 A 0
			Fail
	}
}