actor GravitySphereWep_NormalBar : NormalBar { args 4, 239 }

actor GravitySphereWep : BaseMM8BDMWep
{
Weapon.AmmoUse 2
Weapon.AmmoGive 28
Weapon.SlotNumber 5
Inventory.Pickupmessage "$PU_GRAVITYSPHERE"
Obituary "$OB_GRAVITYSPHERE"
Tag "$TAG_GRAVITYSPHERE"
weapon.ammotype "GravitySphereAmmo"
inventory.icon "XTR0WI_L"
States
{
SpawnLoop:
XWI0 L -1
loop

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

Ready:
XH0L A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_GRAVITYSPHERE)
XH0L A 1 A_WeaponReady
wait

Fire:
XH0L A 0 A_JumpIfNoAmmo("NoAmmo")
XH0L A 0 A_PlaySoundEx("weapon/gravitysphere","Weapon")//mbuster
XH0L B 0 A_FireCustomMissile("GravitySphere",0,1,8,0)
XH0L BC 2
XH0L C 16//30
XH0L CBA 2//3
XH0L A 0 A_Refire
goto Ready+1
NoAmmo:
XH0L A 1 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+1
}
}

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

actor GravitySphere : ProjSpawnFuncActor
{
PROJECTILE
Obituary "$OB_GRAVITYSPHERE"
damagetype "GravitySphere"
+THRUACTORS
+THRUGHOST
+SKYEXPLODE
+BOUNCEONFLOORS
+BOUNCEONCEILINGS
+DONTSPLASH
+DONTREFLECT
+BRIGHT
BounceCount 2
Bouncefactor 0.0
ReactionTime 1
Damage (0)
Radius 6
Height 6
speed 11
Scale 2.5
States
{
Spawn:
XH0L GGHHI 2
XH0L I 0 A_PlaySound("wep_L/GSphereTravel",4,1.0)
XH0L IJJGG 2
XH0L H 0 A_PlaySound("wep_L/GSphereTravel",4,1.0)
XH0L HHIIJ 2
XH0L J 2 A_PlaySoundEx("wep_L/GravityHold","Weapon")
XH0L G 0 A_Explode(110,256,0,0,32)
XH0L G 0 A_SpawnItemEx("GravitySphereFX_H",0,0,0,0,0,0,0,1)
XH0L G 0 A_JumpIf(momx*momx+momy*momy+momz*momz <= 10,"SpawnD")
XH0L G 0 A_PlaySound("wep_L/GSphereTravel",4,1.0)
loop
SpawnD:
XH0L B 0
XH0L B 1 A_CountDown
wait
Death:
XH0L GHIJGHIJ 1 A_SetScale(scaleX-0.1,scaleY-0.2)
stop
}
}

actor GravitySphereFX_H : BasicGraphicEffect
{
States
{
Spawn:
TNT1 A 0
TNT1 AAAAAAAAAAAAAAAA 0 A_SpawnItemEx("GravitySphereFX",random(192,256),0,random(128,256),0,0,-40,random(0,359))
TNT1 AAAAAAAAAAAAAAAA 0 A_SpawnItemEx("GravitySphereFX",random(128,192),0,random(128,256),0,0,-40,random(0,359))
TNT1 AAAAAAAAAAAAAAAA 0 A_SpawnItemEx("GravitySphereFX",random(64,128),0,random(128,256),0,0,-40,random(0,359))
TNT1 AAAAAAAAAAAAAAAA 0 A_SpawnItemEx("GravitySphereFX",random(0,64),0,random(128,256),0,0,-40,random(0,359))
TNT1 A 1
TNT1 AAAAAAAAAAAAAAAA 0 A_SpawnItemEx("GravitySphereFX",random(192,256),0,random(0,128),0,0,-40,random(0,359))
TNT1 AAAAAAAAAAAAAAAA 0 A_SpawnItemEx("GravitySphereFX",random(128,192),0,random(0,128),0,0,-40,random(0,359))
TNT1 AAAAAAAAAAAAAAAA 0 A_SpawnItemEx("GravitySphereFX",random(64,128),0,random(0,128),0,0,-40,random(0,359))
TNT1 AAAAAAAAAAAAAAAA 0 A_SpawnItemEx("GravitySphereFX",random(0,64),0,random(0,128),0,0,-40,random(0,359))
TNT1 A 1
stop
}
}


actor GravitySphereFX : BasicGraphicEffectM
{
-NOGRAVITY
+THRUACTORS
+BRIGHT
States
{
SpawnFrame:
XH0L O 12
stop
}
}
