actor BlackHoleBombBoss : BaseMM8BDMWep_CBM
{
tag "$TAGC_9H"
dropitem "RainbowGalaxyWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 56
Obituary "$OB_BLACKHOLEBOMB"
Inventory.Pickupmessage "unfunny dev comment goes here"
weapon.ammotype "SpaceTravelAmmo"
States
{
Spawn:
C_09 RSTUVWX 4
loop

Ready:
GALH V 0 ACS_ExecuteAlways(998,0,DYE_GALAXYMAN)
GALH V 0 A_GunFlash
GALH V 2
goto Ready0

Ready0:
GALH V 0 A_JumpIfInventory("BlackHoleBombCooldown",1,"Ready0_1")
goto Ready0_2
Ready0_1:
GALH V 0 A_JumpIfInventory("SpaceTravelAmmo",1,"Ready0_3")
GALH V 4 A_WeaponReady(WRF_NOPRIMARY)
GALH V 0 A_JumpIfInventory("GalaxyPortFlag",1,2)
GALH V 0 A_GiveInventory("SpaceTravelAmmo",3)
GALH V 0
GALH V 0 A_JumpIfInventory("BlackHoleBombCooldown",1,"Ready0_1")
goto Ready0
Ready0_2:
GALH V 0 A_JumpIfInventory("SpaceTravelAmmo",1,"Ready0_4")
GALH V 4 A_WeaponReady
GALH V 0 A_JumpIfInventory("GalaxyPortFlag",1,2)
GALH V 0 A_GiveInventory("SpaceTravelAmmo",3)
GALH V 0
loop
Ready0_3:
GALH V 4 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWRELOAD)
GALH V 0 A_JumpIfInventory("GalaxyPortFlag",1,2)
GALH V 0 A_GiveInventory("SpaceTravelAmmo",3)
GALH V 0
GALH V 0 A_JumpIfInventory("BlackHoleBombCooldown",1,"Ready0.3")
goto Ready0_4
Ready0_4:
GALH V 4 A_WeaponReady(WRF_ALLOWRELOAD)
GALH V 0 A_JumpIfInventory("GalaxyPortFlag",1,2)
GALH V 0 A_GiveInventory("SpaceTravelAmmo",3)
GALH V 0
loop

ReadyC:
GALH V 0 A_JumpIfInventory("BlackHoleBombCooldown",1,"Ready1")
goto Ready2

Flash:
TNT1 A 0 A_Jump(256,1,3,5,7,9,11,13)
TNT1 A 2 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 2 ACS_ExecuteAlways(991,0,DYE_GALAXYMAN1)
TNT1 A 2 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 2 ACS_ExecuteAlways(991,0,DYE_GALAXYMAN7)
TNT1 A 2 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 2 ACS_ExecuteAlways(991,0,DYE_GALAXYMAN6)
TNT1 A 2 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 2 ACS_ExecuteAlways(991,0,DYE_GALAXYMAN5)
TNT1 A 2 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 2 ACS_ExecuteAlways(991,0,DYE_GALAXYMAN4)
TNT1 A 2 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 2 ACS_ExecuteAlways(991,0,DYE_GALAXYMAN3)
TNT1 A 2 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 2 ACS_ExecuteAlways(991,0,DYE_GALAXYMAN2)
goto Flash+1

Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
GALH V 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
GALH V 1 A_Raise
Loop

Fire:
GALH V 0 A_JumpIfInventory("GalaxyAltFlag",1,"Fire_A")
GALH V 0 A_JumpIfInventory("BlackHoleFlag",1,"Fire2")
GALH V 0 A_JumpIfInventory("BlackHoleBombCooldown",1,"Fire2Wait")

GALH V 0 A_GiveInventory("GalaxymanMain_CI",1)
GALH V 0 A_GiveInventory("BlackHoleFlag",1)

Fire_0:
/*GALH BC 3
GALH C 4 offset(50,-7)
GALH C 3 A_WeaponReady(14)//Reset offsets
GALH B 3*/ //16
GALH V 1 offset(0,60) 
GALH V 1 offset(0,90)
TNT1 A 1 A_WeaponReady(14)
TNT1 A 1 offset(0,100)
GALH N 1 offset(0,80)
GALH N 2 offset(0,60)
//GALH E 3 offset(0,40)
//GALH G 2 offset(0,60)
GALH N 2 offset(0,80)
TNT1 A 4 A_WeaponReady(14)
TNT1 A 1 offset(0,60)
GALH V 1 offset(0,50)
GALH V 1 offset(0,36) 
goto Ready0

BotFire:
GALH V 1 //A_GiveInventory("RainbowGalaxyBoss",1)
GALH V 1 //A_SelectWeapon("RainbowGalaxyBoss")
Goto Ready0

Fire2:
GALH V 0 A_JumpIfInventory("MissingBlackHole",1,"Fire2Reset")
GALH V 0 A_GiveInventory("BlackHoleFlagD",1)
GALH V 0 A_GiveInventory("Blackholecooldownindicatorbar",1)
GALH V 0 A_GiveInventory("MissingBlackHole",1)
goto Fire2Wait
Fire2Reset:
GALH V 0 A_PlaySoundEx("GNT/FailUse","Body")
GALH V 0 A_TakeInventory("BlackHoleFlagD",999)
GALH V 0 A_TakeInventory("MissingBlackHole",999)
GALH V 0 A_TakeInventory("BlackHoleFlag",999)
GALH V 0 A_TakeInventory("BlackHoleBombCooldown",999)
goto Fire2Wait

Fire2Wait:
Fire2_0:
GALH W 2 Offset(7,38)A_RailWait
GALH W 2 Offset(10,41)A_RailWait
Goto Ready0

Altfire:
GALH A 0 A_JumpIfInventory("GalaxyAltFlag",1,"Fire_A")
AltfireStart:
GALH V 0 ACS_NamedExecuteAlways("GalaxyM2M1") 
GALH C 0 A_GiveInventory("GalaxyIsM2",1)
GALH A 2 Offset(25, 1)
GALH A 1 Offset(50, -32)
GALH B 2 Offset(75, -72)
GALH C 1 Offset(12, -35)
Altfiring:
GALH C 0 A_PlaySoundEx("weapon/blackholebombC","Weapon")
GALH C 0 A_GiveInventory("GalaxymanMain2_CI",1)
GALH OPQRSTU 2 Offset(-33, -7)
GALH C 0 Offset(-16, 13) A_ReFire("Altfiring")
AltfireEnd:
GALH C 2 Offset(-16, 13)
GALH V 4 A_WeaponReady(14)
GALH C 0 A_TakeInventory("GalaxyIsM2",99)
Goto Ready0

Reload:
GALH V 0 A_JumpIfInventory("GalaxyAltFlag",1,"ReloadEnd")
GALH V 0 A_JumpIfInventory("GalaxyPortFlag",1,"GalaxyTeleport")
GALH V 0 A_JumpIfInventory("SpaceTravelAmmo",1,"Reload2")
Goto ReadyC

Fire_A:
TNT1 A 1 A_GiveInventory("BlackHoleFlagD",1)
goto Reload4

Reload2:
GALH V 0 A_GiveInventory("GalaxyAltFlag",1)
GALH V 0 ACS_NamedExecuteAlways("GalaxyRM1") 
GALH V 0 SetPlayerProperty(0,1,0)
GALH V 0 A_JumpIfInventory("FlightDisableFlag",1,2)
GALH V 0 A_ChangeFlag("NOGRAVITY",1)
GALH V 0
GALH V 1 offset(30,32)
GALH V 1 offset(60,36) 
GALH V 1 offset(100,40) 
GALH V 1 offset(150,44)
TNT1 A 1 A_WeaponReady(14)
TNT1 A 1 offset(0,100)
GALH E 1 offset(0,80)
GALH E 1 offset(0,60)
GALH E 1 offset(0,40)
goto Reload2End

Reload2End:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("BlackHoleFlag",1,"Reload3")
Goto Reload4

Reload3:
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,3)
TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
TNT1 A 0 A_JumpIfInventory("ImpairmentStack",1,"Reload33")
TNT1 A 0 ThrustThingZ(0,2,0,1)
TNT1 A 0 A_Recoil(-8)
TNT1 A 0 A_TakeInventory("SpaceTravelAmmo",9)
TNT1 A 0 A_PlaySoundEx("weapon/RamFlight","Weapon")
TNT1 A 0 A_SpawnItemEX("GalaxyRam",0,0,28,momx,momy,momz,0,8)
GALH E 2 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_ALLOWRELOAD)
TNT1 A 0 A_SpawnItemEX("GalaxyRam",0,0,28,momx,momy,momz,0,8)
GALH F 2 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_ALLOWRELOAD)
TNT1 A 0 A_SpawnItemEX("GalaxyRam",0,0,28,momx,momy,momz,0,8)
GALH G 2 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_ALLOWRELOAD)
TNT1 A 0 A_JumpIfInventory("SpaceTravelAmmo",1,"Reload3")
goto ReloadEnd
Reload33:
TNT1 A 0 ThrustThingZ(0,2*ACS_NamedExecuteWithResult("ImpairmentACS")/100,0,1)
TNT1 A 0 A_Recoil(-8*ACS_NamedExecuteWithResult("ImpairmentACS")/100)
TNT1 A 0 A_TakeInventory("SpaceTravelAmmo",9)
TNT1 A 0 A_PlaySoundEx("weapon/RamFlight","Weapon")
TNT1 A 0 A_SpawnItemEX("GalaxyRam",0,0,28,momx,momy,momz,0,8)
GALH E 2 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_ALLOWRELOAD)
TNT1 A 0 A_SpawnItemEX("GalaxyRam",0,0,28,momx,momy,momz,0,8)
GALH F 2 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_ALLOWRELOAD)
TNT1 A 0 A_SpawnItemEX("GalaxyRam",0,0,28,momx,momy,momz,0,8)
GALH G 2 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_ALLOWRELOAD)
TNT1 A 0 A_JumpIfInventory("SpaceTravelAmmo",1,"Reload3")
goto ReloadEnd

Reload4:
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,3)
TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
TNT1 A 0 A_JumpIfInventory("ImpairmentStack",1,"Reload44")
TNT1 A 0 ThrustThingZ(0,2,0,1)
TNT1 A 0 A_Recoil(-8)
TNT1 A 0 A_TakeInventory("SpaceTravelAmmo",9)
TNT1 A 0 A_PlaySoundEx("weapon/RamFlight","Weapon")
TNT1 A 0 A_SpawnItemEX("GalaxyRam",0,0,28,momx,momy,momz,0,8)
GALH E 2 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_ALLOWRELOAD)
TNT1 A 0 A_SpawnItemEX("GalaxyRam",0,0,28,momx,momy,momz,0,8)
GALH F 2 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_ALLOWRELOAD)
TNT1 A 0 A_SpawnItemEX("GalaxyRam",0,0,28,momx,momy,momz,0,8)
GALH G 2 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_ALLOWRELOAD)
TNT1 A 0 A_JumpIfInventory("SpaceTravelAmmo",1,"Reload4")
goto ReloadEnd
Reload44:
TNT1 A 0 ThrustThingZ(0,2*ACS_NamedExecuteWithResult("ImpairmentACS")/100,0,1)
TNT1 A 0 A_Recoil(-8*ACS_NamedExecuteWithResult("ImpairmentACS")/100)
TNT1 A 0 A_TakeInventory("SpaceTravelAmmo",9)
TNT1 A 0 A_PlaySoundEx("weapon/RamFlight","Weapon")
TNT1 A 0 A_SpawnItemEX("GalaxyRam",0,0,28,momx,momy,momz,0,8)
GALH E 2 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_ALLOWRELOAD)
TNT1 A 0 A_SpawnItemEX("GalaxyRam",0,0,28,momx,momy,momz,0,8)
GALH F 2 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_ALLOWRELOAD)
TNT1 A 0 A_SpawnItemEX("GalaxyRam",0,0,28,momx,momy,momz,0,8)
GALH G 2 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY|WRF_ALLOWRELOAD)
TNT1 A 0 A_JumpIfInventory("SpaceTravelAmmo",1,"Reload4")
goto ReloadEnd

ReloadEnd:
GALH C 0 A_TakeInventory("GalaxyAltFlag",999)
GALH C 0 SetPlayerProperty(0,0,0)
GALH C 0 A_ChangeFlag("NOGRAVITY",0)

ReloadEnd_0:
GALH E 1 offset(0,40)
GALH E 1 offset(0,60)
GALH E 1 offset(0,80)
TNT1 A 1 offset(0,100)
TNT1 A 1 offset(150,44)
GALH V 1 offset(150,44)
GALH V 1 offset(100,40) 
GALH V 1 offset(60,36) 
GALH V 1 offset(30,32)
GALH V 4 A_WeaponReady(14)
Goto Ready0

GalaxyTeleport:
GALH V 0 A_PlaySound("classes/GalaxyTeleport",1,0.5)
GALH V 0 A_SpawnItemEx("GalaxymanPortalWarperFX",0,0,0,0,0,0,0,1)
goto GalaxyTeleport_0
GalaxyTeleport_0:
GALH V 2 Offset(25, 1)
GALH V 2 Offset(50, -32)
GALH HIJKLM 1
GALH V 0 A_TakeInventory("UnSolid",1)
GALH V 0 A_ChangeFlag("SOLID",0)
GALH V 0 A_GiveInventory("Nudge",1)
TNT1 A 1 Thing_Move(tid, tid+6000, 1)
GALH V 0 A_SpawnItemEx("ResolidifyPlayer_H")
GALH V 0 A_PlaySound("classes/GalaxyTeleport",1,0.5)
GALH MLKJI 1
GALH H 2 Offset(50, -32)
GALH V 2 Offset(25, 1)
goto Ready0
}
}

ACTOR GalaxyIsM2 : inventory
{
Inventory.MaxAmount 1
-invbar
}

actor Blackholecooldownindicatorbar2 : Powerup
{ 
}
  
actor Blackholecooldownindicatorbar : PowerupGiver
{ 
powerup.type "Blackholecooldownindicatorbar2"
Powerup.Duration 105
+INVENTORY.AUTOACTIVATE   
} 

actor SpaceTravelAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 224
+INVENTORY.IGNORESKILL
}

actor GalaxyAltFlag :OnceC {}

actor GalaxyPortFlag :OnceC{}

actor GalaxyPortCoolDown : Powerup
{
powerup.duration 35
}

actor BlackHoleFlagD : Powerup
{
powerup.duration 35
}

actor GalaxyHudFlag : Inventory
{
inventory.amount 1
inventory.maxamount 7
}

actor MissingBlackHole : OnceC {}

actor GalaxyHudCvar_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("cbm_OldGalaxyHud"),"Pickup0")
goto Pickup1
Pickup0:
TNT1 A 0 A_TakeInventory("GalaxyHudFlag",99)
stop
Pickup1:
TNT1 A 0 A_JumpIfInventory("GalaxyHudFlag",1,"No")
TNT1 A 0 A_GiveInventory("GalaxyHudFlag",random(1,7))
stop
No:
TNT1 A 0
stop
}
}


actor PortalItem : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "GALCON8"
inventory.pickupmessage "Now you're thinking with Portals!"
Tag "$TAGC_9H2"
scale 2.0
+INVBAR
states
{
Spawn:
GLCN A 1
loop
Use:
TNT1 A 0 A_JumpIfInventory("GalaxyPortFlag",1,"Take")
TNT1 A 0 A_JumpIfInventory("GalaxyPortCoolDown",1,"No")
TNT1 A 0 A_PlaySoundEX("weapon/shieldhum","SoundSlot6")
TNT1 A 0 A_GiveInventory("GalaxyPortFlag",1)
TNT1 A 0 A_SpawnItemEx("GalaxyPortWatcher")
TNT1 A 0 A_SpawnItemEx("PortChecker",0,0,0,0,0,0,0,1)
//TNT1 A 0 A_SpawnItemEx("GalaxyHoleMarker",0,0,0,0,0,0,0,1)
fail
Take:
TNT1 A 0 A_PlaySoundEX("misc/astroplatformappear","SoundSlot6")
TNT1 A 0 A_GiveInventory("GalaxyPortCoolDown",1)
TNT1 A 0 A_TakeInventory("GalaxyPortFlag",999)
fail
No:
TNT1 A 0
fail
}
}


actor GalaxyPortWatcher : BasicHelper
{
states
{
Spawn:
TNT1 A 0
TNT1 A 1
TNT1 A 0 A_JumpIfInventory("WeaponCharge",32,7)
TNT1 A 0 A_JumpIfInTargetInventory("GalaxyPortFlag",1,2)
TNT1 A 1 A_TakeFromTarget("GalaxyPortFlag",99)
stop
TNT1 A 0 A_JumpIfInTargetInventory("SpaceTravelAmmo",1,3)
TNT1 A 0 A_GiveToTarget("PortCheckerSoundOff",1)
TNT1 A 1 A_TakeFromTarget("GalaxyPortFlag",99)
stop
TNT1 A 0 A_GiveInventory("WeaponCharge",1)
goto Spawn
TNT1 A 0 A_JumpIfInTargetInventory("IsDead",1,"Death")
TNT1 A 0 A_TakeFromTarget("SpaceTravelAmmo",6)
TNT1 A 0 A_TakeInventory("WeaponCharge",999)
TNT1 A 0 A_JumpIfInTargetInventory("SpaceTravelAmmo",1,"Spawn")
TNT1 A 0 A_GiveToTarget("PortCheckerSoundOff",1)
TNT1 A 1 A_TakeFromTarget("GalaxyPortFlag",99)
stop
Death:
TNT1 A 1 A_TakeFromTarget("GalaxyPortFlag",99)
stop
}
}

actor PortChecker
{
-SOLID
+NOGRAVITY
+DONTBLAST
+THRUACTORS
+NOINTERACTION
+FORCEXYBILLBOARD
height 1
radius 1
scale 2.0
States
{
Spawn:
TNT1 A 0
TNT1 A 0 Thing_ChangeTID(0,6000+ACS_ExecuteWithResult(257, 0))
Spawn2:
BLKT WWXXYYZZ 1
TNT1 A 0 A_JumpIfInTargetInventory("IsDead",1,"SuperDeath")
TNT1 A 0 A_JumpIfInTargetInventory("GalaxyPortFlag",1,"Spawn2")
goto SuperDeath
SuperDeath:
TNT1 A 0 //A_PlaySoundEx("misc/astroplatformappear","Body")
//TNT1 A 0 A_TakeFromTarget("GalaxyPortFlag",999)
BLKT WWXXYYZZ 1 A_FadeOut(0.1)
TNT1 A 0 A_JumpIfInTargetInventory("GalaxyPortFlag",1,"EmergancyRecoveryMode")
stop
EmergancyRecoveryMode:
BLKT WWXXYYZZ 1 A_FadeIn(0.1)
goto Spawn2
}
}

actor PortCheckerSoundOff : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("GalaxyPortCoolDown",1)
TNT1 A 0 A_PlaySoundEx("misc/astroplatformappear","Body")//A_PlaySoundEX("weapon/shieldhum","SoundSlot6")
stop
}
}

actor GalaxyHoleMarker : MapMarker
{
height 0
radius 0
//+CLIENTSIDEONLY
+NOINTERACTION
+NOGRAVITY
-SOLID
States
{
Spawn:
BLKH BBCCDDEE 1
TNT1 A 0 A_JumpIfInTargetInventory("GalaxyPortFlag",1,"Spawn")
BLKH BBCCDDEEBBCCDDEE 1 A_FadeOut(0.1)
stop
}
}


actor GalaxymanPortalWarperFX_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_Warp(2,0,0,32,0,24)
TNT1 A 0 A_SetScale(ScaleX-0.2)
TNT1 A 0 A_FadeOut(0.05)
stop
}
}

actor GalaxymanPortalWarperFX : ShieldWarper_CBM
{
Renderstyle translucent
Alpha 1.0
Scale 2.0
States
{
Spawn:
9P_H A 0
9P_H AABBAABBAA 1 A_GiveInventory("GalaxymanPortalWarperFX_P",1)
stop
}
}

actor BlackHoleBombPewPew
{
Translation "192:192=59:59","198:198=62:62"
PROJECTILE
damagetype "GalaxyM_Shot"
Obituary "$OB_BLACKHOLEPEW"
+FORCEXYBILLBOARD
+THRUSPECIES
Species "DumbBlackHole"
Damage (13)
Speed 30
radius 10
height 10
scale 1.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("BULL_Tidifier", 0)
SpawnLOOP:
TNT1 A 1
BLKH BBCCDDEE 1 A_SpawnItemEx("BlackHoleBombXFX3",0,0,0,random(-1,-4),random(2,-2),random(2,-2),0,1)
goto SpawnLOOP+1
}
}

actor BlackHoleBombPewPew1 : BlackHoleBombPewPew{Translation"192:192=205:205","198:198=206:206"}
actor BlackHoleBombPewPew2 : BlackHoleBombPewPew{Translation"192:192=103:103","198:198=116:116"}
actor BlackHoleBombPewPew3 : BlackHoleBombPewPew{Translation"192:192=106:106","198:198=111:111"}
actor BlackHoleBombPewPew4 : BlackHoleBombPewPew{Translation"192:192=248:248","198:198=230:230"}
actor BlackHoleBombPewPew5 : BlackHoleBombPewPew{Translation"192:192=225:225","198:198=227:227"}
actor BlackHoleBombPewPew6 : BlackHoleBombPewPew{Translation"192:192=38:38","198:198=40:40"}
actor BlackHoleBombPewPew7 : BlackHoleBombPewPew{Translation"192:192=57:57","198:198=60:60"}

actor BlackHoleBombPewPewB : BlackHoleBombPewPew{Translation "192:192=205:205","198:198=74:74"}
actor BlackHoleBombPewPewR : BlackHoleBombPewPew{Translation "192:192=171:171","198:198=41:41"}
actor BlackHoleBombPewPewO : BlackHoleBombPewPew{Translation "192:192=104:104","198:198=128:128"}
actor BlackHoleBombPewPewP : BlackHoleBombPewPew{Translation "192:192=229:229","198:198=232:232"}

actor BlackHoleBombX
{
Translation "192:192=59:59","198:198=62:62"//250 251
var int user_S;
DeathSound "weapon/blackholebombdetonateC"
PROJECTILE
Obituary "$OB_BLACKHOLEBOMB"
damagetype "GalaxyM_BHB"
+NOTARGETSWITCH
+FORCEXYBILLBOARD
+BRIGHT
+SKYEXPLODE
+EXPLODEONWATER
+RIPPER
+DONTBLAST
+THRUSPECIES
Species "DumbBlackHole"
damage (0)
Radius 15
Height 8
speed 12
scale 2.5
States
{
Spawn:
BLKH B 0
BLKH B 0 ACS_ExecuteAlways(259,0,1)
BLKH B 0 A_PlaySoundEx("weapon/blackholebombC","Voice",1)
Spawn2:
BLKH BB 1 A_JumpIfInTargetInventory("BlackHoleFlagD",1,"Next")
BLKH B 0 ACS_ExecuteAlways(259,0,1)
BLKH B 0 A_ChangeVelocity(cos(-pitch)*15,0,sin(-pitch)*15,3)
BLKH BB 1 A_JumpIfInTargetInventory("BlackHoleFlagD",1,"Next")
BLKH B 0 ACS_ExecuteAlways(259,0,1)
BLKH B 0 A_ChangeVelocity(cos(-pitch)*15,0,sin(-pitch)*15,3)

BLKH CC 1 A_JumpIfInTargetInventory("BlackHoleFlagD",1,"Next")
BLKH C 0 ACS_ExecuteAlways(259,0,1)
BLKH C 0 A_ChangeVelocity(cos(-pitch)*15,0,sin(-pitch)*15,3)
BLKH CC 1 A_JumpIfInTargetInventory("BlackHoleFlagD",1,"Next")
BLKH C 0 ACS_ExecuteAlways(259,0,1)
BLKH C 0 A_ChangeVelocity(cos(-pitch)*15,0,sin(-pitch)*15,3)
BLKH C 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")

BLKH DD 1 A_JumpIfInTargetInventory("BlackHoleFlagD",1,"Next")
BLKH B 0 ACS_ExecuteAlways(259,0,1)
BLKH B 0 A_ChangeVelocity(cos(-pitch)*15,0,sin(-pitch)*15,3)
BLKH DD 1 A_JumpIfInTargetInventory("BlackHoleFlagD",1,"Next")
BLKH B 0 ACS_ExecuteAlways(259,0,1)
BLKH B 0 A_ChangeVelocity(cos(-pitch)*15,0,sin(-pitch)*15,3)

BLKH EE 1 A_JumpIfInTargetInventory("BlackHoleFlagD",1,"Next")
BLKH E 0 ACS_ExecuteAlways(259,0,1)
BLKH E 0 A_ChangeVelocity(cos(-pitch)*15,0,sin(-pitch)*15,3)
BLKH EE 1 A_JumpIfInTargetInventory("BlackHoleFlagD",1,"Next")
BLKH E 0 ACS_ExecuteAlways(259,0,1)
BLKH E 0 A_ChangeVelocity(cos(-pitch)*15,0,sin(-pitch)*15,3)
BLKH E 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
loop
Next: 
TNT1 A 0 A_Stop
TNT1 A 0 A_SpawnItemEx("BlackHoleX",0,0,0,0,0,0,0,33)
//TNT1 A 1 A_StopSound(4)
stop
Death:
TNT1 A 0 A_SpawnItemEx("BlackHoleBombXDeath",0,0,0,0,0,0,0,33)
TNT1 A 0 A_TakeFromTarget("MissingBlackHole",999)
TNT1 A 0 A_TakeFromTarget("BlackHoleFlagD",999)
TNT1 A 0 A_TakeFromTarget("BlackHoleFlag",999)
//TNT1 A 1 A_StopSound(4)
TNT1 A 1 
TNT1 A 0 A_TakeFromTarget("BlackHoleFlag",999)
stop
}
}

actor BlackHoleBombXB : BlackHoleBombX{translation "192:192=205:205","198:198=74:74"}
actor BlackHoleBombXR : BlackHoleBombX{translation "192:192=171:171","198:198=41:41"}
actor BlackHoleBombXO : BlackHoleBombX{translation "192:192=104:104","198:198=128:128"}
actor BlackHoleBombXP : BlackHoleBombX{translation "192:192=229:229","198:198=232:232"}

actor BlackHoleBombXBot : BlackHoleBombX
{
-RIPPER
+SEEKERMISSILE
+SCREENSEEKER
ReactionTime 10
scale 2.5
States
{
Spawn:
BLKH B 0
BLKH B 0 A_PlaySoundEx("weapon/blackholebombC","Body",1)
Spawn2:
BLKH BBBBCCCC 1 A_SeekerMissile(2,10,3,96,3)
BLKH D 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"SuperDeath")
BLKH DDDDEEEE 1 A_SeekerMissile(2,10,3,96,3)
BLKH B 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"SuperDeath")
BLKH B 0 A_CountDown
loop
SuperDeath:
goto Super::Death
Death:
TNT1 A 0 A_Stop
TNT1 A 0 A_SpawnItemEx("BlackHoleX",0,0,0,0,0,0,0,33)
TNT1 A 1 A_StopSound(4)
stop
}
}

actor BlackHoleBombXBotB : BlackHoleBombXBot{translation "192:192=205:205","198:198=74:74"}
actor BlackHoleBombXBotR : BlackHoleBombXBot{translation "192:192=171:171","198:198=41:41"}
actor BlackHoleBombXBotO : BlackHoleBombXBot{translation "192:192=104:104","198:198=128:128"}
actor BlackHoleBombXBotP : BlackHoleBombXBot{translation "192:192=229:229","198:198=232:232"}

actor BlackHoleBombXDeath : BasicExplosion
{
Obituary "$OB_BLACKHOLEBOMBX"
damagetype "GalaxyM_Shot"
ReactionTime 5
Scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("weapon/blackholebombdetonateC","Body")
9P_H A 0 A_Explode(10,96,0,0,48)
9P_H ABABABABAB 2 A_SetScale(ScaleX-0.2)
stop
}
}

actor GalaxyM_BHBProtect : PowerProtection
{
Powerup.Duration 9
DamageFactor "GalaxyM_BHB", 0.12
}

actor GalaxyM_BHBProtect4 : PowerProtection
{
Powerup.Duration 9
DamageFactor "GalaxyM_BHB", 0.0
}

actor PowerGalaxyBHB_ACS : PowerSpeed
{
Speed 2.1
powerup.duration 8
+POWERSPEED.NOTRAIL
}

actor BlackHoleX
{
PROJECTILE
Obituary "$OB_BLACKHOLEBOMB"
damagetype "GalaxyM_BHB"
+NOINTERACTION
+FORCEXYBILLBOARD
+BRIGHT
+THRUACTORS
+NOTARGETSWITCH
+THRUSPECIES
Species "DumbBlackHole"
reactiontime 6
damage (0)
Radius 2
Height 2
Scale 3.0
States
{
Spawn:
BLKH F 0
BLKH F 0 A_TakeFromTarget("MissingBlackHole",999)
BLKH F 0 A_TakeFromTarget("BlackHoleFlag",999)
BLKH F 0 A_TakeFromTarget("BlackHoleFlagD",999)
BLKH F 0 A_GiveToTarget("BlackHoleBombCooldown",1)
BLKH F 0 A_PlaySound("weapon/blackholebombdetonateC",2,1,1)
Spawn2:
BLKH F 0 A_SpawnItemEx("BlackHoleXHelperFX",0,0,0,0,0,0,0,1)
BLKH FFGG 1 A_GiveInventory("BlackHoleX_Pickup",1)
BLKH H 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
BLKH H 0 A_SpawnItemEx("BlackHoleXHelperFX",0,0,0,0,0,0,0,1)
BLKH HHII 1 A_GiveInventory("BlackHoleX_Pickup",1)
BLKH J 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
BLKH J 0 A_SpawnItemEx("BlackHoleXHelperFX",0,0,0,0,0,0,0,1)
BLKH JJKK 1 A_GiveInventory("BlackHoleX_Pickup",1)
BLKH L 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
BLKH F 0 A_CountDown
BLKH L 0 A_SpawnItemEx("BlackHoleXHelperFX",0,0,0,0,0,0,0,1)
BLKH LLMM 1 A_GiveInventory("BlackHoleX_Pickup",1)
BLKH N 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
BLKH N 0 A_SpawnItemEx("BlackHoleXHelperFX",0,0,0,0,0,0,0,1)
BLKH NNOO 1 A_GiveInventory("BlackHoleX_Pickup",1)
BLKH P 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
BLKH P 0 A_SpawnItemEx("BlackHoleXHelperFX",0,0,0,0,0,0,0,1)
BLKH PPQQ 1 A_GiveInventory("BlackHoleX_Pickup",1)
BLKH F 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
BLKH F 0 A_CountDown
loop
Death:
TNT1 A 0 ACS_NamedExecuteAlways("cbm_GalaxyBHB_ACSEnd",0,224)
TNT1 A 1 A_PlaySound("weapon/BlackHoleBombPoof",1,0.75)
X_9H Z 4
TNT1 A 1
X_9H X 3
TNT1 A 1
X_9H Y 3
TNT1 A 1 A_StopSound(2)
X_9H Z 3
TNT1 A 1
X_9H X 2
TNT1 A 1
X_9H Y 2
TNT1 A 1
X_9H Z 2
TNT1 A 1
X_9H X 1
TNT1 A 1
X_9H Y 1
TNT1 A 1
X_9H Z 1
TNT1 A 1
TNT1 A 0 A_TakeFromTarget("BlackHoleBombCooldown",999)
TNT1 A 1
stop
}
}

actor BlackHoleXPlayerEnd_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(C_JAX_CHECK_JUMP)==1,"Pickup_J")
stop
Pickup_J:
TNT1 A 0 A_ChangeVelocity(momx,momy,11,2)
stop
}
}

actor BlackHoleX_Pickup : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("BlackHoleX_Damager",0,0,16)
TNT1 A 0 ACS_NamedExecuteAlways("cbm_GalaxyBHB_ACS",0,4,8,168)//cbm_GalaxyBHB_ACS",0,4,22,224
stop
}
}


actor BlackHoleX_Damager : BasicExplosion
{
Obituary "$OB_BLACKHOLEBOMB"
damagetype "GalaxyM_BHB"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(27,24,0,0,24)
TNT1 A 4
stop
}
}

actor BlackHoleXHelperFX : BasicClientSide
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0
TNT1 A 0 A_SetPitch(random(-1,1)*10)//(random(0,1)*2-1)
TNT1 AA 0 //A_SpawnItemEx("BlackHoleBombXFX1",0,0,0,Cos(pitch)*224,0,-sin(pitch)*224,random(0,359),513)
TNT1 AA 0 A_SpawnItemEx("BlackHoleBombXFX1",Cos(pitch)*168,0,-sin(pitch)*168,0,0,0,random(0,359),513)
TNT1 A 1
TNT1 A 0 A_SetPitch(random(2,5)*10)
TNT1 A 0 A_SpawnItemEx("BlackHoleBombXFX1",Cos(pitch)*168,0,-sin(pitch)*168,0,0,0,random(0,359),513)
TNT1 A 0 A_SetPitch(random(-2,-4)*10)
TNT1 A 0 A_SpawnItemEx("BlackHoleBombXFX1",Cos(pitch)*168,0,-sin(pitch)*168,0,0,0,random(0,359),513)
TNT1 A 1
TNT1 A 0 A_SetPitch(random(5,9)*10)
TNT1 A 0 A_SpawnItemEx("BlackHoleBombXFX1",Cos(pitch)*168,0,-sin(pitch)*168,0,0,0,random(0,359),513)
TNT1 A 0 A_SetPitch(random(-5,-9)*10)
TNT1 A 0 A_SpawnItemEx("BlackHoleBombXFX1",Cos(pitch)*168,0,-sin(pitch)*168,0,0,0,random(0,359),513)
TNT1 A 1
TNT1 A 0 A_SetPitch(random(-9,9)*10)
TNT1 AA 0 A_SpawnItemEx("BlackHoleBombXFX1",Cos(pitch)*168,0,-sin(pitch)*168,0,0,0,random(0,359),513)
TNT1 A 1
stop
}
}

actor BlackHoleBombXFX : BasicClientSide
{
+FORCEXYBILLBOARD
States
{
Spawn:
BLKH TS 3
BLKH S 0 A_ChangeVelocity(-16,0,0,3)
BLKH RRRRRRRRRRRR 1 A_SpawnItemEx("BlackHoleBombXFX2",0,0,0,momx/1.5,momy/1.5,0,0,9)
stop
}
}

actor BlackHoleBombXFX1 : BlackHoleBombXFX
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 //A_ScaleVelocity(0.00390625)
BLKH TS 3
BLKH S 0 A_ChangeVelocity(Cos(pitch)*-14,0,-sin(pitch)*-14,3)//A_ScaleVelocity(-16.0)
BLKH RRRRRRRRRRRR 1 A_SpawnItemEx("BlackHoleBombXFX2",0,0,0,momx/1.5,momy/1.5,momz/1.5,0,9+16384)
stop
}
}

actor BlackHoleBombXFX2 : BlackHoleBombXFX
{
States
{
Spawn:
BLKH R 5
stop
}
}

actor BlackHoleBombXFX3 : BlackHoleBombXFX
{
Scale 1.5
States
{
Spawn:
BLKH TSRRR 3
stop
}
}

actor GalaxyRam : BasicExplosion
{
damagetype "GalaxyM_Ram"
Obituary "$OB_GALAXYRAM"
States
{
Spawn:
TNT1 A 0 
TNT1 A 1 A_Explode(4,84,0,0,24)
stop
}
}

actor GalaxymanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("BlackHoleBombX",0,0,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("BlackHoleBombXB",0,0,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("BlackHoleBombXR",0,0,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("BlackHoleBombXO",0,0,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("BlackHoleBombXP",0,0,0,0)
goto Done
}
}

actor GalaxymanMainBot_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("BlackHoleBombXBot",0,0,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("BlackHoleBombXBotB",0,0,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("BlackHoleBombXBotR",0,0,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("BlackHoleBombXBotO",0,0,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("BlackHoleBombXBotP",0,0,0,0)
goto Done
}
}

actor GalaxymanMain2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_GiveInventory("GalaxymanMainX_CI",1)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("BlackHoleBombPewPewB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("BlackHoleBombPewPewR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("BlackHoleBombPewPewO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("BlackHoleBombPewPewP",0,0,8,0)
goto Done
}
}

actor GalaxymanMainX_CI : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7,8)
TNT1 A 0 A_FireCustomMissile("BlackHoleBombPewPew1",0,0,8,0)
stop
TNT1 A 0 A_FireCustomMissile("BlackHoleBombPewPew2",0,0,8,0)
stop
TNT1 A 0 A_FireCustomMissile("BlackHoleBombPewPew3",0,0,8,0)
stop
TNT1 A 0 A_FireCustomMissile("BlackHoleBombPewPew4",0,0,8,0)
stop
TNT1 A 0 A_FireCustomMissile("BlackHoleBombPewPew5",0,0,8,0)
stop
TNT1 A 0 A_FireCustomMissile("BlackHoleBombPewPew6",0,0,8,0)
stop
TNT1 A 0 A_FireCustomMissile("BlackHoleBombPewPew7",0,0,8,0)
stop
TNT1 A 0 A_FireCustomMissile("BlackHoleBombPewPew",0,0,8,0)
stop
}
}
