actor BubbleMan_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_2C"
dropitem "BubbleLeadWep"
Weapon.AmmoUse 4
Weapon.AmmoGive 28
Obituary "$OB_BUBBLELEAD"
weapon.ammotype "WaddleWaddleAmmo"
weapon.ammotype2 "BubbleDabbleAmmo"
States
{
Spawn:
C_02 C 1
loop

Deselect:
BUBA A 0
goto DeselectSwap
Select:
BUBA A 0
goto SelectSwap

Ready:
BUBA A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_BUBBLEMAN)
BUBA A 0 A_GunFlash("Flash",1)
goto Ready1
Ready1:
BUBA A 0 A_JumpIfInventory("WaddleWaddleAmmo",4,"Ready2")
BUBA A 3 A_WeaponReady(WRF_NOSECONDARY)
BUBA A 0 A_GiveInventory("WaddleWaddleAmmo",1)
loop
Ready2:
BUBA A 3 A_WeaponReady
BUBA A 0 A_GiveInventory("WaddleWaddleAmmo",1)
loop

Fire:
BUBA A 0 A_PlaySoundEx("weapon/rbuster","Weapon")
BUBA A 0 A_FireCustomMissile("BubProj",0,0,-8,0)
BUBA BCA 4
BUBA A 0 A_GiveInventory("WaddleWaddleAmmo",2)
Goto Ready1
Altfire:
BUBA A 0 A_GiveInventory("VivifyDelay6",1)
BUBA A 0 A_Refire(1)
BUBA P 2 A_GiveInventory("Bubbleman_Alt_P")
BUBA QQRST 2
BUBA T 0 A_Refire("AltAmmoCheck")
goto AltAmmoCheck+1
AltAmmoCheck:
BUBA T 0 A_JumpIfInventory("WaddleWaddleAmmo",4,"Altfire2")
BUBA A 2 Offset(-44,52)
goto Ready1
Altfire2:
BUBA S 0 A_GiveInventory("VivifyDelay6",1)
BUBA S 0 A_Refire(1)
BUBA S 2 A_GiveInventory("Bubbleman_Alt_P")
goto Altfire+3

Flash:
TNT1 A 0 A_JumpIfInventory("IsTreadingWater",1,"Flash.Swim")
TNT1 A 1
loop
Flash.Ammo:
TNT1 A 0 A_JumpIfInventory("BubbleDabbleAmmo",560,"Flash")
TNT1 A 0 A_JumpIfInventory("IsTreadingWater",1,"Flash.Swim")
TNT1 A 1 A_GiveInventory("BubbleDabbleAmmo",2+CallACS("core_checkrune",RUNE_RAGE)*2)
loop

Flash.Swim:
TNT1 A 1 A_GiveInventory("BubbleSwimFlash_P",1)
TNT1 A 0 A_JumpIf(z-floorz==0,"Flash.LandEnd")
TNT1 A 0 A_JumpIfInventory("BubbleDabbleAmmo",1,"Flash.Swim")
TNT1 A 0 A_GiveInventory("BubbleSwimFlash_P")
goto Flash.Land

Flash.Land:
TNT1 A 0 A_JumpIf(z-floorz==0,"Flash.LandEnd")
TNT1 A 0 A_JumpIf(momz==0,"Flash.LandZ")
TNT1 A 1
loop
Flash.LandZ:
TNT1 A 1
TNT1 A 0 A_JumpIf(z-floorz==0,"Flash.LandEnd")
TNT1 A 0 A_JumpIf(momz==0,"Flash.LandEnd")
goto Flash.Land+2
Flash.LandEnd:
TNT1 A 1 A_GiveInventory("BubbleSwimFlashEnd_P",1)
goto Flash.Ammo

}
}

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

actor BubbleDabbleAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 560
+INVENTORY.IGNORESKILL
}

actor BubbleIsSwimming_F : Inventory{}

actor Bubbleman_Alt_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_PlaySoundEx("weapon/rbuster","Weapon")
TNT1 A 0 A_TakeInventory("WaddleWaddleAmmo",4,1)
TNT1 A 0 A_FireCustomMissile("BubbleBounceX",0,0,0,8)
stop
}
}

actor BubbleSwimFlash_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("BubbleDabbleAmmo",1,"SwimCheck")
TNT1 A 0 A_GiveInventory("CBM_AviationOff_P")
TNT1 A 0 A_GiveInventory("VivifyFlag3",1)
TNT1 A 0 A_TakeInventory("BubbleIsSwimming_F")
TNT1 A 0 //A_Log("I HAVE NO AMMO")
stop
SwimCheck:
TNT1 A 0 A_JumpIfInventory("HasFeetInWater",1,"Swim")
TNT1 A 0 A_JumpIfInventory("IsUnderWater",1,"Swim")
TNT1 A 0 A_JumpIfInventory("PowerBubbleFlood",1,"Swim")//IsUnderBubbleWater
TNT1 A 0 A_GiveInventory("CBM_AviationOff_P")
TNT1 A 0 A_GiveInventory("VivifyFlag3",1)
TNT1 A 0 A_TakeInventory("BubbleIsSwimming_F")
TNT1 A 0 //A_Log("NO SWIM")
stop
Swim:
TNT1 A 0 A_GiveInventory("BubbleIsSwimming_F",1)
TNT1 A 0 A_TakeInventory("VivifyFlag3")
TNT1 A 0 A_TakeInventory("BubbleDabbleAmmo",1)
TNT1 A 0 A_TakeInventory("BubbleDabbleAmmo",1,1)
TNT1 A 0 A_GiveInventory("CBM_AviationOn_P")
TNT1 A 0 //A_Log("LETS SWIM")
stop
SwimNo:
TNT1 A 0 A_GiveInventory("CBM_AviationOff_P")
TNT1 A 0 A_GiveInventory("VivifyFlag3",1)
TNT1 A 0 A_TakeInventory("BubbleIsSwimming_F")
TNT1 A 0 //A_Log("I CANT SWIM")
stop
}
}

actor BubbleSwimFlashEnd_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("VivifyFlag3",1)
TNT1 A 0 A_TakeInventory("IsTreadingWater")
TNT1 A 0 A_TakeInventory("BubbleIsSwimming_F")
TNT1 A 0 A_GiveInventory("CBM_AviationOff_P")
stop
}
}

actor BubbleBounceX : ProjSpawnFuncActor
{
PROJECTILE
Obituary "$OB_BUBBLELEAD"
damagetype "BubbleM_Lead"
-NOGRAVITY
+SKYEXPLODE
+BOUNCEONFLOORS
+BOUNCEONCEILINGS
+USEBOUNCESTATE
+CANBOUNCEWATER
+FORCEXYBILLBOARD
BounceSound "weapon/BubbleBounce"
bouncefactor 1.0
wallbouncefactor 1.0
BounceCount 25
gravity 1.0
ReactionTime 25//45
Damage (220)
Radius 20
Height 16
Speed 8
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 //A_Recoil(-9)
TNT1 A 1 A_ChangeVelocity(sqrt(momx*momx+momy*momy)+9,0,momz+6.25,3)//ThrustThingZ(0,25,0,0)
SpawnL:
BUBA E 0 A_CountDown
BUBA EF 3
loop
Bounce.Floor:
BUBA E 0 ThrustThingZ(0,40,0,0)//A_ChangeVelocity(momx,momy,10,2)
Goto SpawnL
Death:
XDeath:
TNT1 A 1
stop
}
}



actor BubProj : ProjSpawnFuncActorFast
{
var int user_TranslateWhiteColors;
PROJECTILE
Obituary "$OB_BUBBLEBUSTER"
damagetype "BubbleM_Shot"
Damage (120)
radius 9
height 6
Speed 64
scale 2.5
States
{
Spawn:
TNT1 A 1
BUBA D 1 A_SpawnItemEx("BubProjFX",0,0,0,0,0,0,0,1)
wait
Death:
BUBA D 1
stop
}
}

actor BubProjFX : BasicGraphicEffect
{
//+FORCEXYBILLBOARD
Alpha 0.75
scale 2.0
States
{
SpawnFrame:
TNT1 A 1
BUBA M 1 A_FadeOut
wait
}
}


///////////////////////
//X=================X//
//| The Bubble Item |//
//X=================X//
///////////////////////

actor BubbleFlooder : BasicClassItem
{
inventory.icon "BubIcon"
inventory.pickupmessage "Welcome to Davy Jones' Locker!"
Tag "Bubble Flood Trigger"
states
{
Spawn:
BUBA WXY 3
loop
UseCBM:
TNT1 A 0 A_JumpIfInventory("BubbleFloodBusy",1,"No")
TNT1 A 0 A_JumpIfInventory("BubbleFloodDeployed",1,"Success2")
TNT1 A 0 A_JumpIfInventory("HasFeetInWater",1,"No")
TNT1 A 0 A_JumpIfInventory("IsUnderWater",1,"No")
TNT1 A 0 A_JumpIfInventory("PowerBubbleFlood",1,"No")//IsUnderBubbleWater
Success:
TNT1 A 0 A_GiveInventory("IsTreadingWater",1)
TNT1 A 0 A_JumpIf(momx*momx+momy*momy+momz*momz < 36,"TooSlow")
TNT1 A 0 A_SpawnItemEx("BubbleFlood",0,0,56,momx/3,momy/3,momz/12,0,8)
fail
TooSlow:
TNT1 A 0 A_SpawnItemEx("BubbleFlood",0,0,56)
fail
Success2:
TNT1 A 0 A_GiveInventory("BubbleFloodUndeploy",1)
fail
}
}

actor BubbleFloodDeployed : Inventory{}
actor BubbleFloodBusy : Inventory{}
actor BubbleFloodUndeploy : Inventory{}

actor BubbleFlood : BasicHelper
{
+USESPAWNEVENTSCRIPT
var int user_UseProjSpawnFunc;
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("classes/FloodIn","Weapon")
TNT1 A 0 A_TakeFromTarget("BubbleFloodUndeploy",1)
TNT1 A 0 A_GiveToTarget("BubbleFloodDeployed",1)
TNT1 A 0 A_GiveToTarget("BubbleFloodBusy",1)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner1",0,0,0,0,0,0,0,129)//SXF_CLIENTSIDE
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner1",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner1",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner2",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner2",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner2",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",95)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner3",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",95)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner3",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",95)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner3",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",95)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner4",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",95)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner4",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",95)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner4",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",125)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner5",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",125)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner5",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",125)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner5",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",125)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner6",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",125)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner6",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",125)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner6",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",140)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner7",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",140)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner7",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",140)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner7",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",140)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner8",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",140)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner8",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",140)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawner8",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

TNT1 A 0 A_TakeFromTarget("BubbleFloodBusy",1)

FullDeployed1:
TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",200)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawnerF1",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIfInTargetInventory("BubbleFloodUndeploy",1,"UnDeploy")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",200)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawnerF1",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIfInTargetInventory("BubbleFloodUndeploy",1,"UnDeploy")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",200)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawnerF1",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
TNT1 A 0 A_JumpIfInTargetInventory("BubbleFloodUndeploy",1,"UnDeploy")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",200)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawnerF2",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIfInTargetInventory("BubbleFloodUndeploy",1,"UnDeploy")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",200)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawnerF2",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIfInTargetInventory("BubbleFloodUndeploy",1,"UnDeploy")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",200)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawnerF2",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
TNT1 A 0 A_JumpIfInTargetInventory("BubbleFloodUndeploy",1,"UnDeploy")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",200)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawnerF3",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIfInTargetInventory("BubbleFloodUndeploy",1,"UnDeploy")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",200)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawnerF3",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIfInTargetInventory("BubbleFloodUndeploy",1,"UnDeploy")

TNT1 A 0 ACS_NamedExecuteWithResult("CBM_BubbleFlood",200)
TNT1 A 1 A_SpawnItemEx("BubbleFloodFXSpawnerF3",0,0,0,0,0,0,0,129)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
TNT1 A 0 A_JumpIfInTargetInventory("BubbleFloodUndeploy",1,"UnDeploy")
goto FullDeployed1

UnDeploy:
TNT1 A 0 A_SpawnItemEx("BubbleFloodOutSound")

TNT1 A 0 A_TakeFromTarget("BubbleFloodDeployed",1)
TNT1 A 0 A_GiveToTarget("BubbleFloodBusy",1)

TNT1 AAA 1 A_SpawnItemEx("BubbleFloodFXSpawner8",0,0,0,0,0,0,0,129)
TNT1 AAA 1 A_SpawnItemEx("BubbleFloodFXSpawner7",0,0,0,0,0,0,0,129)
TNT1 AAA 1 A_SpawnItemEx("BubbleFloodFXSpawner6",0,0,0,0,0,0,0,129)
TNT1 AAA 1 A_SpawnItemEx("BubbleFloodFXSpawner5",0,0,0,0,0,0,0,129)
TNT1 AAA 1 A_SpawnItemEx("BubbleFloodFXSpawner4",0,0,0,0,0,0,0,129)
TNT1 AAA 1 A_SpawnItemEx("BubbleFloodFXSpawner3",0,0,0,0,0,0,0,129)
TNT1 AAA 1 A_SpawnItemEx("BubbleFloodFXSpawner2",0,0,0,0,0,0,0,129)
TNT1 AAA 1 A_SpawnItemEx("BubbleFloodFXSpawner1",0,0,0,0,0,0,0,129)

Death:
TNT1 A 0 A_TakeFromTarget("BubbleFloodBusy",1)
stop
}
}

actor BubbleFloodOutSound : BasicHelper
{
states
{
Spawn:
TNT1 A 0
TNT1 A 2 A_PlaySoundEx("classes/FloodOut","Weapon")
stop
}
}

actor BubbleFloodFXSpawner : BasicClientSide
{
//+NONETID
states
{
Spawn5c:
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",0,0,165,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",165,0,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",0,165,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",0,0,-165,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",-165,0,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",0,-165,0,0,0,0,0,129)
Spawn4c:
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",105,105,-105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",105,-105,-105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",-105,105,-105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",-105,-105,-105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",105,105,105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",105,-105,105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",-105,105,105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",-105,-105,105,0,0,0,0,129)
Spawn3c:
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",0,0,90,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",90,0,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",0,90,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",0,0,-90,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",-90,0,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",0,-90,0,0,0,0,0,129)
Spawn2c:
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",60,60,-60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",60,-60,-60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",-60,60,-60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",-60,-60,-60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",60,60,60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",60,-60,60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",-60,60,60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX3",-60,-60,60,0,0,0,0,129)
Spawn1c:
TNT1 A 0
stop

Spawn5b:
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",0,0,165,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",165,0,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",0,165,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",0,0,-165,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",-165,0,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",0,-165,0,0,0,0,0,129)
Spawn4b:
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",105,105,-105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",105,-105,-105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",-105,105,-105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",-105,-105,-105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",105,105,105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",105,-105,105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",-105,105,105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",-105,-105,105,0,0,0,0,129)
Spawn3b:
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",0,0,90,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",90,0,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",0,90,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",0,0,-90,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",-90,0,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",0,-90,0,0,0,0,0,129)
Spawn2b:
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",60,60,-60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",60,-60,-60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",-60,60,-60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",-60,-60,-60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",60,60,60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",60,-60,60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",-60,60,60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX2",-60,-60,60,0,0,0,0,129)
Spawn1b:
TNT1 A 0
stop

Spawn5a:
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",0,0,165,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",165,0,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",0,165,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",0,0,-165,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",-165,0,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",0,-165,0,0,0,0,0,129)
Spawn4a:
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",105,105,-105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",105,-105,-105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",-105,105,-105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",-105,-105,-105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",105,105,105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",105,-105,105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",-105,105,105,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",-105,-105,105,0,0,0,0,129)
Spawn3a:
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",0,0,90,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",90,0,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",0,90,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",0,0,-90,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",-90,0,0,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",0,-90,0,0,0,0,0,129)
Spawn2a:
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",60,60,-60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",60,-60,-60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",-60,60,-60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",-60,-60,-60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",60,60,60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",60,-60,60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",-60,60,60,0,0,0,0,129)
TNT1 A 0 A_SpawnItemEx("BubbleFloodFX1",-60,-60,60,0,0,0,0,129)
Spawn1a:
TNT1 A 0
stop
}
}

actor BubbleFloodFXSpawner1 : BubbleFloodFXSpawner
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("BubbleFloodFXMA",0,0,0,0,0,0,0,129)
goto Spawn1a
}
}

actor BubbleFloodFXSpawner2 : BubbleFloodFXSpawner
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("BubbleFloodFXMB",0,0,0,0,0,0,0,129)
goto Spawn1b
}
}

actor BubbleFloodFXSpawner3 : BubbleFloodFXSpawner
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("BubbleFloodFXMC",0,0,0,0,0,0,0,129)
goto Spawn2c
}
}

actor BubbleFloodFXSpawner4 : BubbleFloodFXSpawner
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("BubbleFloodFXMD",0,0,0,0,0,0,0,129)
goto Spawn2a
}
}

actor BubbleFloodFXSpawner5 : BubbleFloodFXSpawner
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("BubbleFloodFXME",0,0,0,0,0,0,0,129)
goto Spawn3b
}
}

actor BubbleFloodFXSpawner6 : BubbleFloodFXSpawner
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("BubbleFloodFXMF",0,0,0,0,0,0,0,129)
goto Spawn3c
}
}

actor BubbleFloodFXSpawner7 : BubbleFloodFXSpawner
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("BubbleFloodFXMG",0,0,0,0,0,0,0,129)
goto Spawn4a
}
}

actor BubbleFloodFXSpawner8 : BubbleFloodFXSpawner
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("BubbleFloodFXMH",0,0,0,0,0,0,0,129)
goto Spawn4b
}
}

actor BubbleFloodFXSpawnerF1 : BubbleFloodFXSpawner
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("BubbleFloodFXM3",0,0,0,0,0,0,0,129)
goto Spawn5c
}
}

actor BubbleFloodFXSpawnerF2 : BubbleFloodFXSpawner
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("BubbleFloodFXM1",0,0,0,0,0,0,0,129)
goto Spawn5a
}
}

actor BubbleFloodFXSpawnerF3 : BubbleFloodFXSpawner
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("BubbleFloodFXM2",0,0,0,0,0,0,0,129)
goto Spawn5b
}
}

actor BubbleFloodFX1 : BubbleFloodFXSpawner
{
scale 2.5
RenderStyle "Translucent"
Alpha 0.3
+CLIENTSIDEONLY
states
{
Spawn:
BUBA G 0
BUBA G 1
stop
}
}

actor BubbleFloodFX2 : BubbleFloodFX1
{
states
{
Spawn:
BUBA H 0
BUBA H 1
stop
}
}

actor BubbleFloodFX3 : BubbleFloodFX1
{
states
{
Spawn:
BUBA I 0
BUBA I 1
stop
}
}

actor BubbleFloodFXM1 : BubbleFloodFX1{}
actor BubbleFloodFXM2 : BubbleFloodFX2{}
actor BubbleFloodFXM3 : BubbleFloodFX3{}

actor BubbleFloodFXMA : BubbleFloodFXM1{Alpha 0.06}
actor BubbleFloodFXMB : BubbleFloodFXM2{Alpha 0.09}
actor BubbleFloodFXMC : BubbleFloodFXM3{Alpha 0.12}
actor BubbleFloodFXMD : BubbleFloodFXM1{Alpha 0.15}
actor BubbleFloodFXME : BubbleFloodFXM2{Alpha 0.18}
actor BubbleFloodFXMF : BubbleFloodFXM3{Alpha 0.21}
actor BubbleFloodFXMG : BubbleFloodFXM1{Alpha 0.24}
actor BubbleFloodFXMH : BubbleFloodFXM2{Alpha 0.27}

actor InBubbleFlood_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("PowerBubbleFlood",1,"Pickup2")
TNT1 A 0 A_GiveInventory("BubbleFloodEnter_P")
TNT1 A 0 A_SpawnItemEx("BubbleFloodExitWatcher")
Pickup2:
TNT1 A 0 A_GiveInventory("PowerBubbleFlood")
stop
}
}

actor IsUnderBubbleWater : IsUnderWater {}

actor BubbleFloodExitWatcher : BasicHelper
{
+SERVERSIDEONLY
states
{
Spawn:
TNT1 A 0
Spawn2:
TNT1 A 1
TNT1 A 0 A_JumpIfInTargetInventory("PowerBubbleFlood",1,"Spawn2")
TNT1 A 0 A_GiveToTarget("BubbleFloodExit_P")
stop
}
}

actor BubbleFloodEnter_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_GiveInventory("IsUnderBubbleWater")
TNT1 A 0 A_GiveInventory("BubbleFloodGravPowerGiver")
stop
}
}

actor BubbleFloodExit_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_TakeInventory("IsUnderBubbleWater")
TNT1 A 0 A_TakeInventory("BubbleFloodGravPower")
stop
}
}

actor BubbleFloodGravPowerGiver : PowerApropGiver {}
actor BubbleFloodGravPower : PowerUp
{
	+INVENTORY.ALWAYSPICKUP
	Powerup.Duration 0x7FFFFFFC
}

actor PowerBubbleFlood : Powerup
{
Powerup.Duration 3
}

actor BubbleMan_W_NormalBar : NormalBar {Args 4,94}
actor BubbleMan_W_ScriptBar : ScriptBar {}