// This file was created for Satanic Redux, by amv2k9. It's purpose? It stores 
// the actors used in walljumping, and any other new items used in ACS.

ACTOR NullItem
{
	States
	{
	Spawn:
		TNT1 A 1
		Stop
	}
}

ACTOR GenericScriptItem : Inventory
{
	-INVBAR
	Inventory.Amount 1
	Inventory.MaxAmount 1
}

ACTOR IsPlayingNecrorunner : Inventory
{
	-INVBAR
	Inventory.Amount 1
	Inventory.MaxAmount 1
}

ACTOR WallCheckArchetype
{
	+ MTHRUSPECIES
	+ MISSILE
	+ NOGRAVITY
	Speed 0
	Height 8
	Radius 1
	Renderstyle None
	States
	{
	Spawn:
		TNT1 A 1
		TNT1 A 3 A_ChangeFlag("THRUACTORS",1)
		stop
	XDeath:	
		TNT1 A 0
		stop
	}
}

ACTOR WallCheck8 : WallCheckArchetype 
{ 
	Radius 8 
}

ACTOR WallCheck16 : WallCheckArchetype 
{ 
	Radius 16 
}

ACTOR WallCheck24 : WallCheckArchetype 
{ 
	Radius 24 
}

ACTOR WallCheck32 : WallCheckArchetype 
{ 
	Radius 32 
}

ACTOR WallCheck64 : WallCheckArchetype 
{ 
	Radius 64 
}

// Tertiary Attack Stuff //

ACTOR TertiaryActive : CustomInventory
{
	-INVBAR
	Inventory.Amount 1
	Inventory.MaxAmount 1
	States
	{
	Spawn:
		TNT1 A 0
		Loop
	Use:
		TNT1 A 0 A_JumpIfInventory("Satanic_Posessing",1,"ItemFail")
		TNT1 A 0 A_JumpIfInventory("WeapWithNoTertChecker",1,"SwitchToMEagle")
		TNT1 A 0 A_JumpIfInventory("MEagleCheck",1,"ScopeSwitch")
		TNT1 A 0 A_GiveInventory("TertiaryChecker",1)
		Fail
	ScopeSwitch:
		TNT1 A 0 A_JumpIfInventory("TertiaryChecker",1,"ToggleScope")
		TNT1 A 0 A_GiveInventory("TertiaryChecker",1)
		Fail
	ToggleScope:
		TNT1 A 0 A_TakeInventory("TertiaryChecker",1)
		Fail
	SwitchToMEagle:
		TNT1 A 0 A_SelectWeapon("Satanic_MaledictoryEagle")
		Fail
	ItemFail:
		TNT1 A 0
		Fail
	}
}

ACTOR TertiaryCancel : CustomInventory
{
	-INVBAR
	Inventory.Amount 1
	Inventory.MaxAmount 1
	States
	{
	Spawn:
		TNT1 A 1
		Loop
	Use:
		TNT1 A 0 A_JumpIfInventory("Satanic_Posessing",1,"ItemFail")
		TNT1 A 0 A_JumpIfInventory("MEagleCheck",1,"ItemFail")
		TNT1 A 0 A_JumpIfInventory("MEagleScopeCheck",1,"ScopeSwitch")
		TNT1 A 0 A_TakeInventory("TertiaryChecker",1)
		Fail
	ScopeSwitch:
		TNT1 A 0 A_TakeInventory("TertiaryChecker",1)
		Fail
	ItemFail:
		TNT1 A 0
		Fail
	}
}

// Low Health Heartbeat Indicator

ACTOR ToggleLHI : CustomInventory
{
	-INVBAR
	Inventory.Amount 1
	Inventory.MaxAmount 1
	States
	{
	Spawn:
		TNT1 A 1
		Loop
	Use:
		TNT1 A 0 A_JumpIfInventory("Satanic_LowHealthIndicatorCheck",1,"Take")
		TNT1 A 0 A_GiveInventory("Satanic_LowHealthIndicatorCheck",1)
		Fail
	Take:
		TNT1 A 0 A_TakeInventory("Satanic_LowHealthIndicatorCheck",1)
		Fail
	}
}

ACTOR ToggleLHIText : CustomInventory
{
	-INVBAR
	Inventory.Amount 1
	Inventory.MaxAmount 1
	States
	{
	Spawn:
		TNT1 A 1
		Loop
	Use:
		TNT1 A 0 A_JumpIfInventory("Satanic_LowHealthIndicatorCheck",1,"InInventory")
		TNT1 A 0 A_Print("heartbeat indicator is off")
		Fail
	InInventory:
		TNT1 A 0 A_Print("heartbeat indicator is on")
		Fail
	}
}

ACTOR Satanic_LowHealthIndicatorCheck : GenericScriptItem {}








/*
ACTOR TertiaryActive : CustomInventory
{
	-INVBAR
	Inventory.Amount 1
	Inventory.MaxAmount 1
	States
	{
	Spawn:
		TNT1 A 0
		Loop
	Use:
		TNT1 A 0 A_JumpIfInventory("Satanic_Posessing",1,"PosessedFail")
		TNT1 A 0 A_JumpIfInventory("WeapWithNoTertChecker",1,"SwitchToMEagle")
		TNT1 A 0 A_JumpIfInventory("MEagleCheck",1,"ScopeSwitch")
		TNT1 A 0 A_GiveInventory("TertiaryChecker",1)
		Fail
	ScopeSwitch:
		TNT1 A 0 A_SelectWeapon("MEagleScope")
		Fail
	SwitchToMEagle:
		TNT1 A 0 A_SelectWeapon("Satanic_MaledictoryEagle")
		Fail
	PosessedFail:
		TNT1 A 0
		Fail
	}
}

ACTOR TertiaryCancel : CustomInventory
{
	-INVBAR
	Inventory.Amount 1
	Inventory.MaxAmount 1
	States
	{
	Spawn:
		TNT1 A 0
		Loop
	Use:
		TNT1 A 0 A_JumpIfInventory("Satanic_Posessing",1,"PosessedFail")
		TNT1 A 0 A_JumpIfInventory("MEagleScopeCheck",1,"ScopeSwitch")
		TNT1 A 0 A_TakeInventory("TertiaryChecker",1)
		Fail
	ScopeSwitch:
		TNT1 A 0 A_SelectWeapon("Satanic_MaledictoryEagle")
		TNT1 A 0 A_TakeInventory("TertiaryChecker",1)
		Fail
	PosessedFail:
		TNT1 A 0
		Fail
	}
}
*/

ACTOR TertiaryChecker : GenericScriptItem {}

ACTOR WeapWithNoTertChecker : GenericScriptItem {}


// Previously-Equipped-Weapon Stuff //

// this is used by the Shroud Magic //

ACTOR CurrentWeaponIsBloodMagic : GenericScriptItem {}

ACTOR CurrentWeaponIsMEagle : GenericScriptItem {}

ACTOR CurrentWeaponIsMEagleScope : GenericScriptItem {}

ACTOR CurrentWeaponIsDefiler : GenericScriptItem {}

ACTOR CurrentWeaponIsHellfire : GenericScriptItem {}

ACTOR CurrentWeaponIsDeadheads : GenericScriptItem {}

ACTOR CurrentWeaponIsSufferStaff : GenericScriptItem {}

ACTOR CurrentWeaponIsPosessGauntlets : GenericScriptItem {}

ACTOR CurrentWeaponIsVengeful : GenericScriptItem {}

ACTOR CurrentWeaponIsLeech : GenericScriptItem {}

ACTOR CurrentWeaponIsDarkChaos : GenericScriptItem {}

ACTOR CurrentWeaponIsKindredGenesis : GenericScriptItem {}


// Per-Weapon Crosshair Toggling

ACTOR TogglePWC : CustomInventory
{
	-INVBAR
	Inventory.Amount 1
	Inventory.MaxAmount 1
	States
	{
	Spawn:
		TNT1 A 1
		Loop
	Use:
		TNT1 A 0 A_JumpIfInventory("PWCIsOff",1,"TurnOn")
	TurnOff:
		TNT1 A 0 A_GiveInventory("PWCIsOff")
		TNT1 A 0 A_Print("Per-Weapon Crosshairs are off")
		Fail
	TurnOn:
		TNT1 A 0 A_TakeInventory("PWCIsOff")
		TNT1 A 0 A_Print("Per-Weapon Crosshairs are on")
		Fail
	}
}
		
ACTOR PWCIsOff : GenericScriptItem {}