actor MothersPieWep_NormalBar : NormalBar{args 225, 41}
actor MothersPieWep : BaseMM8BDMWep
{
Weapon.AmmoUse 2
Weapon.AmmoGive 28
Weapon.SlotNumber 4
Obituary "$OB_MOTHERSPIE"
Inventory.Pickupmessage "$PU_MOTHERSPIE" 
Tag "$TAG_MOTHERSPIE"
weapon.ammotype "MothersPieAmmo"
inventory.icon "MPIEICON"
Scale 2.0
States
{
SpawnLoop: 
MPIE Z 1
loop
Ready: 
MPIE A 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_MOTHERSPIE) 
MPIE A 0 A_JumpIfNoAmmo("ReadyNoAmmo")
MPIE A 1 A_WeaponReady
Goto Ready+1
ReadyC: Goto Ready+1
ReadyNoAmmo:
MPI2 I 1 A_WeaponReady
MPI2 I 0 A_JumpIfNoAmmo("ReadyNoAmmo")
Goto Ready+1
ReadyC: Goto Ready+1
Deselect: 
MPIE A 0
goto DeselectSwap
Select: 
MPIE A 0
goto SelectSwap
Fire: 
MPIE A 0 A_JumpIfNoAmmo("NoAmmo") 
MPIE A 0 A_PlaySoundEx("weapon/joegrenade","Weapon")
MPIE A 0 A_FireCustomMissile("MothersPie",0,1,8,0)
MPIE A 0 A_FireCustomMissile("MothersPie2",0,0,8,0)
MPIE BCDEFGHHH 3
MPIE A 0 A_JumpIfNoAmmo("NoneWait")
MPIE A 3 Offset(0,42)
MPIE A 3 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
goto Ready+1
NoneWait:
MPI2 I 3 Offset(0,42)
MPI2 I 3 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
goto Ready+1
NoAmmo: 
MPI2 I 1 ACS_NamedExecute("core_noammo",0)
Goto Ready+1
}
}

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

actor MothersPie : BasicProjectile
{
-NOGRAVITY
Obituary "$OB_MOTHERSPIE"
PROJECTILE
Damage (CallACS("vile_cbm_damage",24))
damagetype "MothersPie"
speed 24
Scale 2.5
Height 24
Radius 24
gravity 1.11
States
{
Spawn:
MPIE A 0
MPIE A 0 ThrustThingZ(0, 16, 0, 1)
goto Spawn2
Spawn2:
MPIE IJLMNOPQRST 2 A_Changeflag("NOGRAVITY",0)
loop
XDeath:
TNT1 A 0 A_PlaySoundEx("weapons/mm4/dustcrushersplit", "Body")
TNT1 A 6 A_SpawnItemEx("ExplosionEffect1",0,0,0,0,0,0,0,SXF_WEPFXCOLOR)
TNT1 A 0 A_SpawnItemEx("MPieBitC",0,0,0,28,0,0,45)
TNT1 A 0 A_SpawnItemEx("MPieBitC",0,0,0,28,0,0,-45)
TNT1 A 0 A_SpawnItemEx("MPieBitC",0,0,0,28,0,0,225)
TNT1 A 0 A_SpawnItemEx("MPieBitC",0,0,0,28,0,0,-225)
stop
Death:
TNT1 A 0 A_PlaySoundEx("weapons/mm4/dustcrushersplit", "Body")
TNT1 A 6 A_SpawnItemEx("ExplosionEffect1",0,0,0,0,0,0,0,SXF_WEPFXCOLOR)
TNT1 A 0 A_SpawnItemEx("MPieBit",0,0,0,28,0,0,45)
TNT1 A 0 A_SpawnItemEx("MPieBit",0,0,0,28,0,0,-45)
TNT1 A 0 A_SpawnItemEx("MPieBit",0,0,0,28,0,0,225)
TNT1 A 0 A_SpawnItemEx("MPieBit",0,0,0,28,0,0,-225)
stop
}
}

actor MothersPie2 : MothersPie {speed 32
states
{
Spawn:
MPIE A 0
MPIE A 0 ThrustThingZ(0, 24, 0, 1)
goto Spawn2
}
}



actor MPieBit : BasicProjectile
{
+THRUACTORS
Radius 9
Height 9
damage (CallACS("vile_cbm_damage",20))
damagetype "MothersPieBit"
Obituary "$OB_MOTHERSPIE"
ReactionTime 90
speed 28
states
{
Spawn:
MPIE U 0
MPIE U 3 A_SpawnItemEx("MPieFX", -4, frandom(-7,7), frandom(-7,7), 0, 0, 0, 0, SXF_TRANSFERPITCH|SXF_WEPFXCOLOR)
MPIE U 0 A_ChangeFlag(THRUACTORS, false)
Spawn2:
MPIE VWU 3 A_SpawnItemEx("MPieFX", -4, frandom(-7,7), frandom(-7,7), 0, 0, 0, 0, SXF_TRANSFERPITCH|SXF_WEPFXCOLOR)
loop
}
}

actor MPieBitC : MPieBit
{
+THRUACTORS
states
{
Spawn:
MPIE U 0
MPIE U 3 A_SpawnItemEx("MPieFX", -4, frandom(-7,7), frandom(-7,7), 0, 0, 0, 0, SXF_TRANSFERPITCH|SXF_WEPFXCOLOR)
MPIE U 0 A_ChangeFlag("THRUACTORS", 0)
MPIE V 3 A_SpawnItemEx("MPieFX", -4, frandom(-7,7), frandom(-7,7), 0, 0, 0, 0, SXF_TRANSFERPITCH|SXF_WEPFXCOLOR)
MPIW W 0 A_SpawnItemEx("MPieFX", -4, frandom(-7,7), frandom(-7,7), 0, 0, 0, 0, SXF_TRANSFERPITCH|SXF_WEPFXCOLOR)
MPIE W 3 A_CountDown
Spaw2:
MPIE UVW 3 A_SpawnItemEx("MPieFX", -4, frandom(-7,7), frandom(-7,7), 0, 0, 0, 0, SXF_TRANSFERPITCH|SXF_WEPFXCOLOR)
MPIE W 0 A_CountDown
loop
}
}

actor MPieFX : BasicGraphicEffect
{
States
{
SpawnFrame:
MPIE XY 2
stop
}
}