actor Bubble 22004
{
  Radius 2
  Height 2
  Speed 1
  Scale 0.05
  Alpha 0.25
  RenderStyle Add
  projectile
  +CLIENTSIDEONLY
  +FORCEXYBILLBOARD
  +NOCLIP
  States
  {
  Spawn:
    SBUB A 1
    //fall through
  Rise:
    SBUB A 0 A_JumpIf(waterlevel == 0, "Death")
    SBUB A 1 A_Jump (32, "Jiggle")
    loop
  Jiggle:
    SBUB A 0 A_JumpIf(waterlevel == 0, "Death")
    SBUB A 1 A_SetAngle (random (0, 360)) 
    SBUB A 0 A_Recoil (0.1)
    goto Rise
  Death:
    TNT1 A 1
    stop
  }
}

actor BubbleSpawner : SwitchableDecoration 22005
{
  Radius 2
  Height 2
  RenderStyle None
  +NOINTERACTION
  States
  {
  Spawn:
  Active:
    SBUB A 2 nodelay A_PlaySound("World/Bubbles", CHAN_6, 1, TRUE)
  Bubbles:
    SBUB A 2 A_SpawnItemEx ("Bubble", random (-Args[0], Args[0]), 0, 0, 0, 0, 2, random (0, 360), 0, 128)
    loop
  Inactive:
    SBUB A -1 A_StopSound (CHAN_6)
	stop
  }
}