//====================================
// Formatted and Cleaned by Ru5tK1ng
//------------------------------------
//====================================

  Actor MirrorBusterBoss : BaseMM8BDMWep_CBM
  {
    Tag "$TAGC_KA"
	DropItem "MirrorBusterWepCDropped"
	Weapon.AmmoUse 0
	Weapon.AmmoGive 0
	Obituary "$OB_MIRRORREFLECT"
	Weapon.AmmoType "MirrorChargeAmmo"
	States
	{
		Spawn:
		C_0K A 1
		Loop

		Ready:
		ENKA A 0 A_GiveInventory("NormShot", 1)
		ENKA A 0 ACS_ExecuteAlways(998,0,DYE_ENKER)
		ENKR A 0 ACS_NamedExecuteAlways("Enker_Passive")
		Goto Ready2

		Ready2:
		ENKA A 1 A_WeaponReady(WRF_NOSECONDARY)
		ENKA A 0 A_JumpIfInventory("EnkerAltCD",1,"Ready2")
		Goto Ready3

		Ready3:
		ENKA A 1 A_WeaponReady
		Goto Ready3

		Deselect:
		TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
		ENKA A 1 A_Lower
		Loop

		Select:
		TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
		ENKA A 1 A_Raise
		Loop

		Fire:
		ENKA A 0 A_JumpIfInventory("IsBot",1,"BotFire")
		ENKA A 0 A_JumpIfInventory("PowerRage_ST",1,"Fire_R")
		ENKA A 1 A_GunFlash("Flash2",GFF_NOEXTCHANGE)
		ENKA C 1 offset(10,41)
		ENKA C 1 offset(20,44)
		ENKA C 1 offset(30,48)
		ENKA C 1 offset(40,52)
		ENKA D 1 offset(45,54)A_GiveInventory("EnkerMainShot_P",1)
		ENKA D 1 offset(50,56)
		ENKA D 1 offset(55,58)
		ENKA D 2 offset(60,60)
		ENKA D 1 offset(55,58)
		ENKA D 1 offset(50,56)
		ENKA D 1 offset(45,54)A_GunFlash("Flash3",GFF_NOEXTCHANGE)
		ENKA C 1 offset(40,52)
		ENKA C 1 offset(30,48)
		ENKA C 1 offset(20,44)
		ENKA C 1 offset(10,41)
		ENKA A 1 offset(8,39)
		ENKA A 1 offset(6,37)
		ENKA A 1 offset(4,36)
		ENKA A 1 offset(3,35)
		ENKA A 1 offset(2,34)
		ENKA A 1 offset(1,33)
		Goto Ready2

		Fire_R:
		ENKA A 1 A_GunFlash("Flash2R",GFF_NOEXTCHANGE)
		ENKA C 1 offset(20,44)
		ENKA C 1 offset(40,52)
		ENKA D 1 offset(45,54)A_GiveInventory("EnkerMainShot_P",1)
		ENKA D 1 offset(50,56)
		ENKA D 2 offset(60,60)
		ENKA D 1 offset(50,56)A_GunFlash("Flash3R",GFF_NOEXTCHANGE)
		ENKA C 1 offset(40,52)
		ENKA C 1 offset(20,44)
		ENKA A 1 offset(8,39)
		ENKA A 1 offset(4,36)
		ENKA A 1 offset(2,34)
		Goto Ready2

		Flash2:
		TNT1 A 1 //You need a delay here to sync up the flash state sprites with offsets.
		ENKA GHIJK 1
		Stop
		
		Flash2R:
		TNT1 A 1
		ENKA GHI 1
		Stop

		Flash3:
		TNT1 A 1
		ENKA KJIHG 1
		Stop

		Flash3R:
		TNT1 A 1
		ENKA IHG 1
		Stop
		
		Flash4:
		TNT1 A 1 A_JumpIfInventory("IsDead",1,"NoFlash")
		TNT1 A 0 A_JumpIfInventory("MirrorChargeFlash",1,"Flash.Hit")
		TNT1 A 0 ACS_ExecuteWithResult(998,DYE_ENKER,1)
		loop
		Flash.Hit:
		ENKA L 1 //ACS_ExecuteWithResult(991,227)
		ENKA L 0 A_JumpIfInventory("IsDead",1,"NoFlash")
		ENKA M 1 //ACS_ExecuteWithResult(991,228)
		ENKA M 0 A_JumpIfInventory("IsDead",1,"NoFlash")
		ENKA N 1 //ACS_ExecuteWithResult(991,229)
		ENKA N 0 A_JumpIfInventory("IsDead",1,"NoFlash")
		ENKA O 1 //ACS_ExecuteWithResult(991,234)
		ENKA O 0 A_JumpIfInventory("IsDead",1,"NoFlash")
		ENKA P 1 //ACS_ExecuteWithResult(991,235)
		ENKA P 0 A_JumpIfInventory("IsDead",1,"NoFlash")
		goto Flash4
		NoFlash:
		TNT1 A 0 ACS_ExecuteWithResult(998,DYE_ENKER,1)
		stop

		AltFire:
		ENKA C 0 A_JumpIfInventory("EnkerAltCombo_F",1,"Altfire_Swipe")
		ENKA A 0 A_GiveInventory("EnkerAbsorbCount",1)
		ENKA A 0 A_GiveInventory("EnkerArmor",1)
		ENKA A 0 A_GiveInventory("StunArmor",1)
		ENKA A 0 A_GiveInventory("LastArmorCount",100)
		ENKA A 0 SetPlayerProperty(0,1,0)
		ENKA A 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_JumpZ,0,1)
		ENKA A 0 A_PlaySoundEx("weapon/mirrorabsorb","Weapon")
		ENKA A 0 A_JumpIfInventory("PowerRage_ST",1,"AltFire_R")
		ENKA A 1 A_GunFlash("Flash2",GFF_NOEXTCHANGE)
		ENKA C 1 offset(10,41)
		ENKA C 1 offset(20,44)
		ENKA C 1 offset(30,48)
		ENKA C 1 offset(40,52)
		ENKA D 1 offset(50,56)
		ENKA D 1 offset(60,49)
		ENKA D 1 offset(70,42)
		ENKA D 1 offset(80,35)
		ENKA F 0 A_GunFlash("Flash4",GFF_NOEXTCHANGE)

		AltfireUpStart1:
		ENKA F 1 offset(-10,39)A_JumpIfInventory("EnkerAltCombo_F",1,"AltFireUpStartX1")
		AltfireUpStart2:
		ENKA F 1 offset(-8,36)A_JumpIfInventory("EnkerAltCombo_F",1,"AltFireUpStartX2")
		AltfireUpStart3:
		ENKA F 1 offset(-6,33)A_JumpIfInventory("EnkerAltCombo_F",1,"AltFireUpStartX3")
		AltfireUpStart4:
		ENKA F 1 offset(-4,30)A_JumpIfInventory("EnkerAltCombo_F",1,"AltFireUpStartX4")
		AltfireUp:
		ENKA F 1 Offset(-2,27)A_JumpIfInventory("EnkerAltCombo_F",1,"AltFireXUp")
		ENKA F 0 A_JumpIfInventory("EnkerParryCounter",11,"AltFire2")
		ENKA F 0 A_GiveInventory("EnkerParryCounter",1)
		loop

		AltFireUpStartX1:
		ENKA F 1 offset(-10,39)A_WeaponReady(WRF_NOPRIMARY|WRF_NOBOB)
		AltFireUpStartX2:
		ENKA F 1 offset(-8,36)A_WeaponReady(WRF_NOPRIMARY|WRF_NOBOB)
		AltFireUpStartX3:
		ENKA F 1 offset(-6,33)A_WeaponReady(WRF_NOPRIMARY|WRF_NOBOB)
		AltFireUpStartX4:
		ENKA F 1 offset(-4,30)A_WeaponReady(WRF_NOPRIMARY|WRF_NOBOB)
		AltFireXUp:
		ENKA F 1 Offset(-2,27)A_WeaponReady(WRF_NOPRIMARY|WRF_NOBOB)
		ENKA F 0 A_JumpIfInventory("EnkerParryCounter",11,"AltFire2")
		ENKA F 0 A_GiveInventory("EnkerParryCounter",1)
		loop

		AltFire_R:
		ENKA A 1 A_GunFlash("Flash2R",GFF_NOEXTCHANGE)
		ENKA C 1 offset(20,44)
		ENKA C 1 offset(40,52)
		ENKA D 1 offset(60,49)
		ENKA D 1 offset(80,35)
		ENKA F 1 offset(-10,39)
		ENKA F 1 offset(-6,33)
		AltfireUp_R:
		ENKA F 1 Offset(-2,27)A_JumpIfInventory("EnkerAltCombo_F",1,"AltFireXUp_R")
		ENKA F 0 A_JumpIfInventory("EnkerParryCounter",5,"AltFire2")
		ENKA F 0 A_GiveInventory("EnkerParryCounter",1)
		loop
		AltFireXUp_R:
		ENKA F 1 Offset(-2,27)A_WeaponReady(WRF_NOPRIMARY|WRF_NOBOB)
		ENKA F 0 A_JumpIfInventory("EnkerParryCounter",5,"AltFire2")
		ENKA F 0 A_GiveInventory("EnkerParryCounter",1)
		loop

		AltFire2:
		ENKA F 0 A_WeaponReady(WRF_NOFIRE|WRF_NOBOB)
		ENKA D 0 A_GunFlash("NoFlash",GFF_NOEXTCHANGE)
		ENKA F 0 A_TakeInventory("EnkerParryCounter",50)
		ENKA F 0 A_JumpIfInventory("PowerRage_ST",1,"AltFire2_R")
		ENKA F 1 offset(-4,30)
		ENKA F 1 offset(-6,33)
		ENKA F 1 offset(-8,36)
		ENKA F 1 offset(-10,39)
		ENKA D 1 offset(80,35)
		ENKA D 1 offset(70,42)
		ENKA D 1 offset(60,49)
		ENKA D 0 A_GunFlash("Flash3",GFF_NOEXTCHANGE)
		ENKA D 1 offset(50,56)
		ENKA A 0 A_TakeInventory("EnkerAbsorbCount",1)
		ENKA C 1 offset(40,52)A_SpawnItemEx("EnkerAmmoHelper",0,0,0,0,0,0,0,1)
		ENKA C 1 offset(30,48)
		ENKA C 1 offset(20,44)
		ENKA C 1 offset(10,41)
		Goto AltfireEnd

		AltFire2_R:
		ENKA F 0 A_WeaponReady(WRF_NOFIRE|WRF_NOBOB)
		TNT1 A 0 ACS_ExecuteWithResult(998,DYE_ENKER,1)
		ENKA F 0 A_TakeInventory("EnkerParryCounter",50)
		ENKA F 1 offset(-6,33)
		ENKA F 1 offset(-10,39)
		ENKA D 1 offset(80,35)
		ENKA D 0 A_GunFlash("Flash3R",GFF_NOEXTCHANGE)
		ENKA D 1 offset(60,49)
		ENKA A 0 A_TakeInventory("EnkerAbsorbCount",1)
		ENKA C 1 offset(40,52)A_SpawnItemEx("EnkerAmmoHelper",0,0,0,0,0,0,0,1)
		ENKA C 1 offset(20,44)
		Goto AltfireEnd

		AltfireEnd:
		ENKA A 0 A_TakeInventory("EnkerAbsorbCount",1)
		ENKA A 0 SetPlayerProperty(0,0,0)
		ENKA A 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_JumpZ,10,1)
		ENKA A 0 A_GiveInventory("EnkerAltCooldown_RC",1)
		ENKA A 0 A_JumpIfInventory("PowerRage_ST",1,"AltfireEnd_R")
		ENKA A 1 offset(8,39)
		ENKA A 1 offset(6,37)
		ENKA A 1 offset(4,36)
		ENKA A 1 offset(3,35)
		ENKA A 1 offset(2,34)
		ENKA A 1 offset(1,33)
		ENKA A 0 A_TakeInventory("EnkerAltCombo_F",99)
		Goto Ready2
		
		Altfire_Swipe:
		ENKA F 0 A_TakeInventory("EnkerParryCounter",50)
		ENKA A 0 A_TakeInventory("EnkerAbsorbCount",1)
		ENKA A 0 A_SpawnItemEx("EnkerAmmoHelper",0,0,0,0,0,0,0,1)
		ENKA C 0 SetPlayerProperty(0,0,0)
		ENKA C 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_JumpZ,10,1)
		ENKA C 0 A_GiveInventory("VivifyDelay6",1)
		ENKA C 0 A_GunFlash("NoFlash",GFF_NOEXTCHANGE)
		ENKA C 0 A_Refire(1)
		ENKA C 1
		ENKA C 1 offset(-10,24)
		//ENKA C 1 offset(-20,23)
		ENKA C 1 offset(-30,20)
		//ENKA C 1 offset(-40,16)
		ENKA D 0 A_PlaySoundEx("misc/enkerswing","Weapon")
		ENKA C 0 //A_GiveInventory("EnkerDash_P",1)
		ENKA D 1 offset(-35,34) A_GiveInventory("EnkerMelee_CI",1)
		ENKA D 1 offset(3,32)
		//ENKA D 1 offset(49,30)
		ENKA D 6 offset(102,28)
		//ENKA D 1 offset(49,30)
		ENKA D 1 offset(3,32)
		ENKA D 1 offset(-35,34)
		//ENKA C 1 offset(-40,12)
		ENKA C 1 offset(-30,16)
		//ENKA C 1 offset(-20,20)
		ENKA C 1 offset(-10,23)
		//ENKA A 1 offset(8,39)
		ENKA A 1 offset(6,37)
		//ENKA A 1 offset(4,36)
		ENKA A 1 offset(3,35)
		//ENKA A 1 offset(2,34)
		ENKA A 1 offset(1,33)A_GiveInventory("EnkerAltCooldown_RC",1)
		ENKA A 6 A_WeaponReady(WRF_NOFIRE)
		goto Ready2

		AltfireEnd_R:
		ENKA A 1 offset(8,39)
		ENKA A 1 offset(4,36)
		ENKA A 1 offset(2,34)
		Goto Ready2

		BotFire:
		ENKA A 0 A_JumpIfInventory("MirrorChargeAmmo",44,2)
		ENKA A 0 A_Jump(64, "AltFireBot")
		ENKA A 0
		Goto Fire+1

		AltFireBot:
		ENKA A 0 A_GiveInventory("EnkerAbsorbCount",1)
		ENKA A 0 A_GiveInventory("EnkerArmor",1)
		ENKA A 0 A_GiveInventory("LastArmorCount",100)
		ENKA A 0 SetPlayerProperty(0,1,0)
		ENKA A 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_JumpZ,0,1)
		ENKA A 0
		ENKA A 0 A_PlaySoundEx("weapon/mirrorabsorb","Weapon")
		ENKA CD 3
		ENKA E 29
		ENKA DC 3
		ENKA A 0 A_TakeInventory("EnkerAbsorbCount",1)
		ENKA A 0 A_TakeInventory("BasicArmor",999)
		ENKA A 0 A_TakeInventory("LastArmorCount",999)
		ENKA A 0 SetPlayerProperty(0,0,0)
		ENKA A 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_JumpZ,10,1)
		Goto Fire+1

	}
  }


//=======================
// Inventory & Powerups
//-----------------------
//=======================

actor EnkerSwapItem1 : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "SMirIcon"
Tag "$TAGC_KA2"
scale 2.0
inventory.pickupmessage "(insert dev joke here)"
+INVBAR
states
{
Spawn:
CRAA X 1
loop

Use:
TNT1 A 0 A_GiveInventory("BigShot",1)
TNT1 A 0 A_TakeInventory("NormShot",99)
TNT1 A 0 A_TakeInventory("EnkerSwapItem1")
TNT1 A 0 A_GiveInventory("EnkerSwapItem2")
TNT1 A 0 A_PlaySoundEx("item/ItemUseMM9","SoundSlot6")
stop

No:
TNT1 A 0
fail
}
}

actor EnkerSwapItem2 : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "BMirIcon"
Tag "$TAGC_KA1"
scale 2.0
inventory.pickupmessage "(insert dev joke here)"
+INVBAR
states
{
Spawn:
CRAA X 1
loop

Use:
TNT1 A 0 A_GiveInventory("NormShot",1)
TNT1 A 0 A_TakeInventory("BigShot",99)
TNT1 A 0 A_TakeInventory("EnkerSwapItem2")
TNT1 A 0 A_GiveInventory("EnkerSwapItem1")
TNT1 A 0 A_PlaySoundEx("item/ItemUseMM9","SoundSlot6")
stop

No:
TNT1 A 0
fail
}
}

  Actor BigShot : OnceC
  {
  }
  
actor EnkerDash_P : CustomInventory
{
States
{
Pickup:
//TNT1 A 0 A_JumpIfInventory("EnkerDashCooldown",1,"No")
TNT1 A 0 A_JumpIf(z-floorz==0,"Activate")
stop
Activate:
TNT1 A 0 A_GiveInventory("Enker_ItemBoostCheck_P")
stop
No:
TNT1 A 0
stop
}
}

actor EnkerDashFX : BasicClientside
{
renderstyle add
alpha 0.75
states
{
Spawn:
TNT1 A 0
TNT1 AA 1 A_JumpIf(ACS_NamedExecuteWithResult("cbm_IsPointerClient",2)!=1, "Fade")
ENKR L 1 A_FadeOut(0.08)
wait
Fade:
TNT1 A 0 A_JumpIfInTargetInventory("IsDead",1,"Death")
ENKR L 1 A_FadeOut(0.08)
loop
Death:
TNT1 A 0
stop
}
}


  Actor EnkerDashFXInv : CustomInventory
  {
    States
	{
		Pickup:
		TNT1 A 0 A_SpawnItemEx("EnkerDashFX",0,0,4,0,0,0,0,1)
		Stop
	}
  }


  Actor EnkerDashFXGiver : BasicHelper
  {
    ReactionTime 6
	States
	{
		Spawn:
		TNT1 A 2 A_GiveToTarget("EnkerDashFXInv", 1)
		TNT1 A 0 A_CountDown
		Loop

		Death:
		TNT1 A 0
		Stop
	}
  }
  
  actor EnkerAmmoHelper : BasicHelper
  {
	States
	{
		Spawn:
		TNT1 AA 0
		TNT1 A 0 A_TakeFromTarget("StunArmor",999)
		TNT1 A 0 A_TakeFromTarget("BasicArmor",999)
		TNT1 A 0 A_TakeFromTarget("LastArmorCount",999)
		TNT1 A 0
		stop
	}
  }

actor EnkerDashSpeedTrail : PowerSpeed
{
powerup.duration 10
speed 1.0
}
  
actor EnkerDashCooldown_H : BasicHelper
{
	+SERVERSIDEONLY
	States
		{
			Spawn:
			TNT1 A 0
			TNT1 A 0 A_GiveToTarget("EnkerDashCooldown",112)
			SpawnL:
			TNT1 A 0 A_JumpIf(CallACS("core_targetexists")==0,"Death")
			TNT1 A 1 A_TakeFromTarget("EnkerDashCooldown",1+CallACS("cbm_CheckForRage",2))
			TNT1 A 0 A_JumpIfInTargetInventory("EnkerDashCooldown",1,"SpawnL")
			stop
		}
}

	actor Enker_ItemBoostCheck_P : CustomInventory
	{
		States
		{
			Pickup:
			TNT1 A 0 A_PlaySoundEx("weapon/fakedash","SoundSlot7")

			TNT1 A 0 A_JumpIf(CallACS("cbm_FetchMovementInput")==21,"P_LF")
			TNT1 A 0 A_JumpIf(CallACS("cbm_FetchMovementInput")==19,"P_RF")
			TNT1 A 0 A_JumpIf(CallACS("cbm_FetchMovementInput")==17,"P_F")
			TNT1 A 0 A_JumpIf(CallACS("cbm_FetchMovementInput")==13,"P_LB")
			TNT1 A 0 A_JumpIf(CallACS("cbm_FetchMovementInput")==11,"P_RB")
			TNT1 A 0 A_JumpIf(CallACS("cbm_FetchMovementInput")==9,"P_B")
			TNT1 A 0 A_JumpIf(CallACS("cbm_FetchMovementInput")==5,"P_L")
			TNT1 A 0 A_JumpIf(CallACS("cbm_FetchMovementInput")==3,"P_R")
			goto P_None


			P_R://Right (2)
			TNT1 A 0 A_SpawnItemEx("EnkerDashFXGiver")
			TNT1 A 0 //A_SpawnItemEX("EnkerDashCooldown_H",0,0,0)
			TNT1 A 0 A_ChangeVelocity(0,-30,0,3)
			goto End
			P_L://Left (4)
			TNT1 A 0 A_SpawnItemEx("EnkerDashFXGiver")
			TNT1 A 0 //A_SpawnItemEX("EnkerDashCooldown_H",0,0,0)
			TNT1 A 0 A_ChangeVelocity(0,30,0,3)
			goto End
			P_B://Back (8)
			TNT1 A 0 A_SpawnItemEx("EnkerDashFXGiver")
			TNT1 A 0 //A_SpawnItemEX("EnkerDashCooldown_H",0,0,0)
			TNT1 A 0 A_ChangeVelocity(-30,0,0,3)
			goto End
			P_F://Forward (16)
			TNT1 A 0 A_SpawnItemEx("EnkerDashFXGiver")
			TNT1 A 0 //A_SpawnItemEX("EnkerDashCooldown_H",0,0,0)
			TNT1 A 0 A_ChangeVelocity(30,0,0,3)
			goto End

			P_RB:
			TNT1 A 0 A_SpawnItemEx("EnkerDashFXGiver")
			TNT1 A 0 //A_SpawnItemEX("EnkerDashCooldown_H",0,0,0)
			TNT1 A 0 A_ChangeVelocity(sin(-45)*30,sin(-45)*30,0,3)
			goto End
			P_LB:
			TNT1 A 0 A_SpawnItemEx("EnkerDashFXGiver")
			TNT1 A 0 //A_SpawnItemEX("EnkerDashCooldown_H",0,0,0)
			TNT1 A 0 A_ChangeVelocity(sin(-45)*30,sin(45)*30,0,3)
			goto End

			P_RF:
			TNT1 A 0 A_SpawnItemEx("EnkerDashFXGiver")
			TNT1 A 0 //A_SpawnItemEX("EnkerDashCooldown_H",0,0,0)
			TNT1 A 0 A_ChangeVelocity(sin(45)*30,sin(-45)*30,0,3)
			goto End
			P_LF:
			TNT1 A 0 A_SpawnItemEx("EnkerDashFXGiver")
			TNT1 A 0 //A_SpawnItemEX("EnkerDashCooldown_H",0,0,0)
			TNT1 A 0 A_ChangeVelocity(sin(45)*30,sin(45)*30,0,3)
			goto End
			P_None://No input/conflicting input (left+right=0)
			TNT1 A 0 
			goto End
		}
	}
  
  Actor NormShot : BigShot { Inventory.Icon "SMirIcon" }
  Actor ReloadWait : PowerUp { PowerUp.Duration 35  }
  Actor EnkerAbsorbCount : OnceC {}

  Actor MirrorChargeAmmo : Ammo
  {
    Inventory.Amount 1
	Inventory.MaxAmount 55
	+INVENTORY.IGNORESKILL
  }

  Actor EnkerParryCounter : Ammo
  {
    Inventory.Amount 1
	Inventory.MaxAmount 30
	+INVENTORY.IGNORESKILL
  }


  Actor EnkerArmor : BasicArmorPickup
  {
    Armor.Savepercent 90.005
	Armor.Saveamount 100
  }
  
actor EnkerAltCD : Powerup {}
  
actor EnkerAltCooldown : PowerupGiver
{ 
powerup.type "EnkerAltCD"
Powerup.Duration 28
+INVENTORY.AUTOACTIVATE   
} 


  Actor EnkerAltCombo_F : Powerup
  {
    PowerUp.Duration 20
  }
  
  Actor MirrorChargeFlash : Powerup
  {
    PowerUp.Duration 3
  }

  Actor LastArmorCount : Inventory
  {
    Inventory.Amount 1
	Inventory.MaxAmount 100
  }


  Actor EnkerAltCooldown_RC : CustomInventory
  {
    States
	{
		Pickup:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("PowerRage_ST",1,2)
		TNT1 AA 0 A_GiveInventory("EnkerAltCooldown",1)
		TNT1 A 0
		Stop
	}
  }



  Actor EnkerMainShot_P : CustomInventory
  {
    States
	{
		Pickup:
		TNT1 A 0 A_JumpIfInventory("NormShot", 1, 2)
		TNT1 A 0 A_JumpIfInventory("MirrorChargeAmmo",11,"Pickup2")
		TNT1 A 0 A_PlaySoundEx("weapon/mirrordeflect","Weapon")
		TNT1 A 0 A_GiveInventory("EnkerMain_CI",1)
		Stop

		Pickup2:
		TNT1 A 0 A_PlaySoundEx("weapon/mirrordeflect2","Weapon")
		TNT1 A 0 A_TakeInventory("MirrorChargeAmmo",11)
		TNT1 A 0 A_GiveInventory("EnkerMain2_CI",1)
		Stop
	}
  }


//====================
// Mirror Attacks
//--------------------
//====================

  Actor MirrorShotSmallCust
  {
    +THRUGHOST
	Translation "192:192=229:229"
	Projectile
	DamageType "Enker_Shot"
	Obituary "$OB_MIRRORREFLECT"
	Damage (15)
	Radius 10
	Height 8
	Speed 40
	Scale 2.5
	States
	{
		Spawn:
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BULL_Tidifier", 0)
		SpawnL:
		X_KA CD 2
		X_KA C 0 A_ChangeFlag("THRUGHOST",0)
		X_KA CD 2
		Goto SpawnL+3
	}
  }


  Actor MirrorShotSmallCustB : MirrorShotSmallCust{translation "192:192=205:205"}
  Actor MirrorShotSmallCustR : MirrorShotSmallCust{translation "192:192=171:171"}
  Actor MirrorShotSmallCustO : MirrorShotSmallCust{translation "192:192=104:104"}
  Actor MirrorShotSmallCustP : MirrorShotSmallCust{translation "192:192=229:229"}


  Actor MirrorShotLargeCust : MirrorShotSmallCust
  {
    DamageType "Enker_Shot2"
	Obituary "$OB_MIRRORREFLECT"
	Radius 16
	Height 18
	Damage (30)
	Speed 50
	States
	{
		Spawn:
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BULL_Tidifier", 0)
		SpawnL:
		X_KA DE 2
		X_KA D 0 A_ChangeFlag("THRUGHOST",0)
		X_KA DE 2
		Goto SpawnL+3
	}
  }


  Actor MirrorShotLargeCustB : MirrorShotLargeCust{translation "192:192=205:205"}
  Actor MirrorShotLargeCustR : MirrorShotLargeCust{translation "192:192=171:171"}
  Actor MirrorShotLargeCustO : MirrorShotLargeCust{translation "192:192=104:104"}
  Actor MirrorShotLargeCustP : MirrorShotLargeCust{translation "192:192=229:229"}

actor EnkerMeleeCust
{
Translation "198:198=76:76","192:192=229:229"
PROJECTILE
damagetype "Enker_Push"
Obituary "$OB_MIRRORSPEAR"
+THRUACTORS
+DONTBLAST
+DONTSPLASH
ReactionTime 1
damage (0)
Radius 4
Height 4
speed 60
xscale 2.5
yscale 1.0
States
{
Spawn:
TNT1 A 1
KGNP J 1 A_CountDown
wait
Death:
TNT1 A 2 A_Explode(25,100,0,0,75)
KGNP JK 2 
KGNP J 2
stop
}
}

actor EnkerMeleeCustB : EnkerMeleeCust{Translation "192:192=205:205","198:198=74:74"}
actor EnkerMeleeCustR : EnkerMeleeCust{Translation "192:192=171:171","198:198=41:41"}
actor EnkerMeleeCustO : EnkerMeleeCust{Translation "192:192=104:104","198:198=128:128"}
actor EnkerMeleeCustP : EnkerMeleeCust{Translation "192:192=229:229","198:198=232:232"}

//================
// Attack Items
//----------------
//================

  Actor EnkerMain_CI : TeamColor_CI
  {
    States
	{
		FireX:
		TNT1 A 0 A_FireCustomMissile("MirrorShotSmallCust",0,0,8,0)
		Goto Done

		FireB:
		TNT1 A 0 A_FireCustomMissile("MirrorShotSmallCustB",0,0,8,0)
		Goto Done

		FireR:
		TNT1 A 0 A_FireCustomMissile("MirrorShotSmallCustR",0,0,8,0)
		Goto Done

		FireO:
		TNT1 A 0 A_FireCustomMissile("MirrorShotSmallCustO",0,0,8,0)
		Goto Done

		FireP:
		TNT1 A 0 A_FireCustomMissile("MirrorShotSmallCustP",0,0,8,0)
		Goto Done
	}
  }


  Actor EnkerMain2_CI : TeamColor_CI
  {
    States
	{
		FireX:
		TNT1 A 0 A_FireCustomMissile("MirrorShotLargeCust",0,0,8,0)
		Goto Done

		FireB:
		TNT1 A 0 A_FireCustomMissile("MirrorShotLargeCustB",0,0,8,0)
		Goto Done

		FireR:
		TNT1 A 0 A_FireCustomMissile("MirrorShotLargeCustR",0,0,8,0)
		Goto Done

		FireO:
		TNT1 A 0 A_FireCustomMissile("MirrorShotLargeCustO",0,0,8,0)
		Goto Done

		FireP:
		TNT1 A 0 A_FireCustomMissile("MirrorShotLargeCustP",0,0,8,0)
		Goto Done
	}
  }

  Actor EnkerMelee_CI : TeamColor_CI
  {
    States
	{
		FireX:
		TNT1 A 0 A_FireCustomMissile("EnkerMeleeCust",0,0,0,0)
		Goto Done

		FireB:
		TNT1 A 0 A_FireCustomMissile("EnkerMeleeCustB",0,0,0,0)
		Goto Done

		FireR:
		TNT1 A 0 A_FireCustomMissile("EnkerMeleeCustR",0,0,0,0)
		Goto Done

		FireO:
		TNT1 A 0 A_FireCustomMissile("EnkerMeleeCustO",0,0,0,0)
		Goto Done

		FireP:
		TNT1 A 0 A_FireCustomMissile("EnkerMeleeCustP",0,0,0,0)
		Goto Done
	}
  }