ACTOR Megasphere2 : Megasphere replaces Megasphere
{
  Inventory.PickupMessage "Cigsphere!"
  Inventory.PickupSound "Megasphere/Pickup"
  Renderstyle Add
  +FLOATBOB
  States
  {
  Spawn:
    TBMS AA 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    TBMS AAAA 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	TBMS B 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    TBMS BBBB 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	TBMS A 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    TBMS CCCC 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	TBMS A 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    TBMS DDDD 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	TBMS E 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    TBMS EEEE 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	TBMS F 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    TBMS FFFF 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	TBMS E 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    TBMS EEEE 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	TBMS D 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    TBMS DDDD 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	TBMS C 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    TBMS CCCC 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	TBMS B 0 A_SpawnItemEx("MegaFade",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
    TBMS BBBB 1 Bright A_SpawnItemEx("MegasphereParticle",frandom(10.0,-10.0),frandom(10.0,-10.0),35+frandom(10.0,-10.0),frandom(0.6,-0.6),frandom(0.6,-0.6),frandom(1.2,0.4),frandom(0.0,360.0),SXF_CLIENTSIDE,64)
	Loop
  Pickup:
	TNT1 AAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Cigbutt",frandom(5.0,-5.0),frandom(5.0,-5.0),20+frandom(5.0,-5.0),frandom(1.0,5.0),0,frandom(2.0,6.0),frandom(0.0,360.0),SXF_CLIENTSIDE,40)
    TNT1 A 0 A_GiveInventory("MegasphereArmor2", 1)
    TNT1 A 0 A_GiveInventory("MegasphereHealth", 1)
    Stop
  }
}
Actor MegasphereArmor2 : BodyArmor
{
}

ACTOR MegaFade
{
  +NOGRAVITY
  +NOINTERACTION
  +NOTONAUTOMAP
  Renderstyle Add
  States
  {
  Spawn:
	TBMS C 1 A_FadeOut(0.12)
	TBMS C 0 A_SetScale(ScaleX+0.02,ScaleX)
	Loop
  }
}

ACTOR MegasphereParticle : ItemParticle
{
	States
	{
	Spawn:
	KPRT A 0
	SetScale:
	"####" "#" 0 A_SetScale(0.1)
	Main:
	"####" "#" 0 A_JumpIf(ScaleX <= 0,"NULL")
	"####" "#" 0 A_FadeOut(frandom(0.02,0.04))
	"####" "#" 0 A_ChangeVelocity(0,0,frandom(-0.1,0.15),CVF_RELATIVE)
	"####" "#" 1 Bright A_SetScale(ScaleX-frandom(-0.01,0.02))
	Loop
	}
}