actor MirrorBusterBoss : BaseMM8BDMWep_CBM 
{
dropitem "MirrorBusterWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 1
Obituary "$OB_MIRRORREFLECT"
weapon.ammotype "MirrorCharge"
States
{
Spawn:
C_0K A 1
loop
Ready:
ENKA A 0 ACS_ExecuteAlways(998,0,943)
goto Ready2
Ready2:
ENKA A 1 A_WeaponReady(WRF_NOSECONDARY)
ENKA A 0 A_JumpIfInventory("EnkerAltCooldown",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("MirrorCharge",11,"StrongMirror")
ENKA A 1 A_GunFlash
ENKA C 1 offset(10,41)
ENKA C 1 offset(20,44)
ENKA C 1 offset(30,48)
ENKA C 1 offset(40,52) A_PlaySoundEx("weapon/mirrordeflect","Weapon")
ENKA D 1 offset(45,54) A_GiveInventory("EnkerMain_CI",1)
ENKA D 1 offset(50,56)
ENKA D 1 offset(55,58)
ENKA D 1 offset(60,60)
ENKA D 1 offset(60,60) A_GiveInventory("EnkerRageRuneCheck")
ENKA D 1 offset(55,58)
ENKA D 1 offset(50,56)
ENKA D 1 offset(45,54)
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
StrongMirror:
ENKA A 1 A_GunFlash
ENKA C 1 offset(10,41)
ENKA C 1 offset(20,44)
ENKA C 1 offset(30,48) A_TakeInventory("MirrorCharge",11)
ENKA C 1 offset(40,52) A_PlaySoundEx("weapon/mirrordeflect2","Weapon")
ENKA D 1 offset(45,54) A_GiveInventory("EnkerMain2_CI",1)
ENKA D 1 offset(50,56)
ENKA D 1 offset(55,58)
ENKA D 1 offset(60,60)
ENKA D 1 offset(60,60) A_GiveInventory("EnkerRageRuneCheck2")
ENKA D 1 offset(55,58)
ENKA D 1 offset(50,56)
ENKA D 1 offset(45,54)
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

AltFire:
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(648,0,1)
ENKA A 0 A_PlaySoundEx("weapon/mirrorabsorb","Weapon")
ENKA A 1 A_GunFlash("Flash2")
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 1 offset(-10,39)
ENKA F 1 offset(-8,36)
ENKA F 1 offset(-6,33)
ENKA F 1 offset(-4,30)
ENKA F 11 offset(-2,27)
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 1 offset(50,56)
ENKA C 1 offset(40,52)
ENKA C 1 offset(30,48)
ENKA C 1 offset(20,44)
ENKA C 1 offset(10,41)
//35
ENKA A 0 A_TakeInventory("EnkerAbsorbCount",1)
ENKA A 0 A_TakeInventory("StunArmor",99)
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(648,0,0)
ENKA A 0 A_GiveInventory("EnkerAltCooldown",1)
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

Flash:
TNT1 A 1//You need a delay here to sync up the flash state sprites.
ENKA GHIJK 1
TNT1 AAA 1
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 AAA 1
ENKA KJIHG 1
stop
Flash2:
TNT1 A 1 A_GiveInventory("MirrorCharge",1)
ENKA GHIJK 1
TNT1 AAAAAAA 1
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 11
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 AAAAAAA 1
ENKA KJIHG 1
stop

BotFire:
ENKA A 0 A_JumpIfInventory("MirrorCharge",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(648,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(648,0,0)
goto Fire+1
}
}

actor enkerarmor : BasicArmorPickup
{
Armor.Savepercent 90
Armor.Saveamount 100
}

actor EnkerAltCooldown : PowerDamage
{
powerup.duration 20
damagefactor "normal", 1.0
}

actor LastArmorCount : Inventory
{
inventory.amount 1
inventory.maxamount 100
}

actor MirrorCharge : Ammo
{
+INVENTORY.IGNORESKILL
inventory.amount 1
inventory.maxamount 55
}

actor EnkerAbsorbCount : OnceC {}


actor MirrorShotSmallCust
{
Translation "192:192=229:229"
PROJECTILE
damagetype "MirrorBuster1"
Obituary "$OB_MIRRORREFLECT"
+THRUGHOST
damage (16)
Radius 8
Height 7
speed 40
scale 2.5
States
{
Spawn:
MIRR TU 2
MIRR U 0 A_ChangeFlag("THRUGHOST",0)
MIRR TU 2
goto Spawn+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 "MirrorBuster3"
Obituary "$OB_MIRRORREFLECT"
Radius 14
Height 18
damage (35)
speed 50
States
{
Spawn:
MIRR UV 2
MIRR U 0 A_ChangeFlag("THRUGHOST",0)
MIRR UV 2
goto Spawn+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 : EnkerMelee
{
Obituary "$OB_MIRRORSPEAR"
damagetype "MirrorBuster"
}

actor EnkerRageRuneCheck : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("RuneDoubleFiringSpeed",1,"Yes")
//TNT1 A 0 A_JumpIfInventory("PowerDoubleFiringSpeed",1,"Yes")
stop
Yes:
TNT1 A 0 A_PlaySoundEx("weapon/mirrordeflect","Weapon")
TNT1 A 0 A_GiveInventory("EnkerMain_CI",1)
stop
}
}

actor EnkerRageRuneCheck2 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("RuneDoubleFiringSpeed",1,"Yes")
//TNT1 A 0 A_JumpIfInventory("PowerDoubleFiringSpeed",1,"Yes")
stop
Yes:
TNT1 A 0 A_PlaySoundEx("weapon/mirrordeflect2","Weapon")
TNT1 A 0 A_GiveInventory("EnkerMain2_CI",1)
stop
}
}

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
}
}
