const int FUSE_LENGTH = 85;
//Didn't work for FuseLength's MaxAmmo

actor HyperBombBoss : BaseMM8BDMWep_CBM
{
dropitem "HyperBombWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 1
Obituary "$OB_HYPERBOMB"
weapon.ammotype "GigaAmmo"
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_01 D 1
loop
Ready:
BOMT A 0 ACS_ExecuteAlways(998,0,723)
BOMT A 1 A_WeaponReady
Goto Ready+1
HoldingReady:
TNT1 A 0 A_JumpIfInventory("GigaAmmo",FUSE_LENGTH,"ThrowX")
TNT1 A 1 A_WeaponReady
TNT1 A 0 A_SpawnItemEx("TempSplode",0,0,56,momx,momy,momz,0,9,0)
loop
Deselect:
BOMT A 0 A_JumpIfInventory("SuperArmTemp",1,"Drop")
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
BOMT A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
BOMT A 1 A_Raise
Loop
Fire:
TNT1 A 0 A_JumpIfInventory("SuperArmTemp",1,"HardThrow")
goto Prime
AltFire:
TNT1 A 0 A_JumpIfInventory("SuperArmTemp",1,"Throw")
goto Prime
Prime:
BOMT A 0 A_PlaySoundEx("weapon/superarmuse","Weapon")
BOMT A 0 A_GiveInventory("SuperArmTemp",1)
BOMT B 1 A_GunFlash
BOMT C 1
BOMT D 1 A_SpawnItemEx("TempSplode",32,0,-35,momx,momy,momz,0,41)
BOMT D 1 A_SpawnItemEx("TempSplode",32,0,-28,momx,momy,momz,0,41)
BOMT E 1 A_SpawnItemEx("TempSplode",32,0,-21,momx,momy,momz,0,41)
BOMT E 1 A_SpawnItemEx("TempSplode",32,0,-14,momx,momy,momz,0,41)
BOMT F 1 A_SpawnItemEx("TempSplode",32,0,-7,momx,momy,momz,0,41)
BOMT F 1 A_SpawnItemEx("TempSplode",32,0,0,momx,momy,momz,0,41)
TNT1 A 1 A_SpawnItemEx("TempSplode",32,0,7,momx,momy,momz,0,41)
TNT1 A 1 A_SpawnItemEx("TempSplode",32,0,14,momx,momy,momz,0,41)

TNT1 A 1 A_SpawnItemEx("TempSplode",32,0,21,momx,momy,momz,0,41)
TNT1 A 1 A_SpawnItemEx("TempSplode",32,0,28,momx,momy,momz,0,41)
TNT1 A 1 A_SpawnItemEx("TempSplode",32,0,35,momx,momy,momz,0,41)
TNT1 A 1 A_SpawnItemEx("TempSplode",32,0,42,momx,momy,momz,0,41)
TNT1 A 1 A_SpawnItemEx("TempSplode",32,0,49,momx,momy,momz,0,41)
TNT1 A 1 A_SpawnItemEx("TempSplode",32,0,56,momx,momy,momz,0,41)


TNT1 A 1 A_SpawnItemEx("TempSplode",24,0,56,momx,momy,momz,0,41)
TNT1 A 1 A_SpawnItemEx("TempSplode",16,0,56,momx,momy,momz,0,41)
TNT1 A 1 A_SpawnItemEx("TempSplode",8,0,56,momx,momy,momz,0,41)
TNT1 A 1 A_SpawnItemEx("TempSplode",0,0,56,momx,momy,momz,0,41)
PrimeWait:
TNT1 A 0 A_SpawnItemEx("TempSplode",0,0,56,momx,momy,momz,0,9,0)
goto HoldingReady
//loop
ThrowX:
BOMT M 0
Throw:
BOMT M 0 A_PlaySoundEx("weapon/BombThrow","Weapon")
BOMT M 0 A_GiveInventory("BombmanAlt_CI",1)
BOMT M 0 A_TakeInventory("SuperArmTemp",1)
BOMT MNONM 3
TNT1 AA 3 A_TakeInventory("GigaAmmo",FUSE_LENGTH)
BOMT BA 2
goto Ready+1
HardThrow:
BOMT G 0 A_PlaySoundEx("weapon/BombThrow","Weapon")
BOMT G 0 A_GiveInventory("BombmanMain_CI",1)
BOMT G 0 A_TakeInventory("SuperArmTemp",1)
BOMT GHIJKL 2
TNT1 AA 4 A_TakeInventory("GigaAmmo",FUSE_LENGTH)
BOMT BA 2
goto Ready+1
Drop:
BOMT A 0 A_PlaySoundEx("weapon/BombThrow","Weapon")
BOMT A 0 A_GiveInventory("BombmanOther_CI",1)
BOMT A 0 A_TakeInventory("SuperArmTemp",1)
BOMT MNONM 3
TNT1 AA 3 A_TakeInventory("GigaAmmo",FUSE_LENGTH)
BOMT BA 2
goto Deselect+1

Flash:
TNT1 A 0 A_JumpIfInventory("SuperArmTemp",1,1)
stop
TNT1 A 0 A_GiveInventory("GigaAmmo",1)
TNT1 A 1
TNT1 A 0 A_JumpIfInventory("GigaAmmo",FUSE_LENGTH,1)
loop
TNT1 A 1 A_GiveInventory("GigaAmmo",1)
stop
/*OldThrow:
GUTA A 0 A_FireCustomMissile("splode",0,0,0,56)//A_SpawnItemEx("GutRock",0,0,56,20,0,-4,0,0,0)
GUTA A 0 A_TakeInventory("SuperArmTemp",1)
TNT1 A 0 A_TakeInventory("GigaAmmo",5)
BOMT GHIJKL 2
TNT1 A 7
BOMT BA 2
Goto Ready+1
Slider:
BOMT A 0 A_PlaySoundEx("Weapon/mbuster","Weapon")
BOMT A 0 A_FireCustomMissile("BowlSplodeTest",0,0,8,0)
BOMT A 0 A_TakeInventory("SuperArmTemp",1)
BOMT A 0 A_TakeInventory("GigaAmmo",5)
BOMT MNONM 3
TNT1 A 6
BOMT BA 3
Goto Ready+1*/
}
}

actor GigaAmmo : Ammo
{
+INVENTORY.IGNORESKILL 
inventory.amount 1
//inventory.maxamount FUSE_LENGTH
inventory.maxamount 85
}

actor TempSplode
{
-SOLID
+NOGRAVITY
+NOINTERACTION
//+CLIENTSIDEONLY
//+DONTBLAST
+NOTIMEFREEZE
Radius 4
Height 4
Scale 2.5
States
{
Spawn:
BOMB S 0
BOMB S 1
stop
}
}


actor HyperBombB : HyperBomb
{
Translation "192:192=216:216", "199:199=0:0", "202:202=215:215"
speed 25
reactiontime 1
states
{
Spawn:
BOMB S 0
BOMB S 0 A_JumpIfInTargetInventory("GigaAmmo",FUSE_LENGTH,"DetonateX")
BOMB S 0 ThrustThingZ(0,18,0,1)
goto FuseGiveCheck
FuseGive:
TNT1 A 0 A_GiveInventory("GigaAmmo",ACS_ExecuteWithResult(803,GIGAAMMO))
TNT1 A 0 A_TakeFromTarget("GigaAmmo",FUSE_LENGTH)
TNT1 A 0 A_JumpIfInventory("GigaAmmo",FUSE_LENGTH,"Detonate")
goto Spawn2+1
/*FuseGive:
TNT1 A 0 A_TakeFromTarget("GigaAmmo",1)
TNT1 A 0 A_GiveInventory("GigaAmmo",1)
TNT1 A 0 A_JumpIfInventory("GigaAmmo",FUSE_LENGTH,"Detonate")*/
FuseGiveCheck:
TNT1 A 0 A_JumpIfInTargetInventory("GigaAmmo",1,"FuseGive")
goto Spawn2+1
Spawn2:
BOMB S 0 A_JumpIfInventory("GigaAmmo",FUSE_LENGTH,"Detonate")
BOMB S 1 A_GiveInventory("GigaAmmo",1)
loop
Detonate:
BOMB S 0 A_CountDown
BOMB S 1
loop
DetonateX:
BOMB S 0 A_SpawnItemEx("HyperBombBX",0,0,0,0,0,0,0,1)
stop
Death:
BOMB S 0 A_ChangeVelocity(0,0,0,CVF_REPLACE)
BOMB S 0 A_ChangeFlag("NOGRAVITY",1)
BOMB S 0 A_JumpIfInventory("GigaAmmo",80,"Deathtonation")
BOMB S 0 A_Explode(25,150,0,0,10)

BOMB S 0 A_PlaySoundEx("weapon/hyperbomb","Weapon")
TN_B EF 1 ThrustThingZ(0,0,0,0)
TN_B GHIJKLMNOPQRS 1
stop
Deathtonation:
BOMB S 0 A_Stop
BOMB S 0 A_ChangeFlag("NOGRAVITY",1)
BOMB S 0 A_PlaySoundEx("weapon/BombmanBoom", "Weapon")
BOMB S 0 A_Explode(60,196,0,0,24)
TH_B BCDEFGHIJKLMNOPQR 1
stop
}
}

actor HyperBombBB : HyperBombB{translation "192:192=205:205", "199:199=74:74", "202:202=205:205"}
actor HyperBombBR : HyperBombB{translation "192:192=171:171", "199:199=41:41", "202:202=171:171"}
actor HyperBombBO : HyperBombB{translation "192:192=104:104", "199:199=128:128", "202:202=104:104"}
actor HyperBombBP : HyperBombB{translation "192:192=229:229", "199:199=232:232", "202:202=229:229"}


actor HyperBombBX : BasicExplosion
{
damagetype "HyperBomb"
Obituary "$OB_HYPERBOMB"
Scale 2.5
States
{
Spawn:
BOMB S 0
BOMB S 0 A_Explode(40,150,0,0,16)
BOMB S 0 A_PlaySoundEx("weapon/BombmanBoom", "Weapon")
TH_B BCDEFGHIJKLMNOPQR 1
stop
}
}

actor HyperBombBDrop : HyperBombB
{
speed 10
states
{
Spawn:
BOMB S 0
BOMB S 0 ThrustThingZ(0,12,0,1)
goto FuseGiveCheck
}
}

actor HyperBombBDropB : HyperBombBDrop{translation "192:192=205:205", "199:199=74:74", "202:202=205:205"}
actor HyperBombBDropR : HyperBombBDrop{translation "192:192=171:171", "199:199=41:41", "202:202=171:171"}
actor HyperBombBDropO : HyperBombBDrop{translation "192:192=104:104", "199:199=128:128", "202:202=104:104"}
actor HyperBombBDropP : HyperBombBDrop{translation "192:192=229:229", "199:199=232:232", "202:202=229:229"}

actor HyperBombBHardThrow : HyperBombB
{
-HEXENBOUNCE
speed 35
states
{
Spawn:
BOMB S 0
BOMB S 0 ThrustThingZ(0,22,0,1)
goto FuseGiveCheck
}
}

actor HyperBombBHardThrowB : HyperBombBHardThrow{translation "192:192=205:205", "199:199=74:74", "202:202=205:205"}
actor HyperBombBHardThrowR : HyperBombBHardThrow{translation "192:192=171:171", "199:199=41:41", "202:202=171:171"}
actor HyperBombBHardThrowO : HyperBombBHardThrow{translation "192:192=104:104", "199:199=128:128", "202:202=104:104"}
actor HyperBombBHardThrowP : HyperBombBHardThrow{translation "192:192=229:229", "199:199=232:232", "202:202=229:229"}

actor BombmanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("HyperBombBHardThrow",0,1,0,56)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("HyperBombBHardThrowB",0,1,0,56)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("HyperBombBHardThrowR",0,1,0,56)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("HyperBombBHardThrowO",0,1,0,56)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("HyperBombBHardThrowP",0,1,0,56)
goto Done
}
}

actor BombmanAlt_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("HyperBombB",0,1,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("HyperBombBB",0,1,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("HyperBombBR",0,1,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("HyperBombBO",0,1,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("HyperBombBP",0,1,8,0)
goto Done
}
}

actor BombmanOther_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("HyperBombBDrop",0,1,0,28)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("HyperBombBDropB",0,1,0,28)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("HyperBombBDropR",0,1,0,28)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("HyperBombBDropO",0,1,0,28)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("HyperBombBDropP",0,1,0,28)
goto Done
}
}

