actor MirrorBusterWep : BaseMM8BDMWep 10081
{
//$Category MM8BDM-Weapons
//$Title Mirror Buster
//$Sprite WEA3H0
Weapon.AmmoUse 2
Weapon.AmmoGive 28
Weapon.SlotNumber 7
Inventory.Pickupmessage "$PU_MIRRORBUSTER"
Obituary "$OB_MIRRORBUSTER"
Tag "$TAG_MIRRORBUSTER"
weapon.ammotype "MirrorBusterAmmo"
inventory.icon "MIRRSI"
States
{
SpawnLoop:
WEA3 H -1
loop
Ready:
MIRR F 0 ACS_ExecuteAlways(998,0,52)
MIRR F 1 A_WeaponReady
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
MIRR F 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
MIRR F 1 A_Raise
Loop
Fire:
MIRR F 0 A_JumpIfInventory("MirrorBusterCooldown",1,"NoAmmo")
MIRR F 0 A_JumpIfNoAmmo("NoAmmo")
MIRR H 0 A_TakeInventory("MirrorBusterAmmo",2,TIF_NOTAKEINFINITE)
MIRR F 0 A_PlayWeaponSound("weapon/mirroractivate")
MIRR F 0 A_GiveInventory("WeaponCharge", 1)
MIRR FFFFF 1 A_SpawnItemEx("MirrorBuster1",56*cos(pitch), 0, 56*sin(-pitch)+32, momx, momy, momz, 0, SXF_ABSOLUTEMOMENTUM | SXF_TRANSFERPITCH,0)
MIRR FFFFF 1 A_SpawnItemEx("MirrorBuster2",56*cos(pitch), 0, 56*sin(-pitch)+32, momx, momy, momz, 0, SXF_ABSOLUTEMOMENTUM | SXF_TRANSFERPITCH,0)
MIRR FFFFF 1 A_SpawnItemEx("MirrorBuster1",56*cos(pitch), 0, 56*sin(-pitch)+32, momx, momy, momz, 0, SXF_ABSOLUTEMOMENTUM | SXF_TRANSFERPITCH,0)
MIRR FFFFF 1 A_SpawnItemEx("MirrorBuster2",56*cos(pitch), 0, 56*sin(-pitch)+32, momx, momy, momz, 0, SXF_ABSOLUTEMOMENTUM | SXF_TRANSFERPITCH,0)
MIRR FFFFF 1 A_SpawnItemEx("MirrorBuster1",56*cos(pitch), 0, 56*sin(-pitch)+32, momx, momy, momz, 0, SXF_ABSOLUTEMOMENTUM | SXF_TRANSFERPITCH,0)
MIRR FFFFF 1 A_SpawnItemEx("MirrorBuster2",56*cos(pitch), 0, 56*sin(-pitch)+32, momx, momy, momz, 0, SXF_ABSOLUTEMOMENTUM | SXF_TRANSFERPITCH,0)
MIRR H 3
MIRR G 0 A_JumpIfInventory("MirrorBusterSwitch", 1, "Release")
MIRR G 0 A_JumpIfInventory("IsBot", 1, "Release")
MIRR G 0 A_JumpIfInventory("WeaponCharge", 5, "Charge3Start")
MIRR G 0 A_JumpIfInventory("WeaponCharge", 2, "Charge2Start")
Charge1:
MIRR H 1 A_RailWait
MIRR G 0 A_Refire("Charge1")
Goto Release
Charge2Start:
MIRR G 0 A_GunFlash("Sound.BusterCharge", GFF_NOEXTCHANGE)
Charge2:
MIRR K 1 ACS_ExecuteAlways(991,0,65)
MIRR K 0 A_Refire("Charge2.a")
Goto Release
Charge2.a:
MIRR L 1 ACS_ExecuteAlways(991,0,66)
MIRR L 0 A_Refire("Charge2.b")
Goto Release
Charge2.b:
MIRR H 1 ACS_ExecuteAlways(991,0,52)
MIRR H 0 A_Refire("Charge2")
Goto Release
Charge3Start:
MIRR G 0 A_GunFlash("Sound.BusterCharge", GFF_NOEXTCHANGE)
Charge3:
MIRR M 1 ACS_ExecuteAlways(991,0,227)
MIRR M 0 A_Refire("Charge3.a")
Goto Release
Charge3.a:
MIRR N 1 ACS_ExecuteAlways(991,0,228)
MIRR N 0 A_Refire("Charge3.b")
Goto Release
Charge3.b:
MIRR O 1 ACS_ExecuteAlways(991,0,229)
MIRR O 0 A_Refire("Charge3.c")
Goto Release
Charge3.c:
MIRR P 1 ACS_ExecuteAlways(991,0,234)
MIRR P 0 A_Refire("Charge3.d")
Goto Release
Charge3.d:
MIRR Q 1 ACS_ExecuteAlways(991,0,235)
MIRR Q 0 A_Refire("Charge3")
Goto Release
Altfire:
MIRR F 0 A_GiveInventory("MirrorBusterSwitch", 1)
BotFire:
Release:
MIRR G 0 A_JumpIfInventory("WeaponCharge", 5, "ReleaseStrong")
MIRR G 0 A_JumpIfInventory("WeaponCharge", 2, "ReleaseMid")
MIRR F 0 A_JumpIfNoAmmo("NoAmmo")
ReleaseWeak:
TNT1 A 0 A_FireCustomMissile("MirrorShotSmall",0,0,0,0)
TNT1 A 0 A_TakeInventory("MirrorBusterAmmo",1,TIF_NOTAKEINFINITE)
TNT1 A 0 A_PlaySound("weapon/mirrordeflect")
goto ReleaseEnd
ReleaseMid:
TNT1 A 0 A_FireCustomMissile("MirrorShotMedium",0,0,0,0)
TNT1 A 0 A_TakeInventory("MirrorBusterAmmo",2,TIF_NOTAKEINFINITE)
TNT1 A 0 A_PlaySound("weapon/mirrordeflect")
goto ReleaseEnd
ReleaseStrong:
TNT1 A 0 A_FireCustomMissile("MirrorShotLarge",0,0,0,0)
TNT1 A 0 A_TakeInventory("MirrorBusterAmmo",3,TIF_NOTAKEINFINITE)
TNT1 A 0 A_PlaySound("weapon/mirrordeflect2")
goto ReleaseEnd
ReleaseEnd:
MIRR F 0 ACS_ExecuteAlways(991,0,52)
MIRR G 4 A_TakeInventory("WeaponCharge", 999999)
MIRR F 14
MIRR G 0 A_JumpIfInventory("MirrorBusterSwitch",1,2)
MIRR G 0 A_GiveInventory("MirrorBusterCooldown", 9999)
MIRR G 0 
MIRR G 0 A_TakeInventory("MirrorBusterSwitch", 9999)
MIRR G 0 A_TakeInventory("ShieldCheck", 1)
Goto Ready+1
NoAmmo:
MIRR G 0 A_TakeInventory("MirrorBusterSwitch", 9999)
MIRR F 1 ACS_Execute(979,0)
MIRR G 0 A_TakeInventory("ShieldCheck", 1)
//MIRR F 0 A_ClearRefire
Goto Ready+1
}
}

actor MirrorBusterAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

actor MirrorBusterSwitch : Once {}
actor MirrorBusterCooldown : Powerup {Powerup.duration 40}

actor MirrorBuster1 
{
+MISSILE
//+RIPPER
+DONTSPLASH
+NOGRAVITY
+SHOOTABLE
+GHOST
+NOBLOOD
+NOTARGETSWITCH
+DONTRIP
+RIPPER
+DONTBLAST
+NOTAUTOAIMED
+BRIGHT
Damage 0
Height 32
Radius 48
speed 0
health 100
painchance 256
scale 3.5
States
{
Spawn:
MIRR AA 1//AABBBAAABBB 1 A_Warp(AAPTR_TARGET, 38,0,38*sin(-pitch)+32,0, WARPF_COPYINTERPOLATION|WARPF_NOCHECKPOSITION)
stop
Pain:
TNT1 A 0 
TNT1 A 0 A_PlaySoundEx("weapon/mirrorabsorb", "Weapon")
TNT1 A 0 A_JumpIfHealthLower(61,"ShotStrong")
TNT1 A 0 A_JumpIfHealthLower(88,"ShotMid")
TNT1 A 0 A_JumpIfHealthLower(100,"ShotWeak")
TNT1 A 1
stop
Pain.DozerShot:
ShotStrong:
TNT1 A 0 A_ChangeFlag("INVULNERABLE",1)
TNT1 A 1 A_GiveToTarget("WeaponCharge",5)
stop
ShotMid:
TNT1 A 0 A_ChangeFlag("INVULNERABLE",1)
TNT1 A 1 A_GiveToTarget("WeaponCharge",2)
stop
ShotWeak:
TNT1 A 0 A_ChangeFlag("INVULNERABLE",1)
TNT1 A 1 A_GiveToTarget("WeaponCharge",1)
stop
Death:
TNT1 A 0 A_ChangeFlag("INVULNERABLE",1)
TNT1 A 0 A_JumpIfHealthLower(1,"ShotStrong")
stop
NoShot:
TNT1 A 0
stop
}
}



actor MirrorBuster2 : MirrorBuster1
{
States
{
Spawn:
MIRR BB 1
stop
}
}

actor MirrorShotSmall
{
PROJECTILE
+THRUGHOST
+BRIGHT
Radius 10
Height 8
scale 2.5
damage (20)
damagetype "MirrorBuster1"
Obituary "$OB_MIRRORBUSTER"
speed 40
States
{
Spawn:
MIRR C 2
loop
}
}

actor MirrorShotMedium : MirrorShotSmall
{
damage (40)
Radius 12
Height 11
damagetype "MirrorBuster2"
States
{
Spawn:
MIRR D 2
loop
}
}

actor MirrorShotLarge : MirrorShotSmall
{
damage (60)
Radius 16
Height 15
damagetype "MirrorBuster3"
States
{
Spawn:
MIRR DE 2
loop
}
}

//// LEGACY ////

actor MirrorBusterFlag : Inventory
{
inventory.amount 1
inventory.maxamount 12
}


actor FireMirrorShotSmall : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
states
{
Spawn:
TNT1 A 0
stop
Pickup:
TNT1 A 0 A_FireCustomMissile("MirrorShotSmall",0,0,0,0)
TNT1 A 0 A_PlaySound("weapon/mirrordeflect")
stop
}
}

actor FireMirrorShotMedium : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
states
{
Spawn:
TNT1 A 0
stop
Pickup:
TNT1 A 0 A_FireCustomMissile("MirrorShotMedium",0,0,0,0)
TNT1 A 0 A_PlaySound("weapon/mirrordeflect")
stop
}
}

actor FireMirrorShotLarge : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
states
{
Spawn:
TNT1 A 0
stop
Pickup:
TNT1 A 0 A_FireCustomMissile("MirrorShotLarge",0,0,0,0)
TNT1 A 0 A_PlaySound("weapon/mirrordeflect2")
stop
}
}


/*actor MirrorBusterTest
{
	+SOLID
	+SHOOTABLE
	+NODAMAGE
	+REFLECTIVE
	Painchance 255
	health 100
	Height 56
	Radius 24
	Scale 2.5
	States
	{
		Spawn:
		ENKR A 0
		SpawnLoop:
		ENKR F 0 A_GiveInventory("MirrorBusterAmmo", 28)
		ENKR FFF 1 A_SpawnItemEx("MirrorBuster1",38,0,0, momx, momy, momz, 0, SXF_ABSOLUTEMOMENTUM, 0)
		ENKR GGG 1 A_SpawnItemEx("MirrorBuster2",38,0,0, momx, momy, momz, 0, SXF_ABSOLUTEMOMENTUM, 0)
		loop
		Pain:
		ENKR H 5
		goto SpawnLoop
	}
}*/