actor BlackHoleBombWepSH : BaseMM8BDMWep replaces BlackHoleBombWep
{
Weapon.AmmoUse 7
Weapon.AmmoGive 56
Weapon.SlotNumber 3
Inventory.Pickupmessage "$PU_BLACKHOLEBOMB"
Obituary "$OB_BLACKHOLEBOMB"
Tag "$TAG_BLACKHOLEBOMB"
weapon.ammotype "BlackHoleBombAmmo"
inventory.icon "BLAKHOLI"
+INVENTORY.RESTRICTABSOLUTELY Inventory.RestrictedTo megamans
States
{
Spawn:
BLKH A 1
loop
Ready:
BHUD A 0 ACS_ExecuteAlways(998,0,196)
BHUD A 0 A_JumpIfInventory("BlackHoleBombCooldown", 1, "Ready2")
BHUD A 1 A_WeaponReady
Goto Ready+1
Ready2:
BHUD E 1 A_WeaponReady
BHUD E 0 A_JumpIfInventory("BlackHoleBombCooldown", 1, "Ready2")
Goto Ready+1
Deselect:
BHUD A 0 A_JumpIfInventory("BlackHoleFlag",1,"DeselectSwitch")
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
BHUD A 1 A_Lower
Goto Deselect+1
DeselectSwitch:
BHUD A 2 A_GiveInventory("BlackHoleFlag",3)
BHUD A 0 A_TakeInventory("BlackHoleFlag",999)
//DeselectCooldown:
//BHUD A 10
//BHUD A 0 A_JumpIfInventory("BlackHoleBombCooldown", 1, "DeselectCooldown")
Goto Deselect+1
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
BHUD A 1 A_Raise
Loop
Fire:
BHUD A 0 A_JumpIfInventory("BlackHoleBombCooldown", 1, "NoAmmo")
BHUD A 0 A_JumpIfInventory("BlackHoleFlag",1,"Switch")
BHUD A 0 A_JumpIfNoAmmo("NoAmmo")
BHUD A 1
BHUD A 0 A_SpawnItemEx("BlackHoleBomb", 0, 8, 32, cos(-pitch)*40, 0, sin(-pitch)*40, 0, SXF_TRANSFERTRANSLATION|SXF_TRANSFERPITCH)
BHUD A 0 A_TakeInventory("BlackHoleBombAmmo", 7)
BHUD A 0 A_GiveInventory("BlackHoleFlag",1)
BHUD BC 3
BHUD A 10
Goto Ready+1
Switch:
BHUD E 10 A_GiveInventory("BlackHoleFlag",1)
BHUD E 0 A_TakeInventory("BlackHoleFlag",999)
Goto Ready+1
NoAmmo:
BHUD A 1 ACS_Execute(979,0)
Goto Ready+1
}
}

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

actor BlackHoleBombProtection : PowerProtection
{
powerup.duration 10
damagefactor "BlackHoleBomb", 0.0
}


actor BlackHoleBomb
{
PROJECTILE
+NOTARGETSWITCH
+FORCEXYBILLBOARD
+RIPPER
Obituary "$OB_BLACKHOLEBOMB"
Radius 15
Height 8
scale 2.5
damage (0)
damagetype "BlackHoleBomb"
speed 25
States
{
Spawn:
BLKH B 0
BLKH B 0 A_PlaySoundEx("weapon/blackholebomb","Weapon",1)
BLKH BB 1 A_JumpIfInTargetInventory("BlackHoleFlag",2,"Switch")
BLKH B 0 ACS_ExecuteAlways(259, 0, 1)
BLKH B 0 
BLKH BB 1 A_JumpIfInTargetInventory("BlackHoleFlag",2,"Switch")
BLKH B 0 ACS_ExecuteAlways(259, 0, 1)
BLKH B 0 

BLKH CC 1 A_JumpIfInTargetInventory("BlackHoleFlag",2,"Switch")
BLKH B 0 
BLKH CC 1 A_JumpIfInTargetInventory("BlackHoleFlag",2,"Switch")
BLKH B 0 

BLKH DD 1 A_JumpIfInTargetInventory("BlackHoleFlag",2,"Switch")
BLKH B 0 ACS_ExecuteAlways(259, 0, 1)
BLKH B 0 
BLKH DD 1 A_JumpIfInTargetInventory("BlackHoleFlag",2,"Switch")
BLKH B 0 ACS_ExecuteAlways(259, 0, 1)
BLKH B 0 

BLKH EE 1 A_JumpIfInTargetInventory("BlackHoleFlag",2,"Switch")
BLKH B 0 
BLKH EE 1 A_JumpIfInTargetInventory("BlackHoleFlag",2,"Switch")
BLKH B 0
loop
Switch:
BLKH B 0 A_StopSound
BLKH B 1 A_JumpIfInTargetInventory("BlackHoleFlag",3,"Death")
BLKH B 0 A_SpawnItemEx("BlackHoleBombExplosionSH",0,0,0,0,0,0,0,SXF_TRANSFERTRANSLATION|SXF_NOCHECKPOSITION)
stop
Death:
BLKH B 1 
BLKH B 0 A_TakeFromTarget("BlackHoleFlag",999)
BLKH B 0 A_SpawnItemEx("BlackHoleBombExplosionSH",0,0,0,0,0,0,0,SXF_TRANSFERTRANSLATION|SXF_NOCHECKPOSITION)
BLKH B 0 A_StopSound
Dying:
BLKH B 0 A_SetScale(scalex, scaley - 0.15)
BLKH B 1 A_FadeOut(0.1) 
BLKH B 0 A_SetScale(scalex, scaley - 0.15)
BLKH B 1 A_FadeOut(0.1) 
BLKH B 0 A_SetScale(scalex, scaley - 0.15)
BLKH C 1 A_FadeOut(0.1) 
BLKH B 0 A_SetScale(scalex, scaley - 0.15)
BLKH C 1 A_FadeOut(0.1) 
BLKH B 0 A_SetScale(scalex, scaley - 0.15)
BLKH D 1 A_FadeOut(0.1) 
BLKH B 0 A_SetScale(scalex, scaley - 0.15)
BLKH D 1 A_FadeOut(0.1) 
BLKH B 0 A_SetScale(scalex, scaley - 0.15)
BLKH E 1 A_FadeOut(0.1)
BLKH B 0 A_SetScale(scalex, scaley - 0.15)
BLKH E 1 A_FadeOut(0.1)
loop 
}
}

actor BlackHoleBombExplosionSH
{
PROJECTILE
+NOINTERACTION
+FORCEXYBILLBOARD
+RIPPER
damage (0)
Obituary "$OB_BLACKHOLEBOMB"
Height 1
Radius 1
damagetype "BlackHoleBomb"
reactiontime 5
Scale 3.0
States
{
Spawn:
BLKH F 0
BLKH F 0 A_GiveToTarget("BlackHoleBombCooldown", 1)
BLKH F 0 A_SpawnItemEx("BlackHoleBombFXSpawnerSH", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
BLKH F 0 A_PlaySoundEx("weapon/blackholebombdetonate", "body", 1)
BLKH F 0 A_Explode(10,128,0)
BLKH QQPP 1
BLKH F 0 A_Explode(10,128,0)
BLKH OONN 1
BLKH F 0 A_Explode(10,128,0)
BLKH MMLL 1
BLKH F 0 A_Explode(10,128,0)
BLKH KKJJ 1
BLKH F 0 A_Explode(10,128,0)
BLKH IIHH 1
BLKH F 0 A_Explode(10,128,0)
BLKH GGFF 1
BLKH Q 0 A_Countdown
goto Spawn+3
Death:
TNT1 A 3//Finish the sound effect before stopping
TNT1 A 0 A_StopSound
stop
}
}

actor BlackHoleBombFXSpawnerSH
{
+NOINTERACTION
+NOGRAVITY
+CLIENTSIDEONLY
-SOLID
height 1
radius 1
reactiontime 18
States
{
	Spawn:
		TNT1 A 0
		TNT1 AA 0 A_SpawnItemEx("BlackHoleBombFXSH", 0, 0, 0, 0, 0, 0, random(0, 359), SXF_TRANSFERTRANSLATION)
		TNT1 A 1 A_SpawnItemEx("BlackHoleBombFXSH", 0, 0, 0, 0, 0, 0, random(0, 359), SXF_TRANSFERTRANSLATION)
		TNT1 AA 0 A_SpawnItemEx("BlackHoleBombFXSH", 0, 0, 0, 0, 0, 0, random(0, 359), SXF_TRANSFERTRANSLATION)
		TNT1 A 1 A_SpawnItemEx("BlackHoleBombFXSH", 0, 0, 0, 0, 0, 0, random(0, 359), SXF_TRANSFERTRANSLATION)
		TNT1 AA 0 A_SpawnItemEx("BlackHoleBombFXSH", 0, 0, 0, 0, 0, 0, random(0, 359), SXF_TRANSFERTRANSLATION)
		TNT1 A 1 A_SpawnItemEx("BlackHoleBombFXSH", 0, 0, 0, 0, 0, 0, random(0, 359), SXF_TRANSFERTRANSLATION)
		TNT1 AA 0 A_SpawnItemEx("BlackHoleBombFXSH", 0, 0, 0, 0, 0, 0, random(0, 359), SXF_TRANSFERTRANSLATION)
		TNT1 A 1 A_SpawnItemEx("BlackHoleBombFXSH", 0, 0, 0, 0, 0, 0, random(0, 359), SXF_TRANSFERTRANSLATION)
		TNT1 AA 0 A_SpawnItemEx("BlackHoleBombFXSH", 0, 0, 0, 0, 0, 0, random(0, 359), SXF_TRANSFERTRANSLATION)
		TNT1 A 1 A_SpawnItemEx("BlackHoleBombFXSH", 0, 0, 0, 0, 0, 0, random(0, 359), SXF_TRANSFERTRANSLATION)
		TNT1 AA 0 A_SpawnItemEx("BlackHoleBombFXSH", 0, 0, 0, 0, 0, 0, random(0, 359), SXF_TRANSFERTRANSLATION)
		TNT1 A 1 A_SpawnItemEx("BlackHoleBombFXSH", 0, 0, 0, 0, 0, 0, random(0, 359), SXF_TRANSFERTRANSLATION)
		TNT1 A 0 A_Countdown
		loop
	Death:
		TNT1 A 0
		stop
}
}

actor BlackHoleBombFXSH
{
+NOINTERACTION
+NOGRAVITY
+CLIENTSIDEONLY
+FORCEXYBILLBOARD
-SOLID
scale 2.5
height 0
radius 0
States
{
Spawn:
BLKH TS 3
BLKH S 0 A_ChangeVelocity(16, 0, 0, CVF_RELATIVE|CVF_REPLACE)
BLKH RRRRRRRRRRRR 1 A_SpawnItemEx("BlackHoleBombFXSH2",0,0,0,momx/1.5,momy/1.5,0,0,SXF_ABSOLUTEMOMENTUM|SXF_TRANSFERTRANSLATION)
stop
}
}

actor BlackHoleBombFXSH2 : BlackHoleBombFXSH
{
States
{
Spawn:
BLKH R 5
stop
}
}
actor BlackHoleBombCooldown : Powerup
{
	powerup.duration 80//132
}
actor RainbowGalaxyPew
{
Translation "192:192=59:59", "198:198=62:62"
PROJECTILE
damagetype "BlackHoleBomb"
Obituary "$OB_BLACKHOLEBOMB"
+FORCEXYBILLBOARD
Damage (10)
radius 10
height 10
Speed 26
scale 1.25
States
{
Spawn:
TNT1 A 1
BLKH BCDE 3 A_SpawnItemEx("BlackHoleBombFX",0,0,0,random(-1,-4),random(2,-2),random(2,-2),0,1)
goto Spawn+1
}
}

actor RainbowGalaxyPew1 : RainbowGalaxyPew{ Speed 30}
actor RainbowGalaxyPew2 : RainbowGalaxyPew{ Speed 24}
actor RainbowGalaxyPew3 : RainbowGalaxyPew{Damage (11) Radius 11 Height 11 Speed 28 Scale 1.5}
actor RainbowGalaxyPew4 : RainbowGalaxyPew{Damage (11) Speed 22}
actor RainbowGalaxyPew5 : RainbowGalaxyPew{Radius 12 Height 12 Scale 1.5}
actor RainbowGalaxyPew6 : RainbowGalaxyPew{Damage (12)}
actor RainbowGalaxyPew7 : RainbowGalaxyPew{Speed 28}

actor RainbowGalaxyPew_Pickup : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7,8)
TNT1 A 0 A_FireCustomMissile("RainbowGalaxyPew1",random(-4,4),1,8,0)stop
TNT1 A 0 A_FireCustomMissile("RainbowGalaxyPew2",random(-3,3),1,8,0)stop
TNT1 A 0 A_FireCustomMissile("RainbowGalaxyPew3",random(-4,4),1,8,0)stop
TNT1 A 0 A_FireCustomMissile("RainbowGalaxyPew4",random(-2,2),1,8,0)stop
TNT1 A 0 A_FireCustomMissile("RainbowGalaxyPew5",random(-4,4),1,8,0)stop
TNT1 A 0 A_FireCustomMissile("RainbowGalaxyPew6",random(-4,4),1,8,0)stop
TNT1 A 0 A_FireCustomMissile("RainbowGalaxyPew7",random(-3,3),1,8,0)stop
TNT1 A 0 A_FireCustomMissile("RainbowGalaxyPew", random(-2,2),1,8,0,0,0)
stop
}
}
