// This file was created for Satanic Redux, by amv2k9. It's purpose? 
// Redefinition of artifacts to allow for dynamic lights, and definitions of 
// "abilities" that replace Doom artifacts.

ACTOR NecroDoll : CustomInventory
{
	Inventory.PickupMessage "you got a necromancer doll... uh, fully articulated action figure! now with gut-tear action!"
	-INVBAR
	States
	{
	Spawn:
		SDOL A -1
		Stop
	Pickup: 
		TNT1 A 0 A_GiveInventory ("Backpack",1)
		TNT1 A 0 A_GiveInventory ("Satanic_KindredGenesisGiver", 1)
		TNT1 A 0 A_GiveInventory ("Satanic_ClockOfDoom",2)
		TNT1 A 0 A_GiveInventory ("Satanic_ShadowBookWrapper",1)
		TNT1 A 0 A_GiveInventory ("Satanic_SoulAmmo",400)
		TNT1 A 0 A_GiveInventory ("Satanic_Shotgun",1)
		TNT1 A 0 A_GiveInventory ("Satanic_Head", 1)
		TNT1 A 0 A_GiveInventory ("Satanic_HeadAmmo", 60)
		TNT1 A 0 A_GiveInventory ("Satanic_EagleCartridgeAmmo", 16)
		TNT1 A 0 A_GiveInventory ("Satanic_Clip", 160)
		TNT1 A 0 A_GiveInventory ("Satanic_ShotgunCartridgeAmmo", 8)
		TNT1 A 0 A_GiveInventory ("Satanic_Shell", 56)
		TNT1 A 0 A_GiveInventory ("Satanic_StaffOfSuffering",1)
		TNT1 A 0 A_GiveInventory ("Satanic_HellfireDevice",1)
		TNT1 A 0 A_GiveInventory ("Satanic_HellfireDeviceAmmo", 100)
		TNT1 A 0 A_GiveInventory ("Satanic_Vengeful",1)
		TNT1 A 0 A_GiveInventory ("Satanic_VengefulAmmo", 30)
		TNT1 A 0 A_GiveInventory ("Satanic_Leech",1)
		TNT1 A 0 A_GiveInventory ("Satanic_DarkChaos",1)
		Stop 
  }
}

ACTOR NecroDoll2 : CustomInventory
{
	Inventory.PickupMessage "you got a necromancer doll... uh, fully articulated action figure! now with gut-tear action!"
	-INVBAR
	States
	{
	Spawn:
		SDOL A -1
		Stop
	Pickup: 
		TNT1 A 0 A_GiveInventory ("Backpack",1)
		TNT1 A 0 A_GiveInventory ("Satanic_SoulAmmo",400)
		TNT1 A 0 A_GiveInventory ("Satanic_ClockOfDoom",2)
		TNT1 A 0 A_GiveInventory ("Satanic_Leech2",1)
		TNT1 A 0 A_GiveInventory ("Satanic_EagleCartridgeAmmo", 16)
		TNT1 A 0 A_GiveInventory ("Satanic_Clip", 160)
		TNT1 A 0 A_GiveInventory ("Satanic_Shotgun",1)
		TNT1 A 0 A_GiveInventory ("Satanic_ShotgunCartridgeAmmo", 8)
		TNT1 A 0 A_GiveInventory ("Satanic_Shell", 56)
		TNT1 A 0 A_GiveInventory ("Satanic_TaintedCross", 1)
		TNT1 A 0 A_GiveInventory ("Satanic_Vengeful2",1)
		TNT1 A 0 A_GiveInventory ("Satanic_VengefulAmmo", 30)
		TNT1 A 0 A_GiveInventory ("Satanic_StaffOfSuffering2",1)
		TNT1 A 0 A_GiveInventory ("Satanic_DarkChaos2",1)
		Stop 
	}
}

ACTOR CompMap : AllMap replaces AllMap
{
	States
	{
	Spawn:
		PMAP A 6 Bright Light ("mappickuplight1")
		PMAP B 6 Bright Light ("mappickuplight2")
		PMAP C 6 Bright Light ("mappickuplight3")
		PMAP D 6 Bright Light ("mappickuplight2")
		PMAP C 6 Bright Light ("mappickuplight3")
		PMAP B 6 Bright Light ("mappickuplight2")
		Loop
	}
}

ACTOR NecroVision : CustomInventory
{
	+COUNTITEM
	+INVENTORY.INVBAR
	Inventory.Icon "NCRVA0"
	Tag "NecroVision - 20 mana"
	States
	{
	Spawn:
		TNT1 A -1
		Stop
	Use:
		TNT1 A 0 A_JumpIfInventory("PowerNecVis",1,"TakePower")
		TNT1 A 0 A_GiveInventory("NecVisAbility",1)
		TNT1 A 0 ACS_ExecuteAlways(769,0,20,0,0)
		Fail
	TakePower:
		TNT1 A 0 A_TakeInventory("PowerNecVis",1)
		Fail
	}
}

ACTOR NecVisAbility : Infrared
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	Powerup.Type NecVis
	States
	{
	Spawn:
		TNT1 A -1
		Loop
	}
}

ACTOR PowerNecVis : PowerLightAmp
{
	Powerup.Colormap 0, 0, 0, 1, 0, 0
	Powerup.Duration -60
}

ACTOR NecroBarrier : CustomInventory
{
	+COUNTITEM
	+INVENTORY.INVBAR
	Inventory.Icon "NCBRA0"
	Tag "NecroBarrier - 50 mana"
	States
	{
	Spawn:
		TNT1 A -1
		Stop
	Use:
		TNT1 A 0 A_JumpIfInventory("PowerNecShroud",1,"TakeNecShroud")
	Continue:	
		TNT1 A 0 A_JumpIfInventory("PowerNecBar",1,"ManualDeactivate")
		TNT1 A 0 A_GiveInventory("NecroBarrierArmor",1)
		TNT1 A 0 A_GiveInventory("NecBarAbility",1)
		TNT1 A 0 ACS_ExecuteAlways(769,0,50,0,0)
		Fail
	ManualDeactivate:
		TNT1 A 0 ACS_ExecuteAlways(820,0,1,0,0)
		TNT1 A 0 A_TakeInventory("PowerNecBar",1)
		Fail
	TakeNecShroud:
		TNT1 A 0 A_TakeInventory("PowerNecShroud")
		Goto Continue
	}
}

ACTOR NecBarAbility : RadSuit
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	Powerup.Type NecBar
	States
	{
	Spawn:
		TNT1 A -1
		Loop
	}
}

ACTOR PowerNecBar : PowerIronFeet
{
	Powerup.Color 255,0,0,0.175
	Powerup.Duration -60
}

ACTOR NecroBarrierArmor : GreenArmor
{
	Inventory.Icon "NCBRA0"
	Armor.SavePercent 30
	Armor.SaveAmount 100
}

ACTOR NecroShroud : CustomInventory
{
	+COUNTITEM
	+INVBAR
	Inventory.Icon "NCSHA0"
	Tag "NecroShroud - 50 mana"
	States
	{
	Spawn:
		TNT1 A -1
		Stop
	Use:
		TNT1 A 0 A_JumpIfInventory("PowerNecBar",1,"TakeNecroBarrier")
	Continue:
		TNT1 A 0 A_JumpIfInventory("PowerNecShroud",1,"ManualDeactivate")
		TNT1 A 0 A_SetBlend("FF FF FF",0.60,15)
		TNT1 A 0 A_GiveInventory("NecShroudAbility")
		TNT1 A 0 A_GiveInventory("Satanic_ShroudWeapon")
		TNT1 A 0 A_SelectWeapon("Satanic_ShroudWeapon")
		TNT1 A 0 ACS_ExecuteAlways(769,0,50,0,0)
		Fail
	ManualDeactivate:
		TNT1 A 0 A_TakeInventory("PowerNecShroud")
		TNT1 A 0 A_TakeInventory("Satanic_ShroudWeapon")
		Fail
	TakeNecroBarrier:
		TNT1 A 0 ACS_ExecuteAlways(820,0,1,0,0)
		TNT1 A 0 A_TakeInventory("PowerNecBar",1)
		Goto Continue
	}
}

ACTOR NecShroudAbility : BlurSphere
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
	Powerup.Type NecShroud
	States
	{
	Spawn:
		TNT1 A -1
		Loop
	}
}

ACTOR PowerNecShroud : PowerInvisibility
{
	Powerup.Duration -30
	Powerup.Color 0,0,0,0.130
}

ACTOR ShadowSigil : CustomInventory
{
	+COUNTITEM
	+INVENTORY.INVBAR
	Inventory.Icon "SIGLA0"
	Tag "Shadow Sigil"
	States
	{
	Spawn:
		TNT1 A -1
		Stop
	Use:
		TNT1 A 0 ACS_ExecuteAlways(794,0,1,0,0)
		Fail
	}
}

ACTOR ManaReplacesInvisibility : Satanic_SoulAmmoAgain replaces BlurSphere {}	