//$GZDB_SKIP

//Pickup sound replacements
//I'll eventually add some visual replacements as well.

//Replacements made for heretic.
// Weapons Section ---------------------------------------------------------

actor Dusk_unspecifiedpickup_tomeofpower : RandomSpawner replaces ArtiTomeOfPower
{
    DropItem "SuperShotgun_Pickup", 255, 1
    DropItem "Sword_Pickup", 255, 1
    DropItem "Fastfire_Totem_Pickup", 255, 3
}


actor Dusk_unspecifiedPickup_timebomb : RandomSpawner replaces ArtiTimeBomb
{
    DropItem "Dusk_HealthBonus", 255, 1
    DropItem "Dusk_ArmorBonus", 255, 1
    DropItem "RocketAmmo_heretic", 255, 3
}


//Soap/Blistering heat replacements for heretic.
ACTOR Dusk_ArtiInvisibility : ArtiInvisibility  {}

actor Dusk_unspecifiedPickup_invissphere : RandomSpawner replaces ArtiInvisibility
{
    DropItem "SoapTypeCheck", 255, 1
    DropItem "Dusk_ArtiInvisibility", 255, 3
}


ACTOR Dusk_ArtiEgg : ArtiEgg  {}

actor Dusk_unspecifiedPickup_egg : RandomSpawner replaces ArtiEgg
{
	+NOTDMATCH
    DropItem "Blistering_Heat_Pickup", 255, 1
    DropItem "Dusk_ArtiEgg", 255, 3
}



Actor pistol_spawner_htic : RandomSpawner  replaces Goldwand			{	Dropitem "Pistol_Pickup"	}
Actor winchester_spawner_htic : RandomSpawner  replaces Crossbow		{	Dropitem "Winchester_Pickup"	}
//supershotgun has random chances to appear instead of tome of power.
Actor assrifle_spawner_htic : RandomSpawner  replaces Blaster 			{	Dropitem "AssRifle_Pickup"	}
Actor sniper_spawner_htic : RandomSpawner replaces Gauntlets			{	Dropitem "Sniper_Pickup"	}
Actor crossbow_spawner_htic : RandomSpawner  replaces Skullrod 			{	Dropitem "Crossbow_Pickup"	}
Actor mortar_spawner_htic : RandomSpawner  replaces PhoenixRod 			{	Dropitem "Mortar_Pickup"	}
Actor riveter_spawner_htic : RandomSpawner  replaces MaceSpawner		{	Dropitem "Riveter_Pickup"	}
//Cigar is only obtainable through cheats.








// Ammo Section ------------------------------------------------------------

// Bullets --------------------------------------------------------------------
ACTOR Clip_heretic1 : ClipSmolReplacer replaces GoldWandAmmo			{}
actor ClipBox_heretic1 : ClipSmolBoxReplacer replaces GoldWandHefty	{}

ACTOR Clip_heretic2 : ClipReplacer replaces BlasterAmmo		{}
actor ClipBox_heretic2 : ClipBoxReplacer replaces BlasterHefty	{}


// Rockets ------------------------------------------------------------------
ACTOR RocketAmmo_heretic : RocketAmmoReplacer replaces PhoenixRodAmmo	{}
actor RocketBox_heretic : RocketBoxReplacer replaces PhoenixRodHefty	{}


// Cells --------------------------------------------------------------------
ACTOR Cell_heretic1 : CellReplacer replaces SkullRodAmmo			{}
ACTOR CellPack_heretic1 : CellPackReplacer replaces SkullRodHefty	{}

ACTOR Cell_heretic2 : CellReplacer replaces MaceAmmo				{}
ACTOR CellPack_heretic2 : CellPackReplacer replaces MaceHefty		{}


// Shells ------------------------------------------------------------------
ACTOR Shell_heretic : ShellReplacer replaces CrossbowAmmo			{}
ACTOR ShellBox_heretic : ShellBoxReplacer replaces CrossbowHefty	{}





// Armor Section -----------------------------------------------------------

Actor Dusk_GreenArmor_heretic : Dusk_GreenArmor replaces SilverShield
{
	Inventory.PickupSound "misc/a_pkup"
}

Actor Dusk_BlueArmor_heretic : Dusk_BlueArmor replaces EnchantedShield
{
	Inventory.PickupSound "misc/a_pkup"
}



//health section -------------------------------

ACTOR Dusk_Stimpack_heretic : Dusk_Stimpack replaces CrystalVial
{
	Inventory.PickupSound "misc/h_pkup"
}

ACTOR Dusk_Medikit_heretic : Dusk_Medikit replaces ArtiHealth
{
	Inventory.PickupSound "misc/h_pkup"
}



//Powerups section ---------------------------


ACTOR Dusk_ArtiInvulnerability : PowerupGiver replaces ArtiInvulnerability
{
	Game Heretic
	SpawnID 133
	+COUNTITEM
	+FLOATBOB
	+NOGRAVITY
	+INVENTORY.PICKUPFLASH
	Inventory.RespawnTics 4230
	Inventory.Icon ARTIINVU
	Inventory.PickupMessage "$TXT_ARTIINVULNERABILITY"
	Tag "$TAG_ARTIINVULNERABILITY"
	Powerup.Type Invulnerable
	Powerup.Color Gold
	States
	{
	Spawn:
		INVU ABCD 3
		Loop
	}
}



// Soulsphere/Megasphere --------------------------------------------------------

ACTOR Dusk_Soulsphere_heretic : Dusk_Soulsphere replaces ArtiSuperHealth
{
}


ACTOR Dusk_Heretic_backpack : Dusk_Backpack //replaces BagOfHolding
{
}





Actor BagOfHoldingReplacer replaces BagOfHolding
{
	Monster
	+NONSHOOTABLE
	-SHOOTABLE
	+NOINTERACTION
	-COUNTKILL
	States
	{
	Spawn:
		TNT1 A 1

	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("MultiplayerCheck",0,0,0,0) == 2,"Pack")
//	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("NoBackpackSkirmish",0,0,0,0) == 0,"Pack")
		TNT1 A 0
TNT1 A 0 A_JumpIf(CallACS("nobackpack") == 1,"Soap")

	pack:	TNT1 A 0 A_SpawnItemEx("Dusk_Heretic_BackPack",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION|SXF_TRANSFERAMBUSHFLAG)	Goto End
	soap:	TNT1 A 0 A_SpawnItemEx("SoapTypeCheck",0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION|SXF_TRANSFERAMBUSHFLAG)	Goto End
	
	//-------------------------------------------------------------------------------------------------------
	//	Special / End of spawner states
	//-------------------------------------------------------------------------------------------------------
	End:
		TNT1 A 1 A_Die
		Wait
	Death:
		TNT1 A 1
		Stop
	}
}
