actor NoiseCrushBoss : BaseMM8BDMWep_CBM 
{
tag "NotCastlevaniaSotN"
dropitem "NoiseCrushWepCDropped"
//Weapon.AmmoUse 28
Weapon.AmmoGive 56
Weapon.SlotNumber 1
Obituary "$OB_NOISECRUSH"
Inventory.Pickupmessage "Power up! Noise Crush!"
weapon.ammotype "NoiseCrushClassAmmo"
States
{
Spawn:
C_07 G 1
loop
Ready:
SHDW A 0 ACS_ExecuteAlways(998,0,846)
SHDW A 0 A_JumpIfInventory("NoiseCrushFlagB",1,"Charged")
SHDW A 1 A_WeaponReady
SHDW A 0 A_GiveInventory("NoiseCrushClassAmmo",1)
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
SHDW A 0
SHDW A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
SHDW A 1 A_Raise
Loop
Fire:
SHDW A 0 A_JumpIfInventory("ShademanIsFlying",1,"Swoop")
SHDW A 0 A_JumpIfInventory("NoiseCrushFlagB",1,"Fire2")
SHDW A 0 A_PlaySoundEx("weapon/NoiseC1","Weapon")
SHDW A 0 A_GiveInventory("ShademanMain_CI",1)
SHDW C 9
SHDW BA 4
SHDW A 0 A_Refire
goto Ready+1
Charged:
SHDW E 0 ACS_ExecuteAlways(998,0,850,6)
SHDW G 1 A_PlaySoundEx("weapon/noisecrushcharge","Weapon")
SHDW F 1 ACS_ExecuteAlways(998,0,851,7)
SHDW G 1 ACS_ExecuteAlways(998,0,850,6)
SHDW F 1 ACS_ExecuteAlways(998,0,851,7)
goto ChargedReady
ChargedReady:
SHDW F 0 ACS_ExecuteAlways(998,0,850,6)
SHDW F 0 A_PlaySoundEx("weapon/noisecrushcharge","Weapon")
SHDW G 1 A_WeaponReady
SHDW E 0 ACS_ExecuteAlways(998,0,851,7)
SHDW F 1 A_WeaponReady
SHDW F 0 ACS_ExecuteAlways(998,0,850,6)
SHDW G 1 A_WeaponReady
SHDW E 0 ACS_ExecuteAlways(998,0,851,7)
SHDW F 1 A_WeaponReady
loop
Fire2:
SHDW C 0 A_PlaySoundEx("weapon/NoiseC2","Weapon")
SHDW A 0 A_GiveInventory("ShademanMain2_CI",1)
SHDW C 15 A_TakeInventory("NoiseCrushFlagB",1)
SHDW C 0 ACS_ExecuteAlways(998,0,846,1)
SHDW BA 5
NCRU I 0 A_Refire
Goto Ready+1
AltFire:
TNT1 A 0 A_JumpIfInventory("ShademanIsFlying",1,"FlightMode")
TNT1 A 0 A_JumpIfInventory("NoiseCrushFlagB",1,"Fire2")
SHDW H 0 A_PlaySound("weapon/shadewing",1,0.5)
SHDW HIJ 3
TNT1 A 0 A_GiveInventory("ShademanIsFlying",1)
TNT1 A 0 A_GunFlash
Goto FlightMode
FlightMode:
TNT1 A 0 A_TakeInventory("NoiseCrushClassAmmo",4)
TNT1 A 0 A_JumpIfInventory("NoiseCrushClassAmmo",1,"Thrust")
Goto Flight
Thrust:
TNT1 A 0 A_GiveInventory("ShadeWing",1)
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,2)
TNT1 A 0 ThrustThingZ(0,30,0,0)
TNT1 A 0
Flight:
TNT1 A 0 A_TakeInventory("IsInvunFlag",999)
TNT1 A 0 A_ChangeFlag("INVULNERABLE",0)
TNT1 AAAA 1
TNT1 A 0 A_TakeInventory("ShadeWing",1)
TNT1 AAAAAAAAAAAAAAAA 1 A_JumpIf(floorz-z==0,"FlightEnd")
Flight2:
TNT1 A 0 A_JumpIf(floorz-z==0,"FlightEnd")
TNT1 A 1 A_WeaponReady
loop
Swoop:
TNT1 A 0 A_JumpIfInventory("NoiseCrushClassAmmo",10,"SwoopStart")
Goto Flight
SwoopStart:
TNT1 A 0 A_PlayWeaponSound("weapon/shadedive")
TNT1 A 0 A_GiveInventory("ShadeDrainPower",1)
TNT1 A 0 A_TakeInventory("NoiseCrushClassAmmo",10)
TNT1 A 0 SetPlayerProperty(0,1,0)
TNT1 A 2 A_Stop
SHDW D 2
Swooping:
TNT1 A 0 A_GiveInventory("ShadeDrainPower",1)
TNT1 A 0 A_GiveInventory("IsInvunFlag",1)
TNT1 A 0 A_ChangeFlag("INVULNERABLE",1)
SHDW D 0 A_Recoil(-3)
SHDW D 0 ThrustThingZ(0,7,1,1)
SHDW D 0 A_SpawnItemEx("SwoopDamager",0,0,8,momx+8,momy,momz,0,8,0)
TNT1 A 0 A_JumpIfInventory("SwoopSafeGuard",100,"SwoopFail")
SHDW E 1 A_JumpIf(floorz-z==0,"SwoopFail")
SHDW D 0 A_GiveInventory("SwoopSafeGuard",1)
loop
SwoopFail:
TNT1 A 0 A_TakeInventory("IsInvunFlag",999)
TNT1 A 0 A_ChangeFlag("INVULNERABLE",0)
SHDW D 0 A_TakeInventory("SwoopSafeGuard",999)
SHDW D 0 A_SpawnItemEx("SwoopDamager",0,0,16,momx+8,momy,momz,0,8,0)
SHDW E 2 A_Recoil(-2)
SHDW D 0 A_SpawnItemEx("SwoopDamager",0,0,16,momx+8,momy,momz,0,8,0)
SHDW E 2 A_Recoil(-2)
SHDW D 0 A_SpawnItemEx("SwoopDamager",0,0,16,momx+8,momy,momz,0,8,0)
SHDW E 2 A_Recoil(-2)
SHDW D 0 A_TakeInventory("ShadeDrainPower",1)
SHDW D 0 ThrustThingZ(0,18,0,1)
SHDW E 2 A_Recoil(-2)
SHDW D 0 ThrustThingZ(0,18,0,1)
SHDW E 2 A_Recoil(-2)
SHDW D 0 ThrustThingZ(0,6,0,1)
SHDW E 2 A_Recoil(-2)
SHDW D 0 ThrustThingZ(0,6,0,1)
SHDW D 4 SetPlayerProperty(0,0,0)
Goto FlightEnd
FlightEnd:
SHDW JIH 2
TNT1 A 0 A_TakeInventory("ShademanIsFlying",99)
TNT1 A 0 A_TakeInventory("NoiseCrushFlagB",1)
Goto Ready+1
NoAmmo:
SHDW A 0
Goto Ready+1
Flash:
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,"Fall")
TNT1 A 1 A_SetGravity(0.125)
TNT1 A 0 A_JumpIfInventory("ShademanIsFlying",1,"Flash")
Flash2:
TNT1 A 1 A_GiveInventory("EnvironmentGravity",1) //A_SetGravity(0.8)
stop
Fall:
TNT1 A 1
TNT1 A 0 A_JumpIfInventory("ShademanIsFlying",1,"Flash")
goto Flash2
}
}

actor NoiseCrushFlagB : OnceC {}

actor ShademanIsFlying : OnceC {}

actor ShadeWing : OnceC {}

actor SwoopSafeGuard : Inventory
{
Inventory.amount 1
Inventory.maxamount 50
}

actor ShadeDrainPower : PowerDrain
{
Powerup.Duration -30
}

actor SwoopDamager : BasicExplosion
{
damagetype "ShadeDrain"
Speed 1
Obituary "$OB_SHADESWOOP"
States
{
Spawn:
TNT1 A 0
TNT1 A 2 A_Explode(10,90,0)//15 80
stop
}
}

actor NoiseCrushClassAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 56
+INVENTORY.IGNORESKILL
}

actor NoiseCrushB : NoiseCrush
{
Translation "192:192=4:4", "198:198=61:61"
+DONTREFLECT
Radius 6
Height 6
damage (15)
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("NoiseCrushTrailBoss1",0,0,0,0,0,0,0,1)
TNT1 A 1 A_CountDown
TNT1 A 0 A_SpawnItemEx("NoiseCrushTrailBoss2",0,0,0,0,0,0,0,1)
TNT1 A 1 A_CountDown
TNT1 A 0 A_SpawnItemEx("NoiseCrushTrailBoss3",0,0,0,0,0,0,0,1)
TNT1 A 1 A_CountDown
TNT1 A 0 A_SpawnItemEx("NoiseCrushTrailBoss4",0,0,0,0,0,0,0,1)
TNT1 A 1 A_CountDown
Goto Look
Look:
TNT1 A 0 A_JumpIfCloser(40, "Give")
TNT1 A 0 A_SpawnItemEx("NoiseCrushTrailBoss1",0,0,0,0,0,0,0,1)
TNT1 A 1 A_CountDown
TNT1 A 0 A_JumpIfCloser(40, "Give")
TNT1 A 0 A_SpawnItemEx("NoiseCrushTrailBoss2",0,0,0,0,0,0,0,1)
TNT1 A 1 A_CountDown
TNT1 A 0 A_JumpIfCloser(40, "Give")
TNT1 A 0 A_SpawnItemEx("NoiseCrushTrailBoss3",0,0,0,0,0,0,0,1)
TNT1 A 1 A_CountDown
TNT1 A 0 A_JumpIfCloser(40, "Give")
TNT1 A 0 A_SpawnItemEx("NoiseCrushTrailBoss4",0,0,0,0,0,0,0,1)
TNT1 A 1 A_CountDown
loop
Give:
TNT1 A 2 A_GiveToTarget("NoiseCrushFlagB",1)
stop
}
}

actor NoiseCrushBB : NoiseCrushB{translation "192:192=205:205","198:198=74:74"}
actor NoiseCrushBR : NoiseCrushB{translation "192:192=171:171","198:198=41:41"}
actor NoiseCrushBO : NoiseCrushB{translation "192:192=104:104","198:198=128:128"}
actor NoiseCrushBP : NoiseCrushB{translation "192:192=229:229","198:198=232:232"}

actor NoiseCrush2B : NoiseCrush2
{
Translation "192:192=4:4", "198:198=61:61"
Radius 22
Height 16
damage (40)
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_SpawnItemEx("NoiseCrushTrailBoss5",0,0,0,0,0,0,0,1)
TNT1 A 1 A_SpawnItemEx("NoiseCrushTrailBoss6",0,0,0,0,0,0,0,1)
TNT1 A 1 A_SpawnItemEx("NoiseCrushTrailBoss7",0,0,0,0,0,0,0,1)
TNT1 A 1 A_SpawnItemEx("NoiseCrushTrailBoss8",0,0,0,0,0,0,0,1)
loop
}
}

actor NoiseCrush2BB : NoiseCrush2B{translation "192:192=205:205","198:198=74:74"}
actor NoiseCrush2BR : NoiseCrush2B{translation "192:192=171:171","198:198=41:41"}
actor NoiseCrush2BO : NoiseCrush2B{translation "192:192=104:104","198:198=128:128"}
actor NoiseCrush2BP : NoiseCrush2B{translation "192:192=229:229","198:198=232:232"}

actor NoiseCrushTrailBoss1 : NoiseCrushTrail1
{
States
{
Spawn:
SHDW U 5
stop
}
}

actor NoiseCrushTrailBoss2 : NoiseCrushTrailBoss1
{
States
{
Spawn:
SHDW T 5
stop
}
}

actor NoiseCrushTrailBoss3 : NoiseCrushTrailBoss1
{
States
{
Spawn:
SHDW S 5
stop
}
}

actor NoiseCrushTrailBoss4 : NoiseCrushTrailBoss1
{
States
{
Spawn:
SHDW R 5
stop
}
}

actor NoiseCrushTrailBoss5 : NoiseCrushTrailBoss1
{
States
{
Spawn:
SHDW Y 8
stop
}
}

actor NoiseCrushTrailBoss6 : NoiseCrushTrailBoss1
{
States
{
Spawn:
SHDW X 8
stop
}
}

actor NoiseCrushTrailBoss7 : NoiseCrushTrailBoss1
{
States
{
Spawn:
SHDW W 8
stop
}
}

actor NoiseCrushTrailBoss8 : NoiseCrushTrailBoss1
{
States
{
Spawn:
SHDW V 8
stop
}
}

actor ShademanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("NoiseCrushB",0,0,-8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("NoiseCrushBB",0,0,-8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("NoiseCrushBR",0,0,-8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("NoiseCrushBO",0,0,-8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("NoiseCrushBP",0,0,-8,0)
goto Done
}
}

actor ShademanMain2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("NoiseCrush2B",0,0,-8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("NoiseCrush2BB",0,0,-8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("NoiseCrush2BR",0,0,-8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("NoiseCrush2BO",0,0,-8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("NoiseCrush2BP",0,0,-8,0)
goto Done
}
}